text
stringlengths 28
935k
| meta
stringlengths 137
139
| red_pajama_subset
stringclasses 1
value |
---|---|---|
\section{Introduction}
\label{sec:intro}
\emph{Leaf powers} are a class of graphs that were introduced in 2002 by Nishimura, Ragde and Thilikos \cite{MR1874637}, extending the notion of graph powers. For a graph $G$, the $k$th power
graph $G^k$ has the same set of vertices as $G$ but a different notion of adjacency: two vertices are adjacent in $G^k$ if there is a path of at most $k$ edges between them in $G$. Determining whether a graph is a $k$th power of another graph is known to be NP-complete, for $k \geq 2$~\cite{nguyen2009hardness}. However deciding whether a graph $G$ is the second power of a graph $H$ is decidable in polynomial time when $H$ belongs to various graph classes such as bipartite graphs~\cite{lau2006bipartite}, block graphs~\cite{tuy2010square}, cactus graphs~\cite{golovach2016finding} and cactus block graphs~\cite{ducoffe2019finding}. Besides, it is possible to decide in linear time if a graph is the power of a tree~\cite{chang2015linear}. The leaf powers are defined in the same way from trees, but only including the leaves of the trees as vertices. The $k$th leaf power of a tree $T$ has the leaves of $T$ as its vertices,
with two vertices adjacent in the leaf power if there is a path of at most $k$ edges between them in $T$. A given graph $G$ is a $k$-leaf-power graph when there exists a tree $T$ for which $G$ is the $k$th leaf power. In this case, $T$ is a \emph{$k$-leaf root} of $G$. In general, the $k$-leaf root may have vertices and edges that are not part of the input graph. For example, \autoref{fig:3-leaf} shows a 3-leaf power alongside one of its 3-leaf roots. Nishimura et al., further, derived the first polynomial-time algorithms to recognize $k$-leaf powers for $k = 3$ and $k = 4$~\cite{MR1874637}.
One application of recognizing leaf powers arises as a formalization of a problem in computational biology, the reconstruction of evolutionary history and evolutionary trees from information about the similarity between species \cite{MR2001887,fitch1967construction}. In this problem, the common ancestry of different species can be represented by an evolutionary or phylogenetic tree, in which each vertex represents a species and each edge represents a direct ancestry relation between two species. We only have full access to living species, the species at the leaves of the tree; the other species in the tree are typically long-extinct, and may be represented physically only through fossils or not at all. If we suppose that we can infer, from observations of living species, which ones are close together (within some number $k$ of steps in this tree) and which others are not, then we could use an algorithm for leaf power recognition to infer a phylogenetic tree consistent with this data.
\begin{figure}[t]
\center
\includegraphics[scale=.33]{3-leaf.png}
\caption{A 3-leaf power graph $G$ and one of its 3-leaf roots $T.$ }
\label{fig:3-leaf}
\end{figure}
\subsection{New Results}
In this paper, presenting two different algorithms, we prove that the $k$-leaf powers of degeneracy $d$ can be recognized in time that is fixed-parameter tractable when parameterized by $k$ and $d$. Here, the degeneracy of a graph is the maximum, over its subgraphs, of the minimum degree of any subgraph.
Our first algorithm makes ample use of Courcelle's theorem~\cite{MR1217156} while the second employs a dynamic programming method to provide a time complexity with a better dependence on the parameters. Although the second algorithm is more efficient, we retain the description of the first algorithm as it was the source of our inspiration to devise a more practical method to prove the fixed-parameter tractability of $k$-leaf powers, and as we feel that our technique of using graph products
(which we use in both algorithms) can have broader applications.
Both algorithms have running time polynomial (in fact linear) in the size of the input graph, multiplied by a factor that depends non-polynomially on $k$ and $d$. We also apply the same methods to a more general problem in which each edge of the input graph is labeled by a range of distances, constraining the corresponding pair of leaves in the leaf root to have a distance in that range.
Later, it will be discussed that leaf powers have unbounded clique-width. However, it is known that the $k$-leaf powers have bounded clique-width when $k$ is bounded~\cite{gurski2007clique}.
A wide class of graph problems (those expressible in a version of monadic second order logic quantifying over only vertex sets, $\MSO_1$) can be solved in fixed-parameter time for graphs of bounded clique-width, via Courcelle's theorem. However we have been unable to express the recognition of leaf powers in $\MSO_1$. Instead, our algorithm uses a more powerful version of monadic second order logic allowing quantification over edge sets, $\MSO_2$. Later, it will be discussed that leaf powers with bounded degeneracy have bounded treewidth, allowing us to apply a form of Courcelle's theorem for $\MSO_2$ for graphs of bounded treewidth.
However, there is an additional complication that makes it tricky to apply these methods to leaf power recognition.
As stated earlier, the tree that we wish to find, for which our given input graph is a leaf power, will in general include vertices and edges that are not part of the input, but $\MSO_2$ can only quantify over subsets of the existing vertices and edges of a graph, not over sets of vertices and edges that are not subsets of the input. To work around this problem,
we apply Courcelle's theorem not to the given graph $G$ itself, but to a \emph{graph product} $G \boxtimes C_k$
where $C_k$ is a $k$-vertex cycle graph. We prove that a leaf root (the tree for which $G$ is a leaf power, if there is one) can be embedded as a subgraph of this product, that it can be recognized by an $\MSO_2$ formula applied to this product, and that this product has bounded treewidth whenever $G$ is a $k$-leaf power of bounded degeneracy.
In this way we can recognize $G$ as a leaf power, not by applying Courcelle's theorem to $G$, but by applying it to the graph product.
Thus, our algorithm combines the following ingredients:
\begin{itemize}
\item Our embedding of the $k$-leaf root as a subgraph of the graph product $G \boxtimes C_k$.
\item Our logical representation of $k$-leaf roots as subgraphs of graph products.
\item Courcelle's theorem, which provides general-purpose algorithms for testing $\MSO_2$ formulas on graphs of bounded treewidth.
\item The fact that leaf powers of bounded degeneracy also have bounded treewi-dth.
\item The fact that, by taking a product with a graph of bounded size, we preserve the bounded treewidth of the product.
\end{itemize}
Our algorithm runs in fixed-parameter tractable time when parameterized by $k$ and the degeneracy $d$ of the given input graph. In particular, it runs in linear-time when $k$ and $d$ are both constant.
Our results provide the first known efficient algorithms for recognizing $k$-leaf powers for $k \ge 7$, for graphs of bounded degeneracy.
More generally, our method of embedding into graph products appears likely to apply to other graph problems involving network design (the addition of edges to an existing graph, rather than the identification of a special subgraph of the input). In the case we apply this method to leaf power recognition, we expect that it should be possible to translate
our $\MSO_2$ formula over the graph product into a significantly more complicated $\MSO_2$ formula over the input graph, but the method of embedding into graph products considerably simplifies our task of designing a logical formula for our problem. Later, we also profit from the same embedding into a product as a key step in our dynamic programming algorithm to decide whether a graph is a $k$-leaf power.
\subsection{Related Work}
\begin{figure}[t]
\includegraphics[width=\linewidth]{whole2}\par
\caption{ A graph is a 4-leaf power if and only if it is chordal and does not contain any of the graphs above as a subgraph. }
\label{fig:forbidden}
\end{figure}
Polynomial-time algorithms are known for recognizing $k$-leaf powers for $k \leq 6$.
\begin{itemize}
\item A graph is a 2-leaf power if it is a disjoint union of cliques, so this class of graphs is trivial to recognize.
\item There exist various ways to characterize 3-leaf powers~\cite{MR1874637,MR2211095,dom2004error,MR2237730}, some of which lead to efficient algorithms. For instance, one way to determine if a graph is a 3-leaf power is to check whether it is bull-, dart- and gem-free and chordal~\cite{dom2004error}. The chordal graphs have a known recognition algorithm, and testing for the existence of any of the other forbidden induced subgraphs is polynomial, because they all have bounded size.
\item Similarly, there are various known ways to characterize 4-leaf powers~\cite{MR1874637,MR2237730,dom2005extending,MR2479182}. One is that a graph is a 4-leaf power if and only if it is chordal and does not contain any of the graphs depicted in \autoref{fig:forbidden} as induced subgraphs~\cite{MR2237730}. Again, this leads to a polynomial-time recognition algorithm, because all of these graphs have bounded size.
\item $k$-leaf powers can be recognized in polynomial time if the $(k-2)$- Steiner root problem can be solved in polynomial time. Chang and Ko, in 2007, provided a linear-time recognition algorithm for 3-Steiner root problem~\cite{chang20073}. This implies that 5-leaf powers can be recognized in linear time. Besides, Brandst{\"a}dt et al. provided a forbidden induced subgraph characterization for the distance-hereditary 5-leaf powers~\cite{MR2537378}.
\item Ducoffe has recently extended result of Chang and Ko~\cite{chang20073} and provided a polynomial-time recognition algorithm of 4-Steiner powers~\cite{ducoffe20194} which as stated, it leads to a polynomial-time recognition of 6-leaf powers.
\end{itemize}
Polynomial-time structural characterization of $k$-leaf powers for $k \geq 7$ is still an open problem.
Throughout the literature, there exist many structural characterizations of leaf powers which provide potentially useful insight into this class of graphs. It is known, for instance, that all leaf powers are strongly chordal, but the converse is not always true. Further, Kennedy et al. showed that strictly chordal graphs are always $k$-leaf powers for $k \geq 4$; these are the chordal graphs that are also, dart- and gem-free. They provided a linear-time algorithm to construct $k$-leaf roots of strictly chordal graphs \cite{MR2577678}.
For all $k \geq 2$, every $k$-leaf power is also a ($k+2$)-leaf power. A $(k+2)$-leaf root of any $k$-leaf-power can be obtained from its $k$-leaf root, by subdividing all edges incident to leaves. However, the problems of recognizing $k$-leaf powers for different values of $k$ do not collapse: for all $k \geq 4$, there exists a $k$-leaf power which is not a $(k+1)$-leaf power \cite{brandstadt2008k}.
\subsection{Organization}
This paper is organized as follows.
We begin in \autoref{sec:preliminaries} with some preliminary definitions and a survey of the relevant background material for our results.
In \autoref{sec:embedding} we describe how to embed leaf roots into graph products , a construction used in both of our algorithms.
We provide a logical formulation of the leaf power recognition problem in \autoref{sec:logic}, and in \autoref{sec:courcelle} we use this formulation for our first algorithm for the problem.
We generalize the problem to leaf powers with restricted distance ranges on each input graph edge in \autoref{sec:generalize}.
Our dynamic programming algorithm for leaf powers is presented in \autoref{sec:dynamic}.
We conclude with some general observations in \autoref{sec:conclusion}.
\section{Preliminaries}
\label{sec:preliminaries}
\subsection{Definitions}
Throughout this paper, we let $G(V,E)$ denote a simple undirected graph (typically, the input to the leaf power recognition problem). If $u$ and $v$ are two vertices in $V$ that are adjacent in $G$, we let $e(u,v)$ denote the edge connecting them.
\begin{figure}[t!]
\center
\includegraphics[scale=.35]{cross_w}
\caption{ The graph on the right is the strong product of a four-vertex path graph (top left) and a four-vertex cycle graph (bottom left). The colors indicate the partition of the edges into vertical, horizontal, and diagonal subsets.}
\label{cross}
\end{figure}
The strong product of graphs $G_1$ and $G_2$, denoted as $G_1 \boxtimes G_2$, is a graph whose vertices are ordered pairs of a vertex from $G_1$ and a vertex from $G_2$. In it, two distinct vertices $(u_1,u_2)$ and $(v_1,v_2)$ are adjacent if and only if for all $i \in \{1,2\}$, $u_i = v_i$ or $u_i$ and $v_i$ are adjacent in $G_i$. \autoref{cross} shows an example, the strong product of a four-vertex path graph with a four-vertex cycle graph. When we construct a strong product, we will classify the edges of the product into three subsets:
\begin{itemize}
\item We call an edge from $(u_1,u_2)$ to $(v_1,v_2)$ a \emph{vertical edge} if $u_2=v_2$.
The edges of this type form $|V(G_2)|$ disjoint copies of $G_1$ as subgraphs of the product.
\item We call an edge from $(u_1,u_2)$ to $(v_1,v_2)$ a \emph{horizontal edge} if $u_1=v_1$.
The edges of this type form $|V(G_1)|$ disjoint copies of $G_2$ as subgraphs of the product.
\item We call the remaining edges, for which $u_1\ne v_1$ and $u_2\ne v_2$, \emph{diagonal edges}. The subgraph composed of the diagonal edges forms a different kind of graph product,
the \emph{tensor product} $G_1\times G_2$.
\end{itemize}
We may think of these three edge sets as forming an (improper) edge coloring of the graph product.
In \autoref{cross} these edge sets are colored blue, red and green, respectively.
\subsection{Graph Parameters}
\label{subsec:parameters}
One of the simplest ways of parameterizing sparse graphs is by their \emph{degeneracy}. The degeneracy $d(G)$ of a graph $G$ is the smallest number such that every nonempty subgraph of $G$ contains at least one vertex of degree at most $d(G)$~\cite{lick1970k}. Degeneracy may be equivalently defined as the least $d$ for which an ordering of vertices of the graph exists in which each vertex has at most $d$ later neighbors in that ordering. There exists many problems in literature parameterized by the degeneracy as a measure of graph sparseness~\cite{eppstein2010listing,alon2009linear,cai2006random}, as it implies that every graph of size $n$ and degeneracy $d$ has at most $(n-1)d$ edges. Degeneracy may be computed in linear-time by a greedy algorithm that repeatedly removes the minimum-degree vertex and records the largest degree seen among the vertices at the time they are removed~\cite{MR709826}.
The notion of \emph{treewidth}, a more complicated graph sparsity parameter, was first introduced by Bertel\'e and Brioschi~\cite{BB72} and Halin~\cite{MR0444522} and later rediscovered by Robertson and Seymour \cite{MR855559}. One way to define treewidth is to use the concept of tree decomposition. A tree decomposition of graph $G$ consists of a tree $T$ where each vertex $X_i \in T$ (called a bag) is a subset of vertices of $G$.
This tree and its bags are required to satisfy the following properties:
\begin{itemize}
\item For each edge $e(u,v)$ in $G$, there exists a bag in $T$ containing both $u$ and $v$; and
\item For each vertex $v$ in $G$, the bags containing $v$ form a nonempty connected subtree of $T$.
\end{itemize}
The width of a tree decomposition is the size of its largest bag, minus one. The treewidth of a graph is defined as the minimum width achieved over all tree decompositions of the graph. Bounded treewidth graphs are especially interesting from an algorithmic point of view. Many well-known NP-complete problems have linear-time algorithms on graphs of bounded treewidth~\cite{MR1268488}.
Another related graph parameter, \emph{ clique-width}, was introduced by Courcelle et al.{} to characterize the structural complexity of graphs \cite{MR1217156}. The clique-width of a graph $G$ is the minimum number of labels necessary to construct $G$ by means of four graph operations: creation of a new vertex with a label, vertex disjoint union of labeled graphs, insertion of an edge between two vertices with specified labels and relabeling of vertices. Relevantly for us, Courcelle et al. showed that unit interval graphs are of unbounded clique-width. A graph is an interval graph if and only if all its vertices can be mapped into intervals on a straight line such that two vertices are adjacent when the corresponding intervals intersect each other. In the unit interval graphs, each interval has a unit length. As shown by Brandst{\"a}dt et al., unit interval graphs belong to the class of leaf powers, which implies that leaf powers also have unbounded clique-width \cite{brandstadt2008ptolemaic,MR2574841}.
These three properties are defined differently to each other, and may have significantly different values. For instance, the complete bipartite graph $K_{n,n}$ has clique-width two but treewidth and degeneracy $n$, and the $n\times n$ grid graph has degeneracy two but clique-width and treewidth $\Omega(n)$. Nevertheless, as stated earlier, all leaf powers are chordal graphs and it is known for a chordal graph, treewidth is equal to maximum clique number minus one~\cite{MR855559}. This implies that treewidth of leaf powers are equal to their degeneracy.
\subsection{Courcelle's Theorem}
By considering graphs as logical structures, their properties can be expressed in first-order and second-order logic. In first-order logic, graph properties are expressed as logical formulas wherein the variables range over vertices and the predicates include equality and adjacency relations. Second-order logic is an extension of first-order logic with the power to quantify over relations. Particularly, many natural graph properties can be described in monadic second-order logic, which is a restriction of second-order logic in which only unary relations (sets of vertices or edges) are allowed~\cite{MR1480957}.
There exist two variations of monadic second-order logic: $\MSO_1$ and $\MSO_2$. In $\MSO_1$, quantification is allowed only over sets of vertices, while $\MSO_2$ allows quantification over both sets of vertices and sets of edges. $\MSO_2$ is strictly more expressive; there are some properties, such as Hamiltonicity \cite{MR1451381}, which are expressible in $\MSO_2$ but not in $\MSO_1$. A graph property is \emph{$\MSO_2$-expressible} if there exists an $\MSO_2$ formula to express it, in which case the corresponding class of graphs becomes \emph{$\MSO_2$-definable}.
The algorithmic connection between treewidth and monadic second-order logic is given by Courcelle's theorem, according to which every property definable in monadic second-order logic can be tested in linear time on graphs of bounded treewidth \cite{MR1042649}. Later, Courcelle et al. extended this theorem to the class of graphs with bounded clique-width when the underlying property is $\MSO_1$-definable~\cite{MR1739644}. In our application of Courcelle's theorem, we will use an $\MSO_2$ formula with a free variable $\horizontal$, an edge set, which we will use to pass to the formula certain information about the structural decomposition of the graph it is operating on. This extension of Courcelle's theorem to formulas with a constant number of additional free variables, whose values are assigned through some extra-logical process prior to applying the theorem, is non-problematic and standard.
However, even in $\MSO_2$, it is only possible to quantify over subsets of vertices and edges that belong to the graph to which the logical formula is applied. Much of the difficulty of the leaf power problem rests in this restriction. If we could quantify over edges and vertices that were not already present,
we could construct a formula that asserts the existence of sets of vertices and edges forming a leaf root of a given graph, and then add clauses to the formula that ensure that the quantified sets describe a valid leaf root. However, we are not allowed such quantification, because in general the leaf root has vertices and edges that do not belong to our input graph. To apply Courcelle's theorem to leaf power recognition, we must instead find a way to express the property of being a leaf power using only quantification over subsets of vertices and edges of the graph to which we apply the theorem. For this reason, the problem of leaf power recognition forms an important test case for the ability to express graph problems in MSO logic.
A problem is \emph{fixed-parameter tractable} with respect to a parameter $x$ of the input if the problem can be solved in time $f(x)n^{O(1)}$ where $n$ is the size of the input, $f$ is a computable function of $x$ (independent of $n$), and the exponent of $n$ in the $O(1)$ term is independent of~$x$. Courcelle's theorem is the foundation of many fixed-parameter tractable algorithms \cite{bannister2014crossing,MR2120320,MR3761167,MR2220663}, as it proves that properties expressible in $\MSO_1$ or $\MSO_2$ are fixed-parameter tractable with respect to the clique-width or treewidth (respectively) of the input graph.
\section{Embedding Leaf Roots into Graph Products}
\label{sec:embedding}
In this section, we show that every $k$-leaf power has a $k$-leaf root that can be embedded in the graph product $G \boxtimes C_k$.
Let $G$ be a $k$-leaf power graph, and $T$ be a $k$-leaf root of $G$.
If $G$ is not connected, we can handle each of its connected components independently;
in this way, we can assume from now on, without loss of generality that $G$ is a connected graph with at least three vertices, and that $T$ is a leaf root chosen arbitrarily among the possible $k$-leaf roots of $T$. It follows from these assumptions that $T$ is a tree, because every edge in $G$ must be represented by a path in $T$. Because $T$ has at least three leaves, it has at least one interior node; we choose one of these nodes arbitrarily to be the root of $T$.
Additionally, every vertex or edge of $T$ participates in a path of length at most $k$ between two leaves, representing an edge of $G$. For, if some vertices and edge do not participate in these paths, removing all non-participating vertices and edges from $T$ would produce a smaller leaf root, without creating any new leaves. But this removal would disconnect pairs of leaves on the opposite sides of any removed edge, contradicting the assumption that $G$ is connected.
\begin{figure}[t!]
\center
\includegraphics[scale=.25]{4leafRep}
\caption{A 4-leaf power graph $G$ (left), and one of its leaf roots $T$ (right). Each leaf of $T$ is labeled by the vertex of $G$ that it represents, and each internal node of $T$ is labeled by its closest leaf node.
When there are ties at a node (as for instance at the root of $T$) the choice of label is made arbitrarily among the closest leaf nodes whose labels appear among the children of the node.}
\label{4_leaf_rep}
\end{figure}
As the first step of the embedding, we provide a subroutine that takes as input, a graph and a $k$-leaf root of the form, mentioned above and embeds it in $G \boxtimes C_k$ as a subgraph. While, our leaf-power recognition algorithm does not employ this subroutine, as it does not have access to the $k$-leaf root; this subroutine solely fulfills the purpose of proving that the $k$-leaf root of this form can be embedded in the graph product. For that, we label the vertices of $T$ with the names of vertices in $G$.
Each vertex of $T$ will get a label in this way; some labels will be used more than once.
In particular, we label each leaf of $T$ by the vertex of $G$ represented by that leaf.
Then, as shown in \autoref{4_leaf_rep}, we give each non-leaf node of $T$ the same label as its closest leaf. If there are two or more closest leaves, we choose one arbitrarily among the labels already applied to the children of the given interior node. In this way, when the same label appears more than once, the tree nodes having that label form a connected path in~$T$.
As we now show, these labels, together with the depths of the nodes modulo~$k$, can be used to embed the $k$-leaf root $T$ into the strong product $G\boxtimes C_k$,
where $C_k$ denotes a $k$-vertex cycle graph.
\begin{lemma}
\label{lem:leaf-root-embedding}
If $G$ is a connected $k$-leaf power graph on three or more vertices, and $T$ is any $k$-leaf root of $G$, then $T$
can be embedded as a subtree of the strong product $G \boxtimes C_k$.
Additionally, the embedding can be chosen in such a way that each horizontal cycle in the strong product (the product of a vertex $v$ of $G$ with $C_k$) contains exactly one leaf of the embedded copy of $T$, the leaf representing $v$.
\end{lemma}
\begin{figure}[t]
\center
\includegraphics[scale=.23]{embed}
\caption{ The graph on the bottom left is a 4-leaf root $T$ of graph $G$ (top left). $T$ can be embedded in the strong product $G \boxtimes C_4$ (right), by mapping each vertex $u$ of $T$ to the pair $(v,i)$ where $v$ is the label of $u$ and $i$ is the depth of $u$ (modulo~$k$).}
\label{embed}
\end{figure}
\begin{proof}
We map a vertex $u$ of $T$ to the pair $(v,i)$
where $v$ is the label assigned to $u$ (the name of a vertex in $G$)
and $i$ is the depth of $u$ (its distance from the root of $T$), taken modulo~$k$.
This pair is one of the vertices of the strong product, so we have mapped vertices of $T$ into vertices of the strong product. An example of such embedding can be seen in \autoref{embed}. Because $G$ is assumed to be connected, each node of $T$ participates in at least one path of length at most $k$ between two leaves of $T$, representing an adjacency of $G$; it follows that the label for each node of $T$ is at most $k-1$ steps away from the node, and that each path of same-labeled nodes in $T$ has length at most $k-1$. As a consequence, when we take depths modulo~$k$, none of these paths can wrap around the cycle and cover the same vertex of the graph product more than once. That is, our mapping from $T$ to $G \boxtimes C_k$ is one-to-one.
Because each leaf of $T$ is labeled with the vertex of $G$ that it represents, this mapping has the property described in the lemma, that each horizontal cycle in the strong product contains exactly one leaf of the embedded copy of $T$, the leaf representing the vertex whose product with $C_k$ forms that particular horizontal cycle.
We must also show that this mapping from $T$ to $G \boxtimes C_k$
maps each pair of vertices that are adjacent in $T$ into a pair of vertices that are adjacent in $G \boxtimes C_k$. Recall that adjacency in $G \boxtimes C_k$ is the conjunction of two conditions:
two vertices in the product are adjacent if their first coordinates are equal or adjacent in $G$ and their second coordinates are equal or adjacent in $C_k$.
Because every two adjacent vertices in $T$ have depths that differ by one,
the second coordinates of their images in the product will always be adjacent in $C_k$.
It remains to show that, when two vertices are adjacent in $T$, their images in the product have first coordinates that are equal or adjacent in $G$. That is, the labels of the two adjacent vertices in $T$ should be equal or adjacent.
Rephrasing what we still need to show, it is the following: whenever two adjacent vertices in $T$ have different labels, those labels represent adjacent vertices in $G$.
To see that this is true, consider two adjacent vertices $u_1$ and its parent $u_2$ in $T$,
labeled by two different vertices $v_1$ and $v_2$ in $G$.
As we already stated at the start of this section, the assumption of the lemma that $G$ is connected implies that edge $u_1u_2$ in $T$ participates in at least one path $P$ of length at most $k$ between two leaves, corresponding to an adjacency in $G$. But because $v_1$ and $v_2$ are represented by the closest leaves to $u_1$ and $u_2$ (respectively) the length of the path in $T$ between the leaves representing $v_1$ and $v_2$ must be at most equal to the length of $P$.
Therefore, there is a path of length at most $k$ between the leaves representing $v_1$ and $v_2$, so $v_1$ and $v_2$ are adjacent in the $k$-leaf power $G$, as required.
\end{proof}
Based on this embedding, we can prove the following characterization of leaf powers,
which we will use in our application of Courcelle's theorem to the problem. It is important, for this characterization, that we express everything intrinsically in terms of the properties of the graph product $G\boxtimes C_k$, its edge coloring, and its subgraphs, without reference to the given graph $G$.
\begin{lemma}
\label{lem:prop}
A given connected graph $G$ on three or more vertices is a $k$-leaf power if and only if the product $G\boxtimes C_k$
has a subgraph $T$ with the following properties:
\begin{enumerate}
\item\label{prop:forest}
$T$ is $1$-degenerate (i.e., a forest).
\item\label{prop:oneleaf}
Every vertex of $G\boxtimes C_k$ is connected by horizontal edges of the product
to exactly one leaf of $T$.
\item\label{prop:adjacent}
Two vertices of $G\boxtimes C_k$ are the endpoints of a non-horizontal edge of the product
if and only if the corresponding leaves of $T$ (given according to Property~\ref{prop:oneleaf})
are the distinct endpoints of a path of length at most $k$ in $T$.
\end{enumerate}
\end{lemma}
\begin{proof}
A subgraph obeying these properties is a forest (Property~\ref{prop:forest}), whose leaves can be placed into one-to-one correspondence with the vertices of~$G$ (Property~\ref{prop:oneleaf}, using the fact that the horizontal cycles of the product correspond one-to-one with vertices of $G$). It has a path of length at most $k$ between two leaves if and only if the corresponding vertices of~$G$ are adjacent (Property~\ref{prop:adjacent}).
So if it exists, it is a $k$-leaf root of $G$ and $G$ is a $k$-leaf power.
In the other direction, if $G$ is a connected $k$-leaf power, let $T$ be a $k$-leaf root of $G$. Then, according to \autoref{lem:leaf-root-embedding}, $T$ can be embedded as a subtree of $G\boxtimes C_k$ (Property~\ref{prop:forest}), with exactly one leaf for each horizontal cycle (Property~\ref{prop:oneleaf}), that forms a $k$-leaf root of $G$ (Property~\ref{prop:adjacent}).
So when $G$ is a $k$-leaf power, a subgraph $T$ obeying the properties of the lemma exists.\end{proof}
\section{Logical Expression}
\label{sec:logic}
In this section, we describe how to express the components of \autoref{lem:prop}, our characterization of the products $G\boxtimes C_k$ that contain a $k$-leaf root of $G$,
in monadic second-order logic. Our logical formula will involve a free variable $horizontal$,
the subset of edges of the given graph (assumed to be of the form $G\boxtimes C_k$) that are horizontal in the product (that is, edges that connect two copies of the same vertex in $G$).
We will also assume that $V$ and $E$ refer to the vertices and edges of the graph $G\boxtimes C_k$. In our logical formulas, we will express the type of each quantified variable (whether it is a vertex, edge, set of vertices, or set of edges) by annotating its quantifier with a membership or subset relation. For instance, ``$\forall x\in V:\dots$'' quantifies $x$ as a vertex variable.
We will express the incidence predicate between an edge $e$ and a vertex $v$ (true if $v$ is an endpoint of $e$, false otherwise) by $e\incident v$. Because our formulas will also use equality as a predicate, we will express the equality between names of formulas and their explicit logical formulation using a different symbol, $\equiv$.
In our formulas, predicates (equality, incidence, and adjacence) will be considered to bind more tightly than logical connectives, allowing us to omit parentheses in many cases.
A subgraph of the given graph may be represented by its set $S$ of edges. In this representation, adjacency between two vertices $a$ and $b$ may be expressed by the formula
\[
\adjacent(a,b,S)\equiv\exists e\in S: (e\incident a\wedge e\incident b).
\]
The following formula expresses the property that the neighbors of vertex $\ell$ in subgraph $S$ include at most one vertex from a set $X$:
\[
\leaf(\ell,X,S)\equiv
\forall c,d\in X:
\Bigl(\bigl(\adjacent(\ell,c,S)\wedge
\adjacent(\ell,d,S)\bigr)
\rightarrow c=d\Bigr).
\]
This allows us to express the acyclicity of a subgraph $S$ in terms of 1-degeneracy: every nonempty subset $X$ of vertices contains a leaf.
\[
\acyclic(S)\equiv
\forall X\subset V:
(\exists x\in X)\rightarrow\exists \ell\in X: \leaf(\ell,X,S).
\]
This already allows us to express the first condition of \autoref{lem:prop}.
We will also use a predicate for whether two vertices $p$ and $q$ are connected by horizontal edges. This is true if for every subset $C$ of vertices containing $p$ and excluding $q$, there exists a horizontal edge, connecting a vertex of $C$ to a vertex not in $C$.
\begin{multline*}
\alignedwith(p,q)\equiv
\forall C\subset V:
\bigl(p\in C\wedge\lnot(q\in C)\bigr)\rightarrow\\
\exists h\in \horizontal:\exists y,z\in V: \
\bigl(y\in C\wedge \lnot(z\in C)\wedge h\incident y\wedge h\incident z\bigr).
\end{multline*}
This allows us to express a predicate for the property that vertex $\ell$ is a leaf of subgraph $S$
on the same horizontal level as another vertex $v$ (that is, $\ell$ is the representative leaf for $v$'s level):
\[
\representative(v,\ell,S)\equiv
\leaf(\ell,V,S)\wedge\alignedwith(v,\ell).
\]
The second part of \autoref{lem:prop} is that every level has exactly one representative leaf:
\begin{multline*}
\represented(S)\equiv
\bigl(
\forall v\in V: \exists \ell\in V: \representative(v,\ell,S)
\bigr) \wedge\\
\Bigl(
\forall v,\ell_1,\ell_2\in V: \bigl(\representative(v,\ell_1,S)\wedge\representative(v,\ell_2,S)\bigr)\\
\rightarrow \ell_1=\ell_2
\Bigr)
\end{multline*}
{\sc{Unlike}} for the previous formulas, there is no way of expressing the existence of a path of length $k$ from $u$ to $v$ in subgraph $S$, for a non-fixed $k$, in $\MSO_2$. We need a different formula $\haspath_k$ for each $k$. We do not require these paths to be simple, as this would only complicate the formula without simplifying our use of it. However it is essential for our application
to the third condition of \autoref{lem:prop} that we require our paths to have distinct endpoints.
\begin{multline*}
\haspath_k(u,v,S)\equiv
\exists w_1,w_2,\dots w_{k-1}\in V:
\exists e_1,e_2,\dots e_k\in S:\\
\lnot(u=v)\wedge
e_1\incident u \wedge
e_1\incident w_1 \wedge
e_2\incident w_1 \wedge \dots \wedge
e_k\incident w_{k-1} \wedge
e_k\incident v.
\end{multline*}
Other than the inequality of the two endpoints, this formula allows repetitions of vertices and edges within each path. In particular, it allows $w_i$ and $w_{i+1}$ to be equal to each other, repeating one endpoint of an edge twice and omitting the other endpoint. Because we allow repetitions in this way, this formulation of the $\haspath$ predicate has the following convenient property:
\begin{lemma}
For all $k\ge 1$ and all $u$, $v$, and $S$, we have that
\[
\haspath_k(u,v,S)\rightarrow\haspath_{k+1}(u,v,S).
\]
\end{lemma}
\begin{proof}
Let $w_1,\dots w_{k-1}$ and $e_1,\dots e_k$ be the vertices and edges witnessing the truth of $\haspath_k(u,v,S)$, let $w_k=v$, and let $e_{k+1}=e_k$.
Then $w_1,\dots, w_k$ and $e_1,\dots, e_{k+1}$ witness the truth of $\haspath_{k+1}(u,v,S)$.
\end{proof}
\begin{corollary}
Two vertices $u$ and $v$ of a subgraph $S$ of a given graph obey the predicate $\haspath_k(u,v,S)$ if and only if they are distinct and their distance in $S$ is at most $k$.
\end{corollary}
This allows us to express the final part of \autoref{lem:prop}, the requirement that each two vertices are connected by a non-horizontal edge if and only if their representatives are connected by a short path:
\begin{multline*}
\isroot_k(S)\equiv
\forall u,v\in V:
\Bigl(
\bigl(\exists u', v' \in V \ \exists e\in E: \alignedwith(u,u') \wedge \\ \alignedwith(v,v') \wedge e\incident u'\wedge e\incident v'\wedge\lnot(e\in\horizontal)\bigr)
\longleftrightarrow \\
\exists x,y\in V:
\bigl(\representative(u,x,S)\wedge
\representative(v,y,S)\wedge \\
\haspath_k(x,y,S)\bigr)
\Bigr).
\end{multline*}
\begin{lemma}
\label{lem:formula}
There exists an $\MSO_2$ formula
that is modeled by a graph $G \boxtimes C_k$
and its set $\horizontal$ of horizontal edges
exactly when $G \boxtimes C_k$ meets the conditions of
\autoref{lem:prop}.
\end{lemma}
\begin{proof}
The formula is
\[
\exists S: \bigl(\acyclic(S)\wedge\represented(S)\wedge\isroot_k(S)\bigr).
\]
A subgraph defined by a set $S$ of its edges meets the first condition of the lemma if $\acyclic(S)$ is true, it meets the second condition of the lemma if $\represented(S)$ is true, and it meets the third condition of the lemma if $\isroot_k(S)$ is true.
\end{proof}
\begin{corollary}
\label{cor:mso}
The property of a graph $G$ being $k$-leaf power can be expressed as an $\MSO_2$
formula of $G\boxtimes C_k$ and of the set $\horizontal$ of horizontal edges of this graph product.
\end{corollary}
\section{Fixed-Parameter Tractability of Leaf Powers}
\label{sec:courcelle}
In this section, by using Courcelle's theorem, we provide our main result that recognizing $k$-leaf powers is fixed-parameter tractable when parameterized by $k$ and the degeneracy of the input graph.
In order to apply Courcelle's theorem to the graph product $G\boxtimes C_k$ we need to bound its treewidth.
\begin{lemma}
\label{lem:bounded-treewidth}
If $G$ has treewidth $t$ and H has a bounded number of vertices $s$ then $G \boxtimes H$ has treewidth at most $s(t+1)-1$.
\end{lemma}
\begin{proof}
Given any tree-decomposition of $G$ with width $t$, we can form a decomposition of $G\boxtimes H$ by using the same tree, and placing each vertex $(v,w)$ of $G\boxtimes H$ (where $v$ and $w$ are vertices of $G$ and $H$ respectively) into the same bag as vertex $v$ of $G$.
The size of the largest bag of the tree-decomposition of $G$ is $t+1$, so the size of the largest bag of the resulting tree-decomposition of the graph product is $s(t+1)$. The treewidth is one less than the size of the largest bag.
\end{proof}
\begin{corollary}
If $G$ has a bounded treewidth and $k$ is bounded, then $ G\boxtimes C_k$ also has bounded treewidth.
\label{cor:bounded_tw}
\end{corollary}
This gives us our main theorem:
\begin{theorem}
\label{thm:1}
For fixed constants $k$ and $d$, it is possible to recognize in linear time (with fixed-parameter tractable dependence on $k$ and $d$) whether a graph of degeneracy at most $d$ is a $k$-leaf power.
\end{theorem}
\begin{proof}
As stated earlier in \autoref{subsec:parameters}, leaf powers with bounded degeneracy have bounded treewidth and it follows from \autoref{cor:bounded_tw} that $G \boxtimes C_k$ also has bounded treewidth. Therefore, by applying Courcelle's theorem to the $\MSO_2$ formula of \autoref{cor:mso} we obtain the result.
\end{proof}
\section{Edges Labeled by Distance Ranges}
\label{sec:generalize}
It is perhaps of interest to generalize $k$-leaf powers to a more general version in which each edge of the input graph $G$ has a weight range $[k_1,k_2]$ where $2 \leq k_1 \leq k_2$ and $K$ is the upper bound on $k_2$ over all the edges. We say that $G$ is a \emph{labeled $K$-leaf power} if $G$ has a $K$-leaf root $T$ in which, for each edge $uv$ of $G$, the corresponding leaves of $T$ are at a distance that is within the range used to label edge $uv$. As with the unlabeled version of the problem, for non-adjacent pairs of vertices of $G$, the corresponding leaves should be at distance more than $K$. The original $k$-leaf power is a restricted variant of this general version in which all edges have a fixed weight range $[1,k]$ and $K = k$.
One motivation for this comes from the phylogenetic tree applications of $k$-leaf powers.
If we know some information about the evolutionary distance between species, and wish to reconstruct the evolutionary tree, the information we know may be more fine-grained than merely that the distance is big or small. The ranges on each edge allow us to model this fine-grained information and by doing so restrict the trees that can be generated to more accurately reflect the data. As we show in this section, our parameterized algorithms can be extended to the more general problem of recognizing labeled $K$-leaf powers.
Recall that we are already modeling some labeling information on the graph product $G_1 \boxtimes G_2$, in the logic of graphs, as the free set variable $\horizontal$.
We will similarly need to model the edge weight range labels logically.
To do so, we extend the weights on the edges of $G$ to the weights on the edges of a graph product using the following definition.
Suppose that we are considering the graph product $G_1 \boxtimes G_2$ where $G_1$ and $G_2$ are weighted and unweighted, respectively. Recall that, in this product, two distinct vertices $(u_1,u_2)$ and $(v_1,v_2)$ are adjacent if and only if for all $i \in \{1,2\}$, $u_i = v_i$ or $u_i$ and $v_i$ are adjacent in $G_i$. A vertical or diagonal edge is an edge with endpoints $(u_1,u_2)$ and $(v_1,v_2)$, for which $u_1\ne v_1$. In this case, we assign the vertical or diagonal edge weight $\omega$ if the edge connecting $u_1$ and $v_1$ has weight $\omega$, in $G_1$.
We have the following analogue of \autoref{lem:leaf-root-embedding} for the weighted case:
\begin{lemma}
\label{lem:general-leaf-root-embedding}
If $G$ is a weighted connected $K$-leaf power graph on three or more vertices, and $T$ is any $K$-leaf root of $G$, then $T$
can be embedded as a subtree of the strong product $G \boxtimes C_{K}$.
Additionally, the embedding can be chosen in such a way that each horizontal cycle in the strong product (the product of a vertex $v$ of $G$ with $C_{K}$) contains exactly one leaf of the embedded copy of $T$, the leaf representing $v$.
\end{lemma}
\begin{proof}
The weighted graph product has the same underlying graph as the unweighted product,
and the weighted $K$-leaf root is a special case of the unweighted $K$-leaf root,
so this follows immediately from \autoref{lem:leaf-root-embedding}, which provides an embedding into the graph power of every $K$-leaf root.
\end{proof}
We can now provide the following characterization of $K$-leaf powers.
\begin{lemma}
\label{lem:general-prop}
A given connected weighted graph $G$ on three or more vertices is a $K$-leaf power if and only if the product $G\boxtimes C_{K}$
has a subgraph $T$ with the following properties:
\begin{enumerate}
\item\label{general-prop:forest}
$T$ is $1$-degenerate (i.e., a forest).
\item\label{general-prop:oneleaf}
Every vertex of $G\boxtimes C_{K}$ is connected by horizontal edges of the product to exactly one leaf of $T$.
\item\label{general-prop:adjacent}
If two vertices of $G\boxtimes C_{K}$ are the endpoints of a non-horizontal edge of the product with weight $[k_1,k_2]$
then the corresponding leaves of $T$ (given according to Property~\ref{general-prop:oneleaf})
are the distinct endpoints of a path of length at least $k_1$ and at most $k_2$ in $T$.
\item\label{general-prop:nonadjacent}
If two distinct leaves of $T$ are at distance at most $K$ then there exists a non-horizontal edge of the product with two endpoints vertices, aligned to each leaf.
\end{enumerate}
\end{lemma}
\begin{proof}
The proof follows the same lines as the proof of \autoref{lem:prop}, modified only to take into account the edge weights.
\end{proof}
In order to express the components of \autoref{lem:general-prop} in monadic second-order logic, we reuse formulas \acyclic\ and \represented \ from \autoref{lem:prop} for the first and second parts of \autoref{lem:general-prop}, respectively.
To express the third part, we introduce $K^2$ edges sets $I_{k_1,k_2}$ where $2 \leq k_1 \leq k_2 \leq K$. An edge $e$ of the product, with two endpoints $(u_1,u_2)$ and $(v_1,v_2)$ belongs to $I_{k_1,k_2}$ if and only if $u_1 \ne u_2$, $v_1 \ne v_2$ and it has weight $[k_1,k_2]$. This allows us the express the requirement that if two vertices are connected by a non-horizontal edge with weight $[k_1,k_2]$ then their representatives are connected by a path with a length in the range $[k_1,k_2]$:
\begin{multline*}
\textsc{edge}_{k_1,k_2}(S)\equiv
\forall u,v\in V:
\Bigl(
\bigl(\exists e\in E: e\incident u\wedge e\incident v\wedge (e\in I_{k_1,k_2})\bigr) \\
\longrightarrow
\exists x,y\in V:
\bigl(\representative(u,x,S)\wedge
\representative(v,y,S)\wedge \\
\haspath_{k_2}(x,y,S) \wedge \neg \haspath_{k_1-1}(x,y,S) \bigr)
\Bigr).
\end{multline*}
The last part of \autoref{lem:general-prop} can be expressed as follows:
\begin{multline*}
\textsc{nonedge}_{K}(S)\equiv
\forall u,v\in V:
\Bigl( \bigl( \exists x,y \in V: \representative(u,x,S) \wedge \\ \representative(y,v,S)\wedge \haspath_{K}(x,y,S) \bigr) \longrightarrow \bigl(\exists u',v' \in V \ \exists e \in E: e\incident u' \\ \wedge e\incident v' \wedge \alignedwith(u,u') \wedge \alignedwith(v,v') \wedge \neg (e \in \horizontal)\bigr) \Bigr)
\end{multline*}
\begin{lemma}
\label{lem:general-formula}
There exists an $\MSO_2$ formula
that is modeled by a graph $G \boxtimes C_{K}$
and its set $\horizontal$ of horizontal edges and $K^2$ edge sets $I_{k_1,k_2}$
exactly when $G \boxtimes C_{K}$ meets the conditions of
\autoref{lem:general-prop}.
\end{lemma}
\begin{proof}
The formula is
\begin{multline*}
\exists S: \bigl(\acyclic(S)\wedge\represented(S)\wedge\textsc{edge}_{2,2}(S) \wedge \textsc{edge}_{2,3}(S) \wedge \dots \wedge \\ \textsc{edge}_{K,K}(S) \wedge \textsc{nonedge}_{K}(S)\bigr).
\end{multline*}
A subgraph defined by a set $S$ of its edges meets the first condition of the \autoref{lem:general-prop} if $\acyclic(S)$ is true, it meets the second condition of the lemma if $\represented(S)$ is true, it meets the third condition of the lemma if $\textsc{edge}_{k_1,k_2}(S)$ is true for all $2 \leq k_1 \leq k_2 \leq K$, and it meets the forth condition of the lemma if $\textsc{nonedge}(S)$ is true.
\end{proof}
\begin{corollary}
\label{cor:general-mso}
The property of a weighted graph $G$ being $K$-leaf power can be expressed as an $\MSO_2$
formula of $G\boxtimes C_{K}$, of the set $\horizontal$ of horizontal edges and of the $K^2$ edge sets $I_{k_1,k_2}$ of this graph product.
\end{corollary}
As proved in \autoref{lem:bounded-treewidth}, if $G$ has a bounded treewidth and $K$ is fixed, then $G \boxtimes C_{K}$ also has a bounded treewidth. This fact enables us to provide the following theorem for the general leaf power problem.
\begin{theorem}
For fixed constants $K$ and $d$, it is possible to recognize in linear time (with fixed-parameter tractable dependence on $K$ and $d$) whether a graph of degeneracy at most $d$ is a $K$-leaf power.
\end{theorem}
\begin{proof}
The proof follows the same outline as the proof of \autoref{thm:1}, modified only to use the weighted versions of the lemmas above in place of their unweighted versions.
\end{proof}
\section{Dynamic Programming Algorithm}
\label{sec:dynamic}
Many graph problems, including a vast number of NP-hard problems, have been shown to be solvable in polynomial time when given a tree decomposition of constant width~\cite{MR1105479,bodlaender1988dynamic,MR1268488}.
Dynamic programming on tree decomposition of graphs is an underlying technique to devise such algorithms, restricted to graphs of bounded treewidth~\cite{bodlaender1988dynamic}. Indeed, our application of Courcelle's theorem relies on such an algorithm to evaluate whether a logical formula is modeled by the given graph. In this section, we present a direct dynamic programming algorithm to decide whether the input graph is a $k$-leaf power.
Dynamic programming algorithms often use a variant of tree decomposition, called \textit{nice} tree decomposition. A nice tree decomposition of graph $G$ is a rooted tree decomposition $T$ of $G$ in which each bag $X_i$ is one of the following:
\begin{itemize}
\item a \textit{leaf} bag in which $|X_i|$ = 1,
\item a \textit{forget} bag with one child $X_j$, where $X_i \subset X_j$ and $|X_j| - |X_i| = 1$,
\item an \textit{introduce} bag with one child $X_j$, where $X_j \subset X_i$ and $|X_i| - |X_j| = 1$, or
\item a \textit{join} bag with two children $X_j$ and $X_{j'}$, where $X_i = X_j = X_{j'}$,
\end{itemize}
For a forget bag we call $X_j \setminus X_i$ the \textit{forgotten vertex}. Given a graph $G$ and its tree decomposition of width $w$, one can construct a nice tree decomposition of equal width in linear time~\cite{kloks1994treewidth}.
Our algorithm uses these restrictions on tree decompositions, but we need others as well.
Therefore, we will define an \textit{extra} nice tree decomposition.
In comparison with nice tree decomposition, an extra nice tree decomposition has one more type of bag, an \textit{edge-associated} bag. An edge-associated bag $X_i$ has a child $X_j$ where $X_i = X_j$ and exactly one edge $e(u,v)$, $u,v \in X_i$, is associated with $X_i$. Using a nice tree decomposition of $G$, we can simply construct such tree decomposition in the following way: for each pair of adjacent pairs $u$ and $v$ in bag $X_i$, if $e(u,v)$ is not yet associated to a bag, create a new bag $X_{i'}$ as a new parent of $X_i$ where $X_{i'} = X_i$ and associate edge $e(u,v)$ to $X_{i'}$. The old parent of $X_i$, if it exists, is now the parent of $X_{i'}$.
Our algorithm is run over a \textit{mixed} decomposition of graphs $G$ and graph product $H$. Given an extra nice decomposition of $G$ of width $w$, for each vertex $v$ in bag $X_i$, add all vertices $(v,r) \in H$ for $ 0 \leq r < k$. Hence, the size of each bag of the mixed decomposition is at most $wk$. Our second algorithm can therefore be viewed as using the same graph product technique that our first algorithm used, applied directly in a dynamic programming algorithm rather than indirectly via Courcelle's theorem.
\subsection{Local Picture of a $\pmb k$-leaf root}
Intuitively, for each bag of mixed decomposition $M$, we describe, a local picture which describes a subtree of a $k$-leaf root $T$, if one exists. This description allows us to check whether the big picture, $T$, is a $k$-leaf root of $G$. For a bag $X_i$ let $G_i$ and $H_i$ be a set of vertices of $X_i$ that belongs to $G$ and $H$, respectively.
A local picture of $T$ at bag $X_i$ consists of the following ingredients:
\begin {itemize}
\item A partition of $H_i$ into connected components (with one more partition set for vertices of $H_i$, not participating in $T$).
\item A distance matrix between each pair of vertices in the same component. Each coefficient of the matrix will store either a number between 1 and $k$ (the distance between two vertices), or a special flag $\infty$ to represent a finite distance greater than $k$.
\item A designated root vertex for each component, the vertex that will become the closest to the root of $T$.
\item For each vertex $v$ of $G_i$ in $X_i$, a corresponding vertex $(v,i)$ chosen as the leaf representative of $v$ in $H_i$.
\end{itemize}
To reduce the number of local pictures that we need to consider,
consistently with the embedding of \autoref{sec:embedding},
we will restrict our attention to local pictures in which the vertices $(v,i)$ of $H_i$ associated with a single vertex $v$ of $H_i$ are either part of a single component or not in any component,
and have distances within that component consistent with their distances along the cycle $C_k$.
We will associate with each remaining local picture a Boolean variable. We will set this variable to True if there is a subtree of $H$ within the bags descending from $X_i$ that is consistent with the local picture
and with the requirement that it be part of a leaf root of $G$. Otherwise, we set this variable to False.
In order to enforce the requirement that the local picture be consistent with being part of a leaf root, we only consider local pictures such that, for the distances in
each component, the pairs of representative vertices at distance at
most $k$ are adjacent in $G$ and pairs with distance $\infty$ are non-adjacent.
Adjacent vertices in $G_i$ whose representatives belong to different components are allowed, however, as their distance will be checked at a higher level of the tree decomposition where their components merge. If these conditions are not met, we set the associated Boolean variable of the local picture to False.
We process $M$ in post-order from leaves to the root of $M$ computing for each bag and each local picture the Boolean variable for that local picture. This bottom-up ordering ensures that the variables for local pictures of the child or children of a bag are known before we try to compute the variables at the bag itself. After computing these values, $G$ will be a $k$-leaf power if and only if there exists a local picture at the root bag whose associated Boolean variable is true. If $G$ is a $k$-leaf power, one can form a $k$-leaf root by creating a vertex as the root of the $k$-leaf root and connect it to the root of each component of the True local picture, with an appropriate number of edges (at most k edges for each connection). Further, such ordering allows us to remember the distance to the nearest forgotten leaf as $\mu_v$ for each non-leaf vertex $v$ of each local picture for distance-checking purposing. In another word, $\mu_v$ stores the distance from $v$ to the nearest forgotten leaf that is no more present in the current local picture. When the bottom-up traversal of $M$ reaches a bag $X_i$, one of the following cases occurs:
\begin{itemize}
\item $X_i$ may be a leaf of $M$. In this case, it contains a vertex $v \in G$ alongside all vertices $(v,r)$, $ 0 \leq r < k$. A local picture is set to True if and only if it has one component, a single chain of vertices with the appropriate distances, ending at the vertex designated as the representative of $v$.
\item $X_i$ may be a forget bag. In this case, it has one child $X_j$ where $X_i \subset X_j$ and $H_j \wedge (X_j \backslash X_i) = \{(v,r)\}, 0 \leq r < k$. A local picture $\ell$ at $X_i$ is set to True if and only if it is formed by removing vertices $(v,r)$ (a chain of vertices representing $v \in G_j$) from a True local picture $\ell'$ of $X_j$.The removal of such chain of vertices may result in more number of components in the corresponding True local picture $\ell$. If a removed vertex has a child other than the one in the chain, that child becomes the root of a new component in $\ell$. Further, as the designated leaf of such chain is forgotten, there might be a need to update $\mu_u$ for a vertex $u$ in $\ell$ within the vicinity ($<k$) of the forgotten leaf.
\item $X_i$ may be an introduce bag. In this case, it has one child $X_j$ where $X_j \subset X_i$ and $G_i \wedge (X_i \backslash X_j) = \{v\}$. A local picture at $X_i$ is set to True if and only if it can be formed from one of the True local pictures of $X_j$ by adding one more component which is a path $(v,r), \dots , (v,r')$, $ 0 \leq r,r' < k$. Because the subtree descending from $X_i$ does not contain any edge-associated bags for edges incident with $v$, this component cannot be connected to any of the existing components in the local picture in $X_j$.
\item $X_i$ may be an edge-associated bag. In this case, it has one child $X_j$ where $X_i = X_j$ and there exists an edge $e(u,v)$ associated to bag $X_i$. A local picture $L$ at $X_i$ is set True if and only if either there exists an exact True copy of the local picture at $X_j$, or using the edge $e(u,v)$, $L$ can be formed from a True local picture at $X_j$ by connecting a root $x$ of one component to a vertex $w$ of another component. Such connection can be made if the resulting local picture obeys the distance matrix and also the distance from each forgotten leaf of one component to a (forgotten or existing) leaf of another component is greater than $k$ as their corresponding vertices in $G$ cannot be adjacent given the definition of extra nice decomposition (when a vertex is forgotten, it cannot be reintroduced as the bags containing that vertex form a nonempty connected subtree).
\item $X_i$ may be a join bag. In this case, it has two children $X_j$ and $X_{j'}$ where $X_i= X_j = X_{j'}$. A local picture $L_1$ at $X_i$ has its value set to True if and only if there exist True local pictures $L_2$ and $L'_2$ at $X_j$ and $X_{j'}$, respectively, that when combined together, they form $L_1$. To find such a combination, we consider all pairs of local pictures for $L_2$ and $L'_2$ at $X_j$ and $X_{j'}$ and construct a bipartite graph $F$. One side of bipartition includes vertices of $H_i \in X_i$, each with two neighbors, representing the two subtrees, the vertex belongs to in the local pictures $L_2$ and $L'_2$. $L_1$ can be formed if and only if $F$ is a forest, its subtrees are subtrees of $F$ and the combined local picture obeys the distance matrix at $L_1$ and no forgotten or existing leaf of $L_2$ get a distance at most $k$ to a forgotten leaf of $L_2'$ or vice versa.
\end{itemize}
\subsection{Analysis}
To analyze our dynamic programming algorithm, we need to understand the number of local pictures that are possible in each bag of the tree decomposition. We can perform this analysis by combining the following factors, each of which depends only on the width $w$ and leaf power parameter $k$ of the given input.
\begin{itemize}
\item For each vertex $v$ of $G_i$, there are $O(k^2)$ choices for the representative vertex and the length of the path using vertices $(v,i)$ in the component of this representative vertex. The total number of such choices for all vertices of $G_i$ is $k^{O(w)}$.
\item Given these choices of paths, there are $w^{O(w)}$ ways of connecting the paths into components and selecting the vertex closest to the root within each component.
\item Within a component that connects $c$ paths, there are $(ck)^{O(w)}$ choices of distance matrix for the whole component consistent with the distances within each path and with the assumption that the distances come from a tree.
\end{itemize}
Therefore, there are $(wk)^{O(w)}$ local pictures considered by our algorithm for each bag.
The time for the algorithm is dominated by the join bags; there are $n-1$ of these bags, and in each such bag we consider a number of pairs of local pictures bounded by the square of the number of local pictures per bag. Each pair of local pictures in the two child bags takes time polynomial in $w$ and $k$ to check for whether it is consistent and to find the corresponding local picture in the join bag. So the total time for our dynamic programming algorithm is $O\bigl(n(wk)^{O(w)}\bigr)$.
\section{Conclusion}
\label{sec:conclusion}
We have provided two fixed-parameter algorithms to recognize $k$-leaf powers (and generalized $K$-leaf powers) for graphs of bounded degeneracy. In both methods we use embeding of a $k$-leaf root of a $k$-leaf power graph in the graph product of the input graph and a $k$-vertex cycle $C_k$. Our first algorithm finds a logical characterization of the leaf roots that are embedded in this way, and applies Courcelle's theorem to determine the existence of a subgraph of the graph product that meets our characterization.
Our methods of using low-treewidth supergraphs to represent vertices and edges that are not part of the input graph, and of using graph products to find these supergraphs helped us to solve the problem directly using dynamic programming rather than by applying Courcelle's theorem. Additionally, these methods may be useful in other graph problems. For instance, the same graph product technique would have greatly simplified the application of Courcelle's theorem in our recent work on planar split thickness~\cite{MR3761167}: a graph $G$ has planar split thickness $k$ if and only if $G\boxtimes K_k$ has a planar subgraph $S$ such that, for each non-horizontal edge of the product, the endpoints of the edge are aligned with the endpoints of an edge in $S$. In reducing the logical complexity of problems such as these, our first method also makes it more likely that faster model checkers for restricted
fragments of MSO logic \cite{bannach_et_al:LIPIcs:2018:9469} can be applied to our problem.
Our dynamic programming algorithm has significantly better dependence on its parameters than
our first, logic-based algorithm. However, its dependence is still not singly exponential.
We leave whether this is possible as open for future research.
| {'timestamp': '2020-06-02T02:24:09', 'yymm': '1810', 'arxiv_id': '1810.02452', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02452'} | arxiv |
\section{Introduction}
Deep generative models reached a turning point after generative adversarial networks (GANs) were proposed by \cite{14GAN}. GANs are capable of modeling data with complex structures. For example, DCGAN can sample realistic images using a convolutional neural network (CNN) structure\citep{DCGAN}. GANs have been implemented in many applications in the field of computer vision with good results, such as super-resolution, image translation, and text-to-image generation\citep{DBLP:conf/cvpr/LedigTHCCAATTWS17, DBLP:conf/cvpr/IsolaZZE17, DBLP:conf/iccv/ZhangXL17, DBLP:conf/icml/ReedAYLSL16}.
However, despite these successes, GANs are affected by training instability and mode collapse problems. GANs often fail to converge, which can result in unrealistic fake samples. Furthermore, even if GANs successfully synthesize realistic data, the fake samples exhibit little variability. This problem is due to Jensen--Shannon divergence and the low dimensionality of the data manifold.
A common solution to this problem is injecting an instance noise and finding different divergences. The injection of instance noise into real and fake samples during the training procedure was proposed by \cite{SonNoise}, where its positive impact on the low dimensional support for the data distribution was shown to be a regularizing factor based on the Wasserstein distance, as demonstrated analytically by \cite{DBLP:journals/corr/ArjovskyB17}. In $f$-GAN, $f$-divergence between the target and generator distributions was suggested which generalizes the divergence between two distributions\citep{FGAN}. In addition, a gradient penalty term which is related with Sobolev IPM(Integral Probability Metric) between data distribution and sample distribution was suggested by \cite{SOBOLEVGAN}.
The Wasserstein GAN (WGAN) is known to resolve the problems of generic GANs by selecting the Wasserstein distance as the divergence\citep{WGAN}. However, WGAN often fails with simple examples because the Lipschitz constraint on discriminator is rarely achieved during the optimization process and weight clipping. Thus, mimicking the Lipschitz constraint on the discriminator by using a gradient penalty was proposed by \cite{WGANGP}.
Noise injection and regularizing with a gradient penalty appear to be equivalent. The addition of instance noise in $f$-GAN can be approximated to adding a zero centered gradient penalty\citep{ROTH}. Thus, regularizing GAN with a simple gradient penalty term was suggested by \cite{18Mescheder} who provided a proof of its stability.
Based on a theoretical analysis of the convergence, \cite{STABILITY_GAN} proved the local exponential stability of the gradient-based optimization dynamics in GANs by treating the simultaneous gradient descent algorithm with a dynamic system approach. These previous studies were useful because they showed that the local behavior of GANs can be explained using dynamic system tools and the related Jacobian's eigenvalues. An alternative gradient descent algorithm and the optimal step size for discrete updating were also studied by \cite{18Mescheder}.
In this study, we aim to prove the convergence property of the simple gradient penalty $\mu$-Wasserstein GAN(SGP $\mu$-WGAN) dynamic system under general gradient penalty measures $\mu$. To the best of our knowledge, our study is the first theoretical approach to GAN stability analysis which deals with abstract singular penalty measure. In addition, measure valued differentiation\citep{Heidergott2008} is applied to take the derivative on the integral with a parametric measure, which is helpful for handling an abstract measure and its integral in our proof.
The main contributions of this study are as follows.
\begin{itemize}
\item We prove the regularized effect and local stability of the dynamic system for a general penalty measure under suitable assumptions. The assumptions are written as both a tractable strong version and intractable weak version. To prove the main theorem, we also introduce the measure valued differentiation concept to handle the parametric measure.
\item Based on the proof of the stability, we explain the reason for the success of previous penalty measures. We claim that the support of a penalty measure will be strongly related to the stability, where the weight on the limiting penalty measure might affect the speed of convergence.
\item We experimentally examined the general convergence results by applying two test penalty measures to several examples. The proposed test measures are unintuitive but they still satisfy the assumptions and similar convergence results were obtained in the experiment.
\end{itemize}
\section{Preliminaries}
First, we introduce our notations and basic measure-theoretic concepts. Second, we define our SGP $\mu$-WGAN optimization problem and treat this problem as a continuous dynamic system. Preliminary measure theoretic concepts are required to justify that the dynamic system changes in a sufficiently smooth manner as the parameter changes, so it is possible to use linearization theorem. They are also important for dealing with the parametric measure and its derivative. The problem setting with a simple gradient term is also discussed. The squared gradient size and simple gradient penalty term are used to build a differentiable dynamic system and to apply soft regularization as a resolving constraint, respectively. The continuous dynamic system approach, which is a so-called ODE method, is used to analyze the GAN optimization problem with the simultaneous gradient descent algorithm, as described by \cite{STABILITY_GAN}.
\subsection{Notations and Preliminaries Regarding Measure Theory}
$D(x;\psi) : \mathcal{X}\rightarrow\mathbb{R}$ is a discriminator function with its parameter $\psi$ and $G(z;\theta) : \mathcal{Z}\rightarrow\mathcal{X}$ is a generator function with its parameter $\theta$. $p_d$ is the distribution of real data and $p_g=p_\theta$ is the distribution of the generated samples in $\mathcal{X}$, which is induced from the generator function $G(z;\theta)$ and a known initial distribution $p_{latent}(z)$ in the latent space $\mathcal{Z}$. $\norm{\cdot}$ denotes the $L^2$ Euclidean norm if no special subscript is present.
The concept of weak convergence for finite measures is used to ensure the continuity of the integral term over the measure in the dynamic system, which must be checked before applying the theorems related to stability. Throughout this study, we assume that the measures in the sample space are all finite and bounded.
\begin{definition}
For a set of finite measures $\{\mu_i\}_{i\in\mathcal{I}}$ in the metric space $(\mathcal{X},d)$ with metric $d$ and Borel $\sigma$-algebra $\mathcal{B}(\mathcal{X})$, $\{\mu_i\}_{i\in\mathcal{I}}$ is referred to as bounded if there exists some $M>0$ such that for all $i \in \mathcal{I}$,
$$\mu_i(\mathcal{X}) \leq M$$
\end{definition}
For instance, $M$ can be set as 1 if $\{\mu_i\}$ are probability measures on $\mathbb{R}^n$. Assuming that the penalty measures are bounded, Portmanteau theorem offers the equivalent definition of the weak convergence for finite measures. This definition is important for ensuring that the integrals over $p_\theta$ and $\mu$ in the dynamic system change continuously.
\begin{definition}(Portmanteau Theorem)
For a bounded sequence of finite measures $\{\mu_n\}_{n\in\mathbb{N}}$ on the Euclidean space $\mathbb{R}^n$ with a $\sigma$-field of Borel subsets $\mathcal{B}(\mathbb{R}^n)$, $\mu_n$ converges weakly to $\mu$ if and only if for every continuous bounded function $\phi$ on $\mathbb{R}^n$, its integrals with respect to $\mu_n$ converge to $\int \phi d\mu$, i.e.,
$$\mu_n\rightarrow\mu \Longleftrightarrow \int \phi d\mu_n \rightarrow \int\phi d\mu$$
\end{definition}
The most challenging problem in our analysis with the general penalty measure is taking the derivative of the integral, where the measure depends on the variable that we want to differentiate. If our penalty measure is either absolutely continuous or discrete, then it is easy to deal with the integral. However, in the case of singular penalty measure, dealing with the integral term is not an easy task. Therefore, we introduce the concept of a weak derivative of a probability measure in the following\citep{Heidergott2008}. The weak derivative of a measure is useful for handling a parametric measure that is not absolutely continuous with low dimensional support.
\begin{definition}(Weak Derivatives of a Probability Measure)
Consider the Euclidean space and its $\sigma$-field of Borel subsets $(\mathbb{R}^d,\mathcal{B}(\mathbb{R}^d))$. The probability measure $P_\theta$ is called weakly differentiable at $\theta$ if a signed finite measure $P'_\theta$ exists where
$$\frac{d}{d\theta}\int \phi(x)dP_\theta = \lim_{\Delta \rightarrow 0}\frac{1}{\Delta}\{\int \phi(x)dP_{\theta+\Delta} - \int \phi(x)dP_{\theta}\} = \int \phi(x)dP'_{\theta}$$
is satisfied for every continuous bounded function $\phi$ on $\mathbb{R}^n$. For the multidimensional parameter $\theta$, this can be defined similar manner.
\end{definition}
We can show that the positive part and negative part of $P'_\theta$ have the same mass by putting $\phi(x)=1$ and the Hahn--Jordan decomposition on $P'_\theta$. Therefore, the following triple $(c_\theta, P^+_\theta, P^-_\theta)$ is called a weak derivative of $P_\theta$, where $P^\pm_\theta$ are probability measures and $P'_\theta$ is rewritten as:
$$P'_\theta = c_\theta P^+_\theta - c_\theta P^-_\theta$$
Therefore,
$$\frac{d}{d\theta}\int \phi(x)dP_\theta = \int \phi(x)dP'_{\theta} = c_\theta(\int \phi(x)dP^+_\theta - \int\phi(x)dP^-_\theta)$$
holds for every continuous bounded function $\phi$ on $\mathbb{R}^n$. It is known that the representation of $(c_\theta ,P^+_\theta,P^-_\theta)$ for $P'_\theta$ is not unique because $(c_\theta + C_\theta,P^+_\theta + q_\theta,P^-_\theta + q_\theta)$ is also another representation of $P'_\theta$.\\
For the general finite measure $Q_\theta$, a normalizing coefficient $M(\theta)<\infty$ can be introduced. The product rule for differentiating can also be applied in a similar manner to calculus.
$$\frac{d}{d\theta}\int \phi(x;\theta)dP_\theta = \int \nabla_\theta \phi(x;\theta)dP_\theta + \int \phi(x;\theta)dP'_\theta$$
Therefore, for the general finite measure $Q_\theta = M(\theta)P_\theta$, its derivative $Q'_\theta$ can be represented as below.
$$Q'_\theta = M'(\theta)P_\theta + M(\theta)P'_\theta = M'(\theta)P_\theta + c_\theta M(\theta)P^+_\theta - c_\theta M(\theta)P^-_\theta$$
\subsection{Problem Setting as a Dynamic System}
Previous work of \cite{18Mescheder} showed that the dynamic system of WGAN-GP is not necessarily stable at equilibrium by demonstrating that the sequence of parameters is not Cauchy sequence. This is mainly due to the term $\norm{x}$ in the dynamic system which has a derivative $\frac{x}{\norm{x}}$ that is not defined at $x=0$. WGAN-GP has a penalty term $\mathbb{E}_{\mu_{GP}}[(\norm{\nabla_x D(x;\psi)}-1)^2]$ that can lead to a discontinuity in its dynamic system.
These problems can be avoided by using the squared value of the gradient's norm $\norm{\nabla_x D}^2$, which is a differentiable function. In contrast to the WGAN-GP, recent methods based on a gradient penalty such as the simple gradient penalty employed by \cite{18Mescheder} and the Sobolev GAN used the average of the squared values for the penalty area, whereas the WGAN-GP penalizes the size of the discriminator's gradient $\norm{\nabla_x D}$ away from 1 in a pointwise manner.
This advantage of squared gradient term\footnote{In this study, we prefer to use the expectation notation on the finite measure, which can be understood as follows. Suppose that $\mu_{\psi,\theta} = M(\psi,\theta)\bar{\mu}_{\psi,\theta}$ where $\bar{\mu}_{\psi,\theta}$ is normalized to the probability measure. Then, $\mathbb{E}_{\mu_{\psi,\theta}}[\norm{\nabla_x D}^2] = \mathbb{E}_{\bar{\mu}_{\psi,\theta}}[M(\psi,\theta)\norm{\nabla_x D}^2] = \int \norm{\nabla_x D}^2M(\psi,\theta)d\bar{\mu}_{\psi,\theta}(x) = \int \norm{\nabla_x D}^2d\mu_{\psi,\theta}(x)$}, $\mathbb{E}_\mu[\norm{\nabla_x D}^2]$, makes the dynamic system differentiable and we define the WGAN problem with the square of the gradient's norm as a simple gradient penalty. This simple gradient penalty can be treated as soft regularization based on the size of the discriminator's gradient, especially in case where $\mu$ is the probability measure \citep{ROTH}. It is convenient to determine whether the system is stable by observing the spectrum of the Jacobian matrix. In the following, $(D(x;\psi),p_d,p_\theta,\mu)$ is defined as an SGP $\mu$-WGAN optimization problem (SGP-form) with a simple gradient penalty term on the penalty measure $\mu$.
\begin{definition}
The WGAN optimization problem with a simple gradient penalty term $\norm{\nabla_x D}^2$, penalty measure $\mu$, and penalty weight hyperparameter $\rho>0$ is given as follows, where the penalty term is only introduced to update the discriminator.
\begin{align*}
\max_\psi &: \mathbb{E}_{p_d}[D(x;\psi)] - \mathbb{E}_{p_\theta}[D(x;\psi)] - \frac{\rho}{2}\mathbb{E}_\mu[\norm{\nabla_x D(x;\psi)}^2] \\
\min_\theta &: \mathbb{E}_{p_d}[D(x;\psi)] - \mathbb{E}_{p_\theta}[D(x;\psi)]
\end{align*}
\end{definition}
According to \cite{STABILITY_GAN} and many other optimization problem studies, the simultaneous gradient descent algorithm for GAN updating can be viewed as an autonomous dynamic system of discriminator parameters and generator parameters, which we denote as $\psi$ and $\theta$. As a result, the related dynamic system is given as follows.
\begin{align*}
\dot{\psi} &= \mathbb{E}_{p_d}[\nabla_\psi D] - \mathbb{E}_{p_\theta}[\nabla_\psi D] - \frac{\rho}{2}\nabla_\psi\mathbb{E}_\mu[\nabla_x^T D\nabla_x D] \\
\dot{\theta} &= \nabla_\theta\mathbb{E}_{p_\theta}[D]
\end{align*}
\section{Toy Examples}
We investigate two examples considered in previous studies by \cite{18Mescheder} and \cite{STABILITY_GAN}. We then generalize the results to a finite measure case. The first example is the univariate Dirac GAN, which was introduced by \cite{18Mescheder}.
\begin{definition}(Dirac GAN)
The Dirac GAN comprises a linear discriminator $D(x;\psi)=\psi x$, data distribution $p_d=\delta_0$, and sample distribution $p_\theta=\delta_\theta$.
\end{definition}
The Dirac-GAN with a gradient penalty with an arbitrary probability measure is known to be globally convergent\citep{18Mescheder}. We argue that this result can be generalized to a finite penalty measure case.
\begin{lemma} \label{lemma:diracgeneralGAN}
Consider the Dirac GAN problem with SGP form $(D(x;\psi)=\psi x, \delta_0, \delta_\theta, \mu_{\psi,\theta})$. Suppose that some small $\eta > 0$ exists such that its finite penalty measure $\mu_{\psi,\theta}$ with mass $M(\psi,\theta) = \int 1d\mu_{\psi,\theta} \geq 0$ satisfies either
\begin{itemize}
\item $M(\psi,\theta)>0$ for $(\psi,\theta) \in B_\eta((0,0))$ or
\item $M(0,0)=0$ and $\psi \nabla_\psi M(\psi,\theta) \geq 0$ for $(\psi,\theta) \in B_\eta((0,0))$.
\end{itemize}
Then, the SGP $\mu$-WGAN optimization dynamics with $(D(x;\psi)=\psi x, \delta_0, \delta_\theta, \mu_{\psi,\theta})$ are locally stable at the origin and the basin of attraction $B = B_R((0,0))$ is open ball with radius $R$. Its radius is given as follows.
\begin{align*}
R = \max \{\eta \geq 0 | 2M(\psi,\theta) + \psi \nabla_\psi M(\psi,\theta) \geq 0 \text{ for all }(\psi,\theta)\text{ such that } \psi^2+\theta^2\leq \eta^2 \}
\end{align*}
\end{lemma}
Motivated by this example, we can extend this idea to the other toy example given by \cite{STABILITY_GAN}, where WGAN fails to converge to the equilibrium points $(\psi,\theta) = (0,\pm 1)$.
\begin{lemma} \label{lemma:toysimpleGAN}
Consider the toy example $(D(x;\psi)=\psi x^2, U(-1,1), U(-|\theta|,|\theta|), \mu_\theta)$ where $U(0,0)=\delta_0$ and the ideal equilibrium points are given by $(\psi^*,\theta^*)=(0,\pm 1)$. For a finite measure $\mu = \mu_\theta$ on $\mathbb{R}$ which is independent of $\psi$, suppose that $\mu_\theta\rightarrow\mu^*$ with $\mu^*\neq C\delta_0$ for $C\geq 0$. The dynamic system is locally stable near the desired equilibrium $(0,\pm 1)$, where the spectrum of the Jacobian at $(0,\pm 1)$ is given by $\lambda = -2\rho\mathbb{E}_{\mu^*}[x^2] \pm \sqrt{4\rho^2\mathbb{E}_{\mu^*}[x^2]^2 - \frac{4}{9}}$.
\end{lemma}
\section{Main Convergence Theorem}
We propose the convergence property of WGAN with a simple gradient penalty on an arbitrary penalty measure $\mu$ for a realizable case: $\theta=\theta^*$ with $p_d=p_{\theta^*}$ exists. In \autoref{sec41}, we provide the necessary assumptions, which comprise our main convergence theorem. In \autoref{sec42}, we give the main convergence theorem with a sketch of the proof. A more rigorous analysis is given in the Appendix.
\subsection{Assumptions}\label{sec41}
The first assumption is made regarding the equilibrium condition for GANs, where we state the ideal conditions for the discriminator parameter and generator parameter. As the parameters converge to the ideal equilibrium, the sample distribution$(p_\theta)$ converges to the real data distribution$(p_d)$ and the discriminator cannot distinguish the generated sample and the real data.
\begin{Assumption}
$p_\theta \rightarrow p_d$ as $\theta\rightarrow\theta^*$ and $D(x;\psi^*) = 0$ on $supp(p_d)$ and its small open neighborhood, i.e., $x\in\cup_{x'\in supp(p_d)} B_{\epsilon_{x'}}(x')$ implies $D(x;\psi^*) = 0$. For simplicity, we denote $\cup_{x'\in supp(p_d)} B_{\epsilon_{x'}}(x')$ as $B(supp(p_d))$.
\end{Assumption}
The second assumption ensures that the higher order terms cannot affect the stability of the SGP $\mu$-WGAN. In the Appendix, we consider the case where the WGAN fails to converge when Assumption 2 is not satisfied. Compared with the previous study by \cite{STABILITY_GAN}, the conditions for the discriminator parameter are slightly modified.
\begin{Assumption}
\begin{align*}
g(\theta) = \norm{\mathbb{E}_{p_d}[\nabla_\psi D(x;\psi^*)] - \mathbb{E}_{p_\theta}[\nabla_\psi D(x;\psi^*)]}^2, h(\psi) = \mathbb{E}_{\mu_{\psi,\theta^*}}[\norm{\nabla_x D(x;\psi)}^2]
\end{align*}
are locally constant along the nullspace of the Hessian matrix.
\end{Assumption}
The third assumption allows us to extend our results to discrete probability distribution cases, as described by \cite{18Mescheder}.
\begin{Assumption}
$\exists\epsilon_g>0$ such that $D(x;\psi^*) = 0$ on $\cup_{|\theta-\theta^*|<\epsilon_g} supp(p_\theta)$.
\end{Assumption}
The fourth assumption indicates that there are no other ``bad'' equilibrium points near $(\psi^*,\theta^*)$, which justifies the projection along the axis perpendicular to the null space.
\begin{Assumption}
A bad equilibrium does not exist near the desired equilibrium point. Thus, $(\psi^*,\theta^*)$ is an isolated equilibrium or there exist $\delta _d, \delta_g> 0$ such that all equilibrium points in $B_{\delta_d}(\psi^*)\times B_{\delta_g}(\theta^*)$ satisfy the other assumptions.
\end{Assumption}
The last assumption is related to the necessary conditions for the penalty measure. A calculation of the gradient penalty based on samples from the data manifold and generator manifold or the interpolation of both was introduced in recent studies \citep{WGANGP,ROTH,18Mescheder}. First, we propose strong conditions for the penalty measure.
\begin{Assumption} The finite penalty measure $\mu = \mu_\theta$ satisfies the followings:
\begin{enumerate}
\item[a]
$\mu_\theta\rightarrow\mu_{\theta^*} = \mu^*$ and $\mu_\theta$ is independent of the discriminator parameter $\psi$.
\item[b]
$supp(p_{d}) \subset supp(\mu^*)$
\item[c]
$\exists\epsilon_\mu>0$ such that $supp(\mu_\theta)\subset B(supp(p_d))$ for $|\theta-\theta^*|<\epsilon_\mu$.
\end{enumerate}
\end{Assumption}
The assumption given above means that the support of the penalty measure $\mu_\theta$ should approach the support of the data manifolds smoothly as $\theta\rightarrow\theta^*$. Thus, the gradient penalty should be evaluated based on the data manifold and some open neighborhood $B(supp(p_d))$ near the equilibrium. However, the penalty measure from WGAN-GP with a simple gradient penalty still reaches equilibrium without satisfying Assumption 5c. Therefore, we suggest Assumption 6, which is a weak version of Assumption 5. Assumption 6a\footnote{This condition is technically required to handle the derivative of the measure in a convenient manner using the weak formulation. Even if the measure is not differentiable, it may possible to differentiate the integral. For instance, $\delta_\psi$ is continuous but it does not have its weak derivative. However, it is still possible to differentiate $\mathbb{E}_{\delta_\psi}[\omega(x)] = \omega(\psi)$ if the function $\omega$ is differentiable at $\psi$.} is technically required to take the derivative of the integral $\mathbb{E}_{\mu_{\psi,\theta}}[\norm{\nabla_x D(x;\psi)}^2]$ with respect to $\psi$.
\begin{Assumption} (Weak version of Assumption 5) The finite penalty measure $\mu = \mu_{\psi,\theta}$ satisfies the following.
\begin{enumerate}
\item[a]
$\mu_{\psi,\theta}\rightarrow\mu_{\psi^*, \theta^*} = \mu^*$, where $supp(\mu_{\psi,\theta})$ only depends on $\theta$. Near the equilibrium, $\mu_{\psi,\theta}$ can be weakly differentiated twice with respect to $\psi$. In addition, its mass $M(\psi,\theta) = \int 1d\mu_{\psi,\theta}$ is a twice-differentiable function of $\psi$ and bounded by $M_1<\infty$ near the equilibrium.
\item[b]
$E_{\mu^*}[\nabla_{\psi x}D\nabla_{\psi x}^TD]$ is positive definite or $supp(p_{d}) \subset supp(\mu^*)$.
\item[c]
$\exists\epsilon_\mu>0$ such that $supp(\mu_\theta)\subset V$ for $|\theta-\theta^*|<\epsilon_\mu$, where $V = \{x|\nabla_x D(x;\psi^*)=0\}$.
\end{enumerate}
\end{Assumption}
In summary, the gradient penalty regularization term with any penalty measure where the support approaches $B(supp(p_d))$ in a smooth manner works well and this main result can explain the regularization effect of previously proposed penalty measures such as $\mu_{GP}$, $p_d$, $p_\theta$, and their mixtures.
\subsection{Main Convergence Theorem}\label{sec42}
According to the modified assumptions given above, we prove that the related dynamic system is locally stable near the equilibrium. The tools used for analyzing stability are mainly based on those described by \cite{STABILITY_GAN}. Our main contributions comprise proposing the necessary conditions for the penalty measure and proving the local stability for all penalty measures that satisfy Assumption 6.
\begin{theorem}
Suppose that our SGP $\mu$-WGAN optimization problem $(D,p_d,p_\theta,\mu)$ with equilibrium point $(\psi^*,\theta^*)$ satisfies the assumptions given above. Then, the related dynamic system is locally stable at the equilibrium.
\end{theorem}
A detailed proof of the main convergence theorem is given in the Appendix. A sketch of the proof is given in three steps. First, the undesired terms in the Jacobian matrix of the system at the equilibrium are cancelled out. Next, the Jacobian matrix at equilibrium is given by $\begin{bmatrix}
-\rho Q & -R \\
R^T & 0
\end{bmatrix}$, where $Q = \mathbb{E}_{\mu^*}[\nabla_{\psi x}D\nabla^T_{\psi x}D]$ and $R = \nabla_\theta\mathbb{E}_{p_\theta}[\nabla_\psi D]|_{\theta = \theta^*}$. The system is locally stable when both $Q$ and $R^TR$ are positive definite. We can complete the proof by dealing with zero eigenvalues by showing that $N(Q^T) \subset N(R^T)$ and the projected system's stability implies the original system's stability.
Our analysis mainly focuses on WGAN, which is the simplest case of general GAN minimax optimization
\begin{align*}
\max_\psi &: \mathbb{E}_{p_d}[f(D(x;\psi))] + \mathbb{E}_{p_\theta}[f(-D(x;\psi))] - \frac{\rho}{2}\mathbb{E}_\mu[\norm{\nabla_x D(x;\psi)}^2] \\
\min_\theta &: \mathbb{E}_{p_d}[f(D(x;\psi))] + \mathbb{E}_{p_\theta}[f(-D(x;\psi))]
\end{align*}
with $f(x)=x$. Similar approach is still valid for general GANs with concave function $f$ with $f''(x) < 0$ and $f'(0)\neq 0$.
\section{Experimental Results}
We claim that every penalty measure that satisfies the assumptions can regularize the WGAN and generate similar results to the recently proposed gradient penalty methods. Several penalty measures were tested based on two-dimensional problems (mixture of 8 Gaussians, mixture of 25 Gaussians, and swissroll), MNIST and CIFAR-10 datasets using a simple gradient penalty term. In the comparisons with WGAN, the recently proposed penalty measures and our test penalty measures used the same network settings and hyperparameters. The penalty measures and its detailed sampling methods are listed in \autoref{tab:table1}, where $x_d \sim p_d, x_g \sim p_\theta$, and $\alpha \sim U(0,1)$. $\mathcal{A}$ indicates fixed anchor point in $\mathcal{X}$.
\begin{table}[htb]
\caption{List of benchmark WGANs (WGAN and WGAN-GP with non-zero centered gradient penalty) and 5 penalty measures with a simple gradient penalty term. In this table, WGAN-GP represents the previous model proposed by \citep{WGANGP}, which penalizes the WGAN with non-zero centered gradient penalty terms, whereas $\mu_{GP}$ represents the simple method. In our experiment, no additional weights are applied on 5 penalty measures and they are all probability distributions.}
\begin{center}
\begin{tabularx}{0.9\textwidth}{@{}lXX@{}}
\toprule
Penalty & Penalty term & Penalty measure, sampling method \\ \midrule
WGAN & None(Weight Clipping) & None \\
WGAN-GP & $\mathbb{E}_\mu[(\norm{\nabla_x D} - 1)^2]$ & $\hat{x} = \alpha x_d + (1-\alpha) x_g$ \\ \midrule
$p_g$ & $\mathbb{E}_\mu[\norm{\nabla_x D}^2]$ & $\hat{x} = x_g$ \\
$p_d$ & $\mathbb{E}_\mu[\norm{\nabla_x D}^2]$ & $\hat{x} = x_d$ \\
$\mu_{GP}$ & $\mathbb{E}_\mu[\norm{\nabla_x D}^2]$ & $\hat{x} = \alpha x_d + (1-\alpha) x_g$ \\
$\mu_{mid}$ & $\mathbb{E}_\mu[\norm{\nabla_x D}^2]$ & $\hat{x} = 0.5 x_d + 0.5 x_g$ \\
$\mu_{g,anc}$ & $\mathbb{E}_\mu[\norm{\nabla_x D}^2]$ & $\hat{x} = \alpha \mathcal{A} + (1-\alpha) x_g$ \\ \bottomrule
\end{tabularx}
\end{center}
\label{tab:table1}
\end{table}
By setting the previously proposed WGAN with weight-clipping\citep{WGAN} and WGAN-GP\citep{WGANGP} as the baseline models, SGP $\mu$-WGAN was examined with various penalty measures comprising three recently proposed measures and two artificially generated measures. $p_\theta$ and $p_d$ were suggested by \cite{18Mescheder} and $\mu_{GP}$ was introduced from the WGAN-GP. We analyzed the artificial penalty measures $\mu_{mid}$ and $\mu_{g,anc}$ as the test penalty measures.
The experiments were conducted based on the implementation of the \cite{WGANGP}. The hyperparameters, generator/discriminator structures, and related TensorFlow implementations can be found at \url{https://github.com/igul222/improved_wgan_training} \citep{WGANGP}. Only the loss function was modified slightly from a non-zero centered gradient penalty to a simple penalty. For the CIFAR-10 image generation tasks, the inception score\citep{INCEPTION} and FID\citep{FID} were used as benchmark scores to evaluate the generated images.
\subsection{2D Examples and MNIST}
We checked the convergence of $p_\theta$ for the 2D examples (8 Gaussians, swissroll data, and 25 Gaussians) and MNIST digit generation for the SGP-WGANs with five penalty measures. MNIST and 25 Gaussians were trained over 200K iterations, the 8 Gaussians were trained for 30K iterations, and the Swiss Roll data were trained for 100K iterations. The anchor $\mathcal{A}$ for $\mu_{g,anc}$ was set as $(2,-1)$ for the 2D examples and 784 gray pixels for MNIST. We only present the results obtained for the MNIST dataset with the penalty measures comprising $\mu_{mid}$ and $\mu_{g,anc}$ in \autoref{fig:imagesmnist}. The others are presented in the Appendix.
\begin{figure}[htb]
\centering
\begin{subfigure}{0.44\textwidth}
\includegraphics[width=\linewidth]{mnist200Kmid.png}
\label{fig:16}
\end{subfigure}
\begin{subfigure}{0.44\textwidth}
\includegraphics[width=\linewidth]{mnist200Kanc.png}
\label{fig:17}
\end{subfigure}
\caption{MNIST example. Images generated with $\mu_{mid}$(left) and $\mu_{g,anc}$(right).}
\label{fig:imagesmnist}
\end{figure}
\subsection{CIFAR-10}
DCGAN and ResNet architectures were tested on the CIFAR-10 dataset. The generators were trained for 200K iterations. The anchor $\mathcal{A}$ for $\mu_{g,anc}$ during CIFAR-10 generation was set as fixed random pixels. The WGAN, WGAN-GP, and five penalty measures were evaluated based on the inception score and FID, as shown in \autoref{tab:table2}, which are useful tools for scoring the quality of generated images. The images generated from $\mu_{mid}$ and $\mu_{g,anc}$ with ResNet are shown in \autoref{fig:imagescifar}. The others are presented in the Appendix.
\begin{table}[htb]
\caption{Benchmark score results obtained based on the CIFAR-10 dataset under DCGAN and ResNet architectures. The higher inception score and lower FID indicate the good quality of the generated images.}
\begin{center}
\begin{tabular}{@{}lllll@{}}
\toprule
\multirow{2}{*}{Penalty} & \multicolumn{2}{c}{DCGAN} & \multicolumn{2}{c}{ResNet} \\
& Inception & FID & Inception & FID \\ \midrule
WGAN
\footnote{ WGAN failed to generate images for the ResNet architecture } & $5.64 \pm 0.09$ & 48.7 & - & - \\
WGAN-GP & $6.48 \pm 0.10$ & 35.0 & $7.82 \pm 0.09$ & 18.1 \\ \midrule
$p_g$ & $6.46 \pm 0.09$ & 38.0 & $7.63 \pm 0.10$ & 20.9 \\
$p_d$ & $6.33 \pm 0.07$ & 38.9 & $7.63 \pm 0.09$ & 20.3 \\
$\mu_{GP}$ & $6.40 \pm 0.08$ & 35.4 & $7.60 \pm 0.09$ & 18.3 \\
$\mu_{mid}$ & $6.60 \pm 0.07$ & 33.9 & $7.86 \pm 0.07$ & 16.4 \\
$\mu_{g,anc}$ & $6.45 \pm 0.07$ & 33.7 & $7.36 \pm 0.09$ & 22.4 \\ \bottomrule
\end{tabular}
\end{center}
\label{tab:table2}
\end{table}
\begin{figure}[htb]
\centering
\begin{subfigure}{0.39\textwidth}
\includegraphics[width=\linewidth]{mid199999.png}
\label{fig:18}
\end{subfigure}
\begin{subfigure}{0.39\textwidth}
\includegraphics[width=\linewidth]{samples_199999.png}
\label{fig:19}
\end{subfigure}
\caption{CIFAR-10 example. Images generated with $\mu_{mid}$(left) and $\mu_{g,anc}$(right) under the ResNet architecture.}
\label{fig:imagescifar}
\end{figure}
\section{Conclusion}
In this study, we proved the local stability of simple gradient penalty $\mu$-WGAN optimization for a general class of finite measure $\mu$. This proof provides insight into the success of regularization with previously proposed penalty measures. We explored previously proposed analyses based on various gradient penalty methods. Furthermore, our theoretical approach was supported by experiments using unintuitive penalty measures. In future research, our works can be extended to alternative gradient descent algorithm and its related optimal hyperparameters. Stability at non-realizable equilibrium points is one of the important topics on stability of GANs. Optimal penalty measure for achieving the best convergence speed can be also investigated using a spectral theory, which provides the mathematical analysis on stability of GAN with a precise information on the convergence theory.
\subsubsection*{Acknowledgments}
We thank Dr Seok Hyun Hong for fruitful discussions about this study. Hyung Ju Hwang was supported by the Basic Science Research Program through the National Research Foundation of Korea (NRF-2017R1E1A1A03070105).
\newpage
| {'timestamp': '2018-10-08T02:06:12', 'yymm': '1810', 'arxiv_id': '1810.02528', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02528'} | arxiv |
\section{Introduction}
As a revolutionary innovation, mobile augmented reality (AR) has become a miraculous technology in the past few years. By combining the computer-generated and sensor-extracted elements with the real objects and enabling real-time 3D interaction between mobile users and physical surroundings at fingertips, mobile AR is envisioned as a new paradigm to submerge mobile subscribers in a fabulous mixed-reality world \cite{AR_Survey, VM_cloudlet}. In view of the great business opportunities involved in mobile AR, many leading companies have continuously scrambled to design and promote their own mobile AR applications and products, such as Google Glass, Microsoft HoloLens, and Recon Jet.
However, despite the fully immersive user experience, mobile AR still faces with many technical challenges that hinder its widespread commercial use. Due to the hardware limitation, running sophisticated AR algorithms at mobile devices generally causes long processing delay and high energy consumption, which are the main hurdles for implementation. To handle these issues, many cutting-edge technologies, such as advanced hardware structure, acceptable approximate computing, and partial video frame updating have been developed to improve the mobile AR performance. Nevertheless, these methods still cannot catch up with the rapid growth of user demand while pointlessly increasing the cost of mobile devices. Hence, novel techniques are urgently expected to tackle the above challenges.
To overcome the computational resource shortage of mobile devices, another major innovation in the past decade is \textit{mobile cloud computing} (MCC), which allows users to offload computation-intensive tasks to a number of powerful cloud servers deployed at the remote cloud platform for processing \cite{Cloud_computing}. However, with the strict delay requirement of mobile AR applications, MCC suffers from extra propagation delay due to the long physical distance between mobile devices and cloud servers \cite{MCC_magazine}. To this end, an improved technique, which is referred to as \textit{mobile edge computing} (MEC), has been recently proposed by the European Telecommunication Standards Institute (ETSI) and is also considered by the Third Generation Partnership Project (3GPP) in their future standards. By distributing the conventional centralized cloud computing resources to the edge of mobile networks, MEC offers an adjacent computing environment for mobile subscribers and provides a variety of benefits, including ultra-low latency, real-time access, and location-aware services, etc.\cite{MEC_magazine_paradigm, MEC_Survey, MEC_magazine_smartcity}.
On the other hand, by taking advantages of the proximity to mobile users in MEC and the abundant computation capacity in MCC, effective collaboration between cloud and edge computing can further improve the system performance. Several hierarchical edge-to-cloud architectures have been proposed to collaborate the computation capacity of edge servers and cloud servers\cite{Cloud_Edge1, Cloud_Edge2}. However, they are not specifically designed for AR applications. Motivated by this, in this work, we propose a novel hierarchical computation architecture to deal with the long processing delay and high energy consumption of mobile AR applications. The newly-designed architecture is composed of three layers: the user layer, the edge layer, and the cloud layer. By integrating the communication, computation, and control modules in the edge layer while seamlessly collaborating the edge and cloud computing capacities, several critical components of AR applications can be intelligently offloaded to both edge and cloud servers for further processing. In accordance with this architecture, an advanced operation mechanism is developed by embedding the MEC functions into the AR process. Moreover, to support the proposed AR framework, we further discuss three key technologies, i.e., the joint communication and computation resource allocation, the collaborative cloud and edge computing, and the content-based image retrieval from the viewpoints of energy efficiency and delay optimization. The main merit of the proposed MEC-based AR framework is that it merges the advantages of cloud computing and edge computing to enormously improve the quality of experience (QoE) for AR applications.
In what follows, we first provide a comprehensive AR overview, including the indispensable components of general AR applications, fashionable AR devices, and existing technologies for alleviating the inherent long processing delay and high energy consumption problems. To improve the system performance, our key contributions are the novel hierarchical computation architecture and the related AR operation mechanism as well as the three key technologies, which can significantly facilitate the implementation of the MEC-based AR framework. Finally, simulation results demonstrate that the proposed AR framework can evidently improve the energy and delay performance, as compared against some baseline schemes. Our design in this article has the great potential to provide an essential reference for the future development of mobile AR technology.
\section{Overview of Augmented Reality}
In this section, we present an overview of AR, including the specific components of general AR applications, the compelling mobile AR devices, and the incumbent AR technologies, from the viewpoints of energy efficiency and latency optimization.
\subsection{AR Application Components}
To combine colorful computer-generated and sensor-extracted data with the physical reality, different AR applications possess diverse modules for specific processing purposes. However, five computation components, i.e., the $\emph{video source}$, $\emph{tracker}$, $\emph{mapper}$, \emph{object recognizer}, and $\emph{renderer}$, are indispensable for almost all AR applications, and they play the critical roles in general AR architectures \cite{AR_cloudlet_1, AR_cloudlet_2}.
\begin{figure}[!htp]
\centering
\includegraphics[width=0.5\textwidth]{AR_components.eps}
\caption{Main components of general AR applications.}
\label{Main Components of an AR Application}
\end{figure}
As illustrated in Fig. \ref{Main Components of an AR Application}, the aforementioned five components collaborate closely to accomplish an integrated AR process. First, the video source fetches the raw videos from mobile cameras and clips these videos into frames with specific image format, such as JPEG and PNG. Next, the video frames are delivered to the tracker to determine the user's position with respect to the physical surroundings. Given the tracking results, virtual coordinate of the environment can be established by the mapper. Then, the internal objects in video frames are identified by the object recognizer with robust features. Afterwards, the augmented information of the identified object can be accurately retrieved from local memory (or cloud database) and properly mixed with the original videos by the renderer. The results are finally displayed on the screens of AR devices so that the subscribers are able to enjoy a magic interactive experience with the physical reality at the fingertips.
\subsection{Fashionable AR Devices}
A variety of AR devices with different operation modes have been recently designed with multifarious functions. Table \uppercase\expandafter{\romannumeral1} summarizes several well-known AR devices developed by major companies. Among them, Google Glass, Microsoft HoloLens, and Osterhout Design Group (ODG) R-9 operate independently, whereas Meta 2 and Recon Jet need to rely on external equipments such as personal computers (PCs) or smart phones.
The Google Glass is the first-appeared AR glass, which has a stylish appearance and provides users with requested information, such as calendar, weather, and message via natural language voice commands. Comparatively, Microsoft HoloLens enables users to engage with digital content and interact with holograms of the surroundings for supplying subscribers with a mixed-reality experience. This function is extended in ODG R-9 by combining with some advanced modules, such as Bluetooth 5.0, built-in GPS, and six degrees of freedom tracking. However, these devices all suffer from high energy consumption and cannot work for a long time. On the other hand, by connecting powerful computers, Meta 2 allows users to intuitively touch, grab, and move the computer-generated digital objects as real ones, which inevitably leads to its non-portability for outdoor use. Particularly, Recon Jet is extensively used in sport scenes and can exhibit the real-time motion information of mobile users.
\begin{table*}
\centering
\footnotesize
\caption{Major AR Devices}
\vspace{-1em}
\label{table1}
\begin{tabular}{p{1.5cm}p{1.5cm}p{1.5cm}p{1.5cm}p{3.1cm}p{2.8cm}p{1cm}}
\hline
\hline
Product&Operation Mode &CPU &GPU &Latency &Battery Autonomy &Weight \\
\hline
\hline
Google Glass &Independent &1 GHz &300 MHz &700 ms for user interface (UI) response &$<$ 1 h when recording videos &42 g \\
\hline
Microsoft HoloLens &Independent &1.04 GHz &HoloLens Graphics &Few seconds for gesture recognition &2-3 h for typical use &579 g \\
\hline
ODG R-9 & Independent &2.45 GHz &710 MHz &Not available &24 h for browsing and casual use &184 g\\
\hline
Meta 2 &Dependent &3.4 GHz &1127 MHz &80 ms for gesture recognition &Powered by PC &500 g \\
\hline
Recon Jet &Dependent &1 GHz &PowerVR SGX540 &40 s for loading navigation map &4 h for typical use &85 g \\
\hline
\hline
\end{tabular}
\end{table*}
Although the above AR devices can provide fully immersive experience for mobile subscribers, they generally suffer from long processing delay and high energy consumption, which are the most-critical performance metrics for AR applications. To overcome these drawbacks, several existing technologies have been recently developed, which will be discussed in the following.
\subsection{Existing Technologies}
Presently, there are mainly three kinds of technologies to reduce the processing delay and energy consumption of AR applications, as summarized in the following \cite{AR_Survey}.
\begin{itemize}
\item \textbf{Advanced hardware structure:}
It is hard for traditional battery to sustainably support the complex operations of AR applications. As a result, advanced hardware structures such as multi-core CPU with low frequency and voltage can be utilized to replace the single-core ones. Furthermore, the dynamic voltage and frequency scaling (DVFS) technology can be adopted to save energy with respect to specific requirements.
\item \textbf{Acceptable approximate computing:}
Consistently performing accurate calculation in AR applications usually consumes much energy and results in long processing delay. Therefore, approximate computing for AR tasks can be adopted according to detailed computational accuracy requirements. For example, low-precision tasks, such as location sensing, can be approximately processed to balance computational accuracy and energy (delay) efficiency.
\item \textbf{Partial video frame updating:}
The frequent movement of mobile AR devices would produce a large volume of video data, which is adverse for real-time processing. Therefore, partial video frame updating can be exploited to avoid redundant computing by processing the newly-generated data only.
\end{itemize}
Based on the above mentioned technologies, the end-to-end latency and energy consumption of AR applications can be improved to some extent. However, since the computation-intensive tasks, e.g., tracking, mapping, and object recognition, are still remained for local computing, the end-to-end latency and energy consumption cannot be further reduced and the anticipated user demand is still far from reaching.
To overcome the resource shortage of mobile devices, MEC has been recently proposed and is regarded as a new paradigm to deliver better experience for mobile users by offloading computation-intensive tasks to the servers deployed at the edge of mobile networks \cite{MEC_You}. Motivated by this, we present a novel computation framework for embedding MEC into AR applications in the following section.
\section{MEC-Based AR Framework}
In this section, we first present a novel hierarchical computation architecture for multi-user AR systems and then introduce a detailed mechanism to support AR applications.
\subsection{Hierarchical Computation Architecture}
Considering a multi-user AR scenario where several AR applications need to be executed simultaneously, we propose a hierarchical architecture composed of three layers, namely, the \textit{user layer}, the \textit{edge layer}, and the \textit{cloud layer}. As illustrated in Fig. \ref{Hierarchical Computation Architecture}, multiple AR devices are located in the user layer and are connected to the edge layer through wireless links. The cloud layer mainly consists of an enormous database for data storage and abundant computational resources for data processing. These two layers are quite similar to the existing AR architectures and thus we do not devote special attention henceforth.
\begin{figure}[!htp]
\centering
\includegraphics[width=0.5\textwidth]{Architecture.eps}
\caption{Hierarchical Computation Architecture.}
\label{Hierarchical Computation Architecture}
\end{figure}
The uniqueness of our proposed architecture is that an edge layer is inserted between the conventional cloud layer and user layer. The edge layer can be equipped at the base stations (BSs) of cellular networks or the access points (APs) of WiFi networks. The merit of this design is that MEC can be utilized to improve the end-to-end latency and energy consumption performance of AR applications. Furthermore, cloud computing and edge computing can be potentially collaborated for further performance enhancement.
In the proposed hierarchical architecture, one major issue is how to design the function modules in the edge layer to seamlessly collaborate with the other two layers. To tackle this problem, we introduce three functionalized components, namely, $\emph{communication unit}$, $\emph{operation platform}$, and $\emph{virtualized controller}$ in the edge layer on the basis of the software defined network (SDN) technology. Note that the combination of the three modules also leads to the convergence of communication, computation, and control. In what follows, we will present a detailed description on these three modules.
\begin{itemize}
\item \textbf{Communication Unit:}
The communication unit can be regarded as a ``bridge" that enables real-time data transmission between the edge layer and the other two layers. On one aspect, when multiple AR devices offload the computational tasks, such as video steams, to the BS, the inner radio remote unit (RRU) has the responsibility to successfully receive these data. Furthermore, these data are required to be delivered to the operation platform for further processing. On the other aspect, the computation results from operation platform and cloud layer should be multicasted to the corresponding users through the communication unit.
\item \textbf{Operation Platform:}
The operation platform is the core of this architecture, which processes the offloaded AR tasks from mobile users. The original data from RRU is firstly stored in the edge cache, and will be delivered to the computing platform for further processing. The critical AR computing platform is composed of a computing module (resembling computer's CPU) and a graphics module (resembling computer's GPU). The former is utilized to process the computing-related tasks, such as tracking and mapping, while the latter is utilized to process the graphics-related tasks like object recognition. Since AR tasks usually require additional data, such as 3D-models and annotations of the recognized objects, we establish a small database at the edge layer for storing the object information that is frequently accessed. With this design, we do not have to invariably fetch the requested information from the remote cloud database, which can significantly reduce the end-to-end latency.
\item \textbf{Virtualized Controller:}
The virtualized controller serves as the ``centralized coordinator" of the whole edge layer, which is divided into four specific components: the network controller, the computing controller, the storage controller, and the system controller. The network controller manages all network activities among three layers, such as network establishment and data transmission. Accordingly, the computing controller supervises the entire process in the operation platform while it optimally allocates the available computational resource to each AR task with specific requirements. Moreover, the inherent executive priorities and collaborative properties of AR tasks from different subscribers are also evaluated in the computing controller. In addition, the storage controller aims at properly managing the memory mechanism of the edge database for fast data searching and updating. Finally, the system controller monitors the behaviours of the above three controllers and coordinates them in a more efficient way.
\end{itemize}
\subsection{MEC-based AR Operation Mechanism}
Thus far, our discussions have focused on the physical modules of the proposed hierarchical architecture for AR applications. In the following, we further present some detailed operations to facilitate the AR implementation.
\begin{figure}[!htp]
\centering
\includegraphics[width=0.5\textwidth]{Processing.eps}
\caption{MEC-based AR operation mechanism.}
\label{Novel AR Executing Mechanism}
\end{figure}
As depicted in Fig. \ref{Novel AR Executing Mechanism}, the proposed MEC-based AR operation mechanism can be divided into three tiers, which are consistent with the hierarchical architecture, i.e., the \textit{user tier}, the \textit{edge tier}, and the \textit{cloud tier}. The main idea of this mechanism is that the video source and renderer of AR applications must be processed locally whereas the computation-intensive components, i.e., the tracker, mapper, and object recognition should be offloaded to the edge and cloud servers. The detailed operations in each tier are generalized into specific blocks and will be elaborated in the following.
The user tier is responsible for executing the local operations. Multiple AR devices simultaneously start with sensing real environment, producing raw videos, and capturing users' gestures via their cameras and sensors. Through identification analysis, this original information will be transformed into two categories: the video streams which contain the raw video data and the operation instructions which carry the specific requirements of mobile subscribers, such as object identification and sentiment analysis. Thereafter, this information will be further duplicated into two copies with one stored in the uplink cache for data transmission and the other stored in the local cache for subsequent processing. Consequently, the transceivers of mobile AR devices will transmit the data in the uplink cache to the edge layer through wireless channels.
The edge tier plays a critical role in computing AR applications. Upon receiving the offloaded data from AR devices, the BS will first classify them into two kinds: the raw video streams and the user's operation instructions, and then deliver them to the edge cache for separate storage. Thereafter, these two kinds of data are delivered to the tracker-mapper module and the video clipping module, respectively. The tracker-mapper module then tracks users' locations and builds virtual coordinates to coincide with the real world via some algorithms, such as simultaneous localization and mapping (SLAM) and parallel tracking and mapping (PTAM). Meanwhile, the video clipping module slices one representative frame (or image) from each raw video for subsequent processing. It should be noted that some users may observe the same object and require the same information of this object. With this regard, classifiers can be leveraged to assort all frames from different videos into several categories based on the inherent information, such that each category contains those frames of the same object. This function can be implemented via some well-known machine learning algorithms, such as convolutional neural networks (CNN) and support vector machines (SVM). Afterwards, one typical image of each category is picked out and utilized to match with the standard images pre-stored in the edge database by some image retrieval methods. By this means, the inherent collaborative properties of AR applications can be fully utilized and redundant calculation can be effectively avoided. Then, if the matched standard image is found in the edge database, the corresponding annotation information will be fetched from the adjacent edge storage. Otherwise, the related frame will be offloaded to the cloud server for further searching.
The cloud tier contains a large cloud database for storing the additional data that are not cached in the edge tier due to its limited memory size. Once the retrieval operation in the edge tier is not realized, the corresponding image will be offloaded to the cloud tier for further searching. Owing to the adequate computational resource at the cloud server and the sufficient capacity of the cloud storage, the image retrieval will be generally achieved. Thereafter, the requested information will be transmitted back to the edge tier and combined with the virtual map that is reconstructed by the tracker-mapper module. Also, the total computation results are multicasted to the corresponding devices. Finally, these data are exhibited to the subscribers after mixing with the original videos via the local renderers.
\section{Key Implement Technologies}
In this section, we will develop three key technologies, i.e., the joint communication and computation resource allocation, the collaborative cloud and edge computing, and the content-based image retrieval to further improve the energy efficiency and reduce the processing latency.
\subsection{Joint Communication and Computation Resource Allocation}
In the proposed framework, the computational tasks of an AR application can be jointly processed by the local device, the edge server, and the cloud server. Meanwhile, the communication resource of the wireless network and the computational resources of the edge/cloud servers can be shared by all AR devices. Therefore, joint communication and computation resource allocation is essential to further improve the delay and energy performance \cite{Joint_resource_allocation}. Generally, two schemes in current AR scenarios should be taken into account, i.e., the centralized and distributed resource allocation schemes.
In centralized AR systems, both user priority and channel state information can be acquired in the edge layer. Therefore, the network controller and the computing controller can collaboratively design the resource allocation policy by optimizing a specific objective function, such as minimizing the end-to-end latency under a prescribed resource utilization constraint and maximizing the mobile energy efficiency under an offloading latency constraint. Moreover, the network controller and the computing controller can monitor the specific requirements of different AR tasks in real-time and adaptively adjust the resource allocation to meet the diverse user demands.
However, in distributed AR systems, the aforementioned information can no longer be obtained by the edge layer, making it difficult to centrally control the allocation of available communication and computation resources. To tackle this problem, game-theoretical techniques can be exploited to develop distributed algorithms based on past network and channel information, whereas the obtained result is demonstrated to achieve the Nash equilibrium and can deliver satisfactory latency and energy consumption experiences for mobile AR subscribers.
\subsection{Collaborative Cloud and Edge Computing}
On the one hand, traditional cloud servers are typically deployed at the remote cloud platform, suffering from long propagation delay when transmitting onerous AR tasks in the core network. On the other hand, although the adjacent MEC servers can be implemented at the nearby BS, their computation and storage capacities are usually limited. Therefore, by combining the advantages of the powerful computation capacity of cloud computing and the proximity to mobile subscribers of edge computing, collaborative cloud and edge computing is envisioned as a promising paradigm to achieve better AR performance.
In the proposed framework, due to the limited edge storage capacity, the additional information such as 3D models and annotations of those unpopular objects should be stored in the cloud database to alleviate the storage burden at the edge database. On the other hand, the edge database only need to store those frequently accessed information of the popular objects. This can be realized by storing the historical access record of each object's information in the edge layer and setting an appropriate threshold to judge which object is popular. By this means, massive object recognition operations can be avoided at the edge layer and the AR processing latency can be effectively reduced. Moreover, when several edge servers are simultaneously served by the same cloud server, it is important to properly allocate the available cloud computational resource to each edge server based on their workload and local computation capacities. The detailed resource allocation policy can be derived by solving a specific optimization problem through some convex and non-convex optimization tools. For instance, more cloud computational resource need to be allocated to assist those edge servers with less computation capacities and heavier workload to balance the uneven resource and workload distribution over different edge servers.
\subsection{Content-based Image Retrieval}
Object recognizer is a critical component of AR applications, which usually consumes a large processing delay, especially in the image retrieval procedure. Therefore, advanced content-based image retrieval technology should be developed to accelerate the searching speed. Motivated by the work in \cite{MVS}, we present a typical pipeline for image retrieval within the proposed mechanism, which consists of three steps: feature extraction, feature matching, and geometric verification.
\textbf{1) Feature extraction:}
Once an image is input into the graphics module of the edge layer, the feature extraction algorithm will immediately search its inherent salient interest points, which are used to estimate the similarity between this image and the standard images pre-stored in the edge and cloud databases. Various robust feature descriptors can be applied to obtain typical features, such as scale invariant feature transform and speeded up robust features \cite{Feature_extraction}.
\textbf{2) Feature matching:}
Current pairwise feature matching algorithm generally consumes a lot of time since it directly matches the input image with all standard images. To cope with this issue, we pre-construct a data structure to store the features of all standard images with particular indices. Then, by comparing the extracted features with those in the data structure, a shortlist of candidate images can be efficiently filtered. Thereafter, the slow pairwise feature matching method can be applied between the input image and the candidate images only, and a best-matched image can be eventually picked out from the shortlist. In this way, the image retrieval delay can be substantially reduced.
\textbf{3) Geometric verification:}
After obtaining the best-matched standard image, further examination is required to confirm whether the matching result is correct. Geometric verification is commonly utilized to test whether the input image and the best-matched standard image are similar with only geometric and photometric distortions. If the verification result is correct, the matching relation will be established. Otherwise, the input image and its features will be offloaded to the cloud server for further searching.
It shall be noted that with the above three steps, the computation and storage resources of the cloud server and edge server can be jointly utilized to improve the accuracy of object recognition. Consequently, the end-to-end latency and energy consumption can be effectively reduced.
\section{Performance Evaluation}
In this section, we present simulation results to manifest the latency and energy performance enhancement of our proposals against two benchmark schemes. We consider a scenario where multiple mobile devices in the coverage of the same BS execute AR applications simultaneously. The edge layer is implemented at the central BS with a radius of 200 m. The cloud layer is deployed in a remote cloud platform. The BS connects the cloud platform through a backhaul link, whose uplink and downlink transmission capacities are both set to be 200 Mbps. The edge and cloud computing capacities are set to be $\text{5} \times \text{10}^{\text{10}}$ CPU cycle/s and $\text{3} \times \text{10}^{\text{11}}$ CPU cycle/s, respectively \cite{MEC_You}. Each AR device is randomly distributed according to Poisson distribution within the BS coverage, adopting the TDMA channel access with a bandwidth of 15 MHz. The local computation capacity of each device follows the uniform distribution between $[5 \times 10^{8}, 2 \times 10^{9}]$ CPU cycle/s. The channel gains between mobile devices and the BS are generated according to independent and identically distributed (i.i.d.) Rayleigh random variables with unit variance. Since the cloud computing components are first offloaded to the edge layer through wireless links and then being transmitted to the cloud server through the backhaul link equipped with high transmission bandwidth, the distance between mobile devices and the cloud server could be ignored in this paper.
Other major parameters of AR applications can be found in \cite{MEC_AR_Letter}.
In our test, we compare the performance of our proposals with two benchmark schemes: the local computing scheme where the tracker and mapper modules are remained for local processing while the object recognizer is offloaded for cloud computing, and the cloud computing scheme where the tracker, mapper, and object recognizer are all offloaded to the remote cloud platform. Meanwhile, we name our proposed scheme as the edge computing scheme.
\begin{figure}
\centering
\subfigure[End-to-end latency of three schemes.]{
\includegraphics[width=0.75\columnwidth]{Average_delay.eps} \label{Per-user delay}
}
\subfigure[Energy consumption of three schemes.]{
\includegraphics[width=0.75\columnwidth]{Total_energy.eps} \label{Total-user energy}
}
\subfigure[Total mobile energy consumption under different delay tolerances.]{
\includegraphics[width=0.75\columnwidth]{Energy_Delay.eps} \label{Total_Energy_Delay_tolerance}
}
\caption{Simulation results.}\label{Simulation results}
\end{figure}
Fig. \ref{Per-user delay} presents the comparative results of the end-to-end latency of each device in the three schemes, where the transmission power of each mobile device is bounded by 24 dBm. In this simulation, since both communication and computation latency increase almost linearly with the number of devices, the end-to-end latency of each scheme has an approximately linear trend. From the figure, the local computing scheme always delivers the worst latency performance among three schemes because of the insufficient computational resource of mobile devices. Moreover, due to the limited communication resource, the end-to-end latency increases with the number of devices in all schemes. However, the proposed edge computing scheme always achieves the best latency performance since it can collaborate the cloud computing and edge computing. Specifically, for the case with 36 devices, the edge computing scheme can reduce about 41.44\% and 12.85\% latency as compared with local computing and cloud computing schemes, respectively. Note that in the simulation, we set the computation capacity of the cloud server almost 10 times of the edge server as a typical example. With the increase of the cloud computation capacity, the performance gap between the cloud computing scheme and the edge computing scheme will become smaller.
Fig. \ref{Total-user energy} depicts the comparative results of the total energy consumption of all devices with the number of devices, where the maximum delay tolerance of each AR application is 450 ms. From this figure, the cloud computing scheme can always achieve a better energy efficiency than the local computing scheme because of the extra energy consumption for tracking and mapping at local devices. Nevertheless, the proposed edge computing scheme always achieves the highest energy efficiency among all schemes. In the scenario with 36 devices, our proposed scheme can save about 73.71\% and 65.34\% energy consumption as compared with local computing and cloud computing schemes, respectively. Specifically, the overall energy consumption of each scheme would grow rapidly when the number of devices becomes large. The reason is that the communication energy becomes dominant with large number of mobile devices, which increases exponentially with the number of devices.
To further show the performance advantage on energy saving of the proposed edge computing scheme, we depict the total energy consumption of all mobile devices with different delay tolerances in Fig. \ref{Total_Energy_Delay_tolerance}, where the number of devices is set to be 30. From the figure, the mobile energy consumption of each scheme decreases with the maximum delay tolerance. The reason is that, more computational resource should be utilized to assist the task processing to meet the stricter delay requirement, leading to the higher mobile energy consumption. Once again, the superiority of the edge computing scheme is demonstrated by this test.
Overall, our tests demonstrate that the MEC-based AR framework is more efficient than other two conventional schemes as a result of the collaboration between cloud computing and edge computing. Both the processing latency and the energy consumption can be significantly reduced, leading to better QoE, such as high image resolution, long battery autonomy, convenient portability, and real-time performance for AR subscribers.
\section{Conclusion}
This article presents a novel MEC-based computation framework for current AR applications to optimize the energy efficiency and processing delay. A hierarchical computation architecture is first developed, which is composed of three layers: the user layer, the edge layer, and the cloud layer. By seamlessly integrating the communication, computation, and control functions at the edge layer and taking full advantages of both edge computing and cloud computing, computation-intensive tasks of AR applications can be intelligently offloaded to both edge and cloud servers for collaborative computation. In accordance with this architecture, we then develop a novel mechanism to simultaneously support multiple AR applications of different mobile subscribers. Three key technologies are also discussed, which can cooperate to further reduce the processing latency and energy consumption of mobile AR devices. Our proposed architecture and mechanism are finally tested by simulation results, which demonstrate the substantial performance improvement of our proposals over the existing schemes.
| {'timestamp': '2018-10-16T02:23:29', 'yymm': '1810', 'arxiv_id': '1810.02509', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02509'} | arxiv |
\section{Introduction}
Even though machine translation has improved considerably with the advent of neural machine translation (NMT) \citep{Sutskever2014,Bahdanau2015}, the translation of pronouns remains a major issue. They are notoriously hard to translate since they often require context outside the current sentence.
As an example, consider the sentences in Figure \ref{fig:ecb}. In both languages, there is a pronoun in the second sentence that refers to the European Central Bank. When the second sentence is translated from English to German, the translation of the pronoun \textit{it} is ambiguous. This ambiguity can only be resolved with context awareness: if a translation system has access to the previous English sentence, the previous German translation, or both, it can determine the antecedent the pronoun refers to. In this German sentence, the antecedent \textit{Europ\"{a}ische Zentralbank} dictates the feminine gender of the pronoun \textit{sie}.
\begin{figure}
\begin{itemize}
\item[\textbf{EN}] However, \ul{the European Central Bank (ECB)} took an interest in it. \textit{It} describes bitcoin as ``the most successful virtual currency''.
\end{itemize}
\begin{itemize}
\item[\textbf{DE}] Dennoch hat \ul{die Europ\"{a}ische Zentralbank (EZB)} Interesse hierf\"{u}r gezeigt. \textit{Sie} beschreibt Bitcoin als ``die virtuelle W\"{a}hrung mit dem gr\"{o}ssten Erfolg''.
\end{itemize}
\caption{Example sentence illustrating how the translation of pronouns is ambiguous on a sentence level. Pronouns of interest are in italics, and the antecedents they refer to are underlined. Taken from WMT \texttt{newstest2013}.} \label{fig:ecb}
\end{figure}
It is unfortunate, then, that current NMT systems generally operate on the sentence level \citep{Vaswani2017,Gehring2017,Hieber2017}. Documents are translated sentence-by-sentence for practical reasons, such as line-based processing in a pipeline and reduced computational complexity. Furthermore, improvements of larger-context models over baselines in terms of document-level metrics such as BLEU or RIBES have been moderate, so that their computational overhead does not seem justified, and so that it is hard to develop more effective context-aware architectures and empirically validate them.
To address this issue, we present an alternative way of evaluating larger-context models on a test set that allows to specifically measure a model's capability to correctly translate pronouns.
The test suite consists of pairs of source and target sentences, in combination with contrastive translation variants (for evaluation by model scoring) and additional linguistic and contextual information (for further analysis). The resource is freely available.\footnote{\url{https://github.com/ZurichNLP/ContraPro}}
Additionally, we evaluate several context-aware models that have recently been proposed in the literature on this test set, and extend existing models with parameter tying.
The main contributions of our paper are:
\begin{itemize}
\item We present a large-scale test set to evaluate the accuracy with which NMT models translate the English pronoun {\em it} to its German counterparts {\em es}, {\em sie} and {\em er}.
\item We evaluate several context-aware systems and show how targeted, contrastive evaluation is an effective tool to measure improvement in pronoun translation.
\item We empirically demonstrate the effectiveness of parameter tying in multi-encoder context-aware models.
\end{itemize}
Section \ref{sec:related-work} explains how our paper relates to existing work on context-aware models and the evaluation of pronoun translation. Section \ref{sec:testset} describes our test suite. The context-aware models we use in our experiments are detailed in Section \ref{sec:models}. We discuss our experiments in Section \ref{sec:experiments} and the results in Section \ref{sec:evaluation}.
\section{Related Work} \label{sec:related-work}
Two lines of work are related to our paper: research on context-aware translation (described in Section \ref{subsec:related-models}) and research on focused evaluation of pronoun translation (described in Section \ref{subsec:related-eval}).
\subsection{Context-Aware NMT Models} \label{subsec:related-models}
If the translation of a pronoun requires context beyond the current sentence (see the example in Figure \ref{fig:ecb}), a natural extension of sentence-level NMT models is to condition the model prediction on this necessary context. In the following, we describe a number of existing approaches to making models ``aware'' of additional context.
\begin{table*}
\begin{center}
\begin{tabular}{lcccccc}
& \multicolumn{2}{c}{\textbf{Languages}} & \multicolumn{4}{c}{\textbf{Context types}} \\
& source & target & source & target & preceding & following \\
\hline
\citet{Tiedemann2017} & DE & EN & x & x & x & \\
\citet{Jean2017} & EN & FR/DE & x & & x & \\
\citet{Wang2017} & ZH & EN & x & & x & \\
\citet{Voita2018} & EN & RU & x & & x & x\\
\citet{Bawden2017} & EN & FR & x & x & x & \\
\citet{DBLP:conf/acl/HaffariM18} & FR/DE/ET & EN & x & x & x & \\
\citet{agrawal2018} & EN & IT & x & x & x & x \\
\end{tabular}
\caption{Overview of context-aware translation models in related work.}\label{tbl:rel-overview}
\end{center}
\end{table*}
The simplest possible extension is to translate units larger than sentences. \citet{Tiedemann2017} concatenate each sentence with the sentence that precedes it, for the source side of the corpus or both sides.
All of their models are standard sequence-to-sequence models built with recurrent neural networks (RNNs), since the method does not require any architectural change. \citet{agrawal2018} use the same concatenation technique with a Transformer architecture \cite{Vaswani2017}, and experiment with wider context.
A number of works do propose changes to the NMT architecture. A common technique is to extend a standard encoder-decoder model by additional encoders for the context sentence(s), with a modified attention mechanism \cite{Jean2017,Bawden2017,Voita2018}. One aspect that differs between these works is the architecture of the encoder and attention. While \citet{Jean2017,Bawden2017} extend an RNN encoder-decoder with a second encoder that the decoder attends to, \citet{Voita2018} extend the Transformer architecture with an encoder that is attended to by the main encoder. \citet{Voita2018} also introduce parameter sharing between the main encoder and the context encoder, but do not empirically demonstrate its importance.
While the number of encoded sentences in the previous work is fixed, \citet{Wang2017,DBLP:conf/acl/HaffariM18} explore the integration of variable-size context through a hierarchical architecture, where a first-level RNN reads in words to produce sentence vectors, which are then fed into a second-level RNN to produce a document summary.
Apart from differences in the architectures, related work varies in whether it considers source context, target context, or both (see Table \ref{tbl:rel-overview} for an overview of language arcs and context types).
Some work considers only source context, but for pronoun translation, target-side context is intuitively important for disambiguation, especially if the antecedent itself is ambiguous.
In our evaluation, we therefore emphasize models that take into account both source and target context.
Our experiments are based on models from \citet{Bawden2017}, who have released their source code.\footnote{\url{https://github.com/rbawden/nematus}} We extend their models with parameter sharing, which was shown to be beneficial by \citet{Voita2018}. Additionally, we consider a concatenative baseline, similar to \citet{Tiedemann2017}, and Transformer-based models \citep{Voita2018}.
\subsection{Evaluation of Pronoun Translation} \label{subsec:related-eval}
Pronouns can serve a variety of functions with complex cross-lingual variation \cite{guillouphd},
and hand-picked, manually annotated test suites have been presented for the evaluation of pronoun translation \cite{Guillou2016b,Isabelle2017,Bawden2017}.
While suitable for analysis, the small size of the test suites makes it hard to make statistically confident comparisons between systems,
and the hand-picked nature of the test suites introduces biases.\footnote{For example, all pronoun examples in the test suite by \citet{Bawden2017} require the previous target sentence for disambiguation, and thus do not reward models that condition on more than one sentence of context.}
To overcome these problems, we opted for a fully automatic approach to constructing a large-scale test suite.
Conceptually, our test set is most similar to the ``cross-lingual pronoun prediction'' task held at DiscoMT and WMT in recent years \cite{Hardmeier2015,Guillou2016,Loaiciga2017}: participants are asked to fill a gap in a target sentence, where gaps correspond to pronouns.
The first edition of the task focused on English$\to$French, and it was found that local context (such as the verb group) was a strong signal for pronoun prediction. Hence, future editions only provided target-side lemmas instead of fully inflected forms, which makes the task less suitable to evaluate
end-to-end neural machine translation systems, although such systems have been trained on the task \cite{jean-EtAl:2017:DiscoMT}.
\citet{Loaiciga2017} do not report on the proportion of intra-sentential and inter-sentential anaphora in their test set, but the two top-performing systems only made use of intra-sentential information.
Our test suite focuses on allowing the comparison of end-to-end context-aware NMT systems, and we thus extract a large number of \emph{inter-sentential anaphora}, with meta-data allowing for a focus on inter-sentential anaphora with a long distance between the pronoun and its antecedent.
Our focus on evaluating end-to-end NMT systems also relieves us from having to provide annotated training sets, and reduces pressure to achieve balance and full coverage of phenomena.\footnote{For example, we do not consider cases where English {\em it} is translated into something other than a personal pronoun. While this would be a severe blind spot in a training set for pronoun prediction, the focused nature of our test suite does not impair the performance of end-to-end NMT systems on other phenomena.}
An alternative approach to automatically evaluate pronoun translation are reference-based methods that produce a score based on word alignment between source, translation output, and reference translation, and identification of pronouns in them, such as AutoPRF \cite{hardmeier2010} and APT \cite{miculicich2017validation}.
\citet{guillou2018} perform a human meta-evaluation and show substantial disagreement between reference-based metrics and human judges, especially because there often exist valid alternative translations that use different pronouns than the reference.
Our test set, and our protocol of generating contrastive examples, is focused on selected pronouns to minimize the risk of producing contrastive examples that are actually valid translations.
\section{Test set with contrastive examples} \label{sec:testset}
Contrastive evaluation requires a large set of suitable examples that involve the translation of pronouns. As additional goals, our test set is designed to 1) focus on \textit{hard} cases, so that it can be used as a benchmark to track progress in context-aware translation and 2) allow for fine-grained analysis.
Section \ref{subsec:automatic-extraction} describes how we extract our data set. Section \ref{subsec:eval-scoring} explains how, given a set of contrastive examples, contrastive evaluation works.
\subsection{Automatic extraction of contrastive examples from corpora} \label{subsec:automatic-extraction}
We automatically create a test set from the OpenSubtitles corpus \citep{Lison2016}.\footnote{\url{http://opus.nlpl.eu/OpenSubtitles2016.php}} The goal is to provide a large number of difficult test cases where an English pronoun has to be translated to a German pronoun.
The most challenging cases are translating {\em it} to either {\em er, sie} or {\em es}, depending on the grammatical gender of the antecedent.\footnote{The pronouns {\em he} and {\em she} usually refer to a person in English, and since persons do not change gender in the translation, we assume that learning the correspondences {\em he} $\rightarrow$ {\em er} and {\em she} $\rightarrow$ {\em sie} does not present a challenge for a model. Cases where {\em he} or {\em she} refer to a noun that is not a person are possible, but extremely rare.} Not only is the translation of {\em it} ambiguous, there is also class imbalance in the training data (see Table \ref{Tab:fast_align_freqs}). There is roughly a 30\% probability that {\em it} is aligned to {\em es},\footnote{Note that these statistics include non-referential uses of {\em it}, that we exclude from our testset.} which makes it difficult to learn to translate {\em er} and {\em sie}. We use parsing and automatic co-reference resolution to find translation pairs that satisfy our constraints.
\begin{table}
\begin{center}
\begin{tabular}{lrr}
\toprule
Alignment & Frequency & Probability \\
\midrule
it$\rightarrow$es & 255764 & 0.334 \\
it$\rightarrow$sie & 64446 & 0.084 \\
it$\rightarrow$er & 44543 & 0.058 \\
it$\rightarrow$ist & 42614 & 0.055 \\
it$\rightarrow$Sie & 26054 & 0.034 \\
it$\rightarrow$, & 21037 & 0.027 \\
it$\rightarrow$das & 17992 & 0.023 \\
it$\rightarrow$dies & 11943 & 0.015 \\
it$\rightarrow$wird & 11886 & 0.015 \\
it$\rightarrow$man & 10539 & 0.013 \\
it$\rightarrow$ihn & 7744 & 0.010 \\
\bottomrule
\end{tabular}
\caption{Frequency and probability of alignments of \textit{it} in the training data of our systems (all data from the WMT 2017 news translation task). Alignments are produced by a fast\_align model.}\label{Tab:fast_align_freqs}
\end{center}
\end{table}
To provide a basis for filtering with constraints, we tokenize the whole data set with the Moses tokenizer, generate symmetric word alignments with fast\_align \citep{Dyer2013}, parse the English text with CoreNLP \citep{Manning2014}, parse the German text with ParZu \citep{sennrich2013} and perform coreference resolution on both sides. The coreference chains are obtained with the neural model of CoreNLP for English, and with CorZu for German \citep{Tuggener2016}, respectively.
\begin{table*}
\begin{center}
\begin{tabular}{lll}
\toprule
source: & {\em It could get tangled in your hair.}\\
reference: & {\em \textbf{Sie} k\"onnte sich in deinem Haar verfangen.} \\
\midrule
contrastive:& {\em \textbf{Er} k\"onnte sich in deinem Haar verfangen.} \\
contrastive:& {\em \textbf{Es} k\"onnte sich in deinem Haar verfangen.} \\
\midrule
antecedent en: & a bat \\
antecedent de: & eine Fledermaus (f.) \\
antecedent distance : & 1 \\
\bottomrule
\end{tabular}
\caption{Example sentence pair with contrastive translations. An antecedent distance of 1 means that the antecedent is in the immediately preceding sentence.}\label{Tab:example}
\end{center}
\end{table*}
Then we opt for high-precision, aggressive filtering, according to the following protocol: for each pair of sentences $(e, f)$ in English and German, extract iff
\begin{itemize}
\item $e$ contains the English pronoun {\em it}, and $f$ contains a German pronoun that is third person singular ({\em er, sie } or {\em es}), as indicated by their part-of-speech tags;
\item those pronouns are aligned to each other;
\item both pronouns are in a coreference chain;
\item their nominal antecedents in the coreference chain are aligned on word level.
\end{itemize}
This removes most candidate pairs, but is necessary to overcome the noise introduced by our preprocessing pipeline, most notably coreference resolution.
From the filtered set, we create a balanced test set by randomly sampling 4000 instances of each of the three translations of {\em it} under consideration ({\em er}, {\em sie}, {\em es}). We do not balance antecedent distance. See Table \ref{Tab:testsetStats} for the distribution of pronoun pairs and antecedent distance in the test set.
For each sentence pair in the resulting test set, we introduce \textit{contrastive translations}.
A contrastive translation is a translation variant where the correct pronoun is swapped with an incorrect one. For an example, see Table \ref{Tab:example}, where the pronoun {\em it} in the original translation corresponds to {\em sie} because the antecedent {\em bat} is a feminine noun in German ({\em Fledermaus}). We produce wrong translations by replacing {\em sie} with one of the other pronouns ({\em er}, {\em es}).
Note that, by themselves, these contrastive translations are grammatically correct if the antecedent is outside the current sentence. The test set also contains pronouns with an antecedent in the same sentence (antecedent distance 0). Those examples do not require any additional context for disambiguation and we therefore expect the sentence-level baseline to perform well on them.
We take extra care to ensure that the resulting contrastive translations are grammatically correct, because ungrammatical sentences are easily dismissed by an NMT system. For instance, if there are any possessive pronouns (such as {\em seine}) in the sentence, we also change their gender to match the personal pronoun replacement.
The German coreference resolution system does not resolve {\em es} because most instances of {\em es} in German are either non-referential forms, or they refer to a clause instead of a nominal antecedent. We limit the test set to nominal antecedents, as these are the only ambiguous cases with respect to translation.
For this reason, we have to rely entirely on the English coreference links for the extraction of sentence pairs with {\em it$\rightarrow$es}, as opposed to pairs with {\em it$\rightarrow$er} and {\em it$\rightarrow$sie} where we have coreference chains in both languages.\footnote{There are some cases where the antecedent is listed as {\em it} in the test set. This is our fallback behaviour if the coreference chain does not contain any noun. In that case, we do not know the true antecedent.}
Our extraction process respects document boundaries, to ensure we always search for the right context. We extract additional information from the annotated documents, such as the distance (in sentences) between pronouns and their antecedents, the document of origin, lemma, morphology and dependency information if available.
\begin{table}
\begin{center}
\begin{tabular}{crrrr}
\toprule
distance & {\em it}$\rightarrow${\em es} & {\em it}$\rightarrow${\em er} & {\em it}$\rightarrow${\em sie} &total \\ \cmidrule{2-5}
\phantom{$>$}0 & 872 & 736 & 792 & 2400\\
\phantom{$>$}1 & 1892 & 2577 & 2606& 7075\\
\phantom{$>$}2 & 631 & 459 & 420 &1510\\
\phantom{$>$}3 & 274 & 167 & 132 & 573\\
$>$3 & 331 & 61 & 50 & 442\\ \cmidrule{2-5}
total & 4000 & 4000 & 4000 & 12000\\
\bottomrule
\end{tabular}
\caption{Test set frequencies of pronoun pairs and antecedent distance (measured in sentences).}\label{Tab:testsetStats}
\end{center}
\end{table}
\subsection{Evaluation by scoring} \label{subsec:eval-scoring}
Contrastive evaluation is different from conventional evaluation of machine translation in that it does not require any translation. Rather than testing a model's ability to translate, it is a method to test a model's ability to \textit{discriminate} between given good and bad translations.
We exploit the fact that NMT systems are in fact language models of the target language, conditioned on source text. Like language models, NMT systems can be used to compute a model score (the negative log probability) for an existing translation. Contrastive evaluation, then, means to compare the model score of two pairs of inputs: $(actual\ source,\ reference\ translation)$ and $(actual\ source,\ contrastive\ translation)$. If the model score of the actual reference translation is higher, we assume that this model can detect wrong pronoun translations.
However, this does \textit{not} mean that systems actually produce the reference translation when given the source sentence for translation. An entirely different target sequence might rank higher in the system's beam during decoding. The only conclusion permitted by contrastive evaluation is whether or not the reference translation is more probable than a contrastive variant.
If the model score of the reference is indeed higher, we refer to this outcome as a ``correct decision'' by the model. The model's decision is only correct if the reference translation has a higher score than any contrastive translation. In our evaluation, we aggregate model decisions on the whole test set and report the overall percentage of correct decisions as accuracy.
During scoring, the model is provided with reference translations as target context, while during translation, the model needs to predict the full sequence. It is an open question to what extent performance deteriorates when context is itself predicted, and thus noisy. We highlight that the same problem arises for sentence-level NMT, and has been addressed with alternative training strategies \cite{Ranzato2015}.
\section{Context-Aware NMT Models} \label{sec:models}
This section describes several context-aware NMT models that we use in our experiments. They fall into two major categories: models based on RNNs and models based on the Transformer architecture \cite{Vaswani2017}. We experiment with additional context on the source side and target side.
\subsection{Recurrent Models}
We consider the following recurrent baselines:
\textbf{baseline} Our baseline model is a standard bidirectional RNN model with attention, trained with Nematus. It operates on the sentence level and does not see any additional context. The input and output embeddings of the decoder are tied, encoder embeddings are not.
\textbf{concat22} We concatenate each sentence with one preceding sentence, for both the source and target side of the corpus. Then we train on this new data set without any changes to the model architecture. This very simple method is inspired by \citet{Tiedemann2017}.
The following models are taken, or slightly adapted, from \citet{Bawden2017}. For this reason, we give only a very short description of them here and the reader is referred to their work for details.
\textbf{s-hier} A multi-encoder architecture with hierarchical attention. This model has access to one additional context: the previous source sentence. It is read by a separate encoder, and attended to by an additional attention network. The output of the resulting two attention vectors is combined with yet another attention network.
\textbf{s-t-hier} Identical to {\em s-hier}, except that it considers two additional contexts: the previous source sentence and previous target sentence. Both are read by separate encoders, and sequences from all encoders are combined with hierarchical attention.
\textbf{s-hier-to-2} The model has an additional encoder for source context, whereas the target side of the corpus is concatenated, in the same way as for {\em concat22}. This model achieved the best results in \citet{Bawden2017}.
For each variant, we also introduce and test weight tying: we share the parameters of embedding matrices between encoders that read the same kind of text (source or target side).
\subsection{Transformer Models}
All remaining models are based on the Transformer architecture \cite{Vaswani2017}. A Transformer avoids recurrence completely: it follows an encoder-decoder architecture using stacked self-attention and fully connected layers for both the encoder and decoder.
\textbf{baseline} A standard context-agnostic Transformer. All model parameters are identical to a {\em Transformer-base} in \citet{Vaswani2017}.
\textbf{concat22} A simple concatentation model where only the training data is modified, in the same way as for the recurrent {\em concat22} model.
\textbf{concat21} Trained on data where the preceding sentence is concatenated to the current one only on the source side. This model is also taken from \citet{Tiedemann2017}.
\textbf{\citet{Voita2018}} A more sophisticated context-aware Transformer that uses source context only. It has a separate encoder for source context, but all layers except the last one are shared between encoders. A source and context sentence are first encoded independently, and then a single attention layer and a gating function are used to produce a context-aware representation of the source sentence. Such restricted interaction with context is shown to be beneficial for analysis of contextual phenomena captured by the model. For details the reader is referred to their work.
\section{Experiments} \label{sec:experiments}
We train all models on the data from the WMT 2017 English$\to$German news translation shared task ($\sim$ 5.8 million sentence pairs). These corpora do not have document boundaries, therefore a small fraction of sentences will be paired with wrong context,
but we expect the model to be robust against occasional random context (see also \citealt{Voita2018}). Experimental setups for the RNN and Transformer models are different, and we describe them separately.
All RNN-based models are trained with Nematus \cite{sennrich-EtAl:2017:EACLDemo}. We learn a joint BPE model with 89.5k merge operations \cite{sennrich-haddow-birch:2016:P16-12}. We train shallow models with an embedding size of 512, a hidden layer size of 1024 and layer normalization. Models are trained with Adam \cite{Kingma2015}, with an initial learning rate of 0.0001. We apply early stopping based on validation perplexity. The batch size for training is 80, and the maximum length of training sequences is 100 (if input sentences are concatenated) or 50 (if input lines are single sentences).
For our Transformer-based experiments, we use a custom implementation and follow the hyperparameters from \citet{Vaswani2017,Voita2018}.
Systems are trained on lowercased text that was encoded using BPE (32k merge operations).
Models consist of 6 encoder and decoder layers with 8 attention heads.
The hidden state size is 512, the size of feedforward layers is 2048.
Model performance is evaluated in terms of BLEU, on \texttt{newstest2017}, \texttt{newstest2018} and all sentence pairs from our pronoun test set. We compute scores with SacreBLEU \cite{post2018call}.\footnote{Our (cased) SacreBLEU signature is \texttt{BLEU+c.mixed+ l.en-de+\#.1+s.exp+t.wmt\{17,18\}+tok.13a+ v.1.2.10}.} Evaluation with BLEU is done mainly to control for overall translation quality.
To evaluate pronoun translation, we perform contrastive evaluation and report the accuracy of models on our contrastive test set.
\begin{table*}
\centering
\begin{tabular}{lcccccc}
\toprule
& \multicolumn{2}{c}{newstest2017} & \multicolumn{2}{c}{newstest2018} & \multicolumn{2}{c}{pronoun set} \\
& cased & uncased & cased & uncased & cased & uncased \\
\cmidrule{2-7}
baseline & 23.0 & 23.7 & 33.7 & 34.2 & 19.4 & 19.9\\
concat22 & 23.8 & 24.4 & \textbf{34.5}& 35.0 & \textbf{20.2} & 20.8 \\
\midrule
\multicolumn{3}{l}{\bf independent encoders}\\
s-hier & 23.5 & 24.0 & 33.5 & 34.0 & 18.9 & 19.5\\
s-hier-to-2 & 23.8 & 24.3 & 34.2 & 34.8 & 19.2 & 19.7\\
s-t-hier & 23.1 & 23.6 & 33.1 & 33.6 & 19.3 & 20.0\\
\midrule
\multicolumn{3}{l}{\bf with weight tying}\\
s-hier.tied & 23.6 & 24.1 & 33.7 & 34.2 & 19.7 & 20.3\\
s-hier-to-2.tied & \textbf{24.2} & 24.8 & 34.1 & 34.7 & 20.1 & 20.7 \\
s-t-hier.tied & 23.5 & 24.0 & 33.9 & 34.5 & 19.4 & 20.0\\
\midrule
\multicolumn{3}{l}{\bf Transformer-based models}\\
baseline & - & 24.6 & - & 35.4 & - & 21.1\\
concat21 & - & 24.8 & - & 35.3 & - & \textbf{21.8}\\
concat22 & - & 24.4 & - & 36.0 & - & 21.3\\
\cite{Voita2018} & - & \textbf{25.3} & - & \textbf{36.5} & - & 21.7 \\
\bottomrule
\end{tabular}
\caption{English$\to$German BLEU scores on newstest2017, newstest2018 and all sentence pairs from our pronoun test set. Case-sensitive and case-insensitive (uncased) scores are reported. Higher is better, and the best scores are marked in bold.}\label{Tab:bleu}
\end{table*}
\section{Evaluation} \label{sec:evaluation}
The BLEU scores in Table \ref{Tab:bleu} show a moderate improvement for most context-aware systems. This suggests that the architectural changes for the context-aware models do not degrade overall translation quality. The contrastive evaluation on our test set on the other hand shows a clear increase in the accuracy of pronoun translation: The best model {\em s-hier-to-2.tied} achieves a total of +16 percentage points accuracy on the test set over the baseline, see Table \ref{Tab:pairs}.
\begin{table}
\centering
\begin{tabular}{lcccc}
\toprule
& & \multicolumn{3}{c}{reference pronoun}\\
& total & {\em es} & {\em er} & {\em sie} \\ \cmidrule{2-5}
baseline & 0.44 & 0.85 & 0.17 & 0.31\\
concat22 & 0.53 & 0.84 & 0.32 & 0.42\\
\midrule
\multicolumn{3}{l}{\bf independent encoders}\\
s-hier & 0.43 & 0.80 & 0.20 & 0.29 \\
s-hier-to-2 & 0.55 & 0.84 & 0.41 & 0.40\\
s-t-hier & 0.52 & 0.88 & 0.32 & 0.36\\
\midrule
\multicolumn{3}{l}{\bf with weight tying}\\
s-hier.tied & 0.47 & 0.85 & 0.30 & 0.26 \\
s-hier-to-2.tied & \textbf{0.60} & 0.87 & \textbf{0.45} &\textbf{0.48}\\
s-t-hier.tied & 0.56 & 0.86 & 0.39 & 0.42 \\
\midrule
\multicolumn{3}{l}{\bf Transformer-based models}\\
baseline & 0.47 & 0.81 & 0.22 & 0.38 \\
concat21 & 0.48 & 0.88 & 0.26 & 0.31 \\
concat22 & 0.49 & \textbf{0.91} & 0.20 & 0.36 \\
\cite{Voita2018} & 0.49 & 0.84 & 0.23 & 0.39 \\
\bottomrule
\end{tabular}\textbf{}
\caption{Accuracy on contrastive test set (N=4000 per pronoun) with regard to reference pronoun.}\label{Tab:pairs}
\end{table}
\begin{table}
\begin{center}
\begin{tabular}{lcc}
\toprule
& \multicolumn{2}{c}{antecedent location}\\
& intrasegmental & external \\ \cmidrule{2-3}
baseline & 0.57& 0.41 \\
concat22 & 0.58 & 0.51 \\
\midrule
\multicolumn{3}{l}{\bf independent encoders}\\
s-hier & 0.58 & 0.39 \\
s-hier-to-2 & 0.63 & 0.53 \\
s-t-hier & 0.52 & 0.52\\
\midrule
\multicolumn{3}{l}{\bf with weight tying}\\
s-hier.tied & 0.56 & 0.45 \\
s-hier-to-2.tied & 0.65 & \textbf{0.58} \\
s-t-hier.tied & 0.57 & 0.55 \\
\midrule
\multicolumn{3}{l}{\bf Transformer-based models}\\
baseline & 0.70 & 0.41 \\
concat21 & 0.67 & 0.44 \\
concat22 & 0.56 & 0.47 \\
\cite{Voita2018} & \textbf{0.75} & 0.43 \\
\bottomrule
\end{tabular}
\caption{Accuracy on contrastive test set with regard to antecedent location (within segment vs.\ outside segment).}\label{Tab:segmental}
\end{center}
\end{table}
Table \ref{Tab:segmental} shows that context-aware models perform better than the baseline when the antecedent is outside the current sentence.
In our experiments, all context-aware models consider one preceding sentence as context.
The evaluation according to the distance of the antecedent in Table \ref{Tab:antedist} confirms that the subset of sentences with antecedent distance 1 benefits most from the tested context-aware models (up to +20 percentage points accuracy).
However, we note two surprising patterns:
\begin{itemize}
\item For inter-sentential anaphora, the performance of all systems, including the baseline, improves with increasing antecedent distance.
\item Context-aware systems that consider one preceding sentence also improve on intra-sentential anaphora, and on pronouns whose antecedent is outside the context window.
\end{itemize}
\begin{table*}
\begin{center}
\begin{tabular}{lccccc}
\toprule
& \multicolumn{5}{c}{antecedent distance} \\
& 0 & 1 & 2 & 3 & $>$3 \\ \cmidrule{2-6}
baseline & 0.57 & 0.38 & 0.47 & 0.52 & 0.67 \\
concat22 & 0.58 & 0.50 & 0.51 & 0.51 & 0.69 \\
\midrule
\multicolumn{3}{l}{\bf independent encoders}\\
s-hier & 0.58 & 0.36 & 0.42 & 0.46 & 0.61 \\
s-hier-to-2 & 0.63 & 0.51 & 0.54 & 0.60 & 0.70 \\
s-t-hier & 0.52 & 0.49 & \textbf{0.57} & \textbf{0.61} & 0.71 \\
\midrule
\multicolumn{3}{l}{\bf with weight tying}\\
s-hier.tied & 0.56 & 0.43 & 0.46 & 0.49 & 0.67 \\
s-hier-to-2.tied & 0.65 & \textbf{0.58} & 0.55 & 0.55 & \textbf{0.75} \\
s-t-hier.tied & 0.57 & 0.54 & 0.56 & 0.59 & 0.72 \\
\midrule
\multicolumn{3}{l}{\bf Transformer-based models}\\
baseline & 0.70 & 0.38 & 0.45 & 0.49 & 0.65 \\
concat21 & 0.67 & 0.42 & 0.45 & 0.47 & 0.66 \\
concat22 & 0.56 & 0.44 & 0.53 & 0.54 & 0.74 \\
\cite{Voita2018} & \textbf{0.75} & 0.39 & 0.48 & 0.54 & 0.66 \\
\bottomrule
\end{tabular}
\caption{Accuracy on contrastive test set with regard to antecedent distance of antecedent (in sentences).}\label{Tab:antedist}
\end{center}
\end{table*}
The first observation can be explained by the distribution of German pronouns in the test set. The further away the antecedent, the higher the percentage of {\em it}$\rightarrow${\em es} cases, which are the majority class, and thus the class that will be predicted most often if evidence for other classes is lacking. We speculate that this is due to our more permissive extraction heuristics for {\em it}$\rightarrow${\em es}.
\begin{table*}
\begin{center}
\begin{tabular}{ll}
\toprule
source sentence with antecedent & {\em What's with the door?}\\
target sentence with antecedent & {\em Was ist mit der T\"ur?}\\
source context & {\em \textbf{It} won't open.}\\
reference context & {\em \textbf{Sie} geht nicht auf.}\\
source sentence & {\em - Is \textbf{it} locked?} \\
reference sentence & {\em - Ist \textbf{sie} abgeschlossen?} \\ \midrule
contrastive 1 & {\em - Ist \textbf{er} abgeschlossen?} \\
contrastive 2 & {\em - Ist \textbf{es} abgeschlossen?}\\
\bottomrule
\end{tabular}
\caption{Example where 1) antecedent distance is $>$1 and 2) the context given contains another pronoun as an additional hint.}\label{Ex:farAnte}
\end{center}
\end{table*}
We attribute the second observation to the existence of coreference chains where the preceding sentence contains a pronoun that refers to the same nominal antecedent as the pronoun in the current sentence. Consider the example in Table \ref{Ex:farAnte}: The nominal antecedent of {\em it} in the current sentence is {\em door}, {\em T\"ur} in German with feminine gender. The nominal antecedent occurs two sentences before the current sentence, but the German sentence in between contains the pronoun {\em sie}, which is a useful signal for the context-aware models, even though they cannot know the nominal antecedent.
Note that only models aware of target-side context can benefit from such circumstances: The {\em s-hier} models as well as the Transformer model by \cite{Voita2018} only see source side context, which results in lower accuracy if the distance to the antecedent is $>$1, see Table \ref{Tab:antedist}.
While such coreference chains complicate the interpretation of the results, we note that improvements on inter-sentential anaphora with antecedent distance $>1$ are relatively small (compared to distance 1), and that performance is still relatively poor (especially for the minority classes {\em er} and {\em sie}). We encourage evaluation of wider-context models on this subset, which is still large thanks to the size of the full test set.
Regarding the comparison of different context-aware architectures, our results demonstrate the effectiveness of parameter sharing between the main encoder (or decoder) and the contextual encoder.
We observe an improvement of 5 percentage points from {\em s-hier-to-2} to {\em s-hier-to-2.tied}, and 4 percentage points from {\em s-t-hier} to {\em s-t-hier.tied}.
Context encoders introduce a large number of extra parameters, while inter-sentential context is only relevant for a relatively small number of predictions.
We hypothesize that the training signal is thus too weak to train a strong contextual encoder in an end-to-end fashion without parameter sharing.
Our results also confirm the finding by \citet{Bawden2017} that multi-encoder architectures, specifically {\em s-hier-to-2(.tied)}, can outperform a simple concatenation system in the translation of coreferential pronouns.
The Transformer-based models perform strongest on pronouns with intra-segmental antecedent, outperforming the recurrent baseline by 9--18 percentage points.
This is likely an effect of increased model depth and the self-attentional architecture in this set of experiments.
The model by \cite{Voita2018} only uses source context, and outperforms the most comparable RNN system, {\em s-hier.tied}.
However, the Transformer-based {\em concat22} slightly underperforms the RNN-based {\em concat22}, and we consider it future research how to better exploit target context with Transformer-based models.
\section{Conclusions}
We present a large-scale test suite to specifically test the capacity of NMT models to translate pronouns correctly. The test set contains 12,000 difficult cases of pronoun translations from English {\em it} to its German counterparts {\em er, sie} and {\em es}, extracted automatically from OpenSubtitles \citep{Lison2016}.
We evaluate recently proposed context-aware models on our test set. Even though the increase in BLEU score is moderate for all context-aware models, the improvement in the translation of pronouns is considerable: The best model ({\em s-hier-to-2.tied}) achieves a +16 percentage points gain in accuracy over the baseline.
Our experiments confirm the importance of careful architecture design, with multi-encoder architectures outperforming a model
that simply concatenates context sentences. We also demonstrate the effectiveness of parameter sharing between encoders of a context-aware model.
We hope the test set will prove useful for empirically validating novel architectures for context-aware NMT.
So far, we have only evaluated models that consider one sentence of context, but the nominal antecedent is more distant for a sizable proportion of the test set, and the evaluation of variable-size context models \cite{Wang2017,DBLP:conf/acl/HaffariM18} is interesting future work.
\section*{Acknowledgements}
We are grateful to the Swiss National Science Foundation (SNF) for supporting the project \mbox{CoNTra} (grant number 105212\_169888).
| {'timestamp': '2019-03-07T02:13:03', 'yymm': '1810', 'arxiv_id': '1810.02268', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02268'} | arxiv |
\section{Introduction}
Many machine learning (ML) problems involve iterative alternate optimization of different objectives $\{\ell_m\}_{m=1}^M$ w.r.t different sets of parameters $\{\bm{\theta}_n\}_{n=1}^N$ until a global consensus is reached. For instances, in training generative adversarial networks (GANs)~\citep{goodfellow2014generative}, parameters of the generator and the discriminator are alternately updated to an equilibrium;
in many multi-task learning problems~\citep{argyriou2007multi}, one usually has to alternate the optimization of different task-specific objectives on corresponded data, until the target task performance is maximized.
In these processes, one needs to determine which objective $\ell_m$ and which set of parameters $\bm{\theta}_n$ to choose at each step, and subsequently, how many iteration steps to perform for the subproblem $\min_{\bm{\theta}_n} \ell_m$. We refer to this as determining an \emph{optimization schedule} (or update schedule).
While extensive research has been focused on developing better optimization algorithms or update rules~\citep{kingma2014adam,bello2017neural,duchi2011adaptive,sutskever2013importance}, how to select optimization schedules has remained less studied.
When the objective is complex (e.g. non-convex or combinatorial) and the parameters to be optimized are high-dimensional, the optimization schedule can directly impact the quality of convergence. However, we hypothesize that the schedule is learnable in a data-driven way, with the following empirical evidence:
(1) The optimization of many ML models is sensitive to the update schedule. For examples, the updates of the generator and the discriminator in GANs are carefully reconciled to avoid otherwise model collapse or gradient vanishing~\citep{goodfellow2014generative,radford2015unsupervised};
In solving many multi-task learning or regularizer-augmented objectives, the optimization target $\mathcal{L}$ is a combination of multiple task-specific objectives. It is desirable to weight each objective differently as $\mathcal{L} = \sum_{m=1}^M \lambda_m \ell_m$, while different values of $\{\lambda_m\}_{m=1}^M$ result in different (local) optima.
This indicates that different loss terms shall not be treated equally, and achieving the best downstream task performance requires optimizing every $\ell_m$ to different extents. (2) Previous research and practice have suggested that there do exist optimization schedules that are more probable to produce better convergence than random ones, e.g. ~\citet{arjovsky2017wasserstein} and~\citet{salimans2016improved} suggest that keeping the steps of updating the generator and discriminator of GANs at $K:1 (K > 1)$ leads to faster and more stable training of GANs.
Based on the hypothesis, in this paper, we develop \emph{AutoLoss}, a generic meta-learning framework to automatically determine the optimization schedule in iterative and alternate optimization processes. AutoLoss introduces a parametric controller attached to an alternate optimization task. The controller is trained to capture the relations between the past history and the current state of the optimization process, and the next step of the decision on the update schedule. It takes as input a set of status features, and decides which objectives from $\{\ell_m\}_{m=1}^M$ to optimize, and which set of parameters from $\{\bm{\theta}_n\}_{n=1}^N$ to update. The controller is trained via policy gradient to maximize the eventual outcome of the optimization (e.g. downstream task performance). Once trained, it can guide the optimization of task models
to achieve higher quality of convergence faster, by predicting better schedules.
To evaluate the effectiveness of AutoLoss, we instantiate it on four typical ML tasks: $d$-ary quadratic regression, classification using a multi-layer perceptron (MLP), image generation using GANs, and neural machine translation (NMT) based on multi-task learning. We propose an effective set of features and reward functions that are suitable for the controllers' learning and decisions. We show that, on all four tasks, the AutoLoss controller is able to capture the distribution of better optimization schedules that result in higher quality of convergence on the corresponding task than strong baselines. For examples, on quadratic regression with L1 regularization, it learns to detect the potential risk of overfitting, and incorporates L1 regularization when necessary, helps the task model converge to better results that can hardly be achieved by optimizing linear combinations of objective terms. on GANs, the AutoLoss controller learns to balance the training of generator and discriminator dynamically, and report both faster per-epoch convergence and better quality of generators after convergence, compared to fixed heuristic-driven schedules. On machine translation, it automatically learns to resemble human-tuned update schedules while being more flexible, and reports better perplexity results.
In summary, we make the following contributions in this paper: (1) We present a unified formulation for iterative and alternate optimization processes, based on which, we develop AutoLoss, a generic framework to learn the discrete optimization schedule of such processes using reinforcement learning (RL). To our knowledge, this is the first framework that tries to learn the optimization schedule in a data-driven way.
(2) We instantiate AutoLoss on four ML tasks: $d$-ary regression, MLP classification, GANs, and NMT. We propose a novel set of features and reward functions to facilitate the training of AutoLoss controllers.
(3) We empirically demonstrate AutoLoss' efficacy: it delivers higher quality of convergence for all four tasks on synthetic and real dataset than strong baselines. Training AutoLoss controller has acceptable overhead less than most hyperparameter searching methods; the trained AutoLoss controller is generalizable -- it can guide and improve the training of a new task model with different specifications, or on different dataset.
\section{Related Work}
\noindent \textbf{Alternate Optimization.}
Many ML models are trained using algorithms with iterative and alternate workflows, such as EM~\citep{moon1996expectation}, stochastic gradient descent (SGD)~\citep{bottou2010large}, coordinate descent~\citep{wright2015coordinate}, multi-task learning~\citep{zhang2017survey}, etc. AutoLoss can improve these processes by learning a controller in a data-driven way, and figuring out better update schedules using this controller, as long as the schedule does affect the optimization goal. In this paper, we focus mostly on optimization problems, but note AutoLoss is applicable to alternate processes that involve non-optimization subtasks, such as sampling methods~\citep{griffiths2004finding, ma2015complete}.
\noindent \textbf{Meta learning.} Meta learning~\citep{andrychowicz2016learning, maclaurin2015gradient, wang2016learning, finn2017model, chen2016learning} has drawn considerable interest from the community, and has been recently applied to improve the optimization of ML models~\citep{ravi2016optimization, li2016learning, bello2017neural, fan2018learning}. Among these works, the closest to ours are~\citet{li2016learning, bello2017neural, fan2018learning}.~\citet{li2016learning} propose \emph{learning to optimize} to directly predict the gradient values at each step of SGD. Since the gradients are continuous and usually high-dimensional, directly regressing their values might be difficult, and the learned gradient regressor is nontransferable to new models or tasks. Differently,~\citet{bello2017neural} propose to learn better gradient update rules based on a domain specific language. The learned rules outperform manually designed ones and is generalizable. AutoLoss differs from this line of works -- instead of learning to generate values of updates (gradients), AutoLoss focuses on producing better scheduling of updates. Therefore AutoLoss can model other classes of problems such as scheduling the generator and discriminator training in GANs, or even go beyond optimization problems. In~\citet{fan2018learning}, a \emph{learning to teach} framework is proposed that a teacher model, trained by optimization metadata, can guide the learning of student models. AutoLoss instantiates the framework in the sense that the teacher model (controller) produces better schedules for the task model (student) optimization.
\noindent \textbf{AutoML.} Also of note is another line of works that apply RL to enable automatic machine learning (AutoML), such as device placement optimization~\citep{mirhoseini2017device}, neural architecture search~\citep{baker2016designing, zoph2016neural}, etc. While addressing different problems, AutoLoss' controller is trained in a similar way~\citep{peters2008reinforcement} for sequential and discrete predictions.
\section{AutoLoss}
\label{sec:autoloss}
\noindent \textbf{Background.} In most ML tasks, given observed data $\mathcal{D}$, we aim to minimize an objective function $\mathcal{L}(\mathcal{D}; \bm{\Theta})$ with respect to the parameters $\bm{\Theta}$ of the model that we use to characterize the data. Solving this minimization problem involves finding the optima of $\bm{\Theta}$ (denoted as $\bm{\Theta}^*$), which we usually resort to a variety of de facto optimization methods~\citep{boyd2004convex} if close-formed solutions are unavailable. In the rest of the paper, we will focus on two typical classes of optimization workflows which many modern ML model solvers would fall into: \emph{iterative} and \emph{alternate} optimization.
Iterative optimization methods look for the optimal parameter $\bm{\Theta}^{*}$ in an \emph{iterative-convergent} way, by repeatedly updating $\bm{\Theta}$ until certain stopping criteria is reached.
Specifically, at iteration $t$, the parameters $\bm{\Theta}$ are updated from $\bm{\Theta}^{(t)}$ to $\bm{\Theta}^{(t+1)}$ following the update equation $\bm{\Theta}^{(t+1)} = \bm{\Theta}^{(t)} + \epsilon \cdot \Delta_{\mathcal{L}}(\mathcal{D}^{(t)}; \bm{\Theta}^{(t)})$, where we denote $\Delta_{\mathcal{L}}$ as the function that calculates update values of $\bm{\Theta}$ depending on $\mathcal{L}$, $\mathcal{D}^{(t)} \subseteq \mathcal{D}$ as a subset of $\mathcal{D}$ used at iteration $t$ and $\epsilon$ a scaled factor. Many widely-adopted algorithms~\citep{bottou2010large,boyd2003subgradient} fall into this family, e.g. in the case for SGD, $\Delta_{\mathcal{L}}$ reduces to deriving the gradient updates $\nabla \bm{\Theta}$ (we skip optional steps such as momentum or projection for clarity), $D^{(t)}$ is a stochastic batch, and $\epsilon$ is the learning rate.
To describe alternate optimization, we notice the objective $\mathcal{L}$ is usually composed of multiple different optimization targets: $\mathcal{L} = \{\ell_m\}_{m=1}^M$, and we want $\bm{\Theta}^*$ to minimize a certain combination of them. For example, when fitting a regression model with mean square error (MSE), appending an L1 loss helps obtain sparsity; in this case, $\mathcal{L}$ is written as a linear combination of MSE and L1 terms.
Similarly, the parameters $\bm{\Theta}$ in many cases are also composable, e.g. when the model has multiple components with independent sets of parameters.
If we decompose $\bm{\Theta} = \{\bm{\theta}_n\}_{n=1}^N$, an alternate optimization (in our definition) contains multiple steps, where each step $t$ involves choosing $\ell_{m_t} \in \mathcal{L}, \bm{\theta}_{n_t} \in \bm{\Theta}$, which we will call as \emph{determining an optimization action} (notated as $a$), and update $\bm{\theta}_{n_t}$ w.r.t. $\ell_{m_t}$.
Further, we note that many ML optimization tasks in practice are both iterative and alternate,
such as the training process of GANs, where the updates of generator and discriminator parameters are alternated, each with a few iterations of stochastic updates, until equilibrium.
We therefore present iterative and alternate optimization with the following unified formulation:
\begin{equation}
\mbox{for } t = 1 \rightarrow T, \mbox{ choose } (\ell_{m_t}, \bm{\theta}_{n_t}) = a_{q_t} \in \mathcal{A}, \mbox{ update } \bm{\theta}^{(t+1)}_{n_t} = \bm{\theta}^{(t)}_{n_t} + \epsilon \cdot \Delta_{\ell_{m_t}}^{n_t},
\label{eq:unified_workflow}
\end{equation}
where $\mathcal{A} = \{ a_q\}_{q=1}^Q$ denotes the task-specific action space that defines all legitimate pairs of loss and parameter to choose from; $\Delta_{\ell_{m_t}}^{n_t}$ are update values of ${\bm{\theta}}_{n_t}$ w.r.t. ${\ell}_{m_t}$. Eq.~\ref{eq:unified_workflow} reduces to the vanilla form of iterative optimization when $\mathcal{A} = \{(\mathcal{L}, \bm{\Theta})\}$.
\noindent \textbf{AutoLoss.}
Given the formulation in Eq.~\ref{eq:unified_workflow}, our goal is to determine $a_{q_t}$, i.e. which losses to optimize and what parameters to update at each $t$, in order to maximize the downstream task performance. We introduce a meta model, which we call \emph{controller}, to be distinguished from the \emph{task model} used in the downstream task. The controller is expected to learn during its exploration of task model optimization processes, and is able to decide how to update once sufficient knowledge has been accumulated.
Specifically, we let the controller make sequential decisions at each step $t$; it scans through the past history and the current states of the process (described as a feature vector $\bm{X}^{(t)} \in \mathbb{R}^K$), and predicts a one-hot vector $\bm{Y}^{(t)} \in \{0, 1\}^{|\mathcal{A}|}$, i.e. $a_q \in |\mathcal{A}|$ will be selected if the $q$th entry of $\bm{Y}^{(t)}$ is 1.
We model our controller as a conditional distribution $p(\bm{y}|\bm{x}; \bm{\phi})$ parameterized by $\bm{\phi}$\footnote{The other alternate is to condition the decision at the $t$ step on the decision made at the $t-1$ step, though we choose a simpler one to highlight the generic idea behind AutoLoss.}, where we denote $\bm{y}$ and $\bm{x}$ as the $|\mathcal{A}|$-dim decision variable and $K$-dim feature variable, respectively. At each step $t$, we sample $\bm{Y}^{(t)} \sim p(\bm{y}|\bm{x} = \bm{X}^{(t)}; \bm{\phi})$, and perform updates following Eq.~\ref{eq:unified_workflow} and $\bm{Y}^{(t)}$.
\noindent \textbf{Parameter Learning}.
The parameters of the controller $\bm{\phi}$ is trained to maximize the performance of the optimization task given sampled sequences of decisions within $T$ steps, notated as $\mathcal{Y} = \{\bm{Y}^{(t)}\}_{t=1}^T$. Accordingly, we introduce the training objective of the controller as $J(\bm{\phi}) = \mathbb{E}_{\mathcal{Y} \sim p(\bm{y}|\bm{x}; \bm{\phi})} \big[ R(\mathcal{Y}) | \mathcal{L}, \bm{\Theta} \big]$, where $R(\cdot)$ is the reward function that evaluates the final task performance after applying the schedule $\mathcal{Y}$ for its optimization. We will discuss the form of $R$ in \S\ref{sec:applications}.
Since the decision process involves non-differentiable sampling, we learn the parameters using REINFORCE~\citep{williams1992simple} and future variants (see \S\ref{sec:applications} for details)~\citep{schulman2017proximal}, where the unbiased policy gradients at each updating step of the controller are estimated by sampling $S$ sequences of decisions $\{\mathcal{Y}_s\}_{s=1}^S$ (for all experiments we set $S=1$) and compute
\begin{equation}
\nabla_{\phi} J(\phi) = \frac{1}{S} \sum_{s=1}^S \big[ (R(\mathcal{Y}_s) - B) \cdot \nabla_{\phi} \sum_{t=1}^T \log p(\bm{Y}^{(t)}_s |\bm{X}^{(t)}_s; \bm{\phi})| \mathcal{L}, \bm{\Theta} \big],
\label{eq:policy_gradient}
\end{equation}
where $\bm{Y}_s^{(t)}$ is the $t$th decision in $\mathcal{Y}_s$.
To reduce the variance, we introduce a baseline term $B$ in Eq.~\ref{eq:policy_gradient} to stabilize the training (similar to ~\citet{pham2018efficient}), where $B$ is defined as a moving average of received reward: $B^{(h+1)} \leftarrow \eta B^{(h)} + (1-\eta) R^{(h)}$ with $\eta$ as a decay factor. Whenever applicable, the final reward $R(\mathcal{Y}_s) - B$ is clipped to a given range to avoid exploding or vanishing gradients. We present the detailed training algorithm in Appendix~\ref{sec:training_algo}.
\section{Applications}
\label{sec:applications}
We next apply AutoLoss to four specific ML tasks: $d$-ary quadratic regression and MLP classification with L1 regularization, image generation using GANs, and neural machine translation based on multi-task learning. We instantiate $\mathcal{L}, \bm{\Theta}, \mathcal{A}, \bm{X}^{(t)}$ and $R$ for these tasks.
\subsection{Quadratic Regression and MLP Classification with L1 Regularization}
Given training data $\mathcal{D} = \{\bm{u}_p, v_p\}_{p=1}^P, \bm{u}_{p} \in \mathbb{R}^d, v_p \in \mathbb{R}$ generated by a linear model with Gaussian noise,
we try to fit them using a $d$-ary quadratic model $f: \mathbb{R}^d \rightarrow \mathbb{R}$ as $f(\bm{u}; \bm{\Theta}) = \bm{u}^{\top} \bm{A} \bm{u} + \bm{b}^{\top} \bm{u} + c$, where parameters $\bm{\Theta} = \{\bm{A}, \bm{b}, c\}$ are optimized via minimizing the mean square error (MSE) $\ell_1(\bm{\Theta}) = \mathbb{E}_{(\bm{u}, v) \in \mathcal{D}} [f(\bm{u; \bm{\Theta}}) - v]^2$. Since fitting the data using a higher-order model is prone to overfitting, we add an L1 term $\ell_{2} = \|\bm{\Theta}\|_1$. A traditional way to find $\bm{\Theta}^{*}$ is to minimize $\ell_1 + \lambda \ell_2$, where $\lambda$ is a hyperparameter yet to be determined by hyperparameter search. This problem can be solved using many iterative optimization methods, e.g. SGD.
To model this problem using AutoLoss, we define $\mathcal{L} = \{\ell_1, \ell_2\}$ ($M=2$), $\bm{\Theta} = \{\bm{\theta}_1\}$ with $\bm{\theta}_1 = \{\bm{A}, \bm{b}, c\}$ ($N=1$), and $\mathcal{A} = \{(\ell_1, \bm{\theta}), (\ell_2, \bm{\theta})\}$, i.e. the controller has Bernoulli outputs which we sample decisions from.
Similarly, we apply AutoLoss in training a binary MLP classifier $f(\bm{\Theta}): \mathbb{R}^d \rightarrow \{0, 1\}$ with ReLU nonlinearity, which is non-convex and highly prone to overfitting. We materialize $\bm{\Theta} = \{\bm{\theta}_1\}$ where $\bm{\theta}_1$ are all MLP parameters, $\mathcal{L} = \{\ell_1, \ell_2\}$ with $\ell_1$ as the binary cross entropy (BCE) and $\ell_2 = \|\bm{\Theta}\|_{1}$, and $\mathcal{A} = \{(\ell_1, \bm{\theta}), (\ell_2, \bm{\theta})\}$.
For both tasks, we design $\bm{X}^{(t)}$ as a concatenation of the following features in order to capture the current optimization state and the past history: (1) \emph{training progress}: the percentile progress of training $t/T$. (2) \emph{normalized gradient magnitude}: an $M$-dim vector where the $m$th entry is $\frac{\|\nabla_{\bm{\Theta}} \ell_m\|_2}{\sqrt{\mbox{dim}(\bm{\Theta})}}$. (3) \emph{loss values}: an $M$-dim vector $[\ell_1, \dots, \ell_M]$ that contains values of each $\ell_m$ at $t$. Extracting features (2)(3) requires computing $\ell_m$ and $\nabla_{\bm{\Theta}} \ell_m$ repeatedly at each step $t$, which might be inefficient. We alternatively maintain and use their latest history values -- we compute $\ell_m$ and $\nabla_{\bm{\Theta}} \ell_m$ only when the controller has decided to optimize $\ell_m$ at the jcurrent step, and update their values in the history accordingly.
(4) \emph{validation metrics}: the loss value of $\ell_1(\bm{\Theta}^{(t)})$ (MSE for regression or BCE for classification) evaluated on a validation set, the exponential moving averages of it and of its higher-order differences.
Similarly, we evaluate the validation error only when needed and use their most recent values stored in the history.
For the reward function, we simply instantiated $R = \frac{C}{err}$ for regression and $R = \frac{C}{err - 1}$ for classification, respectively, where $C$ is a constant, $\mbox{err}$ is MSE for regression or classification error for classification, evaluated using converged parameters $\bm{\Theta}^{(T)}$ on the validation dataset. Hence, the controller obtains a larger reward if the task model achieves a lower MSE or classification error.
It is worth noting that we intentionally choose these two models as a proof-of-concept that AutoLoss would work on both convex and non-convex cases. See \S\ref{sec:evaluation} for more experiment results.
\subsection{GANs}
\label{sec:applications:gans}
A vanilla GAN has two set of parameters: the parameters of the generator $G$ as $\bm{\theta}_1$ and those of the discriminator $D$ as $\bm{\theta}_2$, alternately trained via a minimax game as follows (where $\bm{z}$ is notated a noise variable):
\begin{equation*}
\min_{\bm{\theta_1}} \max_{\bm{\theta_2}} \mathcal{L}(\bm{\theta}_1, \bm{\theta}_2) = \mathbb{E}_{\bm{u} \sim p_{data}(\bm{u})} [\log D(\bm{u})] + \mathbb{E}_{\bm{z} \sim p_{\bm{z}}(\bm{z})} [\log (1 - D(G(\bm{z})))].
\end{equation*}
This is a typical alternate process that cannot be expressed by any linear combination of loss terms (hence can hardly benefit from hyperparameter search as in the previous two cases).
How to appropriately balance the optimization of $\bm{\theta}_1$ and $\bm{\theta}_2$ is a key factor that affects the success of GAN training. Beyond fixed schedules, automatically adjusting the training of $G$ and $D$ remains untackled. Fortunately, AutoLoss offers unique opportunities to learn the optimization schedules of GANs.
In particular, we instantiate $\bm{\Theta} = \{\bm{\theta}_1, \bm{\theta}_2\}$, $\mathcal{L} = \{\ell_1, \ell_2\}$ with $\ell_1 = \mathbb{E}_{\bm{z} \sim p_{\bm{z}}(\bm{z})} [\log (1 - D(G(\bm{z})))]$, $\ell_2 = - \mathbb{E}_{\bm{u} \sim p_{data}(\bm{u})} [\log D(\bm{u})] - \mathbb{E}_{\bm{z} \sim p_{\bm{z}}(\bm{z})} [\log (1 - D(G(\bm{z})))]$. To match the possible actions in GANs training, we set $\mathcal{A}$ as $\{(\ell_1, \bm{\theta}_1), (\ell_2, \bm{\theta}_2)\}$, i.e. the controller chooses at each step to optimize one of $G$ and $D$.
To track the training status of both $G$ and $D$, we reuse the same four aspects of features (1)-(4) in previous applications with the following variations: (2) We use a 3D vector $[\frac{\|\nabla_{\bm{\theta}_1} \ell_1\|_2}{\sqrt{\mbox{dim}(\bm{\theta}_1)}}, \frac{\|\nabla_{\bm{\theta}_2} \ell_2\|_2}{\sqrt{\mbox{dim}(\bm{\theta}_2)}}, \log{\frac{\|\nabla_{\bm{\theta}_1} \ell_1\|_2 \cdot \sqrt{\mbox{dim}(\bm{\theta}_2)}}{\|\nabla_{\bm{\theta}_2} \ell_2\|_2 \cdot \sqrt{\mbox{dim}(\bm{\theta}_1)}}}]$, where the first two entries are gradient norms of $G$ and $D$, respectively, while the third is their log ratio to reflect how balanced the updates are; (3) A vector of training losses and their ratio $[\ell_1, \ell_2, \frac{\ell_1}{\ell_2}]$; (4) As there is no clear validation metric to evaluate a GAN, for $G$, we generate a few samples given its current state of parameters $\bm{\theta}^{(t)}_1$, and compute the \emph{inception score} (notated as $\mathcal{IS}$) of them as a feature to indicate how good $G$ is. For $D$, we sample equal number of samples from both $G$ and the training set and use $D$'s classification error (classified as real or fake) on them as a feature. For (2)-(4), we similarly use their most recent history values for improved efficiency. In a same way, we instantiate $R = C \cdot \mathcal{IS}^2$ to encourage the controller to predict schedules that lead to better generators.
\subsection{Multi-task Neural Machine Translation}
Most multi-task learning problems require optimizing several domain-specific objectives jointly for improved performance~\citep{argyriou2007multi}. However, without carefully weighting or scheduling of the optimization of each objective, the results may unexpectedly degrade than optimizing a single objective~\citep{zhang2017survey, teh2017distral}. As the third application, we apply AutoLoss to find better optimization schedules for multi-task learning based neural machine translation (NMT). Following~\citet{niehues2017exploiting}, we build an attention-based encoder-decoder model with three task objectives: the target task translates German into English ($\ell_1$), while the secondary tasks are German named entity recognition (NER) ($\ell_2$) and German POS tagging ($\ell_3$). We use a shared encoder $E$ with parameters $\bm{\theta}_{e}$ and separate decoders $D_{MT}, D_{NER}, D_{POS}$ with parameters as $\bm{\theta}_d^{MT}, \bm{\theta}_d^{NER}, \bm{\theta}_d^{POS}$ for the aforementioned three tasks, respectively. To fit within the AutoLoss framework, we set $\mathcal{L} = \{\ell_m\}_{m=1}^3$, $\bm{\Theta} = \{\bm{\theta}_1, \bm{\theta}_2, \bm{\theta}_3\}$ with $\bm{\theta}_1 = \{\bm{\theta}_e, \bm{\theta}_d^{MT}\}, \bm{\theta}_2 = \{\bm{\theta}_e, \bm{\theta}_d^{NER}\}, \bm{\theta}_3 = \{\bm{\theta}_e, \bm{\theta}_d^{POS}\}$, and the action space $\mathcal{A} = \{(\ell_1, \bm{\theta}_1), (\ell_2, \bm{\theta}_2), (\ell_3, \bm{\theta}_3)\}$, i.e. the controller decides one task to optimize at a time. Still, we reuse the same set of features in previous tasks with small revisions, and set the reward function $R = C \cdot \mbox{PPL}$ where PPL is the validation perplexity. More details about the NMT task are provided in Appendix~\ref{sec:appendix:mtmt_training_detail}.
\subsection{Discussion}
When the task model is complex and requires numerous iterations to converge (i.e. when $T$ in Eq.~\ref{eq:policy_gradient} is large), the controller receives sparse and delayed rewards. To facilitate the training, we adapt $T$ depending on the task: for simpler tasks that converge with fewer iterations (e.g. regression and MLP classification), $T$ equals the number of steps to convergence. For GANs and NMT that need longer exploration, we set $T$ as a fixed constant (instead of the max number to convergence) and online train the controller using proximal policy optimization (PPO) algorithm with actor-critic style. We accordingly adjust the reward function as $R^{(t) \rightarrow (t+T)} = C \cdot (P^{(t+T)} - P^{(t)}) / (\frac{P^{(t)} - P^{(t - kT)}}{k})$ where $k$ is a hyperparameter and $P$ is $\mathcal{IS}$ for GANs and $\mbox{PPL}$ for NMT, i.e. we generate a reward every $T$ steps based on the improvement of performance and use it as reward for each step in this segment of steps. Since the improvement will be tiny around optima, we normalize the reward by dividing $\frac{P^{(t)} - P^{(t - kT)}}{k}$ in case the reward is too small to provide enough training signal.
\section{Evaluation}
\label{sec:evaluation}
In this section, we evaluate AutoLoss empirically on the four tasks using synthetic and real data. We reveal the follow major findings: (1) Overall, AutoLoss can help achieve better quality of convergence faster on all four tasks compared to strong baselines (\S\ref{sec:quality}), with acceptable overheads in controller training. (2) A trained controller on a task model is transferable to guide the training of another task model with different configurations (e.g. neural architectures), or on totally different data distributions, while still converging faster and better (\S\ref{sec:transferability}).
\subsection{Quality of Convergence}
\label{sec:quality}
We first verify the feasibility of the AutoLoss idea. We empirically show that under the formulation of Eq.~\ref{eq:unified_workflow}, there \emph{do exist} learnable update schedules, and AutoLoss is able to capture their distribution and guides the task model to achieve better quality of convergence across multiple tasks and models.
\subsubsection{Regression and Classification with L1 Regularization} \label{sec:regression_classification}
We first apply AutoLoss on two relatively simple tasks with synthetic data, and see whether it can outperform its alternatives (e.g. minimizing linear combinations of loss terms) in combating overfitting. Specifically, for regression, we synthesize dataset $\mathcal{D} = \{\bm{u}_p, v_p\}_{p=1}^P$ using a linear model with Gaussian noise (in the form of $v = \bm{w} \cdot \bm{u} + \xi$ ). In this case, a quadratic regressor is over-expressive and highly likely to overfit the data if without proper regularization. Similarly, for MLP, we synthesize a classification dataset with risks of overfitting by letting only $5\%$ dimensions in $\bm{u}$ be informative whereas the rest be either linear combinations of them or random noise. Details of how the data are synthesized are provided in the Appendix~\ref{sec:appendix:data_synthesis}.
We split our dataset into 5 parts following \citet{fan2018learning}: $\mathcal{D}_{train}^C$ and $\mathcal{D}_{val}^C$ for controller training; Once trained, the controller is used to guide the training of a new task model on another two partitions $\mathcal{D}_{train}^T$, $\mathcal{D}_{val}^T$. Hence, the controller would not work by just memorizing good schedules on $\mathcal{D}_{train}^C$. We reserve the fifth partition $\mathcal{D}_{test}$ to assess the task model after guided training. For both regression and classification, our controller is simply a two-layer MLP with ReLU activation.
\begin{table}
\centering
\begin{tabular}{c|c|c|c|c|c|c}
\hline
Metric & \textsc{w/o L1} & \textsc{S1} & \textsc{S2} & \textsc{S3} & \textsc{DGS} & \textsc{AutoLoss} \\
\hline
\hline
\emph{MSE} & .790 & .086 & .096 & .095 & .086 & \bf{.070} \\
\hline
\emph{err} & .124 & .091 & .094 & .094 & .093 & \bf{.088} \\
\hline
\end{tabular}
\caption{\textsc{AutoLoss} vs. \textsc{w/o L1}, schedules S1-S3, and \textsc{DGS} on $d$-ary quadratic regression and MLP classification. Results are averaged over 10 trials. Since the training data are generated with noise, we substitute the baseline MSE (3.94) from the results caused by noise during data generation.}
\vspace{-15pt}
\label{tab:MSE_err}
\end{table}
We compare MSE or classification error (err) evaluated on $\mathcal{D}_{test}$ in Table~\ref{tab:MSE_err} to the following methods: (1) \textsc{w/o L1}: which minimizes only an MSE or BCE term on $\mathcal{D}_{train}^T \cup \mathcal{D}_{val}^T$.
(2) We designed three flexible schedules that optimize the L1 term at each iteration if the condition $\frac{A - B}{B} > th$ is met, where $A, B$ are (S1) task loss values ($\ell_1$) evaluated on $\mathcal{D}_{val}^T$ and $\mathcal{D}_{train}^T$
respectively, (S2) L1 loss and task loss evaluated on $\mathcal{D}_{val}^T$, (S3) gradient norms of L1 and MSE loss. We grid search the threshold $th$ on training data and only report best achieved results.
(3) \textsc{DGS}: we minimize $\ell_1 + \lambda \ell_2$ with $\lambda$ determined by dense grid search (DGS); Particularly, we densely grid search the best $\lambda$ from a pre-selected interval using 50 experiments, and report the best MSE\footnote{Note that the DGS presented is a very strong baseline and might even be unrealistic in practice due to unacceptable cost or lack of prior knowledge on hyperparameters.}.
\begin{wrapfigure}{r}{0.61\textwidth}
\vspace{-18pt}
\begin{center}
\includegraphics[width=0.3\textwidth]{figures/regression_lambda_sensitivity.pdf}
\includegraphics[width=0.3\textwidth]{figures/MLP_lambda_sensitivity.pdf}
\end{center}
\vspace{-18pt}
\caption{AutoLoss reaches good convergence regardless of $\lambda$ for both $d$-ary regression (convex) and MLP classification (non-convex).}
\vspace{-10pt}
\label{fig:regression_lambda}
\end{wrapfigure}
Without regularization, the performance deteriorates -- we observed the large gap between \textsc{w/o L1} and others with L1 on both tasks (convex and non-convex).
AutoLoss manages to detect and combat the potential risk of overfitting with the designed features, and automatically optimizes the provided L1 term when appropriate.
In terms of task performance, \textsc{AutoLoss} outperforms three manually designed schedules as well as DGS, a practically very strong method. This is not unexpected as AutoLoss' parametric controller offers more flexibility than heuristic-driven schedules, or any fixed-formed objectives with a dense grid of $\lambda$ values (i.e. DGS). To understand this, consider the $d$-ary quadratic regression which is convex and has global optima only determined by $\lambda$.
AutoLoss frees the loss surface from being strictly characterized in the form of a linear combination equation, thus allows for finding better optimal solutions that not only enjoy the regularizer effects (i.e. sparsity), but also more closely characterize observed data. As a side benefit, AutoLoss liberates us from hyper-searching $\lambda$, which might be difficult or expensive, and not transferable from one model or dataset to another.
We perform an additional experiment in Figure~\ref{fig:regression_lambda} where we set different $\lambda$ in $\ell_2 = \lambda |\bm{\Theta}|_2$, and note AutoLoss always reaches the same quality of convergence regardless of $\lambda$. Similar results are observed on MLP classification, a highly non-convex model. The results suggest AutoLoss might be a better alternative to incorporate regularization than fixed-formed combinations of loss terms. We further provide an ablation study on the importance of each designed feature in the Appendix~\ref{sec:appendix:feature_ablation}.
\begin{figure}[tbp]
\centering
\begin{subfigure}{.245\textwidth}
\centering
\includegraphics[width=\linewidth]{figures/mnist_1.pdf}
\end{subfigure}%
\begin{subfigure}{.245\textwidth}
\centering
\includegraphics[width=\linewidth]{figures/mnist_5.pdf}
\end{subfigure}
\begin{subfigure}{.245\textwidth}
\centering
\includegraphics[width=\linewidth]{figures/mnist_7.pdf}
\end{subfigure}
\begin{subfigure}{.245\textwidth}
\centering
\includegraphics[width=\linewidth]{figures/mnist_9.pdf}
\end{subfigure}
\vspace{-5pt}
\caption{\small Comparing \textsc{AutoLoss} to 4 best performed baselines out of GAN K:1 and GAN 1:K in terms of training progress ($\mathcal{IS}$ vs. epochs). Each curve corresponds to 3 runs of experiments and the variances are illustrated as vertical lines on the curves.}
\vspace{-15pt}
\label{fig:GAN_progress}
\end{figure}
\subsubsection{GANs}
\label{sec:evaluation:gans}
We next use AutoLoss to help train GANs to generate images. We first build a DCGAN with the architecture of $G$ and $D$ following~\citet{radford2015unsupervised}, and train it on MNIST. As the task model itself is hard to train, in this experiment, we set the controller as a linear model with Bernoulli outputs.
GAN's minimax loss goes beyond the form of linear combinations, and there is no rigorous evidence showing how the training of $G$ and $D$ shall be scheduled. Following common practice, we compare $\textsc{AutoLoss}$ to the following baselines: (1) \textsc{GAN}: the vanilla GAN where $D$ and $G$ are alternately updated once a time; (2) \textsc{GAN 1:K}: suggested by some literature, we build a series of baselines that update $D$ and $G$ at the ratio 1:K (K = 3, 5, 7, 9, 11) in case $D$ is over-trained to reject all samples by $G$; (3) \textsc{GAN K:1}: that we contrarily bias toward more updates for $D$. To evaluate $G$, we use the inception score ($\mathcal{IS}$)~\citep{salimans2016improved} as a quantitative metric, and also visually inspect generated results. To calculate $\mathcal{IS}$ of digit images, we follow~\citet{deng2017structured} and use a trained CNN classifier on MNIST train split as the ``inception network'' (real MNIST images have $\mathcal{IS} = 9.5$ on it). In Figure~\ref{fig:GAN_progress}, we plot the $\mathcal{IS}$
w.r.t. number of training epochs, comparing \textsc{AutoLoss} to four best performed baselines out of all \textsc{GAN 1:K} and \textsc{GAN K:1}, each with three trials of experiments. We also report the converged $\mathcal{IS}$ for all methods here: 8.6307, 9.0026, 9.0232, 9.0145, \textbf{9.0549} for \textsc{GAN}, \textsc{GAN (1:5)}, \textsc{GAN (1:7)}, \textsc{GAN (1:9)}, \textsc{AutoLoss}, respectively.
In general, GANs trained with AutoLoss present two improvements over baselines: higher quality of final convergence in terms of $\mathcal{IS}$, and faster per-epoch convergence. For example, comparing to \textsc{GAN 1:1}, \textsc{AutoLoss} improves the converged $\mathcal{IS}$ for 0.5, and is almost 3x faster to achieve where \textsc{GAN 1:1} converges ($\mathcal{IS} = 8.6$) in average. We observe \textsc{GAN 1:7} performs closest to \textsc{AutoLoss}: it achieves $\mathcal{IS} = 9.02$, compared to \textsc{AutoLoss} 9.05, though almost 5 epochs slower to converge, and exhibits higher variance in multiple experiments. It is worth noting that all \textsc{GAN K:1} baselines perform worse than the rest and are skipped in Figure~\ref{fig:GAN_progress}, echoing the statements~\citep{arjovsky2017wasserstein,gulrajani2017improved,deng2017structured} that more updates of $G$ than $D$ might be preferable in GAN training. We visualize some generated digit images by AutoLoss-guided GANs in the Appendix~\ref{sec:appendix:MNIST_images} and find the visual quality directly relevant with $\mathcal{IS}$ and no mode collapse is observed.
\begin{figure*}[tbp]
\centering
\begin{subfigure}{.33\textwidth}
\includegraphics[width=\linewidth]{figures/mtmt.pdf}
\end{subfigure}%
\begin{subfigure}{.33\textwidth}
\includegraphics[width=\linewidth]{figures/mtmt_distribution.pdf}
\end{subfigure}
\begin{subfigure}{.33\textwidth}
\centering
\includegraphics[width=\linewidth]{figures/reg_fixed_budget.pdf}
\end{subfigure}
\vspace{-5pt}
\caption{\small (L) Validaton PPL w.r.t. training epochs on the NMT task; (M) Visualization of the trained controller's policy on the NMT task; (R) \textsc{AutoLoss} vs. \textsc{DGS} in terms of MSE w.r.t. scanned data batches on the $d$-ary regression task.}
\vspace{-10pt}
\label{fig:NTM_budget}
\end{figure*}
\subsubsection{Multi-task Neural Machine Translation}
Lastly, we evaluate AutoLoss on multi-task neural machine translation. Our NN architecture exactly follows the one in~\citet{niehues2017exploiting}. More information about the dataset and experiment settings are provided in Appendix~\ref{sec:appendix:mtmt_training_detail} and~\citet{niehues2017exploiting}. We use an MLP controller with a 3-way softmax output, and train it along with the NMT model training, and compare it to the following approaches: (1) \textsc{MT}: single-task NMT baseline trained with parallel data; (2) \textsc{FixedRatio}: a manually designed schedule that selects which task objective to optimize next based on a ratio proportional to the size of training data for each task; (3) \textsc{FineTuned MT}: train with \textsc{FixedRatio} first and then fine-tune delicately on MT task. Note that baselines (2) and (3) are searched and heavily tuned by authors of~\citet{niehues2017exploiting}. We evaluate the perplexity (PPL) on validation set w.r.t. training epochs in Figure~\ref{fig:NTM_budget}(L), and report the final converged PPL as well: 3.77, 3.68, 3.64, \textbf{3.54} for \textsc{MT}, \textsc{FixedRatio}, \textsc{FineTuned MT} and \textsc{AutoLoss}, respectively.
We observe that all methods progress similarly but \textsc{AutoLoss} and \textsc{FineTune MT} surpass the other two after several epochs. \textsc{AutoLoss} performs similarly to \textsc{FineTune MT} in terms of training progress before epoch 10, though \textsc{AutoLoss} learns the schedule fully automatically while \textsc{FineTune MT} requires heavy manual crafting. AutoLoss is about 5x faster than \textsc{FixedRatio} to reach where the latter converges, and reports the lowest PPL than all other approaches after convergence, crediting to its flexibility of being able to parameterize and learn the update schedules. We visualize the controller's softmax output after convergence in Fig~\ref{fig:NTM_budget}(M). It is interesting to notice that the controller meta-learns to up-weight the target NMT objective at later phase of the training. This, in some sense, seems to resemble the ``fine-tuning the target task'' strategy appeared in many multi-task learning literature, but is much more flexible thanks to the parametric controller.
\subsection{Overhead}
AutoLoss introduces three possible sources of overheads: controller feature extraction, controller inference and training, and potential cost by additional task model training.
Since we build features merely based on existing metadata or histories (see \S\ref{sec:applications}), which have to be computed anyway even without AutoLoss, the feature extraction has negligible overhead.
Moreover, as a simple 2-layer MLP controller would suffice for many applications per our experiments, training or inference with the controller add minimal computational overhead, especially on modern hardware such as GPUs.
Besides, for tasks that converge shortly within a few iterations (e.g. $d$-ary regression and MLP classification), AutoLoss, similar to grid search, requires repeating multiple experiments in order to accumulate sufficient supervisions ($T$ is \# of steps to converge). To assess the resulted overhead, we perform a fixed budget experiment: given a fixed number of data batches allowed to scan, we compare in Fig~\ref{fig:NTM_budget}(R) the reached convergence by \textsc{AutoLoss} and \textsc{DGS} on the regression task. We observe AutoLoss is much more sample-efficient -- it achieves better convergence with less training runs. On the other hand, for computational-heavy tasks that need many steps to converge (GANs, NMT), the controller training, in most cases, can finish simultaneously with task model training, and does not repeat experiments as many times as other hyperparameter search methods would do.
\begin{table}[tbp]
\centering
\begin{tabular}{c|c|c|c}
\hline
Dataset $\#$ & \textsc{w/o L1} & \textsc{DGS} & \textsc{AutoLoss} \\
\hline
\hline
\emph{1} & .1337 & \textbf{.1019} & .1037 \\
\hline
\emph{2} & .1294 & .1035 & \textbf{.1016} \\
\hline
\emph{3} & .1318 & .1022 & \bf{.0997} \\
\hline
\end{tabular}
\vspace{-5pt}
\caption{Comparing \textsc{AutoLoss} to other methods when transferring a trained AutoLoss controller for MLP classification to different data distributions.}
\label{tab:MLP_transfer}
\vspace{-10pt}
\end{table}
\subsection{Transferability}
\label{sec:transferability}
We next investigate the transferability of a trained controller to different models or datasets.
\subsubsection{Transfer to Different Models}
\label{sec:transfer_to_different_models}
To see whether a differently configured task model can benefit from a trained controller, we design the following experiment: we let a trained DCGAN controller on MNIST guide the training of new GANs (from scratch) whose $G$ and $D$ have randomly sampled neural architectures. We describe the sampling strategies in Appendix~\ref{sec:appendix:DCGAN_sampling}.
We compare the (averaged) converged $\mathcal{IS}$ between with and without the AutoLoss controller in Fig~\ref{fig:transfer}(L), while we skip cases that both AutoLoss and the baseline fail ($\mathcal{IS} < 6$) because improper neural architectures are sampled. \textsc{AutoLoss} manages to generalize to unseen architectures, and outperforms \textsc{DCGAN} in 16 out of 20 architectures. This proves that the trained controller is not simply memorizing the optimization behavior of the specific task model it is trained with; instead, the knowledge learned on a neural network is generalizable to novel model architectures.
\begin{figure}[tbp]
\centering
\begin{subfigure}{0.38\textwidth}
\includegraphics[width=\linewidth]{figures/transfer_to_models.pdf}
\end{subfigure}
\begin{subfigure}{0.38\textwidth}
\includegraphics[width=\linewidth]{figures/cifar.pdf}
\vspace{-20pt}
\end{subfigure}
\label{fig:transfer_to_models}
\caption{(L) Comparing the final convergence ($\mathcal{IS}$) on training randomly sampled DCGAN architectures w/ and w/o a pre-trained AutoLoss controller; (R) On CIFAR-10, comparing the training progress ($\mathcal{IS}$ vs. epochs) of a series of baselines GAN 1:K, GAN K:1 and an AutoLoss-guided GAN with its controller trained on MNIST.}
\vspace{-10pt}
\label{fig:transfer}
\end{figure}
\subsubsection{Transfer to Different Data Distributions}
Our second set of experiments try to figure out whether an AutoLoss controller can generalize to different data distributions. Accordingly, we let a trained controller on one dataset to guide the training of the same task model from scratch, but on a different dataset with totally different distributions. We compare the AutoLoss-trained model to other methods, and report the results in Table~\ref{tab:MLP_transfer} and Figure~\ref{fig:transfer}(R) on two tasks respectively: MLP classification, for which we synthesize 4 datasets following a generative process with 4 different specifications (therefore different distributions), with one of them used for controller training; GANs, where we first train a controller for digit generation on MNIST, and use the controller to guide the training of the same GAN architecture on CIFAR-10. In both cases, we observe AutoLoss manages to guide the model training on unseen data. On MLP classification, it delivers trained models comparable to or better than models searched via \textsc{DGS}, while being 50x more economical --- note that DGS has to repeat 50 or more experiments to achieve the reported results in Table~\ref{tab:MLP_transfer} on unseen data (or model). By contrast, AutoLoss, once trained, is free at inference phase.
On image generation, when transferred from digit images to natural images, a controller guided GAN achieves both higher quality of convergence and faster per-epoch convergence than a normal GAN trained with various fixed schedules, among which we observe \textsc{GAN 1:1} performs best on CIFAR-10, while most of \textsc{GAN K:1} schedules fail.
We visually inspect the images generated by DCGANs guided by the MNIST-trained controller and find the image quality satisfying and no mode collapse occurred, with converged $\mathcal{IS} \approx 7$, compared to best reported $\mathcal{IS} = 6.16$ by DCGANs in previous literature. Visualization of the generated CIFAR-10 images can be found in Appendix~\ref{sec:appendix:CIFAR10_images}.
Finally, we are also interested in knowing whether a trained controller is transferable when both data and models change. We transfer a DCGAN controller trained on MNIST to a new DCGAN with different architectures on CIFAR-10, and observe comparable quality and speed of convergence to the best fixed schedule on CIFAR-10, though AutoLoss bypasses the schedule search and is more readily available.
\section{Conclusion}
We propose a unified formulation for iterative alternate optimization and developed AutoLoss, a framework to automatically learn and generate optimization schedules. Comprehensive experiments on synthetic and real data have demonstrated that the optimization schedule produced by AutoLoss controller can guide the task model to achieve better quality of convergence, and the trained AutoLoss controller is transferable from one dataset to another, or one model to another.
\newpage
| {'timestamp': '2018-10-08T02:03:36', 'yymm': '1810', 'arxiv_id': '1810.02442', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02442'} | arxiv |
\section{Introduction}
\label{sec:intro}
Semantic Role Labeling (SRL) is a shallow semantic parsing task whose goal is to recognize the predicate-argument structure of each predicate.
Given a sentence and a target predicate, SRL systems have to predict semantic arguments of the predicate.
Each argument is a {\it span}, a unit that consists of one or more words.
A key to the argument span prediction is how to represent and model spans.
One popular approach to it is based on BIO tagging schemes.
State-of-the-art neural SRL models adopt this approach \cite{zhou:15,he:17,tan:18}.
Using features induced by neural networks, they predict a BIO tag for each word.
Words at the beginning and inside of argument spans have the ``B" and ``I" tags, and words outside argument spans have the tag ``O."
While yielding high accuracies, this approach reconstructs argument spans from the predicted BIO tags instead of directly predicting the spans.
Another approach is based on labeled span prediction \cite{oscar:15,fitzgerald:15}.
This approach scores each span with its label.
One advantage of this approach is to allow us to design and use span-level features, that are difficult to use in BIO tagging approaches.
However, the performance has lagged behind that of the state-of-the-art BIO-based neural models.
To fill this gap, this paper presents a simple and accurate span-based model.
Inspired by recent span-based models in syntactic parsing and coreference resolution \cite{stern:17,lee:17}, our model directly scores all possible labeled spans based on span representations induced from neural networks.
At decoding time, we greedily select higher scoring labeled spans.
The model parameters are learned by optimizing log-likelihood of correct labeled spans.
We evaluate the performance of our span-based model on the CoNLL-2005 and 2012 datasets \cite{carreras:05,pradhan:12}.
Experimental results show that the span-based model outperforms the BiLSTM-CRF model.
In addition, by using contextualized word representations, ELMo \cite{peters:18}, our ensemble model achieves the state-of-the-art results, 87.4 F1 and 87.0 F1 on the CoNLL-2005 and 2012 datasets, respectively.
Empirical analysis on these results shows that the label prediction ability of our span-based model is better than that of the CRF-based model.
Another finding is that ELMo improves the model performance for span boundary identification.
In summary, our main contributions include:
\begin{itemize}
\setlength{\parskip}{0cm}
\setlength{\itemsep}{0cm}
\item A simple span-based model that achieves the state-of-the-art results.
\item Quantitative and qualitative analysis on strengths and weaknesses of the span-based model.
\item Empirical analysis on the performance gains by ELMo.
\end{itemize}
\noindent
Our code and scripts are publicly available.\footnote{https://github.com/hiroki13/span-based-srl}
\section{Model}
\label{sec:problem}
We treat SRL as {\it span selection}, in which we select appropriate spans from a set of possible spans for each label.
This section formalizes the problem and provides our span selection model.
\subsection{Span Selection Problem}
\subsection*{Problem Setting}
Given a sentence that consists of $T$ words $w_{1:T} = w_1, \cdots, w_T$ and the target predicate position index $p$, the goal is to predict a set of labeled spans $Y = \{ \langle i, j, r \rangle_k \}^{|Y|}_{k=1}$.
\begin{align*}
\textbf{Input} \: & \text{:} \: X = \{ w_{1:T}, p \}, \\
\textbf{Output} \: & \text{:} \: Y = \{ \langle i, j, r \rangle_k \}^{|Y|}_{k=1} \:\:.
\end{align*}
\noindent
Each labeled span $\langle i, j, r \rangle$ consists of word indices $i$ and $j$ in the sentence ($1 \le i \le j \le T$) and a semantic role label $r \in \mathcal{R}$.
One simple method to predict $Y$ is to select the highest scoring span $(i, j)$ from all possible spans $\mathcal{S}$ for each label $r$,
\begin{align}
\label{eq:argmax}
\mathop{\rm argmax}\limits_{(i, j) \in \mathcal{S}} \: \textsc{Score}_r(i, j), \: r \in \mathcal{R} \:\: .
\end{align}
\noindent
Function $\textsc{Score}_r(i, j)$ returns a real value for each span $(i, j) \in \mathcal{S}$ (described in Section \ref{sec:score} in more detail).
The number of possible spans $\mathcal{S}$ in the input sentence $w_{1:T}$ is $\frac{T (T +1)}{2}$, and $\mathcal{S}$ is defined as follows,
\[
\mathcal{S} = \{ (i, j) \: | \: i, j \in \{1, \cdots, T\}, i \le j \} \:\: .
\]
\noindent
Note that some semantic roles may not appear in the sentence.
To deal with the absence of some labels, we define the predicate position span $(p, p)$ as a {\sc Null} span and train a model to select the {\sc Null} span when there is no span for the label.\footnote{Since the predicate itself can never be an argument of its own, we define the position as the {\sc Null} span.}
\subsection*{Example}
Consider the following sentence with the set of correct labeled spans $Y$.\\
\hspace{1.5cm} She$_1$ \hspace{0.2cm} \underline{kept}$_2$ \hspace{0.2cm} a$_3$ \hspace{0.2cm} cat$_4$
\hspace{1.4cm} [\hspace{0.05cm} {\tt A0} \hspace{0.05cm}] \hspace{1.1cm} [ \hspace{0.3cm} {\tt A1} \hspace{0.3cm}]
\begin{align*}
Y = \{ \: & \langle 1, 1, \texttt{A0} \rangle, \: \langle 3, 4, \texttt{A1} \rangle,\\
& \langle 2, 2, \texttt{A2} \rangle, \cdots, \langle 2, 2, \texttt{TMP} \rangle \: \}
\end{align*}
\noindent
The input sentence is $w_{1:4} = \text{``She kept a cat"}$, and the target predicate position is $p=2$.
The correct labeled span $\langle 1, 1, \texttt{A0} \rangle$ indicates that the A0 argument is ``She", and $\langle 3, 4, \texttt{A1} \rangle$ indicates that the A1 argument is ``a cat".
The other labeled spans $\langle 2, 2, * \rangle$ indicate there are no arguments.
All the possible spans in this sentence are as follows,
\begin{align*}
\mathcal{S}_{w_{1:4}} = \{ & (1, 1), (1, 2), (1, 3), (1, 4), (2, 2), \\
& (2, 3), (2, 4), (3, 3), (3, 4), (4, 4) \} \:\: ,
\end{align*}
\noindent
where the predicate span $(2, 2)$ is treated as the \textsc{Null} span.
Among these candidates, we select the highest scoring span for each label.
As a result, we can obtain correct labeled spans $Y$.
\subsection{Scoring Function}
\label{sec:score}
As the scoring function for each span in Eq.~\ref{eq:argmax}, we model normalized distribution over all possible spans $\mathcal{S}$ for each label $r$,
\begin{align}
\label{eq:score}
\textsc{Score}_r(i, j) & = \text{P}_{\theta}(i, j \: | \: r) \nonumber \\
& = \frac{\text{exp}(\text{F}_{\theta}(i, j, r))}{\displaystyle \sum_{(i', j') \in \mathcal{S}} \text{exp}(\text{F}_{\theta}(i', j', r))} \:\:,
\end{align}
\noindent
where function $\text{F}_{\theta}$ returns a real value.
We train the parameters $\theta$ of $\text{F}_{\theta}$ on a training set,
\begin{align*}
\mathcal{D} & = \{ (X^{(n)}, Y^{(n)})\}_{n=1}^{|\mathcal{D}|} \:\:, \\
X & = \{ w_{1:T}, p \} \:\:, \\
Y & = \{ \langle i, j, r \rangle_k \}_{k=1}^{|Y|} \:\:.
\end{align*}
\noindent
To train the parameters $\theta$ of $\text{F}_{\theta}$, we minimize the cross-entropy loss function,
\begin{align}
\label{eq:loss}
\mathcal{L}({\theta}) & = \sum_{(X, Y) \in \mathcal{D}} \ell_{\theta}(X, Y) \:\:, \\ \nonumber
\ell_{\theta}(X, Y) & = \sum_{\langle i, j, r\rangle \in Y} \text{log} \: \text{P}_{\theta}(i, j | r) \:\:,
\end{align}
\noindent
where function $\ell_{\theta}(X, Y)$ is a loss for each sample.
\subsection{Function $\text{F}_{\theta}$}
\label{sec:function}
Function $\text{F}_{\theta}$ in Eq.~\ref{eq:score} consists of three types of functions; the base feature function $f_{base}$, the span feature function $f_{span}$ and the labeling function $f_{label}$ as follows,
\begin{align}
\label{a} {\bf h}_{1:T} & = f_{base}(w_{1:T}, p) \:\:, \\
\label{b} {\bf h}_s & = f_{span}({\bf h}_{1:T}, s) \:\:, \\
\label{c} \text{F}_{\theta}(i, j, r) & = f_{label}({\bf h}_s, r) \:\:.
\end{align}
\noindent
Firstly, $f_{base}$ calculates a base feature vector ${\bf h}_t$ for each word $w_t \in w_{1:T}$.
Then, from a sequence of the base feature vectors ${\bf h}_{1:T}$, $f_{span}$ calculates a span feature vector ${\bf h}_s$ for a span $s = (i, j)$.
Finally, using ${\bf h}_s$, $f_{label}$ calculates the score for the span $s = (i, j)$ with a label $r$.
Each function in Eqs.~\ref{a}, \ref{b} and \ref{c} can arbitrarily be defined.
In Section \ref{sec:network}, we describe our functions used in this paper.
\subsection{Inference}
\label{sec:inference}
The simple argmax inference (Eq.~\ref{eq:argmax}) selects one span for each label.
While this argmax inference is computationally efficient, it faces the following two problematic issues.
\begin{description}
\setlength{\parskip}{0cm}
\setlength{\itemsep}{0cm}
\item[(a)] The argmax inference sometimes selects spans that overlap with each other.
\item[(b)] The argmax inference cannot select multiple spans for one label.
\end{description}
\noindent
In terms of (a), for example, when $\langle 1, 3, \texttt{A0} \rangle$ and $\langle 2, 4, \texttt{A1} \rangle$ are selected, a part of these two spans overlaps.
In terms of (b), consider the following sentence.\\\vspace{-0.2cm}
\hspace{0.1cm} He \underline{came} to the U.S. yesterday at 5 p.m.
[{\tt A0}] \hspace{0.75cm} [\hspace{0.35cm} {\tt A4} \hspace{0.35cm}]\hspace{0.1cm}[\hspace{0.2cm} {\tt TMP} \hspace{0.2cm}]\hspace{0.1cm}[\hspace{0.1cm} {\tt TMP} \hspace{0.1cm}]\\
\vspace{-0.2cm}
\noindent
In this example, the label {\tt TMP} is assigned to the two spans (``yesterday" and ``at 5 p.m.").
Semantic role labels are mainly categorized into (i) {\it core labels} or (ii) {\it adjunct labels}.
In the above example, the labels {\tt A0} and {\tt A4} are regarded as core labels, which indicate obligatory arguments for the predicate.
In contrast, the labels like {\tt TMP} are regarded as adjunct labels, which indicate optional arguments for the predicate.
As the example shows, adjunct labels can be assigned to multiple spans.
To deal with these issues, we use a greedy search that keeps the consistency among spans and can return multiple spans for adjunct labels.
Specifically, we greedily select higher scoring labeled spans subject to two constraints.
\begin{description}
\setlength{\parskip}{0cm}
\setlength{\itemsep}{0cm}
\item[Overlap Constraint:] Any spans that overlap with the selected spans cannot be selected.
\item[Number Constraint:] While multiple spans can be selected for each adjunct label, at most one span can be selected for each core label.
\end{description}
\noindent
As a precise description of this algorithm, we describe the pseudo code and its explanation in Appendix \ref{sec:decode}.
\section{Network Architecture}
\label{sec:network}
To compute the score for each span, we have introduced three functions ($f_{base}, f_{span}, f_{label}$) in Section \ref{sec:function}.
As an instantiation of each function, we use neural networks.
This section describes our neural networks for each function and the overall network architecture.
\subsection{BiLSTM-Span Model}
\label{sec:bilstm}
\begin{figure}[t]
\begin{center}
\includegraphics[width=7.5cm]{emnlp18-model.pdf}
\caption{Overall architecture of our BiLSTM-span model.}
\label{fig:model}
\end{center}
\end{figure}
Figure \ref{fig:model} illustrates the overall architecture of our model.
The first component $f_{base}$ uses bidirectional LSTMs (BiLSTMs) \cite{schuster:97,graves:05,graves:13} to calculate the base features.
From the base features, the second component $f_{span}$ extracts span features.
Based on them, the final component $f_{label}$ calculates the score for each labeled span.
In the following, we describe these three components in detail.
\subsection*{Base Feature Function}
As the base feature function $f_{base}$, we use BiLSTMs,
\begin{align*}
f_{base}(w_{1:T}, p) = \textsc{BiLSTM}(w_{1:T}, p) \:\: .
\end{align*}
\noindent
There are some variants of BiLSTMs.
Following the deep SRL models proposed by \newcite{zhou:15} and \newcite{he:17}, we stack BiLSTMs in an interleaving fashion.
The stacked BiLSTMs process an input sequence in a left-to-right manner at odd-numbered layers and in a right-to-left manner at even-numbered layers.
The first layer of the stacked BiLSTMs receives word embeddings ${\bf x}^{word} \in \mathbb{R}^{d^{word}}$ and predicate mark embeddings ${\bf x}^{mark} \in \mathbb{R}^{d^{mark}}$.
As the word embeddings, we can use existing word embeddings.
The mark embeddings are created from the mark feature which has a binary value.
The value is 1 if the word is the target predicate and 0 otherwise.
For example, at the bottom part of Figure~\ref{fig:model}, the word ``bought" is the target predicate and assigned $1$ as its mark feature.
Receiving these inputs, the stacked BiLSTMs calculates the hidden states until the top layer.
We use these hidden states as the input feature vectors ${\bf h}_{1:T}$ for the span feature function $f_{span}$ (Eq.~\ref{b}).
Each vector ${\bf h}_t \in {\bf h}_{1:T}$ has $d^{hidden}$ dimensions.
We provide a detailed description of the stacked BiLSTMs in Appendix~\ref{sec:lstm}.
\subsection*{Span Feature Function}
From the base features induced by the BiLSTMs, we create the span feature representations,
\begin{align}
\label{eq:span}
f_{span}({\bf h}_{1:T}, s) = [ {\bf h}_i + {\bf h}_j; {\bf h}_i - {\bf h}_j] \:\:,
\end{align}
\noindent
where the addition and subtraction features of the $i$-th and $j$-th hidden states are concatenated and used as the feature for a span $s = (i, j)$.
The resulting vector ${\bf h}_s$ is a $2d^{hidden}$ dimensional vector.
The middle part of Figure~\ref{fig:model} shows an example of this process.
For the span $(3, 5)$, the span feature function $f_{span}$ receives the $3$rd and $5$th features (${\bf h}_3$ and ${\bf h}_5$).
Then, these two vectors are added, and the $5$th vector is subtracted from the $3$rd vector.
The resulting vectors are concatenated and given to the labeling function $f_{label}$.
Our design of the span features is inspired by the span (or segment) features used in syntactic parsing \cite{wang:16,stern:17,teranishi:17}.
While these neural span features cannot be used in BIO-based SRL models, they can easily be incorporated into span-based models.
\subsection*{Labeling Function}
Taking a span representation ${\bf h}_s$ as input, the labeling function $f_{label}$ returns the score for the span $s = (i, j)$ with a label $r$.
Specifically, we use the following labeling function,
\begin{align}
\label{eq:label}
f_{label}({\bf h}_s, r) = {\bf W}[r] \cdot {\bf h}_s \:\:,
\end{align}
\noindent
where ${\bf W} \in \mathbb{R}^{|\mathcal{R}| \times 2d^{hidden}}$ has a row vector associated with each label $r$, and ${\bf W}[r]$ denotes the $r$-th row vector.
As the result of the inner product of ${\bf W}[r]$ and ${\bf h}_s$, we obtain the score for a span $(i, j)$ with a label $r$.
The upper part of Figure~\ref{fig:model} shows an example of this process.
The span representation ${\bf h}_s$ for the span $s = (3, 5)$ is created from addition and subtraction of ${\bf h}_3$ and ${\bf h}_5$.
Then, we calculate the inner product of ${\bf h}_s$ and ${\bf W}[r]$.
The score for the label {\tt A0} is $2.1$, and the score for the label {\tt A1} is $3.7$.
In the same manner, by calculating the scores for all the spans $\mathcal{S}$ and labels $\mathcal{R}$, we can obtain the score matrix (at the top part of Figure~\ref{fig:model}).
\subsection{Ensembling}
\label{sec:mos}
We propose an ensemble model that uses span representations from multiple models.
Each base model trained with different random initializations has variance in span representations.
To take advantage of it, we introduce a variant of a mixture of experts (MoE) \cite{shazeer:17},
\footnote{One popular ensemble model for SRL is the product of experts (PoE) model \cite{fitzgerald:15,he:17,tan:18}.
In our preliminary experiments, we tried the PoE model but it did not improve the performance.}
\begin{align}
\label{eq:e1}
{\bf h}^{\text{moe}}_s & = {\bf W}^{\text{moe}}_s \cdot \sum^{M}_{m=1} \alpha_m \: {\bf h}^{(m)}_s \:\:,\\
\label{eq:e2}
f^\text{moe}_{label}({\bf h}^\text{moe}_s, r) & = {\bf W}^{\text{moe}}[r] \cdot {\bf h}^{\text{moe}}_s\:\:.
\end{align}
\noindent
Firstly, we combine span representations ${\bf h}^{(m)}_s$ from each model $m \in \{1, \cdots, M \}$.
${\bf W}^\text{moe}_s$ is a parameter matrix and $\{ \alpha_m \}^M_{m=1}$ are trainable, softmax-normalized parameters.
Then, using the combined span representation ${\bf h}^{\text{moe}}_s$, we calculate the score in the same way as Eq.~\ref{eq:label}.
We use the same greedy search algorithm used for our base model (Section~\ref{sec:inference}).
During training, we update only the parameters of the ensemble model, i.e., $\{ {\bf W}^{\text{moe}}_s, {\bf W}^{\text{moe}}, \{ \alpha_m \}^M_{m=1} \}$.
That is, we fix the parameters of each trained model $m$.
As the loss function, we use the cross-entropy (Eq.~\ref{eq:loss}).
\section{Experiments}
\label{sec:exp}
\subsection{Datasets}
We use the CoNLL-2005 and 2012 datasets\footnote{We use the version of OntoNotes downloaded at: http://cemantix.org/data/ontonotes.html.}.
We follow the standard train-development-test split and use the official evaluation script\footnote{The script can be downloaded at: http://www.lsi.upc.edu/~srlconll/soft.html} from the CoNLL-2005 shared task on both datasets.
\begin{table*}[t]
\centering
{\small
\begin{tabular}{llcccccccccccc} \toprule
& & \multicolumn{3}{c}{Development}
& \multicolumn{3}{c}{Test WSJ}
& \multicolumn{3}{c}{Test Brown}
& \multicolumn{3}{c}{Test ALL} \\
{\sc Emb} & {\sc Model} & P & R & F1 & P & R & F1 & P & R & F1 & P & R & F1 \\ \hline
\multirow{3}{*}{\sc Senna} & {\sc Crf} & 81.7 & 81.3 & 81.5 & 83.3 & 82.5 & 82.9 & 72.6 & 70.0 & 71.3 & 81.9 & 80.8 & 81.4 \\
& {\sc Span} & 83.6 & 81.4 & 82.5 & 84.7 & 82.3 & 83.5 & 76.0 & 70.4 & 73.1& 83.6 & 80.7 & 82.1 \\
& {\sc Span} (Ensemble) & 85.6 & 82.6 & 84.1 & 86.6 & 83.6 & 85.1 & 78.2 & 71.8 & 74.8& 85.5 & 82.0 & 83.7 \\ \hline
\multirow{3}{*}{\sc ELMo} & {\sc Crf} & 86.6 & 86.8 & 86.7 & 87.4 & 87.3 & 87.3 & 78.5 & 78.3 & 78.4 & 86.2 & 86.1 & 86.1\\
& {\sc Span} & 87.4 & 86.3 & 86.9 & 88.2 & 87.0 & 87.6 & 79.9 & 77.5 & 78.7 & 87.1 & 85.7 & 86.4 \\
& {\sc Span} (Ensemble) & {\bf 88.0} & {\bf 86.9} & {\bf 87.4} & {\bf 89.2} & {\bf 87.9} & {\bf 88.5} & {\bf 81.0} & {\bf 78.4} & {\bf 79.6} & {\bf 88.1} & {\bf 86.6} & {\bf 87.4} \\ \toprule
\end{tabular}
}
\caption{\label{tab:result:conll05} Experimental results on the CoNLL-2005 dataset, in terms of precision (P), recall (R) and F1. The bold numbers denote the highest precision, recall and F1 scores among all the models.}
\end{table*}
\begin{table*}[t]
\centering
{\small
\begin{tabular}{llcccccc} \toprule
& & \multicolumn{3}{c}{Development}
& \multicolumn{3}{c}{Test} \\
{\sc Emb} & {\sc Model} & P & R & F1 & P & R & F1 \\ \hline
\multirow{3}{*}{\sc Senna} & {\sc Crf} & 82.8 & 81.9 & 82.4 & 82.9 & 81.9 & 82.4 \\
& {\sc Span} & 84.3 & 81.5 & 82.9 & 84.4 & 81.7 & 83.0 \\
& {\sc Span} (Ensemble) & 86.0 & 83.0 & 84.5 & 86.1 & 83.3 & 84.7 \\ \hline
\multirow{3}{*}{\sc ELMo} & {\sc Crf} & 86.1 & {\bf 85.8} & 85.9 & 86.0 & {\bf 85.7} & 85.9\\
& {\sc Span} & 87.2 & 85.5 & 86.3 & 87.1 & 85.3 & 86.2 \\
& {\sc Span} (Ensemble) & {\bf 88.6} & 85.7 & {\bf 87.1} & {\bf 88.5} & 85.5 & {\bf 87.0} \\ \toprule
\end{tabular}
}
\caption{\label{tab:result:conll12} Experimental results on the CoNLL-2012 dataset.}
\end{table*}
\begin{table}[t]
\centering
{\small
\begin{tabular}{lcccc} \toprule
& \multicolumn{3}{c}{CoNLL-05} & CoNLL12 \\
& WSJ & Brown & ALL & \\ \hline \hline
\multicolumn{5}{c}{\sc Single Model} \\ \hline
{\sc ELMo-Span} & {\bf 87.6} & 78.7 & {\bf 86.4} & {\bf 86.2} \\
He+ 18 & 87.4 & {\bf 80.4} & - & 85.5 \\
Peters+ 18 & - & - & - & 84.6 \\
Strubell+ 18 & 83.9 & 72.6 & - & - \\
Tan+ 18 & 84.8 & 74.1 & 83.4 & 82.7 \\
He+ 17 & 83.1 & 72.1 & 81.6 & 81.7 \\
Zhou+ 15 & 82.8 & 69.4 & 81.1 & 81.3 \\
FitzGerald+ 15 & 79.4 & 71.2 & - & 79.6 \\
T\"{a}ckstr\"{o}m+ 15 & 79.9 & 71.3 & - & 79.4 \\
Toutanova+ 08 & 79.7 & 67.8 & - & - \\
Punyakanok+ 08 & 79.4 & 67.8 & 77.9 & -\\ \toprule
\multicolumn{5}{c}{\sc Ensemble Model} \\ \hline
{\sc ELMo-Span} & {\bf 88.5} & {\bf 79.6} & {\bf 87.4} & {\bf 87.0} \\
Tan+ 18 & 86.1 & 74.8 & 84.6 & 83.9 \\
He+ 17 & 84.6 & 73.6 & 83.2 & 83.4 \\
FitzGerald+ 15 & 80.3 & 72.2 & - & 80.1 \\
Toutanova+ 08 & 80.3 & 68.8 & - & -\\
Punyakanok+ 08 & 79.4 & 67.8 & 77.9 & -\\ \toprule
\end{tabular}
}
\caption{\label{tab:result:comparison} Comparison with existing models. The numbers denote F1 scores on each test set.}
\end{table}
\subsection{Baseline Model}
For comparison, as a model based on BIO tagging approaches, we use the BiLSTM-CRF model proposed by \newcite{zhou:15}.
The BiLSTMs for the base feature function $f_{base}$ are the same as those used in our BiLSTM-span model.
\vspace{-0.1cm}
\subsection{Model Setup}
\label{sec:model-setup}
As the base function $f_{base}$, we use 4 BiLSTM layers with 300 dimensional hidden units.
To optimize the model parameters, we use Adam \cite{kingma:14}.
Other hyperparameters are described in Appendix~\ref{sec:hparam} in detail.
\subsection*{\bf Word Embeddings}
Word embeddings have a great influence on SRL models.
To validate the model performance, we use two types of word embeddings.
\begin{itemize}
\setlength{\parskip}{0cm}
\setlength{\itemsep}{0cm}
\item Typical word embeddings, SENNA\footnote{http://ronan.collobert.com/senna/} \cite{collobert:11}
\item Contextualized word embeddings, ELMo\footnote{http://allennlp.org/elmo} \cite{peters:18}
\end{itemize}
\noindent
SENNA and ELMo can be regarded as different types of embeddings in terms of the context sensitivity.
SENNA and other typical word embeddings always assign an identical vector to each word regardless of the input context.
In contrast, ELMo assigns different vectors to each word depending on the input context.
In this work, we use these word embeddings that have different properties.\footnote{In our preliminary experiments, we also used the GloVe embeddings \cite{pennington:14}, but the performance was worse than SENNA.}
These embeddings are fixed during training.
\subsection*{Training}
As the objective function, we use the cross-entropy $\mathcal{L}_{\theta}$ in Eq.~\ref{eq:loss} with L2 weight decay,
\begin{equation}
\label{eq:reg}
\mathcal{L}_{\theta} = \sum_{(X, Y) \in \mathcal{D}} \ell_{\theta}(X, Y)+ \frac{\lambda}{2} ||\theta||^2 \:\:,
\end{equation}
\noindent
where the hyperparameter $\lambda$ is the coefficient governing the L2 weight decay.
\subsection{Results}
\label{sec:label}
We report averaged scores across five different runs of the model training.
Tables~\ref{tab:result:conll05} and \ref{tab:result:conll12} show the experimental results on the CoNLL-2005 and 2012 datasets.
Overall, our span-based ensemble model using ELMo achieved the best F1 scores, 87.4 F1 and 87.0 F1 on the CoNLL-2005 and CoNLL-2012 datasets, respectively.
In comparison with the CRF-based single model, our span-based single model consistently yielded better F1 scores regardless of the word embeddings, {\sc Senna} and {\sc ELMo}.
Although the performance difference was small between these models using {\sc ELMo}, it seems natural because both models got much better results and approached to the performance upper bound.
Table~\ref{tab:result:comparison} shows the comparison with existing models in F1 scores.
Our single and ensemble models using {\sc ELMo} achieved the best F1 scores on all the test sets except the Brown test set.
\section{Analysis}
\label{sec:analysis}
To better understand our span-based model, we addressed the following questions and obtained the following findings.
\subsection*{Questions}
\begin{description}
\setlength{\parskip}{0cm}
\setlength{\itemsep}{0cm}
\item[(a)] What are strengths and weaknesses of our span-based model compared with the CRF-based model?
\item[(b)] What aspect of SRL does ELMo improve?
\end{description}
\subsection*{Findings}
\begin{description}
\setlength{\parskip}{0cm}
\setlength{\itemsep}{0cm}
\item[(a)] While the CRF-based model is better at span boundary identification (Section~\ref{sec:sbi}), the span-based model is better at label prediction, especially for A2 (Section~\ref{sec:lp}).
\item[(b)] ELMo improves the model performance for span boundary identification (Section~\ref{sec:sbi}).
\end{description}
\noindent
In addition, we have conducted qualitative analysis on span and label representations learned in the span-based model (Section~\ref{sec:qa}).
\subsection{Performance for Span Boundary Identification}
\label{sec:sbi}
\begin{table}[t]
\centering
{\small
\begin{tabular}{llcccc} \toprule
& & \multicolumn{2}{c}{CoNLL-05} & \multicolumn{2}{c}{CoNLL-12} \\
{\sc Emb}& {\sc Model} & F1 & diff & F1 & diff \\ \hline
\multirow{2}{*}{\sc Senna} & {\sc Span} & 86.6 & \multirow{2}{*}{-0.4}& 87.3 & \multirow{2}{*}{-0.6} \\
& {\sc Crf} & 87.0 & & 87.9 & \\ \hline
\multirow{2}{*}{\sc ELMo} & {\sc Span} & 90.5 & \multirow{2}{*}{-0.7} & 90.3 &\multirow{2}{*}{-0.6} \\
& {\sc Crf} & 91.2 & & 90.9 & \\ \toprule
\end{tabular}
}
\caption{\label{tab:span-identification} F1 scores only for span boundary match.}
\end{table}
We analyze the results predicted by the single models.
We evaluate F1 scores only for the span boundary match, shown by Table~\ref{tab:span-identification}.
We regard a predicted boundary $\langle i, j, * \rangle$ as correct if it matches the gold annotation regardless of its label.
On both datasets, the CRF-based models achieved better F1 than that of the span-based models.
Also, compared with {\sc Senna}, {\sc ELMo} yielded much better F1 by over 3.0.
This suggests that a factor of the overall SRL performance gain by {\sc ELMo} is the improvement of the model ability to identify span boundaries.
\subsection{Performance for Label Prediction}
\label{sec:lp}
\begin{table}[t]
\centering
{\small
\begin{tabular}{llcccc} \toprule
& & \multicolumn{2}{c}{CoNLL-05} & \multicolumn{2}{c}{CoNLL-12} \\
{\sc Emb}& {\sc Model} & Acc. & diff & Acc. & diff \\ \hline
\multirow{2}{*}{\sc Senna} & {\sc Span} & 95.3 & \multirow{2}{*}{+1.5} & 95.1 & \multirow{2}{*}{+1.5} \\
& {\sc Crf} & 93.8 & & 93.6 & \\ \hline
\multirow{2}{*}{\sc ELMo} & {\sc Span} & 96.1 & \multirow{2}{*}{+0.9} & 95.7 & \multirow{2}{*}{+1.3} \\
& {\sc Crf} & 95.2 & & 94.4 & \\ \toprule
\end{tabular}
}
\caption{\label{tab:label-prediction} Accuracies only for semantic role labels.}
\end{table}
We analyze labels of the predicted results.
For labeled spans whose boundaries match the gold annotation, we evaluate the label accuracies.
As Table~\ref{tab:label-prediction} shows, the span-based models outperformed the CRF-based models.
Also, interestingly, the performance gap between {\sc Senna} and {\sc ELMo} was not so big as that for span boundary identification.
\subsection*{Label-wise Performance}
\begin{table*}[t]
\centering
{\small
\begin{tabular}{l|rrrr|rrrr} \toprule
& \multicolumn{4}{c}{CoNLL-2005} & \multicolumn{4}{c}{CoNLL-2012} \\
& \multicolumn{2}{c}{\sc Senna} & \multicolumn{2}{c}{\sc ELMo} & \multicolumn{2}{c}{\sc Senna} & \multicolumn{2}{c}{\sc ELMo} \\
Label & \multicolumn{1}{c}{\sc Crf} & \multicolumn{1}{c}{\sc Span} & \multicolumn{1}{c}{\sc Crf} & \multicolumn{1}{c}{\sc Span} & \multicolumn{1}{c}{\sc Crf} & \multicolumn{1}{c}{\sc Span} & \multicolumn{1}{c}{\sc Crf} & \multicolumn{1}{c}{\sc Span} \\ \hline
A0 & 89.9 & 90.2 & 93.0 & 93.2 & 89.9 & 90.0 & 92.5 & 92.5\\
A1 & 83.2 & 83.8 & 89.1& 89.2 & 84.7 & 85.1 & 88.7 & 89.0\\
A2 & 70.9 & 73.1 & 80.0 & 81.2 & 78.6 & 79.4 & 83.2 & 84.2\\
A3 & 64.4 & 71.2 & 78.8 & 78.5 & 61.9 & 62.9 & 69.0 & 70.7\\
ADV & 59.3 & 61.9 & 68.1 & 67.0 & 63.2 & 63.7 & 67.5 & 67.0\\
DIR & 43.2 & 47.3 & 56.6& 54.5 & 54.1 & 52.0 & 61.1 & 59.7\\
LOC & 58.2 & 60.5 & 68.1& 68.3 & 65.8 & 65.0 & 72.0 & 72.0\\
MNR & 61.4 & 61.3 & 66.5& 67.7 & 64.4 & 65.7& 70.5 & 71.1\\
PNC & 57.3 & 60.2 & 68.8& 67.7 & 18.5 & 13.7 & 20.2 & 16.1\\
TMP & 81.8 & 82.7 & 86.1 & 86.0 & 82.2 & 82.3 & 86.1 & 86.2\\ \hline
Overall & 81.5 & 82.5 & 86.7 & 86.9 & 82.4 & 82.9 & 85.9 & 86.3\\ \toprule
\end{tabular}
}
\caption{\label{tab:label:result} F1 Scores for frequent labels on the development set of the CoNLL-2005 and 2012 datasets.}
\end{table*}
Table~\ref{tab:label:result} shows F1 scores for frequent labels on the CoNLL-2005 and 2012 datasets.
For A0 and A1, the performances of the CRF-based and span-based models were almost the same.
For A2, the span-based models outperformed the CRF-based model by about 1.0 F1 on the both datasets.
\footnote{The PNC label got low scores on the CoNLL-2012 dataset in Table\ \ref{tab:label:result}. Almost all the gold PNC (purpose) labels are assigned to only the news article domain texts of the CoNLL-2012 dataset. The other 6 domain texts have no or very few PNC labels. This can lead to the low performance.}
\subsection*{Label Confusion Matrix}
\begin{figure}[t]
\begin{center}
\includegraphics[width=7cm]{emnlp18-conf-mat2.pdf}
\end{center}
\vspace{-0.2cm}
\caption{\label{fig:label-conf} Confusion matrix for labeling errors of our span-based model using ELMo. Each cell shows the percentage of predicted labels for each gold label.}
\end{figure}
\noindent
Figure~\ref{fig:label-conf} shows a confusion matrix for labeling errors of the span-based model using ELMo.\footnote{We have observed the same tendency of labeling confusions between the models using ELMo and SENNA.}
Following \newcite{he:17}, we only count predicted arguments that match the gold span boundaries.
The span-based model confused A0 and A1 arguments the most.
In particular, the model confused them for ergative verbs.
Consider the following two sentences:\vspace{-0.3cm}\\
\noindent
\hspace{0.5cm} People \underline{start} their own business ... \\
\vspace{0.2cm}\hspace{0.5cm} [\hspace{0.1cm} {\tt A0} \hspace{0.1cm}] \\
\hspace{0.5cm} .. Congress has \underline{started} to jump on ... \\
\vspace{-0.3cm}\hspace{0.2cm} [\hspace{0.3cm} {\tt A1} \hspace{0.3cm}] \\
\noindent
where the constituents located at the syntactic subjective position fulfill a different role A0 or A1 according to their semantic properties, such as animacy.
Such arguments are difficult for SRL models to correctly identify.
Another point is the confusions of A2 with DIR and LOC.
As \newcite{he:17} pointed out, A2 in a lot of verb frames represents semantic relations such as direction or location, which can cause the confusions of A2 with such location-related adjuncts.
To remedy these two problematic issues, it can be a promising approach to incorporate frame knowledge into SRL models by using verb frame dictionaries.
\subsection{Qualitative Analysis on Our Model}
\label{sec:qa}
\subsection*{On Span Representations}
\begin{table}[t]
\centering
{\small
\begin{tabular}{rcl} \toprule
\multicolumn{3}{c}{``$\cdots$ toy makers to \underline{move} [ across the border ] ."} \\
\multicolumn{3}{c}{\hspace{2.9cm}GOLD:A2} \\
\multicolumn{3}{c}{\hspace{2.9cm}PRED:DIR} \\ \hline \hline
\multicolumn{3}{c}{Nearest neighbors of ``across the border"}\\ \hline
1 & DIR & across the Hudson \\
2 & DIR & outside their traditional tony circle \\
3 & DIR & across the floor \\
4 & DIR & through this congress \\
5 & A2 & off their foundations \\
6 & DIR & off its foundation\\
7 & DIR & off the center field wall \\
8 & A3 & out of bed \\
9 & A2 & through cottage rooftops \\
10 & DIR & through San Francisco \\ \toprule
\end{tabular}
}
\caption{\label{tab:knn} Example of the CoNLL-2005 development set, in which our model misclassified the label for the span ``across the border". We collect 10 nearest neighbors of this span from the training set.}
\end{table}
\noindent
Our span-based model computes and uses span representations (Eq.~\ref{eq:span}) for label prediction.
To investigate a relation between the span representations and predicted labels, we qualitatively analyze nearest neighbors of each span representation with its predicted label.
Specifically, for each predicted span in the development set, we collect 10 nearest neighbor spans with their gold labels from the training set.
Table~\ref{tab:knn} shows 10 nearest neighbors of a span ``across the border" for the predicate ``move".
The label of this span was misclassified, i.e., the predicted label is DIR but the gold is A2.
Looking at its nearest neighbor spans, they have different gold labels, such as DIR, A2 and A3.
Like this case, we have observed that spans with a misclassified label often have their nearest neighbors with inconsistent labels.
\subsection*{On Label Embeddings}
\begin{figure}[t]
\begin{center}
\includegraphics[width=7cm]{emb.pdf}
\end{center}
\vspace{-0.8cm}
\caption{\label{fig:label-emb} Label embedding distribution of our span-based model.}
\end{figure}
\noindent
We analyze the label embeddings in the labeling function (Eq.~\ref{eq:label}).
Figure~\ref{fig:label-emb} shows the distribution of the learned label embeddings.
The adjunct labels are close to each other, which are likely to be less discriminative.
Also, the core label A2 is close to the adjunct label DIR, which are often confused by the model.
To enhance the discriminative power, it is promising to apply techniques that keep label representations far away from each other \cite{wen:16,luo:17}.
\section{Related Work}
\label{sec:rwork}
\subsection{Semantic Role Labeling Tasks}
Automatic SRL has been widely studied \cite{gildea:02}.
There have been two main styles of SRL.
\begin{itemize}
\setlength{\parskip}{0cm}
\setlength{\itemsep}{0cm}
\item FrameNet-style SRL \cite{baker:98}
\item PropBank-style SRL \cite{palmer:05}
\end{itemize}
\noindent
In this paper, we have tackled PropBank-style SRL.\footnote{Detailed descriptions on FrameNet-style and PropBank-style SRL can be found in \newcite{baker:98,das:14,kingsbury:02,palmer:05}.}
In PropBank-style SRL, there have been two main task settings.
\begin{itemize}
\setlength{\parskip}{0cm}
\setlength{\itemsep}{0cm}
\item Span-based SRL: CoNLL-2004 and 2005 shared tasks \cite{carreras:04,carreras:05}
\item Dependency-based SRL: CoNLL-2008 and 2009 shared tasks \cite{surdeanu:08,hajivc:09}
\end{itemize}
\noindent
Figure~\ref{fig:dep:exam} illustrates an example of span-based and dependency-based SRL.
In dependency-based SRL (at the upper part of Figure~\ref{fig:dep:exam}), the correct A2 argument for the predicate ``hit" is the word ``with".
On one hand, in span-based SRL (at the lower part of Figure~\ref{fig:dep:exam}), the correct A2 argument is the span ``with the bat".
For span-based SRL, the CoNLL-2004 and 2005 shared tasks \cite{carreras:04,carreras:05} provided the task settings and datasets.
In the task settings, various SRL models, from traditional pipeline models to recent neural ones, have been proposed and competed with each other \cite{pradhan:05,he:17,tan:18}.
For dependency-based SRL, the CoNLL-2008 and 2009 shared tasks \cite{surdeanu:08,hajivc:09} provided the task settings and datasets.
As in span-based SRL, recent neural models achieved high-performance in dependency-based SRL \cite{marcheggiani:17a,marcheggiani:17b,he:dep:18,cai:18}.
This paper focuses on span-based SRL.
\subsection{BIO-based SRL Models}
\begin{figure}[t]
\centering
\begin{dependency}[text only label, label style={above}, edge style={green!60!black,very thick}]
\begin{deptext}[column sep=.2cm]
He \& hit \& the \& ball \& with \& the \& bat \\
\end{deptext}
\depedge[edge unit distance=0.38cm]{2}{1}{{\Large \tt A0}}
\depedge[edge unit distance=0.2cm]{2}{4}{{\Large \tt A1}}
\depedge[edge unit distance=0.3cm, edge start x offset=-0.1cm]{2}{5}{{\Large \tt A2}}
\wordgroup[minimum height=0.75cm]{1}{1}{1}{a0}
\wordgroup[minimum height=0.75cm]{1}{3}{4}{a1}
\wordgroup[minimum height=0.75cm]{1}{5}{7}{a2}
\wordgroup[minimum height=0.75cm, group style={fill=orange!30}]{1}{2}{2}{prd}
\groupedge[edge below, edge style={blue!60!black,ultra thick}, label style={below, yshift=-0.05cm}]{prd}{a0}{\Large \tt A0}{0.35cm}
\groupedge[edge below, edge style={blue!60!black,ultra thick}, label style={below, yshift=-0.05cm}]{prd}{a1}{\Large \tt A1}{0.35cm}
\groupedge[edge below, edge style={blue!60!black,ultra thick}, label style={below, yshift=-0.05cm}, edge start x offset=-0.1cm]{prd}{a2}{\Large \tt A2}{0.8cm}
\end{dependency}
\caption{\label{fig:dep:exam} Example of dependency-based SRL (the upper part) and span-based SRL (the lower part).}
\end{figure}
Span-based SRL can be solved as BIO sequential tagging \cite{hacioglu:04,pradhan:05,marquez:05}.\\
\noindent
{\bf Neural models} \hspace{0.2cm} State-of-the-art SRL models use neural networks based on the BIO tagging approach.
The pioneering neural SRL model was proposed by \newcite{collobert:11}.
They use convolutional neural networks (CNNs) and CRFs.
Instead of CNNs, \newcite{zhou:15} and \newcite{he:17} used stacked BiLSTMs and achieved strong performance without syntactic inputs.
\newcite{tan:18} replaced stacked BiLSTMs with self-attention architectures.
\newcite{strubell:18a} improved the self-attention SRL model by incorporating syntactic information.
\noindent
{\bf Word representations} \hspace{0.2cm} Typical word representations, such as SENNA \cite{collobert:11} and GloVe \cite{pennington:14}, have been used and contributed to the performance improvement \cite{collobert:11,zhou:15,he:17}.
Recently, \newcite{peters:18} integrated contextualized word representation, ELMo, into the model of \newcite{he:17} and improved the performance by 3.2 F1 score.
\newcite{strubell:18b} also integrated ELMo into the model of \newcite{strubell:18a} and reported the performance improvement.
\subsection{Span-based SRL Models}
Another line of approaches to SRL is labeled span modeling \cite{xue:04,koomen:05,toutanova:05}.\\
\vspace{-0.3cm}
\noindent
{\bf Typical models} \hspace{0.2cm}
Typically, in this approach, models firstly identify candidate argument spans (argument identification) and then classify each span into one of the semantic role labels (argument classification).
For inference, several effective methods have been proposed, such as structural constraint inference by using integer linear programming \cite{punyakanok:08} or dynamic programming \cite{oscar:15,fitzgerald:15}.\\
\vspace{-0.3cm}
\noindent
{\bf Recent span-based model} \hspace{0.2cm} A very recent work, \newcite{he:18}, proposed a span-based SRL model similar to our model.
They also used BiLSTMs to induce span representations in an end-to-end fashion.
A main difference is that while they model $\text{P}(r | i, j)$, we model $\text{P}(i, j | r)$.
In other words, while their model seeks to select an appropriate label for each span ({\it label selection}), our model seeks to select appropriate spans for each label ({\it span selection}).
This point distinguishes between their model and ours.\\
\vspace{-0.3cm}
\noindent
{\bf FrameNet span-based model} \hspace{0.2cm} For FrameNet-style SRL, \newcite{swayamdipta:17} used a segmental RNN \cite{kong:16}, combining bidirectional RNNs with semi-Markov CRFs \cite{sarawagi:04}.
Their model computes span representations using BiLSTMs and learns a conditional distribution over all possible labeled spans of an input sequence.
Although we cannot compare our results with theirs, we can regard that our model is simpler and effective for PropBank-style SRL.
\subsection{Span-based Models in Other NLP Tasks}
In syntactic parsing, \newcite{wang:16} proposed an LSTM-based sentence segment embedding method named LSTM-Minus.
\newcite{stern:17,kitaev:18} incorporated the LSTM Minus into their parsing model and achieved the best results in constituency parsing.
In coreference resolution, \newcite{lee:17,lee:18} presented an end-to-end coreference resolution model, which considers all spans in a document as potential mentions and learn distributions over possible antecedents for each.
Our model can be regarded as an extension of their model.
\section{Conclusion and Future Work}
\label{sec:conc}
We have presented a simple and accurate span-based model.
We treat SRL as {\it span selection} and our model seeks to select appropriate spans for each label.
Experimental results have demonstrated that despite the simplicity, the model outperforms a strong BiLSTM-CRF model.
Also, our span-based ensemble model using ELMo achieves the state-of-the-art results on the CoNLL-2005 and 2012 datasets.
Through empirical analysis, we have obtained some interesting findings.
One of them is that the span-based model is better at label prediction compared with the CRF-based model.
Another one is that ELMo improves the model performance for span boundary identification.
An interesting direction for future work concerns evaluating span representations from our span-based model.
Since the investigation on the characteristics of the representations can lead to interesting findings, it is worthwhile evaluating them intrinsically and extrinsically.
Another promising direction is to explore methods of incorporating frame knowledge into SRL models.
We have observed that a lot of label confusions arise due to the lack of such knowledge.
The use of frame knowledge to reduce these confusions is a straightforward approach.
\section*{Acknowledgments}
This work was partially supported by JST CREST Grant Number JPMJCR1513 and JSPS KAKENHI Grant Number 18K18109.
We are grateful to the members of the NAIST Computational Linguistics Laboratory, the members of Tohoku University Inui-Suzuki Laboratory, Kentaro Inui, Jun Suzuki, Yuichiro Matsubayashi, and the anonymous reviewers for their insightful comments.
| {'timestamp': '2018-10-05T02:12:29', 'yymm': '1810', 'arxiv_id': '1810.02245', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02245'} | arxiv |
\section{Introduction}
The query complexity of Boolean functions is one of the simplest models of computation.
In this setting, the cost of the computation is the number of the input bits one needs to query to decide the value of the function on this input.
One of the main challenges is to precisely relate the computational power of the \emph{decision tree complexity} $\D(f)$, \emph{randomized decision tree complexity} $\R(f)$ and \emph{quantum decision tree complexity} $\Q(f)$ (see \cite{Aaronson_2016} for the currently known relations between various complexity measures).
\emph{Block sensitivity} $\bs(f)$ is a useful intermediate measure that has been used to show polynomial relations between the above measures.
\emph{Fractional block sensitivity} $\fbs(f)$ (aka fractional certificate complexity $\fC(f)$, randomized certificate complexity $\RC(f)$ \cite{Aaronson_2008}) is a recently introduced measure that is a relaxation of block sensitivity \cite{Tal_2013}.
It has been used to show a tight relation (up to logarithmic factors) between the \emph{zero-error randomized decision tree complexity} $\R_0(f)$ and \emph{two-sided bounded error randomized decision tree complexity} $\R_2(f)$ \cite{Kulkarni_2016}.
The relation between $\bs(f)$ and $\fbs(f)$ has been only partially understood.
On one hand, $\bs(f) \leq \fbs(f)$ and this inequality is tight.
On the other hand, it is known that $\fbs(f) \leq \bs(f)^2$ but the best known separation gives $\fbs(f) = \left(\nicefrac{1}{3\sqrt2}+o(1)\right) \bs(f)^{3/2}$ \cite{Gilmer_2016}.
We show a family of functions that give a constant factor improvement, $\fbs(f) = \left(\nicefrac{1}{\sqrt6}-o(1)\right) \bs(f)^{3/2}$.
\section{Definitions}
Let $f: \{0,1\}^n \rightarrow \{0,1\}$ be a Boolean function on $n$ variables.
We denote the input to $f$ by a binary string $x = (x_1, \ldots, x_n)$, so that the $i$-th variable is $x_i$.
For an index set $P \subseteq [n]$, let $x^P$ be the input obtained from an input $x$ by flipping every bit $x_i$, $i \in P$.
We briefly define the notions of sensitivity, certificate complexity and variations on them.
For more information on them and their relations to other
complexity measures (such as deterministic, probabilistic and quantum decision
tree complexities), we refer the reader to the surveys by Buhrman and de Wolf \cite{Buhrman_deWolf_2002}
and Hatami et al. \cite{Hatami_Kulkarni_Pankratov_2011}.
The \emph{sensitivity complexity} $\sens(f,x)$ of $f$ on an input $x$ is defined as \begin{equation} \sens(f,x) = | \{ i \in [n] \mid f(x) \neq f(x^{\{i\}})\} |.\end{equation} The \emph{sensitivity} $\sens(f)$ of $f$ is defined as $\max_{x \in \{0,1\}^n} \sens(f,x)$.
The \emph{block sensitivity} $\bs(f,x)$ of $f$ on an input $x$ is defined as the maximum number $t$ such that there are $t$ pairwise disjoint subsets $B_1, \ldots , B_t$ of $[n]$ for which $f(x) \neq f\left(x^{B_i}\right)$. We call each $B_i$ a \emph{block}.
The \emph{block sensitivity} $\bs(f)$ of $f$ is defined as $\max_{x \in \{0,1\}^n} \bs(f,x)$.
The \emph{fractional block sensitivity} $\fbs(f,x)$ of $f$ on an input $x$ is the optimal value of the following linear program, where each sensitive block of $x$ is assigned a real valued weight $w_B$:
\begin{align*}
\max \sum_{f(x) \neq f(x^B)} w_B \hspace{1.5cm} \text{subject to: } &\forall i \in [n]: \sum_{B \ni i} w_B \leq 1, \\
&\forall B: 0 \leq w_B \leq 1.
\end{align*}
The \emph{fractional block sensitivity} of $f$ is defined as $\fbs(f) = \max_{x \in \{0,1\}^n} \fbs(f,x)$.
A \emph{certificate} $C$ of $f$ is a partial assignment $C: P \rightarrow \{0,1\}, P \subseteq [n]$ of the input such that $f$ is constant on this restriction. We call $|P|$ the \emph{length} of $C$. If $f$ is always 0 on this restriction, the certificate is a \emph{0-certificate}. If $f$ is always 1, the certificate is a \emph{1-certificate}.
The \emph{certificate complexity} $\Cert(f,x)$ of $f$ on an input $x$ is defined as the minimum length of a certificate that $x$ satisfies.
The \emph{certificate complexity} $\Cert(f)$ of $f$ is defined as $\max_{x \in \{0,1\}^n} \Cert(f,x)$.
The \emph{fractional certificate complexity} $\fC(f,x)$ of $f$ on an input $x$ is the optimal value of the following linear program, where each position $i \in [n]$ is assigned a real valued weight $v_i$:
\begin{align*}
\min \sum_{i \in [n]} v_i \hspace{1.5cm} \text{subject to: } &\forall B \text{ s.t. } f(x) \neq f(x^B): \sum_{i \in B} v_i \geq 1, \\
&\forall i \in [n]: 0 \leq v_i \leq 1.
\end{align*}
The \emph{fractional certificate complexity} of $f$ is defined as $\fC(f) = \max_{x \in \{0,1\}^n} \fC(f,x)$.
For any of these measures $\M \in \{\sens, \bs, \fbs, \fC, \Cert\}$, define $\M_b(f) = \max_{x \in f^{-1}(b)} \M(f,x)$.
In that way, we define the measures $\sens_0(f)$, $\sens_1(f)$, $\bs_0(f)$, $\bs_1(f)$, $\fbs_0(f)$, $\fbs_1(f)$, $\fC_0(f)$, $\fC_1(f)$, $\Cert_0(f)$, $\Cert_1(f)$.
In particular, $\M(f) = \max\{\M_0(f), \M_1(f)\}$.
One can show that $\sens(f) \leq \bs(f) \leq \fbs(f) \leq \fC(f) \leq \Cert(f)$ \cite{Tal_2013}.
In fact, the linear programs of $\fbs(f,x)$ and $\fC(f,x)$ are duals of each other.
Therefore, $\fbs(f) = \fC(f)$.
\section{Separation}
The separation in \cite{Gilmer_2016} composes a graph property Boolean function (namely, whether a given graph is a star graph) with the $\orf$ function.
We build on these ideas and define a new graph property $g$ for the composition that gives a larger separation.
\begin{theorem}
There exists a family of Boolean functions such that $$\fbs(f) = \left(\frac{1}{\sqrt6}-o(1)\right) \bs(f)^{3/2}.$$
\end{theorem}
\begin{proof}
Let $N \geq 12$ be a multiple of 3.
An input on $\binom{N}{2}$ variables $(x_{1,2}, x_{1,3},\ldots,x_{N-1,N})$ encodes a graph $G$ on $N$ vertices.
Let $x_{i,j} = 1$ iff the vertices $i$ and $j$ are connected by an edge in $G$.
We define an auxiliary function $g : \{0,1\}^{\binom{N}{2}} \rightarrow \{0,1\}$.
Partition $[N]$ into three sets $S_0,S_1,S_2$ such that $S_r = \{i \in [N] \mid i \equiv r \pmod 3 \}$.
Let $g(x)=1$ iff:
\begin{itemize}
\item there is some vertex $i$ that is connected to every other vertex by an edge (a star graph);
\item for any $r \in \{0, 1, 2\}$, no two vertices $j, k \neq i$ such that $j, k \in S_r$ are connected by an edge.
\end{itemize}
Formally, $g(x)=1$ iff $x$ satisfies one of the following 1-certificates $C_1,\ldots,C_N$:
$C_i$ assigns 1 to every edge in $\{x_{j,k} \mid j = i \lor k = i \} $, and assigns 0 to every edge in $\{x_{jk} \mid j \neq i, k \neq i, j \equiv k \pmod 3 \}$.
Now we calculate the values of $\bs_0(g), \bs_1(g), \fbs_0(g)$.
\begin{itemize}
\item $\bs_0(g) = 3$.
Consider an input $x$ describing a triangle graph between vertices $i, j, k$.
For this input $g(x) = 0$.
Let $x'$ be an input obtained from $x$ by removing the edge $x_{i,j}$ and adding all the missing edges $x_{k,l}$, for all $l \neq i, j$.
The corresponding graph is a star graph, therefore, $g(x') = 1$.
Let $B_k$ be the sensitive block that flips $x$ to $x'$.
Similarly define $B_i$ and $B_j$.
None of the three blocks overlap, hence $\bs_0(g,x) \geq 3$.
Now we prove that $\bs_0(g) \leq 3$.
Assume the contrary, that there exists an input $x \in f^{-1}(0)$ with $\bs(g,x) \geq 4$.
Then $x$ has (at least) 4 non-overlapping sensitive blocks $B_1,\ldots, B_4$.
Each $x^{B_i}$ satisfies one of the 1-certificates, each a different one.
There are 4 such certificates, therefore at least two of them require a star at vertices $i, j$ belonging to the same $S_r$.
The corresponding certificates $C_i$ and $C_j$ both assign 1 at the edge $x_{i,j}$.
On the other hand, every other $C_k$ assigns 0 at $x_{i,j}$.
Therefore, of the 4 certificates corresponding to $B_1, \ldots, B_4$, two assign 1 to this edge and two assign 0 to this edge.
Then, regardless of the value of $x_{i,j}$, we would need to flip it in two of the blocks $B_1,\ldots, B_4$: a contradiction, since the blocks don't overlap.
Therefore no such $x$ exists.
\item $\bs_1(g) =\frac{ N^2}{6}+\frac{N}{6}$.
Examine any 1-certificate $C_i$.
Find three indices $j,k,l \equiv i \pmod 3$ (this is possible, as $N \geq 12$).
Any input $x$ that satisfies $C_i$ has $x_{i,j} = x_{i,k} = x_{i,l} = 1$.
On the other hand, any other 1-certificate $C_t$ requires at least two of the variables $x_{i,j}, x_{i,k}, x_{i,l}$ to be 0.
Hence, the Hamming distance between $C_i$ and $C_t$ is at least two.
Therefore, flipping any position of $x$ that is fixed in $C_i$ changes the value of the function as well.
Thus, $\sens(f,x) = \Cert(f,x)$.
As $\sens(f,x) \leq \bs(f,x) \leq \Cert(f,x)$, we have $$\bs(f,x) = \Cert(f,x) = |C_i| = 3{\binom{N/3}{2}} + \frac{2N}{3} = \frac{ N^2}{6}+\frac{N}{6}.$$
\item $\fbs_0(g) \geq \frac N 2$.
Examine the all zeros input $0^{\binom{N}{2}}$.
Any sensitive block $B$ of this input flips the edges on a star from some vertex.
Therefore, any position is flipped by exactly two of the sensitive blocks.
The weights $w_B = \frac 1 2$ for each sensitive block $B$ then give a feasible solution for the fractional block sensitivity linear program.
As there are $N$ sensitive blocks, $\fbs(g,0^{\binom{N}{2}}) = \frac N 2$.
\end{itemize}
To obtain the final function we use the following lemma:
\begin{lemma}[Proposition 31 in \cite{Gilmer_2016}]
Let $g$ be a non-constant Boolean function and $$f = \orf(g^{(1)}, \ldots ,g^{(m)}),$$ an $\orf$ composed with $m$ copies of $g$.
Then for complexity measures $\M \in \{\bs, \fbs\}$, we have
\begin{align*}
\M_1(f) &= \M_1(g) \\
\M_0(f) &= m \cdot \M_0(g).
\end{align*}
\end{lemma}
Let $m=\bs_1(g)/\bs_0(g)=\frac{N^2}{18}+\frac{N}{18}$.
Then $\bs(f) = \bs_0(f)=\bs_1(f) = \bs_1(g) = \frac{N^2}{6}+\frac{N}{6}$.
On the other hand, $\fbs(f) \geq \fbs_0(f)=m\cdot \fbs_0(g) \geq m \cdot \frac N 2 = \frac{N^3}{36}+\frac{N^2}{36}$.
Therefore, we have $$\fbs(f) \geq \left( \frac{N^2}{6}+\frac{N}{6} \right) \cdot \frac{N}{6} = \bs(f) \cdot \left(\frac{1}{\sqrt 6}-o(1)\right) \sqrt{\bs(f)} = \left(\frac{1}{\sqrt 6}-o(1)\right) \bs(f)^{3/2}.$$
\end{proof}
\bibliographystyle{alpha}
| {'timestamp': '2018-10-08T02:01:17', 'yymm': '1810', 'arxiv_id': '1810.02393', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02393'} | arxiv |
\section{Introduction}
Over the past three decades, the frequency and severity of wildfires in North America has grown \cite{Schoennagel4582}. From 2006 to 2015, the US Congress spent \$13 billion to suppress wildfires \cite{hoover2015wildfire}, and a record high 10.1 million acres of land were consumed by wildfires in 2015 \cite{FireCenter}. Modeling and tracking wildfire growth allows firefighters to more effectively mitigate wildfires by distributing fire suppressant. Current approaches use computer models to predict wildfire growth \cite{andrews2007predicting} or satellite images to track wildfires \cite{martin1999fire}, but neither approach offers real-time high-resolution maps of wildfires. Because wildfires can change speed and direction due to changes in wind and fuel conditions, better accuracy is needed for firefighters to monitor wildfires.
Unmanned aerial vehicles (UAVs) are increasingly popular for wildfire surveillance because they offer real-time observations without risking human pilots \cite{ambrosia2015selection,watts2012unmanned}. Julian and Kochenderfer proposed a method for wildfire monitoring with a team of small autonomous UAVs, which was shown scale with larger numbers of aircraft \cite{julian2018autonomous}. To enable automatic control of an aircraft, images of a wildfire must be processed and used to generate trajectories that maneuver the aircraft to track moving fires. Flight tests with autonomous helicopters over controlled fires demonstrated wildfire tracking through image feature matching \cite{merino2012unmanned}. Other works developed algorithms for detecting fire within images through genetic fuzzy logic \cite{kukreti2016detection} and color space conversion with threshold segmentation \cite{yuan2015uav}. This work does not model image processing but assumes wildfire locations can be extracted from raw images.
Given noisy images of wildfire locations, two approaches are proposed to filter and compile the observations into a wildfire map, referred herein as a belief map. The first approach is based on the Kalman filter \cite{kalman1960}, which was originally developed for filtering noisy observations and has since been applied to many image-based applications, such as restoring noisy images \cite{biemond1983fast} and predicting the time evolution of roadway scenes based on images of traffic \cite{dellaert1997robust}. This work performs image-based belief updates using an extended Kalman filter (EKF), which revises a wildfire belief map in locations where observations are made.
The second proposed filtering approach uses a particle filter to simulate and estimate the extent of wildfires given observations. Particle filters are popular for filtering and prediction for non-linear systems \cite{arulampalam2002tutorial} and have been used to track moving cars \cite{niknejad2012road} and people \cite{breitenstein2009robust}. In addition, particle filters have been used with observations from multiple aircraft in order to track ground targets \cite{ong2006decentralised}. This work implements a particle filter to create an accurate wildfire belief map and predict wind parameters governing the wildfire expansion, which would give firefighters a more accurate prediction of the wildfire's location and future growth.
After creating wildfire belief maps, a deep reinforcement learning (DRL) controller is trained to navigate the aircraft. DRL trains a policy mapping high dimensional or image inputs to control actions, allowing images to be used as the basis for control. DRL controllers are trained through simulation, resulting in intelligent controllers for many applications such as Atari games and Go \cite{mnih2015human,silver2016mastering}. In previous work, DRL was used to train a neural network controller that makes decisions based on observations of wildfire \cite{julian2018autonomous}. This work considers a team of two aircraft, though more aircraft can be incorporated by considering pairwise interactions~\cite{julian2018autonomous}. This work extends the previous approach by modeling camera images, incorporating observation errors, filtering observations into a belief map, and predicting wildfire growth through wind estimation. Furthermore, this work explores how flight directly over fires, where air could be turbulent and dangerous, can be discouraged. Simulated experiments show that DRL intelligently guides aircraft to survey wildfires while accurately estimating wildfire wind and future growth.
\section{Problem Formulation}
This section describes how the wildfire, aircraft, and cameras are modeled.
\subsection{Wildfire Model}\label{sec:wildfire}
A stochastic wildfire model~\cite{Bertsimas2017} is used to simulate wildfires, as done in previous work~\cite{julian2018autonomous}. An area of land is divided into a $100\times 100$ grid of cells, and each cell $s$ has some amount of fuel $F(s)$ and is either burning ($B(s)=1$), or not burning ($B(s)=0$). A non-burning cell might begin burning at the next time step if nearby cells are burning, and the probability of ignition increases with proximity to burning cells. The fuel decreases as the cell burns until the fuel is gone and the cell extinguishes. Assuming a burning rate $\beta=1$, the wildfire propagates according to
\begin{equation}
F_{t+1}(s) =
\begin{cases}
\max(0,F_t(s)-\beta)& \text{if } B_t(s)\\
F_t(s) & \text{otherwise}
\end{cases}
\end{equation}
\begin{equation} \label{eq:probIgnite}
p(s) =
\begin{cases}
1 -\prod_{s'} (1-P(s,s')B_t(s')) & \text{if } F_t(s)>0 \\
0 & \text{otherwise}
\end{cases}
\end{equation}
where $p(s)$ is the probability cell $s$ will ignite, and $P(s,s')$ is the probability cell $s'$ ignites cell $s$. Typically, $P(s,s')$ is smaller when the two cells are further apart. Wind can be modeled by biasing $P(s,s')$ in a given direction.
\begin{figure}
\centering
\vspace{1pt}
\input{FireModel.tex}
\caption{Wildfire propagation over time}
\label{fig:FireProp}
\end{figure}
\Cref{fig:FireProp} shows a wildfire spreading from an initial seed with wind blowing to the east, making the fire grow more quickly towards the east. The wildfire locations are updated once every \SI{2.5}{\second}. This simplistic wildfire model illustrates the proposed algorithms, but expert knowledge of wildfires can be incorporated by changing the growth probabilities or by adding new terms to the model. Any wildfire model that is easily simulated can be used with the presented approach.
\subsection{Aircraft Model}
Autonomous aircraft are tasked with monitoring wildfire growth. Assuming the aircraft fly at constant altitude and constant speed $v$, the position $(x,y)$ and heading direction $\psi$ of the aircraft change according to
\begin{equation}
\dot{x} = v\cos(\psi), \quad \dot{y} = v \sin(\psi), \quad \dot{\psi} = \frac{g \tan(\phi)}{v}
\end{equation}
where $g$ is the sea-level gravitational acceleration constant and $\phi$ is the aircraft bank angle. The aircraft trajectory can be controlled through $\phi$. In this work, $v=\SI{20}{\meter\per\second}$, and wind is not incorporated into the aircraft dynamics, although wind terms could be added to $\dot{x}$ and $\dot{y}$ to model the effect of wind.
\subsection{Camera Model}
Unlike prior work that assumed a fixed sensing radius around each aircraft~\cite{julian2018autonomous}, this work models fixed cameras on the aircraft to generate wildfire observations. To define the camera orientation, the aircraft orientation must first be defined. The aircraft frame is rotated with respect to the fixed north-east-down world frame using the roll-pitch-yaw convention. The aircraft body frame is centered at the aircraft center of gravity such that the $x$-axis points to the aircraft nose, the $z$-axis points downward, and the $y$-axis points out the right wing of the aircraft. In this work, the aircraft is assumed to remain at steady-level flight with pitch angle $\theta=0^\circ$. Conversion from the body frame to the world frame is accomplished by rotating about the $z$-axis by heading angle $\psi$ and then rotating about the $x$-axis by bank angle $\phi$.
The camera frame is attached to the camera with the $x$-axis and $y$-axis defining the image plane and the $z$-axis perpendicular to the image plane and positive in front of the camera. The camera is rotated with respect to the aircraft body axes. Let $\phi_c$ be the camera rotation about the aircraft $x$-axis and $\theta_c$ be the subsequent camera rotation about the $y$-axis. As a result, a point $\vect{p}_c$ defined in the camera frame has world frame coordinates $\vect{p}_w$ where
\begin{equation}
\vect{p}_w =\vect{R}_z(\theta)\vect{R}_x(\phi)\vect{R}_y(\theta_c)\vect{R}_x(\phi_c)\vect{p}_c.
\end{equation}
A simple pinhole camera model was used, which uses a camera matrix based on focal length and assumes no distortion or skew \cite{trucco1998introductory}. With camera image coordinates $(u,v)$, focal length $f$, and world points in the camera frame $(x,y,z)$, the pinhole camera model defines
\begin{equation}\label{eq:cam_mat}
(u,v)=(\frac{fx}{z},\frac{fy}{z}).
\end{equation}
Because \cref{eq:cam_mat} reduces the dimensionality of observations from 3-D to 2-D, there are infinitely many $(x,y,z)$ points that give the same $(u,v)$. However, the aircraft is assumed to be flying at altitude $h=\SI{200}{\meter}$, so there will only be one ground point for every image point. The cameras were modeled as \SI{35}{\milli\meter} cameras with \SI{24}{\milli\meter} by \SI{36}{\milli\meter} images and \SI{50}{\milli\meter} focal lengths. In this work, the aircraft use four cameras with $\theta_c=30^\circ$ and $\phi_c\in [-40^\circ,-13^\circ,13^\circ,40^\circ]$. In addition, sensor observations are limited to a range of \SI{300}{\meter} to prevent the aircraft from viewing points very far away.
\Cref{fig:Sensors} shows the observations for an aircraft in level flight and one banked $40^\circ$ during a left turn. Each aircraft observes four regions, one for each camera. The bank angle significantly skews the observations because the aircraft bank angle also rotates the attached cameras. The range of the images is limited to \SI{300}{\meter}, as shown in the right plot of \cref{fig:Sensors}, so the aircraft are limited to viewing only nearby locations.
\begin{figure}
\vspace{4pt}
\include{SensorsBank}
\vspace{-15pt}
\caption{Aircraft imaging regions without limiting range (left) and with a range limit of 300 meters (right)}
\label{fig:Sensors}
\end{figure}
Each observation image maps a region of 30 by 20 pixels from image coordinates to the ground where the wildfire of the nearest cell is observed. To introduce observation errors, 10\% of the image observations are changed at random. Noisy images are filtered and compiled into a belief map that specifies all locations believed to be burning. By compiling observations into a belief map, information over the course of many observations can be preserved and used to make informed decisions. Two methods for filtering images are presented in \cref{sec:EKF,sec:PF}.
\section{Deep Reinforcement Learning Controller}
A controller is needed to command bank angle $\phi$ so that aircraft cooperatively monitor a wildfire. One method to map state information to control commands is to train a neural network controller through deep Q-learning, a deep reinforcement learning (DRL) algorithm~\cite{mnih2015human}. Deep Q-learning trains a neural network through simulation to represent the state-action value function $Q(s,a)$. When considering two aircraft, the state information for one aircraft is composed of the relative pose of the other aircraft and wildfire locations as follows:
\begin{enumerate}
\item $\rho$ (\si{\meter}): Distance to the other aircraft
\item $\theta_r$ (\si{\radian}): Angle to other aircraft relative to the aircraft's heading direction
\item $\psi_r$ (\si{\radian}): Heading angle of other aircraft relative to the aircraft's heading direction
\item $\phi_0$ (\si{\radian}): Bank angle of aircraft
\item $\phi_1$ (\si{\radian}): Bank angle of other aircraft
\item $\text{Belief}_r$ (image): Wildfire belief map relative to aircraft position and heading
\end{enumerate}
Therefore, the state information differs for each aircraft and describes the scenario from each aircraft's perspective.
In this work, there are two possible actions: to increase or decrease commanded bank angle by $\SI{5}{\deg}$, which could be tracked using a proportional-derivative controller. Bank angle commands are given at a frequency of $\SI{10}{\hertz}$ and limited to $\phi \in [\SI{-50}{\deg},\SI{50}{\deg}]$, which allows the controller to quickly change the commanded bank angle while still commanding precise angles.
In deep Q-learning, simulations are conducted to collect tuples of state $s$, action $a$, reward $r$, and next state $s'$. For this application, the reward function is designed to encourage desired behavior and includes
\begin{enumerate}
\item Reward for new wildfire locations in belief map
\item Penalty for proximity to other aircraft
\item Penalty for flying directly over wildfire
\end{enumerate}
Rewarding the aircraft for new wildfire locations appearing in the belief map encourages the aircraft to observe areas where the wildfire is expanding. Penalizing the aircraft for flying near the other aircraft encourages the aircraft to make distinct observations, and penalizing the aircraft for flying over the wildfire discourages the aircraft from flying in potentially turbulent and dangerous conditions. The effect of the last penalty is explored in greater detail in \cref{sec:results}.
To approximate the state-action values, $Q(s,a)$ is parameterized by a neural network. For this application, the neural network uses ReLU activations and is composed of fully connected layers for the five continuous state variables and convolutional layers with max-pooling for the relative belief map image. The flattened output of the convolutional layers is concatenated with the output of the fully connected layers and followed by two more fully connected layers. The output layer is composed of two values, representing the value of the two possible actions.
For a tuple $(s,a,r,s')$, state-action values ideally follow
\begin{equation}\label{eq:qlearning}
Q(s,a) = r + \gamma \max_{a'} Q(s',a')
\end{equation}
where $\gamma$ is a discount factor, set to $\gamma=0.99$ here. Gradient descent methods are used to update the neural network parameters to minimize errors in \cref{eq:qlearning}, as described by~\citeauthor{mnih2015human}~\cite{mnih2015human}.
\section{Extended Kalman Filter}\label{sec:EKF}
One approach to filtering noisy observations uses an extended Kalman filter (EKF). Let $\vect{x}_t \in \mathbb{R}^N$ be the current state where $N$ is the number of cells in the grid and $x_t^i$ represents the probability that cell $i$ is burning at time $t$. The EKF estimates $\vect{x}_t$ with a mean value $\vect{mu}_t$ and covariance $\vect{\Sigma}_t$. With the assumption that the fire spreads slowly, $\vect{x}_t$ can be approximated as static subject to Gaussian white process noise, which allows the Jacobian of the state dynamics to be reduced to an identity matrix. Furthermore, the observation made at each point in the observation image depends on the burning status of the cells closest to the point of observation, so the observation Jacobian for a given point in the observation is 1 for cells closest to that point and 0 for other cells.
However, the EKF approach has a significant drawback. With $N=10000$, the matrix inversion of $\Sigma$ means computational complexity will be $\mathcal{O}(N^3)$~\cite{cormen2009introduction}. If observations are received at a rate of $\SI{10}{\hertz}$, then this approach will not be able to keep up with the rate of new observations. To speed up computation, each cell is assumed to be independent. This limits the filter from correlating the values of neighboring cells, but if the wildfire grows slowly, then this approximation can be effective. With this simplification, filtering is performed by $N$ one-dimensional EKFs, which greatly reduces the computational complexity to $\mathcal{O}(N)$. For each cell with initial mean $\mu_{0}=0$ and variance $\sigma_{0}=0.1$, the EKF update is defined as
\begin{align}
\bar{\mu}_{t} &= \mu_{t-1} \\
\bar{\sigma}_{t} &= \sigma_{t-1} + q \\
k &= \bar{\sigma}_{t}(\bar{\sigma}_{t} + r)^{-1} \\
\mu_{t} &= \bar{\mu}_{t} + k(y_t-\textbf{1}\{\bar{\mu}_{t}>0.5\}) \\
\sigma_{t} &= \bar{\sigma}_{t} - k\bar{\sigma}_{t}
\end{align}
where $y_t$ is the sensor observation, $q$ is the process noise variance, and $r$ is the observation noise variance~\cite{thrun2005probabilistic}.
\begin{figure}
\vspace{4pt}
\include{EKF_Plot}
\vspace{-15pt}
\caption{True wildfire (left) and EKF belief map (right)}
\label{fig:EKF}
\end{figure}
While the EKF can filter and compile noisy images into a map, there are a few limitations. The EKF does not use any model of wildfire dynamics, so regions that are not observed are static until observed again. \Cref{fig:EKF} shows the final wildfire and aircraft configuration as well as the trajectories flown as the wildfire expands. The EKF mean is thresholded with $\hat{x}=1\{\mu>0.5\}$ to produce a wildfire belief map, which is accurate near the aircraft but less accurate at other points along or inside the fire front. In addition, the underlying wind parameters governing the wildfire growth remain uncertain. The next section discusses an approach that uses a particle filter to address these issues.
\section{Particle Filter}\label{sec:PF}
An approach to filtering wildfire observations while estimating wind and wildfire growth is to use a particle filter where each particle represents a probabilistic wildfire model. As opposed to the discrete wildfire model presented in \cref{sec:wildfire}, this probabilistic model uses distributions over $B(s)$ and $F(s)$ because the true values are unknown. For each cell $s$, the probability that a cell is burning at time $t$ is $b_t(s)$ with fuel distribution $f^K_t(s)$, where $K\in[0,1,\dots,K_{\text{max}}]$ is the amount of fuel remaining. The wildfire probabilities are initialized with a small square of high probability wildfire and a uniform distribution over possible fuels, and then they are propagated according to
\begin{align}
p(f^0_{t+1}(s)) &= p(f^0_{t}(s)) + p(f^1_{t}(s))p(b_{t}(s)) \\
p(f^K_{t+1}(s)) &= p(f^K_{t}(s))(1-p(b_t(s))) + \\
&\phantom{{}=20} p(f^{K+1}_{t}(s))p(b_{t}(s)) \notag \\
\rho(s) &=1-\prod_{s'} (1-P(s,s')p(b_t(s'))) \\
p(b_t(s)) &= (1-p(f^0_{t}))[(1-p(b_t(s))\rho(s) + p(b_t(s))]
\end{align}
where $P(s,s')$ is the probability that cell $s'$ will ignite cell $s$ as a function of wind, and $\rho(s)$ is the probability that cell $s$ will ignite from nearby cells. Therefore, the wildfire probabilities will grow according to non-dimensional wind coefficients. With each time step, the wildfire probabilities are updated and the wind is allowed to change according to random Gaussian noise, which allows the particle filter to adapt to changing winds.
Each observation is used to update the particle likelihood. For particle $x$, the posterior log-likelihood $\ell(x \mid o)$ is computed according to Bayes' Rule as
\begin{equation}
\ell(x \mid o) \propto \sum_{i=1}^N \log p(o_i \mid x) + \log p(x)
\end{equation}
Initially all particles are assumed equally likely; however, as the log-likelihood is updated with new measurements, some particles will be more likely than others. After 20 wildfire steps, the particle filter is resampled with a weighted distribution proportional to the normalized particle likelihoods \cite{arulampalam2002tutorial}. Resampling removes unlikely particles and encourages the filter to explore more promising particles. After resampling, some particles will be duplicated, but the random changes added to the wind encourage the particle filter to model wildfires with different wind speeds. For this work 40 particles were used.
In addition to updating particle likelihoods, the observations are used to update the particle wildfire probabilities. For observation $o_t$ correlated with ground cell $s$, the particle update follows Bayes' rule as
\begin{align}
p(b_t(s) \mid o_t=1) &\propto p(o_t=1 \mid b_t(s))p(b_t(s)) \\
p(b_t(s) \mid o_t=0) &\propto p(o_t=0 \mid b_t(s))p(b_t(s))
\end{align}
where $p(o_t=1 \mid b_t(s))$ and $p(o_t=0 \mid b_t(s))$ define the observation model. The probability of observing correctly was set to 0.8.
\begin{figure*}
\vspace{1pt}
\include{PF_Plot}
\vspace{-15pt}
\caption{Particle filter predictions for wildfire and wind}
\label{fig:PF}
\end{figure*}
The particle filter's wildfire and wind predictions can be computed as the sum over particles weighted by normalized particle likelihood. \Cref{fig:PF} shows the state of a particle filter after a period where the aircraft have observed the wildfire. The fire probabilities can be thresholded as in the EKF approach to create a wildfire belief map that is accurate away from the aircraft, unlike the EKF belief map. Points inside the wildfire expansion have a low probability of burning because the fuel is likely depleted, and the particle filter can predict the wildfire expansion even without new observations. In addition, the particle filter accurately predicts the true wind parameters of the fire, as shown in the rightmost plot of \cref{fig:PF}, where marker size denotes particle probability.
While good observations will enhance the particle filter accuracy, observations in unimportant locations will lead to large differences between the predicted wildfire and true wildfire. Therefore, the aircraft need to fly strategic trajectories to observe as much new wildfire as possible to compute an accurate wildfire belief map.
\section{Baselines}
In the following experiments, three baseline methods for generating aircraft trajectories are compared with the DRL approaches. The first baseline chooses actions randomly, and the second baseline uses a simple heuristic method to fly near the wildfire to make observations. The third baseline uses a receding horizon approach where the wildfire belief map is used to plan a trajectory of $T$ steps, then $t<T$ steps are executed before re-planning. The trajectory is optimized using a coordinate descent approach with random restarts, which yields good trajectories without needing to evaluate all possible trajectories.
\section{Simulation Results} \label{sec:results}
Twenty random simulations were conducted for different DRL and baseline controllers. Each method was evaluated with different penalties for flying over the wildfire, and four metrics were extracted. The first metric counts the number of fire cells within \SI{40}{\meter} of the aircraft during the trajectory, while the second metric counts the number of fire cells observed during the trajectory. The third metric computes the Hamming distance between the thresholded belief map and true wildfire map, and the fourth metric computes the average error in predicted wind. Although the EKF approach does not approximate wind, the observations can be used with the particle filter even though the particle filter is not being used to guide the aircraft.
\begin{figure}
\include{ResultPlots}
\vspace{-10pt}
\caption{Simulation results for DRL and baseline methods}
\label{fig:Results}
\end{figure}
\Cref{fig:Results} shows the performance of the different methods as a function of fire cells flown over, which varies as each method is tuned with different penalties for flying over fire. Both DRL approaches dominate the baselines in all metrics. Although the EKF belief map does not represent the wildfire as well, applying the particle filter to the generated observations improves performance. Overall both the EKF and particle filter methods are effective in controlling the aircraft. These results suggest that the simpler EKF approach is as effective in guiding the aircraft as the particle filter.
\begin{figure}
\include{TrajComp}
\vspace{-10pt}
\caption{Trajectories flown with penalty for flying over wildfire}
\label{fig:Traj}
\end{figure}
\begin{figure}
\include{TrajComp_Fire}
\vspace{-10pt}
\caption{Trajectories flown without penalty for flying over wildfire}
\label{fig:TrajFire}
\end{figure}
To further study the behavior of the controllers, \cref{fig:Traj,fig:TrajFire} show the trajectories of the aircraft with different controllers. When flying over wildfire is discouraged, as in \cref{fig:Traj}, both DRL controllers circle around the wildfire at a safe distance. Furthermore, the cyan aircraft performs a stalling $360^\circ$ turn to gain separation from the other aircraft so observations are not redundant. This behavior illustrates that the aircraft can cooperate implicitly to monitor wildfire growth, while the baseline trajectories are uncoordinated and less effective. \Cref{fig:TrajFire} shows the trajectories flown when flying over wildfire is not penalized. The DRL approaches, along with the heuristic method, guide the aircraft to the interior of the fire and make tight turns, allowing the aircraft to view the entire front from one location.
\begin{figure}
\vspace{4pt}
\include{ErrorRateResults}
\vspace{-10pt}
\caption{Simulation results for DRL methods with observation errors}
\label{fig:ErrorRateResults}
\end{figure}
Increasing observation error shows one advantage of the particle filter over the EKF for controlling aircraft. As shown in \cref{fig:ErrorRateResults}, increasing the observation error level from 10\% decreases the number of fire cells observed when using the EKF but not when using the particle filter. The particle filter is less easily fooled by noisy observations because it uses a prior over wildfire locations, although the generated belief map and wind estimates degrade as the error level reaches 35\%. This result demonstrates that the particle filter controller is more robust to observation error.
\section{Conclusions}
This work presented deep reinforcement learning (DRL) controllers for wildfire surveillance using noisy camera observations. Two methods, an extended Kalman filter (EKF) and particle filter, were implemented to filter the images into a belief map, which were used as the input to the DRL controller. Simulations were conducted with different penalties for flying over the wildfire, and both DRL methods were shown to effectively guide the aircraft to survey the wildfire and outperformed baseline methods. The particle filter was able to accurately predict wildfire growth and wind parameters, which are informative indicators about the state of the wildfire. In addition, the particle filter was shown to be more robust to observation error than the EKF because it uses a prior over the wildfire locations. Animations and code can be found at github.com/sisl/UAV\_Wildfire\_Monitoring.
\section*{Acknowledgments}
The authors wish to thank Jeremy Morton for his helpful feedback. This material is based upon work supported by the National Science Foundation Graduate Research Fellowship under Grant No. DGE-1656518. Any opinion, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.
\printbibliography
\end{document}
| {'timestamp': '2019-03-05T02:03:11', 'yymm': '1810', 'arxiv_id': '1810.02455', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02455'} | arxiv |
\section{INTRODUCTION} \label{sec:intro}
The work in this paper is motivated by surface mining operations. Mine road networks connect many points of interest where raw material is extracted, stored and processed. Multiple haul trucks transport material between sources and sinks. Fig. \ref{fig:mine} shows a topologically equivalent graph of a mine road network (geometrically obfuscated for commercial reasons), with many sinks, sources, and intersections where vehicles may interact.
The overall goal in mining is to maximise material extraction. To ensure this, trucks attempt to reach their destinations in minimal time and simply travel at maximum speed, with little consideration of how their actions affect each other.
The aim of this paper is to develop a multi-vehicle trajectory planner that minimises the fleet's total traversal time. A major part of this involves making local decisions in response to interactions between vehicles, which can have complex flow-on effects on multiple other vehicles, i.e. interdependencies/coupling between vehicles.
Globally optimal methods often only solve small problems within practical computation times \cite{RN791}. The problem is challenging because resolving interactions amounts to large combinatorial problems. The number of solutions increases exponentially with the number of interactions. Interactions at intersections capture these aspects, and are the focus of this paper. Interactions from sharing road sections greatly increase the complexity of the problem. To solve optimally they require additional methods out of the scope of this paper. This paper considers only intersection interactions.
Mixed Integer Linear Programming (MILP) is used to incorporate the entire trajectory optimisation problem, and is solved with Gurobi \cite{RN1172}. The main contribution is an extension of an iterative MILP planning method, applied to multiple cooperative vehicles on road networks. An improvement to the method is also presented that reduces iterations and computation time.
A distance based objective function (OF) that avoids binary variables is formulated and analysed. Lower and upper bounds on goal times are found allowing more efficient goal constraints and fewer binary variables with a time based OF.
Additionally, a faster locally optimal heuristic algorithm is presented, as well as a planner to imitate the behaviour of real mine trucks. These typically react to imminent interactions at intersections as they are encountered during operation. Simulated experiments test and compare the reactive, heuristic, and MILP methods.
\begin{figure}[ht]
\fbox{\includegraphics[width=3.8cm, height=8.3cm, angle=90]{road.pdf}}
\caption{Graph of a mine road network. Coloured edges represent vehicle paths defined by task assignments}
\label{fig:mine}
\vspace*{-\baselineskip}
\end{figure}
\section{LITERATURE REVIEW} \label{sec:litRev}
MILP can be used for single vehicle trajectory planning \cite{RN883}, \cite{RN865}, \cite{RN930}, or for multiple cooperative vehicles \cite{RN784}, \cite{RN938}, \cite{RN950}. Dynamics are modelled as discrete time systems solved as MILPs when minimising traversal time. Big-M constraints force vehicles to stay out of static obstacle areas at each time step. Binary variables select which side of obstacles vehicles pass. Moving obstacles with known trajectories are similarly avoided by changing the avoidance area at every time step \cite{RN783}. A similar formulation to moving obstacles extends to multiple vehicles avoiding inter-vehicle collisions. Trajectories are optimised as part of the MILP, rather than predefined. This greatly increases the number of binary variables and can easily result in impractical solve time. Binary variables select the order of travel between a pair of vehicles through a common area.
\cite{RN945} presents an iterative MILP method to decrease trajectory planning time. The first iteration relaxes all avoidance constraints. Obstacle collisions are identified in the resulting trajectory, defining times to apply avoidance constraints in the next iteration. This process repeats until the trajectory is collision free. The work in \cite{RN945} is only applied to individual vehicles in a static 2D environment.
\cite{RN892}, \cite{RN893}, \cite{RN870}, \cite{RN895} plan multi-vehicle trajectories on road networks. They formulate two MILPs, with approximations that remove feasibility and optimality. The first assumes unbounded acceleration. The second constrains velocity to its maximum value at all road segment edges. They suffer long computation times, scaling poorly with vehicle interactions.
\cite{RN792}, \cite{RN791}, \cite{RN789} use Branch and Bound (BNB) to select vehicle travel order through shared areas as a sequence of decisions. A separate method plans paths adhering to vehicle orderings, which initialises an an interior-point solver. A downside of the multi-vehicle method (\cite{RN791}) is the remaining possibility of collision after optimisation.
Prioritised planners define a sequence of vehicles in order of relative priority \cite{RN1162}, \cite{RN1161}, \cite{RN1163}, \cite{RN898}. Lower priority vehicles "give way". These methods are globally suboptimal because trajectories are planned one at a time, and the combined search space of all vehicles is not considered.
Some approaches use a hierarchy of complementary planners \cite{RN980}, \cite{RN1096}, \cite{RN1028}, \cite{RN905}, \cite{RN1155}. A high level approximate solution to the global problem attempts to avoid local minima. The resulting solution is used as a reference by low level methods, which consider accurate vehicle dynamics and ensure safety. Since the high level method approximates the environment, it is generally not globally optimal at the resolution of the low level. Drawbacks of methods like \cite{RN1155} is the requirement for a priority sequence.
Reactive methods avoid collisions during execution by responding to the physical presence of agents \cite{RN1141}, \cite{RN889}, \cite{RN1145}. Solving smaller local problems lowers computational time, but there is typically no global optimality or feasibility.
\cite{RN832} apply queue theory to coordinate traffic at an intersection. \cite{RN1168} find the optimal solution to an approximation of the intersection problem with convex optimisation. \cite{RN1169} use a protocol for vehicles approaching an intersection to reserve the time-space area they will occupy during their traversal. These methods only consider individual intersections rather than an entire road network.
\section{PROBLEM OVERVIEW} \label{sec:problem}
All vehicles travel along roads of a connected network modelled as a graph $G=(V,E)$, with vertices representing sinks, sources, and intersections. Each vehicle \(i\) is given a task that defines start and goal locations in $G$. Task assignments are assumed given by another method. Shortest paths are found with graph search methods like Dijkstra.
Each vehicle's path \(P_{i}\) consists of a sequence of connected vertices \(P_{i}=\left\{v|v\in V\right\}\), which also defines a sequence of edges to travel \(\left\{e\vert e\in E\right\}\). Each road segment represented by an edge has an associated length. Length of a path is the sum of its edge lengths. The position \(x(t)\) of a vehicle at time \(t\) is measured along one dimension, relative to its given path. The vehicle travels from \(x(0)=0\) to \(x(T)=x_f\), with \(T\) being the arrival time at the goal.
A double integrator model is used for vehicle dynamics. Velocity is \(v(t)=\dot{x}(t)\in[0,v_{max}]\). Control input is acceleration, \(u(t)=\ddot{x}(t)\in[a_{min},a_{max}]\). Velocity is assumed to be positive as the aim is to minimise traversal time. Initial and final velocities \(v_{0}=v(0), v_{f}=v(T)\) are defined by tasks.
Once all vehicles have paths, their trajectories are calculated. The major complication studied in this paper concerns resolving vehicle interactions at intersections when their paths cross. If a pair of vehicle trajectories overlap in time when crossing an intersection, those trajectories will result in collision, and the interaction is labelled \emph{active}. Otherwise, it is \emph{inactive}. To ensure safety, we therefore wish to obtain trajectories that only have inactive interactions. The objective is to minimise the aggregated traversal time of all vehicles.
\section{MILP} \label{sec:MILP}
\subsection{Multi-Vehicle MILP} \label{sec:mvMILP}
This section summarises the MILP model developed in this paper. In contrast to [32], [6], [7], [8], whose multi-vehicle models involve a 2D/3D environment with collisions possible throughout the workspace, in this paper interactions are limited to vehicle-pairs whose paths cross, and only within intersection areas. The result is a smaller model and faster optimisation.
We utilise a discrete time model for the double integrator, with sampling rate \(1/\Delta t\), in which the control signal \(u_k\) is assumed to be constant throughout each step. The resulting model is given by:
\begin{equation} \label{eq:dynamics}
\begin{split}
v_{k}=v_{k-1}+u_{k} \cdot \Delta t \\
x_{k}=x_{k-1}+\frac{ \left( v_{k}+v_{k-1} \right) }{2} \cdot \Delta t
\end{split}
\end{equation}
\(K\) is defined to be a high estimate of the goal time. Binary variables \(b_{k}\) for each step determine goal arrival time. A constraint ensures that exactly one \(b_{k}\) equals to 1: \(\sum _{k=1}^{K}b_{k}=1\). The associated step \(k\) is used as the traversal time. Big-M constraints at each \(k\) ensure the vehicle has velocity \(v_f\) at position \(x_{f}\) when \(b_{k}=1\).
\begin{equation} \label{eq:finalX}
\begin{split}
x_{k} \leq x_{f}+ \left( 1-b_{k} \right) M \\
x_{k} \geq x_{f}- \left( 1-b_{k} \right) M \\
v_{k} \leq v_{f}+ \left( 1-b_{k} \right) M \\
v_{k} \geq v_{f}- \left( 1-b_{k} \right) M \\
\end{split}
\end{equation}
Where M is a large positive number.
The extension to multiple vehicles involves adding constraints to force all interactions to be inactive. Let vehicles \(i\) and \(j\) overlap a shared intersection at spatial intervals \([x_{is},x_{ie}]\) and \([x_{js},x_{je}]\) along their respective paths. At each step \(k\), four binary variables, \(c_{i,j,k,1},\ldots,c_{i,j,k,4}\), and four Big-M constraints are defined:
\begin{equation} \label{eq:avoid}
\begin{split}
x_{i,k} \leq x_{is}+Mc_{i,j,k,1} \\
x_{i,k} \geq x_{ie}-Mc_{i,j,k,2} \\
x_{j,k} \leq x_{js}+Mc_{i,j,k,3} \\
x_{j,k} \geq x_{je}-Mc_{i,j,k,4} \\
\end{split}
\end{equation}
When \(c_{i,j,k,l}=1\), the associated constraint is relaxed. When \(c_{i,j,k,l}=0\), the constraint is enforced, and one vehicle must be out of the intersection. The following constraint ensures that at least one avoidance constraint is enforced at step \(k\):
\begin{equation} \label{eq:binaryAvoid}
\sum _{l=1}^{4}c_{i,j,k,l} \leq 3
\end{equation}
The OF minimises the sum of traversal times of all \(I\) vehicles:
\begin{equation} \label{eq:objMulti}
J= \min_{b_{i,k}} \sum _{i=1}^{I} \sum _{k=1}^{K} \Delta t \cdot k \cdot b_{i,k}
\end{equation}
The \(c_{i,j,k,l}\) variables determine the vehicle travel order through intersections, and when they bypass each other. The heuristic algorithm in Section \ref{sec:heuristic} constrains both aspects with waypoint constraints, one vehicle at a time. Similarly to prioritised approaches \cite{RN1162}, \cite{RN1161}, \cite{RN898}, this results in local optimality. The advantage of the MILP method is it considers different travel orders and allows both vehicles in an interaction to adjust trajectories to resolve an interaction, resulting in global optimality.
\subsection{Efficient Goal Constraints} \label{sec:goals}
A reduction in the quantity of integer variables in an MILP generally decreases optimisation time \cite{RN938}. The solution performance can be improved by reducing the search space, by imposing lower and upper bound (LB/UB) constraints on the goal arrival time of vehicles. Let $\underline{t}_i$ be the goal time of truck $i$ while neglecting all interactions, i.e., constraints \ref{eq:avoid}-\ref{eq:binaryAvoid}. Therefore: \(b_{i,k} = 0, \forall k \leq \underline{t}_i\).
Using the heuristic procedure of Section \ref{sec:heuristic} a feasible trajectory for all vehicles can be efficiently computed, which determines the goal times $\overline{t}_i$ of all vehicles $i \in I$. A "delay" is then computed for each vehicle as $\overline{t}_i - \underline{t}_i$. An optimal solution cannot contain a truck arrival time that is later than $\underline{t}_i + \sum_{i' \in I} (\overline{t}_i' - \underline{t}_i')$. For time steps $k$ after this time: $b_{i,k} = 0$ are applied.
These techniques are applied for all approaches presented in Section \ref{sec:targeted}, as well for all the numerical results in experiments in Section \ref{sec:results}, unless otherwise stated.
\subsection{Distance-based objective function} \label{sec:distanceOF}
This section eliminates the binary variables that define when vehicles reach their goals, which generally reduces computation time. An alternative OF is presented that sums the absolute distance-to-goal values:
\begin{equation} \label{eq:objDist}
J = \min_{x_{i,k}} \sum _{i=1}^{I} \sum _{k=1}^{K} \vert x_{i,f}-x_{i,k} \vert
\end{equation}
The absolute terms in the OF are modified to make them linear. Details in \cite{RN1174}.
A limitation with OF \ref{eq:objDist} is that final velocity constraints can no longer be enforced: Only zero final velocity problems are suitable. Another is undesirable behaviour in the multi-vehicle case. The OF includes the distance-to-goal throughout the entire trajectory. Locations far from the goal early in the trajectory are penalised, and therefore so are trajectories with low velocities early on. Each vehicle's behaviour becomes greedier in attempting to reach the goal. This can be a problem when low velocity early on allows a better solution for the vehicle fleet.
A workaround is to eliminate unnecessary distance-to-goal penalties for particular time steps by using the LB/UB on goal times in section \ref{sec:goals}. The smaller range of steps to which the penalty is applied results in more direct optimisation of goal time and better behaved trajectories.
\section{ITERATIVE SOLVERS} \label{sec:solvers}
\subsection{MILP With Targeted Interaction Constraints} \label{sec:targeted}
As shown in Section \ref{sec:results}, the largest effect on the optimisation time of the MILP is from binary variables in the interaction constraints. Reducing them is the subject of this section. For the majority of a vehicle's trajectory, it will likely not be involved in an interaction. Rather than the typical approach of applying interaction constraints at all time steps, they can be reduced by only applying them to steps they are needed.
Algorithm \ref{alg:MILP} adds interaction constraints to the model in a lazy fashion, similarly to \cite{RN945}. It begins by creating a relaxed MILP model on line \ref{alg:relaxedModel} without avoidance constraints. Active interactions are identified (line \ref{alg:active}), and avoidance constraints are added for each (line \ref{alg:addConstraints}). The model is re-optimised on line \ref{alg:optimise2} and the process is repeated until no active interactions remain (line \ref{alg:MILPwhile}).
Line \ref{alg:interactionTimes} selects time steps to add avoidance constraints. \cite{RN945} applies one constraint at the midpoint of an interaction, potentially requiring many iterations for a feasible solution. Instead, a feature of the road network can be exploited, that vehicles must travel across known intersection regions. Avoidance constraints are added at every step in the time-interval between the first vehicle entering the intersection, and the last vehicle exiting. The usual result is only one additional iteration. As shown in section \ref{sec:results}, the interaction interval approach reduces solve times from the midpoint method of \cite{RN945}. Optimal solutions returned by Algorithm \ref{alg:MILP} are also optimal to the monolithic MILP of section \ref{sec:mvMILP}.
\begin{algorithm}
\caption{Iterative lazy interaction constraint MILP}\label{alg:MILP}
\begin{algorithmic}[1]
\State \textbf{Input}: Network $G(V,E)$, Vehicles with tasks $A$
\State \textbf{Output}: Multiple vehicle trajectories $S$
\State \(M \gets \mathrm{RelaxedMultiMILP}(G,A)\) \label{alg:relaxedModel}
\State \(S \gets \mathrm{Optimise(M)}\)
\State $N \gets \mathrm{ActiveInteractions}(S)$ \label{alg:active}
\While{$N\ne0$} \label{alg:MILPwhile} \Comment{While active interactions remain}
\ForAll{\(n \in N\)}
\State \( (t_1,...,t_n) \gets \mathrm{InteractionTimes}(n)\) \label{alg:interactionTimes}
\State \(M \gets \mathrm{AddAvoidanceCons}(M,n,t_1,...,t_n)\) \label{alg:addConstraints}
\EndFor
\State \(S \gets \mathrm{Optimise}(M)\) \label{alg:optimise2}
\State $N \gets \mathrm{ActiveInteractions}(S) $
\EndWhile
\State \textbf{return} $S$
\end{algorithmic}
\end{algorithm}
\subsection{Sequential Avoidance Heuristic Solver} \label{sec:heuristic}
Even with the proposed improvements of Sections \ref{sec:goals} and \ref{sec:targeted}, as the problem scales up and the number of interactions increase, MILP solve times can become impractically long. A faster alternative method is presented in iterative Algorithm \ref{alg:iterate}, which sequentially resolves active interactions.
Lines \ref{alg:relaxed} and \ref{alg:iterativeActive0} first solve the relaxed problem and find all active interactions. In each iteration, the earliest active interaction is identified (line \ref{alg:earlyInteraction}) between two vehicles. Let $i$ be the vehicle \emph{entering} the intersection first, and $j$ the last (line \ref{alg:sort}). A spatiotemporal waypoint constraint is added to the model to resolve the interaction, forcing $j$ to wait until $i$ has left the intersection. Let $\tilde{t}_{i}$ (line \ref{alg:exitTime}) be the time at which vehicle $i$ \emph{leaves} the intersection; then, the constraint added to the model is \(x_{j,k} \leq {x}_{js}\). \(k\) is the closest time step to \(\tilde{t}_i\), and \({x}_{j,s}\) is where \(j\) enters the intersection (line \ref{alg:entrancePos}).
Line \ref{alg:resolve} calls Algorithm \ref{alg:heuristic}, which calculates a new trajectory for \(j\). A a single vehicle MILP is used, adding waypoint constraints for every interaction resolution. After trajectory adjustment, active interactions are re-identified on line \ref{alg:iterativeActive}, and the process repeats until no active interactions remain. Each vehicle has a sequence of waypoints at the end.
Although not tested in this paper, an alternative is to use equality waypoint constraints: \(x_{j,k}={x}_{js}\). The idea is that the closest feasible point to an active interaction results in a close to optimal trajectory, assuming the prior trajectory solution is optimal in the relaxed problem. The advantage is the equality results in a smaller search space relative to the inequality, and therefore will take less time to optimise.
\begin{algorithm}
\caption{Sequential Avoidance Heuristic}\label{alg:iterate}
\begin{algorithmic}[1]
\State \textbf{Input}: Network $G(V,E)$, Vehicles with tasks $A$
\State \textbf{Output}: Multiple vehicle trajectories $S$
\State Calculate initial relaxed trajectories $S$ \label{alg:relaxed}
\State $N \gets \mathrm{ActiveInteractions}(S)$ \label{alg:iterativeActive0}
\While{$N\ne0$} \Comment{While active interactions remain}
\State $n_0 \gets \mathrm{EarliestInteraction}(N) $ \label{alg:earlyInteraction}
\State $i,j \gets \mathrm{SortVehicles}(n_0) $ \Comment{Non-adj., Adjusting} \label{alg:sort}
\State ${x}_{js} \gets \mathrm{EntrancePosition}(n_0,j) $ \label{alg:entrancePos}
\State $\tilde{t}_{i} \gets \mathrm{DepartureTime}(n_0,i) $ \label{alg:exitTime}
\State $s \gets \mathrm{ResolveInteraction}(j,\tilde{t}_{i},{x}_{js}) $ \label{alg:resolve}
\State $S[j] \gets s $ \Comment{Update solution set} \label{alg:update}
\State $N \gets \mathrm{ActiveInteractions}(S) $ \label{alg:iterativeActive}
\EndWhile
\State \textbf{return} $S$
\end{algorithmic}
\end{algorithm}
\begin{algorithm}
\caption{Waypoint interaction resolver}\label{alg:heuristic}
\begin{algorithmic}[1]
\State \textbf{Procedure} \(\mathrm{ResolveInteraction}(j,\tilde{t}_{i},{x}_{js},Heuristic)\):
\State \(j[WP] \gets j[WP] + \mathrm{WaypointConstraint}(\tilde{t}_{i},{x}_{js})\) \label{alg:waypoint}
\State \(s \gets \mathrm{SingleVehicleMILP}(j)\) \Comment{New trajectory for \(j\)} \label{alg:heurMILP}
\State \textbf{return} $s$
\end{algorithmic}
\end{algorithm}
\subsection{Reactive interaction resolver} \label{sec:reactive}
To compare the presented MILP methods, a reactive solver was developed that approximates the control method haul trucks use on real mines. The iterative framework of Algorithm \ref{alg:iterate} is used again, with two key differences: The interaction resolver on line \ref{alg:resolve} calls Algorithm \ref{alg:react}, and minimum time trajectories (both initial and adjusted) for each vehicle are found by solving a two-point boundary value problem (TPBVP), which has a bang-off-bang control structure \cite{RN870}.
Interactions are resolved by one of the vehicle-pair "giving way" to the other based on visibility at the intersection. Active interactions are identified by an inflated virtual safety buffer, resulting in more conservative reactions to other vehicles. Line \ref{alg:stop} adjusts \(j\)'s trajectory to stop just before the intersection. Once \(i\) exits, \(j\) proceeds again at maximum speed (line \ref{alg:goal}), regardless of whether it has stopped.
\begin{algorithm}
\caption{Reactive interaction resolver}\label{alg:react}
\begin{algorithmic}[1]
\State \textbf{Procedure} \(\mathrm{ResolveInteraction}(j,\tilde{t}_{i},{x}_{js},Reactive)\):
\State $s_{decel} \gets \mathrm{StopTrajectory}(j,{x}_{js}) $ \label{alg:stop}
\State $s_{goal} \gets \mathrm{GoalTrajectory}(s_{decel},\tilde{t}_{i}) $ \label{alg:goal}
\State $s \gets \mathrm{CombineTrajectory}(s,s_{decel},s_{goal}) $
\State \textbf{return} $s$
\end{algorithmic}
\end{algorithm}
\section{EXPERIMENTS AND RESULTS} \label{sec:results}
Experiments are run on simulated road networks in three types of scenarios. In all scenarios, vehicles begin simultaneously. Vehicle paths cross each other at multiple intersections, where interactions between vehicle-pairs occur.
The first scenario type includes two toy cases, with a road network structured as in Fig. \ref{fig:manual}, to illustrate differences between the methods presented. Vehicle 1 travels a path with three consecutive intersections, each one crossed by another vehicle. In the first case, the relaxed solution results in vehicle 1 actively interacting with every other vehicle (at intersections A,B, and C), reaching each intersection just before the others. In the second case, different road lengths change vehicle behaviour. The relaxed solution results in one active interaction between vehicles 1 and 2 at intersection A, with vehicle 2 entering first. Such cases are expected to result in locally optimal but globally suboptimal solutions with greedy algorithms such as the sequential avoidance heuristic of Section \ref{sec:heuristic}. The MILP is expected to find solutions with better sequencing decisions.
The second scenario type consist of grid-like structures, which allows a consistent way to scale problems up. An example of a 3x3 grid is Fig. \ref{fig:grid}, showing vehicle start locations. Vehicles traverse the straight line paths directly in front. A similar structure is used for grid networks of other sizes. This type of network is physically symmetric. Road segment lengths between intersections are all 100m, resulting in vehicles arriving at intersections at the same time. This results in a special problem case as both travel orders to resolve an interaction are equivalent in cost and typically both must be considered.
The last scenario uses the road network shown in Fig. \ref{fig:mine}, which contains 431 nodes and 876 connecting edges. This involved creating paths in the network defined by randomly selected start and goal nodes for 24 vehicles.
\begin{figure}[b]
\begin{subfigure}{0.55\columnwidth}
\includegraphics[width=1\columnwidth]{manual2road}
\caption{Toy case for heuristic solver}
\label{fig:manual}
\end{subfigure}
\begin{subfigure}{0.44\columnwidth}
\includegraphics[width=1\columnwidth]{grid}
\caption{Grid based road network}
\label{fig:grid}
\end{subfigure}
\caption{Two types of simulated road networks. \(S_i,G_i\) indicate the start and goal locations of vehicle \(i\).}
\label{fig:networks}
\vspace*{-\baselineskip}
\end{figure}
All solutions were computed on a PC with Windows 7, Intel Core i7-4810MQ 2.8GHz CPU, 16GB RAM. MILPs optimised with Gurobi 8. All vehicles are identical, with models approximating mining haul trucks: Lengths $15m$; mass $200t$; coefficient of rolling resistance \(0.08\), maximum and minimum accelerations \(\pm3m/s^2\).
Figs. \ref{fig:manual1Start}, \ref{fig:manual1Heur}, and \ref{fig:manual1MILP} show vehicle 1's trajectory for the first toy case in the relaxed, heuristic and MILP solutions respectively. The heuristic selects vehicle 1 to maintain its trajectory and delays all other vehicles. The total delay to the fleet is proportional to the number of vehicles. The MILP instead considers the possibility of vehicle 1 slowing down, which is sufficient for all interactions. The total delay is due to only vehicle 1's adjustment. The result is a delay time of 4s for the MILP, less than half of the heuristic's 10.9s delay.
Trajectories are shown in Figs. \ref{fig:manual2Start}, \ref{fig:manual2Heur}, and \ref{fig:manual2MILP} for the second toy case. To avoid the active interaction at intersection A, the heuristic delays vehicle 1's trajectory. This causes a new interaction at intersection B with vehicle 3. Vehicle 1 is further delayed, and a chain of delays results. The MILP instead delays vehicle 2 once rather than multiple times. The experiment results in a 2.4s delay for the MILP, and 7.1s for the heuristic. These experiments show that the MILP is able to find better solutions than the heuristic in particular problem structures.
\begin{figure}[h]
\begin{subfigure}{0.49\columnwidth}
\includegraphics[width=1\columnwidth]{manual1v1trajStart.png}
\caption{Case 1 relaxed solution}
\label{fig:manual1Start}
\end{subfigure}
\begin{subfigure}{0.49\columnwidth}
\includegraphics[width=1\columnwidth]{manual2v1trajStart.png}
\caption{Case 2 relaxed solution}
\label{fig:manual2Start}
\end{subfigure}
\begin{subfigure}{0.49\columnwidth}
\includegraphics[width=1\columnwidth]{manual1v1trajHeur.png}
\caption{Case 1 Heuristic solution}
\label{fig:manual1Heur}
\end{subfigure}
\begin{subfigure}{0.49\columnwidth}
\includegraphics[width=1\columnwidth]{manual2v1trajHeur.png}
\caption{Case 2 Heuristic solution}
\label{fig:manual2Heur}
\end{subfigure}
\begin{subfigure}{0.49\columnwidth}
\includegraphics[width=1\columnwidth]{manual1v1trajMILP.png}
\caption{Case 1 MILP solution}
\label{fig:manual1MILP}
\end{subfigure}
\begin{subfigure}{0.49\columnwidth}
\includegraphics[width=1\columnwidth]{manual2v1trajMILP.png}
\caption{Case 2 MILP solution}
\label{fig:manual2MILP}
\end{subfigure}
\caption{Trajectories of vehicle 1 in Fig. \ref{fig:manual} in two different toy cases. Blue lines show front and rear vehicle position along path, purple bars represent intersection areas. Rectangles indicate other vehicles crossing intersections: Red represents active interactions, and grey inactive.}
\label{fig:manualTrajectories}
\vspace*{-\baselineskip}
\end{figure}
Table \ref{tab:OFgoal} shows results of experiments comparing computation times of the time-based and distance-based OF, applied to grid networks of various size. Solving the model with distance-based OF is faster, ranging between 11\% to 24\% of the time-based OF. Table \ref{tab:OFgoal} also shows the effect of applying a narrower range of goal constraints as discussed in section \ref{sec:goals}. The narrower range results in solve times ranging between 24\% and 58\% of the full range model.
\begin{table}[htbp]
\centering
\begin{tabular}{|c|c|c|c|}
\hline
& \multicolumn{2}{c|}{Time OF} & Distance OF \bigstrut\\
\hline
Grid size & Narrow range & \multicolumn{2}{c|}{Full range} \bigstrut\\
\hline
1 & 0.6 & 2.5 & 0.3 \bigstrut\\
\hline
2 & 2.7 & 9.9 & 2.0 \bigstrut\\
\hline
3 & 11.0 & 19.2 & 4.8 \bigstrut\\
\hline
\end{tabular}%
\caption{Computation time (s) comparison of two OFs}
\label{tab:OFgoal}%
\vspace*{-\baselineskip}
\end{table}%
Table \ref{tab:compTime} shows the solve times of the iterative MILP methods of section \ref{sec:targeted}. The second column refers to the model with interaction avoidance constraints at all steps. Only shown up to the 4x4 size as larger problems result in long solve times. The third column refers to the iterative midpoint constraint method, which gains a computational reduction ranging between 86\% and 96\%. The fourth column refers to constraints applied to all steps during active interactions, gaining a further reduction between 18\% to 60\%. The last column refers to the heuristic of section \ref{sec:heuristic}, which is typically faster than the rest, with solve times reduction as high as 63\% over the fastest MILP method.
In terms of scaling up with problem size, the interaction-interval method scales better than the midpoint method, though not as well as the heuristic, which is approximately linear. The reactive method solve times were consistently under 10ms for all problems.
\begin{table}[htbp]
\centering
\begin{tabular}{|c|c|c|c|c|}
\hline
\multicolumn{1}{|p{1.75em}|}{Grid} & MILP & \multicolumn{2}{c|}{Iterative MILP} & Seq. Avoid. \bigstrut\\
\cline{2-4} \multicolumn{1}{|p{1.75em}|}{size} & Full range & Midpoint & Interaction interval & \multicolumn{1}{p{4.5em}|}{Heuristic} \bigstrut\\
\hline
1 & 2.5 & 0.34 & 0.14 & 0.15 \bigstrut\\
\hline
2 & 9.9 & 0.80 & 0.38 & 0.41 \bigstrut\\
\hline
3 & 19 & 1.5 & 0.73 & 0.58 \bigstrut\\
\hline
4 & 59 & 2.1 & 1.2 & 0.88 \bigstrut\\
\hline
6 & > 60 & 4.3 & 2.8 & 1.4 \bigstrut\\
\hline
8 & > 60 & 7.0 & 4.2 & 1.9 \bigstrut\\
\hline
10 & > 60 & 11 & 5.6 & 2.5 \bigstrut\\
\hline
\end{tabular}%
\caption{Computation times (s) of various methods applied to grid networks. Full range refers to adding interaction-avoidance constraints to every time step of the MILP. The two iterative methods add targeted constraints.}
\label{tab:compTime}
\vspace*{-\baselineskip}
\end{table}%
Fig. \ref{Fig:delay} displays the solution performance of various methods, measured as total delay time, defined in Section \ref{sec:goals}. The reactive solution consistently results in the highest total delay. The heuristic usually has a delay slightly higher than the MILP method. Only one MILP line is shown as the various MILP methods of Section \ref{sec:MILP} give the same answers, varying only in solve times.
\begin{figure}[t]
\centering
\includegraphics[width=1\columnwidth]{delay}
\caption{Delay time of the various methods as the problem size is scaled up}
\label{Fig:delay}
\vspace*{-\baselineskip}
\end{figure}
The delay data shows the heuristic solver works approximately as well as the MILP optimiser in terms of solution cost, and often with lower computation time for grid structured models. This can be attributed to the optimal solution consisting of any one of the two vehicles at each active interaction giving way, which does not affect any other vehicle. In these scenarios the heuristic matches this behaviour, and complexity that the MILP can capture has no advantage.
Fig. \ref{fig:mineTrajectory} shows the relaxed solution trajectories of two vehicles on the network of Fig. \ref{fig:mine}. Despite 24 vehicles, only two active interactions occur. The path in Fig. \ref{fig:v9Traj} has many intersections but almost all interactions are inactive, while Fig. \ref{fig:v23Traj} shows a short path crossing one intersection. These are representative of problems that typically arise in topologically similar networks. The interaction sparsity is due to the network containing long road segments without intersections, and the vehicles' simultaneous starting times.
Table \ref{tab:mine} summarises the results of multiple methods of another problem instance with 38 vehicles and 24 active interactions. The proposed iterative MILP method is better or equal performing than all methods and faster than all non-reactive planners. The Heuristic's lower solve time shows its superior scaling.
When there is interaction sparsity, the MILP only has a small delay time advantage over the Heuristic. For sparse problems, a local search method such as the Sequential Avoidance Heuristic is likely to achieve close to optimal solutions. As the problem is scaled up, the trade-off in computation time of the globally optimal MILP method increases.
\begin{table}[htbp]
\centering
\begin{tabular}{|l|c|r|}
\hline
& \multicolumn{1}{l|}{Comp. time (s)} & \multicolumn{1}{l|}{Delay (s)} \bigstrut\\
\hline
Reactive & 0.002 & 46.6 \bigstrut\\
\hline
Heuristic & 1.14 & 27.3 \bigstrut\\
\hline
Midpoint MILP & 10.3 & 21.8 \bigstrut\\
\hline
Interval MILP & 6.22 & 21.8 \bigstrut\\
\hline
\end{tabular}%
\caption{Computation time and delay costs of the solution of a randomised problem on the network of Fig. \ref{fig:mine}}
\label{tab:mine}%
\vspace*{-\baselineskip}
\end{table}%
\begin{figure}[ht]
\begin{subfigure}{0.49\columnwidth}
\includegraphics[width=1\columnwidth]{v9relaxed}
\caption{Vehicle 9 with long path crossing many intersections.}
\label{fig:v9Traj}
\end{subfigure}
\begin{subfigure}{0.49\columnwidth}
\includegraphics[width=1\columnwidth]{v23relaxed}
\caption{Vehicle 23 with short path crossing one intersection.}
\label{fig:v23Traj}
\end{subfigure}
\caption{Trajectories of two interacting vehicles on the road network of Fig. \ref{fig:mine}.}
\label{fig:mineTrajectory}
\vspace*{-\baselineskip}
\end{figure}
\section{CONCLUSION AND FUTURE WORK} \label{sec:conclusion}
A method to solve multi-vehicle trajectory planning problems on road networks has been presented. The approach consists of iteratively solving relaxed MILP models, adding targeted interaction-avoidance constraints in each iteration until a feasible and globally optimal solution emerges. More efficient versions of the OF and goal constraints were formulated and tested. An additional heuristic algorithm was developed with faster solve times but suboptimal solutions. Experimental results showed that the iterative MILP method reduced solve times relative to previous methods.
The presented methods will be extended to resolving interactions along shared road segments which is expected to greatly increase the complexity of the models. To test the advantages and trade-offs of the optimal MILP method, experiments will be extended to scenarios where vehicle interactions are denser. Other future work includes optimising goal times based on machinery status and queues, and incorporating energy in optimisations.
\bibliographystyle{IEEEtran}
| {'timestamp': '2018-10-08T02:05:58', 'yymm': '1810', 'arxiv_id': '1810.02517', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02517'} | arxiv |
\section{Normalization lemmas for transductions}\label{app:prelims-omitted}
In this section we give proofs omitted from \cref{sec:prelims-logic}.
\begin{proof}[of \cref{lem:normal} and of \cref{lem:normal-qf}]
We give appropriate swapping rules that allow us to arrange the
atomic operations comprising $\interp I$ into the desired normal
form.
We start with putting all the unary lifts at the front of the
sequence. Observe that whenever an atomic operation is followed by a
unary lift, then these two operations may be appropriately swapped.
This is straightforward for all atomic operations apart from
copying. For this last case, observe that copying followed by a
unary lift introducing a unary predicate~$X$ is equivalent to a
transduction that does the following. First, using unary lifts
introduce two auxiliary unary predicates $X_1$ and $X_2$,
interpreted to select vertices that are supposed to be selected by
$X$ in the original universe, respectively in the copy of the
universe. Then perform copying. Finally, use extension and reduct
operations to appropriately interpret $X$ and drop predicates
$X_1,X_2$.
Having applied the above swapping rules exhaustively, the formula is
rewritten into the form $\interp L;\interp I'$ where $\interp I'$
does not contain any lifts. Observe that if $\interp I$ was almost
quantifier-free, then $\interp I'$ is deterministic almost
quantifier-free. This proves \cref{lem:normal-qf}.
Next, we perform swapping within $\interp I'$ so that all copying
operations are put at the front of the sequence of atomic
operations. Again, it suffices to show that whenever an atomic
operation is followed by copying, then the two operations may be
swapped. For reducts this is obvious, while for extensions and
restrictions one should modify the formula parameterizing the
operation in a straightforward way to work on each copy separately.
Thus we have rewritten $\interp I$ into the form
$\interp L;\interp C;\interp I''$ where $\interp I''$ does not use
lifts or copying.
Now consider $\interp I''$. It is clear that all reduct operations
can be moved to the end of the transduction, since it does not harm
to have more relations in the structure. Next, we move all
restriction operations to the end (before reduct operations) by
showing that each restriction operation can be swapped with any
extension or function extension operation. Suppose that the
restriction is parameterized by a unary formula $\psi$, and it is
followed by an extension operation (normal or function), say
parameterized by a formula $\varphi$. Then the two operations may be
swapped provided we appropriately {\em{relativize}} $\varphi$ as
follows: add guards to all quantifiers in $\varphi$ so that they run
only over elements satisfying $\psi$, and for every term $\tau$ used
in $\varphi$ add guards to check that all the intermediate elements
obtained when evaluating $\tau$ satisfy $\psi$.
Applying these swapping rules exhaustively rewrites $\interp I''$
into the form $\interp I''';\interp X';\interp R$,
where~$\interp I'''$ is a sequence of extension and function
extension operations, $\interp X'$ is a sequence of restriction
operations, and $\interp R$ is a sequence of reduct operations. We
now argue that~$\interp X'$ can be replaced with a single
restriction operation $\interp X$. It suffices to show how to do
this for two consecutive restriction operations, say parameterized
by $\psi_1$ and $\psi_2$, respectively. Then we may replace them by
one restriction operation parameterized by $\psi_1\wedge\psi_2'$,
where $\psi_2'$ is obtained from $\psi_2$ by relativizing it with
respect to $\psi_1$ just as in the previous paragraph.
We are left with treating the extension and function extension
operations within $\interp I'''$. Whenever a formula $\varphi$
parameterizing some extension or function extension operation
within~$\interp I'''$ uses a relation symbol $R$ introduced by some
earlier extension operation within~$\interp I'''$, say parameterized
by formula~$\varphi'$, then replace all occurrences of $R$ in
$\varphi$ with~$\varphi'$. Similarly, if~$\varphi$ uses some
function $f$ that was introduced by some earlier function extension
operation within $\interp I'''$, say using formula $\varphi'(x,y)$,
then replace each usage of $f$ in $\varphi$ by appropriatiely
quantifying the image using formula $\varphi'(x,y)$. Perform the
same operations on the formula parameterizing the restriction
operation $\interp X$.
Having performed exhaustively the operations above, formulas
parameterizing all atomic operations in $\interp I''';\interp X$ use
only relations and functions that appear originally in the structure
or were added by $\interp L;\interp C$. Hence, all extension and
function extension operations within $\interp I'''$ which introduce
symbols that are later dropped in $\interp R$ can be simply removed
(together with the corresponding reduct operation). It now remains
to observe that all atomic operations within~$\interp I'''$ commute,
so they can be sorted: first function extensions, then (normal)
extensions.
\end{proof}
\begin{comment}
Next we prove that an oracle representing a given structure can be
computed in linear time when the structure is drawn from a fixed
class of bounded expansion. Actually, the result works even for any
class with {\em{bounded degeneracy}}. The {\em{degeneracy}} of a
graph $G$ is the least integer $d$ such that the vertices of $G$ can
be linearly ordered so that every vertex has at most $d$ neighbors
that are smaller in the order. A class of structures $\class{C}$ has
{\em{bounded degeneracy}} if there exists an integer $d$ such that
the Gaifman graph of every structure from $\class{C}$ has degeneracy at
most $d$. It is well-known that every class of bounded expansion has
bounded degeneracy (see e.g.~\cite{Sparsity}).
\begin{lemma} Let $\class{C}$ be a class of relational structures over a
fixed signature and of bounded degeneracy. Then there exists a
linear-time algorithm that, given a structure $\str A\in \class{C}$
encoded as its universe and lists of tuples in its relations,
constructs a data structure implementing an oracle representing
$\str A$. Each call to this oracle runs in constant time.
\end{lemma} \begin{proof}
Let $G$ be the Gaifman graph of $\str A$; clearly $G$ can be
constructed from the input in linear time. By assumption, there
exists an integer $d$ such that $G$ admits a vertex ordering
$\sigma$ of degeneracy at most $d$; i.e. one where every vertex has
at most $d$ smaller neighbors. It is well-known that a vertex
ordering of optimum degeneracy can be computed in linear time (see
e.g.~\cite{Sparsity}), hence we may compute such an ordering
$\sigma$. For every element of $\str A$ we store its index in
$\sigma$ so that comparison with respect to $\sigma$ can be
performed in constant time.
For every relation $R$ from the signature and every element $u$ of
the structures create a list of tuples $L_R(u)$, initially set to be
empty. Next, for every tuple $(u_1,\ldots,u_k)$ that belongs to $R$
in $\str A$ we find which element among $u_1,\ldots,u_k$ is the
largest in $\sigma$; let it be $u_i$. Then we add the tuple
$(u_1,\ldots,u_k)$ to the list $L_R(u_i)$. Note that at the end each
list $L_R(u)$ has length at most $(d+1)^k$, which is a constant,
since among $u$ and its at most $d$ neighbors smaller in $\sigma$
there can be at most this many tuples belonging to $R$.
The oracle call for relation $R$ is now very easy to implement:
given a tuple $(u_1,\ldots,u_k)$, find which of its elements is the
largest in $\sigma$ and search for the tuple on the constant-length
list associated with this element. \end{proof}
Finally, we provide the proof of \cref{lem:effectivity}.
\begin{proof}[Proof of \cref{lem:effectivity}]
We may assume that $\interp I$ is in the normal form provided by
\cref{lem:normal}: it starts with a sequence of unary lifts,
followed by a sequence of copying operations, and finally a
quantifier-free copyless transduction is applied. First, by
assumption that unary lifts are efficient we may apply each of them
in linear time and store the computed unary predicates as tables in
the data structure. Second, the copying operations can be clearly
applied in linear time. Hence, we are left with the remaining
quantifier-free copyless transduction; call it $\interp I'$. For
further constructions, the following claim will be useful.
\begin{claim}\label{cl:qf-eval} For every quantifier-free formula
$\varphi(x_1,\ldots,x_k)$, the following problem can be solved in
constant time: given a structure $\str A$ and its elements
$u_1,\ldots,u_k$, verify whether $\varphi(u_1,\ldots,u_k)$ holds
in $\str A$. \end{claim}
\begin{proof}\renewcommand{\qedsymbol}{\ensuremath{\lrcorner}}
Observe that given access to the oracle representing $\str A$,
every term appearing in $\varphi$ can be evaluated in constant
time. Given the evaluation of terms, every atomic formula
appearing in $\varphi$ can be evaluated in constant time, either
by an oracle call or checking whether two elements are equal.
Given the evaluation of atomic formulas, the whole quantifier-free
formula can be evaluated in constant time. \end{proof}
We now iterate through the atomic operations comprising $\interp I'$
and implement them consecutively, maintaining the structure obtained
by applying the already considered prefix of $\interp I'$. Each
reduct operation can be applied in constant time by just dropping
the appropriate query in the oracle. Each extension operation can be
also applied in constant time by adding to the oracle an appropriate
query implemented using the algorithm provided by
Claim~\cref{cl:qf-eval}.
We now implement a function extension operation, say
$\mathsf{FunExtend}_{f\leftarrow \psi}$, in quadratic time. For
every pair of elements $u$ and $v$ compute, using \cref{cl:qf-eval},
whether $\psi(u,v)$ holds. Then for each element $u$ compute $f(u)$
by iterating through all elements $v$ and checking whether there is
a unique one for which $\psi(u,v)$ is satisfied. Values of $f(u)$
can be stored as a table in the data structure so that they can be
accessed later in constant time; this yields the query algorithm for
function $f$.
Finally, we implement a restriction operation, say
$\mathsf{Restrict}_{\psi}$, in linear time. First, using
\cref{cl:qf-eval} compute the subset of the universe comprising
elements satisfying $\psi$; call it $A$ and declare it the universe
of the new structure. In the data structure we maintain the old
universe and store $A$ as a boolean table. For every oracle query
for a function $f$, we append to the query a check whether the
computed value belongs to $A$, and if this is not the case, we
return that the value is undefined. Oracle query for relations
remain unchanged. Note here that both function and relation queries
might use, as subroutines, function queries from earlier structures;
these earlier queries are {\em{not}} being modified as above.
\end{proof}
\end{comment}
\section{Proof of \cref{lem:ltd-lsd-covers}}
\begin{proof}[of \cref{lem:ltd-lsd-covers}]
We will prove that a graph class $\class{C}$ has low treedepth colorings
if and only if it has low treedepth covers. The result then follows
from \cref{thm:beltc}.
We start with the left-to-right direction. Assume $\class{C}$ has low
treedepth colorings. Then for every graph $G\in \class{C}$ and $p\in \mathbb{N}$
we may find a vertex coloring $\gamma\colon V(G)\to [N]$ using~$N$
colors where every $i \le p$ color classes induce in $G$ a subgraph
of treedepth at most~$i$; here, $N$ depends only on $p$ and $\class{C}$.
Assuming without loss of generality that $N\ge p$, define a
$p$-cover~$\cal U_G$ of size at most $\binom{N}{p}$ as follows:
$\cal U_G=\set{\gamma^{-1}(X)\colon X\subset [N], |X|=p}$.
Then~$\cal U=(\cal U_G)_{G\in \class{C}}$ is a finite $p$-cover of $\class{C}$
of bounded treedepth.
Conversely, suppose that every graph $G\in \class{C}$ admits a $p$-cover
$\cal U_G$ of size $N$ where $G[U]$ has treedepth at most $d$ for
each $U\in \cal U_G$; here, $N$ and $d$ depend only on $p$
and~$\class{C}$. Define a coloring $\chi\colon V(G)\to \cal P(\cal U_G)$
as follows: for $v\in V(G)$, let $\chi(v)$ be the set of those
$U\in \cal U_G$ for which $v\in U$. Thus, $\chi$ is a coloring of
$V(G)$ with $2^N$ colors. Take any $p$ subsets
$X_1,\ldots,X_p\subseteq \cal U_G$ such that
$\chi^{-1}(X_i)\neq \emptyset$ for each $i\in [p]$. Arbitrarily
choose any $x_i\in \chi^{-1}(X_i)$. Since $\cal U_G$ is a $p$-cover
of $G$, there exists $U\in \cal U_G$ such that
$\{x_1,\ldots,x_p\}\subseteq U$. Consequently, for each $i\in [p]$
we have that $U\in X_i$, implying $\chi^{-1}(X_i)\subseteq U$.
Hence $G[\chi^{-1}(\{X_1,\ldots,X_p\})]$ is an induced subgraph of
$G[U]$, whereas the latter graph has treedepth at most $d$ by the
assumed properties of $\cal U_G$. We conclude that every $p$ color
classes in $\chi$ induce a subgraph of treedepth at most $d$.
It remains to refine this coloring so that we in fact obtain a
coloring such that every at most $i\leq p$ color classes induce a
subgraph of treedepth at most $i$. As every~$p$ color classes
in~$\chi$ induce a subgraph of treedepth at most $d$, we can fix for
every~$p$ color classes~$I$ of $\chi$ a treedepth decomposition
$Y_I$ of height at most $d$. We define the coloring $\xi$ such that
every vertex~$v$ gets the color $\{(I, h_I) :$ $I$ is a subset of
$p$ color classes containing $v$ and $h_I$ is the depth of $v$ in
the decomposition $Y_I\}$. Note that since the number of colors of
$\chi$ is finite, the number of colors used by $\xi$ is also finite.
We now prove that in the refined coloring, any $i\leq p$ colors in
$\xi$ have treedepth at most $i$. Fix any $i\leq p$ colors in $\xi$
and denote the tuple of colors by $J$. As $\xi$ is a refinement of
$\chi$, there exists a tuple $I$ of at most $p$ colors in $\chi$
which contains all vertices of $G[J]$. Furthermore, the~$i$ selected
colors of $J$ are contained in $i$ levels of the treedepth
decomposition $Y_I$. Taking the restriction of these $i$ levels
yields a forest of height at most $i$, which is a witness that
$G[J]$ has treedepth at most $i$.
\end{proof}
\section{Proof of \cref{lem:bicliques}}
In this section we prove \cref{lem:bicliques}. One implication is
easy: it is known~\cite{Ganian2012} that every class of bounded
treedepth also has bounded shrubdepth, and moreover the
bi-clique~$K_{s,s}$ has treedepth $s+1$, so every class of bounded
treedepth excludes some bi-clique.
We need to prove the reverse implication: any class of bounded
shrubdepth that moreover excludes some bi-clique has bounded
treedepth. We will use the following well-known characterization of
classes of bounded treedepth (see~\cite[Theorem 13.3]{Sparsity}).
\begin{lemma}\label{lem:td-path}
A class of graphs $\class{C}$ has bounded
treedepth if and only if there exists a number $d\in \mathbb{N}$ such that
no graph from $\class{C}$ contains a path on more than $d$ vertices as a
subgraph.
\end{lemma}
By \cref{lem:td-path} and \cref{prop:sd_properties}(\ref{SD:3}), to
prove \cref{lem:bicliques} it is sufficient to prove the following.
\begin{lemma}
There exists a function
$g\colon \mathbb{N}\times\mathbb{N}\times \mathbb{N}\to \mathbb{N}$ such that the following holds.
For all integers $h,m,s\in \mathbb{N}$, if a graph $G$ does not contain the
bi-clique $K_{s,s}$ as a subgraph and admits a connection model of
height at most $h$ using at most $m$ labels, then $G$ does not
contain any path on more than $g(h,m,s)$ vertices as a subgraph.
\end{lemma}
\begin{proof}
We proceed by induction on the height $h$. For $h=0$, only one-vertex
graphs admit a connection model of height $0$, so we may set
$g(0,m,s)=1$.
For the induction step, suppose $G$ does not contain $K_{s,s}$ as a
subgraph and admits a connection model $T$ of height $h\geq 1$ and
using $m$ labels. Call two vertices $u$ and $v$ of $G$
{\em{related}} if they are contained in the same subtree of $T$
rooted at a child of the root of $G$, and {\em{unrelated}}
otherwise. Whenever $u$ and $v$ are unrelated, their least common
ancestor is the root of $T$, so whether they are adjacent depends
solely on the pair of their labels.
Let $P=(v_1,\ldots,v_p)$ be a path in $G$. A {\em{block}} on $P$ is
a maximal contiguous subpath of~$P$ consisting of vertices that are
pairwise related. Thus, $P$ breaks into blocks $B_1,\ldots,B_q$,
appearing on $P$ in this order. Note that each block $B_i$ is a path
that is completely contained in an induced subgraph of $G$ that
admits a connection model of height $h-1$ and using~$m$ labels.
Hence, by the induction hypothesis we have that each block $B_i$ has
at most $g(h-1,m,s)$ vertices.
For a non-last block $B_i$ (i.e. $i\leq q$), define the
{\em{signature}} of $B_i$ as the pair of labels of the following two
vertices: the last vertex of $B_i$ and of its successor on $P$, that
is, the first vertex of $B_{i+1}$. The following claim is the key
point of the proof.
\begin{claim}\label{cl:single-sig}
For any signature, the number of
non-last blocks with this signature is at most $4(s-1)$.
\end{claim}
\begin{proof}
\renewcommand{\qedsymbol}{\ensuremath{\lrcorner}}
Let $\sigma=(\lambda_1,\lambda_2)$ be the signature in question and
let $\mathcal{B}$ be the set of blocks with signature~$\sigma$;
suppose for the sake of contradiction that $|\mathcal{B}|>4(s-1)$.
Consider the following random experiment: independently color each
subtree of $T$ rooted at a child of the root black or white, each
with probability $1/2$. Call a block $B_i\in \mathcal{B}$
{\em{split}} if the last vertex of~$B_i$ is white and the first
vertex of $B_{i+1}$ is black. Since these two vertices are unrelated
(by the maximality of~$B_i$), each block $B_i$ is split with
probability~$1/4$, implying that the expected number of split blocks
is $|\mathcal{B}|/4>s-1$. Hence, some run of the experiment yields a
white/black coloring of subtrees rooted at children of the root of
$T$ and a set $\mathcal{S}\subseteq \mathcal{B}$ of $s$ blocks that
are split in this coloring.
Let $u_1,\ldots,u_s$ be the last vertices of blocks from
$\mathcal{S}$ and $v_1,\ldots,v_s$ be their successors on the path
$P$, respectively. By assumption, all vertices $u_i$ have label
$\lambda_1$ and all vertices~$v_i$ have label $\lambda_2$. Further,
all vertices $u_i$ are white and all vertices $v_i$ are black,
implying that~$u_i$ and~$v_j$ are unrelated for all $i,j\in [s]$.
Since $u_i$ is unrelated and adjacent to $v_i$, it follows
that~$u_i$ is adjacent to all vertices $v_j$, $j\in [s]$, as these
vertices are also unrelated to $u_i$ and have the same label as
$v_j$. We conclude that $u_1,\ldots,u_s$ and $v_1,\ldots,v_s$ form a
bi-clique $K_{s,s}$ in $G$, a contradiction.
\end{proof}
Since the number of possible signatures is $m^2$, by
\cref{cl:single-sig} we infer that the total number of blocks is at
most $4(s-1)m^2+1$. As we argued, each block has at most $g(h-1,m,s)$
vertices, implying $p\leq (4(s-1)m^2+1)\cdot g(h-1,m,s)$. As $P$ was
chosen arbitrarily, we may set
$$g(h,m,s)\coloneqq (4(s-1)m^2+1)\cdot g(h-1,m,s).$$
This concludes the inductive proof.
\end{proof}
\section{Conclusion}\label{sec:conclusion}
In this paper we have provided a natural combinatorial
characterization of graph classes that are first-order transductions
of bounded expansion classes of graphs. Our characterization
parallels the known characterization of bounded expansion classes by
the existence of low treedepth decompositions, by replacing the notion
of treedepth by shrubdepth. We believe that we have thereby taken a
big step towards solving the model-checking problem for first-order
logic on classes of structurally bounded
expansion
On the structural side we remark that transductions of bounded
expansion graph classes are just the same as transductions of classes
of structures of bounded expansion (i.e., classes whose Gaifman graphs
or whose incidence encodings have bounded expansion). On the other
hand, it remains an open question to characterize classes of
relational structures, rather than just graphs, which are
transductions of bounded expansion classes. We are lacking the
analogue of \cref{lem:key}; the problem is that within the proof we
crucially use the characterization of shrubdepth via SC-depth, which
works well for graphs but is unclear for structures of higher arity.
Finally, observe that classes of bounded expansion can be
characterized among classes with structurally bounded expansion as
those which are bi-clique free. It follows, that every monotone (i.e.,
subgraph closed) class of structurally bounded expansion has bounded
expansion. Exactly the same statement holds characterizing bounded
treedepth among bounded shrubdepth, and the second item holds for
treewidth vs cliquewidth. In particular, for monotone graph classes
all pairs of notions collapse.
We do not know how to extend our results to nowhere dense classes of
graphs, mainly due to the fact that we do not know whether there
exists a robust quantifier-elimination procedure for these graph
classes.
\section{Proof of \cref{lem:lsc0}\quad
\normalfont\itshape\normalsize(almost quantifier-free transductions commute with covers)}\label{sec:transductions-and-covers}
In this section we prove \cref{lem:lsc0}, which we restate for
convenience.
\setcounter{tmp}{\thetheorem}
\setcounterref{theorem}{lem:lsc0}
\addtocounter{theorem}{-1}
\begin{lemma}\label{lem:lsc}
If a class of graphs $\class{C}$ has low shrubdepth covers and
$\interp I$ is an almost quantifier-free transduction that outputs
colored graphs, then $\interp I(\class{C})$ also has low shrubdepth
covers.
\end{lemma}
\setcounter{theorem}{\thetmp}
We start with formulating the following lemma which states that
almost quantifier-free transductions are, in a certain sense, local.
\begin{lemma}\label{lem:dep}
For every deterministic almost quantifier-free transduction
$\interp I$ there is a constant $c\in \mathbb{N}$ such that the following
holds. For every structure $\str A$ and every element~$v$ of
$\interp I(\str A)$ there is a set $S_v\subset V(\str A)$ of size at
most $c$ such that for any sets $U,W$ with
$W\subset V(\interp I(\str A))$ and $U\subset V(\str A)$, if
$U\supseteq\bigcup_{v\in W}S_v$, then
$$\interp I(\str A)[W]=\interp I(\str A[U])[W].$$
\end{lemma}
\newcommand{\mathsf{cl}}{\mathsf{cl}}
In order to prove the lemma, we define the following notions of
\emph{dependency} and \emph{support}.
\begin{definition}
Suppose that $\tau(v)=(f_p\circ\cdots \circ f_1)(v)$ is a term. For
a structure~$\str A$ carrying partial functions $f_1,\ldots,f_p$, we
say that an element $v\in V(\str A)$ {\em{$\tau$-depends}} with
respect to $\tau$ on itself and all elements of the form
$(f_p\circ\cdots \circ f_i)(v)$ for $i\in [p]$, whenever defined.
For a quantifier-free formula $\varphi(x_1,\ldots,x_k)$, an element
$v\in V(\str A)$ {\em{$\varphi$-depends}} on all elements on which
$v$ $\tau$-depends, for any term $\tau$ appearing in~$\varphi$. For
an element $v$, the set of elements on which $v$ $\varphi$-depends
in $\str A$ will be denoted by $\mathsf{cl}^{\str A}_\varphi(v)$; note
that the size of this set is always bounded by a constant depending
only on $\varphi$. Observe also that given elements
$v_1,\ldots,v_k$, to check whether $\varphi(v_1,\ldots,v_k)$ holds
in $\str A$ it suffices to check whether it holds in the
substructure of~$\str A$ induced by all elements on which
$v_1,\ldots,v_k$ $\varphi$-depend.
\end{definition}
With the auxiliary notion of dependency defined we can come to the
definition of \emph{support. }
\begin{definition}
Suppose $\interp I$ is a deterministic almost quantifier-free
transduction, and let $\str A$ be an input structure. For an
element $v\in V(\interp I(\str A))$ and a subset
$S\subseteq V(\str A)$, we now define what it means that $v$ {\em{is
$\interp I$-supported}} by $S$. We first define this for atomic
operations (note that unary lifts are excluded since $\interp I$ is
assumed to be deterministic):
\begin{itemize}
\item If $\interp I$ is a reduct operation or a copy operation, then
$v$ is $\interp I$-supported by $S$ if and only if $v\in S$.
\item If $\interp I$ is a restriction or an extension operation, say
parameterized by a formula $\varphi$, then $v$ is
$\interp I$-supported by $S$ if and only if
$\mathsf{cl}^{\str A}_\varphi(v)\subseteq S$.
\item Suppose $\interp I$ is a function extension operation, say
introducing a partial function~$f$ using a binary formula
$\varphi(x,y)$. Then $v$ is $\interp I$-supported by $S$ if and
only if $\mathsf{cl}^{\str A}_\varphi(v)\subseteq S$ and the following
holds:
\begin{itemize}
\item if there exists exactly one $w\in V(\str A)$ for which
$\varphi(v,w)$ holds, then
$\mathsf{cl}^{\str A}_\varphi(w)\subseteq S$.
\item if there are at least two elements $w\in V(\str A)$ for
which $\varphi(v,w)$ holds, then
$\mathsf{cl}^{\str A}_\varphi(w)\subseteq S$ for at least two
distinct such elements $w$.
\end{itemize}
\end{itemize}
Finally, for non-atomic deterministic almost quantifier-free
transductions the notion of $\interp I$-supporting is defined by
induction on the structure of the transduction. Suppose~$\interp I$
is the composition $\interp I_1; \interp I_2$ of two transductions.
Then $v\in V(\interp I(\str A))$ is $\interp I$-supported by
$S\subseteq V(\str A)$ if there exists a subset
$T\subseteq V(\interp I_1(\str A))$ and, for each $w\in T$, a subset
$S_w\subseteq S$ such that $v$ is $\interp I_2$-supported by $T$ and
each $w\in T$ is $\interp I_1$-supported by $S_w$.
\end{definition}
The notion of supporting is trivially closed under taking supersets:
if $v$ is $\interp I$-supported by $S$, then $v$ is also
$\interp I$-supported by any superset of $S$.
\begin{proof}[of \cref{lem:dep}]
By induction on the definition of an almost quantifier-free
transduction $\interp I$ it is easy to see that for every
$v\in V(\interp I(\str A))$ there is a set $S_v\subset V(\str A)$
such that $v$ is $\interp I$-supported by $S_v$ and $|S_v|$ is
bounded by a constant, possibly depending on $\interp I$.
By induction we also observe that if $W\subset V(\interp I(\str A))$
and $U\subset V(\str A)$ are such that every $v\in W$ is
$\interp I$-supported by $U$ then
$$\interp I(\str A)[W]=\interp I(\str A[U])[W].$$
This proves the lemma.
\end{proof}
\medskip We can now prove \cref{lem:lsc}.
\begin{proof}[of \cref{lem:lsc}]
Let $\class{C}$ be a class with low shrubdepth covers and let $\interp I$
be an almost quantifier-free transduction that outputs colored
graphs. We show that $\interp I(\class{C})$ has low shrubdepth covers.
By normalizing $\interp I$ as described in \cref{lem:normal-qf}, we
may assume that $\interp I$ is of the form $\interp L;\interp J$,
where $\interp L$ is a sequence of unary lifts and $\interp J$ is
deterministic almost quantifier-free. As~$\class{C}$ has low shrubdepth
covers, the class $\class{D}=\interp L(\class{C})$ also has low shrubdepth
covers (this is implied by \cref{prop:sd_properties}(\ref{SD:5})).
Moreover, $\interp I(\class{C})=\interp J(\class{D})$. Therefore, it suffices
to focus on the deterministic almost quantifier-free
transduction~$\interp J$ applied to the class~$\class{D}$. Note that
$\class{D}$ is a class of colored graphs, i.e., graphs with unary
predicates on their vertices.
Let $c$ be the constant provided by \cref{lem:dep} for the
transduction $\interp J$. We need to find, for every $p\in \mathbb{N}$, a
finite $p$-cover of $\interp J(\class{D})$ of bounded shrubdepth, so let
us fix~$p$. Let~$\cal U$ be a finite $(c\cdot p)$-cover of $\class{D}$
of bounded shrubdepth. For a graph $G\in \class{D}$ and $U\in \cal U_G$,
let $W_U\subseteq V(\interp J(G))$ be the set of those elements $v$
of $\interp J(G)$ such that $S_v\subset U$, where~$S_v$ is as
obtained from \cref{lem:dep} applied to the deterministic almost
quantifier-free transduction $\interp J$.
Define a cover $\cal W=(\cal W_{\interp J(G)})_{G\in \class{D}}$ of
$\interp J(\class{D})$ by letting
$$\cal W_{\interp J(G)} = \{ W_U\colon U\in \cal U_G\}
\qquad \textrm{for every graph $G\in \class{D}$.}$$
Clearly $|\cal W_{\interp J(G)}|\leq |\cal U_G|$, so $\cal W$ is
finite as well. We need to verify that $\cal W$ is a $p$-cover and
that it has bounded shrubdepth.
To see that $\cal W$ is a $p$-cover, take any $p$ elements
$w_1,\ldots,w_p$ of $\interp J(G)$. Let
$S=\bigcup_{i=1}^p S_{w_i}$. Then $|S|\leq c\cdot p$, hence there
exists $U\in \cal U_G$ with $S\subseteq U$. We conclude that
$\set{w_1,\ldots,w_p}\subset W_U \in \cal W_G$.
To see that $\cal W$ is a bounded shrubdepth cover, observe that by
assumption $\class{D}[\cal U]$ has bounded shrubdepth, hence by
\cref{prop:sd_properties}(\ref{SD:5}) we find that
$\interp J(\class{D}[\cal U])$ also has bounded shrubdepth. By
\cref{lem:dep}, for each $G\in \class{D}$ and
$W_U\in \cal W_{\interp J(G)}$, the induced substructure
$\interp J(G)[W_U]$ is equal to $\interp J(G[U])[W_U]$. Now it
suffices to note that $\interp J(G[U])\in \interp J(\class{D}[\cal U])$,
hence $\interp J(G)[W_U]$ belongs to the hereditary closure of
$\interp J(\class{D}[\cal U])$, which also has bounded shrubdepth by
\cref{prop:sd_properties}(\ref{SD:1}).
\end{proof}
\section{Proof of \cref{pro:bi-def0}\quad \normalfont\itshape\normalsize(bi-definability of classes with low shrubdepth covers and classes of bounded expansion)}\label{sec:bi-def}
In this section we prove \cref{pro:bi-def0}, which we repeat for
convenience.
\setcounter{tmp}{\thetheorem}
\setcounterref{theorem}{pro:bi-def0}
\addtocounter{theorem}{-1}
\begin{proposition}\label{pro:bi-def}
Suppose $\class{C}$ is a class of graphs with low shrubdepth
covers. Then there is a pair of transductions $\interp S$ and
$\interp I$, where $\interp S$ is almost quantifier-free and
$\interp I$ is deterministic almost quantifier-free, such that
$\interp S(\class{C})$ is a class of colored graphs of bounded expansion
and $\interp I(\interp S(G))=\{G\}$ for each $G\in \class{C}$.
\end{proposition}
\setcounter{theorem}{\thetmp}
Clearly, \cref{pro:bi-def} implies that $\class{C}$ has structurally
bounded expansion, since it can be obtained as a result of
transduction $\interp I$ to a class $\interp S(\class{C})$ of bounded
expansion. Thus, the right-to-left implication of \cref{thm:main} is
a corollary of the proposition.
\medskip The idea of the proof of \cref{pro:bi-def} is as follows.
We first prove in \cref{lem:connectome} of \cref{sec:def-ccs} that
connected components in graphs of bounded shrubdepth are definable by
almost quantifier-free transductions. We use \cref{lem:connectome}
to first prove \cref{pro:bi-def} for the special case where $\class{C}$ is
a class of graphs of bounded shrubdepth, and for those we prove
bi-definability with classes of trees of bounded depth. This is done
in \cref{lem:key} of \cref{sec:key}. Then, we conclude the general
case in \cref{sec:key-general}, by lifting \cref{lem:key} using
covers.
\subsection{Defining connected components in graphs of bounded shrubdepth}\label{sec:def-ccs}
The following lemma is the combinatorial core of our proof of \cref{pro:bi-def}.
\begin{lemma}\label{lem:connectome}
Let $\class{C}$ be a class of graphs of bounded shrubdepth. There is an
almost quantifier-free transduction $\interp F$ such that for a
given $G\in \class{C}$, every output of $\interp F$ on $G$ is equal to
$G$ enriched by a function $g\colon V(G)\to V(G)$ such that
$g(v)=g(w)$ if and only if $v$ and $w$ are in the same connected
component of $G$.
\end{lemma}
The rest of \cref{sec:def-ccs} is devoted to the proof of \cref{lem:connectome}.
\medskip
\paragraph{Guidance systems.}
We first introduce the notions of {\em{guidance systems}} and of
functions {\em{guided}} or {\em{guidable}} by them. This is a
combinatorial abstraction for functions computable by almost
quantifier-free transductions.
Let $G$ be a graph. A {\em{guidance system}} in $G$ is any family
$\mathcal{U}$ of subsets of the vertex set of $G$. The {\em{size}} of a
guidance system $\mathcal{U}$ is the cardinality of the family $\mathcal{U}$. We say
that a partial function $f\colon V(G)\rightharpoonup V(G)$ is {\em{guided}} by
the guidance system $\mathcal{U}$ if for every $x\in V(G)$ for which $f(x)$ is
defined and different than $x$, there is some $U\in\mathcal{U}$ such
that~$f(x)$ is the unique neighbor of $v$ in $U$. Finally, a partial
function $f\colon V(G)\rightharpoonup V(G)$ is \emph{$\ell$-guidable}, where
$\ell\in\mathbb{N}$, if there is a guidance system $\mathcal{U}$ of size at most
$\ell$ in $G$ that such that $f$ is guided by $\mathcal{U}$.
Observe that an $\ell$-guidable partial function maps each vertex $v$
from its domain to a vertex in the same connected component as $v$.
The following lemmas will be useful for operating on guidable
functions.
\begin{lemma}[$\star$]\label{lem:glue-directed}
Let $G$ be a graph and suppose $g\colon V(G)\rightharpoonup V(G)$ is a
partial function such that the restriction $g|_C$ of $g$ to each
connected component $C$ of $G$ is $\ell$-guidable. Then $g$ is
$\ell$-guidable.
\end{lemma}
\begin{lemma}[$\star$]\label{lem:glue-directable}
Let $G$ be a graph and let $g_1,\ldots,g_s\colon V(G)\rightharpoonup V(G)$ be
partial functions, where $g_i$ is $\ell$-guidable for each
$i\in [s]$. If $g\colon V(G)\rightharpoonup V(G)$ is a partial function such
that for every $x\in V(G)$ there is some $i\in[s]$ such that
$g(x)=g_i(x)$, then $g$ is $(\ell\cdot s)$-guidable.
\end{lemma}
Finally, guidable functions can be computed using almost
quantifier-free transductions.
\begin{lemma}[$\star$]\label{lem:local}
Let $\class{C}$ be a class of graphs and let $\ell\in\mathbb{N}$ be
fixed. Suppose that each $G\in \class{C}$ is equipped with an
$\ell$-guidable function $f_G\colon V(G)\rightharpoonup V(G)$. Then there
exists an almost quantifier-free transduction which given
$G\in \class{C}$ has exactly one output: the graph $G$ enriched
with~$f_G$.
\end{lemma}
We will use the following fact stating that graphs of bounded shrubdepth do not
admit long induced paths.
\begin{lemma}[\cite{Ganian2013}]\label{lem:ind-paths}
For every class $\class{C}$ of graphs of bounded shrubdepth there exists
a constant $r\in \mathbb{N}$ such that no graph from $\class{C}$ contains a path
on more than $r$ vertices as an induced subgraph. Consequently, for
every graph $G\in \class{C}$ every connected component of $G$ has
diameter at most $r$.
\end{lemma}
\paragraph{Spanning forests.}
For a graph $G$ and a function $g\colon V(G)\to V(G)$, we
say that $g$ \emph{defines a spanning forest of depth $r$} on $G$
if $g$ is guarded by $G$ and
the $r$-fold composition $g^r\colon V(G)\to V(G)$ is constant when restricted to each connected component of~$G$.
In particular, two vertices $u,v\in V(G)$ are in the same connected component of $G$
if and only if $g^r(u)=g^r(v)$.
The following lemma states that guidance systems can define
shallow spanning forests in graph classes of bounded shrubdepth.
\begin{lemma}\label{lem:bfs}
For every class $\class{C}$ of graphs of bounded shrubdepth there exist
constants $q,r\in \mathbb{N}$ such that for every $G\in \class{C}$ there is
a function $f_G\colon V(G)\to V(G)$ which is $q$-guidable as a partial
function on $G$ and defines a spanning forest of depth $r$ on $G$.
\end{lemma}
We first show how \cref{lem:connectome} follows from \cref{lem:bfs}.
\begin{proof}[of \cref{lem:connectome}]
By \cref{lem:local}, there is an almost
quantifier-free transduction~$\interp I$ which, given a graph $G\in\class{C}$ on input, constructs the
function $f_G$ obtained from \cref{lem:bfs}. Now let $g=f_G^r$ be the
$r$-fold composition of $f$. Clearly, $g$ can be computed by an
almost quantifier-free transduction using a single function
extension operation, making use of the function~$f_G$ constructed by
$\interp I$. As $g$ is constant on every connected component of $G$, \cref{lem:connectome} follows.
\end{proof}
It remains to prove \cref{lem:bfs}.
\paragraph{Constructing guidable choice functions.}
\cref{lem:bfs} will follow easily from
the fact that connected components of graphs of bounded shrubdepth have bounded diameter by \cref{lem:ind-paths},
and from the following lemma, essentially stating that every total binary relation whose graph has bounded shrubdepth
contains a guidable choice function.
\begin{lemma}\label{lem:go-right}
For every class $\class{C}$ of graphs of bounded shrubdepth there exists
a constant $p\in \mathbb{N}$ such that the following holds. Suppose
$G\in \class{C}$ and $A$ and $B$ are two disjoint subsets of vertices of
$G$ such that every vertex of $A$ has a neighbor in $B$. Then there
is a function $f\colon A\to B$ which is $p$-guidable as a partial
function on $G$.
\end{lemma}
We found two conceptually different proofs of this result. We believe
that both proofs describe complementary viewpoints on the problem, so
we present both of them. To keep the presentation concise, in the
main body of the paper we give only one proof, using the
characterization of classes of bounded shrubdepth using connection
models, and their close connection to \emph{bi-cographs}.
We present the second proof in Appendix~\ref{app:greedy}, which provides an explicit
greedy procedure leading to the construction of $f$.
\medskip
We first prove a special case of \cref{lem:go-right} for graphs which
have a connection model using two different labels $\alpha$ and
$\beta$, where one part of $G$ has label $\alpha$ and the other part
has label $\beta$. Such graphs are called {\em{bi-cographs}}
(cf.~\cite{Giakoumakis1997}).
\begin{lemma}\label{lem:go-right-bico}
Let $G$ be a bi-cograph with parts $A,B$ and with a connection model
of height~$h$ where vertices in $A$ have label $\alpha$ and vertices
in $B$ have label $\beta$. Suppose further that every vertex in $A$
has a neighbor in $B$. Then there is a function $f\colon A\to B$
which is $h$-guidable as a partial function on $G$.
\end{lemma}
\begin{proof}
By \cref{lem:glue-directed}, it is enough to consider the case when
$G$ is connected. Let~$T$ be the assumed connection model of height
$h$.
We prove that there is an $h$-guidable function $f\colon A\to B$.
The proof proceeds by induction on $h$. The base case, when $h=1$
is trivial, because then every vertex of $A$ is adjacent to every
vertex of $B$, so picking any $w\in B$ the function $f\colon A\to B$
which maps every $v\in A$ to $w$ is guided by the guidance system
consisting only of $\set{w}$.
In the inductive step, assume that $h\ge 2$ and the statement holds
for height $h-1$. Since~$G$ is connected, either the label $C(r)$
of the root $r$ contains the pair $(\alpha,\beta)$, or~$r$ has only
one child $v$. In the latter case, the subtree of $T$ rooted at $v$
is a connection model of $G$ of height $h-1$, so the conclusion
holds by inductive assumption. Hence, we assume that
$(\alpha,\beta)\in C(r)$.
Let $\cal S$ be the set of bipartite induced subgraphs $H$ of $G$
such that $H$ is defined by the connection model rooted at some
child of $r$ in $T$. As $(\alpha,\beta)\in C(r)$, it follows that
if $H_1,H_2\in\cal S$ are two distinct graphs, then every vertex
with label $\alpha$ in $H_1$ is connected to every vertex with label
$\beta$ in $H_2$. We consider two cases, depending on whether
$\cal S$ contains more than one graph $H$ containing a vertex with
label $\beta$, or not.
In the first case, there are at least two graphs $H_1,H_2\in\cal S$
such that $H_1$ and $H_2$ both contain a vertex with label
$\beta$. Pick $w_1\in V(H_1)$ and $w_2\in V(H_2)$, both with label
$\beta$. Then every vertex in $A$ is adjacent either to $w_1$ or to
$w_2$. Let $f\colon A\to B$ be a function which maps a vertex
$v\in A$ to $w_1$ if $v$ is adjacent to $w_1$, and to $w_2$
otherwise. Then $f$ is guided by the guidance system consisting of
$\set{w_1}$ and $\set{w_2}$.
In the second case, there is only one graph $H\in\cal S$ which
contains a vertex with label $\beta$. Pick an arbitrary vertex $w$
with label $\beta$ in $H$. Notice that every vertex in $V(G)-V(H)$
is adjacent to $w$. The graph $H$ has a connection model of height
$h-1$, so by inductive assumption, there is a guidance system
$\cal U\subset\pow{V(H)}$ of size at most $h-1$ and a function
$f_0\colon V(H)\cap A\to V(H)\cap B$ which is guided by $\cal U$.
Then the function $f\colon A\to B$ which extends $f_0$ by mapping
every vertex in $V(G)-V(H)$ to $w$ is guided by
$\cal U\cup\set{\set{w}}$. In either case, we have constructed a
$h$-guidable function $f\colon A\to B$, as required.
\end{proof}
We now prove \cref{lem:go-right} in the general case.
\begin{proof}[of \cref{lem:go-right}]\label{pf:}
Let $\class{C}$ be a class of graphs of bounded shrubdepth. Hence, there
is a finite set of labels $\Lambda$ and a number $h\in\mathbb{N}$ such that
every graph $G\in\class{C}$ has a connection model of height $h$ using
labels from $\Lambda$. For $\alpha\in\Lambda$, let $V_\alpha$ denote
the set of vertices of $G$ which are labeled $\alpha$.
Define a function $\mu\colon A\to \Lambda^2$ as follows: for every
vertex $v$ define $\mu(v)$ as $(\alpha,\beta)$, where $\alpha$ is
the label of $v$, and $\beta\in\Lambda$ is an arbitrary label such
that $v$ has a neighbor in~$B$ with label $\beta$.
For every pair of labels $\alpha,\beta$, consider the bipartite
graph $G_{\alpha\beta}$ which is the subgraph of $G$ consisting of
$\mu^{-1}((\alpha,\beta))$ on one side and $B\cap V_\beta$ on the
other side, and all edges between these sets; note that they are
disjoint, as one is contained in $A$ and second in~$B$. Observe that
$G_{\alpha\beta}$ is a bi-cograph with a connection model of height
$h$, such that every vertex in $V(G_{\alpha\beta})\cap A$ has a
neighbor in $V(G_{\alpha\beta})\cap B$. By \cref{lem:go-right-bico}
there is a function
$f_{\alpha\beta}\colon \mu^{-1}((\alpha,\beta)) \to B\cap V_\beta$
which is $h$-guidable in $G_{\alpha\beta}$. Observe that
$f_{\alpha\beta}$ is also $h$-guidable when treated as a partial
function on $G$; it suffices to take the same guidance system, but
with all its sets restricted to~$B$.
Finally, define the function $f\colon A\to B$ so that if $v\in A$ and
$\mu(v)=(\alpha,\beta)$, then $f(v)=f_{\alpha\beta}(v)$. By
\cref{lem:glue-directable}, the function $f$ is
$(h\cdot |\Lambda|^2)$-guidable. This concludes the proof of
\cref{lem:go-right}.
\end{proof}
\paragraph{Constructing guidable spanning forests.}
We are ready to complete the proof of \cref{lem:bfs} stating that shallow
spanning forests on classes of bounded shrubdepth are definable by guidance systems.
\begin{proof}[of \cref{lem:bfs}]
Let $\class{C}$ be a class of graphs of bounded shrubdepth, and
let $r$ and $p$ be constants provided by \cref{lem:ind-paths} and
\cref{lem:go-right}, respectively, for the class~$\class{C}$.
Let
$R_0\subset V(G)$ be a set of vertices which contains exactly one
vertex in each connected component $C$ of $G$.
By \cref{lem:ind-paths}, we may assume that
every vertex in $G$ is at distance at most $r$ from a unique vertex in $R_0$.
For
$i=1,\ldots,r$, let $R_i$ be the set of vertices of $G$ whose
distance to some vertex in $R_0$ is equal to~$i$. Then the sets $R_0,R_1,\ldots,R_r$ form a partition
of the vertex set of $G$. Furthermore, observe that for
$i=1,\ldots,r$, every vertex of $R_i$ has a neighbor in $R_{i-1}$.
Fix a number $i\in\set{1,\ldots,r}$. Apply \cref{lem:go-right} to
$R_i$ as $A$ and $R_{i-1}$ as $B$. This yields a function
$f_i\colon R_i\to R_{i-1}$ which is $p$-guidable in
$G[R_i\cup R_{i-1}]$. In particular, $f_i$ is also a $p$-guidable
partial function $f_i\colon V(G)\rightharpoonup V(G)$.
Let $f_0$ be a partial function from $V(G)$ to $V(G)$ that fixes
every vertex of $R_0$ and is undefined otherwise. Then $f_0$ is
guided by the guidance system $\{R_0\}$, hence it is $1$-guidable in
$G$.
Consider now the function $f_G\colon V(G)\to V(G)$ such that for
$u\in V(G)$, $f_G(u)=f_i(u)$ if $f_i(u)$ is defined for some
$i\in\set{0,\ldots,r}$. By the first item of
\cref{lem:glue-directable} we find that~$f_G$ is
$p(r+1)$-guidable. By construction, $f_G$ is guarded, and
$f_G^r$ maps every vertex $v\in V(G)$
to the unique vertex in $R_0$ which lies in the connected component of $v$.
This proves that $f_G$ defines a spanning forest of depth $r$ on $G$.
\end{proof}
This completes the proof of \cref{lem:connectome}.
\subsection{\cref{pro:bi-def} for classes of bounded shrubdepth}\label{sec:key}
In this section, we prove \cref{pro:bi-def} in the special case when
$\class{C}$ is a class of graphs of bounded shrubdepth:
\begin{lemma}\label{lem:key}
Let $\cal B$ be a class of graphs of bounded shrubdepth. Then there
is a class $\cal T$ of colored trees of bounded height and a pair of
transductions $\interp T$ and $\interp B$ such that $\interp T$ is
almost quantifier-free, $\interp B$ is deterministic almost
quantifier-free, $\interp T(\cal B)\subseteq \cal T$,
$\interp B(\cal T)\subseteq \cal B$, and
\[
\interp B(\interp T(G))=\{G\}\ \ \textrm{for all}\ \ G\in {\cal B}
\quad \textrm{and}\quad \interp T( \interp B(t))\ni t\ \ \textrm{for
all}\ \ t\in \cal T.
\]
Moreover, for any $G\in \cal B$, every $t\in \interp T(G)$ is an
SC-decomposition of $G$.
\end{lemma}
We remark that in \cref{lem:key}, every output of the transduction
$\interp T$ is an SC-decomposition of the input graph of bounded
depth, whereas the transduction $\interp B$ recovers the graph from
its SC-decomposition.
In other words, the lemma allows to construct the SC-decomposition of
a graph from a class of graphs of bounded shrubdepth using an almost
quantifier-free transduction.
This argument is the combinatorial cornerstone of our approach.
Conceptually, it shows that bounded-height decompositions of graphs
from classes of bounded shrubdepth can be defined in a very weak
logic, as essentially the whole information about the decomposition
can be pushed to unary predicates on vertices (added using unary
lifts), and from this information the decomposition can be
reconstructed using only deterministic almost quantifier-free
formulas.
\medskip
We need one more auxiliary lemma which allows to apply a transduction
in parallel to a disjoint union of structures. Suppose $\cal K$ is a
set of structures over the same signature. The \emph{bundling} of
$\cal K$ is a structure obtained by taking the disjoint union
$\bigcup \cal K$ of the structures in~$\cal K$, extended with a set
$X$ disjoint from $V(\bigcup\cal K)$ and a function
$f\colon V(\bigcup\cal K)\to X$ such that $f(x)=f(y)$ if and only if
$x,y$ belong to the same structure in $\cal K$. We denote such a
bundling by $\bigcup \cal K^X$. We now prove that an almost
quantifier-free transduction working on each structure separately can
be lifted to their bundling.
\begin{lemma}[$\star$]\label{lem:parallel}
Let $\interp I$ be an almost quantifier-free transduction. Then
there is an almost quantifier-free transduction ${\interp I}^\star$
such that if the input to $\interp I^\star$ is the bundling
$\bigcup \cal K^X$ of $\cal K$, then
$\interp I^\star(\bigcup \cal K^X)$ is the set containing the
bundling of every set formed by taking one member from
$\interp I(\str K)$ for each $\str K\in \cal K$.
\end{lemma}
We can now give a proof of \cref{lem:key}.
\begin{proof}[of \cref{lem:key}]
Let $\cal B_d$ be the class of graphs of SC-depth at most $d$. We
prove the statement for $\cal B=\cal B_d$, yielding appropriate
transductions $\interp B_d$ and $\interp T_d$. Observe that this
implies the general case: if $\cal B$ is any class of graphs of
bounded shrubdepth, then by \cref{prop:sd_properties}(\ref{SD:2})
there is a number $d$ such that every graph from $\cal B$ has
SC-depth at most $d$, hence we may set $\interp B=\interp B_d$,
$\interp T=\interp T_d$, and $\cal T=\interp T(\cal B)$.
The proof is by induction on $d$. The base case, when $d=0$, is
trivial. In general, every output of $\interp T_d$ will be an
SC-decomposition of the input graph of depth $d$. That is, it is a
tree of height $d$, here encoded as a structure by providing its
parent function. The leaves of this tree are exactly the original
vertices of the input graph $G$. They are colored with $d$ unary
predicates $W_0,W_1,\ldots,W_{d-1}$, corresponding to flip sets used
on consecutive levels of the SC-decomposition.
Now, given an almost quantifier-free transduction $\interp T_d$ we
construct an almost quantifier-free transduction $\interp T_{d+1}$.
The transduction $\interp T_{d+1}$, given a graph $G$,
nondeterministically computes a rooted tree $t_G$ as above in the
following steps. Implementing each of them using an almost
quantifier-free transduction is straightforward, and to keep the
description concise, we leave the implementation details to the
reader.
\begin{itemize}
\item Since $G\in \cal B_{d+1}$, there is a vertex subset
$W\subseteq V(G)$ such that in the graph $G'$ obtained from $G$ by
flipping the adjacency within $W$ every connected component
belongs to $\cal B_d$. Using a unary lift, introduce a unary
predicate $W_{0}$ selecting the set $W$ and compute $G'$ by
flipping the adjacency within $W_{0}$.
\item Let $g\colon V(G')\to V(G')$ be the function given by
\cref{lem:connectome}, applied to the graph~$G'$. Note that $g$
can be constructed using an almost quantifier-free transduction.
Using copying and restriction, create a copy $X$ of the image of
$g$. By composing~$g$ with the function that maps each element of
the image of~$g$ to its copy (easily constructible using function
extension), we construct a function $g'\colon V(G')\to X$ such that
$g'(v)=g'(w)$ if and only if $v$ and $w$ are in the same connected
component of $G'$. Hence, $g'\colon V(G')\to X$ defines a bundling
of the set of connected components of~$G'$.
\item Apply \cref{lem:parallel} to the transduction $\interp T_d$
yielding a transduction $\interp T_d^\star$. Our transduction
$\interp T_{d+1}$ now applies $\interp T_d^\star$ to the bundling
given by $g'$, resulting in a bundling of the family of colored
trees $t_C$, for $C$ ranging over the connected components
of~$G'$.
\item Using extension, mark the roots of the trees $t_C$ with a new
unary predicate; for $C$ ranging over the connected components of
$G'$ these are exactly elements that do not have a parent. Create
new edges which join each such a root $r$ with $g'(r)$. In effect,
for every connected component $C$ of $G'$, all the roots of the
trees $t_C$ are appended to a new root $r_C$. At the end clear
all unnecessary relations from the structure. Note that the
obtained tree~$t_G$ retains all unary predicates $W_1,\ldots,W_d$
that were introduced by the application of the transduction
$\interp T_d^\star$ to $G'$, as well as the predicate $W_{0}$
introduced at the very beginning. All these predicates select
subsets of leaves of $t_G$.
\end{itemize}
This concludes the description of the almost quantifier-free
transduction $\interp T_{d+1}$. The transduction $\interp B_{d+1}$
is defined similarly, and reconstructs $G$ out of $t_G$ recursively
as follows:
\begin{itemize}
\item Let $r$ be the root of $t_G$; it can be identified as the only
vertex that does not have a parent. Remove $r$ from the structure,
thus turning $t_G$ into a forest $t'_G$, where the roots of $t'_G$
are children of $r$ in $t_G$.
\item Using function extension, add a function $f$ which maps every
vertex $v$ to its unique root ancestor in $t'_G$. This can be done
by taking $f$ to be the $d$-fold composition of the parent
function of $t'_G$ with itself (assuming each root points to
itself, which can be easily interpreted).
\item Copy all the roots of trees in $t'_G$ and let $X$ be the set
of those copies. Construct a function $f'\colon V(t'_G)\to X$ that
maps each vertex $v$ to the copy of $f(v)$. Observe that $f'$
defines a bundling of the trees of $t'_G$.
\item Apply the transduction $\interp B_d^\star$ obtained from
\cref{lem:parallel} to the above bundling. This yields a bundling
of the family of connected components of $G'$, where $G'$ is
obtained from $G$ by flipping the adjacency within $W_{0}$.
\item Forgetting all elements of the structure apart from the
bundled connected components of $G'$ yields the graph $G'$.
Construct the graph $G$ by flipping the adjacency inside the set
$W_{0}$. Note here that since the remaining vertices are exactly
the leaves of the original tree $t_G$, the predicate $W_{0}$ is
still carried by them. Finally, clean the structure from all
unnecessary predicates.
\end{itemize}
It is straightforward to see that transductions $\interp T_d$ and
$\interp B_d$ satisfy all the requested properties. This concludes
the proof of \cref{lem:key}.
\end{proof}
\subsection{\cref{pro:bi-def} for classes of with low shrubdepth covers}\label{sec:key-general}
We now prove \cref{pro:bi-def} in the general case. As noted earlier,
this will finish the proof of the right-to-left implication in
\cref{thm:main}.
\begin{proof}[of \cref{pro:bi-def}]
Let $\class{C}$ be a class of graphs with low shrubdepth covers. We fix
a finite $2$-cover~$\cal U$ of $\class{C}$ such that $\class{C}[\cal U]$ has
bounded shrubdepth. Let $N=\sup\set{|\cal U_G|\colon G\in \class{C}}$,
and for $G\in \class{C}$ let~$\wh G$ be the extension of $G$ by unary
predicates $U_1,\ldots,U_N$ such that
$\set{U_1,\ldots,U_N}=\cal U_G$. Let
$\wh \class{C}=\set{\wh G\colon G\in \class{C}}$. Then the class
$\cal B=\wh\class{C}[\cal U]$ has bounded~shrubdepth.
Apply \cref{lem:key} to the class $\class{C}[\cal U]$, yielding almost
quantifier-free transductions $\interp T$ and~$\interp B$. It is
easy to construct an almost-quantifier free transduction
$\interp S'$ such that for $G\in \class{C}$, the structure
$\interp S'(\wh G)$ is the union of the trees
$T_U\in \interp T(G[U])$, one tree per each $U\in \cal U_G$, where
the union is disjoint apart from the vertices which belong to $V(G)$
(the leaves of the trees). Indeed, we process $U_1,\ldots,U_N$ in
order, and for each consecutive $U_i$ we apply the
transduction~$\interp T$ to $G[U_i]$, appropriately modifying all
its atomic operations so that the elements outside of $U_i$ are
ignored and kept intact. Recall all the constructed trees have
depth bounded by a constant, say $d$.
Now obtain $\interp S$ from $\interp S'$ by precomposing with a
sequence of unary lifts introducing the predicates $U_1,\ldots,U_N$,
and appending the following operations. First, using extension
operations introduce unary predicates $D_{i,\ell}$ for
$i\in \set{1,\ldots,N}$ and $\ell\in \set{0,1,\ldots,d}$ such that
$D_{i,\ell}$ selects nodes at depth $\ell$ in the tree
$T_{U_i}$. Next, using an extension operation that introduces an
adjacency relation binding every pair of elements $u,v$ such that
$f(u)=v$ for some function $f$ in the signature (the parent
functions). Finally, use a sequence of reduct operations which drop
all functions and non-unary relations from the signature, apart from
adjacency. Thus every output of $\interp S$ is a colored graph.
Let $\class{F}=\interp S(\class{C})$. By \cref{lem:lsc}, $\class{F}$ has low
shrubdepth covers. Furthermore, each graph $H\in \interp S(G)$ for
some $G\in \class{C}$ is the union of at most $N$ trees, hence $H$ is
$N$-degenerate and in particular excludes the biclique $K_{N+1,N+1}$
as a subgraph.
Hence by \cref{lem:bicliques} we infer that $\interp S(\class{C})$ has
low treedepth covers, so by \cref{lem:ltd-lsd-covers},
$\interp S(\class{C})$ is a class of bounded expansion.
We are left with constructing a deterministic almost quantifier-free
transduction $\interp I$ satisfying $\interp I(\interp S(G))=\{G\}$.
This transduction should take on input a graph $H\in \interp S(G)$
and turn it back to $G$. The vertex set of $H$ consists of $V(G)$
and trees $T_U$ for $U\in \cal U_G$, each built on top of the subset
$U$ of $V(G)$ and of depth at most $d$. Using predicates
$D_{i,\ell}$ it is easy to use a sequence of quantifier-free
function extension operations to construct, for each
$U\in \cal U_G$, the parent function of $T_U$, thus turning the
substructure induced by the nodes of $T_U$ back into~$T_U$.
Similarly as before, it is now straightforward to construct a
transduction $\interp I'$ that applies the transduction $\interp B$
to each colored tree $T_U$, thus turning the set of its leaves into
$G[U]$. Since~$\cal U$ was a $2$-cover, for every edge $e$ of $G$
there exists $U\in \cal U_G$ that contains both endpoints of~$e$.
Hence, applying $\interp I'$ to the current structure recovers the
graph $G$; this concludes the construction of $\interp I$. Note that
$\interp I$ is deterministic almost quantifier-free.
\end{proof}
\section{Algorithmic aspects}
\label{sec:alg}
In this section we give a preliminary result about efficient
computability of transductions on classes with structurally bounded
expansion. When we refer to the size of a structure in the algorithmic
context, we refer to its total size, i.e., the sum of its universe
size and the total sum of sizes of tuples in its relations.
Call a class \(\class{C}\)
of graphs of structurally bounded expansion {\em{efficiently
decomposable}} if there is a finite $2$-cover $\cal U$ of $\class{C}$
and an algorithm that, given a graph $G\in \class{C}$, in linear time
computes the cover $\cal U_G$ and for each $U\in\cal U_G$, an
SC-decomposition $S_U$ of depth at most $d$ of the graph $G[U]$, for
some constant $d$ depending only on $\class{C}$. Our result is as follows.
\begin{theorem}\label{thm:algo} Suppose $\interp J$ is a deterministic
transduction and $\class{C}$ is a class of graphs that has structurally
bounded expansion and is efficiently decomposable. Then given a
graph $G\in \class{C}$, one may compute $\interp J(G)$ in time linear in
the size of the input plus the size of the output. \end{theorem}
We remark that instead of efficient decomposability we could assume
that the $2$-cover~$\cal U_G$ of a graph $G$ and corresponding
SC-decompositions for all $U \in \cal U_G$ is given together with $G$
as input. If only the cover is given but not the SC-decompositions, we
would obtain cubic running time because bounded shrubdepth implies
bounded cliquewidth and we can compute an approximate clique
decomposition in cubic time~\cite{oum2008approximating}. Then,
SC-decompositions of small height are definable in monadic
second-order logic, and hence they can be computed in linear time
using the result of Courcelle, Makowski and
Rotics~\cite{Courcelle2000a}.
Observe that the theorem implies that we can efficiently evaluate a
first-order sentence and enumerate all tuples satisfying a formula
$\varphi(x_1, \ldots, x_k)$ on the given input graph, since this
amounts to applying the theorem to a transduction consisting of a
single extension operation. This strengthens the analogous result of
Kazana and Segoufin~\cite{Kazana2013} for classes of bounded
expansion.
\begin{proof}[sketch] We will make use of transductions $\interp S$
and $\interp I$ constructed in the proof of
\cref{pro:bi-def}. Recall that $\interp S(\class{C})$ is a
class of colored graphs of bounded expansion, $\interp I$ is
deterministic, and $\interp I(\interp S(G))=\{G\}$ for each
$G\in \class{C}$. Observe that $\interp J$ is equivalent to
$\interp S;\interp I;\interp J$ on~$\class{C}$. Defining $\interp K$ as
$\interp I;\interp J$, we get that
$\interp J(G)=\interp K(\interp S(G))$ for $G\in \class{C}$. Moreover,
since~$\interp I$ is deterministic, it follows that $\interp K$ is
deterministic.
Let $G\in\class{C}$ be an input graph. By efficient decomposability of
$\class{C}$, in linear time we can compute a cover $\cal U_G$ of $G$
together
with an SC-decomposition $S_U$ of depth at most~$d$ of $G[U]$, for
$U\in\cal U_G$. Each $S_U$ is a colored tree, and by the
construction described in the proof of \cref{pro:bi-def},
the trees $S_U$ for $U\in\cal U_G$, glued along the leaves form a
structure belonging to~$\interp S(G)$. As
$\interp J(G)=\interp K(\interp S(G))$, it suffices to apply the
enumeration result of Kazana and Segoufin for classes of bounded
expansion~\cite{Kazana2013} to the colored graph~$\interp S(G)$ and
to all formulas occurring in the transduction $\interp K$.
\end{proof}
\section{Introduction}
The interplay of methods from logic and graph theory has led to many
important results in theoretical computer science, notably in
algorithmics and complexity theory. The combination of logic and
algorithmic graph theory is particularly fruitful in the area of
\emph{algorithmic meta-theorems}. Algorithmic meta-theorems are
results of the form: \emph{every computational problem definable in a
logic \(\mathcal{L}\) can be solved efficiently on any class of structures satisfying a property~\(\class{P}\).}
In other words, these theorems show that the \emph{model-checking
problem} for the logic \(\mathcal{L}\) on any class \(\class{C}\) satisfying
\(\class{P}\) can be solved efficiently, where \emph{efficiency} usually
means \emph{fixed-parameter tractability}.
The archetypal example of an algorithmic meta-theorem is Courcelle's
theorem~\cite{Courcelle1,Courcelle2}, which states that model-checking
a formula~$\phi$ of \emph{monadic second-order logic} can be solved in
time $f(\phi)\cdot n$ on any graph with $n$ vertices which comes from
a fixed class of graphs of \emph{bounded treewidth}, for some
computable function $f$.
Seese~\cite{Seese1996} proved an analogue of Courcelle's result for
the model-checking problem of first-order logic on any class of graphs
of bounded degree. Following this result, the complexity of
first-order model-checking on specific classes of graphs has been
studied extensively in the literature. See
e.g.~\cite{GroheK11,DKT2,GroheKS17,Kazana2013,Dawar2007a,Flum2001,Frick2001,Seese1996,
eickmeyer2017map,kazana2013enumeration,segoufin2011first,grohe2001generalized,durand2007first,durand2014enumerating,ganian2013fo,hlineny2017}.
One of the main goals of this line of research is to find a structural
property \(\class{P}\)
which precisely defines those graph classes \(\class{C}\)
for which model checking of first-order logic is tractable.
So far, research on algorithmic meta-theorems has focused
predominantly on \emph{sparse} classes of graphs, such as classes of
bounded \emph{treewidth}, \emph{excluding a minor} or which have
\emph{bounded expansion} or are \emph{nowhere dense}.
The concepts of \emph{bounded expansion} and \emph{nowhere denseness}
were introduced by Ne{\v s}et{\v r}il and Ossona~de~Mendez with the
goal of capturing the intuitive notion of \emph{sparseness}. See
\cite{Sparsity} for an extensive cover of these notions. The large
number of equivalent ways in which they can be defined using either
notions from combinatorics, theoretical computer science or logic,
indicate that these two concepts capture some very natural limits of
``well-behavedness'' and algorithmic tractability. For instance,
Grohe et al.~\cite{GroheKS17} proved that if \(\class{C}\)
is a class of graphs closed under taking subgraphs then model checking
first-order logic on $\class{C}$ is tractable if, and only if, \(\class{C}\)
is nowhere dense (the lower bound was proved in~\cite{DKT2}). As far
as algorithmic meta-theorems for fixed-parameter tractability of
first-order model-checking are concerned, this result completely
solves the case for graph classes which are \emph{closed under taking
subgraphs}, which is a reasonable requirement for sparse but not for
dense graph classes.
Consequently, research in this area has shifted towards studying the
dense case, which is much less understood.
While there are several examples of algorithmic meta-theorems on dense
classes, such as for monadic second-order logic on classes of bounded
\emph{cliquewidth} \cite{Courcelle2000a} or for first-order logic on
\emph{interval graphs}, \emph{partial orders}, classes of bounded
\emph{shrubdepth} and other classes, see
e.g.~\cite{ganian2013fo,gajarsky2015fo,Ganian2012,GajarskyHOLR16}, a
general theory of meta-theorems for dense classes is still
missing. Moreover, unlike the sparse case, there is no canonical
hierarchy of dense graph classes similar to the sparse case which
could guide research on algorithmic meta-theorems in the dense world.
Hence, the main research challenge for dense model-checking is not
only to prove tractability results and to develop the necessary
logical and algorithmic tools. It is at least as important to define
and analyze promising candidates for
``structurally simple'' classes of graph classes which are not
necessarily sparse. This is the main motivation for the research in
this paper. Since bounded expansion and nowhere denseness form the
limits for tractability of certain problems in the sparse case, any
extension of the theory should provide notions which collapse to
bounded expansion or nowhere denseness, under the additional
assumption that the classes are closed under taking subgraphs.
Therefore, a natural way of seeking such notions is to base them on
the existing notions of bounded expansion or nowhere denseness.
In this paper, we take bounded expansion classes as a starting point
and study two different ways of generalizing them towards dense graph
classes preserving their good properties. In particular, we define
and analyze classes of graphs obtained from bounded expansion classes
by means of first-order interpretations and classes of graphs obtained
by generalizing another, more combinatorial characterization of
bounded expansion in terms of low treedepth colorings into the dense
world. Our main structural result shows that these two very different
ways of generalizing bounded expansion into the dense setting lead to
the same classes of graphs. This is explained in greater detail below.
\medskip
\noindent
\textbf{Interpretations and transductions.} One possible way of
constructing ``well-behaved'' and ``structurally simple'' classes of
graphs is to use logical \emph{interpretations}, or the related
concept of \emph{transductions} studied in formal language and
automata theory. For our purpose, transductions are more convenient
and we will use them in this paper. Intuitively, a
\emph{transduction} is a logically defined operation which takes a
structure as input and nondeterministically produces as output a
target structure.
In this paper we use \emph{first-order} transductions, which involve
first-order formulas (see \cref{sec:preliminaries} for details). Two
examples of such transductions are graph complementation, and the
squaring operation which, given a graph $G$, adds an edge between
every pair of vertices at distance $2$ from each other.
We postulate that if we start with a ``structurally simple'' class
\(\class{C}\)
of graphs, e.g.~a class of bounded expansion or a nowhere dense class,
and then study the graph classes~\(\class{D}\)
which can be obtained from \(\class{C}\)
by first-order transductions, then the resulting classes should still
have a simple structure and thus be well-behaved algorithmically as
well as in terms of logic. In other words,~the resulting classes are
interesting graph classes with good algorithmic and logical
properties, and which are certainly not sparse in general. For
instance, a useful feature of transductions is that they provide a
canonical way of reducing model-checking problems from the generated
classes \(\class{D}\)
to the original class~\(\class{C}\),
provided that given a graph $H\in \class{D}$, we can effectively compute
some graph $G\in\class{C}$ that is mapped to $H$ by the transduction. In
general, this is a hard problem, requiring a \emph{combinatorial}
understanding of the structure of the resulting classes $\class{D}$.
The above principle has so far been successfully applied in the
setting of graph classes of bounded treewidth and monadic second-order
transductions: it was shown by Courcelle, Makowsky and
Rotics~\cite{courcelle2000linear} that transductions of classes of
bounded treewidth can be combinatorially characterized as classes of
bounded cliquewidth. This, combined with Oum's
result~\cite{oum2008approximating} gives a fixed-parameter algorithm
for model-checking monadic second-order logic on classes of bounded
cliquewidth. More recently, the same principle, but for first-order
logic, has been applied to graphs of bounded
degree~\cite{GajarskyHOLR16}, leading to a combinatorial
characterization of first-order transductions of such classes, and to
a model-checking algorithm.
Applying our postulate to bounded expansion classes yields the central
notion of this paper: a class of graphs has \emph{structurally bounded
expansion} if it is the image of a class of bounded expansion under
some fixed first-order transduction. This paper is a step towards a
combinatorial, algorithmic, and logical understanding of such
graph~classes.
\bigskip
\noindent\textbf{Low Shrubdepth Covers. }
The method of transductions is one way of constructing complex graphs
out of simple graphs. A more combinatorial approach is the method of
\emph{decompositions} (or \emph{colorings})~\cite{Sparsity}, which we
reformulate below in terms of \emph{covers}. This method can be used
to provide a characterization of bounded expansion classes in terms of
very simple graph classes, namely classes of \emph{bounded
treedepth}. A class of graphs has bounded treedepth if there is a
bound on the length of simple paths in the graphs in the class (see
\cref{sec:preliminaries} for a different but equivalent definition). A
class \(\class{C}\)
has \emph{low treedepth covers} if for every number \(p \in \mathbb{N}\)
there is a number \(N\)
and a class of bounded treedepth $\cal T$ such that for every
$G\in\class{C}$, the vertex set $V(G)$ can be covered by \(N\)
sets $U_1,\ldots,U_N$ so that every set $X\subset V(G)$ of at most $p$
vertices is contained in some $U_i$, and for each $i=1,\ldots,N$, the
subgraph of $G$ induced by $U_i$ belongs to $\cal T$. A consequence
of a result by Ne{\v s}et{\v r}il and Ossona~de~Mendez~\cite{POMNI} on
a related notion of \emph{low treedepth colorings} is that a graph
class has bounded expansion if, and only if, it has low treedepth
covers.
The decomposition method allows to lift algorithmic, logical, and
structural properties from classes of bounded treedepth to classes of
bounded expansion. For instance, this was used to show tractability of
first-order model-checking on bounded expansion
classes~\cite{dkt,Grohe2011}.
An analogue of treedepth in the dense world is the concept of
\emph{shrubdepth}, introduced in~\cite{Ganian2012}. Shrubdepth shares
many of the good algorithmic and logical properties of treedepth.
This notion is defined combinatorially, in the spirit of the
definition of cliquewidth, but can be also characterized by logical
means, as first-order transductions of classes of bounded treedepth.
Applying the method of decompositions to the notion of shrubdepth
leads to the following definition. A class \(\class{C}\)
of graphs has \emph{low shrubdepth covers} if for every number
\(p \in \mathbb{N}\)
there is a number~\(N\)
and a class $\cal B$ of bounded shrubdepth such that for every
$G\in\class{C}$, there is a \emph{$p$-cover} of $G$ consisting of \(N\)
sets $U_1,\ldots,U_N\subset V(G)$, so that every set $X\subset V(G)$
of at most $p$ vertices is contained in some $U_i$ and for each
$i=1,\ldots,N$, the subgraph of $G$ induced by $U_i$ belongs
to~$\cal B$. Shrubdepth properly generalizes treedepth and
consequently classes admitting low shrubdepth covers properly extend
bounded expansion classes.
It was observed earlier~\cite{KwonPS17} that for every fixed $r\in\mathbb{N}$
and every class $\mathscr{C}$ of bounded expansion, the class of $r$th power
graphs $G^r$ of graphs from $\mathscr{C}$ (the $r$th power of a graph is a
simple first-order transduction) admits low shrubdepth colorings.
\bigskip\noindent\textbf{Our contributions.} Our main result,
\cref{thm:main}, states that the two notions introduced above are the
same: a class of graphs $\class{C}$ has structurally bounded expansion
if, and only if, it has bounded shrubdepth covers. That is,
transductions of classes of bounded expansion are the same as classes
with low shrubdepth covers (cf. Figure~\ref{fig:main}). This gives a
combinatorial characterization of structurally bounded expansion
classes, which is an important step towards their algorithmic
treatment.
\begin{figure*}
\centering \input{classes-interpretation-stephan}
\caption{ The nodes in the diagram depict properties of graph
classes, and the arrows depict operations on properties of graph
classes. Equality (1) is by~\cite{Ganian2012}. Equality (2) is
by~\cite{POMNI}. Equality~($\star$) is the main result of this
paper, \cref{thm:main}. }
\label{fig:main}
\end{figure*}
One of the key ingredients of our proof is a quantifier-elimination
result (\cref{thm:qe-lsc}) for transductions on classes of
structurally bounded expansion. This result strengthens in several
ways similar results for bounded expansion classes due to
Dvo\v r\'ak, Kr\'al', and Thomas\xspace~\cite{dkt}, Grohe and Kreutzer~\cite{Grohe2011} and Kazana and
Segoufin~\cite{kazana2013enumeration}. Our assumption is more
general, as they assume that $\class{C}$ has bounded expansion, and here
$\class{C}$ is only required to have low shrubdepth covers. Also, our
conclusion is stronger, as their results provide quantifier-free
formulas involving some unary functions and unary predicates which are
computable algorithmically, whereas our result shows that these
functions can be defined using very restricted transductions.
Quantifier-elimination results of this type proved to be useful for
the model-checking problem on bounded expansion
classes~\cite{dkt,Grohe2011,kazana2013enumeration}, and this is also
the case here.
As explained earlier, the transduction method allows to reduce the
model-checking problem to the problem of finding inverse images under
transductions, which is a hard problem in general and depends very
much on the specific transduction. On the other hand, as we show, the
cover method allows to reduce the model-checking problem for classes
with low shrubdepth covers to the problem of computing a bounded
shrubdepth cover of a given graph. In fact, as a consequence of our
proof, in \cref{thm:algo} we show that it is enough to compute a
$2$-cover of a given graph $G$ from a structurally bounded expansion
class, in order to obtain an algorithm for the model-checking problem
for such classes. We conjecture that such an algorithm exists and
that therefore first-order model-checking is fixed-parameter tractable
on any class of graphs of structurally bounded expansion. We leave
this problem for future work.
\bigskip\noindent\textbf{Organization.} In \cref{sec:preliminaries} we
collect basic facts about logic, transductions, treedepth, shrubdepth
and the notion of bounded expansion. In \cref{sec:sbe} we provide the
formal definitions of structurally bounded expansion classes and
classes with low shrubdepth covers, and state the main results and
their proofs using lemmas which are proved in the following three
sections.
We consider algorithmic aspects in \cref{sec:alg} and conclude in
\cref{sec:conclusion}. We aim to present an easy to follow proof of
our main result. For this reason, we present proofs of the key lemmas
in the main body of the paper, while rather technical results that
disturb the flow of ideas are presented in full detail in the
appendix.
\section{Proof of Lemma~\ref{lem:dep}}
\subsection{Low shrubdepth covers imply structurally bounded expansion}\label{sec:lsc-sbe}
\begin{comment}
\medskip
Using the transduction $\interp B$, it is easy
to see that
there is an almost quantifier-free transduction $\interp I$
such that $\interp I(\interp S(\wh G))= \interp I(\interp S'(G))=G$ for $G\in \class{C}$. This finishes the proof of~Theorem~\ref{thm:main}.\hfill$\square$
\bigskip
As a corollary of the proof of~Theorem~\ref{thm:main},
we obtain the following.
\begin{theorem}\label{thm:algo}
Let $\class{C}$ be a class with structurally bounded
expansion and let $\mathcal U$ be a finite $2$-cover of $\class{C}$ of bounded shrubdepth.
There is an algorithm which, given a first order sentence $\phi$, a graph $G\in \class{C}$ and the $2$-cover $\cal U_G$,
determines whether $G$ satisfies $\phi$ in time
$C(\phi)\cdot n$, for some computable function $C$.
\end{theorem}
\begin{proof}
The algorithm claimed in the theorem proceeds as follows.
Given $G$ and $\cal U_G$, compute
the expansion $\wh G$ of $G$ by predicates corresponding to the elements of $\cal U_G$.
As noted in the proof of~Theorem~\ref{thm:main}, the almost quantifier-free transduction $\interp S$ is effective.
Hence, $\interp S(\wh G)$ can be computed in linear time, by~Lemma~\ref{lem:effectivity}.
Since $\interp I(\interp S(\wh G))= G$, there is a sentence $\psi$ computable from $\interp I$ and $\phi$ such that
$$\interp S(\wh G)\textit{ satisfies } \psi\ \textit{if and only if }\ G\textit{ satisfies } \phi.$$
To determine whether $\interp S(\wh G)$ satisfies $\psi$ we use the fact the
the class $\set{\interp S(\wh G):\wh G\in \wh\class{C}}$
has bounded expansion,
and the result of Dvo\v r\'ak, Kr\'a\v l, and Thomas, i.e.,~Theorem~\ref{thm:quantifier-elimination}.
\end{proof}
\end{comment}
\subsection*{Proof outline}
We now outline the proof of \cref{thm:main} and \cref{thm:qe-lsc}.
Both theorems follow easily from \cref{pro:bi-def0} and
\cref{pro:qe-be0} stated below. These are proved in subsequent
sections.
We start with the following lemma, which intuitively shows that covers
commute with almost quantifier-free transductions.
\begin{lemma}\label{lem:lsc0}
If a class of graphs $\class{C}$ has low shrubdepth covers and
$\interp I$ is an almost quantifier-free transduction that outputs
colored graphs, then $\interp I(\class{C})$ also has low shrubdepth
covers.
\end{lemma}
\begin{proof}[sketch]
The idea is that for any almost quantifier-free transduction
$\interp I$
there is a constant $c$ such any induced substructure of
$\interp I(G)$ on $p$ elements depends only on an induced
substructure of $G$ of size $p\cdot c$. In particular, a
$(p\cdot c)$-cover of $G$ induces a $p$-cover of $\interp I(G)$.
Moreover, as having bounded shrubdepth is preserved by
transductions, a low shrubdepth cover of $\class{C}$ induces a low
shrubdepth cover of $\interp I(\class{C})$. The details are presented in
\cref{sec:transductions-and-covers}.
\end{proof}
\medskip The main novel ingredient in our proof of \cref{thm:main} and
\cref{thm:qe-lsc} is the following result, which intuitively states
that classes with low shrubdepth covers are bi-definable with classes
of bounded expansion, using almost quantifier-free transductions.
\begin{proposition}\label{pro:bi-def0}
Suppose $\class{C}$ is a class of graphs with low shrubdepth covers. Then
there is a pair of transductions $\interp S$ and $\interp I$, where
$\interp S$ is almost quantifier-free and $\interp I$ is
deterministic almost quantifier-free, such that $\interp S(\class{C})$ is
a class of colored graphs of bounded expansion and
$\interp I(\interp S(G))=\{G\}$ for each $G\in \class{C}$.
\end{proposition}
Clearly, \cref{pro:bi-def0} implies that $\class{C}$ has structurally
bounded expansion, since it can be obtained as a result of
transduction $\interp I$ to a class $\interp S(\class{C})$ of bounded
expansion. Thus, the right-to-left implication of \cref{thm:main} is
a corollary of the proposition. The proof of \cref{pro:bi-def0} is
presented in \cref{sec:bi-def}. We sketch the rough idea below.
\begin{proof}[sketch]
First, in \cref{lem:key} of \cref{sec:key}, we prove the special
case where~$\class{C}$ is a class of graphs of bounded shrubdepth, and
for those we prove bi-definability with classes of trees of bounded
depth. In particular, if $\class{D}$ is a class of graphs of bounded
shrubdepth, then there is a pair of almost quantifier-free
transductions $\interp T,\interp I_0$ such that $\interp T(\class{D})$ is
a class of colored trees of bounded depth and such that
$\interp I_0(\interp T(H))=\set H$ for all $H\in \class{D}$.
\cref{lem:key} is the combinatorial core of this paper.
To prove \cref{pro:bi-def0}, we lift \cref{lem:key} to the general
case using covers, as follows. Let $\class{C}$ be a class with low
shrubdepth covers and let $\cal U$ be a $2$-cover of $\class{C}$ of
bounded shrubdepth, and let $N$ be such that $|\cal U_G|\le N$ for
$G\in \class{C}$. We apply the bounded shrubdepth case to the class
$\class{D}=\class{C}[\cal U]$, yielding almost quantifier-free transductions
$\interp T$ and $\interp I_0$ as above. The transduction $\interp S$
works as follows: given a graph $G\in\class{C}$, introduce $N$ unary
predicates marking the cover $\cal U_G$ of $G$, and for each
$U\in \cal U_G$, apply $\interp T$ to the induced subgraph $G[U]$ of
$G$, yielding a colored tree $\interp T(G[U])$. Define
$\interp S(G)$ as the union of the trees $\interp T(G[U])$, for
$U\in \cal U_G$. As $\cal U_G$ is a $2$-cover of $G$, $G$ is the
union of the induced graphs $G[U]$ for $U\in \cal U_G$. As each
graph $G[U]$ can be recovered from the tree $\interp T(G[U])$ using
the inverse transduction $\interp I_0$, it follows that $G$ can be
recovered from the union $\interp S(G)$. This yields the inverse
transduction $\interp I$ such that $\interp I(\interp S(G))=\set G$.
As $\interp S$ is almost quantifier-free by construction, it follows
from \cref{lem:lsc0} that $\interp S(\class{C})$ is a class with low
shrubdepth covers. Moreover, each graph in $\interp S(\class{C})$ is a
union of at most $N$ trees, so it does not contain $K_{N+1,N+1}$ as
a subgraph. It follows from \cref{lem:bicliques} that the low
shrubdepth cover of $\interp S(\class{C})$ is in fact a low treedepth
cover. Hence, $\interp S(\class{C})$ has low treedepth covers, i.e., has
bounded expansion.
\end{proof}
\bigskip \cref{thm:qe-lsc}, and the remaining implication in
\cref{thm:main} are consequences of the following result.
\begin{proposition}\label{pro:qe-be0}
Let $\class{C}$ be a class of graphs of bounded expansion and let
$\interp I$ be a transduction. Then $\interp I$ is equivalent to an
almost quantifier-free transduction $\interp J$ on $\class{C}$.
\end{proposition}
We note that \cref{pro:qe-be0} is a strengthening of similar
statements provided by Dvo\v{r}\'ak et al.~\cite{DKT2} and of Grohe
and Kreutzer~\cite{Grohe2011}, and could be derived by a careful
analysis of their proofs. In \cref{sec:qe} we provide a
self-contained proof, which we believe is simpler than the previous
proofs, and is sketched below.
\begin{proof}[sketch]
We use the characterization of bounded expansion classes as those
which have low treedepth covers. We first prove \cref{pro:qe-be0}
for forests of bounded depth. This can be handled by a direct
(although slightly cumbersome) combinatorial argument, similarly as
in~\cite{DKT2}. In Appendix~\ref{sec:automata} we present an
argument using tree automata.
The statement for classes of forests of bounded depth then easily
lifts to classes of bounded treedepth. Here we use the fact that in
a graph of bounded treedepth it is possible to encode a depth-first
search forest of bounded depth, by using unary predicates marking
the depth of each node in the spanning forest.
We then lift the result from classes of bounded treedepth using
covers. Specifically, suppose for simplicity that the transduction
$\interp I$ is a single extension operation, parametrized by a
formula $\psi$. We then proceed by induction on the structure of the
formula $\psi$ and show that it can be replaced by a quantifier-free
formula, at the cost of introducing unary functions defined by an almost
quantifier-free transduction.
In the inductive step, the only nontrivial case is the one of
existential quantification, i.e., of formulas of the
form $$\psi(\bar y)=\exists x.\phi(x,\bar y),$$ where
$\phi(x,\bar y)$ may be assumed to be a quantifier-free formula
involving unary functions, by inductive assumption. We consider a
$p$-cover $\cal U$ of $\class{C}$ where $p$ is a constant such that there
are at most $p$ different terms occurring in $\phi(x,\bar y)$.
Since $\class{C}$ has bounded expansion, we may assume that the cover
$\cal U$ has bounded treedepth, and that there is a constant
$N\in \mathbb{N}$ such that $|\cal U_G|\le N$ for all $G\in \class{C}$. For a
fixed graph $G\in\class{C}$, the existentially quantified variable $x$
must be in one of the sets $U\in \cal U_G$. Therefore, the formula
$\psi(\bar y)$ is equivalent to a disjunction of at most $N$
formulas $\psi_{i}(\bar y)$, for $i=1,\ldots,N$, where each formula
$\psi_{i}(\bar y)$ performs existential quantification restricted to
the $i$th set in $\cal U_G$ (where $\cal U_G$ is ordered
arbitrarily). By the special case of the proposition proved for
classes of bounded treedepth, $\psi_i(\bar y)$ is equivalent to a
quantifier-free formula on $\class{C}[\cal U]$ (the quantifier-free
formula uses unary functions introduced by almost quantifier-free
transductions). Reassuming, $\psi$ is equivalent on $G$ to a
disjunction of quantifier-free formulas involving unary functions
that are introduced by almost quantifier-free transductions. This
deals with the inductive step.
\end{proof}
We finally show how to conclude \cref{thm:main} and \cref{thm:qe-lsc}
from \cref{lem:lsc0}, \cref{pro:bi-def0} and \cref{pro:qe-be0}.
\begin{proof}[of \cref{thm:main}]As observed, the right-to-left
implication of \cref{thm:main} follows from \cref{pro:bi-def0}. We
now show the left-to-right implication.
Let $\class{C}$ be a class of bounded expansion and let $\interp I$ be a
transduction that outputs colored graphs. We show that
$\interp I(\class{C})$ has low shrubdepth covers.
By \cref{lem:ltd-lsd-covers}, $\class{C}$ has low treedepth covers.
Applying \cref{pro:qe-be0} yields an almost quantifier-free
transduction $\interp J$ such that
$\interp I(\class{C}) = \interp J(\class{C})$. As $\class{C}$ in particular has
low shrubdepth covers (cf. \cref{prop:sd_properties}~(\ref{SD:3})),
we may apply \cref{lem:lsc0} to $\interp J$ and $\class{C}$ to deduce
that $\interp J(\class{C})=\interp I(\class{C})$ has low shrubdepth covers.
\end{proof}
\begin{proof}[of \cref{thm:qe-lsc}]
\cref{pro:bi-def0} allows to reduce the theorem to the case of
classes of bounded expansion, as almost quantifier-free
transductions are closed under composition. The case of bounded
expansion classes is handled by \cref{pro:qe-be0}.
\end{proof}
It remains to provide the details of the proofs of \cref{lem:lsc0},
\cref{pro:bi-def0} and \cref{pro:qe-be0}. This is done in
\cref{sec:transductions-and-covers}, \cref{sec:bi-def} and
\cref{sec:qe}, respectively. After that, in \cref{sec:alg} we
conclude with a preliminary algorithmic result concerning the
model-checking problem for first-order logic on classes with
structurally bounded expansion.
\section{Preliminaries}\label{sec:preliminaries}
\paragraph*{Basic notation.} We use standard graph notation. All
graphs considered in this paper are undirected, finite, and simple;
that is, we do not allow loops or multiple edges with the same pair of
endpoints. We follow the convention that the composition of an empty
sequence of (partial) functions is the identity function. For an
integer $k$, we denote $[k]=\{1,\ldots,k\}$.
\subsection{Structures, logic, and transductions}\label{sec:prelims-logic}
\paragraph*{Structures and logic.} A {\em{signature}} $\Sigma$ is a
finite set of relation symbols, each with prescribed arity that is a
non-negative integer, and unary function symbols. A
\mbox{{\em{structure}}}~$\str A$ over $\Sigma$ consists of a finite
universe $V(\str A)$ and {\em{interpretations}} of symbols from the
signature: each relation symbol $R\in \Sigma$, say of arity $k$, is
interpreted as a $k$-ary relation $R^{\str A}\subseteq V(\str A)^k$,
whereas each function symbol $f$ is interpreted as a {\em{partial}}
function $f^{\str A}\colon V(\str A)\rightharpoonup V(\str A)$. We drop the
superscipt when the structure is clear from the context, thus
identifying each symbol with its interpretation. If \(\str{A}\)
is a structure and \(X\subseteq V(\str{A})\)
then we define the \emph{substructure} of \(\str{A}\)
induced by \(X\)
in the usual way except that a unary function \(f(x)\)
in \(\str{A}\)
becomes undefined on all \(x \in X\)
for which \(f(x) \not\in X\).
The {\em{Gaifman graph}} of a structure $\str A$ is the graph with
vertex set $V(\str A)$ where two elements $u,v\in \str A$ are adjacent
if and only if either $u$ and $v$ appear together in some tuple in
some relation in $\str A$, or $f(u)=v$ or $f(v)=u$ for some partial
function $f$ in $\str A$.
For a signature $\Sigma$, we consider standard
first-order logic over $\Sigma$. Let us clarify the usage of function
symbols. A {\em{term}} $\tau(x)$ is a finite composition of function
symbols applied to a variable $x$. In a structure $\str A$, given an
evaluation of $x$, the term $\tau(x)$ either evaluates to some element
of $\str A$ in the natural sense, or is {\em{undefined}} if during the
evaluation we encounter an element that does not belong to the domain
of the function that is to be applied next.
In first order logic over $\Sigma$ we allow usage of atomic formulas of the following form:
\begin{itemize}
\item $R(\tau_1(x_1),\ldots,\tau_k(x_k))$ for a relation symbol $R$ of
arity $k$, terms $\tau_1,\ldots,\tau_k$, and variables
$x_1,\ldots,x_k$;
\item $\tau_1(x_1)=\tau_2(x_2)$ for terms $\tau_1,\tau_2$ and variables $x_1,x_2$; and
\item $\mathsf{dom}_f(\tau(x))$ for term $\tau$ and variable $x$
\end{itemize}
Here, the predicate $\mathsf{dom}_f(\tau(x))$ checks whether $\tau(x)$ belongs
to the domain of $f$. The semantics are defined as usual, however an
atomic formula is false if any of the terms involved is undefined.
Based on these atomic formulas, the syntax and semantics of first
order logic is defined in the expected way.
\paragraph*{Graphs, colored graphs and trees.} Graphs can be viewed
as finite structures over the signature consisting of a binary
relation symbol~$E$, interpreted as the edge relation, in the usual
way. For a finite label set $\Lambda$, by a {\em{$\Lambda$-colored}}
graph we mean a graph enriched by a unary predicate~\(U_\lambda\)
for every $\lambda\in \Lambda$. We will follow the convention that if
$\class{C}$ is a class of colored graphs, then we implicitly assume that
all graphs in \(\class{C}\)
are over the same fixed finite signature. A rooted forest is an
acyclic graph $F$ together with a unary predicate $R\subset V(F)$
selecting one root in each connected component of $F$. A tree is a
connected forest. The {\em{depth}} of a node $x$ in a rooted forest
$F$ is the distance between $x$ and the root in the connected
component of $x$ in $F$. The depth of a forest is the largest depth of
any of its nodes. The {\em{least common ancestor}} of nodes $x$ and
$y$ in a rooted tree is the common ancestor of $x$ and $y$ that has
the largest depth.
\paragraph*{Transductions.} We now define the notion of transduction
used in the sequel. A \emph{transduction} is a special type of
first-order interpretation with set parameters, which we see here
(from a computational point of view) as a nondeterministic operation
that maps input structures to output structures. Transductions are
defined as compositions of \emph{atomic operations} listed below.
An \textbf{extension} operation is parameterized by a first-order
formula $\phi(x_1,\ldots,x_k)$ and a relation symbol $R$. Given an
input structure $\str A$, it outputs the structure $\str A$ extended
by the relation $R$ interpreted as the set of $k$-tuples of elements
satisfying $\phi$ in~$\str A$. A \textbf{restriction} operation is
parameterized by a unary formula $\psi(x)$. Applied to a
structure~$\str A$ it outputs the substructure of~$\str A$ induced by
all elements satisfying \(\psi\).
A \textbf{reduct} operation is parameterized by a relation symbol
\(R\), and results in removing the relation~\(R\)
from the input structure. \textbf{Copying} is an operation which,
given a structure~$\str A$ outputs a disjoint union of two copies of
$\str A$ extended with a new unary predicate which marks the newly
created vertices, and a symmetric binary relation which connects each
vertex with its copy. A \textbf{function extension} operation is
parameterized by a binary formula $\varphi(x,y)$ and a function symbol
$f$, and extends a given input structure by a partial function $f$
defined as follows: $f(x)=y$ if $y$ is the unique vertex such that
$\varphi(x,y)$ holds. Note that if there is no such $y$ or more than
one such $y$, then $f(x)$ is undefined. Finally, suppose $\sigma$ is
function that maps each structure $\str A$ to a nonempty family
$\sigma(\str A)$ of subsets of its universe. A \textbf{unary lift}
operation, parameterized by $\sigma$, takes as input a
structure~$\str A$ and outputs the structure~$\str A$ enriched by a
unary predicate~$X$ interpreted by a nondeterministically chosen set
$U\in\sigma(\str A)$.
We remark that function extension operations can be simulated by
extension operations, defining the graphs of the functions in the
obvious way. They are, however, useful as a means of extending the
expressive power of transductions in which only quantifier-free
formulas are allowed, as defined below.
\emph{Transductions} are defined inductively: every atomic
transduction is a transduction, and the composition of two
transductions $\interp I$ and $\interp J$ is the transduction
$\interp I;\interp J$ that, given a structure $\str A$, first applies
$\interp I$ to $\str{A}$ and then $\interp J$ to the output
$\interp I(\str{A})$. A transduction is {\em{deterministic}} if it does
not use unary lifts. In this case, for every input structure there is
exactly one output structure. A transduction is \emph{almost
quantifier-free} if all formulas that parameterize atomic operations
comprising it are quantifier-free\footnote{We use the adverb
``almost'' to indicate that such transductions still can access
elements that are not among its free variables via functions.}, and
is \emph{deterministic almost quantifier-free} if it additionally does
not use unary lifts.
\pagebreak
If $\class{C}$ is a class of structures, we write $\interp I(\class{C})$ for the
class which contains all possible outputs~$\interp I(\str{A})$ for
$\str{A}\in \class{C}$. We say that two transductions~$\interp I$ and
$\interp J$ are \emph{equivalent} on a class~$\class{C}$ of structures if
every possible output of $\interp I(\str A)$ is also a possible output
of $\interp J(\str A)$, and vice versa, for every $\str A \in \class{C}$.
\medskip It may happen that an atomic operation $\interp I$ is
undefined for a given input structure $\str A$. For example, for an
extension operation parametrized by a first order formula $\phi$ using
a relation symbol $R$, if the input structure $\str A$ does not carry
the symbol $R$, then $\interp I(\str A)$ is undefined according to the
above definition. This will never occur in our constructions.
However, for completeness, we may define $\interp I(\str A)$ as a
fixed structure $\bot$ in such situations.
When considering a composition of atomic operations, we avoid
overriding symbols by later operations, i.e., we always assume that
subsequent atomic operations create relation symbols which are
distinct from previously created relations symbols and also from
symbols in the original signature. Since every transduction
$\interp I$ is a composition of finitely many atomic operations, the
result of $\interp I$ applied to a structure over a finite signature
$\Sigma$ will be again a structure over a finite signature $\Gamma$,
which depends on $\Sigma$ and~$\interp I$ only (unless the result is
undefined).
\medskip
\begin{example}\label{ex:transduction}
Let $\class{C}$ be the class of rooted forests of depth at most $d$, for
some fixed $d\in\mathbb{N}$. We describe an almost quantifier-free
transduction which defines the \emph{parent function} in $\class{C}$.
First, using unary lifts introduce $d+1$ unary predicates
$D_0,...,D_d$, where~$D_i$ marks the vertices of the input tree
which are at distance $i$ from a root. Next, using a function
extension, define a partial function $f$ which maps a vertex $v$ in
the input tree to its parent, or is undefined in case of a
root. This can be done by a quantifier-free formula, which selects
those pairs $x,y$ such that $x$ and $y$ are adjacent and $D_i(x)$
implies $D_{i-1}(y)$.
\end{example}
It will sometimes be convenient to work with the encoding of
bounded-depth trees and forests as node sets endowed with the parent
function, rather than graphs with prescribed roots. As seen in
\cref{ex:transduction}, these two encodings can be translated to each
other by means of almost quantifier-free transductions, which render
them essentially equivalent.
\paragraph*{Normal forms.} It will sometimes be useful to assume a
certain normal form of transductions. We will need two similar, yet
slightly different normal forms: one for general transductions and one
for almost quantifier-free transductions. The proofs are standard, for
completeness, we give them in the appendix.
\begin{lemma}[$\star$]\label{lem:normal}
Let $\interp I$ be a transduction. Then $\interp I$ is equivalent to
a transduction of the form
$$\interp L;\interp C;\interp F;\interp E;\interp X;\interp R,$$
where
\begin{itemize}
\item $\interp L$ is a sequence of unary lifts;
\item $\interp C$ is a sequence of copying operations;
\item $\interp F$ is a sequence of function extension operations,
one for each function on the output;
\item $\interp E$ is a sequence of extension operations, one for
each relation on the output;
\item $\interp X$ is a single restriction operation; and
\item $\interp R$ is a sequence of reduct operations.
\end{itemize}
Moreover, formulas parameterizing atomic operations in
$\interp F;\interp E;\interp X$ use only relations and functions
that appeared originally on input or were introduced by
$\interp L;\interp C$. In particular, none of these formulas uses
any function or relation introduced by an atomic operation in
$\interp F;\interp E$.
\end{lemma}
\begin{lemma}[$\star$]\label{lem:normal-qf}
Every almost quantifier-free transduction is equivalent to an almost
quantifier-free transduction that first applies a sequence of unary
lifts and then applies a deterministic almost quantifier-free
transduction.
\end{lemma}
\begin{comment}
\paragraph{Algorithmic aspects.}
For the algorithmic purposes we assume the following model of oracle
access to structures. A structure $\str A$ over a signature $\Sigma$
is represented by providing the universe of $\str A$ and access to an
oracle that answers the following queries:
\begin{itemize}
\item For a given relation symbol $R\in \Sigma$, say of arity $k$, and
elements $u_1,\ldots,u_k$, one can query whether $R(u_1,\ldots,u_k)$
holds.
\item For a given function symbol $f\in \Sigma$ and element $u$, one
can query the value of $f(u)$ (the query may answer that $u$ does
not belong to the domain of $f$).
\end{itemize}
Whenever we speak about running time of an algorithm over some given
structure, we measure the running time in terms of the number of
standard operations and oracle calls. That is, we assume that oracle
calls are implemented in constant time. Further, by
{\em{constructing}} a structure we mean constructing its universe and
a data structure implementing an oracle representing it. In
Appendix~\ref{app:prelims-omitted} we show that such an oracle can be
constructed in linear time for any relational structure from a fixed
class of bounded expansion, given the standard encoding by a list of
tuples.
To state algorithmic claims following from our constructions it will
be convenient to use the following notion.
\begin{definition}\label{def:effectivity}
A unary lift $\mathsf{Lift}_{X\leftarrow \sigma}$ is
\emph{effective} if $\sigma(\str A)$ is computable from $\str A$ in
linear time. We say that an almost quantifier-free transduction is
\emph{effective} if all the unary lifts comprising it are effective.
\end{definition}
The following lemma gives a general-purpose algorithm for applying
effective almost quantifier-free transductions. Its proof follows by
a straightforward implementation, see
Appendix~\ref{app:prelims-omitted}.
\begin{lemma}\label{lem:effectivity}
Suppose $\interp I$ is an effective almost quantifier-free
transduction. Then given a structure $\str A$ one may construct the
structure $\interp I(\str A)$ in quadratic time. More precisely,
the output consists of the universe of $\interp I(\str A)$ and a
data structure implementing an oracle representing
$\interp I(\str A)$, where each call to this oracle runs in constant
time and uses a constant number of calls to the oracle representing
$\str A$.
\end{lemma}
\end{comment}
\subsection{Treedepth and shrubdepth}\label{subsec:tdsd}
The \emph{treedepth} of a graph $G$ is the minimal depth of a rooted
forest $F$ with the same vertex set as $G$, such that for every edge
$uv$ of $G$, $u$ is an ancestor of $v$, or $v$ is an ancestor of $u$
in $F$. A class $\class{C}$ of graphs has \emph{bounded treedepth} if
there is a bound $d \in \mathbb{N}$ such that every graph in $\class{C}$ has
treedepth at most $d$. Equivalently, $\mathscr{C}$ has bounded treedepth if
there is some number $k$ such that no graph in $\class{C}$ contains a
simple path of length~$k$~\cite{Sparsity}. The notion of treedepth
lifts to structures: a class $\class{C}$ of structures has bounded
treedepth if the class of their Gaifman graphs has bounded treedepth.
\paragraph*{Shrubdepth.} The following notion of \emph{shrubdepth}
has been proposed in~\cite{Ganian2012} as a dense analogue of
treedepth. Originally, shrubdepth was defined using the notion of
\emph{tree-models}. We present an equivalent definition basing on the
notion of \emph{connection models}, introduced in~\cite{Ganian2012}
under the name of {\em{$m$-partite cographs}} of bounded depth.
\smallskip
A {\em connection model} with labels from $\Lambda$ is a rooted
labeled tree $T$ where each leaf $x$ is labeled by a label
$\lambda(x)\in \Lambda$, and each non-leaf node $v$ is labeled by a
(symmetric) binary relation $C(v)\subset \Lambda\times \Lambda$. Such
a model defines a graph $G$ on the leaves of $T$, in which two
distinct leaves $x$ and $y$ are connected by an edge if and only if
$(\lambda(x),\lambda(y))\in C(v)$, where~$v$ is the least common
ancestor of $x$ and $y$. We say that $T$ is a \emph{connection model}
of the resulting graph $G$.
\begin{example}
Fix $n\in\mathbb{N}$, and let $G_n$ be the bi-complement of a matching of
order $n$, i.e., the bipartite graph with nodes $a_1,\ldots,a_n$ and
$b_1,\ldots,b_n$, such that $a_i$ is adjacent to~$b_j$ if and only
if $i\neq j$. A connection model for $G_n$ is shown below:
\begin{center}
\includegraphics[height=19mm]{matching}
\end{center}
\end{example}
We can naturally extend the definition above to structures with unary
functions by regarding each unary function by a binary relation
selecting all $(\mathrm{argument},\mathrm{value})$ pairs.
\medskip
A class of graphs $\class{C}$ has {\em bounded shrubdepth} if there is
a number $h\in \mathbb{N}$ and a finite set of labels $\Lambda$ such that
every graph $G\in \class{C}$ has a connection model of depth at most $h$
using labels from $\Lambda$.
\medskip Shrubdepth can be equivalently defined in terms of another
graph parameter, as follows.
Given a graph $G$ and a set of vertices $W\subset V(G)$, the graph
obtained by \emph{flipping the adjacency within $W$} is the graph $G'$
with vertices $V(G)$ and edge set which is the symmetric difference of
the edge set of $G$ and the edge set of the clique on $W$.
\smallskip The \emph{subset-complementation depth}, or
\emph{SC-depth}, of a graph is defined inductively as follows:
\begin{itemize}
\item a graph with one vertex has SC-depth $0$, and
\item a graph $G$ has SC-depth at most $d$, where $d\ge 1$, if there
is a set of vertices $W\subset V(G)$ such that in the graph obtained
from $G$ by flipping the adjacency within $W$ all connected
components have SC-depth at most $d-1$.
\end{itemize}
\begin{example}
A star has SC-depth at most $2$: flipping the adjacency within the
set consisting of the vertices of degree $1$ yields a clique, which
in turn has SC-depth at most~$1$.
\end{example}
The notion of SC-depth leads to a natural notion of decompositions.
An \emph{SC-decomposition} of a graph $G$ of SC-depth at most $d$ is a
rooted tree $T$ of depth $d$ with leaf set~$V(G)$, equipped with unary
predicates $W_0,\ldots,W_d$ on the leaves. Each child $s$ of the root
in $T$ corresponds to a connected component $C_s$ of the graph $G'$
obtained from~$G$ by flipping the adjacency within $W_0$, such that
the subtree of $T$ rooted at $s$, together with the unary predicates
$W_1,\ldots,W_d$ restricted to $V(C_s)$, form an SC-decomposition of
$C_s$.
\medskip We will make use of the following properties, where the first
one follows from the definition of shrubdepth, and the remaining ones
follow from~\cite{Ganian2012}.
\begin{proposition
\label{prop:sd_properties}Let $\class{C}$ be a class of graphs. Then:
\begin{enumerate}
\item\label{SD:1} If $\class{C}$ has bounded shrubdepth then the class of
all induced subgraphs of graphs from~$\class{C}$ also has bounded
shrubdepth.
\item\label{SD:2} $\class{C}$ has bounded shrubdepth if and only if for
some $d\in \mathbb{N}$ all graphs in $\class{C}$ have SC-depth at most $d$.
\item\label{SD:3} If $\class{C}$ has bounded treedepth then $\class{C}$ has
bounded shrubdepth.
\item\label{SD:5} If $\class{C}$ has bounded shrubdepth and $\interp I$
is a transduction that outputs colored graphs, then
$\interp I(\class{C})$ has bounded
shrubdepth
\end{enumerate}
\end{proposition}
It is well-known (see~\cite{Gurski2000}) that in the absence of large
bi-cliques (complete bipartite graphs) a graph of bounded cliquewidth
has in fact bounded treewidth. The same holds also for shrubdepth and
treedepth. The lemma is proved by an easy induction on the depth of
the connection models.
\begin{lemma}[$\star$]\label{lem:bicliques}
A class of graphs $\class{C}$ has bounded treedepth if and only if graphs
in $\class{C}$ have bounded shrubdepth and exclude some fixed bi-clique
as a subgraph.
\end{lemma}
\subsection{Bounded expansion}
A graph $H$ is a \emph{depth-$r$ minor} of a graph $G$ if $H$ can be
obtained from a subgraph of $G$ by contracting mutually disjoint
connected subgraphs of radius at most $r$. A class $\class{C}$ of graphs
has \emph{bounded expansion} if there is a function
$f: \mathbb{N} \to \mathbb{N}$ such that
\(\frac{|E(H)|}{|V(H)|}\leq f(r)\)
for every $r \in \mathbb{N}$ and every depth-$r$ minor \(H\)
of a graph from $\class{C}$. Examples include the class of planar graphs,
or any class of graphs with bounded maximum degree.
\medskip We will use the following lemma.
\begin{lemma}\label{lem:lex}
Let $\class{C}$ be a class of (colored) graphs of bounded expansion and
let $\interp C$ be a copy operation. Then $\interp C(\class{C})$ is a
class of colored graphs of bounded expansion.
\end{lemma}
\begin{proof}
Let $G\in \class{C}$. The Gaifman graph of $\interp C(G)$ is a subgraph
of the so-called {\em{lexicographic product of $G$ with $K_2$}},
i.e., it is constructed from the latter by replacing every vertex
with two clones of it. It is known that if a class of graphs $\class{C}$
has bounded expansion, then the class of lexicographic products of
graphs from $\class{C}$ with any fixed graph $H$ also has bounded
expansion; see e.g.,~\cite[Proposition 4.6]{Sparsity}.
\end{proof}
\smallskip The connection between treedepth and graph classes of
bounded expansion can be established via \emph{$p$-treedepth
colorings}. For an integer $p$, a function $c: V(G) \to C$ is a
$p$-treedepth coloring if, for every $i\le p$ and set $X\subset V(G)$
with $|c(X)|=i$, the induced graph $G[X]$ has treedepth at most $i$. A
graph class $\class{C}$ has \emph{low treedepth colorings} if for every
$p \in \mathbb{N}$ there is a number $N_p$ such that for every
$G \in \class{C}$ there exists a $p$-treedepth coloring $c\colon V(G)\to C$
with $|C|\le N_p$.
\begin{theorem}[\cite{POMNI}]\label{thm:beltc}
A class of graphs $\class{C}$ has bounded expansion if, and only if, it
has low treedepth colorings.
\end{theorem}
\section{Proof of \cref{pro:qe-be0}\quad\normalfont\itshape\normalsize(quantifier elimination for classes of bounded expansion)}\label{sec:qe}
In this section we prove \cref{pro:qe-be0}, which we repeat for convenience.
\setcounter{tmp}{\thetheorem}
\setcounterref{theorem}{pro:qe-be0}
\addtocounter{theorem}{-1}
\begin{proposition}\label{pro:qe-be}
Let $\class{C}$ be a class of graphs of bounded expansion and let
$\interp I$ be a transduction. Then $\interp I$ is equivalent to an
almost quantifier-free transduction $\interp J$ on $\class{C}$.
\end{proposition}
\setcounter{theorem}{\thetmp}
We note that \cref{pro:qe-be} is a strengthening of similar statements
provided by Dvo\v{r}\'ak et al.~\cite{DKT2} and of Grohe and
Kreutzer~\cite{Grohe2011}, and could be derived by a careful analysis
of their proofs, and by using the \cref{lem:star} below.
For a graph $G$ and a partial function $f\colon V(G)\rightharpoonup V(G)$, we
say that $f$ is \emph{guarded} by~$G$ if for every vertex in the
domain of $f$ is mapped to itself or to its neighbor.
\begin{lemma}[$\star$]\label{lem:star}
Let $\class{C}$ be a class of graphs which has $2$-covers of bounded
treedepth, and for each $G\in \class{C}$, let $\wh G$ be the graph $G$
extended by a partial function $f\colon V(G)\rightharpoonup V(G)$ which is
guarded by $G$. Then there is an almost quantifier-free transduction
$\interp F$ using only unary lifts and a single function extension
such that $\interp F(G)=\wh G$.
\end{lemma}
To derive \cref{pro:qe-be} from~\cite{DKT2}, one would need to prove
that the unary functions constructed in their proofs can be obtained
as compositions of guarded functions, and conclude using
\cref{lem:star}. Rather then doing that, below we provide a
self-contained proof of \cref{pro:qe-be}, which we also believe is
simpler than the existing proofs, among other reasons, thanks to the
notion of covers. In \cref{sec:dkt} we outline how the result of Dvo\v r\'ak, Kr\'al', and Thomas\xspace
can be deduced from our proof.
\medskip
We will use the following restricted form of transductions. A
\emph{faithful transduction} is a transduction which does not use
copying and restrictions. A \emph{guarded transduction} is a faithful
transduction which given a structure $\str A$, produces a structure
whose Gaifman graph is a subgraph of the Gaifman graph of $\str A$.
In the following lemmas, we identify a first-order formula
$\phi(\bar x)$ with the transduction which inputs a structure $\str A$
and outputs~$\str A$ extended with a single relation, consisting of
those tuples $\bar a$ which satisfy $\phi(\bar x)$ in $\str A$ (this
transduction is a composition of an extension operation followed by a
sequence of reduct operations which drop all the symbols from the
input structure).
\begin{lemma}\label{lem:qe-formulas}
Let $\phi(\bar x)$ be a first-order formula and let $\class{C}$ be a
class of graphs of bounded expansion. Then there is a guarded
transduction $\interp I$ which adds unary function and relation
symbols only, and a quantifier-free formula $\phi'(\bar x)$, such
that $\phi$ is equivalent to $\interp I; \phi'$ on $\class{C}$.
\end{lemma}
Before proving \cref{lem:qe-formulas}, we first show how to conclude
\cref{pro:qe-be} using it.
\begin{proof}[of \cref{pro:qe-be}]
For simplicity we assume that the signature produced by $\interp I$
consists of one relation~$P$; lifting the proof to signatures
containing more relation and function symbols is immediate. By
\cref{lem:normal}, we may express $\interp I$ as
$$\interp I=\interp L;\interp C;\interp E;\interp X;\interp R,$$
where
\begin{itemize}
\item $\interp L$ is a sequence of unary lifts,
\item $\interp C$ is a sequence of copying operations,
\item $\interp E$ is a single extension operation introducing the
final relation $P$ using some formula $\phi(\bar x)$,
\item $\interp X$ is a single universe restriction operation using
some formula $\psi(x)$ that does not use symbol $P$, and
\item $\interp R$ is a sequence of reduct operations that drop all
relations and functions apart from~$P$.
\end{itemize}
From \cref{lem:lex} it follows that the class
$\interp C(\interp L(\class{C}))$ of colored graphs is a class of bounded
expansion, and therefore, we may apply \cref{lem:qe-formulas} to it,
and to the formulas $\phi(\bar x)$ and $\psi(x)$ considered above.
Using \cref{lem:qe-formulas} we replace the formulas $\phi(\bar x)$
and $\psi(x)$ by quantifier-free formulas, at the cost of
introducing additional guarded transductions which introduce unary
function and relation symbols. Using \cref{lem:star}, every such
transduction is equivalent to an almost quantifier-free
transduction. Hence, the transductions $\interp E$ and $\interp X$
can be replaced in $\interp I$ by almost quantifier-free
transductions, yielding an almost quantifier-free transduction
$\interp J$ that is equivalent to $\interp I$ on $\class{C}$.
\end{proof}
As explained, \cref{pro:qe-be} together with \cref{pro:bi-def} yields
\cref{thm:qe-lsc}. It remains to prove \cref{lem:qe-formulas}.
Similarly as in~\cite{DKT2,Grohe2011}, we first prove the statement
for classes of colored forests of bounded depth:
\begin{lemma}[$\star$]\label{lem:qe-trees0}
Let $\phi(\bar x)$ be a first-order formula and let $\class{F}$ be a
class of colored rooted forests of bounded depth. Then there is a
transduction $\interp I_\phi$ which, given a rooted forest
$F\in \class{F}$ extends it by the parent function of $F$ and some unary
predicates, and there exists a quantifier-free formula
$\phi'(\bar x)$ such that $\phi$ is equivalent to
$\interp I_\phi;\phi'$ on $\class{F}$.
\end{lemma}
Let us remark that the presented proof of \cref{lem:qe-trees0} is
based on the automata approach and is conceptually different from the
ones used in~\cite{DKT2,Grohe2011}. Note that the
transduction~$\interp I_\phi$ produced in \cref{lem:qe-trees0} is in
particular a guarded transduction, since the parent of a vertex in a
forest is in particular a neighbor of that vertex.
\medskip The next step is to lift \cref{lem:qe-trees0} to classes of
structures of bounded treedepth. We first observe that classes of
bounded treedepth are bi-definable with classes of forests of bounded
depth, using almost quantifier-free transductions. This result is
similar, but much simpler to prove than \cref{lem:key}, which is an
analogous statement for classes of bounded shrubdepth.
\begin{lemma}\label{lem:dfs}
Let $\class{C}$ be a class of structures of bounded treedepth. There is a
pair of faithful transductions $\interp T$ and $\interp C$ and a
class $\class{F}$ of colored rooted forests of bounded depth such that
$\interp T(\class{C})\subset \class{F}$, $\interp C(\class{F})\subset \class{C}$ and
$\interp C(\interp T(\str A))=\set {\str A}$ for $\str A\in
\class{C}$.
Moreover, the transduction $\interp T$ is guarded, and $\interp C$
is deterministic almost quantifier-free.
\end{lemma}
\begin{proof}
We follow the well-known encoding of structures of bounded treedepth
inside colored forests, where a structure $\str A\in\class{C}$ is encoded
in a depth-first search forest of its Gaifman graph, as follows.
A \emph{depth first-search} (DFS) forest of a graph $G$ is a rooted
forest $F$ which is a subgraph of $G$, such that every edge of $G$
connects an ancestor with a descendant in $F$.
It is known that a graph $G$ of treedepth at most $d$ has a DFS
forest of depth at most $2^d$. If $\str A$ is a structure over a
fixed signature $\Sigma$, $G$ is its Gaifman graph and $F$ is a DFS
forest of $G$ of depth $2^d$, then $\str A$ can be encoded in $F$
using a bounded number of additional unary predicates by labeling
every node $v$ of $F$ by the isomorphism type of the substructure of
$\str A$ induced by $v_1,\ldots,v_t$, where $v_1,\ldots,v_t$ are the
nodes on the path from a root of $F$ to $v$, $v=v_t$ and $t\le 2^d$.
The number of used unary predicates depends only on the signature
$\Sigma$ and $d$.
If $\class{C}$ be a class of structures of treedepth at most $d$, then
the transduction $\interp T$, given a structure $\str A\in \class{C}$
outputs a DFS forest $F$ of the Gaifman graph of $\str A$ of depth
at most $2^d$, extended with unary predicates encoding $\str A$, as
described above. The structure $\str A$ can be recovered from $F$
(together with the unary predicates) using a deterministic almost
quantifier-free transduction, which first introduces the parent
function, and then uses a quantifier-free formula to determine the
quantifier-free type of a tuple of vertices.
\end{proof}
Using \cref{lem:dfs} we easily lift the quantifier-elimination result
from forests of bounded depth to classes of low treedepth.
\begin{lemma}\label{lem:qe-btd}
Let $\phi(\bar x)$ be a first-order formula and let $\class{C}$ be a
class of structures of bounded treedepth. Then there is a guarded
transduction $\interp I_\phi$ and a quantifier-free formula
$\phi'(\bar x)$ such that $\phi$ is equivalent to
$\interp I_\phi;\phi'$ on $\class{C}$.
\end{lemma}
\begin{proof}
Let $\interp C,\interp T$ and $\class{F}$ be as in \cref{lem:dfs}. Since
$\interp C(\interp T(\str A))=\set{\str A}$ and $\interp C$ is
deterministic, there is a formula $\psi(\bar x)$ such that $\phi$ is
equivalent to $\interp T;\psi$ on $\class{C}$. Now, apply
\cref{lem:qe-trees0} to the class $\class{F}$ and the formula
$\psi(\bar x)$, yielding a guarded transduction $\interp J$ and a
quantifier-free formula $\psi'(\bar x)$, such that $\psi$ is
equivalent to $\interp J;\psi'$ on $\class{F}$. By composition, $\phi$
is equivalent to $\interp T;\interp J;\psi'$ on $\class{C}$. Note that
$\interp T;\interp J$ is a guarded transduction, since $\interp T$
and $\interp J$ are such. This proves the lemma.
\end{proof}
Finally, we lift the quantifier elimination procedure to classes with
low shrubdepth covers using \cref{lem:dep} and a reasoning very
similar to the proof of \cref{lem:lsc}. Again, conceptually this lift
is exactly what is happening in~\cite{DKT2,Grohe2011}, however, our
approach based on covers makes it quite straightforward. The key
observation is encapsulated in the following lemma.
\begin{lemma}\label{lem:qf-covers}
Let $\class{D}$ be a class of structures with unary relation and function
symbols only, and let $\phi(\bar x)$ be a quantifier-free formula
with $p$ free variables, involving $c$ distinct terms. Then there
is a quantifier-free formula $\phi'(\bar x)$ such that following
conditions are equivalent for a structure $\str A\in\class{D}$, a
$c\cdot p$-cover $\cal U_{\str A}$ of the Gaifman graph of $\str A$,
and a $p$-tuple $\bar a$ of elements of $\str A:$
\begin{enumerate}
\item $\str A, \bar a\models \phi(\bar x)$,
\item there is some $U\in \cal U_G$ containing $\bar a$ such that
$\str A[U],\bar a\models\phi'(\bar x)$.
\end{enumerate}
\end{lemma}
\begin{proof
We first consider the special case when $\phi(\bar x)$ is an atomic
formula.
%
Each term $t$ occurring in $\phi(\bar x)$ defines a partial function
$t_{\str A}\colon V(\str A)\rightharpoonup V(\str A)$ on a given
structure~$\str A$, in the natural way. Let $\cal T$ denote the set
of terms occurring in $\phi(\bar x)$. By assumption,
$|\cal T|\le c$. For a tuple $\bar a=(a_1,\ldots,a_p)$ of elements
of a structure $\str A$, denote by $\cal T_{\str A}(\bar a)$ the set
$\setof{t_{\str A}(a_i)}{t\in \cal T, 1\le i\le p}$. Then
$|\cal T_{\str A}(\bar a)|\le c\cdot p$.
Since $\phi(\bar x)$ is an atomic formula, for any $p$-tuple
$\bar a$ of elements of $\str A$ and any set $U\subset V(\str A)$
containing $\cal T_{\str A}(\bar a)$ we have the following
equivalence:
$$\str A,\bar a\models\phi(\bar x)\iff
\str A[U],\bar a\models\phi(\bar x).$$
Take $\phi'(\bar x)=\phi(\bar x)$. The equivalence of the two items
then follows by assumption that $\cal U_G$ is a $p\cdot c$-cover of
$\str A$, so for every $\bar a$, there is some set $U\in \cal U_G$
containing $\cal T_{\str A}(\bar a)$.
To treat the general case of a quantifier-free formula, we take
$\phi'(\bar x)$ to be a conjunction of $\phi(\bar x)$ and a formula
which verifies that all the values in $\cal T_{\str A}(\bar a)$ are
defined. We leave the details to the reader.
\end{proof}
We are ready to prove \cref{lem:qe-formulas}.
\begin{proof}[of \cref{lem:qe-formulas}]
The proof proceeds by induction on the structure of the formula
$\phi(\bar x)$. In the base case, $\phi(\bar x)$ is a
quantifier-free formula, so we may take $\interp I$ to be the
identity transduction.
In the inductive step, we consider two cases. If $\phi(\bar x)$ is
a boolean combination of simpler formulas, then the statement
follows immediately from the inductive assumption. The interesting
case is when $\phi(\bar x)$ is of the form
$\exists y.\psi(\bar x,y)$, for some formula $\psi(\bar x,y)$. We
consider this case below. Denote by $p$ the number of free variables
in the formula~$\psi(\bar x,y)$.
Apply the inductive assumption to the formula $\psi(\bar x,y)$,
yielding a guarded transduction $\interp I_\psi$ and a formula
$\psi'(\bar x,y)$. Let $c$ be the number of distinct terms
(including subterms) appearing in the formula $\psi'(\bar x,y)$.
Let $\class{D}=\interp I_\psi(\class{C})$. Note that every structure in $\class{D}$
has unary function and relation symbols only, and is guarded by some
graph in~$\class{C}$. By \cref{lem:lsc}, we can pick a finite
$c\cdot p$-cover $\cal U$ of $\class{C}$, so that the class
$\class{C}[\cal U]$ has bounded treedepth. As $\interp I_\psi$ is
guarded, it follows that also the class $\class{D}[\cal U]$ has bounded
treedepth.
Apply \cref{lem:qf-covers} to $\class{D}$ and $\psi'(\bar x,y)$, yielding
a formula $\psi''(\bar x,y)$ such that for every graph $G\in \class{C}$,
$p$-tuple of vertices $(\bar a,b)$ and the $c\cdot p$-cover
$\cal U_{G}$ of $G\in \class{C}$, the following equivalences hold:
\begin{align*}
G,\bar a,b\models\psi(\bar x,y) & \iff
\interp I_{\psi}(G),\bar a,b\models\psi'(\bar x,y)\\ &\iff
\interp I_{\psi}(G)[U],\bar a,b\models\psi''(\bar x,y)\ \textit{for some $U\in \cal U_G$ containing $\bar a,b$}.
\end{align*}
Apply \cref{lem:qe-btd} to the class $\class{D}[\cal U]$ and the formula
$\exists y.\psi''(\bar x,y)$, yielding a guarded transduction
$\interp F$ and quantifier-free formula $\rho(\bar x)$ such that for
every $\str A\in \class{D}[\cal U]$ and tuple
$\bar a\in V(\str A)^{|\bar x|}$,
$$\str A,\bar a\models \exists y.\psi''(\bar x,y)
\iff \interp F(\str A),\bar a\models \rho(\bar x).$$
\begin{claim}\label{cl1}For each graph $G\in\class{C}$ and tuple
$\bar a\in V(H)^{|\bar x|}$, the following conditions are
equivalent:
\begin{enumerate}
\item $G,\bar a\models\exists y.\psi(\bar x,y)$,
\item there is some $U\in \cal U_G$ containing $\bar a$ such that
$\interp F(\interp I_\psi(G)[U]),\bar a\models \rho(\bar x)$.
\end{enumerate}
\end{claim}
\begin{clproof}We have the following equivalences:
\begin{align*}
G,\bar a\models\exists y.\psi(\bar x,y) &\iff
G,\bar a,b\models\psi(\bar x,y)\textit{\ for some $b\in V(G)$}\\&\iff
\interp I_\psi(G)[U],\bar a,b\models\psi''(\bar x,y)\textit{\ for some $U\in \cal U_G$ containing $\bar a,b$}\\&\iff
\interp I_\psi(G)[U],\bar a\models\exists y.\psi''(\bar x,y)\textit{\ for some $U\in \cal U_G$ containing $\bar a$}\\&\iff
\interp F(\interp I_\psi(G)[U]),\bar a\models\rho(\bar x)\textit{\ for some $U\in \cal U_G$ containing $\bar a$}.
\end{align*}
This proves the claim.
\end{clproof}
Let $N=\sup\set{|\cal U_G|\colon G\in \class{C}}$. For each graph
$G\in \class{C}$, fix an enumeration $U_1,\ldots,U_N$ of the cover
$\cal U_G$.
\begin{claim}\label{cl2}
There is a guarded transduction $\interp F'$ and quantifier-free
formulas $\rho_1(\bar x),\ldots,\rho_N(\bar x)$ such that given a
graph $G\in\class{C}$, a number $i\in\set{1,\ldots,N}$ and a tuple
$\bar a$ of elements of~$U_i$,
$$\interp F'(G),\bar a\models \rho_i(\bar x)\iff
\interp F(\interp I_\psi (G)[U_i]),\bar a\models \rho(\bar x). $$
\end{claim}
\begin{clproof}
We construct a guarded transduction $\interp F'$ which, given a
graph $G\in \class{C}$, first applies the guarded transduction
$\interp I_\psi$, then introduces unary predicates marking the
sets $U_1,\ldots,U_N$, and then, for each such unary predicate
$U_i$, applies to the structure $\interp I_\psi(G)[U_i]$ the
transduction $\interp F$, modified so that each function symbol
$f$ is replaced by a new function symbol $f^i$.
Then the formula $\rho_i(\bar x)$ is obtained from the formula
$\rho(\bar x)$, by replacing each function symbol $f$ by the
function symbol $f^i$.
\end{clproof}
Combining \cref{cl1} and \cref{cl2} we get the following equivalence:
$$\interp F'(G),\bar a\models \bigvee_{i=1}^N \rho_i(\bar x)\iff
G,\bar a\models \phi(\bar x),$$
concluding the inductive step. This finishes the proofs of \cref{lem:qe-formulas} and \cref{pro:qe-be}.\\
\mbox{}
\end{proof}
\subsection{Effectivity}\label{sec:dkt}
As a side remark, we note that we can easily derive the result of
Dvo\v r\'ak, Kr\'al', and Thomas\xspace, by observing that the above proof of \cref{lem:qe-formulas} is
effective, and can be leveraged to construct a transduction
$\interp I$ which is a linear time computable function.
We say that a transduction $\interp I$ is a \emph{linear time}
transduction if there is an algorithm which, given a structure
$\str A$ as input, produces some structure
$\str B\in \interp I(\str A)$ in linear time. Here, the structure
$\str A$ is represented using the adjacency list representation, i.e.,
for a colored graph, the size of the description is linear in the sum
of the number of vertices and the number of edges in the graph.
\medskip We show the following, effective variant of
\cref{lem:qe-formulas}.
\begin{lemma}\label{lem:qe-formulas-eff}
Let $\phi(\bar x)$ be a first-order formula and let $\class{C}$ be a
class of graphs of bounded expansion. Then there is a guarded
transduction $\interp I$ which adds unary function and relation
symbols only, and a quantifier-free formula $\phi'(\bar x)$, such
that $\phi$ is equivalent to $\interp I; \phi'$ on $\class{C}$.
Moreover, $\interp I$ is a linear time transduction.
\end{lemma}
\begin{proof}
To prove \cref{lem:qe-formulas-eff}, we observe that the
transduction $\interp I$ in \cref{lem:qe-formulas} is a linear time
transduction. The proof follows by tracing the proof of
\cref{lem:qe-formulas}, and observing the following.
\begin{enumerate}
\item In \cref{lem:qe-trees0}, the constructed transduction
$\interp I$ is a linear time transduction. This is because the
transduction only adds the parent function (which is clearly
linear-time computable, given a rooted forest) and some unary
predicates, each of which can be computed in linear time, since
each unary predicate is produced by running a deterministic
threshold tree automaton on the input tree.
\item In \cref{lem:dfs}, the transduction $\interp T$ is a linear
time transduction, since it amounts to running a depth-first
search on the input graph.
\item In \cref{lem:qe-btd}, the produced transduction
$\interp J=\interp T;\interp J$ is a linear time transduction, as
a composition of two linear time transductions.
\item In the proof of \cref{lem:qe-formulas}, the nontrivial step is
in the inductive step, in the case of an existential
formula.
In this case, the constructed transduction $\interp F'$ is a
linear time transduction, assuming $\class{C}$ has bounded expansion,
as $\interp F'$ amounts to introducing unary predicates denoting
the elements of a cover $\cal U_G$, and applying transductions
$\interp I_\psi$ and $\interp F$ which are linear time
transductions, respectively, by the inductive assumption, and by
the effective version of \cref{lem:qe-btd} discussed above.
We note that if $\class{C}$ has bounded expansion then for any fixed
$p\ge 0$ there is a finite $p$-cover $\cal U$ of $\class{C}$ of bounded
treedepth such that $\cal U_G$ can be computed from a given
$G\in \class{C}$ in time $f(p)\cdot |V(G)|$, for some function $f$
depending on $\class{C}$ (the function $f$ may not be computable). To
compute $\cal U_G$, we may first compute a $g(p)$-treepdepth
coloring of $G$ for some function $g$ (as required in the proof of
\cref{lem:ltd-lsd-covers}) and observe that it can be converted to
a cover in linear time, as in the proof of
\cref{lem:ltd-lsd-covers}. A $p$-treedepth coloring can be
computed in linear time, cf.~\cite{POMNII, dkt, Sparsity}.
\end{enumerate}
\end{proof}
\section{Quantifier elimination}\label{app:qe}
In this section we provide the missing proofs of the lemmas from
\cref{sec:qe}.
\subsection{Proof of \cref{lem:star}}
\begin{proof}[of \cref{lem:star}]
We show that if $\class{C}$ is a class of graphs of bounded expansion,
$G\in \class{C}$ and $f\colon V(G)\rightharpoonup V(G)$ is a partial function that
is guarded by $G$, then~$f$ is $\ell$-guidable, for some $\ell$
depending only on $\class{C}$. Then the claim of the lemma follows by
\cref{lem:local}.
First, consider the special case when $\class{C}$ is a class of treedepth
$h$, for some $h\in\mathbb{N}$. For each $G\in \class{C}$, fix a forest $F$ of
depth $h$ with $V(F)=V(G)$ such that every edge in~$G$ connects
comparable nodes of $F$. Label every vertex $v$ of $G$ by the depth
of $v$ in the forest $F$, using labels $\set{1,\ldots,h}$. It is
easy to see that the corresponding partition of $V(G)$ is a guidance
system of order $h$ for $f$.
Now the general case, when $\class{C}$ is a class which has a $2$-cover
$\cal U$ of bounded treedepth. Let
$N=\sup\set{|\cal U_G|:G\in \class{C}}$, and let $h$ be the treedepth of
the class $\class{C}[\cal U]$. Let $G\in \class{C}$ be a graph and let
$f\colon V(G)\to V(G)$ be a function which is guarded by $G$. Then
$f|_U$ is $h$-guidable by the previous case, and hence $f$ is
$(h\cdot N)$-guidable by \cref{lem:glue-directable}.
\end{proof}
\subsection{Proof of \cref{lem:qe-trees0}: quantifier elimination on trees of bounded depth}\label{sec:automata}
We first give a quantifier elimination procedure for colored trees of
bounded depth. In the following, we consider {\em{$\Sigma$-labeled
trees}}, that is, unordered rooted trees $t$ where each node is
labeled with exactly one element of $\Sigma$. We write $t(v)$ for the
label of a node $v$ in the tree $t$. In this section we model trees
by their parent functions, that is, we consider them as structures
where the universe of the structure is the node set, there is a unary
relation for each {\em{label}} from $\Sigma$, and there is one partial
function that maps each node to its parent (the roots are not in the
domain). A $\Gamma$-relabeling of a $\Sigma$-labeled tree~$t$ is any
$\Gamma$-labeled tree whose underlying unlabeled tree is the same as
that of $t$. As usual, a class of trees $\class{T}$ has {\em{bounded
height}} if there exists $h\in \mathbb{N}$ such that each tree in $\class{T}$
has height at most $h$.
For convenience we now regard sets of free variables of formulas,
instead of traditional tuples. That is, if $\varphi$ is a formula
with free variables $X$ and $\nu\colon X\to V(t)$ is a valuation of
variables from $X$ in a tree $t$, then we write $t,\nu\models \varphi$
if the formula $\varphi$ is satisfied in $t$ when its free variables
are evaluated as prescribed by $\nu$.
Our quantifier elimination procedure is provided by the
following~lemma, which implies \cref{lem:qe-trees0}.
\begin{lemma}\label{le:qe-forests}
Let $\class{T}$ be a class of $\Sigma$-labeled trees of bounded height
and let $\varphi$ be a first-order formula over the signature of
$\Sigma$-labeled trees with free variables $X$. Then there exists a
finite set of labels $\Gamma$, a $\Gamma$-relabeling $\wh t$ of $t$,
and a quantifier-free formula $\wh \phi$ over the signature of
$\Gamma$-labeled trees with free variables $X$, such that for each
valuation $\nu$ of $X$ in $t$ we have
$$t,\nu\models \phi\qquad\textrm{if and only if}\qquad \wh t,\nu\models \wh \phi.$$
\end{lemma}
The result immediately lifts to classes of forests of bounded depth,
which are modeled the same way as trees, i.e., using a unary parent
function.
\begin{corollary}\label{cor:qe-forests}
The same statement as above holds for a class $\class{F}$ of
$\Sigma$-labeled forests of bounded height and a first-order formula
$\psi$ over the signature $\Sigma$-labeled forests.
\end{corollary}
\begin{proof}
Let $\class{F}$ be a class of $\Sigma$-labeled forests of bounded height
and let $\psi$ be a first-order formula with free variables
$X$. Construct a class of $\Sigma$-labeled trees $\class{T}$, by
prepending an unlabeled root $r_f$ to each forest $f$ in $\class{F}$,
yielding a tree $t_f$. We may rewrite the formula~$\psi$ to a
first-order formula $\phi$ such that $f,\nu\models \psi$ if and only
if $t_f,\nu\models\phi$, for every $f\in \class{F}$ and every valuation
$\nu$ of $X$ in $f$.
Apply \cref{le:qe-forests} to $\class{T}$, yielding a relabeling $\wh t$
of each tree $t$ in $\class{T}$, using some finite set of labels
$\Gamma$. This relabeling yields a relabeling $\wh f$ of each
forest $f\in \class{F}$, where each non-root node $v$ is labeled by a
pair of labels: the label of $v$ in the tree $\wh t_f$, and the
label of the root of $\wh t_f$. Furthermore, we have
$t_f,\nu\models\phi$ if and only if $\wh t_f,\nu\models \wh \phi$,
for every valuation $\nu$. Note that all quantifier-free properties
involving the prepended root $r_f$ in the $\Gamma$-labeled tree
$\wh t_f$ can be decoded from the labeled forest $\wh f$: the unary
predicates that hold in $r_f$ are encoded in all the vertices of
$\wh f$, and $r_f$ is the parent of the roots of $\wh f$ (the
elements for which the parent function is undefined). It follows
that we may rewrite the formula $\wh \phi$ to a formula $\wh\psi$
such that $\wh t_f,\nu\models \wh\phi$ if and only if
$\wh f,\nu\models \wh\psi$, for every valuation $\nu$ of $X$ in
$f$. Reassuming, $f,\nu\models \psi$ if and only if
$\wh f,\nu\models\wh \psi$, for every $f\in \class{F}$ and every
valuation $\nu$ of $X$ in $f$.
\end{proof}
\cref{cor:qe-forests} immediately implies \cref{lem:qe-trees0}. It
remains to prove \cref{le:qe-forests}. Before proving
\cref{le:qe-forests}, we recall some standard automata-theoretic
techniques.
\bigskip
\newcommand{\res}[2]{#2\!\downharpoonright_{\;#1}} We define tree
automata which process unordered labeled trees. Such automata process
an input tree $t$ from the leaves to the root
assigning states to each node in the tree. The state assigned to the
current node $v$ depends only on the label $t(v)$ and the multiset of
states labeling the children of $v$, where the multiplicities are
counted only up to a certain fixed threshold. Because of that, we call
these automata \emph{threshold tree automata}.
\newcommand{\aut}[1]{\mathcal{#1}}
We develop all the simple facts about tree automata needed for our
purposes below. We refer to~\cite{DBLP:books/ws/automata2012/Loding12}
for a general introduction. Note that what is usually considered under
the notion of \emph{tree automata} are automata which process
\emph{ordered} trees, i.e., trees where the children of each node are
ordered. Tree automata collapse in expressive power to threshold tree
automata in the case when they are required to be independent of the
order, i.e., if $\aut A$ is a tree automaton with the property that
for any two ordered trees~$t,t'$ which are isomorphic as unordered
trees, either both $t$ and $t'$ are accepted by $\aut A$ or both~$t$
and $t'$ are rejected by $\aut A$, then the language (i.e., set) of
trees accepted by $\aut A$ is equal to the language of trees accepted
by some threshold automaton. Therefore, the theory of threshold tree
automata is a very simple and special case of that of tree
automata. We now recall some simple facts about such automata.
\bigskip
Fix a set of labels $Q$. A $Q$-multiset is a multiset of elements of
$Q$. If $\tau$ is a number and $X$ is a $Q$-multiset, then by
$\res\tau X$ we denote the maximal multiset $X'\subset X$ where the
multiplicity of each element is at most $\tau$. In other words, for
every element whose multiplicity in $X$ is more than $\tau$, we put it
exactly $\tau$ times to $X'$; all the other elements retain their
multiplicities.
\medskip
We define \emph{threshold tree automata} as follows. A threshold tree
automaton is a tuple $(\Sigma, Q,\tau, \delta, F)$, consisting~of
\begin{itemize}
\item a finite input alphabet $\Sigma$;
\item a finite state space $Q$;
\item a \emph{threshold} $\tau\in \mathbb{N}$;
\item a transition relation $\delta$, which is a finite set of rules
of the form $(a,X,q)$, where $a\in \Sigma$, $q\in Q$, and $X$ is a
$Q$-multiset in which each element occurs at most $\tau$ times;
and
\item an \emph{accepting condition} $F$, which is a subset of $Q$.
\end{itemize}
A \emph{run} of such an automaton over a $\Sigma$-labeled tree $t$ is
a $Q$-labeling $\rho:V(t)\to Q$ of~$t$ satisfying the following
condition for every node $x$ of $t$:
\begin{quote}
If $t(x)=a, \rho(x)=q$ and $X$ is the multiset of the $Q$-labels of
the children of~$x$ in $t$, then $(a,\res\tau X,q)\in \delta$.
\end{quote}
The automaton \emph{accepts} a $\Sigma$-labeled tree $t$ if it has a
run $\rho$ on $t$ such that $\rho(r)\in F$, where $r$ is the root of
$t$. The \emph{language} of a threshold tree automaton is the set of
$\Sigma$-labeled trees it accepts. A language $L$ of $\Sigma$-labeled
trees is {\em{threshold-regular}} if there is a threshold tree
automaton whose language is $L$; we also say that this automaton
{\em{recognizes}} $L$.
An automaton is \emph{deterministic} if for all $a\in \Sigma$ and all
$Q$-multisets $X$ in which each element occurs at most $\tau$ times
there exists $q$ such that $(a,X,q)\in \delta$ and whenever
$(a,X,q),(a,X,q')\in \delta$, then $q=q'$. Note that a deterministic
automaton has a unique run on every input tree.
The next lemma explains basic properties of threshold tree automata
and follows from standard automata constructions. In the lemma we
speak about {\em{monadic second-order logic}} (MSO), which is the
extension of first-order logic by quantification over unary
predicates.
\pagebreak
\begin{lemma}\label{lem:automata}
The following assertions hold:
\begin{enumerate}[(1)]
\item\label{determinisation} For every threshold automaton there is a
deterministic threshold automaton with the same language.
\item\label{closure-bc} Threshold-regular languages are closed under
boolean operations.
\item\label{closure-relabel} If $f\colon \Sigma\to \Gamma$ is any
function and $L$ is a threshold-regular language of $\Sigma$-labeled
trees, then the language $f(L)$ comprising trees obtained from trees
of $L$ by replacing each label by its image under $f$ is also
threshold-regular.
\item\label{formula-to-automata} For every MSO sentence $\phi$ in the
language of\, $\Sigma$-labeled trees there is a deterministic
threshold automaton $\aut A_\phi$ whose language is the set of trees
satisfying~$\phi$.
\end{enumerate}
\end{lemma}
\begin{proof}
Assertion \ref{determinisation} follows by applying the standard
powerset determinization construction. For assertion
\ref{closure-bc}, it follows from \ref{determinisation} that every
threshold-regular language is recognized by a deterministic
threshold tree automaton. Then, for conjunctions we may use the
standard product construction and for negation we may negate the
accepting condition. For assertion \ref{closure-relabel}, an
automaton recognizing $f(L)$ can be constructed from an automaton
recognizing $L$ by nondeterministically guessing labels from
$\Sigma$ consistently with the given labels from $\Gamma$, so that
the guessed $\Sigma$-labeling is accepted by the automaton
recognizing $L$. Now assertion \ref{formula-to-automata} follows
from~\ref{determinisation},~\ref{closure-bc},
and~\ref{closure-relabel} in a standard way, because every MSO
formula can be constructed from atomic formulas using boolean
combinations and existential quantification (which can be regarded
as a relabeling $f$ that forgets the information about the
quantified set).
\end{proof}
Let $X$ be a finite set of (first-order) variables and let
$\Sigma_X=\Sigma\times \pow{X}$.
Given a tree $t$ and a partial valuation $\nu\colon X\rightharpoonup V(t)$, let
$t\otimes \nu$ be the $\Sigma_X$-tree obtained from $t$, by replacing,
for each node $u$ of $t$, the label $a$ of $u$ by the pair $(a,Y)$
where $Y=\nu^{-1}(u)\subseteq X$.
\begin{comment}
\begin{lemma}\label{lem:valuations}
Let $\phi$ be a first-order formula in the language of
$\Sigma$-labeled forests with free variables~$X$, and let
$\Sigma_X=\Sigma\times \pow{X}$. Then there is a deterministic
threshold automaton $\aut A$ that accepts those $\Sigma_X$-labeled
forests which are of the form $t\otimes\nu$, where $t$ is a
$\Sigma$-labeled forest and $\nu\colon X\to V(t)$ is a total
valuation such that $t,\nu\models \phi$.
\end{lemma}
\begin{proof}
It is obvious that there is an MSO sentence $\psi$ such that
$t,\nu\models\phi$ if and only if $t\otimes \nu\models \psi$: just
guess existentially a run of the automaton and check its correctness
and acceptance. The lemma then follows from
\cref{lem:automata}\ref{formula-to-automata}.
\end{proof}
\end{comment}
Toward the proof of \cref{le:qe-forests}, consider a first-order
formula $\phi$ over $\Sigma$-labeled trees with free variables $X$.
We can easily rewrite $\varphi$ to a first-order sentence $\psi$ over
$\Sigma_X$-labeled trees such that $t,\nu\models \phi$ if and only if
$t\otimes \nu \models \psi$ for every $\Sigma$-labeled tree~$t$ and
valuation $\nu\colon X\to V(t)$. By
\cref{lem:automata}\ref{formula-to-automata} there is a deterministic
threshold automaton $\aut A_{\psi}$ whose language is exactly the set
of $\Sigma_X$-labeled trees satisfying $\psi$.
Denote by $Q$ the set of states and by $K$ the threshold of
$\aut A_{\psi}$, and let $M=K+|X|$. Denote by $\Delta$ the set of
$Q$-multisets in which every element occurs at most $M$ times.
Given a $\Sigma$-labeled tree $t$ and a partial valuation
$\nu\colon X\rightharpoonup V(t)$, define $\rho_\nu$ as the $Q$-labeling of $t$
which is the unique run of $\aut A_{\psi}$ over $t\otimes \nu$. For a
node $u$ of $t$, let $C_\nu(u)$ be the $Q$-multiset defined as
follows:
\begin{align*} C_\nu(u)&=\set{\rho_\nu(w):\textit{ $w$ is a child of $u$ in $t$}}.
\end{align*}
Define a new set of labels $\Gamma=\Sigma\times \Delta$, and a
$\Gamma$-relabeling $\wh t$ of $t$ as follows: for each $u\in V(t)$,
say with label $a\in \Sigma$ in $t$, the label of $u$ in $\wh t$ is
the pair $(a,\res M{C_\emptyset(u)})$, where~$\emptyset$ is the
partial valuation that leaves all variables of $X$ unassigned. Our
goal now is to prove that this relabeling $\wh t$ of $t$ satisfies the
conditions expressed in \cref{le:qe-forests}. To this end, given a
valuation $\nu$ of $X$ in $\wh t$, let $\wh t|_\nu$ denote the
$\Gamma_X$-labeled tree obtained from $\wh t\otimes \nu$ by
restricting the node set to the set of ancestors of nodes in the image
$\nu(X)$ of $\nu$.
\begin{comment}
\begin{lemma}\label{lem:same-result}
Suppose $s$ and $t$ are two $\Sigma$-labeled trees and let $\mu,\nu$
be valuations of $X$ in $s$ and $t$, respectively, such that
$\wh s|_{\mu}$ and $\wh t|_\nu$ are isomorphic. Then
$s,\mu\models \varphi$ if and only if $t,\nu\models \varphi$.
\end{lemma}
\begin{proof}
Let $\alpha$ be an isomorphism between $\wh s|_{\mu}$ and
$\wh t|_\nu$. Note that $\alpha(\mu(x))=\nu(\alpha(x))$ for each
$x\in X$, because the information about valuations $\mu,\nu$ is
present in the labels in $\wh s|_{\mu}$ and $\wh t|_\nu$,
respectively. Let $\pi$ and $\rho$ be the unique runs of
$\aut A_{\psi}$ on $s\otimes \mu$ and $t\otimes \nu$, respectively.
Then a straightforward induction over the depth shows that each node
$u$ of $s|_\mu$ is labeled in $\pi$ with the same state as
$\alpha(u)$ in $\rho$; indeed, it suffices to observe that all
threshold formulas evaluate in the same way.
Consequently, $\aut A_{\psi}$ accepts $s\otimes \mu$ if and only if
it accepts $t\otimes \nu$.
\end{proof}
\cref{lem:same-result} immediately implies the following.
\begin{corollary}\label{cor:set-defines}
There is a set of $\Gamma_X$-labeled trees $\cal R$ such that for
any tree $t$ and valuation $\nu$ of $X$ in $t$, we have
$t,\nu\models \phi$ if and only if $\wh t|_\nu\in \cal R$.
\end{corollary}
\end{comment}
\begin{lemma}\label{cor:set-defines}
There is a set of $\Gamma_X$-labeled trees $\cal R$ such that for
every $\Sigma$-labeled tree $t$ and valuation $\nu$ of $X$
in~$t$,
$$t,\nu\models \phi\textit{\quad if and only if\quad}\wh t|_\nu\in
\cal R.$$
\end{lemma}
\begin{proof}
Fix a tree $t$ and a valuation $\nu$ of $X$ in $t$. We say that a
node $u$ of $t$ is \emph{nonempty} if it has a descendant which is
in the image of $\nu$. For node $u$ of $t$ define the following
$Q$-multisets:
\begin{align*} N_\emptyset(u)&=\set{\rho_\emptyset(w):\textit{ $w$ is a nonempty child of $u$}},\\
N_\nu(u)&=\set{\rho_\nu(w):\textit{
$w$ is a nonempty child of $u$}}.
\end{align*}
Note that since there are at most $|X|$ nonempty children of a given
node $u$, there is a finite set $Z$ independent of $t$ and $\nu$
such that the functions $N_\nu$ and $N_\emptyset$ take values in
$Z$. Fix a node $u$ of $t$.
\begin{claim}\label{cl:depends}
The state $\rho_\nu(u)$ is uniquely determined by the label of $u$
in $t\otimes\nu$, and the $Q$-multisets
$\res M{C_\emptyset(u)},N_\emptyset(u)$ and $N_\nu(u)$, i.e.,
there is a function
$f\colon \Sigma_X\times \Delta\times Z\times Z\to Q$ such that for
every tree $t$, valuation $\nu$ and node $u$,
\begin{align}\label{eq:dyn}
\rho_\nu(u)=f(\,\mathrm{label\ of }\ u\ \mathrm{ in }\ t\otimes\nu\, , \,\res M{C_\emptyset(u)}\, ,\, N_\emptyset(u)\, ,\, N_\nu(u)\, ).
\end{align}
\end{claim}
\begin{proof
Clearly $N_\emptyset(u)\subset C_\emptyset(u)$, as multisets.
Moreover, the following equality among multisets holds:
\begin{align}\label{eq:multiset}
C_\nu(u)&=(C_\emptyset(u)-N_\emptyset(u))+N_\nu(u).
\end{align}
This is because the automaton $\aut A_\psi$ is deterministic and
therefore $\rho_\nu(w)=\rho_\emptyset(w)$ for all nodes $w$ which
are not nonempty.
From~Equation~\ref{eq:multiset}, the fact that $N_\emptyset(u)$
has at most~$|X|$ elements and $M=K+|X|$, it follows that
\begin{align}\label{eq:multiset-res}
\res K{((\res M {C_\emptyset(u)}-N_\emptyset(u))+N_\nu(u))}=\res K {(C_\nu(u))}.
\end{align}
By definition of the run of $\aut A_\psi$ on $t\otimes\nu$, the
state $\rho_\nu(u)$ is determined by the label of $u$ in
$t\otimes \nu$ and by $\res K {(C_\nu(u))}$. It follows
from~Equation~\ref{eq:multiset-res} that $\rho_\nu(u)$ is uniquely
determined by the label of $u$ in $t\otimes \nu$,
$\res M{(C_\emptyset(u))}$, and the $Q$-multisets $N_\emptyset(u)$
and $N_\nu(u)$, proving the claim.
\end{proof}
From \cref{cl:depends} it follows that the state $\rho_\nu(r)$, where
$r$ is the root of $t$, depends only on the tree $\wh t|_\nu$.
Indeed, we can inductively compute the states $\rho_\nu(u)$ and
$\rho_\emptyset(u)$, moving from the leaves of $\wh t|_\nu$ towards
the root, as follows. Suppose $u$ is a node of $\wh t|_\nu$ such
that~$\rho_\nu(v)$ and~$\rho_\emptyset(v)$ have been computed for all
the nonempty children $v$ of $u$ (in particular, this holds if $u$ is
a leaf of $\wh t|_\nu$). Then, we can determine the
multisets~$N_\nu(u)$ and $N_\emptyset(u)$ using their definitions, and
consequently, we can determine~$\rho_\nu(u)$ by~Equation~\ref{eq:dyn},
whereas~$\rho_\emptyset(u)$ only depends on $\res K{C_\emptyset(u)}$
and on the label of $u$ in $t$. Note that both the label of $u$ in
$t$ and the multiset $\res K{C_\emptyset(u)}$ are encoded in the label
of $u$ in $\wh t$.
As shown above, for any tree $t$ and valuation $\nu$, the state of
$\rho_\nu$ at the root depends only on $\wh t|_\nu$. On the other
hand, $t,\nu\models\phi$ if and only if the state of $\rho_\nu(r)$ at
the root is an accepting state. Hence, whether or not
$t,\nu\models \phi$, depends only on the tree $\wh t|_\nu$. This
proves the lemma.
\end{proof}
Finally, we observe the following.
\begin{lemma}\label{lem:induced-forest-check}
For each $\Gamma_X$-labeled tree $s$ there exists a quantifier-free
formula $\psi_s$ over the signature of $\Gamma$-labeled trees with
free variables $X$ such that the following holds: for every
$\Gamma$-labeled tree $t$ and valuation $\nu$ of $X$ in $t$, we have
$$t,\nu\models \psi_s\qquad\textrm{if and only if}\qquad\textrm{$t|_\nu$ is isomorphic to $s$.}$$
\end{lemma}
\begin{proof}
Observe that the ancestors of nodes in $\nu(X)$ may be obtained by
applying the parent function to them. Thus, using a quantifier-free
formula we may check whether each node of $\nu(X)$ lies at depth as
prescribed by $s$, whether its ancestors have labels as prescribed
by $s$, and whether the depth of the least common ancestor of every
pair of nodes of $\nu(X)$ is as prescribed by $s$. Then $t|_\nu$ is
isomorphic to $s$ if and only if all these conditions hold.
\end{proof}
With all the tools prepared, we may prove \cref{le:qe-forests}.
\begin{proof}[of \cref{le:qe-forests}]
Let $\cal R_h$ be the intersection of $\cal R$ with the class of
trees of height at most $h$. Since each tree from $\cal R$ has at
most $|X|$ leaves by definition, $\cal R_h$ is finite and its size
depends only on $|X|$ and $h$. By \cref{cor:set-defines}, it now
suffices to define~$\wh \phi$ as the disjunction of formulas
$\psi_s$ provided by \cref{lem:induced-forest-check} over
$s\in \cal R_h$.
\end{proof}
\begin{comment}
\subsection{Bounded depth trees}
We now use \cref{le:qe-forests} to show that every transduction
working on colored trees of bounded height is equivalent to an almost
quantifier-free transduction. Here, a transduction is {\em{copyless}}
if it does not use copying.
\begin{lemma}\label{lem:qe-trees}
Let $\class{T}$ be a class of colored trees of bounded height. Then
every copyless transduction $\interp I$ is equivalent to some almost
quantifier-free copyless transduction $\interp J$ on $\class{T}$.
\end{lemma}
\begin{proof}
Rewrite $\interp I$ in the normal form expressed in
\cref{lem:normal}. Take any relation $R$ from the final signature,
and consider formula $\phi_R$ that interprets it. Apply
\cref{le:qe-forests} to~$\phi_R$, yielding a quantifier-free
formula~$\wh \phi_R$ and a suitable recolorings of the given tree.
Then $R$ can be added to the structure by introducing the recoloring
using unary lifts and applying extension operation parameterized by
$\wh \phi_R$. By performing this for every relation $R$ from the
final signature, as well as for every function from the final
signature and for the domain restriction formula
$\phi_{\mathrm{dom}}$, we construct the output of $\interp I$ on the
given tree by means of an almost quantifier-free transduction.
\end{proof}
\paragraph*{Classes of bounded shrubdepth.}
Now a combination of \cref{lem:qe-trees} and \cref{lem:key} allows an
easy lift to classes of bounded shrubdepth and hence to obtain the
statement of \cref{cor:qe-bsd}. We repeat the statement for
convenience.
\begin{lemma
Let $\class{C}$ be a class of colored graphs of bounded shrubdepth. Then
every transduction $\interp I$ is equivalent to some almost
quantifier-free transduction $\interp J$ on $\class{C}$.
\end{lemma}
\begin{proof}
We first argue that without loss of generality we may assume that
$\interp I$ is copyless. By \cref{lem:normal} we can rewrite
$\interp I$ so that it starts with a sequence of unary lifts
$\interp L$ followed by a sequence of copying operations
$\interp C$, and then applies a copyless transduction $\interp I'$.
It can be easily seen that both unary lifts and copying preserve
boundedness of shrubdepth, hence the class
$\class{C}'=(\interp L;\interp C)(\class{C})$ also has bounded shrubdepth. It
would be tempting to say that we may just now apply the reasoning
for the copyless transduction $\interp I'$ applied on $\class{C}'$, but
there is a slight caveat --- $\class{C}'$ is not necessarily a class of
colored graphs due to functions introduced by copying. However, this
can be easily fixed by appending a quantifier-free transduction
$\interp M$ that adds, using lifts, unary predicates selecting the
layers of copies, and then turns functions introduced by copying
into edges of the (unique) adjacency relation. The usage of these
functions in formulas appearing later in $\interp I'$ can be
replaced by quantifying existentially an appropriately labeled
element and checking adjacency. Thus, after these modifications
$\interp I'$ is applied on a class of colored graphs
$\class{C}''=(\interp L;\interp C;\interp M)(\class{C})$, which has bounded
shrubdepth.
So from now on we may assume that $\interp I$ is copyless. Let
$\interp B$ and $\interp T$ be the almost quantifier-free
transductions provided by \cref{lem:key} for the class $\class{C}$ (with
colors stripped); recall that~$\interp B$ is copyless. Then
$\interp I$ is equivalent to the composition
$\interp T;\interp B;\interp I$; here we use that the additional
unary predicates on vertices of the given graph are kept intact by
the composition $\interp T;\interp B$. Now~$\interp B;\interp I$ is
a transduction working on $\interp T(\class{C})$, which is a class of
colored trees of bounded height. By \cref{lem:qe-trees},
$\interp B;\interp I$ is equivalent to some almost quantifier-free
transduction $\interp J'$. Hence $\interp I$ is equivalent to
$\interp T;\interp J'$, which is almost quantifier-free.
\end{proof}
We now give an analogue of \cref{lem:key} for classes of bounded
treedepth.
\begin{lemma}\label{lem:key-td}
Let $\cal B$ be a class of structures over a fixed signature that
has bounded treedepth. Then there is a class $\cal T$ of colored
forests of bounded height and a pair of faithful almost
quantifier-free transductions $\interp T$ and $\interp B$ such that
$\interp B(\cal T)\subseteq \cal B$,
$\interp T(\cal B)\subseteq \cal T$, and
$$\interp B(\interp T(\str A))= \str A\ \ \textrm{for all}\ \ \str A\in {\cal B}\qquad \textrm{and}\qquad \interp T( \interp B(t))=t\ \ \textrm{for all}\ \ t\in \cal T.$$
\end{lemma}
The reason why we need \cref{lem:key-td} instead of the seemingly more
general \cref{lem:key} is technical: \cref{lem:key} applies only to
classes of graphs instead of general structures, and this was actually
important in the proof. Fortunately, for classes of bounded treedepth
the proof is much simpler.
\begin{proof}[Proof of \cref{lem:key-td}]
For a graph $G$, a {\em{DFS forest}} in $G$ is any rooted forest $t$
on the vertex set of $G$ satisfying the following two conditions:
\begin{itemize}
\item For every edge $uv$ of $G$, either $u$ is an ancestor of $v$
in $t$ or vice versa.
\item For every pair of vertices $u,v$ such that $v$ is the parent
of $u$ in $t$, there is an edge $uv$ in $G$.
\end{itemize}
A DFS forest of a graph can be computed by running depth-first
search on it and outputting the forest described by the recursive
calls. It is well-known (see e.g.~\cite[Section 17.3]{Sparsity})
that if $G$ has treedepth $d$ then any DFS forest of $G$ has depth
at most $2^d$.
Let $\Sigma$ be the signature of structures in $\cal B$ and let
$d\in \mathbb{N}$ be such that every structure in $\cal B$ has treedepth at
most $d$. Take any structure $\str A\in \cal B$. Let $G$ be the
Gaifman graph of $\str A$ and let $t$ be any its DFS forest; then
$t$ has depth at most $p=2^d$. Let $R_0,R_1,\ldots,R_p$ be the
partition of $V(\str A)$ such that $R_i$ comprises vertices at depth
$i$ in $t$.
For $i\in [p]$, define function $f_i\colon R_i\to R_{i-1}$ by
setting $f_i(u)$ to be the parent of $u$ in $t$. Observe that by
the properties of DFS forests the following assertion holds:
$f_i(u)$ is the unique neighbor of $u$ in $R_{i-1}$. It follows
that $f_i$, regarded as a partial function from $V(G)$ to $V(G)$, is
$1$-guidable in the sense introduced in \cref{sec:directable}. By
\cref{lem:glue-guidable}, the parent function of $t$ is
$p$-guidable, hence by \cref{lem:local} it can be computed using an
almost quantifier-free transduction.
We now define a coloring of $t$ with a bounded number of unary
predicates that encodes the relations and functions in $G$. Create
a unary predicate $U_{\str B}$ for every $\Sigma$-structure $\str B$
with universe $\{0,1,\ldots,a\}$ for some $a\leq p$; note that the
number of such structures is finite and bounded only in terms of
$\Sigma$ and $d$. Such predicate $U_{\str B}$ is interpreted as
follows: for each $u\in V(\str A)$, $U_{\str B}$ is satisfied in $u$
if and only if:
\begin{itemize}
\item the depth of $u$ is equal to $a$, and
\item the substructure of $\str A$ induced by the ancestors of $u$
in $t$ is isomorphic to $\str B$, where the isomorphism maps the
unique ancestor of $u$ at depth $i$ to $i$, for each
$i\in \{0,1,\ldots,a\}$.
\end{itemize}
Observe that provided the parent function of $t$ has been already
introduced, such a labeling can be computed using a sequence of
extension operations, one for each predicate $U_{\str B}$. Indeed,
given a vertex $x$ it suffices to find all ancestors of $x$ in $t$
by iteratively applying the parent function at most $p$ times, and
then verifying the isomorphism type of the substructure induced by
them. This yields the transduction $\interp T$.
For transduction $\interp B$, given the colored forest $t$ we
reconstruct relations and functions from $\str A$ one by one using
extension and function extension operations. Say that we would like
to reconstruct a relation $R\in \Sigma$ of arity $r$. Given a tuple
$v_1,\ldots,v_r$ of nodes of $t$, we check the following condition
to determine whether $R(v_1,\ldots,v_r)$ holds in $\str A$: all
pairs of elements $v_1,\ldots,v_r$ are bound by the ancestor
relation in $t$ and, provided $v_i$ has the largest depth among them
(i.e. $v_1,\ldots,v_r$ are all ancestors of $v_i$), the information
encoded in the label of $v_i$ in $t$ implies that
$R(v_1,\ldots,v_r)$ holds in $\str A$. It is straightforward to see
that this check can be done using a quantifier-free formula working
over $t$. The case of functions from $\Sigma$ is treated in the same
way.
\end{proof}
By combining \cref{lem:key-td} with \cref{le:qe-forests} we easily
obtain the following.
\begin{corollary}\label{cor:qe-bsd}
Let $\class{C}$ be a class of structures over a fixed signature which has
bounded treedepth. Then every faithful transduction $\interp I$ is
equivalent to some faithful almost quantifier-free transduction
$\interp J$ on $\class{C}$.
\end{corollary}
\begin{proof}
Let $\interp B$ and $\interp T$ be the transductions provided by
\cref{lem:key-td} for the class $\class{C}$. We first consider the case
when $\interp I$ is a single extension operation, say introducing a
relation $R$ using a formula $\phi$. It is easy to see that there
is a formula $\psi$ such that for every $\str A\in \class{C}$, $\psi$
selects exactly the same tuples of elements in $\interp T(\str A)$
as $\phi$ in $\str A$. Indeed, it suffices to pull back $\phi$ over
the transduction $\interp B$, that is, replace every relation or
function symbol in $\phi$ by its interpretation in $\interp B$.
Next apply \cref{le:qe-forests} to $\psi$, yielding a
quantifier-free formula $\wh \psi$ and, for every forest
$t\in \interp T(\class{C})$, a recoloring $\wh t$ of $t$ such that
$\wh \psi$ selects exactly the same tuples in $\wh t$ as $\psi$ in
$t$. It now suffices to consider the following sequence of
transductions: apply $\interp T$, compute recoloring $\wh t$ using
unary lifts, apply extension operation parameterized by $\wh \psi$,
and finally apply $\interp B$ to turn the structure back to the
original.
The general case can be done by rewriting the transduction to the
normal form provided by TODO\todo{normal form} and applying the
above reasoning to each extension and function extension operation
separately; the treatment of function extension is the same as that
of (normal) extension. That is, we first apply $\interp T$ and then
use a sequence of recolorings and extensions to introduce all the
necessary relations and functions.
\end{proof}
\subsection{Classes with bounded shrubdepth covers} \label{subsec:qe}
Finally, in this subsection we consider the general case of classes
with low shrubdepth covers, that is, we prove \cref{lem:qe-lsc}. In
the proof we use the notions of cover, $p$-cover and finite cover for
structures and not for graphs as defined in \cref{sec:sbe}; the
extension of these notions to structures is straightforward.
\begin{proof}[Proof of \cref{lem:qe-lsc}]
For simplicity we assume that the final signature consists of one
relation $P$; lifting the proof to signatures containing more
relation and function symbols is immediate. By \cref{lem:normal},
we may express $\interp I$ as
$$\interp I=\interp L;\interp C;\interp E;\interp X;\interp R,$$
where
\begin{itemize}
\item $\interp L$ is a sequence of unary lifts,
\item $\interp C$ is a sequence of copying operations,
\item $\interp E$ is a single extension operation introducing the
final relation $P$ using some formula $\phi(\bar x)$,
\item $\interp X$ is a single universe restriction operation using
some formula $\psi(x)$ that does not use symbol $P$, and
\item $\interp R$ is a sequence of reduct operations that drop all
relations and functions apart from~$P$.
\end{itemize}
By applying the same reasoning as in the beginning of the proof of
\cref{cor:qe-bsd}, we may add an almost quantifier-free transduction
$\interp M$ between $\interp C$ and $\interp E$ so that
$\class{D}\coloneqq (\interp L;\interp C;\interp M)(\class{C})$ is a class of
colored graphs, and hence $\interp E;\interp X;\interp R$ is a
copyless transduction applied on a class of colored graphs $\class{D}$.
We note that it is easy to see that unary lifts and copying
preserves having low shrubdepth covers, hence $\class{D}$ has low
shrubdepth covers.
Call an extension operation a \emph{projection operation} if it is
parameterized by a formula of the form $\exists_y\,\alpha$, where
$\alpha$ is a quantifier-free formula.
\begin{claim}\label{cl:rewrite-extend}
Every extension operation is equivalent to a composition of
quantifier-free extension operations, projection operations, and
reduct operations.
\end{claim}
\begin{proof}\renewcommand{\qedsymbol}{\ensuremath{\lrcorner}}
Every first-order formula can be constructed from atomic formulas
using disjunction, negation, and existential quantification.
Supposing that the extension operation in question is
$\mathsf{Extend}_{R\leftarrow \phi}$, we may construct relations
$R_\psi$ for subformulas $\psi$ of $\phi$ in a bottom-up manner over
the structure of $\phi$, where $R_\psi$ selects exactly those tuples
of elements which satisfy $\psi$. When $\psi$ is a disjunction or
negation of smaller subformula(s), then $R_\psi$ can be constructed
using a quantifier-free extension operation. When $\psi$ is an
existential quantification applied to a smaller subformula, then
$R_\psi$ can be constructed using a projection operation. Finally,
at the end we drop all the intermediate relations using a sequence
of reduct operations.
\end{proof}
Using \cref{cl:rewrite-extend} we may rewrite $\interp E$ as a sequence
$$\interp E = \interp I_1;\ldots;\interp I_t,$$
where each transduction $\interp I_i$ is either a quantifier-free
extension, projection, or reduct operation. Now by induction on $i$
we prove that each prefix $\interp I_1;\ldots;\interp I_i$ is
equivalent to some almost quantifier-free transduction on $\class{D}$. The
base case for $i=0$ holds trivially.
\medskip
For the induction step, suppose $\interp I_1;\ldots;\interp I_{i-1}$
is equivalent to some almost quantifier-free transduction $\interp J$
on $\class{D}$. If $\interp I_i$ is a quantifier-free extension or reduct
operation, then~$\interp J;\interp I_i$ is also almost quantifier-free
and we are done. Hence, suppose $\interp I_i$ is a projection
operation, say introducing a relation $R(\bar x)$ using formula
$\varphi(\bar x)=\exists_y\, \alpha(\bar x,y)$ where $\alpha$ is
quantifier-free and $\bar x$ is a tuple of variables. Let
$p=|\bar x|$ be the number of free variables of $\phi$.
Define
$$\interp F=\mathsf{Extend}_{Q\leftarrow \alpha}\qquad\textrm{and}\qquad \interp P=\mathsf{Extend}_{R\leftarrow \exists_y\, Q(\bar x,y)}.$$
Then $\interp I_{i}$ is equivalent to $\interp F;\interp P$, hence
$\interp I_1;\ldots;\interp I_i$ is equivalent to
$\interp J;\interp F;\interp P$ on $\class{D}$. Observe that
$\interp K\coloneqq \interp J;\interp F$ is almost quantifier-free.
Let $c$ be the constant provided by \cref{lem:dep} for $\interp K$,
and let $q\coloneqq c\cdot (p+1)$.
Pick a finite $q$-cover $\cal U$ of $\class{D}$ of bounded shrubdepth.
Take any graph $G$ from $\class{D}$, and let $\str A=\interp K(G)$.
For $U\in \cal U_G$, let $W_U\subseteq V(\str A)$ be the set of those elements of $\str A$ that are $\interp K$-supported by $U$.
Define
$$\cal W_{\str A} = \{ W_U\colon U\in \cal U_G\}.$$
The covers $\cal W_{\str A}$ form a cover $\cal W$ of
$\interp K(\class{D})$. Using the same reasoning as in the proof of
\cref{lem:lsc} we infer that $\cal W$ is a finite $(p+1)$-cover of
$\interp K(\class{D})$ such that for every
$\interp K(G) \in \interp K(\class{D})$ it holds that every $(p+1)$-tuple
of elements is $\interp K$-supported by some $U \in \cal U_G$.
Consider now the transduction $\interp K;\interp P$ applied to the
class $\class{D}[\cal U]$, which is a class of graphs of bounded
shrubdepth. By \cref{cor:qe-bsd}, $\interp K;\interp P$ is equivalent
to some almost quantifier-free transduction $\interp H$ on
$\class{D}[\cal U]$. We may now consider the following almost
quantifier-free transduction $\interp H'$ applied on $\class{D}$: given a
graph $G\in \class{D}$, apply $\interp K$ to add all relations and
functions introduced by $\interp K$, next using a sequence of unary
lifts introduce unary predicates selecting all subsets
$U\in \cal U_G$, and then apply $\interp H$ to each
substructure~$G[U]$ for $U\in \cal U_G$ to introduce relation $R$
within $U$. Here, we need to appropriately modify atomic operations
in $\interp H$ to ignore elements outside of $U$.
We claim that $\interp H'(G)=\interp P(\str A)$. Clearly all relations
and functions apart from $R$ are the same in $\interp H'(G)$ as in
$\interp P(\str A)$, since $\interp H'$ has applied $\interp K$ at the
beginning. Take any tuple~$\bar v$ of $p$ elements in
$\interp P(\str A)$ such that $R(\bar u)$ holds in
$\interp P(\str A)$. This means that there exists $w\in V(\str A)$
such that $Q(\bar u,w)$ holds in $\interp K(G)$. Since
$\cal W_{\str A}$ is a $(p+1)$-cover of $\interp K(G)$, there exists
some $U\in \cal U_G$ such that all elements of $\bar v$ as well as $w$
belong to $W_U$. By definition of $W_U$, $w$ and elements of $\bar v$
are all $\interp K$-supported by $U$. By \cref{lem:dep}, it follows
that $Q(\bar v,w)$ holds also in $\interp K(G[U])$, so $R(\bar v)$
holds in $\interp H'(G)$. Conversely, if $R(\bar v)$ holds in
$\interp H'(G)$, this means that $Q(\bar v,w)$ holds in
$\interp K(G[U])$ for some $U\in \cal U_G$ such that $\bar v$ and $w$
all belong to $W_U$, and in particular $Q(\bar v,w)$ holds also in
$\interp K(G)$ by \cref{lem:dep}. This implies that $R(\bar v)$ holds
in $\interp P(\str A)$, as required. Hence $\interp H'$ is an almost
quantifier-free transduction satisfying all the required properties.
This concludes the induction step.
\medskip
Using induction we have shown that the extension operation $\interp E$
is equivalent to some almost quantifier-free transduction
$\interp E'$. We now treat the restriction operation~$\interp X$ as
follows. Using the same reasoning as above we may find an almost
quantifier-free transduction $\interp X'$ that introduces a unary
predicate $X$ which selects all vertices satisfying the formula $\psi$
governing $\interp X$. Then $\interp X$ is equivalent to
$\interp X';\mathsf{Restrict}_{X}$, which is almost quantifier-free.
Thus, we have replaced both $\interp E$ and $\interp X$ with almost
quantifier-free transduction, obtaining an almost quantifier-free
transduction equivalent to $\interp I$.
\end{proof}
\begin{proof}[of \cref{pro:effective-be}] \todo{Prove}.
\end{proof}
\subsection{Sketch of the result of Dvo\v{r}\'ak, Kr\'al', and Thomas.}
We now sketch how from the presented reasoning one may recover the
result of Dvo\v{r}\'ak, Kr\'al', and Thomas~\cite{DKT2} that on every
class of relational structures of bounded expansion~$\class{C}$ and
first-order sentence $\varphi$, checking whether $\varphi$ holds in a
given structure from $\class{C}$ can be done in linear time. Before giving
the sketch, we first give an effective analogue of \cref{lem:key} for
classes of bounded treedepth. Here, a transduction is {\em{faithful}}
if it uses neither copying nor restriction operations; that is, the
input and output universes are equal.
\begin{lemma}\label{lem:key-td}
Let $\cal B$ be a class of structures over a fixed signature that
has bounded treedepth. Then there is a class $\cal T$ of colored
forests of bounded height and a pair of faithful transductions
$\interp T$ and $\interp B$ such that $\interp B$ is almost
quantifier free, $\interp T$ is deterministic almost
quantifier-free, $\interp B(\cal T)\subseteq \cal B$,
$\interp T(\cal B)\subseteq \cal T$, and
$$\interp B(\interp T(\str A))=\{\str A\}\ \ \textrm{for all}\ \ \str A\in {\cal B}\qquad \textrm{and}\qquad \interp T(\interp B(t))\ni t\ \ \textrm{for all}\ \ t\in \cal T.$$
Moreover, given $\str A$, some member of $\interp T(\str A)$ may be
computed in linear time.
\end{lemma}
\begin{proof}
For a graph $G$, a {\em{DFS forest}} in $G$ is any rooted forest $t$
on the vertex set of $G$ satisfying the following two conditions:
\begin{itemize}
\item For every edge $uv$ of $G$, either $u$ is an ancestor of $v$ in $t$ or vice versa.
\item For every pair of vertices $u,v$ such that $v$ is the parent of
$u$ in $t$, there is an edge $uv$ in $G$.
\end{itemize}
A DFS forest of a graph can be computed by running depth-first search
on it and outputting the forest described by the recursive calls. It
is well-known (see e.g.~\cite[Section 17.3]{Sparsity}) that if $G$ has
treedepth $d$ then any DFS forest of $G$ has depth at most $2^d$.
Let $\Sigma$ be the signature of structures in $\cal B$ and let
$d\in \mathbb{N}$ be such that every structure in $\cal B$ has treedepth at
most $d$. Take any structure $\str A\in \cal B$. Let $G$ be the
Gaifman graph of $\str A$ and let $t$ be any its DFS forest; then $t$
has depth at most $p=2^d$ and can be computed in linear time. Let
$R_0,R_1,\ldots,R_p$ be the partition of $V(\str A)$ such that $R_i$
comprises vertices at depth~$i$ in $t$.
For $i\in [p]$, define function $f_i\colon R_i\to R_{i-1}$ by setting
$f_i(u)$ to be the parent of $u$ in $t$. Observe that by the
properties of DFS forests the following assertion holds: $f_i(u)$ is
the unique neighbor of $u$ in $R_{i-1}$. It follows that $f_i$,
regarded as a partial function from $V(G)$ to $V(G)$, is $1$-guidable
in the sense introduced in \cref{sec:directable}. By
\cref{lem:glue-guidable}, the parent function of $t$ is $p$-guidable,
hence by \cref{lem:local} it can be computed using an almost
quantifier-free transduction.
We now define a coloring of $t$ with a bounded number of unary
predicates that encodes the relations and functions in $G$. Create a
unary predicate $U_{\str B}$ for every $\Sigma$-structure $\str B$
with universe $\{0,1,\ldots,a\}$ for some $a\leq p$; note that the
number of such structures is finite and bounded only in terms of
$\Sigma$ and $d$. Such predicate $U_{\str B}$ is interpreted as
follows: for each $u\in V(\str A)$, $U_{\str B}$ is satisfied in $u$
if and only if:
\begin{itemize}
\item the depth of $u$ is equal to $a$, and
\item the substructure of $\str A$ induced by the ancestors of $u$ in
$t$ is isomorphic to $\str B$, where the isomorphism maps the unique
ancestor of $u$ at depth $i$ to $i$, for each
$i\in \{0,1,\ldots,a\}$.
\end{itemize}
Observe that provided the parent function of $t$ has been already
introduced, such a labeling can be computed using a sequence of
extension operations, one for each predicate~$U_{\str B}$. Indeed,
given a vertex $x$ it suffices to find all ancestors of $x$ in $t$ by
iteratively applying the parent function at most $p$ times, and then
verifying the isomorphism type of the substructure induced by them.
This yields the transduction $\interp T$. Note that some member of
$\interp T(\str A)$ can be computed in linear time by computing any
DFS forest and defining the coloring directly from the definition.
For transduction $\interp B$, given the colored forest $t$ we
reconstruct relations and functions from~$\str A$ one by one using
extension and function extension operations. Say that we would like
to reconstruct a relation $R\in \Sigma$ of arity $r$. Given a tuple
$v_1,\ldots,v_r$ of nodes of $t$, we check the following condition to
determine whether $R(v_1,\ldots,v_r)$ holds in $\str A$: all pairs of
elements $v_1,\ldots,v_r$ are bound by the ancestor relation in $t$
and, provided $v_i$ has the largest depth among them
(i.e. $v_1,\ldots,v_r$ are all ancestors of $v_i$), the information
encoded in the label of $v_i$ in $t$ implies that $R(v_1,\ldots,v_r)$
holds in $\str A$. It is straightforward to see that this check can be
done using a quantifier-free formula working over $t$. The case of
functions from~$\Sigma$ is treated in the same way.
\end{proof}
We now give a sketch of the proof of the result of Dvo\v{r}\'ak et al.
\begin{itemize}
\item Without loss of generality we may assume that $\class{C}$ is a class
of colored graphs. Indeed, every relational structure $\str A$ can
be represented by its incidence graph, and formulas over the
original structure can be translated to formulas over its incidence
graph.
\item We observe that the proof of \cref{le:qe-forests} is effective
in the following sense: given~$t$, the recolored tree $\wh t$ can be
computed in linear time. Indeed, computing $\wh t$ boils down to
running a fixed automaton on $t$.
\item We replace the usage of \cref{lem:key} with
\cref{lem:key-td}. Thus, transduction $\interp T$ provided by
\cref{lem:key-td} is effective --- some output can be computed in
linear time. Moreover, as applied in the proof of
\cref{lem:qe-lsc}, the transduction $\interp T$ only adds unary
predicates and parent functions of DFS forests of some induced
subgraphs of the input graph $G$, while keeping the vertex set
intact. Thus, each of these functions is {\em{guarded}} by the
original graph $G$ in the following sense: if $f(u)=v$ then $u$ and
$v$ are adjacent in $G$.
\item Suppose now that we are given a first-order sentence $\varphi$
whose satisfaction we would like to check on a given graph $G$
belonging to the class $\class{C}$. Take a fresh variable~$z$ and
consider $\varphi$ as a formula $\varphi(z)$; then $\varphi(z)$ is
satisfied either in all or in no vertex of $G$, depending on whether
$G$ satisfies $\varphi$ or not. Consider a transduction consisting
of one extension operation $\mathsf{Extend}_{Z\leftarrow \varphi}$.
Observe that evaluating this transduction on $G$ resolves whether
$G$ satisfies $\varphi$.
\item By \cref{lem:qe-lsc}, $\mathsf{Extend}_{Z\leftarrow \varphi}$ is
equivalent to some almost quantifier-free transduction $\interp I$
on~$\class{C}$. A close examination of the proof of \cref{lem:qe-lsc}
reveals that $\interp I$ may be assumed to have the following form:
first a sequence of unary lifts, then a sequence of quantifier-free
function extension operations using predicates introduced by the
unary lifts, and finally a single quantifier-free extension
operation introducing the final predicate $Z$ using some
quantifier-free formula $\psi$.
\item Effectivity of \cref{lem:key-td} implies that all the unary
lifts are effective in the following sense: some output of the lift
can be computed in linear time. Thus, the part of $\interp I$
comprising unary lifts can be performed in linear time.
\item Having observed that each function added by a function extension
operation in $\interp I$ is guarded by the input graph $G$, it is
straightforward to implement all the function extension operations
in linear time.
\item Finally, it remains to check whether $\psi$ is satisfied in any,
equivalently every, vertex of the final structure. Since $\psi$ is
quantifier-free, for any vertex $u$ it can be checked in constant
time whether $\psi(u)$ holds.
\end{itemize}
\end{comment}
\section{Main results}\label{sec:sbe}
In this section we introduce two notions which generalize the concept
of bounded expansion. Then we state the main results and outline the
proof. First, we introduce classes of \emph{structurally bounded
expansion}. This notion arises from closing bounded expansion graph
classes under transductions.
\begin{definition
A class $\class{C}$ of graphs has {\em{structurally bounded expansion}}
if there exists a class of graphs $\class{D}$ of bounded expansion and a
transduction $\interp I$ such that $\class{C}\subseteq \interp I(\class{D})$.
\end{definition}
The second notion, \emph{low shrubdepth covers}, arises from the low
treedepth coloring characterisation of bounded expansion (see
\cref{thm:beltc}) by replacing treedepth by its dense counterpart,
shrubdepth. For convenience, we formally define this in terms of
\emph{covers}.
\begin{definition}\label{def:cover
A \emph{cover} of a graph $G$ is a family $\cal U_{G}$ of subsets of
$V(G)$ such that $\bigcup \cal U_{G}= V(G)$. A cover $\cal U_{G}$
is a \emph{$p$-cover}, where $p \in \mathbb{N}$, if every set of at most $p$
vertices is contained in some $U \in \cal U_{G}$.
%
If $\class{C}$ is a class of graphs, then a \mbox{($p$-)}cover of $\class{C}$
is a family $\cal U=(\cal U_{G})_{G\in \class{C}}$, where $\cal U_{G}$ is
a ($p$-)cover of $G$. The cover $\cal U$ is \emph{finite} if
$\sup\set{|\cal U_{G}|\colon G\in \class{C}}$ is finite. Let
$\class{C}[\cal U]$ denote the class of graphs
$\set{G[U]\colon G\in\class{C}, U\in \cal U_{G}}$. We say that the
cover~$\cal U$ has \emph{bounded treedepth} (respectively, bounded
shrubdepth) if the class $\class{C}[\cal U]$ has bounded treedepth
(respectively, shrubdepth).
\end{definition}
\begin{example}
Let $\class{T}$ be the class of trees and let $p\in\mathbb{N}$. We construct a
finite $p$-cover~$\cal U$ of $\class{T}$ which has bounded treedepth.
Given a rooted tree $T$, let $\cal U_T=\set{U_0,\ldots,U_{p}}$,
where~$U_i$ is the set of vertices of $T$ whose depth is not
congruent to~$i$ modulo $p+1$. Note that $T[U_i]$ is a forest of
height $p$, and that $\cal U_T$ is a $p$-cover of $T$. Hence
$\cal U=(\cal U_T)_{T\in\class{T}}$ is a finite $p$-cover of $\class{T}$ of
bounded treedepth.
\end{example}
In analogy to low treedepth colorings, we can now characterize graph
classes of bounded expansion using covers. We say that a class $\class{C}$
of graphs has \emph{low treedepth covers} if for every $p\in \mathbb{N}$ there
is a finite $p$-cover $\cal U$ of $\class{C}$ with bounded treedepth. The
following lemma follows easily from \cref{thm:beltc}.
\begin{lemma}[$\star$]\label{lem:ltd-lsd-covers}
A class of graphs has bounded expansion if, and only if, it has low
treedepth covers.
\end{lemma}
We now define the second notion generalizing the concept of bounded
expansion. The idea is to use low shrubdepth covers instead of low
treedepth covers.
\begin{definition}\label{def:lsdc}
A class $\class{C}$ of graphs has \emph{low shrubdepth covers} if, and
only if, for every $p\in \mathbb{N}$ there is a finite $p$-cover $\cal U$ of
$\class{C}$ with bounded shrubdepth.
\end{definition}
It is easily seen that \cref{lem:ltd-lsd-covers} together with
\cref{prop:sd_properties}(\ref{SD:3}) imply that every class of
bounded expansion has low shrubdepth covers. Our main result is the
following theorem.
\begin{theorem}\label{thm:main}
A class of graphs has structurally bounded expansion if, and only
if, it has low shrubdepth covers.
\end{theorem}
As a byproduct of our proof of \cref{thm:main} we obtain the
following quantifier-elimination result, which we believe is of
independent interest.
\begin{theorem}\label{thm:qe-lsc}
Let $\class{C}$ be a class of colored graphs which has low shrubdepth
covers. Then every transduction $\interp I$ is equivalent to some
almost quantifier-free transduction $\interp J$ on~$\class{C}$.
\end{theorem}
\subsection{Greedy proof of \cref{lem:go-right}}\label{app:greedy}
We now present the second proof of \cref{lem:go-right}. As asserted
by \cref{lem:ind-paths}, graphs from a fixed class of bounded
shrubdepth do not admit arbitrarily long induced paths. We need a
strengthening of this statement: classes of bounded shrubdepth also
exclude induced structures that roughly resemble paths, as made
precise next.
\begin{definition}
Let $G$ be a graph. A {\em{quasi-path}} of length $\ell$ in $G$ is a
sequence of vertices $(u_1,u_2,\ldots,u_\ell)$ satisfying the
following conditions:
\begin{itemize}
\item $u_iu_{i+1}\in E(G)$ for all $i\in [\ell-1]$; and
\item for every odd $i\in [\ell]$ and even $j\in [\ell]$ with
$j>i+1$, we have $u_iu_j\notin E(G)$.
\end{itemize}
\end{definition}
Note that in a quasi-path we do not restrict in any way the
adjacencies between $u_i$ and~$u_j$ when $i,j$ have the same parity,
or even when $i$ is odd and $j$ is even but $j<i-1$. We now prove
that classes of bounded shrubdepth do not admit long quasi-paths; note
that since an induced path is also a quasi-path, the following lemma
actually implies \cref{lem:ind-paths}.
\begin{lemma}\label{lem:exc-quasi}
For every class $\class{C}$ of graphs of bounded shrubdepth there exists
a constant $q\in \mathbb{N}$ such that no graph from $\class{C}$ contains a
quasi-path of length $q$.
\end{lemma}
\begin{proof}
It suffices to prove the following claim.
\begin{claim}\label{cl:conn-mod-quasi}
There exists a function $f\colon \mathbb{N}\times\mathbb{N}\to \mathbb{N}$ such that no
graph admitting a connection model of height $h$ and using $m$
labels contains a quasi-path of length larger than $f(h,m)$.
\end{claim}
The proof is by induction on $h$. Observe first that graphs admitting
a connection model of height $0$ are exactly graphs with one vertex,
hence we may set $g=f(0,m)=1$ for all $m\in \mathbb{N}$.
We now move to the induction step. Assume $G$ admits a connection
model $T$ of height $h\geq 1$ where $\lambda\colon V(G)\to \Lambda$ is
the corresponding labeling of $V(G)$ with a set $\Lambda$ consisting
of $m$ labels. Call two vertices $u,v\in V(G)$ {\em{related}} if in
$T$ they are contained in the same subtree rooted at a child of the
root of $T$; obviously this is an equivalence relation. The least
common ancestor of two unrelated vertices is always the root of $T$,
hence for any two unrelated vertices $u,v$, whether $u$ and $v$ are
adjacent depends only on the label of $u$ and the label of $v$.
Now suppose $G$ admits a quasi-path $Q=(u_1,\ldots,u_\ell)$. A
{\em{block}} in $Q$ is a maximal contiguous subsequence of $Q$
consisting of pairwise related vertices. Thus $Q$ is partitioned into
blocks, say $B_1,\ldots,B_p$ appearing in this order on $Q$. Observe
that every block~$B_i$ either is a quasi-path itself or becomes a
quasi-path after removing its first vertex. Since vertices of~$B_i$
are pairwise related, they are contained in an induced subgraph of $G$
that admits a tree model of height $h-1$ and using $m$ labels,
implying by the induction hypothesis that
\begin{equation}\label{eq:block-length}
\textrm{every block has length at most $f(h-1,m)+1$.}
\end{equation}
Next, for every non-last block $B_i$ (i.e. $i\neq p$), let the
{\em{signature}} of $B_i$ be the following triple:
\begin{itemize}
\item the parity of the index of the last vertex of $B_i$,
\item the label of the last vertex of $B_i$, and
\item the label of its successor on $Q$, that is, the first vertex of
$B_{i+1}$.
\end{itemize}
The next claim is the key step in the proof.
\begin{claim}\label{cl:seven-blocks}
There are no seven non-last blocks with the same signature.
\end{claim}
\begin{proof}\renewcommand{\qedsymbol}{\ensuremath{\lrcorner}}
Supposing for the sake of contradiction that such seven non-last
blocks exist, by taking the first, the fourth, and the seventh of
them we find three non-last blocks $B_i,B_j,B_k$ with sames
signature such that $1\leq i<j<k<p$ and $j-i>2$ and $k-j>2$. Let
$1\leq a<b<c<\ell$ be the indices on $Q$ of the last vertices of
$B_i,B_j,B_k$, respectively. By the assumption,
$\lambda(u_a)=\lambda(u_b)=\lambda(u_c)$,
$\lambda(u_{a+1})=\lambda(u_{b+1})=\lambda(u_{c+1})$, and $a,b,c$
have the same parity. Suppose for now that $a,b,c$ are all even;
the second case will be analogous. Further, the assumptions $j-i>2$
and $k-j>2$ entail $b>a+2$ and $c>b+2$.
Observe that $u_{a+1}$ and~$u_b$ have to be related. Indeed, $u_{a}$
has the same label as~$u_{b}$, while it is unrelated and adjacent to
$u_{a+1}$. So if $u_{a+1}$ and $u_b$ were unrelated, then they would
be adjacent as well, but this is a contradiction because $a+1$ is odd,
$b$ is even, and $a+2<b$. Similarly $u_a$ and $u_{c+1}$ are related
and $u_b$ and $u_{c+1}$ are related. By transitivity we find
that~$u_b$ and $u_{b+1}$ are related, a contradiction.
The case when $a,b,c$ are all odd is analogous: we similarly find that
$u_a$ is related to~$u_{b+1}$, $u_a$ is related to $u_{c+1}$, and
$u_b$ is related to $u_{c+1}$, implying that $u_b$ is related to
$u_{b+1}$, a contradiction. This concludes the proof.
\end{proof}
Since there are $2m^2$ different signatures, \cref{cl:seven-blocks}
implies that
\begin{equation}\label{eq:block-number}
\textrm{the number of blocks is at most $12m^2+1$.}
\end{equation}
Assertions Equation~\ref{eq:block-length} and
Equation~\ref{eq:block-number} together imply that
$\ell\leq (f(h-1,m)+1)(12m^2+1)$. As $Q$ was chosen arbitrarily, we
may set
$$f(h,m)\coloneqq (f(h-1,m)+1)\cdot (12m^2+1).$$
This concludes the proof of \cref{cl:conn-mod-quasi} and of
\cref{lem:exc-quasi}.
\end{proof}
Now \cref{lem:go-right} immediately follows from the following
(essentially reformulated) statement.
\begin{lemma}\label{lem:unambigious-neighbor}
For every class $\class{C}$ of graphs of bounded shrubdepth there exists
a constant $p\in \mathbb{N}$ such that the following holds. Suppose
$G\in \class{C}$ and $A$ and $B$ are two disjoint subsets of vertices of
$G$ such that every vertex of $A$ has a neighbor in $B$. Then there
exist subsets $B_1,\ldots,B_p\subseteq B$ with the following
property: for every vertex $v\in A$ there exists $i\in [p]$ such
that $v$ has exactly one neighbor in $B_i$.
\end{lemma}
\begin{proof}
Call a vertex $u\in B$ a {\em{private neighbor}} of a vertex
$v\in A$ is $u$ is the only neighbor of~$v$ in $B$. Consider the
following procedure which iteratively removes vertices from $A$ and
$B$ until $A$ becomes empty. The procedure proceeds in rounds,
where each round consists of two reduction steps, performed in
order:
\begin{enumerate}
\item {\bf{$B$-reduction:}} As long as there exists a vertex $u\in B$
that is not a private neighbor of any $v\in A$, remove $u$ from $B$.
\item {\bf{$A$-reduction:}} Remove all vertices from $A$ that have
exactly one neighbor in $B$.
\end{enumerate}
Observe that in the $B$-reduction step we never remove any vertex that
is a private neighbor of some vertex in $A$, so during the procedure
we maintain the invariant that every vertex of~$A$ has at least one
neighbor in $B$. Note also that in any round, after the $B$-reduction
step the set $B$ remains nonempty, due to the invariant, and then
every vertex of $B$ is a private neighbor of some vertex of $A$.
Thus, the $A$-reduction step will remove at least one vertex from $A$
per each vertex of $B$, so the size of $A$ decreases in each round.
Consequently, the procedure stops after a finite number of rounds, say
$\ell$, when $A$ becomes empty.
Let $B_1,\ldots,B_\ell$ be subsets of the original set $B$ such that
$B_i$ denotes $B$ after the $i$th round of the procedure. Further,
let $A_1,\ldots,A_\ell$ be the subsets of the original set $A$ such
that $A_i$ comprises vertices removed from $A$ in the $i$th round.
Note that $A_1,\ldots,A_\ell$ form a partition of $A$. The following
properties follow directly from the construction:
\begin{enumerate}
\item\label{p:1} Every vertex of $A_i$ has exactly one neighbor in
$B_i$, for each $1\leq i\leq \ell$.
\item\label{p:2} Every vertex of $A_i$ has at least two neighbors in
$B_{i-1}$, for each $2\leq i\leq \ell$.
\item\label{p:3} Every vertex of $B_i$ has at least one neighbor in
$A_i$, for all $1\leq i\leq \ell$.
\end{enumerate}
For Property~\ref{p:2} observe that otherwise such a vertex would be
removed in the previous round.
Property \ref{p:1} implies that subsets $B_1,\ldots,B_\ell$ satisfy
the property requested in the lemma statement. Hence, it suffices to
show that $\ell$, the number of rounds performed by the procedure, is
universally bounded by some constant $p$ depending on the class $\class{C}$
only.
Take any vertex $v_\ell\in A_\ell$. By Property~\ref{p:1} and
Property~\ref{p:2}, it has at least two neighbors in~$B_{\ell-1}$, out
of which one, say $u_\ell$, belongs to $B_\ell$, and another, say
$u_{\ell-1}$, belongs to $B_{\ell-1}-B_\ell$. Next, by
Property~\ref{p:3} we have that $u_{\ell-1}$ has a neighbor
$v_{\ell-1}\in A_{\ell-1}$. Observe that $v_{\ell-1}$ cannot be
adjacent to $u_\ell$, because $v_{\ell-1}$ has exactly one neighbor in
$B_{\ell-1}$ by Property~\ref{p:1} and it is already adjacent to
$u_{\ell-1}\neq u_{\ell}$. Again, by Property~\ref{p:1} and
Property~\ref{p:2} we infer that $v_{\ell-1}$ has another neighbor
$u_{\ell-2}\in B_{\ell-2}-B_{\ell-1}$. In turn, by Property~\ref{p:3}
again $u_{\ell-2}$ has a neighbor $v_{\ell-2}\in A_{\ell-2}$, which is
non-adjacent to both $u_{\ell-1}$ and $u_{\ell}$, because $u_{\ell-2}$
is its sole neighbor in~$B_{\ell-2}$. Continuing in this manner we
find a sequence of vertices
$$(v_1,u_1,v_2,u_2,\ldots,v_\ell,u_\ell)$$
with the following properties: each two consecutive vertices in the
sequence are adjacent and for each $i<j$, $v_i$ is non-adjacent to
$u_j$. This is a quasi-path of length $2\ell$. By
\cref{lem:exc-quasi}, there is a universal bound $q$ depending only on
$\class{C}$ on the length of quasi-paths in $G$, implying that we may take
$p=\lfloor q/2\rfloor$.
\end{proof}
\begin{comment}
Armed with \cref{lem:unambigious-neighbor}, we give a proof of
\cref{lem:connectome'}; as argued, it implies \cref{lem:connectome}.
\begin{proof}[of \cref{lem:connectome'}]
Let $r$ and $p$ be constants provided by \cref{lem:ind-paths} and
\cref{lem:unambigious-neighbor}, respectively, for the class $\class{C}$.
Let $R_0\subset V(G)$ be a set of vertices which contains exactly
one vertex in each connected component of $G$. For $i=1,\ldots,r$,
let $R_i$ be the set of vertices of $G$ whose distance to some
vertex in $R_0$ is equal to $i$. By \cref{lem:ind-paths}, the sets
$R_0,R_1,\ldots,R_r$ form a partition of the vertex set of $G$.
Furthermore, observe that for $i=1,\ldots,r$, every vertex of $R_i$
has a neighbor in $R_{i-1}$.
Fix $i\in\set{1,\ldots,r}$. Apply \cref{lem:unambigious-neighbor} to
$R_i$ as $A$ and $R_{i-1}$ as $B$. This yields a function
$f_i\colon R_i\to R_{i-1}$ which is $(p,1)$-directable in
$G[R_i\cup R_{i-1}]$. In particular, $f_i$ is also
$(p,1)$-directable partial function $f_i\colon V(G)\rightharpoonup V(G)$.
Let $f_0$ be a partial function from $V(G)$ to $V(G)$ that fixes
every vertex of $R_0$ and is undefined otherwise. Then $f_0$ is
$1$-directed by the guidance system $\{R_0\}$, hence it is
$(1,1)$-directable in $G$.
Consider now the function $f\colon V(G)\to V(G)$ such that for
$u\in V(G)$, $f(u)=f_i(u)$ if $f_i(u)$ is defined for some
$i\in\set{0,\ldots,r}$. By the first item of
\cref{lem:glue-directable} we find that $f$ is
$(p(r+1),1)$-directable. Now let $g=f^r$ be the $r$-fold
composition of $f$. Then for every vertex $u$ we have that
$g(u)=w_C$ where $C$ is the connected component of $G$ in which $u$
resides. By the second item of \cref{lem:glue-directable} we
conclude that $g$ is $(p(r+1)r,r)$-directable. This concludes the
proof.
\end{proof}
\end{comment}
\section{Proof of \cref{lem:parallel}}
\begin{proof}[of \cref{lem:parallel}]
It is enough to consider the case when $\interp I$ is an atomic
operation.
We assume that the input structure is a bundling $\bigcup \cal K^X$
of $\cal K$, given by a function $f\colon V(\bigcup \cal K)\to X$.
Note that elements of $V(\bigcup \cal K)$ can be identified in the
structure as those that are in the domain of $f$.
Let $\sim$ be the equivalence relation on $V(\bigcup \cal K)$, where
$x\sim y$ if and only if $f(x)=f(y)$. Note that $\sim$ can be added
to the structure by an extension operation parameterized by the
formula $f(x)=f(y)$. We now consider cases depending on what atomic
operation~$\interp I$~is.
\begin{itemize}
\item If $\interp I$ is a reduct or restriction operation, then we set
${\interp I}^\star=\interp I$ (we may assume that a restriction does
not remove elements of $X$ by appropriate relativization, so
that~${\interp I}^\star$ indeed outputs a bundling).
\item If $\interp I$ is an extension operation parameterized by a
quantifier-free formula $\phi(x_1,\ldots,x_k)$, then set
${\interp I}^\star$ to be the extension operation parameterized by
the formula
$\phi(x_1,\ldots,x_k)\land\bigwedge_{i,j\in [k]} (x_i\sim x_j)$.
\item If $\interp I$ is a function extension operation parameterized
by a formula $\varphi(x,y)$, then set $\interp I^\star$ to be
function extension operation parameterized by the formula
$\varphi(x,y)\land (x\sim y)$.
\item If $\interp I$ is a copy operation, then $\interp I^\star$ is
defined as the composition of a copy operation and a function
extension operation that introduces a new function $f^\star$ in
place of~$f$ defined as follows. We first define a function
$\mathsf{origin}(x)$ as follows. Recall that when copying, we
introduce a new unary predicate, say $P$, marking the newly created
vertices and each vertex is made adjacent to its new copy. We let
$\mathsf{origin}(x)$ be defined by
$\psi_{\mathsf{origin}}(x,y)\coloneqq P(x)\wedge E(x,y)$. We now
define $f^\star(x)=f(\mathsf{origin}(x))$. The resulting bundling is
given by the function $f^\star$.
\item If $\interp I$ is a unary lift, say parameterized by a function
$\sigma$, then set ${\interp I}^\star$ to be the unary lift
parameterized by the function $\sigma^\star$ that applies $\sigma$
to each structure from $\cal K$ separately, investigates all
possible ways of picking one output for each structure in $\cal K$,
and returns the set of bundlings of sets formed in this
way
\end{itemize}
\end{proof}
\section{Proofs of \cref{sec:def-ccs}}\label{app:connectome}
In this section we present the missing proofs of \cref{sec:def-ccs} as
well as a second proof for \cref{lem:go-right}.
\subsection{Guided and guidable functions}\label{sec:directable}
\begin{proof}[of \cref{lem:glue-directed}]
For each connected component $C$ of $G$ we may find a guidance
system $\mathcal{U}^C=\{U^C_1,\ldots,U^C_\ell\}$ that guides $g|_C$. Since
$g|_C$ is undefined for vertices outside of $C$, we may assume that
$U^C_i\subseteq V(C)$ for each $i\in [\ell]$. It follows that $g$
is guided by the guidance system $\mathcal{U}=\{U_1,\ldots,U_\ell\}$ defined
by setting $U_i$ to be the union of $U^C_i$ throughout connected
components $C$ of $G$.
\end{proof}
\begin{proof}[of \cref{lem:glue-directable}]
Let $\mathcal{U}_i$ be a guidance system of size at most $\ell$ that such
that~$g_i$ is guided by~$\mathcal{U}_i$. Then $\mathcal{U}=\bigcup_{i=1}^s \mathcal{U}_i$
is a guidance system of size at most $\ell\cdot s$. It is easy to
see that $\mathcal{U}$ guides the partial function $g$.
\end{proof}
\begin{proof}[of \cref{lem:local}]
Let $\mathcal{U}$ be a guidance system of size at most $\ell$ such that
$f_G$ is guided by $\mathcal{U}$. For each vertex $x$ such that $f(x)$ is a
neighbor of $x$, pick an arbitrary set $V(x)\in\mathcal{U}$ such that $f(x)$
is the unique neighbor of $x$ in $V(x)$.
We now present an almost quantifier-free transduction that
constructs $f_G$. First, for each $U\in \mathcal{U}$ use a unary lift to
introduce a unary predicate that selects the vertices of $U$. Next,
introduce two unary predicates, $\textit{Null}$ and $\textit{Self}$,
which select the vertices~$x$ such that~$f(x)$ is undefined or
$f(x)=x$, respectively. Finally, for each $V\in\mathcal{U}$ introduce a
unary predicate ${G_V}$ that selects vertices $x$ with $V(x)=V$.
Now, for each $U\in \mathcal{U}$, construct the partial function~$d_U$ which
maps every vertex $x$ to its unique neighbor in $U$ (if it exists)
using the function extension operation parameterized by the formula
$E(x,y)\land U(y)$. Finally, construct $f_G$ using the function
extension operation parameterized by the formula $\alpha(x,y)$
stating that $x\not\in\textit{Null}$ and either $x\in\textit{Self}$
and $y=x$, or $x\in G_V$ and $y=d_U(x)$.
\end{proof}
\begin{comment}
\begin{proof}
Let $\Lambda$ be a set of $\ell$ labels and let $\Lambda^{\leq d}$
denote the set of words over $\Lambda$ of length at most~$d$. Fix a
graph $G\in\class{C}$ and let $f_G\colon V(G)\rightharpoonup V(G)$ be the
prescribed function. There is a guidance system
$\mathcal{U}=(U_\lambda)_{\lambda\in \Lambda}$ such that $f_G$ is directed
by~$\mathcal{U}$.
For $w\in \Lambda^\star$ let $f_w\colon V(G)\rightharpoonup V(G)$ be the
partial function defined using the guidance system $\mathcal{U}$. We first
show the claim in the case where $g=f_w$, for some $w$ of length at
most $d$. As functions computed by almost quantifier-free
transductions are closed under compositions, it suffices to consider
the special case when $w$ is a single letter $\alpha$. In this case,
using unary lifts we construct the structure $\wh G$ which extends
$G$ by unary predicates selecting $U_\alpha$, for
$\alpha\in \Lambda$. Then the function $f_\alpha$ can be
constructed using a function extension operation parameterized by
the formula $\alpha(x,y)=E(x,y)\land U_\alpha(y)$.
Now, if $g$ is an arbitrary function which is $d$-directed by
$\lambda$, then we first construct the functions $f_w$ for each
$w\in \Lambda^{\leq d}$; as described above, this can be done using
almost quantifier-free transduction. For $w\in \Lambda^{\leq d}$,
let $V_w$ be the set of vertices $x$ of $G$ such that
$g(x)=f_w(x)$. Then sets $V_w$ can be added to $G$ using a series of
unary lifts. Using this labeling, the function $g$ can be
constructed by a quantifier-free transduction, where the
corresponding quantifier-free formula $\alpha(x,y)$ says that if
$x\in V_w$ then $y=f_w(x)$.
\end{proof}
\end{comment}
\begin{comment}
\subsection{Proof of \cref{lem:connectome}}
We will derive \cref{lem:connectome} from the following two lemmas.
The first one is the known property that graph classes of bounded
shrubdepth do not admit long induced paths.
\begin{lemma}[\cite{Ganian2013}]\label{lem:ind-paths}
For every class $\class{C}$ of graphs of bounded shrubdepth there exists
a constant $r\in \mathbb{N}$ such that no graph from $\class{C}$ contains a path
on more than $r$ vertices as an induced subgraph. Consequently, for
every graph $G\in \class{C}$ every connected component of $G$ has
diameter at most $r$.
\end{lemma}
The second lemma is the following.
\begin{lemma}\label{lem:go-right}
For every class $\class{C}$ of graphs of bounded shrubdepth there exists
a constant $p\in \mathbb{N}$ such that the following holds. Suppose
$G\in \class{C}$ and $A$ and $B$ are two disjoint subsets of vertices of
$G$ such that every vertex of $A$ has a neighbor in $B$. Then there
is a function $f\colon A\to B$ which is $p$-guidable as a partial
function on $G$.
\end{lemma}
Before giving the proof of \cref{lem:go-right},
we first show how it implies \cref{lem:connectome}.
\begin{proof}[of \cref{lem:connectome}]
Let $r$ and $p$ be constants provided by \cref{lem:ind-paths} and
\cref{lem:go-right}, respectively, for the class $\class{C}$. Let
$R_0\subset V(G)$ be a set of vertices which contains exactly one
vertex in each connected component of $G$. For $i=1,\ldots,r$, let
$R_i$ be the set of vertices of $G$ whose distance to some vertex in
$R_0$ is equal to~$i$. By \cref{lem:ind-paths}, the sets
$R_0,R_1,\ldots,R_r$ form a partition of the vertex set of $G$.
Furthermore, observe that for $i=1,\ldots,r$, every vertex of $R_i$
has a neighbor in $R_{i-1}$.
Fix a number $i\in\set{1,\ldots,r}$. Apply \cref{lem:go-right} to
$R_i$ as $A$ and $R_{i-1}$ as $B$. This yields a function
$f_i\colon R_i\to R_{i-1}$ which is $p$-guidable in
$G[R_i\cup R_{i-1}]$. In particular, $f_i$ is also $p$-guidable
partial function $f_i\colon V(G)\rightharpoonup V(G)$.
Let $f_0$ be a partial function from $V(G)$ to $V(G)$ that fixes
every vertex of $R_0$ and is undefined otherwise. Then $f_0$ is
guided by the guidance system $\{R_0\}$, hence it is $1$-guidable in
$G$.
Consider now the function $f_G\colon V(G)\to V(G)$ such that for
$u\in V(G)$, $f_G(u)=f_i(u)$ if $f_i(u)$ is defined for some
$i\in\set{0,\ldots,r}$. By the first item of
\cref{lem:glue-directable} we find that~$f_G$ is
$p(r+1)$-guidable. By \cref{lem:local}, there is an almost
quantifier-free transduction~$\interp I$ which constructs the
function $f_G$, given $G$ on input. Now let $g=f_G^r$ be the
$r$-fold composition of $f_G$. Clearly, $g$ can be computed by an
almost quantifier-free transduction using a single function
extension operation, making use of the function~$f_G$ constructed by
$\interp I$. Then for every vertex $u$ we have that $g(u)=w_C$
where $C$ is the connected component of $G$ in which $u$ resides.
This concludes the proof of \cref{lem:connectome}.
\end{proof}
To complete the proof of \cref{lem:connectome}, it remains to prove
\cref{lem:go-right}. In fact, we present two proofs of this result.
One is an approach using \emph{bi-cographs}, and the other is using a
greedy procedure.
\subsection{Proof of \cref{lem:go-right} using bi-cographs}
We first prove a special case of \cref{lem:go-right} for graphs which
have a connection model using two different labels $\alpha$ and
$\beta$, where one part of $G$ has label $\alpha$ and the other part
has label $\beta$. Such graphs are called {\em{bi-cographs}}
(cf.~\cite{Giakoumakis1997}).
\begin{lemma}\label{lem:go-right-bico}
Let $G$ be a bi-cograph with parts $A,B$ and with a connection model
of height~$h$ where vertices in $A$ have label $\alpha$ and vertices
in $B$ have label $\beta$. Suppose further that every vertex in $A$
has a neighbor in $B$. Then there is a function $f\colon A\to B$
which is $h$-guidable as a partial function on $G$.
\end{lemma}
\begin{proof}
By \cref{lem:glue-directed}, it is enough to consider the case when
$G$ is connected. Let~$T$ be the assumed connection model of height
$h$.
We prove that there is a $h$-guidable function $f\colon A\to B$. The
proof proceeds by induction on $h$. The base case, when $h=1$ is
trivial, because then every vertex of $A$ is adjacent to every
vertex of $B$, so picking any $w\in B$ the function $f\colon A\to B$
which maps every $v\in A$ to $w$ is guided by the guidance system
consisting only of $\set{w}$.
In the inductive step, assume that $h\ge 2$ and the statement holds
for height $h-1$. Since~$G$ is connected, either the label $C(r)$
of $r$ contains the pair $(\alpha,\beta)$, or $r$ has only one child
$v$. In the latter case, the subtree of $T$ rooted at $v$ is a
connection model of $G$ of height $h-1$, so the conclusion holds by
inductive assumption. Hence, we assume that
$(\alpha,\beta)\in C(r)$.
Let $\cal S$ be the set of bipartite induced subgraphs $H$ of $G$
such that $H$ is defined by the connection model rooted at some
child of $r$ in $T$. As $(\alpha,\beta)\in C(r)$, it follows that
if $H_1,H_2\in\cal S$ are two distinct graphs, then every vertex
with label $\alpha$ in $H_1$ is connected to every vertex with label
$\beta$ in $H_2$. We consider two cases, depending on whether
$\cal S$ contains more than one graph $H$ containing a vertex with
label $\beta$, or not.
In the first case, there are at least two graphs $H_1,H_2\in\cal S$
such that $H_1$ and $H_2$ both contain a vertex with label
$\beta$. Pick $w_1\in V(H_1)$ and $w_2\in V(H_2)$, both with label
$\beta$. Then every vertex in $A$ is adjacent either to $w_1$ or to
$w_2$. Let $f\colon A\to B$ be a function which maps a vertex
$v\in A$ to $w_1$ if $v$ is adjacent to $w_1$, and to $w_2$
otherwise. Then $f$ is guided by the guidance system consisting of
$\set{w_1}$ and $\set{w_2}$.
In the second case, there is only one graph $H\in\cal S$ which
contains a vertex with label $\beta$. Pick an arbitrary vertex $w$
with label $\beta$ in $H$. Notice that every vertex in $V(G)-V(H)$
is adjacent to $w$. The graph $H$ has a connection model of height
$h-1$, so by inductive assumption, there is a guidance system
$\cal U\subset\pow{V(H)}$ of size at most $h-1$ and a function
$f_0\colon V(H)\cap A\to V(H)\cap B$ which is guided by $\cal U$.
Then the function $f\colon A\to B$ which extends $f_0$ by mapping
every vertex in $V(G)-V(H)$ to $w$ is guided by
$\cal U\cup\set{\set{w}}$.
In either case, we have constructed a $h$-guidable function
$f\colon A\to B$, as required.
\end{proof}
We now prove \cref{lem:go-right} in the general case.
\begin{proof}[of \cref{lem:go-right}]\label{pf:}
Let $\class{C}$ be a class of graphs of bounded shrubdepth. Hence, there
is a finite set of labels $\Lambda$ and a number $h\in\mathbb{N}$ such that
every graph $G\in\class{C}$ has a connection model of height $h$ using
labels from $\Lambda$. For $\alpha\in\Lambda$, let $V_\alpha$ denote
the set of vertices of $G$ which are labeled $\alpha$.
Define a function $\mu\colon A\to \Lambda^2$ as follows: for every
vertex $v$ define $\mu(v)$ as $(\alpha,\beta)$, where $\alpha$ is
the label of $v$, and $\beta\in\Lambda$ is an arbitrary label such
that $v$ has a neighbor in~$B$ with label $\beta$.
For every pair of labels $\alpha,\beta$, consider the bipartite
graph $G_{\alpha\beta}$ which is the subgraph of $G$ consisting of
$\mu^{-1}((\alpha,\beta))$ on one side and $B\cap V_\beta$ on the
other side, and all edges between these sets; note that they are
disjoint, as one is contained in $A$ and second in~$B$. Observe that
$G_{\alpha\beta}$ is a bi-cograph with a connection model of height
$h$, such that every vertex in $V(G_{\alpha\beta})\cap A$ has a
neighbor in $V(G_{\alpha\beta})\cap B$. By \cref{lem:go-right-bico}
there is a function
$f_{\alpha\beta}\colon \mu^{-1}((\alpha,\beta)) \to B\cap V_\beta$
which is $h$-guidable in $G_{\alpha\beta}$. Observe that
$f_{\alpha\beta}$ is also $h$-guidable when treated as a partial
function on $G$; it suffices to take the same guidance system, but
with all its sets restricted to~$B$.
Finally, define the function $f\colon A\to B$ so that if $v\in A$ and
$\mu(v)=(\alpha,\beta)$, then $f(v)=f_{\alpha\beta}(v)$. By
\cref{lem:glue-directable}, the function $f$ is
$(h\cdot |\Lambda|^2)$-guidable. This concludes the proof of
\cref{lem:go-right}.
\end{proof}
\end{comment}
\input{Treducible-mipi}
\begin{comment
\subsection{Proof of \cref{lem:key}}\label{sec:key-proof}
Before giving the details of the proof of \cref{lem:key}, we state an
auxiliary lemma which allows to apply a transduction in parallel to a
disjoint union of structures.
\medskip
Suppose $\cal K$ is a set of structures over the same signature. The
\emph{bundling} of $\cal K$ is a structure obtained by taking the
disjoint union $\bigcup \cal K$ of the structures in $\cal K$,
extended with a set $X$ disjoint from $V(\bigcup\cal K)$ and a
function $f\colon V(\bigcup\cal K)\to X$ such that $f(x)=f(y)$ if and
only if $x,y$ belong to the same structure in $\cal K$. We denote
such a bundling by $\bigcup \cal K^X$. We now prove that an almost
quantifier-free transduction working on each structure separately can
be lifted to their bundling.
\begin{lemma}\label{lem:parallel}
Let $\interp I$ be an almost quantifier-free transduction. Then
there is an almost quantifier-free transduction ${\interp I}^\star$
such that if the input to $\interp I^\star$ is the bundling
$\bigcup \cal K^X$ of $\cal K$, then
$\interp I^\star(\bigcup \cal K^X)$ is the set containing the
bundling of every set formed by taking one member from
$\interp I(\str K)$ for each $\str K\in \cal K$.
\end{lemma}
\begin{proof}
It is enough to consider the case when $\interp I$ is an atomic
operation.
We assume that the input structure is a bundling $\bigcup \cal K^X$
of $\cal K$, given by a function $f\colon V(\bigcup \cal K)\to X$.
Note that elements of $V(\bigcup \cal K)$ can be identified in the
structure as those that are in the domain of $f$.
Let $\sim$ be the equivalence relation on $V(\bigcup \cal K)$, where
$x\sim y$ if and only if $f(x)=f(y)$. Note that $\sim$ can be added
to the structure by an extension operation parameterized by the
formula $f(x)=f(y)$. We now consider cases depending on what atomic
operation $\interp I$ is.
\begin{enumerate}[(1)]
\item If $\interp I$ is a reduct or restriction operation, then we
set ${\interp I}^\star=\interp I$ (we may assume that a
restriction does not remove elements of $X$ by appropriate
relativization, so that ${\interp I}^\star$ indeed outputs a
bundling).
\item If $\interp I$ is an extension operation parameterized by a
quantifier-free formula $\phi(x_1,\ldots,x_k)$, then set
${\interp I}^\star$ to be the extension operation parameterized by
the formula
$\phi(x_1,\ldots,x_k)\land\bigwedge_{i,j\in [k]} (x_i\sim x_j)$.
\item If $\interp I$ is a function extension operation parameterized
by a formula $\varphi(x,y)$, then set $\interp I^\star$ to be
function extension operation parameterized by the formula
$\varphi(x,y)\land (x\sim y)$.
\item If $\interp I$ is a copy operation, then $\interp I^\star$ is
defined as the composition of a copy operation and a function
extension operation that introduces a new function $f^\star$ in
place of $f$ defined as follows: if $\mathsf{origin}(x)$ is the
function mapping each copy of a vertex to its origin (recall that
such function is added when applying copying), then
$f^\star(x)=f(\mathsf{origin}(x))$. The resulting bundling is
given by the function $f^\star$.
\item If $\interp I$ is a unary lift, say parameterized by a
function $\sigma$, then set ${\interp I}^\star$ to be the unary
lift parameterized by the function $\sigma^\star$ that applies
$\sigma$ to each structure from $\cal K$ separately, investigates
all possible ways of picking one output for each structure in
$\cal K$, and returns the set of bundlings of sets formed in this
way.
\end{enumerate}
\end{proof}
We can now give a complete proof of \cref{lem:key}.
\begin{proof}[Proof of \cref{lem:key}]
Let $\cal B_d$ be the class of graphs of SC-depth at most $d$. We
prove the statement for $\cal B=\cal B_d$, yielding appropriate
transduction $\interp B_d$ and $\interp T_d$. Observe that this
implies the general case: if $\cal B$ is any class of graphs of
bounded shrubdepth, then by \cref{lem:bsd} there is a number $d$
such that every graph from $\cal B$ has SC-depth at most $d$, hence
we may set $\interp B=\interp B_d$, $\interp T=\interp T_d$, and
$\cal T=\interp T(\cal B)$.
The proof is by induction on $d$. The base case, when $d=0$, is
trivial. In general, every output of $\interp T_d$ will be an
SC-decomposition of the input graph of depth $d$. That is, it is a
tree of height $d$, encoded as a structure by providing its parent
function. The leaves of this tree are exactly the original vertices
of the input graph $G$. They are colored with $d+1$ unary
predicates $W_0,W_1,\ldots,W_d$, corresponding to flip sets used on
consecutive levels of the SC-decomposition.
Now, given an almost quantifier-free transduction $\interp T_d$ we
construct an almost quantifier-free transduction $\interp T_{d+1}$.
The transduction $\interp T_{d+1}$, given a graph $G$,
nondeterministically computes a rooted tree $t_G$ as above in the
following steps (we think of plurality of outputs of unary lifts as
of selecting one nondeterministically). Implementing each of them
using an almost quantifier-free transduction is straightforward, and
to keep the description concise, we leave the implementation details
to the reader.
\begin{enumerate}[(1)]
\item Since $G\in \cal B_{d+1}$, there is a vertex subset
$W\subseteq V(G)$ such that in the graph $G'$ obtained from $G$ by
flipping the adjacency within $W$ every connected component
belongs to $\cal B_d$. Using a unary lift, introduce a unary
predicate $W_{0}$ selecting the set $W$ and compute $G'$ by
flipping the adjacency within $W_{0}$.
\item Let $g\colon V(G')\to V(G')$ be the function given by
\cref{lem:connectome}, applied to the graph $G'$. Note that $g$
can be constructed using an almost quantifier-free transduction.
Using copying and restriction, create a copy $X$ of the image of
$g$. By composing $g$ with the function that maps each element of
the image of $g$ to its copy (easily constructible using function
extension), we construct a function $g'\colon V(G')\to X$ such that
$g'(v)=g'(w)$ if and only if $v$ and $w$ are in the same connected
component of $G'$. Hence, $g'\colon V(G')\to X$ defines a bundling
of the set of connected components of $G'$.
\item Apply \cref{lem:parallel} to the transduction $\interp T_d$
yielding a transduction $\interp T_d^\star$. Our transduction
$\interp T_{d+1}$ now applies $\interp T_d^\star$ to the bundling
given by $g'$, resulting in a bundling of the family of colored
trees $t_C$, for $C$ ranging over the connected components of
$G'$.
\item Using extension, mark the roots of the trees $t_C$ with new a
unary predicate; for $C$ ranging over the connected components of
$G'$ these are exactly elements that do not have a parent. Create
new edges which join each such a root $r$ with $g'(r)$. In effect,
for every connected component $C$ of $G'$, all the roots of the
trees $t_C$ are appended to a new root $r_C$. At the end clear
all unnecessary relations from the structure. Note that the
obtained tree~$t_G$ retains all unary predicates $W_1,\ldots,W_d$
that were introduced by the application of the transduction
$\interp T_d^\star$ to $G'$, as well as the predicate $W_{0}$
introduced at the very beginning. All these predicates select
subsets of leaves of $t_G$.
\end{enumerate}
This concludes the description of the almost quantifier-free
transduction $\interp T_{d+1}$. The transduction $\interp B_{d+1}$
is defined similarly, and reconstructs $G$ out of $t_G$ recursively
as follows:
\begin{enumerate}[(1)]
\item Let $r$ be the root of $t_G$; it can be identified as the only
vertex that does not have a parent. Remove $r$ from the structure,
thus turning $t_G$ into a forest $t'_G$, where the roots of $t'_G$
are children of $r$ in $t_G$.
\item Using function extension, add a function $f$ which maps every
vertex $v$ to its unique root ancestor in $t'_G$. This can be done
by taking $f$ to be the $d$-fold composition of the parent
function of $t'_G$ with itself (assuming each root points to
itself, which can be easily interpreted).
\item Copy all the roots of trees in $t'_G$ and let $X$ be the set
of those copies. Construct a function $f'\colon V(t'_G)\to X$ that
maps each vertex $v$ to the copy of $f(v)$. Observe that $f'$
defines a bundling of the trees of $t'_G$.
\item Apply the transduction $\interp B_d^\star$ obtained from
\cref{lem:parallel} to the above bundling. This yields a bundling
of the family of connected components of $G'$, where $G'$ is
obtained from $G$ by flipping the adjacency within $W_{0}$.
\item Forgetting all elements of the structure apart from the
bundled connected components of $G'$ yields the graph $G'$.
Construct the graph $G$ by flipping the adjacency inside the set
$W_{0}$. Note here that since the remaining vertices are exactly
the leaves of the original tree $t_G$, the predicate $W_{0}$ is
still carried by them. Finally, clean the structure from all
unnecessary predicates.
\end{enumerate}
It is straightforward to see that transductions $\interp T_d$ and
$\interp B_d$ satisfy all the requested properties. This concludes
the proof.
\end{proof}
\end{comment} | {'timestamp': '2018-10-08T02:01:08', 'yymm': '1810', 'arxiv_id': '1810.02389', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02389'} | arxiv |
\section{Introduction}
Many inter-laboratory studies involve the collection of results for more than one measurand from each participant. For example, in a collaborative study aimed at validation of a new standard measurement procedure, results for more than one test material are usually collected, either to obtain information on precision at different levels or as part of a split-level design \cite{aoac75}. In reference material certification by inter-laboratory study, results for multiple analytes in the same candidate reference material may be obtained, or a separate quality control material of known properties may be included for assessing laboratory performance \cite{G35}. Proficiency testing rounds also frequently collect data for multiple measurands, on multiple test items, or both. In these circumstances, the identification of anomalous results can be challenging, as it is possible for a laboratory to have results with an acceptable range for each individual measurand on each test item but nonetheless differ substantially from the remainder of the population in terms of the general pattern of results. Identifying such anomalies is an important step in initial data inspection and `clean-up'.
The problem of location outliers in interlaboratory studies is well known \cite{HUND2000145}. Standards for interlaboratory study, such as ISO 5725 \cite{ISO5725-2} and the IUPAC protocol \cite{IUPAC-collab-1994} for collaborative study of test methods, routinely include procedures for detection of location outliers. Similarly, proficiency testing guidance such as ISO 13528 \cite{ISO13528-2015} includes outlier inspection and accommodation methods. While most early guidance used univariate outlier detection, robust statistical methods, as suggested by the Royal Society of Chemistry's Analytical methods Committee \cite{AMC89-1}, have become a widely used alternative for accommodation of outlying results \cite{HUND2000145}. So far, however, essentially all of these rely on application of univariate methods, applied to results for one measurand or test material at a time. These methods do not take account of the frequent strong correlation visible in many interlaboratory studies, and can miss unusual patterns of results. This multivariate problem suggests a multivariate approach.
Several approaches for outlier identification in multivariate data are available. For bivariate data, Youden plots can be effective \cite{aoac75}. For multivariate data, principal component analysis \cite{chatcol80} and measures such as Mahalanobis distance \cite{mahal1936} can be valuable aids. However, while visual inspection is always useful for inspection, it is often useful to include criteria for declaring an observation as anomalous. For example, for univariate outlier detection, critical values for common statistical outlier tests are used to decide whether follow-up action is appropriate. For multivariate data, such criteria will commonly require information on covariance between different measurands. Since most interlaboratory data sets show at least some outliers, however, the usual covariance measures, such as sample covariance and Pearson correlation (usually denoted \textit{r}), can badly overestimate the covariance of the underlying distribution. What is needed are methods of estimating covariance that are robust to the presence of outlying values.
There are now a number of outlier-resistant procedures for obtaining estimates of covariance or correlation. These include, for example, a simple pairwise procedure due to Gnanadesikan and Kettenring \cite{GK72}, and more complex iterative procedures such as the minimum covariance determinant method \cite{fastMCD} or the ``OGK'' estimator \cite{OGK02}. Rank correlation (either Spearman or Kendall \cite{kendall38}) is also relatively resistant to extreme values compared to the usual Pearson correlation. Despite their availability, these have rarely been applied to the analysis of interlaboratory study data. Lischer noted the possible utility of a robust Mahalanobis score \cite{Lischer1996}, but considered available robust covariance estimators insufficiently reliable for the purpose at that time. Dueck and Lohr \cite{dueckLohr2005} later proposed a procedure based on M-estimation and demonstrated its use for outlier identification in a biological measurement study with two measurements per test item. ISO 13528:2005 \cite{ISO13528-2005} suggested the use of methods based on rank correlation to support interpretation of Youden plots, but did not include any formally robust statistical methods. There seem to be no examples of robust covariance use in inter-laboratory studies for analytical chemistry.
This paper is accordingly intended to illustrate the use of selected robust estimators of covariance or correlation in the identification of anomalous laboratory results in inter-laboratory data, focussing on the situation of a single laboratory result (or mean) for each test item and measurand. The discussion begins with a brief overview of the concept of covariance and a summary of some important characteristics of robust estimators. Selected robust estimators of covariance are then described briefly, before illustrating their application to review of interlaboratory study data.
\section{Covariance and correlation}
Covariance is commonly taken as a property of a pair of variables or data sets; the classical covariance estimator for vectors $\matvec{x}_{i}=(x_{1i}, x_{2i}, \ldots, x_{ni})$, $\matvec{x}_{j}=(x_{1j}, x_{2j}, {\ldots}, x_{nj} )$ of length $n$ can be written
\begin{equation}
\label{ref-001}
\mathrm{cov}\left(\matvec{x}_{i},\matvec{x}_{j}\right)=\frac{\sum _{k=n}^{1}\left(x_{ik}- \overline{\matvec{x}}_{i}\right)\left(x_{jk}- \overline{\matvec{x}}_{j}\right)}{n- 1}
\end{equation}
and the correlation coefficient $r_{ij}$ is
\begin{equation}
\label{ref-002}
r_{ij}=\frac{\mathrm{cov}\left(\matvec{x}_i,\matvec{x}_j\right)}{s(\matvec{x}_i)s(\matvec{x}_j)}
\end{equation}
where $s(\matvec{x}_{i})$, $s(\matvec{x}_{j})$ denote the respective sample standard deviations. Note that when $j=i$, $\mathrm{cov}(\matvec{x}_{i}, \matvec{x}_{j})$ is just the variance for $\matvec{x}_{i}$. While variance is always positive, a valid covariance can be positive or negative; its magnitude is also less than or equal to the product of the two standard deviations. A valid correlation coefficient can therefore be in the interval $[-1, 1]$. These properties are guaranteed by equations \eqref{ref-001} and \eqref{ref-002} but, as will be seen below, not necessarily guaranteed by other possible estimators. For multivariate data with \textit{p} variables, the classical covariance is described by a covariance matrix \textbf{V}, the elements of which are given by
\begin{equation}
\label{eqn:covmat}
\mathbf{V}_{i,j}=\mathbf{V}_{j,i}=\mathrm{cov}\left(\matvec{x}_{i},\matvec{x}_{j}\right);\, \, \, i,j=1,2, \, \ldots, \, p
\end{equation}
While this is simply a symmetric square matrix containing the variances along the leading diagonal and the pairwise covariances elsewhere, a less obvious but important additional feature is that a valid covariance matrix is, (for \textit{p~{\textless}~n})\textit{,} positive definite; that is, its determinant is strictly greater than zero. For \textit{p~}${\geq}$~$n$, however, the covariance matrix is singular and has zero determinant. For multivariate (rather than pairwise) applications, this can have additional implications for the choice of robust covariance estimator.
\section{Robust covariance estimators}
\subsection{Performance characteristics for robust estimators}
Any choice of robust estimator is influenced by a range of considerations, so it is useful to summarise some of the main performance characteristics of robust estimators. The most important statistical properties are usually breakdown point, efficiency and bias. The breakdown point is a measure of the proportion of outlying values that can be tolerated. There are at least two different definitions in univariate data; for the present paper we take breakdown point as the proportion of values that can move to ${+\infty}$ without the estimate becoming infinite. The efficiency, $e$, is usually taken as the ratio of the classical variance to the variance of the estimator in question for normally distributed data; a practical way of looking at efficiency is that $n/e$ is the number of observations needed to give the same uncertainty as the corresponding classical estimator applied to $n$ data. Efficiency is often much more important for location estimators (functions that give an estimate of mean value) as it directly affects the uncertainty of estimates. Bias indicates whether an estimator, on average, over- or under-estimates the corresponding population parameter. Ideally, one seeks an unbiased estimator; where this is impractical, estimators may be adjusted for \textit{consistency}; that is, while they may be biased for small $n$, as $n$ tends to infinity, the expectation of the estimator tends to the population value.
A particular issue in assessing the performance of robust estimators in the multivariate case is that the nature of outliers is important. Figure~\ref{ref-032} shows two important cases. ``Tail outliers'' (B in Figure~\ref{ref-032}) are just the familiar univariate outliers in the same direction for both (or all) sets of data. Another type, labelled A in Figure~\ref{ref-032}, arise from a population with correlation ${-\rho}$, when the bulk of the data have correlation ${\rho}$. These have been termed ``correlation outliers'' \cite{Croux2010}. These typically decrease correlation unless very extreme. Unless extreme, they can not easily be detected by univariate data inspection; note that point A in Figure~\ref{ref-032} is not particularly extreme for either variable. Resistance to correlation outliers is a desirable property of robust covariance estimators; assessment of bias accordingly needs to consider both ``tail'' and ``correlation'' outliers.
\begin{figure}
\centering
\includegraphics[width=0.6\textwidth]{image18}
\caption{Two different kinds of outlier in bivariate data. A: ``correlation outlier''; B, ``tail outliers''. Vertical and horizontal dashed lines are through the medians of the data, for visual guidance.}
\label{ref-032}
\end{figure}
Two other practical characteristics can also be important; computational complexity and computing time. Speed and simplicity can -- particularly for inspection and review -- be more important than the best possible efficiency or bias.
We now present a number of established robust covariance estimators and review them against these criteria.
\section{Some outlier-resistant estimators of covariance or correlation}
\subsection{Rank correlation}
There are two common measures of rank correlation; Spearman's ${\rho}$ and Kendall's ${\tau}$ \cite{kendall38}. Spearman's ${\rho}$ for two sets of data ($\matvec{x}$, $\matvec{y}$) is simply the correlation coefficient \eqref{ref-002} calculated from the ranks $\left(R(x_{i}), R(y_{i})\right)$ within each set, that is, the numerical location of each data point when the set is sorted into ascending order. Spearman's ${\rho}$ can also be calculated from
\begin{equation}
\label{eqn:rho-alt}
\rho =1- \frac{6\sum _{i=1,n}d_{i}^{2}}{n(n^{2}- 1)}
\end{equation}
where $d_{i}=R(x_{i})-R(y_{i})$ and $n$ is the number of (bivariate) data points.
Kendall's ${\tau}$ relies on the numbers $N_{c}$ and $N_{d}$ of, respectively, ``concordant'' and ``discordant'' points in a multiple pairwise comparison of the data sets. A pair of points $\left(x_{i}, y_{i}\right)$ and $\left(x_{j}, y_{j}\right)$ is considered concordant if ($x_{j}$-$x_{i}$) and $\left(y_{j}-y_{i}\right)$ have the same sign; discordant if they have opposite sign, and is not counted if $(x_{j}=x_{i})$ or ($y_{j}=y_{i})$. Then, Kendall's ${\tau}$ is given by
\begin{equation}
\label{eqn:kendall-tau}
\tau =\frac{N_{\mathrm{c}}- N_{\mathrm{d}}}{N_{\mathrm{c}}+N_{\mathrm{d}}}
\end{equation}
Like the correlation coefficient \textit{r}, these measures are both limited to the range {$[-1,1]$}. Both rank correlations are quite efficient, with efficiencies above 70\% at the normal; for both, the asymptotic efficiency is lowest near ${\rho}=1$, increasing to about 90\% as ${\rho}$ tends to zero. \cite{Croux2010}
Because ranks are themselves insensitive to distribution, measures of correlation based on ranks already provide fair resistance to outlying values. Croux and Delon found good resistance for the Spearman and Kendall correlation at 1\% contamination by ``worst-case'' outliers (chosen for their extreme effect on rank correlation); for both, effects became appreciable at 5\% contamination, though Kendall's ${\tau}$ showed smaller effects. \cite{Croux2010} For ``correlation outliers'', both of these correlation measures tolerate 5-10\% outlier contamination well, though with a bias towards smaller correlation.
Both $\rho$ and $\tau$ can be used to construct covariance estimates by multiplication by the product $s(\matvec{x})s(\matvec{y})$ of the respective standard deviations, using the relationship in eq. \eqref{ref-002}. For outlier resistance for the corresponding covariance estimates, the standard deviations can be replaced by robust standard deviations for each of the two variables concerned, giving, for example:
\begin{equation}
\label{eqn:covRS}
\mathrm{cov}_{RS}\left(\matvec{x},\matvec{y}\right)=\rho s^{*}(\matvec{x})s^{*}(\matvec{y})
\end{equation}
where $s^{\mathrm{*}}(.)$ denotes a robust estimate of standard deviation and the subscript \textit{RS} indicates a \underline{R}ank correlation using \underline{S}pearman's method. The combination of a rank correlation with robust estimates of standard deviation provides considerably improved outlier resistance. For this reason, ISO 13528:2005 \cite{ISO13528-2005} recommended the use of Spearman's rank correlation, supplemented by the ``Algorithm A'' robust estimates of standard deviation, as a basis for confidence ellipsoids in Youden plots \cite{ISO13528-2005}. The efficiency and breakdown for covariance estimators such as \eqref{eqn:covRS} is dictated primarily by the robust standard deviation estimator; for example, use of the scaled median absolute deviation (MAD$_{\mathrm{e}}$, \cite{AMC89-1}) provides 50\% breakdown but efficiency at the normal of only 37\% \cite{MaronnaYohai}, while Rousseeuw's $Q_{\mathrm{n}}$ retains the high breakdown of 50\% but has efficiency of 82\% \cite{Qn1993}.
\subsection{Gnanadesikan-Kettenring pairwise estimator (GK)}
Gnanadesikan and Kettenring \cite{GK72} noted the identity
\begin{equation}
\mathrm{cov}\left(\mathbf{x,y}\right)=\left[\mathrm{var}\left(\matvec{x}\mathbf{+}\matvec{y}\right)- \mathrm{var}\left(\matvec{x}\mathbf{-}\matvec{y}\right)\right]/4
\end{equation}
and proposed the simple covariance estimate
\begin{equation}
\label{ref-004}
\mathrm{cov}_{GK}\left(\matvec{x},\matvec{y}\right)=\left(s_{1}^{*2}- s_{2}^{*2}\right)/4
\end{equation}
where $s_{1}^{*}$ and $s_{2}^{*}$ are robust standard deviations for $\left(\matvec{x}+\matvec{y}\right)$ and $\left(\matvec{x}- \matvec{y}\right)$ respectively. This gives a very simple estimator, as it relies only on the availability of a robust estimator of standard deviation. The principle is also very flexible, in that it can use any robust estimate of scale, including very simple estimators such as MAD$_{\mathrm{e}}$ and more efficient estimators such as Rousseeuw's $Q_{\mathrm{n}}$ \cite{Qn1993}. The breakdown and efficiency follow the properties of the robust scale estimator used. It does, however, suffer from the disadvantage that the magnitude of a calculated $\mathrm{cov}_{GK}$ is not guaranteed to be smaller than the product of the robust standard deviations; essentially because location-dependent weights used in calculating $s_{1}^{*}$ and $s_{2}^{*}$ are generally not the same as the weights used for corresponding data points in calculating $s^{*}\left(\matvec{x}\right)$ and $s^{*}\left(\matvec{y}\right)$. A covariance matrix constructed in this way -- even for two variables -- is therefore not guaranteed to be positive definite
\cite{GK72, OGK02}.
\subsection{Gnanadesikan-Kettenring estimate of correlation (RGK)}
Since $\mathrm{cov}_{GK}$ can lead to invalid covariance estimates, and therefore estimates of correlation outside the admissible range $[-1, 1]$, Gnanadesikan and Kettenring proposed an alternative robust estimator of correlation, here denoted $\mathrm{cor}_{GK}$, which is guaranteed to be in the admissible range. $\mathrm{cor}_{GK}$, for data $\mathbf{x, y}$, is constructed as follows:
\begin{enumerate}[i)]
\item Calculate scaled data $\mathbf{z}_x = \matvec{x}/s^{\mathrm{*}}(\matvec{x})$, $\mathbf{z}_y = \matvec{y}/s^{\mathrm{*}}(\matvec{y})$, where $s^{\mathrm{*}}(.)$ denotes a robust estimate of standard deviation, as before;
\item Calculate robust standard deviations $s_{z+}^{\mathrm{*}}$, $s_{z-}^{\mathrm{*}}$ of $\mathbf{z}_x + \mathbf{z}_y$ and $\mathbf{z}_x - \mathbf{z}_y$ respectively;
\item $\mathrm{cor}_{GK}$ is then calculated as
\begin{equation}
\label{eqn:corGK}
\mathrm{cor}_{GK}(\matvec{x, y}) = \frac{s_{z+}^{\mathrm{*}2} - s_{z-}^{\mathrm{*}2}}{s_{z+}^{\mathrm{*}2} + s_{z-}^{\mathrm{*}2}}
\end{equation}
\end{enumerate}
Since equation \eqref{eqn:corGK} is a difference of (robust) variances divided by their sum, it must always be in the range $[-1, 1]$.
Given $\mathrm{cor}_{GK}$, it is now possible to re-use the original scale estimates $s^{\mathrm{*}}(\matvec{x})$ and $s^{\mathrm{*}}(\matvec{y})$ in the same way as equation \eqref{eqn:covRS} to obtain the covariance estimator:
\begin{equation}
\label{eqn:covRGK}
\mathrm{cov}_{RGK} = \mathrm{cor}_{GK}(\matvec{x, y}){\mathrm{*}}s^(\matvec{x})s^{\mathrm{*}}(\matvec{y})
\end{equation}
where the subscript ``RGK'' denotes that the covariance esimator arises from the Gnanadesikan-Kettenring estimate of correlation $\mathrm{cor}_{GK}$.
Like $\mathrm{cov}_{GK}$, $\mathrm{cov}_{RGK}$ only requires a means of calculating a robust standard deviation; one suggested implementation \cite{Shevlyakov_Smirnov_2016, ShevPas1987} used the simple and well-known $\mathrm{MAD}$ estimator (which does not need scaling for consistency as the scaling factor cancels in \eqref{eqn:corGK}) to form a ``MAD correlation coefficient''.
As for $\mathrm{cov}_{GK}$, the efficiency and breakdown properties for $\mathrm{cov}_{RGK}$ broadly follow those of the robust standard deviation estimator $s^*$ used in \eqref{eqn:covRGK}.
\subsection{Orthogonalized Gnanadesikan-Kettenring estimator \newline (OGK)}
To guarantee a positive definite covariance matrix, Maronna and Zamar \cite{OGK02} proposed an iterative extension of $\mathrm{cov}_{GK}$, denoted $\mathrm{cov}_{OGK}$. The algorithm involves iteratively scaling the variables; constructing an initial correlation matrix $\matvec{U}$ by applying $\mathrm{cov}_{GK}$ (equation~\eqref{ref-004}) to the scaled variables; extraction of the eigenvalues \textbf{e}$_{i}$ of $\matvec{U}$; and use of these and the initial robust standard deviations to form a new covariance estimate. As a side effect of a re-weighting step in the algorithm, Mahalanobis distances are also calculated and available. A full description is beyond the scope of the present paper, but implementations are readily available; in particular in the R {\texttt robustbase} package \cite{robustbase} and the R {\texttt rrcov} package \cite{rrcov-article, rrcov} which, like R itself, are free to use. $\mathrm{cov}_{OGK}$ does require specification of a robust standard deviation (scale) estimator; Maronna and Zamar \cite{OGK02} preferred a ``$\tau$ scale'' estimate proposed by Yohai and Zamar \cite{YohaiZamar1988}, for speed and because it gave better results than ${\mathrm{MAD_e}}$ in simulations. Although computationally more complex, $\mathrm{cov}_{OGK}$ is relatively fast, even for relatively high-dimensional data, and successfully guarantees a valid robust estimate of covariance. Breakdown and efficiency again largely follow the particular estimators chosen in the intermediate $\mathrm{cov}_{GK}$ calculations.
\subsection{Minimum Covariance Determinant (MCD) estimator}
An alternative strategy can be thought of as a multidimensional equivalent of data set truncation to remove extreme values before calculating the usual covariance and then re-scaling, in a manner reminiscent of the use of a trimmed mean or Shorth (``shortest half'', \cite{andrews72}) estimate. An efficient example is the minimum covariance determinant (MCD) estimator proposed by Rousseeuw {\cite{rousseeuw1985-mcd}}. The method finds the subset of $h~(n/2\leq h \le n)$ data points in a set of $n$ that has the classical covariance matrix with the smallest determinant. The process is illustrated in Figure~\ref{ref-033}. Since there are generally $n!/\left[h!\left(n- h\right)!\right]$ subsets of size \textit{h}, this can be slow. A fast algorithm (``FastMCD'' or FMCD) is, however, available \cite{fastMCD} and has been applied successfully to data sets of the order of 10~000 data points; far above the size of typical inter-laboratory data sets. Implementations are available in, for example, the R \texttt{robustbase} \cite{robustbase} and \texttt{rrcov} \cite{rrcov, rrcov-article} packages, and the R \texttt{MASS} package \cite{MASS-book}. The estimator, which we denote $\mathrm{cov}_{MCD}$, has the advantage that the covariance matrix is guaranteed to be positive definite as long as the number of variables is less than $h$, and the centroid of the chosen subset additionally provides a robust estimate of location. The breakdown point, $h/n$, can be as good as 0.5 (as robust as the median) depending on the choice of \textit{h}. Common recommendations are $h=0.5n$ and $h=0.75n$. Efficiency at the normal for MCD (with $h=0.75n$ and reweighting as recommended by Rousseeuw \cite{rousseeuw1985-mcd}) is good, at between about 60\% and 90\% depending on number of variables; lower dimensionality is associated with lower efficiency \cite{CroukHaes1990}.
\begin{figure}
\centering
\subfloat[]{
\includegraphics[width=0.4\textwidth]{image19}
\label{fig:mcd-a}
}
\subfloat[]{
\includegraphics[width=0.4\textwidth]{image20}
\label{fig:mcd-b}
}
\subfloat[]{
\includegraphics[width=0.4\textwidth]{image21}
\label{fig:mcd-c}
}
\caption{Schematic of MCD estimation. The minimum covariance determinant estimate is formed from a multivariate data set \protect\subref{fig:mcd-a} of $n$ data points by \protect\subref{fig:mcd-b} selecting a subset of size \textit{h} (dark grey in \protect\subref{fig:mcd-b}), determining the covariance of the subset, taking the determinant of that covariance matrix, and continuing iteratively to find the subset with the smallest such determinant \protect\subref{fig:mcd-c}. Having found the relevant subset, the covariance is determined and re-scaled, typically to return an unbiased estimate of covariance for multivariate normal data.}
\label{ref-033}
\end{figure}
A practical disadvantage of the MCD estimator is that the number of variables must be less than \textit{h}, or the determinant vanishes for any subset. Although this is not often a problem for bivariate covariance estimation, it can appreciably restrict the application of MCD in inter-laboratory studies of modest size with many measurands. A further practical difficulty -- other than the computational complexity of the FastMCD algorithm -- is that, in our hands, some implementations appeared to be biased low for under about 60 data points, ruling out their use for typical reference material certification studies. Some care must accordingly be taken in choosing the implementation. Of the MCD implementations examined, the implementation in \cite{robustbase} was found to give good results for the modest data set size in the examples shown here.
\section{Experimental}
\subsection{Illustrative data}
To illustrate some applications of robust estimators of covariance, we use two inter-laboratory data sets from a reference material certification exercise, used to certify a drinking water material. Two materials were circulated; a candidate reference material (``RM'') and a performance control material (``QC''). The candidate reference material was a drinking water from a domestic supply, fortified for some elements of interest. The performance control material was made up to similar (but intentionally not identical) levels to the candidate RM by spiking demineralised water. Laboratories measured both materials, results for the QC material being used to check for serious measurement bias. Five replicates were run for the candidate RM; three for the QC material. Summary data (laboratory means) are given in {\hyperref[ref-038]{Table~S1}} and {\hyperref[ref-039]{Table~S2}} (provided as supplementary material). {\hyperref[ref-038]{Table~S1}} gives mean results for potassium, for both materials. {\hyperref[ref-039]{Table~S2}} gives summary results for eight elements for the candidate reference material only; the mean of five replicates is given.
\subsection{Computational methods}
All calculations and plots used R, version 3.4.4 \cite{Rstats}. Youden plots with robust confidence regions were produced using the \texttt{metRology} package for R, version 0.9-28 \cite{metRology}, supported by the \texttt{robustbase} package \cite{robustbase}. Robust PCA used the \texttt{rrcov} package \cite{rrcov}. All computations were performed on an Intel-based PC running an Intel Pentium G3528 running at 3.2~GHz; the operating system was Microsoft Windows 10 Pro.
\section{Applications}
\subsection{Robust confidence regions for Youden plots.}
Youden plots \cite{aoac75} are a convenient graphical means of checking for an important between-laboratory effect in an interlaboratory study. They consist of a scatter plot of laboratory mean observations on two materials. If there is no laboratory effect, these should form an uncorrelated scatter; an important laboratory effect (comparable to or greater than the within-laboratory standard deviation) leads to marked correlation. Although originally proposed for review of data from a split-level design, in which the two materials have very similar concentrations of a given analyte, the plot also works well in most circumstances where two materials are measured using the same procedure and where multiple measurands are determined simultaneously for the same material (for example, simultaneous measurement of multiple elements by ICP-MS). Because of their convenience and simplicity, they are also suggested for review of proficiency testing data \cite{ISO13528-2015}. To confirm whether individual data points can be considered anomalous, the 2005 edition of ISO 13528 additionally suggested the use of confidence ellipses based on rank correlation, on the (obsolete) grounds that ``There is a need for a robust method of calculating the ellipse, but the details of such a method have not yet been worked out.'' (ref. \cite{ISO13528-2005}, sec 8.5.2.1 Note 2).
In this RM study, a QC and candidate RM were circulated and measured. Youden plots of the candidate RM result against the corresponding QC material data were appropriate for inspection.
Before considering Youden plots, it is useful to look at the data from a univariate perspective. Figure~\ref{ref-034} shows data for potassium in both materials. While it is clear that there are several tail outliers, there is no immediate indication of any other anomaly.
Youden plots add a new insight and illustrate the advantage of robust estimates of covariance. Youden plots for the potassium data, with confidence ellipses calculated by four covariance methods, are given in Figure~\ref{ref-035}. In all cases, the ellipses are calculated from the respective covariance estimate using the methods described by Jackson \cite{jacksonIQC, jacksonTech59}; a summary is given in the Annex. Note that these ellipses are constructed to include a given proportion of observations, and not the confidence region for the centroid.
\begin{figure}
\centering
\includegraphics[width=0.8\textwidth]{image22}
\caption{Box plots of mean results for potassium from 25 laboratories for a candidate RM (``RM'') and a performance control material (``QC'') in a reference material characterisation exercise.}
\label{ref-034}
\end{figure}
It is immediately clear from the Youden plots that one laboratory (Lab29) forms a severe correlation outlier, visible at the top left of each plot. This almost certainly arises from confusion in sample labelling, as the values reported would not have been unreasonable for the alternate materials and the laboratory was found to be a similar off-diagonal outlier for several other elements, with the extent of the discrepancy increasing with the difference in concentrations for the two materials.
\begin{figure}[!h]
\centering
\subfloat{\includegraphics[width=0.47\textwidth]{image23} \label{fig:youden-a}}
\quad
\subfloat{\includegraphics[width=0.47\textwidth]{image24} \label{fig:youden-b}}
\subfloat{\includegraphics[width=0.47\textwidth]{image25mad} \label{fig:youden-c}}
\quad
\subfloat{\includegraphics[width=0.47\textwidth]{image26} \label{fig:youden-d}}
\caption{Youden plots of laboratory means for potassium on two materials, with data confidence ellipses at 95\% (dashed line) and 99\% (solid line). The estimators for the covariance were a) classical covariance (equation \eqref{ref-001}; b) Spearman rank correlation with $\mathrm{MAD_e}$ scale; c) Gnanadesikan-Kettenring correlation estimator ($\mathrm{cov}_{RGK}$) with $\mathrm{MAD_e}$ scale; d) orthogonalised Gnanadesikan-Kettenring estimator ($\mathrm{cov}_{OGK}$). Vertical and horizontal lines are drawn through the centroid as calculated by the relevant classical or robust location estimate. Laboratory identifiers are shown for any observation outside the 99\% confidence region.}
\label{ref-035}
\end{figure}
For the purpose of the present paper, however, the effect of the different covariance estimators is of most interest. The ellipse based on classical covariance, denoted a) in the Figure, is clearly substantially inflated by all the outliers. It is also clear from the near-circular confidence ellipse that the correlation (0.04) has been severely reduced by the correlation outlier. Both effects lead to a considerably inflated confidence region. By comparison, all of the robust estimators give much smaller confidence regions and show substantially greater correlation; for this data set, the correlations from Spearman, RGK, OGK and MCD estimators are 0.67, 0.75, 0.81 and 0.86 respectively. For comparison, omitting Lab29 gives a classical correlation of 0.91, in part due to the two marked tail outliers but clearly showing the drastic effect of the off-diagonal observation.
There is less variation among the confidence regions calculated from robust covariance estimators. The Spearman-based $\mathrm{cov}_{RS}$, b) in the Figure, has performed relatively well, and gives a similar region to the Gnanadesikan-Kettenring correlation estimator at c) (both using $\mathrm{MAD_e}$ as scale estimator). In this case, the MCD estimator, with \textit{h} set to 0.5 (not shown in the figure), gives a region almost identical to that from $\mathrm{cov}_{OGK}$ and identifies the same outliers.
For this data set, the conclusions from the different outlier-resistant estimators are reasonably consistent: Laboratory 29 is an extreme case for all estimators; laboratories 27, 20 and 9 should be investigated; and laboratory 2 appears as a marginal 99\% outlier for two of the robust estimators and is barely inside the 99\% region from $\mathrm{cov}_{OGK}$. One other laboratory (not labelled in the plot) shows consistently as a 95\% outlier at the high end of the range and would normally be checked for technical issues, while a second in the same general area is just inside the 95\% region and would probably also merit further investigation.
There are small differences in detail between the different robust estimators. The Spearman-based estimator using $\mathrm{MAD_e}$ scale gave the smallest correlation and consequently the widest of the robust ellipses, perhaps reflecting the Spearman estimator's slight sensitivity to correlation outliers. $\mathrm{cov}_{OGK}$ gave a high correlation resulting in a longer, narrow ellipse, probably due to the use of a scale estimator which is more efficient than $\mathrm{MAD_e}$ at the expense of somewhat greater univariate outlier sensitivity. $\mathrm{cov}_{RGK}$ using $\mathrm{MAD_e}$ scale showed behaviour intermediate between $\mathrm{cov}_{OGK}$ and $\mathrm{cov}_{OGK}$, illustrating a modest improvement in resistance to correlation outliers compared to ${\mathrm{cov}_{RS}}$.
Despite the expected small differences between different robust estimators, however, it is clear from this example that use of a robust region in a Youden plot provides considerably better discrimination of outlying values than the classical covariance.
\section{Robust Mahalanobis distance}
A Mahalanobis distance is a covariance-scaled distance from (usually) a centroid to a particular point in a multivariate data set. It can be thought of as a multivariate analogue of the familiar \textit{z}-score, when the \textit{z}-score divisor is based on the dispersion of the data set. For a vector \textbf{z}$_{i}$, multivariate location ${\upmu}$ and a covariance matrix \textbf{V,} the Mahalanobis distance \textit{d}$_{\mathrm{M}}$ for \textbf{z}$_{i}$ is given by
\begin{equation}
d_{\mathrm{M}}=\sqrt{\left(\mathbf{z}_{i}- \mathbf{\upmu }\right)^{\mathrm{T}}\mathbf{V}^{- 1}\left(\mathbf{z}_{i}- \mathbf{\upmu }\right)}
\label{ref-005}
\end{equation}
In statistical software, Mahalanobis distance is often presented as a squared distance $d_{\mathrm{M}}^{2}$, that is, without taking the square root in eqn. \eqref{ref-005}. Lischer suggested its use in this form for proficiency testing \cite{Lischer1996}, as well as noting the idea of robust variants, though the low efficiency of available robust covariance methods at the time appears to have dictated another approach. When multivariate data with \textit{p} variables arise from a multivariate normal distribution with centroid ${\upmu}$ and covariance matrix \textbf{V,} $d_{\mathrm{M}}^{2}$ is distributed as ${\chi}^{2}$(\textit{p}), giving a simple approximate method of estimating critical values. Given robust estimators for covariance, a robust Mahalanobis distance (RMHD) can be calculated by combining a robust covariance matrix with a robust estimate of location.
The application to inspection of interlaboratory data can be illustrated using the multi-element data set of {\hyperref[ref-039]{Table~S2}}. It is first necessary to decide how to treat the small number of missing values, which are common in inter-laboratory data and which would interfere with both covariance and distance calculations. For inspection purposes, a small proportion of missing values can be replaced with a suitable default value; here, missing values are replaced with the median of the remaining data in each column. This is a very simple form of `imputation'. For reliable statistical inference, more sophisticated processes are recommended, in particular multiple imputation methods \cite{mice2018}, but direct single replacement suffices for inspection.
Figure~\ref{ref-036} compares classical Mahalanobis distances for the data in {\hyperref[ref-039]{Table S2}} with the corresponding RMHD, based (in this case) on $\mathrm{cov}_{OGK}$. Distances are calculated from the data set means in Figure~\ref{ref-036}a) and from medians in Figure~\ref{ref-036}b); the use of medians for location in Figure~\ref{ref-036}a) made no difference to the general findings. The differences are striking. First, the classical variant in Figure~\ref{ref-036}a) shows no marked outlying laboratories. Second, none of the values in Figure~\ref{ref-036}a) is above either of the critical values shown in the plot. By contrast, the range of values is much larger in Figure~\ref{ref-036}b), and there are at least four laboratories which exceed the 99\% critical value, one very substantially so.
\begin{figure}[t]
\subfloat[]{%
\includegraphics[width=0.47\textwidth]{image27}
\label{fig:mhd-a}}
\quad
\subfloat[]{%
\includegraphics[width=0.47\textwidth]{image28}
\label{fig:mhd-b}}
\caption{Classical and robust Mahalanobis distances. \protect\subref{fig:mhd-a} classical Mahalanobis distance and \protect\subref{fig:mhd-b} Robust Mahalanobis distance (RMHD) calculated using the OGK estimate of covariance, for the data in {\hyperref[ref-039]{Table S2}} with simple imputation. Vertical lines show approximate critical values at the 95\% (dashed) and 99\% (solid line) levels of confidence.}
\label{ref-036}
\end{figure}
The interpretation of the RMHD plot in Figure~\ref{ref-036}b) is straightforward. Laboratories 9, 23, 28 and, to a lesser extent, 10, are clearly anomalous and should be inspected in more detail. Inspection of the raw data shows, for example, that Laboratory 9 has a particularly high value for arsenic; laboratory 23 shows outlying values for cadmium and lead and reported no nickel in the sample; and laboratory 28 has reported unusually low values for both manganese and arsenic.
The reason for the poor discrimination shown by the classical estimator in Figure~\ref{ref-036}a) is primarily that multiple outliers for many elements have substantially inflated the covariance estimates, in turn reducing the calculated Mahalanobis distances to a point where they all appear to be within the expected 95\% region for a multivariate normal distribution. By contrast, use of a robust covariance estimator shows several important lines of investigation in a very simple plot.
It is, however, important to bear in mind that the Mahalanobis distance remains a summary statistic across multiple variables. While this can be very helpful in cases of multiple modest deviations leading to an unusual location (such as a modest correlation outlier), it is possible for any summary to conceal important detail. It follows that some additional detailed follow-up for individual, less striking, anomalies is usually prudent.
\section{Robust principal component analysis}
Principal component analysis (PCA) is an important tool for exploratory analysis of multivariate data \cite{chatcol80}. It operates by choosing a set of orthogonal directions which successively represent most variation in the data set as a whole; choosing those directions associated with the largest variation effectively reduces the number of dimensions needed to identify structure in the data. PCA is, however, prone to interference from outlying values in the same way as most other statistical methods; extreme values can dominate variation and distort the principal components. This can, however, be overcome by use of robust estimators for covariance and correlation. This follows because, although PCA can be performed in a number of ways, all the principal components for a given data set can be obtained directly from a correlation or covariance matrix by eigenvector decomposition \cite{chatcol80}. (The use of correlation and covariance in PCA are not equivalent; PCA from a correlation matrix is essentially equivalent to PCA on \textit{z}-scaled data. This gives different principal components. PCA based on correlation is often recommended where variables differ considerably in magnitude). Given a method of obtaining robust estimates of covariance, together with standard tools for eigenvector decomposition, all that is needed to obtain robust principal components is to replace the classical covariance matrix with the robust covariance matrix in the PCA extraction step. Eigenvector extraction is not straightforward, and is best handled by specialised routines; it is not discussed here. Fortunately, reliable implementations are widely available as standard software libraries and in both open source and commercial mathematical and statistical software, making application to inter-laboratory data almost as straightforward as classical PCA.
The utility of robust PCA can be illustrated by application to the data of {\hyperref[ref-039]{Table S2}}. Figure~\ref{ref-037} compares biplots for the first two principal components obtained from classical (Figure~\ref{ref-037}a) and robust (Figure~\ref{ref-037}b) PCA. The robust method used the MCD estimator $\mathrm{cov}_{MCD}$ for covariance; because of the wide range of concentrations, both analyses used scaling by variable.
\begin{figure}[!h]
\centering
\subfloat[]{%
\includegraphics[width=0.47\textwidth]{image29}
\label{fig:pca-a}
}
\quad
\subfloat[]{%
\includegraphics[width=0.47\textwidth]{image30}
\label{fig:pca-b}
}
\caption{Classical and robust PCA for inter-laboratory data. \protect\subref{fig:pca-a} Classical PCA biplot for the first two principal components for the data in Table~S2 constructed from the classical covariance matrix; \protect\subref{fig:pca-b} Biplot for PCA based on a covariance matrix constructed using the MCD estimator. Variables were scaled in both cases. Points (filled circles) show scores on PC1 and PC2 for each laboratory; arrows show the projections of the different variables on the PC1/PC2 plane. Only the outlying laboratories in both plots are labelled.}
\label{ref-037}
\end{figure}
The most striking feature is the difference in apparent dispersion among laboratories. For the classical PCA, laboratories are relatively dispersed, especially along PC2. In the robust plot, the distance to laboratory 9 dwarfs other distances in the diagram, with laboratories 23 and 28 visible at the bottom of the diagram. There are also differences in detail. In the classical PCA plot, laboratories 23 and, to a lesser extent, 26 and 10 appear most distinct. From the biplot, Lab 23 is apparently associated with high cadmium and lead values (as noted above) and low nickel; Lab 26 with high chromium, copper and manganese and low arsenic; Lab 10 approximately mirrors the associations of Lab 23. Lab 9 is not prominent. By comparison, the robust PCA biplot of Figure~\ref{ref-037}b) clearly highlights Lab 9 as a considerable outlier, with Lab 23 and Lab 28 again apparently distinct. Expansion of the central region of Figure~\ref{ref-037}b) (not shown) identifies Lab 10 and (to a lesser extent) Lab 4 as modest outlying points to low left of the majority. This clearly follows the indications given by the robust Mahalanobis plot (Figure~\ref{ref-036}); the important additional information is an indication of the elements likely to be responsible for the anomalous locations. For example, Lab 9's location is apparently associated with very high arsenic. This partially explains why Lab 9 is not obvious in Figure~\ref{ref-037}a), as arsenic does not contribute strongly to the first two classical principal components.
A further difference between the classical and robust PCA is the range of principal component scores, which indicate the relative distance, from a centroid, of a given point along each principal component direction. The classical PCA shows a small range of scores along the first two PCs, which (like the apparently small classical Mahalanobis distances in Figure~\ref{ref-036}a) might be taken to indicate that no values are particularly important. By comparison, scores in the robust PCA show a substantially larger range, more accurately indicating that the outliers are more remote from a central majority than might be expected by chance. Thus, while systematic exploration through different pairwise choices of principal component can generally locate outliers regardless of the use of robust methods, extreme cases appear to stand out more strongly, with more informative PC scores, in robust PCA.
\section{Conclusions}
This paper has briefly drawn attention to a number of robust estimators of covariance and provided illustrations of some applications of robust covariance in the examination of inter-laboratory data, exemplified by a reference material certification exercise. Robust covariance estimators are much less affected by outlying values, in turn providing more reliable estimates of covariance in outlier-contaminated data sets. As a consequence, the use of robust covariance estimators led to substantially clearer diagnostics; anomalies were more readily detected on visual inspection, and critical values based on robust estimates of (co)variance identify important extremes more reliably. There is therefore good reason to include robust covariance estimators, and associated diagnostics, in the inter-laboratory toolkit.
Turning to the most appropriate robust estimator for inspection of inter-laboratory data, among those explored here, the Orthogonalized Gnanadesikan-Kettenring (OGK) estimator seems most generally applicable when a suitable software implementation is available. It provides broadly similar performance to the MCD estimator, offers fewer restrictions on number of variables, and guarantees a positive definite covariance matrix. It also offers a speed advantage over MCD, though in practice this is inconsequential for typical interlaboratory data sets. In the absence of a software implementation of OGK or MCD estimators, the much simpler $\mathrm{cov}_{RGK}$ estimator is a good alternative, particularly for pairwise correlation and covariance; it has useful resistance to correlation outliers and guarantees valid pairwise correlation. In the rare cases where multiple pairwise application of $\mathrm{cov}_{RGK}$ generates an invalid multivariate covariance matrix, the combination of rank correlation and robust standard deviation guarantees non-singular covariance matrix at the expense of somewhat greater susceptibility to off-diagonal ``correlation outliers''.
\section*{Acknowledgements}
Preparation of this paper was supported by the UK Department for
Business, Energy and Industrial Strategy under the
UK National Measurement System Chemical and Biological
Metrology Programme.
The author is additionally grateful to Professor M Thompson (Birkbeck college, London) for helpful comments on an early draft of this manuscript.
\section*{Conflicts of interest}
There are no conflicts of interest to declare.
\bibliographystyle{ieeetr}
| {'timestamp': '2018-11-09T02:14:55', 'yymm': '1810', 'arxiv_id': '1810.02467', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02467'} | arxiv |
\section{Background}
To address the spectrum crisis caused by rapidly growing wireless devices \cite{Akyildiz2006}, the Federal Communications Committee (FCC) allows unlicensed Television Band Devices (TVBDs) to operate in TV white spaces (TVWS) as secondary users (SUs) in the U.S. \cite{2ndOrder}. TVWS is defined as geographical areas where over-the-air TV services are unavailable \cite{2ndOrder}. Under TVWS paradigm, TVBD can access a list of TVWS channels obtained by querying a geolocation database. The geolocation databases calculate TVWS channels by approaches in \cite{5457914} based on the registration information of TV stations and radio propagation models. Since TV stations do not change their status often, geolocation databases only need to be updated on a daily basis, and a secondary user could also query only a few times per day if not roaming. Therefore, workload of a geolocation database can be handled by technology for large website. Actually, such services are provided by Internet companies, such as Google, Microsoft, and Spectrum Bridge.
However, the TVWS approach leaves populated urban areas, where spectrum shortage is most severe, with too few TVWS \cite{5457914,Hessar2014,zhzhao_techreport}, for these areas are also major markets of broadcast TV. As TV receiver feedback becomes essential in the next generation terrestrial TV standard, ATSC 3.0 \cite{Fay2016}, a TV receiver-facilitated TV spectrum sharing paradigm is proposed to exploit the underutilized legacy Over-The-Air TV service areas (TV black-spaces) \cite{Zhao14Globecom,Rempe2017,zhao2017}.
An exemplary network structure of TV black-spaces paradigm is illustrated in Fig.~\ref{fig:cell}, where a secondary user base-station can schedule wireless communication on a list of free TV channels that are not watched by any TV receivers (primary users) in its interference zone. This free channel list is dynamically determined by the behaviors of those TV receivers. The secondary user base-station has to evacuate communication on a TV channel immediately if any TV receiver in its interference zone is tuned in.
Analyses based on empirical data of population, TV stations, TV usage and traffic patterns, show that the TV black-spaces approach can bring several folds increase of available spectrum in major urban areas compared to TVWS approach, meanwhile requires much stricter timing on spectrum management to protect the quality of experience of TV viewers \cite{zhao2017}. It is a challenge to design infrastructures for the timing requirement of spectrum management in the TV black-spaces.
\begin{figure} [h!]
\centering
\subfloat[]{
\includegraphics[height=2in]{./CogTV_Cell_Multiple.png}
\label{fig:cell}
}
\subfloat[]{
\includegraphics[height=1.2in]{./SM_Fully_Centralized.png}
\label{fig:centralized}
}
\subfloat[]{
\includegraphics[height=1.2in]{./SM_Fully_Distributed.png}
\label{fig:distributed}
}
\caption{(a) Cognitive Television (Cog-TV) Cellular Network, (b) Fully Centralized SM (c) Fully Distributed SM.}
\vspace{-0.2in}
\end{figure}
\section{Spectrum Management Infrastructure}
The spectrum management in TV black-spaces includes: receiving feedback from TV receivers when they change channels, update free channel list for a secondary base-station, coordinating neighboring secondary base-stations for spectrum reuse and mobility management. Because of the random individual choices of each TV viewer, the free channel list for each secondary base-station would be different and can be changed at any time. Delay is introduced by network and processing on the chains of TV set feedback, spectrum management, and resource scheduling at local secondary base-station. The real-time constraint is that secondary user must stop transmitting within 0.3 sec once a TV user push the button on the remote.
The optimal solution could be anywhere between fully centralization (Fig.~\ref{fig:centralized}) and fully distribution (Fig.~\ref{fig:distributed}). The benefits of centralization include simplified TV receiver feedback, seamless across-cell coordination, low backhaul bandwidth overhead, and all the typical benefits of cloud computing. Fully distributed solution can reduce the latency for every chain of spectrum management, but would require more backhaul bandwidth consumption for TV set feedback and cross-cell coordination, and higher processing capability at the secondary base-station (cost).
\section{Cyber Physical Systems-Based Approach}
In this project, we aim to find an approach to strike a balance between two extremes through Cyber-Physical Systems (CPS). Parameters of the system include the dimensions of Cog-TV cell, and the characteristics of densities and traffics of TV receivers and secondary users, and network latency, and processing capacity of a spectrum manager processor and/or cluster (unit cost). The output is the number of secondary cells to be managed by a spectrum manager unit, and estimated performance and cost profile.
Based on approach of scheduling in CPS \cite{LiQiao10}, the physical network is modeled as a graph, where each node represent a secondary base-station. A spectrum manager unit is represented by a clique that connecting multiple nodes. The number of nodes in a clique is determined by the processing capacity of the spectrum manager unit, and the processing jobs at spectrum manager unit is modeled as a queueing model. The processing delays is then calculated based on the constraints of processing capacity and cost of the spectrum manager unit. The maximal size of each clique is subjected to the processing delays and network latency, and is constrained by the maximal allowable channel evacuation latency (e.g. 0.3 sec).
Based on the graph and queueing model, metrics of performance (for both TV users and secondary users), and cost of secondary base-station and spectrum manager unit can be calculated as functions of size of clique. Numerical searching or analytical optimization algorithm can be used to find out the optimal size of clique. The results could be a function of traffic load, and thus the degree of centralization could be variable. This dynamic degree of centralization can reduce energy consumption by adaptive the spectrum manager control system to the traffic.
\section{System Model}\label{sec:cps}
We describe the system with a physical model and a cyber model. The physical model includes the events of primary users switching channel (called zapping event), the reactive action of channel evacuation by secondary users, and the latencies in the network and spectrum manager(s) between these two events. The cyber model describes the computational process within a spectrum manager, of which the delay depends on scale of the spectrum manager.
\subsection{Physical Model}\label{sec:cps:phy}
\begin{figure} [h!]
\centering
\vspace{-0.2in}
\subfloat[]{
\includegraphics[width=0.45\linewidth]{./CPS_delay_model.png}
\label{fig:delay:sys}
}
\subfloat[]{
\includegraphics[width=0.45\linewidth]{./CPS_handover_model.png}
\label{fig:delay:su}
}
\vspace{-0.1in}
\caption{(a) Physical Model, (b) Secondary User Delay.}\label{fig:delay}
\end{figure}
We first describe the physical process from the perspective of events, as illustrated in Fig.~\ref{fig:delay:sys}. The first type of event (Event 1) is zapping, which is a TV user initializing a switch of TV channel by pushing a button at his/her remote or TV sets. Event 1 triggers a signaling message being immediately sent to the spectrum manager by the TV set. The message contains the identity of TV set (which indicates its location) and the requested channel, $b$. The message of event 1 is sent to a spectrum manager, which checks if any secondary links in the vicinity of the requesting TV set are currently operating on the requested TV channel $b$. If yes, then the spectrum manager will immediately send a spectrum scheduling command to these secondary links. The spectrum scheduling command contains free channels that the interrupted secondary links could continually operate on. Once the command reaches target secondary link(s), the secondary base-stations (SBS) or base-station(s) will schedule attached secondary user equipments (SUEs) to switch from channel $b$ to a free channel provided by the spectrum manager. After these steps, the second type of event (event 2) happens, that is the secondary users evacuating the channel $b$. Once secondary links on channel $b$ are evacuated, the TV receiver can receive clean TV signal on channel $b$, and start to buffer and decode the TV signals.
From an event 1 to its reactive event 2, there are three types of delays: network latency, response delay of spectrum manager, and the reaction time of secondary link (handover delay), as shown in Fig.~\ref{fig:delay:sys}. Network latency includes the time a signaling message travels from TV user to the spectrum manager, as well as a spectrum scheduling command travels from the spectrum manager to the SBSs in general. Network latency depends on the physical distance between the TV user and spectrum manager, and follows a linear and stochastic model \cite{goonatilake2012}:
\begin{equation}\label{eq:network}
t_N(x) = ax+b + c\;, \text{where } c\sim\mathcal{N}(0,\sigma^2)\;,
\end{equation}
and $x$ is the distance between two ends, and $a$, $b$ are constants. We consider using Internet as the backhaul connecting primary users, secondary users, and the spectrum manager(s). In \cite{goonatilake2012}, the parameters are found to be $a=0.022$, $b=4.862$, and $\sigma^2=0.907$, where $x$ and $\delta(x)$ are in miles and milliseconds, respectively.
The second type of delay is the response time of the spectrum manager between receiving the signaling message of PU and a spectrum scheduling command is sent out to target secondary users, which is further modeled by cyber model in the next section.
The third type of delay is the evacuation time of secondary link, as illustrated by an exemplary process in Fig.~\ref{fig:delay:su}. Suppose the secondary link are operated in a time division mode, which is the alternating downlink and uplink transmissions on channel $b$. The downlink is transmission from secondary base-station (SBS) to secondary user equipment (SUE), and vice versa the uplink. The spectrum scheduling command is always sent to SBS, which is directly connected to the backhaul network. The command however can arrive at an arbitrary time of the normal operating of the secondary link. If a new frame of downlink and uplink already began, (indicated as close of a scheduling window in Fig.~\ref{fig:delay:su}), the SBS will wait until the next downlink and uplink frame. Since the arrival of command and the secondary link are independent, we assume a uniformly distributed random delay $e$ is incurred until a handover process starts. The handover process can be viewed as a conversation between SBS and SUE that include a DL and an UL packets. In the DL packet, the SBS tells SUE to handover from channel $b$ to the next free channel $k$, and ST returns an acknowledge in consequent UL packet. After the UL packet, the SBS and ST stop transmission on channel $b$, which marks a event 2.
As a result, the handover delay is modeled as:
\begin{equation}\label{eq:handover}
t_H = e + f \;,
\end{equation}
where $f$ is the fixed overhead, and $e\sim\mathcal U(0,l_f)$ is a uniform random variable between two frames, where $l_f$ is the frame length.
Since the secondary link interferes the TV receiver, it is only when the secondary link evacuated channel $b$ (event 2), the TV receiver could start to buffer and decode the TV signal on channel $b$. The real-time constraints of the physical model is that time between a zapping (event 1) and according evacuation (event 2), which is the evacuation delay, $\Delta_{e}$, should not exceed an threshold $Pr(\Delta_{e}\leq\Delta_{max}) = O_{max}$, where $O_{max}$ is a prescribed protection probability. For example, the digital TV set usually takes 1-2 seconds to buffer and decode the TV signal before the first frame of image is displayed on the screen \cite{Lee_Reducing_2010}, which is called zapping time. The evacuation delay increases the zapping time, hence degrades the quality of experience (QoE) of the TV user. Assuming a 10-20\% increase of zapping time is acceptable to the TV user, then the evacuation time should be lower than 200ms, $\Delta_{max}\leq200ms$ \cite{Rempe2017,zhao17}.
\subsection{Cyber Model}\label{sec:cps:cyber}
\begin{figure} [h!]
\centering
\subfloat[]{
\includegraphics[height=1.6in]{./CPS_queueing_model.png}
\label{fig:delay:queue}
}
\subfloat[]{
\includegraphics[height=1.3in]{./CPS_relation_SM.png}
\label{fig:delay:db}
}
\caption{Cyber Model at Spectrum Manager: (a) Queueing Model, (b) An Exemplary Interference Relation Database.}\label{fig:cyber}
\end{figure}
The processing of arriving signaling message at the spectrum manager is modeled as a queueing model $M/G/C$, as shown in Fig.~\ref{fig:delay:queue}. The $M/G/C$ queueing model is explained as follows: The arrival process of signaling message triggered by zapping events is assume to follow a Poisson process, denoted by $M$. The arrival rate of zapping events is proportional to the number of TV receivers registered at the spectrum manager, and the activity levels of these TV receivers. The arriving signaling messages is put in a queue, and be processed based on a first-arrive-first-serve rule. There are $C$ servers within the spectrum manager, e.g. multi-core, or cluster, processing these zapping messages. When a job is complete, there are two possible outcomes: either some secondary users need to evacuate the channel, or no secondary user need to evacuate the channel. The latter happens when there already many TV users watching that TV channel the TV user is demanding, or there are no secondary user operating on that TV channel in the protection zone of the TV user. For the former outcome, a spectrum scheduling command will be sent to the affected secondary user. For the latter outcome, the spectrum manager only need to log or update its database. Based on the queueing model in Fig.~\ref{fig:delay:queue}, the processing time of an arriving zapping events is determined by how many active TV receivers is registered at the spectrum manager. The more TV receivers a spectrum manager handles, the longer the waiting time in the queue, and the longer the job processing time.
The job processing time is determined by the numbers of primary users and secondary users the spectrum manager handles due to the size effect of a relational database. The relational database within the spectrum manager, as shown in Fig.~\ref{fig:delay:db}, records the interference relationship between secondary users and primary users. The interference relationship is mainly determined by the physical distance between the secondary and primary users, as well as the radio environments. For each TV receiver, there is a prescribed guard zone, which is a disk centered at the TV receiver, with radius, $r_p$. Any secondary user within the guard zone of the TV receiver is not allowed to transmit on the channel being watched by that TV receiver. Therefore, based on the geolocations of PUs and SUs that are known to the spectrum manager, a relational database can be established. In the exemplary interference database shown in Fig.~\ref{fig:delay:db}, there are N SUs and M PUs, and SUs 1, 2, 5, are in the guard zone of PU 1, and so on. Notice that SUs and PUs are dynamic as they can be added to or removed from the system.
When a spectrum management job is processed, the spectrum manager will first search the interference database for all the SUs that within the guard zone of the requesting PU (of which the identity is included in the signaling message). Then the spectrum manager checks the channels occupied by these selected SUs to see if the channel requested by PU is occupied or not. The time complexity of this process is $\mathcal{O}(M+N)$. If there are SUs need to be evacuated, the spectrum manager need to find out a list of free channels for them to continue their operations. The spectrum manager will search the interference database to find out all the PUs that is interfered by an secondary user, and find out the channels that are not used by those PUs. The time complexity of finding available channel for each interrupted SU link is $\mathcal{O}(M)$. The spatial distribution of SUs is modeled as Poisson Point Process, with density $\lambda_{s}$ \cite{zhao17}. The number of SUs in the guard zone of each TV receiver, $n$, follows a Poisson distribution, with Probability Mass Function (PMF):
\begin{equation}\label{eq:poisson:su}
Pr(n=k)=\frac{(\lambda_{s}\pi r_p^2)^{k}\exp(-\lambda_{s}\pi r_p^2)}{k!}\;.
\end{equation}
Similarly, spatial distribution of TV receives is also modeled as a Poisson Point Process with density $\lambda_{p}$, and the number of PUs in the interference range of a SBS, $m$, also follows a Poisson distribution, with Probability Mass Function:
\begin{equation}\label{eq:poisson:pu}
Pr(m=k)=\frac{(\lambda_{p}\pi r_p^2)^{k}\exp(-\lambda_{p}\pi r_p^2)}{k!}\;,
\end{equation}
The service time of a spectrum management job that involves event 2 can be expressed as:
\begin{equation}
t_p = g(M+N) + gMn + hmn + l\;,
\end{equation}
where $g$ is the unit time consumption for searching an item in the database, $h$ is the unit time of looking up channels occupied by a PU, and $l$ is a random delay caused by internal uncertainty of the computing system, such as scheduling delay of Operating System. In \cite{matalqa2016effect}, the average response time of a query in disk-based database for dataset size of 1,200, 4,800, and 19,000 is reported as 6, 26, and 220 milliseconds, respectively. For telecommunications, fast response is achieved by in-memory database \cite{Jose2013,HZhang15}. For example, IBM solidDB \cite{lindstrom2013ibm}, can reduce the response time from 375 milliseconds in disk-based database to 50 milliseconds, and achieve an average of 1.2 million transactions per second for a dataset of 1 million records. In \cite{Jose2013}, SolidDB is reported to achieve 140,000 transactions per seconds on Flash-backed DRAM storage device.
\section{Scale-based Evacuation Delay Model}\label{sec:model}
The evacuation delay is the sum of network latency in \eqref{eq:network}, spectrum handover delay in \eqref{eq:handover}, and response time of spectrum manager. Since the total time a job spent in the queueing system in Section \ref{sec:cps:cyber} does not have a closed-form, an approximation is found first, then the total evacuation delay is modeled based on the approximated response time.
\subsection{Approximation of Spectrum Manager Response Time}
From the cyber model in Section \ref{sec:cps:cyber}, the service time of each arriving zapping event is proportional to the number of SUs need to be evacuated. The upper bound of evacuated SUs is the number of SUs, $n$, in the guard zone of that TV receiver. For tractability, the service time $t_p$ is approximated to follow an exponential distribution \cite{KIMURA1995,PSOUNIS2005} with a mean of $\tau E(n)$, where $\tau$ is a constant, and $E(n) = \lambda_{s}\pi r_p^2$.
The spectrum manager response time $t_D$ is represented as the total delay of the $M/M/C$ queueing system. The Laplace transform of the PDF of the response time is \cite{giambene2005queuing}
\begin{equation}\label{eq:laplace:td}
T_D(s) = (1-P_C)\frac{\mu}{\mu+s} + P_C\frac{(\mu C-\lambda)\mu}{(\mu C-\lambda+s)(\mu+s)}\;,
\end{equation}
where $P_C$ denotes the Erlang-C formula \cite{giambene2005queuing}:
\begin{equation}\label{eq:erlangc}
P_C = \frac{\frac{C\rho^C}{C!(S-\rho)}}{\sum_{i=0}^{C-1}\frac{\rho^i}{i!}+ \frac{C\rho^C}{C!(C-\rho)}}\;,
\end{equation}
$\lambda$ is the arrival rate, and $\mu$ is the service rate, and the intensity of the arrival process $\rho = \lambda/\mu$. The service rate $\mu=1/{\left(\tau\lambda_{s}\pi r_p^2\right)}$, and the arrival rate can be found by \cite{zhao17}
\begin{equation}
\lambda = \frac{M \phi(t)}{E(B)}\;,
\end{equation}
where $M$ is the number of registered TV sets at the spectrum manager, $E(B)$ is the average channel holding time of TV users \cite{Cha2008}, $\phi(t)$ is the Household Using Television (HUT), which is the ratio of active TV receiver to all TV receivers \cite{zhao17}.
From this approximation, the distribution of response time of the Spectrum Manager is determined by the number of registered TV sets at the spectrum manager $M$, the density of SUs $\lambda_{s}$, size of guard zone $r_{p}$, number of servers at the spectrum manager, average channel holding time $E(B)$, and HUT which represents the activity level of TV users.
\subsection{Distribution of Evacuation Delay}\label{sec:model:total}
The overall evacuation delay of a secondary user, $t_E$, can be modeled as the sum of network latency, $t_N$, response time of spectrum manager, $t_D$, and spectrum handover overhead, $t_H$, as follows:
\begin{equation}\label{eq:sum}
t_E = t_N + t_D + t_H\;.
\end{equation}
Since $t_N$, $t_D$, and $t_H$ are all random variables, the Laplace transform of the PDF of $t_E$ can be expressed as the product of Laplace transform of PDFs of $t_N$, $t_D$, and $t_H$:
\begin{align}
T_E(s) = &T_N(s) T_H(s) T_D(s) \\
= &\exp\left(s(ax+b)+\frac{s^2}{2}\sigma^2\right) + \frac{e^{-sf}-e^{-s(f+l_f)}}{sl_f}
+ (1-P_C)\frac{\mu}{\mu+s} + P_C\frac{(\mu C-\lambda)\mu}{(\mu C-\lambda+s)(\mu+s)} \;.
\end{align}
For fully centralized solutions, the $x$ is considered to be the distance between locations of spectrum manager (e.g. a data center) and the furtherest cities. $a$ and $b$ are constants in the network latency model, $\sigma^2$ is the variance of random component $c$ in the network latency model. $f$ is the fixed time consumption of spectrum handover, $l_f$ is the frame length in the air interface protocol. For regional spectrum manager located in the city where TV users under its charge, $x=0$.
The scale of of PUs and SUs handled by a single spectrum manager also determines the distribution of physical distances between the PUs and spectrum manager. Since we consider the guard zone of PU is small (within hundreds of meters), for regional spectrum manager, the distance between secondary link and spectrum manager is assumed identical to the distance between PU and the spectrum manager. However, if a fully distributed solution is employed, the distance between SBS and spectrum manager is 0, and $N=1$.
\section{Numerical Evaluation}\label{sec:eval}
We evaluate 4 solutions based on assumed and collected parameters of aforementioned network latency model, frame length, and evacuation model. The four solutions are:
\begin{itemize}
\item Fully distributed solution where each secondary access point handles the spectrum management functionality for itself. The number of processors of spectrum manager is set to 1.
\item Regional Centralization, where a spectrum manager taking care of all the TV receivers in the city it located in. The number of processors in the spectrum manager is assumed to be 32.
\item National Centralization, where a single spectrum manager located in Lincoln, Nebraska (approximately the geometric center of continental U.S.) taking care of all the TV receivers in the U.S. The number of processors in the spectrum manager is assumed to be 100,000, since it might be a data center.
\item Semi-National Centralization, where 50 individual spectrum managers co-located in Lincoln, Nebraska, taking care of all the TV receivers in the U.S. Each spectrum managers only take care of at most 1 million TV receivers. The number of processors is assumed to be 10,000 for each individual spectrum manager.
\end{itemize}
Based on the statistics of network delay from Internet Service Providers \cite{windstream17,verizon17,att17}, we consider the average round trip latency from coastal cities to Lincoln is 25 ms, and the average round trip latency within the same city as 3ms. The variance of network latency is $\sigma^2=0.907$. The database response time is considered to be 6--50ms when the records in the database is equal to or less than 1 million. The Over-The-Air TV ownership rate is set to 14\%. A city of 8 million population (1.12 million Over-The-Air TV receivers) is considered for the regional spectrum manager case. National wide, the number of Over-The-Air TV receivers is then 44.8 million. The TV usage level is considered to vary from 5\% to 60\% from the middle night to prime time in a typical day. We assume that on average there are 10 to 200 secondary users in the guard zone (radius of 130 meters) of each primary user. The frame length of the communication protocol is assumed to be 20 ms, which is the maximum frame length of WiFi network. As a result, in this evaluation, the spectrum handover overhead of secondary link follows uniform distribution, $t_H\sim\mathcal{U}(20ms, 40ms)$.
\begin{table*}[!t]
\renewcommand{\arraystretch}{1}
\vspace{-0.1in}
\caption{Summary of Average Channel Evacuation Time of Four Levels of Centralization}
\label{tab:summary}
\centering
\begin{tabular}{|c||c|c|c|c|c|}
\hline
Centralization & No. of Processor & No. of TV Receivers & Network Latency & SM response time & Evacuation Time \\ \hline\hline
Fully Distributed & 1 & $\leq130$ & 2 ms & 10 ms & 35 to 55 ms \\ \hline
Regional Centralization & 32 & 1.12 million & 5 ms & 120 ms & 155 ms \\ \hline
National Centralization. & 100,000 & 45 million & 25 ms & 2000 ms & 2060 ms \\ \hline
Semi-National Centralization & 10,000 & 1 million & 25 ms & 120 ms & 180 ms \\ \hline
\end{tabular}
\end{table*}
\subsection{Fully Distribution}
In the fully distributed scenario, the average network latency is 3ms. In this case, the number of registered TV receivers at each spectrum manager (in this case an individual secondary access point) is less than or equal to 130. This means that the relational database at the spectrum manager has at most a few hundred records. The response time of this tiny relational database will be fastest, 10 ms. Based on these conditions, we can find the average evacuation time for the fully distributed spectrum manager is 32 to 55 ms.
\subsection{Regional Centralization}
In the regional centralization scenario, we assume that one spectrum manager located inside the city handles all the TV receivers in a city. In this setting, the number of TV receivers is assumed to be 1.12 million. The number of secondary users in the guard zone of TV receiver is 10-200. The spectrum manager is assumed to be a small workstation, which has 32 processors. We assume that the spectrum manager use in memory database which has the fastest response among all the database solutions. The response time of a single query is 6ms, and the response time average job will handle 200 records, with the probability of 0.1 for secondary users to evacuate the channel. Therefore, each job at the spectrum manager that will issue evacuation instruction will take about $120=6\times200\times0.1$ ms. The average evacuation time $t_E$ is 155 ms in regional centralized spectrum manager.
\subsection{National Centralization}
For the national centralization, the average network delay from the spectrum manager to coastal cities is 25ms. The number of TV receivers in the interference relation database is 45 million. The number of secondary users in the guard zone of TV receiver is 10-200. With database of 45 million records, the response time of individual query will be longer, 100 ms. The job at the spectrum manager that will issue channel evacuation instruction will take $2000=100\times200\times0.1$ ms.
\subsection{Semi-National Centralization}
Finally, we look at the semi-national centralization solution. The network latency is the same as national centralization scenario, which is 25 ms round trip latency. The difference is that the size of the interference relation database at each individual spectrum manager is limited to 1 million records. Therefore, an individual database query will be responded in shorter time, which is the same as the regional centralization case, $120$ ms. The average evacuation time is then 180 ms, which is longer than the regional centralization scenario due to additional network latency.
The average evacuation time in the four centralization scenarios is summarized in Table \ref{tab:summary}.
\section{Conclusion}
Through a preliminary analysis of the four architecture of spectrum manager in TV set-assisted spectrum sharing, we find that except the fully centralization, the solutions of fully distributed, regionally centralized, and semi-nationally centralized spectrum manager can all meet the real-time requirement of evacuating the TV channels for TV user within 200-300 ms. From the operational perspective, semi-national centralized solution provides best privacy protection of TV users, as well as all the benefit of cloud computing in terms of maintenance, management, energy consumption, and reduced cost of secondary access point.
Future research may include verification of the assumed response time, distribution of network latency, and evaluate the analytical model. The preliminary analysis presented in this paper only include the average latency. Future research should include distributions of the evacuation time, and evaluate if the distribution meet the regulatory requirement. Finally, we also should consider the failure rate of Internet. In this case, centralized solution might be in disadvantage compared to fully distributed solution.
\section*{Acknowledgment}
This work is supported by National Science Foundation under grant number NSF CNS-1247941 and CNS-1247914. The author would also thank Dr. Justin M. Bradley and Dr. Mehmet C. Vuran for their invaluable guidance on this technical report.
\bibliographystyle{IEEEtran}
| {'timestamp': '2018-10-24T02:19:19', 'yymm': '1810', 'arxiv_id': '1810.02474', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02474'} | arxiv |
\subsubsection{Acknowledgements.}
The authors gratefully acknowledge support by Smiths Heimann GmbH.
}
{\small
\bibliographystyle{splncs04}
\section{Conclusion}
\label{sec:conclusion}
In this paper we have introduced MX-RCNN, a multi-view end-to-end trainable object detection pipeline for X-ray images.
MX-RCNN is a two stage detector similar to Faster R-CNN \cite{Ren2017} that extracts features from all views separately using a standard CNN backbone and then fuses these features together to shape a 3D representation of the object in space.
This fusion happens in a novel multi-view pooling layer, which combines all individual features leveraging the geometry of the X-ray imaging setup.
An experimental analysis on a dataset of carry-on luggage containing glass bottles and hand guns showed that when trained with the same annotations, MX-RCNN outperforms Faster R-CNN applied to each view separately and is computationally cheaper than separate processing of all views.
We also showed in an ablation study that the method works by far better when the view angles do not all fall in one line (degenerate 3D case), showing that the pipeline is indeed leveraging its 3D feature representation.
\section{Multi-view X-ray R-CNN}
\label{sec:theory}
We build on the standard Faster R-CNN object detection method \cite{Ren2017}, which works on single-view 2D images and is composed of two stages.
They share a common feature extractor, which outputs a feature map.
The first stage consists of a Region Proposal Network (RPN) that proposes regions of interest to the second stage.
Those regions are then cut from the feature map and individually classified.
The RPN uses a fixed set of 9 standard axis-aligned bounding boxes in 3 different aspect ratios and 3 scales, so-called anchor boxes.
Those anchor boxes are defined at every location of the feature map.
The RPN then alters their position and shape by learning regression parameters in training.
Additionally, a score to distinguish between objects and background is learned in a class-agnostic way, which is used for non-maximum suppression and to pass only a subset of top-scoring region proposals to the second stage.
The second stage classifies the proposals and outputs additional regression values to fine-tune the bounding boxes at the end of the detection process.
\subsubsection{MX-RCNN.} The basic concept of our Multi-view X-ray R-CNN (MX-RCNN) approach is to perform feature extraction on 2D images to be able to utilize standard CNN backbones including ImageNet \cite{Russakovsky2015} pretraining.
This addresses the fact that the amount of annotated X-ray data is significantly lower than that of photographic images.
We then combine the extracted feature maps of different projections, or views, into a common 3D feature space in which object detection takes place, identifying 3D locations of the detected objects.
\begin{figure}[t]
\centering
\includegraphics[width=\linewidth]{img/faster_r-cnn_graph_mv.pdf}
\caption{\emph{Schema of the hybrid 2D-3D MX-RCNN architecture.} The features of each view are extracted independently in 2D and combined in the multi-view pooling layer (\emph{marked in red}). The resulting common 3D feature volume is passed to the RPN and to the RoI pooling layer where regions are extracted for evaluation in the 3D R-CNN layers.}
\label{fig:faster-rcnn}
\end{figure}
Our MX-RCNN uses a ResNet-50 \cite{He2016} architecture, where the first 4 out of its 5 stages are used for feature extraction on the 2D images.
Then a novel multi-view pooling layer, provided with the fixed geometry of the imaging setup, combines the feature maps into a common 3D feature volume.
The combined feature space is passed to a RPN, which has a structure similar to the RPN in Faster R-CNN \cite{Ren2017}, but with 3D convolutional layers instead of 2D ones.
Further, it has \(6 \times A\) regression parameter outputs per feature volume position, where \(A\) is the number of anchor boxes, because for 3D bounding boxes 6 regression parameters are needed.
Following Faster R-CNN, we define those regression parameters as
\begin{equation}
\begin{aligned}
t_x &= \nicefrac{(x-x_a)}{w_a} \quad& t_y &= \nicefrac{(y-y_a)}{h_a} \quad& t_z &= \nicefrac{(z-z_a)}{d_a} \\[.5em]
t_w &= \log(\nicefrac{w}{w_a}) \quad& t_h &= \log(\nicefrac{h}{h_a}) \quad& t_d &= \log(\nicefrac{d}{d_a}) \;,
\end{aligned}
\end{equation}
where the index \(a\) denotes the parameters of the anchor box and with bounding box center (\(x\), \(y\), \(z\)), width \(w\), height \(h\), and depth \(d\).
The RPN proposes volumes to be extracted by a Region-of-Interest pooling layer with an output of size 7\(\times\)7\(\times\)7 to cover a part of the feature volume similar in relative size to the 2D case.
The 3D regions are then fed into a network similar to the last stage of ResNet-50 in which all convolutional and pooling layers are converted from 2D to 3D and the size of the last pooling kernel is adjusted to fit the feature volume size.
In contrast to the 2D stages, these 3D convolutions are trained from scratch since ImageNet pretraining is not possible.
Afterwards, the regions are classified and 3D bounding box regression parameters are determined.
A schema of our MX-RCNN is depicted in \cref{fig:faster-rcnn}.
\subsection{K-means clustering of anchor boxes}
When we expand the hand-selected aspect ratios of the Faster R-CNN anchor boxes of 1:1, 1:2, and 2:1 at 3 different scales to 3D, we arrive at a total of 21 anchor boxes.
Since this number is large and limits the computational efficiency, we aim to improve over these standard anchor boxes.
To that end, we assess the quality of the anchor boxes as priors for the RPN.
Specifically, we use their intersection over union (IoU) \cite{Jaccard1912} with the ground-truth annotations of the training set.
We instantiate anchor boxes at each position of the feature map used by the RPN and for each ground-truth annotation we find its highest IoU with an anchor box.
For the standard anchor boxes expanded to 3D, this yields an average IoU of 0.5.
To improve upon this while optimizing the computational efficiency, we follow the approach of the YOLO9000 object detector \cite{Redmon2016} and use $k$-means clustering on the bounding box dimensions (width, height, depth) in the training set to find priors with a better average overlap with the ground-truth annotations.
We employ the Jaccard distance \cite{Jaccard1912}
\begin{equation}
d_\mathrm{J}(a, b) = 1 - \mathrm{IoU}(a, b)
\end{equation}
between boxes \(a\) and \(b\) as a distance metric.
We run $k$-means clustering for various values of \(k\).
\cref{fig:k-means} shows the average IoU between ground-truth bounding boxes and the closest cluster (\textit{blue, circles}).
To convert clusters into anchor boxes, they have to be aligned to the resolution of a feature grid.
To account for this, we also plot the IoU between the ground-truth bounding boxes and the closest cluster once it has been shifted to the nearest feature grid position (\textit{red, diamonds}).
We choose \(k=10\), which achieves an average IoU of 0.56 for the resulting anchor boxes distributed in a grid.
This is clearly higher than using the standard 21 hand-selected anchor boxes, while maintaining the training and inference speed of a network with only 10 anchor boxes.
\begin{figure}[t]
\centering
\includegraphics[height=4.5cm]{img/k-means_clustering.pdf}
\caption{\emph{Average IoU between ground-truth boxes and the closest cluster from $k$-means clustering as a function of $k$.} The IoU is calculated for anchor boxes centered on the ground-truth boxes (\textit{blue, circles}) and for anchor boxes distributed in the grid of the feature map (\textit{red, diamonds}). Even a low number of clusters already outperforms the standard hand-selected anchor boxes (IoU of 0.5).}
\label{fig:k-means}
\end{figure}
\subsection{Multi-view pooling}
Our proposed multi-view pooling layer maps the related feature maps of the 2D views of an X-ray recording into a common 3D feature volume by providing it with the known geometry of the X-ray image formation process in the form of a weight matrix.
To determine the weights, we connect each group of detector locations related to one pixel in the 2D feature map to their X-ray source to form beams across the 3D space.
For each of the output cells of the 3D feature volume, we use the volume of their intersection with the beams normalized by the cell volume as relative weight factors.
The multi-view pooling layer then computes the weighted average of the feature vectors of all beams for each output cell, normalized by the number of views in each X-ray recording; we call this variant MX-RCNN\textsubscript{avg}.
Additionally, we implemented a version of the multi-view pooling layer that takes the maximum across the weighted feature vectors of all beams for each output cell; we call this variant MX-RCNN\textsubscript{max}.
An example of a mapping, specific to our geometry, is shown in \cref{fig:mv-pooling}.
\begin{figure}[t]
\centering
\includegraphics[height=6cm]{img/featuremapping_rand.pdf}
\caption{Example plot illustrating the relevant beams (\textit{color-coded per view}) in the multi-view pooling of a specific output cell (\textit{marked in red}). The actual geometry differs slightly.}
\label{fig:mv-pooling}
\end{figure}
\subsection{Conversion of IoU thresholds}
\label{subsec:iou-conversion}
Since the IoU in 3D (volume) behaves differently than in 2D (area), we aim to equalize for this.
Specifically, we aim to apply the same strictness for spatial shifts that are allowed per bounding box dimension such that a proposed object is still considered a valid detection.
We assume that the prediction errors of the bounding box regression values are equally distributed across all dimensions.
For simplicity, we further assume that errors are only made up of shifts compared to the ground-truth bounding boxes.
In 2D, the allowed relative shift \(s\) per dimension of a bounding box of arbitrary dimensions for an IoU threshold of \(t_2\) is given by
\begin{equation}
s(t_2) = 1 - \sqrt{\nicefrac{2 t_2}{(t_2 + 1)}} \;.
\end{equation}
The same relative shift applied to an arbitrarily sized 3D bounding box would require the threshold
\begin{equation}
t_3(s) = \nicefrac{(1-s)^3}{(2-(1-s)^3)} \;.
\end{equation}
An IoU threshold \(t_2\) applied to the 2D case therefore becomes
\begin{equation}
t_3(t_2) = \frac{\sqrt{\nicefrac{2 t_2}{(1+t_2)}}^3}{2 - \sqrt{\nicefrac{2 t_2}{(1+t_2)}}^3}
\end{equation}
for use with 3D bounding boxes if the same strictness per dimension is to be maintained.
The evaluation of the \textsc{Pascal} VOC challenge \cite{Everingham2010} for detection in 2D images uses a standard threshold of 0.5, which yields a threshold of 0.374 in the 3D detection case.
\subsection{Computational cost}
Our single-view Faster R-CNN implementation reaches a frame rate of \unit[3.9]{fps} for training and \unit[6.1]{fps} for inference on a NVIDIA GeForce GTX Titan X GPU.
4 frames or images need to be processed for one complete X-ray recording.
Our MX-RCNN achieves frame rates of \unit[4.6]{fps} for training and \unit[7.6]{fps} for inference; note that it can share work across the 4 frames as they are processed simultaneously.
Thus, our method is 18\% faster in training and 25\% faster in inference.
We attribute this to the lower number of regions extracted per recording, because of the common classification stage in the multi-view detector, despite the higher computational costs for its 3D convolutional layers.
\section{Related Work}
Inspired by the impressive results in 2D object detection, several recent works \cite{tulsiani:2015:viewpoint,xiang:2015:3dvp,Xiang:2017:subcnn,mousavian:2016:3ddeepbox} build upon a 2D detection in an image and then attempt to estimate the 3D object pose.
These methods, however, rely predominantly on a set of prior constraints such as objects being located on the ground for estimating the 3D position of the object.
These prior constraints do not appear easily extensible to our problem case, since objects inside bags can take an arbitrary orientation and position.
Other approaches have tried to work directly with depth data \cite{song:2014:sliding,song:2016:deepsliding,li:2016:3dfcn}, where most methods voxelize the space into a regular grid and apply 3D convolutions to the input.
While this yields the most straightforward extension of well-proven 2D detectors, which are based on 2D convolution layers, increasing the dimensionality of convolution layers can only be done at very low resolution as denser voxelizations of the space result in unacceptably large memory consumption and processing time.
Our method also uses the idea of 3D convolutions but defers them to very late stages in which we switch from 2D to 3D.
In doing so, we enable the detector to leverage high image resolution in the input while extracting powerful features that leverage view-consistency.
A number of methods use the geometry of the objects as prior knowledge to infer a 6-DoF object pose.
These methods mainly rely on CAD models or ground truth 3D object models and match either keypoints between these models and 2D images \cite{aubry:2014:seeing3d,romea:2011:moped,zhu:2014:grasping} or entire reconstructed objects \cite{rothganger:2006:affine}.
Borrowing ideas from robotics mapping, the estimated pose of an object produced by a CNN can also be aligned to an existing 3D model using the iterative closest points (ICP) algorithm \cite{gupta:2015:align}.
Hang \textit{et al}. \cite{hang:2015:shape} proposed a method most closely related to ours, which aggregates features extracted from multiple views of a scene using an elementwise max operation among all views.
Yet, unlike our multi-view pooling layer this aggregation is not geometry-aware.
Despite the recent focus on the problem of visual object detection, its application to X-ray images has not received as much attention.
Some older methods \cite{Franzel2012,Bastan2015} exist for this application, but they perform considerably weaker than deep learning-based methods \cite{Akcay:2016:tlxray}.
However, the use of CNNs on X-ray images for baggage inspection has been limited to the direct application of basic 2D detection algorithms, either with pretraining on photographic images or training from scratch.
Jaccard \textit{et al}. \cite{Jaccardicdp} propose a black-box approach to multi-view detection by extracting CNN features from all views, concatenating them, and feeding them to fully-connected layers.
Yet, the accuracy fell short of that of the original single-view detection.
To the best of our knowledge, there exists no previous end-to-end learning approach that successfully uses the geometry of the X-ray machine to perform a fusion of features from various views.
\section{Introduction}
\label{sec:introduction}
Baggage inspection using multi-view X-ray imaging machines is at the heart of most aviation security screening programs.
Due to inherent shortcomings in human inspection arising from gradual fatigue, occasional erroneous judgments, and privacy concerns, computer-aided automatic detection of dangerous goods in baggage has long been a sought-after goal \cite{mery:2016:modern}.
However, earlier approaches, mostly based on hand-engineered features and support vector machines, fell far short of providing detection accuracy comparable to human operators, which is critical due to the sensitive nature of the task \cite{Franzel2012,Bastan2015}.
Thanks to recent advances in object detection using deep convolutional neural networks \cite{Ren2017,Girshick2015,Girshick2016,Redmon2016} with stunning success in photographic images, the accuracy of single-view object detection in X-ray images has improved significantly \cite{Jaccardicdp}.
Yet, most X-ray machines for baggage inspection provide multiple views (two or four views) of the screening tunnel.
An example of this multi-view data is shown in \cref{fig:scan}.
Multi-view approaches for these applications have been only used in the context of classical methods, but whether CNN-based detectors can benefit is unclear.
In fact, \cite{Jaccardicdp} found that a naive approach feeding features extracted from multiple views simultaneously to a fully-connected layer for detection leads to a performance drop over the single-view case.
Fueled by applications such as autonomous driving, 3D object detection has lately gained momentum \cite{geiger:2012:kitti}.
These 3D detection algorithms, unlike their 2D counterparts, are not general purpose and rely on certain sensor combinations or employ heavy prior assumptions that make them not directly applicable to multi-view object detection in X-ray images.
Some of these 3D detection algorithms assume that the shape of the desired object is known in the form of a 3D model \cite{aubry:2014:seeing3d,romea:2011:moped}.
Yet, 3D models of objects are more difficult to acquire compared to simple bounding box annotations and a detector that relies on them for training may not generalize well on objects with highly variable shape such as handguns.
Other methods use point clouds from laser range finders alone or in conjunction with RGB data from a camera \cite{qi:2018:frustum,chen:2017:mv3d}.
Our setup, in contrast, provides multi-view images of objects in a two channel (dual-energy) format, which is rather different from stereo or point cloud representations.
Using 3D convolutions and directly extending existing 2D methods is one possibility, but the computational cost and memory requirements can be prohibitive when relying on very deep CNN backbone architectures such as ResNet \cite{resnet}.
In this work, we extend the well-known Faster R-CNN \cite{Ren2017} to multi-view X-ray images by employing the idea of late fusion, which enables our use of very deep CNNs to extract powerful features from each individual view, while deriving region proposals and performing the classification in 3D.
We introduce a novel \emph{multi-view pooling layer} to enable this fusion of features from single views using the geometry of the imaging setup.
This geometry is assumed fixed all through training and testing and needs to be calculated once.
We do not assume further knowledge of the detected objects as long as we have sufficient bounding box annotations in 2D.
We show that our method, termed \emph{MX-RCNN}, is not only highly flexible in detecting various hazardous object categories with very little extra knowledge required, but is also considerably more accurate while even being more efficient than performing single-view detection in the four views.
\begin{figure}[t!]
\centering
\fbox{\includegraphics[width=2.75cm,height=1.858cm]{img/ex1_v0.png}}\hspace{-\fboxrule}%
\fbox{\includegraphics[width=2.75cm,height=1.858cm]{img/ex1_v1.png}}\hspace{-\fboxrule}%
\fbox{\includegraphics[width=2.75cm,height=1.858cm]{img/ex1_v2.png}}\hspace{-\fboxrule}%
\fbox{\includegraphics[width=2.75cm,height=1.858cm]{img/ex1_v3.png}}%
\caption{An example of multi-view X-ray images of hand luggage containing a glass bottle.}%
\label{fig:scan}
\end{figure}
\section{Multi-view X-Ray Dataset}
\label{sec:dataset}
Lacking a standardized public dataset for this task, we leverage a custom dataset\footnote{Unfortunately, we are not able to release the dataset to the public. Researchers wishing to evaluate on our dataset for comparison purposes are invited to contact the corresponding author.} of dual-energy X-ray recordings of hand luggage made by an X-ray scanner used for security checkpoints.
The X-ray scanner uses line detectors located around the tunnel through which the baggage passes.
Its pixels constitute the $x$-axis in the produced image data while the movement of the baggage, respectively the duration of the X-ray scan and the belt speed, define the $y$-axis of the image.
Each recording consists of four different views, three from below and one from the side of the tunnel the baggage is moved through.
The scans from each view produce two grayscale attenuation images from the dual-energy system, which are converted into a false-color RGB image that is used for the dataset.
This is done to create images with 3 color channels that fit available models pretrained on ImageNet-1000 \cite{Russakovsky2015}.
An example recording is shown in \cref{fig:example-imgs}.
\begin{figure}[t]
\centering
\subfloat[Bottom left view]{
\fbox{\includegraphics[height=3cm]{img/ex2_v0.png}}
} \qquad
\subfloat[Bottom right view]{
\fbox{\includegraphics[height=3cm]{img/ex2_v1.png}}
} \\
\subfloat[Right side view]{
\fbox{\includegraphics[height=3cm]{img/ex2_v2.png}}
} \qquad
\subfloat[Bottom center view]{
\fbox{\includegraphics[height=3cm]{img/ex2_v3.png}}
}
\caption{\emph{False-color images of all views of an example X-ray recording of baggage containing a handgun.} The handgun is easier to spot in certain images depending on their angle of projection. Bounding boxes show the original 2D annotations (\textit{black}) and the reprojected 3D annotations (\textit{red}).}
\label{fig:example-imgs}
\end{figure}
The following types of recordings are available in the dataset: \\
\textbf{Glass Bottle.} Recordings of baggage containing glass bottles of different shapes and sizes. \\
\textbf{TIP Weapon.}
Synthetic recordings of baggage where a pre-recorded scan of a handgun is randomly projected onto a baggage recording by a method called Threat Image Projection (TIP) \cite{TIPSmiths}. A limited set of handguns is repeatedly used to generate all recordings. \\
\textbf{Real Weapon.} Recordings that contain a handgun of various types and are obtained using a conventional scan without the use of TIP. \\
\textbf{Negative.} Recordings containing neither handguns nor glass bottles.
The synthetic TIP images are only used for training and validation; the complete scans with real weapons are used for testing to evaluate if the trained network generalizes.
A detailed overview of the different subsets of the data is given in \cref{tbl:dataset}.
The dataset is split into its subsets such that views belonging to one and the same recording are not distributed over different subsets.
\textsc{Pascal} VOC-style annotations \cite{Everingham2010} with axis-aligned 2D bounding boxes per view are available for two different classes of hazardous objects, \textit{weapon} and \textit{glassbottle}.
\begin{table}[t]
\caption{Number of recordings (images) in the different subsets of the dataset.}
\label{tbl:dataset}
\centering
\newcommand{\hspace{.5\tabcolsep}}{\hspace{.5\tabcolsep}}
\begin{tabular}{@{}l@{\hspace{1cm}}r@{\hspace{.5\tabcolsep}}lr@{\hspace{.5\tabcolsep}}lr@{\hspace{.5\tabcolsep}}lr@{\hspace{.5\tabcolsep}}l@{}}
\toprule
Type / Subset & \multicolumn{2}{c}{Train} & \multicolumn{2}{c}{Validation} & \multicolumn{2}{c}{Test} & \multicolumn{2}{c}{Total} \\
\midrule
Glass Bottle & 358 & (1432) & 40 & (160) & 209 & (836) & 607 & (2428) \\
TIP Weapon & 1944 & (7776) & 216 & (864) & 0 & (0) & 2160 & (8640) \\
Real Weapon & 0 & (0) & 0 & (0) & 464 & (1856) & 464 & (1856) \\
Negative & 0 & (0) & 0 & (0) & 950 & (3800) & 950 & (3800) \\
\midrule
Total & 2302 & (9208) & 256 & (1024) & 1623 & (6492) & 4181 & (16724) \\
\bottomrule
\end{tabular}
\end{table}
\subsection{3D bounding box annotations}
\label{subsec:generation}
To be able to train and evaluate our multi-view object detection with 3D annotations, we generate those out of more commonly available 2D bounding box annotations.
Specifically, we generate axis-aligned 3D bounding boxes from several axis-aligned 2D bounding boxes.
Because all our X-ray recordings have at most one annotated object,\footnote{
The number of annotated objects is a restriction of the dataset only;
our detector is able to handle multiple objects per image.}
there is no need to match multiple annotations across the different views.
In case of multiple annotated objects per image, a geometrically consistent matching could be used.
Recall the specific imaging setup from above.
If we now align the 2D $y$-axis (belt direction) to the 3D $z$-axis, the problem of identifying a suitable 3D bounding box reduces to a mapping from the 2D $x$-axis to a $xy$-plane in 3D.
The lines of projection between the X-ray sources and the detectors corresponding to the $x$-axis limits of the 2D bounding boxes define the areas where the object could be located in the $xy$-plane per view.
We intersect those triangular areas using the Vatti polygon clipping algorithm \cite{Vatti1992} and choose the minimum axis-aligned bounding box containing the resulting polygon as an estimation of the object's position in 3D space.
For the $z$-axis limits of the 3D bounding box, we take the mean of the $y$-limits of the 2D bounding boxes.
An example of the generation process is shown in \cref{fig:3D-bboxes}.
Note that while our process of deriving 3D bounding boxes is customized to the baggage screening scenario, analogous procedures can be defined for more general imaging setups.
Note that in the ideal case, all projection lines would intersect in the 4 corners of the bounding box.
However, due to variances in the annotations made independently for each view, this does not hold in practice.
As a result, the bounding box enclosing the intersection polygon is an upper bound of the estimated position of the object in 3D space.
We thus additionally project the 3D bounding boxes back to the 2D views to yield 2D bounding boxes that include the geometry approximation made in the generation of the 3D bounding box.
The difference between an original 2D annotation and a reprojected 3D bounding box can be seen in \cref{fig:example-imgs}.
We use these 2D annotations to train a single-view Faster R-CNN as a baseline that assumes the same object localization as the multi-view networks trained on the 3D annotations.
If more precise 3D bounding boxes are desired, they could be obtained from joint CT and X-ray recordings, which are becoming more common in modern screening machines.
\begin{figure}[t]
\centering
\includegraphics[height=6cm]{img/3D-bboxes_rand.pdf}
\caption{\emph{Example of the 3D bounding box generation.} The lines of projection (\textit{color-coded per view}) for the 2D bounding box positions overlap in the $xy$-plane of the 3D volume. The resulting polygon of their intersection (\textit{pink}) is enclosed by the 3D bounding box (\textit{red}). The actual geometry differs slightly.}
\label{fig:3D-bboxes}
\end{figure}
\section{Experiments}
\label{sec:experiments}
\subsection{Training}
We scale all images used for training and evaluation by a factor of 0.5 so they have widths of 384, 384, 352, and \unit[416]{px} for the views 0 through 3 of each X-ray recording.
For all experiments we use a ResNet-50 \cite{resnet} with parameters pretrained on ImageNet-1000 \cite{Russakovsky2015}.
The first two stages of the ResNet-50 are fixed and we fine-tune the rest of the parameters.
If not mentioned otherwise, hyper-parameters remain unchanged against the standard implementation of Faster R-CNN.
All networks are trained by backpropagation using stochastic gradient descent (SGD).
As a baseline we train a standard implementation of single-view Faster R-CNN on the training set without data augmentation.
Single-view Faster R-CNN detects objects on all views independently.
We start with a learning rate of 0.001 for the first 12 epochs and continue with a rate of 0.0001 for another 3 epochs.
For training and evaluation of our MX-RCNN, we use a mini-batch size of 4 with all related views inside one mini-batch.
We reduce the number of randomly sampled anchors in each 3D feature volume from 256 to 128 to better match the desired ratio of up to 1:1 between sampled positive and negative anchors.
Additionally, we reduce the number of sampled RoIs to 64 to better match the desired fraction of 25\% foreground regions that have an IoU of at least 0.5 with a 3D ground-truth bounding box.
We accordingly reduce the learning rate by the same factor \cite{Goyal2017}.
In the multi-task loss of the RPN, we change the balancing factor \(\lambda\) for the regression loss and the normalization by the number of anchor boxes to an empirically determined factor of \(\lambda = 0.05\) without additional normalization.
In practice, this ensures good convergence of the regression loss.
We initialize all 3D convolutional layers as in the standard Faster R-CNN implementation.
We then train MX-RCNN\textsubscript{avg} on the training set for 28 epochs with a learning rate of 0.0005.
A cut of the learning rate did not show any benefit when evaluating with the validation set.
Additionally, we train MX-RCNN\textsubscript{max} for 17 epochs with the same learning rate.
Again, a learning rate cut did not show any further improvement on the validation set.
\subsection{Evaluation criteria}
Since there is no established evaluation criterion for our experimental setting, we are using the average precision (AP), which is the de-facto standard for the evaluation of object detection tasks.
Specifically, we compare the trained networks with the evaluation procedure for object detection of the \textsc{Pascal} VOC challenge that is in use since 2010 \cite{Everingham2014}.
To be considered a valid detection, a proposed bounding box must exceed a certain threshold with a ground-truth bounding box.
If multiple proposed bounding boxes match the same ground-truth bounding box, only the one with the highest confidence is counted as a valid detection.
The \textsc{Pascal} VOC challenge uses an IoU of 0.5 as threshold for the case of object detection in 2D images.
As discussed in \cref{subsec:iou-conversion}, to apply the same strictness for relative shifts that are allowed per dimension, we set this threshold to 0.374 for the evaluation of 3D bounding boxes per recording.
Nevertheless, the corresponding IoU threshold we derived for 3D is an estimate.
Hence, we additionally project the proposed 3D bounding boxes onto the 2D views and evaluate them per image with a threshold of 0.5 to directly compare to standard 2D detection.
\begin{table}[t]
\caption{\emph{Experimental results of the different networks evaluated on the test set.} For the multi-view networks the evaluation was done with the proposed 3D bounding boxes and their projections onto the 2D views.}
\label{tbl:results}
\centering
\begin{tabular}{@{}l@{\hspace{1cm}}ccccc@{}}
\toprule
Method & Single-view & \multicolumn{2}{c}{MX-RCNN\textsubscript{avg}} & \multicolumn{2}{c}{MX-RCNN\textsubscript{max}} \\
\cmidrule(lr){3-4}\cmidrule(lr){5-6}
Evaluation & 2D & 3D & 2D & 3D & 2D \\
\midrule
Weapon AP & 85.56 \% & \textbf{92.28 \%} & 90.32 \% & 89.01 \% & 87.73 \% \\
Glassbottle AP & 96.90 \% & \textbf{98.84 \%} & 95.37 \% & 98.74 \% & 95.62 \% \\
Mean AP & 91.23 \% & \textbf{95.56 \%} & 92.84 \% & 93.88 \% & 91.68 \% \\
\bottomrule
\end{tabular}
\end{table}
\begin{figure}[t]
\centering
\subfloat[\textit{Weapon} class.]{\includegraphics[height=4.2cm]{img/precision_recall_weapon.pdf}}
\subfloat[\textit{Glassbottle} class.]{\includegraphics[height=4.2cm, trim=19mm 0 0 0, clip]{img/precision_recall_glassbottle.pdf}}
\caption{\textit{Precision-recall curves of the different networks evaluated on the test set}.
The plots show the precision-recall curves of the single-view (\textit{orange, dashed}), MX-RCNN\textsubscript{avg} (\textit{turquoise, solid}) and MX-RCNN\textsubscript{max} (\textit{pink, dotted}) networks.
For the multi-view networks the precision-recall curves are shown for the evaluation in 3D.}
\label{fig:precrec}
\end{figure}
\subsection{Experimental results}
The standard single-view Faster R-CNN \cite{Ren2017} used as a baseline reaches 91.2\% mean average precision (mAP) per image on the test set (average over classes).
With 93.9\% mAP per recording, our MX-RCNN\textsubscript{max} is 2.7\% points better than the baseline when evaluating in 3D and 0.5\% points better when projected to 2D (91.7\% mAP per image).
Using a weighted average in the multi-view pooling layer of MX-RCNN (MX-RCNN\textsubscript{avg}) shows consistently better detection accuracy than MX-RCNN\textsubscript{max} except for the AP of the \textit{glassbottle} class projected to 2D.
With an mAP per recording for 3D evaluation of 95.6\%, our MX-RCNN\textsubscript{avg} is 4.4\% points better than the baseline when evaluating in 3D and 1.7\% better when projected to 2D (mAP of 92.9\%).
Detailed numbers of the evaluation can be found in \cref{tbl:results}.
Additionally, precision-recall curves are provided in \cref{fig:precrec} to allow studying the accuracy at different operating points.
We observe that the ranking of the curves of the different networks within each object class is consistent with their AP values.
Moreover, it becomes apparent that the benefit of the proposed multi-view approach is particularly pronounced in the important high-recall regime.
\setlength{\tabcolsep}{6pt}
\captionsetup[subfloat]{position=top}
\begin{table}[t]
\caption{\emph{Tolerance of MX-RCNN for disabling individual views when evaluating on the test set.} The proposed 3D bounding boxes were directly evaluated without reprojection to 2D.}
\label{tbl:ablation}
\vspace{-12pt}
\centering
\subfloat[MX-RCNN\textsubscript{avg}]{
\begin{tabular}{@{}l@{\hspace{0.5cm}}ccccc@{}}
\toprule
Views & all & w/o bottom left & w/o bottom right & w/o right side \\
\midrule
Weapon AP & 92.28 \% & 82.34 \% & 85.57 \% & 53.19 \% \\
Glassbottle AP & 98.84 \% & 91.58 \% & 98.59 \% & 92.42 \% \\
Mean AP & 95.56 \% & 86.96 \% & 92.08 \% & 72.80 \% \\
\bottomrule
\end{tabular}}\\
\subfloat[MX-RCNN\textsubscript{max}]{
\begin{tabular}{@{}l@{\hspace{0.5cm}}ccccc@{}}
\toprule
Views & all & w/o bottom left & w/o bottom right & w/o right side \\
\midrule
Weapon AP & 89.01 \% & 74.40 \% & 83.69 \% & 58.86 \% \\
Glassbottle AP & 98.74 \% & 89.89 \% & 97.93 \% & 77.26 \% \\
Mean AP & 93.88 \% & 82.14 \% & 90.81 \% & 68.06 \% \\
\bottomrule
\end{tabular}}
\end{table}
\subsection{Ablation study}
To test the importance of the different views in our multi-view setup on the final detection result, we disabled individual views while evaluating and in the mapping provided to the multi-view pooling layer, respectively.
The evaluation was done for both variants of the multi-view pooling layer on the test set and we directly compared the proposed 3D bounding boxes to 3D ground-truth annotations with 0.374 as IoU threshold without reprojecting them to 2D.
The detailed results can be found in \cref{tbl:ablation}.
We notice that the tolerance for missing views from below the tunnel is higher than for a missing side view.
Also, the impact is more pronounced on weapons whose appearance is more affected by out-of-plane rotations.
In general, the use of weighted averaging when combining features in the multi-view pooling seems to be more fault tolerant than the use of a weighted maximum, with the exception of weapons in combination with a missing side view.
The results show that the network indeed relies on all views to construct the feature volume and to propose and validate detections.
| {'timestamp': '2018-10-05T02:15:22', 'yymm': '1810', 'arxiv_id': '1810.02344', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02344'} | arxiv |
\section{Conclusion}\label{sec:concl}
We demonstrated that a model in an active object language results in a
concise and easy-to-comprehend formal model of system memory. While
such a formalization cannot replace a full-fledged formalization as a
rewriting system or an abstract machine, it can help during modeling
core features, as well to communicate and to structure the essential
ideas. We showed that \emph{message-based} modeling with Active Objects is to some extent natural to
model \emph{shared memory-based} concurrency. Based on
this observation, we speculate that by modeling memory explicitly, the
tools developed for actors and active objects are applicable for
shared memory scenarios, including high performance computing.
\paragraph{Future Work.}
We intend to model in ABS the approach of Bijo et al.~\cite{Bijo} for
cache architectures and extend it with a write buffer to achieve a
weak memory model. We aim to use the ABS tools for resource
analysis~\cite{costabs} on different caching strategies to demonstrate
that the analytic possibilities of active objects can go beyond what
is possible in conventional non-trivial formal models. When doing
this, we plan to develop the ABS model and the term rewriting
extension of \cite{Bijo} in parallel, to test the prototyping approach
advocated here.
The main theorem of Mantel et al. that non-interference under
one memory model does not imply non-interference under another memory
model is proven by providing a program and a distinguishing condition
for each pair of memory models, such that the program fulfills the
condition under one memory model, but not under the other. As
the provided programs contain no loops, we assume that a model checking
approach with Rebeca which would simplify the current proof is feasible.
\section{Discussion}\label{sec:dicuss}
Our model conceptually follows the one by Mantel et al.~\cite{Mantel},
so we mostly compare it to theirs. Their main goal is to establish
non-interference results for weak memory models, while ours is to
produce a modular, easy-to-follow, and analyzable
formalization. Therefore, both approaches are not exclusive, but
complementary: Rewriting systems can establish more complex
properties, while active object languages help during formalization.
\paragraph{Modularity.}
We are able to provide a small and clear interface to program memory,
see Section~\ref{sec:memory}. This is difficult to achieve in term
rewriting system-based models which do not syntactically distinguish
rules for executing language and memory statements. In the model
of~\cite{Mantel}, for example, memory access execution is spread among
three different predicates in differing rule premises. Moreover, the
parameters of predicates that model \emph{different} aspects are not
independent. For example, the predicate describing that an access at
position $i$ can be executed takes $i$ as a parameter, while the
predicate describing the read value takes the list $[0,\dots,i-1]$ as
parameter.
The ABS model we created is in very close correspondence to the
modeled concepts. Once the ABS model is in place, these \emph{can be
carried over} also to a term rewriting semantics: methods may be
mapped to functions or predicates, interfaces to predicate signatures,
fields to configuration elements, etc. The three different rule
premises for executing an access mentioned above, for example, can be
encapsulated into a single function that corresponds to one loop
iteration of the \abs{run} method. The ABS model helps to find such
abstractions by enforcing a process-oriented view.
A small and clear interface reduces the risk of clerical errors in the
formalization. It is justified by the fact that threads and system
memory also have a clear interface in hardware. A concise interface
also helps to transfer the memory model to another language. In both
models \cite{Boudol,Mantel} the memory access aspects are polluted
with specific constructs from the language in which the memory model
resides: registers, special representations of identifiers, etc. An
active object model could have helped to encapsulate the
language-independent parts better.
The ABS model makes no assumption about the implementation language,
as it uses futures, not specific concepts that need to be modeled on
top, yet it shows where and how modularity can be achieved.
\paragraph{Product Variant Management.}
Our model supports the generation of multiple variants. The
modifications that produce these variants are \emph{not visible} in
the core product and hence does not pollute it. The standard approach
in rewriting systems to support different variants is to parameterize
it with underspecified functions or predicates that can be constrained
by different axioms. In contrast to this, the product line approach
expresses constraints by invariants and declaration of software
product lines. This keeps the analysis simple for the core product,
i.e.\ the basic case, as default values for parameters are
unnecessary. It alleviates also analyzing the differences between
different products, because the modifications are encapsulated in
deltas and not scattered around.
Variability management is orthogonal to modularity management, which is offered by , e.g., mixins or inheritance.
Product lines allow to encapsulate changes to more than one class and even single deltas may define operations on multiple classes.
Furthermore, variability is not managed inside the type system -- after variant generation, the program contains no product lines constructs anymore and
single variants can be analyzed or compiled with the tools already available for non-variant programs.
A discussion on the difference between intra-variant and inter-variant code reuse can be found in~\cite{damitrait}, a discussion on the relation of product lines to other concepts in~\cite{Schaefer2012}.
\paragraph{Debugging and Validation.}
In this section we discuss our approach to validation from Section~\ref{sec:sanity}.
The deadlock check (Lemma~\ref{lem:lem}) makes not use of a deadlock
analysis tool, but of the \emph{concept of a deadlock}. In ABS, the
concept of deadlock is non-trivial (due to await on Boolean
conditions), but natural, because ABS has notions of progress and unit
of computation (process). These notions do not exist in term
rewriting systems, making it hard to even state Lemma~\ref{lem:lem}:
rewrite rules for operational semantics often have multiple
preconditions and it is not obvious which of them may block.
The execution witnesses from the litmus test on instruction reordering
in Section~\ref{sec:litmus} are an example of minimal requirements one
may want to ensure.
While we did not provide a proof that the core product does not allow
certain states, it would have been possible to formulate suitable
invariant, similar as in Section~\ref{sec:invariants}, even though it
might not be fully automatic. Active object languages like
Rebeca~\cite{rebeca} that offer model checking support would deliver a
\emph{fully automatic} proof.
In contrast to mainstream general purpose languages, ABS has a fully
formal semantics, allows to state formal invariants, and comes
with a verification tool that is able to verify such invariants. The
invariants in Section~\ref{sec:invariants} were shown
automatically. Proofs with small amount of interaction might also be
acceptable, but the amount of time to invest into formal
validation depends on the modeled system.
In general, we conjecture that invariant proofs with model checking is
adequate for consistency conditions, but too limited for complex
properties such as non-interference, in particular, when
\emph{multiple} memory models are involved. Thus, validation can be
used to ensure that properties hold during development, but it cannot
replace a full formalization.
\paragraph{Testing.}
Executability of ABS models and the high automatization of KeY (for simple invariants) and other static analysis,
allows to intergrate automatic testing into the prototyping apporach.
One can see the example given in Section~\ref{sec:litmus} as a test, which can be part of a regression test suite that
is used to ensure that the introduction of new feature to the model does not break old sanity checks.
The invariants in Section~\ref{sec:invariants} can also be used as regression tests, while the non-automatic Lemma~\ref{lem:lem} does not.
However, some fixed programs can be used as input to the static deadlock analysis to complete the test suite.
We point out that ABS supports unit testing and unit test generation~\cite{apet}, but we did not use this capability in this work.
\paragraph{Prototyping.}
ABS is suitable for quick development: the first model presented
above, including the first two validity checks were completed in under.\
three modeling hours by one person familiar with ABS.
The first model implementing the concepts of \cite{Mantel} including
all three validity checks was ready after one more work day (by the
same modeler). Further changes for the presentation, bug fixing, and
the proof of the invariant took three more hours. Altogether, the
whole development presented in this paper took less than two work
days, but, of course, we had read and benefited from
\cite{Boudol,Mantel}.
The modeler made the experience that it was easier to explain the
ABS model than the rewrite system-based model, even to researchers
with experience in rewriting systems. Interestingly, one colleague
found several bugs in a preliminary version of our model related to
reordering, despite being only provided the same code segments
that are presented in this paper, and not being familiar with weak
memory models. \EK{We assume that programming-language-like modeling languages are more accessible and thus a better formalism to expose computer scientists and engineers to such models.
This is, however, only anecdotical evidence, as a proper user study is out of the scope of this work.}
\paragraph{Generalization and Limitations.}
In this paper we chose the ABS language, mainly because of the
similarities between futures and the identifiers of Boudol et
al.~\cite{Boudol}, as well as to perform a validity check through a
consistency invariant. Other active object languages would also be
possible, for example, Rebeca~\cite{rebeca} that comes with a model
checker.
Compared to the approaches discussed in Section~\ref{sec:related},
Active Objects are less flexible. While they provide a framework for \emph{computation with asynchronous communication},
they do not allow to deviate from this principles.
E.g., active object languages enforce
strong encapsulation---if the modeled domain does not have strong
encapsulation of its elements, then other approaches to prototype
distributed systems might be a better fit.
The choice of modeling language is influenced by which kind of
validity checks are desired and by the desire to have a good match of
concepts between the domain and the model. We suspect that active
object languages are a less good choice for sequential systems.
From a process perspective, the use of static analysis tools, makes the modeler more dependent on the developers.
E.g.,
if the deadlock analysis tool is not precise enough, one must extend the existing tool, which creates overhead for getting acquainted with the code base etc. The sheer presence of a static analysis does not ensure that its results are useful for prototyping
Similarely,
there is no non-interference analysis tool for ABS, which makes it hard to reason about security or recreate the main results from Mantel et al.
Finally, in a term rewriting approach the modeler can change the model according to his proof strategy, while the semantics of the active object language is fixed.
This may result in a demand for sanity checks, which are hard to express in active objects, even on the prototyping stage of development.
\section{Introduction}\label{sec:intro}
Formal methods provide formal frameworks for software and systems
development, including formally defined specification and programming
languages. Their aim is to support design and implementation of
engineering projects with high quality requirements, yet formal
notations themselves are developed without the very support they are
intended to provide. This is not simply an issue of productivity, but
of usability: one of the largest obstacles against the uptake of formal
methods is that they are expressed in---occasionally
dated---formalisms that are hard to communicate, to understand, and to
validate.
In this paper, we intend to show that recent progress in
\emph{software engineering}, including new structuring principles as
well as state-of-art tool support, can be beneficial in \emph{formal
methods engineering} as well. Specifically, we use a modern active
object language instead of a term-rewriting system to formalize
semantics, we use software product lines (SPL)~\cite{variable} to organize and
maintain different variants of the formal model, and we use automated
theorem proving tools to provide early validity checks of the
consistency of the formalized system.
We exemplify our approach with a representative case study in the area
of distributed systems, where we look at certain weak memory
models. The latter became very widespread, but their consequences are
notoriously hard to understand. Currently, weak memory models are
generally formulated as a term rewriting system for a small step
operational semantics (SOS) \cite{Boudol,Mantel}, as abstract
automata~\cite{Sarkar,xtso}, or as axiomatic/algebraic description of
traces~\cite{Axiom,Axiom2}. The advantage of these formalisms is to
give the modeler freedom to adjust the formal semantics so it matches
the underlying intuition and to formulate properties of interest
without any restriction. One disadvantage is that the resulting formal
models are hard to understand for anyone who is not an expert in the
used formalism. Even for experts such formal models tend to be
hard to validate (i.e.\ debug), because limited tool support is
available. Available tools (e.g., rewriting engines
like Maude~\cite{maude}) lack the usability and modularity embodied in
more software-oriented tools. Finally, successful usage of currently
available tools requires that the formalization of the target system
is essentially finished, hence are not suitable for \emph{early}
prototyping \emph{during} formalization.
In the following we demonstrate that active object modeling is
adequate for the domain of weak memory models, and that it can offer
significant tool support during development, analysis, and
presentation of an operational semantics. While weak memory models
can be regarded as representative and sufficiently complex, our
approach is in no way limited to this particular domain.
In our approach, an active object model is developed simultaneously
with an operational semantics. As a consequence, the modeler is able
to profit from debugging techniques, tool support, and best practices
of software engineering. This includes support for modularization of
models, debugging by means of test runs, as well as automated proofs
of invariants. We make use of four software engineering principles:
(1) \emph{modularization} with interfaces and modules, (2)
\emph{variant management} with software product lines, (3)
\emph{validation} by execution tests and formal verification, (4)
development by \emph{early prototyping} to obtain feedback and
experience with the product before creating its final version. These
concepts permit to develop formal models faster, in an interactive
manner, and with higher confidence in their properties.
Our main contributions are: (1) a weak memory model, formalized in the
Abstract Behavioral Specification (ABS) language~\cite{ABS}; (2) a
discussion of the advantages of developing a prototype in an active
object language in parallel to the actual formalization. The paper
is organized as follows: Section~\ref{sec:related} describes similar
approaches and compares to other methods for mechanizing formal
models. Section~\ref{sec:lang} introduces ABS.
Section~\ref{sec:weak} describes the formal model and its
implementation, Section~\ref{sec:sanity} describes the
model validation, and Section~\ref{sec:dicuss} discusses the
advantages of our approach. Section~\ref{sec:concl} concludes.
\section{Abstract Behavioral Specification}\label{sec:lang}
We provide a very short introduction to the \emph{Abstract Behavioral
Specification} (ABS) language. For its formal semantics
see Johnsen et al.~\cite{ABS},
Din et al.~\cite{ding}; for the formal semantics of product lines see
Muschevici et al.~\cite{absspl}, and for a tutorial see
H{\"a}hnle~\cite{tut}.
\subsection{Language}
ABS extends the actor~\cite{actor} concurrency model with
futures~\cite{future} and cooperative scheduling: Objects communicate
with each other only over \emph{asynchronous} method calls. Following
a method call, the caller receives a future as a handle for
identifying the starting process and continues execution. The callee
\emph{resolves} the future by storing its return value in it. An
object may only switch the active process if the currently active
process explicitly releases control. This greatly simplifies the
concurrency model, as between the synchronization points a method can
be regarded as sequential. A process releases control by either
terminating or suspending. The latter means either to wait for a
future to be resolved or for a condition to become true. Once a future
is resolved, any process that possesses a reference to it may read it,
because futures can be passed around. When a process attempts to read
from a non-resolved future, the whole object blocks until the future
is resolved.
ABS models can be compiled into Erlang, Haskell or Java code and be executed~\cite{ABS}.
Syntactically, ABS is close to Java and has similar concepts,
including interfaces and classes.
However, classes have no static
fields and may not extend other classes. In addition, all objects are
strongly encapsulated: the only way to access their state is
via getter and setter methods they may declare.
Modularization is supported by
syntax modules, akin to Haskell, that allow to import and export
classes, interfaces, and functions.
The code in
Figure~\ref{fig:container} declares a module with a simple container
model.
We refrain from introducing the full ABS syntax, as most statements are
standard. We only describe the statements specific to the concurrency
model.
\begin{figure}[bht]
\begin{abscode}
module Container;
export *;
import Element from Element;
interface Container {
Unit setElement(Element e);
Element getElement();
}
class Container implements Container{
Element contains = null;
Unit setElement(Element e){ contains = e; }
Element getElement(){ return contains; }
}
\end{abscode}
\caption{A simple \texttt{Container} in ABS.} \label{fig:container}
\end{figure}
\begin{itemize}
\item To invoke (asynchronously) a method \abs{m} on the object stored
in \abs{o}, the statement \abs{f = o!m(i)} is used. The value of
\abs{i} is passed as the method parameter, and the resulting future
is stored in \abs{f}. The type of the future must match the return
type of the method.
\item There are two statements to synchronize with a future stored in
\abs{f}: (1) \abs{f.get} attempts to synchronize on \abs{f} by
reading its value. If \abs{f} is not resolved yet, then the process
blocks until then: no other process may become active. (2) \abs{await f?} releases control of the
object until \abs{f} is resolved, i.e., another process may become active.
\item To wait on a condition, the statement \abs{await b} releases
control of the processor until the boolean expression evaluates to
true. The behavior is scheduler dependent, as the expression may
evaluate to false again, if another process with such a side-effect
is scheduled first.
\end{itemize}
We abbreviate the pattern \abs{Fut<T> f = o!m(); await f?; i = f.get;}
with \abs{i = await o!m();} and write \abs{foreach (i < E) \{ ... \}}
for \abs{Int i = 0; while (i < E) \{ ...; i = i +1; \}}. If a class has
a method with the signature \abs{Unit run()}, then this method is
started automatically upon object creation.
ABS is object-oriented, but does not enforce to model everything as an object --
the enforced asynchronous communication leads to overhead for simple look-up operations. To omit
this, ABS uses \emph{Abstract Data Types} to abstract from data values
which have no internal state.
\subsection{Product Lines}
\label{sec:product-lines}
ABS offers management of model variants via product lines~\cite{splbook}: A product
line describes different versions of a model that are obtained by
certain syntactic operations on a common core. These syntactic
operations are called \emph{deltas} and they are able to add, as well
as replace classes, methods, and fields. The deltas are applied before
type checking. When a method is replaced in a delta, then the new
version of the method may refer to the previous one with the keyword
\abs{original}. The \abs{Notify} delta in upper part of
Figure~\ref{fig:line} modifies the \abs{setElement} method, such that
the element in the container is notified after being added and the
delta \abs{Queue} replaces the single contained element by a queue.
\begin{figure}[thb]
\begin{abscode}
delta Notify;
modifies class Container.Container {
modifies Unit setElement(Element e) {
original();
await = e!observedBy(this);
}}
delta Queue;
modifies class Container.Container {
removes Element contains;
adds List<Element> contains = Nil;
modifies Unit setElement(Element e) { contains = Cons(e, contains); }
modifies Element getElement() {
Element e = value(contains);
contains = tail(contains);
return e;
}}
\end{abscode}
\begin{abscode}
productline ContainerElement;
features QueueF, NotifyF;
delta Notify after Queue when NotifyF;
delta Queue when QueueF;
product NotifyProduct(NotifyF);
product FullProduct(QueueF, NotifyF);
\end{abscode}
\caption{Deltas and a product line in ABS.} \label{fig:line}
\end{figure}
Product lines associate deltas with \emph{features} and describe
constraints among their application order. The \abs{Notify} delta must
be applied after \abs{Queue}, because only that version of
\abs{setElement} calls \abs{original}. This is achieved by the
\abs{after} directive in the lower part of Figure~\ref{fig:line}.
\subsection{Logic}
ABS offers \emph{invariant}-based reasoning to prove consistency and
safety properties of single objects. Safety and consistency are formulated as object invariants:
formulas in a first-order axiomatization of heap memory in a program
logic that must hold at every release point, i.e.\ at the end of each
method and whenever an \abs{await} statement is reached. ABS methods
are integrated into the logic by \emph{modalities} over ABS
statements. A calculus for showing validity of formulas in this logic
is built into the theorem prover KeY-ABS~\cite{keyabs}. It can verify
invariants semi-automatically by \emph{symbolic execution} of ABS
statements. Symbolic execution can be used to compute formulas that
correspond to symbolic state transformers reflecting the state changes
caused by a given method.
The heap is axiomatized with functions to \textit{select} and
\textit{store} values to/from a reserved variable \textit{heap}. To
express that a field \abs{i} is a list containing only positive values
one may use the following formula $\phi$:
\[
\phi = \forall~\mathsf{Int}~k.~k\geq 0 \wedge k < \mathit{length}(\mathit{select}(\mathit{heap},\mathbf{self},i)) \rightarrow \mathit{select}(\mathit{heap},\mathbf{self},i)[k] > 0
\]
Strong encapsulation is reflected in the signature: each formula may
only reason about the fields of one class. The following expresses
that $\phi$ is an invariant for a given piece of code: if it holds in
the beginning, then it holds after executing \abs{i = Cons(10,i);}:
\[\phi \rightarrow [\text{\abs{i = Cons(10,i);}}]\phi\]
\section{Related Work and Discussion of Tool-Based
Approaches}\label{sec:related}
There is a recognized need for tool support to understand and analyze
relaxed memory models in mainstream programming languages. This led to
the implementation of simulators that are capable to explore the
configuration states generated from a given semantics, see Boudol
et al.~\cite{Boudol} in Java and Sarkar et al.~\cite{Sarkar} in
OCaml. In either case the simulator is far larger and more complex
than the underlying semantics. The simulators are optimized for the
generation of configuration states. Using general purpose languages
as state generators has two main downsides: (1) It obliterates the
differences between code expressing the model and code needed for a
framework to execute it, especially if the program has to be
optimized. Reasoning about the model in terms of the simulation
program is hard, because it includes reasoning about the framework.
(2) The simulators are not intended to be used to \emph{communicate
and reason} about the semantics, only to discover interesting
configurations, the modularization and structure they may have is not
transferable to the model.
Traditional tools used in work on formal semantics include term
rewriting engines such as Maude~\cite{maude}, CafeOBJ~\cite{cafe},
theorem provers like Isabelle/HOL~\cite{isabelle}, and model checkers
like SPIN/Promela~\cite{promela}.
These approaches allow to state theorems about the model and often
have support for executability and modularization through namespaces.
However, they are mostly used as a more precise alternative to
pen-and-paper definitions and suffer from the similar downsides: (1) they
provide no additional modularity or interface abstractions---they do
not \emph{simplify} reasoning about a model, they merely
\emph{formalize} it. For example, Weber~\cite{weber} provides an
Isabelle formalization of the memory model of Mantel et
al.~\cite{Mantel} and finds notational errors that do not compromise
the theoretical results, but hamper comprehensibility. These mistakes
were discovered, because the tool enforces syntax checks, not because
the formalization itself would provide a clearer structure. (2)
traditional formalization tools are not designed for
\emph{prototyping} formal methods: i.e.\ to present and verify the
core ideas of a semantic \emph{before} fleshing it out. In order to
validate formalization ideas by performing tool-based integrity checks
or to ensure that the system behaves as intended, the full model needs
to be formalized. Some provers like Coq~\cite{coq} allow to assume
some properties without proving them for prototyping, but they already
require the structure of the final model to be fixed.
Finally, (3)
current tools offer no specific support for the challenges of
distributed systems and they do not help to manage different variants
of a formal semantics. Libraries like K~\cite{kmaude}
provide support for operational semantics, but to not address distributed systems or modularity.
This is a general drawback of general purpose tools: Prototyping relies on fast feedback cycles
and general purpose approaches need libraries, which hamper analyzability or auxiliary code, which hampers clarity.
Active object languages like ABS~\cite{ABS} and Rebeca~\cite{rebeca}
try to combine the advantages of mainstream programming languages
(executability, fine-grained modularization) with the advantages of
languages with formal semantics (formal verification) and new ideas
from programming language research (e.g., variability management
through feature-based modeling~\cite{variable}) to simplify working
with concurrency. The enforced structure of actors and objects is too
restrictive to use them to analyze and express \emph{all} desirable
global properties, but their tool support and clarity predestines them
to prototype models of distributed systems: fast validation of core
ideas instead of full verification of the complete models.
Active object languages are used to formalize a vast range of
distributed systems: software systems~\cite{hadoop}, cyber-physical
systems~\cite{cyber1}, operational procedures~\cite{ftscs}, and
hardware~\cite{noc,noc2}. We argue that distributed formal system
models can as well be modeled with active objects and that this
results in faster development and more efficient communication.
\section{Model Validation}\label{sec:sanity}
The capability to \emph{validate} design decisions made during
formalization at an early stage can save a lot of work and helps to
improve trust. We exemplify the validation with our model by three
basic integrity checks: (1) the weakened model can produce traces that
are only obtainable in a relaxed, not in a conventional, memory model;
(2) the memory model cannot deadlock, provided that the threads using
it do not deadlock, and (3) the modeling of \abs{id}s is consistent.
\subsection{Instruction Reordering}\label{sec:litmus}
A classical litmus test, i.e., a test to determine whether a weak memory model is able to reproduce basic effects of non-atomic memory accesses, taken from Boudol et al.~\cite{Boudol}, is
the following simplification of Dekker's algorithm:
\begin{center}
\abs{v = 1; println("tr1: "+w)}\qquad run in parallel with\qquad \abs{w = 1; println("tr2: "+v)}
\end{center}
This program can result in a trace where $\mathtt{v} = \mathtt{w} = 0$
holds in the final state only under a weak memory model with
write-read relaxations and relaxed write atomicity,
e.g. IBM370 or TSO~\cite{adve}. This behavior is reproducible in our model. The
code in Figure~\ref{fig:ex00} models the memory accesses of the
program above. In the product \abs{TSO}, the reordering can be
observed by running the ABS model:
\begin{verbatim}
tr1: 0
tr2: 0
\end{verbatim}
\noindent To enforce this behavior, one may, for example, let the memory system
start after 3s and force that reads are executed before writes
whenever possible.\footnote{Product \abs{TSODemo}, resp. \abs{IBMDemo} in the downloadable
model.}
In the core product, this behavior is not observable. This
correlates with the fact that this behavior is not observable in architectures
with sequential consistency.
\begin{figure}[tbh]
\begin{minipage}{0.49\textwidth}
\begin{abscode}
class T1(Memory mem) implements T {
Fut<Int> rg;
Unit run() {
rg = mem.const(0);
await mem!write(this, Loc("v"), 1);
rg = await mem!read(this,Loc("w"));
println("tr1: "+toString(rg.get));
}
}
\end{abscode}
\end{minipage}
\begin{minipage}{0.49\textwidth}
\begin{abscode}
class T2(Memory mem) implements T {
Fut<Int> rg;
Unit run() {
rg = mem.const(0);
await mem!write(this, Loc("w"), 1);
rg = await mem!read(this,Loc("v"));
println("tr2: "+toString(rg.get));
}
}
\end{abscode}
\end{minipage}
\caption{Encoding of the example as a sequence of memory accesses.}
\label{fig:ex00}
\end{figure}
\subsection{Local Deadlock}
A highly desirable property of any memory model is that it should not
deadlock, provided that the whole program does not deadlock. The
notion of deadlock in ABS is a \emph{circular} dependency between
multiple processes~\cite{dead}, where a process $p_1$ is said to
\emph{depend on} a process $p_2$, if $p_1$ is halting at a \abs{f.get}
or \abs{await} statement and execution of $p_2$ would allow $p_1$ to
continue. We refrain from introducing the full semantics of deadlocks
and execution, which are non-trivial in presence of condition synchronization~\cite{avocs}, but give a proof sketch for the following lemma:
\begin{lemma}\label{lem:lem}
There is no reachable state in any valid ABS program using the class
\abs{Mem} that contains a deadlock consisting only of processes
running on an instance of \abs{Mem}.
\vspace{-3mm}
\begin{proof}[Proof sketch]
First, we observe that there are no \abs{f.get} statements and only
two \abs{await} statements, both with boolean guards: one in the
\abs{run} method, one in \abs{internalRead}. Hence, every
deadlock can only involve processes running \abs{run} and
\abs{internalRead}. Second, after the \abs{await} statement of
\abs{internalRead}, the method has no side effects, therefore, no
other process can depend on a process running \abs{internalRead}. So
any deadlock can only involve processes running \abs{run}. But there
is no call of \abs{run}, so there is only one process running
\abs{run}. There can be no deadlock, because for this at least two
processes are needed.\qedhere
\end{proof}
\end{lemma}
A fully automatic deadlock-detection tool for
ABS\footnote{\url{http://formbar.raillab.de/deadlock}} is available, but it
requires a complete system, not merely standalone classes. The code in
Figure~\ref{fig:ex00} is analyzed as deadlock-free in the core
product, with one false positive \emph{live}lock risk due to the
non-terminating loop. Further deadlocks are not possible, because our
thread model so far contains only memory accesses, but no
synchronization statements.
\subsection{Invariants}
\label{sec:invariants}
We show an invariant about internal consistency of our model:
there are no two memory accesses with the same \abs{id}.
This is a direct consequence of another invariant: the value of the
\abs{counter} field is always larger than the highest \abs{id}
occurring in the \abs{list}. We formulate these two invariants in
first-order logic:
\begin{align}
&\forall~ \mathbb{N}~ i,j.~i \neq j \wedge i < \mathsf{length(\xabs{list})} \wedge j < \mathsf{length(\xabs{list})} \rightarrow \mathsf{id}(\xabs{list}[i]) \neq \mathsf{id}(\xabs{list}[j])\\
&\forall~ \mathbb{N}~ i.~ i < \mathsf{length(\xabs{list})} \rightarrow \mathsf{id}(\xabs{list}[i]) < \xabs{counter
\end{align}
These invariants can be shown using the KeY-ABS prover \emph{fully
automatically}\footnote{Invariants and KeY-ABS are included with the
downloadable model. We had to formalize the theory of \abs{Access}
and \abs{List}.} for the \abs{read} and \abs{write} methods. The
other methods trivially preserve these properties, as they do not add
elements to \abs{list} nor modify \abs{counter}. This can be as well
verified with KeY-ABS. The proofs for \abs{read} and \abs{write} have
640 and 851 steps, respectively, and take a few seconds.
\section{A Weak Memory Model}\label{sec:weak}
The memory systems used in modern hardware do not treat write and read accesses of processors as atomic.
Instead, memory accesses are stored in a queue before being executed.
Before execution, they may be reordered and the execution of a read may read the requested value not from the memory, but from a not executed, but visible write access.
While this allows performance boosts, such \emph{weak memory models} are known to result in execution traces which are not reproducable by interleaving the executing threads~\cite{adve,lamport}
We present a simple weak memory model\footnote{The model is available at~\url{http://formbar.raillab.de/en/publications-and-tools/memory-model}} that is
able to simulate instruction reordering and write atomicity violation,
i.e.\ the two main principles of weak memory models~\cite{adve}. Our
model is based on ideas taken from Boudol et al.~\cite{Boudol}, where
identifiers---similar to the futures in ABS---are used and from Mantel
et al.~\cite{Mantel}, where relaxation of the instruction order is
characterized by pair-wise comparisons on the queue of memory
accesses. To keep this paper within reasonable length, we give no examples for some features of memory models, such as fences and visibility beyond read-own-write.
\subsection{Memory}
\label{sec:memory}
We start with the \abs{Memory} interface that models system
memory. Our core product variant is a conventional memory and does not
allow instruction reordering. Its central concept is the
\abs{Map<Location, Int> mem} field that maps location to values. The
client interface is:
\noindent
\begin{abscode}
interface Memory{
Fut<Int> read(Thread t, Location loc);
Unit write(Thread t, Location loc, Int val);
Int const(Int i);
}
\end{abscode}
The \abs{read}/\abs{write} methods model reading/writing a value
from/to the memory and \abs{const} returns a constant. Internally,
memory access is managed by a \abs{list} of waiting accesses and each
call to \abs{read} or \abs{write} adds one access to that list. A
single memory access has the following type:
\noindent
\begin{abscode}
data Access = Write(Thread tid, Location loc, Int value, Int id )
| Read(Thread tid, Location loc, Int id);
\end{abscode}
Each memory \abs{Access} has a unique \abs{id} parameter. After adding
an \abs{Access}, the \abs{write} and \abs{read} methods terminate. The
\abs{read} method returns the future of a call to \abs{internalRead},
which is resolved once the access has been executed. I.e.\ it waits
until the \abs{id} of the corresponding \abs{Access} is added to the
\abs{done} set and then returns the read value, saved in the map
\abs{ret}.
\noindent
\begin{abscode}
Int read(Thread t, Location loc) {
Int myId = counter; // global access counter
list = appendright(list, Read(t, loc, myId));
counter = counter + 1;
return this!internalRead(myId);
}
Int internalRead(Int myId) {
await contains(done, myId);
return lookupUnsafe(ret, myId);//Note: value is not read from mem
}
\end{abscode}
The memory is modeled with a loop that first waits until the
\abs{list} of scheduled \abs{Access} items is not empty, see
Figure~\ref{fig:big}. Then it invokes a \abs{strategy} which returns
the positions of those accesses that can be safely executed next.
Afterwards, it gets and removes the scheduled access from the list,
and executes its effect. The value \abs{snd(pp)} is obtained from a
call to \abs{getValueFor} and used in the read. In case of a write,
the given value is written to memory. The \abs{strategy} method
implements the procedure defined in Mantel et~al.~\cite{Mantel}: At
each position $i$ of \abs{list}, the access at position $i$ is
compared to all accesses on positions $j<i$. The \abs{maySwap} method
takes two accesses and decides whether the second access can be executed before the first one.
In the core product, i.e. under sequential consistency, it returns \abs{False} if and only if the two
accesses are from the same thread. The \abs{getValueFor} method simply
reads from memory.
\begin{figure}[tbh]
\begin{abscode}
Unit run() {
while (True) {
await list != Nil;
List<Int> accList = this.strategy();
Pair<Access, Int> pp = this.getAccess(cextPos(accList)); // invokes getValueFor
case fst(pp) {
Write(t, loc, val, id) =>
{ done = insertElement(done, id); mem = put(mem, loc, val); }
Read(t, loc, id) =>
{ done = insertElement(done, id); ret = put(ret, id, snd(pp)); }
}
}
}
List<Int> strategy() {
List<Int> allowed = Nil;
foreach (i < length(list)) { // prettified
Bool add = True;
foreach (j < i) { // prettified
Bool b = this.maySwap(nth(list,j), nth(list,i));
if (!b) { add = False; }
}
if (add) { allowed = Cons(i, allowed); }
}
return allowed;
}
Int getValueFor(Thread tid, Location loc, Int pos) {
return lookupUnsafe(mem, loc);
}
\end{abscode}
\caption{The next access loop and the access scheduling strategy.}
\label{fig:big}
\end{figure}
\subsection{Threads}
We aim to describe a memory model, not a whole programming language,
hence threads are series of memory invocations. We do not model
control flow or make assumptions about specific properties of the
local store. A memory invocation can have one of the following forms:
\begin{enumerate}
\item \abs{await mem!write(this,Location(name),val);} models a write
access. Observe that after \abs{await} execution continues once the
\abs{Access} is added to the \abs{list}, not when the \abs{Access}
is executed.
\item \abs{reg = await mem!read(this,Location(name));} models a read
access that reads the future into a local location \abs{reg}.
\item \abs{reg.get;} models an access where the value is retrieved,
i.e.\ a computation.
\end{enumerate}
The \abs{await} statements enforce a FIFO treatement of \emph{adding} memory accesses to the queue, from the point of view of a single process.
The future returned by \abs{read} is then used to synchronize on the \emph{execution} of the added memory access.
This is needed for two reasons: (1) Memory systems are synchronous by their nature and it is necessary to enforce synchronicity \emph{at this point}, despite using a asynchronous language.
(2) Additionally to asynchronous communication, ABS does not enforce FIFO scheduling, i.e., the callee object is not required to process the calls in the order they arrive.
\subsection{Instruction Reordering}
To include instruction reordering into our model, we define the
predicates for program order relaxation described by Mantel et\ al.\
in terms of deltas (Section~\ref{sec:product-lines}). Each relaxation
predicate adds a condition in the \abs{maySwap} method. For example,
to permit write-read reordering, one applies the following delta:
\noindent
\begin{abscode}
delta WRDelta;
modifies class Mem.Memory {
modifies Bool maySwap(Access a, Access b) {
Bool ret = False;
case a {
Read(_,_,_) => { ret = original(a,b); }
Write(_,loca,_,_) => case b {
Read(_,locb,_) => { last = original(a,b); #\label{line:write}#
ret = (last || loca != locb); }#\label{line:write2}#
Write(_,_,_,_) => { ret = original(a,b); }}
}
return ret;
}}
\end{abscode}
This method checks whether the arguments are write and read accesses
on different locations. The default is a call to \abs{original}. The
first access for each thread may be executed first, because the core
product models the condition that accesses from different threads can
always be reordered and \abs{original} is called in each case. The
remaining three reorderings are defined in an analogous manner.
\subsection{Write-Atomicity Violation}
To allow read-own-write, the \abs{getValueFor} method must be changed:
When executing a read at position \abs{pos}, it checks
whether there is a write \emph{from the same thread} in the access
list before \abs{pos}. This corresponds to local buffers for each
thread. We refrain from modeling more fine-grained visibility for
read-others-early for presentation's sake.
\noindent
\begin{abscode}
delta ReadEarlyDelta;
modifies class Mem.Memory {
modifies Int getValueFor(Thread tid, Location loc, Int pos) {
return case getWriteValueFor(slice(list, 0, pos-1), loc, tid) {
Just(val) => val;
Nothing => original(loc, pos);
};
}}
\end{abscode}
Method \abs{maySwap} must now allow write-read reordering
when both arguments access the same location. An additional delta \abs{WROwnDelta} does this.
It is identical to \abs{WRDelta}, except that the statements in
Lines~\ref{line:write}-\ref{line:write2} are replaced by
\abs{if (loca==locb) ret = True; else ret = original(a,b);}.
Different memory models are modeled as product variants. Each memory
model is obtained from a set of conditions for instruction reordering
and the product corresponding to that model results from the
application of appropriate deltas. The resulting product line is in
Figure~\ref{fig:pl}.
\begin{figure}[tbh]
\begin{abscode}
productline Memory;
features WWFeature, WRFeature, ReadEarlyFeature;
delta WWDelta when WWFeature;
delta WRDelta after WROwnDelta when WRFeature;
delta ReadEarlyDelta when ReadEarlyFeature;
delta WROwnDelta when ReadEarlyFeature;
product TSO (WRFeature, ReadEarlyFeature);
product PSO (WRFeature, WWFeature, ReadEarlyFeature);
product IBM370 (WRFeature);
\end{abscode}
\caption{Declaration of the weak memory product line, following the terminology of Mantel et al.~\cite{Mantel}.}
\label{fig:pl}
\end{figure}
| {'timestamp': '2018-10-08T02:04:23', 'yymm': '1810', 'arxiv_id': '1810.02470', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02470'} | arxiv |
\section*{Acknowledgments}
\vspace{-0.1cm}
We thank Kelvin Xu, Richard Zhang, Brian Cheung, Ben Poole, A\"{a}ron van den Oord, Luke Metz, Siddharth Reddy, and the anonymous reviewers for feedback on an early draft of this paper.
\section{Unsupervised Meta-Learning}
\vspace{-0.1cm}
In this section, we describe our problem setting in relation to that of unsupervised and semi-supervised learning, provide necessary preliminaries, and present our approach.
\vspace{-0.1cm}
\subsection{Problem Statement}\label{sec:problem_statement}
\vspace{-0.1cm}
Our goal is to leverage unlabeled data for the efficient learning of a range of human-specified downstream tasks. We only assume access to an unlabeled dataset $\mathcal{D} = \{ \mathbf{x}_i \}$ during meta-training. After learning from the unlabeled data, which we will refer to as unsupervised meta-training, we want to apply what was learned towards learning a variety of downstream, human-specified tasks from a modest amount of labeled data, potentially as few as a single example per class.
These downstream tasks may, in general, have different underlying classes or attributes (in contrast to typical semi-supervised problem assumptions), but are assumed to have inputs from the same distribution as the one from which datapoints in $\mathcal{D}$ are drawn. Concretely, we assume that downstream tasks are $M$-way classification tasks, and that the goal is to learn an accurate classifier using $K$ labeled datapoints $(\mathbf{x}_k, \mathbf{y}_k)$ from each of the $M$ classes, where $K$ is relatively small (i.e. between $1$ and $50$).
The unsupervised meta-training phase aligns with the unsupervised learning problem in that it involves no access to information about the downstream tasks, other than the fact that they are $M$-way classification tasks, for variable $M$ upper-bounded by $N$. The upper bound $N$ is assumed to be known during unsupervised meta-training, but otherwise, the values of $M$ and $K$ are not known \emph{a priori}. As a result, the unsupervised meta-training phase needs to acquire a sufficiently general prior for applicability to a range of classification tasks with variable quantities of data and classes.
This problem definition is our prototype for a practical use-case in which a user would like to train an application-specific image classifier, but does not have an abundance of labeled data.
\vspace{-0.1cm}
\subsection{Preliminaries}\label{sec:preliminaries}
\vspace{-0.1cm}
\textbf{Unsupervised embedding learning}. An unsupervised embedding learning algorithm $\mathcal{E}$ is a procedure that takes as input an unlabeled dataset $\mathcal{D}=\{\mathbf{x}_i\}$ and outputs a mapping from $\{\mathbf{x}_i\}$ to embeddings $\{\mathbf{z}_i\}$. These embedded points are typically lower-dimensional and arranged such that distances correspond to meaningful differences between inputs, in contrast to distances between the original inputs, such as image pixels, which are not meaningful measures of image similarity.
\textbf{Task}. An $M$-way $K$-shot classification task $\mathcal{T}$ consists of $K$ training datapoints and labels $\{(\mathbf{x}_k, \bm{\ell}_k)\}$ per class, which are used for learning a classifier, and $Q$ query datapoints and labels per class, on which the learned classifier is evaluated. That is, in a task there are $K+Q=R$ datapoints and labels for each of the $M$ classes.
\textbf{Meta-learning}. A supervised meta-learning algorithm $\mathcal{M}{}(\cdot)$ takes as input a set of supervised meta-training tasks $\{\mathcal{T}_t\}$. It produces a learning procedure $\mathcal{F}{}(\cdot)$, which, in turn, ingests the supervised training data of a task to produce a classifier $f(\cdot)$. The goal of $\mathcal{M}{}$ is to learn $\mathcal{F}{}$ such that, when faced with a meta-test time task $\mathcal{T}_{t'}$ held-out from $\{\mathcal{T}_t\}$, $\mathcal{F}{}$ can learn a $f_{t'}$ that accomplishes $\mathcal{T}_{t'}$. At a high level, the quintessential meta-learning strategy is to have $\mathcal{M}$ iterate over $\{\mathcal{T}_t\}$, cycling between applying the current form of $\mathcal{F}_t$ on training data from $\mathcal{T}_t$ to learn $f_t$, assessing its performance by calculating some meta-loss $\mathcal{L}$ on held-out data from the task, and optimizing $\mathcal{L}$ to improve the learning procedure.
We build upon two meta-learning algorithms: model agnostic meta-learning (MAML)~\citep{finn2017model} and prototypical networks (ProtoNets)~\citep{snell2017prototypical}.
MAML aims to learn the initial parameters of a deep network such that one or a few gradient steps leads to effective generalization; it specifies $\mathcal{F}$ as gradient descent starting from the meta-learned parameters.
ProtoNets aim to meta-learn a representation in which a class is effectively identified by its prototype, defined to be the mean of the class' training examples in the meta-learned space; $\mathcal{F}$ is the computation of these class prototypes, and $f$ is a linear classifier that predicts the class whose prototype is closest in Euclidean distance to the query's representation.
\textbf{Task generation for meta-learning}. We briefly summarize how tasks are typically generated from labeled datasets $\{(\mathbf{x}_i, \mathbf{y}_i)\}$ for supervised meta-learning, as introduced by~\citet{santoro2016meta}.
For simplicity, consider the case where the labels are discrete scalar values $y_i$.
To construct an $N$-way classification task $\mathcal{T}$ (assuming $N$ is not greater than the number of unique $y_i$), we can sample $N$ classes, sample $R$ datapoints $\{\mathbf{x}_r\}_n$ for each of the $N$ classes, and sample a permutation of $N$ distinct one-hot vectors $(\bm{\ell}_n)$ to serve as task-specific labels of the $N$ sampled classes. The task is then defined as $\mathcal{T} = \{(\mathbf{x}_{n,r}, \bm{\ell}_{n}) \mid \mathbf{x}_{n,r} \in \{\mathbf{x}_r\}_n \}$. Of course, this procedure is only possible with labeled data; in the next section, we discuss how we can construct tasks without ground-truth labels.
\vspace{-0.1cm}
\subsection{Unsupervised Meta-Learning with Automatically Constructed Tasks}\label{sec:algorithm}
\vspace{-0.1cm}
We approach our problem from a meta-learning perspective, framing the problem as the acquisition, from unlabeled data, of an efficient learning procedure that is transferable to human-designed tasks. In particular, we aim to construct classification tasks from the unlabeled data and then learn how to efficiently learn these tasks. If such tasks are adequately \emph{diverse} and \emph{structured}, then meta-learning these tasks should enable fast learning of new, human-provided tasks.
A key question, then, is how to automatically construct such tasks from unlabeled data $\mathcal{D}= \{\mathbf{x}_i\}$.
Notice that in the supervised meta-learning task generation procedure detailed in Section~\ref{sec:preliminaries}, the labels $y_i$ induce a partition $\mathcal{P} = \{c_c \}$ over $\{\mathbf{x}_i\}$ by assigning all datapoints with label $y_c$ to subset $c_c$. Once a partition is obtained, task generation is simple; we can reduce the problem of constructing tasks to that of constructing a partition over $\{\mathbf{x}_i\}$. All that's left is to find a principled alternative to human labels for defining the partition.
A na\"ive approach is to randomly partition the data $\mathcal{D}$. While such a scheme introduces diverse tasks, there is no structure; that is, there is no consistency between a task's training data and query data, and hence nothing to be learned during each task, let alone across tasks. As seen in Table~\ref{table:omniglot_ablation}, providing a meta-learner with purely random tasks results in failed meta-learning.
To construct tasks with structure that resembles that of human-specified labels, we need to group datapoints into consistent and distinct subsets based on salient features. With this motivation in mind, we propose to use $k$-means clustering. Consider the partition $\mathcal{P} = \{c_c\}$ learned by $k$-means as a simplification of a Gaussian mixture model $p(\mathbf{x}|c)p(c)$. If the clusters can recover a semblance of the true class-conditional generative distributions $p(\mathbf{x}|c)$, creating tasks based on treating these clusters as classes should result in useful unsupervised meta-training. However, the result of $k$-means is critically dependent on the metric space on which its objective is defined. Clustering in pixel-space is unappealing for two reasons: (1) distance in pixel-space correlates poorly with semantic meaning, and (2) the high dimensionality of raw images renders clustering difficult in practice. We empirically show in Table~\ref{table:omniglot_ablation} that meta-learning with tasks defined by pixel-space clusters, with preprocessing as directed by~\citet{coates2012learning}, also fails.
We are now motivated to cluster in spaces in which common distance functions correlate to semantic meaning. However, we must satisfy the constraints of our problem statement in the process of learning such spaces. To these ends, we use state-of-the-art unsupervised learning methods to produce useful embedding spaces. For qualitative evidence in the unsupervised learning literature that such embedding spaces exhibit semantic meaning, see \citet{cheung2015discovering,bojanowski2017unsupervised, donahue2017adversarial}.
We note that while a given embedding space may not be directly suitable for highly-efficient learning of new tasks (which would require the embedding space to be precisely aligned or adaptable to the classes of those tasks), we can still leverage it for the construction of structured tasks, a process for which requirements are less strict.
Thus, we first run an out-of-the-box unsupervised embedding learning algorithm $\mathcal{E}$ on $\mathcal{D}$, then map the data $\{\mathbf{x}_i\}$ into the embedding space $\mathcal{Z}$, producing $\{\mathbf{z}_i\}$.
To produce a diverse task set, we generate $P$ partitions $\{\mathcal{P}_p\}$ by running clustering $P$ times, applying random scaling to the dimensions of $\mathcal{Z}$ to induce a different metric, represented by diagonal matrix $\mathbf{A}$, for each run of clustering.
With $\bm{\mu}_c$ denoting the learned centroid of cluster $c_c$, a single run of clustering can be summarized with
\begin{equation}
\mathcal{P}, \{\bm{\mu}_c\} = \argmin_{\{c_c\}, \{\bm{\mu}_c\}} \sum_{c=1}^k \sum_{\mathbf{z} \in c_c} \lVert \mathbf{z} - \bm{\mu}_c \rVert^2_\mathbf{A}
\end{equation}
We derive tasks for meta-learning from the partitions using the procedure detailed in Section~\ref{sec:preliminaries}, except we begin the construction of each task by sampling a partition from the uniform distribution $\mathcal{U}{}(\mathcal{P})$, and for $\mathbf{x}_i \in c_c$, specify $y_i = c$. To avoid imbalanced clusters dominating the meta-training tasks, we opt not to sample from $p(c) \propto |c_c|$, but instead sample $N$ clusters uniformly without replacement for each task.
We note that \citet{caron2018deep} are similarly motivated in their design decision of sampling data from a uniform distribution over clusters.
With the partitions being constructed over $\{\mathbf{z}_i\}$, we have one more design decision to make: should we perform meta-learning on embeddings or images? We consider that, to successfully solve new tasks at meta-test time, a learning procedure $\mathcal{F}$ that takes embeddings as input would depend on the embedding function's ability to generalize to out-of-distribution observations. On the other hand, by meta-learning on images, $\mathcal{F}$ can separately adapt $f$ to each evaluation task from the rawest level of representation. Thus, we choose to meta-learn on images.
We call our method clustering to automatically construct tasks for unsupervised meta-learning (CACTUs). We detail the task construction algorithm in Algorithm~\ref{alg:cactus}, and provide an illustration of the complete unsupervised meta-learning approach for classification in Figure~\ref{fig:illustration}.
\algnewcommand\algorithmicto{\textbf{to}}
\begin{algorithm}[htbp]
\footnotesize
\caption{CACTUs{} for classification}
\label{alg:cactus}
\begin{algorithmic}[1]
\Procedure{CACTUs}{$\mathcal{E}, \mathcal{D}, P, k, T, N, K_\text{m-tr}, Q$}
\Stateindent{Run embedding learning algorithm \(\mathcal{E}\) on \(\mathcal{D}\) and produce embeddings \(\{\mathbf{z}_i\}\) from observations $\{\mathbf{x}_i\}$.}
\Stateindent{Run $k$-means on \(\{\mathbf{z}_i\}\) $P$ times (with random scaling)
to generate a set of partitions \(\{\mathcal{P}_p\ = \{c_{c} \}_p\}\).}
\For{$t$ from 1 to the number of desired tasks $T$}
\State Sample a partition \(\mathcal{P}\) uniformly at random from the set of partitions $\{ \mathcal{P}_p \}$.
\Stateforindent{Sample a cluster \(c_{n}\) uniformly without replacement from \(\mathcal{P}\) for each of the \(N\) classes desired for a task.}
\Stateforindent{Sample an embedding \(\mathbf{z}_{r}\) without replacement from \(c_{n}\) for each of the \(R=K_\text{m-tr} + Q\) training and query examples desired for each class, and record the corresponding datapoint \(\mathbf{x}_{n,r}\).}
\State Sample a permutation $(\bm{\ell}_{n})$ of \(N\) one-hot labels.
\State Construct \(\mathcal{T}_t = \{\left(\mathbf{x}_{n,r}, \bm{\ell}_{n} \right) \}\).
\EndFor
\State \textbf{return} \(\{\mathcal{T}_t\}\)
\EndProcedure
\end{algorithmic}
\end{algorithm}
\section{The Embedding Learning Zoo}\label{app:zoo}
We evaluate four distinct methods from prior work for learning the task-generating embeddings.
In adversarially constrained autoencoder interpolation (ACAI), a convolutional autoencoder's pixel-wise $L^2$ loss is regularized with a term encouraging meaningful interpolations in the latent space~\citep{acai}. Specifically, a critic network takes as input a synthetic image generated from a convex combination of the latents of two dataset samples, and regresses to the mixing factor. The decoder of the autoencoder and the generator for the critic are one and the same. The regularization term is minimized when the autoencoder fools the critic into predicting that the synthetic image is a real sample.
The bidirectional GAN (BiGAN) is an instance of a generative-adversarial framework in which the generator produces both synthetic image and embedding from real embedding and image, respectively~\citep{donahue2017adversarial,dumoulin2017adversarially}. Discrimination is done in joint image-embedding space.
The DeepCluster method does discriminative clustering by alternating between clustering the features of a convolutional neural network and using the clusters as labels to optimize the network weights via backpropagating a standard classification loss~\citep{caron2018deep}.
The InfoGAN framework conceptually decomposes the generator's input into a latent code and incompressible noise~\citep{infogan}. The structure of the latent code is hand-specified based on knowledge of the dataset. The canonical GAN minimax objective is regularized with a mutual information term between the code and the generated image. In practice, this term is optimized using variational inference, involving the approximation of the posterior with an auxiliary distribution $ Q(\text{code}|\text{image}) $ parameterized by a recognition network.
Whereas ACAI explicitly optimizes pixel-wise reconstruction error, BiGAN only encourages the fidelity of generated image and latent samples with respect to their respective prior distributions. While InfoGAN also encourages the fidelity of generated images, it leverages domain-specific knowledge to impose a favorable structure on the embedding space and information-theoretic methods for optimization.
DeepCluster departs from the aforementioned methods in that it is not concerned with generation or decoding, and only seeks to learn general-purpose visual features by way of end-to-end discriminative clustering.
\section{Dataset Information}\label{app:datasets}
The Omniglot dataset consists of 1623 characters each with 20 hand-drawn examples. Ignoring the alphabets from which the characters originate, we use 1100, 100, and 423 characters for our meta-training, meta-validation, and meta-testing splits. The miniImageNet dataset consists of 100 classes each with 600 examples. The images are predominantly natural and realistic. We use the same meta-training/meta-validation/meta-testing splits of 64/16/20 classes as proposed by~\cite{ravi2017optimization}. The CelebA dataset includes 202,599 facial images of celebrities and 40 binary attributes that annotate every image. We follow the prescribed 162,770/19,867/19,962 data split.
For Omniglot and miniImageNet, supervised meta-learning tasks and evaluation tasks are constructed exactly as detailed in Section~\ref{sec:preliminaries}: for an $N$-way $K$-shot task with $Q$ queries per class, we sample $N$ classes from the data split and $K+Q$ datapoints per class, labeling the task's data with a random permutation of $N$ one-hot vectors.
For CelebA, we consider binary classification tasks (i.e., 2-way), each defined by 3 attributes and an ordering of 3 Booleans, one for each attribute. Every image in a task-specific class shares all task-specific attributes with each other and none with images in the other class. For example, the task illustrated in Figure~\ref{fig:clusters} involves distinguishing between images whose subjects satisfy \texttt{not Sideburns}, \texttt{Straight Hair}, and \texttt{not Young}, and those whose subjects satisfy \texttt{Sideburns}, \texttt{not Straight Hair}, and \texttt{Young}. To keep with the idea of having distinct classes for meta-training and meta-testing, we split the task-defining attributes. For the supervised meta-learning oracle, we construct meta-training tasks from the first 20 attributes (when alphabetically ordered), meta-validation tasks from the next 10, and meta-testing tasks from the last 10. Discarding tasks with too few examples in either class, this results in 4287, 391, and 402 task prototypes (but many more possible tasks). We use the same meta-test time tasks to evaluate the unsupervised methods. We only consider assessment with 5-shot tasks because, given that there are multiple attributes other than the task-defining ones, any 1-shot task is likely to be ill-defined.
\section{Task Construction via Random Hyperplanes}\label{app:hyperplanes}
Given a set of embedding points $\{\mathbf{z}_i\}$ in a space $\mathcal{Z}$, a simple way of defining a partition $\mathcal{P}=\{c_c\}$ on $\{\mathbf{z}_i\}$ is to use random hyperplanes to slice $\mathcal{Z}$ into subspaces and assign the embeddings that lie in the $c$-th subspace to subset $c_c$. However, a hyperplane slicing can group together two arbitrarily far embeddings, or separate two arbitrarily close ones; given our assumption that good embedding spaces have a semantically meaningful metric, this creates ill-defined classes. This problem can be partially alleviated by extending the hyperplane boundaries with a non-zero margin, as empirically shown in Section~\ref{sec:image_results}.
We now describe how to generate tasks via random hyperplanes in the embedding space. We first describe a procedure to generate a partition $\mathcal{P}$ of the set of embeddings $\{\mathbf{z}_i\}$ for constructing meta-training tasks. A given hyperplane slices the embedding space into two, so for an $N$-way task, we need $H = \lceil\log_2{N}\rceil$ hyperplanes to define sufficiently many subsets/classes for a task. To randomly define a hyperplane in $d$-dimensional embedding space, we sample a normal vector $\mathbf{n}$ and a point on the plane $\mathbf{z}_0$, each with $d$ elements. For an embedding point $\mathbf{z}$, the signed point-plane distance is given by $\frac{\mathbf{n}}{\norm{\mathbf{n}}_2}\cdot (\mathbf{z} - \mathbf{z}_0)$. Defining $H$ hyperplanes in this manner, we discard embeddings for which the signed point-plane distance to any of the $H$ hyperplanes lies within $(-m, m)$, where $m$ is a desired margin. The $H$ hyperplanes collectively define $2^H$ subspaces. We assign embedding points in the $c$-th subspace to subset $c_c$. We define the partition as $\mathcal{P}=\{c_c\}$. We prune subsets that do not have at least $R=K_\text{m-tr}+Q$ members, and check that the partition has at least $N$ remaining subsets; if not, we reject the partition and restart the procedure. After obtaining partitions $\{\mathcal{P}_p\}$, meta-training tasks can be generated by following Algorithm~\ref{alg:cactus} from Line 4.
In terms of practical implementation, we pre-compute 1000 hyperplanes and pruned pairs of subsets of $\{\mathbf{z}_i\}$. We generate partitions by sampling combinations of the hyperplanes and taking intersections of their associated subsets to define the elements of the partition. We determine the number of partitions needed for a given Hyperplanes-MAML{} run by the number of meta-training tasks desired for the meta-learner: we fix 100 tasks per partition.
\section{MNIST Experiments}\label{app:mnist}
The MNIST dataset consists of 70,000 hand-drawn examples of the 10 numerical digits. Our split respects the original MNIST 60,000/10,000 training/testing split. We assess on 10-way classification tasks. This setup results in examples from all 10 digits being present for both meta-training and meta-testing, making the probem setting essentially equivalent to that of semi-supervised learning sans a fixed permutation of the labels. The MNIST scenario is thus a special case of the problem setting considered in the rest of the paper. For MNIST, we only experiment with MAML as the meta-learning algorithm.
For ACAI and InfoGAN we constructed the meta-validation split from the last 5,000 examples of the meta-training split; for BiGAN this figure was 10,000.
After training the ACAI model and inferring embeddings, manually assigning labels to 10 clusters by inspection results in a classification accuracy of 96.00\% on the testing split. As the ACAI authors observe, we found it important to whiten the ACAI embeddings before clustering. The same metric for the InfoGAN embedding (taking an argmax over the categorical dimensions instead of actually running clustering) is 96.83\%. Note that these results are an upper-bound for embedding cluster matching. To see this, consider the 10-way 1-shot scenario. 1 example sampled from each cluster is insufficient to guarantee the optimal label for that cluster; 1 example sampled from each label is not guaranteed to each end up in the optimal category.
Aside from CACTUs{}-MAML, embedding $k_\text{nn}$-nearest neighbors, embedding linear classifier, and embedding direct clustering, we also ran CACTUs{}-MAML on embeddings instead of raw images, using a simple model with 2 hidden layers with 64 units each and ReLU activation, and all other MAML hyperparameters being the same as in Table \ref{tab:maml_hyperparameters}.
Departing from the fixed $k=500$ used for all other datasets, we deliberately use $k=10$ to better understand the limitations of CACTUs{}-MAML. The results can be seen in Table~\ref{table:mnist} in Appendix~\ref{app:datasets}. In brief, with the better embeddings (ACAI and InfoGAN), there is only little benefit of CACTUs{}-MAML over embedding cluster matching. Additionally, even in the best cases, CACTUs{}-MAML falls short of state-of-the-art semi-supervised learning methods.
\section{Hyperparameters and Architectures}\label{app:hyperparameters}
\subsection{MAML}
\begin{table}[H]
\caption{\footnotesize MAML hyperparameter summary.} \label{tab:maml_hyperparameters}
\begin{center}
\begin{tabular}{@{}lrrrr@{}}
\toprule
Hyperparameter & MNIST & Omniglot & miniImageNet & CelebA \\
\midrule
Input size & $28 \times 28$ & $28 \times 28$ & $84 \times 84 \times 3$ & $84 \times 84 \times 3$ \\
Outer (meta) learning rate & 0.001 & 0.001 & 0.001 & 0.001 \\
Inner learning rate & 0.05 & 0.05 & 0.05 & 0.05 \\
Task batch size & 8 & 8 & 8 & 8 \\
Inner adaptation steps (meta-training) & 5 & 5 & 5 & 5 \\
Meta-training iterations & 30,000 & 30,000 & 60,000 & 60,000 \\
Adaptation steps (evaluation) & 50 & 50 & 50 & 50 \\
Classes per task (meta-training) & 10 & 20 & 5 & 2 \\
Shots per class (meta-training) & 1 & 1 & 1 & 1 \\
Queries per class & 5 & 5 & 5 & 5 \\
\bottomrule
\end{tabular}
\end{center}
\end{table}
For MNIST and Omniglot we use the same 4-block convolutional architecture as used by \citet{finn2017model} for their Omniglot experiments, but with 32 filters (instead of 64) for each convolutional layer for consistency with the model used for miniImageNet and CelebA, which is the same as what \cite{finn2017model} used for their miniImageNet experiments. When evaluating the meta-learned 20-way Omniglot model with 5-way tasks, we prune the unused output dimensions. The outer optimizer is Adam~\citep{kingma2014adam}, and the inner optimizer is SGD. We build on the authors' publicly available codebase found at \url{https://github.com/cbfinn/maml}.
When using batch normalization~\citep{ioffe2015batch} to process a task's training or query inputs, we observe that using only $1$ query datapoint per class can allow the model to exploit batch statistics, learning a strategy analogous to a process of elimination that causes significant, but spurious, improvement in accuracy.
To mitigate this, we fix 5 queries per class for every task's evaluation phase, meta-training or meta-testing.
\subsection{ProtoNets}
\begin{table}[H]
\caption{\footnotesize ProtoNets hyperparameter summary.} \label{tab:pnets_hyperparameters}
\begin{center}
\begin{tabular}{@{}lrrr@{}}
\toprule
Hyperparameter & Omniglot & miniImageNet & CelebA \\
\midrule
Input size & $28 \times 28$ & $84 \times 84 \times 3$ & $84 \times 84 \times 3$ \\
Learning rate & 0.001 & 0.001 & 0.001 \\
Task batch size & 1 & 1 & 1 \\
Training iterations & 30,000 & 60,000 & 60,000 \\
Classes per task (meta-training) & 20 & 5 & 2 \\
Shots per class (meta-training) & 1 & 1 & 1 \\
Queries per class (meta-training/meta-testing) & 15/5 & 15/5 & 15/5 \\
\bottomrule
\end{tabular}
\end{center}
\end{table}
For the three considered datasets we use the same architecture as used by \citet{snell2017prototypical} for their Omniglot and miniImageNet experiments. This is a 4-block convolutional architecture with each block consisting of a convolutional layer with 64 $3\times 3$ filters, stride 1, and padding 1, followed by BatchNorm, ReLU activation, and $2\times 2$ MaxPooling. The ProtoNets embedding is simply the flattened output of the last block. We follow the authors and use the Adam optimizer, but do not use a learning rate scheduler. We build upon the authors' publicly available codebase found at \url{https://github.com/jakesnell/prototypical-networks}.
\subsection{CACTUs{}}
For Omniglot, miniImageNet, and CelebA we fix the number of clusters $k$ to be 500. For Omniglot we choose the number of partitions $P=100$, but in the interest of keeping runtime manageable, choose $P=50$ for miniImageNet and CelebA.
\subsection{Use of Unsupervised Learning Methods}
ACAI~\citep{acai}: We run ACAI for MNIST and Omniglot. We pad the images by 2 and use the authors' architecture. We use a 256-dimensional embedding for all datasets. We build upon the authors' publicly available codebase found at \url{https://github.com/brain-research/acai}.
We unsuccessfully try running ACAI on $64\times 64$ miniImageNet and CelebA. To facilitate this input size, we add one block consisting of two convolutional layers (512 filters each) and one downsampling/upsampling layer to the encoder and decoder. However, because of ACAI's pixel-wise reconstruction loss, for these datasets the ACAI embedding prioritizes information about the few ``features'' that dominate the reconstruction pixel count, resulting in clusters that only corresponded to a limited range of factors, such as background color and pose. For curiosity's sake, we tried running meta-learning on tasks derived from these uninteresting clusters anyways, and found that the meta-learner quickly produced a learning procedure that obtained high accuracy on the meta-training tasks. However, this learned prior was not useful for solving downstream tasks.
BiGAN~\citep{donahue2017adversarial}: For MNIST, we follow the BiGAN authors and specify a uniform 50-dimensional prior on the unit hypercube for the latent. The BiGAN authors use a 200-dimensional version of the same prior for their ImageNet experiments, so we follow suit for Omniglot, miniImageNet, and CelebA. For MNIST and Omniglot, we use the permutation-invariant architecture (i.e. fully connected layers only) used by the authors for their MNIST results; for miniImageNet and CelebA, we randomly crop to $64\times64$ and use the AlexNet-inspired architecture used by~\cite{donahue2017adversarial} for their ImageNet results. We build upon the authors' publicly available codebase found at \url{https://github.com/jeffdonahue/bigan}.
DeepCluster~\citep{caron2018deep}: We run DeepCluster for miniImageNet and CelebA, which we respectively randomly crop and resize to $64\times64$. We modify the first layer of the AlexNet architecture used by the authors to accommodate this input size. We follow the authors and use the input to the (linear) output layer as the embedding. These are 4096-dimensional, so we follow the authors and apply PCA to reduce the dimensionality to 256, followed by whitening. We build upon the authors' publicly available codebase found at \url{https://github.com/facebookresearch/deepcluster}.
InfoGAN~\citep{infogan}: We only run InfoGAN for MNIST. We follow the InfoGAN authors and specify the product of a 10-way categorical distribution and a 2-dimensional uniform distribution as the latent code. We use the authors' architecture. Given an image, we use the recognition network to obtain its embedding. We build upon the authors' publicly available codebase found at \url{https://github.com/openai/InfoGAN}.
\section{Experimental Results}\label{app:tables}
This section containsfull experimental results for the MNIST, Omniglot, miniImageNet, and CelebA datasets, including consolidated versions of the tables found in the main text. The metric is classification accuracy averaged over 1000 tasks based on human-specified labels of the testing split, with 95\% confidence intervals. $d$: dimensionality of embedding, $h$: number of hidden units in a fully connected layer, $k$: number of clusters in a partition, $P$: number of partitions used during meta-learning, $m$: margin on boundary-defining hyperplanes.
\begin{sidewaystable}[ht]
\footnotesize
\caption{MNIST digit classification results averaged over 1000 tasks. $\pm$ denotes a 95\% confidence interval. $k$: number of clusters in a partition, $P$: number of partitions used during meta-learning}
\label{table:mnist}
\begin{center}
\begin{tabular}{@{}lccc@{}}
\toprule
Algorithm \hfill{} (way, shot) & (10, 1) & (10, 5) & (10, 10) \\
\midrule
\textit{ACAI}, $d=256$ \\
Embedding $k_\text{nn}$-nearest neighbors & 74.49 $\pm$ 0.82 \% & 88.80 $\pm$ 0.27 \% & 91.90 $\pm$ 0.17 \% \\
Embedding linear classifier & 76.53 $\pm$ 0.81 \% & 92.17 $\pm$ 0.25 \% & 94.58 $\pm$ 0.15 \% \\
Embedding cluster matching, $k=10$ & 91.28 $\pm$ 0.58 \% & 95.92 $\pm$ 0.16 \% & 96.01 $\pm$ 0.12 \% \\
CACTUs{}-MAML on images (ours), $P=1$, $k=10$ & 92.66 $\pm$ 0.34 \% & 96.08 $\pm$ 0.12 \% & 96.29 $\pm$ 0.12 \% \\
CACTUs{}-MAML on embeddings (ours), $P=1$, $k=10$ & 94.77 $\pm$ 0.28 \% & 96.56 $\pm$ 0.11 \% & 96.80 $\pm$ 0.11 \% \\
\midrule
\textit{BiGAN}, $d=50$ \\
Embedding $k_\text{nn}$-nearest neighbors & 29.25 $\pm$ 0.83 \% & 44.59 $\pm$ 0.44 \% & 51.98 $\pm$ 0.30 \% \\
Embedding linear classifier & 30.86 $\pm$ 0.89 \% & 51.69 $\pm$ 0.44 \% & 60.70 $\pm$ 0.31 \% \\
Embedding cluster matching, $k=10$ & 33.72 $\pm$ 0.54 \% & 50.21 $\pm$ 0.36 \% & 52.95 $\pm$ 0.34\% \\
CACTUs{}-MAML on images (ours), $P=1$, $k=10$ & 43.75 $\pm$ 0.46 \% & 62.20 $\pm$ 0.33 \% & 68.38 $\pm$ 0.29 \% \\
CACTUs{}-MAML on images (ours), $P=100$, $k=10$ & 49.73 $\pm$ 0.45 \% & 77.05 $\pm$ 0.30 \% & 83.90 $\pm$ 0.24 \% \\
CACTUs{}-MAML on embeddings (ours), $P=1$, $k=10$ & 36.33 $\pm$ 0.48 \% & 51.78 $\pm$ 0.34 \% & 57.41 $\pm$ 0.30 \% \\
CACTUs{}-MAML on embeddings (ours), $P=100$, $k=10$ & 37.32 $\pm$ 0.41 \% & 60.74 $\pm$ 0.34 \% & 67.34 $\pm$ 0.30 \% \\
\midrule
\textit{InfoGAN}, $d=12$ \\
Embedding $k_\text{nn}$-nearest neighbors & 94.53 $\pm$ 0.51 \% & 96.05 $\pm$ 0.17 \% & 96.24 $\pm$ 0.12 \% \\
Embedding linear classifier & 95.78 $\pm$ 0.42 \% & 96.61 $\pm$ 0.21 \% & 96.85 $\pm$ 0.11 \% \\
Embedding cluster matching, $k=10$ & 93.42 $\pm$ 0.57 \% & 96.97 $\pm$ 0.15 \% & 96.99 $\pm$ 0.10 \% \\
CACTUs{}-MAML on images (ours), $P=1$, $k=10$ & 95.30 $\pm$ 0.23 \% & \textbf{97.18 $\pm$ 0.10 \%} & \textbf{97.28 $\pm$ 0.10 \%} \\
CACTUs{}-MAML on images (ours), $P=100$, $k=10$ & 96.08 $\pm$ 0.19 \% & \textbf{97.22 $\pm$ 0.10 \%} & \textbf{97.31 $\pm$ 0.09 \%} \\
CACTUs{}-MAML on embeddings (ours), $P=1$, $k=10$ & \textbf{96.69 $\pm$ 0.17} \% & \textbf{97.13 $\pm$ 0.10 \%} & \textbf{97.23 $\pm$ 0.10 \%} \\
CACTUs{}-MAML on embeddings (ours), $P=100$, $k=10$ & 96.48 $\pm$ 0.17 \% & 97.08 $\pm$ 0.10 \% & \textbf{97.22 $\pm$ 0.10 \%} \\
\midrule
\textit{Supervised pre-training} \\
Oracle-MAML{} (control) & 97.31 $\pm$ 0.17 \% & 98.51 $\pm$ 0.07 \% & 98.51 $\pm$ 0.07 \% \\
\bottomrule
\end{tabular}
\end{center}
\end{sidewaystable}
\begin{sidewaystable}
\footnotesize
\caption{Omniglot character classification results averaged over 1000 tasks. $\pm$ denotes a 95\% confidence interval. $d$: dimensionality of embedding, $h$: number of hidden units in a fully connected layer, $k$: number of clusters in a partition, $P$: number of partitions used during meta-learning, $m$: margin on boundary-defining hyperplanes.}
\label{table:omniglot}
\begin{center}
\begin{tabular}{@{}lcccc@{}}
\toprule
Algorithm \hfill{} (way, shot) & (5, 1) & (5, 5) & (20, 1) & (20, 5) \\
\midrule
\textit{Baselines} \\
Training from scratch & 52.50 $\pm$ 0.84 \% & 74.78 $\pm$ 0.69 \% & 24.91 $\pm$ 0.33 \% & 47.62 $\pm$ 0.44 \% \\
Random-MAML{}, $P=2400$, $k=500$ & 25.99 $\pm$ 0.73 \% & 25.74 $\pm$ 0.69 \% & 6.51 $\pm$ 0.18 \% & 6.74 $\pm$ 0.18 \% \\
Pixels CACTUs{}-MAML, $P=1$, $k=500$ & 30.55 $\pm$ 0.63 \% & 40.19 $\pm$ 0.71 \% & 12.05 $\pm$ 0.23 \% & 19.01 $\pm$ 0.29 \% \\
\midrule
\textit{ACAI}, $d=256$ \\
Embedding $k_\text{nn}$-nearest neighbors & 57.46 $\pm$ 1.35 \% & 81.16 $\pm$ 0.57 \% & 39.73 $\pm$ 0.38 \% & 66.38 $\pm$ 0.36 \% \\
Embedding linear classifier & 61.08 $\pm$ 1.32 \% & 81.82 $\pm$ 0.58 \% & 43.20 $\pm$ 0.69 \% & 66.33 $\pm$ 0.36 \% \\
Embedding MLP with dropout, $h=128$ & 51.95 $\pm$ 0.82 \% & 77.20 $\pm$ 0.65 \% & 30.65 $\pm$ 0.39 \% & 58.62 $\pm$ 0.41 \% \\
Embedding cluster matching, $k=500$ & 54.94 $\pm$ 0.85 \% & 71.09 $\pm$ 0.77 \% & 32.19 $\pm$ 0.40 \% & 45.93 $\pm$ 0.40 \% \\
Hyperplanes-MAML{} (ours), $P=2400$, $m=0$ & 62.34 $\pm$ 0.82 \% & 81.81 $\pm$ 0.60 \% & 39.30 $\pm$ 0.37 \% & 63.18 $\pm$ 0.38 \% \\
Hyperplanes-MAML{} (ours), $P=2400$, $m=1.2$ & 62.44 $\pm$ 0.82 \% & 83.20 $\pm$ 0.58 \% & 41.86 $\pm$ 0.38 \% & 65.23 $\pm$ 0.37 \% \\
CACTUs{}-MAML (ours), $P=1$, $k=500$ & 66.49 $\pm$ 0.80 \% & 85.60 $\pm$ 0.53 \% & 45.04 $\pm$ 0.41 \% & 69.14 $\pm$ 0.36 \% \\
CACTUs{}-MAML (ours), $P=100$, $k=500$ & \textbf{68.84 $\pm$ 0.80 \%} & \textbf{87.78 $\pm$ 0.50 \%} & \textbf{48.09 $\pm$ 0.41 \%} & \textbf{73.36 $\pm$ 0.34 \%} \\
CACTUs{}-ProtoNets (ours), $P=100$, $k=500$ & \textbf{68.12 $\pm$ 0.84 \%} & 83.58 $\pm$ 0.61 \% & \textbf{47.75 $\pm$ 0.43 \%} & 66.27 $\pm$ 0.37 \% \\
\midrule
\textit{BiGAN}, $d=200$ \\
Embedding $k_\text{nn}$-nearest neighbors & 49.55 $\pm$ 1.27 \% & 68.06 $\pm$ 0.71 \% & 27.37 $\pm$ 0.33 \% & 46.70 $\pm$ 0.36 \% \\
Embedding linear classifier & 48.28 $\pm$ 1.25 \% & 68.72 $\pm$ 0.66 \% & 27.80 $\pm$ 0.61 \% & 45.82 $\pm$ 0.37 \% \\
Embedding MLP with dropout, $h=128$ & 40.54 $\pm$ 0.79 \% & 62.56 $\pm$ 0.79 \% & 19.92 $\pm$ 0.32 \% & 40.71 $\pm$ 0.40 \% \\
Embedding cluster matching, $k=500$ & 43.96 $\pm$ 0.80 \% & 58.62 $\pm$ 0.78 \% & 21.54 $\pm$ 0.32 \% & 31.06 $\pm$ 0.37 \% \\
Hyperplanes-MAML{} (ours), $P=2400$, $m=0$ & 53.60 $\pm$ 0.82 \% & 74.60 $\pm$ 0.69 \% & 29.02 $\pm$ 0.33 \% & 50.77 $\pm$ 0.39 \% \\
Hyperplanes-MAML{} (ours), $P=2400$, $m=0.5$ & 53.18 $\pm$ 0.81 \% & 73.55 $\pm$ 0.69 \% & 29.98 $\pm$ 0.35 \% & 50.14 $\pm$ 0.38 \% \\
CACTUs{}-MAML (ours), $P=1$, $k=500$ & 55.92 $\pm$ 0.80 \% & 76.28 $\pm$ 0.65 \% & 32.44 $\pm$ 0.35 \% & 54.22 $\pm$ 0.39 \% \\
CACTUs{}-MAML (ours), $P=100$, $k=500$ & 58.18 $\pm$ 0.81 \% & 78.66 $\pm$ 0.65 \% & 35.56 $\pm$ 0.36 \% & 58.62 $\pm$ 0.38 \% \\
CACTUs{}-ProtoNets (ours), $P=100$, $k=500$ & 54.74 $\pm$ 0.82 \% & 71.69 $\pm$ 0.73 \% & 33.40 $\pm$ 0.37 \% & 50.62 $\pm$ 0.39 \% \\
\midrule
\textit{Supervised meta-learning} \\
Oracle-MAML{} (control) & 94.46 $\pm$ 0.35 \% & 98.83 $\pm$ 0.12 \% & 84.60 $\pm$ 0.32 \% & 96.29 $\pm$ 0.13 \% \\
Oracle-ProtoNets (control) & 98.35 $\pm$ 0.22 \% & 99.58 $\pm$ 0.09 \% & 95.31 $\pm$ 0.18 \% & 98.81 $\pm$ 0.07 \% \\
\bottomrule
\\[-7pt]
\multicolumn{5}{l}{\makecell[bl]{\footnotesize $^\dagger$ Result used 64 filters per convolutional layer, 3$\times$ data augmentation, and folded the validation set into the training set \\ \footnotesize \hspace{4pt} after hyperparameter tuning.}} \\
\end{tabular}
\end{center}
\end{sidewaystable}
\begin{sidewaystable}
\footnotesize
\caption{miniImageNet object classification results averaged over 1000 tasks. $\pm$ denotes a 95\% confidence interval. $d$: dimensionality of embedding, $h$: number of hidden units in a fully connected layer, $k$: number of clusters in a partition, $P$: number of partitions used during meta-learning, $m$: margin on boundary-defining hyperplanes.}
\label{table:miniimagenet}
\begin{center}
\begin{tabular}{@{}lcccc@{}}
\toprule
Algorithm \hfill{} (way, shot) & (5, 1) & (5, 5) & (5, 20) & (5, 50) \\
\midrule
\textit{Baselines} \\
Training from scratch & 27.59 $\pm$ 0.59 \% & 38.48 $\pm$ 0.66 \% & 51.53 $\pm$ 0.72 \% & 59.63 $\pm$ 0.74 \% \\
\midrule
\textit{BiGAN}, $d=200$ \\
Embedding $k_\text{nn}$-nearest neighbors & 25.56 $\pm$ 1.08 \% & 31.10 $\pm$ 0.63 \% & 37.31 $\pm$ 0.40 \% & 43.60 $\pm$ 0.37 \% \\
Embedding linear classifier & 27.08 $\pm$ 1.24 \% & 33.91 $\pm$ 0.64 \% & 44.00 $\pm$ 0.45 \% & 50.41 $\pm$ 0.37 \% \\
Embedding MLP with dropout, $h=128$ & 22.91 $\pm$ 0.54 \% & 29.06 $\pm$ 0.63 \% & 40.06 $\pm$ 0.72 \% & 48.36 $\pm$ 0.71 \% \\
Embedding cluster matching, $k=500$ & 24.63 $\pm$ 0.56 \% & 29.49 $\pm$ 0.58 \% & 33.89 $\pm$ 0.63 \% & 36.13 $\pm$ 0.64 \% \\
Hyperplanes-MAML{} (ours), $P=4800$, $m=0$ & 20.00 $\pm$ 0.00 \% & 20.00 $\pm$ 0.00 \% & 20.00 $\pm$ 0.00 \% & 20.00 $\pm$ 0.00 \% \\
Hyperplanes-MAML{} (ours), $P=4800$, $m=0.9$ & 29.67 $\pm$ 0.64 \% & 41.92 $\pm$ 0.69 \% & 51.32 $\pm$ 0.71 \% & 54.72 $\pm$ 0.71 \% \\
CACTUs{}-MAML (ours), $P=1$, $k=500$ & 37.75 $\pm$ 0.74 \% & 52.59 $\pm$ 0.75 \% & 62.70 $\pm$ 0.68 \% & 67.98 $\pm$ 0.68 \% \\
CACTUs{}-MAML (ours), $P=50$, $k=500$ & 36.24 $\pm$ 0.74 \% & 51.28 $\pm$ 0.68 \% & 61.33 $\pm$ 0.67 \% & 66.91 $\pm$ 0.68 \% \\
CACTUs{}-ProtoNets (ours), $P=50$, $k=500$ & 36.62 $\pm$ 0.70 \% & 50.16 $\pm$ 0.73 \% & 59.56 $\pm$ 0.68 \% & 63.27 $\pm$ 0.67 \% \\
\midrule
\textit{DeepCluster}, $d=256$ \\
Embedding $k_\text{nn}$-nearest neighbors & 28.90 $\pm$ 1.25 \% & 42.25 $\pm$ 0.67 \% & 56.44 $\pm$ 0.43 \% & 63.90 $\pm$ 0.38 \% \\
Embedding linear classifier & 29.44 $\pm$ 1.22 \% & 39.79 $\pm$ 0.64 \% & 56.19 $\pm$ 0.43 \% & 65.28 $\pm$ 0.34 \% \\
Embedding MLP with dropout, $h=128$ & 29.03 $\pm$ 0.61 \% & 39.67 $\pm$ 0.69 \% & 52.71 $\pm$ 0.62 \% & 60.95 $\pm$ 0.63 \% \\
Embedding cluster matching, $k=500$ & 22.20 $\pm$ 0.50 \% & 23.50 $\pm$ 0.52 \% & 24.97 $\pm$ 0.54 \% & 26.87 $\pm$ 0.55 \% \\
Hyperplanes-MAML{} (ours), $P=4800$, $m=0$ & 20.02 $\pm$ 0.06 \% & 20.01 $\pm$ 0.01 \% & 20.00 $\pm$ 0.01 \% & 20.01 $\pm$ 0.02 \%\\
Hyperplanes-MAML{} (ours), $P=4800$, $m=0.1$ & 35.85 $\pm$ 0.66 \% & 49.54 $\pm$ 0.72 \% & 60.68 $\pm$ 0.69 \% & 65.55 $\pm$ 0.66 \% \\
CACTUs{}-MAML (ours), $P=1$, $k=500$ & 38.75 $\pm$ 0.70 \% & 52.73 $\pm$ 0.72 \% & 62.72 $\pm$ 0.69 \% & 67.77 $\pm$ 0.62 \% \\
CACTUs{}-MAML (ours), $P=50$, $k=500$ & \textbf{39.90 $\pm$ 0.74 \%} & \textbf{53.97 $\pm$ 0.70 \%} & \textbf{63.84 $\pm$ 0.70 \%} & \textbf{69.64 $\pm$ 0.63 \%} \\
CACTUs{}-ProtoNets (ours), $P=50$, $k=500$ & \textbf{39.18 $\pm$ 0.71 \%} & \textbf{53.36 $\pm$ 0.70 \%} & 61.54 $\pm$ 0.68 \% & 63.55 $\pm$ 0.64 \% \\
\midrule
\textit{Supervised meta-learning} \\
Oracle-MAML{} (control) & 46.81 $\pm$ 0.77 \% & 62.13 $\pm$ 0.72 \% & 71.03 $\pm$ 0.69 \% & 75.54 $\pm$ 0.62 \% \\
Oracle-ProtoNets (control) & 46.56 $\pm$ 0.76 \% & 62.29 $\pm$ 0.71 \% & 70.05 $\pm$ 0.65 \% & 72.04 $\pm$ 0.60 \% \\
\bottomrule
\end{tabular}
\end{center}
\end{sidewaystable}
\begin{table}[ht]
\footnotesize
\caption{CelebA facial attribute classification results averaged over 1000 tasks. $\pm$ denotes a 95\% confidence interval. $d$: dimensionality of embedding, $h$: number of hidden units in a fully connected layer, $k$: number of clusters in a partition, $P$: number of partitions used during meta-learning.}
\label{table:celeba}
\begin{center}
\begin{tabular}{@{}lcc@{}}
\toprule
Algorithm \hfill{} (way, shot) & (2, 5) \\
\midrule
\textit{Baselines} \\
Training from scratch & 63.19 $\pm$ 1.06 \% \\
\midrule
\textit{BiGAN}, $d=200$ \\
Embedding $k_\text{nn}$-nearest neighbors & 56.15 $\pm$ 0.89 \% \\
Embedding linear classifier & 58.44 $\pm$ 0.90 \% \\
Embedding MLP with dropout, $h=128$ & 56.26 $\pm$ 0.94 \% \\
Embedding cluster matching, $k=500$ & 56.20 $\pm$ 1.00 \% \\
CACTUs{}-MAML (ours), $P=50$, $k=500$ & \textbf{74.98 $\pm$ 1.02 \%} \\
CACTUs{}-ProtoNets (ours), $P=50$, $k=500$ & 65.58 $\pm$ 1.04 \% \\
\midrule
\textit{DeepCluster}, $d=256$ \\
Embedding $k_\text{nn}$-nearest neighbors & 61.47 $\pm$ 0.99 \% \\
Embedding linear classifier & 59.57 $\pm$ 0.98 \% \\
Embedding MLP with dropout, $h=128$ & 60.65 $\pm$ 0.98 \% \\
Embedding cluster matching, $k=500$ & 51.51 $\pm$ 0.89 \% \\
CACTUs{}-MAML (ours), $P=50$, $k=500$ & \textbf{73.79 $\pm$ 1.01 \%} \\
CACTUs{}-ProtoNets (ours), $P=50$, $k=500$ & \textbf{74.15 $\pm$ 1.02 \%} \\
\midrule
\textit{Supervised meta-learning} \\
Oracle-MAML{} (control) & 87.10 $\pm$ 0.85 \% \\
Oracle-ProtoNets (control) & 85.13 $\pm$ 0.92 \% \\
\bottomrule
\end{tabular}
\end{center}
\end{table}
\clearpage
\section{ImageNet Experiments}\label{app:imagenet}
We investigate unsupervised meta-learning in the context of a larger unsupervised meta-training dataset by using the ILSVRC 2012 dataset's training split \citep{russaskovsky2015imagenet}, which is a superset of the miniImageNet dataset (including meta-validation and meta-testing data) consisting of 1000 classes and over 1,200,000 images. To facilitate comparison to the previous miniImageNet experiments, for meta-validation and meta-test we use the miniImageNet meta-validation and meta-test splits. To avoid task leakage, we hold out all data from these 36 underlying classes from the rest of the data to construct the meta-training split.
For CACTUs{}, we use the best-performing unsupervised learning method from the previous experiments, DeepCluster, to obtain the embeddings. Following \citet{caron2018deep}, we run DeepCluster using the VGG-16 architecture with a 256-dimensional feature space and 10,000 clusters on the meta-training data until the normalized mutual information between the data-cluster mappings of two consecutive epochs converges. To our knowledge, no prior works have yet been published on using MAML for ImageNet-sized meta-learning. We extend the standard convolutional neural network model class with residual connections~\citep{he2016identity}, validate hyperparameters with supervised meta-learning, then use it for unsupervised meta-learning without further tuning. See Table~\ref{tab:maml_hyperparameters_imagenet} for MAML hyperparameters. The training from scratch, embedding $k_\text{nn}$-nearest neighbors, and embedding linear classifier algorithms are the same as they were in the previous sets of experiments. For Oracle-MAML{}, we generated tasks using the ground-truth 964 ImageNet meta-training classes. We also run semi-supervised MAML, with the meta-training tasks consisting of CACTUs-based tasks as well as tasks constructed from the 64 miniImageNet meta-training classes. The unsupervised/supervised task proportion split was fixed according to the ratio of the number of data available to each task proposal method. As before, the meta-learning methods only meta-learned on 1-shot tasks.
\begin{table}[H]
\caption{\footnotesize MAML hyperparameter summary for ImageNet.} \label{tab:maml_hyperparameters_imagenet}
\vspace{-0.3cm}
\begin{center}
\begin{tabular}{@{}lrrrr@{}}
\toprule
Hyperparameter & Value \\
\midrule
Input size & $224 \times 224$ \\
Outer (meta) learning rate & 0.0001 \\
Inner learning rate & 0.001 \\
Task batch size & 3 \\
Inner adaptation steps (meta-training) & 5 \\
Meta-training iterations & 240,000 \\
Adaptation steps (evaluation) & 100 \\
Classes per task (meta-training) & 5 \\
Shots per class (meta-training) & 1 \\
Queries per class & 5 \\
Residual blocks & 5 \\
Layers per residual block & 2 \\
\bottomrule
\end{tabular}
\end{center}
\vspace{-0.3cm}
\end{table}
We find that the vastly increased amount of unlabeled meta-training data (in comparison to miniImageNet) results in significant increases for all methods over their counterparts in Table~\ref{table:miniimagenet} (other than training from scratch, which does not use this data). We find that CACTUs{}-MAML slightly outperforms embedding linear classifier for the 1-shot test tasks, but that the linear classifier on top of the unsupervised embedding becomes better as the amount of test time supervision increases. Augmenting the unsupervised tasks with (a small number of) supervised tasks during meta-training results in slight improvement for the 1-shot test tasks. The lackluster performance of CACTUs{}-MAML is unsurprising insofar as meta-learning with large task spaces is still an open problem: higher shot Oracle-MAML{} only marginally stays ahead of the embedding linear classifier, which is not the case in the other, smaller-scale experiments. We expect that using a larger architecture in conjunction with MAML (such as~\citet{kim2018auto}) would result in increased performance for all methods based on MAML. Further, given the extensive degree to which unsupervised learning methods have been studied, we suspect that unsupervised task construction coupled with better meta-learning algorithms and architectures will result in improved performance on the entire unsupervised learning problem. We leave such investigation to future work.
\begin{sidewaystable}
\caption{miniImageNet object classification results averaged over 1000 tasks, with ImageNet-scale meta-training. $\pm$ denotes a 95\% confidence interval. $d$: dimensionality of embedding, $k$: number of clusters in a partition, $P$: number of partitions used during meta-learning.} \label{table:imagenet}
\begin{center}
\begin{tabular}{@{}lcccc@{}}
\toprule
Algorithm \hfill{} (way, shot) & (5, 1) & (5, 5) & (5, 20) & (5, 50) \\
\midrule
\textit{Baselines} \\
Training from scratch & 28.64 $\pm$ 0.55 \% & 39.71 $\pm$ 0.63 \% & 53.67 $\pm$ 0.75 \% & 59.68 $\pm$ 0.77 \% \\
\midrule
\textit{DeepCluster}, $d=256$ \\
Embedding $k_\text{nn}$-nearest neighbors & 50.17 $\pm$ 0.61 \% & 69.34 $\pm$ 0.51 \% & 79.81 $\pm$ 0.43 \% & 84.72 $\pm$ 0.34 \% \\
Embedding linear classifier & 58.73 $\pm$ 0.62 \% & \textbf{79.05 $\pm$ 0.44} \% & \textbf{87.41 $\pm$ 0.31} \% & \textbf{90.10 $\pm$ 0.27} \% \\
CACTUs{}-MAML (ours), $P=1, k=10000$ & \textbf{60.11 $\pm$ 0.74} \% & 76.42 $\pm$ 0.72 \% & 82.85 $\pm$ 0.66 \% & 85.25 $\pm$ 0.67 \% \\
\midrule
\textit{Semi-supervised meta-learning} \\
Semi-supervised MAML & 61.75 $\pm$ 0.75 \% & 76.43 $\pm$ 0.70 \% & 82.83 $\pm$ 0.69 \% & 85.27 $\pm$ 0.61 \% \\
\midrule
\textit{Supervised meta-learning} \\
Oracle-MAML{} (control) & 74.52 $\pm$ 0.77 \% & 86.23 $\pm$ 0.71 \% & 91.14 $\pm$ 0.69 \% & 92.06 $\pm$ 0.65 \% \\
\bottomrule
\end{tabular}
\end{center}
\end{sidewaystable}
\end{appendices}
\section{Experiments}
\vspace{-0.1cm}
We begin the experimental section by presenting our research questions and how our experiments are designed to address them. Links to code for the experiments can be found at \url{https://sites.google.com/view/unsupervised-via-meta}.
\textbf{Benefit of meta-learning}. Is there any significant benefit to doing meta-learning on tasks derived from embeddings, or is the embedding function already sufficient for downstream supervised learning of new tasks? To investigate this, we run MAML and ProtoNets on tasks generated via CACTUs{} (CACTUs{}-MAML, CACTUs{}-ProtoNets). We compare to five alternate algorithms, with four being supervised learning methods on top of the embedding function.
i) Embedding $k_\text{nn}$-nearest neighbors first infers the embeddings of the downstream task images. For a query test image, it predicts the plurality vote of the labels of the $k_\text{nn}$ training images that are closest in the embedding space to the query's embedding. ii) Embedding linear classifier also begins by inferring the embeddings of the downstream task images. It then fits a linear classifier using the $NK$ training embeddings and labels, and predicts labels for the query embeddings using the classifier.
iii) Embedding multilayer perceptron instead uses a network with one hidden layer of 128 units and tuned dropout~\citep{srivastava2014dropout}.
iv) To isolate the effect of meta-learning on images, we also compare to embedding cluster matching, i.e. directly using the meta-training clusters for classification by labeling clusters with a task's training data via plurality vote. If a query datapoint maps to an unlabeled cluster, the closest labeled cluster is used.
v) As a baseline, we forgo any unsupervised pre-training and train a model with the MAML architecture from standard random network initialization via gradient descent separately for each evaluation task.
\textbf{Different embedding spaces}. Does CACTUs{} result in successful meta-learning for many distinct task-generating embeddings?
To investigate this, we run unsupervised meta-learning using four embedding learning algorithms: ACAI~\citep{acai}, BiGAN~\citep{donahue2017adversarial}, DeepCluster~\citep{caron2018deep}, and InfoGAN~\citep{infogan}. These four approaches collectively cover the following range of objectives and frameworks in the unsupervised learning literature: generative modeling, two-player games, reconstruction, representation interpolation, discriminative clustering, and information maximization. We describe these methods in more detail in Appendix~\ref{app:zoo}.
\textbf{Applicability to different tasks}. Can unsupervised meta-learning yield a good prior for a variety of task types? In other words, can unsupervised meta-learning yield a good representation for tasks that assess the ability to distinguish between features on different scales, or tasks with various amounts of supervision signal? To investigate this, we evaluate our procedure on tasks assessing recognition of character identity, object identity, and facial attributes. For this purpose we choose to use the existing Omniglot~\citep{santoro2016meta} and miniImageNet~\citep{ravi2017optimization} datasets and few-shot classification tasks and, inspired by~\cite{finn2018probabilistic}, also construct a new few-shot classification benchmark based on the CelebA dataset and its binary attribute annotations. For miniImageNet, we consider both few-shot downstream tasks and tasks involving larger datasets (up to 50-shot). Specifics on the datasets and human-designed tasks are presented in Appendix~\ref{app:datasets}.
\textbf{Oracle}. How does the performance of our unsupervised meta-learning method compare to supervised meta-learning with a human-specified, near-optimal task distribution derived from a labeled dataset? To investigate this, we use labeled versions of the meta-training datasets to run MAML and ProtoNets as supervised meta-learning algorithms (Oracle-MAML, Oracle-ProtoNets). To facilitate fair comparison with the unsupervised variants, we control for the relevant hyperparameters.
\textbf{Task construction ablation}. How do the alternatives for constructing tasks from the embeddings compare? To investigate this, we run MAML on tasks constructed via clustering (CACTUs{}-MAML) and MAML on tasks constructed via random hyperplane slices of the embedding space with varying margin (Hyperplanes-MAML{}). The latter partitioning procedure is detailed in Appendix~\ref{app:hyperplanes}. For the experiments where tasks are constructed via clustering, we also investigate the effect of sampling based on a single partition versus multiple partitions. We additionally experiment with tasks based on random assignments of images to ``clusters'' (Random-MAML{}) and tasks based on pixel-space clusters (Pixels CACTUs{}-MAML) with the Omniglot dataset.
To investigate the limitations of our method, we also consider an easier version of our problem statement where the data distributions at meta-training and meta-test time perfectly overlap, i.e. the images share a common set of underlying labels (Appendix~\ref{app:mnist}). Finally, we present results on miniImageNet after unsupervised meta-learning on most of ILSVRC 2012 (Appendix~\ref{app:imagenet}).
\begin{figure}[ht]
\centering
\vspace{-0.2cm}
\includegraphics[width=\textwidth]{figures/clusters.pdf}
\vspace{-0.6cm}
\caption{\footnotesize Examples of three DeepCluster-embedding cluster-based classes (a) and a 2-way 5-shot test task (b) for two datasets. (a) Some of the clusters correspond well to unseen labels (top left, bottom left). Others exhibit semantic meaning despite members not being grouped as such in the labeled version of the dataset (top middle: pair of objects, bottom middle: white hat). Still others are uninterpretable (top right) or are based on image artifacts (bottom right). (b) We evaluate unsupervised pre-training based on the ability to learn downstream, human-designed tasks with held-out images and underlying classes.}
\label{fig:clusters}
\vspace{-0.2cm}
\end{figure}
\vspace{-0.1cm}
\subsection{Experimental Protocol Summary}
\vspace{-0.1cm}
As discussed by~\citet{oliver2018realistic}, keeping proper experimental protocol is particularly important when evaluating unsupervised and semi-supervised learning algorithms.
Our foremost concern is to avoid falsely embellishing the capabilities of our approach by overfitting to the specific datasets and task types that we consider. To this end, we adhere to two key principles. We do not perform any architecture engineering: we use architectures from prior work as-is, or lightly adapt them to our needs if necessary. We also keep hyperparameters related to the unsupervised meta-learning stage as constant as possible across all experiments, including the MAML and ProtoNets model architectures. Details on hyperparameters and architectures are presented in Appendix~\ref{app:hyperparameters}.
We assume knowledge of an upper bound on the number of classes $N$ present in each downstream meta-testing task for each dataset.
However, regardless of the number of shots $K$, we do not assume knowledge of $K$ during unsupervised meta-learning. We use $N$-way 1-shot tasks during meta-training, but test on larger values of $K$ during meta-testing.
We partition each dataset into meta-training, meta-validation, and meta-testing splits. For Omniglot and miniImageNet, these splits contain disjoint sets of classes.
For all algorithms, we run unsupervised pre-training on the unlabeled meta-training split and report performance on downstream tasks dictated by the \emph{labeled} data of the meta-testing split, generated using the procedure from prior work recounted in Section~\ref{sec:preliminaries}.
For the supervised meta-learning oracles, meta-training tasks are constructed in the same manner but from the dataset's meta-training split.
See Figure~\ref{fig:clusters} for illustrative examples of embedding-derived clusters and human-designed test tasks.
To facilitate analysis on meta-overfitting, we use the labels of the meta-validation split (instead of clustering embeddings) to construct tasks for meta-validation.
However, because our aim is to perform meta-learning without supervision,
we do not tune hyperparameters on this labeled data.
We use a fixed number of meta-training iterations, since there is no suitable criterion for early stopping.
When we experiment with the embedding-plus-supervised-learning methods used as fair comparisons to unsupervised meta-learning,
we err on the side of providing more supervision and data than technically allowed. Specifically, we separately tune the supervised learning hyperparameters for each dataset and each task difficulty on the labeled version of the meta-validation split. With DeepCluster embeddings, we also use the entire meta-testing split's statistics to perform dimensionality reduction (via PCA) and whitening, which is unfair as this shares information across tasks.
\vspace{-0.1cm}
\subsection{Results} \label{sec:image_results}
\vspace{-0.1cm}
Our primary results are summarized in Tables \ref{table:omniglot_ours} and \ref{table:miniimagenet_ours}. Task construction ablations are summarized in Tables \ref{table:omniglot_ablation} and \ref{table:miniimagenet_ablation}.
\textbf{Benefit of meta-learning}. CACTUs{}-MAML consistently yields a learning procedure that results in more successful downstream task performance than all other unsupervised methods, including those that learn on top of the embedding that generated meta-training tasks for MAML.
We find the same result for CACTUs{}-ProtoNets for 1-shot downstream tasks. However, as noted by~\citet{snell2017prototypical}, ProtoNets perform best when meta-training shot and meta-testing shot are matched; this characteristic prevents ProtoNets from improving upon ACAI for 20-way 5-shot Omniglot and upon DeepCluster for 50-shot miniImageNet.
We attribute the success of CACTUs{}-based meta-learning over the embedding-based methods to two factors: its practice in distinguishing between many distinct sets of clusters from modest amounts of signal, and the underlying classes of the meta-testing split data being out-of-distribution. In principle, the latter factor is solely responsible for the success over embedding cluster matching, since this algorithm can be viewed as a meta-learner on embeddings that trivially obtains perfect accuracy (via memorization) on the meta-training tasks. The same factor also helps explain why training from standard network initialization is, in general, competitive with directly using the task-generating embedding as a representation. On the other hand, the MNIST results (Table~\ref{table:mnist} in Appendix~\ref{app:tables}) suggest that when the meta-training and meta-testing data distributions have perfect overlap and the embedding is well-suited enough that embedding cluster matching can already achieve high performance, CACTUs{}-MAML yields only a small benefit, as we would expect.
\input{tables/omniglot_ours.tex}
\input{tables/miniimagenet_celeba_ours.tex}
\textbf{Different embedding spaces}. CACTUs{} is effective for a variety of embedding learning methods used for task generation. The performance of unsupervised meta-learning can largely be predicted by the performance of the embedding-based non-meta-learning methods. For example, the ACAI embedding does well with Omniglot, leading to the best unsupervised results with ACAI CACTUs{}-MAML. Likewise, on miniImageNet, the best performing prior embedding (DeepCluster) also corresponds to the best performing unsupervised meta-learner (DeepCluster CACTUs{}-MAML).
\textbf{Applicability to different tasks}. CACTUs{}-MAML learns an effective prior for a variety of task types. This can be attributed to the application-agnostic task-generation process and the expressive power of MAML~\citep{finn2018meta}.
We also observe that, despite all meta-learning models being trained for $N$-way $1$-shot classification of unsupervised tasks, the models work well for a variety of $M$-way $K$-shot tasks, where $M \leq N$ and $K \leq 50$. As mentioned previously, the representation that CACTUs{}-ProtoNets learns is best suited for downstream tasks which match the single shot used for meta-training.
\textbf{Oracle}. The penalty for not having ground truth labels to construct near-optimal tasks ranges from substantial to severe, depending on the difficulty of the downstream task. Easier downstream tasks (which have fewer classes and/or more supervision) incur less of a penalty. We conjecture that with such tasks, the difference in the usefulness of the priors matters less since the downstream task-specific evidence has more power to shape the posterior.
\textbf{Task construction ablation}. As seen in Tables~\ref{table:omniglot_ablation} and~\ref{table:miniimagenet_ablation}, CACTUs{}-MAML consistently outperforms Hyperplanes-MAML{} with any margin. We hypothesize that this is due to the issues with zero-margin Hyperplanes-MAML{} pointed out in Appendix~\ref{app:hyperplanes}, and the fact that nonzero-margin Hyperplanes-MAML{} is able to use less of the meta-training split to generate tasks than CACTUs{}-MAML is. We find that using multiple partitions for CACTUs{}-MAML, while beneficial, is not strictly necessary. Using non-zero margin with Hyperplanes-MAML{} is crucial for miniImageNet, but not for Omniglot. We conjecture that the enforced degree of separation between classes is needed for miniImageNet because of the dataset's high diversity. Meta-learning on random tasks or tasks derived from pixel-space clustering (Table \ref{table:omniglot_ablation}) results in a prior that is much less useful than any other considered algorithm, including a random network initialization; evidently, practicing badly is worse than not practicing at all.
\textbf{Note on overfitting}. Because of the combinatorially many unsupervised tasks we can create from multiple partitions of the dataset, we do not observe substantial overfitting to the unsupervised meta-training tasks. However, we observe that meta-training performance is sometimes worse than meta-test time performance, which is likely due to a portion of the automatically generated tasks being based on nonsensical clusters (for examples, see Figure~\ref{fig:clusters}). Additionally, we find that, with a few exceptions, using multiple partitions has a regularizing effect on the meta-learner: a diverse task set reduces overfitting to the meta-training tasks and increases the applicability of the learned prior.
\input{tables/omniglot_ablation.tex}
\input{tables/miniimagenet_ablation.tex}
\section{Discussion}
\vspace{-0.1cm}
We demonstrate that meta-learning on tasks produced using simple mechanisms based on embeddings improves upon the utility of these representations in learning downstream, human-specified tasks. We empirically show that this holds across benchmark datasets and tasks in the few-shot classification literature~\citep{santoro2016meta, ravi2017optimization, finn2018probabilistic}, task difficulties, and embedding learning methods while fixing key hyperparameters across all experiments.
In a sense, CACTUs{} can be seen as a facilitating interface between an embedding learning method and a meta-learning algorithm. As shown in the results, the meta-learner's performance significantly depends on the nature and quality of the task-generating embeddings. We can expect our method to yield better performance as the methods that produce these embedding functions improve, becoming better suited for generating diverse yet distinctive clusterings of the data.
However, the gap between unsupervised and supervised meta-learning will likely persist because, with the latter, the meta-training task distribution is human-designed to mimic the expected evaluation task distribution as much as possible. Indeed, to some extent, supervised meta-learning algorithms offload the effort of designing and tuning algorithms onto the effort of designing and tuning task distributions. With its evaluation-agnostic task generation, CACTUs{}-based meta-learning trades off performance in specific use-cases for broad applicability and the ability to train on unlabeled data. In principle, CACTUs{}-based meta-learning may outperform supervised meta-learning when the latter is trained on a misaligned task distribution. We leave this investigation to future work.
While we have demonstrated that $k$-means is a broadly useful mechanism for constructing tasks from embeddings, it is unlikely that combinations of $k$-means clusters in learned embedding spaces are universal approximations of arbitrary class definitions. An important direction for future work is to find examples of datasets and human-designed tasks for which CACTUs{}-based meta-learning results in ineffective downstream learning. This will result in better understanding of the practical scope of applicability for our method, and spur further development in automatic task construction mechanisms for unsupervised meta-learning.
A potential concern of our experimental evaluation is that MNIST, Omniglot, and miniImageNet exhibit particular structure in the underlying class distribution (i.e., perfectly balanced classes), since they were designed to be supervised learning benchmarks. In more practical applications of machine learning, such structure would likely not exist.
Our CelebA results indicate that CACTUs{} is effective even in the case of a dataset without neatly balanced classes or attributes. An interesting direction for future work is to better characterize the performance of CACTUs{} and other unsupervised pre-training methods with highly-unstructured, unlabeled datasets.
Since MAML and ProtoNets produce nothing more than a learned representation, our method can be viewed as deriving, from a previous unsupervised representation, a new representation particularly suited for learning downstream tasks.
Beyond visual classification tasks, the notion of using unsupervised pre-training is generally applicable to a wide range of domains, including regression, speech~\citep{oord2018representation}, language~\citep{howard2018universal}, and reinforcement learning~\citep{shelhamer2017loss}. Hence, our unsupervised meta-learning approach has the potential to improve unsupervised representations for a variety of such domains, an exciting avenue for future work.
\section{Introduction}\label{sec:introduction}
\vspace{-0.1cm}
Unsupervised learning is a fundamental, unsolved problem~\citep{hastie2009unsupervised} and has seen promising results in domains such as image recognition~\citep{le2013building} and natural language understanding~\citep{ramachandran2017unsupervised}. A central use case of unsupervised learning methods is enabling better or more efficient learning of downstream tasks by training on top of unsupervised representations~\citep{reed2014learning,cheung2015discovering,infogan} or fine-tuning a learned model~\citep{erhan2010does}. However, since the downstream objective requires access to supervision, the objectives used for unsupervised learning are only a rough proxy for downstream performance. If a central goal of unsupervised learning is to learn \emph{useful} representations, can we derive an unsupervised learning objective that explicitly takes into account how the representation will be used?
The use of unsupervised representations for downstream tasks is closely related to the objective of meta-learning techniques: finding a learning procedure that is more efficient and effective than learning from scratch.
However, unlike unsupervised learning methods, meta-learning methods require large, labeled datasets and hand-specified task distributions. These dependencies are major obstacles to widespread use of these methods for few-shot classification.
To begin addressing these problems, we propose an unsupervised meta-learning method: one which aims to learn a learning procedure,
without supervision, that is useful for solving a wide range of new, human-specified tasks.
With only raw, unlabeled observations, our model's goal is to learn a useful prior such that, after meta-training, when presented with a modestly-sized dataset for a human-specified task, the model can transfer its prior experience to efficiently learn to perform the new task. If we can build such an algorithm, we can enable few-shot learning of new tasks without needing any labeled data nor any pre-defined tasks.
To perform unsupervised meta-learning, we need to automatically construct tasks from unlabeled data. We study several options for how this can be done.
We find that a good task distribution should be diverse, but also not too difficult: na\"{i}ve random approaches for task generation produce tasks that contain insufficient regularity to enable useful meta-learning.
To that end, our method proposes tasks by first leveraging prior unsupervised learning algorithms to learn an embedding of the input data, and then performing an overcomplete partitioning of the dataset to construct numerous categorizations of the data.
We show how we can derive classification tasks from these categorizations for use with meta-learning algorithms.
Surprisingly, even with simple mechanisms for partitioning the embedding space, such as $k$-means clustering, we find that meta-learning acquires priors that, when used to learn new, human-designed tasks, learn those tasks more effectively than methods that directly learn on the embedding. That is, the learning algorithm acquired through unsupervised meta-learning achieves better downstream performance than the original representation used to derive meta-training tasks, without introducing any additional assumptions or supervision. See Figure~\ref{fig:illustration} for an illustration of the complete approach.
The core idea in this paper is that we can leverage unsupervised embeddings to propose tasks for a meta-learning algorithm, leading to an unsupervised meta-learning algorithm that is particularly effective as pre-training for human-specified downstream tasks. In the following sections, we formalize our problem assumptions and goal, which match those of unsupervised learning, and discuss several options for automatically deriving tasks from embeddings.
We instantiate our method with two meta-learning algorithms and compare to prior state-of-the-art unsupervised learning methods. Across four image datasets (MNIST, Omniglot, miniImageNet, and CelebA), we find that our method consistently leads to effective downstream learning of a variety of human-specified tasks, including character recognition tasks, object classification tasks, and facial attribute discrimination tasks, without requiring any labels or hand-designed tasks during meta-learning and where key hyperparameters of our method are held constant across all domains.
We show that, even though our unsupervised meta-learning algorithm trains for one-shot generalization, one instantiation of our approach performs well not only on few-shot learning, but also when learning downstream tasks with up to $50$ training examples per class.
In fact, some of our results begin to approach the performance of fully-supervised meta-learning techniques trained with fully-specified task distributions.
\begin{figure}[htbp]
\begin{center}
\includegraphics[width=0.95\textwidth]{figures/illustration}
\end{center}
\vspace{-0.3cm}
\caption{\footnotesize Illustration of the proposed unsupervised meta-learning procedure. Embeddings of raw observations are clustered with $k$-means to construct partitions, which give rise to classification tasks. Each task involves distinguishing between examples from $N=2$ clusters, with $K_\text{m-tr}=1$ example from each cluster being a training input. The meta-learner's aim is to produce a learning procedure that successfully solves these tasks.}
\label{fig:illustration}
\end{figure}
\section{Related Work} \label{Related Work}
\vspace{-0.15cm}
The method we propose aims to address the unsupervised learning problem~\citep{hastie2009unsupervised,le2013building}, namely acquiring a transferable learning procedure without labels. We show that our method is complementary to a number of unsupervised learning methods, including ACAI~\citep{acai}, BiGAN~\citep{donahue2017adversarial,dumoulin2017adversarially}, DeepCluster~\citep{caron2018deep}, and InfoGAN~\citep{infogan}: we leverage these prior methods to learn embeddings used for constructing meta-learning tasks, and demonstrate that our method learns a more useful representation than the embeddings. The ability to use what was learned during unsupervised pre-training to better or more efficiently learn a variety of downstream tasks is arguably one of the most practical applications of unsupervised learning methods, which has a long history in neural network training~\citep{hinton2006fast,bengio2007greedy,ranzanto2006efficient,vincent2008extracting,erhan2010does}. Unsupervised pre-training has demonstrated success in a number of domains, including speech recognition~\citep{yu2010roles}, image classification~\citep{zhang2017split}, machine translation~\citep{ramachandran2017unsupervised}, and text classification~\citep{dai2015semi,howard2018universal,radford2018improving}.
Our approach, unsupervised meta-learning, can be viewed as an unsupervised learning algorithm that explicitly optimizes for few-shot transferability. As a result, we can expect it to better learn human-specified downstream tasks, compared to unsupervised learning methods that optimize for other metrics, such as reconstruction~\citep{vincent2010stacked,higgins2017beta}, fidelity of constructed images~\citep{radford2016unsupervised,salimans2016improved,donahue2017adversarial,dumoulin2017adversarially}, representation interpolation~\citep{acai}, disentanglement~\citep{bengio2013representation,reed2014learning,cheung2015discovering,infogan,mathieu2016disentangling,denton2017unsupervised}, and clustering~\citep{coates2012learning,krahenbuhl2016data,bojanowski2017unsupervised,caron2018deep}. We empirically evaluate this hypothesis in the next section. In contrast to many previous evaluations of unsupervised pre-training, we focus on settings in which only a small amount of data for the downstream tasks is available, since this is where the unlabeled data can be maximally useful.
Unsupervised pre-training followed by supervised learning can be viewed as a special case of the semi-supervised learning problem~\citep{zhu2011semi,kingma2014semi,rasmus2015semi,oliver2018realistic}. However, in contrast to our problem statement, semi-supervised learning methods assume that a significant proportion of the unlabeled data, if not all of it, shares underlying labels with the labeled data. Additionally, our approach and other unsupervised learning methods are well-suited for transferring their learned representation to many possible downstream tasks or labelings, whereas semi-supervised learning methods typically optimize for performance on a single task, with respect to a single labeling of the data.
Our method builds upon the ideas of meta-learning~\citep{schmidhuber1987evolutionary,bengio1991learning,naik1992meta} and few-shot learning~\citep{santoro2016meta,vinyals2016matching,ravi2017optimization,munkhdalai2017meta,snell2017prototypical}. We apply two meta-learning algorithms, model-agnostic meta-learning~\citep{finn2017model} and prototypical networks~\citep{snell2017prototypical}, to tasks constructed in an unsupervised manner. Similar to our problem setting, some prior works have aimed to learn an unsupervised learning procedure with supervised data~\citep{garg2017supervising,metz2018learning}. Instead, we consider a problem setting that is entirely unsupervised, aiming to learn efficient learning algorithms using unlabeled datasets. Our problem setting is similar to that considered by~\citet{gupta2018unsupervised}, but we develop an approach that is suitable for supervised downstream tasks, rather than reinforcement learning problems, and demonstrate our algorithm on problems with high-dimensional visual observations.
| {'timestamp': '2019-03-25T01:04:27', 'yymm': '1810', 'arxiv_id': '1810.02334', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02334'} | arxiv |
\section{Introduction}
\label{sec:intro}
\IEEEPARstart{M}{edical} imaging is a cornerstone of modern healthcare providing unique diagnostic, and increasingly therapeutic, capabilities that affect patient care. The range of medical imaging modalities is wide but in essence they provide anatomical and functional information about structure and physiopathology. The multi-modality $^{18}$F-Fluorodeoxyglucose (FDG) positron emission tomography and computed tomography (PET-CT) scanner is regarded as the imaging device of choice for the diagnosis, staging, and assessment of treatment response in many cancers~\cite{kligerman2009_petctlung}. PET-CT combines the sensitivity of PET to detect regions of abnormal function and anatomical localization from CT~\cite{blodgett2007_petct}. With PET, sites of disease usually display greater FDG uptake (glucose metabolism) than normal structures. The spatial extent of the disease within a particular structure, however, cannot be accurately determined due to the inherent lower resolution of PET when compared to CT and MR imaging, tumor heterogeneity, and the partial volume effect~\cite{wahl2009_percistpetct}. CT provides the anatomical localization of sites of abnormal FDG uptake in PET and so adds precision to image interpretation~\cite{bagci2013_multimodseg}. One example clinical domain that has benefited greatly from PET-CT imaging is the evaluation of non-small cell lung cancer (NSCLC), the most common type of lung cancer. In NSCLC, the extent of the disease at diagnosis is the most important determinant of patient outcome: whether it is restricted to the lung parenchyma, involved the lung plus regional lymph nodes at the pulmonary hilum and/or mediastinum, extends into the mediastinum or chest wall directly, or has spread beyond the thorax. PET-CT is able to detect sites of disease where there are no abnormalities in the underlying structure on CT, hence its value in patient management~\cite{detterbeck2009_cancerstage,edge2010_ajcc,edge2010_ajcctnm,tatci2015_petctmediasitnum}.
The role of PET-CT in cancer care has provoked extensive research into methods to detect, classify, and retrieve PET-CT images~\cite{teramoto2016_petctpulmnod,bi2017_petctclass,xu2018_petctbone,milletari2016_vnet,zhong2018_petctunet,zhao2015_petctpulmnodsvm,lartizien2014_cadpetct,song2014_lesiondetectseppetct,song2013_petcttumsegsepgraph,han2011_ipmipetctseg,bradshaw2018_vgg3chanpetct,song2012_tumlymhpetct,bi2014_petctmultistage,kumar2014_media}. These methods can be separated into those that: (i) process each modality separately and then combine the modality-specific features~\cite{teramoto2016_petctpulmnod,bi2017_petctclass,xu2018_petctbone,milletari2016_vnet,zhong2018_petctunet,zhao2015_petctpulmnodsvm,lartizien2014_cadpetct,song2014_lesiondetectseppetct,song2013_petcttumsegsepgraph,han2011_ipmipetctseg}, and (ii) combine or fuse complementary features from each modality~\cite{bradshaw2018_vgg3chanpetct,song2012_tumlymhpetct,bi2014_petctmultistage,kumar2014_media}. Methods that process each modality separately are inherently limited when the intent is to consider both the function and anatomical extent of disease. For example, in a chest CT depicting a lung tumor that is causing collapse in adjacent lung tissue, both the tumor and the collapse can appear identical. Similarly, some areas of high FDG uptake on PET images may be linked to normal physiological uptake, such as in the heart, and these regions need to be filtered out based upon knowledge about anatomical characteristics from CT to differentiate them from abnormal PET regions~\cite{boellaard2015_petctguidelines,kroiss2013_petctuptake,rosenbaum2006_falsepositiveuptake,blodgett2005_petctheadneck}. In contrast, methods that fuse information from the two modalities often use \emph{a priori} knowledge about characteristics of the different modalities to `prioritize' information from one of the two modalities for different tasks. Alternatively, they may fuse information using a representation that models relationships between the two modalities. The fusion is particularly necessary in cases where different imaging modalities identify different attributes of the same region of interest (ROI), with no one modality capturing the entire ROI~\cite{bird2015_multimodgtv}. Bagci et al.~\cite{bagci2013_multimodseg} proposed a method to simultaneously delineate ROIs in PET, PET-CT, PET-MR imaging, and fused MR-PET-CT images using a random walk segmentation algorithm with an automated similarity-based seed selection process. Zhao et al.~\cite{zhao2015_petctpulmnodsvm} combined dynamic thresholding, watershed segmentation, and support vector machine (SVM) classification to classify solitary pulmonary nodules on the basis of CT texture features and PET metabolic features. Similarly, Lartizien et al.~\cite{lartizien2014_cadpetct} used texture feature selection and SVM classification for staging of lymphoma patients. Y. Song et al.~\cite{song2014_lesiondetectseppetct}, Q. Song et al.~\cite{song2013_petcttumsegsepgraph}, and Ju et al.~\cite{ju2015_randwalkcutsegpetct} used the context of PET and CT regions to characterize tumors with spatial and visual consistency. Han et al.~\cite{han2011_ipmipetctseg} segmented tumors from PET-CT images, formulating the problem as a Markov Random Field with modality-specific energy terms for PET and CT characteristics. In our prior work~\cite{song2012_tumlymhpetct,bi2014_petctmultistage}, we used multi-stage discriminative models to classify ROIs in the thoracic PET-CT images and in full-body lymphoma studies. In our PET-CT retrieval research~\cite{kumar2014_media,kumar2014_embc}, we have also derived a graph-based model that attempts to bridge the semantic gap by modeling the spatial characteristics that are important for lung cancer staging~\cite{detterbeck2009_cancerstage}. These methods are highly dependent upon an external predefined specification of the relationship between the features from both modalities. Hence, the ability to derive an application-specific fusion would reduce this dependency.
For multi-modality medical imaging, fusion is necessary for computer aided diagnosis tasks such as image visualization, lesion detection, lesion segmentation, and disease classification. For example, Li et al.~\cite{li2018_fusiondenoiseenhance} designed a fusion technique for denoising and enhancing the visual details in multi-modality medical images, while Tong et al.~\cite{tong2017_mmclassalz} fused information from MR and PET images with clinical and genetic biomarkers to predict Alzheimer's disease. Current image fusion strategies in the general (non-medical) domain derive spatially varying fusion weights from the local visual characteristics of the different image data~\cite{li2017_fusionreview}. Features such as pixel variance, contrast, and color saturation are used to derive task-specific fusion ratios for different regions of interest (ROIs) within the images~\cite{kumar2009_variationfusion,shen2012_multifusion}. These fusion methods can thus adapt to and prioritize different content at different locations in the images according to the underlying image features that are relevant to the different images being analyzed. This results in the capacity to enhance specific information from different image data for different tasks. In the case of cancer, a disease that can spread throughout the body, a spatially varying fusion may enhance analysis of the multi-modality medical image data~\cite{hatt2011_petcttumheterogseg}. This may enable greater scrutiny of heterogeneous tumors, better investigation of tumours at and across different tissue boundaries (e.g., tumor invasion of adjacent anatomical structures)~\cite{nagamachi2013_petmrinvasion}, and through integration into visualisation pipelines improve clinicians' interpretation of a patient’s data (e.g., for disease staging)~\cite{boellaard2009_eanmpetctguide}.
Our hypothesis is that the derivation of an appropriate spatially varying fusion of multi-modality image data should be learned from the underlying visual features of the individual images, as this will enable a better integration of the complementary information within each modality. The state-of-the-art in feature learning, selection, and extraction are deep learning methods~\cite{bengio2013_replearn,lecun2015_DLnature}. Convolutional neural networks (CNNs)~\cite{krizhevsky2012_alexnet} are deep learning methods for object detection, classification, and analysis of image data. CNNs have achieved better results than non-deep learning methods in many benchmark tasks, e.g., the ImageNet Large Scale Visual Recognition Challenge~\cite{russakovsky2015_imagenet}. This dominance relates to the ability of CNNs to implicitly learn image features that are `meaningful' for a given task directly from the image data.
Initial research in medical image analysis used CNN approaches that `transferred' features learned from a non-medical domain and tuned them to a specific medical task~\cite{shin2016_cnntransfer,tajbakhsh2016_cnnfinetune}, e.g., classification of the modality of the medical images depicted in research literature~\cite{kumar2017_jbhi}, and the localization of planes in fetal ultrasound images~\cite{chen2015_usloc}. Later studies designed new CNNs for specific clinical challenges, such as the classification of interstitial lung disease in CT images~\cite{anthimopoulos2016_cnnild}. Transfer learning approaches have also been used for multi-modality image classification~\cite{bi2017_petctclass,bradshaw2018_vgg3chanpetct}. Bi et al.~\cite{bi2017_petctclass} used domain-transferred CNNs to extract PET features for PET-CT lymphoma classification. Bradshaw et al.~\cite{bradshaw2018_vgg3chanpetct} fine-tuned a CNN (pre-trained on ImageNet data) for PET-CT images in a multi-channel input approach, using a CT slice and two maximum intensity projections of the PET data as the inputs.
CNNs have also been specifically trained for a number of multi-modality medical image analysis applications. One area of focus are brain MR images obtained with different sequences that are often treated as multi-modality images with the reasoning that the different MR images showed different aspects of the same anatomical structure~\cite{zhang2015_neuromm,tseng2017_crossmodconv,vantulder2017_sharedcrossmod}. Zhang et al.~\cite{zhang2015_neuromm} designed a CNN-based segmentation approach for brain MR images based upon this reasoning. Similarly, Tseng et al.~\cite{tseng2017_crossmodconv} segmented ROIs with complementary features that were learned via a convolution across the different MR images. Van Tulder and de Bruijne~\cite{vantulder2017_sharedcrossmod} used an unsupervised approach to learn a shared data representation of MR images, which acted as a robust feature descriptor for classification applications. In the wider, multi-modality image domain, Liu et al.~\cite{liu2018_mrctattencorr} used a convolutional autoencoder to detect air, bone, and soft tissue for attenuation correction in PET-MR images. Teramoto et al.~\cite{teramoto2016_petctpulmnod} used a CNN as a second stage classifier to determine if candidate lung nodules in PET-CT were false positives. Xu et al.~\cite{xu2018_petctbone} cascaded two V-Nets~\cite{milletari2016_vnet} to detect bone lesions, using CT alone as the input to the first V-Net and a pre-fused PET-CT image for the second. Zhao et al.~\cite{zhao2018_tumorpetctseg} also used V-Nets in a multi-branch paradigm for lung tumor segmentation. Similarly, Zhong et al.~\cite{zhong2018_petctunet} trained one U-Net~\cite{ronneberger2015_unet} for PET and one for CT, combining the results using a graph cut algorithm. Li et al.~\cite{li2019_dlpetctseg} reported a variational model that integrated PET pixel intensity with a CNN-derived CT probability map to segment lung tumors. In general, CNNs have been applied to multi-modality image data as feature extractors and classifiers without consideration of how the features from each modality were combined, relying either on pre-fusion of the input data or independent processing of each input modality. In addition, recent research on CNN-based PET-CT lung tumor segmentation~\cite{zhao2018_tumorpetctseg,zhong2018_petctunet,li2019_dlpetctseg} learned from image patches centered around the tumor and did not consider variation of PET and CT image features for tumors occurring in different anatomical locations.
Our aim was to improve fusion of the complementary information in multi-modality images for automatic medical image analysis. In particular, we focus on image data that depict disease across multiple anatomical locations. We present a new CNN that learns to fuse complementary anatomical and functional data from PET-CT images in a spatially varying manner. The novelty of our CNN is its ability to produce a fusion map that explicitly quantifies the fusion weights for the features in each modality. This is in contrast to CNNs that use multi-channel inputs~\cite{bradshaw2018_vgg3chanpetct,zhang2015_neuromm}, where modalities are implicitly fused, or modality-specific encoder branches~\cite{teramoto2016_petctpulmnod,vantulder2017_sharedcrossmod,zhong2018_petctunet,zhong2019_simultaneouscosegpetct}, where the modality-specific features are concatenated at a later stage. Our co-learning CNN is intended as a general approach for integrating PET and CT information, with components that can be leveraged and optimized for a number of different medical image analysis tasks, such as visualization, classification, and segmentation. To demonstrate the efficacy of our CNN, we conducted experimental comparisons with baseline fusion and tumor segmentation methods on PET-CT lung cancer images.
\section{Methods}
\label{sec:methods}
\subsection{Materials}
\label{sec:methods:materials}
Our dataset comprised 50 FDG PET-CT scans of patients with biopsy-proven NSCLC. Since our intention was to analyze the thorax, our imaging specialist chose representative cases that included patients with solitary lung primary tumors with and without hilar (Stage II) and mediastinal (Stage III) nodal involvement and those where the tumour involved the mediastinum and the chest wall. These cases were chosen from the imaging archive of the Department of Molecular Imaging at the Royal Prince Alfred Hospital, Sydney, Australia over consecutive cases in a three month period. All studies were acquired on a Biograph 128-slice mCT (PET-CT scanner; Siemens Healthineers, Hoffman Estates, Il, USA). The mCT is a high-resolution tomograph with high-definition reconstruction, time-of-flight and flow motion characteristics. Each study comprised one CT volume and one PET volume: the CT resolution was $512 \times 512$ pixels at 0.98mm $\times$ 0.98mm, the PET resolution was 200 $\times$ 200 pixels at 4.07mm $\times$ 4.07mm, with a slice thickness and an interslice distance of 3mm. Both volumes were reconstructed with the same number of slices. Studies contained between 1 to 7 tumors (inclusive) in the thorax. The tumor locations included the different lung lobes, the mediastinum, and hilar nodes. All data were de-identified.
The images were rescaled to a resolution of $256 \times 256$ pixels (x-y axes); rescaling the PET and CT volumes so that they share the same coordinate space is a standard process for analysis of PET-CT data~\cite{zhong2019_simultaneouscosegpetct,han2011_ipmipetctseg,li2019_dlpetctseg,zhao2018_tumorpetctseg}. The PET images were normalized by a transformation to standard uptake values (SUVs). The SUV is a semi-quantitative value of the degree of FDG taken up by the sites of tumor relative to isotope dose and patient mass~\cite{thie2004_suv}. The thorax subvolume (set of 2D thorax slices) of each study were manually identified (mean: 86.5 slices, standard deviation: 6.8 slices). To ensure a balanced class distribution for CNN training, we used the ground truth to select only the axial thorax slices containing all ROIs (lungs, mediastinum, tumors), producing a final dataset of 855 PET-CT slice pairs (855 CT, 855 PET). This sampling is a standard strategy for learning from imbalanced data~\cite{he2008_unbalancedlearning}.
The ground truth was derived from the diagnostic imaging report which detailed the locations of the primary tumor and any involved thoracic lymph nodes. All reports were done by a single, experienced imaging specialist who has read over 80,000 PET and PET-CT scans. We used the report findings to drive a semi-automatic process for ROI labeling. We applied a commonly used adaptive thresholding algorithm~\cite{hu2001_lungseg} to extract the lung ground truth from the CT volume. Similarly, we used connected thresholding to coarsely determine the mediastinum. We extracted the tumor ground truth using 40\% peak SUV connected thresholding to detect the `hot spots’ identified in the diagnostic reports, which is a general cutoff that is widely used when examining tumors in PET images~\cite{bradley2004_suvseg,hong2007_correlationpetsuvuptake,pak2018_prognosticpetsuv,morand2018_suvmax}. Minor manual adjustments were performed to facilitate extraction of the ground truth ROIs (e.g., preventing the left and right lung fields from being joined together with the edge of the mediastinum).
We randomly divided the 50 PET-CT studies into 5 distinct training and test sets for use in a 5-fold cross validation evaluation protocol (see Section~\ref{sec:methods:eval}). Each training set comprised the slices from 40 studies and its associated test set comprised slices from the 10 other studies. A step-by-step description of our dataset creation process is provided in the Supplementary Materials (Section~SIV).
\subsection{Architecture Design}
\label{sec:methods:arch}
\begin{figure}[!t]
\centering
\includegraphics[width=\columnwidth,keepaspectratio]{kumar1}
\caption{The architecture of our CNN, comprising two modality-specific encoders, a co-learning component, and a reconstruction component; the black lines indicate inputs to operations as skip connections between non-adjacent layers. The input to each modality-specific encoder is a 2D image slice of the corresponding modality.}
\label{fig:arch}
\end{figure}
Fig.~\ref{fig:arch} shows the architecture of our proposed CNN; note that the number alongside each feature map in the figure refers to the number of output channels in the feature map. Our CNN comprises four main components: two encoders (one for each modality), one co-learning and fusion component, and a reconstruction component. The purpose of the two encoders is to derive the image features that are most relevant to each specific image modality; the input to each encoder is an axial 2D image slice. The co-learning component uses the modality-specific features produced by the encoders to derive a spatially varying fusion map to weight the modality-specific features at different locations. Finally, the reconstruction component integrates the modality-specific fused features across multiple scales to produce the final prediction map. The components are described in detail in the following subsections.
\subsection{Modality-Specific Encoders}
\label{sec:methods:encoder}
Our CNN contains an encoder for PET images and a separate encoder for CT images. The purpose of each encoder is to extract the visual features that are relevant to the input image modality. Thus, the encoders were designed with stacked convolutional layers in a similar manner to the deep CNNs that have achieved high accuracy in image classification tasks, e.g., AlexNet~\cite{krizhevsky2012_alexnet} and VGGNet~\cite{chatfield2014_devil,simonyan2014_vgg}. As shown in Fig.~\ref{fig:arch}, each encoder comprises four blocks that each contain two convolutional layers for feature map generation and a max pooling layer to down-sample the feature maps.
A consequence of this stacked structure is that as the weights of each layer change, the distribution of the outputs they produce also change, potentially influencing the convolutional layers later in the network. During training, this means that even small changes in the weights of one layer may cascade and be amplified in deeper layers, requiring the layers to continuously adapt to new input distributions~\cite{shimodaira2000_inputdistshift}. As our CNN includes inputs from two different imaging modalities, the co-learning and reconstruction components will be affected by the cascading weight changes from both encoders, which will slow convergence and thus hinder the learning process.
Let $F = W \ast X + b$ be the output feature map of a convolutional layer where $X$ is the input to the convolution layer, $\ast$ is the convolution operation, $W$ is the learned weights of the convolution layer, and $b$ is the learned bias of the convolution layer. We use a batch normalization layer~\cite{ioffe2015_batchnorm} to normalize every dimension of the output feature map $F$ to a distribution with zero mean and unit variance, which acts to reduce the impact when the feature map is used as an input for subsequent convolutional layers.
We use the leaky rectified linear unit (Leaky ReLU) activation function~\cite{maas2013_leakyrelu} after feature map normalization:
\begin{equation}
\psi_\alpha(\hat{f}) =
\begin{cases}
\hat{f}, & \hat{f} > 0 \\
\alpha\cdot\hat{f}, & \hat{f} \leq 0
\end{cases}
\label{eq:leakyrelu}
\end{equation}
where $\hat{f}$ is a normalized feature and $\alpha$ is a parameter controlling the `leakiness' of the activation function, with the constraint that $0 < \alpha < 1$. The Leaky ReLU activation avoids the dead neuron problem that can occur with the standard ReLU function~\cite{maas2013_leakyrelu} where some weights in $W$ can be updated to a value where their training gradients are forever stuck at 0, thus preventing the weights from being updated in the future. The parameter $\alpha$ enables the introduction of a small non-zero gradient when $\hat{f} < 0$, thereby preventing the weights from being stuck at an unrecoverable value. For simplicity of notation, we refer to the output of a convolutional layer by $\hat{F} = \psi_\alpha(W \ast X + b)$ as the feature map generated from $X$ after convolution, batch normalization, and activation.
\subsection{Multi-modality Feature Co-Learning and Fusion}
\label{sec:methods:colearn}
\begin{figure}[!t]
\centering
\includegraphics[width=\columnwidth,keepaspectratio]{kumar2}
\caption{A conceptual example of the co-learning unit that learns to derive the fusion from the feature maps of each modality; for simplicity the figure shows co-learning on a single feature map channel.}
\label{fig:colearn}
\end{figure}
The co-learning component consists of two parts: (i) a co-learning unit that is a CNN that learns to derive spatially varying fusion maps, and a (ii) fusion operation that uses the fusion maps to prioritize different features. Fig.~\ref{fig:colearn} shows a conceptual example of the function of the multi-modality co-learning unit. The inputs to the co-learning unit are two feature maps $\hat{F}_{CT}$ and $\hat{F}_{PET}$ (each from a block of one modality-specific encoder), each of size $w \times h \times c$ with $w$ width, $h$ height, and $c$ channels. These feature maps are stacked to form $\hat{X}_{multi}$, a $w \times h \times m \times c$ tensor with $m = 2$ number of modalities. The channels of $\hat{X}_{multi}$ are then convolved with the channels of a learnable 3D kernel $W_{multi}$ of size $k \times k \times m$, where $k$ is the width and height of the kernel, and $m = 2$ is the number of modalities.
By performing a 3D convolution~\cite{ji2013_3dcnn} without padding the modality dimension, we obtain for a given channel $c$ a feature map with a singleton third dimension where the value at location $(x,y)$ is determined from the neighborhood of both $\hat{F}_{CT}(x,y)$ and $\hat{F}_{PET}(x,y)$:
\begin{equation}
\begin{split}
(&W_{multi} \ast \hat{X}_{multi})(x,y) \\
& = \sum_{i}\sum_{j}\sum_{l} W_{multi}(i, j, l) \cdot \hat{X}_{multi}(x-i,y-j,l)
\end{split}
\label{eq:conv-3d}
\end{equation}
We then squeeze the singleton third dimension to obtain an output feature map $W_{multi} \ast \hat{X}_{multi}$ of size $w \times h \times 2c$, the same width and height as the two modality-specific input feature maps $\hat{F}_{CT}(x,y)$ and $\hat{F}_{PET}(x,y)$ and double the number of channels, which is important for the weighting of modality-specific feature maps by the co-learned fusion maps as described below.
Our intention is that the co-learned fusion map controls the level of importance given to information from each modality at each location, in contrast to the global fusion ratio in PET-CT pixel intermixing~\cite{cai1999_dataintermix,quon2006_petctpilot,cheirsilp2015_petctthoracic}. Thus the co-learned fusion maps directly affect the input distribution of the learnable layers that immediately follow the co-learning unit. Hence, we do not normalize the output of the 3D convolution within the co-learning unit. As with the encoders (see Section~\ref{sec:methods:encoder}), we used a Leaky ReLU activation function to obtain the multi-modality co-learned fusion map:
\begin{equation}
F_{fusion} = \psi\left(W_{multi} \ast \hat{X}_{multi} + b_{multi}\right)
\label{eq:colearn}
\end{equation}
where $b_{multi}$ are the learned biases. Note that the multi-modality fusion map $F_{fusion}$ is obtained by the co-learning unit based on the spatial integration of the features from both modalities, since the 3D convolution operation considers the 3D neighborhood defined by the width, height, and modality of the stacked feature map $\hat{X}_{multi}$.
\begin{figure}[!t]
\centering
\includegraphics[width=\columnwidth,keepaspectratio]{kumar3}
\caption{Multiplying the spatially varying fusion map ($F_{fusion}$) with the stacked modality-specific feature maps ($\hat{F}_{CT} \oplus \hat{F}_{PET}$) to generate a fused co-learned feature map ($F_{co-learned}$). Element-wise multiplication ensures that each value in $F_{co-learned}$ is a weighted form of a modality-specific feature. The red circles and blue circles indicate the element-wise multiplication of CT and PET features, respectively.}
\label{fig:fusion}
\end{figure}
The fusion operation (depicted in Fig.~\ref{fig:fusion}) integrates the modality-specific feature maps according to the values (coefficients) in the multi-modality fusion map, as follows:
\begin{equation}
F_{fused} = F_{fusion} \otimes \left(\hat{F}_{CT} \oplus \hat{F}_{PET}\right)
\label{eq:fusion}
\end{equation}
where $F_{fused}$ is the fused co-learned feature map, $\oplus$ is the stacking operation, and $\otimes$ is an element-wise multiplication. This process merges the two modality-specific feature maps $\hat{F}_{CT}$ and $\hat{F}_{PET}$ and weights them by the co-learned multi-modality fusion map $F_{fusion}$, similar to pixel intermixing. Our CNN (Fig.~\ref{fig:arch}) generates four fused feature maps, one for each pair of encoder blocks. These fused feature maps are passed to the reconstruction part of the CNN (see Section~\ref{sec:methods:reconstruct}).
\subsection{Reconstruction}
\label{sec:methods:reconstruct}
The reconstruction part of our CNN creates a prediction map of the ROIs within the PET-CT image. It does this by integrating the co-learned feature maps from different encoder blocks and upsampling them to the dimensions of the original inputs. Similar to the encoders, the reconstruction component comprises four blocks each with one upsampling layer and two convolutional layers.
The input to a reconstruction block is the output co-learned feature map from a co-learning unit stacked with the output of any prior reconstruction block. The upsampling layer first doubles the width and height of the stacked feature map using nearest neighbor interpolation to enable eventual reconstruction of the detected regions at the same scale as the original input; this formulation is similar to that of a deconvolutional layer~\cite{dumoulin2016_convmath} but does not require any striding operations. The following two convolutional layers merge and refine the information from the stacked modality-specific feature maps. The concept behind each reconstruction block is to generate higher dimensional feature maps that better correspond to the features for different ROIs by merging lower dimensional information with features that were fused from multiple image modalities. As with the modality-specific encoders (see Section~\ref{sec:methods:encoder}), we use batch normalization~\cite{ioffe2015_batchnorm} and Leaky ReLU~\cite{maas2013_leakyrelu} activations.
After the last reconstruction block, the output feature map has the same width and height as the input PET-CT image, with 64 channels in the third dimension. This is analogous to a final 64-dimensional feature vector for each pixel in the original image. We then use a 1$\times$1 convolution to map these feature vectors into $R+1$ feature maps, where $R$ is the number of ROIs. This obtains for each pixel a vector $o$ corresponding to the observed activations for each ROI class as well as an `other' class comprising all other image contents. We use the term `other' rather than `background' as this region encompasses the ‘true’ PET-CT background (areas of the image outside the field of view of the scanner that have a zero pixel value) as well as non-zero pixel areas within the image that are not of interest in the task (e.g., skin and subcutaneous fat of the chest wall, arms, etc.). Finally, we transform these observations into a probability or prediction map that corresponds to the likelihood of the pixel belonging to a particular class using the softmax function~\cite{fernandezcaballero2010_softmax}:
\begin{equation}
p_i(o) = \left(\frac{e^{o_i}}{\sum_r^{R+1} e^{o_r}}\right)
\label{eq:softmax}
\end{equation}
where $p_i(o)$ is the probability that the pixel with observation vector $o$ belongs to the region $i$, $o_i$ is the $i$-th element of vector $o$ and is the activation corresponding to region $i$. The `other' class (and hence the summation for $R+1$ regions in the denominator of Equation~\ref{eq:softmax}) is necessary to formulate the final output of our co-learning CNN as a set of probability maps. The `other' class probability map ensures the sum of probabilities for each pixel has a total of 1 by capturing the probability that a pixel does not belong to any of the ROIs. The use of an additional class to compute the probability of non-ROI regions is a standard formulation that has been used in prior CNN research~\cite{shelhamer2017_fcn}. Fig.~\ref{fig:prediction} is an example of the probability maps generated for the $R=3$ classes used in our experiments (lung fields, mediastinum, tumors), and the `other' class.
\begin{figure}[!t]
\centering
\includegraphics[width=\columnwidth,keepaspectratio]{kumar4}
\caption{The probability maps generated by our CNN for the different regions; a higher (whiter) intensity implies a higher probability that a pixel belongs to a specific region. This example shows: (a) lung fields, (b) mediastinum, (c) tumors, and (d) `other' regions.}
\label{fig:prediction}
\end{figure}
\subsection{Network Training}
\label{sec:methods:train}
We trained our CNN using stochastic mini-batch stochastic gradient descent with momentum~\cite{sutskever2013_sgdmom} using the following loss function and training parameters. To improve the robustness of our training and to avoid overfitting we applied data augmentation through the standard technique of random cropping and flipping of training samples~\cite{chatfield2014_devil,kumar2017_jbhi}.
\subsubsection{Loss Function}
\label{sec:methods:train:loss}
We modified the well-established categorical cross-entropy loss function for training our CNN. Let $o \in O$ be the set of pixel observations in an image $O$ and $T(o)$ be the true class of $o$, from a set of $R+1$ ROIs. Then our loss is given by:
\begin{equation}
L(O) = \frac{1}{|O|}\sum_o S(o)E(o) + \lambda\sum_j (w_j)^2
\label{eq:loss}
\end{equation}
where
\begin{equation}
S(o) = 1-\frac{n_{T(o)}}{\sum_r^{R+1} n_r}
\label{eq:loss-scale}
\end{equation}
is the class specific scaling, and
\begin{equation}
E(o) = -\sum_i^{R+1} y_i(o)\log \left(p_i(o)\right)
\label{eq:cross-entropy}
\end{equation}
is the cross-entropy loss~\cite{anthimopoulos2016_cnnild}. Under this formulation, $n_{T(o)}$ is the number of pixels in the true class of $o$, $n_r$ is the number of pixels in class $r$, $y_i(o)$ is an indicator function that is 1 when $i = T(o)$ and 0 otherwise, $p_i(o)$ is defined by Equation~\ref{eq:softmax}, $\lambda$ is the regularization strength, and $w_j$ is the $j$-th weight in $\mathcal{W}$, the set of all weights in the CNN. The distribution of the number of pixels in each class varies depending on the particular ROI (e.g., there are many more lung pixels than there are tumor pixels). As such, $S(o)$ in Equation~\ref{eq:loss} acts as a scaling coefficient for the cross entropy loss $E(o)$; this formulation is designed to reduce any bias that may be caused by ROIs with different sizes (e.g., tumor ROIs are often much smaller than lung fields)~\cite{ronneberger2015_unet}. The final term in Equation~\ref{eq:loss} is a regularization to reduce overfitting. Our aim was to ensure that the convolution kernel weights (and as a consequence, the features) corresponding to one modality did not overpower the weights (and the features) of the other. As such, we used an $L_2$-regularization, which acts to prioritize lower weights across the entirety of $\mathcal{W}$~\cite{han2015_l2neuralnet}.
\subsubsection{Parameter Selection}
\label{sec:methods:train:params}
We empirically derived the parameters using a two-fold cross-validation approach on the training data (see Section~\ref{sec:methods:materials}). Table~\ref{tab:params} lists the parameters used for our training. Further information on our parameter validation is provided in Section~SI of the Supplementary Materials.
\begin{table} [!t]
\renewcommand{\arraystretch}{1.3}
\centering
\caption{CNN Architecture and Training Parameters}
\label{tab:params}
\begin{tabular} {| r | c |}
\hline
{\bfseries Architecture Parameter} & {\bfseries Value} \\
\hline
2D convolution kernel size & 3$\times$3 \\
convolution stride & 1 \\
max pool size & 2$\times$2 \\
pool stride & 2 \\
number of channels ($c$) & 64 \\
3D convolution kernel size & 3$\times$3$\times$2 \\
\hline
\hline
{\bfseries Training Parameter} & {\bfseries Value} \\
\hline
ReLU leakiness ($\alpha$) & 0.1 \\
regularization strength ($\lambda$) & 0.1 \\
learning rate & 0.0001 \\
momentum & 0.9 \\
batch size & 5 \\
\# epochs & 500 \\
\hline
\end{tabular}
\end{table}
\subsection{Experimental Design}
\label{sec:methods:eval}
We implemented our CNN using Tensorflow 1.4~\cite{abadi2016_tensorflow} on a machine running Ubuntu 14.04 with CUDA 8.0 and CuDNN~\cite{chetlur2014_cudnn}. Training was performed on an 11GB NVIDIA GTX 1080 Ti. A link to our code can be found in Section~SV of the Supplementary Materials.
For robustness and to reduce bias, we used a 5-fold cross validation evaluation approach. For each fold, we used the same training and test datasets for our method and all baselines. We used greyscale inputs for both modalities, as was common in the baseline fusion strategies ~\cite{zhang2015_neuromm,bradshaw2018_vgg3chanpetct,teramoto2016_petctpulmnod} and other multi-modality CNN research~\cite{bi2017_petctclass,liu2018_mrctattencorr,zhang2015_neuromm,tseng2017_crossmodconv}. For all experimental comparisons with baseline methods (see below), we computed the $p$-value with the two-sample $t$-test.
We used two main evaluation tasks to demonstrate the usefulness of our method: the detection and segmentation of ROIs in PET-CT images of lung cancer. We used lung cancer as the target disease because the fusion requirements for tumors within the lung field are well-established: the lungs require mainly CT and the tumors require mostly PET with some CT within the lung area. This well-known requirement could be used to validate whether our co-learning CNN could derive the appropriate spatially varying fusion maps for tumors within the lung. This would indicate that our CNN could learn to produce spatially varying fusion maps for disease in other anatomical locations. As such, our evaluation scenarios required the detection and segmentation of disease within the lung field as well as in the mediastinum and hilar nodes. The specific experiments are detailed below.
\subsubsection{Comparison with Fusion Baselines (Region Detection and Segmentation)}
\label{sec:methods:eval:detection}
We compared our fusion method to several fusion baseline strategies. To limit the number of variable changes in our experimentation, for all fusion baselines we used a similar architecture as in our method (Fig.~\ref{fig:arch}), replacing the co-learning component with a fusion strategy from the literature. The baselines were:
\begin{itemize}
\item A multi-branch (MB) CNN, implementing a fusion strategy where each modality was processed separately and the outputs from each modality were combined~\cite{teramoto2016_petctpulmnod,vantulder2017_sharedcrossmod,zhong2018_petctunet}. The CNN was similar to the architecture in Fig.~\ref{fig:arch} with no co-learning component.
\item A multi-channel (MC) input CNN, implementing a fusion strategy where each modality was treated as different channels of a single input~\cite{zhang2015_neuromm,bradshaw2018_vgg3chanpetct}. The CNN was similar to a single encoder form of the architecture in Fig.~\ref{fig:arch}, with no co-learning component and the CT and PET modalities input as separate channels.
\item A fused (FS) input CNN, implementing a strategy where the input was a PET-CT image that had already been fused via pixel-intermixing~\cite{xu2018_petctbone}. The CNN was similar to a single encoder form of the architecture in Fig.~\ref{fig:arch} with no co-learning component.
\end{itemize}
We measured our CNN's effectiveness in detecting the foreground ROIs (lungs, mediastinum, tumors) and the `other' image contents. This was used to verify if parts of the `other' region could be misinterpreted as an ROI or vice versa (e.g., an area of the image with high intensity PET noise being mistaken as a tumor). Our comparisons used the following metrics calculated from the overlap of the detected region with the ground truth (GT): precision, sensitivity (recall), specificity, and accuracy. We also measured the segmentation quality of the predicted foreground regions using the Dice score.
\subsubsection{Comparison with Lung Tumor Segmentation Baseline}
\label{sec:methods:eval:segmentation}
We compared our co-learning CNN with two recent deep learning methods for PET-CT lung tumor segmentation:
\begin{itemize}
\item A tumor co-segmentation~\cite{zhong2018_petctunet} method. We used the publicly available source code. We trained the baseline CNN on our dataset using the baseline's default parameters except for the batch size and the number of training epochs, which we increased to match the training scheme of our co-learning CNN (see Table~\ref{tab:params}). The baseline segmented the CT and PET images separately, which could be merged for a PET-CT segmentation; we have divided our results accordingly.
\item A variational tumor segmentation method~\cite{li2019_dlpetctseg}. The source code was not publicly available and thus we implemented the baseline according to the details provided in the paper. This baseline used a U-Net to coarsely identify tumor ROIs on CT, which were then refined using the PET data and a fuzzy variational model.
\end{itemize} The baselines were only designed to segment the tumor and hence we only compared the Dice score for the tumor ROI. Both baselines were designed for inputs that were image patches centered around the tumor region. To ensure fair comparisons, we performed separate experiments using patch inputs as well as full PET-CT slices ($256\times256$ pixels).
\subsubsection{Evaluation of the Fusion Effects}
\label{sec:methods:eval:fusion}
We extracted the feature fusion maps produced by the co-learning unit (see Section~\ref{sec:methods:colearn}) to examine the fusion ratios that were produced for an image with a tumor inside the lung field. This experiment was undertaken to confirm whether the fusion ratios that were automatically derived matched the well-established expectations. Further analysis on a heterogeneous tumor was performed for the Supplementary Materials (see Section~S3). We also visually compared the results derived using our co-learning CNN's spatially varying fusion to the results derived from using different uniform fusion ratios with the FS architecture. We used uniform fusion ratios that included mainly anatomical information (30\% PET with 70\% CT), equal information (50\% PET and CT), and mainly functional information (70\% PET with 30\% CT).
\begin{table*} [!t]
\renewcommand{\arraystretch}{1.3}
\centering
\begin{threeparttable}
\caption{Comparison of fusion CNNs on detection and segmentation of different ROIs}
\label{tab:res_compare}
\begin{tabular} {| c || c || c | c | c | c || c |}
\hline
\multicolumn{2}{| c ||}{\bfseries Metrics} & \multicolumn{4}{ c ||}{\bfseries Detection [Mean $\pm$ Standard Deviation \%] } & \multicolumn{1}{ c |}{\bfseries Segmentation [Mean] } \\
\hline
\hline
\multicolumn{1}{| c ||}{\bfseries ROI} & {\bfseries CNN} & Precision & Sensitivity & Specificity & Accuracy & Dice (\%)\\
\hline
\hline
\multirow{4}{*}{\rotatebox[origin=c]{90}{lungs}}
& MB &80.95 $\pm$ 6.35* &99.38 $\pm$ \mbox{ }{\bfseries0.88}* &98.55 $\pm$ 0.50* &98.60 $\pm$ 0.46* &89.09*\\
& MC &78.84 $\pm$ 9.68* &99.40 $\pm$ \mbox{ }1.02\mbox{ } &98.11 $\pm$ 3.24* &98.19 $\pm$ 3.08* &87.51*\\
& FS &79.11 $\pm$ 8.64* &99.06 $\pm$ \mbox{ }1.23* &98.38 $\pm$ 0.66* &98.42 $\pm$ 0.62* &87.68*\\
& our method &{\bfseries85.31 $\pm$ 6.07}\mbox{ } &{\bfseries99.49} $\pm$ \mbox{ }0.93\mbox{ } &{\bfseries98.95 $\pm$ 0.43}\mbox{ } &{\bfseries98.98 $\pm$ 0.39}\mbox{ } &{\bfseries91.73}\mbox{ }\\
\hline
\multirow{4}{*}{\rotatebox[origin=c]{90}{mediastinum}}
& MB &59.75 $\pm$ 15.16* &93.28 $\pm$ \mbox{ }9.21\mbox{ } &98.91 $\pm$ 0.60* &98.83 $\pm$ 0.58* &71.57*\\
& MC &58.15 $\pm$ 15.45* &{\bfseries94.44 $\pm$ \mbox{ }7.52}\mbox{ } &98.85 $\pm$ 0.58* &98.78 $\pm$ 0.57* &70.60*\\
& FS &58.58 $\pm$ {\bfseries14.79}* &90.67 $\pm$ 14.67* &98.89 $\pm$ 0.58* &98.78 $\pm$ 0.59* &70.16*\\
& our method &{\bfseries64.54} $\pm$ 16.14\mbox{ } &94.15 $\pm$ \mbox{ }8.81\mbox{ } &{\bfseries99.12 $\pm$ 0.51}\mbox{ } &{\bfseries99.04 $\pm$ 0.51}\mbox{ } &{\bfseries 75.25}\mbox{ }\\
\hline
\multirow{4}{*}{\rotatebox[origin=c]{90}{tumors}}
& MB &56.57 $\pm$ 29.05* &68.43 $\pm$ 33.81* &99.86 $\pm$ {\bfseries0.13}* &99.79 $\pm$ 0.18* &52.16*\\
& MC &56.83 $\pm$ 29.63* &66.65 $\pm$ 35.51* &99.86 $\pm$ 0.14* &99.80 $\pm$ 0.16* &49.31*\\
& FS &54.26 $\pm$ {\bfseries28.27}* &72.21 $\pm$ 32.76* &99.84 $\pm$ 0.17* &99.79 $\pm$ 0.17* &53.07*\\
& our method &{\bfseries64.56} $\pm$ 29.61\mbox{ } &{\bfseries79.97 $\pm$ 28.26}\mbox{ } &{\bfseries99.89 $\pm$ 0.13}\mbox{ } &{\bfseries99.85 $\pm$ 0.14}\mbox{ } & {\bfseries 63.85}\mbox{ }\\
\hline
\hline
\multirow{4}{*}{\rotatebox[origin=c]{90}{foreground}}
& MB &75.06 $\pm$ {\bfseries6.78}* &97.43 $\pm$ 2.58* &99.12 $\pm$ 0.29* &99.08 $\pm$ 0.31* & 84.64*\\
& MC &73.04 $\pm$ 9.29* &97.72 $\pm$ {\bfseries1.90}* &98.96 $\pm$ 1.07* &98.92 $\pm$ 1.05* & 83.19*\\
& FS &73.60 $\pm$ 7.69* &97.03 $\pm$ 2.61* &99.05 $\pm$ 0.34* &99.00 $\pm$ 0.34* & 83.48*\\
& our method &{\bfseries79.66} $\pm$ 7.53\mbox{ } &{\bfseries97.94} $\pm$ 1.93 &{\bfseries99.33 $\pm$ 0.24}\mbox{ } &{\bfseries99.29 $\pm$ 0.25}\mbox{ } & {\bfseries87.66}\mbox{ }\\
\hline
\hline \multirow{4}{*}{\rotatebox[origin=c]{90}{`other'}}
& MB &99.90 $\pm$ 0.13\mbox{ } &97.32 $\pm$ 0.93* &98.83 $\pm$ 1.96\mbox{ } &97.45 $\pm$ 0.84* &---\\
& MC &{\bfseries99.91} $\pm$ 0.14* &96.80 $\pm$ 3.33* &{\bfseries99.05 $\pm$ 1.30}* &96.98 $\pm$ 3.13* &---\\
& FS &99.87 $\pm$ 0.19* &97.11 $\pm$ 1.06\mbox{ } &98.55 $\pm$ 2.29* &97.24 $\pm$ 0.99* &---\\
& our method &99.90 $\pm$ {\bfseries0.11}\mbox{ } &{\bfseries97.94 $\pm$ 0.76}\mbox{ } &98.82 $\pm$ 1.33\mbox{ } &{\bfseries98.02 $\pm$ 0.71}\mbox{ } &---\\
\hline
\end{tabular}
\begin{tablenotes}
\item[*] $p < 0.05$, in comparison to our method as derived from a $t$-test.
\item MB: multi-branch CNN, MC: multi-channel CNN, FS: fused input CNN
\end{tablenotes}
\end{threeparttable}
\end{table*}
\section{Results}
\label{sec:res}
Table~\ref{tab:res_compare} shows the comparison of our co-learning CNN with the baseline fusion methods on ROI detection and segmentation experiments. The data are presented individually for each of the three ROI, for all foreground ROI collectively, and separately for the non-ROI `other' region. In the detection experiments, our co-learning method has higher mean accuracy when compared to all baselines for all individual ROIs and for the foreground. The improvement in accuracy offered by our method is statistically significant ($p < 0.05$) for all ROIs. In ROI and foreground detection, our co-learning fusion method improves upon all baselines in 15 of the 16 metrics and 14 of these improvements are statistically significant compared to all baselines (all 15 improvements are statistically significant over at least one baseline). The largest overall improvement was in the precision metric, indicating that our method resulted in an increase in the ratio of true positives to false positives. In the segmentation experiments, our co-learning CNN had a significantly higher Dice score ($p < 0.05$) than all baseline fusion CNNs for all foreground ROIs individually and collectively.
\begin{figure*}[!t]
\centering
\includegraphics[width=0.8\textwidth,keepaspectratio]{kumar5}
\caption{Visual comparison of the results obtained by our method compared to the baselines and the ground truth (GT). For clarity, we show on the left the fused form of the original PET-CT image, with a color lookup table applied to the PET modality.}
\label{fig:res_compare_mm}
\end{figure*}
\begin{figure*}[!t]
\centering
\includegraphics[width=\textwidth,keepaspectratio]{kumar6.pdf}
\caption{Visual comparison of the segmentation results obtained by our method compared to the baseline tumor segmentation methods for an PET-CT image slice with tumors in the lung and the mediastinum.}
\label{fig:res_seg}
\end{figure*}
\begin{figure}[!h]
\centering
\includegraphics[width=0.9\columnwidth,keepaspectratio]{kumar7}
\caption{Fusion maps obtained by the first co-learning unit in our CNN. For better visualization, each map has been independently normalized. Areas with higher intensity values represent fusion weights that are relatively more important than areas with lower intensity values.}
\label{fig:res_fusion}
\end{figure}
\begin{table} [!t]
\renewcommand{\arraystretch}{1.3}
\centering
\begin{threeparttable}
\caption{Comparison with Tumor Segmentation Baseline}
\label{tab:res_dice_compare}
\begin{tabular} {| c | r || c |}
\hline
{\bfseries Method} & \multicolumn{1}{ c ||}{\bfseries Input} & {\bfseries Mean Dice (\%) } \\
\hline
\multirow{2}{*}{Li et al.~\cite{li2019_dlpetctseg}}
& PET-CT patch & \mbox{ }36.45 *\\
& PET-CT slice & \mbox{ }\mbox{ }7.61 *\\
\hline
\multirow{6}{*}{Zhong et al.~\cite{zhong2018_petctunet}}
& CT patch & \mbox{ }45.62 *\\
& PET patch & \mbox{ }62.37 *\\
& combined patch & \mbox{ }63.09 *\\
& CT slice & \mbox{ }12.09 *\\
& PET slice & \mbox{ }62.29 *\\
& combined slice & \mbox{ }60.13 *\\
\hline
our method & PET-CT slice & {\bfseries63.85}\mbox{ }\mbox{ }\\
\hline
\end{tabular}
\begin{tablenotes}
\item[*] $p < 0.05$, in comparison to our method.
\end{tablenotes}
\end{threeparttable}
\end{table}
\begin{figure}[!t]
\centering
\includegraphics[width=0.8\columnwidth,keepaspectratio]{kumar8}
\caption{Visual comparison of the results obtained with co-learned fusion and uniform fusion using three different fusion ratios.}
\label{fig:res_fusion_compare}
\end{figure}
Fig.~\ref{fig:res_compare_mm} is a visual comparison of the ROIs detected by our method and by the baselines; a larger version is included as Fig.~S3 in the Supplementary Materials. The figure shows that our method consistently detected regions that were a similar size to the ground truth. In contrast, the MC baseline detected fewer pixels (as shown by the tumor region) while the MB and FS baselines detected more pixels than within the region. In particular, the MB CNN gave pixels within the chest wall a high probability of being within the mediastinum.
Table~\ref{tab:res_dice_compare} is a comparison of the tumor segmentation performed by our co-learning CNN with two recently published PET-CT lung tumor segmentation techniques. The tumors segmented by our co-learning CNN have a significantly ($p < 0.05$) higher Dice score that the baselines.
Fig.~\ref{fig:res_seg} is a visual comparison of the segmentation results for a PET-CT image slice with tumors within the lung field as well as in the mediastinum; a larger version is included as Fig.~S4 in the Supplementary Materials. The figure shows that our method was able to segment three tumors in different locations across the slice, although they are all slightly over-segmented relative to the GT. In contrast, baseline methods had a tendency to under-segment the tumors.
Fig.~\ref{fig:res_fusion} depicts the co-learned fusion maps that were derived for an image with a single tumor; a larger version is included as Fig.~S5 in the Supplementary Materials. In the figure, each feature map channel has been independently normalized so that their real valued pixels could be viewed in the paper. In any particular channel, a higher absolute intensity implies a greater importance placed on that pixel during fusion. The figure shows how different information is prioritized differently for each region. For example, the 7th CT fusion channel (row 1, column 7) places a greater emphasis on the lungs while the 26th PET fusion channel (row 8, column 2) places the greatest emphasis on the tumor. The figure also indicates that the fusion weights are derived from features of both modalities. For example, the 7th CT fusion channel (row 1, column 7) emphasizes the lungs \emph{including} the area that contains the tumor. Meanwhile, the 13th CT fusion channel (row 2, column 5) also emphasizes the lungs but \emph{de-emphasizes} the area containing the tumor. Further analyses are included in Section~SIII of the Supplementary Materials.
Fig.~\ref{fig:res_fusion_compare} is a visual comparison of the results obtained by our co-learning CNN to the results obtained with uniform fusion; a larger version is included as Fig.~S6 in the Supplementary Materials. The figure shows that our CNN has visually consistent tumor detection across both studies. In contrast, the figure visually shows that a uniform fusion ratio may not be optimal for different studies; equal (50\%) PET and CT is the better ratio for detecting the tumor in the study in the left column, while reduced (30\%) PET is the better ratio for the detecting the tumors in study in the right column. The uniform fusion results were sensitive to the fusion ratio and the specific PET-CT images being processed, and across different studies produced probability maps that either missed tumors or overestimated the tumor area.
\section{Discussion}
\label{sec:discuss}
Our main findings are that our co-learning method improved foreground detection accuracy, provided a more consistent detection of regions when compared with the baseline fusion CNNs, and performed better than baseline tumor segmentation methods. We attribute these findings to the ability to derive a spatially varying fusion map that more precisely integrates functional and anatomical visual features across different locations in PET-CT images.
\subsection{Comparison with Baseline Fusion CNNs}
\label{sec:discuss:comparisonfusion}
Our co-learning CNN achieved a higher detection precision, sensitivity, specificity, and accuracy than the MB CNN for fusion across all foreground ROIs individually and collectively. Our explanation for this outcome is that the design of our CNN explicitly fuses features at multiple scales through the multiple co-learning units, which prevents information loss that can occur from the standard pooling (downsampling) operations used for feature map dimensionality reduction in CNNs. In contrast, the MB CNN implements a late fusion approach in which modality-specific feature maps are merged just prior to the reconstruction, meaning that useful complementary information could possibly have already been lost. An examination of Fig.~\ref{fig:res_compare_mm} shows that the MB CNN tends to have larger predicted regions compared to the GT (e.g. larger tumor area, extra regions in mediastinum), indicating that the lost complementary information makes the MB CNN less precise.
The MC CNN implements an early fusion approach in which no modality-specific feature maps are derived and where the first convolutional layer combines both modalities to derive fused feature maps. However, as indicated by the metrics in Table~\ref{tab:res_compare} and the images in Fig.~\ref{fig:res_compare_mm} this tends to prioritize information from some modalities at the expense of information from the other modality. The clearest example is in the less precise detection of the tumor region, which is barely noticeable in Fig.~\ref{fig:res_compare_mm}; only the part of the tumor with peak SUV (highest radiotracer uptake) is detected and the less subtle tumor regions are missed altogether.
The FS baseline is another variant of early fusion; the PET and CT modalities are pre-fused via pixel intermixing and the intermixed image is used as the input. It shares a similar weakness to the MC CNN in that the pre-fusion acts to prioritize information from one modality at the expense of the others, resulting in good precision for the lungs (79.11\% in Table~\ref{tab:res_compare}) but much lower precision for non-lung ROIs. Examination of Fig.~\ref{fig:res_compare_mm} shows that the tumor and mediastinum regions detected by the FS CNN are larger than the GT, indicating that there are a greater number of false positives. Fig.~\ref{fig:res_fusion_compare} shows that our co-learning CNN produces more consistent ROI detections than the FS baseline, which is sensitive to the selection of the uniform fusion ratio parameter. This suggests that the spatially varying fusion derived within our co-learning CNN may be more robust than a pre-determined fusion parameter setting.
All fusion baselines and our co-learning CNN had consistently high specificity for the foreground ROIs, individually and collectively (Table~\ref{tab:res_compare}). This is expected due to the large `other' region in the images, which would provide more pixels to learn the characteristics of true negative samples. This analysis is supported by the high precision ($> 99.8\%$) achieved by all methods in detecting the `other' region, correctly recognizing that `other' regions are distinct from the 3 foreground ROIs. The effectiveness of the CNNs in separating the `other' region from the ROIs indicates that there is a low likelihood that portions of the `other' region could be misinterpreted as one of the ROIs or vice versa (e.g., an area outside the lung with high intensity PET noise being detected as a tumor).
Our co-learning CNN predicts ROIs with a significantly higher ($p < 0.05$) Dice score (Table~\ref{tab:res_compare}) when compared to the baseline fusion methods in an image segmentation task. We note that the MC baseline is similar to the fully convolutional network~\cite{shelhamer2017_fcn} (MC has multiple upsampling stages rather than one), and hence the results indicate that our approach may be comparable to existing CNNs for image segmentation. CNN-based medical image segmentation techniques often include postprocessing steps to refine the coarse or soft outputs produced by the CNNs~\cite{kamnitsas2017_segcnncrf,christ2016_liverlesionfcncrf}; applying similar postprocessing steps would enhance the segmentation quality of our co-learning CNN. We suggest that the coarse outputs from our co-learning CNN may be directly used as the initial inputs for structure-specific analysis. Alternatively, our CNN could be extended and retrained for end-to-end use in specific computer-aided diagnosis applications.
We note that the Dice score achieved by our method for the lung (approximately 91\%) is generally lower than the state-of-the-art results achieved in lung segmentation competitions (approximately 95\%)~\cite{yang2018_lungautosegmentation}. One reason for this is that our co-learning CNN design and training loss function was focused on general fusion rather than a fusion that was optimized for segmentation, resulting in coarse boundaries that did not match the exact ROI. However, the high Dice score for the lung achieved by our method indicates that it is still able to capture most of the lung area. We suggest that the results could be further improved by training our CNN with a segmentation-specific loss (such as a scaled multi-class segmentation Dice loss) and performing multi-scale refinement (such as with RefineNet~\cite{lin2017_refinenet}).
\subsection{Tumor Segmentation Performance}
\label{sec:discuss:comparisonsegmentation}
Our method has a significantly higher Dice score ($p < 0.05$) than the baseline tumor segmentation methods~\cite{zhong2018_petctunet,li2019_dlpetctseg}. The baseline methods produced lower Dice scores when using slices as inputs compared to using patches as inputs. The reason for this outcome is that like other recent PET-CT lung tumor segmentation techniques~\cite{zhao2018_tumorpetctseg,zhong2019_simultaneouscosegpetct}, the baselines were designed for inputs where the tumors were cropped from the full image and centered within an image patch. The results indicate that it is likely that the baselines were unable to identify the tumors when the image contained more varied anatomical and functional information from the full image slice, such as with tumors outside the lung fields (e.g., poor segmentation of tumors in the mediastinum or hilar nodes in Fig.\ref{fig:res_seg}). Our CNN had a comparable Dice score to the co-segmentation baseline~\cite{zhong2018_petctunet} with PET-CT patch inputs, which suggests that our CNN does not rely upon cropped data to learn. The overall lower Dice scores when compared to the baseline publications (which reported scores of about 80\%) is primarily attributed to the difficulty of automatically segmenting images with hilar (Stage II) and mediastinal (Stage III) nodal involvement, which is more challenging than segmenting tumors within the lung field. We note that other methods in the literature that are capable of segmenting tumors across the entire image are not automated and require human input to define the tumor bounding box or seed points for initial segmentation~\cite{song2013_petcttumsegsepgraph,ju2015_randwalkcutsegpetct}.
The co-segmentation baseline~\cite{zhong2018_petctunet} follows a similar approach to the MB fusion baseline; the individual modalities are processed separately and the predicted regions can then be merged. Fig.~\ref{fig:res_seg} shows that the CT image alone is insufficient to identify all the tumors within the image: the heterogeneous tumor within the lung is under-segmented while one of the two mediastinal tumors was not segmented. The PET segmentation detects three tumors but only the regions with the highest SUV have been detected leading to under-segmentation. The integration of the PET and CT result obtains an appropriate ROI for the primary tumor, but the disease outside the lung fields are not well-defined. The variational baseline~\cite{li2019_dlpetctseg} relies upon the initial segmentation of the CT image with refinement of the boundaries via PET. However, the CT image is insufficient for the mediastinal tumour segmentation, resulting in poor overall segmentation performance.
In comparison to the baselines, our CNN was able to identify and segment tumors consistently from the full PET-CT image slice. This outcome was due to its ability to consider PET and CT information in an integrated manner, with the fusion maps balancing the modality-specific information. The results indicate that our method is capable of segmenting tumors across different anatomical locations without prior cropping of patches around the tumor region.
\subsection{Fusion Map Analysis}
\label{sec:discuss:fusion}
The manner of feature fusion is a key difference in our CNN versus the baseline fusion CNNs. Our CNN derives a fusion map for each image that is explicitly multiplied across the feature maps of the different modalities (see Equation~\ref{eq:fusion}), thereby acting as feature weights. As such, our method can potentially derive different fusion maps for different input PET-CT images, prioritizing different characteristics at different locations. In contrast, all the baseline fusion CNNs use the convolution operation to merge the different modalities without any consideration of the spatial relevance of the underlying data. Our CNN also involves such convolutions but they occur \emph{after} the prioritization of information by multiplication with the fusion map.
The fusion maps shown in Fig.~\ref{fig:res_fusion} demonstrate that our co-learning CNN can derive spatially varying fusion maps for images that contain multiple structures that have different fusion requirements. Our CNN does not need to divide the problem into distinct tasks for each ROI but rather can derive the relevant fusion information in an end-to-end manner. For example, the 7th CT fusion channel (row 1, column 7) and the 13th CT fusion channel (row 2, column 5) emphasize the lung fields relative to the area containing the tumor. We suggest the co-learning unit has produced these specific fusion channels because (in combination with other channels) they contain information to distinguish the lung fields from any tumors they may contain. It is well-established that the lung fields can be identified using CT data alone~\cite{hu2001_lungseg}, and it was expected that the co-learning CNN would operate in a similar fashion. The fusion maps automatically derived by our co-learning CNN prioritize the CT data for the lung field ROIs, consistent with this expectation. Similar patterns for lung fields are noticed in the fusion maps of other PET-CT images.
While it may appear that several channels in the fusion map are redundant (similar in appearance to other channels), this is merely a visualization issue caused by normalizing 32-bit floating point greyscale images for display within the paper. As shown in Fig.~S4 in the Supplementary Materials, PET fusion channels 33 to 37 (row 13, columns 1 to 5) appear visually similar but closer examination of the distribution of fusion weights within the images indicates that each channel prioritizes information in subtly different ways. Section~SIII in the Supplementary Materials contains a detailed example showing the differences in these visually similar fusion channels and their impact in the analysis of heterogeneous tumors, which is an important clinical application. We suggest that the capacity of our co-learning CNN to derive these subtly different fusion weights enables more precise integration of the complementary information in each modality when compared with uniform fusion (see Fig.~\ref{fig:res_fusion_compare}).
\subsection{Directions for Further Research}
\label{sec:discuss:future}
In our experiments, we compared our co-learning concept for fusion to other fusion approaches. To focus mainly on the differences in the approach to fusion, we built variant baseline CNNs that were similar to our CNN's architecture but that implemented fusion using conventional techniques. This was done so that the main difference between the baselines and our CNN was the presence of our co-learning component, limiting the number of architectural differences. It also meant that we could use similar hyperparameters for fairer experimental comparisons. Our findings indicate that the addition of the co-learning component improved the final results and as such we suggest that other CNNs may also see improvements if they were to follow a similar conceptual approach for feature fusion; we have left this for future research.
Similarly, we suggest our co-learning CNN could also be extended or adapted to be better optimized for different datasets and applications. Such extensions could be the inclusion of improved encoders that go beyond stacked CNNs by borrowing designs from Residual~\cite{he2016_resnet}, Inception~\cite{szegedy2017_inception}, or other newer CNN architectures; enhanced application-specific encoders would better optimize the feature extraction for different applications. Similarly, the co-learning unit could also be similarly adapted with multiple stacked convolutions to derive fusion maps with even finer details. Finally, it is expected that the final blocks of the reconstruction component will be redesigned for different applications, e.g., such as by using fully connected layers or global average pooling~\cite{selvaraju2017_gradcamglobavgpool} for classification applications. In addition, our approach could be adapted with multi-resolution fusion techniques~\cite{ghassemian2016_multiresfusreview} to enhance its capacity to extract and integrate information at different scales. To compute the fusion maps, our CNN leverages some multi-scale information: each encoder block in the architecture processes the downscaled feature maps from the previous encoder block (see Fig.~\ref{fig:arch}). This is done with max pooling to ensure that the most prominent aspects of the feature maps influence the fusion map computation and the extraction of features from the following encoder blocks. Integration of a multi-resolution fusion technique such as RefineNet~\cite{lin2017_refinenet}, which uses a separate path for each scale or resolution, could further enhance the ability to analyze and refine ROIs with subtle boundaries. We will examine some of these adaptations in our future research.
Our method required selection of the extent of the thorax so its transaxial slices could form the CNN input. This is currently a manual process in our dataset construction to ensure that the correct body region could be analyzed. Automation of this process could result in a performance decrease if slices outside this body region were selected. Hence, an interesting area for future research would be to automatically classify the slices of whole body PET-CT so that they could be correctly passed to the CNN for analysis.
Our current CNN design also requires images in the same coordinate space so that the spatially varying fusion can be computed. However, the PET and CT images originally have different resolutions (see Section~\ref{sec:methods:materials}) and so we rescaled both modalities to $256\times256$ pixels. We note that downscaling the CT data may cause subtle details near tissue boundaries (bronchus or chest wall) to be lost while upscaling the PET may introduce further noise due to the interpolation of the pixel data. We elected to rescale both modalities to a resolution that was in-between the original resolutions to limit the possible the distortions for each modality. The distortions due to data rescaling could possibly be avoided by performing spatially varying fusion across images with different resolutions, but this is a significant challenge that is beyond the scope of this research and hence we leave it to future work.
Our experiments used a dataset of 50 PET-CT images, which is of a similar scale to other studies that have used multi-modality image data~\cite{xu2018_petctbone,zhong2018_petctunet,zhang2015_neuromm,zhong2019_simultaneouscosegpetct}. To reduce the likelihood of overfitting, we trained our co-learning CNN using standard data augmentation techniques (see Section~\ref{sec:methods:train}). Furthermore, to reduce the likelihood of biased results, we used a 5-fold cross-validation analysis protocol, which is a valid compromise in the absence of larger datasets. We note that the use of larger datasets would provide greater opportunities for our co-learning CNN to learn the appropriate fusion characteristics of the underlying data.
In addition, we used greyscale inputs for all experiments rather than use color lookup tables (CLUTs) for PET. CLUTs are sometimes used to enhance the appearance of functional information, particularly in image visualization. Our experimental aim was to focus on how the information from each modality was prioritized and the colorization of PET may have biased the functional information. However, we acknowledge that color information may provide additional visual features and we will explore this in a future study.
Our experiments focused on verifying our CNN’s capabilities in co-learning the fusion on lung cancer where the fusion requirements are well-understood. There are other problem domains (e.g., whole body disease such as lymphoma or metastatic cancer) that contain a wider variety of anatomical structures and heterogeneous disease. These problem domains will require ROI-specific fusion, which may not be known \emph{a priori}. The ability of our co-learning CNN to derive fusion maps for different structures suggest that it could potentially be applied to generate ROI-specific fusion maps for these problems. Furthermore, we used a supervised learning approach and hence the current CNN design and the trained model was focused on application to a specific known disease. This is consistent to other CNN methods that are tuned for specific diseases or tasks ~\cite{anthimopoulos2016_cnnild,christ2016_liverlesionfcncrf}. We suggest that given sufficient training data, there would be no barrier to developing co-learning CNNs for other specific tasks or for deriving CNNs capable of deriving fusion maps across a range of related applications. These are also avenues for future work.
\section{Conclusion}
\label{sec:conc}
We presented a new supervised CNN for fusing complementary information from multi-modality images. Our CNN leveraged modality-specific features to derive a spatially varying fusion map that quantified the importance of each modality's features across different spatial locations. Our findings from region detection and segmentation experiments on PET-CT lung cancer images demonstrated that our method was a significant ($p < 0.05$) improvement upon several baseline CNN-based methods for multi-modality image analysis. We suggest that our conceptual approach of having a specific CNN architectural component to derive explicit fusion maps could be a useful technique for medical image analysis applications that require considering complementary information from different image modalities, e.g., PET-CT and PET-MR.
\bibliographystyle{IEEEtran}
| {'timestamp': '2019-10-29T01:26:37', 'yymm': '1810', 'arxiv_id': '1810.02492', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02492'} | arxiv |
\section{\label{sec:level1}Introduction}
When it comes to the evolution of cooperation, the tit-for-tat (TFT) strategy is a sort of a celebrity among the strategies and constitutes one of the pillars, which ensures that Darwin's theory of natural selection does not collapse under the evidence of the altruistic behavior among non-relatives in nature \cite{axelrod1981,axelrod2006the,Milinski1987}. As computer simulations show, the TFT strategy wins the ultimately defective strategy always-defect (ALLD) and gives rather convincing arguments in favor of Trivers' theory of direct reciprocity (DR). This was proven within classical framework of Iterated Prisoner’s Dilemma (IPD) as well as within stochastic IPD with reactive strategies \cite{Nowak1992}. Theoretically, if the probability of the encounter is large enough and assuming that TFT agents have a perfect memory and enough time available, the relative fitness value of the TFT strategy sooner or later exceeds the relative fitness of the ALLD strategy, regardless of the size of the population \cite{broom2013game-theoretical}. However, in nature there is no infinite memory, nor the infinitely large group; the memory capacity is limited, which probably limits the group size as well. There is empirical evidence which supports that idea – a British anthropologist Robin Dunbar has discovered that the relative size of the neocortex is correlated with the group size – more developed primates live in larger packs \cite{Dunbar1992}. Dunbar's discovery reveals that the size of the brain is adjusted to the size of the group because the brain is not a “computer for the orientation in the physical environment", but primarily "a computer for the orientation in the social environment" \cite{Dunbar1998,DavidBarrett2013,Adolphs2009}. Information that brain has to deal with is about making social bonding, alliances, detecting free-riders etc.
In order to cope with free-riders, the individuals i.e. cooperative agents ought to memorize 3 types of information: “what”,“who” and “when”. For example a particular memory-2 agent might memorize defection (“what”) performed by agent no.3 ("who") in two previous interactions (“when”). Although there are studies that examine the role of memory in the evolution of cooperation, most of them seem to be concerned primarily with the limitations regarding the number of previous interactions which agents can take into account \cite{Stewart2016,Baek2016,Hilbe2017}. It is often overlooked that agents do not interact with a single partner, but are embedded in a large social network. Despite the apparent simplicity of the memory-one strategies (such as TFT) which takes into account only the co-player’s previous move, tracking the reciprocal obligations within large group may place a computationally significant burden on memory systems \cite{hertwig2013simple}. However, the classic computational model of DR does not include the memory limitations regarding the number of co-players nor explains the transition from direct to indirect reciprocity.
The role of gossip in the evolution of cooperation has been seriously considered since Richard D. Alexander suggested that individuals will tend to help those who helped others \cite{alexander1987the}. This kind of mechanism is known as Indirect Reciprocity (IR) and numerous models have been proposed to explain ways in which it may operate. The most famous and probably the most influential model of IR was designed by Martin Nowak and Karl Sigmund in 1998. To each player they assigned a value called an \textit{image score} which could be considered as a reputation of a player. The image score varies according to the players kindness –it rises whenever the player helps others, and falls whenever the player defects. They arranged the game so that each player can take part in many rounds, but not with the same partner twice. However, the players could discriminate other players according to the information they were given about their reputation \cite{Nowak1998}. Their model has shown that nature prefers cooperators, but still there were some criticisms concerning the model. The key weakness of the image scoring is that it punishes the player who defects on a defector, therefore it fails to distinguish justified from unjustified defections \cite{Panchanathan2003}. Secondly, their model does not include DR, since the players cannot re-meet. It was shown that IR through image scoring becomes unstable with respect to DR as the probability of re-meeting increases \cite{Roberts2008}. To resolve the first issue considering the problem of justified/unjustified defection, more sophisticated strategies were proposed- those that can take into account the past of the co-player but also the past of the co-player’s co-players, and so on. It was shown that discrimination based on the concept of "justified defection" can lead to a stability if players have the same reputation in the eyes of all members of their population. But if players have different views about the reputation of others, then errors in perception can undermine cooperation \cite{Nowak2005,MartinezVaquero2013}. Gossip might be a way of achieving consensus and there are researchers who believe that IR should be based on gossip indeed \cite{Sommerfeld2007,Giardini2011,Giardini2016}. Giardini and Vilone have shown that a large quantity of gossip is necessary to support cooperation in Public Goods Game, and that group structure can reduce the effects of errors in transmission \cite{Giardini2016}.
All those issues have motivated us to design a realistic tit-for-tat agents with a limited memory capacity who can move around and re-meet, who can gradually forget their experience and who can exchange the experiences of their own interactions when they meet. In Sec.II of this paper we define the model of the "oblivious TFT" strategy (OTFT). We introduce: (1) the memory capacity (2) the half-life of the memory decay and (3) the energy cost of having the memory. In Sec.III we describe the simulation experiments on OTFT agents with different memory capacities. Only when convinced that the results of the simulations fit Dunbar’s findings, we shall introduce the GossipTFT players with ability to exchange their own experiences (Sec.IV) and provide the evidence that the gossip players can cope with the defectors efficiently even in the very large groups.
\section{\label{sec:level1}Model of the oblivious TFT}
In this paper, we apply the well-known model, namely the PD game to the multi-agent NetLogo modeling environment. In our model, agents move around randomly on the surface without borders which may be considered as the finite toroidal space. Each player is surrounded by his own private space that can be violated by the other individuals in which case they play one round of the PD game. After such an encounter they turn away from each other and move on. The probability of the encounter depends, of course, on the density of the agents, while the outcome of the game depends on their strategies and their history. At the beginning of the simulation each TFT player is given a list as large as the population with the elements which represent the surrounding agents. The list can be considered as memory, since the boolean value of each element depends on the previous experience. The TFT player starts with the list filled with default values false but if betrayed by someone, the list is updated in a way that the value false at the position numerically assigned to that particular individual changes into the value \textit{true}. For example, if the player experiences a betrayal from the third agent, then the history list is updated as follows:
\[[false,false,true,false,\ldots false].\]
Next time, when the TFT player re-meets the agent no.3, he plays defect as well. Therefore, the player who uses the TFT strategy can correct his behavior towards the defector and improve the overall score. If we run the simulation with ALLD and TFT in the same proportion of players, the relative fitness of the ALLD players is higher in the first stage of the simulation, however as time goes by the relative fitness of the TFT strategy increases and finally exceeds the relative fitness of the ALLD strategy.
The TFT players we have described so far have perfect and infinitely large memory – their history lists to store the information about the other players can stretch to infinity and they never forget who is who in the population, which is obviously unrealistic. To make our model more realistic we have introduced the memory capacity – a number that limits the storage of booleans \textit{true}. When the number of boolean values \textit{true} reaches the upper limit $m$, the player cannot change the list elements any more – he is allowed to play the PD game with another exploiter but he cannot store the information \textit{true}. In other words, if he detects $m$ free-riders, he will store exactly $m$ elements \textit{true} and hence the list will be locked.
However, it is meaningless and unrealistic to store such information for an infinite amount of time. According to "use it or lose it" principle, we forget what we rarely see, and we are strengthening the memory of what we meet often. The phrase “use it or lose it” usually refers to the relationship between exercise and muscle mass - the muscle cells become larger after exposure to physical stimulation, but many studies have shown that similar process takes place in brain. For example, new neurons in the adult hippocampus that are stimulated by new and challenging learning experiences are more likely to survive and become incorporated into brain circuits. On the other hand most of the cells will die in one week unless engaged in some kind of learning experience \cite{Shors2012}. Therefore, it is reasonable to implement some kind of mechanism that would gradually remove old information. We usually see forgetfulness as a flaw, but in the combination with a limited memory, forgetfulness may be advantageous - memory decay cleans the list and frees the space to store some new information. The sources of forgetting are a matter of intense debate - researchers disagree about whether memories fade as a function of the mere passage of time (decay theory) or as a function of interfering succeeding events (interference theory) \cite{Barrouillet2011}. Over the years there have been sharp critiques of decay, questioning whether it plays any role at all \cite{Jonides2008}. However, this explanation has strong intuitive appeal, therefore we have designed the mechanism that works similarly to radioactive decay – each element true of the memory list has a certain likelihood of falling into the default state \textit{false}. A random number from 1 to 100 is chosen, in each time unit (which is called a tick in the NetLogo), and if the number is less than the percentage of probability $p$ the element true transforms into the false. Thus, the rate of memory decay can be expressed with half-life equation.
\begin{figure}[h!]
\caption{The memory decay can be expressed either by the probability of an element to transform, either by the half-life. }
\centering
\includegraphics[width=0.5\textwidth]{half-life2.jpg}
\end{figure}
The third important feature of the “oblivious TFT” (OTFT) is the cost that player is obliged to pay for the memory. In the world of nature, having a brain is not just an advantage, but also a burden from the energetic perspective\cite{Dukas1999,Burns2010}. Having a memory is costly, thus we have assumed that the cost is proportional to the memory capacity with the constant of proportionality $k$, which we shall refer to simply as k-value. In each encounter, the fraction of energy \(\Delta E =k\times m\) is subtracted from the player’s payoff.
\section{\label{sec:level1}Restrictions of direct reciprocity}
Having designed those three important features of the OTFT, we have run the simulations with different k-values and half-lives, measuring the relative fitness of the ALLD and OTFT. Each population consisted of ALLD and OTFT with the same proportion of agents. The most representative results were obtained with \(T _\frac{1}{2} = 800 \) ticks and \(k = 5 \cdot 10^{-3}\). Using these values the simulation showed an obvious difference between players using different memory capacities. Given a fixed population size, the OTFT players with larger memory capacity performed better, but only to a certain extent because with the increase of capacity the energy cost becomes so high that their relative fitness cannot reach the relative fitness of ALLD.
The time needed to reach the relative fitness of ALLD does not decrease linearly, rather shows an interesting U-shape, which depends on half-life and k-values.
\begin{figure}[h!]
\caption{The time needed to reach the relative fitness of the ALLD strategy for different memory capacities and different group sizes (40-140 individuals). }
\centering
\includegraphics[width=0.5\textwidth]{t-vs-m.png}
\end{figure}
The stochasticity of the IPD is the result of the random walk of the agents which influences the performance, thus it is impossible to obtain the same exact result. We averaged the measured times and after more than 200 simulations conducted on different population sizes we have obtained curves with minima which shift the position nonlinearly and increases drastically along the vertical axis. The minimal time needed to take over the dominance increases asymptotically with the size of the group. Clearly, the asymptote represents the invisible border that cannot be crossed – if the group size exceeds approx.160 individuals, it is impossible for the cooperators to perform better, no matter how large is their memory capacity.
\begin{figure}[h!]
\caption{The minimal time needed to reach the relative fitness of the ALLD rises asymptotically with the group size. }
\centering
\includegraphics[width=0.5\textwidth]{min-time.png}
\end{figure}
It must be emphasized that the probability of the encounter was conserved since we have programmed the simulation in such way that the size of the world was adjusted i.e. proportional to the number of agents.The minimal time corresponds to the optimal memory capacity suitable for a given group size. Amazingly, the optimal capacity is correlated to the group size with the regression coefficient r=0.9943. Such a strong correlation undoubtedly shows that our model faithfully represents what was suggested and empirically confirmed in the research of primates.
\begin{figure}[h!]
\caption{The optimal memory capacity for a given group size increases linearly with the size of the population. }
\centering
\includegraphics[width=0.5\textwidth]{corr.png}
\end{figure}
\section{\label{sec:level1} The Gossip TFT}
Learning via direct encounters involves risk of being cheated. A less dangerous and therefore more optimal learning method is witnessing the experiences of others. This method usually called vicarious learning has been observed in a variety of animals from drosophila to mice \cite{Mobbs2015}. In humans, vicarious learning is transmitted through multiple channels including imitation, conversation and gossip.
In order to cross the group size border we have designed a special type of TFT players who can exchange the information stored in their history lists. Unlike other authors, we didn’t try to build the reputation, but rather to use the instruments provided so far in the framework of DR. Instead of using the image score, we decided to rely on the history lists of players engaged in the encounter. The new kind of player that we named GossipTFT is able to alter the boolean values of its list when they get in touch with their kind. The procedure goes as follows: If two GossipTFT players meet both of them update their lists according to the simple logical rule: \textit{true} OR \textit{false} with the same position on the lists results in \textit{true} to both of them. The rule may be thought of as precaution which is easy to be justified from the evolutionary perspective –“If he had bad experience with that guy, maybe it’s better to be cautious.” The asymmetry in consequences between false negatives (which can result in being hurt) and false alarms has often led the evolution in the direction of setting the fear threshold quite low (so that even light stimuli are actually interpreted as dangerous) \cite{Adolphs2013}.
\begin{figure}[h!]
\caption{If GossipTFT players meet both of them update their lists according to the simple logical rule: true OR false with the same position on the lists results in true to both of them. }
\centering
\includegraphics[width=0.5\textwidth]{gossip-mechanism.png}
\end{figure}
The GossipTFT players possess the same features, as the OTFT players; limited memory which decays over time and the energy cost of having the memory. Clearly, the cost of having the ability to gossip and to remember must be higher than the ability just to remember. That is why we decided to use k-values
\(k > 5 \cdot 10^{-3}\)
When pushed into the arena to fight versus the ALLD players, the GossipTFT players show an amazing performance. To make it harder for the GossipTFT, we have chosen a k-value \(k = 8 \cdot 10^{-3}\), but even then their speed is almost incomparable; in the small groups they can reach the relative fitness of the ALLD strategy four times faster than the OTFT strategy. In the large groups they can make it forty times faster.
\begin{figure}[h!]
\caption{The performance of the OTFT players (with \(k = 5 \cdot 10^{-3}\)) compared to the GossipTFT players (with \(k = 8 \cdot 10^{-3}\)). }
\centering
\includegraphics[width=0.5\textwidth]{Gossip-vs-OTFT.png}
\end{figure}
\section{\label{sec:level1} Discussion}
It has been suggested that direct reciprocity operates well within small groups of people where it would be hard to get away with cheating one another \cite{nowak2011supercooperators} but no research has been done yet to show \textit{how exactly} the mechanism of direct reciprocity fails to operate as the group size increases. Unlike previous models that have neglected the role of memory, our model takes into account the cognitive abilities of the individuals as well as the cost of having those abilities. As it was shown, we have modified the TFT strategy and introduced: (1) the memory capacity (2) the half-life of the memory decay and (3) the energy cost of having the memory. Using the NetLogo simulations on such “oblivious TFT” (OTFT) we have shown that the optimal memory capacity for handling the exploiters grows with the group size precisely as Dunbar empirically found. Moreover, we have shown that the time required for reaching the relative fitness of the defectors increases asymptotically with the population size which points to the conclusion that there is an upper group size limit at approximately 160 individuals over which the mechanism of direct reciprocity is insufficient to maintain the cooperation. It seems that above the upper limit it is necessary to allow the horizontal transmission of the information i.e. rumors about the free-riders present in the population. In order to allow such transmission without conceptual modifications of the starting model we have equipped our agents with the ability to exchange their own experiences with one another. Such agents, namely GossipTFT players, do not operate by discriminating the individuals according to their reputation, but rather by collecting the experiences of other GossipTFT players. The knowledge collected from others as well as the knowledge gained from the direct encounters may be fading since they forget the information over time, but it seems that these cognitive shortcomings do not reduce their performance. The GossipTFT players can cope with the defectors efficiently much faster than OTFT players even in the large groups and even when the energy cost of gossiping is significantly higher than the cost of just memorizing. The benefit of the information transmission through the population obviously exceeds the price paid for being able to communicate.
It is believed that the demand for social cooperation via indirect reciprocity has propelled the evolution of human language\cite{nowak2011supercooperators} and this paper supports that belief – the stability of a large group is possible, as we have shown, only if there exist a communication which enables the denouncement of the exploiters. Thanks to language, humans are able to overcome the limitations of direct observations and can exchange information about each other, thus isolating defectors and selecting cooperative partners \cite{Giardini2011}. One might argue that in a real world, gossip is unreliable and cannot lead to the consensus about the kindness of the players, but still –in larger societies, especially in the structured societies there may be some other mechanisms of reputation besides the \textit{image score}. The image of an individual may be determined by the performance of its subgroup as well. If such information, namely the \textit{group score} is available then the agents do not need to have perfect knowledge about others’ agent individual histories. On the contrary, as it was shown recently, for large populations only a tiny proportion of image scoring is sufficient to maintain the cooperation \cite{Nax2015}.
However, there are many features that have not been discussed nor included in the model, for example, the reproduction of the agents. The rise of the relative fitness over time, results in the increase of the probability of having the offspring, but the passage of time has relative meaning depending on the life span and the birth rate of the population. So far we have proven that time needed to reach the relative fitness of the defectors goes to infinity while the group grows, but we will not understand completely the transition from DR to IR, as long as we neglect the reproduction. We can only speculate that the critical group size might be even smaller when individuals reproduce since the arrival of the newborn members demands even a larger memory capacity. The implementation of the mechanism of reproduction into the small group brings in a whole series of problems since random drift can strongly affect evolution, but this work remains yet to be done. \\
\textbf{We thank Vinko Zlatić, PhD, Institute Rudjer Bošković, for his support and help.}
\bibliographystyle{unsrt}
| {'timestamp': '2018-10-08T02:06:33', 'yymm': '1810', 'arxiv_id': '1810.02536', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02536'} | arxiv |
\section{Introduction}
Despite the success of deep neural networks in machine learning, they are often found to be highly overparametrized making them computationally expensive with excessive memory requirements.
Pruning such large networks with minimal loss in performance is appealing for real-time applications, especially on resource-limited devices.
In addition, compressed neural networks utilize the model capacity efficiently, and this interpretation can be used to derive better generalization bounds for neural networks~(\cite{arora2018stronger}).
In network pruning, given a large reference neural network, the goal is to learn a much smaller subnetwork that mimics the performance of the reference network.
The majority of existing methods in the literature attempt to find a subset of weights from the pretrained reference network either based on a saliency criterion~(\cite{NIPS1988_119,lecun1990optimal,han2015learning}) or utilizing sparsity enforcing penalties~(\cite{chauvin1989back,Carreira-Perpiñán_2018_CVPR}).
Unfortunately, since pruning is included as a part of an iterative optimization procedure, all these methods require many expensive {\em prune -- retrain cycles} and heuristic design choices with additional hyperparameters, making them non-trivial to extend to new architectures and tasks.
In this work, we introduce a saliency criterion that identifies connections in the network that are important to the given task in a data-dependent way before training.
Specifically, we discover important connections based on their influence on the loss function at a variance scaling initialization, which we call connection sensitivity.
Given the desired sparsity level, redundant connections are pruned once prior to training (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot, single-shot), and then the sparse pruned network is trained in the standard way.
Our approach has several attractive properties:
\begin{tight_itemize}
\vspace{-2mm}
\item \emph{Simplicity.}\;
Since the network is pruned once prior to training, there is no need for pretraining and complex pruning schedules.
Our method has no additional hyperparameters and once pruned, training of the sparse network is performed in the standard way.
\item \emph{Versatility.}\;
Since our saliency criterion chooses structurally important connections, it is robust to architecture variations.
Therefore our method can be applied to various architectures including convolutional, residual and recurrent networks with no modifications.
\item \emph{Interpretability.}\;
Our method determines important connections with a mini-batch of data at single-shot.
By varying this mini-batch used for pruning, our method enables us to verify that the retained connections are indeed essential for the given task.
\end{tight_itemize}
We evaluate our method on {\small MNIST}{}, \cifar{-10}, and {\small Tiny-ImageNet}{} classification datasets with widely varying architectures.
Despite being the simplest, our method obtains extremely sparse networks with virtually the same accuracy as the existing baselines across all tested architectures.
Furthermore, we investigate the relevance of the retained connections as well as the effect of the network initialization and the dataset on the saliency score.
\SKIP{
Our approach has several attractive properties:
\begin{tight_itemize}
\vspace{-2mm}
\item \emph{Simplicity.}\;
It requires no complex pruning -- learning schedule as well as any additional hyperparameters, being procedually simple and easy to use.
\item \emph{Promptitude.}\;
It prune a given network only once, at random initialization without pretraining, achieving sparse network quickly.
\item \emph{Scalability.}\;
It is architecture independent and model-agnostic and can be applied to various large-scale modern network types including convolutional, residual, recurrent networks without adjusting the algorithm.
\item \emph{Interpretability.}\;
Our saliency measure is directly dependent on data, allowing one to interpret whether the right connections are survived from pruning.
\item \NOTE{Update, add, or remove. Once done, move around to fit into the intro.}
\end{tight_itemize}
General explanation
\begin{tight_itemize}
\item problem received new attention
\item big networks, computation speed, memory
\end{tight_itemize}
Problems and motivation
\begin{tight_itemize}
\item standard magnitude-based pruning: heuristic, requires fully-trained network
\item Improve the efficiency of pruning algorithms by introducing a new approach.
\item Bayesian can't be applied to large network, resnets, lstms.
\end{tight_itemize}
Approach
\begin{tight_itemize}
\item
\end{tight_itemize}
Contributions.
\begin{tight_itemize}
\item efficient pruning (\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot requires no pre-training or non-trivial pruning schedule)
\item new approach that can scale
\item demonstrate its applicability to various architectures (convolutional, fully-connected, recurrent, residual)
\item can be applied generally to training neural networks (sparse network encourages generalizability)
\end{tight_itemize}
}
\section{Neural Network Pruning}
\section{Neural network pruning}\label{sec:prelim}
The main hypothesis behind the neural network pruning literature is that neural networks are usually overparametrized, and comparable performance can be obtained by a much smaller network~(\cite{reed1993pruning}) while improving generalization~(\cite{arora2018stronger}).
To this end, the objective is to learn a sparse network while maintaining the accuracy of the standard reference network.
Let us first formulate neural network pruning as an optimization problem.
Given a dataset ${\mathcal{D}} = \{({\mathbf{x}}_i, {\mathbf{y}}_i)\}_{i=1}^n$, and a desired sparsity level $\kappa$ (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot, the number of non-zero weights) neural network pruning can be written as the following constrained optimization problem:
\begin{align}\label{eq:nn}
\min_{{\mathbf{w}}} L({\mathbf{w}};{\mathcal{D}}) &= \min_{{\mathbf{w}}} \frac{1}{n} \sum_{i=1}^n \ell({\mathbf{w}}; ({\mathbf{x}}_i, {\mathbf{y}}_i))\
,\\\nonumber
\text{s.t.}\quad{\mathbf{w}} &\in \mathbb{R}^m,\quad \|{\mathbf{w}}\|_0 \le \kappa\ .
\end{align}
Here, $\ell(\cdot)$ is the standard loss function (\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot, cross-entropy loss), ${\mathbf{w}}$ is the set of parameters of the neural network, $m$ is the total number of parameters and $\|\cdot\|_0$ is the standard $L_0$ norm.
The conventional approach to optimize the above problem is by adding sparsity enforcing penalty terms~(\cite{chauvin1989back, weigend1991generalization, ishikawa1996structural}).
Recently,~\cite{Carreira-Perpiñán_2018_CVPR} attempts to minimize the above constrained optimization problem using the stochastic version of projected gradient descent (where the projection is accomplished by pruning).
However, these methods often turn out to be inferior to saliency based methods in terms of resulting sparsity and require heavily tuned hyperparameter settings to obtain comparable results.
On the other hand, saliency based methods treat the above problem as selectively removing redundant parameters (or connections) in the neural network.
In order to do so, one has to come up with a good criterion to identify such redundant connections.
Popular criteria include magnitude of the weights, \emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot, weights below a certain threshold are redundant~(\cite{han2015learning,guo2016dynamic}) and Hessian of the loss with respect to the weights, \emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot, the higher the value of Hessian, the higher the importance of the parameters~(\cite{lecun1990optimal,hassibi1993optimal}), defined as follows:
\begin{equation}
s_j =
\begin{cases}
|w_j|\ , & \text{for magnitude based} \\[1ex]
\frac{w^{2}_{j}H_{jj}}{2}\;\;\; \text{or}\;\; \frac{w^{2}_{j}}{2H^{-1}_{jj}} & \text{for Hessian based}\;.
\end{cases}
\end{equation}
Here, for connection $j$, $s_j$ is the saliency score, $w_j$ is the weight, and $H_{jj}$ is the value of the Hessian matrix, where the Hessian ${\mathbf{H}} = \partial^{2}L/\partial{\mathbf{w}}^{2} \in {\mathbb{R}}^{m \times m}$.
Considering Hessian based methods, the Hessian matrix is neither diagonal nor positive definite in general, approximate at best, and intractable to compute for large networks.
Despite being popular, both of these criteria depend on the scale of the weights and in turn require pretraining and are very sensitive to the architectural choices.
For instance, different normalization layers affect the scale of the weights in a different way, and this would non-trivially affect the saliency score.
Furthermore, pruning and the optimization steps are alternated many times throughout training, resulting in highly expensive {\em prune -- retrain cycles}.
Such an exorbitant requirement hinders the use of pruning methods in large-scale applications and raises questions about the credibility of the existing pruning criteria.
In this work, we design a criterion which directly measures the connection importance in a data-dependent manner.
This alleviates the dependency on the weights and enables us to prune the network once at the beginning, and then the training can be performed on the sparse pruned network.
Therefore, our method eliminates the need for the expensive prune -- retrain cycles, and in theory, it can be an order of magnitude faster than the standard neural network training as it can be implemented using software libraries that support sparse matrix computations.
\section{Visualizing pruned parameters on (inverted) (fashion-)mnist}
\label{sec:fashion-mnist-invert}
\begin{figure}[h]
\centering
\begin{subfigure}{.49\textwidth}
\centering
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-9_seed-9}.eps} \\
\caption{{\small MNIST}{-Invert}}
\end{subfigure}
\begin{subfigure}{.49\textwidth}
\centering
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-9_seed-9}.eps} \\
\caption{{\small Fashion-MNIST}{-Invert}}
\end{subfigure}
\caption{
Results of pruning with {\small SNIP}{} on inverted {\small (Fashion-)MNIST}{} (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot, dark and bright regions are swapped).
Notably, even if the data is inverted, the results are the same as the ones on the original {\small (Fashion-)MNIST}{} in Figure~\ref{fig:pruned-weights}.
}
\label{fig:pruned-weights-invert}
\end{figure}
\begin{figure}[h]
\centering
\begin{subfigure}{.49\textwidth}
\centering
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.1_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.1_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.1_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.1_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.1_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.1_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.1_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.1_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.1_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.1_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.2_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.2_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.2_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.2_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.2_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.2_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.2_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.2_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.2_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.2_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.3_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.3_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.3_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.3_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.3_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.3_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.3_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.3_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.3_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.3_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.4_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.4_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.4_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.4_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.4_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.4_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.4_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.4_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.4_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.4_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.5_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.5_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.5_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.5_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.5_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.5_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.5_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.5_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.5_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.5_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.6_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.6_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.6_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.6_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.6_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.6_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.6_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.6_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.6_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.6_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.7_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.7_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.7_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.7_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.7_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.7_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.7_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.7_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.7_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.7_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.8_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.8_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.8_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.8_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.8_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.8_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.8_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.8_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.8_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.8_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.9_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.9_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.9_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.9_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.9_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.9_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.9_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.9_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.9_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist/lenet300_w1_bs-100_ts-0.9_class-9_seed-9}.eps} \\
\caption{{\small MNIST}{}}
\end{subfigure}
\begin{subfigure}{.49\textwidth}
\centering
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.1_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.2_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.3_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.4_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.5_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.6_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.7_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.8_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/mnist-invert/lenet300_w1_bs-100_ts-0.9_class-9_seed-9}.eps} \\
\caption{{\small MNIST}{-Invert}}
\end{subfigure}
\begin{subfigure}{.49\textwidth}
\centering
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.1_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.1_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.1_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.1_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.1_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.1_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.1_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.1_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.1_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.1_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.2_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.2_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.2_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.2_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.2_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.2_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.2_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.2_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.2_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.2_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.3_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.3_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.3_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.3_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.3_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.3_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.3_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.3_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.3_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.3_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.4_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.4_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.4_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.4_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.4_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.4_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.4_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.4_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.4_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.4_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.5_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.5_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.5_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.5_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.5_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.5_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.5_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.5_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.5_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.5_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.6_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.6_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.6_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.6_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.6_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.6_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.6_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.6_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.6_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.6_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.7_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.7_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.7_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.7_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.7_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.7_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.7_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.7_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.7_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.7_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.8_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.8_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.8_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.8_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.8_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.8_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.8_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.8_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.8_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.8_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.9_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.9_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.9_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.9_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.9_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.9_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.9_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.9_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.9_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist/lenet300_w1_bs-100_ts-0.9_class-9_seed-9}.eps} \\
\caption{{\small Fashion-MNIST}{}}
\end{subfigure}
\begin{subfigure}{.49\textwidth}
\centering
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.1_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.2_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.3_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.4_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.5_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.6_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.7_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.8_class-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp-vis-mask-wgrad/fashion-mnist-invert/lenet300_w1_bs-100_ts-0.9_class-9_seed-9}.eps} \\
\caption{{\small Fashion-MNIST}{-Invert}}
\end{subfigure}
\caption{
Results of pruning with ${\partial L}/{\partial {\mathbf{w}}}$ on the original and inverted {\small (Fashion-)MNIST}{}.
Notably, compared to the case of using {\small SNIP}{} (Figures~\ref{fig:pruned-weights} and~\ref{fig:pruned-weights-invert}), the results are different:
Firstly, the results on the original {\small (Fashion-)MNIST}{} (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot, (a) and (c) above) are not the same as the ones using {\small SNIP}{} (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot, (a) and (b) in Figure~\ref{fig:pruned-weights}).
Moreover, the pruning patterns are inconsistent with different sparsity levels, either intra-class or inter-class.
Furthermore, using ${\partial L}/{\partial {\mathbf{w}}}$ results in different pruning patterns between the original and inverted data in some cases (\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot, the $2^{\text{nd}}$ columns between (c) and (d)).
}
\label{fig:pruned-weights-wgrad-original-invert}
\end{figure}
\newpage
\section{Fitting random labels: varying sparsity levels}
\label{sec:fit-rand-label-kappa}
\begin{figure}[h]
\centering
\includegraphics[width=0.6\textwidth]{figure/lenet5_fit-random-labels-kappa.eps}
\caption{
The effect of varying sparsity levels ($\bar{\kappa}$).
The lower $\bar{\kappa}$ becomes, the lower training loss is recorded, meaning that a network with more parameters is more vulnerable to fitting random labels.
Recall, however, that all pruned models are able to learn to perform the classification task without losing much accuracy (see Figure~\ref{fig:varying-ts}).
This potentially indicates that the pruned network does not have sufficient capacity to fit the random labels, but it is capable of performing the classification.
}
\label{fig:fit-rand-labels-kappa}
\end{figure}
\section{Tiny-imagenet}
\begin{table}[h]
\centering
\footnotesize
\begin{tabular}{c@{\hspace{.7\tabcolsep}}c l c r@{\hspace{.7\tabcolsep}}c@{\hspace{.7\tabcolsep}}r r@{\hspace{.7\tabcolsep}}c@{\hspace{.7\tabcolsep}}rc}
\toprule
Architecture && \multicolumn{1}{c}{Model} & Sparsity (\%) & \multicolumn{3}{c}{\# Parameters} & \multicolumn{3}{c}{Error (\%)} & $\Delta$ \\
\midrule
\multirow{5}{*}{Convolutional}
&& \valexnet{-s} & $90.0$ & $5.1$m & $\rightarrow$ & $507$k & $62.52$ & $\rightarrow$ & $65.27$ & $+2.75$ \\
&& \valexnet{-b} & $90.0$ & $8.5$m & $\rightarrow$ & $849$k & $62.76$ & $\rightarrow$ & $65.54$ & $+2.78$ \\
&& \vvgg{-C} & $95.0$ & $10.5$m & $\rightarrow$ & $526$k & $56.49$ & $\rightarrow$ & $57.48$ & $+0.99$ \\
&& \vvgg{-D} & $95.0$ & $15.2$m & $\rightarrow$ & $762$k & $56.85$ & $\rightarrow$ & $57.00$ & $+0.15$ \\
&& \vvgg{-like} & $95.0$ & $15.0$m & $\rightarrow$ & $749$k & $54.86$ & $\rightarrow$ & $55.73$ & $+0.87$ \\
\bottomrule
\end{tabular}
\caption[]{
Pruning results of {\small SNIP}{} on {\small Tiny-ImageNet}{} (before $\rightarrow$ after).
{\small Tiny-ImageNet}{}\footnotemark~is a subset of the full {\small ImageNet}{}: there are $200$ classes in total, each class has $500$ and $50$ images for training and validation respectively, and each image has the spatial resolution of $64 \times 64$.
Compared to \cifar{-10}, the resolution is doubled, and to deal with this, the stride of the first convolution in all architectures is doubled, following the standard practice for this dataset.
In general, the {\small Tiny-ImageNet}{} classification task is considered much more complex than {\small MNIST}{} or \cifar{-10}.
Even on {\small Tiny-ImageNet}{}, however, {\small SNIP}{} is still able to prune a large amount of parameters with minimal loss in performance.
\salexnet{} models lose more accuracies than \svgg{}s, which may be attributed to the fact that the first convolution stride for \salexnet{} is set to be $4$ (by its design of no pooling) which is too large and could lead to high loss of information when pruned.
}
\label{tab:compare-various-arch-tiny-imagenet}
\end{table}
\footnotetext{https://tiny-imagenet.herokuapp.com/}
\newpage
\section{Architecture details}
\begin{table}[h]
\centering
\footnotesize
\begin{tabular}{c c c c c c}
\toprule
Module & Weight & Stride & Bias & BatchNorm & ReLU \\
\midrule
Conv & $[11, 11, 3, 96]$ & $[2, 2]$ & $[96]$ & \checkmark & \checkmark \\
Conv & $[5, 5, 96, 256]$ & $[2, 2]$ & $[256]$ & \checkmark & \checkmark \\
Conv & $[3, 3, 256, 384]$ & $[2, 2]$ & $[384]$ & \checkmark & \checkmark \\
Conv & $[3, 3, 384, 384]$ & $[2, 2]$ & $[384]$ & \checkmark & \checkmark \\
Conv & $[3, 3, 384, 256]$ & $[2, 2]$ & $[256]$ & \checkmark & \checkmark \\
Linear & $[256, 1024 \times k]$ & -- & $[1024 \times k]$ & \checkmark & \checkmark \\
Linear & $[1024 \times k, 1024 \times k]$ & -- & $[1024 \times k]$ & \checkmark & \checkmark \\
Linear & $[1024 \times k, c]$ & -- & $[c]$ & \xmark & \xmark \\
\bottomrule
\end{tabular}
\caption[]{
\salexnet{-s} ($k=1$) and \salexnet{-b} ($k=2$).
In the last layer, $c$ denotes the number of possible classes: $c=10$ for \cifar{-10} and $c=200$ for {\small Tiny-ImageNet}{}.
The strides in the first convolution layer for {\small Tiny-ImageNet}{} are set $[4, 4]$ instead of $[2, 2]$ to deal with the increase in the image resolution.
}
\label{tab:alexnet-detail}
\end{table}
\begin{table}[h]
\centering
\footnotesize
\begin{tabular}{c c c c c c}
\toprule
Module & Weight & Stride & Bias & BatchNorm & ReLU \\
\midrule
Conv & $[3, 3, 3, 64]$ & $[1, 1]$ & $[64]$ & \checkmark & \checkmark \\
Conv & $[3, 3, 64, 64]$ & $[1, 1]$ & $[64]$ & \checkmark & \checkmark \\
Pool & -- & $[2, 2]$ & -- & \xmark & \xmark \\
Conv & $[3, 3, 64, 128]$ & $[1, 1]$ & $[128]$ & \checkmark & \checkmark \\
Conv & $[3, 3, 128, 128]$ & $[1, 1]$ & $[128]$ & \checkmark & \checkmark \\
Pool & -- & $[2, 2]$ & -- & \xmark & \xmark \\
Conv & $[3, 3, 128, 256]$ & $[1, 1]$ & $[256]$ & \checkmark & \checkmark \\
Conv & $[3, 3, 256, 256]$ & $[1, 1]$ & $[256]$ & \checkmark & \checkmark \\
Conv & $[1/3/3, 1/3/3, 256, 256]$ & $[1, 1]$ & $[256]$ & \checkmark & \checkmark \\
Pool & -- & $[2, 2]$ & -- & \xmark & \xmark \\
Conv & $[3, 3, 256, 512]$ & $[1, 1]$ & $[512]$ & \checkmark & \checkmark \\
Conv & $[3, 3, 512, 512]$ & $[1, 1]$ & $[512]$ & \checkmark & \checkmark \\
Conv & $[1/3/3, 1/3/3, 512, 512]$ & $[1, 1]$ & $[512]$ & \checkmark & \checkmark \\
Pool & -- & $[2, 2]$ & -- & \xmark & \xmark \\
Conv & $[3, 3, 512, 512]$ & $[1, 1]$ & $[512]$ & \checkmark & \checkmark \\
Conv & $[3, 3, 512, 512]$ & $[1, 1]$ & $[512]$ & \checkmark & \checkmark \\
Conv & $[1/3/3, 1/3/3, 512, 512]$ & $[1, 1]$ & $[512]$ & \checkmark & \checkmark \\
Pool & -- & $[2, 2]$ & -- & \xmark & \xmark \\
Linear & $[512, 512]$ & -- & $[512]$ & \checkmark & \checkmark \\
Linear & $[512, 512]$ & -- & $[512]$ & \checkmark & \checkmark \\
Linear & $[512, c]$ & -- & $[c]$ & \xmark & \xmark \\
\bottomrule
\end{tabular}
\caption[]{
\svgg{-C/D/like}.
In the last layer, $c$ denotes the number of possible classes: $c=10$ for \cifar{-10} and $c=200$ for {\small Tiny-ImageNet}{}.
The strides in the first convolution layer for {\small Tiny-ImageNet}{} are set $[2, 2]$ instead of $[1, 1]$ to deal with the increase in the image resolution.
The second Linear layer is only used in \svgg{-C/D}.
}
\label{tab:vgg-detail}
\end{table}
\section{Related work}
\textbf{Classical methods.}\quad
Essentially, early works in network pruning can be categorized into two groups~(\cite{reed1993pruning}): 1) those that utilize sparsity enforcing penalties; and 2) methods that prune the network based on some saliency criterion.
The methods from the former category~(\cite{chauvin1989back, weigend1991generalization, ishikawa1996structural}) augment the loss function with some sparsity enforcing penalty terms (\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot, $L_0$ or $L_1$ norm), so that back-propagation effectively penalizes the magnitude of the weights during training.
Then weights below a certain threshold may be removed.
On the other hand, classical saliency criteria include the sensitivity of the loss with respect to the neurons~(\cite{NIPS1988_119}) or the weights~(\cite{karnin1990simple}) and Hessian of the loss with respect to the weights~(\cite{lecun1990optimal, hassibi1993optimal}).
Since these criteria are heavily dependent on the scale of the weights and are designed to be incorporated within the learning process, these methods are prohibitively slow requiring many iterations of pruning and learning steps.
Our approach identifies redundant weights from an architectural point of view and prunes them once at the beginning before training.
\textbf{Modern advances.}\quad
In recent years, the increased space and time complexities as well as the risk of overfitting in deep neural networks prompted a surge of further investigation in network pruning.
While Hessian based approaches employ the diagonal approximation due to its computational simplicity, impressive results (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot, extreme sparsity without loss in accuracy) are achieved using magnitude of the weights as the criterion~(\cite{han2015learning}).
This made them the de facto standard method for network pruning and led to various implementations~(\cite{guo2016dynamic, Carreira-Perpiñán_2018_CVPR}).
The magnitude criterion is also extended to recurrent neural networks~(\cite{narang2017exploring}), yet with heavily tuned hyperparameter setting.
Unlike our approach, the main drawbacks of magnitude based approaches are the reliance on pretraining and the expensive prune -- retrain cycles.
Furthermore, since pruning and learning steps are intertwined, they often require highly heuristic design choices which make them non-trivial to be extended to new architectures and different tasks.
Meanwhile, Bayesian methods are also applied to network pruning~(\cite{ullrich2017soft, molchanov2017variational}) where the former extends the soft weight sharing in \cite{nowlan1992simplifying} to obtain a sparse and compressed network, and the latter uses variational inference to learn the dropout rate which can then be used to prune the network.
Unlike the above methods, our approach is simple and easily adaptable to any given architecture or task without modifying the pruning procedure.
\textbf{Network compression in general.}\quad
Apart from weight pruning, there are approaches focused on structured simplification such as pruning filters~(\cite{li2016pruning, molchanov2016pruning}), structured sparsity with regularizers~(\cite{wen2016learning}), low-rank approximation~(\cite{jaderberg2014speeding}), matrix and tensor factorization~(\cite{novikov2015tensorizing}), and sparsification using expander graphs~(\cite{prabhu2017deep}) or Erd\H{o}s-R\'{e}nyi random graph~(\cite{mocanu2018scalable}).
In addition, there is a large body of work on compressing the representation of weights.
A non-exhaustive list includes quantization (\cite{gong2014compressing}), reduced precision~(\cite{gupta2015deep}) and binary weights~(\cite{Hubara2016binarized}).
In this work, we focus on weight pruning that is free from structural constraints and amenable to further compression schemes.
\section{Single-shot network pruning based on connection sensitivity}
Given a neural network and a dataset, our goal is to design a method that can selectively prune redundant connections for the given task in a data-dependent way even before training.
To this end, we first introduce a criterion to identify important connections and then discuss its benefits.
\SKIP{
Given a dataset ${\mathcal{D}} = \{({\mathbf{x}}_i, {\mathbf{y}}_i)\}_{i=1}^n$, training a neural network can be written as the following optimization problem:
\begin{align}\label{eq:nn}
\min_{{\mathbf{w}}} L({\mathbf{w}}) &= \min_{{\mathbf{w}}} \frac{1}{n} \sum_{i=1}^n \ell_i({\mathbf{w}})\
,\\\nonumber
\text{s.t.}\quad{\mathbf{w}} &\in \mathbb{R}^m\ .
\end{align}\NOTE{do we want to add the pruning constraint here?}
Here, $\ell_i(\cdot)$ represents the loss function associated with each data point $({\mathbf{x}}_i, {\mathbf{y}}_i)\in{\mathcal{D}}$ and ${\mathbf{w}}$ is the set of parameters of the neural network.
Note that, in a neural network, each parameter can be thought of as the weight of the corresponding connection, and setting it to zero means the connection is removed from the network.
The main hypothesis behind the neural network pruning literature is that modern networks are usually overparametrized (in fact $m$ is in the order of millions), and the same performance can be obtained by a much smaller network~\cite{?}.
Majority of the pruning works have been devoted to finding a good criterion to obtain redundant connections (\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot, magnitude based~\cite{han2015learning,guo2016dynamic} or Hessian based~\cite{lecun1990optimal,hassibi1993optimal,dong2017learning}), however, all of them require pretrained networks and go through many expensive prune -- retrain cycles.
Such an exorbitant requirement hinders the use of pruning methods in large-scale applications~\NOTE{make sure this is true} and raises questions about the credibility of the previous pruning criteria.
In this work, we attempt to measure the importance of each connection directly in a data-dependent manner.
This enables us to prune the network once at the beginning, and then the training can be performed on the sparse pruned network.
Therefore, our method alleviates the expensive prune -- retrain cycles, and in theory, it can be an order of magnitude faster than standard neural network training as it can be implemented using sparse software libraries.
}
\subsection{Connection sensitivity: architectural perspective}
Since we intend to measure the importance (or sensitivity) of each connection independently of its weight, we introduce auxiliary indicator variables ${\mathbf{c}}\in\{0,1\}^m$ representing the connectivity of parameters ${\mathbf{w}}$.\footnote{Multiplicative coefficients (similar to ${\mathbf{c}}$) were also used for subset regression in \cite{breiman1995better}.}
Now, given the sparsity level $\kappa$,~\Eqref{eq:nn} can be correspondingly modified as:
\vspace{-1mm}
\begin{align}\label{eq:nnc}
\min_{{\mathbf{c}},{\mathbf{w}}} L({\mathbf{c}} \odot{\mathbf{w}}; {\mathcal{D}}) &= \min_{{\mathbf{c}},{\mathbf{w}}} \frac{1}{n} \sum_{i=1}^n
\ell({\mathbf{c}} \odot{\mathbf{w}}; ({\mathbf{x}}_i, {\mathbf{y}}_i))\ ,\\[-1mm]\nonumber
\text{s.t.}\quad{\mathbf{w}} &\in \mathbb{R}^m \ ,\\\nonumber
{\mathbf{c}} &\in \{0,1\}^m, \quad \|{\mathbf{c}}\|_0 \le \kappa\ ,
\end{align}
where $\odot$ denotes the Hadamard product.
Compared to~\Eqref{eq:nn}, we have doubled the number of learnable parameters in the network and directly optimizing the above problem is even more difficult.
However, the idea here is that since we have separated the weight of the connection (${\mathbf{w}}$) from whether the connection is present or not (${\mathbf{c}}$), we may be able to determine the importance of each connection by measuring its effect on the loss function.
For instance, the value of $c_j$ indicates whether the connection $j$ is active ($c_j = 1$) in the network or pruned ($c_j =0$).
Therefore, to measure the effect of connection $j$ on the loss, one can try to measure the difference in loss when $c_j=1$ and $c_j=0$, keeping everything else constant.
Precisely, the effect of removing connection $j$ can be measured by,
\begin{align}\label{eq:csd}
\Delta L_j({\mathbf{w}};{\mathcal{D}}) &= L(\boldsymbol{1} \odot{\mathbf{w}};{\mathcal{D}}) - L((\boldsymbol{1} - {\mathbf{e}}_j) \odot{\mathbf{w}};{\mathcal{D}})\ ,
\end{align}
where ${\mathbf{e}}_j$ is the indicator vector of element $j$ (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot, zeros everywhere except at the index $j$ where it is one) and $\boldsymbol{1}$ is the vector of dimension $m$.
Note that computing $\Delta L_j$ for each $j\in\{1\ldots m\}$ is prohibitively expensive as it requires $m+1$ (usually in the order of millions) forward passes over the dataset.
In fact, since ${\mathbf{c}}$ is binary, $L$ is not differentiable with respect to ${\mathbf{c}}$, and it is easy to see that $\Delta L_j$ attempts to measure the influence of connection $j$ on the loss function in this discrete setting.
Therefore, by relaxing the binary constraint on the indicator variables ${\mathbf{c}}$, $\Delta L_j$ can be approximated by the derivative of $L$ with respect to $c_j$, which we denote $g_j({\mathbf{w}};{\mathcal{D}})$.
Hence, the effect of connection $j$ on the loss can be written as:
\begin{align}\label{eq:csc}
\Delta L_j({\mathbf{w}};{\mathcal{D}}) &\approx g_j({\mathbf{w}};{\mathcal{D}}) = \left.\frac{\partial L({\mathbf{c}}\odot{\mathbf{w}};{\mathcal{D}})}{\partial c_j}\right|_{{\mathbf{c}}=\boldsymbol{1}} = \left.\lim_{\delta\to 0} \frac{L({\mathbf{c}}
\odot{\mathbf{w}};{\mathcal{D}}) - L(({\mathbf{c}} - \delta\,{\mathbf{e}}_j) \odot{\mathbf{w}};{\mathcal{D}})}{\delta}\right|_{{\mathbf{c}}=\boldsymbol{1}}\
.\\[-7mm]\nonumber
\end{align}
In fact, ${\partial L}/{\partial c_j}$ is an infinitesimal version of $\Delta L_j$, that measures the rate of change of $L$ with respect to an infinitesimal change in $c_j$ from $1 \to 1-\delta$.
This can be computed efficiently in one forward-backward pass using automatic differentiation, for all $j$ at once.
Notice, this formulation can be viewed as perturbing the weight $w_j$ by a multiplicative factor $\delta$ and measuring the change in loss.
This approximation is similar in spirit to~\cite{koh2017understanding} where they try to measure the influence of a datapoint to the loss function.
Here we measure the influence of connections.
Furthermore, ${\partial L}/{\partial c_j}$ is not to be confused with the gradient with respect to the weights $\left({\partial L}/{\partial w_j}\right)$, where the change in loss is measured with respect to an additive change in weight $w_j$.
Notably, our interest is to discover important (or sensitive) connections in the architecture, so that we can prune unimportant ones in single-shot, disentangling the pruning process from the iterative optimization cycles.
To this end, we take the magnitude of the derivatives $g_j$ as the saliency criterion.
Note that if the magnitude of the derivative is high (regardless of the sign), it essentially means that the connection $c_j$ has a considerable effect on the loss (either positive or negative), and it has to be preserved to allow learning on $w_j$.
Based on this hypothesis, we define connection sensitivity as the normalized magnitude of the derivatives:
\vspace{-2mm}
\begin{equation}\label{eq:sens}
s_j = \frac{\left|g_j({\mathbf{w}};{\mathcal{D}})\right| }{\sum_{k=1}^m
\left|g_k({\mathbf{w}};{\mathcal{D}})\right|}\
\end{equation}
Once the sensitivity is computed, only the top-$\kappa$ connections are retained, where $\kappa$ denotes the desired number of non-zero weights.
Precisely, the indicator variables ${\mathbf{c}}$ are set as follows:
\begin{equation}
c_j =\mathbbm{1}[s_j - \tilde{s}_{\kappa} \ge 0]\ ,\quad \forall\,j\in \{1\ldots m\}\ ,
\end{equation}
where $\tilde{s}_{\kappa}$ is the $\kappa$-th largest element in the vector ${\mathbf{s}}$ and $\mathbbm{1}[\cdot]$ is the indicator function.
Here, for exactly $\kappa$ connections to be retained, ties can be broken arbitrarily.
We would like to clarify that the above criterion (\Eqref{eq:sens}) is different from the criteria used in early works by~\cite{NIPS1988_119} or~\cite{karnin1990simple} which do not entirely capture the connection sensitivity.
The fundamental idea behind them is to identify elements (\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot weights or neurons) that least degrade the performance when removed.
This means that their saliency criteria (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot $-{\partial L}/{\partial {\mathbf{w}}}$ or $-{\partial L}/{\partial {\boldsymbol{\alpha}}}$; $\boldsymbol{\alpha}$ refers to the connectivity of neurons), in fact, depend on the loss value before pruning, which in turn, require the network to be pre-trained and iterative optimization cycles to ensure minimal loss in performance.
They also suffer from the same drawbacks as the magnitude and Hessian based methods as discussed in~\Secref{sec:prelim}.
In contrast, our saliency criterion (\Eqref{eq:sens}) is designed to measure the sensitivity as to how much influence elements have on the loss function regardless of whether it is positive or negative.
This criterion alleviates the dependency on the value of the loss, eliminating the need for pre-training.
These fundamental differences enable the network to be pruned at single-shot prior to training, which we discuss further in the next section.
\subsection{Single-shot pruning at initialization}
\label{sec:single-random}
\begin{algorithm}[t]
\caption{SNIP: Single-shot Network Pruning based on Connection Sensitivity}
\label{alg:prune}
\begin{algorithmic}[1]
\REQUIRE Loss function $L$, training dataset $\mathcal{D}$, sparsity level $\kappa$ \tikzmark{right}
\COMMENT{Refer~\Eqref{eq:nnc}}
\ENSURE $\|{\mathbf{w}}^*\|_0 \le \kappa$
\STATE ${\mathbf{w}} \gets \text{VarianceScalingInitialization}$
\COMMENT{Refer~\Secref{sec:single-random}}
\STATE ${\mathcal{D}}^{b} = \{\left( {\mathbf{x}}_i, {\mathbf{y}}_i \right)\}^{b}_{i=1} \sim \mathcal{D}$
\COMMENT{Sample a mini-batch of training data}
\STATE $s_j \gets \frac{\left|g_j({\mathbf{w}};{\mathcal{D}}^{b})\right|}{\sum_{k=1}^m \left|g_k({\mathbf{w}};{\mathcal{D}}^b)\right|}\ ,\quad \forall j\in \{1\ldots m\}$
\COMMENT{Connection sensitivity}
\STATE $\tilde{{\mathbf{s}}} \gets \text{SortDescending}({\mathbf{s}})$
\STATE $c_j \gets \mathbbm{1}[s_j - \tilde{s}_{\kappa} \ge 0]\ ,\quad \forall\,j\in \{1\ldots m\}$
\COMMENT{Pruning: choose top-$\kappa$ connections}
\STATE ${\mathbf{w}}^* \gets \argmin_{{\mathbf{w}}\in\mathbb{R}^m}L({\mathbf{c}} \odot{\mathbf{w}}; {\mathcal{D}})$
\COMMENT{Regular training}
\STATE ${\mathbf{w}}^* \gets {\mathbf{c}} \odot {\mathbf{w}}^*$
\end{algorithmic}
\end{algorithm}
Note that the saliency measure defined in~\Eqref{eq:sens} depends on the value of weights ${\mathbf{w}}$ used to evaluate the derivative as well as the dataset ${\mathcal{D}}$ and the loss function $L$.
In this section, we discuss the effect of each of them and show that it can be used to prune the network in single-shot with initial weights ${\mathbf{w}}$.
Firstly, in order to minimize the impact of weights on the derivatives $\partial L / \partial c_j$, we need to choose these weights carefully.
For instance, if the weights are too large, the activations after the non-linear function (\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot, sigmoid) will be saturated, which would result in uninformative gradients.
Therefore, the weights should be within a sensible range.
In particular, there is a body of work on neural network initialization~(\cite{goodfellow2016deep}) that ensures the gradients to be in a reasonable range, and our saliency measure can be used to prune neural networks at any such initialization.
Furthermore, we are interested in making our saliency measure robust to architecture variations.
Note that initializing neural networks is a random process, typically done using normal distribution.
However, if the initial weights have a fixed variance, the signal passing through each layer no longer guarantees to have the same variance, as noted by~\cite{LeCun1998fficient}.
This would make the gradient and in turn our saliency measure, to be dependent on the architectural characteristics.
Thus, we advocate the use of variance scaling methods~(\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot,~\cite{glorot2010understanding}) to initialize the weights, such that the variance remains the same throughout the network.
By ensuring this, we empirically show that our saliency measure computed at initialization is robust to variations in the architecture.
Next, since the dataset and the loss function defines the task at hand, by relying on both of them, our saliency criterion in fact discovers the connections in the network that are important to the given task.
However, the practitioner needs to make a choice on whether to use the whole training set, or a mini-batch or the validation set to compute the connection saliency.
Moreover, in case there are memory limitations (\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot, large model or dataset), one can accumulate the saliency measure over multiple batches or take an exponential moving average.
In our experiments, we show that using only one mini-batch of a reasonable number of training examples can lead to effective pruning.
Finally, in contrast to the previous approaches, our criterion for finding redundant connections is simple and directly based on the sensitivity of the connections.
This allows us to effectively identify and prune redundant connections in a single step even before training.
Then, training can be performed on the resulting pruned (sparse) network.
We name our method {\small SNIP}{} for Single-shot Network Pruning, and the complete algorithm is given in~\Algref{alg:prune}.
\SKIP{
Suppose $f(\cdot; {\mathbf{w}})$ a neural network $f: {\mathbb{R}}^{\text{in}} \rightarrow {\mathbb{R}}^{\text{out}}$ parametrized by ${\mathbf{w}} \in {\mathbb{R}}^{n}$.
Given a dataset $\mathcal{D}$ of inputs ${\mathbf{x}}$ and corresponding labels ${\mathbf{y}}$ and a loss function $\mathcal{L}$, the objective in a supervised learning setting is to find the optimal weights ${\mathbf{x}}^{*}$ that minimize the empirical risk:
\begin{equation}
{\mathbf{w}}^{*} = \argmin_{{\mathbf{w}}} \mathcal{L}\big(f({\mathbf{x}} ; {\mathbf{w}}), {\mathbf{y}}\big),
\end{equation}
which is often solved by gradient descent optimization algorithms.
Since the number of parameters or weights (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot $n$) in modern deep networks can be considerably large, it typically requires a large memory space as well as computation time during both training and inference phases.
In network pruning, it is hypothesized that a network is often highly overparametrized and there are unimportant parameters that can be eliminated; by pruning redundant parameters (or connections), it will save memory space and computation time, simplify the model and improve generalization.
Assuming that parameters (or weights ${\mathbf{w}}$) have some importance scores $\mathcal{I}({\mathbf{w}})$, those considered unimportance based on some criteria are simply set to be $0$ to be pruned.
Then, the important question is how to define the importance function $\mathcal{I}(\cdot)$.
\subsection{Standard approaches}
\label{sec:standard}
The majority of pruning works take the magnitude of weights as the importance measure: remove weights that are below a certain threshold (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot ${\mathbf{w}}_i = 0$ if ${\mathbf{w}}_i < \eta$).
The idea behind is that lower valued weights will transmit less meaningful information than higher valued ones; thus the formers are less important and may be pruned.
This approach turns out to work quite well, however, it is highly heuristic and has several disadvantages.
Depending on the learning policy (\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot learning rate) and/or architectural choices (\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot normalization layer), for example, the weights to be pruned can vary exceedingly.
Related to this, the magnitude based pruning needs to be performed arbitrary number of times (typically many), which brings into questions the reliability of criterion.
In this work, we take a different approach to standard network pruning.
The basic idea is to use some gradient information to determine the importance of network parameters.
Since gradients indicate the rate of changes in some quantities with respect to some other changes, it is reasonable to view connections causing less changes as relatively less important than the others.
Not surprisingly, early pruning works suggested to use the second order gradient information for network pruning (OBD and OBS from \cite{lecun1990optimal} and \cite{hassibi1993optimal} respectively).
Starting from the functional Taylor series of the loss with respect to weights,
\begin{equation}
\delta L = (\frac{\partial L}{\partial {\mathbf{w}}})^\mathsf{T} \cdot \delta {\mathbf{w}} + \frac{1}{2} \delta {\mathbf{w}}^\mathsf{T} \cdot {\mathbf{H}} \cdot \delta {\mathbf{w}} + \mathcal{O}(||\delta{\mathbf{w}} ||^{3})
\label{eq:error-taylor}
\end{equation}
where ${\mathbf{H}} \equiv \partial^{2}L/\partial{\mathbf{w}}^{2}$ is the Hessian matrix containing all second order derivatives, the goal is to find a set of parameters that cause the least increase of loss $L$ when removed.
By assuming the network is converged to a (local) minima and ignoring the third and higher order terms, all terms except for the second term in Eq.~\ref{eq:error-taylor} vanish.
Depending on whether to consider only diagonal or all elements in ${\mathbf{H}}$, this eventually leads OBD and OBS to the solutions of ${\mathbf{w}}^{2}_{i}{\mathbf{H}}_{ii}/2$ and ${{\mathbf{w}}^{2}_{i}}/{2{\mathbf{H}}^{-1}_{ii}}$ respectively for $\mathcal{I}({\mathbf{w}}_i)$.
Although more principled in theory than the magnitude based approach, several assumptions made in this approach make it infeasible to be employed in practice;
Hessian matrix is neither diagonal or positive definite, approximate at best and expensive to compute; \emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot OBS re-computes the inverse Hessian every time a single weight is removed.
\subsection{Proposed approach}
Let us introduce auxiliary varibles ${\mathbf{c}} \in {\mathbb{R}}^{n}$ representing the connectivity of neural connections in the network and construct a new neural network $g$ by the Hadamard product with the network parameters ${\mathbf{w}}$.
With ${\mathbf{c}}$ becoming sparse and binary, \emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot ${\mathbf{c}}: {\mathbf{c}}_i \in \{0, 1\}$ by $\mathcal{I}({\mathbf{w}}_i)$ for all $i=1,..,n$, the objective can be newly formulated as solving a constrained optimization problem as the following:
\begin{equation}
\begin{aligned}
& \underset{{\mathbf{c}}, {\mathbf{w}}}{\text{minimize}} & & \mathcal{L}\big( g({\mathbf{x}}; {\mathbf{c}} \odot {\mathbf{w}}), {\mathbf{y}} \big) \\
& \text{subject to} & & {\mathbf{c}} \in \{0, 1\}^{n}.
\end{aligned}
\end{equation}
Treating ${\mathbf{c}}$ as hyperparameters formualtes a nested optimization problem, however, it becomes quickly prohibitive to solve directly as the number of hyperparmeters grows (\cite{hazan2017hyperparameter}).
Instead, we suggest an alternative based on perturbing the connectivity parameters and measure the sensitivity of connections.
The idea is that if a connection is highly responsive or relatively more responsive to some changes than others, it means to be structurally important thus should survive from pruning.
Recently, similar ideas were presented for other purposes; using influence functions to understand model behavior by \cite{koh2017understanding} and re-weighting noisy and unbalanced examples by \cite{ren2018learning} to name a few.
Here, we use the simliar idea for network pruning.
Also we directly perturb the network's internal parameters rather than inputs/outputs to/from the network.
Consider taking the analytical gradients of the loss from the network $g$ with respect to ${\mathbf{c}}$:
\begin{equation}
\begin{aligned}
\nabla_{{\mathbf{c}}} L_g = \frac{\partial L_g}{\partial {\mathbf{c}}} & = \lim_{\delta \to 0} \frac{\mathcal{L}\big( g(\cdot; ({\mathbf{c}} + \delta) \odot {\mathbf{w}}) \big) - \mathcal{L}\big(g(\cdot; {\mathbf{c}} \odot {\mathbf{w}})\big)}{\delta} \\
& = \lim_{\delta \to 0} \frac{\mathcal{L}\big( g(\cdot; {\mathbf{c}} \odot {\mathbf{w}} + \delta \odot {\mathbf{w}}) \big) - \mathcal{L}\big(g(\cdot; {\mathbf{c}} \odot {\mathbf{w}})\big)}{\delta},
\end{aligned}
\label{eq:grad-wrt-c}
\end{equation}
where we omit ${\mathbf{x}}$ and ${\mathbf{y}}$ in the loss function $\mathcal{L}$ to remove notational clutters.
In essence, this measures the rate of change in the loss when each connection or parameter is perturbed by $\delta {\mathbf{w}}_i$.
By taking only the magnitude of this gradients and normalizing them, we define new importance function:
\begin{equation}
\mathcal{I}({\mathbf{w}}_i) \coloneqq \frac{\big| \frac{\partial L_g}{\partial {\mathbf{c}}_i} \big|}{\sum_{i} \big| \frac{\partial L_g}{\partial {\mathbf{c}}_i} \big|},
\label{eq:importance-func}
\end{equation}
which means that the importance of a network connection is relatievely defined by how large the perturbation makes an impact to the network thereby how important the connection is.
The sparse and binary mask ${\mathbf{c}}$ is created by sorting the weights based on their importance scores using Eq.~\ref{eq:importance-func} and binarize them given a sparsity level $\kappa$.
\textbf{Single-shot purning at cold start}.
Recall that in Hessian based approaches, the first order gradients are set to be zeros (the first term in Eq.~\ref{eq:error-taylor}) assuming that the network is trained to a local minimum in error.
This condition demands the requirement that the network needs to be pre-trained, which is why in most cases pruning has been done as a post-processing after training the reference network.
A few works attempted to perform pruning without pre-training or during training, however, magnitude-based importance scores can be highly disorienting and susceptible to erroneous pruning if computed before the weights reach to its optimal (if it can) or there are architectural matters as pointed out earlier in Sec.~\ref{sec:standard}.
Note that in practice a moderately large network will hardly produce zero loss.
However, we are interested in pruning a network without pre-training and only once.
To find out why our importance function in Eq.~\ref{eq:importance-func} allow us to achieve this goal, let us compare $\nabla_{{\mathbf{c}}} L_g$ in Eq.~\ref{eq:grad-wrt-c} with the analytical gradients of the standard network $f$ in the following,
\begin{equation}
\nabla_{{\mathbf{w}}} L_f = \frac{\partial L_f}{\partial {\mathbf{w}}} = \lim_{\delta \to 0} \frac{\mathcal{L}\big( g(\cdot; {\mathbf{w}} + \delta) \big) - \mathcal{L}\big(g(\cdot; {\mathbf{w}})\big)}{\delta}. \\
\label{eq:grad-wrt-w}
\end{equation}
At first, as opposed to $\nabla_{{\mathbf{c}}} L_g$, $\nabla_{{\mathbf{w}}} L_f$ in Eq.~\ref{eq:grad-wrt-w} measures the rate of change in loss by the same perturbation $\delta$ in isolation from the current weight ${\mathbf{w}}$.
In other words, it is not desirable to take $\nabla_{{\mathbf{w}}} L_f$ as the importance measure since weights (regardless of whether they are optimal) are not evenly distributed in scale with respect to $\delta$.
Conversely, notice that $\nabla_{{\mathbf{c}}} L_g$ does not limit the weights to be optimal or pre-trained because the perturbation $\delta$ is scaled proportionally to the current weghts ${\mathbf{w}}$.
This means that the importance scores can be computed regardless of ${\mathbf{w}}$ optimality, which further allows us to measure the importance of network weights even at random initialization.
Without no architectural restrictions made so far, this leads us to the following pruning scheme: given a neural network (model agnostic), we prune the architecture only once (single-shot) before any procedures using the perturbation gradients computed from the randomly initialized network (cold gradient) and begin training the sparsified network as normal training.
\textbf{Accumulate gradients over multiple mini-batches}.
\textbf{Algorithm table}.
\clearpage
}
\section{Experiments}
We evaluate our method, {\small SNIP}{}, on {\small MNIST}{}, \cifar{-10} and {\small Tiny-ImageNet}{} classification tasks with a variety of network architectures.
Our results show that {\small SNIP}{} yields extremely sparse models with minimal or no loss in accuracy across all tested architectures, while being much simpler than other state-of-the-art alternatives.
We also provide clear evidence that our method prunes genuinely explainable connections rather than performing blind pruning.
\textbf{Experiment setup}\quad
For brevity, we define the sparsity level to be $\bar{\kappa} = (m-\kappa)/m\cdot 100\,(\%)$, where $m$ is the total number of parameters and $\kappa$ is the desired number of non-zero weights.
For a given sparsity level $\bar{\kappa}$, the sensitivity scores are computed using a batch of $100$ and $128$ examples for {\small MNIST}{} and \cifar{} experiments, respectively.
After pruning, the pruned network is trained in the standard way.
Specifically, we train the models using SGD with momentum of $0.9$, batch size of $100$ for {\small MNIST}{} and $128$ for \cifar{} experiments and the weight decay rate of $0.0005$, unless stated otherwise.
The initial learning rate is set to $0.1$ and decayed by $0.1$ at every $25$k or $30$k iterations for {\small MNIST}{} and \cifar{}, respectively.
Our algorithm requires no other hyperparameters or complex learning/pruning schedules as in most pruning algorithms.
We spare $10$\% of the training data as a validation set and used only $90$\% for training.
For \cifar{} experiments, we use the standard data augmentation (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot, random horizontal flip and translation up to $4$ pixels) for both the reference and sparse models.
The code can be found here:~\href{https://github.com/namhoonlee/snip-public}{https://github.com/namhoonlee/snip-public}.
\SKIP{
Note that, given the desired sparsity level, our method prunes the neural network once at the random initialization, and then, the pruned network is trained in the standard way.
To this end, it would be useful to define the sparsity level as the fraction of parameters to be pruned in the network, \emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot, $\bar{\kappa} = (m-\kappa)/m$, where $m$ is the total number of parameters and $\kappa$ is the desired number of non-zero weights.
The pruned network is then trained using SGD with momentum of $0.9$, batch size of $100$ for {\small MNIST}{} and $128$ for CIFAR experiments and the weight decay rate of $0.0005$, unless stated otherwise.
The initial learning rate is set to $0.1$ and decayed by $0.2$ at every $25$k or $30$k iterations for {\small MNIST}{} and CIFAR, respectively.
Our algorithm requires no other hyperparameters or complex learning/pruning schedules as in most pruning algorithms.
We spare $10$\% of the training data as a validation set and used only $90$\% for training.
For CIFAR experiments, we use the standard data augmentation (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot, random horizontal flip and random translation up to $4$ pixels) for both the reference and sparse models.
Our algorithm is implemented using TensorFlow~(\cite{tensorflow2015-whitepaper}), and the code replicating our experiments will be released upon publication.
}
\SKIP{
We prune the network for the desired sparsity $\bar{\kappa} = (m-\kappa)/m$, single-shot at random initialization, and start training as normal.
Unless otherwise stated, we train all models using SGD with momentum of $0.9$, batch size of $100$ for {\small MNIST}{} and $128$ for CIFAR experiments and the weight decay rate of $0.0005$.
The initial learning rate is set $0.1$ and decays by $0.2$ at every $25$k (or $30$k) iterations.
Our algorithm requires no other hyperparameters or complex learning/pruning schedules as in most pruning algorithms.
We spare $10$\% of the training data as a validation set and used only $90$\% for training.
For CIFAR experiments, we use the standard data augmentation (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot random horizontal flip and random translation up to $4$ pixels) for both the reference and sparse models.
We used the TensorFlow libraries~\cite{tensorflow2015-whitepaper}.
Our algorithm is simple to implement, and yet the code replicating our experiments will be released upon publication.
}
\subsection{Pruning LeNets with varying levels of sparsity}
\begin{figure*}[t]
\centering
\begin{subfigure}{.46\textwidth}
\includegraphics[height=38mm]{figure/lenet300_pc_varying-ts_diff-seeds.eps}
\vspace{-3mm}
\caption{\slenet{-300-100}}
\end{subfigure}
\begin{subfigure}{.46\textwidth}
\includegraphics[height=38mm]{figure/lenet5_pc_varying-ts_diff-seeds.eps}
\vspace{-3mm}
\caption{\slenet{-5-Caffe}}
\end{subfigure}
\caption{
Test errors of \slenet{s} pruned at varying sparsity levels $\bar{\kappa}$, where
$\bar{\kappa}=0$ refers to the reference network trained without pruning.
Our approach performs as good as the reference network across varying sparsity levels on both the models.
}
\label{fig:varying-ts}
\end{figure*}
We first test our approach on two standard networks for pruning, \slenet{-300-100} and \slenet{-5-Caffe}.
\slenet{-300-100} consists of three fully-connected (fc) layers with $267$k parameters and \slenet{-5-Caffe} consists of two convolutional (conv) layers and two fc layers with $431$k parameters.
We prune the \slenet{s} for different sparsity levels $\bar{\kappa}$ and report the performance in error on the {\small MNIST}{} image classification task.
We run the experiment $20$ times for each $\bar{\kappa}$ by changing random seeds for dataset and network initialization.
The results are reported in Figure~\ref{fig:varying-ts}.
The pruned sparse \slenet{-300-100} achieves performances similar to the reference ($\bar{\kappa}=0$), only with negligible loss at $\bar{\kappa}=90$.
For \slenet{-5-Caffe}, the performance degradation is nearly invisible.
Note that our saliency measure does not require the network to be pre-trained and is computed at random initialization.
Despite such simplicity, our approach prunes \slenet{s} quickly (single-shot) and effectively (minimal accuracy loss) at varying sparsity levels.
\subsection{Comparisons to existing approaches}
\begin{table*}[t]
\centering
\scriptsize
\begin{tabular}{l c cc cc ccc@{\hspace{.95\tabcolsep}}c@{\hspace{.95\tabcolsep}}c@{\hspace{.95\tabcolsep}}}
\toprule
\multirow{2}{*}{Method} & \multirow{2}{*}{Criterion} & \multicolumn{2}{c}{\vlenet{-300-100}} & \multicolumn{2}{c}{\vlenet{-5-Caffe}} & \multirow{2}{*}{Pretrain} & \multirow{2}{*}{\# Prune} & Additional & Augment & Arch. \\
& & $\bar{\kappa}$ (\%) & err. (\%) & $\bar{\kappa}$ (\%) & err. (\%) & & & hyperparam. & objective & constraints \\
\midrule
Ref. & -- & -- & $1.7$ & -- & $0.9$ & -- & -- & -- & -- & -- \\
LWC & \multicolumn{1}{l}{Magnitude} & $91.7$ & $\mathbf{1.6}$ & $91.7$ & $\mathbf{0.8}$ & \checkmark & many & \checkmark & \xmark & \checkmark \\
DNS & \multicolumn{1}{l}{Magnitude} & $98.2$ & $2.0$ & $99.1$ & $0.9$ & \checkmark & many & \checkmark & \xmark & \checkmark \\
LC & \multicolumn{1}{l}{Magnitude} & $99.0$ & $3.2$ & $99.0$ & $1.1$ & \checkmark & many & \checkmark & \checkmark & \xmark \\
SWS & \multicolumn{1}{l}{Bayesian} & $95.6$ & $1.9$ & $99.5$ & $1.0$ & \checkmark & soft & \checkmark & \checkmark & \xmark \\
SVD & \multicolumn{1}{l}{Bayesian} & $98.5$ & $1.9$ & $99.6$ & $\mathbf{0.8}$ & \checkmark & soft & \checkmark & \checkmark & \xmark \\
OBD & \multicolumn{1}{l}{Hessian} & $92.0$ & $2.0$ & $92.0$ & $2.7$ & \checkmark & many & \checkmark & \xmark & \xmark \\
L-OBS & \multicolumn{1}{l}{Hessian} & $98.5$ & $2.0$ & $99.0$ & $2.1$ & \checkmark & many & \checkmark & \xmark & \checkmark \\
\midrule
\multirow{2}{*}{SNIP \textcolor{gray}{(ours)}} & \multicolumn{1}{l}{Connection} & $95.0$ & $\mathbf{1.6}$ & $98.0$ & $\mathbf{0.8}$ & \multirow{2}{*}{\xmark} & \multirow{2}{*}{ $\bm{1}$} & \multirow{2}{*}{\xmark} & \multirow{2}{*}{\xmark}& \multirow{2}{*}{\xmark} \\
& \multicolumn{1}{l}{sensitivity} & $98.0$ & $2.4$ & $99.0$ & $1.1$ & & & & \\
\bottomrule
\end{tabular}
\caption{
Pruning results on \slenet{s} and comparisons to other approaches.
Here, ``many'' refers to an arbitrary number often in the order of total learning steps, and ``soft'' refers to soft pruning in Bayesian based methods.
Our approach is capable of pruning up to $98$\% for \slenet{-300-100} and $99$\% for \slenet{-5-Caffe} with marginal increases in error from the reference network.
Notably, our approach is considerably simpler than other approaches, with no requirements such as pretraining, additional hyperparameters, augmented training objective or architecture dependent constraints.
}
\label{tab:compare-pruning-lenets}
\end{table*}
What happens if we increase the target sparsity to an extreme level?
For example, would a model with only $1$\% of the total parameters still be trainable and perform well?
We test our approach for extreme sparsity levels (\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot, up to $99$\% sparsity on \slenet{-5-Caffe}) and compare with various pruning algorithms as follows: {\small LWC}{}~(\cite{han2015learning}), {\small DNS}{}~(\cite{guo2016dynamic}), {\small LC}{}~(\cite{Carreira-Perpiñán_2018_CVPR}), {\small SWS}{}~(\cite{ullrich2017soft}), {\small SVD}{}~(\cite{molchanov2017variational}), {\small OBD}{}~(\cite{lecun1990optimal}), {\small L-OBS}{}~(\cite{dong2017learning}).
The results are summarized in Table~\ref{tab:compare-pruning-lenets}.
We achieve errors that are comparable to the reference model, degrading approximately $0.7$\% and $0.3$\% while pruning $98$\% and $99$\% of the parameters in \slenet{-300-100} and \slenet{-5-Caffe} respectively.
For slightly relaxed sparsities (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot, $95$\% for \slenet{-300-100} and $98$\% for \slenet{-5-Caffe}), the sparse models pruned by {\small SNIP}{} record better performances than the dense reference network.
Considering $99\%$ sparsity, our method efficiently finds $1\%$ of the connections even before training, that are sufficient to learn as good as the reference network.
Moreover, {\small SNIP}{} is competitive to other methods, yet it is unparalleled in terms of algorithm simplicity.
To be more specific, we enumerate some key points and non-trivial aspects of other algorithms and highlight the benefit of our approach.
First of all, the aforementioned methods require networks to be fully trained (if not partly) before pruning.
These approaches typically perform many pruning operations even if the network is well pretrained, and require additional hyperparameters (\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot, pruning frequency in~\cite{guo2016dynamic}, annealing schedule in~\cite{Carreira-Perpiñán_2018_CVPR}).
Some methods augment the training objective to handle pruning together with training, increasing the complexity of the algorithm (\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot, augmented Lagrangian in~\cite{Carreira-Perpiñán_2018_CVPR}, variational inference in~\cite{molchanov2017variational}).
Furthermore, there are approaches designed to include architecture dependent constraints (\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot, layer-wise pruning schemes in~\cite{dong2017learning}).
Compared to the above approaches, ours seems to cost almost nothing;
it requires no pretraining or additional hyperparameters, and is applied only once at initialization.
This means that one can easily plug-in {\small SNIP}{} as a preprocessor before training neural networks.
Since {\small SNIP}{} prunes the network at the beginning, we could potentially expedite the training phase by training only the survived parameters (\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot, reduced expected FLOPs in~\cite{louizos2017learning}).
Notice that this is not possible for the aforementioned approaches as they obtain the maximum sparsity at the end of the process.
\subsection{Various modern architectures}
\begin{table*}[t]
\centering
\footnotesize
\begin{tabular}{c@{\hspace{.7\tabcolsep}}c l c r@{\hspace{.7\tabcolsep}}c@{\hspace{.7\tabcolsep}}r r@{\hspace{.7\tabcolsep}}c@{\hspace{.7\tabcolsep}}rc}
\toprule
Architecture && \multicolumn{1}{c}{Model} & Sparsity (\%) & \multicolumn{3}{c}{\# Parameters} & \multicolumn{3}{c}{Error (\%)} & $\Delta$ \\
\midrule
\multirow{5}{*}{Convolutional}
&& \valexnet{-s} & $90.0$ & $5.1$m & $\rightarrow$ & $507$k & $14.12$ & $\rightarrow$ & $14.99$ & $+0.87$ \\
&& \valexnet{-b} & $90.0$ & $8.5$m & $\rightarrow$ & $849$k & $13.92$ & $\rightarrow$ & $14.50$ & $+0.58$ \\
&& \vvgg{-C} & $95.0$ & $10.5$m & $\rightarrow$ & $526$k & $6.82$ & $\rightarrow$ & $7.27$ & $+0.45$ \\
&& \vvgg{-D} & $95.0$ & $15.2$m & $\rightarrow$ & $762$k & $6.76$ & $\rightarrow$ & $7.09$ & $+0.33$ \\
&& \vvgg{-like} & $97.0$ & $15.0$m & $\rightarrow$ & $449$k & $8.26$ & $\rightarrow$ & $8.00$ & $\mathbf{-0.26}$ \\
\midrule
\multirow{3}{*}{Residual}
&& \vwrn{-16-8} & $95.0$ & $10.0$m & $\rightarrow$ & $548$k & $6.21$ & $\rightarrow$ & $6.63$ & $+0.42$ \\
&& \vwrn{-16-10} & $95.0$ & $17.1$m & $\rightarrow$ & $856$k & $5.91$ & $\rightarrow$ & $6.43$ & $+0.52$ \\
&& \vwrn{-22-8} & $95.0$ & $17.2$m & $\rightarrow$ & $858$k & $6.14$ & $\rightarrow$ & $5.85$ & $\mathbf{-0.29}$ \\
\midrule
\multirow{4}{*}{Recurrent}
&& \vlstm{-s} & $95.0$ & $137$k & $\rightarrow$ & $6.8$k & $1.88$ & $\rightarrow$ & $1.57$ & $\mathbf{-0.31}$ \\
&& \vlstm{-b} & $95.0$ & $535$k & $\rightarrow$ & $26.8$k & $1.15$ & $\rightarrow$ & $1.35$ & $+0.20$ \\
&& \vgru{-s} & $95.0$ & $104$k & $\rightarrow$ & $5.2$k & $1.87$ & $\rightarrow$ & $2.41$ & $+0.54$ \\
&& \vgru{-b} & $95.0$ & $404$k & $\rightarrow$ & $20.2$k & $1.71$ & $\rightarrow$ & $1.52$ & $\mathbf{-0.19}$ \\
\bottomrule
\end{tabular}
\caption{
Pruning results of the proposed approach on various modern architectures (before $\rightarrow$ after).
\salexnet{s}, \svgg{s} and \swrn{s} are evaluated on \cifar{-10}, and \slstm{s} and \sgru{s} are evaluated on the sequential {\small MNIST}{} classification task.
The approach is generally applicable regardless of architecture types and models and results in a significant amount of reduction in the number of parameters with minimal or no loss in performance.
}
\label{tab:compare-various-arch}
\end{table*}
In this section we show that our approach is generally applicable to more complex modern network architectures including deep convolutional, residual and recurrent ones.
Specifically, our method is applied to the following models:
\begin{tight_itemize}
\vspace{-2mm}
\item \salexnet{-s} and \salexnet{-b}:
Models similar to \cite{krizhevsky2012imagenet} in terms of the number of layers and size of kernels.
We set the size of fc layers to $512$ (\salexnet{-s}) and to $1024$ (\salexnet{-b}) to adapt for \cifar{-10} and use strides of $2$ for all conv layers instead of using pooling layers.
\item \svgg{-C}, \svgg{-D} and \svgg{-like}:
Models similar to the original \svgg{} models described in \cite{simonyan2014very}.
\svgg{-like} (\cite{zagoruyko201592}) is a popular variant adapted for \cifar{-10} which has one less fc layers.
For all \svgg{} models, we set the size of fc layers to $512$, remove dropout layers to avoid any effect on sparsification and use batch normalization instead.
\item \swrn{-16-8}, \swrn{-16-10} and \swrn{-22-8}:
Same models as in \cite{zagoruyko2016wide}.
\item \slstm{-s}, \slstm{-b}, \sgru{-s}, \sgru{-b}:
One layer \srnn{} networks with either \slstm{} (\cite{zaremba2014recurrent}) or \sgru{} (\cite{cho2014learning}) cells.
We develop two unit sizes for each cell type, $128$ and $256$ for \{$\cdot$\}-s and \{$\cdot$\}-b, respectively.
The model is adapted for the sequential {\small MNIST}{} classification task, similar to~\cite{le2015simple}.
Instead of processing pixel-by-pixel, however, we perform row-by-row processing (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot, the \srnn{} cell receives each row at a time).
\vspace{-2mm}
\end{tight_itemize}
The results are summarized in Table~\ref{tab:compare-various-arch}.
Overall, our approach prunes a substantial amount of parameters in a variety of network models with minimal or no loss in accuracy ({\small $<1$\%}).
Our pruning procedure does not need to be modified for specific architectural variations (\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot, recurrent connections), indicating that it is indeed versatile and scalable.
Note that prior art that use a saliency criterion based on the weights (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot, magnitude or Hessian based) would require considerable adjustments in their pruning schedules as per changes in the model.
\SKIP{
We note of a few challenges in directly comparing against others: different network specifications, learning policies, datasets and tasks.
Nonetheless, we provide a few comparison points that we found in the literature.
On \cifar{-10}, {\small SVD}{} prunes $97.9\%$ of the connections in \svgg{-like} with no loss in accuracy while {\small SWS}{} obtained $93.4\%$ sparsity on \swrn{-16-4} but with a non-negligible loss in accuracy of $2\%$.
Considering RNNs, \cite{narang2017exploring} and \cite{see2016compression} attempt to prune a \sgru{} model for speech recognition and a \slstm{} model for neural machine translation, respectively.
Even though, these methods are specifically designed to prune RNNs, the loss in performance is non-negligible in both the cases, relfecting the challenges of pruning RNNs.
To the best of our knowledge, we are the only to demonstrate on convolutional, residual and recurrent networks for extreme sparsities without requiring additional hyperparameters or modifying the pruning procedure.
}
We note of a few challenges in directly comparing against others: different network specifications, learning policies, datasets and tasks.
Nonetheless, we provide a few comparison points that we found in the literature.
On \cifar{-10}, {\small SVD}{} prunes $97.9\%$ of the connections in \svgg{-like} with no loss in accuracy (ours: $97\%$ sparsity) while {\small SWS}{} obtained $93.4\%$ sparsity on \swrn{-16-4} but with a non-negligible loss in accuracy of $2\%$.
There are a couple of works attempting to prune \srnn{s} (\emph{e.g}\onedot} \def\Eg{\emph{E.g}\onedot, \sgru{}~in~\cite{narang2017exploring} and \slstm{} in~\cite{see2016compression}).
Even though these methods are specifically designed for \srnn{s}, none of them are able to obtain extreme sparsity without substantial loss in accuracy reflecting the challenges of pruning \srnn{s}.
To the best of our knowledge, we are the first to demonstrate on convolutional, residual and recurrent networks for extreme sparsities without requiring additional hyperparameters or modifying the pruning procedure.
\subsection{Understanding which connections are being pruned}
\begin{figure*}
\centering
\begin{subfigure}{.49\textwidth}
\centering
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.1_digit-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.1_digit-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.1_digit-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.1_digit-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.1_digit-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.1_digit-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.1_digit-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.1_digit-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.1_digit-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.1_digit-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.2_digit-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.2_digit-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.2_digit-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.2_digit-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.2_digit-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.2_digit-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.2_digit-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.2_digit-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.2_digit-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.2_digit-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.3_digit-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.3_digit-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.3_digit-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.3_digit-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.3_digit-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.3_digit-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.3_digit-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.3_digit-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.3_digit-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.3_digit-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.4_digit-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.4_digit-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.4_digit-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.4_digit-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.4_digit-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.4_digit-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.4_digit-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.4_digit-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.4_digit-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.4_digit-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.5_digit-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.5_digit-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.5_digit-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.5_digit-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.5_digit-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.5_digit-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.5_digit-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.5_digit-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.5_digit-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.5_digit-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.6_digit-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.6_digit-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.6_digit-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.6_digit-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.6_digit-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.6_digit-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.6_digit-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.6_digit-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.6_digit-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.6_digit-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.7_digit-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.7_digit-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.7_digit-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.7_digit-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.7_digit-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.7_digit-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.7_digit-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.7_digit-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.7_digit-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.7_digit-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.8_digit-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.8_digit-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.8_digit-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.8_digit-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.8_digit-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.8_digit-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.8_digit-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.8_digit-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.8_digit-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.8_digit-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.9_digit-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.9_digit-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.9_digit-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.9_digit-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.9_digit-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.9_digit-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.9_digit-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.9_digit-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.9_digit-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var/input_mask_ts-0.9_digit-9_seed-9}.eps} \\
\caption{{\small MNIST}{}}
\end{subfigure}
\begin{subfigure}{.49\textwidth}
\centering
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.1_digit-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.1_digit-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.1_digit-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.1_digit-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.1_digit-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.1_digit-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.1_digit-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.1_digit-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.1_digit-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.1_digit-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.2_digit-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.2_digit-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.2_digit-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.2_digit-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.2_digit-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.2_digit-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.2_digit-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.2_digit-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.2_digit-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.2_digit-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.3_digit-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.3_digit-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.3_digit-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.3_digit-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.3_digit-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.3_digit-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.3_digit-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.3_digit-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.3_digit-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.3_digit-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.4_digit-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.4_digit-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.4_digit-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.4_digit-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.4_digit-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.4_digit-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.4_digit-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.4_digit-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.4_digit-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.4_digit-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.5_digit-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.5_digit-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.5_digit-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.5_digit-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.5_digit-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.5_digit-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.5_digit-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.5_digit-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.5_digit-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.5_digit-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.6_digit-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.6_digit-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.6_digit-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.6_digit-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.6_digit-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.6_digit-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.6_digit-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.6_digit-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.6_digit-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.6_digit-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.7_digit-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.7_digit-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.7_digit-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.7_digit-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.7_digit-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.7_digit-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.7_digit-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.7_digit-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.7_digit-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.7_digit-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.8_digit-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.8_digit-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.8_digit-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.8_digit-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.8_digit-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.8_digit-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.8_digit-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.8_digit-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.8_digit-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.8_digit-9_seed-9}.eps} \\
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.9_digit-0_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.9_digit-1_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.9_digit-2_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.9_digit-3_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.9_digit-4_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.9_digit-5_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.9_digit-6_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.9_digit-7_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.9_digit-8_seed-9}.eps}
\includegraphics[width=5mm]{figure/{exp_visualize-input-masks_bs-100_ts-var_FasionMNIST/input_mask_bs-100_ts-0.9_digit-9_seed-9}.eps} \\
\caption{{\small Fashion-MNIST}{}}
\end{subfigure}
\caption{
Visualizations of pruned parameters of the first layer in \slenet{-300-100}; the parameters are reshaped to be visualized as an image.
Each column represents the visualizations for a particular class obtained using a batch of $100$ examples with varying levels of sparsity $\bar{\kappa}$, from $10$ (top) to $90$ (bottom).
Bright pixels indicate that the parameters connected to these region had high importance scores (${\mathbf{s}}$) and survived from pruning.
As the sparsity increases, the parameters connected to the discriminative part of the image for classification survive and the irrelevant parts get pruned.
}
\label{fig:pruned-weights}
\end{figure*}
So far we have shown that our approach can prune a variety of deep neural network architectures for extreme sparsities without losing much on accuracy.
However, it is not clear yet which connections are actually being pruned away or whether we are pruning the right (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot, unimportant) ones.
What if we could actually peep through our approach into this inspection?
Consider the first layer in \slenet{-300-100} parameterized by ${\mathbf{w}}_{l=1} \in {\mathbb{R}}^{784 \times 300}$.
This is a layer fully connected to the input where input images are of size $28 \times 28 = 784$.
In order to understand which connections are retained, we can visualize the binary connectivity mask for this layer ${\mathbf{c}}_{l=1}$, by averaging across columns and then reshaping the vector into 2D matrix (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot, ${\mathbf{c}}_{l=1} \in \{0, 1\}^{784 \times 300} \rightarrow {\mathbb{R}}^{784} \rightarrow {\mathbb{R}}^{28 \times 28}$).
Recall that our method computes ${\mathbf{c}}$ using a mini-batch of examples.
In this experiment, we curate the mini-batch of examples of the same class and see which weights are retained for that mini-batch of data.
We repeat this experiment for all classes (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot, digits for {\small MNIST}{} and fashion items for {\small Fashion-MNIST}{}) with varying sparsity levels $\bar{\kappa}$.
The results are displayed in Figure~\ref{fig:pruned-weights} (see Appendix~\ref{sec:fashion-mnist-invert} for more results).
The results are significant; important connections seem to reconstruct either the complete image ({\small MNIST}{}) or silhouettes ({\small Fashion-MNIST}{}) of input class.
When we use a batch of examples of the digit $0$ (\emph{i.e}\onedot} \def\Ie{\emph{I.e}\onedot, the first column of {\small MNIST}{} results), for example, the parameters connected to the foreground of the digit $0$ survive from pruning while the majority of background is removed.
Also, one can easily determine the identity of items from {\small Fashion-MNIST}{} results.
This clearly indicates that our method indeed prunes the \emph{unimportant} connections in performing the classification task, receiving signals only from the most discriminative part of the input.
This stands in stark contrast to other pruning methods from which carrying out such inspection is not straightforward.
\subsection{Effects of data and weight initialization}
Recall that our connection saliency measure depends on the network weights ${\mathbf{w}}$ as well as the given data $\mathcal{D}$ (\Secref{sec:single-random}).
We study the effect of each of these in this section.
\textbf{Effect of data.}\quad
Our connection saliency measure depends on a mini-batch of train examples ${\mathcal{D}}^{b}$ (see~\Algref{alg:prune}).
To study the effect of data, we vary the batch size used to compute the saliency ($|{\mathcal{D}}^{b}|$) and check which connections are being pruned as well as how much performance change this results in on the corresponding sparse network.
We test with \slenet{-300-100} to visualize the remaining parameters, and set the sparsity level $\bar{\kappa}=90$.
Note that the batch size used for training remains the same as $100$ for all cases.
The results are displayed in~\Figref{fig:diff-batch-size}.
\begin{figure*}[h]
\centering
\setlength{\tabcolsep}{1pt}
\begin{tabular}{cccccc|c}
\includegraphics[height=21mm]{figure/exp-lenet300_pc_diff-batch-size/{input_mask_bs-1_ts-0.9_digit--1_seed-9}.eps} &
\includegraphics[height=21mm]{figure/exp-lenet300_pc_diff-batch-size/{input_mask_bs-10_ts-0.9_digit--1_seed-9}.eps} &
\includegraphics[height=21mm]{figure/exp-lenet300_pc_diff-batch-size/{input_mask_bs-100_ts-0.9_digit--1_seed-9}.eps} &
\includegraphics[height=21mm]{figure/exp-lenet300_pc_diff-batch-size/{input_mask_bs-1000_ts-0.9_digit--1_seed-9}.eps} &
\includegraphics[height=21mm]{figure/exp-lenet300_pc_diff-batch-size/{input_mask_bs-10000_ts-0.9_digit--1_seed-9}.eps} & &
\includegraphics[height=21mm]{figure/train_images_mean.eps} \\
$|{\mathcal{D}}^{b}|=1$ & $|{\mathcal{D}}^{b}|=10$ & $|{\mathcal{D}}^{b}|=100$ & $|{\mathcal{D}}^{b}|=1000$ & $|{\mathcal{D}}^{b}|=10000$ & & train set \\
\hlcelldegree{10}($1.94$\%) & \hlcelldegree{22}($1.72$\%) & \hlcelldegree{34}($1.64$\%) & \hlcelldegree{46}($1.56$\%) & \hlcelldegree{58}($1.40$\%) & & --
\end{tabular}
\caption{
The effect of different batch sizes: (top-row) survived parameters in the first layer of \slenet{-300-100} from pruning visualized as images; (bottom-row) the performance in errors of the pruned networks.
For $|{\mathcal{D}}^{b}|=1$, the sampled example was $8$; our pruning precisely retains the valid connections.
As $|{\mathcal{D}}^{b}|$ increases, survived parameters get close to the average of all examples in the train set (last column), and the error decreases.
}
\label{fig:diff-batch-size}
\end{figure*}
\textbf{Effect of initialization.}\quad
Our approach prunes a network at a stochastic initialization as discussed.
We study the effect of the following initialization methods: 1) {\small RN}{} (random normal), 2) {\small TN}{} (truncated random normal), 3) {\small VS-X}{} (a variance scaling method using~\cite{glorot2010understanding}), and 4) {\small VS-H}{} (a variance scaling method~\cite{he2015delving}).
We test on \slenet{s} and \srnn{s} on {\small MNIST}{} and run $20$ sets of experiments by varying the seed for initialization.
We set the sparsity level $\bar{\kappa}=90$, and train with Adam optimizer~(\cite{kingma2014adam}) with learning rate of $0.001$ without weight decay.
Note that for training {\small VS-X}{} initialization is used in all the cases.
The results are reported in Figure~\ref{tab:various-initializer}.
For all models, {\small VS-H}{} achieves the best performance.
The differences between initializers are marginal on \slenet{s}, however, variance scaling methods indeed turns out to be essential for complex \srnn{} models.
This effect is significant especially for \sgru{} where without variance scaling initialization, the pruned networks are unable to achieve good accuracies, even with different optimizers.
Overall, initializing with a variance scaling method seems crucial to making our saliency measure reliable and model-agnostic.
\begin{table}[h]
\centering
\scriptsize
\begin{tabular}{c cccc}
\toprule
\footnotesize Init. & \vlenet{-300-100} & \vlenet{-5-Caffe} & \vlstm{-s} & \vgru{-s} \\
\midrule
RN & $ 1.90 \pm (0.09) $ & $ 0.89 \pm (0.04) $ & $ 2.93 \pm (0.20) $ & $ 47.61 \pm (20.49) $ \\
TN & $ 1.96 \pm (0.11) $ & $ 0.87 \pm (0.05) $ & $ 3.03 \pm (0.17) $ & $ 46.48 \pm (22.25) $ \\
VS-X & $ 1.91 \pm (0.10) $ & $ 0.88 \pm (0.07) $ & $ 1.48 \pm (0.09) $ & $ \mathbf{1.80} \pm (0.10 ) $ \\
VS-H & $ \mathbf{1.88} \pm (0.10) $ & $ \mathbf{0.85} \pm (0.05) $ & $ \mathbf{1.47} \pm (0.08) $ & $ \mathbf{1.80} \pm (0.14 ) $ \\
\bottomrule
\end{tabular}
\caption{
The effect of initialization on our saliency score.
We report the classification errors ($\pm$std).
Variance scaling initialization ({\small VS-X}{}, {\small VS-H}{}) improves the performance, especially for \srnn{s}.
}
\label{tab:various-initializer}
\end{table}
\subsection{Fitting random labels}
\begin{wrapfigure}{R}{0.4\textwidth}
\vspace{-6mm}
\centering
\includegraphics[width=0.38\textwidth]{figure/lenet5_fit-random-labels.eps}
\vspace{-5mm}
\caption{
The sparse model pruned by {\small SNIP}{} does not fit the random labels.
}
\label{fig:fit-rand-labels}
\vspace{-6mm}
\end{wrapfigure}
To further explore the use cases of {\small SNIP}{}, we run the experiment introduced in~\cite{zhang2016understanding} and check whether the sparse network obtained by {\small SNIP}{} memorizes the dataset.
Specifically, we train \slenet{-5-Caffe} for both the reference model and pruned model (with $\bar{\kappa}=99$) on {\small MNIST}{} with either true or randomly shuffled labels.
To compute the connection sensitivity, always true labels are used.
The results are plotted in Figure~\ref{fig:fit-rand-labels}.
Given true labels, both the reference (red) and pruned (blue) models quickly reach to almost zero training loss.
However, the reference model provided with random labels (green) also reaches to very low training loss, even with an explicit L2 regularizer (purple), indicating that neural networks have enough capacity to memorize completely random data.
In contrast, the model pruned by {\small SNIP}{} (orange) fails to fit the random labels (high training error).
The potential explanation is that the pruned network does not have sufficient capacity to fit the random labels, but it is able to classify {\small MNIST}{} with true labels, reinforcing the significance of our saliency criterion.
It is possible that a similar experiment can be done with other pruning methods (\cite{molchanov2017variational}), however, being simple, {\small SNIP}{} enables such exploration much easier.
We provide a further analysis on the effect of varying $\bar{\kappa}$ in Appendix~\ref{sec:fit-rand-label-kappa}.
\SKIP{
Recently, \cite{zhang2016understanding} spurred reconsideration in understanding the generalization capability of neural networks, by showing that standard architectures using SGD and regularization can still reach low training error on randomly labeled examples.
We run the same experiment and check whether the sparse model pruned by {\small SNIP}{} fit random labels.
The results are plotted in Figure~\ref{fig:fit-rand-labels}.
Given true labels, both the dense (red) and pruned sparse (blue) models quickly reach to almost zero training loss.
However, the dense model provided with random labels (green) also reaches to very low training loss, even with an explicit L2 regularizer (purple), indicating that neural networks have enough capacity to memorize completely random data, and thus, generalize poorly.
Notably, the pruned model using our method (orange) does not fit the random labels.
This indicates that {\small SNIP}{} can further be used as a regularizer, by pruning architecturally unimportant connections before training, to improve generalization.
This result is somewhat consistent to the results presented in \cite{arora2018stronger} as well as the conventional wisdom of Occam's razor.
}
\section{Discussion and future work}
In this work, we have presented a new approach, {\small SNIP}{}, that is simple, versatile and interpretable; it prunes irrelevant connections for a given task at single-shot prior to training and is applicable to a variety of neural network models without modifications.
While {\small SNIP}{} results in extremely sparse models, we find that our connection sensitivity measure itself is noteworthy in that it diagnoses important connections in the network from a purely untrained network.
We believe that this opens up new possibilities beyond pruning in the topics of understanding of neural network architectures, multi-task transfer learning and structural regularization, to name a few.
In addition to these potential directions, we intend to explore the generalization capabilities of sparse networks.
| {'timestamp': '2019-02-26T02:07:46', 'yymm': '1810', 'arxiv_id': '1810.02340', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02340'} | arxiv |
\section{Introduction}
\vspace{-0.2cm}
\footnotetext[1]{Shared first authorship.}
\renewcommand*{\thefootnote}{\arabic{footnote}}
\setcounter{footnote}{0}
Many real-world tasks have sparse rewards. For example, animals searching for food may need to go many miles without any reward from the environment. Standard reinforcement learning algorithms struggle with such tasks because of reliance on simple action entropy maximization as a source of exploration behaviour.
Multiple approaches were proposed to achieve better explorative policies. One way is to give a reward bonus which facilitates exploration by rewarding novel observations. The reward bonus is summed up with the original task reward and optimized by standard RL algorithms. Such an approach is motivated by neuroscience studies of animals: an animal has an ability to reward itself for something novel -- the mechanism biologically built into its dopamine release system. How exactly this bonus is formed remains an open question.
Many modern curiosity formulations aim at maximizing ``surprise'' --- inability to predict the future. This approach makes perfect sense but, in fact, is far from perfect. To show why, let us consider a thought experiment. Imagine an agent is put into a $3$D maze. There is a precious goal somewhere in the maze which would give a large reward. Now, the agent is also given a remote control to a TV and can switch the channels. Every switch shows a random image (say, from a fixed set of images). The curiosity formulations which optimize surprise would rejoice because the result of the channel switching action is unpredictable. The agent would be drawn to the TV instead of looking for a goal in the environment (this was indeed observed in~\citep{LargeScaleCuriosity2018}). So, should we call the channel switching behaviour curious? Maybe, but it is unproductive for the original sparse-reward goal-reaching task. What would be a definition of curiosity which does not suffer from such ``couch-potato'' behaviour?
We propose a new curiosity definition based on the following intuition. If the agent knew the observation after changing a TV channel is only one step away from the observation before doing that --- it probably would not be so interesting to change the channel in the first place (too easy). This intuition can be formalized as giving a reward only for those observations which take some effort to reach (outside the already explored part of the environment). The effort is measured in the number of environment steps. To estimate it we train a neural network approximator: given two observations, it would predict how many steps separate them. The concept of novelty via reachability is illustrated in Figure~\ref{fig:reachability}. To make the description above practically implementable, there is still one piece missing though. For determining the novelty of the current observation, we need to keep track of what was already explored in the environment. A natural candidate for that purpose would be episodic memory: it stores instances of the past which makes it easy to apply the reachability approximator on pairs of current and past observations.
Our method works as follows. The agent starts with an empty memory at the beginning of the episode and at every step compares the current observation with the observations in memory to determine novelty. If the current observation is indeed novel --- takes more steps to reach from observations in memory than a threshold --- the agent rewards itself with a bonus and adds the current observation to the episodic memory. The process continues until the end of the episode, when the memory is wiped clean.
We benchmark our method on a range of tasks from visually rich $3$D environments {\em VizDoom}{}, {\em DMLab}{} and {\em MuJoCo}{}. We conduct the comparison with other methods --- including the state-of-the-art curiosity method ICM~\citep{ICM2017} --- under the same budget of environment interactions. First, we use the {\em VizDoom}{} environments from prior work to establish that our re-implementation of the ICM baseline is correct --- and also demonstrate at least $2$ times{} faster convergence of our method with respect to the baseline. Second, in the randomized procedurally generated environments from {\em DMLab}{} our method turns out to be more robust to spurious behaviours than the method ICM: while the baseline learns a persistent firing behaviour in navigational tasks (thus creating interesting pictures for itself), our method learns a reasonable explorative behaviour. In terms of quantitative evaluation, our method reaches the goal at least $2$ times{} more often in the procedurally generated test levels in {\em DMLab}{} with a very sparse reward. Third, when comparing the behaviour of the agent in the complete absence of rewards, our method covers at least $4$ times{} more area (measured in discrete $(x, y)$ coordinate cells) than the baseline ICM. Fourth, we demonstrate that our curiosity bonus does not significantly deteriorate performance of the plain PPO algorithm~\citep{PPO2017} in two tasks with dense reward in {\em DMLab}{}. Finally, we demonstrate that an ant in a {\em MuJoCo}{} environment can learn locomotion purely from our curiosity reward computed based on the first-person view.
\begin{figure}
\begin{minipage}[c]{0.55\textwidth}
\includegraphics[width=\linewidth]{figures/novelty_reachability.pdf} \vspace{-2mm}
\end{minipage}\hfill
\begin{minipage}[c]{0.45\textwidth}
\caption{\label{fig:reachability} We define novelty through reachability. The nodes in the graph are observations, the edges --- possible transitions. The blue nodes are already in memory, the green nodes are reachable from the memory within $k = 2$ steps (not novel), the orange nodes are further away --- take more than $k$ steps to reach (novel). In practice, the full possible transition graph is not available, so we train a neural network approximator to predict if the distance in steps between observations is larger or smaller than $k$.}
\end{minipage}
\vspace{-0.3cm}
\end{figure}
\vspace{-0.2cm}
\section{Episodic Curiosity}
\vspace{-0.2cm}
We consider an agent which interacts with an environment. The interactions happen at discrete time steps over the episodes of limited duration $T$. At each time step $t$, the environment provides the agent with an observation $\mathbf{o}_t$ from the observational space $\mathcal{O}$ (we consider images), samples an action $a_t$ from a set of actions $\mathcal{A}$ using a probabilistic policy $\pi(\mathbf{o}_t)$ and receives a scalar reward $r_t \in \mathbb{R}$ together with the new observation $\mathbf{o}_{t+1}$ and an end-of-episode indicator. The goal of the agent is to optimize the expectation of the discounted sum of rewards during the episode $S = \sum_t \gamma^t r_t$.
In this work we primarily focus on the tasks where rewards $r_t$ are sparse --- that is, zero for most of the time steps $t$. Under such conditions commonly used RL algorithms (e.g., PPO~\citet{PPO2017}) do not work well. We further introduce an episodic curiosity (EC) module which alleviates this problem. The purpose of this module is to produce a reward bonus $b_t$ which is further summed up with the task reward $r_t$ to give an augmented reward $\widehat{r}_t = r_t + b_t$. The augmented reward has a nice property from the RL point of view --- it is a dense reward. Learning with such reward is faster, more stable and often leads to better final performance in terms of the cumulative task reward $S$.
In the following section we describe the key components of our episodic curiosity module.
\def 2.9cm {0.3}
\begin{figure}[t]
\centering
\begin{tabular}{cc}
\includegraphics[height=2.9cm \linewidth]{figures/trainable.pdf} \vspace{-2mm} &
\includegraphics[height=2.9cm \linewidth]{figures/training.pdf} \vspace{-2mm}
\end{tabular}
\caption{\label{fig:rtraining} Left: siamese architecture of reachability (R) network. Right: R-network is trained based on a sequence of observations that the agent encounters while acting. The temporally close (within threshold) pairs of observations are positive examples, while temporally far ones --- negatives.}
\vspace{-0.2cm}
\end{figure}
\vspace{-0.2cm}
\subsection{Episodic Curiosity Module}
\vspace{-0.2cm}
The episodic curiosity (EC) module takes the current observation $\mathbf{o}$ as input and produces a reward bonus $b$. The module consists of both parametric and non-parametric components. There are two parametric components: an embedding network $E: \mathcal{O} \rightarrow \mathbb{R}^n$ and a comparator network $C: \mathbb{R}^{n} \times \mathbb{R}^{n} \rightarrow [0, 1]$. Those parametric components are trained together to predict reachability as parts of the reachability network --- shown in Figure~\ref{fig:rtraining}.
There are also two non-parametric components: an episodic memory buffer $\mathbf{M}$ and a reward bonus estimation function $B$. The high-level overview of the system is shown in Figure~\ref{fig:overview}. Next, we give a detailed explanation of all the components.
\vspace{-0.3cm}
\mypara{Embedding and comparator networks.}
Both networks are designed to function jointly for estimating within-$k$-step-reachability of one observation $\mathbf{o}_i$ from another observation $\mathbf{o}_j$ as parts of a reachability network $R(\mathbf{o}_i, \mathbf{o}_j) = C(E(\mathbf{o}_i), E(\mathbf{o}_j))$.
This is a siamese architecture similar to~\citep{Siamese2015}. The architecture is shown in Figure~\ref{fig:rtraining}.
R-network is a classifier trained with a logistic regression loss: it predicts values close to $0$ if probability of two observations being reachable from one another within $k$ steps is low, and values close to $1$ when this probability is high. Inside the episodic curiosity the two networks are used separately to save up computation and memory.
\vspace{-0.3cm}
\mypara{Episodic memory.}
The episodic memory buffer $\mathbf{M}$ stores embeddings of past observations from the current episode, computed with the embedding network $E$. The memory buffer has a limited capacity $K$ to avoid memory and performance issues. At every step, the embedding of the current observation might be added to the memory. What to do when the capacity is exceeded? One solution we found working well in practice is to substitute a random element in memory with the current element. This way there are still more fresh elements in memory than older ones, but the older elements are not totally neglected.
\vspace{-0.3cm}
\mypara{Reward bonus estimation module.}
The purpose of this module is to check for reachable observations in memory and if none is found --- assign larger reward bonus to the current time step. The check is done by comparing embeddings in memory to the current embedding via comparator network. Essentially, this check insures that no observation in memory can be reached by taking only a few actions from the current state --- our characterization of novelty.
\vspace{-0.2cm}
\subsection{Bonus Computation Algorithm.}
\vspace{-0.2cm}
\begin{figure}[t]
\centering
\includegraphics[width=0.7\linewidth]{figures/overview.pdf} \vspace{-2mm}
\caption{\label{fig:overview} The use of episodic curiosity (EC) module for reward bonus computation. The module take a current observation as input and computes a reward bonus which is higher for novel observations. This bonus is later summed up with the task reward and used for training an RL agent.}
\vspace{-0.2cm}
\end{figure}
At every time step, the current observation $\mathbf{o}$ goes through the embedding network producing the embedding vector $\mathbf{e} = E(\mathbf{o})$. This embedding vector is compared with the stored embeddings in the memory buffer $\mathbf{M} = \tuple{\mathbf{e}_1, \dots, \mathbf{e}_{|\mathbf{M}|}}$ via the comparator network $C$ where $|\mathbf{M}|$ is the current number of elements in memory. This comparator network fills the reachability buffer with values
\begin{equation}
c_i = C(\mathbf{e}_i, \mathbf{e}), \quad i = 1,|\mathbf{M}|.
\end{equation}
Then the similarity score between the memory buffer and the current embedding is computed from the reachability buffer as (with a slight abuse of notation)
\begin{equation}
C(\mathbf{M}, \mathbf{e}) = F \left( c_1, \dots, c_{|\mathbf{M}|} \right) \in [0, 1].
\end{equation}
where the aggregation function $F$ is a hyperparameter of our method. Theoretically, $F = \max$ would be a good choice, however, in practice it is prone to outliers coming from the parametric embedding and comparator networks. Empirically, we found that $90$-th percentile works well as a robust substitute to maximum.
As a curiosity bonus, we take
\begin{equation}
b = B(\mathbf{M}, \mathbf{e}) = \alpha(\beta - C(\mathbf{M}, \mathbf{e})),
\end{equation}
where $\alpha \in \mathbb{R}^+$ and $\beta \in \mathbb{R}$ are hyperparameters of our method. The value of $\alpha$ depends on the scale of task rewards --- we will discuss how to select it in the experimental section. The value of $\beta$ determines the sign of the reward --- and thus could bias the episodes to be shorter or longer. Empirically, $\beta = 0.5$ works well for fixed-duration episodes, and $\beta = 1$ is preferred if an episode could have variable length.
After the bonus computation, the observation embedding is added to memory if the bonus $b$ is larger than a novelty threshold $b_{novelty}$. This check is necessary for the following reason. If every observation embedding is added to the memory buffer, the observation from the current step will always be reachable from the previous step. Thus, the reward would never be granted. The threshold $b_{novelty}$ induces a discretization in the embedding space. Intuitively, this makes sense: only ``distinct enough'' memories are stored. As a side benefit, the memory buffer stores information with much less redundancy. We refer the reader to the video\footnote{\url{https://youtu.be/mphIRR6VsbM}} which visualizes the curiosity reward bonus and the memory state during the operation of the algorithm.
\vspace{-0.2cm}
\subsection{Reachability Network Training}
\vspace{-0.2cm}
If the full transition graph in Figure~\ref{fig:reachability} was available, there would be no need of a reachability network and the novelty could be computed analytically through the shortest-path algorithm. However, normally we have access only to the sequence of observations which the agent receives while acting. Fortunately, as suggested by~\citep{SPTM2018}, even a simple observation sequence graph could still be used for training a reasonable approximator to the real step-distance. This procedure is illustrated in Figure~\ref{fig:rtraining}. This procedure takes as input a sequence of observations $\mathbf{o}_1, \dots, \mathbf{o}_N$ and forms pairs from those observations. The pairs $(\mathbf{o}_i, \mathbf{o}_j)$ where $|i - j| \leq k$ are taken as positive (reachable) examples while the pairs with $|i - j| > \gamma k$ become negative examples. The hyperparameter $\gamma$ is necessary to create a gap between positive and negative examples. In the end, the network is trained with logistic regression loss to output the probability of the positive (reachable) class.
In our work, we have explored two settings for training a reachability network: using a random policy and together with the task-solving policy (online training). The first version generally follows the training protocol proposed by~\citep{SPTM2018}. We put the agent into exactly the same conditions where it will be eventually tested: same episode duration and same action set. The agent takes random actions from the action set. Given the environment interaction budget ($2.5$M $4$-repeated steps{} in {\em DMLab}{}, $300$K $4$-repeated steps{} in {\em VizDoom}{}), the agent fills in the replay buffer with observations coming from its interactions with the environment, and forms training pairs by sampling from this replay buffer randomly. The second version collects the data on-policy, and re-trains the reachability network every time after a fixed number of environment interactions is performed. We provide the details of R-network training in the supplementary material.
\vspace{-0.4cm}
\section{Experimental Setup}
\vspace{-0.4cm}
\def 2.9cm {1.9cm}
\begin{figure}[t]
\centering
{\small
\setlength\tabcolsep{2pt}
\begin{tabular}{cccc}
\includegraphics[height=2.9cm]{figures/VzFirstPerson.jpg} &
\includegraphics[height=2.9cm]{figures/DmSparseFirstPerson.jpg} &
\includegraphics[height=2.9cm]{figures/DmDense1FirstPerson.jpg} &
\includegraphics[height=2.9cm]{figures/mujoco_ant.jpg} \\
(a) & (b) & (c) & (d) \\
\end{tabular}
}
\caption{\label{fig:tasks} Examples of tasks considered in our experiments: (a) {\em VizDoom}{} static maze goal reaching, (b) {\em DMLab}{} randomized maze goal reaching, (c) {\em DMLab}{} key-door puzzle, (d) {\em MuJoCo}{} ant locomotion out of first-person-view curiosity.}
\vspace{-0.3cm}
\end{figure}
We test our method in multiple environments from {\em VizDoom}{}~\citep{ViZDoom2016}, {\em DMLab}{}~\citep{DMLab2016} and {\em MuJoCo}{}~\citep{Mujoco2012,Ant2015}. The experiments in {\em VizDoom}{} allow us to verify that our re-implementation of the previous state-of-the-art curiosity method ICM~\citep{ICM2017} is correct. The experiments in {\em DMLab}{} allow us to extensively test the generalization of our method as well as baselines --- {\em DMLab}{} provides convenient procedural level generation capabilities which allows us to train and test RL methods on hundreds of levels. The experiments in {\em MuJoCo}{} allow us to show the generality of our method. Due to space limits, the {\em MuJoCo}{} experiments are described in the supplementary material. The examples of tasks are shown in Figure~\ref{fig:tasks}.
\vspace{-0.3cm}
\mypara{Environments.}
Both {\em VizDoom}{} and {\em DMLab}{} environments provide rich maze-like $3$D environments. The observations are given to the agent in the form of images. For {\em VizDoom}{}, we use $84 \times 84$ grayscale images as input. For {\em DMLab}{}, we use $84 \times 84$ RGB images as input. The agent operates with a discrete action set which comprises different navigational actions. For {\em VizDoom}{}, the standard action set consists of $3$ actions: move forward, turn left/right. For {\em DMLab}{}, it consists of $9$ actions: move forward/backward, turn left/right, strafe left/right, turn left/right+move forward, fire. For both {\em VizDoom}{} and {\em DMLab}{} we use all actions with a repeat of $4$, as typical in the prior work. We only use RGB input of the provided RGBD observations and remove all head-on display information from the screen, leaving only the plain first-person view images of the maze. The rewards and episode durations differ between particular environments and will be further specified in the corresponding experimental sections.
\vspace{-0.3cm}
\mypara{Basic RL algorithm.}
We choose the commonly used PPO algorithm from the open-source implementation\footnote{\url{https://github.com/openai/baselines}} as our basic RL algorithm. The policy and value functions are represented as CNNs to reduce number of hyperparameters --- LSTMs are harder to tune and such tuning is orthogonal to the contribution of the paper. We apply PPO to the sum of the task reward and the bonus reward coming from specific curiosity algorithms. The hyperparameters of the PPO algorithm are given in the supplementary material. We use only two sets of hyperparameters: one for all {\em VizDoom}{} environments and the other one for all {\em DMLab}{} environments.
\vspace{-0.3cm}
\mypara{Baseline methods.}
The simplest baseline for our approach is just the basic RL algorithm applied to the task reward. As suggested by the prior work and our experiments, this is a relatively weak baseline in the tasks where reward is sparse.
As the second baseline, we take the state-of-the-art curiosity method ICM~\citep{ICM2017}. As follows from the results in~\citep{ICM2017, EX22017}, ICM is superior to methods VIME~\citep{VIME2016}, \#Exploration~\citep{HashExploration2017} and $EX^2$~\citep{EX22017} on the curiosity tasks in visually rich $3$D environments.
Finally, as a sanity check, we introduce a novel baseline method which we call Grid Oracle{}. Since we can access current $(x, y)$ coordinates of the agent in all environments, we are able to directly discretize the world in $2$D cells and reward the agent for visiting as many cells as possible during the episode (the reward bonus is proportional to the number of cells visited). At the end of the episode, cell visit counts are zeroed. The reader should keep in mind that this baseline uses privileged information not available to other methods (including our own method EC). While this privileged information is not guaranteed to lead to success in any particular RL task, we do observe this baseline to perform strongly in many tasks, especially in complicated {\em DMLab}{} environments. The Grid Oracle{} baseline has two hyperparameters: the weight for combining Grid Oracle{} reward with the task reward and the cell size.
\vspace{-0.3cm}
\mypara{Hyperparameter tuning.}
As {\em DMLab}{} environments are procedurally generated, we perform tuning on the validation set, disjoint with the training and test sets. The tuning is done on one of the environments and then the same hyperparameters are re-used for all other environments. {\em VizDoom}{} environments are not procedurally generated, so there is no trivial way to have proper training/validation/test splits --- so we tune on the same environment (as typical in the prior RL work for the environments without splits). When tuning, we consider the mean{} final reward of $10${} training runs with the same set of hyperparameters as the objective --- thus we do not perform any seed tuning. All hyperparameter values are listed in the supplementary material. Note that although bonus scalar $\alpha$ depends on the range of task rewards, the environments in {\em VizDoom}{} and {\em DMLab}{} have similar ranges within each platform --- so our approach with re-using $\alpha$ for multiple environments works.
\vspace{-0.4cm}
\section{Experiments}
\vspace{-0.4cm}
\def 2.9cm {2.3cm}
\begin{figure}[t]
\centering
{\small
\setlength\tabcolsep{2pt}
\begin{tabular}{ccc}
\includegraphics[height=2.9cm]{figures/VzTop.png} &
\includegraphics[height=2.9cm]{figures/DmTop.jpg} &
\includegraphics[height=2.9cm]{figures/DmTopObstructed.jpg} \\
(a) & (b) & (c) \\
\end{tabular}
}
\caption{\label{fig:layouts} Examples of maze types used in our experiments: (a) {\em VizDoom}{} static maze goal reaching, (b) {\em DMLab}{} randomized maze goal reaching, (c) {\em DMLab}{} randomized maze goal reaching with doors.}
\vspace{-0.2cm}
\end{figure}
In this section, we describe the specific tasks we are solving and experimental results for all considered methods on those tasks. There are $4$ methods to report: PPO, PPO + ICM, PPO + Grid Oracle{} and PPO + EC (our method). First, we test static-maze goal reaching in {\em VizDoom}{} environments from prior work to verify that our baseline re-implementation is correct. Second, we test the goal-reaching behaviour in procedurally generated mazes in {\em DMLab}{}. Third, we train no-reward (pure curiosity) maze exploration on the levels from {\em DMLab}{} and report Grid Oracle{} reward as an approximate measure of the maze coverage. Finally, we demonstrate that our curiosity bonus does not significantly deteriorate performance in two dense reward tasks in {\em DMLab}{}. All the experiments were conducted under the same environment interaction budget for all methods (R-network pre-training is included in this budget). The videos of all trained agents in all environments are available online\footnotemark.
For additional experiments we refer the reader to the supplementary material: there we show that R-network can successfully generalize between environments, demonstrate stability of our method to hyperparameters and present an ablation study.
\vspace{-0.2cm}
\subsection{Static Maze Goal Reaching.}
\vspace{-0.2cm}
\footnotetext{\url{https://sites.google.com/view/episodic-curiosity}}
\def 1.0 {1.0}
\begin{figure}[t]
\centering
{\small
\setlength\tabcolsep{2pt}
\begin{tabularx}{\textwidth}{YYY}
Dense & Sparse & Very Sparse \\
\includegraphics[width=1.0 \linewidth]{figures/results-mywayhomedense-v0.pdf} &
\includegraphics[width=1.0 \linewidth]{figures/results-mywayhomesparse-v0.pdf} &
\includegraphics[width=1.0 \linewidth]{figures/results-mywayhomeverysparse-v0.pdf} \\
\end{tabularx}
}
\vspace{-0.4cm}
\caption{\label{fig:VzPlots} Task reward as a function of training step for {\em VizDoom}{} tasks. Higher is better. We use the offline version of our algorithm and shift the curves for our method by the number of environment steps used to train R-network --- so the comparison is fair. We run every method with a repeat of~$3${} (same as in prior work~\citep{ICM2017}) and show all runs. No seed tuning is performed.}
\vspace{-0.4cm}
\end{figure}
The goal of this experiment is to verify our re-implementation of the baseline method is correct. We use the MyWayHome task from {\em VizDoom}{}. The agent has to reach the goal in a static $3$D maze in the time limit of $525$ $4$-repeated steps (equivalent to $1$ minute){}. It only gets a reward of $+1$ when it reaches the goal (episode ends at that moment), the rest of the time the reward is zero.
The task has three sub-tasks (following the setup in~\citep{ICM2017}): ``Dense'', ``Sparse'' and ``Very Sparse''. The layout of the maze is demonstrated in Figure~\ref{fig:layouts}(c). The goal is always at the same room but the starting points are different in those sub-tasks. For the ``Dense'' subtask, the agent starts in one of the random locations in the maze, some of which are close to the goal. In this sub-task, the reward is relatively dense (hence the name): the agent is likely to bump into the goal by a short random walk. Thus, this is an easy task even for standard RL methods. The other two sub-tasks are harder: the agent starts in a medium-distant room from the goal (``Sparse'') or in a very distant room (``Very Sparse''). Those tasks are hard for standard RL algorithms because the probability of bumping into a rewarding state by a random walk is very low.
The training curves are shown in Figure~\ref{fig:VzPlots}. By analysing them, we draw a few conclusions. First, our re-implementation of the ICM baseline is correct and the results are in line with those published in~\citep{ICM2017}. Second, our method works on-par with the ICM baseline in terms of final performance, quickly reaching $100\%$ success rate in all three sub-tasks. Finally, in terms of convergence speed, our algorithm is significantly faster than the state-of-the-art method ICM --- our method reaches $100\%$ success rate at least $2$ times{} faster. Note that to make the comparison of the training speed fair, we shift our training curves by the environment interaction budget used for training R-network.
\vspace{-0.2cm}
\subsection{Procedurally Generated Random Maze Goal Reaching.}
\vspace{-0.2cm}
In this experiment we aim to evaluate maze goal reaching task generalization on a large scale. We train on hundreds of levels and then test also on hundreds of hold-out levels. We use ``Explore Goal Locations Large'' (we will denote it ``Sparse'') and ``Explore Obstructed Goals Large'' (we will denote it ``Sparse + Doors'') levels in the {\em DMLab}{} simulator. In those levels, the agent starts in a random location in a randomly generated maze (both layout and textures are randomized at the beginning of the episode). Within the time limit of~$1800$ $4$-repeated steps (equivalent to $2$ minutes){}, the agent has to reach the goal as many times as possible. Every time it reaches a goal, it is re-spawned into another random location in the maze and has to go to the goal again. Every time the goal is reached, the agent gets a reward $+10$, the rest of the time the reward is zero. The second level is a variation of the first one with doors which make the paths in the maze longer. The layouts of the levels are demonstrated in Figure~\ref{fig:layouts}(b,c).
We found out that the standard task ``Sparse'' is actually relatively easy even for the plain PPO algorithm. The reason is that the agent starting point and the goal are sampled on the map independently of each other --- and sometimes both happen to be in the same room which simplifies the task. To test the limits of the algorithms, we create a gap between the starting point and the goal which eliminates same-room initialization. We report the results for both the original task ``Sparse'' and its harder version ``Very Sparse''. Thus, there are overall three tasks considered in this section: ``Sparse'', ``Very Sparse'' and ``Sparse + Doors''.
The results demonstrate that our method can reasonably adapt to ever-changing layouts and textures --- see Table~\ref{tab:Dm} and training curves in Figure~\ref{fig:DmPlots}. We outperform the baseline method ICM in all three environments using the same environment interaction budget of $20$M 4-repeated steps. The environment ``Sparse'' is relatively easy and all methods work reasonably. In the ``Very Sparse'' and ``Sparse + Doors'' settings our advantage with respect to PPO and ICM is more clear. On those levels, the visual inspection of the ICM learnt behaviour reveals an important property of this method: it is confused by the firing action and learns to entertain itself by firing until it runs out of ammunition. A similar finding was reported in a concurrent work~\citep{LargeScaleCuriosity2018}: the agent was given an action which switched the content on a TV screen in a maze, along with the movement actions. Instead of moving, the agent learns to switch channels forever. While one might intuitively accept such ``couch-potato'' behaviour in intelligent creatures, it does not need to be a consequence of curious behaviour. In particular, we are not observing such dramatic firing behaviour for our curiosity formulation: according to Figure~\ref{fig:reachability}, an observation after firing is still one step away from the one before firing, so it is not novel (note that firing still could happen in practice because of the entropy term in PPO). Thus, our formulation turns out to be more robust than ICM's prediction error in this scenario. Note that we do not specifically look for an action set which breaks the baseline --- just use the standard one for {\em DMLab}{}, in line with the prior work (e.g., ~\citep{Impala2018}).
The result of this experiment suggests to look more into how methods behave in extremely-sparse reward scenarios. The limiting case would be no reward at all --- we consider it in the next section.
\def 1.0 {1.0}
\begin{figure}[t]
\centering
{\small
\setlength\tabcolsep{2pt}
\begin{tabularx}{1.0\textwidth}{YYY}
Sparse & Very Sparse & Sparse + Doors \\
\includegraphics[width=1.0 \linewidth]{figures/results-sparse.jpg} &
\includegraphics[width=1.0 \linewidth]{figures/results-very_sparse.jpg} &
\includegraphics[width=1.0 \linewidth]{figures/results-doors_sparse.jpg} \\
No Reward & No Reward - Fire & Dense 1 \\
\includegraphics[width=1.0 \linewidth]{figures/results-no_reward.jpg} &
\includegraphics[width=1.0 \linewidth]{figures/results-no_fire.jpg} &
\includegraphics[width=1.0 \linewidth]{figures/results-dense1.jpg} \\
\end{tabularx}
}
\vspace{-0.4cm}
\caption{\label{fig:DmPlots} Reward as a function of training step for {\em DMLab}{} tasks. Higher is better. ``ECO'' stands for the online version of our method, which trains R-network and the policy at the same time. We run every method $30${}~times and show $5$ randomly selected runs. No seed tuning is performed.}
\vspace{-0.4cm}
\end{figure}
\vspace{-0.2cm}
\subsection{No Reward/Area Coverage.}
\vspace{-0.2cm}
This experiment aims to quantitatively establish how good our method is in the scenario when no task reward is given. One might question why this scenario is interesting --- however, before the task reward is found for the first time, the agent lives in the no-reward world. How it behaves in this case will also determine how likely it is to stumble into the task reward in the first place.
We use one of the {\em DMLab}{} levels --- ``Sparse'' from the previous experiment. We modify the task to eliminate the reward and name the new task ``No Reward''. To quantify success in this task, we report the reward coming from Grid Oracle{} for all compared methods. This reward provides a discrete approximation to the area covered by the agent while exploring.
The training curves are shown in Figure~\ref{fig:DmPlots} and the final test results in Table~\ref{tab:Dm}. The result of this experiment is that our method and Grid Oracle{} both work, while the ICM baseline is not working --- and the qualitative difference in behaviour is bigger than in the previous experiments. As can be seen from the training curves, after a temporary increase, ICM quality actually decreases over time, rendering a sharp disagreement between the prediction-error-based bonus and the area coverage metric. By looking at the video\footnotemark[\value{footnote}], we observe that the firing behaviour of ICM becomes even more prominent, while our method still shows reasonable exploration.
Finally, we try to find out if the ICM baseline behaviour above is due to the firing action only. Could it learn exploration of randomized mazes if the Fire action is excluded from the action set? For that purpose, we create a new version of the task --- we call it ``No Reward - Fire''. This task demonstrates qualitatively similar results to the one with the full action set --- see Table~\ref{tab:Dm}. By looking at the videos\footnotemark[\value{footnote}], we hypothesise that the agent can most significantly change its current view when it is close to the wall --- thus increasing one-step prediction error --- so it tends to get stuck near ``interesting'' diverse textures on the walls.
The results suggest that in an environment completely without reward, the ICM method will exhaust its curiosity very quickly --- passing through a sharp peak and then degrading into undesired behaviour. This observation raises concerns: what if ICM passes the peak before it reaches the first task reward in the cases of real tasks? Supposedly, it would require careful tuning per-game. Furthermore, in some cases, it would take a lot of time with a good exploration behaviour to reach the first reward, which would require to stay at the top performance for longer --- which is problematic for the ICM method but still possible for our method.
\vspace{-0.2cm}
\subsection{Dense Reward Tasks.}
\vspace{-0.2cm}
\begin{table}[t]
\caption{\label{tab:Dm} Reward in {\em DMLab}{} tasks (mean{} $\pm$ std) for all compared methods. Higher is better. ``ECO'' stands for the online version of our method, which trains R-network and the policy at the same time. We report Grid Oracle{} reward in tasks with no reward. The Grid Oracle{} method is given for reference --- it uses privileged information unavailable to other methods. Results are averaged over $30${} random seeds. No seed tuning is performed.}
\vspace{.1cm}
\centering
{ \fontsize{7}{12} \selectfont
\begin{tabularx}{\textwidth}{@{}lYYcccYY@{}}
\toprule
Method & Sparse & Very Sparse & Sparse+Doors & No Reward & No Reward - Fire & Dense 1 & Dense 2 \\ \midrule
PPO & 27.0 $\pm$ 5.1 & 8.6 $\pm$ 4.3 & 1.5 $\pm$ 0.1 & 191 $\pm$ 12 & 217 $\pm$ 19 & 22.8 $\pm$ 0.5 & 9.41 $\pm$ 0.02 \\
PPO + ICM & 23.8 $\pm$ 2.8 & 11.2 $\pm$ 3.9 & 2.7 $\pm$ 0.2 & 72 $\pm$ 2 & 87 $\pm$ 3 & 20.9 $\pm$ 0.6 & 9.39 $\pm$ 0.02 \\
PPO + EC (ours) & 26.2 $\pm$ 1.9 & 24.7 $\pm$ 2.2 & 8.5 $\pm$ 0.6 & \textbf{475 $\pm$ 8} & \textbf{492 $\pm$ 10} & 19.9 $\pm$ 0.7 & 9.53 $\pm$ 0.03 \\
PPO + ECO (ours) & \textbf{41.6 $\pm$ 1.7} & \textbf{40.5 $\pm$ 1.1} & \textbf{19.8 $\pm$ 0.5} & 472 $\pm$ 18 & 457 $\pm$ 32 & \textbf{22.9 $\pm$ 0.4} & \textbf{9.60 $\pm$ 0.02} \\ \midrule
PPO + Grid Oracle & 56.7 $\pm$ 1.3 & 54.3 $\pm$ 1.2 & 29.4 $\pm$ 0.5 & 796 $\pm$ 2 & 795 $\pm$ 3 & 20.9 $\pm$ 0.6 & 8.97 $\pm$ 0.04 \\ \bottomrule
\end{tabularx}
}
\vspace{-0.4cm}
\end{table}
A desirable property of a good curiosity bonus is to avoid hurting performance in dense-reward tasks (in addition to improving performance for sparse-reward tasks). We test this scenario in two levels in the {\em DMLab}{} simulator: ``Rooms Keys Doors Puzzle'' (which we denote ``Dense 1'') and ``Rooms Collect Good Objects Train'' (which we denote ``Dense 2''). In the first task, the agent has to collect keys and reach the goal object behind a few doors openable by those keys. The rewards in this task are rather dense (key collection/door opening is rewarded). In the second task the agent has to collect good objects (give positive reward) and avoid bad objects (give negative reward). The episode lasts for~$900$ $4$-repeated steps (equivalent to $1$ minute){} in both tasks.
The results show that our method indeed does not significantly deteriorate performance of plain PPO in those dense-reward tasks --- see Table~\ref{tab:Dm}. The training curves for ``Dense 1'' are shown in Figure~\ref{fig:DmPlots} and for ``Dense 2'' --- in the supplementary material. Note that we use the same bonus weight in this task as in other {\em DMLab}{} tasks before. All methods work similarly besides the Grid Oracle in the ``Dense 2'' task --- which performs slightly worse. Video inspection\footnotemark[\value{footnote}] reveals that Grid Oracle --- the only method which has ground-truth knowledge about area it covers during training --- sometimes runs around excessively and occasionally fails to collect all good objects.
\vspace{-0.4cm}
\section{Discussion}
\vspace{-0.4cm}
Our method is at the intersection of multiple topics: curiosity, episodic memory and temporal distance prediction. In the following, we discuss the relation to the prior work on those topics.
\vspace{-0.3cm}
\mypara{Curiosity in visually rich 3D environments.}
Recently, a few works demonstrated the possibility to learn exploration behaviour in visually rich 3D environments like {\em DMLab}{}~\citep{DMLab2016} and {\em VizDoom}{}~\citep{ViZDoom2016}. \citep{ICM2017} trains a predictor for the embedding of the next observation and if the reality is significantly different from the prediction --- rewards the agent. In that work, the embedding is trained with the purpose to be a good embedding for predicting action taken between observations --- unlike an earlier work~\citep{ICMpredecessor2015} which obtains an embedding from an autoencoder. It was later shown by \citep{LargeScaleCuriosity2018} that the perceptive prediction approach has a downside --- the agent could become a ``couch-potato'' if given an action to switch TV channels. This observation is confirmed in our experiments by observing a persistent firing behaviour of the ICM baseline in the navigational tasks with very sparse or no reward. By contrast, our method does not show this behaviour. Another work \citep{EX22017} trains a temporal distance predictor and then uses this predictor to establish novelty: if the observation is easy to classify versus previous observations, it is novel. This method does not use episodic memory, however, and the predictor is used in way which is different from our work.
\vspace{-0.3cm}
\mypara{General curiosity.}
Curiosity-based exploration for RL has been extensively studied in the literature. For an overview, we refer the reader to the works~\citep{CuriosityOverview2009, CuriosityOverview2007}. The most common practical approaches could be divided into three branches: prediction-error-based, count-based and goal-generation-based. Since the prediction-based approaches were discussed before, in the following we focus on the latter two branches.
The count-based approach suggests to keep visit counts for observations and concentrate on visiting states which has been rarely visited before --- which bears distant similarity to how we use episodic memory. This idea is natural for discrete observation spaces and has solid theoretical foundations. Its extension to continuous observation spaces is non-trivial, however. The notable step in this direction was taken by works~\citep{CB2016, CB2017} which introduce a trained observation density model which is later converted to a function behaving similarly to counts. The way conversion is done has some similarity to prediction-error-based approaches: it is the difference of the density in the example before and after training of this example which is converted to count. The experiments in the original works operate on Atari games~\citep{Atari2013} and were not benchmarked on visually rich $3$D environments. Another approach~\citep{HashExploration2017} discretises the continuous observation space by hashing and then uses the count-based approach in this discretised space. This method is appealing in its simplicity, however, the experiments in~\citep{ICM2017,EX22017} show that it does not perform well in visually rich $3$D environments. Another line of work, Novelty Search~\citep{NS2011} and its recent follow-up~\citep{NSFollowup2018}, proposed maintaining an archive of behaviours and comparing current behaviour to those --- however, the comparison is done by euclidean distance and behaviours are encoded using coordinates, while we learn the comparison function and only use pixels.
Finally, our concept of novelty through reachability is reminiscent of generating the goals which are reachable but not too easy --- a well-studied topic in the prior work. The work~\citep{GANGoal2017} uses a GAN to differentiate what is easy to reach from what is not and then generate goals at the boundary. Another work~\citep{ExpectedProgress2013} defines new goals according to the expected progress the agent will make if it learns to solve the associated task. The recent work~\citep{UnsupervisedGoal2018} learns an embedding for the goal space and then samples increasingly difficult goals from that space. In a spirit similar to those works, our method implicitly defines goals that are at least some fixed number of steps away by using the reachability network. However, our method is easier to implement than other goal-generation methods and quite general.
\vspace{-0.3cm}
\mypara{Episodic memory.}
Two recent works \citep{MFEC2016, NEC2017} were inspired by the ideas of episodic memory in animals and proposed an approach to learn the functioning of episodic memory along with the task for which this memory is applied. Those works are more focused on repeating successful strategies than on exploring environments --- and are not designed to work in the absence of task rewards.
\vspace{-0.3cm}
\mypara{Temporal distance prediction.}
The idea to predict the distance between video frames has been studied extensively. Usually this prediction is an auxiliary task for solving another problem. \citep{TCN2017} trains an embedding such that closer in time frames are also closer in the embedding space. Multiple works \citep{EX22017, SPTM2018, PlayingYoutube2018} train a binary classifier for predicting if the distance in time between frames is within a certain threshold or not. While \citep{TCN2017, PlayingYoutube2018} use only the embedding for their algorithms, \citep{EX22017, SPTM2018} also use the classifier trained together with the embedding. As mentioned earlier, \citep{EX22017} uses this classifier for density estimation instead of comparison to episodic memory. \citep{SPTM2018} does compare to the episodic memory buffer but solves a different task --- given an already provided exploration video, navigate to a goal --- which is complementary to the task in our work.
\vspace{-0.6cm}
\section{Conclusion}
\vspace{-0.4cm}
In this work we propose a new model of curiosity based on episodic memory and the ideas of reachability. This allows us to overcome the known ``couch-potato'' issues of prior work and outperform the previous curiosity state-of-the-art method ICM in visually rich $3$D environments from {\em VizDoom}{} and {\em DMLab}{}. Our method also allows a {\em MuJoCo}{} ant to learn locomotion purely out of first-person-view curiosity. In the future, we want to make policy aware of memory not only in terms of receiving reward, but also in terms of acting. Can we use memory content retrieved based on reachability to guide exploration behaviour in the test time? This could open opportunities to learn exploration in new tasks in a few-shot style --- which is currently a big scientific challenge.
\vspace{-0.2cm}
\subsubsection*{Acknowledgments}
\vspace{-0.2cm}
We would like to thank Olivier Pietquin, Alexey Dosovitskiy, Vladlen Koltun, Carlos Riquelme, Charles Blundell, Sergey Levine and Matthieu Geist for the valuable discussions about our work.
{
| {'timestamp': '2019-08-07T02:17:41', 'yymm': '1810', 'arxiv_id': '1810.02274', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02274'} | arxiv |
\section{Introduction} \label{sec::introduction}
Kernels and kernel methods have been gaining their prevalence as standard tools in machine learning. The essential idea in kernel methods lies in the transformation of the input data to certain high-dimensional feature space with certain nice computational properties preserved, which is the so-called \textit{kernel trick}. Literature has witnessed a growth of various kernel-based learning schemes and a flourish of studies, e.g.~\cite{ScSm01, SuVaDe02, StCh08}. Kernel methods are black-boxes in that the feature maps are not interpretable and one cannot know their explicit formulas, which actually brings computational convenience. However, it treats all features the same, which is usually not in line with the case in practice.
The great empirical success of deep learning in the past decade is attributed to the feature learning/ feature engineering brought by the inherent structure of multiple hidden layers \cite{Bengio09a, BeCoVi13a}.
However, feature engineering can never be ad-hoc for deep learning, and can actually play a role in the context of kernel methods.
In fact, it is shown that deep learning models are closely related to kernel methods and many of them can be interpreted by using kernel machines \cite{ChSa09a,AnRoTaPo15a}. Besides, several deep kernel methods have also been proposed by introducing \textit{deeper kernels} \cite{ChSa09a,AnRoTaPo15a}.
Noticing the necessities of feature representation in the context of kernel methods, the present study aims at investigating learning problems with a special class of kernel functions, i.e., anisotropic kernels. The concept of \textit{anisotropic} here is termed as a generalization of the vanilla kernel class, namely, the isotropic kernels. Different from the isotropic ones, the specialty of anisotropic kernels lies in that their shape parameters entail feature-wise adjustments. Though that may involves more hyper-parameters, it may also improves the empirical performance. The validity of the anisotropic kernels can be demonstrated via a wide range of applications, especially the image processing problems, such as lung pattern classification \cite{ShSo04a} and forecasting \cite{GaOrSaCaSaPo13a} via SVMs with anisotropic Gaussian RBF kernels. Literature has been focused on the feature selection capacity that anisotropic kernels bring, for example, \cite{Allen13a} presents an algorithm to minimize a feature-regularized loss function and thus achieving automatic feature selection based on the feature-weighted kernels, \cite{LiYaXi05a} proposes the so called Feature Vector Machine which can be easily extended for feature selection with non-linear models by introducing kernels defined on feature vectors, and
\cite{MaWeBa11a} introduces the kernel-penalized SVM that simultaneously selects relevant features during classifier construction by penalizing each feature’s use in the dual formulation of SVMs.
To cope with the highdimensional nature of the input space, \cite{BrRoCrSe07a} proposes a density estimator with anisotropic kernels which are especially appropriate when the density concentrates on a low-dimensional subspace.
Finally, \cite{ShZh12a} proposes a noise-robust edge detector which combines a small-scaled isotropic Gaussian kernel and large-scaled anisotropic Gaussian kernels to obtain edge maps of images.
Fully aware of the significance of the anisotropic kernels, we address the learning problem of non-parametric least squares regression with anisotropic Gaussian RBF kernel-based support vector machines. The learning goal is to find a function $f_D: X \to \mathbb{R}$ that is a good estimate of the unknown conditional mean $f^*(x) := \mathbb{E}(Y| \boldsymbol{x})$, $\boldsymbol{x} \in X$ given $n$ i.i.d.~observations $D := ( (\boldsymbol{x}_1, y_1), \ldots, (\boldsymbol{x}_n, y_n) )$ of input/output pairs drawn from an unknown distribution $\mathrm{P}$ on $X \times Y$, where $Y \subset \mathbb{R}$.
To be specific, we ought to find a function $f_D$ such that, for the loss function $L: Y \times \mathbb{R} \to [0, \infty)$, the risk
\begin{align*}
\mathcal{R}_{L,\mathrm{P}} (f_{\mathrm{D}}) := \int_{X \times Y} L(y, f_{\mathrm{D}}(x)) \, d\mathrm{P}(x, y)
\end{align*}
should be close to the Bayes risk
$\mathcal{R}_{L,\mathrm{P}}^*
:= \inf \bigl\{ \mathcal{R}_{L,\mathrm{P}}(f) \ | \ f : X \to \mathbb{R} \text{ measureable} \bigr\} $
with respect to $\mathrm{P}$ and $L$. A Bayes decision function is a function $f_{L,\mathrm{P}}^*$ satisfying
$\mathcal{R}_{L,\mathrm{P}}(f_{L,\mathrm{P}}^*) = \mathcal{R}_{L,\mathrm{P}}^*$.
In this paper, we consider an anisotropic kernel-based regularized empirical risk minimizers, namely support vector machine (SVMs) with anisotropic kernel $k_{\boldsymbol{w}}$, which solve the regularized problem
\begin{align} \label{f_D,lambda,gamma}
f_{\mathrm{D},\lambda,\boldsymbol{w}}
= \operatornamewithlimits{arg \, min}_{f \in H_{\boldsymbol{w}}}
\frac{1}{n} \sum_{i=1}^{n} L(y_i,f(x_i))
+ \lambda \|f\|_{H_{\boldsymbol{w}}}^2\ .
\end{align}
Here, $\lambda > 0$ is a fixed real number and $H_{\boldsymbol{w}}$ is a reproducing kernel Hilbert space (RKHS) of $k_{\boldsymbol{w}}$ over $X$.
The main contribution of this paper lies in the establishment of the almost optimal learning rates for nonparametric regression with anisotropic Gaussian SVMs, provided that the target functions are contained in some \textit{anisotropic Besov spaces}.
Recall that the overall smoothness of the commonly used isotropic kernels depends on the worst smoothness of all dimensions, which faces the dilemma where one poor smoothness along certain dimension may lead to unsatisfying convergence rates of the decision functions, even when smoothness along other dimensions is fairly good. Unlike the isotropic ones, the anisotropic kernels are more resistant to the poor smoothness of certain dimensions. To be specific, the overall smoothness is embodied by the \textit{effective smoothness}, or the \textit{exponent of global smoothness}, whose reciprocal is the mean of the reciprocals of smoothness of all dimensions. In this manner, poor smoothness along certain dimensions will not able to jeopardize the whole good one. Based on the effective smoothness, we manage to derive almost optimal learning rates which not only match the theoretical optimal ones for anisotropic kernels up to some logarithmic factor, but also in line with the published optimal learning rates derived by different algorithms. Moreover, when embed our results in cases of the isotropic one where we take all shape parameters as the same, our optimal learning rates still coincide with the theoretical optimal ones for isotropic kernels up to a logarithmic factor and are even better than the existing rates obtained via other methods.
Moreover, even though literature mainly concentrates on isotropic classes, the assumption of this isotropy might result in the loss of efficiency if the regression function actually belongs to an anisotropic class. In fact, this inefficiency is getting worser with the dimension getting higher. Therefore, assumption of anisotropy might serve as a more appropriate substitute. Besides, the anisotropy assumption also shows its advantages in confronting sparse regression functions where the learning rates will automatically depend on a small subset of the coordinates owing to the nature of effective smoothness. This phenomenon is also supported by theoretical analysis in this paper with even faster learning rates established.
The paper is organized as follows: Section \ref{sec::preliminaries} summarizes notations and preliminaries. We present the main results of the almost optimal learning rates of the anisotropic kernels for regression in Section \ref{sec::convergence_rates}. The error analysis is clearly illustrated in Section \ref{sec::error_analysis}. Detailed proofs of Sections \ref{sec::convergence_rates} and \ref{sec::error_analysis} are placed in Section \ref{sec::proofs}, for the sake of clarity. Finally, we conclude this paper in Section \ref{sec::DisCon}.
\section{Preliminaries} \label{sec::preliminaries}
Throughout this paper, we assume that $X\subset\mathbb{R}^d$ is a non-empty, open and bounded set such that its boundary $\partial X$ has Lebesgue measure $0$, $Y:=[-M,M]$ for some $M>0$ and $\mathrm{P}$ is a probability measure on $X\times Y$ such that
$\mathrm{P}_X$ on $X$ is absolutely continuous with respect to the Lebesgue measure on $X$.
Furthermore, we assume that the corresponding density of $\mathrm{P}_X$ is bounded away from $0$ and $\infty$.
In what follows, we denote the closed unit ball of a Banach space $E$ by $B_E$, the $d$-dimensional Euclidean space $\ell_2^d$, we write $B_{\ell_2^d}$.
For $s \in \mathbb{R}$, $\lfloor s \rfloor$ is the greatest
integer smaller or equal $s$ and $\lceil s \rceil$ is the smallest integer greater or equal $s$.
The tensor product $f \otimes g : X \times X \to \mathbb{R}$ of two
functions $f, g : X \to \mathbb{R}$ is defined by $f \otimes g(x, x') := f(x) g(x')$, $x, x' \in X$. The $d$-fold tensor product can be defined analogously.
\subsection{Anisotropic Gaussian kernels and their RKHSs} \label{sec::AniGauRKHS}
The anisotropic kernels can be defined as follows:
\begin{definition}[Anisotropic kernel]
A function $k_{\boldsymbol{w}} : X \times X \to \mathbb{R}$ is called an anisotropic kernel on $X$ with the shape parameter $\boldsymbol{w} = (w_1, \ldots, w_d)^\top$ if there exists a Hilbert space $H$ and a map $\Phi : X \to H$ such that for all $\boldsymbol{x}, \boldsymbol{x}' \in X$ we have
\begin{align*}
k_{\boldsymbol{w}}(\boldsymbol{x}, \boldsymbol{x}')
= \langle \Phi (\boldsymbol{w}^T\boldsymbol{x}'), \Phi (\boldsymbol{w}^T\boldsymbol{x}) \rangle
= \langle \Phi_{\boldsymbol{w}}(\boldsymbol{x}'), \Phi_{\boldsymbol{w}}(\boldsymbol{x}) \rangle,
\end{align*}
where $\boldsymbol{x} = (x_1, \ldots, x_d)^T$ and $\boldsymbol{x}' = (x'_1, \ldots, x'_d)^T$. $\Phi_{\boldsymbol{w}}$ is called a feature map and $H$ is called a feature space of $k_{\boldsymbol{w}}$.
\end{definition}
Careful observation of the definition of isotropic kernels, see e.g.~Definition 4.1 in \cite{StCh08}, will find that they can be taken as anisotropic kernels with the shape parameter $\boldsymbol{w}$ being an all-one vector. One commonly utilized anisotropic kernel is the \textit{anisotropic Gaussian kernel}. With the shape parameter $\boldsymbol{w} = (\gamma_1^{-1}, \ldots, \gamma_d^{-1})$, it takes the form:
\begin{align} \label{Aniso_Gaussian_Kernel}
k_{\boldsymbol{\gamma}} (\boldsymbol{x},\boldsymbol{x}')
:= k_{\boldsymbol{w}} (\boldsymbol{x},\boldsymbol{x}')
= \exp \bigl( - \|{\boldsymbol{w}}^T\boldsymbol{x}' - {\boldsymbol{w}}^T\boldsymbol{x}\|_2^2 \bigr)
= \exp \biggl( - \sum_{j=1}^d \frac{|x_j-x_j'|^2}{\gamma_j^2} \biggr),
\end{align}
where $\boldsymbol{\gamma} = (\gamma_1, \ldots, \gamma_d) \in (0,1]^d$ is called the multi-bandwidth of the anisotropic Gaussian kernels $k_{\boldsymbol{\gamma}}$.
Next, we are encouraged to determine an explicit formula for the RKHSs of anisotropic Gaussian RBF kernels. To this end, let us fix $\boldsymbol{\gamma}=(\gamma_1, \ldots, \gamma_d)$ where $\gamma_i > 0, i=1,\ldots, d$ and $d \in \mathbb{N}$.
For a given function $f : \mathbb{R}^d \to \mathbb{R}$ we define
\begin{align} \label{RKHS_Norm}
\|f\|_{H_{\boldsymbol{\gamma}}}
:= \biggl( \frac{2}{\pi} \biggr)^{d/2}
\biggl( \prod_{i=1}^d \gamma_i \biggr)^{-1}
\biggl( \int_{\mathbb{R}^d} |f(\boldsymbol{x})|^2
\exp \biggl( - \sum_{i=1}^d \frac{4 x_i^2}{\gamma_i^2} \biggr)
\, d\boldsymbol{x} \biggr)^{1/2} \ ,
\end{align}
where $d\boldsymbol{x}$ stands for the Lebesgue measure on $\mathbb{R}^d$.
Furthermore, we write
\begin{align*}
H_{\boldsymbol{\gamma}}
:= \bigl\{ f : \mathbb{R}^d \to \mathbb{R} \, | \, \|f\|_{\boldsymbol{\gamma}} < \infty \bigr\} \, .
\end{align*}
Obviously, $H_{\boldsymbol{\gamma}}$ is a function space with Hilbert norm $\|\cdot\|_{\boldsymbol{\gamma}}$. The following theorem shows that $H_{\boldsymbol{\gamma}}$ is the RKHS of the anisotropic Gaussian RBF kernel $k_{\boldsymbol{\gamma}}$.
\begin{theorem}[RKHS of the anisotropic Gaussian RBF]
Let $\boldsymbol{\gamma}=(\gamma_1, \ldots, \gamma_d)$ where $\gamma_i > 0, i=1,\ldots, d$ and $d \in \mathbb{N}$. Then $(H_{\boldsymbol{\gamma}},\ \|\cdot\|_{H_{\boldsymbol{\gamma}}})$ is an RKHS and $k_{\boldsymbol{\gamma}}$ is its reproducing kernel. Furthermore, for $n \in \mathbb{N}_0:=\mathbb{N}\cup\{0\}$, let $e_{i,n} : \mathbb{R} \to \mathbb{R}$ be defined by
\begin{align*}
e_{i,n} (x_i) := \sqrt{\frac{2^n}{\gamma_i^{2n} n!}} \, x_i^n e^{- \gamma_i^{-2} x_i^2},
\,\,\,\,\,\,\,\,\,\,
\text{ for all } x_i \in \mathbb{R}.
\end{align*}
Then the system $(e_{1,n_1} \otimes \cdots \otimes e_{d,n_d})_{n_1,\dots,n_d\geq 0}$ of functions $e_{1,n_1} \otimes \cdots \otimes e_{d,n_d}: \mathbb{R}^d \to \mathbb{R}$ defined by
\begin{align*}
e_{1,n_1} \otimes \cdots \otimes e_{d,n_d}(z_1, \ldots, z_d) := \prod_{j=1}^d e_{j,n_j} (z_j),
\,\,\,\,\,\,\,\,\,\, (z_1, \ldots, z_d) \in \mathbb{R}^d,
\end{align*}
is an orthonormal basis of $H_{\boldsymbol{\gamma}}$.
\end{theorem}
The above theorem of orthonormal basis (OBS) of $H_{\boldsymbol{\gamma}}$ is in the same way as Theorem 4.38 in \cite{StCh08}.
Therefore, we omit the proof here.
Note that the reproducing kernel of a RKHS is determined by an arbitrary ONB of this RKHS. Therefore, $k_{\boldsymbol{\gamma}}$ is its reproducing kernel of the RKHS $H_{\boldsymbol{\gamma}}$ which turns out to be the product function space of the RKHSs $H_{\gamma_i}$, that is,
$H_{\boldsymbol{\gamma}} = \otimes_{i=1}^d H_{\gamma_i}$,
where $H_{\gamma_i}$ is the RKHS of the one-dimensional Gaussian kernel
\begin{align} \label{1D_Gaussian_Kernel}
k_{\gamma_i} (x, x')
= \exp \biggl( - \frac{|x-x'|^2}{\gamma_i^2} \biggr),
\,\,\,\,\,\,\,\,\,\,\,\,\,\,
x, x' \in \mathbb{R}.
\end{align}
\subsection{Anisotropic Besov spaces} \label{sec::AniBesovSpace}
Let us begin by introducing some function spaces we need.
Sobolev spaces \cite{AdFo03, Tr83} are one type of subspaces of $L_p(\nu)$. Let $\partial^{(\alpha)}$ be the $\alpha$-th weak derivative for a multi-index $\alpha = (\alpha_1, \ldots, \alpha_d) \in \mathbb{N}_0^d$ with $|\alpha| = \sum_{i=1}^d \alpha_i$. Then, for an integer $m \geq 0$, $1 \leq p \leq \infty$, and a measure $\nu$, the Sobolev space of order $m$ with respect to $\nu$ is defined by
\begin{align*}
W_p^m(\nu) := \{ f \in L_p(\nu): \partial^{(\alpha)} f \in L_p(\nu) \text{ exists for all } \alpha \in \mathbb{N}_0^d \text{ with } |\alpha| \leq m\}.
\end{align*}
It is the space of all functions in $L_p(\nu)$ whose weak derivative up to order $m$ exist and are contained in $L_p(\nu)$. The Sobolev norm \cite{AdFo03} of the Sobolev space is given by
\begin{align*}
\|f\|_{W_p^m (\nu)} := \bigg( \sum_{|\alpha| \leq m} \big\| \partial^{(\alpha)} f \big\|_{L_p(\nu)}^p \bigg)^{\frac{1}{p}}.
\end{align*}
In addition, we write $W_p^{0}(\nu) := L_p(\nu)$, and define $W_p^{m}(X) := W_p^{m}(\mu)$ for the Lebesgue measure $\mu$ on $X \subset \mathbb{R}^d$.
Another typical subspaces of $L_p(\nu)$ with a fine scale of smoothness which is commonly considered in the approximation theory, namely anisotropic Besov spaces. In order to clearly describe these function spaces, we need to introduce some device to measure the smoothness of function, which is the modulus of smoothness.
Let $X = \prod_{i=1}^d X^{(i)} \subset \mathbb{R}^d$ be a subset with non-empty interior,
$\nu = \otimes_{i=1}^d \nu_i$ be an arbitrary measure on $X$ with marginal measure $\nu_i$ on $X^{(i)}$, $1 \leq i \leq d$.
For a function $f : X \to \mathbb{R}$ with $f \in L_p(\nu)$ for some $p \in (0, \infty)$, $\boldsymbol{x} = (x_1, \ldots, x_d) \in X$, and $1 \leq i \leq d$, let $f_i := f_i(\cdot|\boldsymbol{x}) :\mathbb{R} \to \mathbb{R}$, $i =1, \ldots, d$ denote the univariate function
\begin{align} \label{UnivariateFunction}
f_i(y) := f_i(\cdot|\boldsymbol{x}) := f(x_1, \ldots, x_{i-1}, y ,x_{i+1}, \ldots, x_d).
\end{align}
Now, we give the formal definition of the modulus of smoothness.
\begin{definition}[Modulus of smoothness]
Let $X \subset \mathbb{R}^d$ be a subset with non-empty interior, $\nu$ be an arbitrary measure on $X$, and $f: X \to \mathbb{R}$ be a function with $f \in L_p(\nu)$ for some $p \in (0, \infty]$. For $\boldsymbol{r} = (r_1, \ldots, r_d) \in \mathbb{N}^d$, the $r_i$-th modulus of smoothness of $f$ in the direction of the variable $x_i$ is defined by
\begin{align} \label{ModulusOfSmoothness}
\omega_{r_i,{L_p(\nu_i)}} (f_i, t_i)
= \sup_{\boldsymbol{x} \in \mathbb{R}^d}
\sup_{0 < |h_i| \leq t_i}
\|\triangle_{h_i}^{r_i} (f_i, \,\cdot \, )\|_{L_p(\nu_i)} \ ,
\end{align}
where the $r_i$-th difference of $f$ in the direction of the variable $x_i$, $1 \leq i \leq d$, denoted as $\triangle_{h_i}^{r_i} (f_i,\, \cdot\, )$, is defined by
\begin{align*}
\triangle_{h_i}^{r_i} (f_i, x_i) =
\begin{cases}
\sum_{j_i=0}^{r_i} {r_i \choose j_i} (-1)^{r_i-j_i} f_i(x_i + j_i h_i)
& \text{ if } x_i \in X_{r_i,h_i}
\\
0 & \text{ if } x_i \notin X_{r_i,h_i}
\end{cases}
\end{align*}
for $\boldsymbol{j} = (j_1, \ldots, j_d) \in \mathbb{N}^d$, $\boldsymbol{h} = (h_1, \ldots, h_d) \in [0, \infty)^d$ and $X_{r_i,h_i} := \{ x_i \in X^{(i)} : x_i + s_i h_i \in X^{(i)} \text{ f.a. } s_i \in [0,r_i] \}$.
\end{definition}
To elucidate the idea of the modulus of smoothness, let us consider the case where $r_i=1$, $i=1, \ldots, d$. Then, we obtain
\begin{align*}
h_i^{-1}\triangle_{h_i}^{1} (f_i,\, x_i ) = \frac{f_i(x_i + h_i) - f_i (x_i)}{h_i} \xrightarrow{h_i \to 0} f_i' (x_i),
\end{align*}
if the derivative $f_i'$ of $f_i$ exists in $x_i$. As a result, $h_i^{-1}\triangle_{h_i}^{1} (f_i,\, x_i )$ equals the secant's slope and is bounded, if $f_i$ is differentiable at $x_i$. Analogously, $h_i^{-1}\triangle_{h_i}^{r_i} (f_i,\, x_i )$ is bounded, if, e.g.~second order derivatives exist.
It follows \cite{JoSc76} immediately that for all $f_i \in L_p(\mathbb{R}^d)$, all $\boldsymbol{t} = (t_1, \ldots, t_d) \in \mathbb{R}_+^d$, and all $\boldsymbol{s} = (s_1, \ldots, s_d) \in \mathbb{R}_+^d$,
the modulus of smoothness with respect to $L_p(\nu_i)$ in the direction of the variable $x_i$ satisfies
\begin{align}\label{EigMod_1}
\omega_{r_i,L_p(\mathbb{R}^d)} (f_i,t_i)
\leq \biggl( 1 + \frac{t_i}{s_i} \biggr)^{r_i}
\omega_{r_i,L_p(\mathbb{R}^d)} (f_i,s_i) \, .
\end{align}
The modulus of smoothness \eqref{ModulusOfSmoothness} in the direction of the variable $x_i$ can be used to define the scale of Besov spaces
in the direction of the variable $x_i$.
For $\boldsymbol{\alpha} = (\alpha_1, \ldots, \alpha_d) \in \mathbb{R}^d$,
$1 \leq p, q \leq \infty$, $r_i := \lfloor \alpha_i \rfloor +1$, $1 \leq i \leq d$, and an arbitrary measure $\nu = \otimes_{i=1}^d \nu_i$,
the Besov space $B_{p,q,i}^{\alpha_i}(\nu_i)$
in the direction of the variable $x_i$ is defined by
\begin{align*}
B_{p,q,i}^{\alpha_i}(\nu)
:= \Bigl\{ f \in L_p(\nu) : |f|_{B_{p,q,i}^{\alpha_i}(\nu_i)} < \infty \Bigr\} \ ,
\end{align*}
where the seminorm $|\cdot\,|_{B_{p,q,i}^{\alpha_i}(\nu_i)}$ is defined by
\begin{align*}
|f|_{B_{p,q,i}^{\alpha_i}(\nu_i)} :=
\begin{cases}
\bigl( \int_0^\infty \bigl( t_i^{-\alpha_i} \omega_{r_i,L_p(\nu_i)} (f_i, t_i) \bigr)^q \frac{dt_i}{t_i} \bigr)^{1/q}
& \text{ for } 1 \leq q < \infty, \\
\sup_{t_i>0} \bigl( t_i^{-\alpha_i} \omega_{r_i,L_p(\nu_i)} (f_i, t_i) \bigr)
& \text{ for } q = \infty.
\end{cases}
\end{align*}
In both cases, the norm of $B_{p,q,i}^{\alpha_i}(\nu_i)$ can be defined by
\begin{align*}
\|f\|_{B_{p,q,i}^{\alpha_i}(\nu_i)}
:= \|f\|_{L_p(\nu)} + |f|_{B_{p,q,i}^{\alpha_i}(\nu_i)} \ .
\end{align*}
In addition, for $q = \infty$, we often write
$$
\mathrm{Lip}^*(\alpha_i, L_p(\nu_i)) := B_{p,\infty,i}^{\alpha_i}(\nu_i)
$$
and call $\mathrm{Lip}^*(\alpha_i,L_p(\nu_i))$
the generalized Lipschitz space of order $\alpha_i$.
Finally, if $\nu$ is the Lebesgue measure on $X$, we write
$B_{p,q,i}^{\alpha_i}(X_i) := B_{p,q,i}^{\alpha_i}(\nu_i)$.
\begin{definition}[Anisotropic Besov space]
For
$\boldsymbol{p} = (p_1, \ldots, p_d) \in [1,\infty)^d$,
$\boldsymbol{q} = (q_1, \ldots, q_d) \in [1,\infty]^d$, and
$\boldsymbol{\alpha} = (\alpha_1, \ldots, \alpha_d) \in \mathbb{R}^d$,
the anisotropic Besov space $B_{\boldsymbol{p},\boldsymbol{q}}^{\boldsymbol{\alpha}}(\nu)$
is defined by
\begin{align*}
B_{\boldsymbol{p},\boldsymbol{q}}^{\boldsymbol{\alpha}}(\nu)
:= \biggl\{ f \in L_p(\nu) : \sum_{i=1}^d \|f\|_{B_{p,q,i}^{\alpha_i}(\nu_i)} < \infty \biggr\} \ .
\end{align*}
\end{definition}
In the case $p_i = p$ and $q_i = q$, $i = 1, \ldots, d$, we use the notation
\begin{align*}
B_{p,q}^{\boldsymbol{\alpha}}(\nu) :=
B_{\boldsymbol{p},\boldsymbol{q}}^{\boldsymbol{\alpha}}(\nu).
\end{align*}
\section{Main results} \label{sec::convergence_rates}
In this section, we present our main results: optimal learning rates for LS-SVMs using anisotropic Gaussian kernels for the non-parametric regression problem
based on the least squares loss $L : Y \times \mathbb{R} \to [0, \infty)$ defined by
$L(y, t) = (y - t)^2$.
\subsection{Convergence rates}
It is well known that, for the least squares loss, the function
$f_{L,\mathrm{P}}^* : \mathbb{R}^d \to \mathbb{R}$ defined by
$f_{L,\mathrm{P}}^*(x) = \mathbb{E}_\mathrm{P} (Y | x)$, $x \in \mathbb{R}^d$,
is the only function for which the Bayes risk is
attained. Furthermore, some simple and well-known transformations show
\begin{align}\label{ExcessRiskLS}
\mathcal{R}_{L,\mathrm{P}}(f) - \mathcal{R}_{L,\mathrm{P}}^*
= \|f - f_{L,\mathrm{P}}^*\|_{L_{2}(\mathrm{P}_X)}^2 \, .
\end{align}
Note that, for all $t \in \mathbb{R}$ and $y \in [-M, M]$, the least squares loss
can be clipped at $M > 0$ in the sense of Definition 2.22 in \cite{StCh08}.
To be precise, we denote the clipped value of some $t\ \in \mathbb{R}$ by $\wideparen{t}$, that is
$\wideparen{t} := -M$ if $t < -M$,
$\wideparen{t} := t$ if $t \in [-M, M]$, and
$\wideparen{t} := M$ if $t > M$.
It can be easily verified that the risks of
the least squares loss satisfies $L(y, \wideparen{t}\,) \leq L(y,t)$, and
therefore $\mathcal{R}_{L,\mathrm{P}}(\wideparen{f}) \leq \mathcal{R}_{L,\mathrm{P}}(f)$
holds for all $f : X \to \mathbb{R}$.
\begin{theorem} \label{LearningRates}
Let $Y := [- M, M]$ for $M > 0$, and $\mathrm{P}$ be a distribution on $\mathbb{R}^d \times Y$ such that $X := \mathrm{supp} \mathrm{P}_X \subset B_{\ell_2^d}$ is a bounded domain with $\mu(\partial X) = 0$.
Furthermore, assume that $\mathrm{P}_X$ is a
distribution on $\mathbb{R}^d$ that for all $1 \leq i \leq d$,
the marginal distributions $\mathrm{P}_{X_i}$
has a Lebesgue density $g_i \in L_q(\mathbb{R})$ for some $q \in [1, \infty]$.
Moreover, let $f_{L,\mathrm{P}}^* : \mathbb{R}^d \to \mathbb{R}$ be a Bayes decision function such that
$f_{L,\mathrm{P}}^* \in L_2(\mathbb{R}^d) \cap L_{\infty}(\mathbb{R}^d)$ as well as
$f_{L,\mathrm{P}}^* \in B_{2s,\infty}^{\boldsymbol{\alpha}}(\mathbb{R}^d)$ for $\boldsymbol{\alpha} = (\alpha_1, \ldots, \alpha_d) \geq 1$ and $s \geq 1$ with $\frac{1}{q} + \frac{1}{s} = 1$. Let
\begin{align} \label{MeanSmoothness}
\alpha_0
:= \biggl( \frac{1}{d} \sum_{j=1}^d \frac{1}{\alpha_i} \biggr)^{-1}.
\end{align}
Then, for all $\tau \geq 1$ and all $n \geq 1$,
the SVM using the anisotropic RKHS $H_{\boldsymbol{\gamma}}$ and the least squares loss $L$ with
\begin{align*}
\lambda_n = c_1 n^{-1},
\qquad
\text{ and }
\qquad
\gamma_{i,n} = c_{2,i} n^{- \frac{\alpha_0}{\alpha_i(2 \alpha_0 + d)}}, \, 1 \leq i \leq d,
\end{align*}
we have
\begin{align}\label{RatesLSSVM}
\mathcal{R}_{L,\mathrm{P}}(\wideparen{f}_{\mathrm{D},\lambda_n,\gamma_n}) - \mathcal{R}_{L,\mathrm{P}}^*
\leq C (\log n)^{d+1} n^{-\frac{2\alpha_0}{2\alpha_0+d}}
\end{align}
with probability $\mathrm{P}^n$ not less than $1- e^{-\tau}$.
Here, $c_1 > 0$ and $c_{2,i} > 0$, $1 \leq i \leq d$, are user-specified constants and $C > 0$ is a constant independent of $n$.
\end{theorem}
Note that for isotropic cases, the overall smoothness is depend on the worst smoothness of all dimensions. In other words, one poor smoothness along certain dimension may lead to unsatisfying convergence rates of the decision functions, even when smoothness of other dimensions is well-behaved. In contrast, the anisotropic cases are more appropriate for one poor smoothness of certain dimension will not jeopardize the overall good smoothness much by
embodying smoothness by $\alpha_0$ in \eqref{MeanSmoothness}. This $\alpha_0$ is called the \textit{effective smoothness} \cite{HoLe02a}, or the \textit{exponent of global smoothness} \cite{Birge86a}. Moreover, we can still precisely characterize the \emph{anisotropy} by considering the dimension-specific smoothness vector $\boldsymbol{a} = (a_1, \ldots, a_d)$ with $a_i = \alpha_0/\alpha_i$, $i = 1, \ldots, d$.
In the statistical literature, optimal rates of convergence in anisotropic H\"{o}lder, Sobolev and Besov spaces have been studied in \cite{IbHa81,Nussbaum85a,HoLe02a}. The theoretical optimal learning rate for a function with smoothness $\alpha_i$ along the $i$-th dimension is given by $n^{-2\alpha_0/(2\alpha_0+d)}$, see e.g. \cite{HoLe02a}. Therefore, our established convergence rates in \eqref{RatesLSSVM} match the theoretical optimal ones up to the logarithmic factor $(\log n)^{d+1}$.
Other published convergence rates for anisotropic cases include ones learned by Gaussian process \cite{IbHa81}. With optimal rates learned by SVMs based on anisotropic Gaussian kernel, the results we obtained is in line with these existing ones derived via different algorithms.
Moreover, when considering our rates in the isotropic classes where $\alpha_i = \alpha$ for all $i = 1, \ldots, d$, our rates become $\mathcal{O} ((\log n)^{d+1} n^{-2\alpha/(2\alpha+d)})$ and it is better than the learning rates $\mathcal{O}(n^{-2\alpha/(2\alpha+d) + \xi})$ via SVMs based on isotropic kernel obtained in \cite{eberts2013optimal}. Furthermore, the well-known theoretical optimal rate for isotropic cases is $n^{-2\alpha/(2\alpha+d)}$, see \cite{Stone82}, and our learning rates coincide with it up to the logarithmic factor $(\log n)^{d+1}$.
Though literature often focuses on the isotropic class, this assumption of isotropy would lead to loss of efficiency if the regression function actually belongs to an anisotropic class. Moreover, this inefficiency is getting worser when the dimension becomes higher. Therefore, assumption of anisotropy which treats isotropy as a special case may be a better choice. In addition, the assumption of anisotropy also shows its advantages in facing sparse regression functions, i.e., if the regression function depends only on a small subset of coordinates $I \subset \{ 1, \ldots, d \}$. Therefore, the effective smoothness in \eqref{MeanSmoothness} will depend less on smoothness along some certain dimensions, and thus become larger. In this manner, the learning rates in \eqref{RatesLSSVM} can be further significantly improved.
\begin{theorem} \label{LearningRatesSubset}
Let the assumptions on the distribution $\mathrm{P}$
and the Bayes decision function
$f_{L,\mathrm{P}}^* : \mathbb{R}^d \to \mathbb{R}$
in Theorem \ref{LearningRates}
hold. Moreover,
suppose $f_{L,\mathrm{P}}^*$ belongs to
$B_{2s,\infty}^{\boldsymbol{\alpha}}(\mathbb{R}^I)$
for some subset $I$ of $\{ 1, \ldots, d \}$. Let
\begin{align} \label{MeanSmoothnessSubset}
\alpha_0^I
:= \biggl( \frac{1}{d} \sum_{i \in I} \frac{1}{\alpha_i} \biggr)^{-1}.
\end{align}
Then, for all $\tau \geq 1$ and all $n \geq 1$,
the SVM using the anisotropic RKHS $H_{\boldsymbol{\gamma}}$ and the least squares loss $L$ with
\begin{align*}
\lambda_n = c_1 n^{-1},
\qquad
\text{ and }
\qquad
\gamma_{i,n} = c_{2,i} n^{- \frac{\alpha_0^I}{\alpha_i(2 \alpha_0^I + d)}}, \, i \in I,
\end{align*}
we have
\begin{align}\label{RatesLSSVMSubset}
\mathcal{R}_{L,\mathrm{P}}(\wideparen{f}_{\mathrm{D},\lambda_n,\gamma_n}) - \mathcal{R}_{L,\mathrm{P}}^*
\leq C (\log n)^{|I|+1} n^{-\frac{2\alpha_0^I}{2\alpha_0^I+d}}
\end{align}
with probability $\mathrm{P}^n$ not less than $1- e^{-\tau}$.
Here, $c_1 > 0$ and $c_{2,i} > 0$, $i \in I$, are user-specified constants and $C > 0$ is a constant independent of $n$.
\end{theorem}
The proof of Theorem \ref{LearningRatesSubset} will be omitted as it is similar to the previous theorem. We only mention that the exponents of the logarithmic terms depend on the capacity of the underlying RKHSs.
\subsection{Rate Analysis} \label{sec::rate_analysis}
In this section, we compare our results with previously obtained learning rates for SVMs for regression.
To this end, according to Theorem 9 in \cite{steinwart2009optimal}, we need to verify two conditions, which are $\mu_i(T_k) \sim i^{-\frac{1}{p}}$ and $\| T_k^{\beta/2} f\|_{\infty} \leq c \| f \|_{L_2(\nu)}$, $f \in L_2(\nu)$, where $T_k$ is the integral operator (see, (5) in \cite{steinwart2009optimal}).
First of all, we prove that $\mu_i(T_k) \sim i^{-\frac{1}{p}}$ holds. With the help of Theorem 15 in \cite{steinwart2009optimal}, $\mu_i(T_k) \leq a i^{-\frac{1}{p}}$ is equivalent to
\begin{align} \label{inq_1}
e_i (\mathrm{id}: H \to L_2(P_X)) \leq \sqrt{a} i^{-\frac{1}{2p}}
\end{align}
modulo a constant only depending on $p$. If we denote $\ell_{\infty}$ the space of all bounded functions on $X$, then the above inequality \eqref{inq_1} will be satisfied if the following more classical, distribution-free entropy number assumption
\begin{align} \label{inq_2}
e_i (\mathrm{id}: H \to \ell_{\infty} (X)) \leq \sqrt{a} i^{-\frac{1}{2p}}
\end{align}
is satisfied. Since the establishment of \eqref{inq_2} can be verified by Proposition \ref{EntropyNumberRKHS} that will be mentioned later, we manage to prove the establishment of $\mu_i(T_k) \sim i^{-\frac{1}{p}}$.
Now, we verify that the second condition $\| T_k^{\beta/2} f \|_{\infty} \leq c \| f \|_{L_2(\nu)}$, $f \in L_2(\nu)$ also holds. Since the proof of Theorem 4.1 in \cite{cucker2007learning} shows that the image of $T_k^{\beta/2}$ is continuously embedded into the real interpolation space $[L_2(\nu),\, H]_{\, \beta, \infty}$, therefore the second condition is satisfied if we can prove that $[L_2(\nu),\, H]_{\, \beta, \infty}$ is continuously embedded in $\ell_{\infty}(X)$.
In order to present a more concrete example,
we need to introduce some notations.
In the following, for $\boldsymbol{v} = (v_1, \cdots, v_d) \in \mathbb{N}^d$,
we denote $\overline{\boldsymbol{v}} := \max \{ v_i, \ i = 1, \ldots, d \}$ and
$\underline{\boldsymbol{v}} := \min \{ v_i, \ i = 1, \cdots, d \}$.
Let us now consider the case where $H = W^{\boldsymbol{m}}$ for some $\underline{\boldsymbol{m}} > d/2$.
If $\mathrm{P}_X = \nu$ has a Lebesgue density that is bounded away from $0$ and $\infty$, then we have
\begin{align*}
B_{2,\, \infty}^{\boldsymbol{\alpha}} (X) = [L_2(\mathrm{P}_X),\, W^{\boldsymbol{m}}(X)]_{\, \beta, \infty},
\end{align*}
where $\boldsymbol{\alpha}:= \beta \boldsymbol{m}$.
Consequently, by Corollary 6 in \cite{steinwart2009optimal}, we can obtain the learning rates $n^{- 2\underline{\boldsymbol{\alpha}} /( 2\underline{\boldsymbol{\alpha}} + d )}$ whenever $f_p^* \in B_{2,\, \infty}^{\,{\boldsymbol{\alpha}} }(X)$. Conversely, according to the Imbedding Theorem for Anisotropic Besov Space, see Theorem \ref{ITABS} in the Appendix, $B_{2,\, \infty}^{\, {\boldsymbol{\alpha}}} (X) $ can be continuously embedded into $\ell_{\infty}(X)$ for all
$\underline{\boldsymbol{\alpha}} > d/2$, and therefore, Theorem 9 in \cite{steinwart2009optimal} shows that the learning rates $n^{- 2\underline{\boldsymbol{\alpha}} /( 2\underline{\boldsymbol{\alpha}} + d )}$ is asymptotic optimal for such ${\boldsymbol{\alpha}}$. However, if $\underline{\boldsymbol{\alpha}} \in (0, d/2]$, we can still obtain the rates $n^{- 2\underline{\boldsymbol{\alpha}} /( 2\underline{\boldsymbol{\alpha}} + d )}$, but we no longer know whether they are optimal in the minimax sense.
It is noteworthy that, when the target functions reside in the anisotropic Besov space, as shown in Theorem \ref{LearningRates},
we obtain
the optimal learning rates $n^{-2\alpha_0/(2 \alpha_0 + d)}$
up to certain logarithmic factor.
There, $\alpha_0 := (({\Sigma_{j=1}^d 1/ \alpha_i})/d)^{-1}$, and the decision functions reside in the RKHSs induced by the anisotropic Gaussian RBF kernel. While, when using an anisotropic Sobolev space as the underlying RKHS, the learning rates obtained are $n^{- 2\underline{\boldsymbol{\alpha}} /( 2\underline{\boldsymbol{\alpha}} + d )}$. It can be apparently observed that since $\alpha_0 > \underline{\boldsymbol{\alpha}} $, our learning rates in Theorem \ref{LearningRates} are faster than that with the anisotropic Sobolev space.
\section{Error Analysis} \label{sec::error_analysis}
\subsection{Bounding the Sample Error Term}
Aiming at proving the new oracle inequality in the Proposition \ref{pro::sample}, there is a need for us to control the capacity of the RKHS $H_{\boldsymbol{\gamma}}$ where we use the entropy numbers, see e.g. \cite{CaSt90} or Definition A.5.26 in \cite{StCh08}. The definition of the entropy numbers is presented as follows:
\begin{definition}
Let $S : E \to F$ be a bounded, linear operator between the
normed spaces $E$ and $F$ and $i \geq 1$ be an integer.
Then the $i$-th (dyadic) entropy number of $S$ is defined by
\begin{align*}
e_i(S) := \inf
\biggl\{
\varepsilon > 0 : \exists t_1, \ldots, t_{2^{i−1}} \in S B_E
\text{ such that } S B_E \subset \bigcup_{j=1}^{2^{i-1}}
(t_j + \varepsilon B_F)
\biggr\}
\end{align*}
where the convention $\inf \emptyset := \infty$ is used.
\end{definition}
The following proposition with regard to the capacity of $H_{\boldsymbol{\gamma}}$ can be derived by Theorem 7.34 and Corollary 7.31 in \cite{StCh08}.
\begin{proposition} \label{EntropyNumberRKHS}
Let $X \subset \mathbb{R}^d$ be a closed Euclidean ball.
Then there exists a constant $K > 0$, such
that, for all $p \in (0, 1)$, $\boldsymbol{\gamma} \in (0, 1]^d$ and $i \geq 1$, we have
\begin{align*}
e_i ( \mathrm{id} : H_{\boldsymbol{\gamma}} \to \ell_{\infty}(X) )
\leq (3 K)^{\frac{1}{p}}
\biggl( \frac{d+1}{e p} \biggr)^{\frac{d+1}{p}}
\biggl( \prod_{i=1}^d \gamma_i \biggr)^{-\frac{1}{p}}
i^{-\frac{1}{p}}.
\end{align*}
\end{proposition}
Having developed the above proposition, we are now able to derive the oracle inequality for the least squares loss as follows:
\begin{proposition} \label{pro::sample}
Let $X \subset B_{\ell_2^d}$, $Y := [-M, M] \subset \mathbb{R}$ be a closed subset with $M > 0$ and $\mathrm{P}$ be a distribution on $X \times Y$. Furthermore, let $L: Y \times \mathrm{R} \to [0, \infty)$ be the least squares loss, $k_{\boldsymbol{\gamma}}$ be the anisotropic Gaussian RBF kernel over $X$ with multi-bandwidth $\boldsymbol{\gamma} = (\gamma_1, \ldots, \gamma_d) \in (0, 1]^d$ and $H_{\boldsymbol{\gamma}}$ be the associated RKHS. Fix an $f_0 \in H_{\boldsymbol{\gamma}}$ and a constant $B_0 \geq 4 M^2$ such that $\|L \circ f_0\| \leq B_0$. Then, for all fixed $\varrho \geq 1$ and $\lambda > 0$ and $p \in (0, 1)$, the SVM using $H_{\boldsymbol{\gamma}}$ and $L$ satisfies
\begin{align}
\lambda \|f_{\mathrm{D},\lambda,\boldsymbol{\gamma}}\|_{H_{\boldsymbol{\gamma}}}^2
& + \mathcal{R}_{L,\mathrm{P}}(\wideparen{f}_{\mathrm{D},\lambda,\boldsymbol{\gamma}})
- \mathcal{R}^{*}_{L,\mathrm{P}}
\nonumber\\
& \leq 9 \bigl( \lambda \|f_0\|_{H_{\boldsymbol{\gamma}}}^2
+ \mathcal{R}_{L,\mathrm{P}}(f_0)
- \mathcal{R}_{L,\mathrm{P}}^* \bigr)
+ K(p) \biggl( \frac{a^{2p}}{\lambda^p n} \biggr)
+ \frac{(3456 M^2 + 15 B_0) (1 + \log 3) \varrho}{n}
\label{OracleInequality}
\end{align}
with probability $\mathrm{P}^n$ not less that $1 - e^{-\varrho}$,
where $K(p)$ is a constant only depending on $p$ and $M$.
\end{proposition}
\subsection{Bounding the Approximation Error Term} \label{sec::ApproxError}
In this section, we consider bounding the approximation
error of some function contained in the RKHS $H_{\gamma}$, which is defined by
\begin{align}\label{ApprErrFunc}
A_{\boldsymbol{\gamma}}(\lambda)
:= \inf_{f \in H_{\boldsymbol{\gamma}}} \lambda \|f\|^2_{H_{\boldsymbol{\gamma}}} + \mathcal{R}_{L,\mathrm{P}}(f) - \mathcal{R}^{*}_{L,\mathrm{P}} \ ,
\end{align}
where the infimum is actually attained by a unique element $f_{\mathrm{P},\lambda,\boldsymbol{\gamma}} \in H_{\boldsymbol{\gamma}}$,
see Lemma 5.1 and Theorem 5.2 in \cite{StCh08}.
To this end, it suffices to find a function $f_0 \in H_{\boldsymbol{\gamma}}$
such that both the regularization term $\lambda \|f_0\|_{H_{\boldsymbol{\gamma}}}^2$
and the excess risk $\mathcal{R}_{L,\mathrm{P}}(f_0) - \mathcal{R}^{*}_{L,\mathrm{P}}$ are small.
To construct this function $f_0$ we define, for
$\boldsymbol{x} = (x_1, \ldots, x_d) \in \mathbb{R}^d$,
$\boldsymbol{\gamma} = (\gamma_1, \ldots, \gamma_d) \in \mathbb{R}_+^d$,
$\boldsymbol{r} = (r_1, \ldots, r_d) \in \mathbb{N}^d$,
and $\boldsymbol{j} = (j_1, \ldots, j_d) \in \mathbb{N}^d$,
the function $K : \mathbb{R}^d \to \mathbb{R}$ by
\begin{align}\label{tilde_K}
K(\boldsymbol{x}) := \prod_{i=1}^d K_i(x_i)
\end{align}
with functions $K_i : \mathbb{R} \to \mathbb{R}$ defined by
\begin{align}\label{tilde_K_i}
K_i(x_i) := \left( \frac{2}{\pi} \right)^{1/2}
\sum_{j_i=1}^{r_i} {r_i \choose j_i} \frac{(-1)^{1-j_i}}{j_i \gamma_i}
\exp \biggl( - \frac{2 |x_i|^2}{j_i^2 \gamma_i^2} \biggr),
\,\,\,\,\,\,\,\,
1 \leq i \leq d.
\end{align}
Assume that there exists a Bayes decision function
$f_{L,\mathrm{P}}^* \in L_2(\mathbb{R}^d) \cap L_{\infty}(\mathbb{R}^d)$,
then we define $f_0$ by
\begin{align}\label{f_0}
f_0(\boldsymbol{x})
:= K * f_{L,\mathrm{P}}^*(\boldsymbol{x})
= \int_{\mathbb{R}^d} K(\boldsymbol{x} - \boldsymbol{t})
f_{L,\mathrm{P}}^*(\boldsymbol{t}) \, d\boldsymbol{t} \ ,
\,\,\,\,\,\,\,\,
\boldsymbol{x} \in \mathbb{R}^d.
\end{align}
In order to show that $f_0$ is indeed a suitable function to bound \eqref{ApprErrFunc}, there is a need for us to first ensure that $f_0$ is contained in $H_{\boldsymbol{\gamma}}$. Moreover, we need to bound both of the excess risk of $f_0$ and the $H_{\boldsymbol{\gamma}}$-norm. Proposition \ref{ErrorEstimation} gives the bound of the excess risk with the help of the modulus of smoothness and Proposition \ref{ConvolutionInRKHS} focus on the estimation of the regularization term.
\begin{proposition}\label{ErrorEstimation}
Let us fix some $q \in [1, \infty)$. Furthermore, assume that $\mathrm{P}_X$ is a
distribution on $\mathbb{R}^d$ that for all $1 \leq i \leq d$,
the marginal distributions $\mathrm{P}_{X_i}$
has a Lebesgue density $g_i \in L_p(\mathbb{R})$ for some $p \in [1, \infty]$.
Let $f : \mathbb{R}^d \to \mathbb{R}$ be such that $f \in L_q(\mathbb{R}^d) \cap L_{\infty}(\mathbb{R}^d)$.
Then, for $\boldsymbol{r} =(r_1, \ldots, r_d) \in \mathbb{N}^d$, $\boldsymbol{\gamma} = (\gamma_1, \ldots, \gamma_d) \in \mathbb{R}_+^d$, and $s \geq 1$ with $1 = \frac{1}{s} + \frac{1}{p}$, we have
\begin{align*}
\|K * f - f\|_{L_q(\mathrm{P}_X)}^q
\leq \sum_{i=1}^d c_{r_i,q} \|g_i\|_{L_p(\mathbb{R})} \, \omega_{r_i,L_{q s}(\mathbb{R})}^q (f_i, \gamma_i/2) \ ,
\end{align*}
where $c_{r_i,q}$ are constants only depending on $r_i$ and $q$.
\end{proposition}
Next, the following proposition aims at bounding the regularization term and proving that the convolution of a function from $L_2(\mathbb{R}^d)$ with $K$ is contained in the RKHS $H_{\boldsymbol{\gamma}}$. The following result is considered to provide a helpful supremum bound.
\begin{proposition} \label{ConvolutionInRKHS}
Let $f \in L_2(\mathbb{R}^d)$, $H_{\boldsymbol{\gamma}}$ be the RKHS of the anisotropic Gaussian kernel $k_{\boldsymbol{\gamma}}$ over $X \subset \mathbb{R}^d$ with $\boldsymbol{\gamma} = (\gamma_1, \ldots, \gamma_d) \in \mathbb{R}_+^d$
and $K : \mathbb{R}^d \to \mathbb{R}$ be defined by \eqref{tilde_K} for a fixed $\boldsymbol{r} = (r_1, \ldots, r_d) \in \mathbb{N}^d$. Then we have $K * f \in H_{\boldsymbol{\gamma}}$ with
\begin{align*}
\|K * f\|_{H_{\boldsymbol{\gamma}}}
\leq
\pi^{-\frac{d}{4}} \prod_{i=1}^d (2^{r_i} - 1) \|f\|_{L_2(\mathbb{R}^d)}
\prod_{i=1}^d \gamma_i^{-\frac{1}{2}} \ .
\end{align*}
Moreover, if $f \in L_{\infty}(\mathbb{R}^d)$, we have
\begin{align*}
|K * f(\boldsymbol{x})| \leq \prod_{i=1}^d (2^{r_i} - 1) \|f\|_{L_{\infty}(\mathbb{R}^d)} \ ,
\,\,\,\,\,\,\,\,\,
\boldsymbol{x} \in X \ .
\end{align*}
\end{proposition}
The following theorem gives an upper bound for the approximation error function
$A_{\boldsymbol{\gamma}}(\lambda)$.
\begin{theorem}\label{ApproximationError}
Let $L$ be the least squares loss,
$\mathrm{P}$ be the probability distribution on $\mathbb{R}^d \times Y$,
and the marginal distributions $\mathrm{P}_{X_i}$
has a Lebesgue density $g_i \in L_p(\mathbb{R})$ for some $p \in [1, \infty]$.
Let $f : \mathbb{R}^d \to \mathbb{R}$ be such that
$f \in L_q(\mathbb{R}^d) \cap L_{\infty}(\mathbb{R}^d)$.
such that $X := \mathrm{supp} \mathrm{P}_X \subset B_{\ell_2^d}$ is a bounded domain with
$\mu(\partial X) = 0$.
Furthermore, assume that $\mathrm{P}_X$ is a
distribution on $\mathbb{R}^d$ that for all $1 \leq i \leq d$,
the marginal distributions $\mathrm{P}_{X_i}$
has a Lebesgue density $g_i \in L_q(\mathbb{R})$ for some $q \in [1, \infty]$.
Moreover, let $f_{L,\mathrm{P}}^* : \mathbb{R}^d \to \mathbb{R}$ be a Bayes decision function such that $f_{L,\mathrm{P}}^* \in L_2(\mathbb{R}^d) \cap L_{\infty}(\mathbb{R}^d)$ as well as
$f_{L,\mathrm{P}}^* \in B_{2s,\infty}^{\boldsymbol{\alpha}}(\mathbb{R}^d)$ for $\boldsymbol{\alpha} = (\alpha_1, \ldots, \alpha_d) \geq 1$ and $s \geq 1$ with $\frac{1}{q} + \frac{1}{s} = 1$.
Then, for all $\boldsymbol{\gamma} \in (0, 1]^d$ and $\lambda > 0$, there holds
\begin{align}\label{ApproximationErrorEstimation}
\lambda \|f_0\|_{H_{\boldsymbol{\gamma}}}^2 + \mathcal{R}_{L,\mathrm{P}}(f_0) - \mathcal{R}_{L,\mathrm{P}}^*
\leq C_1 \lambda \prod_{i=1}^d \gamma_i^{-1} +
C_s \sum_{i=1}^d \gamma_i^{2 \alpha_i},
\end{align}
where the constant $C_1 > 0$ and $C_s > 0$ is a constant depending on the smoothness $s$.
\end{theorem}
\section{Proofs} \label{sec::proofs}
\begin{proof}[Proof of Proposition \ref{EntropyNumberRKHS}]
By Lemma 4.2 in \cite{BhPaDu14},
the covering numbers of unit ball $B_{\boldsymbol{\gamma}}$ of
the Gaussian RKHS $H_{\boldsymbol{\gamma}}(X)$ for all $\boldsymbol{\gamma} \in (0, 1)^d$ and
$\varepsilon \in (0, \frac{1}{2})$ satisfy
\begin{align} \label{CoveringNumberRKHS}
\log \mathcal{N} (B_{\boldsymbol{\gamma}}, \|\cdot\|_{\infty}, \varepsilon)
\leq K \biggl( \prod_{i=1}^d \gamma_i \biggr)^{-1}
\biggl( \log \frac{1}{\varepsilon} \biggr)^{d+1}.
\end{align}
where $K > 0$ is a constant depending only on $d$.
From this, we conclude that
\begin{align*}
\sup_{\varepsilon \in (0, \frac{1}{2})}
\varepsilon^p \log \mathcal{N} (B_{\boldsymbol{\gamma}}, \|\cdot\|_{\infty}, \varepsilon)
\leq K \biggl( \prod_{i=1}^d \gamma_i \biggr)^{-1}
\sup_{\varepsilon \in (0, \frac{1}{2})}
\varepsilon^p \biggl( \log \frac{1}{\varepsilon} \biggr)^{d+1}.
\end{align*}
Let $h(\varepsilon) := \varepsilon^p ( \log \frac{1}{\varepsilon} )^{d+1}$.
In order to obtain the optimal value of $h(\varepsilon)$, we differentiate it with
respect to $\varepsilon$
\begin{align*}
\frac{d h(\varepsilon)}{d \varepsilon}
= p \varepsilon^{p-1} \biggl( \log \frac{1}{\varepsilon} \biggr)^{d+1}
- \varepsilon^p (d+1) \biggl( \log \frac{1}{\varepsilon} \biggr)^d \log \frac{1}{\varepsilon},
\end{align*}
and set $\frac{d h(\varepsilon)}{d \varepsilon} = 0$ which gives
\begin{align*}
\log \frac{1}{\varepsilon} = \frac{d+1}{p}
\Rightarrow
\varepsilon^* = \frac{1}{e^{\frac{d+1}{p}}}.
\end{align*}
By plugging $\varepsilon^*$ into $h(\varepsilon)$, we obtain
\begin{align*}
h(\varepsilon^*) = \biggl( \frac{d+1}{e p} \biggr)^{d+1},
\end{align*}
and consequently, the covering numbers \eqref{CoveringNumberRKHS} are
\begin{align*}
\log \mathcal{N} (B_{\boldsymbol{\gamma}}, \|\cdot\|_{\infty}, \varepsilon)
\leq K \biggl( \frac{d+1}{e p} \biggr)^{d+1}
\biggl( \prod_{i=1}^d \gamma_i \biggr)^{-1}
\varepsilon^{-p},
\end{align*}
where
$$
a := K \biggl( \frac{d+1}{e p} \biggr)^{d+1}
\biggl( \prod_{i=1}^d \gamma_i \biggr)^{-1}.
$$
Now, by inverse implication of Lemma 6.21 in \cite{StCh08}, see also Exercise
6.8 in \cite{StCh08}, the bound on entropy number of the anisotropic Gaussian RBF kernel is
\begin{align*}
e_i ( \mathrm{id} : H_{\boldsymbol{\gamma}} \to \ell_{\infty}(X) )
\leq (3 a)^{\frac{1}{p}} i^{- \frac{1}{p}}
= (3 K)^{\frac{1}{p}}
\biggl( \frac{d+1}{e p} \biggr)^{\frac{d+1}{p}}
\biggl( \prod_{i=1}^d \gamma_i \biggr)^{-\frac{1}{p}}
i^{-\frac{1}{p}}.
\end{align*}
\end{proof}
\begin{proof}[Proof of Proposition \ref{pro::sample}]
First of all, note that, for all $t \in \mathbb{R}$ and $y \in [-M, M]$, the least squares loss satisfies $L(y, \wideparen{t}) \leq L(y, t)$, that is, it can be clipped at $M>0$ (see \cite{steinwart2009optimal}).
Note that the least squares loss is locally Lipschitz continuous in the sense of Definition 2.18 in \cite{StCh08} with the local Lipschitz constant $|L|_{M,1} = 4 M$.
Moreover, it is easy to verify that the least squares loss satisfies the supremum bound
\begin{align*}
L(y,t) = (y-t)^2 \leq 4 M^2
\end{align*}
and the variance bound
\begin{align*}
\mathbb{E}_{\mathrm{P}} \bigl( L \circ \wideparen{f} - L \circ f_{L,\mathrm{P}}^* \bigr)^2
\leq 16 M^2 \mathbb{E}_{\mathrm{P}} \bigl( L \circ \wideparen{f} - L \circ f_{L,\mathrm{P}}^* \bigr)
\end{align*}
for all $y \in Y$, $t \in [-M, M]$, see also Example 7.3 in \cite{StCh08}. According to the above Proposition \ref{EntropyNumberRKHS}, we also verify the condition of the entropy numbers. We denote here that $K(p)$ is defined by
\begin{align}
K(p) = \max \{ 43200 \cdot 2^{2p} M^2 C_1(p)^2,
360 \cdot 480^p M^2 C_2(p)^{1+p}, 8 M^2 \}.
\label{K_p}
\end{align}
Here, the constants $C_1(p)$ and $C_2(p)$ are derived
in the proof of Theorem 7.16 in \cite{StCh08}, that is
\begin{align*}
C_1(p) := \frac{2 \sqrt{\log 256} C_p^p}{(\sqrt{2} - 1) (1 - p) 2^{p/2}}
\,\,\,\,\,\,
\text{ and }
\,\,\,\,\,\,
C_2(p) := \biggl( \frac{8 \sqrt{\log 16} C_p^p}{(\sqrt{2} - 1) (1 - p) 4^p} \biggr)^{\frac{2}{1+p}},
\end{align*}
where
\begin{align*}
C_p := \frac{\sqrt{2} - 1}{\sqrt{2} - 2^{\frac{2p-1}{2p}}} \cdot \frac{1-p}{p},
\end{align*}
see Lemma 7.15 in \cite{StCh08}.
\end{proof}
\begin{proof}[Proof of Proposition \ref{ErrorEstimation}]
First of all, we show $f \in L_q(\mathrm{P}_X)$.
Because of the assumption $f \in L_q(\mathbb{R}^d) \cap L_{\infty}(\mathbb{R}^d)$,
we have $f \in L_u(\mathbb{R}^d)$ and thus $f \in L_u(X)$
for every $u \in [q, \infty]$ and $q \in [1, \infty]$. In addition,
\begin{align*}
\|f\|_{L_q(\mathrm{P}_X)}
\biggl( \int_{\mathbb{R}^d} |f(\boldsymbol{x})|^q
\, d\mathrm{P}_X(\boldsymbol{x}) \biggr)^{1/q}
= \biggl( \int_X |f(\boldsymbol{x})|^q
\, d\mathrm{P}_X(\boldsymbol{x}) \biggr)^{1/q}
\leq \|f\|_{L_{\infty}(X)} < \infty
\end{align*}
holds, i.e.~$f \in L_q(\mathrm{P}_X)$ for all $q \in [1, \infty)$. It remains to show
\begin{align*}
\|K * f - f\|_{L_q(\mathrm{P}_X)}^q
\leq \sum_{i=1}^d c_{r_i,q} \|g_i\|_{L_p(\mathbb{R})} \, \omega_{r_i,L_{q s}(\mathbb{R})}^q (f, \gamma_i/2) \ .
\end{align*}
To this end, we use the translation invariance of the Lebesgue measure and
$K(\boldsymbol{x}) = K(-\boldsymbol{x})$ ($\boldsymbol{x} \in \mathbb{R}^d$) to obtain,
for $\boldsymbol{r} = (r_1, \ldots, r_d) \in \mathbb{N}^d$,
$\boldsymbol{\gamma} = (\gamma_1, \ldots, \gamma_d) \in \mathbb{R}_+^d$,
and $\boldsymbol{x} = (x_1, \ldots, x_d) \in \mathbb{R}^d$,
\begin{align*}
K * f(\boldsymbol{x})
& = \int_{\mathbb{R}^d} K(\boldsymbol{x} - \boldsymbol{t}) f(\boldsymbol{t}) \, d\boldsymbol{t}
\\
& = \int_{\mathbb{R}} \cdots \int_{\mathbb{R}}
\prod_{i=1}^d K_i(x_i - t_i) f(t_1, \ldots, t_d) \, dt_d \cdots \, dt_1
\\
& = \int_{\mathbb{R}^{d-1}} \prod_{i=1}^{d-1}
K_i(x_i - t_i)
\biggl( \int_{\mathbb{R}}
K_d(x_d - t_d) f(\boldsymbol{t}) \, dt_d \biggr)
\, dt_{d-1} \cdots \, dt_1.
\end{align*}
A simple calculation show that
\begin{align*}
\int_{\mathbb{R}} K_d(x_d - t_d) f(\boldsymbol{t}) \, dt_d
& = \int_{\mathbb{R}} \sum_{j_d=1}^{r_d} {r_d \choose j_d} \frac{(-1)^{1-j_d}}{j_d \gamma_d} \left( \frac{2}{\pi} \right)^{1/2}
\exp \biggl( - \frac{2 |x_d-t_d|^2}{j_d^2 \gamma_d^2} \biggr)
f(\boldsymbol{t}) \, dt_d
\\
& = \sum_{j_d=1}^{r_d} {r_d \choose j_d} \frac{(-1)^{1-j_d}}{j_d \gamma_d}
\left( \frac{2}{\pi} \right)^{1/2}
\int_{\mathbb{R}} \exp \biggl( - \frac{2 |h_d|^2}{\gamma_d^2} \biggr)
f_d(x_d + j_d h_d|\boldsymbol{t}) j_d \, dh_d
\\
& = \int_{\mathbb{R}} \frac{1}{\gamma_d} \left( \frac{2}{\pi} \right)^{1/2}
\exp \biggl( - \frac{2 |h_d|^2}{\gamma_d^2} \biggr)
\biggl( \sum_{j_d=1}^{r_d} {r_d \choose j_d} (-1)^{1-j_d}
f_d(x_d + j_d h_d|\boldsymbol{t}) \biggr) \, dh_d,
\end{align*}
where the functions $f_i$'s, $1 \leq i \leq d$, are defined as in \eqref{UnivariateFunction}.
Recursively we obtain
\begin{align*}
K * f (\boldsymbol{x})
= \int_{\mathbb{R}^d} k(\boldsymbol{h})
\Sigma^{\boldsymbol{r}}
f(\boldsymbol{x} + \boldsymbol{j} \boldsymbol{h})
\, d\boldsymbol{h},
\end{align*}
where $k : \mathbb{R}^d \to \mathbb{R}$ is defined by
$k(\boldsymbol{h}) := \prod_{i=1}^d k_i(h_i)$ with
$k_i : \mathbb{R} \to \mathbb{R}$ defined by
\begin{align*}
k_i(h_i) := \frac{1}{\gamma_i} \left( \frac{2}{\pi} \right)^{1/2}
\exp \biggl( - \frac{2 |h_i|^2}{\gamma_i^2} \biggr),
\,\,\,\,\,\,\,\,\,\,\,
1 \leq i \leq d,
\end{align*}
$\Sigma^{\boldsymbol{r}} := \Sigma^{r_1} \cdots \Sigma^{r_d}$ is defined by
\begin{align*}
\Sigma^{r_i} := \sum_{j_i=1}^{r_i} {r_i \choose j_i} (-1)^{1-j_i},
\,\,\,\,\,\,\,\,\,\,\,
1 \leq i \leq d,
\end{align*}
and $\boldsymbol{j} = (j_1, \ldots, j_d)$. Now, for $1 \leq i \leq d-1$, let $\boldsymbol{u}^{(i)} = (u_1^{(i)}, \ldots, u_d^{(i)}) \in \mathbb{R}^d$ denote the vector with
\begin{align*}
u_{\ell}^{(i)} =
\begin{cases}
0 & \text{ for } \ell = 1, \ldots, i \\
1 & \text{ for } \ell = i+1, \ldots, d.
\end{cases}
\end{align*}
Then, for $0 \leq i \leq d$, setting
\begin{align*}
\boldsymbol{x}^{(i)} =
\begin{cases}
\boldsymbol{x} & \text{ for } i = 0
\\
\boldsymbol{u}^{(i)} \cdot \boldsymbol{x}
+ (1 - \boldsymbol{u}^{(i)}) \cdot (\boldsymbol{x} + \boldsymbol{j} \boldsymbol{h})
& \text{ for } i = 1, \ldots, d-1
\\
\boldsymbol{x} + \boldsymbol{j} \boldsymbol{h} & \text{ for } i = d,
\end{cases}
\end{align*}
we obtain
\begin{align*}
f(\boldsymbol{x} + \boldsymbol{j} \boldsymbol{h}) - f(\boldsymbol{x})
= \sum_{i=1}^d f(\boldsymbol{x}^{(i)}) - f(\boldsymbol{x}^{(i-1)})
= \sum_{i=1}^d f_i(x_i + j_i h_i | \boldsymbol{x}^{(i)})
- f_i(x_i | \boldsymbol{x}^{(i)}).
\end{align*}
With this and $\int_{\mathbb{R}^d} k(\boldsymbol{h}) \, d\boldsymbol{h} = 1$
we obtain, for $q > 1$,
\begin{align*}
\|K * f - f\|_{L_q(\mathrm{P}_X)}^q
& = \int_X |K * f(\boldsymbol{x}) - f(\boldsymbol{x})|^q \, d\mathrm{P}_X(\boldsymbol{x})
\\
& = \int_{\mathbb{R}^d} \biggl|
\int_{\mathbb{R}^d} k(\boldsymbol{h})
\Sigma^{\boldsymbol{r}}
f(\boldsymbol{x} + \boldsymbol{j} \boldsymbol{h})
\, d\boldsymbol{h} - f (\boldsymbol{x})
\biggr|^q \, d\mathrm{P}_X(\boldsymbol{x})
\\
& = \int_{\mathbb{R}^d} \biggl|
\int_{\mathbb{R}^d}
k(\boldsymbol{h}) \Bigl(
\Sigma^{\boldsymbol{r}}
f(\boldsymbol{x} + \boldsymbol{j} \boldsymbol{h})
- f (\boldsymbol{x}) \Bigr)
\, d\boldsymbol{h}
\biggr|^q \, d\mathrm{P}_X(\boldsymbol{x}).
\end{align*}
Next, H\"{o}lder's inequality and $\int_{\mathbb{R}^d} k(\boldsymbol{h}) \, d\boldsymbol{h} = 1$ yield, for $q > 1$,
\begin{align*}
\|K * f - f\|_{L_q(\mathrm{P}_X)}^q
& \leq \int_{\mathbb{R}^d} \biggl(
\biggl(
\int_{\mathbb{R}^d}
k(\boldsymbol{h}) \, d\boldsymbol{h}
\biggr)^{\frac{q-1}{q}}
\biggl(
\int_{\mathbb{R}^d} k(\boldsymbol{h})
\Bigl|
\Sigma^{\boldsymbol{r}}
f(\boldsymbol{x} + \boldsymbol{j} \boldsymbol{h})
- f (\boldsymbol{x}) \Bigr|^q
\, d\boldsymbol{h}
\biggr)^{\frac{1}{q}} \biggr)^q
\, d\mathrm{P}_X(\boldsymbol{x})
\\
& \leq \int_{\mathbb{R}^d}
\int_{\mathbb{R}^d} k(\boldsymbol{h})
\biggl|
\Sigma^{\boldsymbol{r}}
\sum_{i=1}^d f_i(x_i + j_i h_i | \boldsymbol{x}^{(i)})
- f_i(x_i | \boldsymbol{x}^{(i)}) \biggr|^q
\, d\boldsymbol{h}
\, d\mathrm{P}_X(\boldsymbol{x})
\\
& = \int_{\mathbb{R}^d}
\int_{\mathbb{R}^d} k(\boldsymbol{h})
\biggl|
\sum_{i=1}^d \Sigma^{\boldsymbol{r}} \Bigl( f_i(x_i + j_i h_i | \boldsymbol{x}^{(i)})
- f_i(x_i | \boldsymbol{x}^{(i)}) \Bigr) \biggr|^q
\, d\boldsymbol{h}
\, d\mathrm{P}_X(\boldsymbol{x})
\\
& = \int_{\mathbb{R}^d}
\int_{\mathbb{R}^d} k(\boldsymbol{h})
\biggl|
\sum_{i=1}^d \Sigma^{\boldsymbol{r} \setminus r_i} \Bigl( \Sigma^{r_i} \bigl( f_i(x_i + j_i h_i | \boldsymbol{x}^{(i)})
- f_i(x_i | \boldsymbol{x}^{(i)}) \bigr) \Bigr) \biggr|^q
\, d\boldsymbol{h}
\, d\mathrm{P}_X(\boldsymbol{x}),
\end{align*}
where
\begin{align*}
\Sigma^{\boldsymbol{r} \setminus r_i}
:= \Sigma^{r_1} \cdots \Sigma^{r_{i-1}} \Sigma^{r_{i+1}} \cdots \Sigma^{r_d}.
\end{align*}
Since, for $s \geq 0$ and an integer $i \geq 0$, the function $s \to s^i$ is convex, we have for every integer $i \geq 0$ the transformation
\begin{align*}
\biggl( \sum_{j=1}^d a_j \biggr)^i
= d^i \biggl( \frac{1}{d} \sum_{j=1}^d a_j \biggr)^i
\leq d^i \sum_{j=1}^d \frac{1}{d} a_j^i
= d^{i-1} \sum_{j=1}^d a_j^i.
\end{align*}
This leads to
\begin{align}
\|K * f - f\|_{L_q(\mathrm{P}_X)}^q
& \leq \sum_{i=1}^d \int_{\mathbb{R}^d}
\int_{\mathbb{R}^d} k(\boldsymbol{h})
\Bigl|
\Sigma^{\boldsymbol{r} \setminus r_i} \Bigl( \Sigma^{r_i} \bigl( f_i(x_i + j_i h_i | \boldsymbol{x}^{(i)})
- f_i(x_i | \boldsymbol{x}^{(i)}) \bigr) \Bigr) \Bigr|^q
\, d\boldsymbol{h}
\, d\mathrm{P}_X(\boldsymbol{x})
\nonumber\\
& = \sum_{i=1}^d \int_{\mathbb{R}^d} k(\boldsymbol{h})
\int_{\mathbb{R}^d}
\Bigl|
\Sigma^{\boldsymbol{r} \setminus r_i} \Bigl( \Sigma^{r_i} \bigl( f_i(x_i + j_i h_i | \boldsymbol{x}^{(i)})
- f_i(x_i | \boldsymbol{x}^{(i)}) \bigr) \Bigr) \Bigr|^q
\, d\mathrm{P}_X(\boldsymbol{x})
\, d\boldsymbol{h}
\nonumber\\
& \leq \sum_{i=1}^d \int_{\mathbb{R}^d} k(\boldsymbol{h})
\prod_{\ell=1,\atop \ell \neq i}^d (2^{r_{\ell}}-1)^q
\sup_{\boldsymbol{x} \in \mathbb{R}^d}
\|\triangle_{h_i}^{r_i}
\bigl( f_i(\cdot | \boldsymbol{x}), \cdot \bigr)\|_{L_q(\mathrm{P}_{X_i})}^q
\, d\boldsymbol{h}
\nonumber\\
& \leq \sum_{i=1}^d
\int_{\mathbb{R}^d} k(\boldsymbol{h})
\prod_{\ell=1,\atop \ell \neq i}^d (2^{r_{\ell}}-1)^q
\omega_{r_i,L_q(\mathrm{P}_{X_i})}^q(f_i, h_i)
\, d\boldsymbol{h}
\nonumber\\
& \leq \sum_{i=1}^d \prod_{i=1}^d (2^{r_i}-1)^q
\int_{\mathbb{R}}
k_i(h_i) \,
\omega_{r_i,L_q(\mathrm{P}_{X_i})}^q(f_i, h_i)
\, dh_i \ .
\label{Zwischenresultat}
\end{align}
Furthermore, similarly for $q = 1$, we can show that \eqref{Zwischenresultat}
holds. Consequently, \eqref{Zwischenresultat} holds for all $q \geq 1$.
Moreover, we have
\begin{align*}
\omega_{r_i, L_q(\mathrm{P}_{X_i})}^q(f_i, t_i)
& = \sup_{\boldsymbol{x} \in \mathbb{R}^d} \sup_{|h_i| \leq t_i}
\int_{\mathbb{R}} |\triangle_{h_i}^{r_i}(f_i, x_i)|^q \, d\mathrm{P}_{X_i}(x_i)
= \sup_{\boldsymbol{x} \in \mathbb{R}^d} \sup_{|h_i| \leq t_i}
\int_{\mathbb{R}} |\triangle_{h_i}^{r_i}(f_i, x_i)|^q g_i(x_i) \, d\mu(x_i)
\\
& = \sup_{\boldsymbol{x} \in \mathbb{R}^d} \sup_{|h_i| \leq t_i}
\int_{\mathbb{R}} \bigl| \triangle_{h_i}^{r_i}(f_i, x_i) (g_i(x_i))^{1/q} \bigr|^q \, d\mu(x_i)
= \sup_{\boldsymbol{x} \in \mathbb{R}^d} \sup_{|h_i| \leq t_i}
\bigl\| \triangle_{h_i}^{r_i}(f_i, \cdot) g_i^{1/q} \bigr\|_{L_q(\mathbb{R})}^q
\\
& \leq \sup_{\boldsymbol{x} \in \mathbb{R}^d} \sup_{|h_i| \leq t_i}
\Bigl( \|\triangle_{h_i}^{r_i}(f_i, \cdot)\|_{L_{qs}(\mathbb{R})} \bigl\|g_i^{1/q}\bigr\|_{L_{qp}(\mathbb{R})} \Bigr)^q
= \|g_i\|_{L_p(\mathbb{R})} \omega_{r_i,L_{qs}(\mathrm{P}_{X_i})}^q(f_i, t_i)
\\
& \leq \|g_i\|_{L_p(\mathbb{R})} \left( 1 + \frac{2 t_i}{\gamma_i} \right)^{r_iq} \omega_{r_i,L_{qs}(\mathbb{R})}^q \biggl(f_i,\frac{\gamma_i}{2}\biggr)
\end{align*}
where we used \eqref{EigMod_1}. Together with \eqref{Zwischenresultat} this implies
\begin{align}
\|K * f - f\|_{L_q(\mathrm{P}_X)}^q
& \leq \prod_{i=1}^d (2^{r_i} - 1)^q
\sum_{i=1}^d
\int_{\mathbb{R}}
k_i(h_i)
\|g_i\|_{L_p(\mathbb{R})} \left( 1 + \frac{2 h_i}{\gamma_i} \right)^{r_iq} \omega_{r_i,L_{qs}(\mathbb{R})}^q
\biggl(f_i,\frac{\gamma_i}{2}\biggr) \, dh_i
\nonumber\\
& = \prod_{i=1}^d (2^{r_i} - 1)^q
\sum_{i=1}^d
\|g_i\|_{L_p(\mathbb{R})} \omega_{r_i,L_{qs}(\mathbb{R})}^q
\biggl( f_i,\frac{\gamma_i}{2} \biggr)
\int_{\mathbb{R}}
k_i(h_i)
\left( 1 + \frac{2 h_i}{\gamma_i} \right)^{r_iq}
\, d h_i.
\label{MainEstimate}
\end{align}
Since we have
\begin{align*}
\left( 1 + \frac{2 h_i}{\gamma_i} \right)^{r_i q}
\leq \left( 1 + \frac{2 h_i}{\gamma_i} \right)^{\lceil r_i q \rceil}
\leq \sum_{j=0}^{\lceil r_i q \rceil} \binom{\lceil r_i q \rceil}{j} \left(\frac{2 h_i}{\gamma_i} \right)^j,
\end{align*}
therefore,
\begin{align} \label{inequality_1}
\left( 1 + \frac{2 h_i}{\gamma_i} \right)^{r_i q}
\leq \sum_{j=0}^{\lceil r_i q \rceil} \binom{\lceil r_i q \rceil}{j} \left(\frac{2}{\gamma_i} \right)^j
\int_{\mathbb{R}^d}{ h_i } ^j k_i(h_i) \, d h_i
\leq \sum_{j=0}^{\lceil r_i q \rceil} \binom{\lceil r_i q \rceil}{j} \left(\frac{2}{\gamma_i} \right)^j \bigg( \int_{\mathbb{R}}{ h_i } ^{2j} k_i(h_i) \, d h_i \bigg)^{\frac{1}{2}},
\end{align}
where the last inequality holds with the help of H\"{o}lder inequality and $\int_{\mathbb{R}} k_i(h_i)\, dh_i = 1$.
For a fixed $i \in \{ 1, \ldots, d \}$,
with the substitution $h_i = (\frac{\gamma_i^2}{2} u)^{1/2}$,
the functional equation $\Gamma(z+1) = z \, \Gamma(z)$ of the Gamma function $\Gamma$,
and $\Gamma ( \frac{1}{2} ) = \sqrt{\pi}$ we have
\begin{align} \label{inequality_2}
\int_{\mathbb{R}} h_i^{2j} k_i(h_i) \, d h_i
= \frac{1}{\gamma_i} \biggl( \frac{2}{\pi} \biggr)^{\frac{1}{2}}
\int_{\mathbb{R}} h_i^{2j} \exp \biggl( - \frac{2 h_i^2}{\gamma_i^2} \biggr) \, d h_i
= \frac{1}{\gamma_i} \biggl( \frac{2}{\pi} \biggr)^{\frac{1}{2}}
\biggl( \frac{1}{2} \frac{\gamma_i}{\sqrt{2}}
\biggl( \frac{\gamma_i^2}{2} \biggr)^j \sqrt{\pi}
\prod_{m=1}^j \biggl( m - \frac{1}{2} \biggr) \biggr).
\end{align}
Together, \eqref{inequality_1} and \eqref{inequality_2} lead to
\begin{align*}
\int_{\mathbb{R}} k_i (h_i) \left( 1 + \frac{2 h_i}{ \gamma_i } \right)^{r_i q}
& \leq \sum_{j=0}^{\lceil{ r_i q \rceil}} \binom{\lceil r_i q \rceil}{j} \left(\frac{2}{\gamma_i} \right)^j \left( \left( \frac{{\gamma_i}^2}{2} \right)^j \frac{1}{2} \prod_{m=1}^j (m-\frac{1}{2})\right)^{\frac{1}{2}}
\\
& = \sum_{j=0}^{\lceil{ r_i q \rceil}} \binom{\lceil r_i q \rceil}{j} 2^{\frac{j-1}{2}} \left( \prod_{m=1}^j (m - \frac{1}{2}) \right)^{\frac{1}{2}}
\triangleq c'_{r_i,\, q}.
\end{align*}
According to \eqref{MainEstimate}, we have
\begin{align*}
\|K * f - f\|_{L_q(\mathrm{P}_X)}^q
\leq \sum_{i=1}^d c_{r_i,\, q} \| g_i \|_{L_q(\mathbb{R})} \omega_{r_i,L_{qs}(\mathbb{R})}^q \left(f_i, \frac{\gamma_i}{2} \right)
\end{align*}
where $c_{r_i,\, q} := c'_{r_i,\, q} \prod_{i=1}^d ( 2^{r_i} - 1 )^q$.
\end{proof}
\begin{proof}[Proof of Proposition \ref{ConvolutionInRKHS}]
Recall that, for
$\boldsymbol{r} = (r_1, \ldots, r_d) \in \mathbb{N}^d$,
$\boldsymbol{\gamma} = (\gamma_1, \ldots, \gamma_d) \in \mathbb{R}_+^d$,
and $\boldsymbol{x} = (x_1, \ldots, x_d) \in \mathbb{R}^d$,
the function $K : \mathbb{R}^d \to \mathbb{R}$ is defined by
\begin{align*}
K(\boldsymbol{x}) := \prod_{i=1}^d K_i(x_i)
\end{align*}
with functions $K_i : \mathbb{R} \to \mathbb{R}$ defined by
\begin{align*}
K_i(x_i) := \left( \frac{2}{\pi} \right)^{1/2}
\sum_{j_i=1}^{r_i} {r_i \choose j_i} \frac{(-1)^{1-j_i}}{j_i \gamma_i}
\exp \biggl( - \frac{2 |x_i|^2}{j_i^2 \gamma_i^2} \biggr),
\,\,\,\,\,\,\,\,
1 \leq i \leq d.
\end{align*}
We define, for all $1 \leq i \leq d$,
\begin{align}\label{hat_K_j_i}
\widehat{K}_{j_i}(x_i)
:= \left( \frac{2}{\pi} \right)^{1/4}
\left( \frac{1}{j_i \gamma_i} \right)^{1/2}
\exp \biggl( - \frac{2 |x_i|^2}{j_i^2 \gamma_i^2} \biggr),
\,\,\,\,\,\,\,\,
x_i \in X_i.
\end{align}
By Proposition 4.46 in \cite{StCh08}, we obtain
\begin{align*}
\widehat{K}_{j_i} * f_i(\cdot | \boldsymbol{x}) \in H_{j_i \gamma_i}(X_i) \subset H_{\gamma_i}(X_i)
\end{align*}
for all $j_i \in \mathbb{N}$, where the functions $f_i(\cdot | \boldsymbol{x})$'s, $1 \leq i \leq d$, are defined as in \eqref{UnivariateFunction}.
Due to the properties of the convolution, we finally obtain
\begin{align*}
K_i * f_i(\cdot | \boldsymbol{x})
= \sum_{j_i=1}^{r_i} {r_i \choose j_i} (-1)^{1-j_i}
\left( \frac{2}{\pi} \right)^{1/4}
\left( \frac{1}{j_i \gamma_i} \right)^{1/2}
(\widehat{K}_{j_i} * f_i(\cdot | \boldsymbol{x})) \in H_{\gamma_i}(X_i) \ .
\end{align*}
Now, recall the RKHS norm \eqref{RKHS_Norm} which is defined as
\begin{align*}
\|f\|_{H_{\boldsymbol{\gamma}}}
:= \biggl( \frac{2}{\pi} \biggr)^{d/2}
\prod_{i=1}^d \gamma_i^{-1}
\biggl( \int_{\mathbb{R}^d} |f(\boldsymbol{x})|^2
\exp \biggl( - \sum_{i=1}^d \frac{4 x_i^2}{\gamma_i^2} \biggr)
\, d\boldsymbol{x} \biggr)^{1/2},
\end{align*}
an elementary caculation shows that the following equation holds
\begin{align*}
\|K * f\|_{H_{\boldsymbol{\gamma}}}^2
= \biggl\| \biggl( \prod_{i=1}^d K_i \biggr) * f \biggr\|_{H_{\gamma_1} \otimes \ldots \otimes H_{\gamma_d}}^2
& = \biggl\| \biggl( \prod_{i=1}^{d-1} K_i \biggr) * (K_d * f_d(\cdot | \boldsymbol{x})) \biggr\|_{H_{\gamma_1} \otimes \ldots \otimes H_{\gamma_d}}^2
\\
& = \biggl\| \biggl( \prod_{i=1}^{d-1} K_i \biggr) * \big\| K_d * f_d (\cdot | \boldsymbol{x}) \big\|_{H_{\gamma_d}} \biggr\|_{H_{\gamma_1} \otimes \ldots \otimes H_{\gamma_{d-1}}}^2.
\end{align*}
Moreover, the definition of the RKHS norm \eqref{RKHS_Norm} also implies
\begin{align*}
\|K_d * f_d(\cdot | \boldsymbol{x})\|_{H_{\gamma_d}}
& \leq \sum_{j_d=1}^{r_d} j_d^{1/2}
\biggl\| {r_d \choose j_d} (-1)^{1-j_d}
\biggl( \frac{2}{j_d^2 \gamma_d^2 \pi} \biggr)^{1/2}
\exp \biggl( - \frac{2 |\cdot|^2}{j_d^2 \gamma_d^2} \biggr) * f_d(\cdot | \boldsymbol{x}) \biggr\|_{H_{j_d \gamma_d}}
\\
& \leq \sum_{j_d=1}^{r_d} j_d^{1/2} {r_d \choose j_d}
\biggl( \frac{1}{j_d \gamma_d \sqrt{\pi}} \biggr)^{1/2} \|f_d(\cdot | \boldsymbol{x})\|_{L_2(\mathbb{R})}
\\
& = \biggl( \frac{1}{\gamma_d \sqrt{\pi}} \biggr)^{1/2} (2^{r_d} - 1)
\|f_d(\cdot | \boldsymbol{x})\|_{L_2(\mathbb{R})} \ ,
\end{align*}
where we used Proposition 4.46 in \cite{StCh08} in the first two steps.
Recursively we obtain
\begin{align*}
\|K * f\|_{H_{\boldsymbol{\gamma}}}
& = \biggl\| \biggl( \prod_{i=1}^{d-1} K_i \biggr) * \big\| K_d * f_d (\cdot | \boldsymbol{x}) \big\|_{H_{\gamma_d}} \biggr\|_{H_{\gamma_1} \otimes \ldots \otimes H_{\gamma_{d-1}}}
\\
& \leq
\biggl( \frac{1}{\gamma_d \sqrt{\pi}} \biggr)^{1/2} (2^{r_d} - 1)
\biggl\| \biggl( \prod_{i=1}^{d-1} K_i \biggr) *
\|f_d(\cdot | \boldsymbol{x})\|_{L_2(\mathbb{R})}
\biggr\|_{H_{\gamma_1} \otimes \ldots \otimes H_{\gamma_{d-1}}}
\\
& \leq \biggl( \prod_{i=1}^d \gamma_i \biggr)^{-1/2} \pi^{-d/4}
\prod_{i=1}^d (2^{r_i} - 1) \|f\|_{L_2(\mathbb{R}^d)} \ .
\end{align*}
Finally, for all $\boldsymbol{x} \in X$ and $g \in L_{\infty}(\mathbb{R}^d)$, H\"{o}lder's inequality implies
\begin{align*}
|K * f(\boldsymbol{x})|
& \leq \sup_{\hat{\boldsymbol{x}} \in X} |K * f(\hat{\boldsymbol{x}})|
\leq \sup_{\hat{\boldsymbol{x}} \in X}
\int_{\mathbb{R}^d} |K(\hat{\boldsymbol{x}} - \boldsymbol{t}) f(\boldsymbol{t})| \, d\boldsymbol{t}
\\
& \leq \|f\|_{L_{\infty}(\mathbb{R}^d)}
\prod_{i=1}^d
\sum_{j_i=1}^{r_i} {r_i \choose j_i}
\sup_{\hat{x}_i \in X_i} \int_{\mathbb{R}} \left( \frac{2}{j_i^2 \gamma_i^2 \pi} \right)^{1/2}
\exp \biggl( - \frac{2 |\hat{x}_i - t_i|^2}{(j_i \gamma_i)^2} \biggr) \, dt_i
= \prod_{i=1}^d (2^{r_i} - 1) \|f\|_{L_{\infty}(\mathbb{R}^d)} \ .
\end{align*}
\end{proof}
\begin{proof}[Proof of Theorem \ref{ApproximationError}]
First, the assumption $f^*_{L,\mathrm{P}} \in L_2(\mathbb{R}^d) \cap L_{\infty}(\mathbb{R}^d)$ and Proposition \ref{ConvolutionInRKHS} immediately yield
\begin{align*}
f_0 = K * f_{L,\mathrm{P}}^* \in H_{\boldsymbol{\gamma}}.
\end{align*}
Furthermore, because of $f^*_{L,\mathrm{P}} \in L_{\infty}(\mathbb{R}^d)$
and Proposition \ref{ConvolutionInRKHS}, the estimate
\begin{align*}
|K * f_{L,\mathrm{P}}^*(\boldsymbol{x})|
\leq \prod_{i=1}^d (2^{r_i} - 1) \|f_{L,\mathrm{P}}^*\|_{L_{\infty}(\mathbb{R}^d)}
\end{align*}
holds for all $\boldsymbol{x} \in X$.
This implies, for all $(x, y) \in X \times Y$,
\begin{align*}
L\circ f_0 =L(y, K * f_{L,\mathrm{P}}^*(\boldsymbol{x}))
& = (y - K * f_{L,\mathrm{P}}^*(\boldsymbol{x}))^2
= y^2 - 2 y (K * f_{L,\mathrm{P}}^*(\boldsymbol{x}))
+ (K * f_{L,\mathrm{P}}^*(\boldsymbol{x}))^2
\\
& \leq M^2 + 2 M \prod_{i=1}^d (2^{r_i} - 1)
\|f_{L,\mathrm{P}}^*\|_{L_{\infty} (\mathbb{R}^d)}
+ \prod_{i=1}^d (2^{r_i} - 1)^2
\|f_{L,\mathrm{P}}^*\|_{L_{\infty} (\mathbb{R}^d)}^2
\\
& \leq \prod_{i=1}^d 4^{r_i}
\max \{ M, \|f_{L,\mathrm{P}}^*\|_{L_{\infty} (\mathbb{R}^d)} \}^2
\end{align*}
and
\begin{align*}
\|L \circ f_0\|_{\infty}
= \sup_{(x, y) \in X \times Y} |L(y, f_0(\boldsymbol{x}))|
= \sup_{(x, y) \in X \times Y} |L(y, K * f_{L,\mathrm{P}}^*(\boldsymbol{x}))|
\leq \prod_{i=1}^d 4^{r_i}
\max \{ M, \|f_{L,\mathrm{P}}^*\|_{L_{\infty} (\mathbb{R}^d)} \}^2 =: B_0.
\end{align*}
Furthermore, \eqref{ExcessRiskLS} and Proposition \ref{ErrorEstimation} yield
\begin{align*}
\mathcal{R}_{L,\mathrm{P}}(f_0) - \mathcal{R}_{L,\mathrm{P}}^*
& = \mathcal{R}_{L,\mathrm{P}}(K * f_{L,\mathrm{P}}^*)
- \mathcal{R}_{L,\mathrm{P}}^*
= \|K * f_{L,\mathrm{P}}^* - f^*_{L,\mathrm{P}}\|_{L_2(\mathrm{P}_X)}^2
\\
& \leq \sum_{i=1}^d c_{r_i,2} \|g_i\|_{L_q(\mathbb{R})}
\omega_{r_i,L_{2s}(\mathbb{R})}^2
(f_{L,\mathrm{P},i}^*, \gamma_i/2)
\leq \sum_{i=1}^d c_{r_i,2} \|g_i\|_{L_q(\mathbb{R})} \, c_i^2 \gamma_i^{2\alpha_i} \ ,
\end{align*}
where we used
$\omega_{r_i,L_{2s}(\mathbb{R})} (f_{L,\mathrm{P},i}^*, \gamma_i/2) \leq c_i \gamma_i^{\alpha_i}$
for $\boldsymbol{\gamma} = (\gamma_1, \ldots, \gamma_d) \in \mathbb{R}_+^d$,
$\boldsymbol{\alpha} = (\alpha_1, \ldots, \alpha_d) \in [1, \infty)^d$,
$\boldsymbol{r} = (r_1, \ldots, r_d) \in \mathbb{N}^d$,
$r_i = \lfloor \alpha_i \rfloor + 1$ and constants $c_i > 0$, $1 \leq i \leq d$, in the last step, which in turn immediately results from the assumption $f_{L,\mathrm{P}}^* \in B_{2s,\infty}^{\boldsymbol{\alpha}}(\mathbb{R}^d)$. By Theorem \ref{ConvolutionInRKHS}
we know
\begin{align*}
\|f_0\|_{H_{\boldsymbol{\gamma}}}
= \|K * f_{L,\mathrm{P}}^*\|_{H_{\boldsymbol{\gamma}}}
\leq \pi^{-\frac{d}{4}}
\prod_{i=1}^d (2^{r_i} - 1) \|f_{L,\mathrm{P}}^*\|_{L_2(\mathbb{R}^d)}
\prod_{i=1}^d \gamma_i^{-\frac{1}{2}} \ .
\end{align*}
Since we assumed $p, s \geq 1$ with $\frac{1}{p} + \frac{1}{s} = 1$, i.e.~the marginal
densities $g_i$ of $\mathrm{P}_{X_i}$ is contained in $L_p(X_i)$,
the above discussion
together with \eqref{ExcessRiskLS}
yields
\begin{align}
\min_{f \in H_{\boldsymbol{\gamma}}} \lambda \|f\|_{H_{\boldsymbol{\gamma}}}^2 + \mathcal{R}_{L,\mathrm{P}}(f) - \mathcal{R}_{L,\mathrm{P}}^*
& \leq \lambda \|f_0\|_{H_{\boldsymbol{\gamma}}}^2 + \mathcal{R}_{L,\mathrm{P}}(f_0) - \mathcal{R}_{L,\mathrm{P}}^*
\nonumber\\
& = \lambda \|K * f_{L,\mathrm{P}}^*\|_{H_{\boldsymbol{\gamma}}}^2 + \mathcal{R}_{L,\mathrm{P}}(K * f_{L,\mathrm{P}}^*) - \mathcal{R}_{L,\mathrm{P}}^* \nonumber\\
& \leq \pi^{-\frac{d}{2}} \prod_{i=1}^d (2^{r_i} - 1)^2
\|f_{L,\mathrm{P}}^*\|_{L_2(\mathbb{R}^d)}^2
\lambda \prod_{i=1}^d \gamma_i^{-1}
+ \|K * f_{L,\mathrm{P}}^* - f_{L,\mathrm{P}}^*\|_{L_2(\mathrm{P}_X)}^2
\nonumber\\
& \leq \pi^{-\frac{d}{2}} \prod_{i=1}^d (2^{r_i} - 1)^2
\|f_{L,\mathrm{P}}^*\|_{L_2(\mathbb{R}^d)}^2
\lambda \prod_{i=1}^d \gamma_i^{-1}
+ \sum_{i=1}^d c_{r_i,2} \|g_i\|_{L_p(\mathbb{R})} \, \omega_{r_i,L_{2 s}(\mathbb{R})}^2 ( f_{L,\mathrm{P},i}^*, \gamma_i/2 ) \ .
\label{ApproxErrorEstim_1}
\end{align}
Now, to further bound \eqref{ApproxErrorEstim_1},
we have to estimate the modulus of smoothness.
To this end, recall that
$f_{L,\mathrm{P}}^* \in B_{2s,\infty}^{\boldsymbol{\alpha}}(\mathbb{R}^d)$.
By the definition of $\mathrm{Lip}^*(\alpha_i,L_{2s}(\mathbb{R}))
= B_{2s,\infty}^{\alpha_i}(\mathbb{R})$,
we have for all $1 \leq i \leq d$,
\begin{align*}
\omega_{r_i,L_{2s}(\mathbb{R})} (f_{L,\mathrm{P},i}^*, t_i) \leq c_{s,i} t_i^{\alpha_i} \ ,
\,\,\,\,\,\,\,\,
t_i > 0 \ ,
\end{align*}
where $r_i := \lfloor \alpha_i \rfloor + 1$ and $c_{s,i} > 0$ are suitable constants. Using this inequality the upper
bound of the approximation error only depends on the kernel width $\boldsymbol{\gamma}$, the
regularization parameter $\lambda$, the smoothness parameter $\boldsymbol{\alpha}$ of the target function
and some positive constants, i.e.
\begin{align*}
\min_{f \in H_{\boldsymbol{\gamma}}} \lambda \|f\|_{H_{\boldsymbol{\gamma}}}^2 + \mathcal{R}_{L,\mathrm{P}}(f) - \mathcal{R}_{L,\mathrm{P}}^*
\leq C_1 \lambda \prod_{i=1}^d \gamma_i^{-1}
+ C_s \sum_{i=1}^d \gamma_i^{2 \alpha_i}.
\end{align*}
\end{proof}
In order to prove the main theorem given in Theorem \ref{LearningRates},
we need the following lemma which bounds the constant $K(p)$ defined in \eqref{K_p}.
\begin{lemma} \label{BoundKp}
For the constant $K(p)$ defined in \eqref{K_p}, there holds
\begin{align*}
\max_{p \in (0, \frac{1}{2}]} K(p)
\leq 3 \cdot 10^8 e^2 M^2.
\end{align*}
\end{lemma}
\begin{proof}[Proof of Lemma \ref{BoundKp}]
Here we are interested to bound $K(p)$ for $p \in (0, \frac{1}{2}]$.
For this, we first need to bound the constants $C_1(p)$ and $C_2(p)$.
We start with $C_p$ and obtain the following bound for $p \in (0, \frac{1}{2}]$,
\begin{align*}
C_p^p = \biggl( \frac{\sqrt{2} - 1}{\sqrt{2} - 2^{\frac{2p-1}{2p}}} \biggr)^p
\biggl( \frac{1-p}{p} \biggr)^p
\leq e \max_{p \in (0, \frac{1}{2}]}
\biggl( \frac{\sqrt{2} - 1}{\sqrt{2} - 2^{\frac{2p-1}{2p}}} \biggr)^p
= e,
\end{align*}
where we used $(\frac{1-p}{p})^p = (\frac{1}{p}-1)^p \leq e$
for all $p \in (0, \frac{1}{2}]$, and Lemma 14 established in \cite{farooq2017svm}.
Now the bound for $C_1(p)$ is the following:
\begin{align*}
C_1(p)
\leq \max_{p \in (0, \frac{1}{2}]} \frac{2 \sqrt{\log 256} C_p^p}{(\sqrt{2} - 1) (1 - p) 2^{p/2}}
\leq \frac{4 e \sqrt{\log 256}}{\sqrt{2} - 1} \max_{p \in (0, \frac{1}{2}]} \sqrt{1}{2^{p/2}}
\leq 46 e.
\end{align*}
Analogously, the bound for the constant $C_2(p)$ is:
\begin{align*}
C_2(p)^{1+p}
\leq \max_{p \in (0, \frac{1}{2}]} \biggl( \frac{8 \sqrt{\log 16} C_p^p}{(\sqrt{2} - 1) (1 - p) 4^p} \biggr)^2
\leq \frac{256 e^2 \log 16}{(\sqrt{2} - 1)^2} \max_{p \in (0, \frac{1}{2}]} \sqrt{1}{4^{2p}}
\leq 1035 e^2.
\end{align*}
By plugging $C_1(p)$ and $C_2(p)$ into \eqref{K_p}, we thus obtain
\begin{align*}
K \leq \max \{ 2 \cdot 10^8 e M, 3 \cdot 10^8 e^2 M^2, 8 M^2 \}
\leq 3 \cdot 10^8 e^2 M^2.
\end{align*}
\end{proof}
\begin{proof}[Proof of Theorem \ref{LearningRates}]
By plugging the estimate \eqref{ApproximationErrorEstimation} from Theorem \ref{ApproximationError},
$a = (3 K)^{\frac{1}{2p}} \left( \frac{d+1}{e p} \right)^{\frac{d+1}{2p}} \left( \prod_{i=1}^d \gamma_i\right)^{-\frac{1}{2p}}$ from Theorem
\ref{EntropyNumberRKHS}, and the bound for $K(p)$ on $(0, \frac{1}{2}]$ from Lemma \ref{BoundKp},
into \eqref{OracleInequality}, we obtain
\begin{align}
\lambda \|f_{\mathrm{D},\lambda,\boldsymbol{\gamma}}\|_{H_{\boldsymbol{\gamma}}}^2
+ \mathcal{R}_{L,\mathrm{P}}(\wideparen{f}_{\mathrm{D},\lambda,\boldsymbol{\gamma}})
- \mathcal{R}^{*}_{L,\mathrm{P}}
& \leq 9 C_1 \lambda \prod_{i=1}^d \gamma_i^{-1}
+ 9 C_s \sum_{i=1}^d \gamma_i^{2 \alpha_i}
+ 3 C_2 \frac{\prod_{i=1}^d \gamma_i^{-1}}{p^{d+1} \lambda^p n}
+ C_3 \frac{\varrho}{n}
\nonumber\\
& \leq \frac{C M^2}{p^{d+1}}
\biggl( \lambda \prod_{i=1}^d \gamma_i^{-1}
+ \sum_{i=1}^d \gamma_i^{2 \alpha_i}
+ \frac{\prod_{i=1}^d \gamma_i^{-1}}{\lambda^p n}
+ \frac{\varrho}{n} \biggr),
\label{OracleInbetween}
\end{align}
where $C_1$ and $C_s$ are from Proposition \ref{ApproximationError},
$C_2 := 9 \cdot 10^8 e^2 M^2 K ( \frac{d+1}{e} )^{d+1}$ is a constant only depending on $d$,
$C_3 := ( 3456 M^2 + 15 \cdot \prod_{i=1}^d 4^{r_i}
\max \{ M, \|f_{L,\mathrm{P}}^*\|_{L_{\infty} (\mathbb{R}^d)} \}^2 ) (1 + \log 3)$,
and
$C$ is a constant independent of $p$, $\lambda$, $\gamma$, $n$ and $\varrho$.
Setting
\begin{align*}
g(\gamma_1, \ldots, \gamma_d)
:= \lambda \prod_{i=1}^d \gamma_i^{-1}
+ \sum_{i=1}^d \gamma_i^{2 \alpha_i}
+ \biggl( \prod_{i=1}^d \gamma_i \biggr)^{-1}
\lambda^{-p} n^{- 1},
\end{align*}
then $g$ attains its minimum with respect to $\boldsymbol{\gamma} = (\gamma_1, \ldots, \gamma_d)$ if for all $1 \leq j \leq d$,
\begin{align*}
\frac{\partial g}{\gamma_j}
= - \gamma_j^{-1} \lambda \prod_{i=1}^d \gamma_i^{-1}
+ 2 \alpha_j \gamma_j^{-1} \gamma_j^{2 \alpha_i}
- \gamma_j^{-1}
\biggl( \prod_{i=1}^d \gamma_i \biggr)^{-1}
\lambda^{-p} n^{- 1} = 0,
\end{align*}
which implies for all $1 \leq j \leq d$, there holds
\begin{align*}
2 \alpha_j \gamma_j^{2 \alpha_j}
= \lambda \prod_{i=1}^d \gamma_i^{-1} +
\biggl( \prod_{i=1}^d \gamma_i \biggr)^{-1}
\lambda^{-p} n^{-1}.
\end{align*}
Now, let $\gamma_0$ satisfying
\begin{align*}
2 \alpha_i \gamma_i^{2 \alpha_i}
= \gamma_0^{2 \alpha_0},
\,\,\,\,\,\,\,\,\,\,\,\,
i = 1, \ldots, d,
\end{align*}
where $\alpha_0 := d (\sum_{i=1}^d \frac{1}{\alpha_i})^{-1}$ is the mean smoothness defined as in
\eqref{MeanSmoothness}. Then we have
\begin{align*}
\prod_{i=1}^d \gamma_i
= \prod_{i=1}^d \biggl( \frac{1}{2 \alpha_i} \biggr)^{\frac{1}{2 \alpha_i}}
\gamma_0^{\alpha_0 \sum_{i=1}^d \frac{1}{\alpha_i}}
= \prod_{i=1}^d \biggl( \frac{1}{2 \alpha_i} \biggr)^{\frac{1}{2 \alpha_i}}
\gamma_0^d.
\end{align*}
Consequently, \eqref{OracleInbetween} becomes
\begin{align*}
C M^2 p^{-(d+1)} \biggl(
( \lambda \gamma_0^{-d}
+ \gamma_0^{2 \alpha_0}
+ \gamma_0^{-d}
\lambda^{-p}
n^{-1} )
+ \varrho n^{-1}
\biggr).
\end{align*}
Now, optimizing over $\varepsilon$ together with some standard techniques, see
\cite[Lemmas A.1.6 and A.1.7]{StCh08}, we then see that
if we assume $p := 1/\log n$,
the LS-SVM using anisotropic Gaussian RKHS $H_{\boldsymbol{\gamma}}$ and
\begin{align*}
\lambda_n = n^{- 1}
\qquad
\text{ and }
\qquad
\gamma_{i,n} = n^{- \frac{\alpha_0}{\alpha_i(2 \alpha_0 + d)}},
\,
i = 1, \ldots, d,
\end{align*}
learns with rate
\begin{align*}
C M^2 p^{-(d+1)} \biggl(
( \lambda \gamma_0^{-d}
+ \gamma_0^{2 \alpha_0}
+ \gamma_0^{-d}
\lambda^{-p}
n^{-1} )
+ \varrho n^{-1}
\biggr)
\leq C (\log n)^{d+1} \biggl(
n^{- \frac{2 \alpha_0}{2 \alpha_0 + d}} + \varrho n^{-1}
\biggr)
\leq C (\log n)^{d+1}
n^{- \frac{2 \alpha_0}{2 \alpha_0 + d}},
\end{align*}
where the positive constant $C$
is independent of $p$.
\end{proof}
\section{Discussion and Conclusions} \label{sec::DisCon}
In this paper, we investigate the nonparametric regression problem using SVMs with anisotropic Gaussian RBF kernels.
To be specific, by assuming that the target functions are contained in certain anisotropic Besov spaces, we establish the almost optimal learning rates, that is, optimal up to some logarithmic factor, presented by the effective smoothness whose reciprocal is the mean of the reciprocals of smoothness of all dimensions.
With the effective smoothness taken into consideration, our almost optimal learning rates are faster than those obtained with the underlying RKHSs being certain anisotropic Sobolev spaces. Moreover, if we assume that the target function depends only on fewer dimensions, which is often the case in practice, even faster learning rates can be achieved.
\section*{Appendix.}
The whole Appendix is dedicated to the proof of the Imbedding Theorem for Anisotropic Besov Spaces. To this end, let us begin with the definition of the anisotropic Sobolev space, see also \cite{schmeisser1976anisotropic}.
\begin{definition}[Anisotropic Sobolev Space]
Let $\boldsymbol{m} = (m_1, \cdots, m_d)$,
$\boldsymbol{\alpha} = (\alpha_1, \cdots, \alpha_d) \in \mathbb{N}^d$ be vectors of natural numbers. The anisotropic Sobolev space can be defined as
\begin{align}
W^{\boldsymbol{m}}_p :=
\biggl\{ f \ \bigg| \ D^{\boldsymbol{\alpha}} f \in L_p(\mathbb{R}^d), \,
\sum_{j=1}^d \frac{\alpha_j}{m_j} \leq 1 \biggr\}
\end{align}
with the corresponding norm
\begin{align*}
\|f\|_{W^{\boldsymbol{m}, p}} := \sum_{\Sigma \, \alpha_j / m_j \leq 1}
\|D^{\boldsymbol{\alpha}} f\|_{L_p}.
\end{align*}
\end{definition}
In the following, for $\boldsymbol{m} = (m_1, \cdots, m_d) \in \mathbb{N}^d$,
we denote $|\boldsymbol{m}| := \sum_{i =1}^{d}m_i$ and set $\mathrm{dom}\, \boldsymbol{m} := \{\boldsymbol{\alpha}\in \mathbb{N}^d : \sum \alpha_i / m_i \leq 1\}$. Moreover, we define the boundary and interior of $\mathrm{dom}\, \boldsymbol{m}$ as $$
\partial \boldsymbol{m} = \biggl\{\boldsymbol{\alpha}\in \mathbb{N}^d : \sum \alpha_i / m_i \leq 1 \;and\; \exists\, i \leq d\ s.t. \; (\alpha_i + 1) / m_i + \sum_{j \neq i} \alpha_j / m_j > 1 \biggr\}
$$
and $\mathrm{int}\, \boldsymbol{m} := \mathrm{dom}\, \boldsymbol{m}/\partial \boldsymbol{m}$, respectively.
With the above preparations, we now present
the anisotropic Sobolev Imbedding Theorem which is an anisotropic extension of the isotropic Sobolev Imbedding Theorem established in
\cite[Theorem 4.12]{adams2003sobolev}.
\begin{theorem}[The Anisotropic Sobolev Imbedding Theorem] \label{ASIT}
Let $\Omega$ be a domain in $\mathbb{R}^d$ and, for $1 \leq k \leq d$,
let $\Omega_k$ be the intersection of $\Omega$ with a $k$-dimensional plane in $\mathbb{R}^d$.
Let $j \geq 0$ and $m \geq 1$ be integers and let $1 \leq p < \infty$.
Suppose $\Omega$ satisfies the cone condition.
\textbf{Case A} If either $\underline{\boldsymbol{m}} p > d$, then
\begin{align} \label{01}
W^{\boldsymbol{m}}_p(\Omega) \to C_B^0(\Omega).
\end{align}
Moreover, if $1 \leq k \leq d$, then
\begin{align} \label{2}
W^{\boldsymbol{m}}_p(\Omega) \to L^{q}(\Omega_k)
\qquad \text{ for }
p \leq q \leq \infty,
\end{align}
and, in particular,
\begin{align*}
W^{\boldsymbol{m}}_p(\Omega) \to L^q(\Omega)
\qquad \text{ for }
p \leq q \leq \infty.
\end{align*}
\textbf{Case B} If $1 \leq k \leq d$ and $\overline{\boldsymbol{m}} p \geq d$ and $\underline{\boldsymbol{m}} p \leq d$, then
\begin{align}
W^{\boldsymbol{m}}_p(\Omega) \to L^{q}(\Omega_k),
\qquad \text{ for }
p \leq q < \infty,
\end{align}
and, in particular,
\begin{align*}
W^{\boldsymbol{m}}_p(\Omega) \to L^q(\Omega),
\qquad \text{ for }
p \leq q < \infty.
\end{align*}
\textbf{Case C} If $\overline{\boldsymbol{m}} p < d$ and $d - \underline{\boldsymbol{m} }p < k \leq d$, then
\begin{align}
W^{\boldsymbol{m}}_p(\Omega) \to L^{q}(\Omega_k),
\qquad \text{ for }
p \leq q \leq p^* = k p /(d - \underline{\boldsymbol{m}} p).
\end{align}
In particular,
\begin{align}
W^{\boldsymbol{m}}_p(\Omega) \to L^q(\Omega),
\qquad \text{ for }
p \leq q \leq p^* = d p /(d - \underline{\boldsymbol{m}} p).
\end{align}
The imbedding constants for the imbeddings above depend only on $d$, $\boldsymbol{m}$, $p$, $q$, $j$, $k$, and the dimensions of the cone $C$ in the cone condition.
\end{theorem}
Note that we need the following three Lemmas \ref{ALE}, \ref{lemma3} and \ref{lemma4} to prove Theorem \ref{ASIT}, and they are presented here.
\begin{lemma}[A Local Estimate] \label{ALE}
Let domain $\Omega \subseteq \mathbb{R}^d$ satisfy the cone condition.
There exists a constant $K$ depending on $m$, $d$, and the dimensions $\rho$ and $\kappa$ of the cone $C$ specified in the cone condition for $\Omega$ such that
for every $u \in C^{\infty}(\Omega)$, every $x \in \Omega$, and every $r$ satisfying
$0 < r \leq \rho$, we have
\begin{align} \label{localEs}
|u(x)|
\leq K \biggl( \sum_{\boldsymbol{\alpha} \in \mathrm{int}\, \boldsymbol{m}} r^{|\boldsymbol{\alpha}|-d} \int_{C_{x,r}} |D^{\boldsymbol{\alpha}} u(y)| \, dy
+ \sum_{\boldsymbol{\alpha} \in \partial\boldsymbol{m}} \int_{C_{x,r}} |D^{\boldsymbol{\alpha}}u(y)| |x - y|^{|\boldsymbol{\alpha}|-d} \, dy \biggr) \ ,
\end{align}
where $C_{x,r} = \{ y \in C_x : |x - y|\leq r \}$.
Here $C_x \subseteq \Omega$ is a cone congruent to $C$ having vertex at $x$.
\end{lemma}
\begin{proof}[Proof of Lemma \ref{ALE}]
We apply Taylor's formula with integral remainder,
\begin{align*}
f(1) = \sum_{\boldsymbol{\alpha} \in \mathrm{int}\, \boldsymbol{m}} \frac{1}{|\boldsymbol{\alpha}|!} f^{(\boldsymbol{\alpha})}(0)
+ \sum_{\boldsymbol{\alpha} \in \partial \boldsymbol{m}}\frac{1}{(|\boldsymbol{\alpha}|-1)!} \int_0^1 (1 - t)^{|\boldsymbol{\alpha}|-1} f^{(\alpha)}(t) \, dt
\end{align*}
to the function $f(t) = u(t x + (1-t) y)$,
where $x \in \Omega$ and $y \in C_{x,r}$. We note that
\begin{align*}
f^{(\boldsymbol{\alpha})}(t) = \frac{|\boldsymbol{\alpha}|!}{\boldsymbol{\alpha}!}D^{\boldsymbol{\alpha} }u(t x + (1-t) y) (x - y)^{\boldsymbol{\alpha}},
\end{align*}
where $\boldsymbol{\alpha}! = \alpha_1 ! \cdots \alpha_d !$ and
$(x - y)^{\boldsymbol{\alpha}} = (x_1 - y_1)^{\alpha_1} \cdots (x_d - y_d)^{\alpha_d}$, we obtain
\begin{align*}
\begin{split}
|u(x)|
\leq \sum_{\boldsymbol{\alpha} \in \mathrm{int}\, \boldsymbol{m}} \frac{1}{\boldsymbol{\alpha}!} |D^{\boldsymbol{\alpha}}u(y)| |x-y|^{|\boldsymbol{\alpha}|}
+ \sum_{\boldsymbol{\alpha} \in \partial\boldsymbol{m}} \frac{|\boldsymbol{\alpha}|}{\boldsymbol{\alpha}!} |x - y|^{|\boldsymbol{\alpha}|}
\int_0^1 (1 - t)^{|\boldsymbol{\alpha}|-1} |D^{\boldsymbol{\alpha}} u (t x + (1-t) y)| \, dt.
\end{split}
\end{align*}
If the volume of $C$ is $c \rho^d$, then the volume of $C_{X,r}$ is $c r^d$.
By integrating $y$ over $C_{x,r}$, we have
\begin{align*}
c r^d |u(x)|
\leq \sum_{\boldsymbol{\alpha} \in \mathrm{int}\, \boldsymbol{m}} \frac{r^{|\boldsymbol{\alpha}|}}{\boldsymbol{\alpha}!} \int_{C_{x,r}} |D^{\boldsymbol{\alpha}}u(y)| \, dy
+ \sum_{\boldsymbol{\alpha} \in \partial\boldsymbol{m}} \int_{C_{x,r}} |x - y|^{|\boldsymbol{\alpha}|} \, dy
\int_0^1 (1 - t)^{|\boldsymbol{\alpha}|-1} |D^{\boldsymbol{\alpha}} u (t x + (1-t) y)| \, dt.
\end{align*}
As for the final (double) integral, we begin by changing the order of integration, and then substitute $z = t x + (1 - t) y$, so that $z - x = (1 - t) (y - x)$ and $dz = (1 - t)^d \, dy$, then we obtain the integral,
\begin{align*}
\int_0^1 (1 - t)^{- d - 1} \, dt
\int_{C_{x,(1-t)r}} |z - x|^{|\boldsymbol{\alpha}|} |D^{\alpha} u(z)| \, dz.
\end{align*}
Changing the order of the above integration gives
\begin{align*}
\int_{C_{x,t}} |x - z|^{|\boldsymbol{\alpha}|} |D^{\boldsymbol{\alpha}}u(z)| \, dz
\int_0^{1-(|z-x|/r)} (1 - t)^{- d - 1} \, dt
\leq \frac{r^d}{d} \int_{C_{x,r}} |x - z|^{|\boldsymbol{\alpha}|-d} |D^{\alpha} u(z)| \, dz.
\end{align*}
Inequality \eqref{localEs} now follows immediately.
\end{proof}
\begin{proof}[Proof of Case A of Theorem \ref{ASIT}]
As noted earlier, we can assume that $j = 0$.
Let $u \in W^{\boldsymbol{m}}_p(\Omega) \cap C^{\infty}(\Omega)$ and let $x \in \Omega$.
We are supposed to show that
\begin{align} \label{lehh}
|u(x)| \leq K \|u\|_{\boldsymbol{m},p}.
\end{align}
For $p > 1$ and $\underline{\boldsymbol{m}} p > d$, we apply H\"{o}lder's inequality to \eqref{localEs} with $r = \rho$ to obtain
\begin{align*}
|u(x)|
\leq K \biggl( \sum_{\boldsymbol{\alpha} \in \mathrm{int}\, \boldsymbol{m} } c^{1/p'} \rho^{|\boldsymbol{\alpha}| - (d/p)}
\|D^{\boldsymbol{\alpha}}u\|_{p,C_{x,\rho}}
+ \sum_{\boldsymbol{\alpha} \in \partial \boldsymbol{m}} \|D^{\boldsymbol{\alpha}}u\|_{p,C_{x,\rho}}
\biggl[ \int_{C_{x,\rho}} |x - y|^{(|\boldsymbol{\alpha}|-d)p'} \, dy \biggr]^{1/p'} \biggr),
\end{align*}
where $c$ is the volume of $C_{x,1}$ and $p' = p/(p-1)$.
The last integral is finite since $(|\boldsymbol{\alpha}|- d)p > (\underline{\boldsymbol{m}} - d) p' > - d$ when $\underline{\boldsymbol{m}} p > d$. Therefore
\begin{align} \label{10}
|u(x)| \leq K \sum_{\boldsymbol{\alpha} \in \mathrm{dom}\, \boldsymbol{m}} \|D^{\boldsymbol{\alpha}}u\|_{p,C_{x,\rho}}
\end{align}
and \eqref{lehh} follows since $C_{x,\, \rho} \subset \Omega$.
Since any $u \in W^{\boldsymbol{m}}_p(\Omega)$ is the limit of a Cauchy sequence of continuous functions, and \eqref{lehh} implies this Cauchy sequence converges to a continuous function on $\Omega$, $u$ must coincide with a continuous function a.e.~on $\Omega$.
Therefore, we prove that $u \in C_B^0(\Omega)$ and imbedding \eqref{01} holds.
Let the intersection of $\Omega$ with a $k$-dimensional plane $H$ be denoted by $\Omega_k$, $\Omega_{k,\rho} = \{ x \in \mathbb{R}^d : \mathrm{dist}(x, \Omega_k) < \rho \}$, and $u$ and all its derivatives be extended to be zero outside $\Omega$.
Considering that $C_{x,\, \rho} \subset B_{\rho}(x)$ where $B_{\rho}(x)$ denotes the ball of radius $\rho$ with centre at $x$, with \eqref{10} and denoting by $dx'$ the $k$-volume element in $H$, we have
\begin{align*}
\int_{\Omega_k} |u(x)|^p \, dx'
& \leq K \sum_{\boldsymbol{\alpha} \in \mathrm{dom}\, \boldsymbol{m}} \int_{\Omega_k} \, dx'
\int_{B_{\rho}(x)} |D^{\boldsymbol{\alpha}} u(y)|^p \, dy
\\
& = K \sum_{\boldsymbol{\alpha} \in \mathrm{dom}\, \boldsymbol{m}} \int_{\Omega_{k,\rho}} |D^{\boldsymbol{\alpha}}u(y)|^p \, dy
\int_{H \cap B_{\rho}(y)} \, dx'
\leq K_1 \|u\|_{\boldsymbol{m},p,\Omega}^p,
\end{align*}
and $W^{\boldsymbol{m}}_p(\Omega) \to L^p(\Omega_k)$.
However, \eqref{lehh} shows that $W^{\boldsymbol{m}}_p(\Omega) \to L^{\infty}(\Omega_k)$
and hence imbedding \eqref{2} follows by Theorem 2.11 (Interpolation inequality in \cite{adams2003sobolev}).
\end{proof}
Let $\chi_r$ be the characteristic function of the ball
$B_r(0) = \{ x \in \mathbb{R}^d : |x| < r \}$.
In the following discussion we will develop estimates for convolutions of $L^p$ functions with the kernels $\omega_m(x) = |x|^{m-d}$ and
\begin{align*}
\chi_r \omega_m(x) =
\begin{cases}
|x|^{m-d} & \text{ if } |x| < r, \\
0 & \text{ if } |x| \geq r.
\end{cases}
\end{align*}
Observe that if $m \leq d$ and $0 < r \leq 1$, then
we have
$\chi_r(x)
\leq \chi_r \omega_m(x)
\leq \omega_m(x)$.
\begin{lemma} \label{lemma3}
Let $p \geq 1$, $1 \leq k \leq d$, and $d - m p < k$.
There exists a constant $K$ such that for every $r > 0$, every $k$-dimensional plane
$H \subset \mathbb{R}^d$, and every $v \in L^p(\mathbb{R}^d)$, we have
$\chi_r \omega_m * |v| \in L^p(H)$ and
\begin{align} \label{11}
\|\chi_r \omega_m * |v|\|_{p,H}
\leq K r^{m-(d-k)/p} \|v\|_{p,\mathbb{R}^d}.
\end{align}
In particular,
\begin{align*}
\|\chi_1 * |v|\|_{p,H}
\leq \|\chi_1 \omega_m * |v|\|_{p,H}
\leq K \|v\|_{p,\mathbb{R}^d}.
\end{align*}
\end{lemma}
\begin{proof}[Proof of Lemma \ref{lemma3}]
If $p > 1$, then by H\"{o}lder's inequality
\begin{align*}
\chi_r \omega_m * |v|(x)
& = \int_{B_r(x)} |v(y)| |x - y|^{-s} |x - y|^{s+m-d} \, dy
\\
& \leq \biggl( \int_{B_r(x)} |v(y)|^p |x - y|^{- s p} \, dy \biggr)^{1/p}
\biggl( \int_{B_r(x)} |x - y|^{(s+m-d)p'} \, dy \biggr)^{1/p'}
\\
& = K r^{s+m-(d/p)} \biggl( \int_{B_r(x)} |v(y)|^p |x - y|^{-sp} \, dy \biggr)^{1/p},
\end{align*}
provided $s + m - (d/p) > 0$. If $p = 1$ the same estimate holds provided $s + m - d \geq 0$ without using H\"{o}lder's inequality.
Integrating the $p$th power of the above estimate over $H$
(with volume element $dx'$), we obtain
\begin{align*}
\|\chi_r \omega_m * |v|\|_{p,H}^p
& = \int_H \bigl| \chi_r \omega_m * |v|(x) \bigr|^p \, dx'
\leq K r^{(s+m)p-d} \int_H \, dx \int_{B_r(x)} |v(y)|^p |x - y|^{-sp} \, dy
\nonumber\\
& \leq K r^{(s+m)p-d} r^{k-sp} \|v\|_{p,\mathbb{R}^d}^p
= K r^{mp-(n-k)} \|v\|_{p,\mathbb{R}^d}^p,
\end{align*}
provided $k > s p$.
Since that for $d - m p < k$, there exists $s$ satisfying $(d/p) - m < s < k/p$, both estimates above are valid and \eqref{11} holds.
\end{proof}
\begin{lemma} \label{lemma4}
Let $p > 1$, $m p < d$, $d - m p < k \leq d$, and $p^* = k p / (d - mp)$.
There exists a constant $K$ such that for every $k$-dimensional plane $H$ in $\mathbb{R}^d$ and every $v \in L^p(\mathbb{R}^d)$, we have $\omega_m * |v| \in L^{p^*}(H)$ and
\begin{align} \label{12}
\|\chi_1 * |v|\|_{p^*,H}
\leq \|\chi_1 \omega_m * |v|\|_{p^*,H}
\leq \|\omega_m * |v|\|_{p^*,H}
\leq K \|v\|_{p,\mathbb{R}^d}.
\end{align}
\end{lemma}
\begin{proof}[Proof of Lemma \ref{lemma4}]
Only the final inequality of \eqref{12} requires proof.
Since $m p < d$, for each $x \in \mathbb{R}^d$, H\"{o}lder's inequality gives
\begin{align*}
\int_{\mathbb{R}^d - B_r(x)} |v(y)| |x - y|^{m-d} \, dy
& \leq \|v\|_{p,\mathbb{R}^d}
\biggl( \int_{\mathbb{R}^d - B_r(x)} |x - y|^{(m-d)p'} \, dy \biggr)^{1/p'}
\\
& = K_1 \|v\|_{p,\mathbb{R}^d}
\biggl( \int_r^{\infty} t^{(m-d)p'+d-1} \, dt \biggr)^{1/p'}
= K_1 r^{m-(d/p)} \|v\|_{p,\mathbb{R}^d}.
\end{align*}
If $t > 0$, choose $r$ so that $K_1 r^{m-(d/p)} \|v\|_{p,\mathbb{R}^d} = t/2$. If
\begin{align*}
\omega_m * |v|(x)
= \int_{\mathbb{R}^d} |v(y)| |x - y|^{m-d} \, dy
> t,
\end{align*}
then
\begin{align*}
\chi_r \omega_m * |v|(x)
= \int_{B_r(x)} |v(y)| |x - y|^{m-d} \, dy
> t/2.
\end{align*}
Thus
\begin{align*}
\mu_k \bigl( \{ x \in H : \omega_m * |v|(x) > t \} \bigr)
& \leq \mu_k \bigl( \{ x \in H : \chi_r \omega_m * |v|(x) > t/2 \} \bigr)
\leq (2/t)^p \|\chi_r \omega_m * |v|\|_{p,H}^p
\\
& \leq \biggl( \frac{r^{(d/p)-m}}{K_1 \|v\|_{p,\mathbb{R}^d}} \biggr)^p
K r^{mp-d+k} \|v\|_{p,\mathbb{R}^d}^p = K_2 r^k,
\end{align*}
by inequality \eqref{11}. But $r^k = (2 K_1 \|v\|_{p,\mathbb{R}^d} / t)^{p^*}$, so
\begin{align*}
\mu_k \bigl( \{ x \in H : \omega_m * |v|(x) > t \} \bigr)
\leq K_2 \biggl( \frac{2 K_1}{t} \|v\|_{p,\mathbb{R}^d} \biggr)^{p^*}.
\end{align*}
Therefore, the mapping $I : v \mapsto (\omega_m * |v|) |_H$ is of weak type $(p, p^*)$.
For fixed $m$, $d$, $k$, the values of $p$ satisfying the conditions of this lemma constitute an open interval, hence there exist $p_1$ and $p_2$ in that interval, and a number $\theta$ satisfying $0 < \theta < 1$ such that
\begin{align*}
\frac{1}{p} = \frac{1-\theta}{p_1} + \frac{\theta}{p_2},
\qquad
\text{ and }
\qquad
\frac{1}{p^*}
= \frac{d/k}{p} - \frac{m}{k}
= \frac{1-\theta}{p_1^*} + \frac{\theta}{p_2^*}.
\end{align*}
Since $p^* > p$, the Marcinkiewicz interpolation theorem 2.58 in \cite{adams2003sobolev} ensures us that $I$ is bounded from $L^p(\mathbb{R}^d)$ into $L^{p^*}(H)$, i.e.~\eqref{12} holds.
\end{proof}
\begin{proof}[Proof of Case C of Theorem \ref{ASIT} for $p > 1$]
We have $m p < \overline{\boldsymbol{m}} p< d$, $d - m p < d - \underline{\boldsymbol{m}} p < k \leq d$, and $p \leq q \leq p^* = k p / (d - \underline{\boldsymbol{m}} p)$.
Let $u \in C^{\infty}(\Omega)$ and extend $u$ and all its derivatives to be zero on $\mathbb{R}^d - \Omega$. Taking $r = \rho$ in Lemma 4.15 in \cite{adams2003sobolev} and replacing $C_{x,r}$ with the larger ball $B_1(x)$, we have
\begin{align} \label{13}
|u(x)|
\leq K \biggl( \sum_{\boldsymbol{\alpha} \in \mathrm{int}\, \boldsymbol{m}} \chi_1 * |D^{\boldsymbol{\alpha}}u|(x)
+ \sum_{\boldsymbol{\alpha} \in \partial \boldsymbol{m}} \chi_1 \omega_{|\boldsymbol{\alpha}|} * |D^{\boldsymbol{\alpha}}u|(x) \biggr).
\end{align}
If $1/q = \theta/p + (1 - \theta)/p^*$ where $0 \leq \theta \leq 1$, then by the interpolation inequality of Theorem 2.11 in \cite{adams2003sobolev} and Lemmas \ref{lemma3} and \ref{lemma4},
\begin{align*}
\|u\|_{q,\Omega_k}
\leq \|u||_{p,H}^{\theta} \|u\|_{p^*,H}^{1-\theta}
\leq K \biggl( \sum_{\boldsymbol{\alpha} \in \mathrm{int}\, \boldsymbol{m}} \|D^{\boldsymbol{\alpha}}u\|_{p,\mathbb{R}^d} \biggr)^{\theta}
\biggl( \sum_{\boldsymbol{\alpha} \in \partial\boldsymbol{m}} \|D^{\boldsymbol{\alpha}}u\|_{p,\mathbb{R}^d} \biggr)^{1-\theta}
\leq K \|u\|_{\boldsymbol{m},p,\Omega},
\end{align*}
as required.
\end{proof}
\begin{proof}[Proof of Case B of Theorem \ref{ASIT} for $p > 1$]
We have $\overline{\boldsymbol{m}} p \geq d$ and $\underline{\boldsymbol{m}} p \leq d$, $1 \leq k \leq d$, and $p \leq q < \infty$.
We can select numbers $p_1$, $p_2$, and $\theta$ such that
$1 < p_1 < p < p_2$, $d - \underline{\boldsymbol{m}} p_1 < k$, $0 < \theta < 1$, and
\begin{align*}
\frac{1}{p} = \frac{\theta}{p_1} + \frac{1-\theta}{p_2},
\qquad \qquad
\frac{1}{q} = \frac{\theta}{p_1}.
\end{align*}
As in the above proof of Case C for $p > 1$, the maps $v \mapsto (\chi_1 * |v|) |_H$ and $v \mapsto (\chi_1 \omega_{|\boldsymbol{\alpha}|} * |v|) |_H$ are bounded from $L^{p_1}(\mathbb{R}^d)$ into $L^{p_1}(\mathbb{R}^k)$ and so are of weak type $(p_1, p_1)$.
As in the proof of Case A, these same maps are bounded from $L^{p_2}(\mathbb{R}^d)$ into $L^{\infty}(\mathbb{R}^k)$ and so are of weak type $(p_2, \infty)$.
By the Marcinkiewicz theorem again, they are bounded from $L^p(\mathbb{R}^d)$ into $L^q(\mathbb{R}^k)$ and
\begin{align*}
\|\chi_1 * |v|\|_{q,H}
\leq \|\chi_1 \omega_{|\boldsymbol{\alpha}|}* |v|\|_{q,H}
\leq K \|v\|_{p,\mathbb{R}^d}
\end{align*}
and the desired result follows by applying these estimates to the various terms of \eqref{13}.
\end{proof}
Here, the next Theorem \ref{Th2} gives an estimate of the $D^{\boldsymbol{\alpha}}u$ where $u \in W^{\boldsymbol{m}}_p (\Omega)$ and $\boldsymbol{\alpha} \in \mathrm{dom}\, \boldsymbol{m}$.
\begin{theorem} \label{Th2}
Let $\Omega$ be a domain in $\mathbb{R}^{d}$ satisfying the cone condition. For each $\delta_{0}>0$ there exist finite constant $K$, each depending on $d, m, p, \delta_{0}$ and the dimensions of the cone $C$ providing the cone condition for $\Omega$ such that if $0<\delta\leq\delta_{0},0\leq j\leq m$, and $u\in W^{\boldsymbol{m}}_p(\Omega)$ , then
\begin{align}
\|D^{\boldsymbol{\alpha}}u\|_{p} \leq K\delta^{\underline{\boldsymbol{m}}- |\boldsymbol{\alpha}|}\|u\|_{\boldsymbol{m},p}+K\delta^{-|\boldsymbol{\alpha}|}\|u\|_{p}.
\end{align}
\end{theorem}
In order to prove this theorem, we need the following three Lemmas \ref{lemma2-1}, \ref{lemma2-2} and \ref{lemma 2-3}.
\begin{lemma} \label{lemma2-1}
If $\rho>0,1\leq p<\infty, K_{p}=2^{p-1}9^{p}$, and $g\in C^{2}([0, \rho])$ then
\begin{align} \label{4}
|g'(0)|^{p}\displaystyle \leq\frac{K_{p}}{\rho}\bigg(\rho^{p}\int_{0}^{\rho}|g''(t)|^{p}dt+\rho^{-p}\int_{0}^{\rho}|g(t)|^{p}dt\bigg).
\end{align}
\end{lemma}
\begin{proof}[Proof of Lemma \ref{lemma2-1}]
Let $f\in C^{2}([0,1])$, $x\in[0,1/3]$, and $y\in[2/3,1]$. According to the mean-value theorem, there exists $z\in(x,\ y)$ such that
$$
|f'(z)|=\bigg|\frac{f(y)-f(x)}{y-x}\bigg|\leq 3|f(x)|+3|f(y)|.
$$
Therefore,
\begin{align*}
|f'(0)|
= \bigg|f'(z)-\int_{0}^{z}f''(t)dt\bigg|
\leq 3|f(x)|+3|f(y)|+\int_{0}^{1}|f''(t)|dt.
\end{align*}
Integrating $x$ over $[0,1/3]$ and $y$ over [2/3, 1] yields
$$
\frac{1}{9}|f'(0)|\leq\int_{0}^{1/3}|f(x)|dx+\int_{2/3}^{1}|f(y)|dy+\frac{1}{9}\int_{0}^{1}|f''(t)|dt.
$$
For $p\geq 1$, we then have (using H\"{o}lder's inequality if $p>1$)
$$
|f'(0)|^{p}\leq K_{p}\bigg(\int_{0}^{1}|f''(t)|^{p}dt+\int_{0}^{1}|f(t)|^{p}dt\bigg)
$$
where $K_{p}=2^{p-1}9^{p}$. Inequality \eqref{4} now follows by substituting $f(t)=g(\rho t)$ .
\end{proof}
\begin{lemma} \label{lemma2-2}
If $ 1\leq p<\infty$ and the domain $\Omega\subset \mathbb{R}^{n}$ satisfies the cone condition, then there exists a constant $K$ depending on $d, p$, and the height $\rho_{0}$ and aperture angle $\kappa$ of the cone $C$ providing the cone condition for $\Omega$ such that for all $\epsilon, 0<\epsilon\leq p_{0}$ and all $u\in W^{\boldsymbol{m}}_p(\Omega)$ with $m_j\geq 2$, we have
\begin{align} \label{5}
\|D_j \, u(x) \| \leq K_p \big(\epsilon\|D^2_j \, u(x)\|_{p}+\epsilon^{-1}||u\Vert_{p}^{p} \big)
\end{align}
\end{lemma}
\begin{proof}[Proof of Lemma \ref{lemma2-2}]
Let $\Sigma=\{\sigma \in \mathbb{R}^{d}\ :\ |\sigma|=1\}$ be the unit sphere in $\mathbb{R}^{d}$ with volume element $ d\sigma$ and $(d-1)$-volume $ K_{0}=K_{0}(d)=\int_{\Sigma}d\sigma$. If $ x\in\Omega$ let $\sigma_{x}$ be the unit vector in the direction of the axis of a cone $ C_{x}\subset\Omega$ congruent to $C$ and having vertex at $x$, and let $\Sigma_{x}=\{\sigma\in\Sigma\ :\ \angle(\sigma,\ \sigma_{x})\leq\kappa/2\}.$
Let $u\in C^{\infty}(\Omega)$ . If $x\in\Omega, \sigma\in\Sigma_{x}$, and $0<p\leq p_{0}$, then
$$|\sigma\cdot \mathrm{grad}\, u (x)|^{p}\leq\frac{K_{p}}{\rho}I(\rho,p,u,x,\sigma),
$$
where
$$
I(\rho,p, u, x,\sigma)=\rho^{p}\int_{0}^{p}|D_{t}^{2}u(x+t \sigma)|^{p}d t+\rho^{-p}\int_{0}^{p}|u(x+t\sigma)|^{p}dt.
$$
In order to estimate the inner integral on the right side, regard $u$ and its derivatives as being extended to all of $\mathbb{R}^{d}$ so as to be identically zero outside $\Omega$. For simplicity, we suppose $\sigma=e_{d}=(0,\ \ldots,\ 0,1)$ and write $x=(x',\, x_{d})$ with $x'\in \mathbb{R}^{d-1}$, we have
\begin{align*}
\int_{\Omega} I(\rho,p, u, x,e_n)dx
&= \int_{\mathbb{R}^{d-1}}\,dx'\int_{-\infty}^{\infty}dx_{n}\int_{0}^{\rho}\bigg(\rho^{p}\big|D_{d}^{2}u(x', x_{d}+t)\big|^{p}+\rho^{-p}\big|u(x', x_{d}+t)\big|^{p}\bigg)dt
\\
&= \int_{\mathbb{R}^{d-1}}\,dx'\int_{0}^{\rho}dt\int_{-\infty}^{\infty}\bigg(\rho^{p}\big|D_{n}^{2}u(x)\big|^{p}+\rho^{-p}\big|u(x)\big|^{p}\bigg)dx_{d}
\\
&\leq \rho \int_{\Omega}\bigg(\rho^{p} \big|D_{d}^{2}u(x)\big |^{p}+\rho^{-p} \big|u(x) \big|^{p}\bigg)dx.
\end{align*}
If we take $\sigma = e_j$,$j = 1,\cdots, d$, then we can get
$$
\int_{\Omega} \big|e_j \cdot \mathrm{grad}\, u(x)\big|^{p}\leq\frac{K_{p}}{p}\int_{\Omega} I(\rho,p,u,x,e_j)dx,
$$
in other words,
\begin{align*}
\|D_j \, u(x) \|_p \leq K_p \big(\rho^{p}\|D^2_j \, u(x)\|^p_{p}+\rho^{-p}||u\Vert_{p}^{p} \big).
\end{align*}
Inequality \eqref{5} now follows by taking $p$th roots, replacing $\rho$ with $\epsilon$, and noting that $C^{\infty}(\Omega)$ is dense in $W^{\boldsymbol{m}}_p(\Omega)$ .
\end{proof}
\begin{lemma} \label{lemma 2-3}
Let $|\boldsymbol{m}|\geq 2$, let $ 0<\delta_{0}<\infty$, and let $\displaystyle \epsilon_{0}=\min\{\delta_{0},\ \delta_{0}^{2},\ \ldots,\ \delta_{0}^{\overline{\boldsymbol{m}}-1}\}.$ Suppose that for given $p, 1\leq p<\infty$, and given $\Omega\subseteq \mathbb{R}^{d}$ there exists a constant
$K=K(\epsilon_{0},\boldsymbol{m},\ p,\ \Omega)$ such that for every $\epsilon$ satisfying $0<\epsilon\leq\epsilon_0$, every $\boldsymbol{\alpha}$ satisfying $\boldsymbol{\alpha}\in \mathrm{dom}\,\boldsymbol{m}$, and every $u\in W^{\boldsymbol{m}}_p(\Omega)$ , we have
$\exists\, \boldsymbol{\ell} \in \partial\boldsymbol{m}$,
\begin{align}\label{7}
\|D^{\boldsymbol{\alpha}}u\|_{p}\leq K\epsilon^{|\boldsymbol{\ell}| - |\boldsymbol{\alpha}| }\|D^{\boldsymbol{\alpha}}u\|+K\epsilon^{-|\boldsymbol{\alpha}| }\|u\|_p
\end{align}
\end{lemma}
\begin{proof}[Proof of Lemma \ref{lemma 2-3}]
Since $\eqref{7}$ is trivial for $\boldsymbol{\alpha} = 0$, so we consider only the case $|\boldsymbol{\alpha}| \geq 1$.
The proof is accomplished by a double induction on $|\boldsymbol{\alpha}|$ and $ |\boldsymbol{\ell} - \boldsymbol{\alpha}|$ with ${\ell}_i \geq {\alpha}_i$ $i =1, \ldots, d$. The constants $K_{1}, K_{2}, \ldots$ appearing in the argument may depend on $\delta_{0}$ (or $\epsilon_{0}$), $\boldsymbol{m}, p$, and $\Omega.$
First we prove \eqref{7} for $|\boldsymbol{\ell} - \boldsymbol{\alpha}| =1 $, i.e. $\boldsymbol{\ell} - \boldsymbol{\alpha} = e_j $ by induction on $|\boldsymbol{\alpha}|$, so that \eqref{5} is the special case $|\boldsymbol{\alpha}|= 1$. Assume, therefore, that for some $k, 1\leq |\boldsymbol{\beta}|\leq k-2,$
\begin{align} \label{8}
\|D^{\boldsymbol{\beta}}u\|_{p} \leq K_{1}\delta\|D^{\boldsymbol{\beta}+e_j}u\|_{p}+K_{1}\delta^{-|\boldsymbol{\beta}|}\|u\|_{p}
\end{align}
holds for all $\delta,\, 0<\delta\leq\delta_{0}$. Now we prove the above equation with $|\boldsymbol{\alpha}|=k-1$. We obtain from the Lemma \ref{lemma2-2},
$$
\|D^{\boldsymbol{\alpha} }u\|_{p} = \|D_j D^{\boldsymbol{\alpha} - e_j}u\|_{p}\leq K_{p}\delta\|D_j^2D^{\boldsymbol{\alpha} + e_j}u\|_{p}+K_{p}\delta^{-1}\|D^{\boldsymbol{\alpha} + e_j}u\|_{p}.
$$
Combining this inequality with \eqref{8}, we obtain, for $0<\eta\leq\delta_{0},$
$$
\|D^{\boldsymbol{\alpha} }u\|_{p} \leq K_p \delta \|D^{\boldsymbol{\alpha} + e_j}u\|_{p} + K_p K_{1}\delta^{-1}\eta\|D^{\boldsymbol{\beta}+e_j}u\|_{p}+K_p K_{1}\delta^{-1}\eta^{-|\boldsymbol{\beta}|}\|u\|_{p}
$$
We may assume without prejudice that $2K_{1}K_{p}\geq 1$. Therefore, we may take $\eta=\delta/(2K_{1}K_{p})$ and so obtain
\begin{align*}
\|D^{\boldsymbol{\alpha} }u\|_{p}
\leq 2K_p \delta \|D^{\boldsymbol{\alpha} + e_j}u\|_{p} + (\frac{\delta}{2K_1 K_p})^{-|\boldsymbol{\alpha}|}\|u\|_p
\leq K_2 \delta \|D^{\boldsymbol{\alpha} + e_j}u\|_{p} + K_2\delta^{-|\boldsymbol{\alpha}|}\|u\|_p.
\end{align*}
This completes the induction establishing in \eqref{8} for $0<\delta\leq\delta_{0}$, and hence \eqref{7} for $| \boldsymbol{\ell} - \boldsymbol{\alpha}|= 1$ and $0<\epsilon\leq\delta_{0}.$
We now prove by induction on $|\boldsymbol{\ell} - \boldsymbol{\alpha}|$ that
\begin{align} \label{9}
\|D^{\boldsymbol{\alpha}}u\|_{p}\leq K_{3}\delta^{|\boldsymbol{\ell}|- |\boldsymbol{\alpha}|}\|D^{\boldsymbol{\ell}}u\|_{p}+K_{3}\delta^{-|\boldsymbol{\alpha}|}\|u\|_{p}
\end{align}
holds for $1\leq |\boldsymbol{\ell} - \boldsymbol{\alpha}| \leq m-1$ with $\ell_i \geq {\alpha}_i$ and $0<\delta\leq\delta_{0}$. Note that \eqref{8} is the special case $|\boldsymbol{\ell} - \boldsymbol{\alpha}|= 1$ of \eqref{9}. Assume, therefore, that \eqref{9} holds for some $\boldsymbol{\ell}, 1\leq |\boldsymbol{\ell} - \boldsymbol{\alpha}| \leq k-1$. We prove that it also holds for $\boldsymbol{\ell}$ with $|\boldsymbol{\ell} - \boldsymbol{\alpha}| = k$. From \eqref{8} and \eqref{9}, we obtain
\begin{align*}
\|D^{\boldsymbol{\alpha}}u\|_{p}
&\leq K_{4}\delta\|D^{\boldsymbol{\alpha}+e_j}u\|_{p}+K_{4}\delta^{-|\boldsymbol{\alpha}|}\|u\|_{p}
\\
&\leq K_{4}\delta(K_3\delta^{|\boldsymbol{\ell}|- |\boldsymbol{\alpha}|-1}\|D^{\boldsymbol{\ell}}u\|_{p}+K_{3}\delta^{-|\boldsymbol{\alpha}|-1}\|u\|_{p})+K_{4}\delta^{-|\boldsymbol{\alpha}|}\|u\|_{p}
\leq K_5\delta^{|\boldsymbol{\ell}|- |\boldsymbol{\alpha}|}\|D^{\boldsymbol{\ell}}u\|_{p}+K_{5}\delta^{-|\boldsymbol{\alpha}|}\|u\|_{p}.
\end{align*}
Therefore, \eqref{9} holds for $|\boldsymbol{\ell} - \boldsymbol{\alpha}| = k$, and \eqref{7} follows by setting $\delta=\epsilon$ in \eqref{7} and noting that $\epsilon\leq\epsilon_{0}$ if $\delta\leq\delta_{0}$.
\end{proof}
\begin{proof}[Proof of Theorem \ref{Th2}]
It is not hard to find that $\forall\boldsymbol{\alpha}\in \partial \boldsymbol{m}$, $|\boldsymbol{\alpha}| \geq \underline{\boldsymbol{m}}$. So when $\boldsymbol{\alpha}\notin \partial \boldsymbol{m}$, we can find a $\boldsymbol{\ell}\in \partial \boldsymbol{m}$, such that
\begin{align*}
\|D^{\boldsymbol{\alpha}}u\|_{p}
\leq K_6\delta^{|\boldsymbol{\ell}|- |\boldsymbol{\alpha}|}\|D^{\boldsymbol{\ell}}u\|_{p}+K_{6}\delta^{-|\boldsymbol{\alpha}|}\|u\|_{p}
\leq K_6\delta^{\underline{\boldsymbol{m}}- |\boldsymbol{\alpha}|}\|u\|_{\boldsymbol{m},p}+K_{6}\delta^{-|\boldsymbol{\alpha}|}\|u\|_{p}.
\end{align*}
This completes the proof of Theorem \ref{Th2}.
\end{proof}
The following interpolation Theorem \ref{Th1} provides sharp estimates for $L^q$ norms of functions in $W^{\boldsymbol{m}}_p(\Omega)$.
\begin{theorem} \label{Th1}
Let $\Omega$ be a domain in $\mathbb{R}^{d}$ satisfying the cone condition. If $\underline{\boldsymbol{m}} p > d$, let $ p\leq q\leq\infty$;
if $\overline{\boldsymbol{m}} p < d$, let $p\leq q \leq p^{*}=dp/(d - \overline{\boldsymbol{m}}p)$ . Then there exists a constant $K$ depending on $\boldsymbol{m}, d, p, q$ and the dimensions of the cone $C$ providing the cone condition for $\Omega,$ such that for all $u\in W^{\boldsymbol{m}}_p(\Omega)$ ,
\begin{center}
$\Vert u\Vert_{q}\leq K\Vert u\Vert_{\boldsymbol{m},p}^{\theta}\Vert u\Vert_{p}^{1-\theta}$,
\end{center}
where $\theta = d/\underline{\boldsymbol{m}}p - d/\underline{\boldsymbol{m}}q$ .
\end{theorem}
\begin{proof}[Proof of Theorem \ref{Th1}]
The case $\overline{\boldsymbol{m}} p< d, p\leq q\leq p^{*}$ follows directly from Theorem 2.11 in \cite{adams2003sobolev} and Theorem \ref{ASIT}:
$$
\Vert u\Vert_{q}\leq||u\Vert_{p^{*}}^{\theta}\Vert u\Vert_{p}^{1-\theta}\leq \|u\Vert_{\boldsymbol{m},p}^{\theta}\Vert u\Vert_{p}^{1-\theta},
$$
where $1/q=(\theta/p^{*})+(1-\theta)/p$ from which it follows that $\theta=(d/\underline{\boldsymbol{m}} p)-(d/\underline{\boldsymbol{m}}q)$ .
For the cases $\overline{\boldsymbol{m}} p \geq d$ and $\underline{\boldsymbol{m}} p \leq d$, $ p\leq q<\infty$, and $\underline{\boldsymbol{m}} p > d, p\leq q\leq\infty$ we use the local bound obtained in Lemma \ref{ALE}. If $ 0<r\leq\rho$ (the height of the cone $C$), then
\begin{align} \label{11-11}
|u(x)| \leq K_{1}\biggl(\sum_{ \boldsymbol{\alpha} \in \mathrm{int}\, \boldsymbol{m} }r^{|\alpha|-n}\chi_{r}*|D^{\alpha}u|(x)+\sum_{\boldsymbol{\alpha} \in \partial \boldsymbol{m} }\big(\chi_{r}\omega_{|\boldsymbol{\alpha}|}\big)*|D^{\alpha}u|(x)\biggr)
\end{align}
where $\chi_{r}$ is the characteristic function of the balI of radius $r$ centred at the origin in $\mathbb{R}^{d}$, and $\omega_{m}(x)=|x|^{m-d}$. We estimate the $L^{q}$ norms of both terms on the right side of \eqref{11-11} using Young's inequality from Corollary 2.25 in \cite{adams2003sobolev}. If $(1/p)+(1/s)=1+(1/q)$ , then
\begin{align*}
\big\| \chi_r * |D^{\boldsymbol{\alpha}}u| \big\|_q
& \leq \big\| \chi_r \big\|_s \big\| D^{\boldsymbol{\alpha}}u \big\|_p
= K_2 r^{d-(d/p)+(d/q)} \big\| D^{\boldsymbol{\alpha}}u \big\|_p,
\\
\big\| (\chi_r \omega_{|\boldsymbol{\alpha}|}) * |D^{\boldsymbol{\alpha}}u| \big\|_q
& \leq \big\| \chi_r \omega_{|\boldsymbol{\alpha}|} \big\|_s
\big\| D^{\boldsymbol{\alpha}}u \big\|_p
= K_3 r^{|\boldsymbol{\alpha}|-(d/p)+(d/q)}
\big\| D^{\boldsymbol{\alpha}}u \big\|_p.
\end{align*}
Note that $|\boldsymbol{\alpha}|-(d/p)+(d/q)>0$ if $q$ satisfies the above restrictions. Hence
\begin{align*}
\|u\Vert_{q}
\leq K_{4}\bigg(\sum_{ \boldsymbol{\alpha} \in \mathrm{int}\, \boldsymbol{m}} r^{|\boldsymbol{\alpha}|-(d/p)+(d/q)}||D^{\boldsymbol{\alpha}}u||_{p}+\sum_{ \boldsymbol{\alpha} \in \partial \boldsymbol{m}}r^{|\boldsymbol{\alpha}|-(d/p)+(d/q)}||D^{\boldsymbol{\alpha}}u||_{p}\bigg)
= K_{4} \sum_{\boldsymbol{\alpha} \in \mathrm{dom}\, \boldsymbol{m}} r^{|\boldsymbol{\alpha}|-(d/p)+(d/q)}||D^{\boldsymbol{\alpha}}u||_{p}.
\end{align*}
By Theorem \ref{Th2}, we obtain
$$
\|D^{\boldsymbol{\alpha}}u\|_{p} \leq K_5 r^{\underline{\boldsymbol{m}}- |\boldsymbol{\alpha}|}\|u\|_{\boldsymbol{m},p}+K_5 r^{-|\boldsymbol{\alpha}|}\|u\|_{p},
$$
so that, we have
$$
\Vert u\Vert_{q}\leq K_{6}(r^{\underline{\boldsymbol{m}}-(d/p)+(d/q)}\Vert u\|_{\boldsymbol{m},p}+r^{-(d/p)+(d/q)}\Vert u\Vert_{p})\ .
$$
Adjusting $K_{6}$ if necessary, we can assume this inequality holds for all $r\leq 1.$ Choosing $r = (\frac{\| u\|_{p}}{\| u\|_{\boldsymbol{m},p}})^{1/\underline{\boldsymbol{m}}}$ to make the two terms on the right side equal, we obtain the conclusion with $\theta = d/\underline{\boldsymbol{m}}p - d/\underline{\boldsymbol{m}}q$.
\end{proof}
\begin{theorem}[Imbedding Theorem for Anisotropic Besov Spaces] \label{ITABS}
Let $\Omega$ be a domain in $\mathbb{R}^d$ satisfying the cone condition, and let $1\leq p\leq \infty$ and $1\leq q\leq \infty$.
(a) If $\underline{\boldsymbol{\alpha}} = d/p$, then $B^{\boldsymbol{\alpha}}_{p, 1} \to C^0_B(\Omega) \to L^{\infty}(\Omega)$.
(b) If $\underline{\boldsymbol{\alpha}} > d/p$, then $B^{\boldsymbol{\alpha}}_{p, \infty} \to C^0_B(\Omega)$.
\end{theorem}
\begin{proof}[Proof of Theorem \ref{ITABS}]
\textit{(a)}
First, we choose $\gamma\in (0,1)$ and $\boldsymbol{m}$ such that $\gamma \boldsymbol{m} = \boldsymbol{\alpha}$ and $\underline{\boldsymbol{m}} > n/p$. We take $\gamma = \theta := \frac{n}{\underline{\boldsymbol{m}}p} < 1$.
Let $u \in B^{\boldsymbol{\alpha}}_{p,1}(\Omega) = (L_p(\Omega), W^{\boldsymbol{m}}_{p}(\Omega))_{\gamma, 1;J}$ with $\gamma \in (0,1)$.
By the discrete version of the J-method in theorem 7.15 of \cite{adams2003sobolev}, there exist functions $u_i$ in $W^{\boldsymbol{m}}_p(\Omega)$ such that the series $\sum_{i = -\infty}^{\infty} u_i $ converges to $u$ in $B^{\boldsymbol{\alpha}}_{p,1}(\Omega)$ and such that the sequence $\{2^{-i\gamma} J(2^i, u_i)\}_ {-\infty}^{\infty}$ belongs to $\ell^1$ and has $\ell^1$ norm no larger than $C\|u\|_{B^{\boldsymbol{\alpha}}_{p,1}}$. Since $\underline{\boldsymbol{m}} p > d$ and $\Omega$ satisfies the cone condition, Theorem 1 shows that
\begin{align*}
\|v\|_{\infty} \leq C_1 \|v\|_p ^{1- \theta} \|v\|^{\theta}_{\boldsymbol{m}, p}
\end{align*}
for all $v \in W^{\boldsymbol{m}}_{p}(\Omega)$. Thus,
\begin{align*}
\begin{split}
\|u\|_{\infty}
\leq \sum_{-\infty}^{\infty} \|u_i\|_{\infty}
\leq C_1 \sum_{-\infty}^{\infty} \|u_i\|_p^{1 - \theta} \|u\|^{\theta}_{\boldsymbol{m}, p}
\leq C_1 \sum_{-\infty}^{\infty} 2^{-i\theta} J(2^i; u_i)
= C_1 \sum_{-\infty}^{\infty} 2^{-i\gamma} J(2^i; u_i)
\leq C_2 \ \|u\|_{B^{\boldsymbol{\alpha}}_{p,1}}.
\end{split}
\end{align*}
Since $\underline{\boldsymbol{m}} \gamma = \underline{\boldsymbol{\alpha}}$, if the condition $ \underline{\boldsymbol{m}} = d/p$ is satisfied, the conclusion holds.
\textit{(b)} follows from (a).
Since $W^{\boldsymbol{m}}_p(\Omega) \to L_p(\Omega)$, according to the Theorem \ref{ASIT}, we know that $(L_p(\Omega), W^{\boldsymbol{m}}_p(\Omega))_{\theta^{'},\infty}$ $\to (L_p(\Omega),W^{\boldsymbol{m}}_p(\Omega))_{\theta, 1}$, if $\theta^{'} > \theta$.
When $\theta = \frac{d}{\underline{\boldsymbol{m}} p}$, $\theta^{'} = \gamma$, we finish the proof.
\end{proof}
\section*{Reference}
\bibliographystyle{elsarticle-num}
| {'timestamp': '2018-10-05T02:14:48', 'yymm': '1810', 'arxiv_id': '1810.02321', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02321'} | arxiv |
\section{Introduction}\label{sec:intro}
A wireless sensor network (WSN) is a network composed of a large number of sensor nodes where each node is equipped
with processing, communication and sensing capabilities.
All the nodes work cooperatively to monitor physical or environmental conditions, such as temperature, sound and pressure. The development of WSNs are motivated by military and environmental applications, such as battlefield surveillance and flood detection\cite{Akyildiz2002}. Today such networks are used in widescope applications such as robotics, surveillance, smart grid and health care, etc \cite{Fax2004,Kim2012}.
Multi-sensor estimation through WSN gives higher accuracy than a single sensor node \cite{Saber2007}. Thus, a completely centralized Kalman filtering algorithm is proposed in which all the observations of the sensors are sent to a
central processing facility to perform the global data fusion.
However, a fine grained measurement setup will result in a large amount of information that requires further processing
and communication\cite{Bertsekas1999}. Due to the limited energy, communication, computation and storage resources, it may be impossible for all the sensors to send their observations to a central unit. Decentralized Kalman filtering iteration \cite{Yang2013} involves state estimation using the measurement of local neighboring nodes
in which there is no centralized processing station.
Different from the local decentralized Kalman filtering algorithm, the distributed Kalman filtering iteration incorporates the priori estimates of the neighbors into the estimation. Incorporation of neighboring states brings the opportunity to reach consensus throughout the network inherently on the state estimation.
The distributed Kalman filtering algorithm is proposed in which each node estimates the state by communicating with its neighbors and then reaches consensus on the system state. Under distributed Kalman filtering, a sensor does not have to transmit data to a center and can share the information with its neighbors to increase the reliability of the estimation and ensure consistency.
Consensus algorithms are powerful tools to carry out network-wide distributed computation tasks such as computing aggregate quantities and functions over networks \cite{Saber2007,Saber2004,Kempe2003,Boyd2005}.
The work of \cite{Saber2005a} focused on dynamic distributed sensor fusion to obtain consensus
weighted least-squares fused estimates for multiple measurements. However, \cite{Saber2005a} does not include the
system dynamic equations of targets and no direct connection is obtained with the Kalman filter. The work in \cite{Saber2005} proposed some distributed Kalman filtering algorithms, which include a network of micro-Kalman filters that embedded with a low-pass and a band-pass consensus filter. The Kalman consensus filtering algorithm first proposed in \cite{Saber2007(2)} has proved to be
a popular and influential distributed consensus-based framework
for dynamic state estimation. A formal stability and performance analysis of Kalman consensus filtering algorithm was given
in \cite{Saber2009}. The consensus terms in these papers
are added in an ad hoc fashion outside the Kalman filter
framework. Cattivelli and Sayed \cite{Cattivelli2010} proposed diffusion strategies for distributed filtering and smoothing. Simulation shows improved performance relative to the Kalman consensus filtering algorithm \cite{Saber2009}. Yu \textit{et al.} \cite{Yu2009} proposed a distributed consensus filtering algorithm based on pinning control, where only a small fraction of sensors need to measure the target information, with which the whole network can be controlled.
One of the key consideration in WSNs is that both
computation and transmission are time and energy consuming
tasks which have to be reduced as much as possible.
Strategies for distributed estimation \cite{Cattivelli2010,Cui2013,Demetriou2010,Spanos2005} are not closely related to the network topology and can reduce the rate of communication to cut down the energy cost. Besides, it is more flexible for ad-hoc deployment when compared with centralized and decentralized estimations\cite{Rao1993,Sanders1974}. However, there are also some challenges when adopting the distributed estimation strategy in WSNs. For example, the energy of sensors distributed in a complex environment is usually limited and the battery power is difficult to be regained or supplied. Thus, for a sensor, effectively selecting some of its neighboring sensors to send data to can extend the lifetime of its power source while guaranteeing a desired level of estimation quality.
Many literatures \cite{Saber2007(2),Cattivelli2010,Kamal2011,Kamal2013,Wang2014,Ji2017} have considered only the case of a stationary communication strategy which is described by
a constant consensus matrix. However, this is a simple model of communications in many practical applications.
For example, the WSNs need to frequently adjust the network topology due to dynamical operating environments.
In this case the adopted randomized gossip strategy can provide robustness with respect to dynamic environments,
even if network topology is subject to frequent and unpredictable variations.
The resilience to network topology changes makes gossip
protocols particularly appealing as an algorithmic framework for the distributed averaging problem in a dynamic setting. However, their rate of convergence is an issue. In fact, large number of iterations required to achieve target accuracy affect the energy budget and, in turn, the network lifetime. Therefore, several efforts have been made to improve convergence speed and mitigate energy consumption\cite{Freschi2016},\cite{Dimakis2006,Dimakis2008}.
Besides, the work in \cite{Li2017} investigates sensor transmission power control for remote state estimation. Instead of using a conventional sensor, a sensor equipped with an energy harvester which can obtain energy from the external environment is utilized.
Also it should be pointed out that in many practical applications a node cannot simultaneously receive data from two different
neighbor nodes (for example collision can destroy messages in wireless environment) and in some applications data cannot
simultaneously be transmitted to more than one node \cite{Fagnani2008}. This
fact makes the use of randomized consensus algorithms quite appealing as it picks up randomly one of its neighboring nodes and exchanges its estimate.
It turns out that randomized consensus strategies can achieve better performance than deterministic ones with comparable complexity.
In this paper, we propose the randomized gossip based distributed Kalman filtering algorithm which is robust against changes in topology. This method computes a local state estimate using the measurement data from the neighborhoods of every node. Subsequently, in the randomized consensus step one node randomly wakes up, picks up randomly one of its neighbor nodes and exchanges its estimate.
Our main technical contribution is to provide a formal stability and performance analysis of the proposed algorithm and show that the estimation performance is better when compared with $n$ noncooperative decentralized Kalman filtering algorithm. The use of randomized protocols avoids the need of cumbersome communication scheduling, reduces the need of time synchronization and may also reduce power consumption. A further cause of randomness in the communication is the potential unpredictability of the environment where these protocols are implemented: packet losses and collisions are in fact rather common in a sensor network. Finally, we consider optimal sensor scheduling for distributed estimation subject to limited power.
The main contributions of this paper are summarized as follows:
\begin{itemize}
\item [1)] Motivated by the results obtained in \cite{Saber2007(2)}, we derive the distributed implementation of the centralized Kalman filtering algorithm. The difference compared with \cite{Saber2007(2)} is that we adopt the randomized consensus algorithm for fusion of sensor data and covariance information.
\item [2)] Different from the works in \cite{Cattivelli2010} and \cite{Saber2007(2)} which focus on average consensus, we propose a novel distributed Kalman filtering algorithm based on randomized consensus algorithm which is robust against the changes of the network topology. Convergence is considered in the probabilistic sense. We provide a rigorous stability analysis which is one of the main technical contributions of this work. Under a sufficient condition that $\mathcal{P}(\mathcal{P}^{-})^{-1}(I \otimes A)$ is an orthogonal matrix, we show that the proposed algorithm is quite appealing as it has better performance than noncooperative decentralized Kalman filtering algorithm.
\item [3)] Considering the limited communication resource in WSNs, we provide a sub-optimal sensor scheduling scheme for distributed estimation subject to limited power.
\end{itemize}
The remainder of the paper is organized as follows. In section \ref{sec:problem setup}, we first introduce the system model, graph theory preliminary and randomized consensus algorithm. The distributed implementation of the centralized estimation based on the randomized consensus algorithm is then developed. In section~\ref{sec:RGDF}, we formulate the randomized gossip based distributed Kalman filtering algorithm and provide a formal stability and performance analysis. The optimal sensor scheduling for our distributed estimation subject to limited power is formulated in section \ref{sec:Problem statement}.
Section \ref{sec:simulation} presents a numerical example to illustrate the performance of the optimal sensor scheduling scheme and provides the performance comparison of different distributed Kalman filterings algorithms to show the optimality of our algorithm.
\textbf{Notations:}
$Z$ is the set of non-negative integers. $k$ is the time index. $N$ is the set of natural numbers. $R^{n}$ in $n$-dimensional Euclidian
spaces. $S^{n}_{+}$ and $S^{n}_{++}$ are the sets of $n\times n$
positive semi-definite and positive-definite matrices, respectively. When $X\in S^{n}_{+}$, we simply write $X\geq 0$ or $X>0$ if $X\in S^{n}_{++}$.
For a matrix $X$, $X'$ denotes its transpose. $Tr[\cdot]$ denotes the trace of a matrix. $X\geq Y$ if $X-Y \in S^{n}_{+}$. $E[\cdot]$ denotes the expectation of a random
variable. For function $f_{1},f_{2}$ with appropriate domains, $f_{1}f_{2}(x)$ denotes the function composition $f_{1}(f_{2}(x))$,
and $f^{n}(x)\triangleq f(f^{n-1}(x))$ with $ f^{0}\triangleq x$.
Symbol $\otimes$ represents the Kronecker product, $\lambda_{2}(M)$ denotes the second largest eigenvalues of matrix $M$.
\section{PRELIMINARIES And Problem Formulation}\label{sec:problem setup}
\subsection{System Model}
Considering the following discrete linear time-invariant system:
\begin{align}\label{systemdynamic}
x(k+1)=Ax(k)+w(k),
\end{align}
where $x(k)\in R^{m}$ is the system state vector at time $k$, $w(k)$ is the process noise. Assume that $x(0)$ and $w(k)$ are independent zero-mean Gaussian random vectors with covariances $\Pi_{0}$ and $Q$, respectively.
A sensor network composed of $n$ sensors is used to measure the system state $x(k)$. The measurement equation of the $i$th sensor is given by
\begin{align}
y_{i}(k)=C_{i}x(k)+v_{i}(k), i=1,2,...,n,
\end{align}
where $v_{i}(k)\in R^{m_{i}}$ is zero-mean white Gaussian with covariance matrix $R_{i}>0$ which is independent of $x(0), w(k)$, for $\forall k , i,$ and is independent of $v_{j}(s)$ when $i \neq j$ or $k \neq s$. Hence, we have
\begin{equation}
\begin{aligned}
&E\{[w(k), v_{i}[k], v_{j}[k]]^{T}[w(k), v_{i}[k], v_{j}[k]]\}\\
&=diag\{Q, R_{i}, R_{j}\}\delta_{kt}, i,j=1,...,n, i \neq j,
\end{aligned}
\end{equation} where $\delta_{kk}=1$ and $\delta_{kt}=0$ for $ k \neq t.$
The pair $(A ,C_{i})$ is assumed to be observable and $(A,\sqrt{Q})$ is controllable.
\subsection{Graph Theory Preliminaries}
We model the sensor network as a undirected graph $G=(\mathcal{V},\varepsilon)$ with the nodes $\mathcal{V}=\{1,2,....n\}$ being the sensors and the edges $\varepsilon \subset \mathcal{V} \times \mathcal{V}$ representing the communication links.
We define the adjacent matrix $ \Gamma =[\gamma_{ij}] $ as follows. When $\gamma_{ij}=1$, there exists an edge $(i,j)$ representing that the $j$th node receives data from the $i$th one, and $\gamma_{ij}=0$ indicates that the $j$th node does not receive data from $i$th one. Since a sensor node is always able to access its own observed values, we have $\gamma_{ii}=1$.
We consider undirected graph in this paper. The adjacent matrix of an undirected graph is defined as $ \gamma_{ij}=\gamma_{ji}$ if $(j,i)\in \varepsilon,$ where $i\neq j$.
The set of incoming neighbors to a node $v_{i}$ is given as $\mathcal{N}_{i}=\{j \in \mathcal{V}: \gamma_{ji}=1\}$, and the set of outgoing neighbors is defined as $O_{i}=\{j \in \mathcal{V}: \gamma_{ij}=1\}$. The in-degree of node $i$ denoted as $d^{I}_{i}$ is given by $d^{I}_{i}=|\mathcal{N}_{i}|$. Similarly, the out-degree $d^{O}_{i}$ of node $i$ is given by $d^{O}_{i}=|O_{i}|$.
\subsection{Estimation Algorithm}
We propose some notations which will be used in the remainder of the paper, where the expectations are taken with respected to the observed values and process noise $v_{i}(k),w(k)$ as follows:
\begin{equation}
\zeta^{i}_{k} \triangleq \{y_{i}(0),y_{i}(1),...,y_{i}(k)\}
\end{equation}
with $\zeta^{i}_{-1}\triangleq \emptyset$, $i=1,2,...n$. Furthermore, let
\begin{eqnarray}
\hat{x}^{i}_{k|k-1} &\triangleq& E[x^{i}_{k}|\zeta^{i}_{k-1}],\\
P^{i}_{k|k-1} &\triangleq& E[(x_{i}-\hat{x}^{i}_{k|k-1})(x_{i}-\hat{x}^{i}_{k|k-1})^{'}|\zeta^{i}_{k-1}],\\
\hat{x}^{i}_{k} &\triangleq& E[x^{i}_{k}|\zeta^{i}_{k}],\\
P^{i}_{k} &\triangleq& E[(x^{i}_{k}-\hat{x}^{i}_{k})(x^{i}_{k}-\hat{x}^{i}_{k})^{'}|\zeta^{i}_{k}].
\end{eqnarray}
where $P^{i}_{k|k-1}$ and $P^{i}_{k}$ denote the state covariance matrices and their inverses are known as the \textit{information matrices.} Note that $\hat{x}^{i}_{0|-1}=0$ and $P^{i}_{0|-1}=\Pi_{0}$. Here are the Kalman filtering iterations in the information form:
\begin{eqnarray}
(P^{i}_{k})^{-1}&=&(P^{i}_{k|k-1})^{-1}+C_{i}'R^{-1}_{i}C_{i},\\
K^{i}_{k}&=&P^{i}_{k}C_{i}'R^{-1}_{i}, \\
\hat{x}^{i}_{k}&=&\hat{x}^{i}_{k|k-1}+ K^{i}_{k}(y_{i}(k)-C_{i}\hat{x}^{i}_{k|k-1}),\\
P^{i}_{k+1|k}&=&AP^{i}_{k}A'+Q,\\
\hat{x}^{i}_{k+1|k}&=&A\hat{x}^{i}_{k}.
\end{eqnarray}
\subsection{Randomized Gossip Algorithm}
In the following, the randomized gossip algorithm which is used for reaching a consensus on the local estimates against changes in topology is introduced.
First, we define a stochastic matrix $P =[P_{ij}]$ of nonnegative entries with the condition that $P_{ij}>0$ only if $(i,j) \in \mathcal{V} \times \mathcal{V}$. For technical reasons, we assume that $P$ is a stochastic matrix.
We define a set of stochastic matrices as follows:
\begin{align}\label{15}
W_{ij}=I-\frac{(e_{i}-e_{j})(e_{i}-e_{j})^{'}}{2},
\end{align}
where $e_{i}=[0 ... 0 , 1 , 0...0]'$ is an $n \times 1$ unit vector with the $i$th component equal to 1.
Formally, let $\xi(t)$ denote the vector of state values at the end of the time-slot $t$. We have:
$
\xi(t+1)=W(t)\xi(t),
$
where the random matrix $W(t)$, with probability $\frac{1}{n}P_{i,j}$
is randomly selected from the set whose elements are defined in \eqref{15}, that is $W(t)=W_{ij}$.
According to \cite{Boyd2006}, if $\xi(t)$ converges to the vector of averages $\xi_{ave}\textbf{1}=\frac{\boldsymbol{1}\boldsymbol{1}^{T}}{n}\xi(0)$, we must have
$
\lim \limits_{t\rightarrow{\infty}}\Phi(t)=\lim\limits_{t\rightarrow{\infty}}W(t)W(t-1)\cdots W(0)=\boldsymbol{1}\boldsymbol{1}^{T}/n
$
for every initial condition $\xi(0)$.
To obtain the convergence of $\xi(t)$ to $\xi_{\infty}$, we will consider the convergence of consensus error defined as $e(t)=\xi(t)-\xi(\infty)$.
Thus, $e(k)$ evolves according to the same linear system as $\xi$.
Then, repeatedly conditioning and using the linear iteration, the following inequality holds \cite{Boyd2005}:
\begin{equation}\label{18}
E[e(k)^{T}e(k)]\leq \lambda_{2}^{k}(E[W^{T}W])||e(0)||^{2}_{2}.
\end{equation}
From this, we can see that the second moment of the error $e(k)$ converges to $0$ at a rate governed by $\lambda_{2}(E[W^{T}W])$.
This means that any scheme of choosing the $W(t)$ with second largest eigenvalue strictly less than 1 (and, of course, with $\rho(E(W)-\boldsymbol{1}\boldsymbol{1}^{T}/n)$ less than 1 \cite{Boyd2006}) is convergent in the second moment.
In \cite{Boyd2006} the authors also propose the $\varepsilon$-averaging time of the randomized consensus algorithm denoted by
$T_{ave}(\varepsilon)$ which is defined as
\begin{equation}
\sup \limits_{\xi(0)}\inf\Bigg\{t:Pr\Big[\frac{||\xi(t)-\xi_{ave}\textbf{1}||}{||\xi(0)||}\geq \varepsilon\Big]\leq \varepsilon\Bigg\},
\end{equation}
where $||v||$ denotes the $l_{2}$ norm of the vector $v$. Thus, the $\varepsilon$-averaging time is the smallest time it takes for $\xi(k)$ to be within $\varepsilon$ of $\xi_{ave}\textbf{1}$ with high probability, regardless of the initial value $\xi(0)$.
Let $W$ denote the expected value of $W(0)$ which is the same as $E(W(k))$: $W=\frac{1}{n}\sum_{i,j}P_{ij}W_{ij}.$
\begin{lemma}[\cite{Boyd2006}]\label{lemma2.1}
For the randomized consensus algorithm characterized by stochastic matrix $P$, for any initial vector $\xi(0)$, for $k\geq K^{*}(\varepsilon)$
\begin{equation}
Pr(\frac{||\xi(t)-\xi_{ave}\textbf{1}||}{||\xi(0)||}\geq \varepsilon)\leq \varepsilon ,
\end{equation}
where
$
K^{*}(\varepsilon)\triangleq \frac{3\log \varepsilon^{-1}}{\log\lambda_{2}(W)^{-1}}.
$
\end{lemma}
The result in Lemma \ref{lemma2.1} has the following intuitive explanation. For any randomized gossip algorithm with symmetric expectation matrix $E(W)$, the rate of convergence is governed by the second largest eigenvalue $\lambda_{2}(W)$.
\subsection{Centralized Kalman Filtering algorithm Implemented by Randomized Strategy}
Given the system dynamics \eqref{systemdynamic} with observations of $N$ nodes, we derive the distributed implementation of centralized filtering algorithm. Note that the incremental update of our proposed algorithm is similar to the update proposed in \cite{Saber2007(2)}. An important difference in the algorithm is in the consensus step.
In \cite{Saber2007(2)}, the authors attempt to reduce the disagreement regarding the state estimates using an \textit{ad hoc} approach by implementing a consensus step right after the estimation step while we adopt a randomized consensus strategy.
The cause of adopting randomized strategy in the communication is the
unreliable environment
where these protocols are implemented: packet losses, collisions and sensor nodes failures are in fact rather common in a sensor network.
The details of proposed centralized Kalman filtering algorithm based on randomized consensus strategy are summarized in \textit{Algorithm 1}.
\begin{algorithm}[htbp]\label{algor1}
\caption{Centralized Kalman filter based on randomized consensus strategy for sensor $i$}
\SetAlgoLined
1: \textbf{Initialization}: $k=0$, $P^{i}_{0|-1}=n\Pi_{0}$, $\hat{x}^{i}_{0|-1}=\textbf{0}$, consensus iterations $K$\footnotemark[1].\\
2: \While{ new observation data exists}{
3: Get observed value $y_{i}(k)$ and measurement information matrix $R^{-1}_{i}$. Compute information vector and matrix:
\begin{eqnarray*}
U_{i}(0)=C_{i}R_{i}^{-1}C_{i},
u_{i}(0)=C_{i}'R^{-1}_{i}y_{i}(k)
\end{eqnarray*}
4: Perform the average consensus on $u_{i}$ and $U_{i}$ independently.\\
\For{$t=1$ to $K$}{
a) Send $u_{i}(t-1)$ and $U_{i}(t-1)$ to all neighbors $j\in \mathcal{N}_{i} $\\
b) Receive $u_{j}(t-1)$ and $U_{j}(t-1)$ from all neighbors $j\in \mathcal{N}_{i}$\\
c) Update
\begin{equation*}
U_{i}(t)=W(t)U_{i}(t-1), u_{j}(t)=W(t)u_{j}(t-1)
\end{equation*}}
5: Compute the intermediate Kalman estimate of the
target state:
\begin{equation*}
\begin{aligned}
\quad \quad &(P^{i}_{k})^{-1}= (P^{i}_{k|k-1})^{-1}+U_{i}(K) \\
\quad \quad &\varphi^{i}_{k}=\hat{x}^{i}_{k|k-1}+P^{i}_{k}[u_{i}(K)-U_{i}(K)\hat{x}^{i}_{k|k-1}]
\end{aligned}
\end{equation*}
6: Update the state of the local Kalman filter:
\begin{eqnarray*}
\hat{x}^{i}_{k+1|k}=A \hat{x}^{i}_{k},
P^{i}_{k+1|k}=AP^{i}_{k}A'+Q,
\end{eqnarray*}}
\end{algorithm}
\begin{lemma}(\textit{cf. Theorem 1 in \cite{Saber2007(2)}})
Assume the nodes of the sensor networks solve two consensus problems that allow them to calculate the average inverse covariance $S$ and the average measurement $q$ at every iteration $k$. Then, every node of the network can calculate the state estimate $\hat{x}_{k}$ at iteration $k$ using the update equations as follows:
\begin{equation}
\begin{aligned}
M_{\mu}&=(P^{-1}_{\mu}+S)^{-1}, \\
\hat{x}_{k}&=\hat{x}_{k|k-1}+M_{\mu}(q-S\hat{x}_{k|k-1}),\\
P_{\mu}^{+}&=AM_{\mu}A'+Q_{\mu}, \\
\hat{x}_{k+1|k}&=A\hat{x}_{k}.
\end{aligned}
\end{equation} This gives a distributed estimate identical to the one obtained via a centralized Kalman filtering algorithm.
\end{lemma}
\begin{remark}
We assume that all nodes know the the number of nodes $n$ in wireless sensor networks or solve a consensus problem to calculate $n$. Then, the local and central state estimates for all nodes are the same, i.e., $\hat{x}^{c}_{k}=\hat{x}^{i}_{k}$ for all $i$.
\end{remark}
\begin{remark}
We know that the randomized gossip algorithm reaches the average consensus as time approaches infinity. In practical application, we define the $\epsilon$-average time which is the smallest time it takes for $x(k)$ to be within $\varepsilon$ of $x_{ave}\textbf{1}$ with high probability. In other words, if consensus iterations $K \geq \frac{3\log \varepsilon^{-1}}{\log\lambda_{2}(W)^{-1}},$ the system state $x(k)$ becomes within $\varepsilon$ of $x_{ave}\textbf{1}$.
\end{remark}
\footnotetext[1]{ When $K$ is larger than $K^{*}$, the system state can become within $\epsilon$ of the consensus value with high probability.}
This network of consensus scheme for centralized Kalman filtering algorithm is able to collaboratively provide an identical performance to the estimates obtained by a central Kalman filter given that all nodes agree on the two central sums.
Randomized gossip algorithm can approximate these sums and gives an approximate distributed Kalman filter for sensor networks. However, \textit{Algorithm 1} does not solve the distributed Kalman filtering problem. So far, we have shown that if two dynamic consensus problems in $S$ and $q$ are solved, then, a centralized Kalman filtering algorithm can be solved in a distributed way.
This paper will devote to
developing a novel randomized consensus based distributed Kalman filtering algorithm.
\subsection{Problems of Interest}
In our work, due to the limited single-sensor energy, computational ability, and communication capability, a large number of sensor nodes are commonly used in a wide region to estimate the same system state. Each sensor, through communication with its neighbors to exchange information, simultaneously estimates the global performance of the system
and updates its own estimates to improve the performance. Eventually, all nodes could reach a consensus agreement about the values of their estimates of the state. The main problems of interest are summarized as follows:
\begin{enumerate}
\item How to design a distributed estimation strategy that is adaptive to network topology changes?
\item What conditions can guarantee the convergence of the proposed distributed estimation algorithm?
\item How to maximize the estimation performance under limited energy budget?
\end{enumerate}
The detailed formulations and solutions to these problems are presented in the following section.
\section{Randomized Consensus based Distributed Kalman Filtering}\label{sec:RGDF}
In this section, we propose a novel approach to distributed Kalman filtering which depends on the estimation communication among neighboring nodes based on randomized gossip algorithm. This approach is referred to as randomized gossip based distributed Kalman filtering algorithm.
Before presenting this distributed Kalman filtering iteration, it is essential to introduce a more primitive noncooperative decentralized Kalman filtering algorithm that forms the basis of our algorithm.
\subsection {Decentralized Estimation Process}
Decentralized Kalman filtering algorithm have drawn a lot of
interest during the past few decades in
WSNs due to that they do not need a centralized processing
station \cite{Rao1993}, \cite{Sanders1974}.
\begin{figure}
\centering
\includegraphics[width=1\linewidth]{sensor.png}\\
\caption{A WSN exchanging information. (a) Measurement exchange; (b) Estimation exchange.}
\end{figure}
Assume that sensor node $i$ of the sensor network can exchange its observed value $y_{i}$, covariance information matrix $R_{i}$, and output matrix $C_{i}$ with its neighboring nodes $\mathcal{N}_{i}$.
At time $k$, all the sensor nodes first locally predict the state $x_{k}$. Then they transmit their local observed value to and receive these from their neighboring sensor nodes through available channels.
After the data communication, they update their local estimation.
For the $i$th sensor node, denote $\hat{x}^{i}_{k|k-1}$ as the priori estimate of $x(k)$, which is the predicted state estimate, and $\hat{x}^{i}_{k}$ as the posteriori estimate of $x(k)$ after updating the observed value
both taken by itself locally and sent by the other neighboring sensor nodes. Further denote $P^{i}_{k|k-1}$ and $P^{i}_{k}$ as the estimation error
covariance matrices of $\hat{x}^{i}_{k|k-1}$ and $\hat{x}^{i}_{k}$, respectively.
Computation of the aforementioned quantities are given as follows:
\begin{itemize}
\item At time $k$, sensor node $i$ first computes $\hat{x}^{i}_{k|k-1}$ and $P^{i}_{k|k-1}$ based on the following equations
\begin{align*}
\hat{x}^{i}_{k|k-1}=A \hat{x}^{i}_{k-1},
P^{i}_{k|k-1}=AP^{i}_{k-1}A'+Q,
\end{align*}
where the recursion starts from $\hat{x}^{i}_{0}=0$ and $P^{i}_{0}=\Pi_{0}$.
\item After the local observed value $y^{i}_{k}$ is acquired, sensor node $i$ transmits $y^{i}_{k}$ to their neighboring sensor nodes and receives the data from neighboring nodes by available edges. Then the sensor nodes first do the fusion of information. For sensor node $i$, define
\begin{align*}
S_{i} = \sum_{l \in \mathcal{N}_{i} }C_{l}R_{l}^{-1}C_{l}', \quad
q^{i}_{k} = \sum_{l\in \mathcal{N}_{i}}C_{l}'R^{-1}_{l}y_{l}(k).
\end{align*}
\item Then for node $i$, the incremental update is computed as follows:
\begin{align*}
(P^{i}_{k})^{-1}&= (P^{i}_{k|k-1})^{-1}+S_{i}, \\
\hat{x}^{i}_{k}&= \hat{x}^{i}_{k|k-1}+P^{i}_{k}[q^{i}_{k}-S_{i}\hat{x}^{i}_{k|k-1}].
\end{align*}
\end{itemize}
According to the standard Kalman filter, we know that $P^{i}_{k}$ converges to a steady-state value exponentially fast \cite{Yang2013}. Define
\begin{align}
P_{i}\triangleq \lim_{k\to \infty} P^{i}_{k}.
\end{align}
The computation of equations above shows that $P_{i}$ depends on the values of adjacent matrix $\Gamma$.
Should one avoid implementing any consensus, i.e., without further information communication regarding state estimations? The answer to this problem is rather simple. Actually, one can adopt local decentralized Kalman filtering which acts as a basis performance standard for distributed Kalman filtering algorithms. Intuitively, local decentralized Kalman filtering algorithm does not behave well due to the fact that a minority of nodes and their neighbors make poor observations due to environmental or geometric factors.
In local decentralized Kalman filtering algorithm, we assume that no nodes apart from its neighboring nodes
$\mathcal{N}_{i}$ can transmit the information data straight to node $i$. The case that its neighboring nodes transmit the information data from non-neighboring nodes to node $i$ is forbidden.
Consequently, sensor node $i$ can use a central Kalman filter that only utilize the observed values and output matrices of neighboring nodes. This results in the following primitive decentralized Kalman filtering iterations without a consensus on state estimates.
The optimal local state estimation above is generated by incrementally incorporating estimates and data sequentially from the neighborhoods. The iterations calculate the optimal estimate for every neighborhood only. In \cite{Saber2007(2)}, the authors proposed the novel distributed Kalman filtering algorithms for WSNs that have a wide range of applications.
\begin{algorithm}
\caption{Randomized consensus based distributed Kalman filtering algorithm (distributed Kalman filtering algorithm with a randomized gossiping step on estimates).}
\label{algorithm}
\SetAlgoLined
1: \textbf{Initialization}: $P_{0|-1}=\Pi_{0}$, $\hat{x}_{0|-1}=0$, $k=0$, consensus iterations $K$\footnotemark[2]. \\
2: At every time instant $k$: \\
\For{$i=1 \to n$ }{
a) Get the observed value $y_{i}(k)$. Compute the information vector and matrix
\begin{eqnarray*}
u_{i}=C_{i}R_{i}^{-1}C_{i},\quad
U_{i}=C_{i}'R^{-1}_{i}y_{i}(k);
\end{eqnarray*} \\
b) Broadcast information data containing $u_{i}$ and $U_{i}$ to neighboring nodes. \\
c) Receive information data from neighbors $l \in N_{i} $. Locally aggregate observed data and covariance matrices:
\begin{eqnarray*}
S_{i} = \sum_{l \in N_{i} }C_{l}R_{l}^{-1}C_{l}' ,\quad
q^{i}_{k} = \sum_{l\in N_{i}}C_{l}'R^{-1}_{l}y_{l}(k),
\end{eqnarray*}
d) Compute the intermediate Kalman estimate of the target state:
\begin{eqnarray*}
(P^{i}_{k})^{-1}&=& (P^{i}_{k|k-1})^{-1}+S_{i} \\
\varphi^{i}_{k}&=&\hat{x}^{i}_{k|k-1}+P^{i}_{k}[q^{i}_{k}-S_{i}\hat{x}^{i}_{k|k-1}]
\end{eqnarray*}
e) Estimate the target state after a randomized gossiping step: we first define
\begin{align*}
\hat{x}_{k}=[(\hat{x}^{1}_{k})',(\hat{x}^{2'}_{k})',(\hat{x}^{3}_{k})',...,(\hat{x}^{n}_{k})']'
\end{align*} and reduce the estimation disagreement of different sensor nodes:\\
\For{$t=1 \to K$}{
\begin{eqnarray*}
& \hat{x}_{k}=(W(t) \otimes I_{m})[(\varphi^{1}_{k})',(\varphi^{2}_{k})',...,(\varphi^{n}_{k})']',\\
& [(\varphi^{1}_{k})', (\varphi^{2}_{k})'...,(\varphi^{n}_{k})']'=[(\hat{x}^{1}_{k})',...,(\hat{x}^{n}_{k})']'.
\end{eqnarray*}
}}
f) Update the state of the local Kalman filter:
\begin{eqnarray*}
\hat{x}^{i}_{k+1|k}=A \hat{x}^{i}_{k},\quad
P^{i}_{k+1|k}=AP^{i}_{k}A'+Q.
\end{eqnarray*}
\end{algorithm}
The main difference between the above iteration and \cite{Saber2007(2)} are summarized as follows. \cite{Saber2007(2)} attempts to diminish the disagreement with regard to the state estimations in local Kalman filtering adopting an \emph{ad hoc} approach by implementing a consensus step right after the estimation step
\begin{align}\hat{\phi}^{i}_{k}=\hat{x}^{i}_{k}+\epsilon\sum_{j \in N_{i}}(\hat{x}^{j}_{k}-\hat{x}^{i}_{k}).\end{align}
This is equivalent to moving toward the average intermediate estimate of the neighboring nodes.
Based on the local Kalman filtering and randomized gossiping algorithm, we derive the distributed Kalman filtering algorithm updated by adding a random consensus step between the Kalman filtering updates.
The randomized gossiping step is an attempt to achieve the global state consensus by local node interaction.
The detailed realization of the randomized gossip based distributed Kalman filtering algorithm is as shown in \textit{Algorithm 2}.
\footnotetext[2]{When $K$ is larger than $K^{*}$ which is defined in \textit{Remark 1}, the system state can become within $\epsilon$ of the consensus value with high probability.}
The objective in the above algorithm is to diminish the estimation disagreement of different nodes.
The proposed randomized consensus algorithm exchanges information and computes in an arbitrary network. Besides, the proposed algorithm distributes the computational burden by communicating with a randomly chosen neighbor. It can be shown that the proposed algorithm has a better performance than local noncooperative decentralized Kalman filtering algorithm. The convergence and performance analysis are provided below.
\begin{remark}
The neighboring nodes of sensors are exclusively determined by the network topology at the sampling instant, while during sensor communication it is a set with random neighbors selected according to the randomized algorithm. With neighboring node being deterministic in the former case, the filtering algorithm is guaranteed to converge due to the connectivity condition indicated by $N_{i}$; in contrast, the random of neighboring node is exploited to improve the performance in the latter case.
\end{remark}
Although the consensus based Kalman filtering algorithm is highly interesting, the proof of convergence and performance analysis are relatively difficult so far. It is still an open issue. Our own work is in fact motivated by these results extended from Saber \cite{Saber2007(2)}. The main difference is that we use a different consensus algorithm in the paper and provide a convergence proof as follows.
\subsection{Convergence Analysis of Proposed Distributed Filtering Algorithm}
In this section, we analyze the mean-square error performance of the proposed algorithm.
Let $\widetilde{\varphi}^{i}_{k}=x_{k}-\varphi^{i}_{k}$ denote the estimation error at the end of the incremental update.
Denote $\widetilde{x}^{i}_{k|k-1}=x_{k}-\hat{x}^{i}_{k|k-1}$ and $\widetilde{x}^{i}_{k|k}=x_{k}-\hat{x}^{i}_{k|k}$ as the estimation error at the sensor node $i$. Furthermore, let
\begin{eqnarray*}
\widetilde{x}_{k|k}&=&[(\widetilde{x}^{1}_{k|k})',(\widetilde{x}^{2}_{k|k})',...,(\widetilde{x}^{n}_{k|k})']',\\\
\widetilde{\varphi}_{k}&=&[(\widetilde{\varphi}^{1}_{k})',(\widetilde{\varphi}^{2}_{k})',...,(\widetilde{\varphi}^{n}_{k})']'.
\end{eqnarray*} It follows that
\begin{eqnarray*}
\widetilde{\varphi}^{i}_{k} &=& x_{k}-\varphi^{i}_{k} \\
&=& x_{k}-\hat{x}^{i}_{k|k-1}-P^{i}_{k}\sum_{l \in \mathcal{N}_{i}}C_{l}'R^{-1}_{l}[y^{l}_{k}-C_{l}\hat{x}^{l}_{k|k-1}]\\
&=& \widetilde{x}^{i}_{k|k-1}- P^{i}_{k}\sum_{l \in \mathcal{N}_{i}}C_{l}'R^{-1}_{l}[C_{l}\widetilde{x}^{i}_{k|k-1}+v_{l}]\\
&=& P^{i}_{k}[(P^{i}_{k})^{-1}-S_{i}]\widetilde{x}^{i}_{k|k-1}-P^{i}_{k}\sum_{l \in \mathcal{N}_{i}}C_{l}'R^{-1}_{l}v_{l}\\
&=& P^{i}_{k}(P^{i}_{k|k-1})^{-1}\widetilde{x}^{i}_{k|k-1}-P^{i}_{k|k}\sum_{l \in \mathcal{N}_{i}}C_{l}'R^{-1}_{l}v_{l}.
\end{eqnarray*}
We also have
\begin{align}
\widetilde{x}^{i}_{k|k-1}=A \widetilde{x}^{i}_{k-1|k-1}+w(k).
\end{align}
Combining the above two equations into the consensus step, we obtain
\begin{eqnarray}
\widetilde{x}_{k|k}=(W(k) \otimes I_{m}) \widetilde{\varphi}_{k}.
\end{eqnarray}
Define $v_{k}=[(v^{1}_{k})',(v^{2}_{k})',(v^{3}_{k}),...,(v^{n}_{k})']'$ and $\mathcal{C}=diag\{C_{1},C_{2},C_{3}...C_{n}\}$. Besides, the priori and posteriori estimation error matrices of $n$ sensors are defined in a general form a
\begin{equation}
\begin{aligned}
\mathcal{P}_{k|k-1}&=diag\{P^{1}_{k|k-1},...,P^{n}_{k|k-1}\},\\
\mathcal{P}_{k}&=diag\{P^{1}_{k},...,P^{n}_{k}\}.
\end{aligned}
\end{equation}
We also define that
\begin{eqnarray*}
\mathcal{G}&=&[(C_{1}R^{-1}_{1}v_{1})',(C_{2}R^{-1}_{2}v_{1})',...,(C_{n}R^{-1}_{n}v_{n})']',\\
\mathcal{H}&=&\begin{bmatrix}
P^{1}_{k}(P^{1}_{k|k-1})^{-1}[A \widetilde{x}^{1}_{k-1|k-1}+w(k)] & \\
P^{2}_{k}(P^{2}_{k|k-1})^{-1}[A \widetilde{x}^{2}_{k-1|k-1}+w(k)] & \\
\vdots & \\
P^{n}_{k}(P^{n}_{k|k-1})^{-1}[A \widetilde{x}^{n}_{k-1|k-1}+w(k)]
\end{bmatrix}.
\end{eqnarray*}
The extended matrices may be defined as
\begin{align}
\mathcal{W} \triangleq W(k)\otimes I_{m}.
\end{align}
We further define a link matrix $\Gamma$ as follows:
\begin{align}
&[\Gamma]_{l,k} = \left\{ \begin{array}{ll}
1 ,& \textrm{if $l \in \mathcal{N}_{k}$}, \\
0 ,& \textrm{elsewhere},\\
\end{array} \right.
\end{align}and its extended matrix
\begin{align}
\mathcal{L}\triangleq \Gamma \otimes I_{m},
\end{align} where $\otimes$ denotes the Kronecker product. Observe that
\begin{align}
\widetilde{x}_{k|k}=\mathcal{W}'\mathcal{H}-\mathcal{W}'\mathcal{P}_{k}\mathcal{L}'\mathcal{G}
\end{align} or equivalently
\begin{equation}
\begin{aligned}\label{24}
\widetilde{x}_{k|k}=&\mathcal{W}\mathcal{P}_{k}[\mathcal{P}_{k|k-1}^{-1}(\mathbf{1} \otimes A)\widetilde{x}_{k-1|k-1}
+\mathcal{P}_{k|k-1}(I \\
& \otimes w(k))-\mathcal{L}'\mathcal{C}R^{-1}v_{k}].
\end{aligned}
\end{equation}
\begin{remark}
Taking expectations of both sides of equation \eqref{24}, we obtain the following recursion for the expectation of the estimate of the randomized gossip based Kalman filtering algorithm
\begin{equation}\label{eee}
E[\widetilde{x}_{k|k}]=E[\mathcal{W}\mathcal{P}_{k}[\mathcal{P}_{k|k-1}^{-1}(\mathbf{1} \otimes A)E[\widetilde{x}_{k-1|k-1}]].
\end{equation}
Since $E[\widetilde{x}_{0|-1}]=0$ and $E[\widetilde{x}_{0|0}]=0$, we conclude from \eqref{eee} that the proposed randomized consensus Kalman filtering estimation is unbiased.
\end{remark}
We provide the mean-square performance analysis in the following. Let $\mathcal{A}_{k}= \mathcal{P}_{k}\mathcal{P}_{k|k-1}^{-1}(\mathbf{1} \otimes A)$, $\mathcal{B}_{k}= \mathcal{P}_{k}\mathcal{P}_{k|k-1}^{-1},$ and
$\mathcal{D}_{k}=\mathcal{P}_{k}\mathcal{L}'\mathcal{C}R^{-1}$. Equation \eqref{24} can be rewritten in a more compact form as
\begin{align}\label{50}
\widetilde{x}_{k|k}=\mathcal{W}\mathcal{A}_{k}\widetilde{x}_{k-1|k-1}+\mathcal{W}\mathcal{B}_{k}(\mathbf{1} \otimes w(k))- \mathcal{W}\mathcal{D}_{k}v_{k}.
\end{align}
\begin{assumption}
The sensor communications are much faster than measurements so that consensus can be reached during two consecutive measurements.
\end{assumption}
\begin{assumption}
The local decentralized noncooperative Kalman filtering of each node that uses the data from neighborhoods converges to a steady value as time approaches infinity, i.e., $\lim\limits_{k\rightarrow{\infty}} P^{i}_{k|k-1}={P}_{i}^{-}$ and $\lim\limits_{k\rightarrow{\infty}}P^{i}_{k}={P}_{i}$, for~$\forall i\in \{1,2,...,n\}$ (see \cite{Kailath2000} for conditions on Kalman filter convergence).
\end{assumption}
Note that Assumption $1$ was used in \cite{Saber2007,Saber2005a}.
Under the Assumption $2$, the matrices $\mathcal{A}, \mathcal{B}, \mathcal{D}$ also converge to the steady-state, and their steady-state values are given by
\begin{eqnarray*}
\mathcal{P} &\triangleq& \lim\limits_{n\rightarrow{\infty}} \mathcal{P}_{k}=diag\{P_{1},P_{2},...P_{n}\},\\
\mathcal{P}^{-} &\triangleq& \lim\limits_{n\rightarrow{\infty}} \mathcal{P}_{k|k-1}=diag\{P_{1}^{-},P_{2}^{-},...P_{n}^{-}\},\\
\bar{\mathcal{A}} &\triangleq& \lim\limits_{k\rightarrow{\infty}} \mathcal{A}_{k}=\mathcal{P}(\mathcal{P}^{-})^{-1}(I \otimes A),\\
\bar{\mathcal{B}} &\triangleq& \lim\limits_{k\rightarrow{\infty}} \mathcal{B}_{k}=\mathcal{P}(\mathcal{P}^{-})^{-1}(I \otimes Q),\\
\bar{\mathcal{D}} &\triangleq& \lim\limits_{k\rightarrow{\infty}} \mathcal{D}_{k}=\mathcal{P}\mathcal{L}'\mathcal{C}'R^{-1}.
\end{eqnarray*}
Let $\mathcal{P}_{\widetilde{x},k}=E\{\widetilde{x}_{k|k}\widetilde{x}_{k|k}'\}$ denote the covariance matrix of the proposed estimation algorithm. When time $k$ is sufficiently large, based on equation \eqref{50}, the whiteness of noise on the state and the observed value, we obtain
\begin{equation}
\begin{aligned}
\mathcal{P}_{\widetilde{x},k}&=\mathcal{W}\mathcal{\bar{A}}\mathcal{P}_{\widetilde{x},k-1}\mathcal{\bar{A}}'\mathcal{W}'
+\mathcal{W}\mathcal{\bar{B}}(\mathbf{1}\mathbf{1}'\otimes Q)\mathcal{\bar{B}}'\mathcal{W}'
\\
&+\mathcal{W}\mathcal{\bar{D}}R\mathcal{\bar{D}}'\mathcal{W}'.
\end{aligned}
\end{equation}
When it is not involved in a randomized gossiping step, the sensor node does not exchange estimation information with neighbors, it is consistent with the local noncooperative decentralized Kalman filtering algorithm. The estimation error covariance matrix $\mathcal{P}_{k}$
converges to $\mathcal{P}$ as $k$ approaches infinity, where $\mathcal{P}$ is the steady state estimation error covariance matrix in decentralized Kalman filtering algorithm. Before providing a mean-square performance analysis, we introduce the following lemma.
\begin{lemma}\label{lemma1}
$Tr(P)\geqslant Tr(WPW')$, where $W$ is a symmetric stochastic matrix and $P$ is a symmetric positive-definite matrix.
\end{lemma}
\begin{IEEEproof}
Firstly, it is straightforward to have the following property \cite{Wilkinson2013}:
$Tr(ABC)=Tr(CAB)=Tr(CBA)$. Due to the fact that
$W$ and $P$ are all symmetric matrices, it is easy to obtain that $Tr(WPW')=Tr(W'WP)$. In order to demonstrate that $Tr(P)\geqslant Tr(WPW')$, it is equivalent to prove that $Tr(P)\geqslant Tr(W'WP)$, i.e., $Tr(P-W'WP)=Tr((I-W'W)P)\geqslant 0$. Owing to the fact that $W$ is a doubly stochastic matrix, $W'W$ is also a stochastic matrix and the maximal eigenvalue is equal to 1. Hence, $I-W'W$ is a positive semi-definite matrix due to the fact that $x(I-W'W)x' \geqslant 0$ for any vector $x$. By using Cholesky factorization, $P$ can
be factorized as $P=RR'$. We can see that $Tr((I-W'W)P)=Tr((I-W'W)RR')=Tr(R'(I-W'W)R)$, and $R'(I-W'W)R$ is a positive semi-definite matrix because $x'R'(I-W'W)Rx \geqslant 0$ for any vector $x$. Consequently, $Tr(R'(I-W'W)R)\geqslant 0$. This proves that $Tr(P)\geqslant Tr(W'WP)$ and completes the proof of lemma \ref{lemma1}.
The stability and convergence analysis of the proposed algorithm are summarized in the following theorem.
\end{IEEEproof}
\begin{theorem}
The estimation error covariance of our proposed algorithm is defined as $\mathcal{P}_{\widetilde{x},k}=E\{\widetilde{x}_{k|k}\widetilde{x}_{k|k}'\}$ and
$\mathcal{P}_{\widetilde{x},k}$ follows the iteration:
\begin{eqnarray}
&E[\mathcal{P}_{\widetilde{x},k}]=T(E[\mathcal{P}_{\widetilde{x},k-1}]):R^{nm \times nm}\rightarrow R^{nm \times nm} \notag,
\end{eqnarray}
where
$T(\mathcal{P}_{\widetilde{x},k})\triangleq E[\mathcal{W}\mathcal{\bar{A}}\mathcal{P}_{\widetilde{x},k-1}\mathcal{\bar{A}}'\mathcal{W}'
+\mathcal{W}\mathcal{\bar{B}}(\mathbf{1}\mathbf{1}'\otimes Q)\mathcal{\bar{B}}'\mathcal{W}'
+\mathcal{W}\mathcal{\bar{D}}R\mathcal{\bar{D}}'\mathcal{W}'] \notag
$
and $\mathcal{P}_{0}=\mathcal{P}_{\widetilde{x},0} \geq 0$. Then the expectation of estimation error covariance matrix $E[\mathcal{P}_{\widetilde{x},k}]$ converges exponentially to a unique fixed point $\mathcal{\bar{P}}_{\widetilde{x}}$ of the mapping $T$.
\begin{IEEEproof}
See the proof in Appendix A.
\end{IEEEproof}
\end{theorem}
Next, we show that our proposed algorithm achieves better performance than
decentralized Kalman filtering algorithm under a sufficient condition in the following theorem.
\begin{theorem}
Let $\mathcal{P}_{k}$ be the error covariance matrix of noncooperative decentralized Kalman filtering algorithm such that $\mathcal{P}_{k}$ converges to the unique steady state $\mathcal{P}$ for any initial condition.
Suppose that $\mathcal{\bar{A}}=\mathcal{P}(\mathcal{P}^{-})^{-1}(I \otimes A)$ is an orthogonal matrix, then $Tr(E[\mathcal{P}_{\widetilde{x},k}]) \leqslant Tr(\mathcal{P}_{k})$, $\forall k\in R$.
\end{theorem}
\begin{IEEEproof}
The proof is shown in Appendix B.
\end{IEEEproof}
\begin{remark}
To compute the randomized gossip based Kalman filtering algorithm, node $i$ needs to have knowledge of $ (P^{i}_{k|k-1})^{-1}$. In general, computation of $ (P^{i}_{k|k-1})^{-1}$ requires the knowledge of the entire covariance matrix (i.e., the prior covariance of each node and the prior cross-covariances between each pair of nodes). However, computing $(\mathcal{P}^{-})^{-1}$ at every time step at each node in a distributed framework is unrealistic as it would require too much information. When the prior state estimates across the nodes are uncorrelated to each other\cite{Kamal2013}, in this case the $(\mathcal{P}^{-})^{-1}$ can be computed at each node using only a node's own prior covariance matrix (which is of great practical importance).
\end{remark}
In the next section, we will provide a sub-optimal sensor
scheduling scheme for distributed estimation subject to limited power.
\section{Optimal Sensor Connection Scheme}\label{sec:Problem statement}
Some resources such as battery power or channel bandwidth are consumed when the sensors transmit information in WSNs. In this section, we aim to minimize the estimation error while guaranteeing that the specified resource consumption is within a budget.
We consider the average steady-state estimation
error of the $n$ sensor nodes:
\begin{align}
J(\Gamma)=\frac{1}{n}\sum^{n}_{i=1}Tr(E[\mathcal{{P}}_{\widetilde {x}, i}]),
\end{align}
where $\mathcal{{P}}_{\widetilde {x}, i}$ is the steady state estimation error of sensor $i$ when adopting randomized gossip consensus based distributed Kalman filtering algorithm.
We consider the following power constraint for sensor $i$:
\begin{align}
\sum_{j\in N_{i}}c_{ij}\gamma_{ij}+\frac{1}{n}P_{ij}c_{ij} \leq \delta_{i},
\end{align}
where $\delta_{i}$ is a given constant quantifying the power budget of sensor $i$ imposed at each time instant, and $c_{ij}$ is a parameter indicating the communication cost on transmitting data from sensor $i$ to sensor $j$. And node $i$ is active with probability $\frac{1}{n}$, it will contact one neighbor $j$ with probability $P_{ij}$. In practice, the $c_{ij}'s$ can be different due to different location of the sensors in a large range. We design the optimal sensor schedule while adopting proposed algorithm as:
\begin{problem}\label{pro1}
\begin{eqnarray}\label{problem1}
&min& J(\Gamma) \notag\\
&s.t.& \sum_{j\in N_{i}}c_{ij}\gamma_{ij}+\frac{1}{n}P_{ij}c_{ij} \leq \delta_{i},\\
&for& all \quad i=1,2,...,n, \gamma_{ij}=0,1.\notag
\end{eqnarray}
\end{problem}
In section \ref{sec:RGDF}, we have proved that the upper bound of the expected error covariance of our proposed algorithm converges to a unique limit. This shows that the steady state error covariance of our algorithm exists. We turn to tackle Problem \ref{pro1} formulated in \eqref{problem1}.
To solve Problem \ref{pro1}, we transform the implicit form of $J(\Gamma)$ with respect to the optimization variable into explicit one.
Assume that $\gamma_{ij}$ and $\gamma_{ji}$ are independent, we can decompose the Problem \ref{pro1} into $n$ independent optimization problems as follows:
\begin{problem}\label{pro2}
\begin{eqnarray}
&min& \frac{1}{n}Tr(E[\mathcal{{P}}_{\widetilde {x}, i}]) \notag\\
&s.t.& \sum_{j\in N_{i}}c_{ij}\gamma_{ij}+\frac{1}{n}P_{ij}c_{ij} \leq \delta_{i},\\
&for& \gamma_{ij}=0,1.\notag
\end{eqnarray}
\end{problem}
Since the explicit form of the state expected error covariance $E[\mathcal{{P}}_{\widetilde {x}, i}]$ is difficult to obtain due to its randomness, we replace the objective function in Problem \ref{pro2} by the upper bound of the steady-state error covariance $\mathcal{P}_{i}$.
We relax Problem \ref{pro2} as the following optimization problem:
\begin{problem}\label{pro3}
\begin{eqnarray}
&min& \frac{1}{n}Tr(\mathcal{P}_{i}) \notag\\
&s.t.& \sum_{j\in N_{i}}c_{ij}\gamma_{ij}+\frac{1}{n}P_{ij}c_{ij} \leq \delta_{i},\\
&for& \gamma_{ij}=0,1.\notag
\end{eqnarray}
\end{problem}
One of the difficulties to solve the Problem lies in the implicit form of $\mathcal{P}_{i}$ with respect to the optimization variables. We address this difficulty in the following part.
Using the Cholesky factorization, $S_{i}$ can be factorized as
$S_{i}=H_{i}'H_{i}$. Let $H\triangleq(H_{1}',H_{2}',...,H_{n}')'$. Define $\Xi\triangleq diag\{\gamma_{i1}I_{p_{1}},\gamma_{i2}I_{p_{2}},...,\gamma_{in}I_{p_{n}}\}$, where $I_{p_{i}}$ is the identity matrix with order $p_{i}$, i.e., the order of $y_{i}(k)$. We further define the operator $\hat{g}(X;\Xi)$ as
\begin{align}
\hat{g}(X;\Xi)\triangleq ([h(X)]^{-1}+H'\Xi H)^{-1},
\end{align}
where $h(X)=AXA'+Q$.
Notice that $\mathcal{P}_{i}$ satisfies $\mathcal{P}_{i}=\hat{g}(\mathcal{P}_{i};\Xi)$. Then Problem \ref{pro3} is equivalent to the following problem:
\begin{problem}\label{pro4}
\begin{eqnarray}
&min_{\Xi,X}& \frac{1}{n}Tr(X) \notag\\
&s.t.& X \geqslant \hat{g}(X;\Xi), \notag\\
&& \sum_{j\in N_{i}}c_{ij}\gamma_{ij}+\frac{1}{n}P_{ij}c_{ij} \leq \delta_{i}, \\
&& \gamma_{ij}=0,1.\notag
\end{eqnarray}
\end{problem}
Problem \ref{pro4} is still not solvable using any efficient numerical algorithm since the feasible domains given by $X \leqslant \hat{g}(X;\Xi)$ and $\gamma_{ij}=0,1$ are not convex. For the former inequality, one \cite{Sinopoli2004} has the following result.
\begin{lemma} If $(A,C_{i})$ is detectable and $(A,\sqrt{Q})$ is controllable, the following statements are equivalent: \label{lemma2}
\begin{enumerate}
\item $\exists X $ such that $X \geqslant \hat{g}(X,\Xi). $
\item $\exists Z,Y$ such that \\\
$\left[
\begin{matrix}
Y & (Y -Z C_{i})\hat{A} & Y- Z C_{i} & Z \\
\hat{A}'(Y-C_{i}'Z') & Y & 0 & 0 \\
Y-C_{i}'Z' & 0 & Q^{-1} & 0 \\
Z' & 0 & 0 & \Xi\\
\end{matrix}
\right]\geqslant 0.$ Moreover, for $Y$ satisfying the inequality in $2)$, $X=Y^{-1}$ is a solution to the inequality in $1)$. It is also true conversely.
\end{enumerate}
\end{lemma}
\begin{IEEEproof}
The proof is similar to that of Theorem 5 in \cite{Sinopoli2004}.
\end{IEEEproof}
Recalling the properties of Lemma \ref{lemma2}, it can be seen that Problem \ref{pro4} is equivalent to the following one:
\begin{problem}\label{pro5}
\begin{equation*}
\begin{aligned}
&min_{\Xi,X,Y,Z} \frac{1}{n}Tr(X) \\
&s.t. \left[ \begin{matrix} X & I \\ I & Y \end{matrix} \right]\geqslant 0 ,& \\
& \left[ \begin{matrix}Y & (Y -Z C_{i})\hat{A} & Y- Z C_{i} & Z \\ \hat{A}'(Y-C_{i}'Z') & Y & 0 & 0 \\ Y-C_{i}'Z' & 0 & Q^{-1} & 0 \\ Z' & 0 & 0 & \Xi \\ \end{matrix}\right] \geqslant 0 , \\
&\sum_{j\in N_{i}}c_{ij}\gamma_{ij}+\frac{1}{n}P_{ij}c_{ij} \leq \delta_{i},\gamma_{ij}=0,1.
\end{aligned}
\end{equation*}
\end{problem}
Since the feasible domains of $\gamma_{ij}$ is discrete, Problem \ref{pro5} is a Boolean-convex problem which is a common issue when applying numerical methods. A relaxation on the feasible domains is often used to obtain a convex problem \cite{Joshi2009}.
\begin{remark}
Considering the problem which is the same as Problem \ref{pro5} except that the constraint $\gamma_{ij}=0,1$ is replaced by $0\leqslant \gamma_{ij}\leqslant 1$. Denote the solution by $\Gamma^{+}$ and the optimal value by $J^{+}$. Although it is not equivalent to the original problem, the optimal objective value of this relaxed problem is clearly seen to be a lower bound of Problem \ref{pro5}, i.e., $J^{*} \geqslant J^{+}$. The elements of $\Gamma^{+}$ may be fractional. We use $\Gamma^{+}$ to obtain a feasible solution to Problem \ref{pro5} denoted as
$\Gamma^{f}$, which chooses the first $d$ largest element in each row of matrix $\Gamma^{+}$. Although this solution is a relaxed one, the
discretized solution $\Gamma^{f}$ should be close to or may even coincide with the optimal solution $\Gamma^{*}$.
\end{remark}
\section{Simulation Example} \label{sec:simulation}
We present below one example to illustrate our main results.
\begin{example}
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{topology.pdf}\\
\caption{The network topology}\label{topology}
\end{figure}
To illustrate the better performance of our proposed algorithm compared with the distributed solution in \cite{Saber2007(2),Cattivelli2010}, we present a simulation example in this section and visualize the results in the following.
Consider a WSN composed of $n=5$ sensors with the network topology in Fig.~2. The system parameters and the adjacency matrix $\Gamma$ are given as follows:
\begin{align*}
A=\begin{pmatrix}
1.01 & 0 \\
0 & 1.01
\end{pmatrix}, \quad \quad C_{i}=\begin{pmatrix} 2\upsilon_{i} & 0 \\ 0 & 2\upsilon_{i} \end{pmatrix},\end{align*}
\begin{align*} Q=\begin{pmatrix} 0.00002
& 0 \\ 0 & 0.00002 \end{pmatrix},\quad R_{i}=\begin{pmatrix}0.5 & 0 \\ 0 & 0.5\end{pmatrix},
\end{align*}
$\Gamma=
\left(
\begin{array}{ccccc}
1 & 1 & 0 & 0 & 0 \\
1 & 1 & 0 & 1 & 0 \\
1 & 0 & 1 & 0 & 0 \\
0 & 0 & 1 & 1 & 0 \\
0 & 1 & 0 & 0 & 1 \\
\end{array}
\right)$, where random variable $\upsilon_{i}\in(0,1]$. In this example, we consider the case that measurement noise of each sensor is identical, i.e., $R_{i}=R_{j}$, for all $i,j\in \mathcal{V}$.
First, we show the asymptotically convergence of the trace of estimation error covariance matrix of each node in Fig.~\ref{1} and Fig.~\ref{2}, which adopts randomized consensus Kalman filtering algorithm in the WSNs. As depicted in Fig.~\ref{1} and Fig.~\ref{2}, the estimation error, i.e., the trace of error covariance matrix of each node is asymptotically stable when time is long enough. Furthermore, we also compare the performance of different estimation algorithms with different numbers of consensus iteration $K$. Here $K$ is varied from $1$ to $41$ at increments of $5$. Other parameters are kept constant and the priors are chosen to be equal.
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{iteration.eps}\\
\caption{Compare performance of different iteration $K$}\label{iteration}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{sensor12.eps}\\
\caption{The trace of error covariance matrix of sensors: sensor 1 and sensor 2.}\label{1}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{sensor345.eps}\\
\caption{The trace of error covariance matrix of sensors: sensor 3, sensor 4, and sensor 5.}\label{2}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{Estimation_error.eps}
\caption{Estimation error per node using randomized gossip based distributed Kalman filtering algorithm. All the curves are obtain after averaged by 100 times.}\label{a}
\end{figure}
Our next step is to define the mean-square estimation error of tracking state (MSEE) for sensor $i$ at time $k$ as
\begin{equation}
MSEE_{i}(k)=||x(k)-\hat{x}^{i}_{k}||^{2}.
\end{equation}
In Fig.~\ref{fig:state_error}, we show the mean-square estimation error of tracking state per node adopting randomized gossip based distributed Kalman filtering algorithm. Fig. \ref{fig:no_consensus} depicts the mean-square estimation error per node without cooperation steps. As depicted in Figs. \ref{fig:state_error} and \ref{fig:no_consensus}, Fig. \ref{fig:state_error} has a coincident state performance due to cooperation steps while there exists disagreement among sensors in Fig.~ \ref{fig:no_consensus}.
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{state_error.eps}\\
\caption{Estimation error of tracking state per node using gossip based distributed Kalman filtering algorithm. All the curves are obtained after being averaged by 100 times.}\label{fig:state_error}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{No_consensus_filter.eps}\\
\caption{Estimation error per node without cooperation step}\label{fig:no_consensus}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{Performance_compare.eps}\\
\caption{The performance compare of randomized gossip based distributed Kalman filtering algorithm, diffusion strategy based Kalman filtering algorithm, and local noncooperative Kalman filtering algorithm. All the curves are obtained after being averaged by 100 times.}\label{d}
\end{figure}
Fig. \ref{d} compares the performance of different cases including randomized gossip consensus, diffusion strategy, and noncooperation strategy based distributed Kalman filtering algorithm, respectively.
Moreover, for the comparison of three distributed Kalman filtering methods in detail, the average
mean-square estimation error (MSEE) of $n$ sensors tracking state error are further employed to analyze the performance and defined as follows:
\begin{equation}
MSEE_{ave}(k)=\frac{1}{n}\sum_{i=1}^{n}MSEE_{i}(k).
\end{equation}
As depicted in Fig. \ref{d}, all the results are obtained after being averaged by 100 times. The proposed randomized gossip based Kalman filtering algorithm has smaller average mean-square estimation error than other two methods.
Finally, we also show the average disagreement of state tracking by adopting our proposed algorithm, diffusion strategy based Kalman filtering algorithm, and local noncooperative Kalman filtering algorithm in Fig.~\ref{c}.
To measure the disagreement of the estimates independent of network topology, we evaluate the performance of the algorithm
by a normalized version of the distance from the consensus value as follows:
\begin{equation}
||\delta||=(\sum_{i=1}^{n}||\hat{x}_{i}-x_{A}||_{2}^{2})^{1/2}
\end{equation}
with $x_{A}=\frac{1}{n}\sum_{i=1}^{n}\hat{x}_{i}$.
\begin{figure}[ht]
\centering
\includegraphics[width=0.5\textwidth]{delta_compare.eps}\\
\caption{Disagreement Estimates. All the curves are obtain after averaged by 100 times.}\label{c}
\end{figure}
As depicted in Fig. \ref{c}, the estimation disagreement of gossip strategy and diffusion strategy based Kalman filtering algorithm are smaller than local noncooperative Kalman filtering algorithm due to consensus steps.
\end{example}
\section{Conclusions}\label{sec:conclusion}
In this paper, we have proposed a novel algorithm called randomized gossip based distributed Kalman filtering algorithm. Under some mild assumption, we have obtained a sufficient condition for guaranteeing the convergence of the expected estimation error covariance for the proposed algorithm. We also investigate the sensor scheduling problem for distributed estimation when adopting randomized gossip based distributed Kalman filtering algorithm under the power constraint. By relaxing the optimal sensor scheduling problem to a convex optimization problem in a set of linear matrix inequalities, we have provided the sub-optimal solution. The simulation results verify that the better estimates can be obtained when compared with the diffusion based distributed Kalman filtering algorithm and noncooperative decentralized Kalman filtering algorithm. Besides, the average disagreement of estimates of our algorithm is smaller than noncooperative decentralized Kalman filtering algorithm and diffusion strategy based Kalman filtering algorithm.
In our current work, we investigate the scheduling problem when adopting proposed algorithm in a reliable channel. However, in practical applications, channels may be unreliable and have packet delays or droppings. As a future work, we will study other general communication channel models including packet-delay or fading ones.
\begin{appendices}
\section{Proof of Theorem 4.1}
The iteration is obvious. The estimation error covariance $\mathcal{P}_{\widetilde{x},k}$ depends upon the $\mathcal{W}$ which is randomly selected from the set at every time $k$. Thus, we
show that the estimation error covariance of our proposed algorithm converge in expectation to the stable state as follows.
We focus on the proof of the fixed point of the error covariance matrix. For any $X,Y \in R^{nm \times nm}$, we have
\begin{equation*}
||T(X)-T(Y)||^{2}=Tr((T(X)-T(Y))(T(X)-T(Y))'),
\end{equation*}
where $||\cdot||$ represents Frobenius norm. Denote
$\mathcal{\bar{W}}=E[\mathcal{W}]=E[W(k)]\otimes I_{m}=W \otimes I_{m}$, where $W$ is given in equation \eqref{23}.
From the discussion above, we know that
\begin{equation*}
\begin{aligned}
&||T(X)-T(Y)||^{2}=Tr((\mathcal{\bar{W}}[\mathcal{\bar{A}}X \mathcal{\bar{A}}'+\mathcal{\bar{B}}(\mathbf{1}\mathbf{1}'\otimes Q)\mathcal{\bar{B}}'+\\
&\mathcal{\bar{D}}R\mathcal{\bar{D}}']\mathcal{\bar{W}}'-\mathcal{\bar{W}}[\mathcal{\bar{A}}Y \mathcal{\bar{A}}'+\mathcal{\bar{B}}(\mathbf{1}\mathbf{1}'\otimes Q)\mathcal{\bar{B}}'+\mathcal{\bar{D}}R\mathcal{\bar{D}}']\mathcal{\bar{W}}'
)(\cdot)').
\end{aligned}
\end{equation*}
Define $ \varGamma(X)=\mathcal{\bar{A}}X \mathcal{\bar{A}}'+\mathcal{\bar{B}}(\mathbf{1}\mathbf{1}'\otimes Q)\mathcal{\bar{B}}'+\mathcal{\bar{D}}R\mathcal{\bar{D}}' $ and
$\varGamma(Y)=\mathcal{\bar{A}}Y \mathcal{\bar{A}}'+\mathcal{\bar{B}}(\mathbf{1}\mathbf{1}'\otimes Q)\mathcal{\bar{B}}'+\mathcal{\bar{D}}R\mathcal{\bar{D}}'$.
Then, we have
\begin{equation*}
\begin{aligned}
&Tr((T(X)-T(Y))(T(X)-T(Y))')\\
&=Tr((\mathcal{\bar{W}}(\varGamma(X)
-\varGamma(Y))\mathcal{\bar{W}}')(\mathcal{\bar{W}}(\varGamma(X)-\varGamma(Y))\mathcal{\bar{W}}')')\\
&\overset{a}{=}Tr(\mathcal{\bar{W}}\mathcal{\bar{W}}'((\varGamma(X)-\varGamma(Y))(\varGamma(X)-\varGamma(Y))^{'}\mathcal{\bar{W}}^{'}\mathcal{\bar{W}}).
\end{aligned}
\end{equation*}
The equality (a) is derived from the fact that $Tr(ABC)=Tr(ACB)=Tr(BAC)=Tr(BCA)=Tr(CAB)=Tr(CBA).$
Note that the estimation error covariance matrix of the decentralized Kalman filtering converges to a steady state.
More specifically, when $W$ is always an identity matrix, $\varGamma$ is a contraction mapping due to the convergence of decentralized Kalman filtering algorithm.
\begin{equation*}
Tr((\Gamma(Y)-\Gamma(X)(\Gamma(Y)-\Gamma(X)')
\leq \rho ||Y-X||,
\end{equation*}
where $\rho\in(0,1)$.
Thus, according to the above discussions, we have that
\begin{equation}\label{52}
\begin{aligned}
&||T(Y)-T(X)||^{2}=Tr((T(X)-T(Y))(T(X)-T(Y))')\\
&=Tr(\mathcal{\bar{W}}\mathcal{\bar{W}}'((\varGamma(X)-\varGamma(Y))(\varGamma(X)-\varGamma(Y))^{'}\mathcal{\bar{W}}^{'}\mathcal{\bar{W}})\\
&\overset{b}{\leq} Tr((\Gamma(Y)-\Gamma(X)(\Gamma(Y)-\Gamma(X)')
\leq \rho ||Y-X||.
\end{aligned}
\end{equation}
The inequality (b) is derived from the lemma \ref{lemma1} based on the fact that $(\Gamma(Y)-\Gamma(X))(\Gamma(Y)-\Gamma(X))'$ is a symmetric positive-definite matrix and $\mathcal{\bar{W}}$ is a symmetric stochastic matrix. The inequality \eqref{52} illustrates that $T$ is a contraction mapping and a unique fixed point exists for the mapping $T$ according to the Banach fixed point theorem. Thus the conclusion follows.
\section{Proof of Theorem 4.2}
We demonstrate that $Tr(E[\mathcal{P}_{\widetilde{x},k}]) \leqslant Tr(\mathcal{P}_{k})$, $\forall k\in R$ by induction as follows. First note that the initial condition $\mathcal{P}_{0}=\mathcal{P}_{\widetilde{x},0} \geq 0$. Thus $Tr(E(\mathcal{P}_{0}))=Tr(\mathcal{\hat{P}}_{0})$ is tenable at time $k=0$.
Then assume that at time $k$, there holds $Tr(E[\mathcal{P}_{\widetilde{x},k}]) \leqslant Tr(\mathcal{P}_{k})$.
What we need to prove is that $Tr(E[\mathcal{P}_{\widetilde{x},k+1}])\leqslant Tr(\mathcal{P}_{k+1})$ also holds at time $k+1$.
We have that $E(\mathcal{P}_{\widetilde{x},k+1})=E(\mathcal{W}\mathcal{\bar{A}}\mathcal{P}_{\widetilde{x},k}\mathcal{\bar{A}}'\mathcal{W}'+\mathcal{W}\mathcal{\bar{B}}(\mathbf{1}\mathbf{1}'\otimes Q)\mathcal{\bar{B}}'\mathcal{W}'+\mathcal{W}\mathcal{\bar{D}}R\mathcal{\bar{D}}'\mathcal{W}')$.
By using the full probability formula based on the conditional expectation, we obtain that $E(\mathcal{P}_{\widetilde{x},k+1})=E(E(\mathcal{P}_{\widetilde{x},k+1}|\mathcal{P}_{\widetilde{x},k}))$, and $
E(E(\mathcal{P}_{\widetilde{x},k+1}|\mathcal{P}_{\widetilde{x},k}))=E[\mathcal{W}\mathcal{\bar{A}}E(\mathcal{P}_{\widetilde{x},k})\mathcal{\bar{A}}'\mathcal{W}'+
\mathcal{W}\mathcal{\bar{B}}(\mathbf{1}\mathbf{1}'\otimes Q)\mathcal{\bar{B}}'\mathcal{W}'
+\mathcal{W}\mathcal{\bar{D}}R\mathcal{\bar{D}}'\mathcal{W}']$. Combining these relations, we have
\begin{equation*}
\begin{aligned}
&Tr(E(\mathcal{P}_{\widetilde{x},k+1}))=Tr(E[E(\mathcal{W}\mathcal{\bar{A}}\mathcal{P}_{\widetilde{x},k}\mathcal{\bar{A}}'\mathcal{W}'
+\mathcal{W}\mathcal{\bar{B}}(\mathbf{1}\mathbf{1}' \\
&\otimes Q) \mathcal{\bar{B}}'\mathcal{W}'+\mathcal{W}\mathcal{\bar{D}}R\mathcal{\bar{D}}'\mathcal{W}')])=Tr(\mathcal{W}\mathcal{\bar{A}}E(\mathcal{P}_{\widetilde{x},k})\mathcal{\bar{A}}'\mathcal{W}'\\
&+\mathcal{W}\mathcal{\bar{B}}(\mathbf{1}\mathbf{1}'\otimes Q)\mathcal{\bar{B}}'\mathcal{W}'+\mathcal{W}\mathcal{\bar{D}}R\mathcal{\bar{D}}'\mathcal{W}').
\end{aligned}\end{equation*}
Now, $\mathcal{\bar{A}}E(\mathcal{P}_{\widetilde{x},k})\mathcal{\bar{A}}'+
\mathcal{\bar{B}}(\mathbf{1}\mathbf{1}'\otimes Q)\mathcal{\bar{B}}'
+\mathcal{\bar{D}}R\mathcal{\bar{D}}'$ is a positive-definite matrix due to the fact that $\mathcal{P}_{\widetilde{x},k},Q,R$ are all positive-definite matrices, respectively.
Based on the \textit{Lemma \ref{lemma1}}, we further have that
\begin{align*}
&Tr(\mathcal{W}\mathcal{\bar{A}}E(\mathcal{P}_{\widetilde{x},k})\mathcal{\bar{A}}'\mathcal{W}'+
\mathcal{W}\mathcal{\bar{B}}(\mathbf{1}\mathbf{1}'\otimes Q)\mathcal{\bar{B}}'\mathcal{W}'
+\mathcal{W}\mathcal{\bar{D}}R\\
&\mathcal{\bar{D}}'\mathcal{W}') \leqslant Tr(\mathcal{\bar{A}}E(\mathcal{P}_{\widetilde{x},k})\mathcal{\bar{A}}'+
\mathcal{\bar{B}}(\mathbf{1}\mathbf{1}'\otimes Q)\mathcal{\bar{B}}'
+\mathcal{\bar{D}}R\mathcal{\bar{D}}').
\end{align*}
In view of the assumption that $Tr(E[\mathcal{P}_{\widetilde{x},k}) \leqslant Tr(\mathcal{P}_{k})$ and $\mathcal{\bar{A}}=\mathcal{P}(\mathcal{P}^{-})^{-1}(I \otimes A)$ is an orthogonal matrix. There holds that $\mathcal{\bar{A}}E(\mathcal{P}_{\widetilde{x},k})\mathcal{\bar{A}}'=\mathcal{\bar{A}}E(\mathcal{P}_{\widetilde{x},k})\mathcal{\bar{A}}^{-1}$ and $Tr(\mathcal{\bar{A}}E(\mathcal{P}_{\widetilde{x},k})\mathcal{\bar{A}}')=Tr(E(\mathcal{P}_{\widetilde{x},k}))\leqslant Tr(\mathcal{P}_{k})=Tr(\mathcal{\bar{A}}\mathcal{{P}}_{k}\mathcal{\bar{A}}')$.
Note that
\begin{align*}
&Tr(\mathcal{\bar{A}}E(\mathcal{P}_{\widetilde{x},k})\mathcal{\bar{A}}'+\mathcal{\bar{B}}(\mathbf{1}\mathbf{1}'\otimes Q)\mathcal{\bar{B}}'
+\mathcal{\bar{D}}R\mathcal{\bar{D}}')
\leqslant E[Tr(\mathcal{\bar{A}}\\
&\mathcal{{P}}_{k}\mathcal{\bar{A}}'+
\mathcal{\bar{B}}(\mathbf{1}\mathbf{1}'\otimes Q)\mathcal{\bar{B}}'+\mathcal{\bar{D}}R\mathcal{\bar{D}}')]\\
&= E[Tr(\mathcal{{P}}_{k+1})]\\
&=Tr(\mathcal{P}_{k+1}).
\end{align*}
By inductive hypothesis, $Tr(E(\mathcal{P}_{\widetilde{x},k}))\leqslant Tr(\mathcal{P}_{k})$ holds for all time instant $k\geq0$.
The proof is thus completed.
\end{appendices}
\bibliographystyle{IEEE}
| {'timestamp': '2018-10-08T02:06:23', 'yymm': '1810', 'arxiv_id': '1810.02531', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02531'} | arxiv |
\section{Introduction}
Consider the problem of finding a local minimizer of the expectation
$F(x)\eqdef\bE(f(x,\xi))$ w.r.t. $x\in \bR^d$, where $f(\,.\,,\xi)$ is
a possibly non-convex function depending on some random
variable~$\xi$.
The distribution of $\xi$ is assumed unknown, but revealed online by
the observation of iid copies $(\xi_n:n\geq 1)$ of the r.v.~$\xi$.
Stochastic gradient descent (SGD) is the most classical algorithm
to search for such a minimizer.
Variants of SGD which include an inertial term have also become very popular.
In these methods, the update rule depends on a parameter called
the \emph{learning rate}, which is generally assumed constant or vanishing.
These algorithms, although widely used, have at least two limitations.
First, the choice of the learning rate is generally difficult; large learning rates result in
large fluctuations of the estimate, whereas small learning rates
induce slow convergence. Second, a common learning rate is used for
every coordinate despite the possible discrepancies in the values of
the gradient vector's coordinates.
To alleviate these limitations, the popular
\adam\ algorithm \cite{kingma2014adam} adjusts the learning rate
coordinate-wise, as a function of the past values of the squared
gradient vectors' coordinates. The algorithm thus combines the assets
of inertial methods with an adaptive per-coordinate learning rate
selection. Finally, the algorithm includes a so-called
\emph{bias correction} step. Acting on the current estimate of the gradient vector,
this step is especially useful during the early iterations.
Despite the growing popularity of the algorithm, only few works
investigate its behavior from a theoretical point of
view (see the discussion in Section~\ref{sec:related-works}).
The present paper studies the convergence of \adam\ from a dynamical system viewpoint.\\
\noindent{\bf Contributions}
\begin{itemize}[leftmargin=*]
\item We introduce a continuous-time version of the \adam\ algorithm under the form
of a non-autonomous ordinary differential equation (ODE).
Building on the existence of an explicit Lyapunov function for the ODE,
we show the existence of a unique global solution to the ODE. This first result
turns out to be non-trivial due to the irregularity of the vector field.
We then establish the convergence of the continuous-time \adam\
trajectory to the set of critical points of the objective function $F$.
The proposed continuous-time version of \adam\ provides useful
insights on the effect of the bias correction step. It is shown
that, close to the origin, the objective function~$F$ is
non-increasing along the \adam\ trajectory,
suggesting that early iterations of \adam\ can only improve the initial guess.
\item Under a \L{}ojasiewicz-type condition,
we prove that the solution to the ODE converges to a single critical point of the objective
function $F$. We provide convergence rates in this case.
\item
In discrete time, we first analyze the \adam\ iterates in the constant stepsize
regime as originally introduced in \cite{kingma2014adam}.
In this work, it is shown that the discrete-time \adam\ iterates shadow the
behavior of the non-autonomous ODE in the asymptotic regime where
the stepsize parameter $\gamma$ of \adam\ is small. More
precisely, we consider the interpolated process $\sz^\gamma(t)$
which consists of a piecewise linear interpolation of the \adam\ iterates.
The random process $\sz^\gamma$ is indexed by the parameter~$\gamma$, which is
assumed constant during the whole run of the algorithm.
In the space of continuous functions on $[0,+\infty)$ equipped
with the topology of uniform convergence on compact sets,
we establish that $\sz^\gamma$ converges in probability
to the solution to the non-autonomous ODE when $\gamma$ tends to zero.
\item Under a stability condition, we prove the asymptotic ergodic convergence
of the probability of the discrete-time \adam\ iterates to approach the set of critical
points of the objective function in the doubly asymptotic regime
where $n\to\infty$ then $\gamma\to 0$.
\item
Beyond the original constant stepsize \adam\,, we propose
a decreasing stepsize version of the algorithm.
We provide sufficient conditions ensuring the stability and the almost sure convergence of the iterates towards
the critical points of the objective function.
\item We establish a convergence rate of the stochastic iterates of the decreasing stepsize algorithm under the
form of a conditional central limit theorem.
\end{itemize}
We claim that our analysis can be easily extended to
other adaptive algorithms such as e.g. \textsc{RmsProp} or
\textsc{AdaGrad} \cite{tieleman2012lecture,duchi2011adaptive}
and \textsc{AmsGrad} (see Section~\ref{sec:related-works}).\\%\medskip
The paper is organized as follows.
In Section~\ref{sec:adam}, we present
the \adam\ algorithm and the main assumptions.
Our main results are stated in Sections~\ref{sec:continuous_time} to \ref{sec:discrete_decreasing}.
We provide a review of related works in Section~\ref{sec:related-works}.
The rest of the paper addresses the proofs of our results
(Sections~\ref{sec:proofs_cont_time} to \ref{sec:proofs_sec_discrete_decreasing}).
\hfill\\
\noindent{\bf Notations}. If $x$, $y$ are two vectors on $\bR^d$ for some $d\geq 1$, we denote by $x \odot y$, $x^{\odot 2}$, $x/y$, $|x|$, $\sqrt{|x|}$ the vectors
on $\bR^d$ whose $i$-th coordinates are respectively given by $x_iy_i$, $x_i^2$, $x_i/y_i$, $|x_i|$, $\sqrt{|x_i|}$.
Inequalities of the form $x\leq y$ are read componentwise.
Denote by $\|\cdot\|$ the standard Euclidean norm.
For any vector $v\in (0,+\infty)^d$, write $\|x\|^2_v = \sum_i v_i x_i^2$.
Notation $A^T$ represents the transpose of a matrix $A$.
If $z\in \bR^d$ and $A$ is a non-empty subset of $\bR^d$,
we use the notation $\mathsf d(z,A) \eqdef \inf\{ \|z-z'\| :z'\in A\}$.
If $A$ is a set, we denote by $\1_A$ the function equal to one on that set and to zero elsewhere.
We denote by $C([0,+\infty),\bR^d)$ the space of continuous functions from $[0,+\infty)$ to $\bR^d$ endowed with the topology of
uniform convergence on compact intervals.
\section{The \adam\ Algorithm}
\label{sec:adam}
\subsection{Algorithm and Assumptions}
Let $(\Omega,\cF,\bP)$ be a probability space, and let
$(\Xi,\mathfrak{S})$ denote an other measurable space. Consider a
measurable map $f:\bR^d\times \Xi\to \bR$, where $d$ is an integer.
For a fixed value of $\xi$, the mapping $x\mapsto f(x,\xi)$ is
supposed to be differentiable, and its gradient w.r.t. $x$ is denoted
by $\nabla f(x,\xi)$. Define $\cZ\eqdef \bR^d\times\bR^d\times
\bR^d$, $\cZ_{+}\eqdef \bR^d\times\bR^d\times [0,+\infty)^d$ and
$\cZ_{+}^*\eqdef \bR^d\times\bR^d\times (0,+\infty)^d$. \adam\
generates a sequence $z_n\eqdef (x_n,m_n,v_n)$ on
$\cZ_+$ given by Algorithm~\ref{alg:adam}.
\begin{algorithm}[tb]
\caption{\bf \adam$(\gamma,\alpha,\beta,\varepsilon)$.}
\label{alg:adam}
\begin{algorithmic}
\STATE {\bfseries Initialization:} $x_0\in \bR^d, m_0=0$, $v_0=0$.
\FOR{$n=1$ {\bfseries to} $n_{\text{iter}}$}
\STATE $m_n = \alpha m_{n-1} + (1-\alpha) \nabla f(x_{n-1},\xi_n)$
\STATE $v_n = \beta v_{n-1} + (1-\beta) \nabla f(x_{n-1},\xi_n)^{\odot 2}$
\STATE $\hat m_{n} = m_{n}/(1-\alpha^{n})$
\COMMENT{bias correction step}
\STATE $\hat v_{n} = v_{n}/(1-\beta^{n})$
\COMMENT{bias correction step}
\STATE $x_{n} = x_{n-1} - \gamma \hat m_{n} / (\varepsilon+\sqrt{\hat v_{n}}) \,.$
\ENDFOR
\end{algorithmic}
\end{algorithm}
It satisfies:
$
z_n=T_{\gamma,\alpha,\beta}(n,z_{n-1},\xi_n)\,,
$
for every $n\geq 1$, where for every $z=(x,m,v)$ in $\cZ_+$, $\xi\in \Xi$,
\begin{equation}
T_{\gamma,\alpha,\beta}(n,z,\xi) \eqdef
\begin{pmatrix}
x -\frac{\gamma (1-\alpha^{n})^{-1}(\alpha m+(1-\alpha)\nabla f(x,\xi))}{ \varepsilon+{(1-\beta^{n})^{-1/2} (\beta v+(1-\beta)\nabla f(x,\xi)^{\odot 2})^{1/2}}} \\
\alpha m + (1-\alpha) \nabla f(x,\xi) \\
\beta v + (1-\beta) \nabla f(x,\xi)^{\odot 2}
\end{pmatrix}\,.\label{eq:T}
\end{equation}
\begin{remark}
\label{rem:debiasing}
\quad\quad The iterates $z_n$ form a non-homogeneous Markov chain, because $T_{\gamma,\alpha,\beta}(n,z,\xi)$ depends on $n$.
This is due to the so-called debiasing step, which consists of replacing $m_n,v_n$ in Algorithm~\ref{alg:adam}
by their ``debiased'' versions $\hat m_n,\hat v_n$. The motivation becomes clear when expanding the expression:
\begin{equation*}
\hat m_n = \frac{m_n}{1-\alpha^n} = \frac {1-\alpha}{1-\alpha^n}\sum_{k=0}^{n-1}\alpha^k \nabla f(x_k,\xi_{k+1})\,. \label{eq:debiasing}
\end{equation*}
From this equation, it is observed that, $\hat m_n$ forms a convex combination of the past gradients.
This is unlike $m_n$, which may be small during the first iterations.
\end{remark}
\begin{assumption} \label{hyp:model}
The mapping $f:\bR^d\times\Xi\to \bR$ satisfies the following.
\begin{enumerate}[{\sl i)}]
\item For every $x\in \bR^d$, $f(x,\,.\,)$ is $\mathfrak{S}$-measurable.
\item For almost every $\xi$, the map $f(\,.\,,\xi)$ is continuously differentiable. \label{hyp:dif}
\item There exists $x_*\in \bR^d$ s.t. $\bE(|f(x_*,\xi)|)<\infty$ and $\bE(\|\nabla f(x_*,\xi)\|^2)<\infty$.
\item For every compact subset $K\subset \bR^d$, there exists $L_K>~0$ such that
for every $(x,y)\in K^2$, $\bE(\|\nabla f(x,\xi)-\nabla f(y,\xi)\|^2)\leq L_K^2\|x-y\|^2$.
\end{enumerate}
\end{assumption}
Under Assumption~\ref{hyp:model}, it is an easy exercise to show that the mappings
$F:\bR^d\to\bR$ and $S:\bR^d\to\bR^d$, given by:
\begin{equation}
F(x) \eqdef \bE(f(x,\xi)) \quad \text{and} \quad S(x) \eqdef \bE(\nabla f(x,\xi)^{\odot 2})\label{eq:F_and_S}
\end{equation}
are well defined; $F$ is continuously differentiable and by
Lebesgue's dominated convergence theorem, $\nabla F(x) = \bE(\nabla
f(x,\xi))$ for all $x$. Moreover, $\nabla F$ and $S$ are locally Lipschitz continuous.
\begin{assumption}
\label{hyp:coercive}
$F$ is coercive.
\end{assumption}
\begin{assumption}
\label{hyp:S>0}
For every $x\in \bR^d$, $S(x)>0$.
\end{assumption}
It follows from our assumptions that the set of critical points of
$F$, denoted by $$\cS \eqdef \nabla F^{-1}(\{0\}),$$ is non-empty.
Assumption~\ref{hyp:S>0} means that there is \emph{no} point $x\in
\bR^d$ satisfying $\nabla f(x,\xi) = 0$ with probability one (w.p.1). This is
a mild hypothesis in practice.
\subsection{Asymptotic Regime}
We address the constant stepsize regime, where
$\gamma$ is fixed along the iterations (the default value recommended
in \cite{kingma2014adam} is $\gamma = 0.001$). As opposed to the decreasing stepsize context,
the sequence $z_n^\gamma\eqdef z_n$ \emph{cannot} in general converge as $n$ tends to infinity, in an almost sure sense.
Instead, we investigate the asymptotic behavior of the {family} of processes $(n\mapsto z_n^\gamma)_{\gamma>0}$
indexed by $\gamma$, in the regime where $\gamma\to0$. We use the so-called ODE method (see e.g. \cite{ben-(cours)99}).
The interpolated process $\sz^{\gamma}$ is the
piecewise linear function defined on $[0,+\infty)\to \cZ_+$
for all $t \in [n\gamma ,(n+1)\gamma)$ by:
\begin{equation}
\sz^{ \gamma}(t) \eqdef z_{n}^{ \gamma} + (z_{n+1}^{ \gamma}-z_{n}^{ \gamma})\left(\frac {t-n\gamma}{\gamma}\right)\,.
\label{eq:interpolated-process}
\end{equation}
We establish the convergence in probability of the
family of random processes $(\sz^{ \gamma})_{\gamma>0}$ as $\gamma$ tends to zero, towards a
deterministic continuous-time system defined by an ODE.
The latter ODE, which we provide below at Eq.~(\ref{eq:ode}), will be referred to
as the continuous-time version of \adam.
Before describing the ODE, we need to be more specific about our
asymptotic regime. As opposed to SGD, \adam\ depends on
two parameters $\alpha$, $\beta$, in addition to the stepsize $\gamma$.
The paper \cite{kingma2014adam} recommends choosing the constants $\alpha$ and $\beta$ close to one
(the default values $\alpha=0.9$ and $\beta=0.999$ are suggested).
It is thus legitimate to assume that
$\alpha$ and $\beta$ tend to one, as $\gamma$ tends to zero.
We set $\alpha \eqdef \bar \alpha(\gamma)$ and $\beta\eqdef\bar\beta(\gamma)$, where
$\bar \alpha(\gamma)$ and $\bar\beta(\gamma)$ converge to one as $\gamma\to 0$.
\begin{assumption}
\label{hyp:alpha-beta}
The functions $\bar \alpha:\bR_+\to [0,1)$ and $\bar \beta:\bR_+\to [0,1)$ are
s.t. the following limits exist:
\begin{equation}
a\eqdef \lim_{\gamma_\downarrow 0} \frac{1-\bar\alpha(\gamma)}\gamma ,\quad b\eqdef \lim_{\gamma_\downarrow 0}\frac{1-\bar\beta(\gamma)}\gamma\,.\label{eq:regime}
\end{equation}
Moreover, $a>0$, $b>0$, and the following condition holds: $b\leq 4a\,.$
\end{assumption}
Note that the condition $b\leq 4a$ is compatible with the default settings recommended
by \cite{kingma2014adam}.
In our model, we shall now replace the map $T_{\gamma,\alpha,\beta}$ by $T_{\gamma,\bar \alpha(\gamma),\bar \beta(\gamma)}$.
Let $x_0\in \bR^d$ be fixed. For any fixed $\gamma>0$, we define the sequence $(z_n^\gamma)$ generated by
\adam\ with a fixed stepsize~$\gamma>0$:
\begin{equation}
z_n^\gamma \eqdef T_{\gamma,\bar \alpha(\gamma),\bar \beta(\gamma)}(n,z^\gamma_{n-1},\xi_n)\,,\label{eq:znT}
\end{equation}
the initialization being chosen as $z_0^\gamma=(x_0,0,0)$.
\section{Continuous-Time System}
\label{sec:continuous_time}
\subsection{Ordinary Differential Equation}
In order to gain insight into the behavior of the sequence $(z_n^\gamma)$
defined by (\ref{eq:znT}),
it is convenient to rewrite the \adam\ iterations under the following equivalent form, for every $n\geq 1$:
\begin{equation}
z_n^{\gamma} = z^{\gamma}_{n-1} + \gamma h_{\gamma}(n,z^{\gamma}_{n-1}) + \gamma \Delta^\gamma_{n}\,,\label{eq:RM}
\end{equation}
where we define for every $\gamma>0$, $z\in \cZ_+$,
\begin{equation}
h_\gamma(n,z) \eqdef \gamma^{-1}\bE(T_{\gamma,\bar\alpha(\gamma),\bar\beta(\gamma)}(n,z,\xi)-z)\,,\label{eq:hgamma}
\end{equation}
and where $\Delta^\gamma_{n}\eqdef \gamma^{-1}(z_n^{\gamma} - z^{\gamma}_{n-1}) - h_{\gamma}(n,z^{\gamma}_{n-1})$.
Note that $(\Delta^\gamma_{n})$ is a martingale increment noise sequence in the sense that
$\bE(\Delta^\gamma_{n}|\cF_{n-1}) = 0$ for all $n\geq 1$, where $\cF_n$ stands for the $\sigma$-algebra generated
by the r.v. $\xi_1,\dots,\xi_n$.
Define the map $h:(0,+\infty)\times \cZ_+\to\cZ$ for all $t>0$, all $z=(x,m,v)$ in $\cZ_+$ by:
\begin{equation}
\label{eq:h}
h(t,z)= \begin{pmatrix}
-\frac{(1-e^{-at})^{-1}m}{\varepsilon+\sqrt{(1-e^{-bt})^{-1} v}} \\
a (\nabla F(x)-m) \\
b (S(x)-v)
\end{pmatrix} \,,
\end{equation}
where $a,b$ are the constants defined in Assumption~\ref{hyp:alpha-beta}.
We prove that, for any fixed $(t,z)$, the quantity $h(t,z)$ coincides with the limit
of $h_\gamma(\lfloor t/\gamma\rfloor,z)$ as $\gamma\downarrow 0$. This remark along with Eq.~(\ref{eq:RM})
suggests that, as $\gamma\downarrow 0$, the interpolated process $\sz^\gamma$ shadows the non-autonomous differential equation
\begin{equation}
\begin{array}[h]{l}
\dot z(t) = h(t, z(t))\,.
\end{array}
\tag{ODE}
\label{eq:ode}
\end{equation}
\subsection{Existence, Uniqueness, Convergence}
\label{subsec:odeanalysis}
Since $h(\,.\,,z)$ is non-continuous
at point zero for a fixed $z\in \cZ_+$, and since $h(t,\,.\,)$
is not locally Lipschitz continuous for a fixed~$t~>~0$,
the existence and uniqueness of the solution to (\ref{eq:ode}) do not stem directly from off-the-shelf theorems.
Let {\color{black}$x_0$ be fixed}.
A continuous map $z:[0,+\infty)\to\cZ_+$ is said to be a global solution to (\ref{eq:ode}) with initial condition {\color{black}$(x_0,0,0)$}
if $z$ is continuously differentiable on $(0,+\infty)$, if Eq.~(\ref{eq:ode})
holds for all $t>0$, and if {\color{black}$z(0)=(x_0,0,0)$}.
\begin{theorem}[Existence and uniqueness]
\label{th:exist-unique}
Let Assumptions~\ref{hyp:model} to \ref{hyp:alpha-beta} hold true.
There exists a unique global solution $z:[0,+\infty)\to\cZ_+$
to~(\ref{eq:ode}) with
initial condition $(x_0,0,0)$.
Moreover, $z([0,+\infty))$ is a bounded subset of $\cZ_+$.
\end{theorem}
On the other hand, we note that a solution may not exist for
an initial point$(x_0,m_0,v_0)$ with arbitrary (non-zero) values of $m_0, v_0$.
\begin{theorem}[Convergence]
\label{th:cv-adam}
Let Assumptions~\ref{hyp:model} to \ref{hyp:alpha-beta} hold true.
Assume that $F(\cS)$ has an empty interior.
Let $z:t\mapsto (x(t),m(t),v(t))$ be
the global solution to~(\ref{eq:ode}) with the initial condition
$(x_0,0,0)$.\,
Then, the set $\cS$ is non-empty and $\lim_{t\to\infty} \sd(x(t),\cS) =0$,
$\lim_{t\to\infty}m(t)=0$, $\lim_{t\to\infty}S(x(t))-v(t)=0$.
\end{theorem}
\noindent{\bf Lyapunov function.} The proof of Th.~\ref{th:exist-unique}
relies on the existence of a Lyapunov function for the non-autonomous
equation~(\ref{eq:ode}). Define $V:(0,+\infty)\times \cZ_+\to \bR$ by
\begin{equation}
\label{eq:V}
V(t,z)\eqdef F(x)+\frac 12 \left\|m\right\|^2_{U(t,v)^{-1}}\,,
\end{equation}
for every $t>0$ and every $z=(x,m,v)$ in $\cZ_+$, where
$U:(0,+\infty)\times [0,+\infty)^d\to \bR^d$ is the map given by:
\begin{equation}
\label{eq:U}
U(t,v) \eqdef a(1-e^{-at})\left(\varepsilon+\sqrt{\frac{v}{1-e^{-bt}}}\right)\,.
\end{equation}
Then, $t\mapsto V(t,z(t))$ is decreasing if $z(\cdot)$ is the global solution to~(\ref{eq:ode}).
\noindent{\bf Cost decrease at the origin.} As $F$ itself is not a Lyapunov function for~(\ref{eq:ode}),
there is no guarantee that $F(x(t))$ is decreasing w.r.t. $t$.
Nevertheless, the statement holds at the origin. Indeed, it can be shown that
$\lim_{t\downarrow 0}V(t,z(t))=F(x_0)$ (see Prop.~\ref{prop:adam-bounded}). As a consequence,
\begin{equation}
\forall t\geq 0,\ F(x(t))\leq F(x_0)\,.
\label{eq:costdecrease}
\end{equation}
In other words, the (continuous-time) \adam\ procedure
\emph{can only improve} the initial guess $x_0$.
This is the consequence of the so-called bias correction steps in \adam\ (see Algorithm~\ref{alg:adam})\,.
If these debiasing steps were deleted in the \adam\ iterations,
the early stages of the algorithm could degrade the initial estimate $x_0$.
\noindent{\bf Derivatives at the origin.}
The proof of Th.~\ref{th:exist-unique} reveals that the initial derivative is given
by $\dot x(0) = -\nabla F(x_0)/(\varepsilon+\sqrt{S(x_0)})$ (see Lemma~\ref{lem:m-v-derivables-en-zero}).
In the absence of debiasing steps, the initial derivative $\dot x(0)$ would be a function of the initial
parameters $m_0$, $v_0$, and the user would be required to tune these hyperparameters.
No such tuning is required thanks to the debiasing step.
When $\varepsilon$ is small and when the variance of $\nabla f(x_0,\xi)$ is small (\emph{i.e.}, $S(x_0)\simeq \nabla F(x_0)^{\odot 2}$),
the initial derivative $\dot x(0)$ is approximately equal to $-\nabla F(x_0)/|\nabla F(x_0)|$.
This suggests that in the early stages of the algorithm, the \adam\ iterations
are comparable to the \emph{sign} variant of the gradient descent, the properties of which were
discussed in previous works, see \cite{balles2018dissecting}
\subsection{Convergence rates}
In this paragraph, we establish the convergence to a single critical
point of $F$ and quantify the convergence rate, using the following
assumption \cite{lojasiewicz1963}.
\begin{assumption}[\L{}ojasiewicz property]
\label{hyp:lojasiewicz_prop}
For any $x^* \in {\mathcal S}$, there exist
$c >0\,, \sigma >0$ and $\theta \in (0,\frac 12]$ s.t.
\begin{equation}
\label{eq:lojasiewicz}
\forall x \in \bR^d \,\,\text{s.t}\,\,\|x-x^*\|\leq \sigma\,,\quad \|\nabla F(x)\| \geq c |F(x) - F(x^*)|^{1-\theta}\,.
\end{equation}
\end{assumption}
Assumption~\ref{hyp:lojasiewicz_prop} holds for real-analytic functions
and semialgebraic functions.
We refer to
\cite{harauxjendoubi2015,attouch2009convergence,bolte2014proximal}
for a discussion and a review of applications.
We will call any $\theta$ satisfying (\ref{eq:lojasiewicz}) for some $c,\sigma>0$,
as a \L{}ojasiewicz exponent of $f$ at $x^*$. The next result establishes the convergence
of the function $x(t)$ generated by the ODE to a single critical point of $f$,
and provides the convergence rate as a function of the \L{}ojasiewicz exponent of $f$
at this critical point. The proof is provided in subsection~\ref{sec:cont_asymptotic_rates}.
\begin{theorem}
\label{thm:asymptotic_rates}
Let Assumptions~\ref{hyp:model} to \ref{hyp:alpha-beta} and \ref{hyp:lojasiewicz_prop} hold true.
Assume that $F(\cS)$ has an empty interior. Let $x_0 \in \bR^d$ and let $z:t\mapsto (x(t),m(t),v(t))$ be
the global solution to~(\ref{eq:ode}) with initial condition $(x_0,0,0)$.
Then, there exists $x^* \in \cS$ such that $x(t)$ converges to $x^*$ as $t \to +\infty$.
Moreover, if $\theta\in (0,\frac 12]$ is a \L{}ojasiewicz exponent of $f$ at $x^*$,
there exists a constant $C >0$ s.t. for all $t\geq 0$,
\begin{align*}
\|x(t)-x^*\| &\leq C t^{-\frac{\theta}{1-2\theta}}\,,\quad \text{if}\,\,\, 0<\theta<\frac{1}{2}\,,\\
\|x(t)-x^*\| &\leq C e^{- \delta t} \,,\quad \text{for some}\,\, \delta >0\,\,\text{if}\,\, \theta = \frac 12 \,.
\end{align*}
\end{theorem}
\section{Discrete-Time System: Convergence of \adam}
\label{sec:discrete}
\begin{assumption}
\label{hyp:iid}
The sequence $(\xi_n:n\geq 1)$ is iid, with the same distribution as~$\xi$.
\end{assumption}
\begin{assumption}
\label{hyp:moment-f}
Let $p>0$. Assume either one of the following conditions.
\begin{enumerate}[i)]
\item \label{momentegal} For every compact set $K\subset \bR^d$, $\sup_{x\in K} \bE(\|\nabla f(x,\xi)\|^{p})<\infty\,.$
\item \label{momentreinforce} For every compact set $K\subset \bR^d$, $\exists\, p_K>p$, $\sup_{x\in K} \bE(\|\nabla f(x,\xi)\|^{p_K})<\infty.$
\end{enumerate}
\end{assumption}
The value of $p$ will be specified in the sequel, in the statement of
the results. Clearly, Assumption~\ref{hyp:moment-f}~\ref{momentreinforce} is stronger than Assumption~\ref{hyp:moment-f}~\ref{momentegal}.
We shall use either the latter or the former in our statements.
\begin{theorem}
\label{th:weak-cv}
Let Assumptions~\ref{hyp:model} to \ref{hyp:alpha-beta} and \ref{hyp:iid} hold true. Let Assumption~\ref{hyp:moment-f}~\ref{momentreinforce}
hold with $p=2$.
Consider $x_0\in \bR^d$. For every $\gamma>0$, let $(z_n^\gamma:n\in \bN)$ be the random sequence defined by the \adam\ iterations~(\ref{eq:znT})
and $z_0^\gamma = (x_0,0,0)$. Let $\sz^\gamma$ be the corresponding interpolated process defined by Eq.~(\ref{eq:interpolated-process}).
Finally, let $z$ denote the unique global solution to (\ref{eq:ode}) issued from $(x_0,0,0)$.
Then,
$$
\forall\, T>0,\ \forall\, \delta>0,\ \ \lim_{\gamma\downarrow 0}\bP\left(\sup_{t\in[0,T]}\|\sz^\gamma(t)-z(t)\|>\delta\right)=0\,.
$$
\end{theorem}
Recall that a family of r.v. $(X_\alpha)_{\alpha\in I}$ is called \emph{bounded in probability}, or \emph{tight}, if for every
$\delta>0$, there exists a compact set $K$ s.t. $\bP(X_\alpha\in K)\geq 1-\delta$ for every $\alpha\in I$.
\begin{assumption}
\label{hyp:tight}
There exists $\bar \gamma_0>0$ s.t. the family of r.v. $(z_n^\gamma:n\in \bN,0<\gamma<\bar \gamma_0)$ is bounded in probability.
\end{assumption}
\begin{theorem}
Consider $x_0\in \bR^d$. For every $\gamma>0$, let $(z_n^\gamma:n\in \bN)$ be the random sequence defined by the \adam\ iterations~(\ref{eq:znT})
and $z_0^\gamma = (x_0,0,0)$.
Let Assumptions~\ref{hyp:model} to \ref{hyp:alpha-beta}, \ref{hyp:iid} and \ref{hyp:tight} hold.
Let Assumption~\ref{hyp:moment-f}~\ref{momentreinforce} hold with $p=2$. Then,
for every $\delta > 0$,
\begin{equation}
\label{eq:long-run}
\lim_{\gamma\downarrow 0}\limsup_{n\to\infty} \frac 1{n} \sum_{k=1}^n \bP(\sd(x_k^\gamma, \cS)>\delta) = 0\,.
\end{equation}
\label{th:longrun}
\end{theorem}
\noindent{\bf Convergence in the long run.}
When the stepsize $\gamma$ is constant, the sequence
$(x_n^\gamma)$ cannot converge in the almost sure sense as
$n\to\infty$.
Convergence may only hold in the doubly asymptotic regime where
$n\to\infty$ then $\gamma\to 0$.
\noindent{\bf Randomization.} For every $n$, consider a r.v. $N_n$ uniformly
distributed on $\{1,\dots,n\}$. Define $\tilde x_n^\gamma = x_{N_n}^\gamma$.
We obtain from Th.~\ref{th:longrun} that for every $\delta>0$,
$$
\limsup_{n\to\infty} \ \bP(\sd(\tilde x_n^\gamma, \cS)>\delta) \xrightarrow[\gamma\downarrow 0]{} 0\,.
$$
\noindent{\bf Relationship between discrete and continuous time \adam.}
Th.~\ref{th:weak-cv} means that the family of random processes $(\sz^\gamma:~\gamma>0)$ converges
in probability as $\gamma\downarrow 0$ towards the unique solution to~(\ref{eq:ode}) issued from $(x_0,0,0)$.
This motivates the fact that the non-autonomous system~(\ref{eq:ode})
is a relevant approximation to the behavior of the iterates $(z_n^\gamma:n\in \bN)$ for a small
value of the stepsize~$\gamma$.
\noindent{\bf Stability.} Assumption~\ref{hyp:tight} ensures
that the iterates $z_n^\gamma$ do not explode in the long run.
A sufficient condition is for instance that
$\sup_{n,\gamma} \bE \|z_n^\gamma\|<\infty\,.$
{In theory, this assumption can be difficult to verify.}
Nevertheless, in practice, a projection step on a compact set
can be introduced to ensure the boundedness of the estimates.
\section{A Decreasing Stepsize \adam\, Algorithm}
\label{sec:discrete_decreasing}
\subsection{Algorithm}
\adam\, inherently uses constant stepsizes. Consequently, the
iterates~(\ref{eq:znT}) do not converge in the almost sure sense.
In order to achieve convergence, we introduce in this section a decreasing
stepsize version of \adam. The iterations are given in Algorithm~\ref{alg:adam-decreasing}.
\begin{algorithm}[tb]
\caption{\bf \adam - decreasing stepsize $(((\gamma_n,\alpha_n,\beta_n):n\in \bN^*), \varepsilon)$.}
\label{alg:adam-decreasing}
\begin{algorithmic}
\STATE {\bfseries Initialization:} $x_0\in \bR^d, m_0=0$, $v_0=0$, $r_0=\bar r_0=0$.
\FOR{$n=1$ {\bfseries to} $n_{\text{iter}}$}
\STATE $m_n = \alpha_n m_{n-1} + (1-\alpha_n) \nabla f(x_{n-1},\xi_n)$
\STATE $v_n = \beta_n v_{n-1} + (1-\beta_n) \nabla f(x_{n-1},\xi_n)^{\odot 2}$
\STATE $r_n = \alpha_n r_{n-1} + (1-\alpha_n)$
\STATE $\bar r_n = \beta_n \bar r_{n-1} + (1-\beta_n)$
\STATE $\hat m_{n} = m_{n}/r_n$
\COMMENT{bias correction step}
\STATE $\hat v_{n} = v_{n}/\bar r_n$
\COMMENT{bias correction step}
\STATE $x_{n} = x_{n-1} - \gamma_n \hat m_{n} / (\varepsilon+\sqrt{\hat v_{n}}) \,.$
\ENDFOR
\end{algorithmic}
\end{algorithm}
The algorithm generates a sequence $z_n=(x_n,m_n,v_n)$ with initial point $z_0=(x_0,0,0)$,
where $x_0\in\bR^d$. Apart from the fact that the hyperparameters $(\gamma_n,\alpha_n,\beta_n)$
now depend on $n$, the main difference w.r.t Algorithm~\ref{alg:adam} lies in the expression of the
debiasing step. As noted in Remark~\ref{rem:debiasing}, the aim is to rescale $m_n$ (resp. $v_n$)
in such a way that the rescaled version $\hat m_n$ (resp. $\hat v_n$) is a convex combination of
past stochastic gradients (resp. squared gradients). While in the constant step case the rescaling
coefficient is $(1-\alpha^n)^{-1}$ (resp. $(1-\beta^n)^{-1}$), the decreasing step case requires dividing
$m_n$ by the coefficient $r_n=1-\prod_{i=1}^n\alpha_i$ (resp. $v_n$ by $\bar r_n=1-\prod_{i=1}^n\beta_i$),
which keeps track of the previous weights:
$$
\hat m_n = \frac{m_n}{r_n} = \frac{\sum_{k=1}^{n} \rho_{n,k} \nabla f(x_{k-1},\xi_{k})}{\sum_{k=1}^{n} \rho_{n,k}}\,,
$$
where for every $n,k$, $\rho_{n,k} = \alpha_n\cdots\alpha_{k+1}(1-\alpha_k)$. A similar equation holds for $\hat v_n$.
\subsection{Almost sure convergence
\begin{assumption}[Stepsizes]
\label{hyp:stepsizes}
The following holds.
\begin{enumerate}[{\sl i)}]
\item For all $n \in \bN$, $\gamma_n > 0$ and $\gamma_{n+1}/\gamma_n\to 1$,
\item $\sum_n \gamma_n = +\infty$ and $\sum_n \gamma_n^2 <+\infty$,
\item For all $n \in \bN$, $0 \leq \alpha_n \leq 1$ and $0 \leq \beta_n \leq 1$,
\item There exist $a,b$ s.t. $0<b<4a$,\,
$\gamma_n^{-1}(1-\alpha_n) \to a$ and $\gamma_n^{-1}(1-\beta_n) \to b$\,.
\end{enumerate}
\end{assumption}
\begin{theorem}
\label{thm:as_conv_under_stab}
Let Assumptions~\ref{hyp:model} to \ref{hyp:S>0}, \ref{hyp:iid} and~\ref{hyp:stepsizes} hold.
Let Assumption \ref{hyp:moment-f}~\ref{momentegal} hold with $p=4$.
Assume that $F(\cS)$ has an empty interior
and that the random sequence $((x_n,m_n,v_n):n\in \bN)$
given by Algorithm~\ref{alg:adam-decreasing}
is bounded, with probability one.
Then, w.p.1, $\lim_{n\to\infty}
\sd (x_n,\cS)=0$, $lim_{n\to\infty}m_n = 0$
and $lim_{n\to\infty} (S(x_n)-v_n)=0$.
If moreover $\cS$ is finite or countable, then w.p.1, there exists $x^*\in \cS$
s.t. $\lim_{n\to\infty} (x_n,m_n,v_n) = (x^*,0,S(x^*))$.
\end{theorem}
Th.~\ref{thm:as_conv_under_stab} establishes the almost sure convergence of
$x_n$ to the set of critical points of~$F$, under the assumption that the sequence
$((x_n,m_n,v_n))$ is a.s. bounded. The next result provides a sufficient condition
under which almost sure boundedness holds.
\begin{assumption}
\label{hyp:stab}
The following holds.
\begin{enumerate}[{\sl i)}]
\item \label{lipschitz} $\nabla F$ is Lipschitz continuous.
\item \label{momentgrowth} There exists $C>0$ s.t. for all $x \in \bR^d$, $\bE[\|\nabla f(x,\xi)\|^2] \leq C (1+F(x))$.
\item We assume the condition:
\lim\sup_{n\to\infty}
\left(\frac 1{\gamma_n}-\left(\frac{1-\alpha_{n+2}}{1-\alpha_{n+1}}\right)\frac 1{\gamma_{n+1}}\right)
< 2(a-\frac b4)\,,
$\\%$$
which is satisfied for instance if $b<4a$ and $1-\alpha_{n+1} = a\gamma_n$.
\end{enumerate}
\end{assumption}
\begin{theorem}
\label{thm:stab}
Let Assumptions~\ref{hyp:model}, \ref{hyp:coercive}, \ref{hyp:iid}, \ref{hyp:stepsizes} and \ref{hyp:stab} hold.
Let Assumption~\ref{hyp:moment-f}~\ref{momentegal} hold with $p=4$.
Then, the sequence
$((x_n,m_n,v_n):n\in \bN)$ given by Algorithm~\ref{alg:adam-decreasing} is bounded with probability one.
\end{theorem}
\subsection{Central Limit Theorem}
\begin{assumption}
\label{hyp:mean_field_tcl}
Let $x^*\in \cS$. There exists a neighborhood $\cV$ of $x^*$ s.t.
\begin{enumerate}[{\sl i)}]
\item $F$ is twice continuously differentiable on $\cV$,
and the Hessian $\nabla^2 F(x^*)$ of $F$ at $x^*$ is positive
definite.
\item $S$ is continuously differentiable on $\cV$.
\end{enumerate}
\end{assumption}
Define $
D \eqdef \textrm{diag}\left((\varepsilon + \sqrt{S_1(x^*)})^{-1},\cdots,(\varepsilon + \sqrt{S_d(x^*)})^{-1}\right)\,.
$
Let $P$ be an orthogonal matrix s.t. the following spectral decomposition holds:
$$
D^{1/2}\nabla^2F(x^*)D^{1/2} = P\textrm{diag}(\lambda_1,\cdots,\lambda_d)P^{-1}\,,
$$
where $\lambda_1, \cdots,\lambda_d$ are the (positive) eigenvalues of
$D^{1/2} \nabla^2F(x^*)D^{1/2}$.
Define
\begin{equation}
H \eqdef
\begin{pmatrix}
0 & -D & 0\\ a\nabla^2F(x^*) & -a I_d & 0 \\ b \nabla S(x^*) & 0 & -b I_d
\end{pmatrix}\label{eq:H}
\end{equation}
where $I_d$ represents the $d\times d$ identity matrix and $\nabla S(x^*)$ is the
Jacobian matrix of~$S$ at $x^*$.
The largest real part of the eigenvalues of $H$ coincides with $-L$, where
\begin{equation}
L\eqdef b\wedge \frac a2\left( 1-\sqrt{\left(1-\frac{4\lambda_1}a\right)\vee 0}\right) >0\,.\label{eq:L}
\end{equation}
Finally, define the $3d\times 3d$ matri
\begin{equation}
\resizebox{.9\hsize}{!}{$
Q \eqdef
\left( \begin{array}[h]{cc}
0 &
\begin{array}[h]{cc}
0 & \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0
\end{array}\\
\begin{array}[h]{c}
0 \\ 0
\end{array}
& \bE\left[
\begin{pmatrix}
a\nabla f(x^*,\xi) \\ b(\nabla f(x^*,\xi)^{\odot 2}-S(x^*))
\end{pmatrix}\begin{pmatrix}
a\nabla f(x^*,\xi) \\ b(\nabla f(x^*,\xi)^{\odot 2}-S(x^*))
\end{pmatrix}^T\right]
\end{array}\right)\,.\label{eq:Q}
$}
\end{equation}
\begin{assumption}
\label{hyp:step-tcl}
The following holds.
\begin{enumerate}[{\sl i)}]
\item \label{step-tcl-i} There exist $\kappa \in (0,1]$, $\gamma_0>0$, s.t. the sequence $(\gamma_n)$
satisfies
$\gamma_n = {\gamma_0}/{(n+1)^\kappa}$ for all $n$.
If $\kappa = 1$, we assume moreover that $\gamma_0 > \frac{1}{2L}$.
\item The sequences $\left(\frac{1}{\gamma_n}(\frac{1-\alpha_n}{\gamma_n}-a)\right)$ and $\left(\frac{1}{\gamma_n}(\frac{1-\beta_n}{\gamma_n}-b)\right)$ are bounded.
\end{enumerate}
\end{assumption}
\noindent For an arbitrary sequence $(X_n)$ of random variables on some Euclidean space, a probability measure
$\mu$ on that space and an event $\Gamma$ s.t. $\bP(\Gamma)>0$, we say that $X_n$ converges in distribution
to $\mu$ \emph{given $\Gamma$} if the measures $\bP (X_n\in \cdot\,|\Gamma)$ converge weakly to $\mu$.
\begin{theorem}
\label{thm:clt}
Let Assumptions~\ref{hyp:model}, \ref{hyp:S>0}, \ref{hyp:iid}, \ref{hyp:mean_field_tcl} and \ref{hyp:step-tcl} hold true.
Let Assumption~\ref{hyp:moment-f}~\ref{momentreinforce} hold with $p=4$.
Consider the iterates $z_n=(x_n,m_n,v_n)$ given by Algorithm~\ref{alg:adam-decreasing}. Set $z^*=(x^*,0,S(x^*))$.
Set $\zeta \eqdef 0$ if $0<\kappa<1$ and $\zeta \eqdef \frac{1}{2 \gamma_0}$ if $\kappa =1$.
Assume $\bP(z_n \to z^*)>0$. Then, given the event $\{z_n\to z^*\}$,
the rescaled vector $\sqrt{\gamma_n}^{-1}(z_n-z^*)$
converges in distribution to a zero mean Gaussian distribution on $\bR^{3d}$ with a covariance matrix $\Sigma$
which is solution to the Lyapunov equation: $ \left(H + \zeta I_{3d} \right) \Sigma + \Sigma \left( H^T + \zeta I_{3d} \right) = - Q$.
In particular, given $\{z_n\to z^*\}$, the vector $\sqrt{\gamma_n}^{-1}(x_n-x^*)$
converges in distribution to a zero mean Gaussian distribution with a covariance matrix $\Sigma_1$ given by:
\begin{equation}
\Sigma_1 = D^{1/2} P
\left(
\frac{C_{k,\ell}}{ (1 - \frac{2\zeta}{a})(\lambda_k+\lambda_\ell-2\zeta + \frac 2a \zeta^2) +\frac 1{2(a-2\zeta)}(\lambda_k-\lambda_\ell)^2}
\right)_{k,\ell=1\dots d}
P^{-1}D^{1/2}\label{eq:cov}
\end{equation}
where $C\eqdef P^{-1}D^{1/2}\bE\left(\nabla f(x^*,\xi)\nabla f(x^*,\xi)^T\right)D^{1/2}P$.
\end{theorem}
The following remarks are useful.
\begin{itemize}[leftmargin=*]
\item The variable $v_n$ has an impact on the limiting covariance $\Sigma_1$ through its limit $S(x^*)$ (used to define $D$),
but the fluctuations of $v_n$ and the parameter $b$ have no effect on $\Sigma_1$.
As a matter of fact, $\Sigma_1$ coincides with the limiting covariance matrix that would have been obtained by considering
iterates of the form
\begin{equation*}
\begin{cases}
x_{n+1} &= x_n - \gamma_{n+1} p_{n+1} \\
p_{n+1} &= p_n + a\gamma_{n+1}(D\nabla f(x_n,\xi_{n+1})-p_n) \,,
\end{cases}
\end{equation*}
which can be interpreted as a preconditioned version of the stochastic heavy ball algorithm~\cite{gadat2018stochastic}.
Of course, the above iterates are not implementable because the preconditioning matrix $D$ is unknown.
\item
When $a$ is large, $\Sigma_1$ is close to the matrix $\Sigma_1^{(0)}$ obtained
when letting $a \to +\infty$ in Eq.~(\ref{eq:cov}).
The matrix $\Sigma_1^{(0)}$ is the solution to the Lyapunov equation
$$
(D \nabla^2F(x^*) - \zeta I_d) \Sigma_1^{(0)} + \Sigma_1^{(0)} (\nabla^2F(x^*) D - \zeta I_d) = D \bE\left(\nabla f(x^*,\xi)\nabla f(x^*,\xi)^T\right) D\,.
$$
The matrix $\Sigma_1^{(0)}$ can be interpreted as the asymptotic covariance matrix of the $x$-variable
in the absence of the inertial term (that is, when one considers \textsc{RmsProp} instead of \adam).
The matrix $\Sigma_1^{(0)}$ approximates $\Sigma_1$ in the sense that $\Sigma_1 = \Sigma_1^{(0)}+\frac 1a\Delta + O(\frac 1{a^2})$
for some symmetric matrix $\Delta$ which can be explicited. The matrix $\Delta$ is neither positive nor negative definite
in general.
This suggests that the question of the potential benefit of the presence of an inertial term
is in general problem dependent.
\item In the statement of Th.~\ref{thm:clt},
the conditioning event $\{z_n\to z^*\}$ can be replaced by the event $\{x_n\to x^*\}$
under the additional assumption that $\sum_n \gamma_n^2 < +\infty$.
\end{itemize}
\section{Related Works}
\label{sec:related-works}
Although the idea of adapting the
(per-coordinate) learning rates as a function of past gradient values
is not new (see \emph{e.g.} variable metric methods such as the BFGS
algorithms),
\textsc{AdaGrad} \cite{duchi2011adaptive} led the way to a new class of algorithms
that are sometimes referred to as adaptive gradient methods. \textsc{AdaGrad}
consists of dividing the learning rate by the square root of the sum
of previous gradients squared
componentwise.
The idea was to give larger learning rates to highly informative but
infrequent features instead of using a fixed predetermined schedule.
However, in practice, the division by the cumulative sum of squared
gradients may generate small learning rates, thus freezing the
iterates too early. Several works proposed
heuristical ways to set the learning rates using a less aggressive
policy.
The work \cite{tieleman2012lecture} introduced an unpublished, yet popular, algorithm
referred to as \textsc{RmsProp} where the cumulative sum
used in \textsc{AdaGrad} is replaced by a moving average of squared
gradients.
\adam\ combines the advantages of both \textsc{AdaGrad},
\textsc{RmsProp} and inertial methods
As opposed to \textsc{AdaGrad}, for which theoretical convergence guarantees exist
\cite{duchi2011adaptive,chen2018convergence,zhou2018convergence,ward2018adagrad},
\adam\ is comparatively less studied.
The initial paper \cite{kingma2014adam} suggests a $\mathcal{O}(\frac{1}{\sqrt{T}})$ average regret bound in the convex setting,
but \cite{j.2018on} exhibits a counterexample in contradiction with this statement.
The latter counterexample implies that the average regret bound of \adam\ does
not converge to zero. A first way to overcome the problem is to modify the \adam\ iterations
themselves in order to obtain a vanishing average regret. This led \cite{j.2018on}
to propose a variant called \textsc{AmsGrad} with the aim to recover, at least in the convex case, the sought guarantees.
The work \cite{balles2018dissecting} interprets \adam\ as a variance-adapted sign descent combining an update direction given by the sign and
a magnitude controlled by a variance adaptation principle. A ``noiseless'' version
of \adam\ is considered in \cite{basu2018convergence}. Under quite specific values of the \adam-hyperparameters, it is shown that for every $\delta>0$,
there exists some time instant
for which the norm of the gradient of the objective
at the current iterate is no larger than~$\delta$.
The recent paper \cite{chen2018convergence} provides a similar result
for \textsc{AmsGrad} and \textsc{AdaGrad}, but the generalization to \adam\ is subject
to conditions which are not easily verifiable.
The paper \cite{zaheer2018adaptive} provides a convergence result for \textsc{RmsProp}
using the objective function $F$ as a Lyapunov function.
However, our work suggests that unlike \textsc{RmsProp},
\adam\ does not admit $F$ as a Lyapunov function.
This makes the approach of
\cite{zaheer2018adaptive} hardly generalizable to \adam.
Moreover, \cite{zaheer2018adaptive} considers biased gradient estimates instead of the debiased
estimates used in \adam.
In the present work, we study the behavior of an ODE, interpreted as the
limit in probability of the (interpolated) \adam\ iterates as the stepsize tends to zero.
Closely related continuous-time dynamical systems are also studied in \cite{attouch2000heavy,cabot2009long}.
We leverage the idea of approximating a discrete time stochastic system by a deterministic continuous one,
often referred to as the ODE method.
A recent work \cite{gadat2018stochastic} fruitfully exploits this method to study
a stochastic version of the celebrated heavy ball algorithm.
We refer to \cite{davis2018stochastic} for the reader interested in the non-differentiable setting
with an analysis of the stochastic subgradient algorithm for non-smooth non-convex objective functions.
Concomitant to the present paper, Da Silva and Gazeau \cite{da2018general}
(posted only four weeks after the first version of the present work)
study the asymptotic behavior of a similar dynamical system as the one introduced here.
They establish several results in continuous time, such as avoidance of traps
as well as convergence rates in the convex case; such aspects are out of the scope of this paper.
However, the question of the convergence of the (discrete-time) iterates is left open.
In the current paper, we also exhibit a Lyapunov function which allows, amongst others, to draw useful conclusions on the effect of the
debiasing step of \adam\,. Finally, \cite{da2018general} studies a slightly modified version of \adam\, allowing to recover an
ODE with a locally Lipschitz continuous vector field, whereas the original \adam\ algorithm \cite{kingma2014adam} leads
to an ODE with an irregular vector field. This technical issue is tackled in the present paper.
\section{Proofs of Section~\ref{sec:continuous_time}}
\label{sec:proofs_cont_time}
\subsection{Preliminaries}
\label{subsec:setting}
The results in this section are not specific to the case where $F$ and $S$ are defined as in
Eq.~(\ref{eq:F_and_S}): they are stated for
\emph{any} mappings $F$, $S$ satisfying the following hypotheses.
\begin{assumption}
\label{hyp:F}
The function $F:\bR^d\to\bR$ is s.t.: $F$ is continuously differentiable and
$\nabla F$ is locally Lipschitz continuous.
\end{assumption}
\begin{assumption}
\label{hyp:S}
The map $S:\bR^d\to [0,+\infty)^d$ is locally Lipschitz continuous.
\end{assumption}
In the sequel, we consider the following generalization of Eq. (\ref{eq:ode}) for any $\eta >0$:
\begin{equation}
\begin{array}[h]{l}
\dot z(t) = h(t+\eta, z(t))\,.
\end{array}
\tag{ODE\mbox{$_\eta$}}
\label{eq:odeeta}\end{equation}
When $\eta=0$, Eq. (\ref{eq:odeeta}) boils down to the equation of interest (\ref{eq:ode}).
The choice $\eta\in (0,+\infty)$ will be revealed useful to prove Th.~\ref{th:exist-unique}.
Indeed, for $\eta>0$, a solution to Eq. (\ref{eq:odeeta}) can be shown to exist (on some interval) due to the continuity of
the map $h(\,.+\eta,\,.\,)$. Considering a family of such solutions indexed by $\eta\in (0,1]$,
the idea is to prove the existence of a solution to (\ref{eq:ode}) as a cluster point of the latter family when $\eta\downarrow 0$.
Indeed, as the family is shown to be equicontinuous, such a cluster point does exist thanks to the Arzelà-Ascoli theorem.
When $\eta=+\infty$,
Eq. (\ref{eq:odeeta}) rewrites
\begin{equation}
\label{eq:ode-a}
\begin{array}[h]{l}
\dot z(t) = h_\infty(z(t))\,,
\end{array}
\tag{ODE\mbox{$_\infty$}}
\end{equation}
where $h_\infty(z)\eqdef \lim_{t\to \infty} h(t,z)$.
It is useful to note that for $(x,m,v)\in \cZ_+$,
\begin{equation}
\label{eq:h_infty}
h_{\infty}((x,m,v)) = \left(-m / (\varepsilon+\sqrt{v})\,,\, a (\nabla F(x)-m) \,,\,b (S(x)-v) \right)\,.
\end{equation}
Contrary to Eq. (\ref{eq:ode}), Eq.~(\ref{eq:ode-a}) defines an autonomous ODE.
The latter admits a unique global solution for any initial condition in $\cZ_+$,
and defines a dynamical system $\cD$. We shall exhibit a strict Lyapunov function
for this dynamical system $\cD$, and deduce that any solution to (\ref{eq:ode-a}) converges
to the set of equilibria of $\cD$ as $t\to\infty$.
On the otherhand, we will prove that the solution to (\ref{eq:ode}) with a proper initial condition is a so-called asymptotic pseudotrajectory (APT) of $\cD$. Due to the
existence of a strict Lyapunov function, the APT shall inherit the convergence behavior of the autonomous system as $t\to\infty$,
which will prove Th.~\ref{th:cv-adam}.
It is convenient to extend the map $h:(0,+\infty)\times \cZ_+\to\cZ$ on $(0,+\infty)\times \cZ\to\cZ$ by
setting $h(t,(x,m,v))\eqdef h(t,(x,m,|v|))$ for every $t>0$, $(x,m,v)\in \cZ$.
Similarly, we extend $h_\infty$ as $h_\infty((x,m,v)) \eqdef h_\infty((x,m,|v|))$.
For any $T\in (0,+\infty]$ and any $\eta\in [0,+\infty]$, we say that a map $z:[0,T)\to \cZ$ is a solution
to (\ref{eq:odeeta}) on $[0,T)$ with initial condition $z_0\in \cZ_+$,
if $z$ is continuous on $[0,T)$, continuously differentiable
on $(0,T)$, and if (\ref{eq:odeeta}) holds for all $t\in (0,T)$.
When $T=+\infty$, we say that the solution is global.
We denote by $Z^\eta_T(z_0)$ the subset of $C([0,T),\cZ)$ formed by the solutions to (\ref{eq:odeeta})
on $[0,T)$ with initial condition $z_0$.
For any $K\subset\cZ_+$, we define $Z^\eta_T(K)\eqdef \bigcup_{z\in K}Z^\eta_T(z)$.
\begin{lemma}
\label{lem:m-v-derivables-en-zero}
Let Assumptions~\ref{hyp:F} and \ref{hyp:S} hold. Consider $x_0\in \bR^d$,
$T\in (0,+\infty]$ and let $z\in Z_T^0((x_0,0,0))$,
which we write $z(t) = (x(t),m(t),v(t))$. Then, $z$
is continuously differentiable on $[0,T)$,
$\dot m(0)=a\nabla F(x_0)$, $\dot v(0)=bS(x_0)$ and
$
\dot x(0) = \frac{-\nabla F(x_0)}{\varepsilon + \sqrt{S(x_0)}}.
$
\end{lemma}
\begin{proof}
By definition of $z(\,.\,)$, $m(t)=\int_0^ta(\nabla F(x(s))-m(s))ds$ for all $t\in [0,T)$
(and a similar relation holds for $v(t)$).
The integrand being continuous, it holds
that $m$ and $v$ are differentiable at zero and $\dot m(0)=a\nabla F(x_0)$, $\dot v(0)=bS(x_0)$.
Similarly, $x(t) = x_0+\int_0^t h_x(s,z(s))ds$, where
$h_x(s,z(s)) \eqdef -(1-e^{-as})^{-1}m(s)/(\varepsilon+\sqrt{(1-e^{-bs})^{-1}v(s)})\,.$
Note that $m(s)/s \to \dot m(0) = a\nabla F(x_0) $ as $s\downarrow 0$.
Thus, $(1-e^{-as})^{-1}m(s)\to \nabla F(x_0)$ as $s\to 0$. Similarly,
$(1-e^{-bs})^{-1}v(s)\to S(x_0)$. It follows that
$h_x(s,z(s))\to -(\varepsilon+\sqrt{S(x_0)})^{-1}\nabla F(x_0)$.
Thus, $s\mapsto h_x(s,z(s))$
can be extended
to a continuous map on $[0,T)\to\bR^d$ and the differentiability of $x$ at zero
follows.
\end{proof}
\begin{lemma}
\label{lem:v-positif}
Let Assumptions~\ref{hyp:S>0}, \ref{hyp:F} and \ref{hyp:S} hold.
For every $\eta\in [0,+\infty]$, $T\in (0,+\infty]$, $z_0\in \cZ_+$, $z\in Z_T^\eta(z_0)$,
it holds that $z((0,T))\subset \cZ_+^*$.
\end{lemma}
\begin{proof}
Set $z(t) = (x(t),m(t),v(t))$ for all $t$. Consider $i\in \{1,\dots,d\}$.
Assume by contradiction that there exists $t_0\in (0,T)$ s.t.
$v_i(t_0)<0$. Set $\tau\eqdef\sup\{t\in [0,t_0]:v_i(t)\geq 0\}$.
Clearly, $\tau<t_0$ and $v_i(\tau)=0$ by the continuity of $v_i$.
Since $v_i(t)\leq 0$ for all $t\in (\tau,t_0]$, it holds that $\dot v_i(t) = b(S_i(x(t))-v_i(t))$
is nonnegative for all $t\in (\tau,t_0]$. This contradicts the fact that $v_i(\tau)>v_i(t_0)$.
Thus, $v_i(t)\geq 0$ for all $t\in [0,T)$.
Now assume by contradiction that there exists $t\in (0,T)$ s.t.
$v_i(t)=0$. Then, $\dot v_i(t)=bS_i(x(t))>0$.
Thus,
$
\lim_{\delta\downarrow 0} \frac{v_i(t-\delta)}{-\delta} = bS_i(x(t))\,.
$
In particular, there exists $\delta>0$ s.t.
$v_i(t-\delta) \leq -\frac{\delta b}2S_i(x(t))\,.$ This contradicts the first point.
\end{proof}
Recall the definitions of $V$ and $U$ from Eqs.~(\ref{eq:V}) and (\ref{eq:U}).
Clearly, $U_\infty(v)\eqdef\lim_{t\to \infty} U(t,v)=a(\varepsilon+\sqrt{v})$ is well defined for every $v\in [0,+\infty)^d$.
Hence, we can also define $V_\infty(z)\eqdef \lim_{t\to \infty} V(t,z)$ for every $z\in \cZ_+$.
\begin{lemma}
\label{lem:V}
Let Assumptions~\ref{hyp:F} and \ref{hyp:S} hold.
Assume that $0< b\leq 4a$.
Consider $(t,z)\in (0,+\infty)\times \cZ_+^*$ and set $z=(x,m,v)$.
Then, $V$ and $V_\infty$ are differentiable at points $(t,z)$ and $z$ respectively. Moreover,
$\ps{\nabla V_\infty(z),h_{\infty}(z)}\leq -\varepsilon \left\|\frac {am}{U_\infty(v)}\right\|^2\,$ and
\begin{equation*}
\ps{\nabla V(t,z), (1,h(t,z))} \leq -\frac{\varepsilon }2\left\|\frac{a\,m}{U(t,v)}\right\|^2\,.
\end{equation*}
\end{lemma}
\begin{proof}
We only prove the second point, the proof of the first point follows the same line.
Consider $(t,z)\in (0,+\infty)\times \cZ_+^*$.
We decompose
$\ps{\nabla V(t,z), (1,h(t,z))} = \partial_tV(t,z)
+\ps{\nabla_z V(t,z),h(t,z)}$. After tedious but straightforward derivations, we get:
\begin{equation}
\label{eq:partial-t}
\resizebox{0.99\hsize}{!}{$
\partial_t V(t,z) =- \sum_{i=1}^d \frac{a^2m_i^2}{U(t,v_i)^2}\left(\frac{e^{-at}\varepsilon}2+
\left(\frac{e^{-at}}2-\frac{be^{-bt}(1-e^{-at})}{4a(1-e^{-bt})}\right)\sqrt{\frac{v_i}{1-e^{-bt}}}\right)\,,
$}
\end{equation}
where $U(t,v_i)=a(1-e^{-at})\left(\varepsilon+\sqrt{\frac{v_i}{1-e^{-bt}}}\right)$ and $\ps{\nabla_z V(t,z),h(t,z)}$ is equal to:
\begin{equation*}
\sum_{i=1}^d \frac{-a^2m_i^2(1-e^{-at})}{U(t,v_i)^2}
\left(\varepsilon
+ (1-\frac b{4a})\sqrt{\frac{v_i}{1-e^{-bt}}}
+\frac{bS_i(x)}{4a\sqrt{v_i(1-e^{-bt})}}
\right)\,.
\end{equation*}
Using that $S_i(x)\geq 0$, we obtain:
\begin{equation}
\ps{\nabla V(t,z), (1,h(t,z))} \leq -\sum_{i=1}^d \frac{a^2m_i^2}{U(t,v_i)^2}\left(
(1-\frac{e^{-at}}2)\varepsilon+c_{a,b}(t)\sqrt{\frac{v_i}{1-e^{-bt}}}
\right)\,,\label{eq:ineg-V}
\end{equation}
where $c_{a,b}(t)\eqdef 1-\frac{e^{-at}}2-\frac b{4a}\frac{1-e^{-at}}{1-e^{-bt}}\,.$
Using inequality $1-{e^{-at}}/2\geq 1/2$ in (\ref{eq:ineg-V}), the inequality~(\ref{eq:ineg-V})
proves the Lemma, provided that one is able to show that $c_{a,b}(t)\geq 0$, for all $t>0$
and all $a,b$ satisfying $0< b\leq 4a$. We prove this last statement.
It can be shown that the function $b\mapsto c_{a,b}(t)$ is decreasing on $[0,+\infty)$.
Hence, $c_{a,b}(t)\geq c_{a,4a}(t)$. Now, $c_{a,4a}(t) = q(e^{-at})$ where $q:[0,1)\to\bR$ is the
function defined for all $y\in [0,1)$ by $q(y) = y \left(y^4-2y^3+1\right)/(2(1-y^4))\,$.
Hence $q \geq 0$. Thus, $c_{a,b}(t)\geq q(e^{-at})\geq 0$.
\end{proof}
\subsection{Proof of Th.~\ref{th:exist-unique}}
\subsubsection{Boundedness}
Define $\cZ_0 \eqdef \{(x,0,0):x\in \bR^d\}$.
Let $\bar e:(0,+\infty)\times \cZ_+\to\cZ_+$ be defined by
$\bar e(t,z)\eqdef (x,m/(1-e^{-at}),v/(1-e^{-bt}))\,$
for every $t>0$ and every $z=(x,m,v)$ in $\cZ_+$.
\begin{proposition}
\label{prop:adam-bounded}
Let Assumptions~\ref{hyp:coercive}, \ref{hyp:S>0}, \ref{hyp:F} and \ref{hyp:S} hold.
Assume that $0< b\leq 4a$.
For every $z_0\in \cZ_0$, there exists a compact set $K\subset \cZ_+$ s.t.
for all $\eta\in [0,+\infty)$, all $T\in (0,+\infty]$ and all $z\in Z_T^\eta(z_0)$,
$\left\{\bar e(t+\eta,z(t)) :t\in (0,T)\right\} \subset K\,.$
Moreover, choosing $z_0$ of the form $z_0=(x_0,0,0)$ and $z(t) = (x(t), m(t),v(t))$, it holds that $F(x(t))\leq F(x_0)$ for all $t\in [0,T)$.
\end{proposition}
\begin{proof}
Let $\eta\in [0,+\infty)$.
Consider a solution $z_\eta(t) = (x_\eta(t),m_\eta(t),v_\eta(t))$ as in the statement, defined on some interval $[0,T)$.
Define
$\hat m_\eta(t) = m_\eta(t)/(1-e^{-a(t+\eta)})$,
$\hat v_\eta(t) = v_\eta(t)/(1-e^{-b(t+\eta)})$.
By Lemma~\ref{lem:v-positif}, $t\mapsto V(t+\eta,z(t))$ is continuous on $[0,T)$, and
continuously differentiable on $(0,T)$.
By Lemma~\ref{lem:V}, $\dot V(t+\eta,z_\eta(t)) \leq 0$ for all $t>0$.
As a consequence, $t\mapsto V(t+\eta,z_\eta(t))$ is non-increasing on $[0,T)$.
Thus, for all $t\geq 0$, $F(x_{\eta}(t))\leq \lim_{t'\downarrow 0}V(t'+\eta,z_\eta(t'))$. Note that
$
V(t+\eta,z_\eta(t)) \leq F(x_\eta(t))+\frac 12 \sum_{i=1}^d
\frac{m_{\eta,i}(t)^2}{a(1-e^{-a(t+\eta)})\varepsilon}\,. \label{eq:majV}
$
If $\eta>0$, every term in the sum in the righthand side
tends to zero, upon noting that
$m_{\eta}(t)\to 0$ as $t\to 0$.
The statement still holds if $\eta=0$. Indeed, by Lemma~\ref{lem:m-v-derivables-en-zero},
for a given $i\in \{1,\dots,d\}$, there exists $\delta>0$ s.t. for all $0<t<\delta$,
$m_{\eta,i}(t)^2\leq 2 a^2 (\partial_i F(x_0))^2 t^2$
and $1-e^{-at}\geq (at)/2$. As a consequence, each term of the sum
is no larger than $4 (\partial_i F(x_0))^2 t/\varepsilon$, which tends to zero as $t\to 0$.
We conclude that for all $t\geq 0$, $F(x_\eta(t))\leq F(x_0)$.
In particular, $\{x_\eta(t):t\in [0,T)\}\subset \{F\leq F(x_0)\}$, the latter set being bounded
by Assumption~\ref{hyp:coercive}.
We prove that $v_{i,\eta}(t)$ is (upper)bounded.
Define $R_{i} \eqdef \sup S_i(\{F\leq F(x_0)\})$, which is finite by continuity of $S$.
Assume by contradiction that the set $\{t\in [0,T):v_{\eta,i}(t)\geq R_{i}+1\}$ is non-empty, and denote
its infimum by $\tau$. By continuity of $v_{\eta,i}$, one has
$v_{\eta,i}(\tau) = R_{i}+1$. This by the way implies that $\tau>0$. Hence,
$\dot v_{\eta,i}(\tau) = b(S_i(x_\eta(\tau))-v_{\eta,i}(\tau)) \leq -b$.
This means that there exists $\tau'<\tau$ s.t. $v_{\eta,i}(\tau')>v_{\eta,i}(\tau)$, which contradicts the definition of $\tau$.
We have shown that $v_{\eta,i}(t)\leq R_i+1$ for all $t\in (0,T)$.
In particular, when $t\geq 1$, $\hat v_{\eta,i}(t) = v_{\eta,i}(t)/(1-e^{-bt}) \leq (R_i+1)/(1-e^{-b})\,.$
Consider $t\in (0,1\wedge T)$.
By the mean value theorem, there exists $\tilde t_\eta\in [0,t]$ s.t. $v_{\eta,i}(t) = \dot v_{\eta,i}(\tilde t_\eta)t$.
Thus, $v_{\eta,i}(t) \leq b S_i(x(\tilde t_\eta)) t\leq b R_i t$. Using that the map $y\mapsto y/(1-e^{-y})$ is increasing on $(0,+\infty)$,
it holds that for all $t\in (0,1\wedge T)$,
$\hat v_{\eta,i}(t)
\leq bR_i /(1-e^{-b})\,.$
We have shown that, for all $t\in (0,T)$ and all $i\in \{1,\dots,d\}$, $0\leq \hat v_{\eta,i}(t)\leq M$, where
$M\eqdef (1-e^{-b})^{-1}(1+ b)(1+\max\{R_\ell:\ell\in \{1,\dots,d\})$.
As $V(t+\eta,z_\eta(t))\leq F(x_0)$, we obtain: $F(x_0) \geq F(x_\eta(t))+\frac 12
\left\|m_\eta(t)\right\|^2_{U(t+\eta,v_\eta(t))^{-1}}$.
Thus, $F(x_0) \geq \inf F+\frac 1{2a(\varepsilon+\sqrt{M})} \|m_{\eta}(t)\|^2\,$.
Therefore, $m_\eta(\,.\,)$ is bounded on $[0,T)$, uniformly in $\eta$.
The same holds for $\hat m_\eta$ by using the mean value theorem
in the same way as for $\hat v_\eta$. The proof is complete.
\end{proof}
\begin{proposition}
\label{prop:bounded}
Let Assumptions~\ref{hyp:coercive}, \ref{hyp:S>0}, \ref{hyp:F} and \ref{hyp:S} hold.
Assume that $0< b\leq 4a$.
Let $K$ be a compact subset of $\cZ_+$.
Then, there exists an other compact set $K'\subset \cZ_+$ s.t.
for every $T\in (0,+\infty]$ and every $z\in Z_{T}^\infty(K)$,
$z([0,T))\subset K'$.
\end{proposition}
\begin{proof}
The proof follows the same line as Prop.~\ref{prop:adam-bounded} and is omitted.
\end{proof}
For any $K\subset \cZ_+$, define $v_{\min}(K)\eqdef\inf\{v_k: (x,m,v)\in K,i\in \{1,\dots,d\}\}$.
\begin{lemma}
\label{lem:v-lowerbound}
Under Assumptions~\ref{hyp:coercive}, \ref{hyp:S>0}, \ref{hyp:F} and \ref{hyp:S},
the following holds true
\begin{enumerate}[{\it i)},leftmargin=*]
\item For every compact set $K\subset \cZ_+$, there exists $c>0$, s.t. for every $z\in Z^\infty_{\infty}(K)$, of the form
$z(t)= (x(t),m(t),v(t))$, $v_i(t)\geq c \min\left(1 ,\frac{v_{\min}(K)}{2c}+ t\right)\qquad(\forall t\geq 0, \forall i\in\{1,\dots,d\})\,.$
\item For every $z_0\in \cZ_0$, there exists $c>0$ s.t. for every $\eta\in [0,+\infty)$ and every $z\in Z_\infty^\eta(z_0)$,
$v_i(t)\geq c\min(1,t)\qquad(\forall t\geq 0, \forall i\in\{1,\dots,d\})\,.$
\end{enumerate}
\end{lemma}
\begin{proof}
We prove the first point. Consider a compact set $K\subset \cZ_+$.
By Prop.~\ref{prop:bounded}, one can find a compact set $K'\subset \cZ_+$ s.t.
for every $z\in Z^\infty_{\infty}(K)$, it holds that $\{z(t):t\geq 0\}\subset K'$.
Denote by $L_S$ the Lipschitz constant of $S$ on the compact set $\{x:(x,m,v)\in K'\}$.
Introduce the constants $M_1\eqdef \sup\{\|m/(\varepsilon + \sqrt v)\|_\infty:(x,m,v)\in K'\}$,
$M_2\eqdef \sup\{\|S(x)\|_\infty:(x,m,v)\in K'\}$.
The constants $L_S, M_1, M_2$ are finite.
Now consider a global solution $z(t)=(x(t),m(t),v(t))$ in $Z^\infty_{\infty}(K)$.
Choose $i\in \{1,\dots,d\}$ and consider $t\geq 0$. By the mean value theorem,
there exists $t'\in [0,t]$ s.t. $v_i(t) = v_i(0)+\dot v_i(t')t$. Thus,
$ v_i(t) = v_i(0) + \dot v_i(0) t + b(S_i(x(t')) - v_i(t') - S_i(x(0))+ v_i(0)) t$,
which in turn implies
$ v_i(t)\geq v_i(0) + \dot v_i(0) t - b L_S\|x(t')-x(0)\|t - b |v_i(t') - v_i(0)| t$.
Using again the mean value theorem, for every $\ell\in \{1,\dots,d\}$, there exists $t''\in [0,t']$ s.t.
$
|x_\ell(t')-x_\ell(0)| = t' |\dot x_\ell(t'')| \leq t M_1\,.
$
Therefore, $\|x(t')-x(0)\|\leq \sqrt d M_1 t$. Similarly, there exists $\tilde t$ s.t.:
$|v_i(t') - v_i(0)|= t'|\dot v_i(\tilde t)|\leq t'b S_i(x(\tilde t)) \leq t bM_2\,.$
Putting together the above inequalities, $v_i(t) \geq v_i(0) (1-bt) + bS_i(x(0)) t - bC t^2 \,$,
where $C\eqdef (M_2+L_S\sqrt d M_1)$.
For every $t\leq 1/(2b)$, $v_i(t) \geq \frac{v_{\min}}{2} + tbC\left(\frac{S_{\min}}C - t\right) \,,$
where we defined $S_{\min}\eqdef\inf\{S_i(x):i\in \{1,\dots,d\}, (x,m,v)\in K\}$.
Setting $\tau \eqdef 0.5\min(1/b,S_{\min}/C)$,
\begin{equation}
\forall t\in [0,\tau],\ v_i(t) \geq \frac{v_{\min}}{2} + \frac{bS_{\min}t}{2}\,.\label{eq:vlin}
\end{equation}
Set $\kappa_1\eqdef 0.5(v_{\min} + bS_{\min}\tau)$. Note that $v_i(\tau)\geq \kappa_1$.
Define $S_{\min}'\eqdef\inf\{S_i(x):i\in \{1,\dots,d\}, (x,m,v)\in K'\}\,.$
Note that $S_{\min}'>0$ by Assumptions~\ref{hyp:S} and \ref{hyp:S>0}.
Finally, define $\kappa = 0.5\min(\kappa_1,S_{\min}')$.
By contradiction, assume that the set $\{t\geq \tau : v_i(t)<\kappa\}$ is non-empty, and
denote by $\tau'$ its infimum. It is clear that $\tau'>\tau$ and
$v_i(\tau')=\kappa$. Thus, $b^{-1}\dot v_i(\tau') =S_i(x(\tau'))-\kappa$.
We obtain that $b^{-1}\dot v_i(\tau') \geq 0.5S_{\min}'>0$.
As a consequence, there exists $t\in (\tau,\tau')$ s.t. $v_i(t)<v_i(\tau')$. This contradicts
the definition of $\tau'$. We have shown that for all $t\geq \tau$, $v_i(t)\geq \kappa$. Putting this together
with Eq.~(\ref{eq:vlin}) and using that $\kappa\leq v_{\min} + bS_{\min}\tau$,
we conclude that:
$\forall t\geq 0,\ v_i(t)\geq \min\left(\kappa\,, \frac{v_{\min}}{2} + \frac{bS_{\min}t}{2}\right)\,.$
Setting $c\eqdef \min(\kappa,bS_{\min}/2)$, the result follows.
We prove the second point. By Prop.~\ref{prop:adam-bounded}, there exists a compact set $K\subset \cZ_+$ s.t.
for every $\eta\geq 0$, every $z\in Z_\infty^\eta(x_0)$ of the form $z(t) = (x(t),m(t),v(t))$
satisfies
$\{(x(t),\hat m(t),\hat v(t)):t\geq 0\}\subset K$,
where $\hat m(t) = m(t)/(1-e^{-a(t+h)})$ and $\hat v(t) = v(t)/(1-e^{-b(t+h)})$.
Denote by $L_S$ the Lipschitz constant of $S$ on the set $\{x:(x,m,v)\in K\}$.
Introduce the constants $M_1\eqdef \sup\{\|m/(\varepsilon + \sqrt v)\|_\infty:(x,m,v)\in K\}$,
$M_2\eqdef \sup\{\|S(x)\|_\infty:(x,m,v)\in K'\}$. These constants being introduced,
the rest of the proof follows the same line as the proof of the first point.
\end{proof}
\subsubsection{Existence}
\label{sec:existence-adam}
\begin{corollary}
\label{coro:existence}
Let Assumptions~\ref{hyp:coercive}, \ref{hyp:S>0}, \ref{hyp:F} and \ref{hyp:S} hold.
Assume that $0< b\leq 4a$.
For every $z_0\in \cZ_+$,$Z_{\infty}^\infty(z_0)\neq\emptyset$.
For every $(z_0,\eta)\in \cZ_0\times (0,+\infty)$,$Z_{\infty}^\eta(z_0)\neq\emptyset$.
\end{corollary}
\begin{proof}
We prove the first point (the proof of the second point follows the same line).
Under Assumptions~\ref{hyp:F} and \ref{hyp:S}, $h_\infty$ is continuous.
Therefore, Cauchy-Peano's theorem guarantees the existence of a solution to the (\ref{eq:ode}) issued from $z_0$,
which we can extend over a maximal interval of existence $[0,T_{\max})$
We conclude that the solution is global ($T_{\max} = +\infty$) using the boundedness of the solution given by Prop.~\ref{prop:bounded}.
\end{proof}
\begin{lemma}
\label{lem:equicont-eta}
Let Assumptions~\ref{hyp:coercive}, \ref{hyp:S>0}, \ref{hyp:F} and \ref{hyp:S} hold.
Assume that $0< b\leq 4a$.
Consider $z_0\in \cZ_0$. Denote by $(z_\eta:\eta\in (0,+\infty))$ a family of functions on $[0,+\infty)\to \cZ_+$
s.t. for every $\eta>0$, $z_\eta\in Z_\infty^\eta(z_0)$.
Then, $(z_\eta)_{\eta>0}$ is equicontinuous.
\end{lemma}
\begin{proof}
For every such solution $z_\eta$, we set $z_\eta(t)=(x_\eta(t),m_\eta(t),v_\eta(t))$ for all $t\geq 0$,
and define $\hat m_\eta$ and $\hat v_\eta$ as in Prop.~\ref{prop:adam-bounded}.
By Prop.~\ref{prop:adam-bounded}, there exists a constant $M_1$ s.t. for all $\eta>0$ and all $t\geq 0$,
$\max(\|x_\eta(t)\|,\|\hat m_\eta(t)\|_\infty,\|\hat v_\eta(t)\|)\leq M_1$.
Using the continuity of $\nabla F$ and $S$, there exists an other finite constant $M_2$ s.t.
$M_2\geq \sup\{\|\nabla F(x)\|_\infty:x\in \bR^d, \|x\|\leq M_1\}$ and
$M_2\geq \sup\{\|S(x)\|_\infty:x\in \bR^d, \|x\|\leq M_1\}$.
For every $(s,t)\in [0,+\infty)^2$, we have for all $i\in \{1,\dots,d\}$,
$|x_{\eta,i}(t)-x_{\eta,i}(s)|\leq \int_s^t\left|\frac{\hat m_{\eta,i}(u)}{\varepsilon + \sqrt{\hat v_{\eta,i}(u)}}\right|du\,\leq \frac{M_1}\varepsilon |t-s|$,
and similarly $|m_{\eta,i}(t)-m_{\eta,i}(s)| \leq a(M_1+M_2)|t-s|$,
$|v_{\eta,i}(t)-v_{\eta,i}(s)|\leq b(M_1+M_2)|t-s|$\,.
Therefore, there exists a constant $M_3$, independent from $\eta$, s.t. for all $\eta>0$ and all $(s,t)\in [0,+\infty)^2$,
$\|z_\eta(t)-z_\eta(s)\|\leq M_3 |t-s|$
\end{proof}
\begin{proposition}
\label{prop:existence-adam}
Let Assumptions~\ref{hyp:coercive}, \ref{hyp:S>0}, \ref{hyp:F} and \ref{hyp:S} hold.
Assume that $0< b\leq 4a$.
For every $z_0\in \cZ_0$, $Z_\infty^0(z_0)\neq \emptyset$ \emph{i.e.},
(\ref{eq:ode}) admits a global solution issued from $z_0$.
\end{proposition}
\begin{proof}
By Cor.~\ref{coro:existence}, there exists a family $(z_\eta)_{\eta>0}$ of functions on $[0,+\infty)\to \cZ$
s.t. for every $\eta>0$, $z_\eta\in Z^\eta_\infty(z_0)$.
We set as usual $z_\eta(t)=(x_\eta(t),m_\eta(t),v_\eta(t))$. By Lemma~\ref{lem:equicont-eta},
and the Arzelà-Ascoli theorem, there exists a map $z:[0,+\infty)\to \cZ$ and a sequence $\eta_n\downarrow 0$ s.t.
$z_{\eta_n}$ converges to $z$ uniformly on compact sets, as $n\to\infty$. Considering some fixed scalars $t>s> 0$,
$z(t) = z(s) + \lim_{n\to\infty}\int_s^t h(u+\eta_n, z_{\eta_n}(u))du\,.$
By Prop.~\ref{prop:adam-bounded}, there exists a compact set $K\subset \cZ_+$ s.t.
$\{z_{\eta_n}(t):t\geq 0\}\subset K$ for all $n$.
Moreover, by Lemma~\ref{lem:v-lowerbound}, there exists a constant $c>0$ s.t.
for all $n$ and all $u\geq 0$, $v_{\eta_n,k}(u)\geq c \min(1,u)$.
Denote by $\bar K\eqdef K\cap (\bR^d\times\bR^d\times [c\min(1,s),+\infty)^d)$.
It is clear that $\bar K$ is a compact subset of $\cZ_+^*$.
Since $h$ is continuously differentiable on the set
$[s,t]\times \bar K$, it is Lipschitz continuous on that set. Denote by $L_h$ the corresponding
Lipschitz constant. We obtain:
$$
\int_s^t\|h(u+\eta_n, z_{\eta_n}(u)) - h(u, z(u))\|du \leq L_h\left(\eta_n + \sup_{u\in [s,t]}\|z_{\eta_n}(u)-z(u)\|\right)(t-s)\,,
$$
and the righthand side converges to zero. As a consequence, for all $t>s$,
$
z(t) = z(s) + \int_s^t h(u, z(u))du\,.
$ Moreover, $z(0)=z_0$. This proves that $z\in Z^0_\infty(z_0)$.
\end{proof}
\subsubsection{Uniqueness}
\begin{proposition}
\label{prop:unique-adam}
Let Assumptions~\ref{hyp:coercive}, \ref{hyp:S>0}, \ref{hyp:F} and \ref{hyp:S} hold.
Assume $b\leq 4a$.
For every $z_0\in\cZ_0$, $Z_\infty^0(z_0)$ is a singleton
\emph{i.e.}, there exists a unique global solution to (\ref{eq:ode})
with initial condition $z_0$.
\end{proposition}
\begin{proof}
Consider solutions $z$ and $z'$ in $Z^0_\infty(z_0)$. We denote by $(x(t),m(t),v(t))$ the blocks of $z(t)$,
and we define $(x'(t),m'(t),v'(t))$ similarly. For all $t>0$, we
define $\hat m(t)\eqdef m(t)/(1-e^{-at})$, $\hat v(t)\eqdef
v(t)/(1-e^{-bt})$, and we define $\hat m'(t)$ and $\hat v'(t)$
similarly. By Prop.~\ref{prop:adam-bounded}, there exists a compact
set $K\subset \cZ_+$ s.t. $ (x(t),\hat m(t),\hat v(t))$ and
$(x'(t),\hat m'(t),\hat v'(t))$ are both in $K$ for all $t> 0$. We
denote by $L_S$ and $L_{\nabla F}$ the Lipschitz constants of $S$
and $\nabla F$ on the compact set $\{x:(x,m,v)\in K\}$. These
constants are finite by Assumptions~\ref{hyp:F}
and \ref{hyp:S}.
We define $M\eqdef \sup\{\|m\|_\infty:(x,m,v)\in K\}$.
Define $u_x(t) \eqdef \|x(t)-x'(t)\|^2$,
$u_m(t)\eqdef \|\hat m(t)-\hat m'(t)\|^2$ and $u_v(t)\eqdef \|\hat v(t)-\hat v'(t)\|^2$.
Let $\delta>0$. Define: $u^{(\delta)}(t) \eqdef u_x(t)+\delta u_m(t)+\delta u_v(t)\,.$
By the chain rule and the Cauchy-Schwarz inequality,
$\dot u_x(t)\leq 2\|x(t)-x'(t)\|\|\frac{\hat m(t)}{\varepsilon +\sqrt{\hat v(t)}}-\frac{\hat m'(t)}{\varepsilon +\sqrt{\hat v'(t)}}\|$. Thus,
using Lemma~\ref{lem:v-lowerbound}, there exists $c>0$ s.t.
\begin{equation*}
\dot u_x(t)\leq 2\|x(t)-x'(t)\|\left(\varepsilon^{-1}\left\|\hat m(t)-\hat m'(t)\right\|
+\frac M{2\varepsilon^2\sqrt{c\min(1,t)}}\left\|{\hat v(t)}-{\hat v'(t)}\right\|\right)\,.
\end{equation*}
For any $\delta>0$,
$2\|x(t)-x'(t)\|\,\|\hat m(t)-\hat m'(t)\|\leq \delta^{-1/2}(u_x(t)+\delta u_m(t))\leq \delta^{-1/2}u^{(\delta)}(t)$.
Similarly, $2\|x(t)-x'(t)\|\,\|\hat v(t)-\hat v'(t)\|\leq \delta^{-1/2}u^{(\delta)}(t)$.
Thus, for any $\delta>0$,
\begin{align}
\label{eq:ux}
\dot u_x(t)&\leq \left(\frac 1{\varepsilon\sqrt \delta}+\frac M{2\varepsilon^2\sqrt{\delta c\min(1,t)}}\right) u^{(\delta)}(t)\,.
\end{align}
We now study $u_m(t)$. For all $t>0$, we obtain after some algebra:
$\frac {d}{dt}\hat m(t) = a(\nabla F(x(t)) - \hat m(t))/(1-e^{-at})\,.$
Therefore,
$
\dot u_m(t) \leq \frac{2aL_{\nabla F}}{1-e^{-at}}\|\hat m(t)-\hat m'(t)\|\,\|x(t) -x'(t)\|\,.
$
For any $\theta>0$, it holds that $2\|\hat m(t)-\hat m'(t)\|\,\|x(t) -x'(t)\|\leq \theta u_x(t)+ \theta^{-1}u_m(t)$.
In particular, letting $\theta\eqdef 2L_{\nabla F}$, we obtain that for all $\delta>0$,
\begin{equation}
\resizebox{\hsize}{!}{$
\delta \dot u_m(t)\leq \frac{a }{2(1-e^{-at})}\left(4\delta L_{\nabla F}^2 u_x(t)+ \delta u_m(t)\right)
\leq \left(\frac a2+\frac 1{2t}\right)\left(4\delta L_{\nabla F}^2 u_x(t)+ \delta u_m(t)\right)\,,
$}
\label{eq:um}
\end{equation}
where the last inequality is due to the fact that $y/(1-e^{-y})\leq 1+y$ for all $y>0$.
Using the exact same arguments, we also obtain that
\begin{align}
\delta \dot u_v(t)&\leq \left(\frac b2+\frac 1{2t}\right)\left(4\delta L_{S}^2 u_x(t)+ \delta u_m(t)\right)\,.
\label{eq:uv}
\end{align}
We now choose any $\delta$ s.t. $4\delta \leq 1/\max(L_S^2,L_{\nabla F}^2)$.
Then, Eq.~(\ref{eq:um}) and~(\ref{eq:uv}) respectively imply that
$\delta \dot u_m(t)\leq 0.5(a+t^{-1})u^{(\delta)}(t)$ and
$\delta \dot u_v(t)\leq 0.5(b+t^{-1})u^{(\delta)}(t)$.
Summing these inequalities along with Eq.~(\ref{eq:ux}), we obtain that for every $t>0$,
$\dot u^{(\delta)}(t) \leq \psi(t) u^{(\delta)}(t)\,$,
where: $\psi(t) \eqdef \frac{a+b}2+\frac 1{\varepsilon\sqrt \delta}+\frac M{2\varepsilon^2\sqrt{\delta c\min(1,t)}}
+ \frac 1t\,.$
From Gr\"onwall's inequality, it holds that for every $t>s>0$,
$u^{(\delta)}(t)\leq u^{(\delta)}(s)\exp\left(\int_s^t \psi(s')ds'\right)\,$.
We first consider the case where $t\leq 1$. We set $c_1\eqdef (a+b)/2+(\varepsilon\sqrt \delta)^{-1}$
and $c_2\eqdef M/(\varepsilon^2\sqrt{\delta c})$. With these notations,
$\int_s^t \psi(s')ds' \leq c_1t+c_2\sqrt t + \ln \frac ts\,.$
Therefore, $u^{(\delta)}(t)\leq \frac{u^{(\delta)}(s)}{s}
\exp\left(c_1t+c_2\sqrt t + \ln t\right)\,$.
By Lemma~\ref{lem:m-v-derivables-en-zero}, recall that $\dot x(0)$ and
$\dot x'(0)$ are both well defined (and coincide). Thus,
$$
u_x(s) = \|x(s)-x'(s)\|^2
\leq 2\|x(s)-x(0)-\dot x(0)s\|^2+2\|x'(s)-x'(0)-\dot x'(0)s\|^2\,.
$$
It follows that $u_x(s)/s^2$ converges to zero as $s\downarrow 0$.
We now show the same kind of result for $u_m(s)$ and $u_v(s)$.
Consider $i\in \{1,\dots,d\}$. By the mean value theorem, there exists $\tilde s$ (resp. $\tilde s'$) in
$[0,t]$ s.t. $m_i(s)=\dot m_i(\tilde s)s$ (resp. $m_i'(s)=\dot m_i'(\tilde s')s$).
Thus, $\hat m_i(s) = \frac{as}{1-e^{-as}} \left(\partial_i F(x(\tilde s))-m_i(\tilde s)\right)$,
and a similar equality holds for $\hat m_i'(s)$. Then,
given that $\|x(\tilde s)-x'(\tilde s')\| \vee \|m(\tilde s)-m'(\tilde s')\| \leq \|z(\tilde s)-z'(\tilde s')\|$
, $\tilde s\leq s$ and $\tilde s'\leq s$,
$$
\frac{|\hat m_i(s) -\hat m_i'(s) |}s
\leq \frac{2a(L_{\nabla F}\vee 1)s}{1-e^{-as}} \left(\frac{\|z(\tilde s)-z(0)\|}{\tilde s}+\frac{\|z'(\tilde s')-z'(0)\|}{\tilde s'}\right)\,.
$$
By Lemma~\ref{lem:m-v-derivables-en-zero}, $z$ and $z'$ are differentiable at point zero.
Then, the above inequality gives $\limsup_{s\downarrow 0}\frac{|\hat m_i(s) -\hat m_i'(s) |}s \leq 4(L_{\nabla F}\vee 1)\|\dot z(0)\|$
and
\limsup_{s\downarrow 0}\frac{u_m(s)}{s^2} \leq 16d(L_{\nabla F}^2\vee 1)\|\dot z(0)\|^2\,.
Therefore, $u_m(s)/s$ converges to zero as $s\downarrow 0$.
By similar arguments, it can be shown that
$\limsup_{s\downarrow 0}{u_v(s)}/{s^2} \leq 16d(L_{S}^2\vee 1)\|\dot z(0)\|^2$,
thus $\lim u_v(s)/s=0$.
Finally, we obtain that
${u^{(\delta)}(s)}/{s}$ converges to zero as $s\downarrow 0$.
Letting $s$ tend to zero, we obtain that for every
$t\leq 1$, $u^{(\delta)}(t)=0$. Setting $s=1$ and $t>1$,
and noting that $\psi$ is integrable on $[1,t]$, it follows that $u^{(\delta)}(t)=0$ for all $t>1$.
This proves that $z=z'$.
\end{proof}
We recall that a semiflow $\Phi$ on the space $(E,\sd)$ is a continuous map
$\Phi$ from $[0,+\infty)\times E$ to $E$ defined by $(t,x) \mapsto \Phi(t,x) = \Phi_t(x)$
such that $\Phi_0$ is the identity and $\Phi_{t+s} = \Phi_t\circ\Phi_s$ for all $(t,s)\in [0,+\infty)^2$.
\begin{proposition}
\label{prop:semiflow}
Let Assumptions~\ref{hyp:coercive}, \ref{hyp:S>0}, \ref{hyp:F} and \ref{hyp:S} hold.
Assume that $0< b\leq 4a$.
The map $Z_{\infty}^{\infty}$ is single-valued on $\cZ_+\to C([0,+\infty),\cZ_+)$
\emph{i.e.}, there exists a unique global solution to~(\ref{eq:ode-a})
starting from any given point in $\cZ_+$.
Moreover, the following map is a semiflow:
\begin{equation}
\label{eq:flot}
\begin{array}[h]{rcl}
\Phi:[0,+\infty)\times \cZ_+&\to& \cZ_+ \\
(t,z) &\mapsto& Z_{\infty}^{\infty}(z)(t)
\end{array}
\end{equation}
\end{proposition}
\begin{proof}
The result is a direct consequence of Lemma~\ref{prop:unique-adam}.
\end{proof}
\subsection{Proof of Th.~\ref{th:cv-adam}}
\label{sec:convergence}
\subsubsection{Convergence of the semiflow}
We first recall some useful definitions and results.
Let $\Psi$ represent any semiflow on an arbitrary metric space $(E,\sd)$.
A point $z\in E$ is called an \emph{equilibrium point} of the semiflow $\Psi$ if $\Psi_t(z)=z$ for all $t\geq 0$.
We denote by $\Lambda_\Psi$ the set of equilibrium points of~$\Psi$.
A continuous function $\sV:E\to\bR$ is called a \emph{Lyapunov function} for the semiflow $\Psi$
if $\sV(\Psi_t(z))\leq \sV(z)$ for all $z\in E$ and all $t\geq 0$.
It is called a \emph{strict Lyapunov function} if, moreover,
$
\{ z\in E\,:\, \forall t\geq 0,\,\sV(\Psi_t(z))=\sV(z) \}= \Lambda_\Psi
$.
If $\sV$ is a strict Lyapunov function for $\Psi$ and if $z\in E$ is a point s.t. $\{\Psi_t(z):t\geq 0\}$ is relatively compact,
then it holds that $\Lambda_\Psi\neq \emptyset$ and $\sd(\Psi_t(z),\Lambda_\Psi)\to 0$, see \cite[Th.~2.1.7]{haraux1991systemes}.
A continuous function $z:[0,+\infty)\to E$ is said to be an asymptotic pseudotrajectory (APT)
for the semiflow $\Psi$ if for every $T\in (0,+\infty)$,
$
\lim_{t\to+\infty} \sup_{s\in [0,T]} \sd(z(t+s),\Psi_s(z(t))) = 0\,.
$
The following result follows from \cite[Th.~5.7]{ben-(cours)99} and \cite[Prop.~6.4]{ben-(cours)99}.
\begin{proposition}[\cite{ben-(cours)99}]\hfill\\
\label{prop:benaim}
Consider a semiflow $\Psi$ on $(E,d)$ and a map $z:[0,+\infty)\to E$. Assume the following:
\begin{enumerate}[{\it i)}]
\item $\Psi$ admits a strict Lyapunov function $\sV$.
\item The set $\Lambda_\Psi$ of equilibrium points of $\Psi$ is compact.
\item $\sV(\Lambda_\Psi)$ has an empty interior.
\item $z$ is an APT of $\Psi$.
\item $z([0,\infty))$ is relatively compact.
\end{enumerate}
Then, $
\bigcap_{t\geq 0}\overline{z([t,\infty))}$ is a compact connected subset of $\Lambda_\Psi$\,.
\end{proposition}
For every $\delta>0$ and every $z = (x,m,v)\in \cZ_+$, define:
\begin{equation}
W_\delta(x,m,v) \eqdef V_{\infty}(x,m,v) - \delta \ps{\nabla F(x),m} + \delta \|S(x)-v\|^2\,,\label{eq:Wdelta}
\end{equation}
where we recall that $V_\infty(z)\eqdef \lim_{t\to \infty} V(t,z)$ for every $z\in \cZ_+$ and $V$ is defined by Eq.(\ref{eq:V}).
Consider the set $\cE\eqdef h_\infty^{-1}(\{0\})$ of all equilibrium points of (\ref{eq:ode-a}), namely:
$\cE = \{(x,m,v)\in \cZ_+:\nabla F(x)=0,m=0,v=S(x)\}\,$.
The set $\cE$ is non-empty by Assumption~\ref{hyp:coercive}.
\begin{proposition}
\label{prop:Wstrict}
Let Assumptions~\ref{hyp:coercive}, \ref{hyp:S>0}, \ref{hyp:F} and \ref{hyp:S} hold.
Assume that $0< b\leq 4a$.
Let $K\subset \cZ_+$ be a compact set. Define $K'\eqdef \overline{\{\flot(t,z):t\geq 0, z\in K\}}$.
Let $\bflot:[0,+\infty)\times K'\to K'$ be the restriction of the semiflow $\flot$ to $K'$ \emph{i.e.},
$\bflot(t,z) = \flot(t,z)$ for all $t\geq 0, z\in K'$. Then,
\begin{enumerate}[{\it i)}]
\item $K'$ is compact.
\item $\bflot$ is well defined and is a semiflow on $K'$.
\item The set of equilibrium points of $\bflot$ is equal to $\cE\cap K'$.
\item There exists $\delta>0$ s.t. $W_\delta$ is a strict Lyapunov function for the semiflow $\bflot$.
\end{enumerate}
\end{proposition}
\begin{proof}
The first point is a consequence of Prop.~\ref{prop:bounded}.
The second point stems from Prop.~\ref{prop:semiflow}.
The third point is immediate from the definition of $\cE$ and the fact that $\bflot$ is valued in $K'$.
We now prove the last point.
Consider $z\in K'$ and write $\bflot_t(z)$ under the form $\bflot_t(z) = (x(t),m(t),v(t))$. For \emph{any} map ${\mathsf W}:\cZ_+\to\bR$, define
for all $t>0$, $ \cL_{\mathsf W}(t) \eqdef \limsup_{s\to 0} s^{-1}({\mathsf W}(\bflot_{t+s}(z)) - {\mathsf W}(\bflot_{t}(z)))\,.$
Introduce $G(z)\eqdef -\ps{\nabla F(x),m}$ and $H(z)\eqdef \|S(x)-v\|^2$ for every $z=(x,m,v)$.
Consider $\delta>0$ (to be specified later on).
We study $\cL_{W_\delta} = \cL_V + \delta \cL_{G} + \delta \cL_{H}$.
Note that $\bflot_t(z)\in K'\cap \cZ_+^*$ for all $t>0$ by Lemma~\ref{lem:v-positif}. Thus, $t\mapsto V_\infty(\bflot_t(z))$
is differentiable at any point $t>0$ and the derivative coincides with $\cL_V(t) = \dot V_\infty(\bflot_t(z))$.
Define $C_1\eqdef \sup\{\|v\|_\infty:(x,m,v)\in K'\}$.
Then, by Lemma~\ref{lem:V}, $\cL_V(t)\leq -\varepsilon(\varepsilon+\sqrt{C_1})^{-2} \left\|m(t)\right\|^2$.
Let $L_{\nabla F}$ be the Lipschitz constant of $\nabla F$
on $\{x:(x,m,v)\in K'\}$.
For every $t>0$,
\begin{align*}
\cL_G(t
&\leq \limsup_{s\to 0} s^{-1}\|\nabla F(x(t))- \nabla F(x(t+s))\| \|m(t+s)\| - \ps{\nabla F(x(t)),\dot m(t)}\\
&\leq L_{\nabla F}\varepsilon^{-1}\|m(t)\|^2 - a\|\nabla F(x(t))\|^2 + a\ps{\nabla F(x(t)),m(t)}\\
&\leq - \frac a2\|\nabla F(x(t))\|^2 + \left(\frac a2+\frac{L_{\nabla F}}{\varepsilon}\right)\|m(t)\|^2\,.
\end{align*}
Denote by $L_S$ the Lipschitz constant of $S$ on $\{x:(x,m,v)\in K'\}$.
For every $t>0$,
\begin{eqnarray*}
\cL_H(t
&=& \limsup_{s\to 0} s^{-1}(\|S(x(t+s))-S(x(t)) + S(x(t))-v(t+s)\|^2-\|S(x(t))-v(t)\|^2)\\
&=& - 2\ps{S(x(t))-v(t),\dot v(t)
+\limsup_{s\to 0} 2s^{-1}\ps{S(x(t+s))-S(x(t)),S(x(t))-v(t+s)} \\
&\leq& - 2b\|S(x(t))-v(t)\|^2+2L_S\varepsilon^{-1} \|m(t)\| \|S(x(t))-v(t)\|\,.
\end{eqnarray*}
Using that $2 \|m(t)\| \|S(x(t))-v(t)\|\leq \frac {L_S}{b\varepsilon}\|m(t)\|^2 + \frac {b\varepsilon}{L_S}\|S(x(t))-v(t)\|^2$, we obtain
$
\cL_H(t) \leq - b\|S(x(t))-v(t)\|^2+\frac {L_S^2}{b\varepsilon^2}\|m(t)\|^2\,.
$
Hence,
for every $t>0$,
$$
\cL_{W_\delta}(t) \leq -M(\delta)
\|m(t)\|^2 - \frac {a\delta}2\|\nabla
F(x(t))\|^2 - \delta b \|S(x(t))-v(t)\|^2\,.
$$
where $M(\delta)\eqdef \varepsilon(\varepsilon+\sqrt{C_1})^{-2} -\frac {\delta
L_S^2}{b\varepsilon^2} - \delta \left(\frac a2+\frac{L_{\nabla
F}}{\varepsilon}\right)\,.$
Choosing $\delta$ s.t. $M(\delta)>0$,
\begin{equation}
\forall t>0,\ \ \cL_{W_\delta}(t) \leq -c\left( \|m(t)\|^2 + \|\nabla F(x(t))\|^2 + \|S(x(t))-v(t)\|^2\right)\,,\label{eq:ae-derivee}
\end{equation}
where $c \eqdef \min\{ M(\delta), \frac {a\delta}2, \delta b\}$.
It can easily be seen that for every $z\in K'$, $t\mapsto W_\delta(\bflot_t(z))$ is Lipschitz continuous, hence absolutely continuous.
Its derivative almost everywhere coincides with $\cL_{W_\delta}$, which is non-positive.
Thus, $W_\delta$ is a Lyapunov function for $\bflot$.
We prove that the Lyapunov function is strict.
Consider $z\in K'$ s.t. $W_\delta(\bflot_t(z))=W_\delta(z)$ for all $t>0$.
The derivative almost everywhere of $t\mapsto W_\delta(\bflot_t(z))$ is identically zero,
and by Eq. (\ref{eq:ae-derivee}), this implies that
$-c\left(\|m_t\|^2 + \|\nabla F(x_t)\|^2 +\|S(x_t)-v_t\|^2\right)$ is equal to zero
for every $t$ a.e. (hence, for every~$t$, by continuity of $\bflot$).
In particular for $t=0$, $m=\nabla F(x)=0$ and $S(x)-v=0$.
Hence, $z\in h_\infty^{-1}(\{0\})$.
\end{proof}
\begin{corollary}
\label{coro:cv}
Let Assumptions~\ref{hyp:coercive}, \ref{hyp:S>0}, \ref{hyp:F} and \ref{hyp:S} hold.
Assume that $0< b\leq 4a$.
For every $z\in \cZ_+$, $\lim_{t\to \infty} \sd(\Phi(z,t),\cE)=0\,.$
\end{corollary}
\begin{proof}
Use Prop.~\ref{prop:Wstrict} with $K\eqdef\{z\}$.
and \cite[Th.~2.1.7]{haraux1991systemes}.
\end{proof}
\subsubsection{Asymptotic Behavior of the Solution to (\ref{eq:ode})}
\label{sec:cv-non-autonomous}
\begin{proposition}[APT]
Let Assumptions~\ref{hyp:coercive}, \ref{hyp:S>0}, \ref{hyp:F} and \ref{hyp:S} hold true.
Assume that $0< b\leq 4a$.
Then, for every $z_0\in \cZ_0$, $Z^0_\infty(z_0)$ is an asymptotic pseudotrajectory
of the semiflow $\Phi$ given by~(\ref{eq:flot}).
\label{prop:apt}
\end{proposition}
\begin{proof}
Consider $z_0\in \cZ_0$, $T\in (0,+\infty)$ and define $z\eqdef Z_\infty^0(z_0)$.
Consider $t\geq 1$. For every $s\geq 0$, define $\Delta_t(s)\eqdef \|z(t+s)-\flot(z(t))(s)\|$.
The aim is to prove that $\sup_{s\in [0,T]}\Delta_t(s)$ tends to zero as~$t\to\infty$.
Putting together Prop.~\ref{prop:adam-bounded} and Lemma~\ref{lem:v-lowerbound},
the set $K\eqdef \overline{\{z(t):t\geq 1\}}$
is a compact subset of $\cZ_+^*$.
Define $C(t)\eqdef \sup_{s\geq 0}\sup_{z'\in K}\|h(t+s,z')-h_\infty(z')\|$.
It can be shown that $\lim_{t\to\infty} C(t)=0$.
We obtain that for every $s\in [0,T]$, $
\Delta_t(s)\leq T C(t) + \int_0^s
\|h_\infty(z(t+s'))-h_{\infty}(\flot(z(t))(s'))\|ds'\,.$
By Lemma~\ref{lem:v-lowerbound}, $K'\eqdef \overline{\bigcup_{z'\in\flot(K)}z'([0,\infty))}$ is a compact subset of $\cZ_+^*$.
It is immediately seen from the definition that $h_{\infty}$ is Lipschitz continuous on every compact subset of $\cZ_+^*$, hence on $K\cup K'$. Therefore, there exists a constant $L$, independent from $t,s$, s.t.
$
\Delta_t(s)\leq T C(t) + \int_0^s L \Delta_t(s')ds'\qquad (\forall t\geq 1, \forall s\in[0,T])\,.
$
Using Gr\"onwall's lemma, it holds that for all $s\in [0,T]$,
$
\Delta_t(s)\leq TC(t) e^{Ls}\,.
$
As a consequence,
$\sup_{s\in [0,T]}\Delta_t(s)\leq TC(t) e^{LT}$ and the righthand side converges to zero
as $t\to\infty$.
\end{proof}
\subsubsection*{End of the Proof of Th.~\ref{th:cv-adam}}
By Prop.~\ref{prop:adam-bounded}, the set $K\eqdef \overline{Z^0_\infty(z_0)([0,\infty))}$ is a compact subset of $\cZ_+$.
Define $K'\eqdef \overline{\{\flot(t,z):t\geq 0, z\in K\}}\,,$ and let
$\bflot:[0,+\infty)\times K'\to K'$ be the restriction $\flot$ to $K'$.
By Prop.~\ref{prop:Wstrict}, there exists $\delta>0$ s.t.
$W_\delta$ is a strict Lyapunov function for the semiflow $\bflot$.
Moreover, the set of equilibrium points coincides with $\cE\cap K'$.
In particular, the equilibrium points of $\bflot$ form a compact set.
By Prop.~\ref{prop:apt}, $Z^0_\infty(z_0)$ is an APT of $\bflot$.
Note that every $z\in\cE$ can be written under the form
$z=(x,0,S(x))$ for some $x\in \cS$.
From the definition of $W_\delta$ in (\ref{eq:Wdelta}),
$W_\delta(z)=W_\delta(x,0,S(x)) =V_{\infty}(x,0,S(x)) = F(x)$.
Since $F(\cS)$ is assumed to have an empty interior, the same holds
for $W_\delta(\cE\cap K')$. By Prop.~\ref{prop:benaim},
$
\bigcap_{t\geq 0}\overline{Z^0_\infty(z_0)([t,\infty))} \subset \cE\cap K'\,.
$
The set in the righthand side coincides with the set of limits of convergent
sequences of the form $Z^0_\infty(z_0)(t_n)$ for $t_n\to\infty$.
As $Z^0_\infty(z_0)([0,\infty))$ is a bounded set, $\sd(Z^0_\infty(z_0)(t),\cE)$ tends to zero.
\subsection{Proof of Th.~\ref{thm:asymptotic_rates}}
\label{sec:cont_asymptotic_rates}
The proof follows the path of \cite[Th.~10.1.6, Th.~10.2.3]{harauxjendoubi2015},
but requires specific adaptations to deal with the dynamical system at hand.
Define for all $\delta>0$, $t>0$, and $z=(x,m,v)$,
\begin{equation}
\tilde W_\delta(t,(x,m,v)) \eqdef V(t,(x,m,v)) - \delta \ps{\nabla F(x),m} + \delta \|S(x)-v\|^2\,.\label{eq:Wdelta-t}
\end{equation}
The function $\tilde W_\delta$ is the non-autonomous version of the function (\ref{eq:Wdelta}).
Consider a fixed $x_0\in \bR^d$, and define $w_{\delta}(t)\eqdef \tilde W_\delta(t,z(t))$
where $z(t)=(x(t),m(t),v(t))$ is the solution to~(\ref{eq:ode}) with initial condition $(x_0,0,0)$.
The proof uses the following steps.
\begin{enumerate}[{\sl i)},leftmargin=11pt]
\item \textit{Upper-bound on $w_\delta(t)$.}
From Eq.~(\ref{eq:V}),
we obtain that for every $t\geq 1$,
V(t,z(t))\leq |F(x(t))|+\frac {\|m(t)\|^2}{2a\varepsilon (1-e^{-a})}\,.
Using $\ps{\nabla F(x),m}\leq (\|\nabla F(x)\|^2+\|m\|^2)/2$, we obtain that there exists a constant
$c_1$ (depending on $\delta$) s.t. for every $t\geq 1$,
\begin{equation}
\label{eq:w-up}
w_\delta(t) \leq c_1\left(|F(x(t))|+\|m(t)\|^2+\|\nabla F(x(t))\|^2+ \|S(x(t))-v(t)\|^2\right)\,.
\end{equation}
\item \textit{Upper-bound on $\frac d{dt} w_\delta(t)$.}
The function $w_{\delta}$ is absolutely continuous on $[1,+\infty)$.
Moreover, there exist $\delta>0$, $c_2>0$ (both depending on
$x_0$) s.t. for every $t\geq 1$ a.e.,
\begin{equation}
\label{eq:dw-up}
\frac d{dt} w_\delta (t) \leq -c_2\left(\|m(t)\|^2+\|\nabla F(x(t))\|^2+\|S(x(t))-v(t)\|^2\right)\,.
\end{equation}
The proof of Eq.~(\ref{eq:dw-up}) uses arguments that are similar to
the ones used in the proof of Prop.~\ref{prop:Wstrict} (just
use Lemma~\ref{lem:V} to bound the derivative of the first term in
Eq.~(\ref{eq:Wdelta-t})). For this reason, it is omitted.
\item \textit{Positivity of $w_\delta(t)$.} By Lemma~\ref{lem:V},
the function $t\mapsto V(t,z(t))$ is decreasing. As it is lower bounded,
$\ell\eqdef \lim_{t\to\infty}V(t,z(t))$ exists. By Th.~\ref{th:cv-adam},
$m(t)$ tends to zero, hence this limit coincides with $\lim_{t\to\infty} F(x(t))$.
Replacing $F$ with $F-\ell$, one can assume without loss of generality that $\ell=0$.
By Eq.~(\ref{eq:dw-up}), $w_\delta$ is non-increasing on $[1,+\infty)$, hence converging
to some limit. Using again Th.~\ref{th:cv-adam}, $\ps{\nabla F(x(t)),m(t)}\to 0$
and $S(x(t))-v(t)\to 0$. Thus, $\lim_{t\to\infty} w_\delta(t) = \ell = 0$.
Assume that there exists $t_0\geq 1$ s.t. $w_\delta(t_0)=0$. Then, $w_\delta$
is constant on $[t_0,+\infty)$. By Eq.~(\ref{eq:dw-up}), this implies that $m(t)=0$ on this interval.
Hence, $d x(t)/dt = 0$. This means that $x(t) = x(t_0)$ for all $t\geq t_0$. By Th.~\ref{th:cv-adam},
it follows that $x(t_0)\in \cS$. In that case, the final result is shown. Therefore, one
can assume that $w_\delta(t)>0$ for all $t\geq 1$.
\item \textit{Putting together (\ref{eq:w-up}) and (\ref{eq:dw-up}) using the \L{}ojasiewicz condition.}
By Prop. \ref{prop:benaim} and \ref{prop:apt}, the set
$
L\eqdef \overline{\bigcup_{s\geq 0}\{z(t):t\geq s\}}\,
$
is a compact connected subset of $\cE = \{(x,0,S(x)):\nabla F(x)=0\}$.
The set $\mathcal{U}\eqdef \{x:(x,0,S(x))\in L\}$ is a compact and connected subset of $\cS$.
Using Assumption~\ref{hyp:lojasiewicz_prop} and \cite[Lemma 2.1.6]{harauxjendoubi2015},
there exist constants $\sigma,c>0$ and $\theta\in (0,\frac 12]$, s.t.
$\|\nabla F(x)\| \geq c|F(x)|^{1-\theta}\,$ for all $x$ s.t.~$\sd(x,\mathcal{U})<\sigma\,$.
As $\sd(x(t), \mathcal{U})\to 0$, there exists $T\geq 1$ s.t. for all $t\geq T$,
$\|\nabla F(x(t))\|\geq c |F(x(t))|^{1-\theta}$. Thus, we may replace the term $\|\nabla F(x(t))\|^2$
in the righthand side of Eq.~(\ref{eq:dw-up}) using
$\|\nabla F(x(t))\|^2\geq \frac 12\|\nabla F(x(t))\|^2+ \frac 12|F(x(t))|^{2(1-\theta)}$.
Upon noting that $2(1-\theta)\geq 1$,
we thus obtain that there exists a constant $c_3$ and some $T'\geq 1$ s.t. for $t\geq T'$ a.e.,
$$
\frac d{dt} w_\delta (t) \leq -c_3\left(\|m(t)\|^2+\|\nabla F(x(t))\|^2+|F(x(t))|+\|S(x(t))-v(t)\|^2\right)^{2(1-\theta)}\,.
$$
Putting this inequality together with Eq.~(\ref{eq:w-up}), we obtain that for some constant $c_4>0$ and for all
$t\geq T'$ a.e.,
$
\frac d{dt} w_\delta (t) \leq -c_4 w_\delta(t)^{2(1-\theta)}\,.
$
\item \textit{End of the proof.} Following the arguments of \cite[Th.~10.1.6]{harauxjendoubi2015},
by integrating the preceding inequality,
over $[T',t]$, we obtain
$
w_\delta(t) \leq c_5 t^{-\frac 1{1-2\theta}
$
for $t\geq T'$
in the case where $\theta<\frac 12$, whereas $w_\delta(t)$ decays exponentially if $\theta=\frac 12$.
From now on, we focus on the case $\theta<\frac 12$.
By definition of~(\ref{eq:ode}), $\|\dot{x}(t)\|^2\leq \|m(t)\|^2/((1-e^{-a T'})^2\varepsilon^2)$
for all $t\geq T'$. Since Eq.~(\ref{eq:dw-up}) implies $\|m(t)\|^2\leq -\dot w_\delta(t)/c_2$,
we deduce that there exists $c,c'>0$ s.t. for all $t\geq T'$,
\int_t^{2t} \|\dot{x}(s)\|^2 ds \leq c w_\delta(t) \leq c' t^{-\frac 1{1-2\theta}}\,.
Applying \cite[Lemma 2.1.5]{harauxjendoubi2015}, it follows that
$\int_t^{\infty} \|\dot{x}(s)\|^2 ds \leq c t^{-\frac{\theta}{1-2\theta}}$
for some other constant $c$.
Therefore $x^* \eqdef \lim_{t \to +\infty} x(t)$ exists by Cauchy's criterion and
for all $t\geq T'$, $\|x(t)-x^*\| \leq c t^{-\frac{\theta}{1-2\theta}}$\,.
Finally, since $x(t)\to a$, we remark that, using the same arguments,
the global \L{}ojasiewicz exponent $\theta$ can be replaced by any \L{}ojasiewicz exponent
of $f$ at $x^*$.
When $\theta=\frac 12$, the proof follows the same line.
\end{enumerate}
\section{Proofs of Section~\ref{sec:discrete}}
\label{sec:proofs_sec_discrete}
\subsection{Proof of Th.~\ref{th:weak-cv}}
Given an initial point $x_0\in \bR^d$ and a stepsize $\gamma>0$,
we consider the iterates $z_n^{\gamma}$ given by~(\ref{eq:znT})
and $z_0^\gamma\eqdef (x_0,0,0)$.
For every $n\in \bN^*$ and every $z\in \cZ_+$, we define
\begin{equation*}
H_\gamma(n,z,\xi)\eqdef \gamma^{-1} (T_{\gamma,\bar\alpha(\gamma),\bar\beta(\gamma)}(n,z,\xi)-z)\,.
\end{equation*}
Thus, $z_n^\gamma = z_{n-1}^\gamma+\gamma H_\gamma(n,z_{n-1}^\gamma,\xi_n)$ for every $n\in\bN^*$.
For every $n\in\bN^*$ and every $z\in \cZ$ of the form
$z=(x,m,v)$, we define $e_\gamma(n,z)\eqdef (x,(1-\bar\alpha(\gamma)^n)^{-1}m,(1-\bar\beta(\gamma)^n)^{-1}v)$,
and set $e_\gamma(0,z)\eqdef z$.
\begin{lemma}
\label{lem:moment-H}
Let Assumptions~\ref{hyp:model}, \ref{hyp:alpha-beta} and \ref{hyp:moment-f} hold true.
There exists $\bar \gamma_0>0$ s.t. for every $R>0$, there exists $s>0$,
\begin{equation}
\sup\left\{\bE\left(\left\|H_\gamma(n+1,z,\xi)\right\|^{1+s}\right):\gamma\in (0,\bar \gamma_0], n\in \bN, z\in \cZ_+\,\text{s.t.}\,\|e_\gamma(n,z)\|\leq R\right\}<\infty\,.
\label{eq:UI}
\end{equation}
\end{lemma}
\begin{proof}
Let $R>0$.
We denote by $(H_{\gamma,\sx},H_{\gamma,\sm},H_{\gamma,\sv})$ the block components of $H_\gamma$.
There exists a constant $C_s$ depending only on $s$ s.t.
$\|H_\gamma\|^{1+s}\leq C_s(\|H_{\gamma,\sx}\|^{1+s}+\|H_{\gamma,\sm}\|^{1+s}+\|H_{\gamma,\sv}\|^{1+s})$.
Hence, it is sufficient to prove that Eq.~(\ref{eq:UI}) holds
respectively when replacing $H_\gamma$ with each of $H_{\gamma,\sx},H_{\gamma,\sm},H_{\gamma,\sv}$.
Consider $z=(x,m,v)$ in $\cZ_+$. We write:
$\|H_{\gamma,\sx}(n+1,z,\xi)\| \leq \varepsilon^{-1}(\|\frac{m}{1-\bar \alpha(\gamma)^n}\|+\|\nabla f(x,\xi)\|)\,.$
Thus, for every $z$ s.t. $\|e_\gamma(n,z)\|\leq R$, there exists a constant $C$ depending only on $\varepsilon$, $R$ and $s$ s.t.
$\|H_{\gamma,\sx}(n+1,z,\xi)\|^{1+s} \leq C(1+ \|\nabla f(x,\xi)\|^{1+s})$. By Assumption~\ref{hyp:moment-f}, (\ref{eq:UI}) holds for
$H_{\gamma,\sx}$ instead of $H_\gamma$. Similar arguments hold for $H_{\gamma,\sm}$ and $H_{\gamma,\sv}$
upon noting that the functions $\gamma\mapsto(1-\bar \alpha(\gamma))/\gamma$ and $\gamma\mapsto (1-\bar \beta(\gamma))/\gamma$
are bounded under Assumption~\ref{hyp:alpha-beta}.
\end{proof}
For every $R>0$, and every arbitrary sequence $z=(z_n:n\in\bN)$ on $\cZ_+$, we define
$\tau_R(z) \eqdef \inf\{n\in \bN:\|e_\gamma(n,z_n)\|>R\}$ with the convention that $\tau_R(z)=+\infty$ when the set is empty.
We define the map $B_R:\cZ_+^\bN\to\cZ_+^\bN$ given for any arbitrary sequence $z=(z_n:n\in\bN)$ on $\cZ_+$ by
$B_R(z)(n) = z_n\1_{n<\tau_R(z)}+z_{\tau_R(z)}\1_{n\geq\tau_R(z)}$.
We define the random sequence $z^{\gamma,R}\eqdef B_R(z^\gamma)$. Recall that a family $(X_i:i\in I)$ of random variables on some Euclidean space
is called \emph{uniformly integrable} if $\lim_{A\to+\infty} \sup_{i\in I}\bE(\|X_i\|\1_{\|X_i\|>A})=0$.
\begin{lemma}
\label{lem:UI}
Let Assumptions~\ref{hyp:model}, \ref{hyp:alpha-beta}, \ref{hyp:moment-f} and \ref{hyp:iid} hold true.
There exists $\bar \gamma_0>0$ s.t. for every $R>0$, the family of r.v.
$(\gamma^{-1}(z_{n+1}^{\gamma,R} - z_n^{\gamma,R}):n\in \bN,\gamma\in (0,\bar \gamma_0])$ is uniformly integrable.
\end{lemma}
\begin{proof}
Let $R>0$.
As the event $\{n<\tau_R(z^\gamma)\}$ coincides with
$\bigcap_{k=0}^n\{\|e_\gamma(k,z_k^\gamma)\|\leq R\}$, it holds that
for every $n\in \bN$,
\begin{equation*}
\frac{z_{n+1}^{\gamma,R} - z_n^{\gamma,R}}\gamma =\frac{z_{n+1}^{\gamma} - z_n^{\gamma}}\gamma \1_{n<\tau_R(z^\gamma)}
= H_\gamma(n+1,z_n^\gamma,\xi_{n+1}) \prod_{k=0}^n\1_{\|e_\gamma(k, z_k^\gamma)\|\leq R} \,.
\end{equation*}
Choose $\bar \gamma_0>0$ and $s>0$ as in Lemma~\ref{lem:moment-H}.
For every $\gamma\leq \bar \gamma_0$,
\begin{equation*}
\resizebox{\hsize}{!}{$
\bE\left(\left\|\gamma^{-1}(z_{n+1}^{\gamma,R} - z_n^{\gamma,R})\right\|^{1+s}\right)
\leq \sup\left\{ \bE\left(\left\|H_{\gamma'}(\ell+1,z,\xi)\right\|^{1+s} \right):\gamma'\in (0,\bar \gamma_0],\ell\in \bN,z\in \cZ_+, \|e_\gamma(\ell,z)\|\leq R\right\}\,.
$}
\end{equation*}
By Lemma~\ref{lem:moment-H}, the righthand side is finite and does not depend on $(n,\gamma)$.
\end{proof}
For a fixed $\gamma>0$, we define the interpolation map $\sX_\gamma:\cZ^\bN\to C([0,+\infty),\cZ)$ as follows for every
sequence $z=(z_n:n\in \bN)$ on $\cZ$:
$$
\sX_\gamma(z)\,:t \mapsto z_{\lfloor \frac t\gamma\rfloor} + (t/\gamma-\lfloor t/\gamma\rfloor)(z_{\lfloor \frac t\gamma\rfloor+1}-z_{\lfloor \frac t\gamma\rfloor})\,.
$$
For every $\gamma,R>0$, we define $\sz^{\gamma,R}\eqdef \sX_\gamma(z^{\gamma,R}) = \sX_\gamma\circ B_R (z^\gamma)$.
Namely, $\sz^{\gamma,R}$ is the interpolated process associated with the sequence $(z^{\gamma,R}_n)$.
It is a random variable on $C([0,+\infty),\cZ)$.
We recall that $\cF_n$ is the $\sigma$-algebra generated by the r.v. $(\xi_k:1\leq k\leq n)$.
For every $\gamma,n,R$, we use the notation: $\Delta_0^{\gamma,R}\eqdef 0$ and
$$
\Delta_{n+1}^{\gamma,R} \eqdef \gamma^{-1}(z_{n+1}^{\gamma,R} - z_n^{\gamma,R}) - \bE(\gamma^{-1}(z_{n+1}^{\gamma,R} - z_n^{\gamma,R})|\cF_n)\,.
$$
\begin{lemma}
\label{lem:tightness-in-C}
Let Assumptions~\ref{hyp:model}, \ref{hyp:alpha-beta}, \ref{hyp:moment-f} and \ref{hyp:iid} hold true.
There exists $\bar \gamma_0>0$ s.t. for every $R>0$, the family of r.v. $(\sz^{\gamma,R}:\gamma\in (0,\bar \gamma_0])$
is tight. Moreover, for every $\delta>0$,
$
\bP\left(\max_{0\leq n\leq \lfloor\frac T\gamma\rfloor}\gamma\left\|\sum_{k=0}^n\Delta_{k+1}^{\gamma,R}\right\|>\delta\right)\xrightarrow[]{\gamma\to 0} 0\,.
\end{lemma}
\begin{proof}
It is an immediate consequence of Lemma~\ref{lem:UI} and \cite[Lemma 6.2]{bianchi2019constant}
\end{proof}
\noindent The proof of the following lemma is omitted.
\begin{lemma}
\label{lem:cv-h}
Let Assumptions~\ref{hyp:model} and \ref{hyp:alpha-beta} hold true.
Consider $t>0$ and $z\in \cZ_+$. Let $(\varphi_n,z_n)$ be a sequence on $\bN^*\times \cZ_+$ s.t.
$\lim_{n\to\infty}\gamma_n\varphi_n= t$ and $\lim_{n\to\infty}z_n= z$. Then, $\lim_{n\to\infty} h_{\gamma_n}(\varphi_n,z_n)= h(t,z)$
and $\lim_{n\to\infty} e_{\gamma_n}(\varphi_n,z_n)= \bar e(t,z)$.
\end{lemma}
\noindent\textbf{End of the Proof of Th.~\ref{th:weak-cv}}
Consider $x_0\in \bR^d$ and set $z_0=(x_0,0,0)$. Define
$R_0\eqdef \sup\left\{\|\bar e(t,Z_\infty^0(z_0)(t))\|:t>0\right\}\,.$
By Prop.~\ref{prop:adam-bounded}, $R_0<+\infty$. We select an arbitrary $R$ s.t. $R\geq R_0+1$.
For every $n\geq 0$, $z\in \cZ_+$,
$$
z_{n+1}^{\gamma,R} = z_{n}^{\gamma,R}+\gamma H_\gamma(n+1,z_{n}^{\gamma,R},\xi_{n+1}) \1_{\|e_\gamma(n,z_{n}^{\gamma,R})\|\leq R} \,.
$$
Define for every $n\geq 1$, $z\in \cZ_+$,
$h_{\gamma,R}(n,z)\eqdef h_\gamma(n,z)\1_{\|e_\gamma(n-1,z)\|\leq R}$. Then,\\
$
\Delta_{n+1}^{\gamma,R} = \gamma^{-1}(z_{n+1}^{\gamma,R} - z_n^{\gamma,R}) - h_{\gamma,R}(n+1,z_{n}^{\gamma,R})\,.
$
Define also for every $n\geq 0$, \\
M_n^{\gamma,R} \eqdef \sum_{k=1}^n\Delta_k^{\gamma,R} =\gamma^{-1}(z_n^{\gamma,R} - z_0) - \sum_{k=0}^{n-1} h_{\gamma,R}(k+1,z_{k}^{\gamma,R})\,.
$
Consider $t\geq 0$ and set $n\eqdef \lfloor t/\gamma\rfloor$.
For any $T>0$, it holds that :
\begin{equation*}
\sup_{t\in [0,T]} \left\| \sz^{\gamma,R}(t)-z_0 - \int_{0}^{t}h_{\gamma,R}(\lfloor s/\gamma\rfloor+1,\sz^{\gamma,R}(\gamma\lfloor s/\gamma\rfloor))ds\right\|\\
\leq \max_{0\leq n\leq \lfloor T/\gamma\rfloor+1} \gamma \|M_n^{\gamma,R}\|\,.
\end{equation*}
By Lemma~\ref{lem:tightness-in-C},
\begin{equation}
\label{eq:Mn-cv-proba-zero}
\bP\left( \sup_{t\in [0,T]} \left\| \sz^{\gamma,R}(t)-z_0 - \int_{0}^{t}h_{\gamma,R}\left(\lfloor s/\gamma\rfloor+1,\sz^{\gamma,R}(\gamma\lfloor s/\gamma\rfloor)\right)ds\right\|
>\delta\right) \xrightarrow[]{\gamma\to 0} 0\,.
\end{equation}
As a second consequence of Lemma~\ref{lem:tightness-in-C}, the family of r.v. $(\sz^{\gamma,R}:0<\gamma\leq \bar \gamma_0)$ is tight, where $\bar \gamma_0$
is chosen as in Lemma~\ref{lem:tightness-in-C} (it does not depend on $R$).
By Prokhorov's theorem, there exists a sequence $(\gamma_k:k\in \bN)$ s.t. $\gamma_k\to 0$ and
s.t. $(\sz^{\gamma_k,R}:k\in \bN)$ converges in distribution to some probability measure $\nu$ on $C([0,+\infty),\cZ_+)$.
By Skorohod's representation theorem, there exists a r.v. $\sz$ on some probability space $(\Omega',\cF',\bP')$, with distribution $\nu$,
and a sequence of r.v. $(\sz_{(k)}:k\in \bN)$ on that same probability space where for each $k \in \bN$, the r.v. $\sz_{(k)}$ has the same distribution
as the r.v. $\sz^{\gamma_k,R}$,
and s.t. for every $\omega\in\Omega'$, $\sz_{(k)}(\omega)$ converges
to $\sz(\omega)$ uniformly on compact sets. Now select a fixed $T>0$. According to Eq.~(\ref{eq:Mn-cv-proba-zero}), the sequence
$$
\sup_{t\in [0,T]} \left\| \sz_{(k)}(t)-z_0 - \int_{0}^{t}h_{\gamma_{k},R}\left(\lfloor s/\gamma_{k}\rfloor+1,\sz_{(k)}(\gamma_{k}\lfloor s/\gamma_{k}\rfloor)\right)ds\right\|\,,
$$
indexed by $k\in \bN$, converges in probability to zero as $k\to\infty$. One can therefore extract a further subsequence $\sz_{(\varphi_k)}$,
s.t. the above sequence converges to zero almost surely. In particular, since $\sz_{(k)}(t)\to \sz(t)$ for every $t$, we obtain that
\begin{equation}
\sz(t) = z_0 + \lim_{k\to\infty} \int_{0}^{t}h_{\gamma_{\varphi_k},R}\left(\lfloor s/\gamma_{\varphi_k}\rfloor+1,\sz_{(\varphi_k)}(\gamma_{\varphi_k}\lfloor s/\gamma_{\varphi_k}\rfloor)\right)ds\quad (\forall t\in [0,T])\,.\label{eq:cv_z}
\end{equation}
Consider $\omega\in \Omega'$ s.t. the r.v. $\sz$ satisfies (\ref{eq:cv_z}) at point $\omega$.
From now on, we consider that $\omega$ is fixed, and we handle $\sz$ as an element of $C([0,+\infty),\cZ_+)$,
and no longer as a random variable.
Define $\tau\eqdef \inf\{t\in [0,T]: \|\bar e(t,\sz(t))\|>R_0+\frac 12\}$ if the latter set is non-empty,
and $\tau\eqdef T$ otherwise.
Since $\sz(0)=z_0$ and $\|z_0\|<R_0$, it holds that $\tau>0$ using the continuity of $\sz$.
Choose any $(s,t)$ s.t. $0<s<t<\tau$.
Note that $\sz_{(k)}(\gamma_{k}\lfloor s/\gamma_{k}\rfloor)\to \sz(s)$
and $\gamma_k(\lfloor s/\gamma_{k}\rfloor+1)\to s$. Thus, by Lemma~\ref{lem:cv-h},
$h_{\gamma_{k}}\left(\lfloor s/\gamma_{k}\rfloor+1,\sz_{(k)}(\gamma_{k}\lfloor s/\gamma_{k}\rfloor)\right)$
converges to $h(s,\sz(s))$ and
$e_{\gamma_k}(\lfloor s/\gamma_{k}\rfloor,\sz_{(k)}(\gamma_{k}\lfloor s/\gamma_{k}\rfloor))$
converges to $\bar e(s,\sz(z))\,.$
Since $s<\tau$, $\bar e(s,\sz(z))\leq R_0+\frac 12$. As $R\geq R_0+1$, there exists a certain
$K(s)$ s.t. for every $k\geq K(s)$,
$
\1_{\|e_{\gamma_k}(\lfloor s/\gamma_{k}\rfloor,\sz_{(k)}(\gamma_{k}\lfloor s/\gamma_{k}\rfloor))\|\leq R} = 1\,.
$
As a consequence, $h_{\gamma_{k},R}(\lfloor s/\gamma_{k}\rfloor+1,\sz_{(k)}(\gamma_{k}\lfloor s/\gamma_{k}\rfloor))$
converges to $h(s,\sz(s))$ as $k\to\infty$.
Using Lebesgue's dominated convergence theorem, we obtain, for all $t\in [0,\tau]$:
$
\sz(t) = z_0 + \int_{0}^{t}h\left(s,\sz(s))\right)ds\,
$
Therefore $\sz(t) = Z_\infty^0(x_0)(t)$ for every $t\in [0,\tau]$. In particular,
$\|\sz(\tau)\|\leq R_0$
and this means that
$\tau = T$. Thus, $\sz(t)=Z_\infty^0(x_0)(t)$ for every $t\in [0,T]$
(and consequently for every $t\geq 0$). We have shown that for every $R\geq R_0+1$, the sequence of r.v.
$(\sz^{\gamma,R}:\gamma \in (0,\bar \gamma_0])$ is tight and converges in probability to $Z_\infty^0(z_0)$ as $\gamma\to 0$.
Therefore, for every $T>0$,
\begin{equation}
\forall \delta>0,\ \lim_{\gamma\to 0} \bP\left(\sup_{t\in [0,T]}\left\| \sz^{\gamma,R}(t) - Z_\infty^0(x_0)(t)\right\|>\delta \right) =0\,.
\label{eq:cv-proba-R}
\end{equation}
In order to complete the proof, we show that
$
\bP\left(\sup_{t\in [0,T]}\left\| \sz^{\gamma,R}(t) - \sz^{\gamma}(t)\right\|>\delta \right) \to 0
$
as $\gamma \to 0$, for all $\delta >0$.
where we recall that $\sz^\gamma=\sX_\gamma(z^\gamma)$.
Note that $\left\| \sz^{\gamma,R}(t)\right\|\leq
\left\| \sz^{\gamma,R}(t)-Z_\infty^0(z_0)(t)\right\| + R_0$ by the triangular inequality.
Therefore, for every $T,\delta>0$,
\begin{align*
\bP\left(\sup_{t\in [0,T]}\left\| \sz^{\gamma,R}(t) - \sz^{\gamma}(t)\right\|>\delta \right)
&\leq \bP\left(\sup_{t\in [0,T]}\left\| \sz^{\gamma,R}(t)\right\|\geq R \right)\\
&\leq \bP\left(\sup_{t\in [0,T]}\left\| \sz^{\gamma,R}(t)-Z_\infty^0(z_0)(t)\right\| \geq R-R_0\right)\,.
\end{align*
By Eq.~(\ref{eq:cv-proba-R}), the RHS of the above inequality tends to zero as $\gamma\to 0$.
The proof is complete.
\subsection{Proof of Th.~\ref{th:longrun}}
\label{sec:longrun}
We start by stating a general result. Consider a Euclidean space $\sX$ equipped with its Borel $\sigma$-field $\cal X$.
Let $\bar \gamma_0>0$, and consider two families
$(P_{\gamma,n}:0<\gamma<\bar \gamma_0, n\in \bN^*)$ and $(\bar P_{\gamma}:0<\gamma<\bar \gamma_0)$
of Markov transition kernels on $\sX$.
Denote by $\cP(\sX)$ the set of probability measures on $\sX$.
Let $X=(X_n:n\in\bN)$ be the canonical process on $\sX$.
Let $(\bP^{\gamma,\nu}:0<\gamma<\bar \gamma_0,\nu\in \cP(\sX))$ and
$(\bar \bP^{\gamma,\nu}:0<\gamma<\bar \gamma_0,\nu\in \cP(\sX))$ be two families of measures on the canonical space
$(X^\bN,\cal X^{\otimes\bN})$ such that the following holds:
\begin{itemize}[leftmargin=*]
\item Under $\bP^{\gamma,\nu}$, $X$ is a non-homogeneous Markov chain with transition kernels $(P_{\gamma,n}:n\in \bN^*)$
and initial distribution $\nu$, that is, for each $n\in\bN^*$,
$
\bP^{\gamma,\nu}(X_{n}\in dx|X_{n-1}) = P_{\gamma,n}(X_{n-1},dx)\,.
$
\item Under $\bar\bP^{\gamma,\nu}$, $X$ is an homogeneous Markov chain with transition kernel $\bar P_{\gamma}$
and initial distribution $\nu$.
\end{itemize}
In the sequel, we will use the notation $\bar P^{\gamma,x}$ as a shorthand notation for
$\bar P^{\gamma,\delta_x}$ where $\delta_x$ is the Dirac measure at some point $x\in \sX$.
Finally, let $\Psi$ be a semiflow on $\sX$. A Markov kernel $P$ is \emph{Feller}
if $Pf$ is continuous for every bounded continuous $f$.
\begin{assumption} Let $\nu\in \cP(\sX)$.
\begin{enumerate}[{\sl i)}]
\item For every $\gamma$, $\bar P_{\gamma}$ is Feller.
\item $(\bP^{\gamma,\nu}X_n^{-1}:n\in \bN,0<\gamma<\bar \gamma_0)$ is a tight family of measures.
\item For every $\gamma\in (0,\bar \gamma_0)$ and every bounded Lipschitz continuous function $f:\sX\to\bR$,
$P_{\gamma,n}f$ converges to $\bar P_\gamma f$ as $n\to\infty$, uniformly on compact sets.
\item For every $\delta>0$, for every compact set $K\subset \sX$, for every $t>0$,\\
\lim_{\gamma\to 0}\sup_{x\in K}\bar P^{\gamma,x}\left(\|X_{\lfloor t/\gamma\rfloor} - \Psi_t(x)\|>\delta\right)=0\,.
\end{enumerate}
\label{hyp:general}
\end{assumption}
Let $BC_\Psi$ be the Birkhof center of $\Psi$ \emph{i.e.}, the closure of the set of recurrent points.
\begin{theorem}
\label{longrun}
Consider $\nu\in \cP(\sX)$ s.t. Assumption~\ref{hyp:general} holds true. Then, for every $\delta>0$,
$
\lim_{\gamma\to 0}\limsup_{n\to\infty} \frac 1{n+1}\sum_{k=0}^n \bP^{\gamma,\nu}\left(d(X_k,BC_\Psi)>\delta\right)=0\,.
$
\end{theorem}
We omit the proof of this result which follows a similar reasoning to \cite[Th.~5.5 and Proof in section 8.4]{bianchi2019constant} and makes use of results from \cite{for-pag-99}.
\noindent\textbf{End of the Proof of Th.~\ref{th:longrun}.}
We apply Th.~\ref{longrun} in the case where $P_{\gamma,n}$ is the kernel
of the non-homogeneous Markov chain $(z_n^\gamma)$ defined by~(\ref{eq:znT}) and
$\bar P_\gamma$ is the kernel of the homogeneous Markov chain $(\bar z_n^\gamma)$
given by
$\bar z_n^\gamma = \bar z_{n-1}^\gamma+\gamma H_\gamma(\infty,\bar z_{n-1}^\gamma,\xi_n)$
for every $n\in\bN^*$ and $\bar z_0 \in \cZ_+$ where $H_\gamma(\infty,\bar z_{n-1}^\gamma,\xi_n) \eqdef \lim_{k \to \infty} H_\gamma(k,\bar z_{n-1}^\gamma,\xi_n)$. The task is merely to verify Assumption~\ref{hyp:general}{\sl iii)}, the other assumptions being easily verifiable using Th.~\ref{th:weak-cv},
Consider $\gamma\in (0,\bar \gamma_0)$. Let $f: \cZ \to \mathbb{R}$ be a bounded $M$-Lipschitz continuous function and $K$ a compact.
For all $z=(x,m,v) \in K$:
\begin{align*}
&|P_{\gamma,n}(f)(z) - \bar P_{\gamma}(f)(z)| \leq M \gamma \bE \left \| \frac{(1-\alpha^n)^{-1}\tilde{m}_\xi}{ \varepsilon+(1-\beta^n)^{-\frac{1}{2}}{\tilde{v}_\xi^{1/2}}} -\frac{\tilde{m}_\xi}{ \varepsilon+{\tilde{v}_\xi^{1/2}}}\right \| \\
&\resizebox{.99\hsize}{!}{$\leq \frac{M \gamma\alpha^n}{\varepsilon(1- \alpha^n)} \sup_{x,m}\left(\alpha ||m|| + (1-\alpha)\bE||\nabla f(x,\xi)|| \right)
+ \frac{M \gamma \bE ||\tilde{m}_\xi \odot \tilde{v}_\xi^{1/2}||}{\varepsilon^2}\left(1- \frac{1}{(1-\beta^n)^{1/2}}\right)$}\,
\end{align*}
where we write $\alpha=\bar \alpha(\gamma)$, $\beta=\bar \beta(\gamma)$,
$\tilde{m}_\xi \eqdef \alpha m+(1-\alpha)\nabla f(x,\xi)$ and
$\tilde{v}_\xi \eqdef \beta v+(1- \beta)\nabla f(x,\xi)^{\odot 2}$.
Thus, condition~\ref{hyp:general}{\sl iii)} follows.
Finally, Cor.~\ref{coro:cv} implies $BC_\Phi=\cE$.
\section{Proofs of Section~\ref{sec:discrete_decreasing}}
\label{sec:proofs_sec_discrete_decreasing}
In this section, we denote by $\bE_n = \bE(\cdot|\cF_n)$ the conditional expectation w.r.t. $\cF_n$.
We also use the notation $\nabla f_{n+1} \eqdef \nabla f(x_n,\xi_{n+1})$.
The following lemma will be useful in the proofs.
\begin{lemma}
\label{lemma:r_n}
Let the sequence $(r_n)$ be defined as in Algorithm~\ref{alg:adam-decreasing}.
Assume that $0 \leq \alpha_n \leq 1$ for all $n$ and that $(1-\alpha_n)/\gamma_n \to a > 0$ as $n \to +\infty$.
Then,
\begin{enumerate}[{\sl i)}]
\item $\forall n \in \bN, r_n = 1 - \prod_{i=1}^n \alpha_i$,
\item The sequence $(r_n)$ is nondecreasing and converges to $1$.
\item Under Assumption~\ref{hyp:step-tcl}~\ref{step-tcl-i}, for every $\epsilon>0$, for sufficiently large $n$, we have
$r_n-1 \leq e^{-\frac{a\gamma_0}{2(1-\kappa)}n^{1-\kappa}}$ if $\kappa \in (0,1)$ and
$r_n-1 \leq n^{-a \gamma_0/(1+\epsilon)}$ if $\kappa = 1$.
\end{enumerate}
\end{lemma}
A similar lemma holds for the sequence $(\bar{r}_n)$.
\begin{proof}
i) stems from observing that $r_{n+1} -1 = \alpha_{n+1}(r_n -1)$ for every $n \in \bN$ and
iterating this relation ($r_0=0$). As a consequence, the sequence $(r_n)$ is nondecreasing.
We can write :
$
0 \leq 1-r_n \leq \exp(- \sum_{i=1}^n (1-\alpha_i))\,.
$
iii) As $\sum_{n\geq 1} \gamma_n = + \infty$
and $(1-\alpha_n) \sim a\gamma_n$, we deduce that $\sum_{i=1}^n (1-\alpha_i) \sim \sum_{i=1}^n a\gamma_i$.
The results follow from the fact that $\sum_{i=1}^n \gamma_i \sim \frac{\gamma_0}{1-\kappa} n^{1-\kappa}$
when $\kappa \in (0,1)$ and $\sum_{i=1}^n \gamma_i \sim \gamma_0 \ln n$ for $\kappa=1$.
\end{proof}
\subsection{Proof of Th.~\ref{thm:as_conv_under_stab}}
We define
$\bar z_n = (x_{n-1},m_n,v_n)$ (note the shift in the index of the variable $x$).
We have
$$
\bar z_{n+1} = \bar z_n + \gamma_{n+1} h_\infty(\bar z_n) + \gamma_{n+1}\chi_{n+1} + \gamma_{n+1} \varsigma_{n+1}\,,
$$
where $h_\infty$ is defined in Eq.~(\ref{eq:h_infty}) and where we set
$$
\chi_{n+1} = \left(0,\gamma_{n+1}^{-1}(1-\alpha_{n+1})(\nabla f_{n+1}-\nabla F(x_n)),\gamma_{n+1}^{-1}(1-\beta_{n+1})(\nabla f_{n+1}^{\odot 2}-S(x_n))\right)
$$
and $\varsigma_{n+1} = (\varsigma_{n+1}^x,\varsigma_{n+1}^m,\varsigma_{n+1}^v)$ with the components defined by:
$\varsigma_{n+1}^x = \frac{m_n}{\varepsilon + \sqrt{v_n}} - \frac{\gamma_n}{\gamma_{n+1}}\frac{\hat m_n}{\varepsilon + \sqrt{\hat v_n}}$,
$\varsigma_{n+1}^m = \left(\frac{1-\alpha_{n+1}}{\gamma_{n+1}}-a\right)(\nabla F(x_n)-m_n) + a(\nabla F(x_n) - \nabla F(x_{n-1}))$ and
$\varsigma_{n+1}^v = \left(\frac{1-\beta_{n+1}}{\gamma_{n+1}}-b\right)(S(x_n)-v_n) + b(S(x_n) - S(x_{n-1}))$ \,.
We prove that $\varsigma_n\to 0$ a.s.
Using the triangular inequality,
\begin{align*}
\|\varsigma_n^x\|
&\leq \left\| \frac{m_n}{\varepsilon + \sqrt{v_n}} -\frac{m_n}{\bar r_n^{1/2}\varepsilon + \sqrt{v_n}}\right\|
+ \left|1-\frac{\gamma_nr_n^{-1}}{\gamma_{n+1}\bar r_n^{-1/2}}\right|\left\| \frac{m_n}{\bar r_n^{1/2}\varepsilon + \sqrt{v_n}}\right\|\\
&\leq \varepsilon^{-1}|1-\bar r_n^{-1/2}|\|m_n\| + \varepsilon^{-1}\left|\bar r_n^{-1/2}-\frac{\gamma_nr_n^{-1}}{\gamma_{n+1}}\right|\|m_n\|\,,
\end{align*}
which converges a.s. to zero because of the boundedness of $(z_n)$ combined with Assumption~\ref{hyp:stepsizes} and Lemma~\ref{lemma:r_n} for $(\bar r_n)$.
The components $\varsigma_{n+1}^m$ and $\varsigma_{n+1}^v$ converge a.s. to zero,
as products of a bounded term and a term converging to zero.
Indeed, note that $\nabla F$ and $S$ are locally Lipschitz continuous under Assumption~\ref{hyp:model}.
Hence, there exists a constant $C$ s.t. $\|\nabla F(x_n) - \nabla F(x_{n-1})\| \leq C \|x_n-x_{n-1}\| \leq \frac{C}{\varepsilon}\gamma_n\|m_n\|$.
The same inequality holds when replacing $\nabla F$ by $S$.
Now consider the martingale increment sequence $(\chi_n)$, adapted to $\cF_n$.
Estimating the second order moments, it is easy to show using Assumption~\ref{hyp:moment-f}~\ref{momentegal} that
there exists a constant $C'$ s.t.
$\bE_n(\|\chi_{n+1}\|^2)\leq C'$.
Using that $\sum_k\gamma_k^2<\infty$, it follows that $\sum_n\bE_n(\|\gamma_{n+1}\chi_{n+1}\|^2)<\infty$ a.s.
By Doob's convergence theorem, $\lim_{n\to\infty} \sum_{k\leq n} \gamma_k\chi_k$ exists almost surely.
Using this result along with the fact that $\varsigma_n$ converges a.s. to zero, it follows from
usual stochastic approximation arguments \cite{ben-(cours)99} that the interpolated process
$\bar\sz: [0,+\infty)\to \cZ_+$ given by
\[
\bar \sz(t) = \bar z_n + (t-\tau_n) \frac{\bar z_{n+1}-\bar z_n}{\gamma_{n+1}} \qquad \left(\forall n \in \bN\,,\, \forall t \in [\tau_n,\tau_{n+1})\right)
\]
(where $\tau_n = \sum_{k=0}^n\gamma_k$), is almost surely a bounded APT of the semiflow $\bar\Phi$ defined by~(\ref{eq:ode-a}).
The proof is concluded by applying Prop.~\ref{prop:benaim} and Prop.~\ref{prop:Wstrict}.
\subsection{Proof of Prop.~\ref{thm:stab}}
\label{sec:stability}
As $\inf F>-\infty$, one can assume without loss of generality that $F\geq 0$.
In the sequel,
$C$ denotes some positive constant which may change from line to line.
We define $a_n \eqdef (1-\alpha_{n+1})/\gamma_n$ and
$P_n\eqdef \frac 1{2a_nr_n}\ps{m_n^{\odot 2},\frac 1{\varepsilon+\sqrt{\hat v_n}}}$.
We have $a_n\to a$ and $r_n\to 1$.
By Assumption~\ref{hyp:stab}-\ref{lipschitz},
\begin{align}
F(x_{n})
&\leq F(x_{n-1}) - \gamma_{n} \ps{\nabla F(x_{n}),\frac{\hat m_n}{\varepsilon + \sqrt{\hat v_n}}} + C\gamma_n^2 P_n\label{eq:lip}.
\end{align}
We set $u_n \eqdef 1-\frac{a_{n+1}}{a_{n}}$ and
$D_n \eqdef \frac {r_n^{-1}}{\varepsilon+\sqrt{\hat v_{n}}}$, so that $P_n = \frac 1{2a_n}\ps{D_n,m_n^{\odot 2}}$.
We can write:
\begin{equation}
P_{n+1}-P_n= u_nP_{n+1} +\ps{\frac{D_{n+1}-D_n}{2a_n},m_{n+1}^{\odot 2}}+\ps{\frac{D_n}{2a_n},m_{n+1}^{\odot 2}-m_n^{\odot 2}}.\label{eq:P-P}
\end{equation}
We estimate the vector $D_{n+1}-D_n$.
Using that $(r_n^{-1})$ is non-increasing,
$$
D_{n+1}-D_n \leq r_{n}^{-1} \frac{\sqrt{\hat v_n} - \sqrt{\hat v_{n+1}}}{(\varepsilon + \sqrt{\hat v_{n+1}})\odot(\varepsilon + \sqrt{\hat v_n})}\,.
$$
Remarking that $v_{n+1} \geq \beta_{n+1} v_n$, recalling that
$(\bar{r}_n)$ is nondecreasing and using the update rules of $v_n$ and
$\bar{r}_n$, we obtain after some algebra
\begin{align}
\label{eq:subsubterm2}
\sqrt{\hat v_n} - \sqrt{\hat v_{n+1}} &= \bar{r}_{n+1}^{-\frac 12}(1-\beta_{n+1})\frac{v_n-\nabla f_{n+1}^{\odot 2}}{\sqrt{v_n}+\sqrt{v_{n+1}}
+ \frac{\bar{r}_{n+1}-\bar{r}_n}{\sqrt{\bar{r}_n}(\sqrt{\bar{r}_n}+\sqrt{\bar{r}_{n+1}})} \sqrt{\frac{v_n}{\bar{r}_{n+1}}} \nonumber\\
&\leq c_{n+1} \sqrt{\hat v_{n+1}} \,\, \text{where} \,\,
c_{n+1} \eqdef \frac{1-\beta_{n+1}}{\sqrt{\beta_{n+1} }}\left( \frac{1}{1+\sqrt{\beta_{n+1}}} + \frac{1- \bar{r}_n}{2\bar{r}_n} \right)\,.
\end{align}
It is easy to see that $c_n/\gamma_n\to b/2$. Thus, for any $\delta>0$, $c_{n+1}\leq (b+2\delta)\gamma_{n}/2$ for all $n$ large enough.
Using also that $\sqrt{\hat v_{n+1}}/(\varepsilon +\sqrt{\hat v_{n+1}})\leq 1$, we obtain that
D_{n+1}-D_n \leq
\frac{b+2\delta}2 \gamma_n D_n\,.
$
Substituting this inequality in Eq.~(\ref{eq:P-P}), we get
\begin{align*}
P_{n+1}-P_n&\leq u_nP_{n+1} +\gamma_n\ps{\frac{b+2\delta}{4a_n} D_n,m_{n+1}^{\odot 2}}+\ps{\frac{D_n}{2a_n},m_{n+1}^{\odot 2}-m_n^{\odot 2}}\,.
\end{align*}
Using $m_{n+1}^{\odot 2} - m_n^{\odot 2} = 2 m_n
\odot (m_{n+1}-m_n)+(m_{n+1}-m_n)^{\odot 2} $, and noting that\\ $\bE_n(m_{n+1}-m_n) = a_n\gamma_n(\nabla F(x_n) -m_n)$,
\begin{equation*}
\bE_n\ps{\frac {D_n}{2a_n},m_{n+1}^{\odot 2}-m_n^{\odot 2}}
= \gamma_n\ps{\nabla F(x_n),\frac{\hat m_n}{\varepsilon+\sqrt{\hat v_n}}}-2a_n\gamma_nP_n+\ps{\frac {D_n}{2a_n}, \bE_n[(m_{n+1}-m_n)^{\odot 2}] }
\end{equation*}
As $a_n\to a$, we have $a_n-\frac{b+2\delta}{4}\geq a-\frac{b+\delta}{4}$ for all $n$ large enough. Hence,
\begin{align*}
\bE_n P_{n+1}-P_n&\leq
u_nP_{n+1} -2(a-\frac{b+\delta}{4})\gamma_n P_n + \gamma_n\ps{\nabla F(x_n),\frac{\hat m_n}{\varepsilon+\sqrt{\hat v_n}}}
\\
&+
\gamma_n^2\frac{b+2\delta}2\ps{\nabla F(x_n),\frac{\hat m_n}{\varepsilon+\sqrt{\hat v_n}}}
+C\ps{\frac {D_n}{2a_n}, \bE_n[(m_{n+1}-m_n)^{\odot 2}] }\,.
\end{align*}
Using the Cauchy-Schwartz inequality and Assumption~\ref{hyp:stab}~\ref{momentgrowth},
it is easy to show the inequality
$\ps{\nabla F(x_n),\frac{\hat m_n}{\varepsilon+\sqrt{\hat v_n}}}\leq C(1+F(x_n)+P_n)$.
Moreover, using the componentwise inequality $(\nabla f_{n+1}-m_n)^{\odot 2} \leq 2 \nabla f_{n+1}^{\odot 2} + 2 m_n^{\odot 2}$
along with Assumption~\ref{hyp:stab}~\ref{momentgrowth}, we obtain
\begin{equation*}
\resizebox{\hsize}{!}{$
\ps{\frac {D_n}{2a_n}, \bE_n[(m_{n+1}-m_n)^{\odot 2}] } \leq
2(1-\alpha_{n+1})^2\ps{\frac {D_n}{2a_n},
\bE_n[ \nabla f_{n+1}^{\odot 2}]+ m_n^{\odot 2}
}
\leq C\gamma_n^2(1+F(x_n)+P_n)\,.
$}
\end{equation*}
Putting all pieces together with Eq.~(\ref{eq:lip}),
\begin{equation}
\label{eq:F+P}
\resizebox{0.95\hsize}{!}{$
\bE_n(F(x_n)+ P_{n+1}) \leq F(x_{n-1})+P_{n}
+u_nP_{n+1} -2(a-\frac{b+\delta}{4})\gamma_n P_n
+C\gamma_n^2(1+F(x_n)+P_n)\,.
$}
\end{equation}
Define
$
V_n\eqdef (1-C\gamma_{n-1}^2)F(x_{n-1})+(1-u_{n-1})P_{n}
$
where the constant $C$ is fixed so that
Eq.~(\ref{eq:F+P}) holds.
Then,
\begin{equation*}
\bE_n(V_{n+1}) \leq V_n
-\left(2a-\frac{b+\delta}{2}-\frac{u_{n-1}}{\gamma_n}\right)\gamma_n P_n
+C\gamma_n^2(1+P_n)+ C\gamma_{n-1}^2F(x_{n-1})\,.
\end{equation*}
By Assumption~\ref{hyp:stab}, $\lim\sup_n u_{n-1}/\gamma_n< 2a-b/2$ and for $\delta$ small enough, we obtain
\begin{equation*}
\bE_n(V_{n+1}) \leq V_n
+C\gamma_n^2(1+P_n)+ C\gamma_{n-1}^2F(x_{n-1})\leq (1+ C'\gamma_n^2)V_n +C\gamma_n^2\,.
\end{equation*}
By the Robbins-Siegmund's theorem \cite{robbins1971convergence},
the sequence $(V_n)$ converges almost surely to a finite random variable $V_\infty \in \bR^+$.
In turn, the coercivity of $F$ implies that $(x_n)$ is almost surely bounded.
We now establish the almost sure boundedness of $(m_n)$.
Consider the martingale difference sequence $\Delta_{n+1}\eqdef \nabla f_{n+1} -\nabla F(x_n)$.
We decompose $m_{n} = \bar m_n + \tilde m_n$ where
$\bar m_{n+1} = \alpha_{n+1} \bar m_n + (1-\alpha_{n+1})\nabla F(x_n)$ and
$\tilde m_{n+1} = \alpha_{n+1} \tilde m_n + (1-\alpha_{n+1})\Delta_{n+1}$, setting $\bar m_0=\tilde m_0=0$.
We prove that both terms $\bar m_n$ and $\tilde m_n$ are bounded. Consider the first term:
$
\|\bar m_{n+1}\|\leq \alpha_{n+1} \|\bar m_n\| + (1-\alpha_{n+1}) \sup_k\|\nabla F(x_k)\|\,.
$
By continuity of $\nabla F$, the supremum in the above inequality is almost surely finite.
Thus, for every $n$, the ratio $\|\bar m_n\|/\sup_k\|\nabla F(x_k)\|$ is upperbounded by the bounded sequence
$r_n$. Hence, $(\bar m_n)$ is bounded w.p.1. Consider now the term $\tilde m_n$:
\begin{equation*}
\resizebox{\hsize}{!}{$
\bE_n(\|\tilde m_{n+1}\|^2) = \alpha_{n+1}^2\|\tilde m_n\|^2 + (1-\alpha_{n+1})^2\bE_n(\|\Delta_{n+1}\|^2)
\leq (1+(1-\alpha_{n+1})^2)\|\tilde m_n\|^2 + (1-\alpha_{n+1})^2C\,,
$}
\end{equation*}
where $C$ is a constant s.t. $\bE_n(\|\nabla f_{n+1}\|^2) \leq C$ by Assumption~\ref{hyp:moment-f}~\ref{momentegal}.
Here, we used $\alpha_{n+1}^2\leq (1+(1-\alpha_{n+1})^2)$ and the inequality
$\bE_n(\|\Delta_{n+1}\|^2) \leq \bE_n(\|\nabla f_{n+1}\|^2)$.
By Assumption~\ref{hyp:stepsizes}, $\sum_n(1-\alpha_{n+1})^2<\infty$. By the Robbins-Siegmund theorem,
it follows that $\sup_n\|\tilde m_n\|^2<\infty$ w.p.1. Finally, it can be shown that $(v_n)$ is
almost surely bounded using the same arguments.
\subsection{Proof of Th.~\ref{thm:clt}}
\label{sec:clt}
We use~\cite[Th.~1]{pelletier1998weak}.
All the assumptions in the latter can be verified in our case, at the exception of
a positive definiteness condition on the
limiting covariance matrix, which corresponds, in our case, to the matrix $Q$
given by Eq.~(\ref{eq:Q}). As $Q$ is not positive definite, it is strictly speaking not possible
to just cite and apply \cite[Th.~1]{pelletier1998weak}. Nevertheless,
a detailed inspection of the proofs of \cite{pelletier1998weak} shows that only a minor
adaptation is needed in order to cover the present case.
Therefore, proving the convergence result of \cite{pelletier1998weak} from scratch is worthless.
It is sufficient to verify the assumptions of \cite[Th.~1]{pelletier1998weak}
(except the definiteness of $Q$) and then to point out the specific part of the proof of \cite{pelletier1998weak}
which requires some adaptation.
Let $z_n=(x_n,m_n,v_n)$ be the output of Algorithm~\ref{alg:adam-decreasing}.
Define $z^*=(x^*,0,S(x^*))$.
Define $\eta_{n+1} \eqdef (0, a(\nabla f_{n+1} - \nabla F(x_n)), b(\nabla f_{n+1}^{\odot 2}- S(x_n)))$.
We have
\begin{equation}
\label{eq:zn_dec}
z_{n+1} = z_n + \gamma_{n+1} h_\infty(z_n) + \gamma_{n+1}\eta_{n+1} + \gamma_{n+1} \epsilon_{n+1}\,,
\end{equation}
where $\epsilon_{n+1} \eqdef (\epsilon_{n+1}^1,\epsilon_{n+1}^2,\epsilon^3_{n+1})$, whose components are given by
\begin{equation*}
\resizebox{\hsize}{!}{$
\epsilon_{n+1}^1 = \frac{m_n}{\varepsilon+\sqrt{v_n}} - \frac{\hat m_{n+1}}{\varepsilon+\sqrt{\hat v_{n+1}}};\,
\epsilon_{n+1}^2 = \left(\frac{1-\alpha_{n+1}}{\gamma_{n+1}}-a\right)\left( \nabla f_{n+1} - m_n\right);\,
\epsilon_{n+1}^3 = \left(\frac{1-\beta_{n+1}}{\gamma_{n+1}}-b\right)\left( \nabla f_{n+1}^{\odot 2} - v_n\right)\,.
$}
\end{equation*}
Here, $\eta_{n+1}$ is a martingale increment noise and
$\epsilon_{n+1} = (\epsilon_{n+1}^1,\epsilon_{n+1}^2,\epsilon^3_{n+1})$ is a remainder term.
The aim is to check the assumptions (A1.1) to (A1.3) of
\cite{pelletier1998weak}, where the role of the quantities ($h$,
$\varepsilon_n$, $r_n$, $\sigma_n$, $\alpha$, $\rho$, $\beta$) in
\cite{pelletier1998weak} is respectively played by the quantities
($h_\infty$, $\eta_n$, $\epsilon_n$, $\gamma_n$, $\kappa$, $1$, $1$) of
the present paper.
Let us first consider Assumption (A1.1) for $h_\infty$.
By construction, $h_\infty(z^*) = 0$. By Assumptions~\ref{hyp:mean_field_tcl} and \ref{hyp:S>0},
$h_\infty$ is continuously differentiable in the neighborhood of $z^*$ and its
Jacobian at $z^*$ coincides with the matrix $H$ given by Eq.~(\ref{eq:H}).
As already discussed, after some algebra,
it can be shown that the largest real part of the eigenvalues of $H$ coincides with $-L$ where $L>0$
is given by Eq.~(\ref{eq:L}).
Hence, Assumption (A1.1) of \cite{pelletier1998weak}
is satisfied for $h_\infty$. Assumption (A1.3) is trivially satisfied
using Assumption~\ref{hyp:step-tcl}. The crux is therefore to verify Assumption (A1.2).
Clearly, $\bE(\eta_{n+1}|\cF_n)=0$. Using Assumption~\ref{hyp:moment-f}\ref{momentreinforce},
it follows from straightforward manipulations based on Jensen's inequality
that for any $M>0$,
there exists $\delta>0$ s.t.
\sup_{n\geq 0}\bE_n\left(\|\eta_{n+1}\|^{2+\delta}\right) \1_{\{\|z_n-z^*\|\leq M\}}<\infty\,.
$
Next, we verify the condition
\begin{equation}
\label{eq:cond-reste}
\lim_{n\to\infty} \bE\left(\gamma_{n+1}^{-1}\|\epsilon_{n+1}\|^2\1_{\{\|z_n-z^*\|\leq M\}}\right) = 0\,.
\end{equation}
It is sufficient to verify the latter for $\epsilon^i_n$ ($i=1,2,3$) in place of $\epsilon_n$.
The map $(m,v)\mapsto m/(\varepsilon+\sqrt{v})$ is Lipschitz continuous in a neighborhood of
$(0,S(x^*))$ by Assumption~\ref{hyp:S>0}. Thus, for $M$ small enough, there exists a constant $C$ s.t.
if $ \|z_n-z^*\|\leq M$, then
\|\epsilon_{n+1}^1\| \leq C\left\|r_{n+1}^{-1}m_{n+1}-m_n\right\|+C\left\|\bar r_{n+1}^{-1} v_{n+1}-v_n\right\|\,.
$
Using the triangular inequality and the fact that $r_{n+1},\bar r_{n+1}$ are bounded sequences away from zero, there exists an other constant $C$ s.t.
\begin{align*}
\|\epsilon_{n+1}^1\| &\leq C\left\|m_{n+1}-m_n\right\|+C\left\|v_{n+1}-v_{n}\right\|
+C|r_{n+1}-1|+C|\bar r_{n+1}-1|\,.
\end{align*}
Using Lemma~\ref{lemma:r_n} under Assumption~\ref{hyp:step-tcl} (note that $\gamma_0 > 1/2L \geq 1/a$ when $\kappa=1$),
we obtain that the sequence $|r_{n}-1|/\gamma_n$ is bounded, thus $|r_{n+1}-1|\leq C\gamma_{n+1}$.
The sequence $(1-\alpha_{n})/\gamma_n$ being also bounded, it holds that
\begin{align*}
\|m_{n+1}-m_n\|^2 \1_{\{\|z_n-z^*\|\leq M\}} \leq C\gamma_{n+1}^2(1+\|\nabla f_{n+1}\|^2 )\1_{\{\|z_n-z^*\|\leq M\}}\,.
\end{align*}
By Assumption~\ref{hyp:moment-f}~\ref{momentreinforce},
$\bE_n(\|\nabla f_{n+1}\|^2|)$ is bounded by a deterministic constant on $\{\|z_n-z^*\|\leq M\}$.
Thus, $\bE_n(\|m_{n+1}-m_n\|^2\1_{\{\|z_n-z^*\|\leq M\}})\leq C\gamma_{n+1}^2$.
A similar result holds for $\|v_{n+1}-v_n\|^2$. We have thus shown that
$ \bE_n\left(\|\epsilon_{n+1}^1\|^2\1_{\{\|z_n-z^*\|\leq M\}}\right)\leq C\gamma_{n+1}^2$. Hence,
Eq.~(\ref{eq:cond-reste}) is proved for $\epsilon_{n+1}^1$ in place of $\epsilon_{n+1}$.
Under Assumption~\ref{hyp:step-tcl}, the proof uses the same kind of arguments for $\epsilon_{n+1}^2$, $\epsilon_{n+1}^3$ and is omitted.
Finally, Eq.~(\ref{eq:cond-reste}) is proved.
Continuing the verification of Assumption (A1.2), we establish that
\begin{equation}
\label{eq:lim-cov}
\bE_n(\eta_{n+1}\eta_{n+1}^T) \to Q\textrm{ a.s. on } \{z_n\to z^*\}\,.
\end{equation}
Denote by $\bar Q(x)$ the matrix given by the righthand side of Eq.~(\ref{eq:Q}) when $x^*$
is replaced by an arbitrary $x\in \cV$. It is easily checked that $\bE_n(\eta_{n+1}\eta_{n+1}^T)=\bar Q(x_n)$
and by continuity, $\bar Q(x_n)\to Q$ a.s. on $\{z_n\to z^*\}$, which proves (\ref{eq:lim-cov}).
Therefore, Assumption (A1.2) is fulfilled, except for the point mentioned at the beginning of this section :
\cite{pelletier1998weak} puts the additional condition that the limit
matrix in Eq.~(\ref{eq:lim-cov}) is positive definite. This condition is not satisfied in our case,
but the proof can still be adapted. The specific part of the proof where the positive definiteness
comes into play is Th.~7 in \cite{pelletier1998weak}. The proof of \cite[Th.~1]{pelletier1998weak} can therefore
be adapted to the case of a positive semidefinite matrix.
In the proof of \cite[Th.~7]{pelletier1998weak}, we only substitute the inverse of the square root of $Q$ by the Moore-Penrose inverse.
Finally, the uniqueness of the stationary distribution $\mu$ and its expression follow from \cite[Th.~6.7, p. 357]{karatzas-shreve1991}.
\noindent\textbf{Proof of Eq.~(\ref{eq:cov})}.
We introduce the $d\times d$ blocks of the $3d\times 3d$ matrix
$\Sigma = \left(\Sigma_{i,j}\right)_{i,j=1,2,3}$
where $\Sigma_{i,j}$ is $d\times d$. We denote by $\tilde\Sigma$ the $2d\times 2d$ submatrix $\tilde\Sigma \eqdef\left(\Sigma_{i,j}\right)_{i,j=1,2}$.
By Th.~\ref{thm:clt}, we have the subsystem:
\begin{equation}
\tilde H \tilde\Sigma + \tilde\Sigma\tilde H^T =
\begin{pmatrix}
0 & 0 \\
0 & -a^2 \tilde Q
\end{pmatrix}\qquad\text{where }\tilde H \eqdef
\begin{pmatrix}
\zeta I_d & -D \\
a\nabla^2F(x^*) & (\zeta-a) I_d
\end{pmatrix}\label{eq:lyap-reduced}
\end{equation}
and where $\tilde Q \eqdef \textrm{Cov}\left(\nabla
f(x^*,\xi)\right)$. The next step is to triangularize the matrix
$\tilde H$ in order to decouple the blocks of $\tilde\Sigma$. For
every $k=1,\dots,d$, set
$\nu_k^\pm \eqdef -\frac{a}{2}\pm\sqrt{a^2/4-a\lambda_k}$
with the convention that $\sqrt{-1} =
\imath$ (inspecting the characteristic polynomial of $\tilde H$, these
are the eigenvalues of $\tilde H$). Set
$M^\pm\eqdef\diag{(\nu_1^\pm,
\cdots,\nu_d^\pm)}$ and $R^\pm\eqdef
D^{-1/2}PM^\pm P^TD^{-1/2}$. Using the identities $M^++M^-=-a I_d$ and
$M^+M^-=a\Lambda$ where
$\Lambda\eqdef\diag{(\lambda_1,\cdots,\lambda_d)}$, it can be checked
that
$$
\cR\tilde H =\begin{pmatrix}
D R^+ + \zeta I_d & -D \\ 0 & R^-D + \zeta I_d
\end{pmatrix}\cR,\text{ where }\cR\eqdef
\begin{pmatrix}
I_d & 0 \\ R^+ & I_d
\end{pmatrix}\,.
$$
Set $\check \Sigma \eqdef \cR\tilde\Sigma\cR^T$. Denote by
$(\check \Sigma_{i,j})_{i,j=1,2}$ the blocks of $\check\Sigma$.
Note that $\check\Sigma_{1,1} = \Sigma_{1,1}$. By left/right multiplication of Eq.~(\ref{eq:lyap-reduced})
respectively with $\cR$ and $\cR^T$, we obtain
\begin{align}
&(DR^++\zeta I_d) \Sigma_{1,1}+\Sigma_{1,1}(R^+D+\zeta I_d) = \check\Sigma_{1,2} D+ D\check\Sigma_{1,2}^T \label{eq:lapremiere}\\
& (DR^++\zeta I_d) \check\Sigma_{1,2}+\check\Sigma_{1,2} (DR^-+\zeta I_d) = D\check\Sigma_{2,2} \label{eq:ladeuxieme}\\
& (R^-D+\zeta I_d) \check\Sigma_{2,2} + \check\Sigma_{2,2} (DR^-+\zeta I_d) = -a^2\tilde Q \label{eq:laderniere}
\end{align}
Set $\bar \Sigma_{2,2} = P^{-1}D^{1/2}\check\Sigma_{2,2} D^{1/2}P$.
Define $C\eqdef P^{-1}D^{1/2}\tilde Q D^{1/2}P$.
Eq.~(\ref{eq:laderniere}) yields $(M^-+\zeta I_d) \bar\Sigma_{2,2} + \bar\Sigma_{2,2} (M^-+\zeta I_d) = -a^2C$.
Set $\bar \Sigma_{1,2} = P^{-1}D^{-1/2}\check\Sigma_{1,2} D^{1/2}P$.
Eq.~(\ref{eq:ladeuxieme}) rewrites $(M^++\zeta I_d) \bar \Sigma_{1,2}+\bar \Sigma_{1,2} (M^-+\zeta I_d) = \bar \Sigma_{2,2}$.
We obtain that
\bar\Sigma_{1,2}^{k,\ell} = (\nu_k^++\nu_\ell^-+2\zeta)^{-1}\bar\Sigma_{2,2}^{k,\ell} = \frac{-a^2C_{k,\ell}}{(\nu_k^++\nu_\ell^-+2\zeta)(\nu_k^-+\nu_\ell^-+2\zeta)}\,.
$
Set
$\bar \Sigma_{1,1} = P^{-1}D^{-1/2}\Sigma_{1,1} D^{-1/2}P$.
Eq.~(\ref{eq:lapremiere}) becomes $(M^++\zeta I_d)\bar \Sigma_{1,1} + \bar \Sigma_{1,1}(M^++\zeta I_d) = \bar \Sigma_{1,2} + \bar \Sigma_{1,2}^T$. Thus,
\begin{align*}
\bar\Sigma_{1,1}^{k,\ell} &
\resizebox{.9\hsize}{!}{$
= \frac{\bar\Sigma_{1,2}^{k,\ell}+\bar\Sigma_{1,2}^{\ell,k}}{\nu_k^++\nu_\ell^++2\zeta}
= \frac{-a^2C_{k,\ell}}{(\nu_k^++\nu_\ell^++2\zeta)(\nu_k^-+\nu_\ell^-+2\zeta)}\left(\frac{1}{\nu_k^++\nu_\ell^-+2\zeta}
+\frac{1}{\nu_k^-+\nu_\ell^++2\zeta}\right)
$}
\\ &
= \frac{C_{k,\ell}}{ (1 - \frac{2\zeta}{a})(\lambda_k+\lambda_\ell-2\zeta + \frac 2a \zeta^2) +\frac 1{2(a-2\zeta)}(\lambda_k-\lambda_\ell)^2}\,,
\end{align*}
and the result is proved.
\bibliographystyle{siamplain}
| {'timestamp': '2020-05-15T02:01:03', 'yymm': '1810', 'arxiv_id': '1810.02263', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02263'} | arxiv |
\section{Proposed Network Architecture}\label{sec:approach}
\textcolor{black}{We propose a new end-to-end framework for solving the problem of detecting multiple salient instances and ranking the instances according to their degree of saliency}. Our proposed salient object detection network is inspired by the success of convolution-deconvolution pipelines~\cite{noh2015learning,liu2016dhsnet,islam2017gated} that include a feed-forward network for initial coarse-level prediction. Then, we provide a stage-wise refinement mechanism over which predictions of finer structures are gradually restored. Fig.~\ref{fig:network} shows the overall architecture of our proposed network. The encoder stage serves as a feature extractor that transforms the input image to a rich feature representation, while the refinement stages attempt to recover lost contextual information to yield accurate predictions and ranking. We begin by describing how the initial coarse saliency map is generated in section~\ref{feed-forward-network}. This is followed by a detailed description of the stage-wise refinement network, and multi-stage saliency map fusion in sections~\ref{stage-wise-refinement} and section~\ref{fusion} respectively.
\subsection{Feed-forward Network for Coarse Prediction}
\label{feed-forward-network}
Recent feed-forward deep learning models applied to high-level vision tasks (e.g. image classification~\cite{He2015,simonyan2014very}, object detection~\cite{ren2015faster}) employ a cascade comprised of repeated convolution stages followed by spatial pooling. Down-sampling by pooling allows the model to achieve a highly detailed semantic feature representation with relatively poor spatial resolution at the deepest stage of encoding, also marked by spatial coverage of filters that is much larger in extent. The loss of spatial resolution is not problematic for recognition problems; however, pixel-wise labeling tasks (e.g. semantic segmentation, salient object detection) require pixel-precise information to produce accurate predictions. Thus, we choose Resnet-101~\cite{He2015} as our encoder network (fundamental building block) due to its superior performance in classification and segmentation tasks. Following prior works on pixel-wise labeling~\cite{chen2016deeplab,islam2017gated}, we use the dilated ResNet-101~\cite{chen2016deeplab} to balance the semantic context and fine details, resulting in an output feature map reduced by a factor of 8. More specifically, given an input image $I\in\mathbb{R}^{h\times w\times d}$, our encoder network produces a feature map of size $\floor*{\frac{h}{8}, \frac{w}{8}} $. To augment the backbone of the encoder network with a top-down refinement network, we first attach one extra convolution layer with $3\times 3$ kernel and \textcolor{violet}{$N$ channels ($N$ denotes total number of individual observers involved in the labeling process)} to obtain a \textit{Nested Relative Salience Stack} (NRSS). Then, we append a \textit{Stacked Convolutional Module} (SCM) to compute the coarse level saliency score for each pixel. \textcolor{violet}{The SCM consists of three convolutional layers for generating the desired saliency map. The initial convolutional layer has 6 channels with a $3 \times 3$ kernel, followed by two convolutional layers having 3 channels with $3 \times 3$ kernel and one channel with $1 \times 1$ kernel respectively. Each of the channels in the SCM learns a soft weight for each spatial location of the nested relative salience stack in order to label pixels based on confidence that they belong to a salient object. The described operations can be expressed as:}
\begin{gather}
\mathcal{S}_\vartheta^t = \mathcal{C}_{3\times3}(f_{enc}(I;\mathcal{W});\Theta), \hspace{0.2cm} \mathcal{S}_m^t = \partial(\mathcal{S}_\vartheta^t)
\end{gather}
where \textit{I} is the input image and ($\mathcal{W}, \Theta$) denote the parameters of the convolution $\mathcal{C}$. $\mathcal{S}_\vartheta^t$ is the coarse level NRSS for stage \textit{t} that encapsulates different degrees of saliency for each pixel (akin to a prediction of the proportion of observers that might agree an object is salient), $\mathcal{S}_m^t$ refers to the coarse level saliency map, and \textcolor{violet}{$\partial$ refers to SCM. $f_{enc}(.)$ denotes} the output feature map generated by the encoder network. \textcolor{violet}{Note that our encoder network might be replaced with any alternative baseline network} and we have considered a few such choices in our experiments section.
\subsection{Stage-wise Refinement Network}\label{stage-wise-refinement}
Most existing works~\cite{liu2016dhsnet, wang2017stagewise, amulet_2017, hou2016deeply} that have shown success for salient object detection typically share a common structure of stage-wise decoding to recover per-pixel categorization. Although the deepest stage of an encoder has the richest possible feature representation, relying only on convolution and unpooling at the decoding stages to recover lost information may degrade the quality of predictions~\cite{islam2017gated}. So, the spatial resolution that is lost at the deepest layer may be gradually recovered from earlier representations. This intuition appears in proposed refinement based models that include skip connections~\cite{long2015fully,islam2017gated,amulet_2017, hou2016deeply} between encoder and decoder layers. However, how to effectively combine local and global contextual information remains an area deserving further analysis. Inspired by the success of refinement based approaches~\cite{long2015fully, islam2017label,islam2017gated,Islam2018arxiv}, we propose a multi-stage fusion based refinement network to recover lost contextual information in the decoding stage by combining an initial coarse representation with finer features represented at earlier layers. The refinement network is comprised of successive stages of rank-aware refinement units that attempt to recover missing spatial details in each stage of refinement and also preserve the relative rank order of salient objects. Each stage refinement unit takes the preceding NRSS with earlier finer scale representations as inputs and carries out a sequence of operations to generate a refined NRSS that contributes to obtain a refined saliency map. Note that refining the hierarchical NRSS implies that the refinement unit is leveraging the degree of agreement at different levels of SCMs to iteratively improve confidence in relative rank and overall saliency. As a final stage, refined saliency maps generated by the SCMs are fused to obtain the overall saliency map.
\subsubsection{Rank-Aware Refinement Unit}
Previous saliency detection networks~\cite{wang2017stagewise,liu2016dhsnet} proposed refinement across different levels by directly integrating representations from earlier features. Following~\cite{islam2017gated}, we integrate gate units in our rank-aware refinement unit that control the information passed forward to filter out the ambiguity relating to figure-ground and salient objects. The initial NRSS ($\mathcal{S}_\vartheta^t$) generated by the feed-forward encoder provides input for the first refinement unit \textcolor{violet}{($\mathcal{R}_\vartheta^1$)}. Note that one can interpret $\mathcal{S}_\vartheta^t$ as the predicted saliency map in the \textcolor{violet}{refinement} process, but our model forces the channel dimension to be the same as the number of participants involved in labeling salient objects. The refinement unit takes the gated feature map $\mathcal{G}_a^t$ generated by the gate unit~\cite{islam2017gated} as a second input. As suggested by~\cite{islam2017gated}, we obtain $\mathcal{G}_a^t$ by combining two consecutive feature maps \textcolor{violet}{($f_\xi^t$ and $f_\xi^{t+1}$ )} from the encoder network (see dotted box in Fig.~\ref{fig:network}). We first upsample the preceding $\mathcal{S}_\vartheta^t$ to double its size. \textcolor{violet}{A transformation function $\mathcal{T}_f$ comprised of a sequence of operations (convolution followed by batch normalization and ReLU) is applied} on upsampled $\mathcal{S}_\vartheta^t$ and $\mathcal{G}_a^t$ to obtain the refined NRSS ($\mathcal{S}_\vartheta^{t+1}$). We then append the \textit{SCM} module on top of $\mathcal{S}_\vartheta^{t+1}$ to generate the refined saliency map $\mathcal{S}_m^{t+1}$. Finally, the predicted $\mathcal{S}_\vartheta^{t+1}$ is fed to the next stage rank-aware refinement unit. Note that, we only forward the NRSS to the next stage, allowing the network to learn contrast between different levels of confidence for salient objects. Unlike other approaches, we apply supervision for both the refined NRSS and the refined saliency map. The procedure for obtaining the refined NRSS and the refined saliency map for all stages is identical. The described operations may be summarized as follows:
\begin{gather}
\mathcal{S}_\vartheta^{t+1} = w^b \ast \mathcal{T}_f(\mathcal{G}_a^t, u(\mathcal{S}_\vartheta^t)), \hspace{0.1cm} S_m^{t+1} = w_s^b \ast \partial(\mathcal{S}_\vartheta^{t+1})
\end{gather}
where $u$ represents the upsample operation; $w^b$ and $w_s^b$ denotes the parameter for the transformation function $\mathcal{T}_f$ and SCM ($\partial$ in the equation) respectively. Note that \textit{t} refers to particular stage of the refinement process.
\subsection{Multi-Stage Saliency Map Fusion}\label{fusion}
Predicted saliency maps at different stages of the refinement units are capable of finding the location of salient regions with increasingly sharper boundaries. Since all the rank-aware refinement units are stacked together on top of each other, the network allows each stage to learn specific features that are of value in the refinement process. These phenomena motivate us to combine different level SCM predictions, since the internal connection between them is not explicitly present in the network structure. To facilitate interaction, we add a fusion layer at the end of network that concatenates the predicted saliency maps of different stages, resulting in a fused feature map $\mathcal{S}_m^{\hat{f}} $. Then, we apply a $1 \times 1$ convolution layer $\Upsilon$ to produce the final predicted saliency map $\mathcal{S}_m^{T}$ of our network. Note that our network has T predictions \textcolor{violet}{(in our case T=6)}, including one fused prediction and T-1 stage-wise predictions. We can write the operations as follows:
\begin{gather}
\mathcal{S}_m^{\hat{f}} = \eth(\mathcal{S}_m^{t}, \mathcal{S}_m^{t+1}, .... , \mathcal{S}_m^{T-1}), \hspace{0.1cm} \mathcal{S}_m^{T} = w^f \ast \Upsilon(\mathcal{S}_m^{\hat{f}})
\end{gather}
where $\eth$ denotes the cross channel concatenation; $w^f$ is the resultant parameter for obtaining the final prediction.
\subsection{Stacked Representation of Ground-truth} \label{sec:stack}
The ground-truth for salient object detection or segmentation contains a set of numbers defining the degree of saliency for each pixel. The traditional way of generating binary masks is by thresholding which implies that there is no notion of relative salience. Since we aim to explicitly model observer agreement, using traditional binary ground-truth masks is unsuitable. To address this problem, we propose to generate a set of stacked ground-truth maps for PASCAL-S dataset that corresponds to different levels of saliency (defined by inter-observer agreement) denoted as PASCAL-SR. Given a ground-truth saliency map $\mathcal{G}_m$, we obtain a stack $\mathcal{G}_{\vartheta}$ of \textit{N} ground-truth maps ($\mathcal{G}_i, \mathcal{G}_{i+1}, ....., \mathcal{G}_N$) where each map $\mathcal{G}_i$ includes a binary indication that at least $i$ observers judged an object to be salient (represented at a per-pixel level). \textit{N} is the number of different participants involved in labeling the salient objects. The stacked ground-truth saliency maps $\mathcal{G}_{\vartheta}$ provides better separation for multiple salient objects (see Eq. \eqref{eq:stack_gt} for illustration) and also naturally acts as the relative rank order that allows the network to learn to focus on degree of salience. It is important to note the nested nature of the stacked ground truth wherein $\mathcal{G}_{i+1} \subseteq \mathcal{G}_{i}$. This is important conceptually as a representation wherein $\mathcal{G}_i = 1 \iff$ exactly $i$ observers agree, results in zeroed layers in the ground truth stack, and large changes to ground truth based on small differences in degree of agreement.
\begin{equation}\label{eq:stack_gt}
\mathcal{G}_{\vartheta} =
\begin{bmatrix} \mathcal{G}_i \\ \includegraphics[width=0.05\textwidth]{images/stack_slice/100_lslice_1.png} \end{bmatrix}
\begin{bmatrix} \mathcal{G}_{i+1} \\ \includegraphics[width=0.05\textwidth]{images/stack_slice/100_lslice_2.png} \end{bmatrix}
\begin{bmatrix} \mathcal{G}_{i+2} \\ \includegraphics[width=0.05\textwidth]{images/stack_slice/100_lslice_3.png} \end{bmatrix}
\begin{bmatrix} \\... \\\\ \end{bmatrix}
\begin{bmatrix} \mathcal{G}_{N} \\ \includegraphics[width=0.05\textwidth]{images/stack_slice/100_lslice_12.png} \end{bmatrix}
\end{equation}
\subsection{Training the Network}
Our proposed network produces a sequence of nested relative salience stacks (NRSS) and saliency maps at each stage of refinement; however, we are principally interested in the final fused saliency map. Each stage of the network is encouraged to repeatedly produce NRSS and a saliency map with increasingly finer details by leveraging preceding NRSS representations. We apply an auxiliary loss at the output of each refinement stage along with an overall master loss at the end of the network. Both of the losses help the optimization process. In more specific terms, let $I\in\mathbb{R}^{h\times w\times 3}$ be a training image with ground-truth saliency map $ \mathcal{G}_m\in\mathbb{R}^{h\times w}$. As described in Sec.~\ref{sec:stack}, we generate a stack of ground-truth saliency maps $\mathcal{G}_{\vartheta}\in\mathbb{R}^{h\times w\times N}$. To apply supervision on the NRSS ($S_\vartheta^t$) and saliency map $S_{m}^t$, we first down-sample $\mathcal{G}_\vartheta$ and $\mathcal{G}_m$ to the size of $S_\vartheta^t$ generated at each stage resulting in $\mathcal{G}_\vartheta^t$ and $\mathcal{G}_m^t$. Then, at each refinement stage we define pixel-wise euclidean loss $\Delta_{S_\vartheta}^t$ and $\Delta_{S_m}^t$ to measure the difference between ($S_\vartheta^t, \mathcal{G}_\vartheta^t$) and ($S_{m}^t, \mathcal{G}_{m}^t$) respectively. We can summarize these operations as:
{
\begin{gather}
\Delta_{S_{\vartheta}}^t(W) = \frac{1}{2dN} \sum_{i=1}^{d} \sum_{z=1}^{N} (x_i(z)-y_i(z))^2 \nonumber\\
\Delta_{S_m}^t(W) = \frac{1}{2d} \sum_{i=1}^{d} (x_i-y_i)^2 \nonumber \\
L_{aux}^t (W) = \Delta_{S_{\vartheta}}^t + \Delta_{S_m}^t
\end{gather}
}
\noindent where $x \in {\rm I\!R}^d$ and $y \in {\rm I\!R}^d$ ($d$ denotes the spatial resolution) are the vectorized ground-truth and predicted saliency map. $x_i$ and $y_i$ refer to a particular pixel of $S_\vartheta^t$ and $G_\vartheta^t$ respectively. \textit{W} denotes the parameters of whole network and $N$ refers to total number of ground-truth slices ($\text{N=12}$ in PASCAL-SR case and $\text{N=5}$ in COCO-SalRank dataset described in Sec.~\ref{sec:cocosalrank}). The final loss function of the network combining master and auxiliary losses can be written as:
{{\footnotesize
\begin{gather}
L_{final}(W)= L_{mas}(W) + \sum_{t=1}^{T-1} \lambda_t L_{aux}^t (W)
\end{gather}
}}
where $L_{mas}(W)$ refers to the Euclidean loss function computed on the final predicted saliency map $\mathcal{S}_m^{T}$. We set $\lambda_t$ to 1 for all stages to balance the loss, which remains continuously differentiable. Each stage of prediction contains information related to two predictions, allowing our network to propagate supervised information from deep layers. This also begins with aligning the weights with the initial coarse representation,
leading to a coarse-to-fine learning process. The fused prediction generally appears much better than other stage-wise predictions since it contains the aggregated information from all the refinement stages. For saliency inference, we can simply feed an image of arbitrary size to the network and use the fused prediction as our final saliency map.
\section{COCO-SalRank Dataset}\label{sec:cocosalrank}
Given the stated objective of scaling up from the ranking benchmark derived from PASCAL-SR, we aim to construct a larger dataset suitable for saliency ranking analysis for use by the computer vision community to promote saliency ranking research. Designing a large-scale dataset requires a large number of decisions including data collection, processing, and the annotation protocol. Our choices were driven by the end goal of enabling immediate progress in the field of saliency ranking and allowing deeper exploration of relative saliency. The description in what follows may be viewed as having two contributions: i. A larger pool of data for training and benchmarks, which produces demonstrably better results for the PASCAL-SR derived ranking ii. A view into considerations relevant to producing additional data suitable to measuring the success of solutions to assigning relative rank according to saliency. With respect to this latter consideration, the approach and analysis reveals a number of nuances related to the problem space that are important to the content of this work, but also to future data-centric contributions for relative salience. \textcolor{violet}{This might be applied e.g. to the very recent SOC dataset \cite{SOCpaper} as an extension given its high quality annotations, size and variety of images. The SOC dataset in particular (released after submission of this manuscript in its initial form) may have more fine-grained pixel level labeling. In comparison, our dataset relies on the original MS-COCO labels that are somewhat coarse in comparison. With that said, at this time the data presented here is the largest scale and highest quality dataset for ranking, and we have provided a strong roadmap for extension to other datasets such as this one.}
\subsection{Description of the COCO-SalRank dataset}\label{des}
One rule of thumb for constructing a dataset perhaps, is to first analyze existing datasets for the same task. There exist a significant number of saliency detection datasets but the majority provide ground-truth in binary notation. Since saliency ranking requires ground-truth in the form of multiple observers' agreement, a primary objective is to arrive at a dataset that provides a faithful rank order of the salient objects. To do so, we at least require images with several distinct measures of what may be salient. Given the relatedness to human allocation of gaze, it is natural to consider what value may be derived from considering fixation maps across observers in conjunction with cases where instance-wise label maps are also present. Specifically, there is the opportunity to leverage \textcolor{black}{fixation maps} to assign rankings among category items present within instance-wise label maps. We therefore make the careful choice of MS COCO images that include multiple simulated moused-based fixation annotations from the training and validation data of the SALICON dataset~\cite{jiang2015salicon} to construct our proposed dataset. We obtain instance-wise mask annotations from the MS-COCO dataset as SALICON images are chosen from MS-COCO.
Directly combining these two data sources to achieve the desired objective is a more significant challenge than one might expect on the surface for reasons that are highlighted throughout this paper. \textcolor{violet}{Moreover, we have already discussed significant differences between gaze data and mouse-based assessments of salient object for ranking including low-level biases and differences in underlying cognitive processes}. For this reason, we also include careful evaluation on data where both gaze and click based selections are present to validate that the end result comes very close in approximating mouse-based ranking data. Given the set of images with instance-wise labels and \textcolor{black}{mouse-based fixation maps}, we propose a novel approach to provide saliency ranking ground-truth. Initially we create a \emph{noisy} version (version \rom{1}) of the proposed dataset (COCO-SalRank) that includes 7047 training images and 3363 test images. Subsequently, we produce a refined \emph{clean} version (version \rom{2}) of annotations with 3052 training and 1381 test images. Note that in deriving the clean dataset, the cleaned data (version \rom{2}) is also manually checked to remove obvious outliers, and to ensure labeling fidelity. The total number of images removed manually based on visual inspection is 605. The following presents details for deriving these datasets, including data refinement that have been considered in creating the COCO-SalRank dataset:
\begin{itemize}
\setlength{\itemindent}{0em}
\item \textbf{Number of Instances:} We restrict the total number of instances in an image to maximum five.
\item \textbf{Ranking Ties:} No instances are assigned tied values due to differences in relative saliency within labeled instance regions.
\end{itemize}
Considering the above-mentioned factors, we provide two different sets of ground-truth data that may each carry value in model training or evaluation. The justification for this latter statement is borne out in analysis of results.
\subsection{Ground Truth Annotation}
To obtain the saliency ranking ground-truth, as alluded to earlier, we propose a novel approach that assigns a rank order to salient objects in an image given instance-wise segmentations and associated stimulated \textcolor{black}{mouse-based fixation maps}. The instance-wise labeling in MS-COCO is not consistent with the fixation maps provided by SALICON, so we can not directly use these two sets of annotations in order to generate the saliency ranking annotation. There are many instances which are labeled in the instance map but are not a point of focus in the fixation map. Similarly, some instances have reasonable fixation density but are not labeled as an instance in the set of masks. Other challenges include over or under-segmented images, unlabeled non-class objects, and that explicit ranking from manual selections are unavailable for this data.
\begin{figure*}[ht!]
\begin{equation}
\begin{bmatrix} \text{image \& mask}\\ \fcolorbox{red}{red} {\includegraphics[width=0.10\textwidth]{images/2/pascal_anlysis/pascal_rank_gaus/351_image.png}} \hspace{0.05cm} \fcolorbox{red}{red} {\includegraphics[width=0.10\textwidth]{images/2/pascal_anlysis/pascal_rank_gaus/351_image_gt.png}}
\end{bmatrix}
\begin{bmatrix} \text{fixation map} \\ \fcolorbox{red}{red} {\includegraphics[width=0.10\textwidth]{images/2/pascal_anlysis/pascal_rank_gaus/351_rank_new_saliency_gaus_1.png}} \hspace{0.05cm} \fcolorbox{red}{red} {\includegraphics[width=0.10\textwidth]{images/2/pascal_anlysis/pascal_rank_gaus/351_rank_new_saliency_gaus_2.png}}
\end{bmatrix}
\begin{bmatrix} \text{blurring effect} \\ \fcolorbox{red}{red} {\includegraphics[width=0.10\textwidth, height=1.365cm]{images/2/pascal_anlysis/pascal_rank_gaus/351_rank_gaus_1.png}} \hspace{0.05cm} \fcolorbox{red}{red} {\includegraphics[width=0.10\textwidth]{images/2/pascal_anlysis/pascal_rank_gaus/351_rank_gaus_2.png}}
\end{bmatrix}
\begin{bmatrix} \text{power effect} \\ \fcolorbox{red}{red} {\includegraphics[width=0.10\textwidth]{images/2/pascal_anlysis/pascal_rank_pow/351_rank_pow_1.png}} \hspace{0.05cm} \fcolorbox{red}{red} {\includegraphics[width=0.10\textwidth]{images/2/pascal_anlysis/pascal_rank_pow/351_rank_pow_2.png}}
\end{bmatrix} \nonumber
\begin{matrix} \\
\end{matrix}
\end{equation}
\caption{Sets from left to right: Input image and GT rank, \textcolor{black}{simulated mouse-based fixation maps} blurred with different Gaussian filters, predicted rank that corresponds to fixation maps in the previous set ($\alpha = 0.3$), predicted rank that corresponds to two different $\alpha$ ($\sigma = 10.5, \mu = 80$). \textcolor{violet}{Relative rank is indicated by the assigned color and number on each salient instance.} }
\label{fig:blur}
\vspace{-0.3cm}
\end{figure*}
To overcome these limitations, we have arrived at a data refinement pipeline through experimentation that is shown to produce faithful rankings when measured against alternate smaller-scale data where gaze, instance labels, and explicit selection are all present. The methods that address this challenge are described in what follows. We first apply Gaussian blurring on the \textcolor{black}{fixation} locations to obtain the new fixation map $\mathcal{F}_i^\prime $. This is a crucial step in our approach since fixation locations provided by SALICON are generated by mouse tracking instead of a traditional eye tracker which implies a less diffuse distribution on the focus of attention such that fixation points may not overlap with the corresponding instances (even if they are proximal). In addition, as the labeling in MS-COCO does not capture the border of the instances accurately, blurring the fixation locations is especially important to allow density from border fixations to diffuse into the defined mask area. Another important step in our annotation protocol is pruning the original instance mask. As mentioned earlier, regions labeled in instance-wise label maps may not include all salient objects. Instance masks may therefore be pruned based on few carefully chosen criteria. Given the set of new fixation maps $\mathcal{F}^\prime $ and the provided instance-wise maps $\mathcal{I}$, we propose a \textit{Saliency Ranking} algorithm (Algorithm~\ref{alg:ranking}) that generates the ranking ground-truth. Algorithm~\ref{alg:ranking} describes the set of steps to obtain a rank order of salient instances in an image.
\begin{table}[H]
\vspace{-0.4cm}
\begin{algorithm}[H]
\caption{Saliency Ranking}\label{rank}
\begin{algorithmic}[1]
\Function{SalRank}{$\mathcal{I},\mathcal{F}, \sigma, \mu, \xi, \ell, \gamma$} \Comment{instance maps $\mathcal{I}$, fixation $\mathcal{F}$}
\For{\texttt{each instance map $\mathcal{I}_i\in \mathcal{I}$}}
\State $\mathcal{F}_i^\prime $ = \textit{Gaussian} ($\sigma, \mu, \mathcal{F}_i $) \hspace{0.3cm} overlap, $\vartheta = \mathcal{F}_i^\prime \times \mathcal{I}_i$
\For{\texttt{each instance $ \chi \in \mathcal{I}_i$}}
\State score, $\mathbb{R}_\chi = \frac{\sum \vartheta(\chi)}{\sqrt[\epsilon]{\text{size}(\chi)}}$ \hspace{0.5cm} (Rank list, $\mathbb{R}$)
\EndFor
\State $\mathcal{I}_i^\prime$ = \textbf{\color{red}Prune}($\mathcal{I}_i, \mathcal{F}_i^\prime, \mathbb{R}, \alpha_1, \alpha_2 )$
\State overlap, $\vartheta^\prime$ = $\mathcal{I}_i^\prime \times \mathcal{F}_i$ \hspace{0.3cm}total instances, $\rho$ = \textit{unique}($\mathcal{I}_i^\prime$)
\If{$\rho$ $> \xi$ \textbf{or} $\frac{\sum(\vartheta^\prime)}{\sum(\mathcal{F}_i^\prime)}$ $<$ $\ell$ \textbf{or} $\sum(\mathcal{I}_i^\prime \neq 0) > \gamma$ }
\State ignore instance map $\mathcal{I}_i$
\EndIf
\EndFor
\EndFunction
\end{algorithmic}
\label{alg:ranking}
\end{algorithm}
\vspace{-0.5cm}
\end{table}
First, we calculate overlap $\vartheta$ between the new fixation map $\mathcal{F}^\prime $ and the instance-wise map $\mathcal{I}_i$ to remove non-salient instances. Then, we generate a ranking score $\mathbb{R}_\chi$ for each salient instance $\chi$ by dividing the total saliency captured by $\chi$ in $\vartheta$ to the size of the instance raised to the power $\epsilon$. The \textit{prune} function (see Algorithm~\ref{alg:rankin2g} ) takes the newly generated fixation map $\mathcal{F}^\prime $, instance map $\mathcal{I}_i$, and two parameters ($\alpha_1 \& \alpha_2$) as input, resulting in a pruned instance mask, $\mathcal{I}_i^\prime$. The prune function focuses on removing instances with the following conditions: (1) If the size of a particular instance is greater than a certain threshold $\alpha_1$ (\textcolor{violet}{generally due to under-segmentation or close-up shot scenes}) or (2) The rank score of an instance $\mathbb{R}_\chi$ is less than $\alpha_2$ (generally due to receiving very little attention). Given the pruned instance map $\mathcal{I}_i^\prime$, we again calculate the overlap $\vartheta^\prime$ between $\mathcal{F}^\prime $ and $\mathcal{I}_i^\prime$ in order to disqualify the pruned instance maps $\mathcal{I}^\prime$. We apply the following conditions to filter instance maps: (a) The total number of instances is less than $\xi$ (b) The total saliency captured by the pruned instance mask is greater than $\ell$ compared to the fixation map (c) The ratio of background vs salient instances satisfies a certain threshold $\gamma$.
\begin{table}[H]
\vspace{-0.4cm}
\begin{algorithm}[H]
\caption{\textcolor{violet}{Prune} Instance Mask }\label{prune}
\begin{algorithmic}[1]
\Function{\color{red}\textbf{Prune}}{$\mathcal{I}_i, \mathcal{F}_i^\prime, \mathbb{R}, \alpha_1, \alpha_2$}
\Comment{instance map $\mathcal{I}_i$, fixation $\mathcal{F}_i^\prime$}
\For{\texttt{each instance $ \chi \in \mathcal{I}_i$}}
\If{$ \text{size}(\chi) > \alpha_1 $ or $\mathbb{R}_\chi < \alpha_2$ }
\State remove instance $\chi$
\EndIf
\EndFor
\State return pruned instance mask $\mathcal{I}_i^\prime$
\EndFunction
\end{algorithmic}
\label{alg:rankin2g}
\end{algorithm}
\vspace{-0.5cm}
\end{table}
Table \ref{table:thres} demonstrates the set of parameters used to generate both versions of the proposed ground-truth labels. If an instance map meets all of the three conditions, \textcolor{violet}{we assign relative salience to each instance based on their rank score}. Note that we propose two different strategies (relative and absolute) to assign a numeric rank in a range of [0, 255] and this is briefly described in Sec~\ref{sec:salience_assignment}.
\begin{table}[h]
\vspace{-0.1cm}
\caption{ The set of parameters used in our process. In version II, we specifically tighten $\ell$ and $\alpha_2$ to obtain more clean and reliable annotations. }
\vspace{-0.3cm}
\centering
\resizebox{0.48\textwidth}{!}{
\begin{tabular}{ccccccccccccccc}
\specialrule{1.1pt}{1pt}{1pt}
\multicolumn{15}{c}{\color{black}COCO-SalRank } \\
\specialrule{1.2pt}{1pt}{1pt}\
&\multicolumn{5}{c}{version I (noisy) } && \multicolumn{7}{c}{version II (clean) } \\
$\sigma$ & $\mu$ & $\xi$ & $\ell$ & $\gamma$ & $\alpha_1$ & $\alpha_2$ && $\sigma$ & $\mu$ & $\xi$ & $\ell$ & $\gamma$ & $\alpha_1$ & $\alpha_2$ \\
\cline{1-7} \cline{9-15}
10.5 & 80& 5& \color{blue}0.4& 0.65& 0.4 &\color{red} 0.7 && 10.5 & 80& 5& \color{blue}0.7& 0.65& 0.4 & \color{red}0.9\\
\specialrule{1.2pt}{1pt}{1pt}
\end{tabular}}
\label{table:thres}
\vspace{-0.4cm}
\end{table}
\subsection{Dataset Analysis}
We mention \textcolor{violet}{earlier (Sec.~\ref{des})} that our dataset is more suitable for saliency ranking than existing saliency detection datasets. It is evident that it is mandatory to have multi-user agreement to assign a rank score for individual salient instances. In what follows, we discuss a few aspects of the proposed dataset and ranking algorithm, and their justification.
\noindent \textbf{Effect of Blurring and instance size in ranking? }\\
As mentioned prior \textcolor{violet}{(Sec.~\ref{des})}, we use instance maps from MS-COCO and the \textcolor{black}{mouse-based fixation} locations from SALICON in order to generate ranking labels. For each instance in an instance map, we calculate a score that represents the degree of saliency for that instance. A natural approach to calculate the rank score is to compute the amount of saliency that an instance captures. However, larger objects tend to capture more fixations than smaller objects which implies that larger objects may be implicitly biased towards having a higher rank order compared to smaller ones. Therefore, the size of the object is a key deciding factor in the process of calculating the ranking score for each object. Furthermore, the degree of Gaussian burring of the fixation locations also influences the amount of saliency that an instance may capture and as noted, has a proximity effect in relation to object instances and is also influenced by the undefined boundary region.
\begin{figure}[H]
\vspace{-0.2cm}
\centering
\setlength\tabcolsep{0.9pt}
\def0.3{0.8}
\resizebox{0.48\textwidth}{!}{
\begin{tabular}{c}
\begin{tabular}{ c c c c c}
\fcolorbox{red}{red} {\includegraphics[width=0.12\textwidth]{images/2/pascal_anlysis/pascal_rank_gaus/15_image.png}}&
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/2/pascal_anlysis/pascal_rank_gaus/15_saliency_gt.png}}&
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/2/pascal_anlysis/pascal_rank_gaus/15_image_gt.png}}&
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/2/pascal_anlysis/pascal_rank_gaus/15_rank_new_saliency_gaus_1.png}}&
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/2/pascal_anlysis/pascal_rank_gaus/15_rank_gaus_1.png}} \\
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/2/pascal_anlysis/pascal_rank_gaus/218_image.png}}&
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/2/pascal_anlysis/pascal_rank_gaus/218_saliency_gt.png}}&
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/2/pascal_anlysis/pascal_rank_gaus/218_image_gt.png}}&
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/2/pascal_anlysis/pascal_rank_gaus/218_rank_new_saliency_gaus_1.png}}&
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/2/pascal_anlysis/pascal_rank_gaus/218_rank_gaus_1.png}} \\
image & Fixation GT&Rank GT& Fixation (ours)& ours\\
\end{tabular}
\end{tabular}}
\caption{Qualitative comparison for ground-truth annotation using our algorithm for the PASCAL-S dataset. \textcolor{violet}{ Relative rank is indicated by the assigned color and number on each salient instance.}}
\label{fig:pascals_annot}
\vspace{-0.2cm}
\end{figure}
In order to examine how the size of each instance and the blurring of fixation locations might sway the rank for each instance, and to investigate the possible ways to integrate these variables in the calculation of the ranking score, we measure the impact of the ranking parameters against the PASCAL-S dataset since it provides both fixation locations and the manually chosen rank of salient objects annotated by multiple observers. In other words, we use the simulated mouse-based fixation locations and the segmentation masks provided by the PASCAL-S dataset to generate our ranking label which is compared against the ranking labels provided by the PASCAL-S dataset (see Fig.~\ref{fig:pascals_annot}). We compute each instance ranking score according to equation \ref{eq:eq1}.
\noindent We first examine the effect of changing $\alpha$ by fixing the Gaussian blurring filter size to $\mu=80$ and the standard deviation $\sigma = 10.5$. We change the value of $\alpha$ and calculate the Salient Object Ranking (SOR)~\cite{cvpr18_rank} score between the predicted and the ground truth ranking label provided by PASCAL-S as shown in Table~\ref{table:blur}.
\begin{table}[H]
\vspace{-0.2cm}
\caption{ The impact of applying different power $\alpha$, filter size $\mu$, standard deviation $\sigma$ on ranking performance. Note that in the right set, we fix $\alpha =0.3$ and use the filter size equivalent to $\mu = \sigma \times 7$ whereas in left set we fix both $\mu = 80, \sigma= 10.5$ }
\vspace{-0.2cm}
\centering
\resizebox{0.49\textwidth}{!}{
\begin{tabular}{c|c|c|c|c|c|c}
\specialrule{1.1pt}{1pt}{1pt}
\multirow{1}{*}{ \textbf{$\alpha$}}& 1 & 0.6& 0.4 &0.3& 0.2& 0.1 \\
\hline
\multirow{1}{*}{ \textbf{SOR}}& 0.76& 0.86& 0.89& 0.90& 0.88& 0.87 \\
\specialrule{1.1pt}{1pt}{1pt}
\end{tabular}
\begin{tabular}{c|c|c|c|c|c}
\specialrule{1.1pt}{1pt}{1pt}\
\multirow{1}{*}{ $\sigma$}& 5& 13& 21& 29 &37 \\
\hline
\multirow{1}{*}{ \textbf{SOR}}& 0.89& 0.89& 0.88& 0.87& 0.86 \\
\specialrule{1.1pt}{1pt}{1pt}
\end{tabular}
}
\label{table:blur}
\vspace{-0.2cm}
\end{table}
\noindent Similarly, we examine the Gaussian burring effect by fixing the power $\alpha = 0.3$ and changing the standard deviation of the Gaussian blurring $\sigma$. Note that the filter size corresponding to a specific $\sigma$ in Table \ref{table:blur} is $\mu = \sigma *7$. We found empirically that a Gaussian burring filter size $\mu=80$, the standard deviation $\sigma = 10.5$, and $\alpha = 0.3$ tends to correspond to the set of conditions for which fixations best determine manually chosen rankings (based on SOR score for PASCAL-S). Thus, we apply these values as our threshold while generating ground truth for our proposed COCO-SalRank dataset. Fig. \ref{fig:blur} further demonstrates both of those effects.
\noindent \textcolor{violet}{\textbf{Distribution of Ranking among Images:}}
\noindent \textcolor{violet}{The distribution of the images in COCO-SalRank dataset with respect to differing salient object rank order is shown in Table~\ref{table:dis_rank}. It is an evident from the table that, there is a considerable number of images with more than one salient object which is ideal for a saliency ranking problem.}
\begin{table}[H]
\vspace{-0.3cm}
\caption{ \textcolor{violet}{Distribution of images corresponding to different rank order of salient objects on the COCO-SalRank dataset.} }
\vspace{-0.3cm}
\centering
\resizebox{0.48\textwidth}{!}{
\begin{tabular}{ccccccccccc}
\specialrule{1.2pt}{1pt}{1pt}
\multicolumn{5}{c}{version I - \textbf{10,410}} && \multicolumn{5}{c}{version II - \textbf{4,433}} \\
1 & 2 &3 & 4 & 5 && 1 & 2 &3 & 4 & 5 \\
\cline{1-5} \cline{7-11}
1080 & 3058 & 3162 & 2097 & 1013 && 708 & 1732 & 1304 & 556 & 133 \\
\specialrule{1.2pt}{1pt}{1pt}
\end{tabular}}
\label{table:dis_rank}
\vspace{-0.2cm}
\end{table}
\noindent\textcolor{violet}{ \textbf{Size vs Rank Distribution:} According to~\cite{li2014secrets}, the size of an instance-level salient object can be defined as the proportion of pixels in the image. As shown in Fig.~\ref{fig:sizevsrank}, the rank of salient instances in our COCO-SalRank varies significantly. The large-scale instances are likely to have higher rank compared to the medium-sized or smaller-sized instances.} \\
\begin{figure} [t]
\centering
\setlength\tabcolsep{1.0pt}
\resizebox{0.49\textwidth}{!}{
\begin{tabular}{*{2}{c }}
\includegraphics[width=0.24\textwidth]{figures/rank_size_1_p.pdf}&
\includegraphics[width=0.24\textwidth]{figures/rank_size_2_p.pdf}\\
\end{tabular}}
\caption{\textcolor{violet}{The distribution of instance size according to their associated ranks on the COCO-SalRank dataset. Left : version I, Right: version II.}}
\label{fig:sizevsrank}
\vspace{-0.4cm}
\end{figure}
\noindent \textbf{Bias in Data Driven Saliency Annotation:} \textcolor{violet}{The proposed saliency ranking dataset is data-driven and primarily based on the fixation annotations derived from the MS-COCO and SALICON. We know that the data-driven saliency annotation results will be influenced by the annotators whose choices may depend on a variety of factors including at least (culture, gender, background, prior experience). It is a challenge to control for these effects, and this implies that any dataset will always carry some inherent biases that are not image dependent. Related to this, the selection images, and associated rankings for the COCO-SalRank is based on parameters obtained from the PASCAL-SR dataset. An implication of this is that biases in the source data may transfer to the generated dataset. Moreover, one needs to exercise care in considering whether base characteristics of the datasets are similar in terms of masks, source data and fixations derived behaviour. To this end, we examine characteristics of the two datasets, and assigned salient regions to satisfy ourselves that they share similar characteristics. While any base biases may be transferred, this is intrinsic to the data collection process and unavoidable. With that said, we can take some measures to consider what impact any such bias may have insofar as it interacts with the target dataset. To this end, we include a variety of analysis and statistics in Table~\ref{table:bias} that reveals characteristics of selected salient regions, and also sensitivity to number of annotators in deriving the target data from the source data. From Table~\ref{table:bias}, we observe that there is a high correlation in ranking between the original ground truth and one produced when we randomly remove some annotators. This speaks to questions such as the extent to which size of objects matters (which we also examine in Fig. \ref{fig:sizevsrank}), correlation between gaze and object ranking across datasets, and the validity of normalization parameters which seem to be relatively stable even as the number of annotators is artificially suppressed.}
\begin{table}[h]
\vspace{-0.3cm}
\caption{Average SOR for five trials on PASCAL-SR dataset where in each trial we randomly remove annotations provided by $\mathcal{Y}$ annotators.}
\vspace{-0.3cm}
\centering
\resizebox{0.48\textwidth}{!}{
\begin{tabular}{c|cccccccccc}
\specialrule{1.1pt}{1pt}{1pt}
$\mathcal{Y}$&1&2&3&4&5&6&7&8&9&10 \\
\midrule
SOR$_\text{avg}$ & 0.967 &0.968&0.955&0.966&0.958&0.957&0.963&0.953&0.942& 0.931\\
\specialrule{1.2pt}{1pt}{1pt}
\end{tabular}}
\label{table:bias}
\vspace{-0.5cm}
\end{table}
\subsection{Relative and Absolute Salience Assignment} \label{sec:salience_assignment}
\textcolor{violet}{The existing dataset (Pascal-S~\cite{li2014secrets}) contains} information that allows for implicit assignment of relative salience based on agreement among multiple observers while in our case we propose to assign rank value under two different settings (\textit{Relative} and \textit{Absolute}). In the relative setting, we assign rank value based on total number of instances in the mask and their rank score, $\mathbb{R}_\chi$ where $\chi$ is a particular instance. For example, if we have total $\tau$ number of instances in the mask, we divide the range [0, 255] by $\tau$ to obtain the numeric rank value. While in the absolute case, rank values are assigned based on the percentile of the rank score set and then re-scaled to the range [50 255] which corresponds to [20\% - 100\%] of the gray-scale levels. Similar to~\cite{cvpr18_rank}, we generate a stack representation of the ground truth where each stack consists of five slices since a cap of five objects is set in filtering to avoid over-segmentation. For the relative case, the first slice of the stack contains the most salient object, the second slice contains the top two salient objects and so on. However, for the absolute case, the first slice accounts for less than 20\% of the fixations, the second one accounts for less than 40\% of the fixations, and so on.
\begin{equation}\label{eq:stack_gt1}
\mathcal{R}_{\vartheta} =
\begin{bmatrix} R_i \\ \includegraphics[width=0.05\textwidth]{images/2/stack_slice/im_2_relative_slice_1} \end{bmatrix}
\begin{bmatrix} R_{i+1} \\ \includegraphics[width=0.05\textwidth]{images/2/stack_slice/im_2_relative_slice_2} \end{bmatrix}
\begin{bmatrix} R_{i+2} \\ \includegraphics[width=0.05\textwidth]{images/2/stack_slice/im_2_relative_slice_3} \end{bmatrix}
\begin{bmatrix} R_{i+3} \\ \includegraphics[width=0.05\textwidth]{images/2/stack_slice/im_2_relative_slice_4} \end{bmatrix}
\begin{bmatrix} R _{i+4} \\ \includegraphics[width=0.05\textwidth]{images/2/stack_slice/im_2_relative_slice_5} \end{bmatrix}
\end{equation}
\begin{equation}\label{eq:stack_absolute}
\mathcal{A}_{\vartheta} =
\begin{bmatrix} A_i \\ \includegraphics[width=0.05\textwidth]{images/2/stack_slice/im_2_absolute_slice_1} \end{bmatrix}
\begin{bmatrix} A_{i+1} \\ \includegraphics[width=0.05\textwidth]{images/2/stack_slice/im_2_absolute_slice_2} \end{bmatrix}
\begin{bmatrix} A_{i+2} \\ \includegraphics[width=0.05\textwidth]{images/2/stack_slice/im_2_absolute_slice_3} \end{bmatrix}
\begin{bmatrix} A_{i+3} \\ \includegraphics[width=0.05\textwidth]{images/2/stack_slice/im_2_absolute_slice_4} \end{bmatrix}
\begin{bmatrix} A_{i+4} \\ \includegraphics[width=0.05\textwidth]{images/2/stack_slice/im_2_absolute_slice_5} \end{bmatrix}
\end{equation}
The stacked representation of the ground-truth in relative and absolute settings are shown in Eq.~\ref{eq:stack_gt1} and Eq.~\ref{eq:stack_absolute} respectively. As shown in this example (in the case of five ranked instances), a new instance is added to each slice in the relative case, whereas, multiple instances may be added at once in the absolute case if they reside within the same percentile rank.
\subsubsection{Ranking Mechanism}
As saliency ranking is a newly proposed problem, there is no universally agreed upon metric to obtain the rank order of salient instances. We start with the metric proposed in our earlier work~\cite{cvpr18_rank} and explore a few alternatives ranking mechanisms. Firstly, rank order of a salient instance is obtained by averaging the degree of saliency within that instance mask. Then we propose to assign the rank order from an output saliency map by dividing the total degree of saliency within an instance to its size raised to a certain power. Finally, we obtain the rank order by taking the max value of the saliency within the instance region. These considerations relate to the earlier observations concerning the size-saliency tradeoff and its relation to ranking. We can write these metrics as follows:
\begin{equation} \text{Rank} = \left\{
\begin{array}{ll}
\text{SOR}_\text{avg} (\mathcal{S} (\delta)) = &\frac{\sum_{i=1}^{\rho_\delta} \delta(x_i, y_i)}{\rho_\delta}\\
\text{SOR}_\text{pow} (\mathcal{S} (\delta); \alpha) = &\frac{\sum_{i=1}^{\rho_\delta} \delta(x_i, y_i)}{\rho_\delta^\alpha} \\
\text{SOR}_\text{max} (\mathcal{S} (\delta)) = &\text{max} ( \delta(x_i, y_i)) \\
\label{eq:eq1}
\end{array}
\right.
\end{equation}
where $\delta$ represents a particular instance of the predicted saliency map (${S}$), $\alpha$ is set to 0.3, $\rho_\delta$ denotes total numbers of pixels $\delta$ contains, and $\delta(x_i, y_i)$ refers to saliency score for the pixel $(x_i, y_i)$.
\begin{figure}[t]
\centering
\setlength\tabcolsep{1.0pt}
\def0.3{0.9}
\resizebox{0.49\textwidth}{!}{
\begin{tabular}{c}
\begin{tabular}{ c c c }
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking_ours_2/im_62_im.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking_ours_2/im_62_saliency.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking_ours_2/im_62_image.png}}\\
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking_ours_2/im_2188_im.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking_ours_2/im_2188_saliency.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking_ours_2/im_2188_image.png}}\\
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking_ours_2/im_1905_im.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking_ours_2/im_1905_saliency.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking_ours_2/im_1905_image.png}}\\
image & fixation & gt \vspace{0.1cm}\\
\end{tabular}
\hspace{0.001cm}
\begin{tabular}{ c c c }
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking_ours_2/im_2185_im.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking_ours_2/im_2185_saliency.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking_ours_2/im_2185_image.png}}\\
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking_ours_2/im_2356_im.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking_ours_2/im_2356_saliency.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking_ours_2/im_2356_image.png}}\\
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking_ours_2/im_934_im.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking_ours_2/im_934_saliency.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking_ours_2/im_934_image.png}}\\
image & fixation & gt \vspace{0.1cm}\\
\end{tabular}
\end{tabular}}
\caption{Qualitative illustration of obtained ground-truth samples on COCO-SalRank dataset (noisy version). \textcolor{violet}{Relative rank is indicated by the assigned color and number on each salient instance}. The consistency among \textcolor{black}{simulated mouse-based fixation maps} and ground-truth ranking shows good agreement and an intuitive ranking for our proposed dataset.}
\label{fig:cocosalrank_gt}
\vspace{-0.2cm}
\end{figure}
\subsection{Qualitative Examples of COCO-SalRank Dataset}
Fig.~\ref{fig:cocosalrank_gt} depicts visual examples of generated saliency ranking ground-truth on the COCO-SalRank dataset with respect to fixation maps. It is an evident that our algorithm produces ground-truth maps that have an intuitive correspondence with rank and that are consistent with fixation maps in various challenging cases.
\subsection{Challenging Saliency Ranking Cases}
Despite the consistent ground-truth quality for the majority of cases; there are samples that are especially challenging to assign rank order by algorithmic means (see Fig.~\ref{fig:cocosalrank_failure}). Sometimes, fixations are distributed among multiple objects which makes the ranking task challenging. Other failures of ranking happen when a higher ranked object overlaps with or exists close to a less salient object. In that case, the lower ranked object receives some attention attributed to fixations from the higher ranked instance. An additional challenge is the lack of consistency in instance-wise labeling in MS-COCO.
\begin{figure}[h]
\vspace{-0.1cm}
\centering
\setlength\tabcolsep{1.0pt}
\def0.3{0.8}
\resizebox{0.49\textwidth}{!}{
\begin{tabular}{c}
\begin{tabular}{ c c c }
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/failure_ours/5/im_2947_im.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/failure_ours/5/im_2947_saliency.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/failure_ours/5/im_2947_image.png}}\\
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/failure_ours/5/im_202_im.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/failure_ours/5/im_202_saliency.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/failure_ours/5/im_202_image.png}}\\
image & fixation & gt \vspace{0.1cm}\\
\end{tabular}
\hspace{0.04cm}
\begin{tabular}{ c c c ccc}
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/failure_ours/5/im_134_im.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/failure_ours/5/im_134_saliency.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/failure_ours/5/im_134_image.png}}&&&
\multirow{2}{*}[1.42cm]{\includegraphics[width=0.031\textwidth]{figures/jet-v.pdf}}\\
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/failure_ours/5/im_2211_im.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/failure_ours/5/im_2211_saliency.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/failure_ours/5/im_2211_image.png}}&&&\\
image & fixation & gt \vspace{0.1cm}\\
\end{tabular}
\end{tabular}}
\caption{Shown are some illustrative examples of inconsistency among simulated mouse-based fixation maps and the generated ground-truth ranking on COCO-SalRank dataset. These cases are most common for overlapping instances, and for scenes with fixations spread over multiple salient objects. \textcolor{violet}{Assigned colors and numbers indicate the relative rank of each salient instance.}}
\label{fig:cocosalrank_failure}
\vspace{-0.5cm}
\end{figure}
\section{Background}\label{sec:background}
\subsection{Salient Object Detection:}
Convolutional Neural Networks (CNNs) have raised the bar in performance for many problems in computer vision including salient object detection. CNN based models are able to extract more representative and complex features than hand crafted features used in less contemporary work \cite{li2013saliency,yan2013hierarchical,kim2014salient} which has promoted widespread adoption.
Some CNN based methods exploit superpixel and object region proposals to achieve accurate salient object detection \cite{hu2017deep,li2016deep,lee2016deep,li2016deepsaliency,zhao2015saliency,li2015visual}. Such methods follow a multi-branch architecture where a CNN is used to extract semantic information across different levels of abstraction to generate an initial saliency prediction. Subsequently, new branches are added to obtain superpixels or object region proposals, which are used to improve precision of the predictions.
As an alternative to superpixels and object region proposals, other methods~\cite{luo2017non,hou2016deeply,amulet_2017} predict saliency per-pixel by aggregating multi-level features. Luo et al. \cite{luo2017non} integrate local and global features through a CNN that is structured as a multi-resolution grid. Hou et al.~\cite{hou2016deeply} implement stage-wise short connections between shallow and deeper feature maps for more precise detection and inferred the final saliency map considering only middle layer features. Zhang et al.~\cite{amulet_2017} combine multi-level features as cues to generate and recursively fine-tune multi-resolution saliency maps which are refined by boundary preserving refinement blocks and then fused to produce final predictions.
Other methods~\cite{liu2016dhsnet,wang2016saliency,ucf_2017,islam2017salient} use an end-to-end encoder-decoder architecture that produces an initial coarse saliency map and then refines it stage-by-stage to provide better localization of salient objects. Liu and Han \cite{liu2016dhsnet} propose a network that combines local contextual information step-by-step with a coarse saliency map. Wang et al. \cite{wang2016saliency} propose a recurrent fully convolutional network for saliency detection that includes priors to correct initial saliency detection errors. Zhang et al.~\cite{ucf_2017} incorporate a reformulated dropout after specific convolutional layers to quantify uncertainty in the convolutional features, and a new upsampling method to reduce artifacts of deconvolution which results in a better boundary for salient object detection.
In contrast to the above described approaches, we achieve spatial precision through stage-wise refinement by applying novel mechanisms to control information flow through the network while also importantly including a \emph{stacking} strategy that implicitly carries the information necessary to determine relative saliency.
\subsection{Universal Saliency Detection Benchmarks}
\textcolor{violet}{There has long been growing interest in cognitive science disciplines to understand where people look and direct their gaze while interacting with complex indoor or outdoor scenes~\cite{bruce2015computational}. This can be examined by direct measurement of gaze, or by manual selection of important regions, with the latter presenting a situation less prone to low-level biases including centre-bias and those derived from oculomotor constraints~\cite{bruce2015computational}}. Predictive models that address both of these processes have been defined as visual saliency detection. However, in the selection task (as with free-viewing gaze), there is no universal agreement on what constitutes a salient object when opinions are elicited from multiple observers. Until very recently~\cite{cvpr18_rank,Islam2018SemanticsMS}, the literature has failed to acknowledge this nuance of salient object detection. A large number of proposals have been made on methods for predicting salient targets; these studies focus on a binary prediction of a \emph{universal saliency} label that considers \textcolor{violet}{salient objects}~\cite{amulet_2017,ucf_2017,he2017delving,hou2016deeply,wang2016saliency,wang2017stagewise,hu2017deep,li2016deep,lee2016deep,liu2016dhsnet,zhao2015saliency,li2015visual}. \textcolor{violet}{Other studies~\cite{jia2015adaptive,najibi2017towards,zhang2016unconstrained} detect salient objects with multiple bounding boxes but do not consider the variability that may exist across humans in deciding what is salient}. In deference to the apparently deeper problem definition that may be attached to salient object detection, our work~\cite{cvpr18_rank} extended the traditional problem to consider salient object ranking. However, given that this implies a distinct problem domain, there are limitations on what data is currently available for training and/or testing models and the extent of benchmarking that has been carried out.
Several saliency detection~\cite{yan2013hierarchical,shi2013pisa,yang2013saliency,li2014secrets,jiang2015salicon} or eye tracking~\cite{jiang2015salicon} datasets have been \textcolor{violet}{created} and shared with the community to promote saliency research. The majority of these datasets share common features in providing ground-truth annotation as a binary mask (background vs salient object) assigned to each image that is based on one observer, or subject to a threshold when a few opinions are present. Currently, only the Pascal-S dataset is widely available for addressing the saliency ranking problem (with suitable post-processing as in PASCAL-SR) as it provides ground-truth corresponding to multiple observer's agreement across 12 observers. In order to progress further in addressing this problem, there is a dire need for larger-scale datasets to provide a stronger set of data for training and evaluating models. Pascal-S provides ground-truth that implicitly captures relative salience, but only for $\approx$ 1000 examples. The current emphasis on, and success of deep learning architectures generally requires large-scale datasets that implies an even greater need for alternative datasets and suitable benchmark results and metrics. Moreover, the array of current saliency detection datasets is heavily entrenched in the traditional problem definition and associated experimental analysis. We therefore seek to allow research efforts on this problem to rapidly progress, in ensuring availability of large-scale data that serves to improve saliency ranking performance among models, and to allow for immediate adoption of solutions that explore new research directions in assessing \emph{relative saliency} as well as complementing existing datasets and the historical legacy of work in this area.
Obtaining ground-truth by manual labeling is crucial for computer vision applications. Amazon Mechanical Turk (AMT) has been used extensively for labeling large-scale datasets in distributing the labeling task among many human annotators. The crowdsourcing approach has been directed to different tasks that derive desired output labels from human annotation (e.g. assigning a category label, segmenting objects, providing bounding boxes). In this paper, we propose a novel approach to provide a benchmark dataset which involves a hybrid of algorithmic coalescence of multiple disparate labels from common datasets (MSCOCO~\cite{lin2014microsoft}), with optional refinement by a human as a secondary stage. This approach is validated by comparing rank-order assignments with the smaller extant alternative dataset that has exact labels. In this light, this produces not only a dataset, but also algorithmic means for converting other suitable datasets in a similar fashion provided instance level segmentation and a guiding signal such as gaze is present.
\begin{figure*}[t]
\centering
\includegraphics[width=0.99\textwidth]{figures/network/network_cvpr2018_2.pdf}
\vspace{-0.3cm}
\caption{Illustration of our proposed network architecture. In the encoder network \textcolor{violet}{($f_{enc}$)}, the input image is processed with a feed-forward encoder to generate a coarse nested relative salience stack ($\mathcal{S}_\vartheta^t$). We append a Stacked Convolutional Module (SCM) on top of $\mathcal{S}_\vartheta^t$ to obtain a coarse saliency map $\mathcal{S}_m^t$. Then, a stage-wise refinement network, comprised of rank-aware refinement units \textcolor{violet}{($\mathcal{R}_\vartheta^1, \mathcal{R}_\vartheta^2,..., \mathcal{R}_\vartheta^4 $)} (dotted box in the figure), successively refines each preceding NRSS ($\mathcal{S}_\vartheta^t$) and produces a refined NRSS ($\mathcal{S}_\vartheta^{t+1}$). A fusion layer combines predictions from all stages to generate the final saliency map ($\mathcal{S}_m^T$). We provide supervision ($\Delta_{S_{\vartheta}}^t$, $\Delta_{S_m}^t$) at the outputs ($\mathcal{S}_\vartheta^t$, $\mathcal{S}_m^t$) of each refinement stage. The architecture based on iterative refinement of a stacked representation is capable of effectively detecting multiple salient objects and their rank.}
\label{fig:network}
\vspace{-0.2cm}
\end{figure*}
\textcolor{violet}{The groundwork for some of what is presented in this paper appeared previously~\cite{cvpr18_rank}, in which we introduced the saliency ranking problem along with an effective deep learning solution (RSDNet~\cite{cvpr18_rank})}. This presents a deeper problem than traditional salient object detection. In this work, we specifically emphasize promoting rapid progress in this domain by providing new state-of-the-art baseline scores, a new benchmark dataset and highlight guidelines for data creation and nuances critical to producing a dataset of value to addressing the problem. This is also accompanied by in depth analysis of datasets, characteristics of saliency ranking, and considerations going forward. This presents another significant contribution that will provide stronger capabilities for models and guidance on model success advancing progress in the field related to this problem.
\section{Conclusion}\label{sec:conclude}
In this paper, we have presented a neural framework for detecting and ranking multiple salient objects that includes a stack refinement mechanism to achieve better performance. Central to the success of this approach, is how to represent relative saliency both in terms of ground truth, and \textit{in network} in a manner that produces stable performance. We highlight the fact that to date, salient object detection has assumed a relatively limited, and sometimes inconsistent problem definition. Comprehensive experiments demonstrate that the proposed architecture outperforms state-of-the-art approaches across a broad gamut of metrics.
In addition to this, we have considered the problem of saliency ranking from a data driven standpoint and in doing so have presented a large scale benchmark dataset for saliency ranking. We have also introduced a novel set of methods that make use of existing gaze or related data paired with object annotations to generate large-scale rank-ordered data for salient objects. We validate the proposed benchmark by applying state-of-the-art saliency models, and demonstrate the value of a nested representation in defining a relative ranking. We also show that \textcolor{violet}{models trained on our proposed dataset achieve higher ranking performance compared to PASCAL-SR}.
Many interesting research questions arise from the approach and results presented in this paper. One avenue for further investigation is to inspect different representations of the ground truth stack and their impact on the overall performance of both saliency ranking and detection tasks. Another interesting avenue to examine is how to assign rank order based on the predicted saliency maps accounting for characteristics such as instance size, object scale and other characteristics. Additionally, \textcolor{violet}{performance on traditional saliency object detection datasets has largely saturated. Further exploration of different methods to assign rank order will be a fruitful path for further research, and this paper along with the work it builds on provides a solid foundation for future efforts targeting the problem of salient object detection.}
\section{Experimental Results}\label{sec:exp}
The core of our model follows a structure based on ResNet-101~\cite{He2015} with pre-trained weights to initialize the encoder portion.
\textcolor{violet}{ The network is trained using stochastic gradient descent for 20k iterations with momentum of 0.9, weight decay of 0.0005 and the ``poly'' learning rate policy. Testing uses the full resolution image while training relies on random cropping for memory savings.}
A few variants of the basic architecture are proposed, and we report numbers for the following variants that are described in what follows:
\noindent \textbf{RSDNet:} This network includes dilated ResNet-101~\cite{chen2016deeplab} + NRSS + SCM.
\textbf{RSDNet-A:} This network is the same as RSDNet except the ground-truth is scaled by a factor of 1000, encouraging the network to explicitly learn deeper contrast. \textbf{RSDNet-B:} The structure follows RSDNet except that an \textcolor{violet}{atrous pyramid pooling module~\cite{chen2016deeplab} is applied to get NRSS prediction}. \textbf{RSDNet-C:} RSDNet-B + the ground-truth scaling. \textbf{RSDNet-R:} RSDNet with stage-wise rank-aware refinement units + multi-stage saliency map fusion.
\textcolor{violet}{Additionally, we experiment with DeepLabv2-VGG~\cite{chen2016deeplab} and PSPNet~\cite{zhao2017pyramid} networks paired with NRSS to establish initial baselines for our proposed COCO-SalRank dataset. It is worth noting that the inclusion of NRSS at the end of the network architectures allows any model to be trained for the saliency ranking task.}
\subsection{Datasets and Evaluation Metrics}\label{sec:dataset}
\noindent \textbf{Datasets:} We report experimental results on \textcolor{violet}{PASCAL-SR (extended version of publicly available PASCAL-S)} and our proposed COCO-SalRank datasets. The PASCAL-SR dataset includes 850 natural images with multiple complex objects derived from the PASCAL VOC 2012 validation set~\cite{everingham2010pascal}. We randomly split the PASCAL-SR dataset into two subsets (425 for training and 425 for testing). In this dataset, salient object labels are based on an experiment using 12 participants to label salient objects. Virtually all existing approaches for salient object segmentation or detection threshold the ground-truth saliency map to obtain a binary saliency map. This operation seems somewhat arbitrary since the threshold can require consensus among $k$ observers, and the value of $k$ varies from one study to another. This is one of the most highly used salient object segmentation datasets, but is unique in having multiple explicitly tagged salient regions provided by a reasonable sample size of observers. Since a key objective of this work is to rank salient objects in an image, we use the original ground-truth maps (each pixel having a value corresponding to the number of observers that deemed it to be a salient object) rather than trying to predict a binary output based on an arguably contentious thresholding process.
\\
\noindent \textbf{Evaluation Metrics:}
For the multiple salient object detection task, we use five different metrics to measure performance including precision-recall (PR) curves, F-measure (maximal along the curve), S-measure~\cite{fan2017structure}, Area under ROC curve (AUC), and mean absolute error (MAE). Since some of these rely on binary decisions, we threshold the ground-truth saliency map based on the number of participants that deem an object salient, resulting in 12 binary ground truth maps. For each binary ground truth map, multiple thresholds of a predicted saliency map allow for calculation of the true positive rate (TPR), false positive rate (FPR), precision and recall, and corresponding ROC and PR curves. Given that methods that predate this work are trained based on varying thresholds and consider a binary ground truth map, scores are reported based on the binary ground truth map that produces the best AUC or F-measure score (and the corresponding curves are shown). Max F-measure and average F-measure are also reported to provide a sense of how performance varies as a function of the threshold chosen. We also report the MAE score i.e. the average pixel-wise difference between the predicted saliency map and the binary ground-truth map that produces the minimum score. \textcolor{violet}{S-measure computes the structural similarity between the predicted and ground-truth saliency map}.
In ordered to evaluate the rank order of salient objects, we introduce the \textit{Salient Object Ranking} (SOR) metric which is defined as the Spearman's Rank-Order Correlation between the ground truth rank order and the predicted rank order of salient objects. SOR score is normalized to [0 1] for ease of interpretation. Scores are reported based on the average SOR score for each method considering the whole dataset.
\subsection{Performance Comparison with State-of-the-art}
The problem of evaluating salient detection models is challenging in itself which has contributed to differences among benchmarks that are used. In light of these considerations, the specific evaluation we have applied to all the methods aims to remove any advantages of one algorithm over another. We compare our proposed method with recent state-of-the-art approaches, including \textcolor{violet}{PAGRN~\cite{zhang2018progressive}, RAS~\cite{chen2018reverse}, Amulet~\cite{amulet_2017}, UCF~\cite{ucf_2017}, DSS~\cite{hou2016deeply}, NLDF \cite{luo2017non}, DHSNet~\cite{liu2016dhsnet}, MDF~\cite{li2015visual}, ELD \cite{lee2016deep}, and MTDS~\cite{li2016deepsaliency}}. For fair comparison, we build the evaluation code based on the publicly available code provided in \cite{li2013contextual} and we use saliency maps provided by authors of models compared against, or by running their pre-trained models with recommended parameter settings.
\begin{table}[t]
\caption{Quantitative comparison of methods using metrics including AUC, F-measure (max, average), MAE, average S-measure, and SOR \textcolor{violet}{on PASCAL-SR dataset}. The best three results are shown in red, brown and blue respectively.}
\vspace{-0.3cm}
\centering
\def0.3{1.2}
\resizebox{0.49\textwidth}{!}{
\begin{tabular}{l|c|c|c|c|c|c}
\specialrule{1.2pt}{1pt}{1pt}\
\multirow{1}{*}{$\ast$}& AUC& max-$F_m$ &avg-$F_m$ & MAE& avg-$S_m$ & SOR \\
\specialrule{1.2pt}{1pt}{1pt}
MDF~\cite{li2015visual}&0.892&0.787 & 0.730& 0.138&0.675& 0.768 \\
ELD~\cite{lee2016deep} &0.916 &0.789 & 0.774 &0.123 &0.752& 0.792 \\
MTDS~\cite{li2016deepsaliency}& 0.941&0.805 & 0.664 &0.176 & 0.737& 0.782\\
DHSNet~\cite{liu2016dhsnet} &0.927&0.837 & 0.833& 0.092&0.797&0.781 \\
NLDF~\cite{luo2017non}&0.933& 0.846 &0.836 & 0.099&0.793& 0.783\\
DSS~\cite{hou2016deeply}& 0.918& 0.841 & 0.830 & 0.099 &0.792& 0.770\\
AMULET~\cite{amulet_2017}& 0.957& 0.865& \color{red} \textbf{0.841} & 0.097 &0.817& 0.788\\
UCF~\cite{ucf_2017}&0.959& 0.858 & 0.813 & 0.123 &0.802& 0.792\\
RAS~\cite{chen2018reverse}&0.907& 0.841 & 0.828 & 0.101 &0.787& 0.774\\
PAGRN~\cite{zhang2018progressive} & 0.928 & 0.862 & \color{brown}\textbf{0.840} & \color{red}\textbf{0.089}& 0.811&0.828\\
\hline
\textbf{RSDNet} &\color{brown}\textbf{0.972}&0.873& 0.834 & \color{blue} \textbf{0.091} &\color{brown}\textbf{0.832}& 0.825 \\
RSDNet-\textbf{A} &\color{red}\textbf{0.973}&\color{blue} \textbf{0.874} &0.796& 0.103&0.823& 0.838 \\
RSDNet-\textbf{B} &0.969&\color{brown} \textbf{0.877} &0.831&0.100 & \color{blue} \textbf{0.828}&\color{blue} \textbf{0.840} \\
RSDNet-\textbf{C} &\color{brown} \textbf{0.972}&\color{blue} \textbf{0.874}&0.795&0.110&0.823&\color{brown} \textbf{0.848} \\
RSDNet-\textbf{R} &\color{blue}\textbf{0.971}&\color{red} \textbf{0.880} & \color{blue}\textbf{0.837} & \color{brown} \textbf{0.090} &\color{red}\textbf{0.836}& \color{red} \textbf{0.852} \\
\specialrule{1.2pt}{1pt}{1pt}
\end{tabular}}
\label{table:quant_pascals}
\vspace{-0.3cm}
\end{table}
\noindent \textbf{Quantitative Evaluation:}
Table~\ref{table:quant_pascals} shows the performance score of all the variants of our model, and other recent methods on salient object detection. It is evident that, RSDNet-R outperforms other recent approaches for \textcolor{violet}{most of the evaluation metrics including AUC, max F-measure and average S-measure}, which establishes the effectiveness of our proposed hierarchical nested relative salience stack. From the results we have few fundamental observations: (1) Our network improves the max F-measure by a considerable margin on the PASCAL-SR dataset which indicates that our model is general enough that it achieves higher precision with higher recall (see Fig.~\ref{fig:pr_curves_pascals}).
\begin{figure} [H]
\centering
\vspace{-0.2cm}
\setlength\tabcolsep{1.0pt}
\resizebox{0.45\textwidth}{!}{
\begin{tabular}{*{2}{c }}
\includegraphics[width=0.24\textwidth,height=3.64cm]{figures/ROC_pascalS.pdf}& \includegraphics[width=0.24\textwidth,height=3.64cm]{figures/PR_pascalS.pdf}\\
\end{tabular}}
\caption{ROC (Left) and Precision-Recall (Right) curves corresponding to different state-of-the-art methods \textcolor{violet}{on PASCAL-SR dataset}.}
\label{fig:pr_curves_pascals}
\vspace{-0.1cm}
\end{figure}
\noindent (2) \textcolor{violet}{Our model increases the average S-measure on the PASCAL-SR dataset and achieves higher area under the ROC curve (AUC) score compared to the baselines shown in Fig.~\ref{fig:pr_curves_pascals}.} (3) Although our model is only trained on a subset of PASCAL-SR, it significantly outperforms other algorithms that also leverage large-scale saliency datasets. Overall, this analysis hints at strengths of the proposed hierarchical stacked refinement strategy to provide a more accurate saliency map. In addition, it is worth mentioning that RDSNet-R outperforms all the recent deep learning based methods intended for salient object detection/segmentation without any post-processing techniques that are typically used to boost scores.
\noindent \textbf{Qualitative Evaluation:}
Fig.~\ref{fig:qual_pascals} depicts a visual comparison of RSDNet-R with respect to other state-of-the-art methods on the PASCAL-SR dataset. We can see that our method can predict salient regions accurately and produces output closer to ground-truth maps in various challenging cases e.g., instances touching the image boundary ($1^\text{st}$ row), multiple instances of same object ($2^\text{nd}$ row). The nested relative salience stack at each stage provides distinct representations to differentiate between multiple salient objects and allows for reasoning about their relative salience to take place.
\begin{figure}[H]
\begin{center}
\vspace{-0.1cm}
\setlength\tabcolsep{0.7pt}
\def0.3{0.2}
\resizebox{0.49\textwidth}{!}{
\begin{tabular}{*{11}{c c @{\hskip 0.04in}c @{\hskip 0.04in} c c c }}
\includegraphics[width=0.09\textwidth]{images/pred/201_image.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/201_GT.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/201_OURS_V2.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/201_UCF.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/201_AMULET.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/201_DSS.png}\\
\includegraphics[width=0.09\textwidth]{images/pred/796_image.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/796_GT.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/796_OURS_V2.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/796_UCF.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/796_AMULET.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/796_DSS.png} \\
\specialrule{0pt}{0pt}{1pt}\
\rowfont{\scriptsize} Image &\rowfont{\scriptsize} \rowfont{\scriptsize}GT &\rowfont{\scriptsize} RSDNet-R &\rowfont{\scriptsize} UCF~\cite{ucf_2017} &\rowfont{\scriptsize} Amulet~\cite{amulet_2017} &\rowfont{\scriptsize} DSS~\cite{hou2016deeply}
\end{tabular}}
\caption{Predicted salient object regions for the PASCAL-SR dataset. Each row shows outputs corresponding to different algorithms designed for the salient object detection/segmentation task.}
\label{fig:qual_pascals}
\end{center}
\vspace{-0.2cm}
\end{figure}
\subsection{Application: Ranking by Detection}
As salient instance ranking is a completely new problem, there is not existing benchmark. In order to promote this direction of studying this problem, we are interested in finding the ranking of salient objects from the predicted saliency map. Rank order of a salient instance is obtained by averaging the degree of saliency within that instance mask.
\begin{gather}
\text{Rank} (\mathcal{S}_m^{T} (\delta)) = \frac{\sum_{i=1}^{\rho_\delta} \delta(x_i, y_i)}{\rho_\delta}
\end{gather}
where $\delta$ represents a particular instance of the predicted saliency map (${S}_m^{T}$), $\rho_\delta$ denotes total numbers of pixels $\delta$ contains, and $\delta(x_i, y_i)$ refers to saliency score for the pixel $(x_i, y_i)$.
While there may exist alternatives for defining rank order, this is an intuitive way of assigning this score. With that said, we expect that this is another interesting nuance of the problem to explore further; specifically salience vs. scale, and part-whole relationships.
We use the provided instance-wise segmentation and predicted saliency map to calculate the ranking for each image.
To demonstrate the effectiveness of our approach, we compare the overall ranking score with recent approaches. Note that no prior methods report results for salient instance ranking.
We apply the proposed SOR evaluation metric to report how different models gauge relative salience. The last column in Table~\ref{table:quant_pascals} shows the SOR score of our approach and comparisons with other state-of-the-art methods. We achieve 85.2\% correlation score for the best variant of our model. The proposed method significantly outperforms other approaches in ranking multiple salient objects and our analysis shows that learning salient object detection implicitly learns rank to some extent, but explicitly learning rank can also improve salient object detection irrespective of how the ground truth is defined.
\begin{figure} [t]
\centering
\setlength\tabcolsep{0.8pt}
\def0.3{0.8}
\resizebox{0.48\textwidth}{!}{
\begin{tabular}{c}
\begin{tabular}{ c c c c c cccc}
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking/3/114.jpg}} &
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking/3/114_image.png}} &
\fcolorbox{blue}{blue} {\includegraphics[width=0.12\textwidth]{images/ranking/3/114_OURS_V2.png}}&
\fcolorbox{red}{red} {\includegraphics[width=0.12\textwidth]{images/ranking/3/114_AMULET.png}}&
\fcolorbox{red}{red} {\includegraphics[width=0.12\textwidth]{images/ranking/3/114_UCF.png}} &&&
\multirow{3}{*}[1.43cm]{\includegraphics[width=0.031\textwidth, height = 5.6cm]{figures/jet-v.pdf}}\\
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking/5/299.jpg}} &
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking/5/299_image.png}} &
\fcolorbox{blue}{blue} {\includegraphics[width=0.12\textwidth]{images/ranking/5/299_OURS_V2.png}}&
\fcolorbox{red}{red} {\includegraphics[width=0.12\textwidth]{images/ranking/5/299_AMULET.png}}&
\fcolorbox{blue}{blue} {\includegraphics[width=0.12\textwidth]{images/ranking/5/299_UCF.png}} &&&\\
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking/4/177.jpg}} &
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking/4/177_image.png}} &
\fcolorbox{blue}{blue} {\includegraphics[width=0.12\textwidth]{images/ranking/4/177_OURS_V2.png}}&
\fcolorbox{red}{red} {\includegraphics[width=0.12\textwidth]{images/ranking/4/177_AMULET.png}}&
\fcolorbox{red}{red} {\includegraphics[width=0.12\textwidth]{images/ranking/4/177_UCF.png}} &&&\\
Image& GT& RSDNet-R& AMULET~\cite{amulet_2017}& UCF~\cite{ucf_2017}\\
\end{tabular}
\end{tabular}}
\caption{Qualitative depiction of rank order of salient objects \textcolor{violet}{on PASCAL-SR dataset}. \textcolor{violet}{ Relative rank is indicated by the assigned color and number on each salient instance}. Blue and red image borders indicate correct and incorrect ranking respectively.}
\label{fig:pascals_ranking}
\vspace{-0.3cm}
\end{figure}
Fig.~\ref{fig:pascals_ranking} shows a qualitative comparison of the state-of-the-art approaches designed for salient object detection on PASCAL-SR dataset. Note that the role of ranking for more than three objects is particularly pronounced.
\subsection{Extended Ranking Evaluation on PASCAL-SR}
We perform several experiments on the PASCAL-SR dataset under different settings shown in Table~\ref{table:quant_pascals_extend} to justify the correctness of our proposed dataset .
\begin{table}[H]
\vspace{-0.2cm}
\caption{Comparison of Saliency ranking score of several networks on the PASCAL-SR dataset. All the baseline numbers are reported from~\cite{cvpr18_rank}.}
\vspace{-0.2cm}
\centering
\setlength\tabcolsep{2.9pt}
\def0.3{1.1}
\resizebox{0.49\textwidth}{!}{
\begin{tabular}{c|cccccccc}
\specialrule{1.2pt}{1pt}{1pt}\
\multirow{1}{*}{$\ast$}&RSDNet$^\star$& RSDNet$^\ddagger$ & RSDNet$^\dagger$ & RSDNet~\cite{cvpr18_rank} & UCF~\cite{luo2017non} & Amulet~\cite{luo2017non}& DSS~\cite{luo2017non}& NLDF~\cite{luo2017non} \\
\specialrule{1.2pt}{1pt}{1pt}\
SOR$_\text{avg}$ &0.848 &\color{violet}\textbf{0.862}&0.832&0.825&0.792&0.788&0.770&0.783\\
SOR$_\text{pow}$ &0.848 &0.843&\color{violet}\textbf{0.867}&0.839& 0.820& 0.823& 0.834& 0.850 \\
SOR$_\text{max}$ &0.831&0.855&\color{violet}\textbf{0.857}&0.824& 0.837& 0.840& 0.810& 0.851 \\
\specialrule{1.2pt}{1pt}{1pt}
\end{tabular}}
\label{table:quant_pascals_extend}
\vspace{-0.2cm}
\end{table}
First, we train several baseline models using our proposed dataset and evaluate on the test subset of the PASCAL-SR dataset. It is a evident from Table~\ref{table:quant_pascals_extend} that, RSDNet$^\dagger$ (\textit{train} : COCO-SalRank, \textit{test}: test set of PASCAL-SR) outperforms RSDNet in term of saliency ranking. When we fine-tune the trained model with the train set of PASCAL-SR, RSDNet$^\ddagger$ further improves the ranking performance by a considerable margin. Note that we perform the same experiments for both versions of our dataset under relative ranking scenario. When we train RSDNet with COCO-SalRank (version \rom{2}) and test on PASCAL-SR we achieve a significant boost (+2\%) with RSDNet$^\star$ compared to RSDNet. One could argue that, the reason behind the improvement of ranking performance is the large training set compared to the small one of PASCAL-SR, which further underscores the fidelity and effectiveness of our dataset.
\begin{figure}[h]
\vspace{-0.2cm}
\centering
\setlength\tabcolsep{1.0pt}
\resizebox{0.49\textwidth}{!}{
\begin{tabular}{c}
\begin{tabular}{ c c c c c c ccc}
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking/ext/395_im.jpg}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking/ext/395_image.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking/ext/395_new.png}}&
\fcolorbox{blue}{blue} {\includegraphics[width=0.12\textwidth]{images/ranking/ext/395_OURS_V2.png}}&
\fcolorbox{blue}{blue} {\includegraphics[width=0.12\textwidth]{images/ranking/ext/395_AMULET.png}}&
\fcolorbox{red}{red} {\includegraphics[width=0.12\textwidth]{images/ranking/ext/395_UCF.png}} &&&
\multirow{2}{*}[1.4cm]{\includegraphics[width=0.031\textwidth]{figures/jet-v.pdf}}\\
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking/ext/129_im.jpg}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking/ext/129_image.png}}&
\fcolorbox{black}{black} {\includegraphics[width=0.12\textwidth]{images/ranking/ext/129_new.png}}&
\fcolorbox{blue}{blue} {\includegraphics[width=0.12\textwidth]{images/ranking/ext/129_OURS_V2.png}}&
\fcolorbox{blue}{blue} {\includegraphics[width=0.12\textwidth]{images/ranking/ext/129_AMULET.png}}&
\fcolorbox{red}{red} {\includegraphics[width=0.12\textwidth]{images/ranking/ext/129_UCF.png}} &&&\\
image & gt& RSDNet$^\ast$&RSDNet~\cite{cvpr18_rank}& AMULET~\cite{amulet_2017}& UCF~\cite{ucf_2017}\\
\end{tabular}
\end{tabular}}
\caption{ Qualitative illustration of rank order of salient instances \textcolor{violet}{on PASCAL-SR dataset}. \textcolor{violet}{Relative rank is indicated by the assigned color and number on each salient instance.}}
\label{fig:pascals_ranking_ex}
\vspace{-0.1cm}
\end{figure}
Fig.~\ref{fig:pascals_ranking_ex} presents a qualitative comparison of the state-of-the-art approaches designed for salient instance ranking or detection. Note that the role of ranking for more than three objects (2$^{\text{nd}}$ row) is especially pronounced in revealing the significance of our dataset.
\subsection{Ranking Evaluation on COCO-SalRank Under Relative and Absolute Rank Setting}\label{sec:pascals_rank}
The saliency ranking performance of all baseline models under relative and absolute settings are listed in Table~\ref{table:rank-noisy} (version \rom{1} \& version \rom{2}). The performance in terms of all metrics reveals the generality and reliability of the proposed dataset. Given the more limited number of training samples, baseline networks achieve a slightly lower ranking score from version \rom{2} compared to version \rom{1}, which implies and interesting trade-off between signal-to-noise in the data (version \rom{1}) and sheer volume of data. Also the two different settings (relative vs absolute) maintain a comparable performance across models and metrics. Further, as shown in Table~\ref{table:rank-noisy}, the $\text{SOR}_\text{max}$ ranking strategy shows higher scores for all baselines under different settings, demonstrating value in considering different vantage points in how assignments of rank are derived from an underlying saliency map.
\begin{table}[H]
\vspace{-0.2cm}
\caption{Saliency ranking performance comparison for different methods subject to relative and absolute ranking settings on our COCO-SalRank dataset.}
\vspace{-0.2cm}
\centering
\def0.3{1.2}
\resizebox{0.49\textwidth}{!}{
\begin{tabular}{c|c|ccc|ccc}
\specialrule{1.2pt}{1pt}{1pt}\
\multirow{2}{*}{$\ast$} &\multirow{2}{*}{Methods}& \multicolumn{3}{c}{Relative }&\multicolumn{3}{c}{Absolute } \\
\cline{3-8}
&& SOR$_\text{avg}$ & SOR$_\text{pow}$ & SOR$_\text{max}$ &SOR$_\text{avg}$ &SOR$_\text{pow}$ & SOR$_\text{max}$ \\
\cline{1-1} \cline{2-2} \cline{3-5} \cline{6-8}
\multirow{3}{*}{ver I}&RSDNet~\cite{cvpr18_rank} & \color{violet}\textbf{0.736} &\color{violet}\textbf{0.727} & \color{violet}\textbf{0.767}& \color{violet}\textbf{0.732} &\color{violet}\textbf{0.726} &0.761 \\
&PSPNet + NRSS~\cite{zhao2017pyramid} & 0.720& 0.709& 0.764 & 0.730 &0.725 &\color{violet}\textbf{0.770} \\
&DeepLabv2 + NRSS~\cite{chen2016deeplab} & 0.708& 0.710 &0.753 & 0.716& 0.713 &0.750\\
\specialrule{1.2pt}{1pt}{1pt}\
\multirow{3}{*}{ver II}&RSDNet~\cite{cvpr18_rank} & \color{violet}\textbf{0.715} &\color{violet}\textbf{0.693} &\color{violet}\textbf{0.758} & \color{violet}\textbf{0.709}& \color{violet}\textbf{0.696}& 0.745 \\
&PSPNet + NRSS~\cite{zhao2017pyramid} & 0.689& 0.682& 0.754 & 0.695& 0.692& \color{violet}\textbf{0.771} \\
&DeepLabv2 + NRSS~\cite{chen2016deeplab} & 0.680 &0.682 &0.742 & 0.676& 0.688 & 0.727\\
\specialrule{1.2pt}{1pt}{1pt}
\end{tabular}}
\label{table:rank-noisy}
\vspace{-0.1cm}
\end{table}
Fig.~\ref{fig:cocosalrank_ranking} shows a visual comparison of saliency ranking on COCO-SalRank dataset with respect to different baselines. We can see that the baselines can predict rank order of salient objects quite accurately and this produces output closer to ground-truth maps in various challenging cases. Recall that each model is paired with the nested relative salience stack (NRSS)~\cite{cvpr18_rank} at each slice and provides distinct representations to differentiate between multiple salient objects and allows for reasoning about their
relative salience to take place.
\begin{figure}[h]
\vspace{-0.2cm}
\centering
\setlength\tabcolsep{0.7pt}
\def0.3{0.9}
\resizebox{0.49\textwidth}{!}{
\begin{tabular}{c}
\begin{tabular}{ c c c c cccc }
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/ranking_ours/im_86_im.png}}&
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/ranking_ours/im_86_vgg16.png}}&
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/ranking_ours/im_86_pspnet.png}}&
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/ranking_ours/im_86_pspnet.png}}&
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/ranking_ours/im_86_vgg16.png}} &&&
\multirow{4}{*}[1.4cm]{\includegraphics[width=0.03\textwidth, height=5.3cm]{figures/jet-v.pdf}}\\
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/ranking_ours/im_92_im.png}}&
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/ranking_ours/im_92_image.png}}&
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/ranking_ours/im_92_resnet101.png}}&
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/ranking_ours/im_92_pspnet.png}}&
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/ranking_ours/im_92_vgg16.png}}&&& \\
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/ranking_ours/im_2762_im.png}}&
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/ranking_ours/im_2762_image.png}}&
\fcolorbox{red}{red} {\includegraphics[width=0.12\textwidth]{images/ranking_ours/im_2762_resnet101.png}}&
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/ranking_ours/im_2762_pspnet.png}}&
\fcolorbox{red}{red}{\includegraphics[width=0.12\textwidth]{images/ranking_ours/im_2762_vgg16.png}} &&&\\
image & gt&RSDNet& PSPNet& DeepLabv2\vspace{0.1cm}&&&\\
\end{tabular}
\end{tabular}}
\caption{ Qualitative illustration of rank order of salient objects on COCO-SalRank dataset. \textcolor{violet}{Relative rank is indicated by the assigned color and number on each salient instance.}}
\label{fig:cocosalrank_ranking}
\vspace{-0.3cm}
\end{figure}
\subsection{Extended Detection Evaluation on PASCAL-SR Under Relative and Absolute Rank}\label{sec:detection}
To further evaluate the generalization capability and reliability of our proposed dataset, we use the predicted saliency maps for the traditional problem of salient object detection. Note that we do not explicitly train the networks for detection; instead we use the same predicted saliency map produced by networks trained for the ranking problem. We start with performing comprehensive analysis on a subset of the PASCAL-SR dataset to demonstrate the value of our dataset on multiple salient object detection with performance values shown in Table~\ref{table:quant_pascals_detect}.
\begin{table}[t]
\caption{Quantitative comparison of baselines including max F-measure, avg F-measure, AUC, MAE, and avg S-measure on PASCAL-SR dataset.}
\vspace{-0.3cm}
\centering
\def0.3{1.1}
\resizebox{0.49\textwidth}{!}{
\begin{tabular}{c|ccccccc}
\specialrule{1.2pt}{1pt}{1pt}\
\multirow{1}{*}{$\ast$}& RSDNet$^\star$& RSDNet$^\ddagger$ & RSDNet$^\dagger$ & RSDNet & UCF~\cite{luo2017non} & Amulet~\cite{luo2017non}& DSS~\cite{luo2017non} \\
\specialrule{1.2pt}{1pt}{1pt}\
max-$F_m$& 0.849 &\color{violet}\textbf{0.889} &0.855 &0.873 & 0.858 & 0.865 & 0.841 \\
avg-$F_m$&0.787 &\color{violet}\textbf{0.834} & 0.789 & \color{violet}\textbf{0.834} & 0.813 & 0.841 & 0.830 \\
AUC& 0.963& \color{violet}\textbf{0.977} & 0.962 & 0.972&0.959 & 0.957& 0.918 \\
MAE&0.092 & \color{violet}\textbf{0.082}& 0.095 & 0.091&0.123 & 0.097& 0.099 \\
avg-$S_m$ &0.829& \color{violet}\textbf{0.847} &0.830 & 0.832&0.802&0.817&0.792\\
\specialrule{1.2pt}{1pt}{1pt}
\end{tabular}}
\label{table:quant_pascals_detect}
\vspace{-0.2cm}
\end{table}
Similar to (Sec.~\ref{sec:pascals_rank}), we train a baseline network (RSDNet) with our dataset (version \rom{1}) under the relative rank setting and test on PASCAL-SR. Further, in RSDNet$^\ddagger$ we fine-tune the trained model with the training set of PASCAL-SR and evaluate on the test set. From Table~\ref{table:quant_pascals_detect}, we can see that RSDNet$^\ddagger$ outperforms RSDNet in terms of all metrics with a reasonable margin. Fig.~\ref{fig:qual_pascals_ext} depicts a visual comparison of baseline methods along with RSDNet$^\ddagger$. Considering the different strategy for assigning relative salience on the PASCAL-SR dataset, the baseline models achieve comparable numbers only when trained on our dataset.
\begin{figure}[h]
\vspace{-0.2cm}
\begin{center}
\setlength\tabcolsep{0.7pt}
\def0.3{0.2}
\resizebox{0.49\textwidth}{!}{
\begin{tabular}{*{11}{c c @{\hskip 0.04in}c @{\hskip 0.04in} c c c c }}
\includegraphics[width=0.09\textwidth]{images/pred/201_image.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/201_GT.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/201_new.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/201_OURS_V2.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/201_UCF.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/201_AMULET.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/201_DSS.png}
\\
\includegraphics[width=0.09\textwidth]{images/pred/579_image.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/579_GT.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/579_new.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/579_OURS_V2.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/579_UCF.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/579_AMULET.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/579_DSS.png}
\\
\includegraphics[width=0.09\textwidth]{images/pred/796_image.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/796_GT.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/796_new.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/796_OURS_V2.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/796_UCF.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/796_AMULET.png}
&
\includegraphics[width=0.09\textwidth]{images/pred/796_DSS.png}
\\
\specialrule{0pt}{0pt}{1pt}\
\rowfont{\scriptsize} Image &\rowfont{\scriptsize} \rowfont{\scriptsize}GT &\rowfont{\scriptsize} RSDNet$^\star$ & \rowfont{\scriptsize} RSDNet &\rowfont{\scriptsize} UCF &\rowfont{\scriptsize} Amulet &\rowfont{\scriptsize} DSS \\
\end{tabular}}
\caption{Predicted salient object regions for the Pascal-SR dataset. Each row shows outputs corresponding to different algorithms designed for the salient object detection/segmentation task.}
\label{fig:qual_pascals_ext}
\vspace{-0.2cm}
\end{center}
\end{figure}
For further analysis, we report detection performance for baseline models on our dataset (version \rom{1} \& version \rom{2}). Table~\ref{table:noisy-analysis} shows the comparison of detection score for baseline methods in terms of F-measure, AUC, and MAE. Similar to saliency ranking performance, we see consistent performance across different versions, metrics, and ranking settings.
\begin{table}[H]
\vspace{-0.3cm}
\caption{\textcolor{violet}{Quantitative comparison of baseline methods including max and average F-measure, AUC, and MAE on COCO-SalRank dataset (version \rom{1} \& version \rom{2}) under relative and absolute ranking settings.}}
\vspace{-0.3cm}
\centering
\def0.3{1.1}
\resizebox{0.49\textwidth}{!}{
\begin{tabular}{c|c|cccc|cccccc}
\specialrule{1.2pt}{1pt}{1pt}\
\multirow{2}{*}{$\ast$}&\multirow{2}{*}{Methods}& \multicolumn{4}{c}{Relative}&\multicolumn{4}{c}{Absolute} \\
\cline{3-10}
&& max-$F_m$& avg-$F_m$ & AUC & MAE &max-$F_m$ &avg-$F_m$ & AUC& MAE \\
\cline{1-1} \cline{2-2} \cline{3-6} \cline{7-10}
\multirow{3}{*}{I}&RSDNet~\cite{cvpr18_rank} & 0.780 & 0.705& 0.936& \color{violet}\textbf{0.135} & 0.783& 0.663& \color{violet}\textbf{0.944}& 0.158 \\
&PSPNet+NRSS~\cite{zhao2017pyramid} & \color{violet}\textbf{0.796}& \color{violet}\textbf{0.728}& \color{violet}\textbf{0.944}& 0.136 & \color{violet}\textbf{0.794}& \color{violet}\textbf{ 0.737}& 0.944& \color{violet}\textbf{0.132} \\
&DeepLab+NRSS~\cite{chen2016deeplab} & 0.743& 0.649& 0.917& 0.162 & 0.735& 0.631& 0.911& 0.166 \\
\specialrule{1.2pt}{1pt}{1pt}\
\multirow{3}{*}{II}&RSDNet~\cite{cvpr18_rank} & 0.803& 0.777& 0.954& 0.138 & 0.832& 0.762& 0.953& 0.149\\
&PSPNet+NRSS~\cite{zhao2017pyramid} & \color{violet}\textbf{0.850} & \color{violet}\textbf{0.792}& \color{violet}\textbf{0.957}& \color{violet}\textbf{0.13} & \color{violet}\textbf{0.845}& \color{violet}\textbf{0.79}& \color{violet}\textbf{0.956} & \color{violet}\textbf{0.133} \\
&DeepLab+NRSS~\cite{chen2016deeplab} & 0.805& 0.729& 0.934& 0.165 & 0.800& 0.692& 0.932&0.175 \\
\specialrule{1.2pt}{1pt}{1pt}
\end{tabular}}
\label{table:noisy-analysis}
\vspace{-0.1cm}
\end{table}
\subsection{Cross-Dataset Evaluation}\label{sec:experiments}
To further investigate the role and value of the proposed saliency ranking dataset in detail, we conduct cross-dataset evaluation on two different respective versions of the dataset (\textit{noisy} \& \textit{clean}) under relative ranking setting. First, we report saliency ranking performance of baselines for all the alternative metrics in Table~\ref{table:rank-cross}. As shown in Table~\ref{table:rank-cross}, the set of baseline methods achieves better performance in the scenario (train:(version \rom{1}), test: (version \rom{2})) for relative ranking settings when compared with the numbers reported in Table~\ref{table:rank-noisy}. However, when we use the clean version (version \rom{2}) for training, and evaluate the model on the noisy version (version \rom{1}), all the baselines achieve a lower saliency ranking performance compared to the reported number in Table~\ref{table:rank-noisy}. This analysis hints at strengths of the proposed saliency ranking dataset in its value for boosting performance in training algorithms for saliency ranking, and also for validation and testing.
\begin{table}[h]
\caption{Saliency ranking performance comparison for different methods with respect to cross-dataset evaluation under the relative ranking setting.}
\vspace{-0.3cm}
\centering
\def0.3{1.1}
\resizebox{0.48\textwidth}{!}{
\begin{tabular}{c|ccccccc}
\specialrule{1.2pt}{1pt}{1pt}\
\multirow{2}{*}{Methods}& \multicolumn{3}{c}{train:(v\rom{1}), test: (v\rom{2})}&&\multicolumn{3}{c}{train:(v\rom{2}), test: (v\rom{1})} \\
\cline{2-8}
& SOR$_\text{avg}$ & SOR$_\text{pow}$ & SOR$_\text{max}$ &&SOR$_\text{avg}$ &SOR$_\text{pow}$ & SOR$_\text{max}$ \\
\cline{1-1} \cline{2-4} \cline{6-8}
RSDNet~\cite{cvpr18_rank} & \color{violet}\textbf{0.721}& \color{violet}\textbf{0.696}& 0.780 &&\color{violet} \textbf{0.727}& \color{violet}\textbf{0.724}& \color{violet} \textbf{0.753} \\
PSPNet + NRSS~\cite{zhao2017pyramid} & 0.697& 0.684&\color{violet} \textbf{0.781} && 0.700&0.706& 0.729\\
DeepLabv2 + NRSS~\cite{chen2016deeplab} &0.680& 0.680& 0.752 && 0.709& 0.715& 0.748\\
\specialrule{1.2pt}{1pt}{1pt}
\end{tabular}}
\label{table:rank-cross}
\end{table}
\section{Introduction}
\textcolor{black}{The problem of salient object detection~\cite{cheng2014global,itti1998model, liu2010learning, perazzi2012saliency, goferman2011context}} ~\cite{ yan2013hierarchical,shi2013pisa,yang2013saliency,li2014secrets} has been well studied, and much progress has been made. The objective in this problem domain is to select an object or objects in an image that are important, striking, stand-out or draw attention. The majority of work in salient object detection considers either a single salient object~\cite{amulet_2017, ucf_2017, he2017delving, hou2016deeply, wang2016saliency, wang2017stagewise, hu2017deep,li2016deep, lee2016deep, liu2016dhsnet, zhao2015saliency,li2015visual} or multiple salient objects~\cite{jia2015adaptive, najibi2017towards, zhang2016unconstrained, Wang_2018_CVPR}, but does not consider that what is salient may vary from one person to another, and certain objects may be met with more universal agreement concerning their importance. In this work, we bring to light a consideration that has long been neglected in this domain; individual observers may have differences in opinion about what is salient, and moreover, the definition of a salient object is relatively equivocal. This implies that while one or more objects may be salient, there may be more agreement for certain object than others. With respect to a problem definition, salient object detection can be extended to a problem of ranking salient objects. \textcolor{violet}{As such, \textit{saliency ranking} requires the detection of salient instances in a given image, and assignment of a rank to each salient instance based on its degree of saliency.}
There is a paucity of data that includes salient objects that are hand-segmented by multiple observers. It is important to note that any labels provided by a small number of observers (including one) does not allow for discerning the relative importance of objects. Implicit assignment of relative salience based on gaze data~\cite{xia2017and} also presents difficulties, given a different cognitive process than a calculated decision that involves manual labeling~\cite{koehler2014saliency}. Moreover, gaze data is relatively challenging to interpret given factors such as centre bias, visuomotor constraints, and other latent factors~\cite{bruce2015computational, accik2014real}. To overcome some of these shortcomings, we have re-purposed the PASCAL-S dataset~\cite{li2014secrets} via further processing \textcolor{violet}{(described in Sec.~\ref{sec:stack})} to provide a set of data denoted as PASCAL-SR that overcomes some of the limitations of traditional efforts.
\begin{figure}
\centering
\setlength\tabcolsep{1.0pt}
\def0.3{0.3}
\resizebox{0.4\textwidth}{!}{
\begin{tabular}{*{3}{c }}
\includegraphics[width=0.24\textwidth]{images/intro/282.jpg}&
\includegraphics[width=0.24\textwidth]{images/intro/282.png} &
\includegraphics[width=0.24\textwidth]{images/intro/282_OURS_V2}
\\
\includegraphics[width=0.24\textwidth]{images/intro/31.jpg}&
\includegraphics[width=0.24\textwidth]{images/intro/31.png} &
\includegraphics[width=0.24\textwidth]{images/intro/31_OURS_V2.png}
\\
\end{tabular}}
\caption{We present a solution in the form of a deep neural network to detect salient objects and consider their relative ranking based on salience of these objects. Left to right: input image, detected salient regions, and rank order of salient objects. Assigned numbers and colors indicate the rank order of different salient object instances.}
\label{fig:intro1}
\vspace{-0.4cm}
\end{figure}
Therefore, in this paper we consider the problem of salient object detection more broadly. This includes detection of all salient regions, and accounting for inter-observer variability by assigning confidence to different salient regions. We augment the PASCAL-S dataset via further processing to provide ground truth in a form that accounts for relative salience. Success is measured against other algorithms based on the rank order of salient objects relative to ground truth orderings in addition to traditional metrics.
It is our contention that this determination should be possible by a model that provides detection of salient objects (see Fig.~\ref{fig:intro1}).
\begin{figure}
\centering
\includegraphics[width=0.49\textwidth]{figures/dataset_3.pdf}
\vspace{-0.7cm}
\caption{An illustration of the COCO-SalRank dataset. Our dataset provides salient object instances and their relative rank order (relative salience). Due to the large number of instances present in some images, an \textit{instance pruning} process assigns a rank only to instances that receive a sufficiently high degree of attention. We provide two different versions of our proposed ranking dataset in the form of a noisy and cleaned version. Assigned numbers and colors indicate the rank order of salient object instances with chroma corresponding to a numeric scale.}
\label{fig:dataset}
\vspace{-0.4cm}
\end{figure}
\textcolor{violet}{While the PASCAL-S dataset provides selections from multiple observers, this takes a different form than the data derived from a re-purposed version of this dataset included in the current study. For PASCAL-S, results are reported based on varying the threshold required among observers for an object to be considered salient. This implies a solution to multiple binary salient object detection problems and hints at the ill-posed nature of the problem. What this does not consider is an explicit ranking or ordering of salient objects and instead considers instances of the traditional problem subject to a varying threshold for making a binary judgment of what is salient. In contrast, PASCAL-SR dataset is non-binary and includes a specific relative ranking. This requires a non-binary decision and a more balanced control over precision and recall in assigning saliency. Moreover, it's characteristics provide a guide for the development of the more extensive COCO-SalRank dataset presented.}
Although the PASCAL-SR dataset may be made suitable for addressing the problem of ranking salient objects; in order to train deep learning models a significant number of examples are needed; this is also true of evaluation of algorithms that seek to assign a relative rank to salient objects. Therefore, we extend our work in this paper to provide a dataset for saliency ranking, and associated benchmarks, based on images from the MS-COCO dataset~\cite{lin2014microsoft}. This is accomplished by combining existing measurements diagnostic of human attention~\cite{jiang2015salicon} with existing object annotations. This process is more challenging and nuanced than one might initially expect; MS-COCO labels only cover specific object categories, and vary significantly in the precision with which objects are segmented
With that said, we propose a set of methods that prune an initial set of 10k labeled images based on a careful choice of formal criteria for inclusion/rejection. Images and/or labels that remain are assigned a relative ranking based on a simulated gaze tracking process~\cite{jiang2015salicon} (see Fig.~\ref{fig:dataset}). While there are significant differences between manual choice of salient objects and simulated gaze data, we demonstrate how rank values based on the latter can be treated to produce rankings that approximate the former. This process is validated in comparing rank-order assignments based on manual selection on an alternative dataset using the same criteria. Moreover, we demonstrate that training of models on the dataset we provide produces more capable models than those trained on PASCAL-SR, even in the case that training uses no images from PASCAL-SR. It has been noted that in training deep learning models, there is considerable robustness to even large amounts label noise~\cite{rolnick2017deep}. With that said, our experimentation shows only a very small deviation in algorithmic assignment of rank when compared against click-based ground truth, and also presents a general end-to-end approach for generating saliency ranking data
The contribution of this paper extends from the proposed model presented in our prior work~\cite{cvpr18_rank} that 1. Generalizes the problem of salient object detection to salient object ranking which includes inter-observer variability and considers relative rank of salient objects. 2. Presents a new model that predicts salient objects according to the traditional form of this problem, \textcolor{violet}{salient instance detection} and relative ranking.
We extend our prior work in the following respects:
\begin{itemize}
\item We introduce a novel set of methods that make use of existing gaze or related data paired with object annotations to generate a large scale benchmark dataset for saliency ranking. We also propose metrics suitable to measuring success in a relative object saliency landscape.
\item The discussion and details provided for ground truth generation stands on its own, but also highlights important nuances of the problem and thus provides a roadmap for other similar efforts for generating suitable data for training and testing. The more extensive analysis of metrics also sheds further light on their suitability for this problem and examines this space in more detail than~\cite{cvpr18_rank}.
\item The process for generating the dataset is validated in comparing rank-wise assignments made to an alternate dataset using the criteria we propose for algorithmic production of COCO-SalRank. Validation comes from rank order agreement to labels in PASCAL-SR which are produced by a process of manual selection by human participants. This implies a larger dataset in COCO-SalRank suitable for both training and evaluation. Moreover, we demonstrate that training of models on the dataset we provide produces more capable models than those trained on PASCAL-SR when tested on either of the datasets.
\item We provide new state-of-the-art baseline scores for the saliency ranking problem on PASCAL-SR and the proposed dataset, while also providing a corpus of data and code to the community that provides significant value for training and evaluation for a relatively nascent problem domain.
\end{itemize}
| {'timestamp': '2019-09-17T02:31:22', 'yymm': '1810', 'arxiv_id': '1810.02426', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02426'} | arxiv |
\section{Introduction}
A challenging problem in automatic verification consists in determining (or in extending) classes of infinite graphs having a decidable theory in a given logic. A first technique consists in considering some judicious graph transformations, as for example unfolding (that preserves decidability of monadic second-order logic) or logical interpretations. The pushdown hierarchy \cite{DBLP:conf/mfcs/Caucal02} is a hierarchy of decidable graphs of monadic second-order theory. Starting from finite graphs, each level consists of the monadic interpretations of the unfoldings of lower levels. The tree-automatic hierarchy \cite{DBLP:journals/lmcs/ColcombetL07} is a hierarchy of graphs of decidable first-order (FO) theory: each level consists of finite set interpretations of the corresponding level of the pushdown hierarchy. A second technique is to consider graphs whose vertex set and relations are recognizable by automata whose recognized languages form a Boolean algebra. For instance, it is the case of word-automatic graphs or more generally tree-automatic graphs, \textit{i.e} graphs whose vertex set can be encoded by a regular tree language and each relation recognized by a synchronized tree transducer. It turns out the first level of the tree-automatic hierarchy consists of tree-automatic graphs. Lastly, rewriting systems also allow to define interesting graph classes. Graphs at the first level of the pushdown hierarchy are the suffix rewriting graphs of recognizable word rewriting systems \cite{DBLP:conf/caap/Caucal90}. Ground term rewriting graphs (GTR graphs) with the reachability relation are tree-automatic and thus the first-order theory with the reachability predicate ($\FOAccs$) of a GTR graph is decidable \cite{DBLP:conf/lics/DauchetT90}.
Since its monadic second-order theory is not decidable, the infinite grid does not belong to the pushdown hierarchy and is therefore not the unfolding of a finite graph. Nevertheless, as a GTR graph, the infinite grid has a decidable $\FOAccs$ theory. In fact, even the theory of the infinite grid in first-order logic extended by the operator of transitive closure for first-order definable relations remains decidable \cite{DBLP:conf/lics/WohrleT04}. But consider now the infinite grid tree: from each vertex of an infinite grid, there is an edge (labelled by a new symbol) to the origin of a copy of the infinite grid. We will prove that this simple graph (it is just the configuration graph of a system with 2 counters that we can independently incremente and simultanely reset) has the $\FOAccs$ theory decidable but is not a GTR graph. In fact, we are interested in considering, more generally, a class of graphs that model concurrent system computations. For such a system, sequential and parallel computations are possible. To that end, we will consider Mazurkiewicz traces: if the dependency is total, then a trace reduces to a string that describes sequential computation while independence between some letters bring the possibility to describe parallel computation.
For a recognizable trace rewriting system, that is a finite set of rules of the form $\rond{U}\cdot(\rond{V}\xrightarrow{\lambda} \rond{W})$ where $\rond{U}$, $\rond{V}$, $\rond{W}$ are recognizable trace languages, $\lambda$ a label, consider then its rewriting graph: the set of edges of the form $ts\xrightarrow{\lambda}ts'$ such that there exists a rewriting rule $\rond{U}\cdot(\rond{V}\xrightarrow{\lambda} \rond{W})$ with $t\in\rond{U}$, $s\in\rond{V}$, $s'\in\rond{W}$. If all letters are dependent, then such a graph is at the first level of the pushdown hierarchy since it is the suffix rewriting graph of a recognizable word rewriting system, and if no distinct letters are dependent, then it is the configuration graph of a vector addition system. In any case, we will prove in Section 3 that such a graph is word-automatic, even with level-regular contexts: a trace language is level-regular if the set of Foata normal forms of its elements is regular. Since the set of Foata normal forms is regular, every recognizable trace language is level-regular. But, for example, if $a$ and $b$ are two independent letters, the trace language $[(ab)^*]$ is level-regular but not recognizable. The FO theory of the rewriting graph of a recognizable trace rewriting system with level-regular contexts (RTL graph) is thus decidable. We also prove that, in general, its $\FOAccs$ theory is not decidable. Otherwise, we could decide the halting problem for 2-counters Minsky machine. In Section 4, we prove that the concurrent unfolding of a finite concurrent automaton has the $\FOAccs$ theory decidable, by showing that such a graph with the reachability relation is a RTL graph. This extends a theorem of Madhusudan \cite{DBLP:conf/lics/Madhusudan03} on decidability of FO theory of regular trace event structures \cite{Thiagarajan_1996}. We will observe that the infinite grid and the infinite grid tree are the concurrent unfoldings of finite concurrent automata. In Section 5, we define the tree of a graph and we prove that if it is a GTR graph, then it is finitely decomposable by size. The latter implies it is at the first level of the pushdown hierarchy. We deduce that the infinite grid tree is not a GTR graph.
\section{Preliminaries}Before presenting the rewriting graphs of recognizable trace rewriting systems, we recall some basic definitions about graphs, logics, automata and traces.
\medskip
Let $\Sigma$ be a finite alphabet and $\Sigma^*$ be the free monoid of words over $\Sigma$.
\subsection{Graphs}
A \emph{$\Sigma$-graph} $G$ is a subset of $V\times \Sigma \times V$ where $V$ is a set. An element $(p,a,q)\in G$ is an edge labelled by $a$ from source $p$ to target $q$. The notation $p\xrightarrow[G]{a}q$ (or $p\xrightarrow[]{a}q$ when $G$ is understood) means $(p,a,q)\in G$. The \emph{vertex} set of $G$ is $V_G=\{p\in V\mid \exists q\ (p\xrightarrow[G]{a}q \lor q\xrightarrow[G]{a}p)\}$.
The graph $G$ is \emph{deterministic} if for every $a\in \Sigma$, if $(p\xrightarrow[G]{a}q$ and $p\xrightarrow[G]{a}q')$ then $q=q'$.
A \emph{path} in $G$ between vertices $p$ an $q$, labelled by a word $u=a_1\dots a_k$ is a finite sequence of the form $p\xrightarrow[G]{a_1}p_1,\dots,p_{k-1}\xrightarrow[G]{a_k}q$. We denote by $p\xrightarrow[G]{a_1\dots a_k}q$ the existence of such a path. A \emph{loop} in $G$ is a path of the form $p\xrightarrow[G]{a}p$, where $a\in \Sigma$. If $G$ is finite, then for $p,q\in V_G$, the $\Sigma$-word language $L_{p,q}:=\{u\in\Sigma^*\mid p\xrightarrow[G]{u}q\}$ is regular. We write $p\xrightarrow[G]{*}q$ if there exists a word $u\in \Sigma^*$ such that $p\xrightarrow[G]{u}q$. Denote by $G_*$ the $\Sigma\ \dot\cup\ \{*\}$-graph defined by $G_*=G\cup\{(p,*,q)\mid p\xrightarrow[G]{*}q\}$. The graph $G_*$ is obtained from $G$ by adding the reachability relation.
An isomorphism $f$ from $(G,P)$ onto $(H,Q)$, where $G$ and $H$ are $\Sigma$-graphs and $P$ and $Q$ are subsets of $V_G$ and $V_H$ respectively, is a bijection from $V_G$ to $V_H$ such that $$f(P)=Q\ \text{ and }\ (p\xrightarrow[G]{a}q\Longleftrightarrow f(p)\xrightarrow[H]{a}f(q)).$$
\subsection{Logics}A $\Sigma$-graph $G$ is a relational structure over the binary signature $\Sigma$. The \emph{first-order} ($\FO$) theory of $G$ is defined as usual (see \cite{ebbinghaus1996mathematical}). The FO theory of $G_*$ will be refered to as the $\FOAccs$ theory of $G$.
\subsection{Automata}A $\Sigma$-automaton is a triple $\rond{A}=(G,i,F)$ where $G$ is a $\Sigma$-graph, $i\in V_G$ is an initial state and $F\subseteq V_G$ is the set of final states. The $\Sigma$-word language recognized by $\rond{A}$ is $L(\rond{A})=\{u\in \Sigma^*\mid \exists f\in F\ i\xrightarrow[G]{u}f\}$. A $\Sigma$-word language is \emph{regular} if it is recognized by a finite $\Sigma$-automaton. The class of regular $\Sigma$-word languages is a Boolean algebra and is denoted by $\Reg(\Sigma^*)$.
\subsection{Traces}
\subsubsection{Generalities}
A \emph{dependence relation} $D$ is a reflexive and symmetric binary relation on $\Sigma$. The pair $(\Sigma,D)$ is called a \emph{dependence alphabet}. The complement of $D$ is the \emph{independence relation} $I:=\Sigma^2\backslash D$. The $(\Sigma,D)$-trace equivalence $\equiv_{D}$ is the least congruence on $\Sigma^*$ such that $(a,b)\in I\Rightarrow ab\equiv_{D} ba$.
The $(\Sigma,D)$-trace of a word $w\in\Sigma^*$ is its $\equiv_{D}$-equivalence class and is denoted $[w]$. The quotient monoid $\Sigma^*/\equiv_{D}$ is called the \emph{trace monoid} of the dependence alphabet $(\Sigma,D)$ and is denoted by $M(\Sigma,D)$. Note that in case of $D=\Sigma^2$, the trace monoid $M(\Sigma,D)$ coincides to the free monoid $\Sigma^*$.
The prefix binary relation $\sqsubseteq$ on $M(\Sigma,D)$ defined by $t\sqsubseteq t'$ if and only if there exists $s\in M(\Sigma,D)$ such that $ts=t'$ is a partial ordering.
Consider the finite alphabet $I_D:=\{A\subseteq \Sigma \mid \forall a_1\neq a_2\in A\ (a_1,a_2)\in I\}$ and denote by $\Pi_{I_D}:I_D^*\rightarrow M(\Sigma,D)$ the canonical morphism defined by $\Pi_{I_D}(\varnothing)=[\varepsilon]$ and $\Pi_{I_D}(\{a_1,\cdots,a_n\})=[a_1\dots a_n]$ ($n\geqslant 0$). Given $P\subseteq I_D$, we denote by $\Pi_{P}$ the restriction of $\Pi_{I_D}$ to $P^*$. A $P$-word $U$ encodes the trace $\Pi_P(U)$.
Consider the binary relation $\rhd$ on $I_D^{-}:=I_D\setminus \{\varnothing\}$ defined by: $A\rhd B\iff \forall b\in B\ \exists a\in A\ aDb$. Denote by $\Foata\subseteq {I_D^{-}}^*$ the set of $\rhd$-paths.
The surjective morphism $\Pi_{I_D^{-}}$ is not injective. Indeed, suppose $\Sigma=\{a,b\}$ and $aIb$, then $\Pi_{I_D^{-}}(\{a,b\})=\Pi_{I_D^{-}}(\{a\}\{b\})$. The following proposition expresses that each trace is encodable by a unique $I_D^{-}$-word in $\Foata$.
\begin{prop}[Foata normal form]\label{foata}
Let $t\in M(\Sigma,D)$. The Foata normal form of $t$, $\foata{t}$, is the unique $I_D^{-}$-word $\foata{t}=A_1\cdots A_p\in \Foata$ ($p\geqslant 0$) such that $\Pi_{I_D^{-}}(A_1\cdots A_p)=t$.
\end{prop}
\begin{exemple}\label{exempleFoataNomalForm}Suppose $\Sigma=\{a,b,c,d\}$ and $aIc$, $bId$, $cId$. The Foata normal form of $t=[acbdab]$ (see Figure \ref{fig:foata}) is $\foata{t}=\{a,c\}\{b,d\}\{a\}\{b\}$.
\end{exemple}
\begin{figure}
\centering
\scalebox{0.5}{\includegraphics{FoataTrace.eps}}
\caption{The Foata normal form of $[acbdab]$ (Example \ref{exempleFoataNomalForm})}
\label{fig:foata}
\end{figure}
\begin{lemme}[Level automata]\label{levelautomata}The set $\Foata$ of Foata normal forms is regular.
\end{lemme}
\begin{proof}
It is recognized by the following finite $I_D^{-}$-automaton $\rond{A}_{\Foata}$.
\begin{itemize}
\item The $I_D^{-}$-graph is given by:
$\bot\xrightarrow{A} A$ : $ A\in I_D^{-}$
$A\xrightarrow{B} B$ : $A\rhd B$
\item the initial state is $\bot\notin I_D^{-}$
\item all the states are final (even $\bot$).
\end{itemize}
\end{proof}
\subsubsection{Recognizable trace languages}A $(\Sigma,D)$-\emph{trace language} is a subset of $M(\Sigma,D)$. If $\rond{L}$ is a trace language, then the word language $\cup\rond{L}$ is $\cup\rond{L}=\{w\in\Sigma^*\mid [w]\in \rond{L}\}$. If $L$ is a word language, then $[L]$ is the trace language defined by $[L]:=\{[w]\in M(\Sigma,D)\mid w\in L\}$.
A trace language $\rond{L}\subseteq M(\Sigma,D)$ is \emph{recognizable} if there exists a finite monoid $N$ and a monoid morphism $\phi : M(\Sigma,D)\rightarrow N$ such that $\rond{L}=\phi^{-1}(\phi(\rond{L}))$. The class of recognizable trace languages is denoted by $\REC(M(\Sigma,D))$.
\begin{remarque}
In case of $D=\Sigma^2$, $\REC(M(\Sigma,D))=\Reg(\Sigma^*)$.
\end{remarque}
The next proposition recalls the robustness of the class $\REC(M(\Sigma,D))$.
\begin{prop}\label{Boolealgebre}
$\REC(M(\Sigma,D))$ is a Boolean algebra closed under concatenation.
\end{prop}
We give two characterizations of the recognizability of a trace language.
The residual by $s\in M(\Sigma,D)$ of $\rond{L}\subseteq M(\Sigma,D)$ is $s^{-1}\rond{L}=\{t\in M(\Sigma,D)\mid s\cdot t\in \rond{L}\}$. For example, suppose $\Sigma=\{a,b\}$ and $aIb$, then consider $\rond{L}=\{[ab],[abaa],[aaa],[aabbb]\}$. The residual by $[ab]$ of $\rond{L}$ is $\{\varepsilon,[aa],[abb]\}$. The recognizability of a trace language $\rond{L}$ is characterized by the finiteness of its set of residuals.
\begin{prop}\label{finituderesidus}
$\rond{L}\in \REC(M(\Sigma,D))$ if and only if $\{s^{-1}\rond{L}\mid s\in M(\Sigma,D)\}$ is finite.
\end{prop}
Suppose $P$ is a finite alphabet and $\pi:P^*\rightarrow M(\Sigma,D)$ is a surjective morphism. For instance, $P$ could be $\Sigma$, $I_D^{-}$ or $I_D$. If for a trace $t$ we think of $\pi^{-1}(t)$ as the set of its $P$-encodings, the following proposition says that the recognizability of a trace language is equivalent to the regularity of the set of all $P$-encodings of its elements.
\begin{prop}\label{Recreg}
$\rond{L}\in \REC(M(\Sigma,D))$ if and only if $\pi^{-1}(\rond{L})$ is regular.
\end{prop}
\section{Recognizable trace rewriting system with level-regular contexts}The trace language $[(ab)^*]$ with $aIb$ is not recognizable since it has an infinite set of residuals. Nevertheless, the set of Foata normal forms of its elements $\{a,b\}^*$ is regular. This suggests to consider a weaker form of recognizability. In this section, we define the notion of level-regularity for trace languages. Then we consider recognizable trace rewriting systems with level-regular contexts and we prove that their rewriting graphs are word-automatic.
Let $(\Sigma,D)$ be a dependence alphabet. In the following, we write $\Pi_{\Foata}$ for the restriction of $\Pi_{I_D^{-}}$ to $\Foata$.
\subsection{Level-regularity}
\begin{df}$\rond{L}\subseteq M(\Sigma,D)$ is level-regular if the word language $\Pi_{\Foata}^{-1}(\rond{L})$ is regular.
\end{df}
By Proposition \ref{Recreg} and Lemma \ref{levelautomata}, every recognizable trace language is level-regular. Indeed, $\Pi_{\Foata}^{-1}(\rond{L})=\Pi_{I_D}^{-1}(\rond{L})\cap \Foata$.
The class of level-regular languages is a Boolean algebra but it is not closed under concatenation. Consider for example the concatenation of the two level-regular trace languages $[(ab)^*]$ and $[(bc)^*]$, with $D=\{(a,a),(b,b),(c,c)\}$. The set of Foata normal forms of its elements
\begin{center}
\begin{tabular}{rl}
&$\Pi_{\Foata}^{-1}([(ab)^*]\cdot [(bc)^*])$\\
$=$&$\{\{a,b,c\}^k\{b,c\}^*\{b\}^k\mid k\geqslant 0\}\cup \{\{a,b,c\}^k\{a,b\}^*\{b\}^k\mid k\geqslant 0\}$\\
\end{tabular}
\end{center}
is not regular.
\subsection{Trace rewriting system}
Graphs at the first level of the pushdown hierarchy are the suffix rewriting graphs of recognizable word rewriting systems. Such a rewriting system is a finite set of rules of the form $U\cdot (V\xrightarrow{}W)$, where $U$ (the context language), $V$ and $W$ are regular languages. In the following, we consider recognizable trace rewriting systems with level-regular contexts and recognizable left and right hand sides and we prove that their rewriting graphs are word-automatic by encoding their vertex sets by their Foata normal forms.
\begin{df}A recognizable trace rewriting system with level-regular contexts (RTL) $\mathbf{R}$ on $M(\Sigma,D)$ is a finite set of rules of the form $$\rond{U}\cdot(\rond{V}\xrightarrow{\lambda} \rond{W})$$
where $\rond{U}$ is level-regular, $\rond{V},\rond{W}\in \REC(M(\Sigma,D))$ and $\lambda\in \Lambda$ a set of labels.
The rewriting graph $\graph_\mathbf{R}$ of the RTL $\mathbf{R}$ is the $\Lambda$-graph on $M(\Sigma,D)$ defined by $$\graph_\mathbf{R}=\{[uv]\xrightarrow{\lambda}[uw]\mid \exists\ \ \rond{U}\cdot(\rond{V}\xrightarrow{\lambda} \rond{W})\in \mathbf{R}, [u]\in \rond{U},[v]\in \rond{V},[w]\in \rond{W} \}.$$
\end{df}
\begin{exemple}\label{alexbis}
Suppose $D=\{(a,a),(b,b)\}$ and consider the following RTL:
$[(a+b)^*]\cdot([\varepsilon]\xrightarrow{a}[a])$
$[(a+b)^*]\cdot([\varepsilon]\xrightarrow{b}[b])$
$[(ab)^*]\cdot([\varepsilon]\xrightarrow{f}[\varepsilon])$
Its rewriting graph is the infinite grid with a loop labelled by $f$ on each vertex of its diagonal (see Figure \ref{fig:grillediag}).
\end{exemple}
\begin{exemple}\label{alex}
Suppose $D=\{(a,a),(b,b),(c,c)\}$ and consider the following RTL $\mathbf{R}$:
$[(abc)^*]\cdot ([\varepsilon]\xrightarrow{a}[abc])$
$[(abc)^*(ac)^*]\cdot([b]\xrightarrow{b}[\varepsilon])$
$[(abc)^*(ac)^*]\cdot([ac]\xrightarrow{c} [\varepsilon])$
The rewriting graph $\graph_\mathbf{R}$ (see Figure \ref{fig:cone}) is not in the pushdown hierarchy because its MSO theory is undecidable. Furthermore, remark that without the $c$-inner edges, we obtain a graph belonging to level 2 of the pushdown hierarchy.
\end{exemple}
\begin{figure}[h]
\begin{minipage}[t]{.4\linewidth}
\centering
\scalebox{0.65}{\includegraphics{grillediag.eps}}
\caption{The diagonal of the infinite grid (Example \ref{alexbis})}
\label{fig:grillediag}
\end{minipage}
\hfill%
\begin{minipage}[t]{.4\linewidth}
\centering
\scalebox{0.32}{\includegraphics{cone.eps}}
\caption{The rewriting graph of a RTL (Example \ref{alex})}
\label{fig:cone}
\end{minipage}
\end{figure}
Before stating the main result (Theorem \ref{FOConfig}) of this section, we recall some basic definitions about word-automatic graphs.
\paragraph{Word-automatic graphs.}Let $\Sigma$ be an alphabet and $\sharp\notin \Sigma$ a new symbol. The synchronization of two $\Sigma$-words, $u=a_1\dots a_m$ and $v=b_1\dots b_n$, is the $(\Sigma\ \dot \cup\ \{\sharp\})^2$-word $u\otimes v$ defined by \\ $u\otimes v:=(a_1,b_1)\dots (a_k,b_k)(x_{k+1},y_{k+1})\dots(x_K,y_K)$, where $k=\minimum(m,n)$, $K=\maximum(m,n)$ and for every $k< i \leqslant K$, $(x_i,y_i)=(\sharp,b_i)$ if $k=m$ and $(x_i,y_i)=(a_i,\sharp)$ if not.
A $\Lambda$-graph ($\Lambda$ a finite alphabet) $G$ is \emph{word-automatic} if there exists a regular word language $L_{V_G}$ and a bijection $\nu:L_{V_G}\longrightarrow V_G$ such that for each $\lambda\in \Lambda$, the synchronized word language $L_{\lambda}=\{\nu^{-1}(s)\otimes \nu^{-1}(t)\mid s\xrightarrow[G]{\lambda} t\}$ is regular.
The following proposition recalls that the domain and the image of any word-automatic relation is regular.
\begin{lemme}\label{projection}If a language $L$ of $(\Sigma\ \dot \cup\ \{\sharp\})^2$-words $u\otimes v$ is regular, then the languages $\{u\in \Sigma^*\mid \exists v\in \Sigma^*\ u\otimes v\in L\}$ and $\{v\in \Sigma^*\mid \exists u\in \Sigma^*\ u\otimes v\in L\}$ are regular.
\end{lemme}
\begin{remarque}By Lemma \ref{projection}, a $\Lambda$-graph is word-automatic if and only if there exists a bijection $\nu:L \longrightarrow V$, where $L\in \Reg(\Sigma^*)$ and $V\supseteq V_G$ such that for each $\lambda\in\Lambda$, the $(\Sigma\ \dot \cup\ \{\sharp\})^2$-word language $L_{\lambda}=\{\nu^{-1}(s)\otimes \nu^{-1}(t)\mid s\xrightarrow[G]{\lambda} t\}$ is regular.
\end{remarque}
\begin{remarque}\label{RegulierEtAutomatique}Let $L$ be a regular $P$-word language. Then the $(P\ \dot \cup\ \{\sharp\})^2$-word language $\{u\otimes v\mid u,v\in L\}$ is regular. In particular, the $(I_D^{-}\ \dot\cup\ \{\sharp\})^2$-word language $\{\foata{s}\otimes\foata{t}\mid s,t\in M(\Sigma,D)\}$ is regular.
\end{remarque}
The following theorem is partially due to the unique encoding of any trace by its Foata normal form.
\begin{theo}\label{FOConfig}
The rewriting graph of a recognizable trace rewriting with level-regular contexts (RTL graph) is word-automatic.
\end{theo}
Theorem \ref{FOConfig} is no more guaranteed if we suppose that left and right hand sides are just level-regular (see Remark \ref{cotereg}).
\begin{corollaire}[\cite{DBLP:journals/tcs/Hodgson82}]
The $\FO$ theory of a RTL graph is decidable.
\end{corollaire}
In order to prove Theorem \ref{FOConfig}, we set out a crucial property about compatibility between concatenation and Foata normal forms.
In general, $\foata{st}\neq\foata{s}\foata{t}$. Indeed, suppose $D=\{(a,a),(b,b)\}$. If $s=[a]$ and $t=[ab]$, then $\foata{s}=\{a\}$, $\foata{t}=\{a,b\}$ and $\foata{st}=\{a,b\}\{a\}$. The following lemma expresses some compatibility between concatenation and Foata normal form.
\begin{lemme}\label{ConcatEtFoata}
Let $s,t\in M(\Sigma,D)$ such that $\foata{s}=A_1\cdots A_p$ ($p\geqslant 0$) and $\foata{st}=B_1\cdots B_m$. Then $m\geqslant p$, $A_i\subseteq B_i$ for each $1\leqslant i \leqslant p$ and $\Pi_{I_D}((B_1\setminus A_1)\cdots (B_p\setminus A_p) B_{p+1}\cdots B_m)=t$.
\end{lemme}
\begin{proof} By induction on the length of $t$.
\end{proof}
In the following, for $\foata{s}=A_1\cdots A_p$ ($p\geqslant 0$) and $t\in M(\Sigma,D)$, denote by $\foata{s}\parallel t$ the $I_D$-word language $B_1\cdots B_m$ ($m\geqslant p$) such that $A_i\subseteq B_i$ for each $1\leqslant i \leqslant p$ and $\Pi_{I_D}((B_1\setminus A_1)\cdots (B_p\setminus A_p) B_{p+1}\cdots B_m)=t$. Thus $\foata{st}\in \foata{s}\parallel t$, by the lemma above.
\begin{exemple}
Suppose $D=\{(a,a),(b,b)\}$ and consider $s=[aba]$ and $t=[ab]$. Then $\foata{s}=\{a,b\}\{a\}$ and $$\foata{s}\parallel t=\{a,b\}\{a\}\varnothing^*(\{a\}\varnothing^*\{b\}+\{b\}\varnothing^*\{a\}+\{a,b\})\varnothing^*\ \cup\ \{a,b\}\{a,b\}\varnothing^*\{a\}\varnothing^*$$
\end{exemple}
\begin{proof}[Proof of Theorem \ref{FOConfig}]By Proposition \ref{foata} and Lemma \ref{levelautomata}, $\Pi_{\Foata}$ is a bijection from the regular language $\Foata$ onto $M(\Sigma,D)\supseteq V_{\graph_\mathbf{R}}$. We are going to prove that for each $\lambda\in\Lambda$, the $(I_D\ \dot\cup\ \{\sharp\})^2$-word language $L_{\lambda}=\{\foata{[u][v]}\otimes \foata{[u][w]}\mid [u]\in \rond{U},[v]\in \rond{V},[w]\in \rond{W},\ \rond{U}\cdot(\rond{V}\xrightarrow{\lambda} \rond{W})\in \mathbf{R}\}$ is regular.
\\Let $\rond{U}\cdot(\rond{V}\xrightarrow{\lambda} \rond{W})$ be a rule in $\mathbf{R}$. We have to prove that the $(I_D\ \dot\cup\ \{\sharp\})^2$-word language $\{\foata{[u][v]}\otimes \foata{[u][w]}\mid [u]\in \rond{U},[v]\in \rond{V},[w]\in \rond{W}\}$ is regular. By Lemma \ref{ConcatEtFoata} and Remark \ref{RegulierEtAutomatique} and because the intersection of two regular word languages is regular, it suffices to show that the language of $(I_D\ \dot\cup\ \{\sharp\})^2$-words of the form $X\otimes Y$ such that there exists $[u]\in \rond{U}$, $[v]\in \rond{V}$ and $[w]\in \rond{W}$ such that $X\in \foata{[u]}\parallel [v]$ and $Y\in \foata{[u]}\parallel [w]$, is regular. For this, consider the $I_D$-automata $\rond{A}_1$, $\rond{A}_2$ et $\rond{A}_3$ that recognize respectively $\{\foata{u}\mid [u]\in \rond{U}\}$, $\Pi_{I_D}^{-1}(\rond{V})$ and $\Pi_{I_D}^{-1}(\rond{W})$ and define the following $(I_D\ \dot\cup\ \{\sharp\})^2$-automaton.
\begin{itemize}
\item The initial state is $(i_{\rond{A}_1},i_{\rond{A}_2},i_{\rond{A}_3})$
\item the $(I_D\ \dot\cup\ \{\sharp\})^2$-graph is given by
$(p,q,r)\xrightarrow{A\dot\cup B / A\dot\cup C} (p',q',r')$ : $p\xrightarrow[\rond{A}_1]{A} p'$, $q\xrightarrow[\rond{A}_2]{B} q'$, $r\xrightarrow[\rond{A}_3]{C} r'$
$(p,q,r)\xrightarrow{B/C} (\bot,q',r')$ : $p\in F_{\rond{A}_1}\cup \{\bot\}$, $q\xrightarrow[\rond{A}_2]{B} q'$, $r\xrightarrow[\rond{A}_3]{C} r'$
$(p,q,r)\xrightarrow{\sharp/C} (\bot,\bot,r')$ : $p\in F_{\rond{A}_1}\cup \{\bot\}$, $q\in F_{\rond{A}_2}$, $r\xrightarrow[\rond{A}_3]{C} r'$
$(\bot,\bot,r)\xrightarrow{\sharp/C} (\bot,\bot,r')$ : $r\xrightarrow[\rond{A}_3]{C} r'$
$(p,q,r)\xrightarrow{B/\sharp} (\bot,q',\bot)$ : $p\in F_{\rond{A}_1}\cup \{\bot\}$, $r\in F_{\rond{A}_3}$, $q\xrightarrow[\rond{A}_2]{B} q'$
$(\bot,q,\bot)\xrightarrow{B/\sharp} (\bot,q'\bot)$ : $q\xrightarrow[\rond{A}_2]{B} q'$
\item the set of final states is $F=\{(p,q,r)\mid p\in F_{\rond{A}_1}\cup\{\bot\},q\in F_{\rond{A}_2},r\in F_{\rond{A}_3}\}\cup\{(\bot,\bot,r)\mid r\in F_{\rond{A}_3}\}\cup\{(\bot,q,\bot)\mid q\in F_{\rond{A}_2}\}$.
\end{itemize}
\end{proof}
\begin{remarque}\label{cotereg}Suppose $D=\{(a,a),(b,b),(c,c)\}$ and consider the following rewriting rule: $[(ab)^*]([\varepsilon]\xrightarrow{}[(bc)^*])$. Observe that $[(ab)^*]$ and $[(bc)^*]$ are level-regular but not recognizable. Recall that if a relation is word-automatic, then its image is regular (Proposition \ref{projection}). The rewriting graph of this rewriting rule fails to be word-automatic by encoding its vertex set by their Foata normal forms because $\Pi_{\Foata}^{-1}([(ab)^*]\cdot [(bc)^*])$ is not regular.
\end{remarque}
The $\FOAccs$ theory of a RTL graph may fail to be decidable. Indeed, the halting problem of 2-counter Minsky machines can be encoded by RTL graphs.
\begin{prop}\label{Minsky}There exists some RTL graphs that does not have a decidable $\FOAccs$ theory.
\end{prop}
Before proving the proposition above, let us recall some basic definitions about 2-counter Minsky machines.
A 2-counter Minsky machine $M$ of length $n$ is a sequence of $n$ instructions. The $n$-th instruction is a special instruction that halts the machine and for each $k\in\{1,\dots,n-1\}$ the $k$-th instruction is of the form
\begin{tabular}{|lll}
$k:$ & $c:=c+1; \goto(j)$& ($\Incr(c,j)$)\\
\end{tabular}
or
\begin{tabular}{|lll}
$k:$ & $\text{if } c\neq 0 \text{ then } c:=c-1; \goto(j) \text{ else } \goto(l)$&($\Decr(c,j,l)$)
\end{tabular}
\\where $j,l\in\{1,\dots,n\}$ and $c$ is one of the 2 counters.
Configurations of $M$ are the triples $(k,c_1,c_2)\in\{1,\dots,n\}\times \mathbb{N}\times \mathbb{N}$, where $k$ is the instruction number, and $c_1$ and $c_2$ the 2-counter contents. The initial configuration is $(1,0,0)$. A computation is a sequence of configurations starting from the initial configuration and such that two successive configurations respect the instructions. The halting problem is: given a 2-counter Minsky machine, is there a finite computation that halts the machine ?
\begin{theo}[Minsky]
The halting problem of 2-counter Minsky machines is undecidable.
\end{theo}
\begin{proof}[Proof of Proposition \ref{Minsky}]
Given a 2-counter Minsky machine $M$ of length $n$, consider the rewriting graph $G_M$ of the following recognizable trace rewriting system:
\begin{itemize}
\item $\Sigma:=\{\bot_a,\bot_b,a,b,1,\dots,n\}$
\item the independence relation $I$ on $\Sigma$ is given by: $aIb$, $\bot_aI\bot_b$
\item for each $k\in\{1,\dots,n-1\}$ the rewriting rules are:
\begin{itemize}
\item $[k]\xrightarrow{R} [cj]$ ($j\in\{1,\dots,n\}$, $c\in\{a,b\}$) if the $k$-th instruction is $\Incr(c,j)$
\item $[ck] \xrightarrow{R} [j]$
and
$[\bot_ck]\xrightarrow{R} [\bot_cl]$ ($j,l\in\{1,\dots,n\}$, $c\in\{a,b\}$) if the $k$-th instruction is $\Decr(c,j,l)$
\item $[\bot_a\bot_b1]([\varepsilon]\xrightarrow{i}[\varepsilon])$
\item $[n]([\varepsilon]\xrightarrow{f}[\varepsilon])$
\end{itemize}
\end{itemize}
The initial configuration is encoded by $[\bot_a\bot_b1]$. Final configurations are encoded by $[\bot_a\bot_ba^*b^*n]$.
A configuration $(k,c_1,c_2)$ accessible from $[\bot_a\bot_b1]$ is encoded by the trace $[\bot_a\bot_b\overbrace{a\dots a}^{c_1}\overbrace{b\dots b}^{c_2}k]$.
\\The machine $M$ halts if and only if $G_M$ satisfies: $\exists x\exists y (x\xrightarrow{i}x\ \land\ y\xrightarrow{f}y\ \land\ x\xrightarrow{*}y)$.
\end{proof}
\section{Concurrent unfolding of a concurrent automaton}In this section, we consider concurrent automata, that were first introduced in \cite{Shields1997} as asynchronous transition systems, and we prove that the $\FOAccs$ theory of their concurrent unfoldings is decidable. Indeed, we will show that the concurrent unfolding of a concurrent automaton, with the reachability relation is a RTL graph.
Let $(\Sigma,D)$ be a dependence alphabet and $I=\Sigma^2\setminus D$.
\subsection{Concurrent automata}
\begin{df}An $\Sigma$-automaton $\rond{A}=(G,i,F)$ is $D$-concurrent when
\begin{itemize}
\item $G$ is deterministic
\item $((a,b)\in I \text{ and } p\xrightarrow[\rond{A}]{ab}q) \ \Longrightarrow \ p\xrightarrow[\rond{A}]{ba}q$.
\end{itemize}
\end{df}
Every automaton can be seen as a concurrent automaton relatively to the total dependence relation on its edge label set.
\begin{exemple}\label{automateresidu}Let $\rond{L}\subseteq M(\Sigma,D)$ be a trace language. The residual automaton of $\rond{L}$ by $\Sigma$ is the $D$-concurrent $\Sigma$-automaton $\residual{\rond{L}}{\Sigma}$ defined by:
\begin{itemize}
\item the $\Sigma$-graph $\{[u]^{-1}\rond{L}\xrightarrow{a} [ua]^{-1}\rond{L}\mid u\in \Sigma^*, a\in \Sigma\}$
\item the initial state $\rond{L}$
\item final states $[u]^{-1}\rond{L}$ such that $[\varepsilon]\in [u]^{-1}\rond{L}$,
\end{itemize}
is a $D$-concurrent $\Sigma$-automaton that recognises $\cup\rond{L}$ (see Figure \ref{fig:automateresidus}).
\end{exemple}
\begin{exemple}Let $\rond{L}\subseteq M(\Sigma,D)$ be a trace language. The unfolding automaton $U(\rond{L},\Sigma)$ of $\rond{L}$ by $\Sigma$ defined by
\begin{itemize}
\item the Cayley graph of $M(\Sigma,D)$: $\{[u]\xrightarrow{a}[ua]\mid u\in\Sigma^*,a\in \Sigma\}$
\item the initial state $[\varepsilon]$
\item final states $t\in \rond{L}$
\end{itemize}
is a $D$-concurrent $\Sigma$-automaton that recognises $\cup\rond{L}$.
\end{exemple}
\begin{figure}
\centering
\scalebox{0.7}{\includegraphics{residualSigmaBis.eps}}
\caption{$\residual{[(ab)^*]}{\Sigma}$ (Example \ref{automateresidu})}
\label{fig:automateresidus}
\end{figure}
By combining Proposition \ref{Recreg} and Example \ref{automateresidu}, we obtain the following characterization of recognizable trace languages:
\begin{prop}
A trace language $\rond{L}$ is recognizable if and only if there exists a finite $D$-concurrent $\Sigma$-automaton $\rond{A}$ such that $\cup \rond{L}=L(\rond{A})$.
\end{prop}
\subsection{The concurrent unfolding of a concurrent automaton}
\begin{df}
The $D$-unfolding $\U_D(\rond{A})$ of a $D$-concurrent $\Sigma$-automaton $\rond{A}$ is the $D$-concurrent $\Sigma\ \dot\cup\ \{f\}$-graph defined by: $$\U_D(\rond{A})=\{[u]\xrightarrow{a} [ua]\mid u\in \Sigma^*,a\in\Sigma,i\xrightarrow[\rond{A}]{ua}\}\ \cup\ \{[u]\xrightarrow{f} [u]\mid u\in L(\rond{A})\}.$$
\end{df}
In the following example, we introduce the infinite grid tree as the concurrent unfolding of a finite concurrent automaton.
\begin{exemple}
Let $\Sigma=\{a,b,c\}$ and suppose $aIb$. Consider the graph $G=\{p\xrightarrow{a,b,c}p\}$. The $D$-unfolding of $\rond{A}=(G,p,\varnothing)$ (Figure \ref{infinitegridtree}), is the infinite grid (on $\{a,b\}$) tree (see Section \ref{graphtree}) and has a decidable $\FOAccs$ theory by the theorem below.
\end{exemple}
Before stating the main result of this section, recall that the unfolding of a finite graph is a regular tree whose monadic second-order theory is decidable (since unfolding preserves monadic second-order decidability). Here, we consider a notion of concurrent unfolding and we apply this graph transformation to a wider class than the class of finite graphs.
\begin{theo}\label{FOReach}
If $\rond{A}$ is a finite $D$-concurrent automaton, then the $\FOAccs$ theory of $\U_D(\rond{A})$ is decidable.
\end{theo}
We do not know if, in general, the $D$-unfolding preserves $\FOAccs$ decidability.
\begin{proof}[Proof of Theorem \ref{FOReach}]
Consider the $\Sigma\ \dot \cup\ \{*\}$-automaton
$$\U_D(\rond{A})_*:=\U_D(\rond{A})\cup\{[u]\xrightarrow{*} [uv]\mid u,v\in \Sigma^*,i\xrightarrow[\rond{A}]{uv}\}$$
It is the rewriting graph of the following recognizable trace rewriting system:
\smallskip
$\left\{
\begin{array}{l}
[L(G,i,Q_a)]([\varepsilon]\xrightarrow{a} [a]) \ \ a\in \Sigma\ \text{ and }\ Q_a=\{q\in Q\mid q\xrightarrow[\rond{A}]{a}\}\\
[L(G,i,F)]([\varepsilon]\xrightarrow{f} [\varepsilon])\\
[L(G,i,q)]([\varepsilon]\xrightarrow{*} [L(G,q,Q)]) \ \ q\in Q.\\
\end{array} \right.$
\end{proof}
\begin{figure}
\centering
\scalebox{0.7}{\includegraphics{arbregrilleUFC.eps}}
\caption{The infinite grid tree}
\label{infinitegridtree}
\end{figure}
\begin{remarque}Given a $\Sigma$-graph $G$, the $\FO$ theory of the graph $G\cup\{p\xrightarrow{\rond{L}}q\mid p\xrightarrow{u}q, [u]\in \rond{L},\rond{L}\in \REC(M(\Sigma,D))\}$ is refered to as the first-order theory with recognizable reachability predicates ($\FO[\REC]$) of $G$. We can strengthen the last theorem and show that: if $\rond{A}$ is a finite $D$-concurrent automaton, then $\U_D(\rond{A})$ has a decidable $\FO[\REC]$ theory. Indeed, observe that each sentence in $\FO[\REC]$ logic contains a finite number of atomic formula $x\xrightarrow{\rond{L}_1}y$,\dots, $x\xrightarrow{\rond{L}_n}y$ ($n\geqslant 1$). Then $\U_D(\rond{A})\cup\{p\xrightarrow{\rond{L}_j}q\mid p\xrightarrow{u}q, [u]\in \rond{L}_j,j\in\{1,\dots ,n\}\}$ is the rewriting graph of the following RTL:
\begin{center}
$\left\{
\begin{array}{l}
[L(G,i,Q_a)]([\varepsilon]\xrightarrow{a} [a]) \ \ a\in \Sigma\ \text{ and }\ Q_a=\{q\in Q\mid q\xrightarrow[\rond{A}]{a}\}\\
[L(G,i,F)]([\varepsilon]\xrightarrow{f} [\varepsilon])\\
[L(G,i,q)]([\varepsilon]\xrightarrow{\rond{L}_j} [L(G,q,Q)]\cap \rond{L}_j) \ \ q\in Q \ \ j\in \{1,\dots,n\}.\\
\end{array} \right.$
\end{center}
\end{remarque}
We have deduced the $\FO[\REC]$ theory decidability of the Cayley graph of a trace monoid from the $\FO$ decidability of RTL graphs. The following remark shows the inverse reduction.
\begin{remarque}\label{forec}
Lastly, note that any rewriting graph of a recognizable trace rewriting system (with recognizable contexts) on some trace monoid $M(\Sigma,D)$ is a $\FO[\REC]$ interpretation of the Cayley graph of this trace monoid. Indeed, observe that the neutral element is $\FO$-definable: $\neutral(x)=\forall t \bigwedge_{a\in\Sigma}\lnot(t\xrightarrow{a}x)$. Then for each rule of the form $\rond{U}\cdot(\rond{V}\xrightarrow{}\rond{W})$ consider the formula: $\phi(x,y)=\exists i\exists z(\neutral(i)\ \land\ i\xrightarrow{\rond{U}}z \land z\xrightarrow{\rond{V}}x \land z\xrightarrow{\rond{W}}y)$.
\end{remarque}
\subsection{Regular trace event structure} In \cite{DBLP:conf/lics/Madhusudan03}, Madhusudan proves that the $\FO$ theory of a regular trace event structure is decidable. For this, he shows that the vertex set and the relations of such a graph can be encoded by a recognizable trace language on a judicious dependence alphabet. Note that, due to the level-regular contexts, this technique does not allow to prove that the $\FO$ theory of RTL graphs is decidable.
A trace $t=[a_1\cdots a_n]\in M(\Sigma,D)$ is \emph{prime} if the set $\{1,\dots,n\}$, partially ordered by the relation $E$ defined by $iEj$ if and only if $i<j$ and $a_iDa_j$, has exactly one maximal element.
Let $\rond{L}\subseteq M(\Sigma,D)$ be a trace language. Denote by $\premiere(\rond{L})$ the set of prime traces in $\rond{L}$.
\begin{df}
The event structure defined by $\rond{L}$, $\StructEv_{\rond{L}}$, is the $\{\leqslant,\sharp,(\lambda_a)_{a\in\Sigma} \}$-graph whose vertex set is $\premiere(\rond{L})$ defined by
\begin{itemize}
\item $t\xrightarrow{\leqslant} t'$ : $t\sqsubseteq t'$
\item $t\xrightarrow{\sharp} t'$ : $\forall t''\in \premiere(\rond{L})(t\not\sqsubseteq t'' \lor t'\not\sqsubseteq t''))\}$
\item $t\xrightarrow{\lambda_{a}} t$ : $\text{the maximal element of }t \text{ is }a$.
\end{itemize}
\end{df}
\begin{theo}[\cite{DBLP:conf/lics/Madhusudan03}]If $\rond{L}\in \REC(M(\Sigma,D))$, then $\StructEv_{\rond{L}}$ has a decidable $\FO$ theory.
\end{theo}
\begin{proof}
A trace $t\in V_{\U_D(\residual{\rond{L}}{\Sigma})_*}$ is prime if and only if $t$ is not successor of two distinct vertices of $\U_D(\residual{\rond{L}}{\Sigma})_*$. Since this last property is $\FO$ expressible, the event structure $\StructEv_{\rond{L}}$ can be obtained by a $\FO$ interpretation of $\U_D(\residual{\rond{L}}{\Sigma})_*$, that has a decidable $\FO$ theory.
\end{proof}
\section{Graph tree}\label{graphtree}
In this section, we consider ground term rewriting graphs. These graphs have a decidable $\FOAccs$ theory \cite{DBLP:conf/lics/DauchetT90}. We define a notion of graph tree and we prove that if a graph tree is a ground term rewriting graph (GTR graph), then it is finitely decomposable by size. A direct consequence is that the infinite grid tree, defined above as the concurrent unfolding of a concurrent automaton (Exemple \ref{infinitegridtree}), is not a GTR graph, although it has a $\FOAccs$ theory decidable.
\subsection{Ground Term Rewriting graphs (GTR graphs)}
A \emph{position} is an element of $\mathbb{N}^*$, the set of finite words over $\mathbb{N}$. Denote by $\sqsubseteq$ the prefix ordering over $\mathbb{N}^*$. Let $F$ be a ranked alphabet (each symbol in $F$ has an arity in $\mathbb{N}$). A \emph{term $t$ on $F$} is a partial function $t:\mathbb{N}^*\longrightarrow{F}$ whose domain, $\pos(t)$, has the following properties: \begin{itemize}
\item $\pos(t)\neq\varnothing$
\item $\pos(t)$ is prefix closed \item $\forall u\in \pos(t)$, if the arity of $t(u)$ is $n$ ($n\geqslant 0$), then $\{j\mid uj\in\pos(t)\}=\{1,\dots,n\}$.
\end{itemize}
The \emph{size} $\taille{t}$ of a term $t$ is the number of its nodes. The \emph{subterm} of $t$ at position $u$, denoted $\ssterme{t}{u}$, is the term on $F$ defined by: \begin{itemize}
\item $\pos(\ssterme{t}{u})=\{v\in \mathbb{N}^*\mid uv\in\pos(t)\}$
\item $\forall v\in \pos(\ssterme{t}{u})$, $(\ssterme{t}{u})(v)=t(uv)$.
\end{itemize}
If $u\in\pos(t)$ and $s$ is a term, then \emph{$t\sub{u}{s}$}, the term obtained from $t$ by replacing the subterm $\ssterme{t}{u}$ by $s$, is defined by : $$t\sub{u}{s}(v)=\left\{\begin{aligned}
&s(w) \text{ if } v=uw \text{ and } w\in \pos(s)\\
&t(v) \text{ if }v\in\pos(t) \text{ and }u\not \sqsubseteq v\end{aligned}\right.$$
If $t$ is a term on $F$ and $u\in\pos(t)$, then the \emph{context of $t$ at the position $u$} is the term $t\sub{u}{x}$ on $F\ \dot\cup\ \{x\}$, where $x$ is a constant \textit{i.e} the arity of $x$ is 0.
A \emph{context} $C$ on $F$ is a term on $F\ \dot\cup\ \{x\}$, $x$ constant, such that there exists a unique position $u_C\in\pos(C)$ for which $C(u_C)=x$. If $t$ is a term on $F$, then the term $C[t]$ on $F$ is defined by $C[t]:=C\sub{u_C}{t}$. The size $\taille{C}$ of a context $C$ on $F$ is the number of its nodes minus 1.
A \emph{ground term rewriting system} $\GTrs{R}$ is a $4$-tuple $\GTrs{R}=(F,\Sigma,R,i)$ where:\begin{itemize}
\item $F$ is a ranked alphabet \item $\Sigma$ is a label alphabet
\item $R:={\displaystyle \bigcup_{a\in\Sigma}} R_a$, where for each $a\in \Sigma$, $R_a$ is a finite set of rules of the form $s\xrightarrow{a}s'$ with $s$ and $s'$ distinct terms on $F$
\item $i$ is an initial $F$-term.
\end{itemize}
We write: \begin{itemize}
\item $t\xrightarrow[\GTrs{R}]{a}t'$ if there exists a position $p\in \pos(t)$ and a rule $s\xrightarrow{a}s' \in R_a$ such that $\ssterme{t}{p}=s$ and $t'=t\sub{p}{s'}$
\item $t\xrightarrow[\GTrs{R}]{}t'$ when there exists $a\in \Sigma$ such that $t\xrightarrow[\GTrs{R}]{a}t'$
\item $\xrightarrow[\GTrs{R}]{*}$ for the reflexive and transitive closure under composition of $\xrightarrow[\GTrs{R}]{}$.
\end{itemize}
The \emph{configuration graph} $\graph_{\GTrs{R}}$ of $\GTrs{R}$ is the $\Sigma$-graph defined by $$\graph_{\GTrs{R}}:=\{t\xrightarrow[\GTrs{R}]{a}t'\mid i\xrightarrow[\GTrs{R}]{*}t,a\in \Sigma\}$$
A graph is called Ground Term Rewriting graph (GTR graph) if it is isomorphic to the configuration graph of a ground term rewriting system.
\begin{remarque}\label{loop}GTR graphs have no loop since each rule in the rewriting system has distinct left hand side and right hand side.
\end{remarque}
\begin{exemple}
The infinite grid is a GTR graph (see Figure \ref{grilleinfinieGTRS}).
\end{exemple}
\begin{figure}
\centering
\scalebox{0.7}{\includegraphics{grilleGTRSUFC.eps}}
\caption{The infinite grid is a GTR graph}
\label{grilleinfinieGTRS}
\end{figure}
In \cite{DBLP:conf/lics/DauchetT90}, Dauchet and Tison prove that a GTR graph with the reachability relation is tree-automatic. Thus:
\begin{theo}[ \cite{DBLP:conf/lics/DauchetT90}]
GTR graphs have a decidable $\FOAccs$ theory.
\end{theo}
\subsection{Finite decomposition of a graph}
Let us start by recalling the definition of the frontier of a subgraph.
\begin{df}\label{frontiere}
Let $G$ be a graph and $H\subseteq G$ a subgraph of $G$. The frontier of $H$ (in $G$) is $\Fr(H)=V_H \cap V_{G-H}$.
\end{df}
The frontier of $H$ is the set of $H$-vertices that are incident to an edge in $G-H$.
Let $\graph_{\GTrs{R}}$ be a GTR graph. For each $n\geqslant0$, $$G_n:=\{s\xrightarrow{e}t\in \graph_{\GTrs{R}}\mid \taille{s}<n \text{ or } \taille{t}<n\}$$
According to Definition \ref{frontiere}, the frontier of $\graph_{\GTrs{R}}-G_n$ is $\Fr({\graph_{\GTrs{R}}}-G_n)=V_{{\graph_{\GTrs{R}}}-G_n}\cap V_{G_n}$. And the frontier of $K$, a connected component of ${\graph_{\GTrs{R}}}-G_n$, is $\Fr(K)=\Fr({\graph_{\GTrs{R}}}-G_n)\cap V_K$. The frontier of $K$ is formed by the $K$-vertices incident to an edge in $G_n$.
\medskip
The graph $\graph_{\GTrs{R}}$ is \emph{finitely decomposable by size} if $$\dec:=\{(K,\Fr(K))\mid K \text{ connected component of } \graph_{\GTrs{R}}-G_n, n\geqslant 0\}$$ has finite index, for the isomorphism relation.
\begin{theo}[\cite{DBLP:conf/birthday/Caucal08}]\label{finitelydecomposable}
If a countable graph is finitely decomposable by size, then it is at the first level of the pushdown hierarchy. In particular, it has a decidable MSO theory.
\end{theo}
\subsection{Graph tree and finite decomposition}
\begin{df}Let $G$ be a $\Sigma$-graph and $p_0\in V_G$. Given a new symbol $c\notin \Sigma$, the $G$-tree from $p_0$ is the $\Sigma\ \dot\cup\ \{c\}$-graph, $\arbre{G}{p_0}$, defined by $$\arbre{G}{p_0}:=\{up\xrightarrow{a}uq\mid u\in V_G^*, p\xrightarrow[G]{a}q\}\cup\{u\xrightarrow{c}up_0\mid u\in V_G^*\}$$
\end{df}
\begin{exemple}
See Figure \ref{arbredemidroite} for the semi-line tree.
\end{exemple}
\begin{figure}
\centering
\scalebox{0.6}{\includegraphics{arbredemidroiteUFC.eps}}
\caption{The semi-line tree}
\label{arbredemidroite}
\end{figure}
\begin{remarque}\label{cdeterminisme}
The graph $\arbre{G}{p_0}$ is $c$-deterministic: $$(v\xrightarrow[\arbre{G}{p_0}]{c}v_1\text{ and }v\xrightarrow[\arbre{G}{p_0}]{c}v_2)\Longrightarrow v_1=v_2$$\end{remarque}
\begin{remarque}
The graph $\arbre{G}{p_0}$ is a tree if and only if $G$ is a tree.\end{remarque}
\begin{remarque}Let $(\Sigma,D)$ be a dependence alphabet, $G$ a finite $D$-concurrent $\Sigma$-graph and $p_0\in V_G$. The $\Sigma\ \dot \cup\ \{c\}$-graph defined by $G\cup \{p\xrightarrow{c}{p_0}\mid p\in V_G\}$ is $D_c$-concurrent, with $D_c=D\ \cup\ (\Sigma \cup\{c\})\times(\Sigma \cup\{c\})$. Its $D_c$-unfolding from $p_0$ is $\arbre{\U_D(G,p_0)}{p_0}$.
\end{remarque}
\begin{theo}\label{theoprincipal}
If $\arbre{G}{p_0}$ is a GTR graph, then $\arbre{G}{p_0}$ is finitely decomposable by size.\end{theo}
The MSO theory of the infinite grid is undecidable. The same holds for the infinite grid tree. By combining Theorem \ref{theoprincipal} and Theorem \ref{finitelydecomposable}, we deduce the corollary below.
\begin{corollaire}
The infinite grid tree is not a GTR graph.
\end{corollaire}
\subsection{Proof of Theorem \ref{theoprincipal}}
\begin{lemme}\label{reecincomp}Let $G$ be a $\Sigma$-graph and $p_0\in V_G$. If there exists a ground term rewriting system $\GTrs{R}=(F,\Sigma,R,i)$ such that $\arbre{G}{p_0}$ is isomorphic to $\graph_{\GTrs{R}}$, then for every term $t\in V_{\graph_{\GTrs{R}}}$, there exists a smallest position $u_t$ (for the prefix ordering $\sqsubseteq$) at which $t$ is incident to a rewriting in $\graph_{\GTrs{R}}$.
\end{lemme}
\begin{proof}[Proof of Lemma \ref{reecincomp}]
It suffices to prove that if there exists two incomparable positions $u'$ and $u''$ at which $t$ is incident to rewritings, then there exists a position $v$, $v\sqsubseteq u'$, $v\sqsubseteq u''$ at which $t$ is incident to a rewriting.
Denote by $e'$ (respectively $e''$) the label of the rewriting $t$ is incident in position $u'$ (respectively $u''$). We are going to show that $c\notin \{e',e''\}$. Since $u'$ and $u''$ are incomparable and because of Remark \ref{loop}, there exists two paths between two distinct vertices of $\graph_{\GTrs{R}}$, labelled by $e'e''$ and $e''e'$, each of them with no loop (see Figure \ref{reecincompdessin}). This is possible in $\arbre{G}{p_0}$ only if $c\notin \{e',e''\}$. Indeed,
\begin{itemize}
\item $\{e',e''\}\subseteq \{c\}$ is impossible because of Remark \ref{cdeterminisme}
\item $e'=c$ and $e''\in\Sigma$ (or the converse $e''=c$ and $e'\in\Sigma$) is impossible because $c$ and $e''$ do not commute in $\arbre{G}{p_0}$.
\end{itemize}
\begin{figure}
\centering
\psset{arrowsize=5pt}
\psset{xunit=0.95cm,yunit=0.95cm}
\begin{pspicture}(0,0)(5,4)
\pscircle[linewidth=2pt](2,2){1.6}
\psline(1,1.2)(2,3.4)(3.2,1.2)(1,1.2)
\psline(2,3.4)(2,2.6)(1.6,1.6)
\psline(1.6,1.6)(1.4,1.2)
\psline(1.6,1.6)(2,1.2)
\psline(1.8,2)(2.4,1.8)
\psline(2.4,1.8)(2.2,1.2)
\psline(2.4,1.8)(2.6,1.2)
\rput(1.4,1.6){{\tiny $u'$}}
\rput(2.2,1.7){{\tiny $u''$}}
\psline[linestyle=dashed,linewidth=.4pt](2,2.6)(3.4,2.6)
\psline{->}(3.5,2.6)(5,2.6)
\rput(4.2,2.8){{$c$}}
\psline[linestyle=dashed,linewidth=.4pt](2.4,1.8)(3.6,1.8)
\psline(3.6,1.8)(4.8,1.8)
\rput(4.2,2){$e''$}
\psline[linestyle=dashed,linewidth=.4pt](1.6,1.6)(3.2,1)
\psline(3.2,1)(4.4,0.6)
\rput(4,1){$e'$}
\end{pspicture}
\begin{pspicture}(0,-1)(3,3)
\rput(1,1){\rnode{t}{$t$}}
\rput(0,0){\rnode{u}{$t'$}}
\rput(2,0){\rnode{v}{$t''$}}
\rput(1,-1){\rnode{w}{$\bullet$}}
\psset{nodesep=2pt}
{\scriptsize
\ncline[arrows=->]{t}{u}\nbput{$e'$}\ncline[arrows=->]{t}{v}\naput{$e''$}
\ncline[arrows=->]{u}{w}\nbput{$e''$}\ncline[arrows=->]{v}{w}\naput{$e'$}
}
\rput(1,2.4){\rnode{A}{$t'\xleftarrow[u']{e'}t\xrightarrow[u'']{e''}t''$}}
\ncline[nodesep=4pt,linewidth=2pt,arrows=->]{A}{t}
\end{pspicture}
\hfill\begin{pspicture}(0,-1)(3,3)
\rput(1,1){\rnode{t}{$t$}}
\rput(0,0){\rnode{u}{$t'$}}
\rput(2,0){\rnode{v}{$t''$}}
\rput(1,-1){\rnode{w}{$\bullet$}}
\psset{nodesep=2pt}
{\scriptsize
\ncline[arrows=->]{u}{t}\naput{$e'$}\ncline[arrows=->]{v}{t}\nbput{$e''$}
\ncline[arrows=->]{w}{u}\naput{$e''$}\ncline[arrows=->]{w}{v}\nbput{$e'$}
}
\rput(1,2.4){\rnode{A}{$t'\xrightarrow[u']{e'}t\xleftarrow[u'']{e''}t''$}}
\ncline[nodesep=4pt,linewidth=2pt,arrows=->]{A}{t}
\end{pspicture}
\hfill\begin{pspicture}(0,-1)(3,3)
\rput(1,1){\rnode{t}{$t$}}
\rput(0,0){\rnode{u}{$t'$}}
\rput(2,0){\rnode{v}{$t''$}}
\rput(1,-1){\rnode{w}{$\bullet$}}
\psset{nodesep=2pt}
{\scriptsize
\ncline[arrows=->]{u}{t}\naput{$e'$}\ncline[arrows=->]{t}{v}\naput{$e''$}
\ncline[arrows=->]{u}{w}\nbput{$e''$}\ncline[arrows=->]{w}{v}\nbput{$e'$}
}
\rput(1,2.4){\rnode{A}{$t'\xrightarrow[u']{e'}t\xrightarrow[u'']{e''}t''$}}
\ncline[nodesep=4pt,linewidth=2pt,arrows=->]{A}{t}
\end{pspicture}
\caption{Paths in $\graph_{\GTrs{R}}$ between two distinct vertices, labelled by $e'e''$ and $e''e'$}
\label{reecincompdessin}
\end{figure}
But there exists a position $v$ at which the term $t$ is incident to a rewriting labelled by $c$. Due to the precedent point, the position $v$ must be comparable to positions $u'$ and $u''$. Since $u'$ and $u''$ are not comparable, we deduce that $v\sqsubseteq u'$ and $v\sqsubseteq u''$.
\end{proof}
\begin{proof}[Proof of Theorem \ref{theoprincipal}]
Let $\GTrs{R}=(F,\Sigma,R,i)$ be a ground term rewriting system such that $\arbre{G}{p_0}$ is isomorphic to $\graph_{\GTrs{R}}$. We have to show that $$\dec:=\{(K,V_K\cap V_{G_n})\mid K \text{ connected component of } \graph_{\GTrs{R}}-G_n, n\geqslant 0\}$$ has finite index. Let $\delta:=\max\{\lvert\taille{d}-\taille{g}\rvert\mid g\xrightarrow{e}d\in R\}$ and $M:=\max\{\taille{g},\taille{d}\mid g\xrightarrow{e}d\in R\}$. We are going to show that for each connected component $K$ in $\dec$, there exists a position $u_K$ and a context $C_K$ such that \begin{itemize}
\item for every term $t\in V_K$, $u_K\in \pos(t)$ and $C_K$ is the context of $t$ at the position $u_K$ ($t=C_K[\ssterme{t}{u_K}]$)
\item for every term $t\in \Fr_{\graph_{\GTrs{R}}}(K)$, $\taille{\ssterme{t}{u_K}}<M+\delta$.
\end{itemize}Then the finite subset of the (finite) set of terms whose size is at most $M+\delta$, obtained from $\Fr_{\graph_{\GTrs{R}}}(K)$ by removing the context $C_K$, is
characteristic of the isomorphy type of $(K,\Fr_{\graph_{\GTrs{R}}}(K))$. Indeed,
for $K\in \dec$, let $\widetilde{K}:=\{s\mid C_K[s]\in \Fr_{\graph_{\GTrs{R}}}(K)\}$. If $\widetilde{K}=\widetilde{K'}$, then $(K,\Fr_{\graph_{\GTrs{R}}}(K))$ and $(K',\Fr_{\graph_{\GTrs{R}}}(K'))$ are isomorphic \textit{via} $C_K[s]\mapsto C_{K'}[s]$.
\medskip
Let $K\in \dec$ and $n\geqslant 0$ such that $K$ is a connected component of $\graph_{\GTrs{R}} - G_n$. Remark that for every $t\in \Fr_{\graph_{\GTrs{R}}}(K)$, $n\leqslant \taille{t}< n+\delta$. In particular, $\Fr_{\graph_{\GTrs{R}}}(K)$ is finite.
\\Let $m_K:=\min\{\taille{t}\mid t\in V_K\}$. Thus $n\leqslant m_K$. Consider $\distinguer{t}\in V_K$ such that $\taille{\distinguer{t}}=m_K$. Since $\distinguer{t}$ is not an isolated vertex in $K$, there exists a position at which $\distinguer{t}$ is incident to a rewriting in $K$. Let $\distinguer{u}$ be the smallest prefix of this position such that $\taille{\ssterme{\distinguer{t}}{\distinguer{u}}}\leqslant M$. The term $\distinguer{t}$ can be written $\distinguer{t}=\distinguer{C}[\ssterme{\distinguer{t}}{\distinguer{u}}]$, with $\distinguer{C}$ a context.
We are going to prove that each term $t\in V_K$ is defined at position $\distinguer{u}$ and the context of $t$ at $\distinguer{u}$ is $\distinguer{C}$. It is sufficient to prove the following claim.
\begin{affirmation}\label{contexte}Let $t\in V_K$. The position $\distinguer{u}$ is prefix of every position at which the term $t$ is incident to a rewriting in $K$.
\end{affirmation}
Let $t\in \Fr_{\graph_{\GTrs{R}}}(K)$. Recall that $n\leqslant\taille{t}<n+\delta$. Since $\taille{\ssterme{t}{\distinguer{u}}}=\taille{t}-\taille{\distinguer{C}}$, we deduce
$\taille{\ssterme{t}{\distinguer{u}}}<n+\delta-\taille{\distinguer{C}}\leqslant m_K+\delta-\taille{\distinguer{C}}$. But we have $m_K-\taille{\distinguer{C}}=\taille{\ssterme{\distinguer{t}}{\distinguer{u}}}\leqslant M$.
It follows that $\taille{\ssterme{t}{\distinguer{u}}}< M+\delta$.
\end{proof}
\begin{proof}[Proof of Claim \ref{contexte}]
Suppose (as it is the case for the term $\distinguer{t}$) that there exists a position $u$ at which a term $t$ is incident to a rewriting in $K$ such that $\distinguer{u}\sqsubseteq u$
and the context of $t$ at $\distinguer{u}$ is $\distinguer{C}$. We are going to prove that if $v$ is a position at which $t$ is incident to a rewriting in $K$, then $\distinguer{u}\sqsubseteq v$. Since $K$ is connected, the claim will be proved.
First, remark that there does not exist a position $p$ smaller than $\distinguer{u}$ at which $t$ is incident to a rewriting (in $\graph_{\GTrs{R}}$): since $t\in V_K$ and $\distinguer{t}$ (which has minimal size in $V_K$) have the same context $\distinguer{C}$, we have $\taille{\ssterme{t}{\distinguer{u}}}\geqslant \taille{\ssterme{\distinguer{t}}{\distinguer{u}}}$ and thus $\taille{\ssterme{t}{p}}\geqslant \taille{\ssterme{\distinguer{t}}{p}}>M$. We deduce that if there exists a position $p$ at which $t$ is incident to a rewriting and such that $p$ and $u$ are comparable, then $\distinguer{u}\sqsubseteq p$.
Then, consider the smallest position $u_{t}$ at which the term $t$ is incident to a rewriting (Lemma \ref{reecincomp}).
By the previous point, we have $\distinguer{u}\sqsubseteq u_{t} \sqsubseteq u$. Thus $\distinguer{u}\sqsubseteq v$.
\end{proof}
\section{Conclusion}
We have shown that a RTL graph is word-automatic and thus its first-order theory is decidable. We have also shown that such a graph does not have a decidable $\FOAccs$ theory. Furthermore, we have shown that the concurrent unfolding of a concurrent automaton with the reachability relation is a RTL graph and therefore its $\FOAccs$ theory is decidable. Lastly, we have shown that the class of concurrent unfoldings of finite concurrent automata is not included in the class of GTR graphs since the infinite grid tree is not a GTR graph.
Summing up, we have extended the first level of the pushdown hierarchy that consists of suffix rewriting graphs of recognizable word rewriting systems, to RTL graphs. Graphs at the first level of the pushdown hierarchy are the monadic interpretations of regular trees, that are concurrent unfoldings of finite concurrent automata for a trivial dependence relation. A RTL graph is $\FO[\REC]$ interpretation of the Cayley graph of the underlying trace monoid (Remark \ref{forec}), that is the concurrent unfolding of a finite concurrent automaton. But we do not know whether reciprocally an $\FO[\REC]$ interpretation of a concurrent unfolding of a finite concurrent automaton is a RTL graph. We do not either know whether the concurrent unfolding transformation preserves $\FOAccs$ decidability. Another interesting problem would be to extend the second level of the pushdown hierarchy.
\newpage
\nocite{*}
\bibliographystyle{eptcs}
| {'timestamp': '2018-10-08T02:04:24', 'yymm': '1810', 'arxiv_id': '1810.02471', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02471'} | arxiv |
\section{Introduction and related work}
Among the many virtues of deep neural networks is their {\em transferability}: One can train a model for a task ({\em e.g.,} finding cats and dogs in images), and then use it for another ({\em e.g.,} outlining tumors in mammograms) with relatively little effort. Sometimes it works. Alas, little is known on how to predict whether or not such \emph{transfer learning} or \emph{domain adaptation} will work, and if so how much effort is going to be needed, without just trying-and-seeing -- a process that has been referred to as ``alchemy''. It is not a given that training on a sufficiently rich task, and then fine-tuning on anything else, must succeed. Indeed, slight changes in the statistics of the data can make the optimal solution to a task {\em unreachable} \cite{achille2018critical}.%
\footnote{We introduce the notion of \emph{reachability} of a task in \Cref{sec:dynamic-distance}.}
At the most fundamental level, understanding transfer learning or domain adaptation requires understanding the \emph{topology and geometry of the space of tasks.} When are two tasks ``close''? Can one measure the distance between tasks without actually running an experiment? Does knowing this distance help predict whether transfer learning is possible, and if so how many resources will be needed?
This has motivated recent interest in defining distances between classification tasks, but there are shortcomings. Architecture independent distances, such as lexicographic distances between label sets in a taxonomy, fail to capture the complex learning dynamics of deep neural networks (DNNs), which can fail in adapting to slight perturbations of the data distributions, even if the task variable remains identical \cite{achille2018critical}. On the other hand, distances between parametric representations of a task, for instance the weights of DNNs trained on them, fail to capture that very different parameters can represent the exact same posterior distribution. In order to relate to transfer learning, a distance function would have to be asymmetric \cite{mennucci2007asymmetric} as it is typically easier to fine-tune a simple task from a complex one than vice-versa. Such distances can be defined \textit{a posteriori} by looking at the performance of fine-tuning \cite{zamir2018taskonomy}, which however fails to highlight whether the datasets themselves have a distance structure, and how this interacts with the training process of the deep network.
In this paper, we tackle both questions. We use the results of \cite{achille2019information}, which introduces an intrinsic asymmetric distance on the space of learning tasks based on the amount of structure one needs to learn, and which is independent of the particular learning algorithm. While such a ``static distance'' gives qualitatively good results in many cases \cite{achille2019task2vec}, it does not fully capture problems, particularly of domain adaption, where even nearby tasks may be \emph{unreachable} with fine-tuning \cite{achille2018critical}. We then show how the \emph{dynamics} of the learning process, that is, of SGD, interact with the topology of the space of learning tasks, and in particular how the distance between learning tasks relates to transfer learning.
We therefore characterize the probability and expected training time of reaching one task from another, using mathematical tools from physics, in particular Kramer's rate theory \cite{kramers1940brownian, caroli1981diffusion} and the path-integral approach \cite{hunt1981path}, which allows us to model the probability of different paths that SGD may easily take to reach a a solution to the task. We then show that, to first approximation, the transition probability from the solution to a first task (pre-training) to the solution of a second task (fine-tuning) factorizes into two parts. Surprisingly, one turns out to be precisely the intrinsic ``static'' distance on the space of tasks. The other, which we call {\em dynamic} distance, depends on the existence in the loss-landscape of likely path that the optimization procedure (SGD) can use to {\em reach} a task from another. It should be noted that, while the asymptotic dynamics of SGD are well studied \cite{chaudhari2018stochastic}, our focus is on the initial convergence phase, that has received relatively little attention in the literature thus far.
Finally, we verify empirically that the distance we define correlates with the ease of transfer learning and the convergence time on a task.
\section{Preliminaries and notation}
In supervised learning, we are given a training dataset $\mathcal{D} = \set{(x_i,y_i)}_{i=1,\ldots,N}$ of $N$ samples, where $x_i \in \mathcal{X}$ is the observed input data ({\em e.g.}, an image) and $y_i \in \mathcal{Y}$ is an hidden random variable, our \emph{task} that we are training to reconstruct ({\em e.g.}, a label).
A Deep Neural Network trained is a family of functions, parametrized by \emph{weights} $w$, that encodes a posterior probability $p_w(y|x)$ of the task variable $y$ given the input.
The weights $w$ are usually optimized to minimize the cross-entropy loss $L_\mathcal{D}(w) = \mathbb{E}_{(x,y) \sim \mathcal{D}}[-\log p_w(y|x)]$ on the training set $\mathcal{D}$.
Exploiting the additive structure of $L_\mathcal{D}(w)$, the cross-entropy loss is usually minimized using \textit{stochastic gradient descent} (SGD), which, rather than performing gradient descent using the full gradient $\nabla_w L_\mathcal{D}(w)$, updates the weights $w$ with a cheaper gradient estimate computed from a small number of samples (mini-batch). That is, $w_{k+1} = w_k - \eta \nabla \hat{L}_{\xi_k}(w)$,
where $\xi_k$ are the indices of a randomly sampled mini-batch of size $|\xi_k| = B$, and
$\hat{L}_{\xi_k}(w) = \frac{1}{|\xi_k|} \sum_{i \in \xi_k} [-\log p_w(y_i|x_i)]$.
Notice that the mini-batch gradient $\nabla \hat{L}_{\xi_k}(w)$ is an unbiased estimate of the real gradient, \textit{i.e.}\@\xspace, $\mathbb{E}_{\xi_k}[\nabla \hat{L}_{\xi_k}(w)] = \nabla L(w)$. Hence, we can think of $\nabla L_{\xi_k}(w)$ as a noisy version of the real gradient.
This allows us to rewrite the update equation of SGD as
\begin{equation}
\label{eq:sgd-diffusion}
w_{k+1} = w_k - \eta \nabla \hat{L}_{\xi_k}(w_k) + \sqrt{\eta}\, T_{\xi_k}(w_k),
\end{equation}
where we have introduced the noise term $T_{\epsilon_k}(w) = \sqrt{\eta}\,\big(\nabla \hat{L}_{\xi_k}(w) - \nabla L(w)\big)$. Written in this form, \cref{eq:sgd-diffusion} is a Langevin diffusion process \cite{li2015stochastic,chaudhari2018stochastic}, a fact that plays a central role in our analysis. While it is known that the noise term $T_{\xi_k}(w_k)$ is non-Gaussian and non-isotropic for standard DNNs \cite{chaudhari2018stochastic}, modeling $T_{\xi_k}(w_k)$ as uncorrelated white noise still provides useful intuitions in the analysis of SGD while simplifying the theoretical analysis.
In the limit of small step-size, \cref{eq:sgd-diffusion} can be approximated as the continuous stochastic process \cite{li2015stochastic}:
\[\dot{w} = f(w) + \sqrt{2 D} n(t),\]
where $D \propto \eta/B$ is a dissipation constant. We use this approximation in throughout the paper.
We also make use of the Kullbach-Liebler (\textit{KL}) divergence $\KL{p(x)}{q(x)}$ between distributions $p(x)$ and $q(x)$, which is defined as $\KL{p(x)}{q(x)} := \mathbb{E}_{x\sim p(x)}\big[\log (p(x)/q(x))\big]$. We recall that the KL-divergence is always non-negative, and it is zero if and only if $p(x) = q(x)$ \cite{cover2012elements}. Intuitively, it measures the (asymmetric) similarity between two distributions. Given a family of conditional distributions $p_w(y|x)$ parametrized by a vector $w$, we can ask how much a small perturbation $\delta w$ of the parameters $w$ will change the distribution. To second-order, the divergence between the original and perturbed distribution is given by
\[F:=\mathbb{E}_x\KL{p_w(y|x)}{q_{w+\delta w}(y|x)} = \delta w^t F \delta w + o(\|\delta w\|^2)\]
where $F$ is the \textit{Fisher Information Matrix}, defined as
\[F = \mathbb{E}_{x, y\sim p(x)p_w(y|x)}[\nabla \log p_w(y|x)^t\nabla \log p_w(y|x)] = \mathbb{E}_{x\sim p(x)p_w(y|x)}[- \nabla^2_w \log p_w(y|x)].\]
For its relevant properties see, \textit{e.g.}\@\xspace, \cite{martens2014new}. Notice that the Fisher depends on the ground-truth data distribution $p(x,y)$ only through the domain variable $x$, not the \emph{task variable} $y$, since $y\sim p_w(y|x)$ is sampled from the model distribution when computing the Fisher.
\section{The Structure Function of a Task}
We consider a learning task to be implicitly defined by the training dataset $\mathcal{D} = \{ x_i, y_i\}_{i=1}^N$ and loss function that is provided to us. A natural question is when two different tasks $\mathcal{D}$ and $\mathcal{D}'$ are close to each other. Note that two datasets may not share any sample, yet define the same task. Moreover, most of the information contained in the dataset will usually be about nuisances (such as the foliage of the trees, objects in the background), which are not relevant for the task, which furthers complicates defining a distance on the information that actually matters.
To address these problems, \cite{achille2019information}, based on previous work by \cite{vereshchagin2004kolmogorov} on algorithmic information theory, introduces a notion of \emph{structure} of a task, which serves to separate nuisance variability from the task-relevant information. They then define the (asymmetric) distance between two tasks as the amount of additional structure one needs to learn in order to solve the second task given a solution to the first.
Formally, for a given prior $P(w)$ the Structure Function of a dataset is defined by:
\begin{equation}
\label{eq:structure-function}
S_{\mathcal{D}}(t) = \min_{\KL{Q(w|\mathcal{D})}{P(w)} < t} \mathbb{E}_{w \sim Q(w|\mathcal{D})}[L_\mathcal{D}(w)].
\end{equation}
where the minimization is done over a ``posterior'' distribution $Q(w|\mathcal{D})$ over the weights, which can depend on the dataset $\mathcal{D}$. Intuitively, the structure function express the optimal trade-off between information stored in the parameter of the model and error in the task. Since precisely codifying a parameter vector $w$ requires infinite information, we allow a ``noisy'' parameter distribution $Q(w|\mathcal{D})$. Then, $\KL{Q(w|\mathcal{D})}{P(w)}$ represent the amount of bits to encode $Q(w|\mathcal{D})$ relative to the prior.
As we increase the amount of information that we store in the model, we can fit the dataset progressively better and $S_\mathcal{D}(t) \to 0$. However, this is subject to a diminishing return where more and more information needs to be encoded, in order to reduce the loss. To study this trade-off, it is useful to introduce the Lagrangian corresponding to the minimization problem of \cref{eq:structure-function}:
\begin{equation}
\label{eq:kl-complexity}
C_\beta(\mathcal{D}; P, Q) = \mathbb{E}_{w \sim Q(w|\mathcal{D})}[L_\mathcal{D}(p_w(y|x))] + \beta \KL{Q(w|\mathcal{D})}{P(w)}.
\end{equation}
\cite{achille2019information} shows that there is a critical value of the Lagrange multiplier $\beta$, such that the model stops encoding structural information about the task, that is, information features that can generalize, and starts memorizing nuisances of the training set. This suggests defining the Information in the Weights that minimizes $C_\beta(\mathcal{D}; P, Q)$ for $\beta$ as the amount of structural information of the task at level $\beta=1$.
Notice that this quantity is closely related to the Information Bottleneck of the Weights studied in \cite{achille2017emergence}, to PAC-Bayes theory \cite[Theorem 2]{mcallester2013pac}. In particular, for $\beta=1$, it reduces to the Evidence Lower Bound (ELBO) of Variational Inference.
\section{Static distance between tasks}
\label{sec:reachability}
Given two datasets, $\mathcal{D}_1$ and $\mathcal{D}_2$, we may consider the dataset $\mathcal{D}_1 \cup \mathcal{D}_2$ obtained by concatenating them. The amount of extra information that we need to learn $\mathcal{D}_2$ after learning $\mathcal{D}_1$ is the difference in structure between $\mathcal{D}_1 \cup \mathcal{D}_2$ and $\mathcal{D}_1$, suggesting the following definition of distance \cite{achille2019information}
\[
d_\beta(\mathcal{D}_1 \to \mathcal{D}_2) = C_\beta(\mathcal{D}_1 \cup \mathcal{D}_2; P) - C_\beta(\mathcal{D}_1; P),
\]
where $C_\beta(\mathcal{D}; P) = \min_{Q(w|\mathcal{D})} C_\beta(\mathcal{D}; P, Q)$.
Depending on the choice of the prior $P(w)$, we can obtain different instantiations of $C_\beta(\mathcal{D}; P, Q)$ and hence of the distance $d_\beta(\mathcal{D}_1 \to \mathcal{D}_2)$. A particularly appealing choice, both for its simplicity and its connections to SGD dynamics as we will show later, is to pick a Gaussian prior $P(w) = N(0, \lambda^2 I)$ and a Gaussian posterior $Q(w|\mathcal{D})=N(w_0, \Sigma)$, in which case we have the closed-form expression:
\[
\KL{Q(w|\mathcal{D})}{P(w)} = \frac{1}{2} \bra{\frac{w_0^2}{\lambda^2} + \frac{1}{\lambda^2} \tr{\Sigma} + k \log{\lambda^2} + \log(|\Sigma|) - k},
\]
We now are interested in finding the distribution $Q(w|\mathcal{D})$ that minimizes $C_\beta(\mathcal{D}; P, Q)$. Of course, finding the optimal weights $w_0$ is far from trivial, as it involves training a deep network on the dataset. However, we can give a description of the optimal $\Sigma$ for a weight configuration $w_0$: Approximating $C_\beta(\mathcal{D}; P, Q)$ to the second order at $w_0$ and minimizing in $\Sigma$, we obtain the minimizer:
\[\Sigma^*=\frac{\beta}{2} (H + \frac{\beta}{2\lambda^2} I)^{-1},\]
where $H$ is the Hessian of $L_\mathcal{D}(w)$. Using this, we obtain the following expression for $C_\beta(\mathcal{D}; P, Q)$ as a function of the local minimum $w_0$:
\begin{equation}
\label{eq:approximated-beta-complexity}
C_\beta(w_0) = C_\beta (\mathcal{D}; Q, P) = L_\mathcal{D}(w_0) + \frac{\beta}{2} \bra{\frac{\norm{w_0}^2}{\lambda^2} + \log \left|\frac{2\lambda^2}{\beta} H + I \right|},
\end{equation}
where $H$ is computed in $w_0$. As this approximation requires $H$ to be positive semi-definite, which it may not always be, we follow \cite{martens2014new} and rather use the Fisher Information Matrix as a robust positive semi-definite approximation of $H$. Note that this links the ``information complexity'' of the task to the local curvature of the loss landscape at that point. that is, its Hessian or its Fisher Information.
\section{The Dynamic Distance between tasks}
\label{sec:dynamic-distance}
In the previous section, we defined a notion of a ``static'' distance between tasks that is independent of the optimization algorithm used.
But how difficult is it for a SGD to find a solution to task $\mathcal{D}_2$ starting from task $\mathcal{D}_1$? That is, how difficult is it to fine-tune? In this section, we approximate the dynamics of SGD to quantify the extent in which the static distance and the learning dynamics affect the ease of fine-tuning.
Consider a network trained with the $L_2$ regularized loss $U(w) = L_\mathcal{D}(w) + \gamma/2 \norm{w}^2$.
By taking the continuous limit of \cref{eq:sgd-diffusion}, that is, by letting the step size go to zero, we obtain that sample paths evolve according to the stochastic differential equation (SDE) \cite{li2015stochastic}
\[\dot{w} = f(w) + \sqrt{2 D} n(t),\]
where $f(w) = \nabla U(w)$, $D$ is a constant and $n$ is the derivative of a Wiener process.
Given the SDE, we can derive a probability functional over paths, using the Martin-Siggia-Rose formalism. More precisely, the probability of a path $w(t): \mathbb{R} \to \mathcal{W}$ starting from $w_0$ at time $t_0$ is given by \cite{caroli1981diffusion}:
\begin{equation}
\label{eq:msr}
p(w(t)|w_0, t_0) = e^{-S(w(t))} = e^{-\int_{t_0}^{t_f} \L(w(t), \dot{w}(t)) dt},
\end{equation}
where we have defined the Onsager-Machlup Lagrangian
\begin{equation}
\L(w(t), \dot{w}(t)) = \frac{1}{4D} \norm{\dot{w}(t) - f(w)}_2^2 + \frac{1}{2}\div f(w).
\end{equation}
Notice that the density function in \cref{eq:msr} penalizes paths whose speed does not match the gradient $f(w)$, and adds a correction based on the divergence of the gradient field in order to account for concentrating or dissipating effects of the potential, which relates to the curvature of the energy $U$.
One of the main objects of interest for us is the transition probability $p(w_f,t_f|w_0, t_0)$ between two points $w_0$ and $w_f$ in time $\Delta t = t_f - t_0$. This can be expressed, given the probability distribution over paths, as
\begin{equation}
\label{eq:transition}
p(w_f,t_f|w_0, t_0) = \int_{w_0}^{w_f} p(w(t)|w_0, t_0) dw(t) = \int_{w_0}^{w_f} e^{-\int_{t_0}^{t_f} \L(w(t), \dot{w}(t)) dt} d w(t),
\end{equation}
where the integral is over all paths $w(t)$ such that $w(t_0)=w_0$ and $w(t_f) = w_f$. That is, the probability of reaching $w_f$ at the given time is the mass or ``volume'' of all paths reaching $w_f$. Estimating this, gives us information on which part of the loss landscape are easily {\em accessible}, or reachable, via SGD in a given training time.
Intuitively, we may expect the probability of reaching a point to depend on two separate factors: The energy gap between the initial and final configurations, as well as the existence of probable paths connecting them. To see this formally, notice that the path density \cref{eq:msr} can be rewritten using the Stratonovic convention \cite{karatzas2012brownian} as
\begin{align*}
p(w(t)|w_0, t_0)
&= e^{-\int_{t_0}^{t_f} \L(w(t), \dot{w}(t)) dt} \\
&= e^{-\int_{t_0}^{t_f} \frac{1}{4D} \norm{\dot{w}(t) - f(w)}_2^2 + \frac{1}{2} \div f(w) dt} \\
&= e^{-\int_{t_0}^{t_f} \frac{1}{4D} [\dot{w}(t)^2 -2 f(w)\dot{w}(t) + f(w)^2] + \frac{1}{2} \div f(w) dt}\\
&= e^{-\frac{1}{2D} [U(w(t_f)) - U(w(t_0)] } e^{-\frac{1}{2D}\int_{t_0}^{t_f} \frac{1}{2} [\dot{w}(t)^2 + f(w)^2] + D \div f(w) dt},
\end{align*}
We define the \emph{effective potential} $V(w)$ as
\begin{equation}
V(w) = \frac{1}{2} f(w)^2 + D \div f(w) = \frac{1}{2} \nabla U(w)^2 - D \nabla^2 U(w),
\end{equation}
so we can write
\begin{equation}
p(w(t)|w_0, t_0) = e^{-\frac{1}{2D}
\Delta U} e^{-\frac{1}{2D}\int_{t_0}^{t_f} \frac{1}{2} \dot{w}(t)^2 + V(w(t)) dt}.
\end{equation}
\subsection{Reachability of a task}
Substituting this expression in \cref{eq:transition}, we obtain a corresponding decomposition for the transition probability
\begin{equation}
\label{eq:decomposition}
p(w_f,t_f|w_0, t_0) = \utext{e^{-\frac{1}{2D}
[U(w_f) - U(w_0)]} }{Static potential} \int_{w_0}^{w_f} \utext{ e^{-\frac{1}{2D}\int_{t_0}^{t_f} \frac{1}{2} \dot{w}(t)^2 + V(w(t)) dt}}{Reachability} dw(t).
\end{equation}
The first part is \emph{static} in the sense that it depends only on the initial and final configurations and is independent of the path used to reach it.
The second factor measures existence of likely paths $w(t)$ connecting the two points. It is called reachability because, regardless of how large the drop in static potential, the absence of probable paths makes transfer learning unlikely to succeed.
\subsection{Curvature, most likely paths and Lagrange approximation}
In principle, reachability depends both on the task ({\em i.e.,} the data), and the architecture. However, we will now show that to first-order approximation it depends only on information theoretic quantities. In particular, we show that, to first approximation, the most likely path is deterministic and follows an effective potential $U_{\text{\textit{eff}}}(w) = U(w) - D \log |\H U(w)|_+$, where $|\H U(w)|_+$ denotes the determinant of the positive part of the Hessian, \textit{i.e.}, the product of all positive eigenvalues. That is, {\em the potential needs to be corrected in order to account for the local curvature and the amount of correction depends on the temperature. }
One consequence of this fact is that sharp minima may not be minima at all for this particular potential when the temperature is sufficiently high. We will also show that the dynamic part of the potential can create spurious local minima that can inhibit learning of new problems in a transfer learning scenario. We will later also connect the curvature to the amount of information needed to solve a task. Using this connection, we will be able to characterize the {\em ``learnability''} (reachability) of a task in terms of information-theoretic properties of the data. This completes our program of characterizing the geometry and topology of the space of tasks in a manner that does not depend on how the task is actually learned.
To start, we make a Lagrange (or Saddle Point) approximation: given two points $w_0$ and $w_f$, we assume that the probability concentrates around a few most likely paths joining $w_0$ and $w_f$ that are local maxima of the probability density functional. In other words, all probable paths can be obtained as a perturbation of a few critical paths (or activation trajectories). If the critical paths are sufficiently separated, we can estimate the total probability by approximating each cluster as a Gaussian centered around the cluster maximum.
The local maxima of $p(w(t)|w_0, t_0)$ can then be found by minimizing the action $S(w(t))$ in \cref{eq:msr} (or equivalently the simplified action in \cref{eq:decomposition}). Using the Euler-Lagrange equation $d/dt \partial_{\dot{w}} \L(w,\dot{w}) = \partial_w \L(w,\dot{w})$, we obtain that critical paths satisfy the differential equation
\begin{align*}
\ddot{w}(t) = \nabla V(w(t)) = \nabla \bra{ \frac{1}{2} \nabla U(w(t))^2 - D \nabla^2 U(w(t)) },
\end{align*}
where the effective potential $V(w)$ is the same that appears in the decomposition in \cref{eq:decomposition}.
We observe that the Laplacian $ \nabla^2 U(w(t))$ of the potential $U(w)$ acts as a drag term in this expression. Therefore, depending on the temperature, the critical paths move more slowly when the curvature increases, which will play a role later.
For ease of exposition, let us assume for the moment that there is only one critical path $w_c(t)$ between $w_0$ and $w_f$ that satisfies the above equations. Furthermore, let us assume that the path is along a coordinate axis, so that we can expand the potential up to second order around the path as
\[
U(u, \v) = a(u) + \frac{1}{2} \v \cdot b(u) \v.
\]
The Lagrangian associated with this process is
\begin{align}\label{eq:full_toy_Lagrangian}
\L(w, \dot{w})
=& \frac{1}{2D}\left\{ \frac{1}{2}[\dot{\v}^2 + b(u)\v]^2 - \tr[b(u)] \right\} + \frac{1}{2D}\left\{\frac{1}{2}[\dot{u}^2 + a'(u)]^2 - D a''(u) \right\} + \nonumber\\
&\left\{ \frac{[\v\cdot b'(u) \v]^2 }{16D} + \frac{[\dot{u}^2 + a'(u)][\v\cdot b'(u) \v]}{4D} - \frac{1}{2}\v\cdot b''(u) \v\right\}
\end{align}
The first term in eq.~\eqref{eq:full_toy_Lagrangian} accounts for the diffusion along the $\v$ direction. The third therm contains both derivatives of $b(u)$ and second-order terms in ($\v$); we can neglect it if we assume the validity of the saddle point approximation and that $b''(u) \ll b^2(u)/D$, that is, that the $b(u)$ varies slowly enough. Since we are mainly interested in the dynamics along the $u$ coordinate, we can integrate out the variable $\v$ from
eq.~\eqref{eq:msr}. We then obtain
\begin{equation}\label{eq:eq_marinalization_of_p}
p(u(t)|u_0, t_0) \approx e^{-\frac{1}{2D}\int\left\{\frac{1}{2}[\dot{u}^2 + a'(u)]^2 - D a''(u) \right\}dt}\int_{\v(0)=0}^{\v(T)=0} e^{-\frac{1}{2D}\int\left\{ \frac{1}{2}[\dot{\v}^2 + b(u)\v]^2 - \tr[b(u)] \right\}dt} d\v
\end{equation}
When the diffusion in the $\v$ direction is much faster than the dynamics along $u$,
we can replace the integral with the local equilibrium distribution of $\v$ at a fixed $u$. The final expression for the marginalized probability density is
\begin{equation}\label{eq:eq_marginalization_of_p}
p(u(t)|u_0, t_0) \approx e^{-\frac{1}{2}\log(2\pi|b|)}e^{-\frac{1}{2D}\int\left\{\frac{1}{2}[\dot{u}^2 + a'(u)]^2 - D a''(u) \right\}dt}.
\end{equation}
Under this approximation, and introducing an effective potential $U_{\text{\textit{eff}}}(w) = U(w) + D \log |\H U(w)|$ we finally obtain that the probability of reaching a point $w_f$ in a given time $t_f$ is given by
\begin{equation}
\label{eq:decomposition-marginalized}
p(w_f,t_f|w_0, t_0) = e^{-\frac{1}{2D} \Delta
U_{\text{\textit{eff}}}(w)} \int_{w_0}^{w_f} e^{-\frac{1}{2D}\int_{t_0}^{t_f} \frac{1}{2} \dot{u}(t)^2 + V(u(t)) dt} d u(t).
\end{equation}
This is critical, as it shows that both the speed and probability of convergence are controlled by the effective potential $U_{\text{\textit{eff}}}= U(w) - D \log |\H U (w)|$, which corrects the original potential by a term that depends on both the \emph{diffusion coefficient} (which scales as $D=k/B$, where $B$ is the batch-size and $k$ is a constant that depends on the architecture), and the \emph{curvature} (determinant of the Hessian) at that point.
That is, {\em to account for reachability, the potential needs to be corrected with the local curvature, and the amount of correction depends on the temperature.} One consequence of this is the often observed fact that sharp minima may not be minima at all for this particular potential when the temperature is sufficiently high (recall that, for a fixed learning rate, the diffusion coefficient scales as $D=k/B$, where $B$ is the batch-size and $k$ is a constant that depends on the architecture). Moreover, this suggests that the dynamic part of the potential can create spurious local minima that can inhibit learning of new problems in a transfer learning scenario \cite{achille2018critical}.
However, \cref{eq:decomposition-marginalized} still depends on the geometry of the optimization landscape, rather than properties intrinsic to the task.
We now connect the curvature to the amount of information needed to solve a task. Using this connection, we are able to characterize the {\em ``learnability''} (reachability) of a task in terms of information-theoretic properties of the data. This completes our program of characterizing the geometry and topology of the space of tasks in a manner that, to first approximation, does not depend on how the task is actually learned.
\section{Information, Curvature and Kramer's Rate}
\label{sec:kramers}
To establish a link between the curvature $U_{\text{\textit{eff}}}(w) = U(w) + D \log|\H U(w)|$ and the structure function of the task, note that when the network is trained with weight decay, with coefficient $\gamma$, the effective potential $U_{\text{\textit{eff}}}$ minimized by the network is given by:
\[
U_{\text{\textit{eff}}} = U + D \log |\H U (u)| = L_\mathcal{D}(w) + \frac{\gamma}{2} \norm{w}^2 + D \log |\gamma I + H(w)|,
\]
where $H(w)$ is the hessian of the cross entropy loss $L_\mathcal{D}(w)$. By letting $\beta = 2\lambda^2 \gamma$ we obtain that the effective potential that affects the network while training with SGD is exactly the complexity $C_\beta(w;\mathcal{D})$ of the dataset at level $\beta$. Therefore, we may rewrite the first (static) term of the transition probability in \cref{eq:decomposition-marginalized} as:
\begin{equation}
\label{eq:static-complexity}
p(w_f,t_f|w_0, t_0)_\text{static} = e^{-\frac{1}{2D} \Delta
C_\beta(\mathcal{D};P,Q)}.
\end{equation}
This has the important implication that the transition probability is upper-bounded by a static part that depends solely on the complexity of the task, or more generally on the difference in complexity between tasks when fine-tuning. To this, however, we must add a dynamic term that also depends on the architecture of the network and the geometry of the loss landscape, and may in general be non-trivial and further reduce the reachability of a task.
From \cref{eq:decomposition-marginalized} and \Cref{eq:static-complexity}, we can derive the Kramer's convergence rate $1/\tau_K$, which is the expected time of convergence to a minimum, as
\begin{equation}
\label{eq:kramers-rate}
1/\tau_K = C e^{-\frac{1}{D}\Delta C_\beta(w;\mathcal{D})}.
\end{equation}
That is, \emph{the expected time of convergence scales with the difference in complexities between tasks}.
\section{Empirical validation}
\label{sec:experiments}
\begin{figure}
\centering
\includegraphics[width=0.3\linewidth]{pictures/corrupted_labels_plot.pdf}
\includegraphics[width=0.3\linewidth]{pictures/batch_size_plot.pdf}
\includegraphics[width=0.34\linewidth]{pictures/convergence_time.pdf}
\caption{\textbf{(Left)} Plot of the time needed for an AlexNet model to converge, against the number of corrupted random labels added to CIFAR-10. Corrupting labels in the dataset increases the quantity of information that the network needs to store (memorize) in order to fit the dataset (minimize the loss below a given threshold.)
Correspondingly, \cref{eq:eq_marginalization_of_p} predicts an increase of the time to convergence.
Tthe trend of the empirical curve (blue) follows the theoretical prediction (green), where the parameters of the coefficients (\textit{e.g.}\@\xspace, dissipation constant $D$) are fitted from the data.
\textbf{(Center)} Changing the batch size $B$ changes the dissipation constant $D \propto \eta/B$, and correspondingly, by \cref{eq:eq_marginalization_of_p}, changes the time to convergence.
\textbf{(Right)} For several architectures, we plot the time needed for the network to converge (minimize the loss $U$ below a certain threshold) against the estimated complexity of the task, measured by \cref{eq:kl-complexity} using a Gaussian prior and posterior.
}
\label{fig:convergence-time}
\end{figure}
\subsection{Convergence time for different datataset}
In \Cref{sec:kramers} we have seen that the Kramer's rate for convergence, in first approximation and ignoring the contribution of the dynamic part of the transition probability, is given by \eqref{eq:kramers-rate}.
This gives an empirically verifiable law to test our model: In \Cref{fig:convergence-time} (right) we plot the time (number of SGD steps) needed by different architectures to converge on several different datasets. We can see that, as expected, different architectures have different parameters that regulate how the complexity affects the convergence time but for a fixed architecture and hyperparameters, the time to converge mainly depends on the complexity of the task alone.
\textbf{Random labels.} The case of random labels is of particular theoretical interest since, provided the value of $\beta$ is below a critical point to allow memorization of the label, the complexity $C_\beta(w;\mathcal{D})$ scales linearly with the amount of random labels. In \Cref{fig:convergence-time} (left) we show that, in accordance with our model prediction, the time to converge scales with the complexity of the dataset, \textit{i.e.}, in this case with the amount of random labels in the dataset.
\textbf{Changing the batch size.} Another way we can act on the time to converge is to change the diffusion constant $D$ of the network: We know that for a fixed learning rate the diffusion constant scales as $D=c/B$, where $B$ is the batch size. \Cref{fig:convergence-time} (center) shows that changing the batch size changes the time to convergence, following the predicted trend.
\subsection{Time to fine-tune between tasks}
In the previous section we tested the relation between the complexity of the task and the time employed by the network to converge, starting from a random initialization. In practice, we may start from the minimizer of another task, rather than from a random initialization (fine-tuning). In this case, we expect the time to converge to depend not on the complexity of the task, but rather on the reachability of the new task from the previous task (\Cref{sec:reachability}).
In \Cref{fig:task-distance} (Left) we show for several popular datasets the reachability between tasks computed using the definition in \Cref{sec:reachability} and approximated with a ResNet-18 using \cref{eq:approximated-beta-complexity}. Notice that this matrix makes intuitive sense: semantically similar tasks are closer to each other, \textit{e.g.,} CIFAR-100 is close to CIFAR-10 and to its two subsets of artificial and natural objects. Similarly, Fashion MNIST (fashion) is close to color inverted Fashion MNIST (ifashion) and to MNIST. Moreover the matrix captures the fact that it is generally easier to learn a task after training on a more complex, related, task (such as going from CIFAR-100 to CIFAR-10), rather than trying to learn a complex task starting from a simple one (\textit{e.g.,} going from MNIST to CIFAR-100).
From \cref{eq:kramers-rate} and \cref{eq:static-complexity} we know that the distance at level $\beta$ may be compared with the matrix of the time necessary to fine-tune from one task to another (\textit{i.e}., the training time until we reach some loss threshold), which we show in \Cref{fig:task-distance} (Center). In \Cref{fig:task-distance} (Right) we show the relation between time to fine-tune and reachability for several pairs of datasets, which again follows the theoretical prediction between the two.
\begin{figure}
\centering
\includegraphics[width=.28\linewidth]{pictures/distance_matrix_p2.pdf}\
\includegraphics[width=.28\linewidth]{pictures/finetuning_p2.pdf}\
\includegraphics[width=.28\linewidth]{pictures/convergence_time_scatter.pdf}
\caption{
\textbf{(Left)} Reachability between tasks, based on the relative complexity. Each element of the matrix shows the time to convergence when fine-tuning from a pre-training classification task (columns) to a target task (rows). White cells denote no convergence. Notice that semantically similar task are close to each other, and that it is easier to go from a complex task to a related simple task than vice-versa. \textbf{(Center)} Training epochs necessary to fine-tune from one task (row) to another (column). \textbf{(Right)} Scatter plot of the relation between number of steps necessary to converge and the reachability of two datasets.
}
\label{fig:task-distance}
\end{figure}
\section{Discussion}
In this paper we have laid the foundations to enable quantifying the ease of transfer learning. This entails first defining and formally characterizing tasks, and then establishing some sort of topology in the space of tasks. To the best of our knowledge, we are the first to attempt this. We bring to bear tools from diverse fields, from Kolmogorov Complexity to quantum physics, to enable defining and computing sensible notions of distance that correlate with ease of transfer learning. In the process, we discover interesting connections between seemingly disparate concepts:
The first is between the notion of task reachability, which we introduce, and the Kolmogorov Structure Function. This in turn is related to information-theoretic treatments of deep learning that have been recently developed \cite{achille2017emergence}. Furthermore, our analysis points to the importance of analyzing the dynamics of learning, rather than just focusing on the asymptotics, which confirms recent empirical discoveries in critical periods and the notion of Information Plasticity \cite{achille2018critical}.
\bibliographystyle{plain}
| {'timestamp': '2019-05-30T02:09:56', 'yymm': '1810', 'arxiv_id': '1810.02440', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02440'} | arxiv |
\section{Introduction}
Directed acyclic graphical (DAG) models, also referred to as Bayesian networks, are popular probabilistic statistical models to analyze and visualize (functional) causal or directional dependence relationships among random variables.(see e.g.,~\citealp{kephart1991directed,friedman2000using, doya2007bayesian, peters2014identifiability}).
However, learning DAG models from only observational data is a notoriously difficult problem due to non-identifiability and exponentially growing computational complexity. Prior works have addressed the question of identifiability for different classes of joint distribution $\P(G)$. \cite{frydenberg1990chain} and \cite{heckerman1995learning} show the Markov equivalence class (MEC) where graphs that belong to the same MEC have the same conditional independence relations. \cite{spirtes2000causation}, \cite{chickering2003optimal}, \cite{tsamardinos2003towards} and \cite{zhang2016three} show that the underlying graph of a DAG model is recoverable up to the MEC under faithfulness or related assumptions that can be very restrictive~\citep{uhler2013geometry}.
Also well studied is how learning a DAG model is computationally non-trivial due to the super-exponent-\\ially growing size of the space of DAGs in the number of nodes. Hence, it is NP-hard to search DAG space~\citep{chickering1994learning, chickering1996learning}, and many existing algorithms such as PC~\citep{spirtes2000causation}, Greedy Equivalence Search (GES)~\citep{chickering2003optimal}, Min-Max Hill Climbing (MMHC)~\citep{tsamardinos2006max} and Greedy DAG Search (GDS)~\citep{peters2014identifiability}, take greedy search methods that may not guarantee to recover the true MEC.
Recently, a number of fully identifiable classes of DAG models have been introduced \citep{shimizu2006linear,hoyer2009nonlinear, peters2012identifiability,peters2014identifiability, park2015learning, park2017learning, ghoshal2018learning, park2019identifiability}. In addition, some of these models can be successfully learned from high-dimensional data by decomposing the DAG learning problem into ordering estimation and skeleton estimation~\citep{shimizu2011directlingam, buhlmann2014cam, ghoshal2017learning, drton2018causal}. The main reasoning is that if ordering is known or recoverable, learning a directed graphical model is as hard as learning an undirected graphical model or Markov random field (MRF). \cite{meinshausen2006high}, \cite{wainwright2006high}, \cite{ravikumar2011high} and \cite{yang2015graphical} show that sparse undirected graphs can be estimated via $\ell_1$-regularized regression in high-dimensional settings under suitable conditions.
In this paper, we focus on learning Poisson DAG models~\citep{park2015learning, park2017learning} for multivariate count data in high-dimensional settings since large-scale multivariate \emph{count data} frequently arises in many fields, such as high-throughput genomic sequencing data, spatial incidence data, sports science data, and disease incidence data. Like learning the Poisson undirected graphical model or MRF introduced in~\cite{yang2015graphical}, where the sample bound is $\Omega(d_{m}^2 \log^3 p)$, it is not surprising that Poisson DAG models can be learned in high dimensional settings when the indegree of the graph $d$ is bounded. \cite{park2017learning} establishes the consistency of learning Poisson DAG models with the sample bound $n = \Omega(\max\{ d_{m}^4 \log^{12} p, \log^{5+d} p\} )$ where $d_m$ is the maximum degree of the moralized graph and $d$ is the maximum indegree of a graph. This huge sample complexity difference between directed and undirected graphical models is induced mainly for three reasons: (i) nonexistence ordering, (ii) the known parametric functional form (the standard log link) for the dependencies, and (iii) the restrictive non-positive parameter space in Poisson MRFs (see details in \citealp{yang2015graphical}).
The main objective of this work is to propose a new milder identifiability assumption for Poisson DAG models, and to develop a new polynomial time approach, called Moments Ratio Scoring (MRS), for learning a high-dimensional Poisson structural equation models (SEM), that is a Poisson DAG model where the parametric functional form for the dependencies is known while the parameters are unbounded and unknown. We address the question of learning high-dimensional Poisson SEMs under the causal sufficiency assumption that all relevant variables have been observed. However, we do not require the sparse moralized graph and faithfulness assumption that might be restrictive~\citep{uhler2013geometry}.
The MRS algorithm combines the idea of the mean-variance (moments) relation for recovering an ordering, and the sparsity-encouraging $\ell_1$-regularized regression in finding the parents of each node. We provide its sufficient conditions and sample complexity $n = \Omega( d^{2} \log^{9} p)$ under which the MRS algorithm recovers the Poisson SEM with a high probability in the high-dimensional $p > n$ setting. The sample complexity of $n = \Omega( d^{2} \log^{9} p)$ is close to the information-theoretic limit of $\Omega( d \log p )$ for learning sparse DAG models with any exponential family distributions~\citep{ghoshal2017information}. We point out that the sample complexity does not depend on the maximum degree of the moralized graph, $d_m$, but on the indegree of a DAG, $d$. Since a sparse directed graph does not necessarily lead to the sparse moralized graph (e.g., a star graph in Fig.~\ref{fig:star}), to the best of our knowledge, the proposed algorithm is the most efficient and probable for learning sparse Poisson SEMs.
We demonstrate through simulations and a real baseball data application involving multivariate count data that our MRS algorithm performs better than state-of-the-art OverDispersion Scoring (ODS)~\citep{park2015learning}, GES~\citep{chickering2003optimal}, MMHC~\citep{tsamardinos2006max}, and Poisson MRF learning (PMRF) algorithms~\citep{yang2015graphical}, on average, in terms of the both run-time and accuracy of recovering a graph structure and its MEC. In our simulation study, we consider both the extremely sparse ($d=1$) and sparse ($d=10$) high-dimensional settings. Our real data example involving MLB player statistics for 2003 season shows that our MRS algorithm is applicable to multivariate count data while the PMRF algorithm finds too many edges, and the MMHC algorithm tends to select very few edges when variables represent counts. We also investigate the accuracy of our MRS algorithm when samples are generated from general Poisson DAG models and (truncated) Poisson MRFs. The simulation results empirically verify that the MRS algorithm can consistently recover the true edges.
\subsection{Our Contributions}
We summarize the major contributions of the paper as follows:
\begin{itemize}
\item We introduce a milder identifiability condition for Poisson DAG models for multivariate count data.
\item We develop the reliable and scalable lasso-based MRS algorithm which learns sparse high-dimensional Poisson SEMs.
\item We provide the more realistic conditions for learning Poisson SEMs in Section~\ref{SecTheo}.
\item We also provide the sample complexity $n = \Omega( d^{2} \log^{9} p)$ under which the MRS algorithm recovers the Poisson SEM. We emphasize that our theoretical result does not depend on the degree of the moralized graph $d_m$, and hence, the MRS algorithm can recover a graph with hub nodes in the high dimensional setting.
\end{itemize}
To the best of our knowledge, our MRS algorithm is the only provable and realistic method that applies for the high-dimensional multivariate count data when samples are from Poisson SEMs with hub nodes. We must point out that such improved assumptions and sample complexity are not only from our new identifiability condition, but from the additional constraints on the standard log link function for the dependencies.
The remainder of this paper is structured as follows. Section~\ref{SecProb} summarizes the necessary notations and problem settings, Section~\ref{SecPoisson} discusses the Poisson DAG model and its new identifiability condition, and Section~\ref{SecComparison} provides a detailed comparison between Poisson DAG models and MRFs. In Section~\ref{SecAlgorithm}, we introduce our polynomial-time DAG learning algorithm, which we refer to as the Moments Ratio Scoring (MRS). Section~\ref{SecComp} discusses computational complexity of our algorithm, and Section~\ref{SecTheo} provides statistical guarantees for learning Poisson SEMs via the MRS algorithm. Section~\ref{SecNume} empirically evaluates our methods, compared to state-of-the-art ODS, GES, and MMHC algorithms using synthetic data, and confirms that our algorithm is one of the few DAG-learning algorithms that performs well in terms of statistical and computational complexity in low and high-dimensional settings. In addition, we investigate how well the MRS algorithm learns general Poisson DAG models and (truncated) Poisson MRFs using synthetic data. Section~\ref{SecReal} compares our MRS algorithm to the Poisson MRF and MMHC algorithm by analyzing a real 2003 season MLB multivariate count data. Lastly, Section~\ref{SecFuture} discusses some future works.
\section{Poisson DAG Models}
\label{SecClass}
We first introduce some necessary notations and definitions for DAG models. Then, we give a detailed description of previous work on learning Poisson DAG models~\citep{park2015learning}, and we propose a strictly milder identifiability condition. Lastly, we discuss how Poisson DAG models and MRFs~\citep{yang2015graphical} are related.
\subsection{Problem Set-up and Notations}
\label{SecProb}
A DAG $G = (V, E)$ consists of a set of nodes $V = \{1, 2, \cdots, p\}$ and a set of directed edges $E \subset V \times V$ with no directed cycles. A directed edge from node $j$ to $k$ is denoted by $(j,k)$ or $j \rightarrow k$. The set of \emph{parents} of node $k$, denoted by $\mbox{Pa}(k)$, consists of all nodes $j$ such that $(j,k) \in E$. If there is a directed path $j\to \cdots \to k$, then $k$ is called a \emph{descendant} of $j$, and $j$ is an \emph{ancestor} of $k$. The set $\mbox{De}(k)$ denotes the set of all descendants of node $k$. The \emph{non-descendants} of node $k$ are $\mbox{Nd}(k) := V \setminus (\{k\} \cup \mbox{De}(k))$. An important property of DAGs is that there exists a (possibly non-unique) \emph{ordering} $\pi = (\pi_1, ...., \pi_p)$ of a directed graph that represents directions of edges such that for every directed edge $(j, k) \in E$, $j$ comes before $k$ in the ordering. Hence, learning a graph is equivalent to learning the ordering and the skeleton that is the set of directed edges without their directions.
We consider a set of random variables $X := (X_j)_{j \in V}$ with a probability distribution taking values in a sample space $\mathcal{X}_{V}$ over the nodes in $G$. Suppose that a random vector $X$ has a joint probability density function $P(G) = P(X_1, X_2, ..., X_p)$. For any subset $S$ of $V$, let $X_{S} :=\{X_j : j \in S \subset V \}$ and $\mathcal{X}_{S} := \times_{j \in S} \mathcal{X}_{j}$ where $\mathcal{X}_{j}$ is a sample space of $X_j$. For any node $j \in V$, $\P(X_j \mid X_{S})$ denotes the conditional distribution of a variable $X_j$ given a random vector $X_{S}$. Then, a DAG model has the following factorization~\citep{lauritzen1996graphical}:
\begin{equation}
\label{eq:factorization}
\P(G) = \P(X_1, X_2,..., X_p) = \prod_{j=1}^{p} \P(X_j \mid X_{\mbox{Pa}(j)}),
\end{equation}
where $\P(X_j \mid X_{\mbox{Pa}(j)})$ is the conditional distribution of $X_j$ given its parents variables $X_{\mbox{Pa}(j)} :=\{X_k : k \in \mbox{Pa}(j) \subset V \}$.
We suppose that there are $n$ independent and identically distributed samples $X^{1:n} := ( X^{(i)} )_{i=1}^{n}$ from a given graphical model where $X^{(i)} := X_{1:p}^{(i)} = ( X_1^{(i)}, X_2^{(i)},\cdots, X_p^{(i)})$ is a $p$-variate random vector. The notation $\widehat{\cdot}$ denotes an estimate based on samples $X^{1:n}$. We also accept the causal sufficiency assumption that all important variables have been observed.
\subsection{Poisson DAG Model and its Identifiability}
\label{SecPoisson}
The definition of Poisson DAG models in \cite{park2015learning} is that each conditional distribution given its parents $X_j \mid X_{\mbox{Pa}(j)}$ is Poisson such that
\begin{equation}
\label{eq:CondPDAGM}
X_j \mid X_{\mbox{Pa}(j)} \sim \mbox{Poisson}(g_j(X_{\mbox{Pa}(j)})),
\end{equation}
where for any arbitrary positive link function $g_j: \mathcal{X}_{\mbox{Pa}(j)} \to \mathbb{R}^{+}$. Hence using the factorization in Equation~\eqref{eq:factorization}, the joint distribution is as follows:
\begin{equation}
\label{eq:JointPDAGM}
f_{G}(X) = \prod_{j \in V} f_j(X_j \mid X_{\mbox{Pa}(j)}).
\end{equation}
where $f_j$ is the probability density function of Poisson.
A Poisson structural equation model (SEM) is a special case of a Poisson DAG model where the link functions $g_j$'s in Equation~\eqref{eq:CondPDAGM} are the standard log link function for Poisson generalized linear models (GLMs), i.e., $g_j(X_{\mbox{Pa}(j)}) = \mbox{exp}(\theta_j + \sum_{k \in \mbox{Pa}(j)}{\theta_{jk}X_k})$ where $(\theta_{jk})_{k \in \mbox{Pa}(j)}$ represents the linear weights. Using factorization~\eqref{eq:factorization}, the joint distribution of a Poisson SEM can be written as:
\begin{align}
\label{eq:PDAGGLM}
&f(X_1,X_2,...,X_p) = \mbox{exp} \Big( \sum_{j \in V} \theta_j X_j + \sum_{(k,j)\in E} \theta_{jk} X_j X_k - \sum_{j \in V} \log X_j ! - \sum_{j \in V} e^{ \theta_j + \sum_{k \in \mbox{Pa}(j)} \theta_{jk} X_k }\Big).
\end{align}
Poisson DAG models have a useful moments relation for the identifiability:
\begin{proposition}
\label{prop:moments ratio}
Consider a Poisson DAG model~\eqref{eq:JointPDAGM} with non-degenerated rate parameter functions $(g_j(X_{\mbox{Pa}(j)}) )_{j \in V}$. Then, for any node $j \in V$, and any set $S_j \subset \mbox{Nd}(j)$, the following moments relation holds:
\begin{equation}
\label{eq:moment ratio}
\frac{ \E( X_j^2) }{ \E\left[ \E( X_j \mid X_{S_j}) + \E( X_j \mid X_{S_j})^2 \right] } \geq 1
\end{equation}
Equivalently,
\begin{equation*}
\E( \var( \E(X_j \mid X_{\mbox{Pa}(j)} ) \mid X_{S_j} ) ) \geq 0.
\end{equation*}
The equality only holds when $S_j$ contains all parents of $j$, that is, $\mbox{Pa}(j) \subset S_j$.
\end{proposition}
We include the proof in Section~\ref{SecPropProof1}. Proposition~\ref{prop:moments ratio} claims that when all parents of $j$, $\mbox{Pa}(j)$, contribute to its rate parameter, the moments ratio in Equation~\eqref{eq:moment ratio} is equal to 1 if a condition set $S_j$ contains all parents of $j$, $\mbox{Pa}(j) \subset S_j$, otherwise greater than 1. In Poisson SEMs, it is clear that the non-degenerated rate parameter function assumptions are equivalent to the \textit{non-zero coefficients} conditions, $|\theta_{jk}| > 0$ for all $k \in \mbox{Pa}(j)$ since $g_j(X_{\mbox{Pa}(j)}) = \mbox{exp}(\theta_j + \sum_{k \in \mbox{Pa}(j)}{\theta_{jk}X_k})$.
Now, we briefly explain how Poisson DAG models are identifiable from the moments ratio in Proposition~\ref{prop:moments ratio} using the bivariate Poisson DAG models illustrated in Fig.~\ref{figure1}: $G_1: X_1 \sim \mbox{Poisson}(\lambda_1), X_2 \sim \mbox{Poisson}(\lambda_2)$, where $X_1$ and $X_2$ are independent; $G_2: X_1 \sim \mbox{Poisson}(\lambda_1)$ and $X_2 \mid X_1 \sim \mbox{Poisson}(g_2(X_1))$; and $G_3: X_2 \sim \mbox{Poisson}(\lambda_2)$ and $X_1 \mid X_2 \sim \mbox{Poisson}(g_1(X_2))$ for arbitrary non-degenerated positive functions $g_1, g_2: \mathbb{N} \cup \{0\} \to \mathbb{R}^{+}$.
\begin{figure}[!t]
\centering
\begin {tikzpicture}[ -latex ,auto,
state/.style={circle, draw=black, fill= white, thick, minimum size= 2mm},
label/.style={thick, minimum size= 2mm}
]
\node[state] (X1) at (0,0) {\small{$X_1$} }; \node[state] (X2) at (2,0) {\small{$X_2$}}; \node[label] (X3) at (1,-.7) {$G_1$};
\node[state] (Y1) at (5,0) {\small{$X_1$}}; \node[state] (Y2) at (7,0) {\small{$X_2$}}; \node[label] (Y3) at (6,-.7) {$G_2$};
\node[state] (Z1) at (10,0) {\small{$X_1$}}; \node[state] (Z2) at (12,0) {\small{$X_2$}}; \node[label] (Z3) at (11,-.7) {$G_3$};
\path (Y1) edge [shorten <= 2pt, shorten >= 2pt] node[above] { } (Y2);
\path (Z2) edge [shorten <= 2pt, shorten >= 2pt] node[above] { } (Z1);
\end{tikzpicture}
\caption{Bivariate directed acyclic graphs of $G_1$, $G_2$, and $G_3$. }
\label{figure1}
\end{figure}
By Proposition~\ref{prop:moments ratio}, we can see that $\E( X_j^2 )= \E(X_j) + \E(X_j)^2$ for all $j \in \{1, 2\}$ in $G_1$. In $G_2$, we can also see that
$$
\E( X_1^2 )= \E(X_1) + \E(X_1)^2,\quad \text{and} \quad \E( X_2^2 ) > \E(X_2) + \E(X_2)^2.
$$
Similarly, in $G_3$, we have $\E( X_1^2 ) > \E(X_1) + \E(X_1)^2$, while $\E( X_2^2 ) = \E(X_2) + \E(X_2)^2$. Hence, we can determine the true graph based on the moments ratio $\E( X_j^2 ) /( \E(X_j) + \E(X_j)^2 )$.
This idea of a moments relation in Proposition~\ref{prop:moments ratio} can easily apply to general p-variate Poisson DAG models, and hence, the models are identifiable by testing whether the moments ratio in Equation~\eqref{eq:moment ratio} is equal to 1 or greater than 1.
\begin{theorem}
\label{ThmMainIdentifiability}
Consider a Poisson DAG model~\eqref{eq:JointPDAGM} with rate parameters $(g_j(X_{\mbox{Pa}(j)}))_{j \in V}.$ If for any $j \in V$, rate parameter $g_j(\cdot)$ is non-degenerated, the Poisson DAG model is identifiable.
\end{theorem}
We include the proof in Section~\ref{SecTheo}. Theorem~\ref{ThmMainIdentifiability} claims that any Poisson DAG model is identifiable if all parents of node $j$ contribute to its rate parameter. Hence, Theorem~\ref{ThmMainIdentifiability} shows that any Poisson SEM is identifiable under the non-zero coefficients condition, $|\theta_{jk}| > 0$ for all $k \in \mbox{Pa}(j)$. This condition is also commonly assumed in (Gaussian) linear structural equation models for the model identifiability~\citep{spirtes1995directed, ghoshal2017learning,ghoshal2018learning,loh2014high,peters2014identifiability, park2019identifiability}. We believe that it is a natural condition that is in accordance with the intuitive understanding of relationships among variables.
Our identifiability condition is strictly milder than the previous identifiability result in \cite{park2015learning} that is equivalent to $\var( \E( X_j \mid X_{\mbox{Pa}(j)}) \mid X_{S_j} = x ) > 0$ for all $x \in \mathcal{X}_{S_j}$ when $\mbox{Pa}(j) \not \subset S_j$ . For a better comparison, we consider a fully connected graph where $X_1 \sim \text{Poisson}( \lambda )$, $X_2 \mid X_1 \sim \text{Poisson}( \lambda + X_1)$, and $X_3 \mid X_1, X_2 \sim \text{Poisson}( \lambda + X_2 \mathbf{1}(X_1 \neq 0))$ where $\lambda$ is a positive constant and $\mathbf{1}(\cdot)$ is an indicator function. In this case, we can see $\var( \E( X_3 \mid X_{1}, X_{2}) \mid X_1 = 0 ) = 0$, and hence, the identifiability condition in~\cite{park2015learning} is not satisfied, while our condition is satisfied.
In a Poisson SEM, the identifiability assumption in \cite{park2015learning} is also satisfied under the non-zero coefficients condition. However, in the finite sample setting, the difference of both assumptions gets more crucial. For a positive constant $c$, \cite{park2015learning} requires $\min_{ x \in \mathcal{X}_{S_j} } \var( \E( X_j \mid X_{\mbox{Pa}(j)}) \mid X_{S_j} = x ) ) > c$, while we need $\E( \var( \E( X_j \mid X_{\mbox{Pa}(j)}) \mid X_{S_j} ) ) > c$. Hence, our new identifiability assumption makes learning Poisson SEMs easier. We discuss this more in Section~\ref{SecTheo}.
\subsection{Comparison to Poisson MRF}
\label{SecComparison}
In this section, we compare Poisson DAG models and MRFs where the conditional distributions of each node given its parents and neighbors are Poisson, respectively. To simplify the comparison, we consider the joint distribution of a Poisson SEM in Equation~\eqref{eq:PDAGGLM}. This is a form similar to the joint distribution of Poisson MRFs in~\cite{yang2015graphical}, where the joint distribution has the following form:
\begin{align}
\label{eq:PoissonMRF}
&f(X_1,X_2,...,X_p) = \mbox{exp} \Big( \sum_{j \in V} \theta_j X_j + \sum_{(k,j)\in E} \theta_{jk} X_j X_k- \sum_{j \in V} \log X_j ! - A(\theta) \Big),
\end{align}
where $A(\theta)$ is the log of the normalization constant. The key difference between a Poisson SEM and a Poisson MRF is the normalization constant $A(\theta)$ in Equation~\eqref{eq:PoissonMRF}, as opposed to the term $\sum_{j \in V} e^{ \theta_j + \sum_{k \in \mbox{Pa}(j)} \theta_{jk} X_k }$ in Equation~\eqref{eq:PDAGGLM}, which depends on variables.
\cite{yang2015graphical} proves that a Poisson MRF~\eqref{eq:PoissonMRF} is normalizable if and only if all $(\theta_{jk})$ values are less than or equal to $0$. This means Poisson MRFs only capture negative dependency relations. In addition, \cite{yang2015graphical} addresses the learning Poisson MRFs when the functional form of dependencies is $X_j \mid X_{V \setminus j} \sim \mbox{Poisson}(\mbox{exp}(\theta_j + \sum_{k \in \mathcal{N}(j)}{\theta_{jk}X_k}))$ where $\mathcal{N}(j)$ denotes the neighbors of a node $j$ in the graph.
While Poisson MRFs have strong restrictions on the functional form for dependencies and the parameter space, they can be successfully learned in the high-dimensional settings with less restrictive constraints of sparsity. \cite{yang2015graphical} shows that Poisson MRFs can be recovered via $\ell_1$-regularized regression if $n = \Omega\left(d_{m}^2 \log^3 p \right)$, where $d_{m}$ is the degree of the undirected graph. In contrast, \cite{ park2017learning} shows that Poisson DAG models can be learned via the ODS algorithm if $n = \Omega( \max \{ d_{m}^4 \log^{12} p, \log^{5+d} p \} )$ where $d_{m}$ is obtained by the moralized graph and $d$ is the maximum indegree of the graph. This big difference in the sample complexity primarily comes from the unknown functional form for the dependencies in Poisson DAG models. In the next section, we will show that a significant advantage can be achieved by assuming the parametric function for the dependencies in terms of recovering the graphs.
\section{Algorithm}
\label{SecAlgorithm}
Here, we present our Moments Ratio Scoring (MRS) algorithm for learning the identifiable Poisson SEM~\eqref{eq:PDAGGLM}. Our algorithm alternates between an element-wise ordering search using the (conditional) moments ratio, and a parent search using $\ell_1$-regularized GLM. Hence, the algorithm chooses a node for the first element of the ordering, and then determines its parents. The algorithm iterates this procedure until the last element of the ordering and its parents are determined.
Without loss of generality, assume that $\pi = (1,2,\cdots,p)$ is the true ordering.
Then Poisson SEMs~\eqref{eq:PDAGGLM} have the conditional distribution of $X_j$ given that all variables before $j$ in the ordering are reduced to the following Poisson GLM:
\begin{align}
\label{eq:TrueConditionalDistribution}
& P(X_{j} \mid X_{1:(j-1)} ) = \mbox{exp} \bigg\{ \theta_j X_j + \sum_{k \in {1:(j-1)}} \theta_{jk} X_{k} X_j + \log X_j ! - \mbox{exp} \bigg( \theta_j + \sum_{k \in {1:(j-1)}} \theta_{jk} X_{k} \bigg) \bigg\},
\end{align}
where $\theta_{jk} \in \mathbb{R}$ represents the influence of node $k$ on node $j$. For ease of notation, let $\theta(j)$ be a set of parameters related to Poisson GLM~\eqref{eq:TrueConditionalDistribution}. Then $\theta(j) = (\theta_j, \theta_{\setminus j} ) \in \mathbb{R} \times \mathbb{R}^{j-1}$ where $\theta_{\setminus j} = ( \theta_{jk} )_{k \in \{1,2,...,j-1\}}$ is a zero-padded vector with non-zero entries if $k \in \mbox{Pa}(j)$.
Our MRS (Algorithm~\ref{MRS_Algorithm}) involves learning the ordering by comparing moments ratio scores of nodes using the following equations:
\begin{align}
\label{EqnTruncScorej}
\widehat{\mathcal{S}}(1,j) &:=
\frac{ \widehat{\E}( X_j^2)}{ \widehat{\E}( X_j) + \widehat{\E}( X_j )^2 } \quad \text{and} \quad
\widehat{\mathcal{S}}(m,j) :=\frac{ \widehat{\E}( X_j^2 )}{ \widehat{\E}\big( \widehat{\E}( X_j \mid X_{\widehat{\pi}_{1:(m-1)}}) + \widehat{\E}( X_j \mid X_{\widehat{\pi}_{1:(m-1)}})^2 \big) },
\end{align}
where $\widehat{\pi}_{1:m} = \{\widehat{\pi}_1, ... ,\widehat{\pi}_m \}$, $\widehat{\E}(X_j) = \frac{1}{n} \sum_{i = 1}^{n} X_j^{(i)}$, and $\widehat{\E}( \widehat{\E}(X_j \mid X_S) ) = \frac{1}{n} \sum_{i = 1}^{n} \mbox{exp} \big(\widehat{\theta}_j^S + \sum_{k \in S} \widehat{\theta}_{jk}^S X_{k}^{(i)} \big)$, and $\widehat{\E}( \widehat{\E}(X_j \mid X_S)^2 ) = \frac{1}{n} \sum_{i = 1}^{n} \mbox{exp} \big(2\widehat{\theta}_j^S + 2\sum_{k \in S} \widehat{\theta}_{jk}^S X_{k}^{(i)} \big)$ where $\widehat{\theta}_S(j) = (\widehat{\theta}_j^S, \widehat{\theta}_{\setminus j}^S)$ is the solution of the following $\ell_1$-regularized GLM:
\begin{align}
\label{eqn:theta_jS2}
\widehat{\theta}_S(j) := \arg \min \frac{1}{n} \sum_{i = 1}^{n} \bigg[ -X_j^{(i)} \bigg( \theta_j + \sum_{k \in S} \theta_{jk} X_{k}^{(i)} \bigg) + \mbox{exp} \bigg(\theta_j + \sum_{ k \in S } \theta_{jk} X_{k}^{(i)} \bigg) \bigg] + \lambda_j \sum_{k \in S} |\theta_{jk}|.
\end{align}
This score is an estimator of the moments ratio relation in Equation~\eqref{eq:moment ratio}. Hence, the correct element of the ordering has a score of 1, otherwise strictly greater than 1 in population. The ordering is determined one node at a time by selecting the node with the smallest score. Similar strategies of element-wise ordering learning can be found in many existing algorithms (e.g.,~\citealp{shimizu2011directlingam, ghoshal2017learning, ghoshal2018learning, drton2018causal}).
The novelty of our algorithm is learning an ordering by testing which nodes have the smallest moments ratio in Equation~\eqref{eq:moment ratio} using the $\ell_1$-regularized GLM. By substituting the estimation of parameters $\theta(j)$ for an estimation of the conditional mean, we gain significant computational and statistical improvements compared to the previous works in~\cite{park2015learning, park2017learning} where the method of moments is used for estimating the conditional mean and variance.
In principle, the number of conditional variances exponentially grows in the number of conditioning variables. Hence, if a conditioning set contains d-variables with 10 possible outcomes, then the number of possible computations is $10^d$. In other words, the minimum sample size for the ODS algorithm to be implemented is possibly $10^d$, otherwise, none of conditional variances can be estimated.
As we discussed, the problem of a learning directed graph structure is the same as the problem of an learning undirected graph structure if the ordering is known. Hence, given the estimated ordering, the parents of each node $j$ can be learned via $\ell_1$-regularized GLM (see details in \citealp{meinshausen2006high, wainwright2006high, ravikumar2011high,yang2015graphical}). Therefore, we determine the estimated parents of a node $j$ as $\widehat{\mbox{Pa}}(j) := \{ k \in S: \widehat{\theta}_{j k}^S \neq 0 \}$ where $S = \widehat{\pi}_{1:(j-1)}$ and $\widehat{\theta}_S(j)$ is the solution to Equation~\eqref{eqn:theta_jS2}.
\setlength{\algomargin}{0.5em}
\begin{algorithm}[!t]
\caption{ \bf Moments Ratio Scoring (MRS)~\label{MRS_Algorithm} }
\SetKwInOut{Input}{Input}
\SetKwInOut{Output}{Output}
\SetKwInOut{Return}{Return}
\Input{ $n$ i.i.d. samples, $X^{1:n}$}
\Output{ Estimated ordering $\widehat{\pi}=(\widehat{\pi}_1,...,\widehat{\pi}_p)$ and an edge structure, $\widehat{E} \subset V \times V$}
\BlankLine
Set $\widehat{\pi}_{0} = \emptyset$\;
\For{$m = \{1,2,\cdots,p\}$}{
Set $S = \{\widehat{\pi}_1,\cdots,\widehat{\pi}_{m-1}\} $;\\
\For{$j \in \{1,2,\cdots,p\} \setminus S$ }{
Estimate $\widehat{\theta}_{S}(j)$ for $\ell_1$-regularized generalized linear model~\eqref{eqn:theta_jS2}; \\
Calculate scores $\widehat{\mathcal{S}}(m,j)$ using Equation ~\eqref{EqnTruncScorej};\\
}
The $m^{th}$ element of the ordering, $\widehat{\pi}_m = \arg \min_j \widehat{\mathcal{S}}(m,j)$\;
The parents of the $m^{th}$ element of the ordering, $\widehat{\mbox{Pa}}(\widehat{\pi}_m) = \{k \in S \mid \widehat{\theta}_{\widehat{\pi}_m k}^S \neq 0 \} $\;
}
\Return{Estimate the edge set, $\widehat{E} = \cup_{m \in V} \{ (k, \widehat{\pi}_m) \mid k \in \widehat{\mbox{Pa}}(\widehat{\pi}_m) \} $}
\end{algorithm}
\subsection{Computational Complexity}
\label{SecComp}
The computational complexity for the MRS algorithm involves the $\ell_1$-regularized GLM algorithm~\citep{friedman2009glmnet} where the worse-case complexity is $O(n p)$ for a single $\ell_1$-regularized regression run. More precisely, the coordinate descent method updates each gradient in $O(p)$ operations. Hence, with $d$ non-zero terms in the GLM, a complete cycle costs $O(p d)$ operations if no new variables become non-zero, and costs $O(n p)$ for each new variable entered (see details in \citealp{friedman2010regularization}). Since our algorithm has $p$ iterations and there are $p-j+1$ regressions with $j-1$ features for the $j$th iteration, the total worst-case complexity is $O(n p^3)$.
The estimation of a Poisson MRF also involves a node-wise $\ell_1$-regularized GLM over all other variables, and hence the worse-case complexity is $O(n p^2)$ if the coordinate descent method is exploited. The addition of estimation of ordering makes $p$ times more computationally inefficient than the standard method for learning Poisson MRFs.
Learning a DAG model is NP-hard in general~\citep{chickering1994learning}. Hence, many state-of-the-art MEC and DAG learning algorithms, such as PC~\citep{spirtes2000causation}, GES~\citep{chickering2003optimal}, and MMHC~\citep{tsamardinos2006max}, are inherently greedy search algorithms. In the numerical experiments in Section~\ref{SecNume}, we compare MRS to greedy hill-climbing search-based GES and MMHC algorithms in terms of run time, and show that MRS has a significantly better computational complexity.
\subsection{Theoretical Guarantees}
\label{SecTheo}
In this section, we provide theoretical guarantees on the MRS algorithm for learning Poisson SEMs~\eqref{eq:PDAGGLM}. The main result is expressed in terms of the triple $(n,p,d)$, where $n$ is a sample size, $p$ is a graph node size, and $d$ is the indegree of a graph.
\subsubsection{Assumptions}
We begin by discussing the assumptions we impose on Poisson SEMs. Since we apply $\ell_1$-regularized regression for the parent selection, most assumptions are similar to those imposed in~\cite{wainwright2006high}, \cite{ravikumar2011high}, \cite{yang2015graphical} and \cite{park2017learning} where $\ell_1$-regularized regression was used for graphical model learning.
Important quantities are the Hessian matrices of the negative conditional log-likelihood of a node $j$ given some subsets of the nodes in the ordering, $S_j \in \{ \{\pi_{1} \}, \{\pi_{1}, \pi_{2} \},..., \{\pi_1,...\\,\pi_{j-1}\} \}$. Let $Q^{j,S_j} := \bigtriangledown^2 \ell_j^{S_j}(\theta_{S}^{*}(j); X^{1:n})$ where
\begin{align}
\label{eq:likelihood}
& \ell_j^{S_j}( \theta_{S_j}(j), X^{1:n} ) := \frac{1}{n} \sum_{i = 1}^{n} \bigg[ -X_j^{(i)} \bigg( \theta_j^{S_j} + \sum_{k \in S_j} \theta_{jk}^{S_j} X_{k}^{(i)} \bigg) + \mbox{exp} \bigg(\theta_j^{S_j} + \sum_{ k \in S_j } \theta_{jk}^{S_j} X_{k}^{(i)} \bigg) \bigg],
\end{align}
\begin{align}
\label{ThetaSj}
& \theta_{S_j}^{*}(j) := \arg \min \E \bigg[ - X_j \bigg( \theta_j^{S_j} + \sum_{k \in S_j} \theta_{jk}^{S_j} X_{k} \bigg) + \mbox{exp} \bigg(\theta_j^{S_j} + \sum_{ k \in S_j } \theta_{jk}^{S_j} X_{k} \bigg) \bigg].
\end{align}
For ease of notation, we define a set for the non-zero elements of $\theta_{S_j}^{*}(j)$,
\begin{align}
\label{eq:subparents}
T_j := \{k \in S_j \mid \theta_{jk}^{*} \neq 0 \quad \text{where } \theta_{S_j}^{*}(j) = (\theta_{j}^{*}, \theta_{jk}^{*}) \}.
\end{align}
We note that if $S_j$ contains all parents of $j$, $\mbox{Pa}(j) \subset S_j$, then $T_j = \mbox{Pa}(j)$. Lastly, for simplicity, we let $A_{S S}$ denote the $|S| \times |S|$ sub-matrix of the matrix $A$ corresponding to variables $X_{S}$.
\begin{assumption}[Dependence Assumption]
\label{A1Dep}
For any $j \in V$ and any $S_j \in \{ \{\pi_{1} \}, \{\pi_{1}, \pi_{2} \},\\ ..., \{\pi_1,...,\pi_{j-1}\} \}$, there exist positive constants $\rho_{\min}$ and $\rho_{\max}$ such that
\begin{align*}
&\min_{j \in V} \lambda_{\min}\left(Q^{j,S_j}_{ T_j T_j }\right) \geq \rho_{\min},
\quad \text{ and } \quad
\max_{j \in V } \lambda_{\max} \left( \frac{1}{n}\sum_{i=1}^{n} X_{\mbox{Pa}(j)}^{(i)} (X_{\mbox{Pa}(j)}^{(i)})^T \right) \leq \rho_{\max},
\end{align*}
where $T_j$ is in Equation~\eqref{eq:subparents}, $\lambda_{\min}(A)$ and $\lambda_{\max}(A)$ are the smallest and largest eigenvalues of the matrix $A$, respectively.
\end{assumption}
\begin{assumption}[Incoherence Assumption]
\label{A2Inc}
For any $j \in V$ and any $S_j \in \{ \{\pi_{1} \}, \{\pi_{1}, \pi_{2} \},\\..., \{\pi_1,...,\pi_{j-1}\} \}$, there exists a constant $\alpha \in (0,1]$ such that
$$\max_{j, S_j } \max_{t \in T_j^c} \| Q_{t T_j}^{j,S_j} (Q_{T_j T_j}^{j,S_j})^{-1}\|_1 \leq 1 - \alpha,$$
where $T_j$ is in Equation~\eqref{eq:subparents}.
\end{assumption}
Assumption~\ref{A1Dep} ensures that the parent variables are not too dependent. In addition, Assumption~\ref{A2Inc} ensures that parent and non-parent variables are not highly correlated. These two assumptions are standard in all neighborhood regression approaches to variable selection involving $\ell_1$-regularized based methods, and these conditions have imposed in proper works for both high-dimensional regression and graphical model learning.
To control the tail behavior of likelihood functions, we require a bounded sample assumption which is also imposed in the standard $\ell_1$-regularized Poisson regression (e.g., \citealp{jia2017sparse}).
\begin{assumption}[Bounded Sample Assumption]
\label{A3Con}
For any $i \in \{1,2,...,n\}$, $j \in V$, and for all $S_j \in \{ \{\pi_{1} \}, \{\pi_{1}, \pi_{2} \},..., \{\pi_1,...,\pi_{j-1}\} \}$, the samples are bounded:
$$
\max_{i, j} \{ X_{j}^{(i)} \} < C_{x} \log( \max\{n,p\} ) \quad \text{and} \quad \max_{i, j} \{ \mbox{exp}( \theta_{j}^* + \sum_{k \in S_j} \theta_{jk}^* X_k^{(i)} ) \} < C_{x} \log( \max\{n,p\} ).
$$
where $C_{x} > 2$ is a positive constant.
\end{assumption}
Assumption~\ref{A3Con} is closely related to the rate parameters. For instance, the rate parameter of $X_j^{(i)}$ is $\mbox{exp}( \theta_{j}^* + \sum_{k \in \mbox{Pa}(j)} \theta_{jk}^* X_k^{(i)} )$ by the definition of Poisson SEMs. Hence, Assumption~\ref{A3Con} can be understood that too large rate parameters, that leads to a large value of a sample, are not allowed for all conditional distributions.
In fact, Assumption~\ref{A3Con} is satisfied with a high probability when $(\theta_{jk}^*)$ are negative. Since the second condition in Assumption~\ref{A3Con} is directly satisfied with negative $(\theta_{jk}^*)$, we discuss the first condition: Using the union bound,
$$
P\left( \max_{i,j} X_j^{(i)} \geq C_x \log( \max\{n,p\} ) \right) \leq n.p \max_{i,j} \frac{ \E( \mbox{exp}(X_j^{(i)}) ) }{ ( \max\{n,p\} )^{C_x} } \leq \max_{i,j} \frac{ \E( \mbox{exp}(X_j^{(i)}) ) }{ ( \max\{n,p\} )^{C_x - 2} }.
$$
In addition, the moment generating function is bounded when $(\theta_{jk}^*)$ are negative.
$$
\E( \mbox{exp}(X_j)) \leq \E( \E( \mbox{exp}(X_j) \mid X_{\mbox{Pa}(j)} ) ) \leq \E( \mbox{exp}( \theta_j^* + \sum \theta_{jk}^* X_k)) \leq \mbox{exp}( \theta_j^* ).
$$
Hence, given the negative $(\theta_{jk}^*)$ assumption, Assumption~\ref{A3Con} is satisfied with probability at least $1 - \max_{j} \mbox{exp}({\theta_j} )/ ( \max\{n,p\} )^{C_x - 2}$.
Lastly, we require a stronger version of the moments ratio relation in Equation~\eqref{eq:moment ratio}, because we move from the population to the finite samples. This assumption only involves learning the ordering of a graph.
\begin{assumption}
\label{A1}
For all $j \in V$ and $S_j \in \{ \{\pi_{1} \}, \{\pi_{1}, \pi_{2} \},..., \{\pi_1,...,\pi_{j-1}\} \}$, there exists an $M_{\min} > 0$ such that
$$
\E( X_j^2) > ( 1 + M_{\min} ) \E[ \E( X_j \mid X_{S_j}) + \E( X_j \mid X_{S_j})^2 ].
$$
\end{assumption}
Now, we compare Assumptions~\ref{A1Dep},~\ref{A2Inc},~\ref{A3Con}, and~\ref{A1} to the assumptions for learning Poisson MRFs and DAG models. As discussed, our assumptions are similar to the assumptions in \cite{yang2015graphical} and \cite{park2017learning} since all methods exploit the $\ell_1$-regularized GLM.
However, the assumptions in \cite{yang2015graphical} only involve neighbors of node $j$, that is, $S_j = V \setminus j$. While our assumptions involve some subsets of parents, that is, $S_j \in \{ \{\pi_{1} \}, \{\pi_{1}, \pi_{2} \},..., \{\pi_1,...,\pi_{j-1}\} \}$ due to the unknown ordering. In addition, they do not assume the bounded sample assumption. However, they assume the restricted negative parameter space $\theta_{jk} < 0$ due to the normalizability issue. As we explained, if all parameters are negative in a Poisson SEM, the moment generating function is bounded, and hence, the bounded sample assumption is satisfied with a high probability. Lastly, \cite{yang2015graphical} does not have the moments ratio assumption, since it is only used for recovering the ordering.
We compare the required assumptions for the MRS and ODS algorithms in \cite{park2017learning}. A major difference is that the MRS algorithm directly estimates the graph, while the ODS algorithm estimates the moralized graph to reduce the search space of DAGs, and then, estimates the graph. Hence, our assumptions involve some parents of node $j$, while their assumptions involve not only parents, but neighbors of node $j$, that is, $S_j = \{ \{\pi_1,...,\pi_{j-1}\}, V \setminus j \}$. In addition, they require a sparse moralized graph and adjacent faithfulness that are also known to be restrictive. We note that the sparse moralized graph assumption can be very strong since a sparse moralized graph is not implied by a sparse graph. For instance, consider a star graph where $X_1 \to X_{j}$ for all $j \in \{2,3,...,p\}$ in Fig.~\ref{fig:star}. This star graph has the maximum degree of the moralized graph is $p-1$, while the maximum indegree is 1.
Another major difference is in the moments ratio assumption. More precisely, \cite{,park2015learning,park2017learning} assume $\var( \E(X_j \mid X_{S} = x)) > c$ for all $x \in \mathcal{X}_{S}$ when $\mbox{Pa}(j) \not \subset S$, while we require $\E( \var( \E(X_j \mid X_{S} = x)) ) > c$. To emphasize the difference, we consider a 3-node graph $X_1 \to X_2 \to X_3$ where $X_1 \sim Poisson(\lambda), X_2 \mid X_1 \sim Poisson( \mbox{exp}( \theta_1 X_1) )$, and $X_3 \mid X_2 \sim Poisson( \mbox{exp}( \theta_2 X_2) )$. Then, for $j = 3$ and $S = 1$, we have
$$
\var( \E(X_3 \mid X_2) \mid X_1 ) = \var( \mbox{exp}(\theta_2 X_2) \mid X_1) < \E( \mbox{exp}(2 \theta_2 X_2) \mid X_1) = \mbox{exp}( e^{\theta_1 X_1} ( e^{2 \theta_2} -1 ) ).
$$
Hence, for some constants $\theta_1, \theta_2$ and $c$, if $X_1 < \frac{1}{\theta_1} ( \log \log c - \log( e^{2\theta_2} -1) )$, their assumption is not satisfied, while Assumption~\ref{A1} holds.
Lastly, the ODS algorithm requires at least two distinct element of $X_{\mbox{Pa}(j)}^{(i)}$ for a conditional variance estimation, $\var(X_j \mid X_{\mbox{Pa}(j)} )$. In principle, it can be $2^d$ by assuming all variables are binary. Hence when $d$ is not so sparse, the ODS algorithm often fails to be implemented. In Section~\ref{SecNume}, we empirically verify that it can be a critical issue for the ODS algorithm when a graph is not so sparse $(d =5)$.
Therefore, we believe that the assumptions for the MRS algorithm are more realistic.
Although our assumptions are standard in the previous works of $\ell_1$-regularized Poisson regressions, we have to note that the assumptions cannot be confirmed from data and they could be restrictive. However, they are not strong for $\ell_1$-regularized regression when samples are from Gaussian SEMs~(see e.g., \citealp{ravikumar2011high}). Hence, we conjecture that our assumptions can be satisfied with a high probability under mild conditions, and leave this to future study.
\subsubsection{Main Result}
Putting together Assumptions~\ref{A1Dep},~\ref{A2Inc},~\ref{A3Con}, and~\ref{A1}, we have the following main result that a Poisson SEM can be recovered via our MRS algorithm in high-dimensional settings. The theorem provides not only sufficient conditions, but also the probability that our method recovers the true graph structure.
\begin{theorem
\label{ThmMainTheorm}
Consider a Poisson SEM~\eqref{eq:PDAGGLM} with parameter vector $( \theta(j) )_{j \in V}$ and the maximum indegree of the graph $d$.
Suppose that the regularization parameter~\eqref{eqn:theta_jS2} is chosen, such that
$$
\frac{4 C_{x}^2 \sqrt{2}(2-\alpha) }{ \alpha} \frac{ \log^2 (\max\{n,p\}) }{ \kappa_1(n,p) } \leq \lambda_{j} \leq \frac{ \alpha \rho_{\min}^2 }{ 10^2 C_{x}^2 (2 - \alpha) \rho_{\max} d \log^2 (\max\{n,p\}) },
$$
for any $\alpha = (0, 1]$, and $\kappa_1(n,p) \geq \frac{4 \sqrt{2} \cdot 10^2 C_{x}^4 \cdot(2-\alpha)^2 }{ \alpha^2} \frac{ \rho_{\max} }{ \rho_{\min}^2 } d \log^4 (\max\{n,p\})$.
Suppose also that Assumptions~\ref{A1Dep},~\ref{A2Inc},~\ref{A3Con} and~\ref{A1} are satisfied and the values of the parameters in Equation~\eqref{eq:PDAGGLM} are sufficiently large such that $\min_{(j,k) \in E} | \theta_{jk} | \geq \frac{10}{\rho_{\min}} \sqrt{d}\lambda_j$. Then, for any $\epsilon > 0$, there exists a positive constant $C_{\epsilon}$ such that if the sample size is sufficiently large $n > C_{\epsilon} (\kappa_1(n,p) )^2 \log p$, then the MRS algorithm uniquely recovers the graph with a high probability:
\begin{align*}
P( \widehat{G} = G ) \geq 1 - \epsilon.
\end{align*}
\end{theorem} \vspace{-0.0cm}
Detailed proof is provided in Appendices~\ref{SecThmMainProof1} and \ref{SecMainThmProof2}. Appendix~\ref{SecThmMainProof1} provides the error probability that $\ell_1$-regularized regression recovers the true parents of each node given the true ordering, and Appendix~\ref{SecMainThmProof2} provides the error probability that $\ell_1$-regularized regression recovers the ordering. The key technique for the proof is that the \emph{primal-dual witness} method used in sparse regularized regressions and related techniques \citep{meinshausen2006high, wainwright2006high, ravikumar2011high, yang2015graphical}. Theorem~\ref{ThmMainTheorm} intuitively makes sense because neighborhood selection via the $\ell_1$-regularized regression is a well-studied problem, and its bias can be controlled by choosing the appropriate regularization parameter $\lambda_j$. Hence, our moments ratio scores can be sufficiently close to the true scores to recover the true ordering.
Theorem~\ref{ThmMainTheorm} claims that if $n = \Omega( d^{2} \log^9 p )$, our MRS algorithm recovers an underlying graph with a high probability. Hence, our MRS algorithm works in a high-dimensional setting, provided that the indegree of a graph $d$ is bounded. This sample bound result shows that our method has much more relaxed constraints on the sparsity of the graph than the previous work in~\cite{park2017learning}, where the sample bound is $n = \Omega( \max \{ d_{m}^4 \log^{12} p, \log^{5+d} p \} )$. Moreover, it also shows that learning Poisson DAG models may require more samples than the learning Poisson MRFs in~\cite{yang2015graphical}, where the sample bound is $n = \Omega( d_{m}^2 \log^3 p ) )$ due to the existence of the ordering and the unrestricted parameter space.
\subsubsection{Poisson SEM with a Star Graph Example}
\label{SecStar}
In this section, we discuss the validity of our assumptions using a special Poisson SEM with the star graph in Fig.~\ref{fig:star} where $X_1 \sim Poisson(\lambda)$, $X_j \mid X_1 \sim Poisson( \mbox{exp}(\theta X_1) )$, for $j \in \{2,3,...p\}$. This consists of a single hub node connected to the rest of nodes. With this star graph, we show that our assumptions can be satisfied with positive $(\theta_{jk})$.
In order to discuss the validity of Assumptions~\ref{A1Dep},~\ref{A2Inc}, \ref{A3Con}, and \ref{A1} in this particular example, we first calculate the expectation of the Hessian matrix of Equation~\eqref{eq:likelihood}: For any $j \in \{2,3,...p\}$,
\begin{align*}
\E( X_1^2 \mbox{exp}( \theta X_1) ) &= \frac{ \partial^2 }{ \partial \theta^2 } \E( \mbox{exp}( \theta X_1) ) = \lambda \mbox{exp}( \lambda ( \mbox{exp}(\theta) -1 ) + \theta) (\lambda \mbox{exp}(\theta) +1), \\
\E( X_1 X_j \mbox{exp}( \theta X_1) ) &= \frac{ \partial }{ \partial \theta } \E( \mbox{exp}( \theta_1 X_1) X_j ) = \frac{ \partial }{ \partial \theta } \E( \mbox{exp}( \theta X_1) E(X_j \mid X_1) ) \\
&= \frac{ \partial }{ \partial \theta } \E( \mbox{exp}( 2 \theta X_1) ) = 2 \lambda \mbox{exp}( \lambda( \mbox{exp}(2 \theta) -1 ) + 2 \theta).
\end{align*}
Hence, the population version of Assumption~\ref{A1Dep} is reduced to
$$
\rho_{\min} < \lambda \mbox{exp}( \lambda ( \mbox{exp}(\theta) -1 ) + \theta) (\lambda \mbox{exp}(\theta) +1) \quad \text{and} \quad \lambda + \lambda^2 < \rho_{\max}.
$$
It can be satisfied with some positive values of $\theta$. For $\lambda = 2$, $\rho_{\min} = 0.01$ and $\rho_{\max} = 10$, Assumption \ref{A1Dep} is satisfied if $\theta > -3.426$. In addition, for $\lambda = 5$, $\rho_{\min} = 0.01$ and $\rho_{\max} = 50$, it is also satisfied if $\theta > -2.205$.
\begin{figure}[!t]
\centering
\begin {tikzpicture}[ -latex ,auto,
state/.style={circle, draw=black, fill= white, thick, minimum size= 2mm},
label/.style={thick, minimum size= 2mm}
]
\node[state] (X1) at (3,1.5) {\small{$X_1$} };
\node[state] (X2) at (-2,0) {\small{$X_2$}};
\node[state] (X3) at (0,0) {\small{$X_3$}};
\node[state] (X41) at (2,0.0) {\small{$\cdots$}};
\node[state] (X42) at (4,0.0) {\small{$\cdots$}};
\node[state] (X43) at (6,0.0) {\small{$\cdots$}};
\node[state] (X5) at (8,0) {\small{$X_p$}};
\path (X1) edge [shorten <= 2pt, shorten >= 2pt] node[above] {} (X2);
\path (X1) edge [shorten <= 2pt, shorten >= 2pt] node[above] { } (X3);
\path (X1) edge [shorten <= 2pt, shorten >= 2pt] node[above] { } (X41);
\path (X1) edge [shorten <= 2pt, shorten >= 2pt] node[above] { } (X42);
\path (X1) edge [shorten <= 2pt, shorten >= 2pt] node[above] { } (X43);
\path (X1) edge [shorten <= 2pt, shorten >= 2pt] node[above] { } (X5);
\end{tikzpicture}
\caption{Star graph example }
\label{fig:star}
\end{figure}
In addition, the population version of Assumption \ref{A2Inc} can be written as
$$
\max_{j \in V \setminus \{1 \} } \max_{t \in V \setminus \{1, j\} } | \E( Q_{t 1}^{j,1}) \E( (Q_{1 1}^{j, 1})^{-1} ) | = \frac{2\cdot\mbox{exp} ( \lambda \mbox{exp}(\theta)( \mbox{exp}(\theta) -1) + \theta) }{ \lambda \mbox{exp}( \theta ) +1 } \leq 1 - \alpha.
$$
This condition is also satisfied with positive values of $\theta$. For $\lambda = 2$ and $\alpha = 0.01$, a simple algebra yields that Assumption \ref{A2Inc} is satisfied if $\theta< 0.141$.
In addition, for $\lambda = 5$ and $\alpha = 0.01$, the assumption is satisfied if $\theta< 0.165$.
In terms of Assumption~\ref{A3Con}, we also claim that it can be satisfied with some positive $\theta$. Since the moment generating function of $X_1$ is $\mbox{exp}( \lambda(e -1) )$, we have,
$$
P( X_1^{(i)} > C_{x} \log( \max\{n,p\}) ) < \frac{ \E( \mbox{exp}( X_1^{(i)} ) ) }{ \max\{n,p\}^{C_{x}} } = \frac{ \mbox{exp}( \lambda(e -1) ) }{ \max\{n,p\}^{C_{x} } }.
$$
where $C_{x} > 2$ is a positive constant in Assumption~\ref{A3Con}.
For other nodes $j \in \{2,3,...,p\}$, we have,
$$
P( X_j^{(i)} > C_{x} \log( \max\{n,p\}) ) \leq \frac{ \E( \E( \mbox{exp}( X_j^{(i)} ) \mid X_1^{(i)} ) ) }{ \max\{n,p\}^{C_{x}} } = \frac{ \E( \mbox{exp}( \mbox{exp}( \theta X_1^{(i)})( e-1 ) ) ) }{ \max\{n,p\}^{C_{x}} }.
$$
For $\theta < \log X_1^{(i)} / X_1^{(i)}$, we have,
$$
P( X_j^{(i)} > C_{x} \log( \max\{n,p\}) ) \leq \frac{ \E( \mbox{exp}( X_1^{(i)} ( e-1 ) ) ) }{ \max\{n,p\}^{C_{x}} } = \frac{ \mbox{exp}( \lambda(e^{e-1} -1) ) }{ \max\{n,p\}^{C_{x} } }.
$$
Hence, for $\theta < \log ( C_{x} \log ( \max\{n,p\} ) )/ C_{x} \log ( \max\{n,p\} )$ that is the lower bound of $\log X_1^{(i)} / X_1^{(i)}$ given $X_1^{(i)} < C_{x} \log ( \max\{n,p\})$, Assumption~\ref{A3Con} is satisfied with a high probability:
$$
P\left( \max_{i,j} X_j^{(i)} > C_{x} \log( \max\{n,p\}) \right) \leq \frac{ \mbox{exp}( \lambda(e^{e-1} -1) ) }{ \max\{n,p\}^{C_{x}-2 } }.
$$
Now, we discuss Assumption~\ref{A1}. A simple calculation shows that, for any $j \in \{2,3,...,p\}$,
$$
\E(X_j) = \mbox{exp}( \lambda ( \mbox{exp}( \theta - 1 )) ), \text{ and}
\quad
\E(X_j^2) = \mbox{exp}( \lambda ( \mbox{exp}( 2 \theta) - 1 ) ) + \mbox{exp}( \lambda ( \mbox{exp}( \theta) - 1 ) ).
$$
Hence, Assumption~\ref{A1} is equivalent to the constraint,
$$
\mbox{exp}( \lambda ( \mbox{exp}( 2 \theta) - 1 ) ) > M_{min} \mbox{exp}( \lambda ( \mbox{exp}( \theta) - 1 ) ) + (1+ M_{min}) \mbox{exp}( 2\lambda ( \mbox{exp}( \theta ) - 1 ) ).
$$
This condition is also satisfied with some positive $\theta$. For $\lambda = 1$ and $M_{min} = 0$, as we discussed in Proposition~\ref{prop:moments ratio}, Assumption \ref{A2Inc} is always satisfied with any value of $\theta \neq 0$. For $\lambda = 2$ and $M_{min} = 0.001$, Assumption \ref{A2Inc} is satisfied if $|\theta| > 0.033$. Lastly, for $\lambda = 5$ and $M_{min} = 0.001$, Assumption \ref{A2Inc} is satisfied if $|\theta| > 0.021$. Therefore, we show that for this particular star graph, Assumption~\ref{A1Dep},~\ref{A2Inc},~\ref{A3Con}, and~\ref{A1} can be satisfied with a high probability by allowing positive $\theta$.
Finally, we emphasize that the sample complexity of the MRS algorithm, $n = \Omega( d^{2} \log^{9} p)$, does not rely on the maximum degree of the moralized graph, $d_m$, while many DAG learning algorithms using the sparsity of the moralized graph or Markov blanket inevitably depend on $d_m$. For the star graph with $d =1$ and $d_m = p-1$, the MRS algorithm requires $n = \Omega( \log^{9} p)$ to recover the graph in high dimensional settings, while the ODS algorithm may fail since its sample complexity is $\Omega( d_m^{4} \log^{12} p)$. This fact implies that, unlike the ODS algorithm, the MRS algorithm can recover a sparse graph containing hub nodes in high dimensional settings.
\section{Numerical Experiments}
\label{SecNume}
In this section, we provide simulation results to support our main theoretical results of Theorem~\ref{ThmMainTheorm} and the computational complexity in Section~\ref{SecComp}: (i) the MRS algorithm recovers the ordering and edges more accurately as sample size increases; (ii) the required sample size $n = \Omega( d^{2} \log^9 p )$ depends on the number of nodes $p$ and the complexity of the graph $d$; (iii) the MRS algorithm accurately learns the graphs in high-dimensional settings ($p > n$); and (iv) the computational complexity is $O(n p^3)$ at worst. We also show that the MRS algorithm performs favorably compared to the ODS~\citep{park2015learning}, GES~\citep{chickering2003optimal}, and MMHC~\citep{tsamardinos2006max} algorithms. In addition, we investigate how sensitive our MRS algorithm is to deviations from the assumption about the link functions by using the identity link function in Equation~\eqref{eq:JointPDAGM}. Lastly, we also investigate how well the MRS algorithm recovers undirected edges when samples are generated by Poisson and truncated Poisson MRFs~\citep{yang2013poisson, yang2015graphical, inouye2017review}.
\subsection{Random Poisson SEMs}
\label{SecRanPSEM}
We conducted simulations using $200$ realizations of $p$-node Poisson SEMs~\eqref{eq:PDAGGLM} with the randomly generated underlying DAG structures while respecting the indegree constraints $d \in \{1, 5, 10\}$. A graph with $d=1$ is a special case where there is no v-structure, and therefore, the corresponding MEC is completely undirected. The set of non-zero parameters $\theta_{j}, \theta_{jk} \in \mathbb{R}$ in Equation~\eqref{eq:PDAGGLM} was generated uniformly at random in the range $\theta_{j} \in [1, 3]$, $\theta_{jk} \in [-1.5, -0.5] \cup [0.5, 1.5]$ for $d=1$, and $\theta_{jk} \in [-1, -0.1] \cup [0.1, 1]$ for $d = 5, 10$, which helps the generated values of samples to avoid either all zeros or from going beyond the maximum possible value of the R program ( $> 10^{309}$). Nevertheless, if some samples were beyond the maximum possible value, we regenerated the parameters and samples.
The MRS and ODS algorithms were implemented using $\ell_1$-regularized likelihood where we used five-fold cross validation to choose the regularization parameters. Where mean squared error was within two standard error of the minimum mean squared error, we chose the minimum value for the moments ratio scores and the largest value for parent selection. That was because a less biased estimator is preferred for the score calculation, and we preferred a sparse graph containing only legitimate edges. We acknowledge that the level of sparsity can be adjusted according to the importance of precision or recall.
In Fig.~\ref{fig:result001}, we compare the MRS algorithm to state-of-the-art ODS, GES and MMHC algorithms for graph node size $p = \{20, 200\}$, varying sample size $n \in \{25, 50, ..., 250\}$ for $d = 1$ and $n = \{100, 200,..., 1000\}$ for $d = 10$, and provide two results: (i) the average precision ($\frac{ \# \text{ of correctly estimated edges } }{ \# \text{ of estimated edges} }$); (ii) the average recall ($\frac{ \# \text{ of correctly estimated edges } }{ \# \text{ of true edges} }$). As discussed, the both GES and MMHC algorithms only recover the partial graph by leaving some arrows undirected. Therefore, we also provide average precision and recall for the estimated MECs in Fig.~\ref{fig:result002}. Lastly, we provide an oracle, where the true parents of each node are used, while the ordering is estimated via $\ell_1$-regularized GLM. Hence, we can see where the errors come from between the ordering estimation or parent selection. We considered more parameters ($\theta_{jk}, n, p, d$), but for brevity, we focus on these settings.
\begin{figure*}[!t]
\centering \hspace{-2mm}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/PoissonP20D1Precision.png}
\caption{Prec:$p$=20,$d$=1}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/PoissonP20D1Recall.png}
\caption{Reca:$p$=20,$d$=1}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/PoissonP20D10Precision.png}
\caption{Prec:$p$=20,$d$=10}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/PoissonP20D10Recall.png}
\caption{Reca:$p$=20,$d$=10}
\end{subfigure}
\begin{subfigure}[!htb]{.07\textwidth}
\includegraphics[width=\textwidth, trim={14cm 0 0.3cm 1.5cm},clip]{plots/DAGLegend.png}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/PoissonP200D1Precision.png}
\caption{Prec:$p$=200,$d$=1}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/PoissonP200D1Recall.png}
\caption{Reca:$p$=200,$d$=1}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/PoissonP200D10Precision.png}
\caption{Prec:$p$=200,$d$=10}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/PoissonP200D10Recall.png}
\caption{Reca:$p$=200,$d$=10}
\end{subfigure}
\begin{subfigure}[!htb]{.07\textwidth}
\includegraphics[width=\textwidth, trim={14cm 0 0.3cm 1.5cm},clip]{plots/DAGLegend.png}
\end{subfigure}
%
\captionsetup{format=hang}
\caption{Comparison of the MRS algorithm to the oracle, ODS, GES and MMHC algorithms in terms of precision and recall for Poisson SEMs with $p \in \{20, 200\}$ and $d \in \{1, 10\}$.}
\label{fig:result001}
\end{figure*}
As we can see in Fig.~\ref{fig:result001}, the MRS algorithm more accurately recovers the true directed edges as sample size increases. In addition, the MRS algorithm is more precise for small sparse graphs than for large-scale or dense graphs, given the same sample size. Hence it confirms that the MRS algorithm is consistent, and the sample bound $n = \Omega( d^{2} \log^9 p )$ depends on $p$ and $d$.
The MRS algorithm significantly outperforms state-of-the-art GES and MMHC algorithms in terms of both precision and recall, on average, except for cases $p =20, d=1, n \leq 50$. It is worth noting that the GES and MMHC algorithms are not consistent, because the recall for any tree graph must be zero in population, whereas the recall from GES and MMHC increases as sample size increases. Hence, we can conclude that the GES and MMHC algorithms find correct directed edges by finding incorrect v-structures. It is an expected result because the comparison methods only work with a non-faithful distribution, which rarely arises in finite sample settings~\citep{uhler2013geometry}.
Fig.~\ref{fig:result001} shows that the MRS and ODS algorithms have similar performance in identifying directed edges when the indegree is a small $d = 1$. It makes sense because the ODS algorithm recovers any Poisson DAG models if the moralized graph is sparse. In other words, the accuracy of the ODS algorithm may be poor for the non-sparse graph. Moreover, the ODS algorithm often fails to be implemented due to a lack of samples for the estimation of conditional variance, that is, $\sum_{i=1}^{n} \mathbf{1}( X_{S}^{(i)} = x ) < 2$ for all $x \in \mathcal{X}_{S}$. Table~\ref{Tbl:ODSresult} shows the number of failures in the ODS algorithm implementations for node size $p \in \{20, 50\}$ and sample size $n \in \{100, 200,..., 1000\}$ when the indegree is $d = 5$, and the degree of the moralized graph is at most $d_{m} = p-1$. It empirically confirms that the ODS algorithm requires a huge number of samples to be implemented when a true graph is not sparse. Hence, we do not apply the ODS algorithm for the graphs with $d = 10$. It is consistent with our main result that our method can learn the Poisson SEMs with some hub nodes while the ODS algorithm might not.
\begin{table*}
\begin{center}
\begin{tabular}{c c c c c c c c c c c}
n & 100 & 200 & 300 & 400 & 500 & 600 & 700 & 800 & 900 & 1000 \\ \hline
p = 20 & 199 & 175 & 107 & 64 & 1 & 0 & 0 & 0 & 0 &0 \\ \hline
p = 50 & 200 & 200 & 200 & 199 & 192 & 179 & 151 & 140 & 99 & 86 \\ \hline
\end{tabular}
\captionsetup{format=hang}
\caption{Number of failures in ODS algorithm implementations from among 200 sets of samples for different node sizes $p \in \{20, 50\}$, and sample sizes $n \in \{100, 200,..., 1000\}$, when the indegree is $d = 5$.\label{Tbl:ODSresult} }
\end{center} \vspace{-5mm}
\end{table*}
\begin{figure*}[!t]
\centering \hspace{-2mm}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/PoissonP20D1PrecisionMEC.png}
\caption{Prec:$p$=20,$d$=1}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/PoissonP20D1RecallMEC.png}
\caption{Reca:$p$=20,$d$=1}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/PoissonP20D10PrecisionMEC.png}
\caption{Prec:$p$=20,$d$=10}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/PoissonP20D10RecallMEC.png}
\caption{Reca:$p$=20,$d$=10}
\end{subfigure}
\begin{subfigure}[!htb]{.07\textwidth}
\includegraphics[width=\textwidth, trim={14cm 0 0.3cm 1.5cm},clip]{plots/MECLegend.png}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/PoissonP200D1PrecisionMEC.png}
\caption{Prec:$p$=200,$d$=1}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/PoissonP200D1RecallMEC.png}
\caption{Reca:$p$=200,$d$=1}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/PoissonP200D10PrecisionMEC.png}
\caption{Prec:$p$=200,$d$=10}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/PoissonP200D10RecallMEC.png}
\caption{Reca:$p$=200,$d$=10}
\end{subfigure}
\begin{subfigure}[!htb]{.07\textwidth}
\includegraphics[width=\textwidth, trim={14cm 0 0.3cm 1.5cm},clip]{plots/MECLegend.png}
\end{subfigure}
\captionsetup{format=hang}
\caption{Comparison of the MRS algorithm to the oracle, ODS, GES, and MMHC algorithms in terms of the precision and recall for the MECs of Poisson SEMs with $p \in \{20,100\}$ and $d \in \{1, 10\}$.}
\label{fig:result002}
\end{figure*}
Fig.~\ref{fig:result002} shows the analogous results for the recovery of MECs, in which the MRS and all comparison algorithms consistently learn the true MECs. The performance of the MRS algorithm gets better as sample size increases or node size decreases. In addition, we can see that the MRS algorithm still recovers the MEC of the Poisson SEM better on average than the comparison methods. However, it must be pointed out that our MRS algorithm applies to Poisson SEMs~\eqref{eq:PDAGGLM}, while the ODS algorithm accurately learns sparse Poisson DAG models where arbitrary link functions are allowed. In addition, the GES and MMHC algorithms apply to more general classes of DAG models.
\subsection{Random Poisson DAG Models}
\label{SecRanPDAG}
\begin{figure*}[!t]
\centering \hspace{-2mm}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/p20precision_sensitivity.png}
\caption{Prec:$p$=20,$d$=2}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/p20recall_sensitivity.png}
\caption{Reca:$p$=20,$d$=2}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/p100precision_sensitivity.png}
\caption{Prec:$p$=100,$d$=2}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/p100recall_sensitivity.png}
\caption{Reca:$p$=100,$d$=2}
\end{subfigure}
\begin{subfigure}[!htb]{.07\textwidth}
\includegraphics[width=\textwidth, trim={14cm 0 0.3cm 1.5cm},clip]{plots/DAGLegend.png}
\end{subfigure}
\captionsetup{format=hang}
\caption{Comparison of the MRS algorithm to the oracle, ODS, GES and MMHC algorithms in terms of the precision and recall for Poisson DAG models with $p \in \{20,100\}$, $d = 2$, and the identity link function.}
\label{fig:result003}
\end{figure*}
When the data are generated by a random Poisson DAG model~\eqref{eq:CondPDAGM} where $g_j$ is not the standard log link function, our MRS algorithm is not guaranteed to estimate the true directed acyclic graph and its ordering. Hence, an important question is how sensitive our method is to deviations from the link assumption. In this section, we empirically investigate this question.
We generated the $200$ samples with the same procedure specified in Section~\ref{SecRanPSEM}, but with the indegree constraint $d = 2$, and except that identity link function $g_j( \eta ) = \eta$ and the range of parameters was $\theta_{jk} \in [-1.5, -0.5] \cup [0.5, 1.5]$. We note that the link function must be positive, but we allow the negative value of $\theta_{jk}$ by randomly choosing $\theta_{j} \in [1, 10]$. If any Poisson rate parameter is negative, we regenerated the parameters.
In Fig.~\ref{fig:result003}, we compare the MRS to state-of-the-art ODS, GES and MMHC algorithms for varying sample size $n \in \{25,50,...,250\}$, and node size $p \in \{20, 100\}$. Fig.~\ref{fig:result003} shows that the MRS algorithm consistently recovers the true graph, and hence, we can see that the MRS algorithm is not so sensitive to deviations from the link assumption. Comparing it to the ODS algorithm, the MRS algorithm shows slightly worse performance because the ODS algorithm is designed to learn general Poisson DAG models with any type of link functions. However, we can see that the MRS algorithm still performs better than the greedy search-based methods in both average precision and recall.
\subsection{Random Poisson and Truncated Poisson Markov Random Fields}
\begin{figure*}[!t]
\centering \hspace{-2mm}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/PGMP20PrecisionMEC.png}
\caption{Poisson: Prec}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/PGMP20RecallMEC.png}
\caption{Poisson: Reca}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/TPGMP20PrecisionMEC_75.png}
\caption{Truncated: Prec}
\end{subfigure}
\begin{subfigure}[!htb]{.22\textwidth}
\includegraphics[width=\textwidth, trim={0.5cm 0.2cm 0 0.2cm},clip]{plots/TPGMP20RecallMEC_75.png}
\caption{Truncated: Reca}
\end{subfigure}
\begin{subfigure}[!htb]{.07\textwidth}
\includegraphics[width=\textwidth, trim={20.2cm 0 0.3cm 1.5cm},clip]{plots/MRFLegend.png}
\end{subfigure}
\captionsetup{format=hang}
\caption{Comparison of the MRS algorithm to the Poisson MRF learning (PMRF) and truncated Poisson MRF learning (TMRF) algorithms in terms of the precision and recall for undirected edges of random 20-nodes Poisson MRFs and truncated Poisson MRFs with $d_m = 5$, and $R = 100$.}
\label{fig:result005}
\end{figure*}
When samples are generated by a Poisson or truncated Poisson MRF, our MRS algorithm is not guaranteed to find the true dependence relationships of variables. Hence, it is also important to investigate how well our algorithm recovers undirected edges when multivariate count data is from an MRF. In this section, we compare our MRS algorithm to state-of-the-art Poisson MRF (PMRF) and truncated Poisson MRF learning (TMRF) algorithms~\citep{yang2013poisson,yang2015graphical,inouye2017review} when multivariate count data is from Poisson MRFs and truncated Poisson MRFs, respectively. We used the R package XMRF~\citep{wan2016xmrf} for truncated Poisson MRFs.
We generated $100$ samples of 20-nodes random Poisson MRF and truncated Poisson MRF with the randomly generated underlying undirected graphs, respectively. For Poisson MRFs, we set the maximum Markov blanket $d_m = 5$ and the non-zero parameters in Equation~\eqref{eq:PoissonMRF} was generated uniformly at random in the range $\theta_{j} \in [1, 2]$, but we fixed $\theta_{jk} = -0.1$ for all $j \in V$. This is a similar setting used in \cite{yang2015graphical}. For truncated Poisson MRFs, we set $d_m = 5$, $\theta_{j} = 0$, $\theta_{jk} = 0.1$, and the truncation level is $R = 100$, meaning that all samples are less than 100 (see details in Equation 3 of \citealp{yang2013poisson}). In terms of the choice of regularization parameters for the MRS and PMRF algorithms, we used five-fold cross validation as we used in Section~\ref{SecRanPSEM}. For the TMRF algorithm, we set the regularization parameters to 0.1 since this value seems to work well.
Fig.~\ref{fig:result005} compares the MRS algorithm to state-of-the-art PMRF and TMRF algorithms in terms of recovering undirected edges by varying sample size $n \in \{100, 200,..., 1000\}$. For a fair comparison, we used the skeleton of the estimated MEC via the MRS algorithm, because our algorithm returns a DAG. As we can see in Fig.~\ref{fig:result005}, the MRS algorithm consistently finds the true edges from both Poisson MRF and truncated Poisson MRF samples. Hence, we empirically verify that the MRS algorithm can recover some dependence relationships of variables even if samples are from Poisson or truncated Poisson MRFs.
Fig.~\ref{fig:result005} also shows that the MRS algorithm performs significantly worse than the comparison PMRF and TMRF algorithm, on average, when samples are from Poisson MRFs and truncated Poisson MRFs, respectively. It is an expected result because the PMRF and TMRF algorithms are for learning Poisson MRFs and truncated MRFs, while our algorithm is for Poisson SEMs. However, it is worth noting that the TMRF algorithm seems not to work on average when samples are from a Poisson MRF in our setting. It is mainly because the TMRF algorithm is for learning truncated Poisson MRFs, not Poisson MRFs. We emphasize that, in another setting where $\theta_j$ is fixed to 1, the TMRF algorithm works much better. It is also worth noting that the PMRF algorithm seems not to recover any undirected edges when samples are from a truncated Poisson MRF. It can be clearly explained by the fact that the PMRF algorithm cannot capture the positive dependencies, however all parameters are positive in our setting.
\subsection{Computational Complexity}
\begin{figure*}[!t]
\centering
\begin{subfigure}[!htb]{.30\textwidth}
\includegraphics[width=\textwidth, height = 2.5cm, trim={0.0cm 0.2cm 0 0.2cm},clip]{plots/p100time.png}
\caption{$p=100, d=5$}
\end{subfigure}
\begin{subfigure}[!htb]{.30\textwidth}
\includegraphics[width=\textwidth, height = 2.5cm, trim={0.0cm 0.2cm 0.2cm 0.2cm},clip]{plots/p500time.png}
\caption{$p=500, d=5$}
\end{subfigure}
\begin{subfigure}[!htb]{.30\textwidth}
\includegraphics[width=\textwidth, height = 2.5cm, trim={0.0cm 0.2cm 0.2cm 0.2cm},clip]{plots/n500time.png}
\caption{$n=500, d=5$}
\end{subfigure}
\begin{subfigure}[!htb]{.07\textwidth}
\includegraphics[width=\textwidth, trim={9.5cm 0 0.3cm 1.5cm},clip]{plots/legend_time.png}
\end{subfigure}
\captionsetup{format=hang}
\caption{Comparison of the MRS algorithm to the GES and MMHC algorithms in terms of the running time with respect to node size $p$ and sample size $n$}
\label{fig:result004}
\end{figure*}
Fig.~\ref{fig:result004} compares the run-time of the MRS, GES, and MMHC algorithms for learning Poisson SEMs with indegree $d = 5$ by varying sample size $n \in \{100, 200, ... ,1000\}$ with fixed node size $p \in \{100, 500\}$, and varying node size $p \in \{10, 20, ..., 200\}$ with fixed sample size $n = 500$. Fig.~\ref{fig:result004} supports the worst case computational complexity $O(np^3)$ discussed in Section~\ref{SecComp}. In addition, it shows that the MRS algorithm is significantly faster than the greedy search-based GES and MMHC algorithms when a sample size is large ($n > 500$).
\section{Real Multivariate Count Data: MLB Statistics}
\label{SecReal}
We now apply the MRS algorithm and state-of-the-art ODS and MMHC algorithms to a simple data set that involves multivariate count data that models baseball statistics for Major League Baseball (MLB) players during the 2003 season. To the best of our knowledge, our MRS algorithm is the only algorithm that provides a reliable and scalable approach to non-sparse DAG learning with multivariate count data although it is under strong assumptions. In particular, other approaches, such as PC, MMHC, and approaches based on conditional independence testing, suffer severely from the fact that we are dealing with count variables where the number of discrete states is potentially infinite. In addition, ODS algorithm cannot deal with a non-sparse graph such as a graph containing hub nodes. Lastly, both Poisson MRF and truncated Poisson MRF may provide an extremely complicated graph because it connects all pairs of nodes having a common child like a moralized graph.
Our original data set consists of 800 MLB player salary and batting statistics from the 2003 season (see R package Lahman in \citealp{lahmanRpackage} for detailed information). The data set contains 23 covariates: Salary, Number of: Games Played (G), At Bats (AB), Runs (R), Hits (H), Doubles (X2B), Triples (X3B), Home Runs (HR), Runs Batted In (RBI), Stolen Bases (SB), times Caught Stealing (CS), Bases on Balls (BB), Strikeouts (SO), Intentional Walks (IBB), times Hit by Pitch (HBP), Sacrifice Hits (SH), Sacrifice Flies (SF), and times Grounded into Double Plays (GIDP), plus Player ID, Year ID, Stint, Team ID, and League ID. However, we eliminated Player ID, Year ID, Stint, Team ID, and League ID because our focus is to find the directional or causal relationships between salary and batting statistics. In addition, we only considered players in the top 25\% in terms of the number of games played, because the baseball statistics relationships from players who played only a few games could be uncertain. Therefore, the data set we considered contained 18 variables and 200 observations.
We assumed each node to a conditional distribution given its parents is Poisson because most MLB statistics, except for salary, reflect the number of successes or attempts that were counted during the season. Hence, we applied the MRS algorithm for Poisson DAG models with leave-one-out cross validation to choose the tuning parameters, and we chose the largest value where mean squared error is within 2.5 standard error of the minimum mean squared error, because we prefer a sparse graph containing only legitimate edges.
\begin{figure}
\centering
\includegraphics[width=0.60\linewidth, trim={6cm 11cm 6cm 10cm},clip]{plots/MLBDAG.pdf}
\captionsetup{format=hang}
\caption{MLB player statistics directed graph estimated by the MRS algorithm for Poisson DAG models.}
\label{fig:MLBDAG}
\end{figure}
Fig.~\ref{fig:MLBDAG} shows the directed graph estimated by our MRS algorithm. The estimated graph reveals clear causal/directional relationships between batting statistics. This makes sense, because players with larger numbers of HR, BB, RBI, and/or R have a better salary. The more games played, or the more batting chances, the higher H, BB, SO, RBI, and other statistics. Moreover, the higher the total number of hits, the more X2Bs, X3Bs, Rs and the fewer SOs. Players with more home runs and base on balls get intentional walks more frequently. Lastly, the more stolen bases are attempted, the more they are caught stealing, because there is no success without failure.
We acknowledge that our proposed DAG model returns many errors due to restrictive assumptions that are not completely satisfied by the real data. However, the benefit is best seen by comparing MRS to other DAG learning approaches and an undirected graphical model for multivariate count data. In particular, we applied Poisson undirected graphical models~\citep{yang2015graphical} in which $\ell_1$-regularized Poisson regressions are applied. We provide the estimated undirected graph with the largest tuning parameter where mean squared of error is within 2.5 standard error of the minimum mean squared error. The estimated undirected graph in Fig.~\ref{fig:MLBDAG2} (left side) shows that a lot of nodes are connected by edges, that many edges are unexplainable, and that some legitimate edges are missing (e.g., [H, X3B], [SB, CS] are not connected), because the Poisson undirected graphical model only permits negative conditional relationships, whereas most variables are positively correlated. Hence, it may not be useful to understand the relationships between MLB statistics.
We also compared the MMHC algorithm. As discussed, the MMHC algorithm does not guarantee to find a complete directed graph, and prefers a sparser graph when the faithfulness assumption is violated, which often arises in finite sample settings~\citep{uhler2013geometry}. Hence, the estimated directed graph in Fig.~\ref{fig:MLBDAG2} (right side) is extremely sparse, with only four directed edges: [H, HR], [SO, HR], [HR, RBI], and [SF, RBI]. Lastly, ODS algorithm failed to be implemented as expected because of some hub nodes such as the number of games, at bats, and runs batted in.
\begin{figure}
\begin{center}
\includegraphics[width=0.48\linewidth, trim={5.8cm 11cm 6cm 10cm},clip]{plots/MLBundirected.pdf}
\includegraphics[width=0.48\linewidth, trim={5.8cm 11cm 6cm 10cm},clip]{plots/MLBGES.pdf}
\captionsetup{format=hang}
\caption{MLB player statistics undirected graph estimated by $\ell_1$-penalized likelihood regression (left) and a directed acyclic graph estimated by the MMHC algorithm (right).}
\label{fig:MLBDAG2}
\end{center}
\end{figure}
Since our method is the first identifiability result for the strongly correlated count data when variables are directional/causal relationships and there exist hub variables, to the best of our knowledge, our method better identifies the directional/causal relationships between MLB statistics. However, we acknowledge that, like most other DAG-learning approaches, very strong assumptions, such as dependency, incoherence, are required for reliable recovery.
\section{Future Works}
\label{SecFuture}
Several topics remain for future works. Although our assumptions are similar to the assumptions in the previous works of $\ell_1$-regularized Poisson regression, our assumptions could be very restrictive. In addition, they cannot be confirmed from data. However, we conjecture that the assumptions are satisfied with a high probability under mild conditions, and one may be able to prove this. In addition, it is an important problem of finding the minimax rate of the Poisson DAG models, and it should be investigated in the future. Lastly, it would be also interesting to explore if our idea can be applied to other structural equation models with Binomial, Negative Binomial, Exponential, and Gamma distributions. We believe that our node-wise $\ell_1$-regularized based approach can be extended to the identifiable linear SEMs under some suitable conditions.
\bibliographystyle{IEEEtran}
| {'timestamp': '2019-05-28T02:27:09', 'yymm': '1810', 'arxiv_id': '1810.02501', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02501'} | arxiv |
\section{Introduction}\label{sec:introduction}
Weather-related outages in electricity distribution networks (DNs) continue to show an upward trend as utilities face the dual problems of deteriorating power grid infrastructure and higher frequency of natural disasters such as hurricanes~\cite{Campbell,Davidson1}.
Prolonged delays in restoring the power supply for Puerto Rico in the aftermath of Hurricane Maria highlight the importance of strategic planning and efficient response to extreme events. This paper is motivated by the need for developing a modeling framework that (i) accounts for the likely locations of component failures for damage assessment; and (ii) enables the design of pre-storm resource allocation strategies as well as post-storm repair operations. To address these issues, we formulate a two-stage stochastic optimization problem based on an uncertainty model of storm-induced failures.
Our uncertainty model utilizes predictions of storm tracks and surface wind velocities over a spatial region during the expected duration of the storm (see \cite{BaoFuentes} for a related approach). Hours or days in advance of a storm, one can obtain track forecasts from public sources such as the National Hurricane Center (NHC). For a forecasted storm track, we estimate the surface wind velocity field using well-known parametric models \cite{Holland}. We focus on wind-induced damage (as opposed to flooding-induced failures), as strong winds during a storm are reported to be one of the primary factors for failures of above ground DN components, such as the failures resulting from falling of trees/vegetation on power lines and poles~\cite{LiGengfeng}. Next, we estimate the failure probabilities of DN components using a non-homogeneous Poisson process (NHPP) model, which depends on the estimated location-specific wind velocities \cite{Zhou}-\cite{AS}. Finally, these failure probabilities are used as an input to the two-stage stochastic optimization problem.
A key aspect of our formulation is that we allow for the partial DN operation in situations when the bulk power supply is no longer available, and it is beneficial to operationalize microgrids during the recovery period. Literature is now available on the allocation of repair crew and optimal response operations \cite{vanHentenryck, Whipple, Perakis, Kirschen}. These contributions focus on resource limitations, failure uncertainties, and physical constraints. However, the problem of proactive allocation of temporary generators in the pre-storm stage has received limited attention in the literature. This opportunity becomes especially relevant given the technological progress in portable Distributed Energy Resources (DERs) and microgrid technologies~\cite{hurricaneMicrogrid}. The significance of proactive DER allocation in the face of natural disasters has already been acknowledged by federal agencies~\cite{derSiteFEMAArticle,derSiteArticle}. Our formulation allows for strategic placement of DERs at a subset of DN nodes in the pre-storm stage, given the uncertainty in component failures and the resulting outages and lost load for a particular storm. These DERs can then be used to sustain microgrids in the post-storm stage~\cite{Badolato}, while the line repair operations are being completed and the connection to bulk supply is being restored.
Our two-stage stochastic mixed-integer problem considers the DER placement decisions in Stage I (pre-storm), and a multi-period repair problem with DER dispatch within each microgrid in Stage II (post-storm). The objective is to minimize the sum of the cost incurred in DER allocation and the expected cost of unmet demand during the time period of repair and recovery operations. For a given DER allocation (placement) and a realization of DN component disruptions, Stage II is a multi-period problem in which line repair schedules and dispatch within each microgrid are jointly determined. From a practical viewpoint, each period can be viewed as one work shift of the repair crews and the number of repairs per period is constrained. In the $0^\text{th}$ period, the subnetworks formed as a result of disruptions start to operate as microgrids using the available DER supply. In the subsequent time periods, damaged lines are repaired, permitting connections between smaller microgrids to progressively form larger microgrids. In the last time period, the DN is connected back to the main grid, and normal operation is restored. Crucially, the Stage II problem relies on an estimate of the total number of time periods needed for full recovery. We also utilize a novel model of linear power flow for a microgrid island with parallel operation of multiple DER inverters. \Cref{fig:timeline} summarizes the order of events and decisions in our formulation.
\begin{figure}[htbp!]
\centering
\begin{tikzpicture}[scale=1]
\draw [thick,-] (0.25,0.15) -- (.25,-0.15);
i[align=center] at (1,0.75) {DER\\allocation\\($a$)};
i[align=center] at (.25,-0.75) {Storm\\forecast};
i[align=center] at (2,2.1) {Storm\\landing};
i[align=center] at (2,-1.1) {$t=t_1$};
\draw [thick,->] (2,-0.85) -- (2,-0.15);
\draw [thick,->] (2,1.7) -- (2,0.15);
i[align=center] at (2.875,0.75) {Line\\failures\\$(s)$};
\draw [thick,->] (3.75,1.7) -- (3.75,0.15);
i[align=center] at (3.75,2.1) {Storm\\passing};
i[align=center] at (5.5,1) {Line repairs\\($\yc{}{}$)};
i[align=center,font=\fontsize{7}{7}\selectfont] at (5.5,-1) {($\xc{}{}$)\\Dispatch\\within\\ microgrids};
\draw [thick,->] (3.75,-0.85) -- (3.75,-0.15);
i[align=center] at (3.75,-1.25) {$t=t_2$\\$k=0$};
\draw [thick,->] (7.25,-0.85) -- (7.25,-0.15);
i[align=center] at (7.25,-1.25) {\\$k=\mathrm{K}$};
i[align=center] at (7.25,2.1) {Reconnect\\to grid};
\draw [thick,->] (7.25,1.7) -- (7.25,0.15);
\draw [thick,->] (0,0) -- (8,0);
\draw [thick,decorate,decoration={brace,amplitude=6pt,raise=0pt}] (3.9,0.2) -- (7.1,0.2);
\draw [thick,decorate,decoration={brace,amplitude=6pt,raise=0pt}] (7.1,-0.2) -- (3.9,-0.2);
\foreach {x} in {-1,...,13}
\draw [thick,-] (4+0.25*{x},0.1) -- (4+0.25*{x},-0.1);
\end{tikzpicture}
\caption{Timeline of events and decision stages. The DER placement decision ($a$) is made before the storm hits the network ($t=t_1$). Uncertainty $s$ is realized over the course of the storm. After passing of the storm ($t=t_2$, $\protectk = 0$), optimal power flow and line repair decisions ($x,y$) are made. At $\protect {k=\mathrm{K}}$ (end of repair time horizon), the network is fully restored. }
\label{fig:timeline}
\vspace{-3mm}
\end{figure}
Our formulation considers a tree DN with nodes and distribution lines $\G=(\N\bigcup\{0\},\E)$, where $\N$ denotes the set of all DN nodes. The substation node is labeled as 0, and it also forms the connection to the bulk supply through a transmission network. The set $\E$ denotes the set of directed edges, such that the edges are directed away from the substation node. The first-stage problem is as follows \cite{Shapiro}:
\begin{align}\label{eq:sooFirstStage}
\begin{aligned}
\min_{a\in\mathcal{A}} \left\{\myc{g}{}{}\left(a\right) \coloneqq \myc{\costSO_{\text{alloc}}}{}{}^T a + \mathbb{E}_{ \myc{S}{}{} \sim \myc{\mathcal{P}}{}{}} \myc{J}{}{}\left( a, \myc{S}{}{}\right) \right\},
\end{aligned}
\end{align}
where $a$ denotes a resource allocation strategy to be chosen from the set of feasible strategies $\mathcal{A}$. The uncertainty in the random vector $\myc{S}{}{}$ characterizes the random failures of distribution lines and has a probability distribution $\myc{\mathcal{P}}{}{}$ defined over the set of possible line failure scenarios $\mathcal{S} \coloneqq \{0,1\}^{\E}$. $\myc{\costSO_{\text{alloc}}}{}{}$ is a length-$|\N|$ vector of the allocation cost per unit resource at the nodes, $\myc{\costSO_{\text{alloc}}}{}{}^Ta$ is the cost of resource allocation and $\mathbb{E}_{\myc{S}{}{}\sim\myc{\mathcal{P}}{}{}}\myc{J}{}{}(a,\myc{S}{}{})$ is the expected cost of unmet demand under allocation scheme $a$.
To model the post-storm multi-period dispatch with repair scheduling, we consider an a priori fixed time horizon with $\mathrm{K}$ periods. Let $\mathcal{K} \coloneqq \{0,1,\cdots,\mathrm{K}\}$ denote the set of all periods. We denote a period by $k$. For a specific realization of line failures $s\in\mathcal{S}$, $\myc{J}{}{}(a,s)$ denotes the optimal value of the second-stage problem which is given as follows:
\begin{align}\label{eq:sooSecondStage}
\begin{aligned}\small
\myc{J}{}{}\left(a, s\right) := &\min_{\xc{s}{},\yc{s}{}} &&
\textstyle\sum_{k = 0}^{\mathrm{K}}\ \myc{\costSO_{\text{dem}}}{}{}^T\xc{\period,\scenarioIdx}{} \\
& \text{ s.t.} &&\yc{s}{}\in \Yc{}{}\left(s\right), \quad \xc{s}{} \in \Xc{}{}\left(a,s,\yc{s}{}\right),
\end{aligned}
\end{align}
where the scenario-specific second-stage decision variables $\xc{s}{} = \{\xc{\period,\scenarioIdx}{}\}_{k\in\mathcal{K}}$ and $\yc{s}{} = \{\yc{\period,\scenarioIdx}{}\}_{k\in\mathcal{K}}$ respectively denote the collection of dispatch and line repair actions for each period. For a failure scenario $s\in\mathcal{S}$, $\Yc{}{}\left(s\right)$ denotes the set of feasible repair schedules, and $\Xc{}{}\left(a,s,\yc{s}{}\right)$ denotes the set of feasible power flows under the DER allocation $a$ and chosen line repair schedule $\yc{s}{}\in\Yc{}{}\left(s\right)$.
The number of all possible scenarios grows exponentially ($2^{|\N|}$) for a network with $|\N|$ number of nodes, such that enumeration of scenarios in $\mathcal{S}$ is not feasible for sufficiently large $|\N|$. This challenge renders calculating $\mathbb{E}_{\myc{S}{}{}\sim\myc{\mathcal{P}}{}{}}\myc{J}{}{}(a, \myc{S}{}{})$ computationally intractable for large networks. Using the sample average approximation (SAA) method~\cite{Shapiro}, one can obtain an approximate solution to the stochastic optimization problem \eqref{eq:sooFirstStage} by solving the following mixed integer program (MIP):
\begin{equation}\label{eq:sooEmpirical}
\begin{aligned}
&\min_{a\in\mathcal{A}} \left\{
\hat \myc{g}{}{}_{\widehat{\setScenarios}}(a):= \myc{\costSO_{\text{alloc}}}{}{}^Ta + \frac{1}{S}\textstyle\sum_{s \in \widehat{\setScenarios}} \myc{J}{}{}(a, s) \right\},
\end{aligned}
\end{equation}
where $\widehat{\setScenarios} \subset \mathcal{S}$ is a suitably chosen (preferably small) subset of the set of failure scenarios, $S \coloneqq |\widehat{\setScenarios}|$, and $\hat \myc{g}{}{}_{\widehat{\setScenarios}}(a)$ is the SAA objective value of the first-stage problem obtained using $S$ samples drawn from the distribution $\myc{\mathcal{P}}{}{}$. By solving the MIP, we obtain the first-stage solution $a$ as well as the second-stage solutions $\xc{s}{}$ and $\yc{s}{}$ given by $\myc{J}{}{}(a, s)$. The set of constraints for Eq. \text{ref}{eq:sooEmpirical} will be discussed in \cref{sec:physicalNetwork}.
The outline of the paper is as follows. In \cref{sec:lineFailureModel}, we describe the storm wind field prediction and NHPP failure model. In \cref{sec:physicalNetwork}, we describe the DER placement model, repair scheduling model, DER dispatch model, and \textit{LinDistFlow} model for islanded microgrids. In \cref{sec:computational}, we describe our computational results on a 12-node network. Finally, we mention some future extensions to our work in \cref{sec:conludingRemarks}.
\section{Failure model}\label{sec:lineFailureModel}
In general, the probability distribution $\myc{\mathcal{P}}{}{}$ governing the random vector of line failures $S$ in the first-stage problem (Eq. \text{ref}{eq:sooFirstStage}) can be supported over $\{0,1\}^{\E}$. For some $S= s$, we use the convention $s_e=1$ to denote that line $e$ has failed, and 0 otherwise. To capture the physical impact of the storm wind field on DN components, we adopt an approach that characterizes $\myc{\mathcal{P}}{}{}$ by combining: (i) a wind velocity prediction model given a forecast of the storm track and (ii) a Non-Homogeneous Poisson Process (NHPP) model for prediction of line failure rates. The two-dimensional area of the power network is divided into grids of size $\sim$1km$\times$1km, which are indexed by $\myc{h}{}{}$ and form the set $\myc{\ch}{}{}$. We estimate the wind velocity and Poisson failure rate within each grid every hour while the storm is passing over the network. The failure probabilities of distribution lines, which are roughly of length 1km in our study and can pass through multiple grids, are a function of the Poisson rates.
The prediction of velocity measurements $\vel{}{h,t}$ in each grid $\myc{h}{}{}$ and time $t\in[t_1,t_2]$ is based on the storm center location at time $t$ and three wind field parameters: maximum intensity $\Vm$, radius of maximum winds $\Rm$, and shape parameter $\B$. The predicted velocities can be obtained from the classical Holland model which expresses velocity $\vel{}{\myc{h}{}{},\tstorm{}}$ as a function of distance $\radius{}{\myc{h}{}{},\tstorm{}}$ from the storm center \cite{Holland}:
\begin{equation}\small
\label{eq:Holland}
\begin{aligned}
\vel{}{\myc{h}{}{},\tstorm{}}=\Vm\left(\frac{\Rm}{\radius{}{\myc{h}{}{},\tstorm{}}}\right)^{\B/2}\exp\left(1-\left(\frac{\Rm}{\radius{}{\myc{h}{}{},\tstorm{}}}\right)^{\B}\right)^{1/2}.
\end{aligned}
\end{equation}
An estimate of location and time-dependent Poisson failure rates $\PPI{}{\myc{h}{}{},t}$, per unit time (hr) and line length (km), can be obtained using a quadratic NHPP model \cite{Zhou, AS, LiGengfeng}:
\begin{equation}
\label{eq:PPI}
\PPI{}{\myc{h}{}{},t} =
\begin{cases}
\Big(1+\myc{\alpha}{}{}\Big(\left(\frac{\vel{}{\myc{h}{}{},t}}{\myc{v_{crit}}{}{}}\right)^2-1\Big)\Big)\myc{\lambda_{norm}}{}{}, & \text{if }\vel{}{h,t}\geq \myc{v_{crit}}{}{}\\
\myc{\lambda_{norm}}{}{}, & \text{if }\vel{}{h,t}<\myc{v_{crit}}{}{}.
\end{cases}
\end{equation}
The failure rate is $\myc{\lambda_{norm}}{}{}$ if $\vel{}{\myc{h}{}{},t}$ is below a critical velocity $\myc{v_{crit}}{}{}$ and increases quadratically with respect to wind speed above $\myc{v_{crit}}{}{}$. We use $\myc{\alpha}{}{}=4175.6$, $\myc{v_{crit}}{}{}=20.6$ m/s, and $\myc{\lambda_{norm}}{}{}=3.5\times 10^{-5}$ failures/hr/km. These parameters were estimated in a previous study using historical storm data that includes Category 1-3 storms \cite{LiGengfeng}. \footnote{Previous studies applying the quadratic NHPP model simulate the total number of line failures within a region while assuming a spatially-constant velocity in the region at every time step.}
The cumulative intensity function $\CDF{}{\myc{h}{}{}}$ per km at grid $h$ from storm arrival ($\tstormS$) over the network to its departure ($\tstormF$) is obtained by integrating the rate over the time interval:
\begin{equation}
\begin{aligned}
\CDF{}{\myc{h}{}{}}(t_2-t_1)=\int_{t_1}^{t_2} \PPI{}{\myc{h}{}{},t}dt{}{}.
\end{aligned}
\end{equation}
Because the failure rate is given at hourly intervals and measured per hour, $\CDF{}{h}(\cdot)$ is approximately calculated as
\begin{equation}
\begin{aligned}
\CDF{}{\myc{h}{}{}}(t_2-t_1)=\textstyle\sum_{t=t_1}^{t_2} \PPI{}{\myc{h}{}{},t}.
\end{aligned}
\end{equation}
Recall that a power line may span multiple grids. Let $\lineLength{}{e,\myc{h}{}{}}$ denote the length of edge $e$ in grid $\myc{h}{}{}$. The cumulative intensity function for line $e$ is
\begin{equation}
\begin{aligned}
\CDFEdge{}{e}(t_2-t_1)=\textstyle\sum_{\myc{h}{}{}\in\myc{\ch}{}{}}\lineLength{}{e,\myc{h}{}{}}\CDF{}{\myc{h}{}{}}(t_2-t_1).
\label{eq:lineCDF}
\end{aligned}
\end{equation}
In our model, a line that has failed will remain failed for the remaining duration of the storm, such that a line can either never fail or fail once. The failure probability of line $e$ over the storm interval $t_2-t_1$ is
\begin{equation}
\begin{aligned}
\probFail{}{e}(t_2-t_1)=1-e^{-\CDFEdge{}{e}(t_2-t_1)}.
\label{eq:probLineFail}
\end{aligned}
\end{equation}
Finally, the probability of scenario $s$ is given by:
\begin{equation}\small
\begin{aligned}
\hspace{-0.1cm}\mathbf{Pr}(s)=\textstyle\prod_{e\in\E[]}\big(s_e\probFail{}{e}(t_2-t_1)+(1-s_e)(1-\probFail{}{e}(t_2-t_1)\big)
\end{aligned}
\label{eq:probScenario}
\end{equation}
which characterizes the failure probability distribution $\myc{\mathcal{P}}{}{}$. \footnote{In fact, location-specific features such as soil properties and vegetation can also impact the failure probabilities \cite{Whipple}. The effects of these inputs on the failure rates can be included by training a Poisson regression model, provided such data is available.}
The SAA method relies on solving the two-stage problem for a subset of scenarios $\widehat{\setScenarios}$. To select $\widehat{\setScenarios}$, we begin by generating 1,000 realizations $s$ of the random vector $S$ and sort $s$ in decreasing order of their probabilities $\mathbf{Pr}(s)$. Then, we randomly choose a small subset $\widehat{\setScenarios}$ ($\le 10$ number of scenarios) from the 100 most probable of these scenarios. This procedure returns a subset that is representative of the most likely failure scenarios in the DN. The question of how well this sample represents the distribution $\myc{\mathcal{P}}{}{}$ will be addressed in our future work. Nevertheless, we use the set $\widehat{\setScenarios}$ as an input to the problem \eqref{eq:sooEmpirical}, the variables and constraints of which are described in the next section.
\section{Problem formulation}\label{sec:physicalNetwork}
We first define notation related to DN line parameters. A distribution line $e\in\E$ connects a node $j$ to its parent node $i$ in the tree network. Here $i$ and $j$ are the from and to nodes of line $e$, which are denoted by $\fromNode{e}$ and $\toNode{e}$, respectively. Each line has a complex impedance $\impedance{e}=\resistance{e}+\mathbf{j}\reactance{e}$ where $\resistance{e}>0$ and $\reactance{e}>0$ denote the resistance and inductance of the line $e$, respectively, and $\mathbf{j}=\sqrt{-1}$. Also, let ${\mathrm{N}}:=|\N|$. Now, we can detail our formulation for problem \eqref{eq:sooEmpirical}.
\subsection{DER placement model}
Recall that the first-stage decision of problem \eqref{eq:sooEmpirical} is the placement of DERs at DN nodes. Let $\mathcal{U}\subseteq \N$ denote the subset of nodes where DER sites can be developed. Let $\ysc{}{}\in{\{0,1\}}^{\mathcal{U}}$ be a vector, where $\ysc{}{i} = 1$ if a DER site is developed at node $i$ and $\ysc{}{i} = 0$ otherwise. Let $\mathcal{D}$ denote the set of available DERs. The ratings of such DERs (e.g. synchronous generators that run on diesel or natural gas, or photovoltaic generators~\cite{derSiteArticle,derSiteArticle2,derSolarHurricane}) vary from 1 kilowatt to several megawatts~\cite{derSiteFEMAArticle}, so placement of DERs by size is a relevant question. For simplicity, we assume in our study that the DERs are homogeneous, i.e. all have the same rating.
The primary costs of DER placement pertain to site development (e.g. land acquisition or building enclosures to protect DERs from natural disasters); protection of fuel delivery systems that include tanks, pumps and pipelines for fuel; transportation of fuel; and installation of the DERs ~\cite{derSiteArticle,derSiteArticle2}. We assume that the cost of site development is significantly higher than other costs, and thus refer to $\myc{\costSO_{\text{alloc}}}{}{}$ as $\C^\text{\footnotesize SD}$ in which `SD' denotes `site development'. Let $\C^\text{\footnotesize SD}\in\mathbb{R}_+^\mathcal{U}$ be a cost vector such that $\C^\text{\footnotesize SD}_i$ denotes the cost of developing a DER site at node $i\in\mathcal{U}$. Depending on the size and location of the DER site, $\C^\text{\footnotesize SD}_i$ is assumed to be between tens of thousands to a hundred thousand dollars.
Let $\ygc{}{}\in\{0,1\}^{\mathcal{U}\times\mathcal{D}}$ denote a map of DER allocation to candidate sites, such that $\ygc{}{\sited} = 1$ denotes that a DER $d$ is allocated at site $i$. A site $i\in\mathcal{U}$ is operational if and only if there is at least one DER unit allocated to that site, i.e.
\begin{subequations}\label{eq:siteConditions}
\begin{alignat}{8}
\label{eq:siteConditionNecessary}
\ysc{}{i} &\le \textstyle\sum_{d\in\mathcal{D}} \ygc{}{id} \qquad &&\forall \ i \in\mathcal{U}\\
\label{eq:siteConditionSufficient}
\ygc{}{id} & \le \ysc{}{i}\qquad &&\forall \ d\in\mathcal{D}, i \in\mathcal{U}.
\end{alignat}
\end{subequations}
Since there are at most $\abs{\mathcal{D}}$ DERs, \Cref{eq:siteConditionSufficient} can be rewritten with fewer constraints as $\textstyle\sum_{d\in\mathcal{D}} \ygc{}{id} \le \ysc{}{i}\abs{\mathcal{D}} \ \forall \ i \in\mathcal{U}.$
Clearly, a DER $d$ can be allocated to at most one site, i.e.
\begin{equation}\label{eq:oneNodeCondition}
\textstyle\sum_{i\in\mathcal{U}} \ygc{}{id} \le 1\qquad \forall \ d\in\mathcal{D}.
\end{equation}
In practice, the number of DERs are limited by supply. Let $\myc{\mathrm{G}}{}{}$ denote the maximum number of DERs that can be allocated in a DN. Then
\begin{equation}\label{eq:genResourceConstraint}
\textstyle\sum_{i\in\mathcal{U}} \textstyle\sum_{d\in\mathcal{D}} \ygc{}{id} \le \myc{\mathrm{G}}{}{}.
\end{equation}
Thus, the first stage decision variable in problem \eqref{eq:sooEmpirical} of joint site development and DER allocation decisions can be defined as $a\coloneqq \left(\ysc{}{},\ygc{}{}\right)$. The set of feasible resource allocation strategies is $\mathcal{A} \coloneqq \{\left(\ysc{}{},\ygc{}{}\right) \in \mathcal{U}\times\mathcal{D} \ | \ \eqref{eq:siteConditions}-\eqref{eq:genResourceConstraint} \text{ hold} \}$.
\subsection{Multi-period repair scheduling model}
Recall that the second-stage decision of problem \eqref{eq:sooEmpirical} is the multi-period line repair schedule and dispatch within microgrids. We assume that at period $k = 0$, the uncertainty of line failures due to the storm is realized, and the pre-placed DERs can be dispatched to supply power. From period $k=1$, the utility crew starts repairing the damaged lines subject to resource constraints. We choose $\mathrm{K}$ large enough to allow all line repairs in the DN to be complete. Furthermore, we consider that the system performance, in terms of value of demand met, can be fully restored after the DN is reconnected to the main grid. But in the worst-case scenario, this reconnection is likely to happen after the line repairs are completed at $k=\mathrm{K}$. Thus, we constrain the DN to be reconnected back to the main grid at period $k=\mathrm{K}$ for worst-case analysis ~(see \cref{fig:timeline}).
Consider a scenario $s\in\widehat{\setScenarios}$ denoting the locations of line failures and let $\E[s]$ denote the set of failed edges under scenario $s$. For each scenario and $k \in \mathcal{K}$, let $\ylinec{}{} \in {\{0,1\}}^{\E[s] \times \mathcal{K}}$ denote the decision variables concerning repair of failed lines, where $\ylinec{\period,\scenarioIdx}{e} = 1$ for $(e,k)\in\E[s]\times \mathcal{K}$ denotes that the line $e$ is repaired during the $k^{th}$ time period. The repair crew usually needs some time (typically 24-48 hours) for damage assessment and planning of restoration actions after the storm ends, and thus cannot start the repair of lines immediately after the storm. Hence, we assume that no lines are repaired in the first period, i.e.
\begin{equation}\label{eq:norepairFirstPeriod}
\ylinec{k,s}{e} = 0 \quad \forall\ e \in \E[s], k = 0.
\end{equation}
We also assume that at most $\myc{\mathrm{Y}}{}{}$ number of lines can be repaired during any time period, i.e.
\begin{alignat}{6}
\label{eq:lineRepairCrewConstraint}
\textstyle\sum_{e\in\E[s]}\ \ylinec{k,s}{e} &\le \myc{\mathrm{Y}}{}{} \qquad &&\forall\ k\in\mathcal{K}.
\end{alignat}
Here $\myc{\mathrm{Y}}{}{}$ models the combined capability of the crew personnel and equipment in repairing lines in a single period. \footnote{It is indeed possible that the maximum number of repairable lines may vary across periods, which are realistically about a day long. For the sake of simplicity, we chose a fixed $\myc{\mathrm{Y}}{}{}$.} Finally, we constrain that the DN is connected to the main grid at period $k=\mathrm{K}$, i.e.
\begin{equation}\label{eq:mainGridConnected}
\ylinec{k,s}{e} = 1, \quadk=\mathrm{K}, e \in\E, \fromNode{e} = 0,
\end{equation}
where $\fromNode{e} = 0$ denotes that line $e$ connects the DN to the substation node $0$.
For each scenario and $k \in \mathcal{K}$, let $\klinec{}{}\in\{0,1\}^{\E \times \mathcal{K}}$ denote the variables regarding whether the line $e\in\E[]$ is operational at time $k\in\mathcal{K}$, where $\klinec{k,s}{e} = 1$ if the line $e$ is not operational at period $k$ and $\klinec{k,s}{e} = 0$ otherwise. We consider that the lines not damaged during the storm remain operational during all periods:
\begin{equation}\label{eq:undamagedLines}
\klinec{\period,\scenarioIdx}{e} = 0\quad \forall\ k\in \mathcal{K}, e \notin\E[s].
\end{equation}
The connectivity of lines damaged by the storm at period $k = 0$ is as follows:
\begin{equation}\label{eq:initialLineDamage}
\klinec{k,s}{e} = 1, \qquad\forall\ e \in\E[s], k = 0.
\end{equation}
To model the disconnect between the DN and substation until $k=\mathrm{K}$, we set $kl^{0,s}_{e} = 1$ for $e\in\E[s]$ such that $\fromNode{e} = 0$.
A failed line becomes operational after it is repaired, and thereafter continues to remain operational, i.e.
\begin{equation}\label{eq:lineRepairChange}
\klinec{k,s}{e} = \klinec{k-1,s}{e} - \ylinec{k,s}{e} \quad\forall\ k \in \mathcal{K}\setminus 0, e\in\E[s]
\end{equation}
Since, for all $k$, the variables $\klinec{k,s}{e}$ and $\ylinec{k,s}{e}$ can only take binary values, \eqref{eq:lineRepairChange} automatically ensures that a failed line can at most be repaired once, i.e.
$\forall\ e\in\E[s], \ \sum_{k = 0}^{\mathrm{K}}\ylinec{k,s}{e} \le 1$.
Thus, the repair schedule variable for each scenario $s$ in \cref{eq:sooSecondStage} can be denoted as $\yc{s}{} \coloneqq \{(\ylinec{\period,\scenarioIdx}{e}, \klinec{\period,\scenarioIdx}{e})\}_{e\in\E,k\in\mathcal{K}}$, and the set of feasible repair schedules can be written as $\Yc{}{}\left(s\right) \coloneqq \{\yc{}{} \in \E\times\mathcal{K} \ | \ \eqref{eq:norepairFirstPeriod}-\eqref{eq:lineRepairChange} \text{ holds} \}$.
\subsection{Multi-period dispatch model}
As lines are repaired, the connectivity between the microgrid islands is restored, and loads are gradually reconnected. Thus, the DERs need to be redispatched after each period to meet the demand of reconnected loads. Below we present a multi-period dispatch model of DERs. Henceforth, we drop the notation $\forall\ k\in\mathcal{K}, s \in\widehat{\setScenarios}$ for the sake of brevity.
\paragraph*{DER model}
Let $\pgc{\period,\scenarioIdx}{id}$ and $\qgc{\period,\scenarioIdx}{id}$ respectively denote the real and reactive power generated by DER $d$ at node $i$. Depending on whether a DER $d$ is allocated at site $i\in\mathcal{U}$, its contribution to the power generated at node $i$ at any time $t$ is constrained as:
\begin{align}\label{eq:derConnectedConstraint}
\begin{aligned}
0 &\le &&\pgc{\period,\scenarioIdx}{id} &&\le \ygc{}{id} \pgc{max}{d} && \forall\ i \in \mathcal{U}, d \in \mathcal{D}\\
& &&\abs{\qgc{\period,\scenarioIdx}{id}} &&\le \pfc{max}{} \pgc{\period,\scenarioIdx}{id} && \forall\ i \in \mathcal{U}, d \in \mathcal{D}
\end{aligned}
\end{align}
where $\pfc{max}{}$ denotes the $\tan\arccos$ of maximum power factor.
The active and reactive power contributions of a DER to non-DER site nodes are zero, i.e.
\begin{equation}
\pgc{\period,\scenarioIdx}{id} = \qgc{\period,\scenarioIdx}{id} = 0 \quad \forall\ i\in\N\backslash\mathcal{U}, d\in\mathcal{D}.
\end{equation}
In a microgrid island, each DER can adjust its reactive power output depending on the voltage of the node to which it is allocated. This capability can be modeled by a voltage droop control equation:
\begin{equation}\label{eq:islandVoltDroop}
\begin{split}
\abs{\nuc{\period,\scenarioIdx}{i} - \left(\nuc{ref}{d} - \kqc{d}\qgc{\period,\scenarioIdx}{id}\right)} \le \left(1-\ygc{}{id}\right)\mathrm{L}\\
\forall\ i\in\mathcal{U},d\in\mathcal{D}, k\in\{1,...,\mathrm{K}-1\}
\end{split}
\end{equation}
where $\nuc{\period,\scenarioIdx}{i}$ denotes the voltage at node $i$; $\kqc{d}$ denotes the voltage droop coefficient of the DER $d$; $\nuc{ref}{d}$ denotes the idle (no load) terminal voltage reference setpoint of the DER~\cite{droopControl}; and $\mathrm{L}$ is a large constant.
If $\ygc{}{id} = 1$, \eqref{eq:islandVoltDroop} simplifies to $\qgc{\period,\scenarioIdx}{id} = \frac{1}{\kqc{d}}\left(\nuc{ref}{d} - \nuc{\period,\scenarioIdx}{i}\right)$, which models the standard droop control equation that determines the reactive power contribution of the DER at node~$i$ to help voltage regulation of the islanded microgrid. \footnote{Turbine-based DERs such as diesel generators are AC power sources, so they can contribute to voltage regulation via in-built excitation systems that utilize automatic voltage regulators~\cite{derExcitationSystems}. In contrast, DERs such as batteries or photo-voltaic generators are DC power sources, which are connected to the DN via inverters. Such DERs can contribute to voltage regulation if their inverters are set in the voltage source inverter (VSI) control mode~\cite{islandingControlStrategies}.} Once the DN is connected to the main grid, the \enquote{stiff} AC system of the bulk power grid determines the terminal voltage of the DERs. Hence, the voltage droop equation does not apply at period $k = \mathrm{K}$. \footnote{In our model, each DER within an island contributes to the voltage regulation of the microgrid island, simultaneously with other DERs in the same island~\cite{parallelInverterDroopControl}. A suitable extension of our model can also allow some of the DERs to operate in the PQ control mode, in which the DERs' active and reactive power supply is fixed. Moreover, since the DERs can also contribute to frequency regulation of the islanded microgrid, our model can also be extended to consider the frequency droop control equations.}
Next, we describe the load model. We consider only the constant power model for loads.
\paragraph*{Load model}
Let $\pcc{max}{i}+\mathbf{j}\qcc{max}{i}$ denote the nominal power demand at node~$i$; $\kcc{\period,\scenarioIdx}{i}\in\{0,1\}$ the load connectivity where $\kcc{\period,\scenarioIdx}{i} = 1$ if the load at node $i$ is disconnected at time period $k$. When connected, a load's actual consumption can be scaled down to a fraction of its nominal demand, particularly if the available power supply from DERs is not sufficient to meet nominal demand. We model such flexibility by introducing a load control parameter $\lcc{\period,\scenarioIdx}{i}\in [\lcc{min}{i},1]$ (when $\kcc{\period,\scenarioIdx}{i} = 0$, otherwise $\lcc{\period,\scenarioIdx}{i}=0$), where $\lcc{min}{i} \in [0,1]$ denotes the minimum fraction of the load's nominal demand that should be satisfied provided the load is connected, i.e.
\begin{align}\label{eq:loadControlEquation}
\begin{aligned}
\pcc{\period,\scenarioIdx}{i} &= \lcc{\period,\scenarioIdx}{i}\ \pcc{max}{i} \quad \forall\ i \in \N \\
\qcc{\period,\scenarioIdx}{i} &= \lcc{\period,\scenarioIdx}{i}\ \qcc{max}{i} \quad \forall\ i \in \N,
\end{aligned}
\end{align}
where $\pcc{\period,\scenarioIdx}{i}$ and $\qcc{\period,\scenarioIdx}{i}$ respectively denote real and reactive power consumed at node $i$, and
\begin{equation}\label{eq:loadControlParameterConstraint}
\left(1-\kcc{\period,\scenarioIdx}{i}\right)\lcc{min}{i} \le \lcc{\period,\scenarioIdx}{i} \le \left(1-\kcc{\period,\scenarioIdx}{i}\right) \qquad \forall \ i\in\N.
\end{equation}
The load connectivity depends on whether the nodal voltage lies within safe operating bounds, i.e.
\begin{align}\label{eq:voltageDisconnectLoads}
\begin{aligned}
\kcc{\period,\scenarioIdx}{i} &\ge \nucc{min}{i} - \nuc{\period,\scenarioIdx}{i} \quad && \forall\ i\in \N\\
\kcc{\period,\scenarioIdx}{i} &\ge \nuc{\period,\scenarioIdx}{i} - \nucc{max}{i} \quad && \forall\ i\in \N,
\end{aligned}
\end{align}
where $\nucc{min}{i}$ and $\nucc{max}{i}$ denote the lower and upper voltage bounds for the loads at node $i$.
The net actual real and reactive power consumed (denoted by $\ptc{\period,\scenarioIdx}{i}$ and $\qtc{\period,\scenarioIdx}{i}$, respectively) at node $i$ is given by:
\begin{align}
\begin{aligned}
\ptc{\period,\scenarioIdx}{i} &= \pcc{\period,\scenarioIdx}{i} - \textstyle\sum_{d\in\mathcal{D}}\pgc{\period,\scenarioIdx}{id} \qquad \forall\ i\in\N\\
\qtc{\period,\scenarioIdx}{i} &= \qcc{\period,\scenarioIdx}{i} - \textstyle\sum_{d\in\mathcal{D}}\qgc{\period,\scenarioIdx}{id} \qquad \forall\ i\in\N.
\end{aligned}\label{eq:totalPowerConsumption}
\end{align}
\subsection{Linear Power Flow model for microgrids}
We now develop a novel linear power flow model for microgrids based on the classical \textit{LinDistFlow} model. The linearity of these equations provides a computational advantage over the nonlinear power flow model.
We can write the standard power conservation equations for real and reactive power flows as follows:
\begin{align}\label{eq:powerConservation}
\begin{aligned}
\Pc{\period,\scenarioIdx}{e} &= \displaystyle\sum_{l: \fromNode{l} = \toNode{e}} \Pc{\period,\scenarioIdx}{l} + \ptc{\period,\scenarioIdx}{j}, && \forall\ e \in \E, j = \toNode{e} \\
\Qc{\period,\scenarioIdx}{e} &= \displaystyle\sum_{l: \fromNode{l} = \toNode{e}}\Qc{\period,\scenarioIdx}{l} + \qtc{\period,\scenarioIdx}{j}, && \forall\ e \in \E, j = \toNode{e}.
\end{aligned}
\end{align}
Since the failed lines are not operational, there are no power flows on these lines until they are repaired, i.e.
\begin{align}\label{eq:islandingCapacity}
\begin{aligned}
\abs{\Pc{\period,\scenarioIdx}{e}} & \le \left(1-\klinec{\period,\scenarioIdx}{e}\right)\mathrm{L} \qquad && \forall\ e\in\E\\
\abs{\Qc{\period,\scenarioIdx}{e}} & \le \left(1-\klinec{\period,\scenarioIdx}{e}\right)\mathrm{L} \qquad && \forall\ e\in\E.
\end{aligned}
\end{align}
Similarly, the voltage drop equation of the \textit{LinDistFlow} model along a line $e$ is enforced only if line $e$ is operational:
\begin{align}\label{eq:voltageDrop}
\begin{aligned}
\abs{\nuc{k,s}{j} - \left(\nuc{k,s}{i} - 2\left(\resistance{e}\Pc{k,s}{e} + \reactance{e}\Qc{k,s}{e}\right)\right)} \le \mathrm{L}\klinec{k,s}{e} \\ \forall \ e \in \E, i = \fromNode{e}, j = \toNode{e}.
\end{aligned}
\end{align}
Note that if a line $e$ is operational (i.e. $\klinec{\period,\scenarioIdx}{e} = 0$), then \cref{eq:voltageDrop} simplifies to $\nuc{\period,\scenarioIdx}{j} = \nuc{\period,\scenarioIdx}{i} - 2\left(\resistance{e}\Pc{\period,\scenarioIdx}{e} + \reactance{e}\Qc{\period,\scenarioIdx}{e}\right)$, which is the standard voltage drop equation of the \textit{LinDistFlow} model. When the DN is connected back to the main grid, the substation voltage is assumed to be the nominal voltage, i.e. $\nuc{\mathrm{K},s}{0} = \nuc{nom}{}$.
We define the dispatch variable for scenario $s$ in \cref{eq:sooSecondStage} as $\xc{s}{} \coloneqq \{\pgc{\period,\scenarioIdx}{},\qgc{\period,\scenarioIdx}{},$ $\lcc{\period,\scenarioIdx}{},\kcc{\period,\scenarioIdx}{},\ptc{\period,\scenarioIdx}{},\qtc{\period,\scenarioIdx}{},\Pc{\period,\scenarioIdx}{},\Qc{\period,\scenarioIdx}{},$ $\nuc{\period,\scenarioIdx}{}\}_{k\in\mathcal{K}}$, and the set of feasible dispatch decisions as $\Xc{}{}\left(a,s,\yc{}{}\right) \coloneqq \{\xc{}{}\ |\ \eqref{eq:initialLineDamage}-\eqref{eq:voltageDrop} \text{ hold}\}$.
The SAA problem \eqref{eq:sooEmpirical} can be specifically written as:
\begin{alignat}{8}\small
\small\hspace{-0.1cm} \min_{a,\xc{}{},\yc{}{}}
& \ \Bigg\{\sum_{i\in\mathcal{U}} \C^\text{\footnotesize SD}_i \ysc{}{i} +
\frac{1}{S}\sum_{k = 0}^{\mathrm{K}}\sum_{i\in\N} [\C^\text{\footnotesize LC}_i(1-\lcc{\period,\scenarioIdx}{i})+ \C^\text{\footnotesize LS}_i\kcc{\period,\scenarioIdx}{i}] \nonumber\Bigg\}\\
\small \text{s.t. }&\ a=(\ysc{}{},\ygc{}{}), \yc{s}{}\in\Yc{}{}\left(s\right), \xc{s}{} \in \Xc{}{}\left(a,s,\yc{}{}\right) \ \forall \ s\in\widehat{\setScenarios},
\end{alignat}
where $\C^\text{\footnotesize LC}_i$ and $\C^\text{\footnotesize LS}_i$ are respectively the costs of load control and shedding at node $i$; $\xc{}{} \coloneqq \{\xc{s}{}\}_{s\in\widehat{\setScenarios}}$; and $\yc{}{} \coloneqq \{\yc{s}{}\}_{s\in\widehat{\setScenarios}}$.
\subsection{Illustrative example}
\Cref{fig:Schematic} provides an illustration of various aspects of our formulation. In \Cref{subfig:nominal}, the DN is in nominal operating conditions, i.e. each node is connected to the grid and no load control is exercised.
\begin{figure}[htbp!]
\centering
\tikzset{every node/.append ={font size=tiny}}
\tikzstyle{dnnode}=[draw,circle, minimum size=0.5pt, inner sep = 2]
\tikzstyle{dnedge}=[-, line width=1pt]
\tikzstyle{vuledge}=[-, line width=3pt, red!70]
\tikzstyle{swind}=[->, line width=2pt, blue!25, >=latex']
\tikzstyle{dernode}=[circle, fill=blue, minimum size=0.5pt, inner sep = 2]
\tikzstyle{blackoutnode}=[circle, fill=black, minimum size=0.5pt, inner sep = 2]
\tikzstyle{graynode}=[draw=black, pattern=north west lines, fill = black, circle, minimum size=0.5pt, inner sep = 2, fill opacity=0.2]
\tikzstyle{graynodes}=[circle, pattern=north west lines, fill = black, minimum size=0.5pt, inner sep = 2,fill opacity = 0.6]
\tikzstyle{failededge}=[-, densely dotted]
\def \draw[step=1,gray, ultra thin, draw opacity = 0.5] (0,0) grid (3,4); {\draw[step=1,gray, ultra thin, draw opacity = 0.5] (0,0) grid (3,4);}
\def \draw[-, line width = 2pt] (0.8,4.05) -- (2.2,4.05) node [midway,above] {}; {\draw[-, line width = 2pt] (0.8,4.05) -- (2.2,4.05) node [midway,above] {};}
\def i[dnnode] (0) at (1.5,3.85) {}; {i[dnnode] (0) at (1.5,3.85) {};}
\def i[dnnode] (A) at (1.5,3.0) {}; {i[dnnode] (A) at (1.5,3.0) {};}
\def i[dnnode] (A1) at (2,2.5) {}; {i[dnnode] (A1) at (2,2.5) {};}
\def i[dnnode] (A2) at (2.75,2.75) {}; { i[dnnode] (A2) at (2.75,2.75) {};}
\def i[dnnode] (B) at (0.25,2.75) {} ; {i[dnnode] (B) at (0.25,2.75) {} ;}
\def i[dnnode] (C) at (0.25,1.5) {} ; {i[dnnode] (C) at (0.25,1.5) {} ;}
\def i[dnnode] (D) at (1.5,1.25) {} ; {i[dnnode] (D) at (1.5,1.25) {} ;}
\def i[dnnode] (D1) at (1.5,0.25) {} ; {i[dnnode] (D1) at (1.5,0.25) {} ;}
\def i[dnnode] (D2) at (0.5,0.25) {} ; {i[dnnode] (D2) at (0.5,0.25) {} ;}
\def i[dnnode] (D3) at (1.5,2.00) {} ; {i[dnnode] (D3) at (1.5,2.00) {} ;}
\def i[dnnode] (E) at (2.75,1.25) {} ; {i[dnnode] (E) at (2.75,1.25) {} ;}
\def i[dnnode] (F) at (2.75,0.50) {} ; {i[dnnode] (F) at (2.75,0.50) {} ;}
\subfloat[]{\label{subfig:nominal}
\begin{tikzpicture}[scale=0.6,every node/.append ={font size=tiny}]
\draw[step=1,gray, ultra thin, draw opacity = 0.5] (0,0) grid (3,4); \draw[-, line width = 2pt] (0.8,4.05) -- (2.2,4.05) node [midway,above] {};
i[dnnode] (0) at (1.5,3.85) {}; i[dnnode] (A) at (1.5,3.0) {}; i[dnnode] (A1) at (2,2.5) {}; i[dnnode] (A2) at (2.75,2.75) {}; i[dnnode] (B) at (0.25,2.75) {} ; i[dnnode] (C) at (0.25,1.5) {} ; i[dnnode] (D) at (1.5,1.25) {} ; i[dnnode] (D1) at (1.5,0.25) {} ; i[dnnode] (D2) at (0.5,0.25) {} ; i[dnnode] (D3) at (1.5,2.00) {} ; i[dnnode] (E) at (2.75,1.25) {} ; i[dnnode] (F) at (2.75,0.50) {} ;
\foreach \from/\to in {0/A, A/B, A/A1, A1/A2, B/C, C/D, D/E, D/D1, D1/D2, D/D3, E/F}
\draw[dnedge] (\from) -- (\to);
i at (0) {\tiny $\text{0}$};
i at (A) {\tiny $\text{A}$};
i at (A1) {\tiny $\text{G}$};
i at (A2) {\tiny $\text{H}$};
i at (B) {\tiny $\text{B}$};
i at (C) {\tiny $\text{C}$};
i at (D) {\tiny $\text{D}$};
i at (D1) {\tiny $\text{I}$};
i at (D2) {\tiny $\text{J}$};
i at (D3) {\tiny $\text{K}$};
i at (E) {\tiny $\text{E}$};
i at (F) {\tiny $\text{F}$};
\end{tikzpicture}
}
\subfloat[]{\label{subfig:predictions}
\begin{tikzpicture}[scale=0.6]
\draw[step=1,gray, ultra thin, draw opacity = 0.5] (0,0) grid (3,4); \draw[-, line width = 2pt] (0.8,4.05) -- (2.2,4.05) node [midway,above] {};
i[dnnode] (0) at (1.5,3.85) {}; i[dnnode] (A) at (1.5,3.0) {}; i[dnnode] (A1) at (2,2.5) {}; i[dnnode] (A2) at (2.75,2.75) {}; i[dnnode] (B) at (0.25,2.75) {} ; i[dnnode] (C) at (0.25,1.5) {} ; i[dnnode] (D) at (1.5,1.25) {} ; i[dnnode] (D1) at (1.5,0.25) {} ; i[dnnode] (D2) at (0.5,0.25) {} ; i[dnnode] (D3) at (1.5,2.00) {} ; i[dnnode] (E) at (2.75,1.25) {} ; i[dnnode] (F) at (2.75,0.50) {} ;
i[dernode] (Dder) at (D) {} ;
\foreach \from/\to in {0/A, A/B, A/A1, A1/A2, B/C, C/D, D/E, D/D1, D1/D2, D/D3, E/F}
\draw[dnedge] (\from) -- (\to);
\foreach \from/\to in {0/A, B/C, D/E, D/D1, D/D3}
\draw[vuledge] (\from) -- (\to);
\foreach \mx/\my in {0.5/2.5, 2/3, 0.75/1.75, 2/2, 0.75/0.5, 2/0.75}
\draw[swind] (\mx,\my) to (\mx+0.75,\my+0.25);
\end{tikzpicture}
}
\subfloat[$k = 0$]{\label{subfig:failures}
\begin{tikzpicture}[scale=0.6]
\draw[step=1,gray, ultra thin, draw opacity = 0.5] (0,0) grid (3,4); \draw[-, line width = 2pt] (0.8,4.05) -- (2.2,4.05) node [midway,above] {};
i[dnnode] (0) at (1.5,3.85) {}; i[dnnode] (A) at (1.5,3.0) {}; i[dnnode] (A1) at (2,2.5) {}; i[dnnode] (A2) at (2.75,2.75) {}; i[dnnode] (B) at (0.25,2.75) {} ; i[dnnode] (C) at (0.25,1.5) {} ; i[dnnode] (D) at (1.5,1.25) {} ; i[dnnode] (D1) at (1.5,0.25) {} ; i[dnnode] (D2) at (0.5,0.25) {} ; i[dnnode] (D3) at (1.5,2.00) {} ; i[dnnode] (E) at (2.75,1.25) {} ; i[dnnode] (F) at (2.75,0.50) {} ;
i[blackoutnode] (0) at (0) {};
i[blackoutnode] (A) at (A) {};
i[blackoutnode] (A1) at (A1) {};
i[blackoutnode] (A2) at (A2) {};
i[blackoutnode] (B) at (B) {} ;
i[dnnode] (C) at (C) {} ;
i[dnnode] (D) at (D) {} ;
i[blackoutnode] (D1) at (D1) {} ;
i[blackoutnode] (D2) at (D2) {} ;
i[blackoutnode] (D3) at (D3) {} ;
i[dernode] (Dder) at (D) {} ;
i[blackoutnode] (E) at (E) {} ;
i[blackoutnode] (F) at (F) {} ;
\foreach \from/\to in { A/B, A/A1, A1/A2, C/D, D1/D2, E/F}
\draw[dnedge] (\from) -- (\to);
\foreach \from/\to in {0/A, B/C, D/E, D/D1, D/D3}
\draw[failededge] (\from) -- (\to);
\end{tikzpicture}
}
\\ \subfloat[$k = 1$]{\label{subfig:firstRepairs}
\begin{tikzpicture}[scale=0.6]
\draw[step=1,gray, ultra thin, draw opacity = 0.5] (0,0) grid (3,4); \draw[-, line width = 2pt] (0.8,4.05) -- (2.2,4.05) node [midway,above] {};
i[blackoutnode] (0) at (0) {};
i[blackoutnode] (A) at (A) {};
i[blackoutnode] (A1) at (A1) {};
i[blackoutnode] (A2) at (A2) {};
i[blackoutnode] (B) at (B) {} ;
i[graynode] (C) at (C) {} ;
i[dnnode] (D) at (D) {} ;
i[graynode] (D1) at (D1) {} ;
i[graynode] (D2) at (D2) {} ;
i[blackoutnode] (D3) at (D3) {} ;
i[dernode] (Dder) at (D) {} ;
i[graynode] (E) at (E) {} ;
i[graynode] (F) at (F) {} ;
\foreach \from/\to in { A/B, A/A1, A1/A2, C/D, D/E, D/D1, D1/D2, E/F}
\draw[dnedge] (\from) -- (\to);
\foreach \from/\to in {0/A,B/C, D/D3}
\draw[failededge] (\from) -- (\to);
\end{tikzpicture}
}
\subfloat[$k = 2$]{\label{subfig:secondRepairs}
\begin{tikzpicture}[scale=0.6]
\draw[step=1,gray, ultra thin, draw opacity = 0.5] (0,0) grid (3,4); \draw[-, line width = 2pt] (0.8,4.05) -- (2.2,4.05) node [midway,above] {};
i[dnnode] (0) at (1.5,3.85) {}; i[dnnode] (A) at (1.5,3.0) {}; i[dnnode] (A1) at (2,2.5) {}; i[dnnode] (A2) at (2.75,2.75) {}; i[dnnode] (B) at (0.25,2.75) {} ; i[dnnode] (C) at (0.25,1.5) {} ; i[dnnode] (D) at (1.5,1.25) {} ; i[dnnode] (D1) at (1.5,0.25) {} ; i[dnnode] (D2) at (0.5,0.25) {} ; i[dnnode] (D3) at (1.5,2.00) {} ; i[dnnode] (E) at (2.75,1.25) {} ; i[dnnode] (F) at (2.75,0.50) {} ;
i[blackoutnode] (0b) at (0) {};
i[blackoutnode] (Ab) at (A) {};
i[blackoutnode] (A1b) at (A1) {};
i[blackoutnode] (A2b) at (A2) {};
i[graynodes] (Bb) at (B) {} ;
i[graynodes] (C) at (C) {} ;
i[dnnode] (D) at (D) {} ;
i[graynodes] (D1) at (D1) {} ;
i[graynodes] (D2) at (D2) {} ;
i[graynodes] (D3) at (D3) {} ;
i[dernode] (Dder) at (D) {} ;
i[graynodes] (E) at (E) {} ;
i[graynodes] (F) at (F) {} ;
\foreach \from/\to in { A/B, A/A1, A1/A2, C/D, D/E, D/D1, D1/D2, E/F,B/C, D/D3}
\draw[dnedge] (\from) -- (\to);
\foreach \from/\to in {0/A}
\draw[failededge] (\from) -- (\to);
\end{tikzpicture}
}
\subfloat[$k = \mathrm{K}$]{\label{subfig:reconnected}
\begin{tikzpicture}[scale=0.6]
\draw[step=1,gray, ultra thin, draw opacity = 0.5] (0,0) grid (3,4); \draw[-, line width = 2pt] (0.8,4.05) -- (2.2,4.05) node [midway,above] {};
i[dnnode] (0) at (1.5,3.85) {}; i[dnnode] (A) at (1.5,3.0) {}; i[dnnode] (A1) at (2,2.5) {}; i[dnnode] (A2) at (2.75,2.75) {}; i[dnnode] (B) at (0.25,2.75) {} ; i[dnnode] (C) at (0.25,1.5) {} ; i[dnnode] (D) at (1.5,1.25) {} ; i[dnnode] (D1) at (1.5,0.25) {} ; i[dnnode] (D2) at (0.5,0.25) {} ; i[dnnode] (D3) at (1.5,2.00) {} ; i[dnnode] (E) at (2.75,1.25) {} ; i[dnnode] (F) at (2.75,0.50) {} ;
\foreach \from/\to in {0/A, A/B, A/A1, A1/A2, B/C, C/D, D/E, D/D1, D1/D2, D/D3, E/F}
\draw[dnedge] (\from) -- (\to);
\foreach \from/\to in {0/A, B/C, D/E, D/D1, D/D3}
\draw[dnedge] (\from) -- (\to);
\end{tikzpicture}
}
\caption{The subfigures show (a) nominal DN (white nodes indicate no load control), (b) pre-storm DER allocation based on storm forecast (blue node denotes DER allocation, red lines illustrate a disruption scenario), (c) microgrid islands (dotted lines indicate failed lines, black nodes denote the loads that are completely unserved), (d) partial line repairs enable partial load restoration (light gray nodes), (e) line repairs completed leading to more load restoration, although with even more load control than before (dark gray nodes), and finally (f) reconnection to main grid and restoration of nominal performance. }
\label{fig:Schematic}
\end{figure}
We obtain failure probabilities using \cref{eq:probLineFail} and generate $|\widehat{\setScenarios}|$ failure scenarios. Suppose that the utility has resources to develop one DER site in Stage I. Further suppose that due to the powerflow and voltage drop constraints (\eqref{eq:powerConservation} and \eqref{eq:voltageDrop}), transmitting power across more than two lines results in voltage bound violations. Hence, from any site location, the DERs will be able to meet the demand of nodes which are at most two hops away from the site. For example, a DER placed at node H can only supply power to nodes A, G, and H, such that $\{$A,B,G,H$\}$ form the largest connected island. Hence, placing a site at node A can immediately serve demand of 4 loads. However, if we take into account the line repairs, the maximum number of loads that can be reconnected to the DN (after repairs) is eight if the site is developed at node D. Thus, allocating the DER to node D is optimal because it maximizes number of loads served, though only two loads are served during the first period.
In \Cref{subfig:failures}, we see that a failure scenario has been realized for period $k = 0$ where the set of failed lines $\E[s]$ include lines (B,C), (D,E), (D,I), and (D,K). The loss of bulk power supply is represented by the DN's disconnection from the substation, i.e. (0,A) $\in\E[s]$. Since the demand at just two nodes (C, D) is met in the first period, no load control is necessary (i.e. $\kcc{\period,\scenarioIdx}{i} = 0, \lcc{\period,\scenarioIdx}{i} = 1$ $\forall$ $i\in\{$C,D$\}$; and $\kcc{\period,\scenarioIdx}{i} = 1,\ \forall \ i \in \N \backslash \{$C,D$\}$).
Next, we schedule line repairs under the constraint $\myc{\mathrm{Y}}{}{} = 2$, i.e. at most two lines can be repaired in each period. Looking at the most number of loads that can be reconnected, the lines (D,E) and (D,I) should be repaired in the period $k=1$ ($\ylinec{\period,\scenarioIdx}{e} = 1$ if $e\in\{$(D,E), (D,I)$\}$), and lines (D,K) and (B,C) should be repaired in the period $k=2$ ($\ylinec{\period,\scenarioIdx}{e} = 1$ if $e\in\{$(D,K), (B,C)$\}$). Following this schedule, nodes E, F, I, J are connected while $k=1$ (see~\Cref{subfig:firstRepairs}). The DER power supply is enough to serve only partial demand at these nodes ($\kcc{\period,\scenarioIdx}{i} = 0$ and $\lcc{\period,\scenarioIdx}{i} < 1$ for $i\in\{$C,D,E,F,I,J$\}$). The loads at nodes B, C and K are reconnected while $k = 2$ due to further line repairs (see \Cref{subfig:secondRepairs}), and a greater portion of demand can be met ($\lcc{k,s}{i} > \lcc{k-1,s}{i}$ for $i\in\{$C,D,E,F,I,J$\}$). Due to power flow constraints, the loads at nodes A, G, and H cannot be reconnected until the complete network is restored. Finally, when the DN is reconnected to main grid ($\ylinec{\period,\scenarioIdx}{e} = 1$ for $e = $(0,A) and $k = \mathrm{K}$) the nominal operation of the DN is fully restored (see~\cref{subfig:reconnected}).
\section{Evaluation}\label{sec:computational}
\subsection{Experimental setup}
We use a 12-node test feeder in our computational experiments. 6 randomly chosen nodes have one load each. For each homogeneous node $i$ with a load, $\C^\text{\footnotesize LS}_i = 1000$, $\C^\text{\footnotesize LC}_i = 100$, $\lcc{min}{i} = 0.5$. The total capacity of available DERs is chosen to be 80\% of the total demand in the network.
Next, we compute predictions for velocity fields $\vel{}{h,t}$ and Poisson failure rates $\PPI{}{\myc{h}{}{},t}$ at every hour over one day, using the procedure described in \cref{sec:lineFailureModel}. To produce predictions of $\vel{}{h,t}$ using \eqref{eq:Holland}, we consider two different tracks of a Category 1 storm to account for expected uncertainty in the storm trajectory. The storm tracks we used (hereafter referred to as Track 1 and Track 2) differ primarily in that the storm eye wall (region of maximum winds) is farther away from the DN for Track 2, and thus the wind velocities in the DN are lower compared to the case with Track 1. We use synthetic values for the Holland parameters ($\Vm$, $\Rm$, $\B$) to produce predictions of $\vel{}{h,t}$ using \eqref{eq:Holland}. The velocity predictions $\vel{}{h,t}$ may be used to compute $\PPI{}{\myc{h}{}{},t}$.
\begin{table}[!t]
\renewcommand{\arraystretch}{1.3}
\caption{Mean, minimum, and maximum failure probabilities of distribution lines (\textit{left side}) and median, minimum, and maximum island size (\textit{right side}) for the two tracks.}
\label{tabFailures}
\centering
\begin{tabular}{|c||c|c|c||c|c|c|}
\hline
& \multicolumn{3}{c||}{Failure probability} & \multicolumn{3}{c|}{Size of islands} \\ \hline
& Mean & Min & Max & Med. & Min & Max \\ \hline
Track 1 & 0.63 & 0.56 & 0.75 & 1.58 & 1.08 & 4.20 \\ \hline
Track 2 & 0.26 & 0.21 & 0.34 & 3.22 & 2.11 & 5.61 \\ \hline
\end{tabular}
\end{table}
We generate a total of $S=1000$ failure scenarios to examine distributions in frequency of failures and number/size of islands. The quadratic relationship between $\PPI{}{h,t}$ and $\vel{}{h,t}$ in \eqref{eq:PPI} results in a significant increase in probability of failures and decrease in island size if the test feeder is subject to higher storm velocities (see \cref{tabFailures}). \footnote{Category 2-5 storms have a larger radial region of high winds, and we can expect much higher failure probabilities in such cases. In contrast, under mild storms with the tropical storm rating, Poisson intensities are uniformly $\lambda_{norm}$, and the failure probability $\probFail{}{e}$ over $[t_1,t_2]$ is $<0.001$. }
An average of 5.96 failures occur per scenario in Track 1, while only 2.88 failures occur per scenario in Track 2 (see \cref{fig:SimFailures}). The smaller median island size under Track 1 corresponds with a larger number of islands (see \cref{fig:SimIslands}).
To implement the SAA solution approach, we utilize the mixed integer program (MIP) optimization model \eqref{eq:sooEmpirical} in JuliaPro. Solutions are obtained using the Gurobi solver.
\begin{figure}[!htbp]
\centering
\subfloat{\includegraphics[width=0.5\textwidth, scale=0.12]{figuresSGC_Rev/SimFailures.jpg} \label{fig:SimFailures}}
\subfloat{\includegraphics[width=0.5\textwidth, scale=0.12]{figuresSGC_Rev/SimIslands.jpg}\label{fig:SimIslands}}
\setcounter{subfigure}{0}
\caption{Empirical probability of number of line failures (\textit{left}) and number of islands formed (\textit{right}) in the 12-node network for the two tracks. A total of 1,000 failure scenarios are simulated to produce the histograms.}
\label{fig:SimStats}
\end{figure}
\subsection{Impact of resource constraints on DN recovery}
To evaluate the system performance under different resource constraints, we vary $\myc{\mathrm{G}}{}{}$ (number of available DERs) and $\myc{\mathrm{Y}}{}{}$ (maximum number of lines repaired in each period). System performance at a period $k$ is defined as the average percentage difference between the cost of unmet demand and the total cost of complete load shedding, averaged over the sampled scenarios $s$ and as a function of the optimal first-stage solution of each scenario $\hata_s$, i.e.
\begin{equation}
\begin{aligned}
\hspace{-0.2cm}\small\text{System performance} =
\frac{1}{|\widehat{\setScenarios}|}\sum_{s \in \widehat{\setScenarios}} 100\left(1-\frac{ \myc{J}{}{}(\hata_s, s)}{\sum_{i\in\N}\C^\text{\footnotesize LS}_i}\right).
\end{aligned}
\end{equation}
\begin{figure}[htbp!]
\subfloat{\includegraphics[width=0.5\textwidth, scale=0.12]{ResCurve_G1.jpg}}
\subfloat{\includegraphics[width=0.5\textwidth, scale=0.12]{ResCurve_G2.jpg}}
\setcounter{subfigure}{0
\subfloat[Track 1]{\includegraphics[width=0.5\textwidth, scale=0.12]{ResCurve_CB1.jpg}}
\subfloat[Track 2]{\includegraphics[width=0.5\textwidth, scale=0.12]{ResCurve_CB2.jpg}}
\caption{Average system performance of the DN under the two track scenarios, varying $\protect\myc{\mathrm{G}}{}{}$ while setting $\protect\myc{\mathrm{Y}}{}{}=1$ (\textit{top row}) and varying $\protect\myc{\mathrm{Y}}{}{}$ while setting $\protect\myc{\mathrm{G}}{}{}=1$ (\textit{bottom row}).}
\label{fig:resilienceCurves}
\end{figure}
The system performance as a function of $k$ under different values of $\myc{\mathrm{G}}{}{}$ and $\myc{\mathrm{Y}}{}{}$ for two storm tracks is shown in \Cref{fig:resilienceCurves}. Following the storm ($k=0$), the system performance is at a minimum, and improves with each subsequent set of line repairs. Once all the damaged lines are repaired, the system performance is almost (but, not fully) restored. The system performance is fully restored to 100\% following reconnection to the main grid. Since there are more failures on average in the DN under Track 1, the system performance at $k=0$ is lower than for Track 2.
If $\myc{\mathrm{G}}{}{} > 0$, even networks with high failure probabilities will be able to meet a portion of demand given a nonzero DER budget -- the network repair time will simply be longer. Increasing $\myc{\mathrm{Y}}{}{}$ noticeably decreases the average time required to repair the network (return to system performance that is close to 100\%) under both track scenarios. Increasing $\myc{\mathrm{G}}{}{}$ ensures that a larger portion of system demand is met while line repairs are not yet completed.
\section{Concluding remarks}\label{sec:conludingRemarks}
We make the following contributions to address electricity network preparedness for storm-induced outages:
\begin{enumerate}
\item Two-stage stochastic optimization formulation for DER placement and line repairs in DNs under uncertainty in component failure locations,
\item Nonhomogeneous Poisson process (NHPP) model to predict spatially-varying likelihood of line failures, and
\item Model of post-storm microgrid operation with DERs.
\end{enumerate}
Future work will focus on improving computational aspects of our solution approach. As stated in \cref{sec:lineFailureModel}, the sample $\widehat{\setScenarios}$ used for SAA may not approximate the probability distribution $\myc{\mathcal{P}}{}{}$ well. To obtain $\widehat{\setScenarios}$ that is representative of $\myc{\mathcal{P}}{}{}$, one can use a scenario reduction method such as the forward selection or backward reduction algorithm \cite{scenarioReduction}. The quality of solutions can then be evaluated by calculation of the optimality gap \cite{KleywegtShapiro}.
To decrease computation time, we will consider greedy heuristics to solve the multi-stage Stage II decision problem. Specifically, one can select a subnetwork with a small number of nodes based on their criticality. A node has high criticality if restoration of its load has high benefit on other intermediate nodes. The relative weights of the selected nodes can be determined based on their criticality. Running the SAA method on the (minimum spanning tree) subnetwork induced by this smaller set of nodes can lead to a computational speed-up that allows for testing the model on larger DN feeders.
| {'timestamp': '2018-10-05T02:14:35', 'yymm': '1810', 'arxiv_id': '1810.02315', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02315'} | arxiv |
\section{Introduction}
Most approaches to machine learning experiments currently involve tedious hyperparameter tuning. As the use of machine learning methods becomes increasingly important in industrial and engineering applications, there is a growing demand for engineering laws similar to the ones existing for electronic circuit design. Today, circuits can be drawn on a piece of paper and their behavior can be predicted exclusively based of engineering laws. Fully predicting the behavior of machine learning, as opposed to relying on trial and error, requires insights into the training and testing data, the available hypothesis space of a chosen algorithm, the convergence and other properties of the optimization algorithm, and the effect of generalization and loss terms in the optimization problem formulation. As a result, we may never reach circuit-level predictability. One of the core questions that machine learning theory focuses on is the complexity of the hypothesis space and what functions can be modeled, especially in connection with real-world data. Practically speaking, the memory and computation requirements for a given learning tasks are very hard to budget. This is especially a problem for very large scale experiments, such as on multimedia or molecular dynamics data.
Even though artificial neural networks have been popular for decades, the understanding of the processes underlying them is usually based solely on anecdotal evidence in a particular application domain or task (see for example~\cite{morgan2012}). This article presents general methods to both measure and also analytically predict the experimental design for neural networks based on the underlying assumption that memorization is worst-case generalization.
We present 4 engineering rules to determine the maximum capacity of contemporary neural networks:
\begin{enumerate}
\item The output of a single perceptron yields maximally one bit of information.
\item The capacity of a single perceptron is the number of its parameters (weights and bias) in bits.
\item The total capacity $C_{tot}$ of $M$ perceptrons in parallel is $C_{\text{tot}} = \sum_{i=1}^M C_i$ where $C_i$ is the capacity of each neuron.
\item For perceptrons in series (e.g., in subsequent layers), the capacity of a subsequent layer cannot be larger than the output of the previous layer.
\end{enumerate}
After presenting related work in Section~\ref{sec:prior} and summarizing MacKay's proof in Section~\ref{sec:mackay}, we derive the above principles in Sections~\ref{sec:infomodel} and \ref{sec:combining}. In Section~\ref{sec:heuristic}, we then present and evaluate a heuristic approach for fast estimation of the required neural network capacity, in bits, for a given training data set. The heuristic method assumes a network with static, identical weights. Even if such a network will still be able to approximately learn any labeling for a data set, it would require too many neurons. We then assume that training is able to cut down the number of parameters exponentially, when compared to the untrained network. Section~\ref{sec:generalization} discusses the practical implications of memory capacity for generalization. Finally, in Section~\ref{sec:conclusion}, we conclude the article with future work directions.
\begin{figure}[tb!]
\centering
\includegraphics[width=0.48\textwidth]{Networks.pdf}
\caption{\label{f:examples}The perceptron a) has $3$ bits of capacity and can therefore memorize the $14$ Boolean functions of two variables that can have a truth table of $8$ or less states (removing redundant states). The shortcut network b) has $3+4=7$ bits of capacity and can therefore implement all $16$ Boolean functions. The 3-layer network in c) has $6+\min(3,2)=8$ bits of capacity. Last but not least the deep network d) has $6+\min(6,2)+\min(3,2)=10$ bits of capacity.}
\end{figure}
\section{Related Work}
\label{sec:prior}
\begin{figure*}
\centering
\fbox{\includegraphics[width=0.8\textwidth]{dpitfmeter.png}}
\caption{\label{f:dpitfmeter} Our web demo based on the Tensorflow Playground (link see Section~\protect\ref{sec:conclusion}) showing the Principle~\protect\ref{def:prin4} in action. The third hidden layer is dependent on the second hidden layer. Therefore it only holds $1$ bit of information (smoothed by the activation function) despite consisting of 6 neurons with a stand-alone capacity of $18$ bits.}
\end{figure*}
The perceptron was introduced in 1958~\cite{Rosenblatt1958} and since then, it has been extended in many variants, including, but not limited to, the structures described in~\cite{Crammer2006,Dekel2008,KrellPhd2015,KrellOc2015}. The perceptron uses a $k$-dimensional input and generates the output by applying a linear function to the input, followed by a gating function. The gating function is typically the identity function, the sign function, a sigmoid function, or the rectified linear unit (ReLU)~\cite{He2015,Nair2010}. Motivated by brain research~\cite{Feldman1982}, perceptrons are stacked together to networks and they are usually trained by a chain rule known as backpropagation~\cite{Rumelhart1986,Rumelhart1988}.
Even though perceptrons have been utilized for a long time, its capacities have been rarely explored beyond discussion of linear separability. Moreover, catastrophic forgetting has so far not been explained satisfactorily. Catastrophic forgetting~\cite{McCloskey1989,Ratcliff1990} is a phenomenon consisting in the very quick loss of the network's capability to classify the first set of labels, when the net is first trained on one set of labels and then on another set of labels. Our interpretation of the cause of this phenomenon is that it is simply a capacity overflow.
One of the largest contributions to machine learning theory comes from Vapnik and Chervonenkis~\cite{Vapnik2000}, including the Vapnik-Chervonenkis (VC) dimension. The VC dimension has been well known for decades~\cite{Vapnik1971} and is defined as the largest natural number of samples in a dataset that can be shattered by a hypothesis space. This means that for a hypothesis space having VC dimension $D_{VC}$, there exists a dataset with $D_{VC}$ samples such that for any binary labeling ($2^{D_{VC}}$ possibilities) there exists a perfect classifier $f$ in the hypothesis space, that is, $f$ maps the samples perfectly to the labels. Due to perfect memorizing, it holds that $D_{VC}=\infty$ for 1-nearest neighbor. Tight bounds have so far been computed for linear classifiers ($k+1$) as well as decision trees~\cite{Asian2009}. The definition of VC dimension comes with two major drawbacks, however. First, it only considers the potential hypothesis space but not other aspects, like the optimization algorithm, or loss and regularization function affecting the choice of the hypothesis~\cite{Arpit2017}. Second, it is sufficient to provide only one example of a dataset to match the VC dimension. Hence, given a more complex structure of the hypothesis space, the chosen data can take advantage of this structure. As a result, shatterability can be increased by increasing the structure of the data. While these aspects do not matter much for simple algorithms, they constitute a major point of concern for deep neural networks. In~\cite{Vapnik1994}, Vapnik et al. suggest to determine the VC dimension empirically, but state in their conclusion that the described approach does not apply to neural networks as they are ``beyond theory". So far, the VC dimension has only been approximated for neural networks. For example, Mostafa argued loosely that the capacity must be bounded by $N^2$ with $N$ being the number of perceptrons~\cite{Mostafa1989}. Recently,~\cite{Shwartz2014} determined in their book that for a sigmoid activation function and a limited amount of bits for the weights, the loose upper bound of the VC dimension is $\mathcal{O}(|E|)$ where $E$ is the set of edges and consequently $|E|$ the number of non-zero weights. Extensions of the boundaries have been derived for example for recurrent neural networks~\cite{Koiran1998} and networks with piecewise polynomials~\cite{bartlett1999almost} and piecewise linear~\cite{Harvey2017} gating functions. Another article~\cite{Koiran1997} describes a quadratic VC dimension for a very special case. The authors use a regular grid of $n$ times $n$ points in the two dimensional space and tailor their multilayer perceptron directly to this structure to use only $3n$ gates and $8n$ weights.
One measure that handles the properties of given data is the Rademacher complexity~\cite{Bartlett2001}. For understanding the properties of large neural networks, Zhang et al.~\cite{zhang2017} recently performed randomization tests. They show that their observed networks can memorize the data as well as the noise. This is proven by evaluating that their neural networks perfectly learn with random labels or with random data. This shows that the VC dimension of the analyzed networks is above the size of the used dataset. But it is not clear what the full capacity of the networks is. This observation also explains why smaller size networks can outperform larger networks. A more elaborate extension of this evaluation has been provided by Arpit et al.~\cite{Arpit2017}.
\begin{figure*}
\centering
\includegraphics[width=0.49\textwidth]{Figure_TNK_dotted.png}
\includegraphics[width=0.49\textwidth]{Figure_3.png}
\caption{
Left: \label{f:tnk} Characteristic curve examples of the $T(n,k)$ function for different input dimensions $k$ and the two crucial points at $n=k$ for the VC dimension and $n=2k$ for the MacKay capacity. Right: \label{f:realtnk} Measured characteristic curve example for different number of hidden layers for a configuration of scikit-learn\protect\cite{friedland2018caplaw}. The tools to measure and compare the characteristic curves of concrete neural network implementations are available in our public repository (see Section~\protect\ref{sec:conclusion}).
}
\end{figure*}
Summarizing the contribution by~\cite{cover1965}, MacKay is the first to interpret a perceptron as an encoder in a Shannon communication model (\cite{mackay2003}, Chapter~40). MacKay's use of the Shannon model allows the measurement of the memory capacity of the perceptron in bits. Furthermore, it allows for the discussion of a perceptron's capabilities, without taking into account the number of bits used to store the weights (64\,bit doubles, real-valued, etc.). He also points out that there are two distinct transition points in the error measurement. The first one is discontinuous and happens at the VC dimension. For a single perceptron with offset, that point is $D_{VC}=k+1$, when $k$ is the dimensionality of the data. Below this point the error should be $0$, given perfect training, because the perceptron is able to generate all possible shatterings of the hypothesis space. For clarification, we summarize this proof in Section~\ref{sec:mackay} and present initial work on an extension in~\cite{friedland2018caplaw}.
Another important contribution using information theory comes from Tishby~\cite{Tishby2015}. They use the information bottleneck principle to analyze deep learning. For each layer, the previous layers are treated as an encoder that compresses the data $X$ to some better representation $T$ which is then decoded to the labels $Y$ by the consecutive layers. By calculating the respective mutual information $I(X,T)$ and $I(T,Y)$ for each layer they analyze networks and their behavior during training or when changing the amount of training data. Our Principle~\ref{def:prin4} is a direct consequence of his work.
This questions of generalization and network architecture have recently become a heated academic discussion again as deep learning surprisingly seems to outperform shallow learning. For deep learning, single perceptrons with a nonlinear and continuous gating function are concatenated in a layered fashion. Techniques like convolutional filters, drop out, early stopping, regularization, etc., are used to tune performance, leading to a variety of claims about the capabilities and limits of each of these algorithms (for example~\cite{zhang2017}). We are aware of recent questioning of the approach of discussing the memory capacity of neural networks~\cite{Arpit2017,zhang2017}. Occam's razor~\cite{blumer1987} dictates that one should follow the path of least assumptions, as perceptrons were initially conceived as a "generalizing memory", as detailed for example, in the early works of Widrow~\cite{widrow1962}. This approach has also been suggested by~\cite{Mostafa1989} and, as mentioned earlier, later explained in depth by MacKay~\cite{mackay2003}. Also, the Ising model of ferromagnetism, which is a well-known model used to explain memory storage, has already been reported to have similarities to perceptrons~\cite{gardner1987,gardner1988} and also to the neurons in the retina~\cite{tkacik2006ising}.
\section{Capacities of a Perceptron}
\label{sec:mackay}
Here we summarize the proof elaborated in~\cite{cover1965} and \cite{mackay2003}, Chapter~40.
The functionality of a perceptron is typically explained by the XOR example (i.\,e., showing that a perceptron with $2$ input variables $k$, which can have $2^k=4$ states, can only model $14$ of the $2^{2^k}=16$ possible output functions). XOR and its negation cannot be linearly separated by a single threshold function of two variables and a bias. For an example of this explanation, see~\cite{Rojas1996}, section~3.2.2. Instead of computing binary functions of $k$ variables, MacKay effectively changes the computability question to a labeling question: given $n$ points in general position, how many of the $2^n$ possible labelings in $\{0,1\}^n$ can be trained into a perceptron. Just as done by~\cite{cover1965,Rojas1996}, MacKay uses the relationship between the input dimensionality of the data $k$ and the number of inputs $n$ to the perceptron, which is denoted by a function $T(n,k)$ that indicates the number of ``distinct threshold functions'' (separating hyperplanes) of $n$ points in general position in $k$ dimensions. The original function was derived by~\cite{schlaefli1852}. It can be calculated as:
\begin{equation}
\label{eq:tnk2}
T(n,k)=2\sum_{l=0}^{k-1}\genfrac(){0pt}{0}{n-1}{l}
\end{equation}
Most importantly, it holds that
\begin{equation}
T(n,k)=2^n \text{ } \forall k: k\geq n.
\end{equation}
This allows to derive the VC dimension $D$ of a neuron with $k$ parameters shattering a set of $n$ points in general position. The number of possible binary labelings for $n$ points is $2^n$ and $T(n,n=k)=2^n$.
This is the $D=k$, since all possible labelings of the $k=n$ points can be realized.
When $k<n$, the $T(n,k)$ function follows a calculation scheme based on the Pascal Triangle~\cite{coolidge1949story}, which means that the loss due to incomplete shattering is still predictable. MacKay uses an error function based on the cumulative distribution of the standard Gaussian to perform that prediction and approximate the resulting distribution. More importantly, he defines a second point, at which only $50\,\%$ of all possible labelings can be separated by the binary classifier. He proofs this point to be at $n=2k$ for large $k$ and illustrates that there is a sharp continuous drop in performance at this point. MacKay then follows Cover's conclusion that the information theoretic capacity of a perceptron is $2k$. We call this point MacKay dimension in~\cite{friedland2018caplaw}.
When comparing and visualizing the $T(n,k)$ function, it is only natural to normalize function values by the number of possible labelings $2^n$ and to normalize the argument by the number of inputs $k$ which is equal to the capacity of the perceptron. Figure~\ref{f:tnk} displays these normalized functions for different input dimensions $k$. The functions follow a clear pattern like the characteristic curves of circuit components in electrical engineering.
\section{Information Theoretic Model}
\label{sec:infomodel}
\begin{figure*}
\centering
\includegraphics[width=0.7\textwidth]{shannonML.pdf}
\caption{\label{f:shannon}
Shannon's communication model applied to labeling in machine learning. A dataset consisting of $n$ sample points and the ground truth labeling of $n$ bits are sent to the neural network. The learning method converts it into a parameterization (i.\,e., network weights). In the decoding step, the network then uses the weights together with the dataset to try to reproduce the original labeling.}
\end{figure*}
To the best of our knowledge, MacKay is the first person to interpret a perceptron as an encoder in a Shannon communication model (\cite{mackay2003}, Chapter~40). In our article, we use a slightly modified version of the model depicted in Fig.~\ref{f:shannon}.
As explained in Section~\ref{sec:mackay}, the input of the encoder are $n$ points in general position and a random labeling. The output of the encoder are the weights of a perceptron. The decoder receives the (perfectly learned) weights over a lossless channel. The question is: given the received set of weights and the knowledge of the data, can the decoder reconstruct the original labels of the points? In other words, the perceptron is interpreted as memory that stores a labeling of $n$ points relative to the data: how much information can then be stored by training a perceptron? We address this question by interpreting MacKay's definition of neuron capacity as a \textit{memory capacity}.
The use of Shannon's model has an advantage: The mathematical framework of information theory can be applied to machine learning. Moreover, it allows to predict and measure neuron capacity in the unit of information: bits.
We are interested in an upper bound. Therefore, we are only interested in the cases where we can guarantee lossless reproduction of the trained function; in other words, we are interested in the lossless memory capacity of neurons and networks of neurons. The definition of general position used in the previous section is typically used in linear algebra and is the most general case needed for a perceptron that uses a hyperplane for linear separation (see also Table~1 in~\cite{cover1965}). For neural networks, a stricter setting is required because they can implement arbitrary non-linear separations. We must therefore assume that the data points are in completely random positions. This is, the coordinates of the data points are equiprobable.
\section{Networks of Perceptrons}
\label{sec:combining}
For the remainder of this article, we will assume that the network is a feedforward network consisting of traditional perceptrons (threshold units with activation function) with real-valued weights. Each unit has a bias, which counts as an additional real-valued weight~\cite{Rojas1996,mackay2003}. We will additionally assume that the perceptrons are part of a neural network embedded in the model depicted in Figure~\ref{f:shannon}, thus solving a binary labeling task. Because our discussion concerns the upper bounds, it is agnostic about training algorithms.
We define perceptrons to be \textit{in parallel} when they are connected to the same input. A \textit{layer} is a set of perceptrons in parallel. We define perceptrons to be \textit{in series} when they are connected in such a way that as the ones exclusively relying on the outputs of other perceptrons.
We note that Figure~\ref{f:examples} b) shows a perceptron that is connected in parallel.
\begin{principle}{The output of a single perceptron yields maximally one bit of information}
\label{def:prin1}
\end{principle}
A perceptron uses a decision function $f(\vec{w},\vec{x},b)$ of the form\\
\begin{align}
f(\vec{w},\vec{x},b) = {\begin{cases}1&{\text{if }}\ \vec{w}\cdot \vec{x}>b\\0&{\text{otherwise}}\end{cases}}
\end{align}
where $\vec{x} = \{ x_1, x_2, \ldots, x_N \}$ and $\vec{w} = \{ w_1, w_2, \ldots, w_N \}$ are real vectors and $b$ is a real scalar. Therefore, $\vec{w} \cdot \vec{x}$ represents a dot product:
\begin{align}
\vec{w}\cdot \vec{x} = \sum _{i=1}^{N}w_{i}x_{i} \label{eqn:scalprod}
\end{align}
Because the inequality describes a binary condition (it is either greater or not), it follows that each perceptron ultimately behaves as a binary classifier, thus outputting a symbol $o=f(\vec{w},\vec{x},b) \in \{0,1\}$. If each state of $o$ is equiprobable, the information content encoded in the output of the perceptron is $\log_2(2)=1$ bit, else, if each state of $o$ is not equiprobable, the information content it is less than $1$ bit. It is worth remarking that an analytic approximation of the step function $f(\vec{w},\vec{x},b)$, for example a sigmoid, a rectified linear unit, or any other space dividing function, does not affect the aforementioned analysis. This is guaranteed by the data processing inequality~\cite{mackay2003} (p. 144).
\begin{principle}{The lossless storage capacity of a single perceptron is the number of parameters in bits.}
\label{def:prin2}
\end{principle}
This follows intuitively from Section~\ref{sec:mackay}, because $n$ bits of labels can be stored with $k=n$ parameters. This is, each parameter models one bit of labeling. However, confusion often arises over the fact that the weights are assumed real-valued. We therefore introduce the following lemma showing that a perceptron behaves analogous to a memory cell. This is, given fixed random input, it can model $2^k$ different output states, where $k$ is the number of parameters stored by the perceptron.
Assume a perceptron as defined in Principle~\ref{def:prin1} in the model defined in Section~\ref{sec:infomodel}. Let $C(k)$ be the number of bits of labeling storable by $k$ parameters.
\begin{lemma}[Lossless Storage Capacity of a Perceptron]
\label{lem:lmdperc}
$ C(k) = k$
\end{lemma}
\begin{proof}
Let us consider a case distinction over $b$.
Case 1: $b=0$\\
We now rewrite Eq.~\ref{eqn:scalprod} as:
\begin{align}
\sum _{i=1}^{N}s_{i}|w_{i}|x_{i}
\end{align}
where $|w_{i}|$ is the absolute value of $w_i$ and $s_i$ is the sign of each $w_i$, this is $s_i \in \{-1,1\}$.
It is now clear that, given an input $x_i$, the choice of $s_i$ in training is the only determining factor for the outcome of $f(\vec{w},\vec{x},b)$. The values of $|w_i|$ merely serve as scaling factors\footnote{Such scaling maybe important for generalization and training but is not relevant for computing the decision changing capabilities.}.
Since $s_i \in \{-1,1\}$ and $|\{-1,1\}|=2$, it follows that each $s_i$ can be encoded using $\log_2(2)=1$ bit. This is, the maximum number of encodable outcome changes for $f(\vec{w},\vec{x},b)$ is $N$. This inevitably results in the memory capacity of a perceptron being $C(N)=N$.
Case 2: $b\neq 0$\\
Using the same approach as above, we begin by separating the bias and its sign: $b=s_b|b|$, where $|b|$ is the absolute value of $b$ and $s_b$ is the sign of $b$, this is $s_b \in \{-1,1\}$. We can now reformulate the equation as:
\begin{align}
\sum _{i=1}^{N}s_{i}|w_{i}|x_{i} &> |b|s_b \\
\frac{1}{s_b}\sum _{i=1}^{N}s_{i}|w_{i}|x_{i} &> |b|
\end{align}
Since $s_b$ is not dependent on $i$, $s_b$ can only be trained to correct all decisions at once. $|b|$ is strictly positive. This is, the inequality can be decided just by comparing the sign of $s_b$ and the sign of the sum. Again, $s_b \in \{-1,1\}$ and thus $s_b$ encodes $\log_2(2)=1$ bit. As a result, $b$ contributes $1$ bit of memory capacity. In total, a perceptron with non-zero bias can therefore maximally memorize $N+1$ bits of changes to the outcomes of $f(\vec{w},\vec{x},b)$. Since $k=N+1$, it inevitably follows that $C(k)=k$.
\end{proof}
\begin{principle}{The total capacity $C_{tot}$ of $M$ perceptrons in parallel is:
\begin{align}
C_{\text{tot}} = \sum_{i=1}^M C_i
\end{align}
where $C_i$ is the capacity of each neuron.
\label{def:prin3}}
\end{principle}
Consistent with MacKay's interpretation, connecting, for example, two perceptrons in parallel is analogous to using two memory cells with capacity $C_1$ and $C_2$. The storage capacity of such a circuit is maximally $C_{tot}=C_1+C_2$ bits.
For the following lemma we assume two perceptrons connected to the same input, each with a number of parameters $k_1$ and $k_2$. Due to the associativity of addition, We can do this Without loss of generality.
\begin{lemma}[Perceptrons in parallel]
\label{the:lmpar}
$C(k_1+k_2)=k_1+k_2$
\end{lemma}
\begin{proof}
We know from Lemma~\ref{lem:lmdperc} that $C(k_1)=k_1$ and $C(k_2)=k_2$. Since we assume all points of the data to be in equiprobable positions, each perceptron $i$ can now maximally label $k_i$ points independently. This is, the two perceptrons can maximally label $k_1+k_2$ points. This is, $C(k_1+k_2)=k_1+k_2$.
\end{proof}
\begin{principle}{For perceptrons in series, the capacity of a subsequent layer cannot be larger than the largest possible amount of information output of the previous layer.}
\label{def:prin4}
\end{principle}
As explained in Section~\ref{sec:prior}, Tishby~\cite{Tishby2015} treats each layer in a deep perceptron network as an encoder for a subsequent layer. The work analyzes the mutual information between layers and points out that the data processing inequality holds between them, both theoretically and empirically. We are able to confirm this result and note that channel capacity $C$ in general is defined as $C=\sup _{{p_{X}(x)}}I(X;Y)$, where the supremum is taken over all possible choices of $p_{X}(x)$(~\cite{shannon1948bell}). The data processing inequality (\cite{mackay2003}, p. 144) states that if $X\rightarrow Y\rightarrow Z$ is a Markov chain then $I(x;y)\geqslant I(x;z)$, where $I(x;y)$ is the mutual information. In our model (See Section~\ref{sec:infomodel}), the channel is the identity channel and the label distribution is assumed as equiprobable. These two assumptions make the channel capacity identical to the memory capacity and to the mutual information. As a result, the capacity of a subsequent layer is upper bounded by the output of the previous layer.
Without loss of generality, we assume two layers of perceptrons. The output of perceptron layer 1 is the sole input for perceptron layer 2. We denote the total capacity of layer 2 with $C_{L2}$, the number of parameters in layer 2 with $k_{L2}$ and the number of bits in the output of layer 1 with $o_{L1}$.
\begin{lemma}[Perceptrons in Series]
\label{the:lmser}
$C_{L2} = \min(C(k_{L2}),o_{L1})$
\end{lemma}
\begin{proof}
Let create the Markov chain $X\rightarrow Y \rightarrow Z$, where $X$ is the random variable representing the input to layer 1, $Y$ is the random variable representing the output of layer 1 and $Z$ is representing the output of layer 2. It is clear that the $\sup_{{p_{X}(x)}}I(Y;Z)$ is bounded by $I(X;Y)$, which we know to be $o_{L1}$. If $o_{L1}>C(k_{L2})$, then $C(K_{L2})$ limits the number of bits that can be stored in layer 2. If $o_{L1} \leq C(k_{L2})$, then the data processing inequality does not allow for the creation of information and $\sup _{{p_{X}(x)}}I(Y;Z) \leq o_{L1}$. As a consequence, $C_{L2} = \min(C(k_{L2}),o_{L1})$
\end{proof}
When generalizing to more than two layers, it is important to keep in mind that any capacity constraint from an earlier layer will upper bound all subsequent layers. This is, capacity can never increase in subsequent layers. Note that the input layer counts as a layer as well. Figure~\ref{f:dpitfmeter} shows a screen shot of our neural network capacity web demo (link see Section~\ref{sec:conclusion}) with an example of Principle~\ref{def:prin4} in action. Figure~\ref{f:examples} discusses various architecture capacities practically applying the computation principles presented here.
There is a notable illusion that sometimes makes it seem that Principle~\ref{def:prin4} does not hold. In training, weights are initialized, for example at random. This initial configuration can create the illusion that a layer has more states available than dictated by the principle. For example, a layer that has only $1$ bit of capacity using Principle~\ref{def:prin4} can be in more than $2$ states before the weights have been updated in training based on the information passed by a previous layer.
\subsection{Measuring Capacity}
It is possible to practically measure the capacity of concrete neural networks implementations with varying architectures and learning strategies. This is done by generating $n$ random data data points in $d$ dimensions and training the network to memorize all possible $2^n$ binary labeling vectors. Once a network is not able to learn all labelings anymore, we reached capacity. While this effectiveness measurement is exponential in run time, it only needs to be performed on a small representative subnet as capacity scales linearly.
We found that the effectiveness of neural network implementations actually varies dramatically (always below the theoretical upper limit). Therefore capacity measurement alone allows for a task-independent comparison of neural network variations. Our experiments show that linear scaling holds practically and our theoretical bounds are actionable upper bounds for engineering purposes. All the tested threshold-like activation functions, including sigmoid and ReLU exhibited the predicted behavior -- just as explained in theory by the data processing inequality. Our experimental methodology serves as a benchmarking tool for the evaluation of neural network implementations. Using points in random position, one can test any learning algorithm and network architecture against the theoretical limit both for performance and efficiency (convergence rate). Figure~\ref{f:tnk} (right) shows an example measurement curve. These results as well as all tools are available in our public repository (See Section~\ref{sec:conclusion}).
\section{Capacity Requirement Estimate}
\label{sec:heuristic}
\begin{algorithm}
\begin{algorithmic}
\Require $data$: array of length $i$ contains $d$-dimensional vectors $x$, $labels$: a column of $0$ or $1$ with length $i$
\Procedure{$MaxCapReq$}{$(data, labels)$}
\State $thresholds \gets 0$
\ForAll{$i$}
\State $table[i] \gets (\sum{x[i][d]}, label[i])$
\State $sortedtable \gets sort(table, key=column~0)$
\State $class \gets 0$
\EndFor
\ForAll{$i$}
\If{not $sortedtable[i][1] == class $}
\State $class \gets sortedtable[i][1]$
\State $thresholds \gets thresholds+1$
\EndIf
\EndFor
\State $maxcapreq \gets thresholds*d+thresholds+1$
\State $expcapreq \gets \log_2(thresholds+1)*d$
\State {\bf print} "Max:~"$+maxcapreq+$"~bits"
\State {\bf print} "Exp:~"$+expcapreq+$"~bits"
\EndProcedure
\caption{\label{alg:maxnn}Calculating the maximum and approximated expected capacity requirement of a binary classifier neural network for given training data.}
\end{algorithmic}
\end{algorithm}
The upper-bound estimation of the capacity allows the comparison of the efficiency of different architectures independent of a task. However, sizing a network properly to a task requires an estimate of the required capacity. We propose a heuristic method to estimate the neural network capacity requirement for a given dataset and labeling.
The exact memorization capacity requirement based on our model in Figure~\ref{f:shannon} is the minimum description length of the data/labels table that needs to be memorized. In practice, this value is almost never given. Furthermore, in a neural network, the table is recoded using weighted dot-product threshold functions, which, as discussed in Section~\ref{sec:mackay}, has intrinsic compression capabilities. This is, often the labels of $n$ points can be stored with less than $n$ parameters. As we have done throughout the article, we will ignore the compression capabilities of neurons and work with the worst case.
\subsection{Upper Limit Network Size}
This section presents our proposed heuristic for a worst case sized network. Our idea for the heuristic method stems from the definition of the perceptron threshold function (see Principle~\ref{def:prin1}). We observe that the dot product has $d+1$ variables that need to be tuned, with $d$ being the dimensionality of the input vector $x$. This makes perceptron learning and backpropagation NP-complete~\cite{blum1989training}. However, for an upper limit estimation, we chose to ignore the training of the weights $w_i$ by fixing them to $1$: we only train the biases. This is done by calculating the dot products with $w_i:=1$, essentially summing up the data rows of the table. The result is a two-column table with these sums and the classes. We now sort this two-column table by the sums before we iterate through it and record the need of a threshold every time a class change occurs. Note that we can safely ignore column sums with the same value (collisions): If they don't belong to the same class, they count as a threshold. If an actual network was built, training of the weights would potentially resolve this collision. As a last step, we take the number of thresholds needed and estimate the capacity requirement for a network by assuming that each threshold is implemented by a neuron in the hidden layer firing $0$ or a $1$. The number of inputs for these neurons is given by the dimensionality of the data. We then need to connect a neuron in the output layer that has the number of hidden layer neurons as input. The threshold of that output neuron is $0$ and the input weights are $+1$ for class $1$ and $-1$ for class $0$. The reader is encouraged to check that such a network is able to label any table (ignoring collisions). Our algorithm is bounded by the runtime of the sorting, which is $\mathcal{O}(n \log(n))$ in the best case. Since we are able to effectively create a network that memorizes the labeling given the data without tuning the weights, we consider this the upper limit network. Any network that uses more parameters would therefore be wasting resources. Figure~\ref{alg:maxnn} shows pseudo code for this algorithm and the expected capacity presented in the next section.
\begin{table*}
\centering
\resizebox{\textwidth}{!}{%
\begin{tabular}{|l|l|l|l|}
\hline
\rowcolor[HTML]{C0C0C0}
\textbf{Dataset} & \textbf{Max Capacity Requirement} & \textbf{Expected Capacity Requirement} & \textbf{Validation (\% accuracy)} \\ \hline
AND, 2 variables & 4 bits & 2 bits & 2 bits (100\%) \\ \hline
XOR, 2 variables & 8 bits & 4 bits & 7 bits (100\%) \\ \hline
\begin{tabular}[c]{@{}l@{}}Separated Gaussians (100 samples)\end{tabular} & 4 bits & 2 bits & 3 bits (100\%) \\ \hline
2 Circles (100 samples) & 224 bits & 12 bits & 12 bits (100\%) \\ \hline
Checker pattern (100 samples) & 144 bits & 12 bits & 12 bits (100\%) \\ \hline
Spiral pattern (100 samples) & 324 bits & 14 bits & 24 bits (98\%) \\ \hline
ImageNet: 2000 images in 2 classes & 906984 bits & 10240 bits & 10253 bits (98.2 \%) \\ \hline
\end{tabular}
}
\caption{\label{t:experiments} Experimental validation of the heuristic capacity estimation method using the structures available both in our public repository and in the online demo.}
\end{table*}
\subsection{Approximately Expected Capacity}
We estimate the expected capacity by assuming that training the weights and biases is maximally effective. This is, it can cut down the number of threshold comparisons exponentially to $\log_2(n)$ where $n$ is the number of thresholds. The rationale for this choice is that a neural network effectively takes an input as a binary number and matches it against stored numbers in the network to determine the closest match. The output layer then determines the class for that match. That matching is effectively a search algorithm which in the best case can be implemented in logarithmic time. We call this the approximately expected capacity requirement as we need to take into account that real data is never random. Therefore, the network might be able to compress by a factor of $2$ or even a much higher margin.
\subsection{Experimental Results}
Table~\ref{t:experiments} shows experimental results for various data sets. We show the maximum and the approximately expected capacity as generated by the heuristic method. We then show the achieved accuracy using an actual validation experiment using a neural network of the indicated capacity. The AND classifier requires one perceptron without bias. We implemented XOR using a shortcut network (see also~\cite{Rojas1996}). The Gaussians and the circle, checker, and spiral patterns are available as part of the Tensorflow Playground. For the ImageNet experiment, we took 2000 random images from 2 classes (``hummingbird" and ``snow leopard") and in lieu of a convolution layer, we compressed all images aggressively with JPEG quality 20~\cite{friedland2018helmholtz}. The image channels were combined from RGB into only the Y component (grayscale). We then trained a 3-layer neural network and increased the capacity successively. The best result was achieved at the capacity shown in the table; fewer parameters made the memorization result worse -- all other parameters being the same (e.g. 94.6\% accuracy at 5\,kbit capacity, 97.3\% accuracy at 9\,kbit capacity and 97.9\% accuracy at 11\,kbit capacity). We note that image experiments like these are often anecdotal as many factors play into the actual achieved accuracy, including initial conditions of the initialization, learning rate, regularization, and others. We therefore made the scripts and data available for repetition in our public repository (Link see Section~\ref{sec:conclusion}). The results show that our approximation of the expected capacity is very close to the actual capacity.
\section{From Memorization to\\ Generalization}
\label{sec:generalization}
Training the network with random points makes the upper bound neural network size analytically accessible because no inference (generalization) is possible and the best possible thing any machine learner can do is to memorize. This methodology, which is not restricted to neural networks, therefore operates at the lower limit of generalization.
In reality, especially with a large set of samples, one is very unlikely to encounter data with equiprobable distribution. A network trained based on the principles presented here is therefore overfitting. A first consequence is that using more capacity than required for memorization wastes memory and computation resources. Secondly, it will complicate any attempt at explaining the inferences made by the network.
To avoid overfitting and to have a better chance of explaining the data in a human comprehensible way, it is therefore advisable to reduce the number of parameters. This is, again, consistent with Occam's razor. For a given task, we therefore recommended to size the neural network for memorization at first and then successively re-train the network while reducing the number of parameters. It is expected that accuracy on the training data reduces with the network capacity reduction. Generalization capability, which should be quantified by measuring accuracy against a validation set, should increase, however. In the best case, the network loses the ability to memorize the lowest significant digits of the training data. The lowest significant digits are likely insignificant with regard to the target function. This is, they are noise. Cutting the lowest-significant digits first, we expect the decay of training accuracy to follow a logarithmic curve (this was also observed in~\cite{friedland2018helmholtz}). Ultimately, the network with the smallest capacity that is still able to represent the data is the one that maximizes generalization and the chances at explainability. The best possible scenario is a single neuron that can represent an infinite amount of points (above and below the threshold).
\section{Conclusion and Future Work}
\label{sec:conclusion}
We present an alternative understanding of neural networks using information theory. The main trick, that is not specific to neural networks, is to train the network with random points. This way, no inference (generalization) is possible and the best thing any machine learner can do is to memorize. We then present engineering principles to quantify the capabilities of a neural network given it's size and architecture as memory capacity. This allows the comparison of the efficiency of different architectures independently of a task. Second, we introduce and experimentally validate a heuristic method to estimate the neural network capacity requirement for a given dataset and labeling. We then relate this result to generalization and outline a process for reducing parameters. The overall result is a method to better predict and measure the capabilities of neural networks.
Future work in continuation of this research will explore non-binary classification, recursive architectures, and self-looping layers. Moreover, further research into investigating convolutional networks, fuzzy networks and RBF kernel networks would help put these types of architectures into a comparative perspective. We will also revisit neural network training given the knowledge that we have gained doing this research. During the backpropagation step, the data processing inequality is reversed. This is, only one bit of information is actually transmitted backwards through the layers. All results and the tools for measuring capacity and estimating the required capacity are available in our public repository: \url{https://github.com/fractor/nntailoring}.
An interactive demo showing how capacity can be used is available at: \url{http://tfmeter.icsi.berkeley.edu}.
\section*{Acknowledgements}
This work was performed under the auspices of the U.S. Department of Energy by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344. It was also partially supported by a Lawrence Livermore Laboratory Directed Research \& Development grants (17-ERD-096 and 18-ERD-021). IM release number LLNL-TR-758456. Mario Michael Krell was supported by the Federal Ministry of Education and Research (BMBF, grant no. 01IM14006A) and by a fellowship within the FITweltweit program of the German Academic Exchange Service (DAAD). This research was partially supported by the U.S. National Science Foundation (NSF) grant CNS 1514509. 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 any sponsoring institution, the U.S. government or any other entity. We want to cordially thank Ra\'ul Rojas for in depth discussion on the chaining of the $T()$ function. We also want to thank Jerome Feldman for discussions on the cognitive backgrounds, especially the concept of actionability. Kannan Ramchandran's intuition of signal processing and information theory was invaluable. We'd like thank Sascha Hornauer for his advise on the imagenet experiments as well as Alexander Fabisch, Jan Hendrik Metzen, Bhiksha Raj, Naftali Tishby, Jaeyoung Choi, Friedrich Sommer, Alyosha Efros, Andrew Feit, and Barry Chen for their insightful advise. Special thanks go to Viviana Rever\'on for proofreading.
\bibliographystyle{abbrv}
| {'timestamp': '2018-10-05T02:14:53', 'yymm': '1810', 'arxiv_id': '1810.02328', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02328'} | arxiv |
\section{Introduction}
\label{sec:intro}
Facial expressions manipulation has been an active area of research in recent years \cite{brizzi2014optical,gass2011warp,theobald2009mapping}. Several directions such as expression replacing, transferring, exaggerating, and suppressing have been investigated. The presence of facial expressions can provide a rich source of information for human behavior analysis and communication. However, facial expressions can also hinder information retrieval in some cases and affect the performance of approaches that use face as a biometric. Therefore, developing suppression methods that generate a neutral expression can be helpful. These methods can be utilized in various scenarios such as a pre-processing step to face recognition, continuous authentication, and human-computer interaction.
Expression manipulation and neutralization to improve face recognition has gained more attention recently. The existing approaches in this area can be divided into: geometric based approaches \cite{zhang2006geometry,tan2009face}, model/template based approaches \cite{amberg2008expression,chu20143d,theobald2009mapping}, tensor based approaches \cite{yang2012facial,yang2011expression}, and wrap based approaches \cite{gass2011warp}. The main limitation of these approaches is that the facial annotations and the region segmentation are either manual/semi-automated or require pre-training for model fitting.
This paper extends our previous work \cite{brizzi2014optical}, which proposed a method to suppress the smile expression for 4 subjects, to include other expressions and larger datasets (i.e., BU-4DFE \cite{yin20063d} and AM-FED \cite{mcduff2013affectiva}). The main advantages of the presented algorithm are as follows: 1) the algorithm has the ability to suppress any expression without requiring prior knowledge of the data or training for a specific expression, and 2) it is simple and has low cost since it applies the suppression directly to the frames that contain the target face rather than transferring the facial information into a separate model. The experimental results of the proposed method on various expressions namely happiness, sadness, and anger show its ability to suppress and reduce facial expressions.
\section{Proposed Method}
\label{sec:method}
In this section, we provide a presentation of our suppression algorithm, which consists of three main stages: 1) facial landmarks detection and tracking, 2) expression suppression based on strain analysis, 3) post-processing stage to smooth the suppressed expression. Each of these stages is described below.
A subspace constrained mean shift face tracker \cite{saragih2009face} that automatically locates and tracks 66 facial points is applied for facial landmarks detection and tracking. The extracted points are used then to align the face and crop it.
In the second stage, we computed the optical flow vectors between consecutive video frames and used these vectors to derive the optical strain as described in \cite{brizzi2014optical}. The optical strain can be defined as the measure of an object's deformations. In case of facial expressions, it measures the facial tissues' deformations, which are caused by an expression. The strain magnitude, derived from optical flow vectors and computed as described in \cite{brizzi2014optical}, is then normalized to [0,255] and used to generate a strain map. Figure 1 provides an illustration of the normalized strain values (strain map) of a target face across an expression event.
After the strain map is generated, it is used to identify the high strain pixels that need to be replaced based on a simple thresholding. The result is a binary mask that indicates which pixels should be replaced from the reference frame (i.e., frame of neutral expression or lowest strain values) to the current frame. We set the value of this threshold to any number that exceeds the lower 10 percent of values in the strain map.
\begin{figure}[t]
\begin{center}
\includegraphics[width=2.5cm, height=2.5cm]{1a.png}
\includegraphics[width=2.5cm, height=2.5cm]{1b.png}
\includegraphics[width=2.5cm, height=2.5cm]{1e.png}
\includegraphics[width=2.5cm, height=2.5cm]{1f.png}
\end{center}
\begin{center}
\caption{The strain map across different frames (10, 1st row and 52, 2nd row) of a happiness expression.}
\end{center}
\end{figure}
Finally, the post-processing stage consists of two level of smoothing to reduce the artifacts generated as a result of suppressing the expression. The first level of smoothing is applied to the edges of the masked areas to reduce the artifacts of the pixels' masking process using a 2D median smoothing algorithm. The second level of smoothing is used to minimize the false edges on the skin by performing a standard smoothing algorithm on the entire face.
\section{Study Design}
\label{sec:study}
\subsection{Dataset}
Video sequences of two publicly-available datasets were used to evaluate our strain-based method for expression suppression. The first dataset is SUNY Binghampton BU-4DFE \cite{yin20063d} dataset that contains 101 subjects performing 6 different posed prototypical expressions. Each of those subjects has a total of 6 video sequences, which gives a total of 606 video sequences. The second dataset is AM-FED \cite{mcduff2013affectiva} in the wild dataset that contains 242 facial videos collected in real world conditions. The videos have spontaneous facial expressions of subjects recorded while watching amusing Super Bowl commercials.
\subsection{Study procedure}
In order to evaluate our suppression algorithm, two expression detectors were applied before and after suppressing the expression. The first detector is the OpenCV Haar-cascade object detector, which has been trained to detect smiles. This detector returns the smile's intensity in each frame of a video sequence as a normalized value between 0 and 99. The second expression detector is the FACET Module from the iMotions Attention Tool version 5.3 \cite{iMotions}. This commercial detector was used to detect sadness and anger expressions. Given a subject's face, the detector reports an evidence value that indicates how likely the subject is expressing any of the expressions at a given frame.
\section{Experiments and Results}
\label{sec:experiments}
We report the results of applying the strain-based suppression algorithm on BU-4DFE posed facial expression dataset and AM-FED spontaneous facial expression dataset. We tested the algorithm on BU-4DFE with three expressions (i.e., happiness, sadness, and anger) and AM-FED dataset with only happiness expression since subjects of this dataset only show the happiness expression. The subsections below present the experimental results of applying the strain-based suppression algorithm and its evaluation using expression detectors.
\begin{figure}[t]
\begin{center}
\includegraphics[width=2.5cm, height=2.5cm]{4c.png}
\includegraphics[width=2.5cm, height=2.5cm]{4e.png}
\includegraphics[width=2.5cm, height=2.5cm]{4d.png}
\includegraphics[width=2.5cm, height=2.5cm]{4f.png}
\begin{center}
\caption{Expression Suppression on BU-4DFE dataset}
\end{center}
\includegraphics[width=2.5cm, height=2cm]{org.jpg}
\includegraphics[width=2.5cm, height=2cm]{org2.png}
\includegraphics[width=2.5cm, height=2cm]{org3c.png}
\includegraphics[width=2.5cm, height=2cm]{sup.jpg}
\includegraphics[width=2.5cm, height=2cm]{sup2.png}
\includegraphics[width=2.5cm, height=2cm]{supr3c.png}
\begin{center}
\caption{Expression Suppression on AM-FED dataset}
\end{center}
\end{center}
\end{figure}
Figure 2 depicts the suppression of happiness and sadness for two subjects in BU-4DFE dataset. Figure 3 shows the results of suppressing the spontaneous happiness expression for three subjects in AM-FED dataset. For each subject, the first row represents a frame from the original video and the second row represents the same frame from the generated suppressed video. The third column in Figure 3 shows the ability of our algorithm to suppress the spontaneous happiness expression in low resolution videos.
\subsection{Algorithm Evaluation Using Expression Detectors}
To evaluate the effectiveness of our algorithm in suppressing the expression, OpenCV happiness detector and FACET expressions' detector were utilized to measure the expression's intensity before and after applying the algorithm. OpenCV detector was used to measure the happiness intensity for both BU-4DFE and AM-FED datasets while FACET detector was used to measure the intensity of other expressions in BU-4DFE dataset.
Before we proceed further in presenting the results, it is important to mention that applying the strain-based suppression algorithm on video sequences gives us one of the three following cases: 1) the algorithm completely suppresses the expression, 2) it reduces the expression intensity, and 3) it increases the expression intensity. The results of evaluating the suppression algorithm for happiness expression in AM-FED dataset and for happiness, sadness, and anger expressions in BU-4DFE dataset are summarized below.
\subsubsection{Expression: Happiness}
Tables 1 and 2 summarize the results of evaluating the algorithm on a set of video sequences depicting the happiness expression.
Table 1 shows the three cases of applying OpenCV detector to AM-FED dataset. The table shows that happiness expression for 21\% of all videos in AM-FED dataset was completely suppressed and it was reduced by 50\% for 64\% videos. However, the algorithm failed to reduce the expression but instead it increased its intensity in around 15\% of videos. We think this can be attributed to the facial distortions (i.e., artifacts) caused by the pixels replacement. We believe this issue can be solved by using better facial alignment methods as well as advanced smoothing techniques. Figure 4 illustrates the performance of OpenCV detector before and after suppression for three subjects in AM-FED dataset using a Receiver Operating Characteristic (ROC) curve. This curve shows a noticeable reduction in the performance of OpenCV detector after applying the suppression algorithm.
\begin{table}[H]
\centering
\caption{OpenCV Results for AM-FED Dataset}
\label{my-label}
\begin{tabular}{| c | c | c | }
\hline
Case & \% of videos & \% changes \\
\hline
Smile Removed & \centering 21\% & 100\% \\
Smile Reduced & \centering 64\% & 50\% \\
Smile Increased & \centering 15\% & 10\% \\
\hline
\end{tabular}
\end{table}
Table 2 shows the three cases of applying OpenCV detector to BU-4DFE dataset. Figure 5 shows intensity of the happiness expression in an original video sequence (green) of BU-4DFE dataset, which is completely suppressed after applying the suppression algorithm as illustrated by the blue line.
\begin{figure}[t]
\begin{center}
\includegraphics [width=6cm, height=4cm]{ROCc.png}
\caption{ROC curve for OpenCV detector before (blue) and after (green) suppression. }
\end{center}
\end{figure}
\begin{figure}[t]
\begin{center}
\centering
\includegraphics[width=6.5cm, height=4.5cm]{happy_ICIP.png}
\centering
\caption{Intensity of happiness before (green) and after (blue) the suppression; the expression starts at frame 13 and ends at 75.}
\end{center}
\end{figure}
\begin{table}[H]
\centering
\caption{OpenCV Results for BU-4DFE Dataset}
\label{my-label}
\begin{tabular}{| c | c | c | }
\hline
Case & \% of videos & \% changes \\
\hline
Smile Removed & \centering 59\% & 100\% \\
Smile Reduced & \centering 38\% & 75\% \\
Smile Increased & \centering 3\% & 5\%\\
\hline
\end{tabular}
\end{table}
\subsubsection{Expression: Sadness}
As shown in Table 3, the sadness expression is reduced in approximately 87\% of the subjects and increased in the remaining. Figure 6 displays the intensity of the sadness expression in an original video sequence (green curve) of BU-4DFE Dataset, which is reduced after applying the algorithm as illustrated by the blue curve. The figure shows that the expression’s intensity is reduced to below 50\% in most frames.
\begin{table}[t]
\centering
\caption{Sadness Results Using FACET with BU-4DFE }
\label{my-label}
\begin{tabular}{| c | c | c | }
\hline
Case & \% of videos & \% changes \\
\hline
Sadness Removed & \centering 0\% & 100\% \\
Sadness Reduced & \centering 87\% & 60\% \\
Sadness Increased & \centering 13\% & 22\% \\
\hline
\end{tabular}
\end{table}
\subsubsection{Expression: Anger}
The suppression algorithm was able to reduce the anger expression by 40\% for most of the subjects and completely suppressed the expression in about 6\% of the subjects. The results are summarized in Table 4. Figure 7 displays the intensity of the anger expression in an original video sequence (green curve) as compared to the intensity in the suppressed video sequence (blue curve).
\begin{table}[t]
\centering
\caption{Anger Results Using FACET with BU-4DFE}
\label{my-label}
\begin{tabular}{| c | c | c | }
\hline
Case & \% of videos & \% changes \\
\hline
Anger Removed & \centering 6\% & 100\% \\
Anger Reduced & \centering 88\% & 40\% \\
Anger Increased & \centering 6\% & 36\% \\
\hline
\end{tabular}
\end{table}
\begin{figure}[t]
\begin{center}
\centering
\includegraphics[width=6.5cm, height=4.5cm]{sad_ICIP.png}
\caption{ Intensity of sadness before (green) and after (blue) the algorithm; the expression starts at frame 12 and ends at 76.}
\end{center}
\end{figure}
\begin{figure}[t]
\begin{center}
\centering
\includegraphics[width=6.5cm, height=4.5cm]{anger_figure_ICIP.png}
\centering
\caption{Intensity of anger before (green) and after (blue) the algorithm; the expression starts at frame 11 and ends at 76.}
\end{center}
\end{figure}
\section{Conclusions}
\label{sec:majhead}
This paper presents a strain-based method for suppressing facial expressions in videos. Evaluating the algorithm on two publicly-available datasets (AM-FED spontaneous expression dataset and BU-4DFE posed dataset) proves the capability of the presented algorithm in reducing if not completely suppressing facial expressions. The algorithm yields 75\% reduction in the happiness expression in BU-4DFE dataset. The reduction of the same expression in AM-FED (the wild dataset) was about 50\%. The lower reduction rate in case of spontaneous facial expressions can be attributed to the nature of these expressions (i.e., spontaneous facial expressions tend to be less intense and dynamic comparing to the posed expressions).
The algorithm was able to reduce anger and sadness expressions significantly although the average reductions are lower than that of the happiness expression. It is possible to attribute the lesser effectiveness of suppression for anger and sadness to the subjects' representation of those expressions. Smiling was the universal representation for happiness, while the expressions for anger and sadness were more variable among the subjects. This does not affect the suppression algorithm, but may cause expression detectors to yield different results. The results of this work are encouraging; they prove the effectiveness of using facial strain for expression suppression and open new directions for future works.
In future, we plan to follow three main directions. First, we will investigate the most recent facial tracker to improve the facial alignment and registration. We believe improving the facial alignment would improve the performance since our algorithm depends on pixel replacement; a high accuracy facial alignment can decrease the artifacts generated by pixel replacement. Second, we will evaluate our algorithm on other expressions such as surprise and disgust using expression detectors designed for detecting these emotions. Finally, we plan to compare our algorithm with the state of the arts in expression suppression.
| {'timestamp': '2018-10-08T02:01:36', 'yymm': '1810', 'arxiv_id': '1810.02401', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02401'} | arxiv |
\subsubsection*{\bibname}}
\input{own_commands.tex}
\begin{document}
\twocolumn[
\aistatstitle{Generalizing the theory of cooperative inference}
\aistatsauthor{Pei Wang \And Pushpi Paranamana \And Patrick Shafto}
\aistatsaddress{Department of Mathematics \& Computer Science, Rutgers University---Newark } ]
\begin{abstract}
Cooperative information sharing is important to theories of human learning and has potential implications for machine learning.
Prior work derived conditions for achieving optimal Cooperative Inference given relatively restrictive assumptions.
We demonstrate convergence for any discrete joint distribution, robustness through equivalence classes and stability under perturbation, and effectiveness by deriving bounds from structural properties of the original joint distribution.
We provide geometric interpretations, connections to and implications for optimal transport and to importance sampling, and conclude by outlining open questions and challenges to realizing the promise of Cooperative Inference.
\end{abstract}
\input{main.tex}
\newpage
\input{supplement.tex}
\end{document}
\section{Introduction}
Cooperative information sharing is fundamental to human learning and finds applications in machine learning. The core idea of cooperation in human inference stems from work by Grice (Gricean Maxims; Grice, 1975)\nocite{grice1975logic} in linguistic pragmatics. Recent work in the linguistics literature has formalized the Rational Speech Act model \citep{frank2012predicting,goodman2013knowledge,Kao2014,lassiter2017adjectival}, which builds on earlier models of cooperative information sharing \citep{shafto2008teaching,Shafto2014,shafto2012learning}.
Indeed, these phenomena are not limited to language. Related models have been proposed to explain infants' learning from parents \citep{tomasello2009we,csibra2009natural,bonawitz2011double,shafto2012learning,buchsbaum2011children,gweon2014sins,shneidman2016learning,Eaves2016c},
learning from cooperative teachers \citep{shafto2008teaching,Shafto2014}, and how people decide who to trust \citep{shafto2012epistemic,Eaves2016c}.
This model is of interest for explaining human learning and communication, but it lacks overarching theory regarding when and why cooperation might facilitate learning and communication. Our paper is a step toward a general mathematical theory for this work.
Cooperative information sharing is of recent interest in machine learning. Explainability of machine learning models has been formalized in the Cooperative Inference (CI) framework \citep{yang2017explainable,vongbayesian}. There have also been several recent papers on learning from demonstrations that leverage cooperation in similar models \citep{ho2016showing,ho2018effectively}. Finally, cooperative inverse reinforcement learning is explicitly centered around CI
\citep{hadfield2016cooperative,fisac2017pragmatic}.
We make four contributions toward strengthening the overarching theory of Cooperative Inference.
(a)
Section~\ref{sec: rectangular} proves convergence of CI for any rectangular matrix, which ensures that CI applies to any discrete model.
(b) Cross ratio equivalence analysis in Section~\ref{sec:CR_eq} shows that the space of possible joint distributions is reducible to only working with distributions that differ in cross ratio(s). This provides a natural geometric structure over possible machine learning models, which is a highly general and very interesting direction for future work detailed in Section~\ref{sec:connections}.
(c)
Section~\ref{sec:sensitivity analysis} proves stability under perturbation which ensures robustness of inference where agents' beliefs differ. This shows that CI has the possibility of being viable in practice.
(d)
Section~\ref{sec:bounds} provides general bounds on effectiveness that are derived from structural properties of the initial matrix, $\mathbf{M}$.
Section~\ref{sec:connections} provides a geometric interpretation, and connects to optimal transport and importance sampling, and Section~\ref{sec:conclusion} conlcudes.
\section{Overview and Background}
All matrices in this paper are understood to be real, non-negative and have no zero rows or zero columns.
Matrices are in uppercase and their elements are in the corresponding lowercase.
These matrices can be thought as joint distributions of models throughout. In more detail, let $\mathcal H$ be a concept space and $\dataSpace$ be a data space. For a given matrix $\mathbf{M}$,
each column can be viewed as a concept in $\mathcal H$ and each row
can be viewed as a data in $\dataSpace$. Normalizing by dividing the sum of its entries, $\mathbf{M}$ can be turned into a conditional distribution over $\mathcal H$ or $\dataSpace$.
In this paper, we study the cooperative communication between a teacher and a learner.
Here, cooperation means that the teacher's selection of data depends on what the learner is likely to infer and vice versa.
The idea of \textit{cooperative inference} was introduced in \citep{YangYGWVS18}. We now briefly review their work.
\begin{definition}\label{def:CI}
For a fixed \textit{concept space} $\mathcal H$ and a \textit{data space} $\dataSpace$,
let $\PP{L_0}{\concept}$ be the learner's prior of a \textit{concept} $\concept$ among $\mathcal H$ and $\PP{T_0}{d}$ be the teacher's prior of selecting a \textit{data} $\data$ from $\dataSpace$.
The teacher's posterior of selecting $\data$ to convey $\concept$ is denoted by $\TT$ and the learner's posterior for $\concept$ given $\data$ is denoted by $\PP{L}{\concept\given d}$. \textbf{Cooperative inference} is a system shown below:
\begin{subequations}
\begin{align}
\PP{L}{\concept\given d} &= \frac{\TT \PP{L_0}{\concept}}{\PP{L}{d}},
\label{eq:L}\\
\TT &= \frac{\PP{L}{\concept\given d} \PP{T_0}{d}}{\PP{T}{\concept}},
\label{eq:T}
\end{align}
\label{eq:LT}
\end{subequations}
\noindent where $\PP{L}{d}$ and $\PP{T}{\concept}$ are the normalizing constants.
\end{definition}
Assuming uniform prior, \citep{YangYGWVS18} showed that Equation~\eqref{eq:LT} can be solved using
\textbf{Sinkhorn iteration}~(\textbf{SK} for short; \citep{Sinkhorn1967}). The solution (if it exists) depends only on the initial joint distribution matrix, $\mathbf{M}\,_{\size{\dataSpace} \times \size{\conceptSpace}}$, which defines the consistency between data and concepts.
\textbf{Sinkhorn iteration} is simply the repetition of row and column normalization of $\mathbf{M}\,$.
Denote the matrices obtained at the $k^\mathrm{th}$ row and column iteration of \eqref{eq:LT} by $\mathbf{L}^{k}$ and $\TTmat^{k}$, respectively. Let their limits (if they exist) be $\mathbf{L}:=\lim_{k\to\infty}\mathbf{L}^{k}$ and $\TTmat:=\lim_{k\to\infty}\TTmat^{k}$.
\begin{example}\label{eg:M}
Consider a joint distribution matrix
$\tiny{\mathbf{M}=
\begin{blockarray}{ccc}
&h_1 & h_2 \\
\begin{block}{c (cc)}
d_1 & 1 & 1 \\
d_2 & 0 & 1 \\
\end{block}
\end{blockarray}}$, where $m_{ij}=1$ if $d_i$ is consistent with $h_j$ and $m_{ij}=0$ otherwise, for $i,j=1,2$. \
The SK iteration proceeds as the following:
row normalization of $\mathbf{M}$ outputs: $\tiny\mathbf{L}^{1}= \begin{pmatrix}\frac{1}{2} & \frac{1}{2} \\ 0 & 1 \end{pmatrix}$,
column normalization of $\mathbf{L}^{1}$ outputs: $\tiny\TTmat^{1}= \begin{pmatrix}1 & \frac{1}{3} \\ 0 & \frac{2}{3} \end{pmatrix}$.
Iteratively, $\tiny\mathbf{L}^{k}= \begin{pmatrix}1-\frac{1}{2k} & \frac{1}{2k} \\ 0 & 1 \end{pmatrix}$,
$\tiny\TTmat^{k}= \begin{pmatrix}1 & \frac{1}{2k} \\ 0 & 1-\frac{1}{2k} \end{pmatrix}$, and the limits exist as $k\to \infty$:
$\tiny\mathbf{L}=\TTmat=\mathbf{M}^*=\begin{pmatrix}1 &0 \\ 0 & 1 \end{pmatrix}$.
For this $\mathbf{M}$, a teacher and a leaner who reason \textit{independently}
can not reliably convey $h_1$ using $\dataSpace$; $d_1$, the only data that is consistent with $h_1$ is also consistent with $h_2$.
However, a teacher and learner that assume \textit{cooperation} can perfectly convey $h_1$ using $d_1$; in the converged joint distribution $\mathbf{M}^*$, $d_1$ is consistent only with $h_1$.
Intuitively, a cooperative teacher will pick $d_2$ to teach $h_2$, because picking $d_1$ would cause confusion for the learner. Correspondingly, when receiving $d_1$, the cooperative leaner will reason that the teacher must intend to teach $h_1$, because otherwise he would pick $d_2$. In fact, the teaching between the cooperative pair is optimal, $\CI(\mathbf{M})=1$ (Definition~\ref{def:CIndex}).
\end{example}
The \textit{Cooperative index} quantifies the effectiveness of the cooperative communication.
It is the average probability that a concept in $\mathcal H$ can be correctly inferred by a learner given the teacher's selection of data.
\begin{definition}\label{def:CIndex}
Given $\mathbf{M}\,$ and assuming that SK iteration of \eqref{eq:LT} converges to a pair of matrices $\mathbf{L}=(l_{ij})$ and $\TTmat=(t_{ij})$, we define the \textbf{cooperative index} as
\[ \CI(\mathbf{M}\,) = \frac{1}{\size{\conceptSpace}} \mathbf{L} \odot \TTmat=\frac{1}{\size{\conceptSpace}} \sum_{j=1}^{\size{\conceptSpace}} \sum_{i=1}^{\size{\dataSpace}} l_{i,j} t_{i,j}.\]
\end{definition}
Here, $\mathbf{L} \odot \TTmat$ means the inner product between $\mathbf{L} $ and $ \TTmat$.
The definition implies that $\CI(\mathbf{M}\,)$ is invariant under row and column permutations of $\mathbf{M}$.
Next we define a few useful technical terms.
\begin{definition}\label{def:positive_diag}
Let $A=(a_{ij})$ be an $n\times n $ matrix and $S_n$ be the set of all permutations of $\{1, 2, \dots, n\}$.
For any $\sigma \in S_n$, the set of $n$-elements $\{a_{1\sigma(1)},\dots, a_{n,\sigma(n)} \}$ is called a \textbf{diagonal}
of $A$. If every $a_{k\sigma(k)}>0$, we say that the diagonal is \textbf{positive}.
An element $a_{i_0j_0}$ of $A$ is called \textbf{on-diagonal} if it is contained in a positive diagonal, otherwise $a_{i_0j_0}$ is called \textbf{off-diagonal}. In particular, $A$ may have a positive off-diagonal element.
We use $\overbar{A}$ to denote the matrix obtained from $A$ by setting all its off-diagonal elements into zeros.
If $A$ contains no positive off-diagonal element, i.e $A=\overbar{A}$, $A$ is said to have \textbf{total support}.
\end{definition}
\citep{YangYGWVS18} focused on the case when the data set and the hypotheses set have the same size. They showed that $0 \leq \CI(\mathbf{M}\,)\leq 1$ for any $\mathbf{M}$ (if $\CI(\mathbf{M})$ exists). In particular, when $\mathbf{M}$ is a square matrix, they showed that Equation~(\ref{eq:LT}) has a solution if and only if $\mathbf{M}$ has at least one diagonal and $\CI(\mathbf{M})$ is optimal if and only if $\mathbf{M}$ has exactly one positive diagonal.
\section{Convergence of rectangular matrices}\label{sec: rectangular}
It is typical that the sizes of a data set and a concept set are different. Therefore, considering only square models is too restrictive. We show that the solution of Equation~\eqref{eq:LT} can be obtained using SK iteration for any rectangular joint distribution $\mathbf{M}$. This implies that cooperative inference can be performed on any discrete model.
First, we study the format of the limit of SK iteration on rectangular matrices.
It is proven in \citep{sinkhorn1967concerning} that the limit (if exists) of SK iteration on a \textbf{square} $\mathbf{M}$ is a single doubly stochastic matrix $\mathbf{M}^*$, i.e. $\mathbf{L}=\TTmat=\mathbf{M}^*$. As the numbers of rows and columns are different in a \textbf{rectangular} $\mathbf{M}$, the limit of the SK iteration on $\mathbf{M}$ is a pair of distinct matrices $(\mathbf{L}, \TTmat)$, where, $\mathbf{L}$ is row normalized and $\TTmat$ is column normalized. Such a pair is called \textit{stable} defined below.
\begin{definition}\label{def:partial_pattern}
The \textbf{pattern} of a matrix $A$ is the set of entries where $a_{ij} > 0.$
Matrix $B$ is said to have a \textbf{partial pattern} of $A$, denoted by $B\prec A$, if $a_{ij}=0 \implies b_{ij}=0$.
\end{definition}
\begin{definition}\label{def:sk_stable}
A pair of $u\times v$-matrices $(P,Q)$ is called \textbf{stable} if column normalization of $P$ equals $Q$ and row normalization of $Q$ equals $P$. A matrix is \textit{stable} if it is contained in a \textit{stable} pair.
\end{definition}
\begin{remark}
If $(P,Q)$ is \textit{stable}, then $P$ and $Q$ are row and column normalized, respectively. \textit{$SK$ iteration} of $P$ (or $Q$) results a sequence alternating between $P$ and $Q$. Moreover, $P$ and $Q$ must have the same pattern.
\end{remark}
As mentioned above, the limit of SK iteration is doubly stochastic for a square $\mathbf{M}$.
The following proposition provides a similar analogy for the characteristics of the limit pair for rectangular $\mathbf{M}$.
\begin{prop}\label{prop:stable_format} \footnote{All proofs are included in the supplemental materials.}
Suppose that $(P,Q)$ is a \textbf{stable} pair of $u\times v$-matrices.
Then up to permutations, $P$ is a block-wise diagonal matrix
of the form $P=\mathrm{diag}(B_1, \dots, B_k)$\footnote{The corresponding statement holds for $Q$ too.}, where
each $B_i$ is row normalized and has a constant column sum denoted by $c_i$.
In particular, $c_i=u_i/v_i$, where $u_i\times v_i$ is the dimension of $B_i$, for $i\in \{1,\dots, k\}$.
\end{prop}
In addition to providing a convergence format for more general discrete joint distributions, the block diagonal form implies relations between subset of data and concepts that can be leveraged for developing structured models and joint distributions.
Let $(\mathbf{L}, \TTmat)$ be the limit pair of SK iteration on $\mathbf{M}$. $\mathbf{L}$ and $\TTmat$ must have the same partial pattern of $\mathbf{M}$ as the SK iteration preserves zeros.
Hence, the existence of a pair of \textit{stable} matrices with partial pattern of $\mathbf{M}$
is necessary for the convergence of SK.
In Proposition~\ref{EU}, we show that this condition is also sufficient.
\textit{Stable} matrices with partial pattern of $\mathbf{M}$ can be partially ordered with respect to their patterns.
We use $\overbar{\mathbf{M}}$ to denote the matrix obtained from $\mathbf{M}$ by setting elements outside the maximum partial pattern to zeros.
Note that elements outside the maximum partial pattern of a rectangular matrix shall be treated as off-diagonal elements in a square matrix.
\begin{prop} \label{EU}
A non-negative rectangular matrix $\mathbf{M}$ converges to a pair of \textit{stable} matrices
under SK iteration if and only if there exists a \textit{stable} pair of matrices with partial pattern of $\mathbf{M}$.
\end{prop}
\textit{Proof.} The `only if' direction is clear from the above discussion.
We now show the `if' direction.
Suppose there exists a \textit{stable} pair $(P,Q)$ such that $P\prec \mathbf{M}$.
Let $\{\mathbf{L}^1, \TTmat^1, \mathbf{L}^2, \TTmat^2, \dots\}$ be the sequence of matrices generated by SK iteration on $\mathbf{M}$, where $\mathbf{L}^k$ and $\TTmat^k$ are row and column normalized respectively.
This sequence is bounded since each element of $\mathbf{L}^k$ or $\TTmat^k$ is bounded above by $1$. Hence, according to Bolzano–Weierstrass theorem, the sequence must have as a limit a pair of matrices (may not be unique).
Let $(\mathbf{L}, \TTmat)$ and $(\mathbf{L}', \TTmat')$ be two pairs of such limits. To show that they are the same, we only need to
prove that $\mathbf{L}=\mathbf{L}'$. Lemma~\ref{limit_intermediate} and Remark~\ref{same_pattern} indicate that $\mathbf{L}$ and $\mathbf{L}'$ must have the maximum partial pattern of $\mathbf{M}$, hence, they have the same pattern. Moreover, because they are limits, $\mathbf{L}$ and $\mathbf{L}'$ are \textit{stable} as well. Therefore, it follows from Proposition~\ref{prop:stable_format} that up to permutations, $\mathbf{L}$ and $\mathbf{L}'$ have the same column sums.
Further, Lemma~\ref{lemma:diagonal_eq} implies that there exists
$X, Y$ and $X', Y'$ such that $\mathbf{L}=X \overbar{\mathbf{M}} Y$ and $\mathbf{L}'=X' \overbar{\mathbf{M}} Y'$. Therefore, $\mathbf{L}$ and $\mathbf{L}'$ not only have the same row and column sums, but also are diagonally equivalent. Thus, Lemma~\ref{lemma: diag_eq} implies that $\mathbf{L}=\mathbf{L}'$.
$\Box$
In fact, the existence of a stable pair of matrices with partial pattern of $\mathbf{M}$
is naturally satisfied for all $\mathbf{M}$ under considerations(non-negative matrices without zero rows or zero columns), thus:
\begin{prop}\label{prop:exist_sk_subpattern}
For any matrix $\mathbf{M}$,
there exists a \textit{stable} pair of matrices $(P,Q)$ such that $P$ and $Q$ have a partial pattern of $\mathbf{M}$.
\end{prop}
Construction of a such $(P,Q)$ is illustrated below.
\begin{example}\label{eg:subpattern}
Let $\tiny \mathbf{M}=\begin{pmatrix} m_{11}& m_{12} & m_{13}\\ m_{21} & m_{22}&m_{23} \end{pmatrix}$ be a matrix without zero row or zero column. The first two columns are both non-zero implies that up to permutation, either $m_{11}\neq0, m_{12}\neq 0$ or $m_{11}\neq0, m_{22}\neq 0$ . (1)~If $m_{11}\neq0, m_{22}\neq 0$, we may assume that $m_{23}\neq 0$ (up to permutation). In this case, let $\tiny A=\begin{pmatrix} 1& 0& 0\\ 0 & 1&1\end{pmatrix}$.
(2)~Otherwise $m_{11}\neq0, m_{12}\neq 0$. (2-A)~If further $m_{23}\neq 0$, let $\tiny A=\begin{pmatrix} 1& 1& 0\\ 0 & 0&1\end{pmatrix}$.
(2-B)~If $m_{23}= 0$, then $m_{13}\neq 0$. There must exist a non-zero element in the second row of $\mathbf{M}$. Up to permutation,
we may assume that $m_{21}\neq 0$, let $\tiny A=\begin{pmatrix} 0& 1& 1\\ 1 & 0&0\end{pmatrix}$.
In all cases, $A\prec \mathbf{M}$ is block-wise diagonal with each block in the form of a row or column vector.
Let $P,Q$ be row and column normalization of $A$ respectively.
It is straightforward to check that $(P,Q)$ is \textit{stable}.
\end{example}
Propositions~\ref{EU} and \ref{prop:exist_sk_subpattern} together imply our main result:
\begin{thm}\label{main}
Every rectangular matrix converges to a pair of stable matrices under SK iteration.
\end{thm}
\begin{remark}\label{rmk:diff_scalar_SK}
Theorem~\ref{main} is different from the classical convergence result for \textit{scalar Sinkhorn iteration} \citep{menon1969spectrum}.
Let $\mathbf{M}$ be a $u\times v$-matrix, $\mathbf{r}=(r_1, \dots, r_u)^T$ be column vector and $\mathbf{c}=(c_1, \dots, c_v)$ row vector. Similarly to the (regular) SK iteration, scalar SK iteration also alternates between row and column normalizing steps.
However in each step of scalar SK, row-$i$ (column-$j$) is normalized to have sum $r_i$ (sum $c_j$) instead of $1$.
The convergence~\footnote{Here convergence means the sequence generated by the iterative process converges to a single matrix.} of scalar SK on a given tuple $(\mathbf{M}, \mathbf{r}, \mathbf{c})$ has been intensively studied.
A complete summary of equivalent convergence criteria are described in \citep{idel2016review}.
Unfortunately, we can not simply apply these existing results:
(1) Normalizing with respect to $\mathbf{r}$ and $\mathbf{c}$ has no statistical basis for our setting.
(2) The convergence criteria are hard to verify.
(3) For a given model, the teacher's data selection matrix needs not to be the same as the learner's concepts inferring matrix.
\end{remark}
\begin{cor}\label{cor:M_barM_SKsame}
SK iteration of $\mathbf{M}$ and $\overbar{\mathbf{M}}$ converge to the same limit. Therefore, $CI(\mathbf{M})=CI(\overbar{\mathbf{M}})$.
\end{cor}
\begin{remark}\label{rmk:finite_step}
Corollary~\ref{cor:M_barM_SKsame} indicates that the elements outside the maximum partial pattern of $\mathbf{M}$ have no effect on the limit, and thus on \textit{Cooperative Index}. For instance, in square matrices, such elements are precisely positive off diagonal entries. They are easy to detect using ideas from graph theory \citep{dulmage1958coverings}.
Being able to pass to the maximal partial pattern
makes the cooperative inference much more feasible. The convergence of $\overbar \mathbf{M}$ is linear, where as the convergence of $\mathbf{M}$ slower \citep{soules1991rate}.
\end{remark}
In the rest of this paper, we assume $\mathbf{M}$ is square. With machinery developed in this section, similar analysis can be made for rectangular matrices.
\section{Equivalence and sensitivity}\label{sec:cr_sn}
We first introduce cross ratio equivalence and show that models whose joint distribution matrices are cross ratio equivalent, are the same under cooperative inference. Further, we will show that cooperative inference on models is robust to small perturbations on the joint distribution matrix $\mathbf{M}$.
These features are essential because in most realistic situations we only have access to noisy data points, and because they provide flexibility in model choice by allowing selection of any joint distribution in a cross ratio equivalent class.
\subsection{Cross Ratio Equivalence}\label{sec:CR_eq}
Intuitively, given a model, SK iteration is a process that selects a representation for two cooperative agents.
We develop a method to characterize the models that yield to the same representation.
SK iteration can be interpreted as a map between the initial and the limit matrices.
Let $\A$ be the set of $n\times n$ matrices that has at least one positive diagonal, $\overbar{\A}\subset \A$ be the set of $n\times n$ matrices with \textit{total support} (Definition~\ref{def:positive_diag}) and $\mathcal{B}$ be the set of $n\times n$ doubly stochastic matrices. According to \citep{sinkhorn1967concerning}, SK iteration of any $\mathbf{M}\in \A$ converges to a unique matrix $\mathbf{M}^*\in \mathcal{B}$. Hence SK iteration can be viewed as a map $\Phi$ from $\A$ to $\mathcal{B}$ where $\Phi(\mathbf{M})=\mathbf{M}^*$.
It is important to note that $\Phi$ is not injective. For instance, in Example~\ref{eg:off_diag*} below, with any choices of $m_{12}$ and $m_{32}$, $\mathbf{M}$ maps to the same image under $\Phi$. For a matrix $\mathbf{L}\in \mathcal{B}$, $\Phi^{-1}(\mathbf{L})$ is used to denote the set of all matrices in $\A$ that map to $\mathbf{L}$.
We will now introduce the notion-\textit{cross ratio equivalence} between square matrices and
show that the preimage set of a matrix $\mathbf{L}\in \mathcal{B}$ can be completely characterized by its \textit{cross ratios}.
\begin{definition}\label{def:cross ratios}
Let $A, B$ be two $n\times n$ matrices and $D^A_1=\{a_{1,\sigma(1)},\dots, a_{n, \sigma(n)}\}$ and $D^A_2=\{a_{1,\sigma'(1)},\dots, a_{n, \sigma'(n)}\}$ be two positive diagonals of $A$ determined by permutations $\sigma, \sigma'\in S_n$ (Definition~\ref{def:positive_diag}).
Denote the products of elements on $D^A_1$ and $D^A_2$ by $d^A_1=\Pi_{i=1}^{n}a_{i, \sigma(i)}, d^A_2=\Pi_{i=1}^{n}a_{i, \sigma'(i)}$ respectively. Then $\CR(D^A_1, D^A_2)=d^A_1/d^A_2$ is called the \textbf{cross ratio} between $D^A_1$ and $D^A_2$ of $A$. Further, let the diagonals in $B$ determined by the same $\sigma$ and $\sigma'$ be
$D^B_1=\{b_{1,\sigma(1)},\dots, b_{n, \sigma(n)}\}$ and $D^B_2=\{b_{1,\sigma'(1)},\dots, b_{n, \sigma'(n)}\}$. We say $A$ is \textbf{cross ratio equivalent} to $B$, denoted by $A\overset{cr}{\sim} B$, if $d_i^A\neq 0 \Longleftrightarrow d_i^B\neq 0$
and $\CR(D^A_1, D^A_2)=\CR(D^B_1, D^B_2)$ holds for
any $D^A_1$ and $D^A_2$.
\end{definition}
\begin{example}
Let $\tiny A=\begin{pmatrix} 3 & 2 & 1\\ 0 & 1&1\\1&0&1 \end{pmatrix},
B=\begin{pmatrix}9 & 20 & 6\\ 0 & 5&3\\2&0&4 \end{pmatrix}$.
$A$ has three positive diagonals $D^A_1=\{a_{11}, a_{22}, a_{33}\}$, $D^A_2=\{a_{12}, a_{23}, a_{31}\}$ and
$D^A_3=\{a_{13}, a_{22}, a_{31}\}$ with $d^A_1=3, d^A_2=2,d^A_3=1$. $B$ has three corresponding positive
diagonals $D^B_1, D^B_2$ and $D^B_3$ with $d^B_1=180, d^B_2=120,d^B_3=60$.
It is easy to check that $\CR(D^A_i,D^A_j)=\CR(D^B_i,D^B_j)$ for any $i,j\in \{1,2,3\}$.
Hence $A$ is \textit{cross ratio equivalent} to $B$.
\end{example}
\begin{remark}
(1) Definition~\ref{def:cross ratios} implies that if $A\overset{cr}{\sim} B$, then $\overbar{A}$ and $\overbar{B}$ (Definition~\ref{def:positive_diag})
must have the same pattern. Otherwise there exists a positive diagonal $D_1^A$ of $A$ (or B) whose corresponding diagonal $D_1^B$ in B (or A) contains zero ($d^A_1\neq 0$ whereas $d^B_1=0$).
\newline
(2)
Let $A$ and $B$ be matrices with the same pattern.
Assume they both have $N_d$ positive diagonals.
To determine whether $A$ is \textit{cross ratio equivalent} to $B$, instead of examining $\binom{N_d}{2}$ pairs of cross ratios, it is sufficient to check whether $CR(D^A_1, D^A_i)=CR(D^B_1, D^B_i)$, $i\in \{1, \dots, N_d\}$ holds for a fixed positive diagonal $D^A_1$.
\end{remark}
\begin{prop}\label{prop:preimage}
Let $\mathbf{M}\in A$ be a consistency matrix and $\mathbf{L}\in \mathcal{B}$ be a doubly stochastic matrix.
Then $\mathbf{M} \in \Phi^{-1}(\mathbf{L})$ if and only if $\mathbf{M}$ is \textit{cross ratio equivalent} to $\mathbf{L}$.
\end{prop}
\textit{Sketch of proof.}
Let $\mathbf{M} \in \Phi^{-1}(\mathbf{L})$, we now show they have the same cross ratios.
Since $\mathbf{M}$ and $\overbar{\mathbf{M}}$ have exactly the same positive diagonals, we may assume that $\mathbf{M}$ has total support.
Hence, \citep{sinkhorn1967concerning} implies that
there exist diagonal matrices $X=\mathrm{diag}(x_1, \dots, x_n)$ and $Y=\mathrm{diag}(y_1, \dots, y_n)$ such that $\mathbf{M}=X \mathbf{L} Y$.
In particular, $m_{ij}=x_i\times l_{ij} \times y_j$ holds, for any element $m_{ij}$.
Let $D^{\mathbf{M}}_1=\{m_{i,\sigma(i)}\}$, $D^{\mathbf{M}}_2=\{m_{i,\sigma'(i)}\}$
be two positive diagonals of $\mathbf{M}$ and $D^{\mathbf{L}}_1=\{l_{i,\sigma(i)}\}$, $D^{\mathbf{L}}_2=\{l_{i,\sigma'(i)}\}$ be the corresponding positive diagonals in $\mathbf{L}$. Then:
\begin{equation*}\label{eq:same_cr}
\footnotesize
\begin{split}
CR(D^{\mathbf{M}}_1,D^{\mathbf{M}}_2)& =\frac{\Pi_{i=1}^{n}m_{i,\sigma(i)}}{\Pi_{i=1}^{n}m_{i,\sigma'(i)}}
=\frac{\Pi_{i=1}^{n}x_i\times l_{i,\sigma(i)} \times y_{\sigma(i)}}{\Pi_{i=1}^{n} x_i\times l_{i,\sigma'(i)}\times y_{\sigma'(i)}}\\
& = \frac{\Pi_{i=1}^{n}x_i\times \Pi_{i=1}^{n} l_{i,\sigma(i)} \times \Pi_{i=1}^{n} y_{\sigma(i)}}{\Pi_{i=1}^{n} x_i\times \Pi_{i=1}^{n} l_{i,\sigma'(i)}\times \Pi_{i=1}^{n} y_{\sigma'(i)}}\\
&=\frac{\Pi_{i=1}^{n}l_{i,\sigma(i)}}{\Pi_{i=1}^{n}l_{i,\sigma'(i)}}=CR(D^{\mathbf{L}}_1,D^{\mathbf{L}}_2) \hspace{0.5in} \Box
\end{split}
\end{equation*}
\begin{cor}\label{cor:total_support}
For $\mathbf{M}_1, \mathbf{M}_2 \in \A$, if $\mathbf{M}_1\overset{cr}{\sim} \mathbf{M}_2$ then $\CI(\mathbf{M}_1)=\CI(\mathbf{M}_2)$.
\end{cor}
Proposition~\ref{prop:preimage} captures the key ingredient, \textit{cross ratios}, of a model.
It indicates that cross ratio equivalent models can be treated the same for cooperative agents.
Corollary~\ref{cor:total_support} implies that their cooperative indices are the same and hence they have the same communication effectiveness. This can be very useful in practice: (1) Models with same representation can be effectively categorized, which avoids unnecessary implementation of similar models;
(2) Models can be freely modified as long as the cross ratios are preserved which may increase computational efficiency.
\subsection{Sensitivity Analysis}\label{sec:sensitivity analysis}
We now investigate sensitivity of $\Phi$ to perturbation of $\mathbf{M}$.
Without loss of generality, we will assume that only one element in $\mathbf{M}$ is perturbed at a time as other perturbations may be treated as compositions of such.
Let $\mathbf{M}^{\epsilon}=(m^{\epsilon}_{ij})$ be a matrix obtained by varying the element $m_{st}$ of $\mathbf{M}=(m_{ij})$ by $\epsilon$, i.e.
$m^{\epsilon}_{st}=m_{st}+\epsilon $ and $m_{ij}=m^{\epsilon}_{ij}$ for $(i,j)\neq (s,t)$.
We may also assume that $\epsilon>0$. Otherwise we may view $\mathbf{M}$ as a matrix obtained from a positive perturbation on $\mathbf{M}^{\epsilon}$.
Proposition~\ref{prop:preimage} indicates that $\Phi$ is robust to any amount of perturbation on \textit{off diagonal} elements.
In more detail, suppose that both $m^{\epsilon}_{st}$ and $m_{st}$ are off diagonal elements of $\mathbf{M}^{\epsilon}$ and $\mathbf{M}$ respectively.
Then $\overbar{\mathbf{M}}=\overbar{\mathbf{M}}^{\epsilon}$ $\implies$ $\Phi(\mathbf{M})=\Phi(\overbar{\mathbf{M}})=\Phi(\overbar{\mathbf{M}}^{\epsilon})=\Phi(\mathbf{M}^{\epsilon})$ $\implies$ $\CI(\mathbf{M})=\CI(\mathbf{M}^{\epsilon})$. Thus we have:
\begin{prop}\label{prop:robust_off_diag}
Cooperative Inference is robust to any amount of off diagonal perturbations on $\mathbf{M}$.
\end{prop}
\begin{example}\label{eg:off_diag*}
Let $\tiny{\mathbf{M}=
\begin{blockarray}{cccc}
&h_1 & h_2 & h_3 \\
\begin{block}{c (ccc)}
d_1 & 1 & * &1\\
d_2 & 0 &1 & 0\\
d_3 & 1 & * &1\\ \end{block} \end{blockarray}}$ be a consistency matrix.
Suppose that the consistency between $d_1, d_3$ and $h_2$ can not be properly measured.
With Proposition~\ref{prop:robust_off_diag}, $\CI(\mathbf{M})$ can still be easily obtained:
$\tiny \overbar{\mathbf{M}}=\begin{pmatrix} 1 & 0 & 1\\ 0 & 1&0\\1&0&1 \end{pmatrix}$ converges to
$\tiny \overbar{\mathbf{M}}^*=\begin{pmatrix} 0.5& 0 & 0.5\\ 0 & 1&0\\0.5 &0&0.5 \end{pmatrix}$ in one step of SK iteration.
So we have that $\CI(\mathbf{M})=\CI(\overbar{\mathbf{M}})=(4\times 0.5^2+1^2)/3=2/3$.
\end{example}
Proposition~\ref{prop:robust_off_diag} is not only important for sensitivity analysis, but also practical to efficiently perform cooperative inference as mentioned in Remark~\ref{rmk:finite_step}.
For instance, if one $*$ in Example~\ref{eg:off_diag*} is positive, it takes infinite many steps of SK iteration for $\mathbf{M}$ to reach its limit, whereas it takes only one step for~$\overbar{\mathbf{M}}$.
Proposition~\ref{prop:robust_off_diag} also implies the main theorem in \citep{YangYGWVS18} stating $\CI(\mathbf{M})$ is optimal if $\mathbf{M}$ is a permutation of a triangular matrix. For an $n\times n$ \textit{triangular} matrix $\mathbf{M}=(m_{ij})$, all the elements except $m_{i,i}$ are off diagonal.
To efficiently apply cooperative inference, one only needs to consider $\overbar{\mathbf{M}}=\mathrm{diag}(m_{11},\dots, m_{nn})$. SK iteration on $\overbar{\mathbf{M}}$ converges to $I_n=\mathrm{diag}(1,\dots, 1)$ in one step. Therefore, we have $\CI(\mathbf{M})=1$.
By analogy, Corollary~\ref{cor:M_barM_SKsame} implies that CI is robust to any perturbation on elements that are off maximal partial pattern for \textit{rectangular} matrices as well.
Perturbations for \textit{on-diagonal} elements are more complicated and interesting.
To obtain $\mathbf{M}^{\epsilon}$, one may either perturb an on-diagonal element of $\mathbf{M}$ or perturb a zero element of $\mathbf{M}$ introducing a new diagonal(s) for $\mathbf{M}^{\epsilon}$ .
A celebrated result in \citep{sinkhorn1972continuous} shows that $\Phi:\A\to \mathcal{B}$ is a continuous function:
\begin{thm}[Continuity of SK iteration]\label{thm:continous_sk}
$\Phi(\mathbf{M}^{\epsilon})$ converges to $\Phi(\mathbf{M})$ as $\mathbf{M}^{\epsilon}\to \mathbf{M}$.
\end{thm}
Here, distance between matrices are measured by the maximum element-wise difference, e.g. $d(\mathbf{M}, \mathbf{M}^{\epsilon})=\epsilon$.
This implies that small on-diagonal perturbations on a model with joint distribution $\mathbf{M}$, yield close solutions for cooperative inference.
\begin{example}\label{eg:on_diag_epsilon}
Let $\tiny \mathbf{M}=\begin{pmatrix} 1 & 1 &0\\0& 1&1\\1&0&1 \end{pmatrix}$, $\tiny\mathbf{M}^{\epsilon_1}=\begin{pmatrix} 1.5 & 1&0 \\0& 1&1\\1&0&1 \end{pmatrix}$, $\tiny\mathbf{M}^{\epsilon_2}=\begin{pmatrix} 1.1 & 1&0 \\0& 1&1\\1&0&1 \end{pmatrix}$, $\tiny\mathbf{M}^{\epsilon_3}=\begin{pmatrix} 1 & 1&0.1 \\0& 1&1\\1&0&1 \end{pmatrix}$ and
$\tiny\mathbf{M}^{\epsilon_4}=\begin{pmatrix} 1 & 1&0.5 \\0& 1&1\\1&0&1 \end{pmatrix}$. Apply SK iterations on $\mathbf{M}$ and $ \mathbf{M}^{\epsilon_i}$, we have:
$\tiny\Phi(\mathbf{M})=\begin{pmatrix} 0.5 & 0.5 &0\\0& 0.5&0.5\\0.5&0&0.5 \end{pmatrix}$,
$\tiny\Phi(\mathbf{M}^{\epsilon_1})=\begin{pmatrix} 0.534 & 0.466&0 \\0& 0.534&0.466\\0.466&0&0.534 \end{pmatrix}$,
$\tiny\Phi(\mathbf{M}^{\epsilon_2})=\begin{pmatrix} 0.508 & 0.492&0 \\0& 0.508&0.492\\0.492&0&0.508 \end{pmatrix}$,
$\tiny\Phi(\mathbf{M}^{\epsilon_3})=\begin{pmatrix} 0.478& 0.478& 0.044 \\0& 0.522 8&0.478\\0.522,&0&0.478 \end{pmatrix}$,
$\tiny\Phi(\mathbf{M}^{\epsilon_4})=\begin{pmatrix} 0.423& 0.423& 0.155 \\0 & 0.577& 0.423\\0.577& 0& 0.423 \end{pmatrix}$.
It is clear that for perturbations on the same location, the variation on the limit matrix decreases as the size of the perturbation gets smaller. Moreover, perturbations of the same size cause different variations on the limits depending on whether a new diagonal is introduced. For instance, $\mathbf{M}^{\epsilon_4}$ introduces a new diagonal to $\mathbf{M}$ whereas $\mathbf{M}^{\epsilon_2}$ does not.
Although both are $0.5$ away from $\mathbf{M}$,
after SK iteration
$d(\Phi(\mathbf{M}),\Phi(\mathbf{M}^{\epsilon_2}))=0.034$ and $d(\Phi(\mathbf{M}),\Phi(\mathbf{M}^{\epsilon_4}))=0.155$.
\end{example}
In the following example, we illustrate how one may effectively bound the variation in the limit in terms of~$\epsilon$, even for perturbations that introduce new diagonals. However, in general, $\Phi$ is not Lipschitz \footnote{The authors would like to thank Yue Yu for pointing out counterexamples.}.
\begin{example}\label{eg:new_diag_epsilon}
Let $\tiny \mathbf{M}=\begin{pmatrix} a_{11} & a_{12} &0\\0& a_{22}&a_{23}\\a_{31}&0&a_{33} \end{pmatrix}$ and $\tiny\mathbf{M}^{\epsilon}=\begin{pmatrix} a_{11} & a_{12} &\epsilon \\0& a_{22}&a_{23}\\a_{31}&0&a_{33} \end{pmatrix}$.
While $\mathbf{M}$ has only two diagonals $D_1$ and $D_2$ with products of elements $d_1=a_{11}a_{22}a_{33}$ and $d_2=a_{12}a_{23}a_{31}$,
the perturbation introduces one more diagonal $D_3$ with $d_3=\epsilon\cdot a_{22}a_{31}$ to $\mathbf{M}^{\epsilon}$.
The Birkhoff-von Neumann theorem (Theorem~\ref{thm:BN}) guarantees that
doubly stochastic matrices $\Phi(\mathbf{M})$ and $\Phi(\mathbf{M}^{\epsilon})$ can be written as \textit{convex combinations} of permutation matrices as shown below:
$\tiny \Phi(\mathbf{M})=\theta_1\begin{pmatrix}1 & 0 &0\\0& 1&0\\0&0&1 \end{pmatrix}+\theta_2\begin{pmatrix}0 & 1 &0\\0& 0&1\\1&0&0 \end{pmatrix}=\begin{pmatrix} \theta_1 & \theta_2 &0\\0& \theta_1&\theta_2\\\theta_2&0&\theta_1 \end{pmatrix} $
\begin{equation*}
\begin{split}
\Phi(\mathbf{M}^{\epsilon})&=\alpha_1 \tiny{\begin{pmatrix} 1 & 0 &0\\0& 1&0\\0&0&1 \end{pmatrix}}+\alpha_2\begin{pmatrix}0 & 1 &0\\0& 0&1\\1&0&0 \end{pmatrix}+\alpha_3\begin{pmatrix} 0& 0 &1\\0& 1&0\\1&0&0 \end{pmatrix} \\
&= \scriptsize{\begin{pmatrix}\alpha_1 & \alpha_2 &\alpha_3\\0& \alpha_1+\alpha_3&\alpha_2\\\alpha_2+\alpha_3&0&\alpha_1 \end{pmatrix}},\\
\end{split}
\end{equation*}
where $\theta_1+\theta_2=1, \alpha_1+\alpha_2+\alpha_3=1$ and $\theta_i, \alpha_j>0$.
Notice that the variation between $\Phi(\mathbf{M})$ and $\Phi(\mathbf{M}^{\epsilon})$ is caused by $\alpha_3$,
we will now derive an upper bound for $\alpha_3$.
Since $\Phi$ preserves cross ratios, evaluating a cross ratio, for example $\CR(D_3, D_1)$, in both $\Phi(\mathbf{M}^{\epsilon})$ and $\mathbf{M}^{\epsilon}$
we have that:
\begin{equation}\label{eq:cr_Me}
\footnotesize{\frac{\alpha_3(\alpha_2+\alpha_3)}{\alpha^2_1}=\frac{d_3}{d_1}=\epsilon\cdot \frac{a_{22}a_{31}}{a_{11}a_{22}a_{33}}:=\epsilon\cdot A_1}
\end{equation}
Since $\alpha_1+\alpha_2+\alpha_3=1$, we may assume that $\small{\alpha_1<1/2}$
Substituting $\small {\alpha_2+\alpha_3=1-\alpha_1}$ into Equation~\eqref{eq:cr_Me}, we get $\frac{\alpha_3(1-\alpha_1)}{\alpha^{2}_1}=\epsilon\cdot A_1$ and this implies that:
\begin{equation*}\label{eq:alpha_3}
\footnotesize \alpha_3=\epsilon\cdot A_1\cdot \frac{\alpha^{2}_1}{1-\alpha_1}\leq \epsilon\cdot A_1 \cdot \frac{1}{2}\,,
\end{equation*}
where the last `$\leq$' holds because $\frac{\alpha^{2}_1}{1-\alpha_1}$ reaches its maximum at $\alpha_1=\frac{1}{2}$ for $\alpha_1<\frac{1}{2}$. Thus, $\alpha_3$ is bounded above by a constant multiple of $\epsilon$.
\end{example}
The next proposition explores how sensitive $\Phi$ is to perturbations on its images. Thus, given two doubly stochastic matrices in $\mathcal{B}$, we will measure the distance between their preimages under $\Phi$.
\begin{prop}\label{prop:dist_preimage}
Let $\mathbf{L}^1, \mathbf{L}^2\in \mathcal{B}$. If $d(\mathbf{L}^1, \mathbf{L}^2) \leq \epsilon$, for any $\mathbf{M}^1\in \Phi_n^{-1}(\mathbf{L}^1)$ with total support, there exist a $\mathbf{M}^2\in \Phi_n^{-1}(\mathbf{L}^2)$ and a constant $C$ such that $d(\mathbf{M}^1, \mathbf{M}^2)\leq C\cdot \epsilon$.
\end{prop}
In fact, restricting to matrices with total support, $\Phi$ can be amended into a homeomorphism (see Supplemental Materials).
Viewing SK iteration as a representation selecting process,
the homeomorphic property of $\Phi$ indicates that such process preserves important information needed to reconstruct the original model.
\section{Lower Bound for CI}\label{sec:bounds}
\textit{Cooperative Index} measures the effectiveness of the cooperative communication. However, for a given consistency matrix $\mathbf{M}$, in order to calculate $\CI(\mathbf{M})$ one needs to obtain $\Phi(\mathbf{M})$ by \textit{SK iterations}, which sometimes can be an expensive process.
We provide bounds on $\CI(\mathbf{M})$ that do not require computing SK.
First, we derive a uniform bound for $\CI(\mathbf{M})$ which only depends on the size of $\mathbf{M}$.
\begin{prop}
For an $n \times n$ matrix $\mathbf{M}$, $\displaystyle \CI(\mathbf{M})\geq\frac{1}{n}$ with the equality when $\mathbf{M}$ is uniformly distributed.
\end{prop}
\textit{Proof.}
Let $\mathbf{M}^*=\left(m^*_{ij}\right)_{n\times n}$ be the limit of $\mathbf{M}$ under SK iteration.
By Generalized Mean Inequality, we have $\left(\frac{\sum_{ij} m^*_{ij}}{n^2}\right)^2\leq \frac{\sum_{ij} (m^*_{ij})^2}{n^2}$. Since $\mathbf{M}^*$ is doubly stochastic, we have $\sum_{ij} m^*_{ij}=n$ and it follows that $\sum (m^*_{ij})^2 \geq 1$. Therefore, $\CI(\mathbf{M})=\frac{\sum (m^*_{ij})^2}{n} \geq \frac{1}{n}$. $\Box$
Notice that, as the size of $\mathbf{M}$ increases the above bound is not effective. However, the number of positive diagonals a matrix consists can be small regardless of its size. Next, we provide another lower bound for $\CI(\mathbf{M})$ that depends only on the number of positive diagonals.
\begin{prop}\label{no.of_diag}
For an $n\times n$ matrix $\mathbf{M}$ with $d$ positive diagonals, $\displaystyle \CI(\mathbf{M})\geq 1/d$.
\end{prop}
\textit{Proof.}
Since $\mathbf{M}$ is a square matrix, the limit of SK iteration is a unique doubly stochastic matrix $\mathbf{M}^*$.
Therefore, by Birkhoff-von Neumann theorem
$\mathbf{M}^*=\sum_{i=1}^{d} \theta_iP_i$ and by Definition~\ref{def:CIndex} we have:
\begin{align*}
\mbox{CI}(\mathbf{M}) &=\frac{1}{n} \mathbf{M}^*\odot \mathbf{M}^* = \frac{1}{n} \left(\sum_{i=1}^{d} \theta_iP_i\right)\odot \left(\sum_{i=1}^{d} \theta_iP_i\right)\\
& \geq \frac{1}{n} \sum_i^d \theta_iP_i \odot \theta_iP_i
\overset{(1)}{=}\sum_i^d \theta_i^2
\overset{(2)}{\geq} \frac{1}{d}
\end{align*}
Equality~(1) holds because each $P_i$ is a permutation matrix and so $P_i\odot P_i=n$.
Inequality~(2) is obtained from Generalized Mean Inequality as $\sum_{i=1}^{d}\theta_{i}=1$. $\Box$
Such a bound makes sense because $\CI$ measures the effectiveness of the cooperative communication.
Each diagonal is a representation for communication. $\CI(\mathbf{M})$ decreases as the number of diagonals increases.
The optimal $\CI(\mathbf{M})$ is achieved when $\mathbf{M}$ has only one diagonal, i.e.$\mathbf{M}$ is upper triangular up to permutation.
\begin{example}
Consider
$\mathbf{M}$ in Example~\ref{eg:off_diag*}. We have $n=3, d=2$ and
$\CI(\mathbf{M})=\left(0.5^2\times 4+1\right)/3=2/3>1/2=1/d >1/3=1/n$.
\end{example}
Above example shows that when the number of diagonals is small, Proposition~\ref{no.of_diag} provides a good bound. However, counting the number of diagonals of an $n\times n$ matrix can also be computationally expensive.
Next, we provide a much more accessible bound.
\begin{definition}
An $n \times n$ matrix $A$ is \textbf{indecomposable} if there exists no permutation matrices $P$ and $Q$ such that $\tiny PAQ= \begin{pmatrix}
A_{11} & 0\\
A_{21} & A_{22}
\end{pmatrix}$ where, $A_{11}$ and $A_{22}$ are square submatrices.
\end{definition}
\begin{prop}\label{pos_ele}
For any $n \times n$ matrix $\mathbf{M}$, $\CI(\mathbf{M})\geq \frac{1}{\eta-2n+\tau+1}$, where $\eta$ is the number of positive elements and $\tau$ is the number of indecomposable components.
\end{prop}
\textit{Proof.} Let $\mathbf{M}^*$ be the SK limit of $\mathbf{M}$ and $\eta^*$ and $\tau^*$ be the number of positive elements and the number of indecomposable components in $\mathbf{M}^*$, respectively.
Then according to \citep{brualdi1982notes},
$\mathbf{M}^*$ has a Birkhoff-von Neumann decomposition with $k$ permutation matrices, where
$k \leq \eta^*+\tau^*-2n+1$. Further note that $\eta + \tau \leq \eta^*+\tau^*$.
Hence, similarly as in the proof of Proposition~\ref{no.of_diag},
we have that $\CI(\mathbf{M})=\CI(\mathbf{M}^*)\geq \frac{1}{k}\geq \frac{1}{\eta^*+\tau^*-2n+1} \geq \frac{1}{\eta+\tau-2n+1}$. $\Box$
\begin{example}Consider an $n\times n$ matrix $\mathbf{M}$ of the form
\begin{minipage}{0.3\linewidth}
\begin{tikzpicture}\tiny [baseline=(current bounding box.center)]
\matrix (m) [matrix of math nodes,nodes in empty cells,right delimiter={)},left delimiter={(} ]{
* & & & && & * \\
& & && & & \\
&& *& *& *& & \\
& & *& *& *&& \\
&& *& *& *&& \\
& & && & & \\
* & & & && & * \\
} ;
\draw[loosely dotted] (m-1-1)-- (m-3-3);
\draw[loosely dotted] (m-1-7)-- (m-3-5);
\draw[loosely dotted] (m-7-1)-- (m-5-3);
\draw[loosely dotted] (m-7-7)-- (m-5-5);
\end{tikzpicture}
\end{minipage}
\begin{minipage}{0.6\linewidth}
where, any * is a positive number and the rest are zeros. Notice that, it quickly becomes challenging to count $d$ when $n$ is large.
\end{minipage}
When $n=5$, we have $\eta=13, \tau=2, d=12$, and so $\CI(\mathbf{M})\geq 1/(\sigma +\tau -2n+1)=1/6>1/d$.
\end{example}
\section{Connections to other work}\label{sec:connections}
\textbf{Geometric interpretation.} Cooperative inference is intuitive given the geometric interpretation of SK iteration, which has
been long known and favored in the study of contingency tables \citep{fienberg1970iterative, borobia1998matrix}.
Each joint distribution matrix $\mathbf{M}=(m_{ij})$ of dimension $u\times v$ can be viewed as a point in the $(uv-1)$-dimension simplex,
$\mathcal{S}_{uv}=\small{\{(m_{11},\dots, m_{uv}):m_{ij}\geq 0, \sum_{ij} m_{ij}=1\}}$.
In \citep{fienberg1968geometry}, the author showed that, in $\mathcal{S}_{uv}$, positive\footnote{Every element is positive.} matrices
with the same cross-product ratios\footnote{Two matrices with the same cross-product ratios must be cross ratio equivalent (Definition~\ref{def:cross ratios}).} form a special case of determinantal manifold $\mathcal{H}$, which is studied in \citep{room1938geometry}.
In particular, for the $2\times 2$ case, authors of \citep{fienberg1970iterative} built a homeomorphic map from $\mathcal{H}$ to the unit square and illustrated the convergence path of successive SK iterations in the unit square.
Similarly, non-negative joint-distribution matrices with the same pattern locate on a lower-dimension face of $\mathcal{S}_{uv}$ and
matrices with the same cross ratios form a further subspace.
\textbf{Optimal transport.} Choosing a suitable distance to compare probabilities is a key problem in statistical machine learning. When the probability space is a metric space, optimal transport distances (earth mover’s in computer vision) define a powerful geometry to compare probabilities \citep{villani2008optimal}. Optimal transport distances are a fundamental family of distances for probability
measures and histograms of features. \citep{cuturi2013sinkhorn} proposed a new family
of optimal transport distances, \textbf{Sinkhorn distance}, that look at transport problems from a maximum entropy
perspective.
The resulting optimum is a proper distance
which can be computed through Sinkhorn’s matrix scaling.
Let $C$ be the cost matrix, $\mathbf{r}$ and $\mathbf{c}$ be the marginal distributions for a given optimal transport problem. The matrix $\mathbf{M}^*$ that optimizes the Sinkhorn distance can be obtained by applying $(\mathbf{r},\mathbf{c})$-scalar SK iteration on $\mathbf{M}=e^{-\lambda \cdot C}$, where $\lambda$ is the regularization parameter.
\cite{cuturi2013sinkhorn} proved that this Sinkhorn algorithm can be computed at a speed that is several orders of magnitude faster than that of transport solvers.
Optimal transport with Sinkhorn distance provides a powerful tool for domain adaptation.
\cite{courty2015optimal} proposed the following method: first link two domains based on prior knowledge (build an initial cost matrix $C$); then learn an optimal distribution matrix $\mathbf{M}^*$ (w.r.t, Sinkhorn distance) from one domain to the other by applying scalar SK iteration on
$\mathbf{M}=e^{-\lambda \cdot C}$. If certain transports should never happen, i.e. elements of $C$ are allowed to be $\infty$, then
the corresponding $\mathbf{M}$ will be a sparse matrix. Remark~\ref{rmk:diff_scalar_SK} notes that scalar SK iteration of a sparse $\mathbf{M}$ may not converge and the convergence criteria can not be easily verified.
Whereas, in the case that both domains have uniform marginal distributions,
Theorem~\ref{main} guarantees the existence of the optimal distribution matrix $\mathbf{M}^*$ for any choice of the cost matrix.
In the sparse case, the convergence rate can be further sped up by first identifying and removing off-diagonal elements, i.e. turning $\mathbf{M}$ into $\overbar{\mathbf{M}}$, then applying SK iteration on $\overbar{\mathbf{M}}$ as in Remark~\ref{rmk:finite_step}.
More importantly, our results in Section~\ref{sec:cr_sn} capture the essential features of the Sinkhorn distance approach.
Proposition~\ref{prop:preimage} implies that cost matrices that are cross ratio equivalent lead to the same optimal transport. Proposition~\ref{thm:continous_sk} indicates that optimal distribution matrix $\mathbf{M}^*$ is continuous to the choice of regularization parameter $\lambda$, which can be used to discretize the range of~$\lambda$.
\textbf{Importance Sampling} Cooperative inference can be interpreted as selection of optimal distributions for importance sampling.
A straightforward view is to consider Equation~\eqref{eq:LT}.
Given a joint distribution $\mathbf{M}$, let $\TTmat^1$ be the column normalization of $\mathbf{M}$.
The $ij^{\text{th}}$-element $P_{\TTmat^1}(d_i|h_j)$ of $\TTmat^1$ can be viewed as the teacher's initial probability of selecting $d_i$ to convey $h_j$. Once $d_i$ is observed, the learner needs to sample a concept to match $d_i$.
Assume that the learner's prior on $\mathcal H$ is uniform.
To minimize the variance, the learner should sample from the optimal distribution:
$P_{\mathbf{L}^1}(h_j|d_i)=\frac{P_{\TTmat^1}(d_i|h_j)}{\sum_{j}P_{\TTmat^1}(d_i|h_j)}$.
Thus the optimal learner's matrix $\mathbf{L}^1$ is the row normalization of $\TTmat^1$.
Similarly, based on $\mathbf{L}^1$, to reduce variance, the teacher should sample according to the matrix $\TTmat^2$, the column normalization of $\mathbf{L}^1$.
This alternating process is precisely SK iteration.
So, the solution of cooperative inference is not only the stable limit of a sequence of optimal distributions for individual $d$ and $h$, but also the only doubly stochastic matrix
cross ratio equivalent to $\mathbf{M}$.
A more subtle and interesting version of importance sampling is also achieved by cooperative inference.
Let $\mathbf{M}$ be an $n\times n$ joint distribution.
Suppose that the teacher aims to convey the whole set of $n$ concepts simultaneously.
To do so, the teacher must teach $n$ different data points at once---one data point per concept.
This is equivalent to picking a map from $\dataSpace$ to $\mathcal H$, i.e. a permutation $\sigma \in S_n$
as $|\dataSpace|=|\mathcal H|=n$.
Then $P_{T}(\dataSpace_{\sigma}|\mathcal H_T)=\Pi_{i} P_{T}(d_{\sigma(i)}|h_i)$ is the probability that the teacher picks $\sigma$
to teach and $P_{L}(\mathcal H_L|\dataSpace_{\sigma})=\Pi_{i} P_{L}(h_i|d_{\sigma(i)})$ is the probability that given $\sigma$, the learner's inference completely matches the teacher's intention.
Therefore, in order to efficiently estimate the communication accuracy, $P(\mathcal H_L|\mathcal H_T)=\sum_{\sigma\in S_n} P_{L}(\mathcal H_L|\dataSpace_{\sigma})P_{T}(\dataSpace_{\sigma}|\mathcal H_T)$,
one must sample permutations that make large positive contributions to the summation.
Such an importance sampling is attained by Cooperative inference for the following reasons.
(1) SK iteration completely removes the probability of sampling off-diagonal elements. Thus a $\sigma$
will be sampled only if it could lead to a prefect teaching.
(2) \cite{beichl1999approximating} proved that the limit of SK iteration
maximizes entropy for doubly stochastic matrices that have the same pattern as $\mathbf{M}$, and
further they showed that this is the ideal property for sampling positive diagonals.
\textbf{Other connections.} See supplemental materials for pointers to other connections.
\section{Conclusion}\label{sec:conclusion}
Cooperative inference holds promise as a theory of human-human, human-machine, and machine-machine information sharing. An impediment to realizing this promise is the lack of foundational results related to convergence, robustness, and effectiveness. We have addressed each of these limitations, including specific results showing the convergence of Cooperative Inference via SK iteration for any rectangular matrix, equivalence classes of models in terms of their cross-ratios, continuity of SK iteration which implies stability to perturbation, and several different bounds on the effectiveness of Cooperative Inference that can be derived from the original model. We also demonstrated connections and implications through geometric interpretations of Cooperative inference, optimal transport, and importance sampling. Important open questions include developing methods for modifying machine learning models to increase the efficacy and furthering our understanding of the representational implications of Cooperative Inference.
\noindent
\textbf{Acknowledgements}
This material is based on research sponsored by the Air Force Research Laboratory and DARPA under agreement number FA8750-17-2-0146. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon. This research was also supported by NSF SMA-1640816, and NSF NSF-1549981.
\newpage
\bibliographystyle{plainnat}
\section{Supplemental Material}\label{sec:Supp}
\begin{proof}[\textbf{Proof of Proposition~\ref{prop:stable_format}}]
Let the column sums of $P$ be $\mathcal{C}=\{c_1, \dots, c_v\}$ and row sums of $Q$ be $\mathcal{R}=\{r_1, \dots, r_u\}$.
$(P,Q)$ is a SK stable pair implies that column normalization of $P$ equals $Q$, i.e. if $q_{ij}>0$ then $q_{ij}=p_{ij}/c_j$, and further row normalization of $Q$ equals $P$, i.e. if $p_{ij}>0$ then $p_{ij}=q_{ij}/r_i$.
So we have that $p_{ij}=p_{ij}/(r_i\cdot c_j)$ $\implies r_i\cdot c_j=1$ (Claim~$(*)$).
Therefore $c_j\in \mathcal{C}$ $\implies$ $1/c_j\in \mathcal{R}$ and $r_i\in \mathcal{R}$ $\implies$ $1/r_i\in \mathcal{C}$. In particular, let $c_{max}=\max\{c_1, \dots, c_v\}$ and $r_{min}=\min\{r_1, \dots, r_u\}$.
We have that $c_{max}=1/r_{min}$.
With permutation, we may assume that the columns with sum $c_{max}$ in $P$ are the first $v_1$ columns and
the rows with sum $r_{min}$ in $Q$ are the first $u_1$ rows. Note that an element $p_{ij}$ in the first $v_1$ columns of $P$ is positive only if it is in the first $u_1$ rows. Otherwise assume that $p_{i_0j}>0$ for $i_0>u_1$, then Claim~$(*)$ implies that $c_j\cdot r_{i_0}=1$ $\implies$ $r_{i_0}=1/c_j=1/c_{max}=r_{min}$. This contradicts to $i_0>u_1$.
Similarly, we may show that an element $q_{ij}$ in the first $u_1$ rows of $Q$ is positive only if it is in the first $v_1$ columns. Further note that $Q$ and $P$ have the same pattern. So we have that for $i\leq u_1$, $p_{ij}>0$ only if $j\leq v_1$.
Therefore let $B_1$ be the submatrix of $P$ formed by the first $u_1$ rows and first $v_1$ columns and $P_1$ ($Q_1$) be the submatrix of $P$ ($Q$) formed by the last $u-u_1$ rows and the last $v-v_1$ columns. We just showed that $P=\mathrm{diag}\{B_1, P_1\}$ and the column sum $c_{max}$ of $B_1$ is a constant (equals $u_1/v_1$). $(P_1, Q_1)$ is a \textit{SK stable} pair with smaller dimension. Hence, inductively, the proposition holds.
\end{proof}
\begin{lemma}\label{limit_intermediate}
If a pair of matrices $(P, Q)$ as in Proposition \ref{EU} exists, the pattern of any pair of limit matrices $(\mathbf{L}^\prime, \TTmat^\prime$) is intermediate between the pattern of $(P, Q)$ and the pattern of $\mathbf{M}$, namely, $(P, Q) \prec (\mathbf{L}^\prime, \TTmat^\prime) \prec \mathbf{M}$.
\end{lemma}
\begin{proof}
Let the dimension of $\mathbf{M}$ be $u\times v $.
Denote the sequence of matrices generated by \textit{SK iteration} by $\{\mathbf{L}^n, \TTmat^n\}
(n>0)$, where $\mathbf{L}^n$ are row normalized and has column sums $\{c_{jn}\}_j$, and $\TTmat^n
$ are column normalized and has row sums $\{r_{in}\}_i$.
As explained in \cite{pretzel1980convergence},
there exist diagonal matrices $X_n$ and $Y_n$ such that $\mathbf{L}^n=X_n\mathbf{M} Y_n$ and $\TTmat^n=X_n\mathbf{M} Y_{n+1}$.
In particular, $X_n=\mathrm{diag}\{x_{1n}, \dots, x_{un}\}$ and $Y_n=\mathrm{diag}\{y_{1n}, \dots, y_{vn}\}$, where each
$x_{in}$ is the product of row normalizing constants (reciprocal of row sums) of row-$i$ from step $1$ to $n$ and
each $y_{jn}$ is the product of column normalizing constants (reciprocal of column sums) of column-$j$ from step $1$ to $n$.
Here, $Y_1$ is the identity matrix.
Denote the row sums of $Q$ by $\{r_i\}^{u}_{i=1}$
and the column sums of $P$ by $\{c_j\}^v_{j=1}$.
Consider the following functions, we will show that they form an increasing sequence(the use of it will be clear later).
$$f_n=\prod\limits^{u}_{i=1}x_{in}^{1+\alpha r_i}\prod\limits^{v}_{j=1}y_{jn}^{\alpha +c_j},$$
$$g_n=\prod\limits^u_{i=1}x_{in}^{1+\alpha r_i}\prod\limits^v_{j=1}y_{jn+1}^{\alpha+c_j},$$
where, $\alpha\geq -\dfrac{\log s}{\log r},$ with $s=\frac{1}{\prod\limits_{j}c_j^{c_j}}$ and $r=\left(\frac{v}{u}\right)^v$.
\begin{align}\label{eq:fg}
\dfrac{g_n}{f_n}
=\prod\limits^v_{j=1}\left(\frac{y_{jn+1}}{y_{jn}} \right)^{\alpha +c_j}
&=\prod\limits^v_{j=1}\left(\frac{1}{c_{jn}} \right)^{\alpha +c_j}\nonumber \\
&\geq \prod\limits^v_{j=1}\left(\frac{1}{c_{jn}} \right)^{c_j}
\prod\limits^v_{j=1}\left(\frac{1}{c_{jn}} \right)^{\alpha} \,.
\end{align}
Due to Lemma 1 of \cite{berry2007algorithms} we have, $\frac{1}{\prod\limits_{j}c_{jn}^{c_j}}\geq \frac{1}{\prod\limits_{j}c_j^{c_j}}=s$, i.e. the first product of the right hand side of Inequality~\eqref{eq:fg} is greater or equal to ~$s$.
Moreover, by arithmetic and geometric means inequality, $\left(\prod\limits_{j=1}^v c_{jn}\right)^\frac{1}{v}\leq \dfrac{\sum\limits^v_{j=1} c_{jn}}{v}=\dfrac{u}{v}.$
Hence,
$\prod\limits^v_{j=1}\dfrac{1}{c_{jn}} =r$.
Therefore $\dfrac{g_n}{f_n}\geq s r^{\alpha}\geq 1$, where the second inequality holds because of the choice of $\alpha.$
Hence we have $g_n\geq f_n.$
The analogous argument holds for $f_{n+1}/g_n$.
So, we have $f_{n+1}\geq g_n\geq f_n$ (Claim~$*$).
Now recall that $\mathbf{L}^n=X_n\mathbf{M} Y_n$. In particular, we have $l^n_{ij}=x_{in}m_{ij}y_{jn}$, for $m_{ij}\neq0$.
So $x_{in}y_{jn}=\frac{l^n_{ij}}{m_{ij}}$ and it is bounded above because
the elements $l^n_{ij}$ are bounded above by 1. One possible upper bound is $K=\frac{1}{ \min m_{ij}}$, where min is taken over non zero elements in $\mathbf{M}$.
Moreover, let $d_{ij}= p_{ij}+\alpha \,q_{ij}$, then
\begin{align*}
\prod \limits_{ij}\left(x_{in}y_{jn}\right)^{d_{ij}} &=
\prod \limits_{ij}\left(x_{in}y_{jn}\right)^{p_{ij}+\alpha \,q_{ij}} \\
&= \prod \limits_{i}x_{in}^{\sum_{j}p_{ij}+\alpha \,q_{ij}}
\prod \limits_{j}y_{jn}^{\sum_{i}p_{ij}+\alpha \,q_{ij}}\\
&= \prod \limits_{i}x_{in}^{1+\alpha\cdot r_i}\prod \limits_{j}y_{jn}^{\alpha+c_j}=f_n.
\end{align*}
Furthermore, if $d_{ij}\neq 0$, then $p_{ij}\neq 0 \implies m_{ij}\neq 0$ and hence $x_{in}y_{jn}\leq K$.
Therefore $f_n\leq K^d,$ where $d=\sum\limits_{ij}d_{ij}$.
Together with Claim~$*$, we have
$\left(x_{in}y_{jn}\right)^{d_{ij}}K^{(d-d_{ij})}\geq f_n\geq f_1.$ So if $d_{ij}\neq 0$, then $x_{in}y_{jn}$ is bounded away from zero. Thus it follows that $l^n_{ij}$ is bounded away from zero for all $n$. Therefore $P\prec \mathbf{L}^\prime$, where $\mathbf{L}^\prime$ is the limit of a subsequence of $\mathbf{L}^n$.
Finally, since SK iteration perseveres zero elements, $\mathbf{L}'\prec \mathbf{M}$.
Together, we have $P\prec \mathbf{L}' \prec \mathbf{M}$.
A similar argument holds for $Q$ and $\TTmat'$.
Thus the lemma holds.
\end{proof}
\begin{remark}\label{same_pattern}
Notice that, the choice of $(P, Q)$ is free within the constraints (having partial pattern of $\mathbf{M}$ and being \textit{SK stable}). In particular, such matrix pairs can be partially ordered with respect to their patterns, and $(P, Q)$ can be selected such that they have the maximum possible pattern. Since the pattern of limit matrices must be intermediate between the pattern of $(P, Q)$ and the pattern of $\mathbf{M}$, it follows that, all the pairs of limit matrices must have the same pattern, which must be the maximum possible.
\end{remark}
\begin{lemma}\label{lemma:diagonal_eq}
Any limit matrix of \textit{SK iteration} on $\mathbf{M}$
is diagonally equivalent to $\overbar {\mathbf{M}}$.
\end{lemma}
\begin{proof}
Let $\mathbf{L}'$ be the limit of the sequence $X_n^\prime \mathbf{M} Y_n^\prime$ (where the $\prime$ signifies any sub-sequence of \textit{SK iteration}). Then $\mathbf{L}'$ is also the limit of the sequence $X_n^\prime \overbar {\mathbf{M}} Y_n^\prime$,
since both $\overbar{\mathbf{M}}$ and $\mathbf{L}'$ has the same pattern.
In this case, Lemma 2 of \cite{pretzel1980convergence}
implies that there exist diagonal matrices $X, Y$ such that $\mathbf{L}'=X\overbar{\mathbf{M}}Y$, i.e. $\mathbf{L}'$ and $\overbar{\mathbf{M}}$ are diagonally equivalent.
\end{proof}
Proposition~1 in \cite{pretzel1980convergence} shows that:
\begin{lemma}\label{lemma: diag_eq}
Let $A$ and $B$ be two matrices with the same row and columns sums.
If there exists diagonal matrices $X$ and $Y$ such that $A=XBY$, then
$A=B$.
\end{lemma}
\begin{proof} [\textbf{Proof of Proposition~\ref{prop:exist_sk_subpattern}}]
We claim that: for a given $u\times v$ matrix $\mathbf{M}$, one may construct a \textit{binary} matrix $A \prec \mathbf{M}$ such that up to permutation, $A$ is block-wise diagonal of the form $\mathrm{diag}(B_1, \dots, B_k)$ where each $B_i$ is a row or column vector of ones (i.e. $B_i=(1, \dots, 1)$ or $B_i=(1, \dots, 1)^T$).
Let $P,Q$ be the row and column normalizations of $A$ respectively.
It is straightforward to check that $(P,Q)$ is \textit{SK stable} and $P\prec \mathbf{M}$. Therefore, we only need to prove the claim.
We will prove the claim inductively on the dimension of $\mathbf{M}$.
Let $n=\max\{u,v\}$.
When $n=1$, $\mathbf{M}$ is an $1\times 1$ matrix and the claim holds.
Now assume that the claim holds when $n\leq k-1$, we will show that
for a $u\times v$ matrix $\mathbf{M}$ with $\max\{u,v\}=k$, the claim still holds.
Without loss, we may assume that $v=k$. There are now two cases.
\textit{Case 1} When $u<k$, let $\mathbf{M}'$ be the sub-matrix formed by the first $k-1$ columns of $\mathbf{M}$.
Then $\mathbf{M}'$ is a $u\times (k-1)$ matrix.
$\mathbf{M}$ has no zero columns implies that $\mathbf{M}'$ has no zero columns.
(1) If $\mathbf{M}'$ contains no zero rows, according to the inductive assumption, there exists
a binary matrix $A' \prec \mathbf{M}'$ having the desired form.
Note that the last column of
$\mathbf{M}$ contains a non-zero element $m_{tk}$. Let $\mathbf{v}=(v_1, \dots, v_u)^T$ be the column vector with $v_i=0$ if $i\neq t$ and $v_t=1$. The desire $A\prec \mathbf{M}$ is then constructed using $A'$ and $\mathbf{v}$ as following.
The $t$-th row of $A'$ must have a non-zero element $a'_{ts}$ (as $A'$ has no zero row). Denote the block contains $a'_{ts}$ by $B'$.
If $B'$ is a row vector with all ones, then $A$ is obtained by augmenting $A'$ by $\mathbf{v}$, i.e. $A=[A', \mathbf{v}]$.
Otherwise, we may replace $a'_{s,t}$ in $A'$ by zero and denote the resulting matrix by $A^{''}$.
$A$ is obtained by augmenting $A^{''}$ by $\mathbf{v}$, i.e. $A=[A^{''}, \mathbf{v}]$.
(2) If $\mathbf{M}'$ contains zero rows, let $\mathbf{M}^*$ be the matrix obtained from $\mathbf{M}'$ by omitting rows with indices in $S_{zero}$ where $S_{zero}$ is the index set of zero rows. Then there exists $A^*\prec \mathbf{M}^*$ according to the inductive assumption. Let $A'\prec \mathbf{M}'$ be the matrix obtained from $A^*$ by inserting back the zero rows (at indices $S_{zero}$).
Note that $\mathbf{M}$ contains no zero rows implies that $m_{ik}>0$ for any $i\in S_{zero}$. Let $\mathbf{v}=(v_1, \dots, v_u)^T$ be the column vector where $v_i=1$ if $i\in S_{zero}$ and $v_i=0$ otherwise. $A$ is obtained by augmenting $A'$ by $\mathbf{v}$, i.e. $A=[A', \mathbf{v}]$.
\textit{Case 2} When $u=k$, let $\mathbf{M}'$ be the sub-matrix formed by the first $k-1$ rows $\mathbf{M}$. Then depending whether $M'$ contains zero column, one may construct $A$ as in case~1. In all circumstances, it is easy to check that the defined $A$ has the desired format by construction. Hence claim also holds for any matrix $\mathbf{M}$ (or its transpose) of the form $u\times k$.
\end{proof}
\begin{proof}[\textbf{Proof of Corollary~\ref{cor:M_barM_SKsame}}]
Let $(\mathbf{L},\TTmat)$ and $(\overbar \mathbf{L},\overbar \TTmat)$ be the limit of SK iteration on $\mathbf{M}$ and $\overbar \mathbf{M}$ respectively. It is enough to show that $\mathbf{L}=\overbar \mathbf{L}$.
Lemma \ref{lemma:diagonal_eq} implies that both $\overbar \mathbf{L}$ and $\mathbf{L}$ are diagonally equivalent to $\overbar{\mathbf{M}}$. Therefore, $\mathbf{L}$ is diagonally equivalent to $\overbar \mathbf{L}$. Further since both $\mathbf{L}$ and $\overbar \mathbf{L}$ have the same pattern as $\overbar \mathbf{M}$, Proposition~\ref{prop:stable_format} shows that they have the same row and column sums. Hence, Lemma \ref{lemma: diag_eq} implies that $\mathbf{L}=\overbar \mathbf{L}$.
\end{proof}
\begin{proof}[\textbf{Proof of Proposition~\ref{prop:preimage}}]
Since $\mathbf{M}$ and $\overbar{\mathbf{M}}$ have exactly the same positive diagonals, we may assume that $\mathbf{M}$ has total support.
Suppose that $\mathbf{M} \in \Phi^{-1}(\mathbf{L})$, i.e. $\Phi(\mathbf{M})=\mathbf{L}$. Since $\mathbf{M}$ has total support, \cite{sinkhorn1967concerning} implies that
there exists diagonal matrices $X=\mathrm{diag}(x_1, \dots, x_n)$ and $Y=\mathrm{diag}(y_1, \dots, y_n)$ such that $\mathbf{M}=X \mathbf{L} Y$.
In particular, $m_{ij}=x_i\times l_{ij} \times y_j$ holds, for any element $m_{ij}$.
Let $D^{\mathbf{M}}_1=\{m_{i,\sigma(i)}\}$, $D^{\mathbf{M}}_2=\{m_{i,\sigma'(i)}\}$
be two positive diagonals of $\mathbf{M}$ and $D^{\mathbf{L}}_1=\{l_{i,\sigma(i)}\}$, $D^{\mathbf{L}}_2=\{l_{i,\sigma'(i)}\}$ be the corresponding positive diagonals in $\mathbf{L}$.
Then:
\begin{equation}\label{eq:cross_ratio}
\footnotesize
\begin{split}
CR(D^{\mathbf{M}}_1,D^{\mathbf{M}}_2)& =\frac{\Pi_{i=1}^{n}m_{i,\sigma(i)}}{\Pi_{i=1}^{n}m_{i,\sigma'(i)}}
=\frac{\Pi_{i=1}^{n}x_i\times l_{i,\sigma(i)} \times y_{\sigma(i)}}{\Pi_{i=1}^{n} x_i\times l_{i,\sigma'(i)}\times y_{\sigma'(i)}}\\
& = \frac{\Pi_{i=1}^{n}x_i\times \Pi_{i=1}^{n} l_{i,\sigma(i)} \times \Pi_{i=1}^{n} y_{\sigma(i)}}{\Pi_{i=1}^{n} x_i\times \Pi_{i=1}^{n} l_{i,\sigma'(i)}\times \Pi_{i=1}^{n} y_{\sigma'(i)}}\\
&=\frac{\Pi_{i=1}^{n}l_{i,\sigma(i)}}{\Pi_{i=1}^{n}l_{i,\sigma'(i)}}=CR(D^{\mathbf{L}}_1,D^{\mathbf{L}}_2)
\end{split}
\end{equation}
We have established the `if' direction.
Now, for the `only if' direction, suppose that $\mathbf{M}\overset{cr}{\sim} \mathbf{L}$. Let $\mathbf{M}^*=\Phi(\mathbf{M})$. Then $\mathbf{M}^*\in \mathcal{B}$ and $\mathbf{M}\in \Phi^{-1}(\mathbf{M}^*)$.
According to Equation~\eqref{eq:cross_ratio}, $\mathbf{M}^*\overset{cr}{\sim}\mathbf{M}$ and so $\mathbf{M}^*\overset{cr}{\sim}\mathbf{L}$. Let $k=d_1^{\mathbf{M}^*}/d_1^{\mathbf{L}}>0$,
where $D_1^{\mathbf{M}^*}$ and $D_1^{\mathbf{L}}$ are positive diagonals determined by the same $\sigma\in S_n$.
$\mathbf{M}^*\overset{cr}{\sim}\mathbf{L}$ implies that $\Pi_{i=1}^{n}m^*_{i,\alpha(i)}=k\times \Pi_{i=1}^{n}l_{i,\alpha(i)}$ for any $\alpha \in S_n$.
Note that \textit{distinct} doubly stochastic matrices do not have proportional corresponding diagonal products
(For a proof see \cite{sinkhorn1969problems}). Hence, $\mathbf{L}=\mathbf{M}^*=\Phi(\mathbf{M})$.
\end{proof}
\begin{thm}[Birkhoff-von Neumann theorem](\cite{dufosse2016notes})\label{thm:BN}
For any $n\times n$ doubly stochastic matrix $A$, there exist $\theta_i \geq 0$ with $\sum_{i=1}^{k}\theta_{i}=1$ and permutation matrices $\{P_1,\dots,P_k\}$ such that $A=\sum_{i=1}^{k} \theta_iP_i$. This representation is also called Birkhoff-von Neumann (BvN) decomposition of $A$.
\end{thm}
\begin{proof}[\textbf{Proof of Proposition~\ref{prop:dist_preimage}}]
$\mathbf{M}^1$ has total support implies that there exist two diagonal matrices $X=\mathrm{diag}\{x_1, \dots, x_n\}$ and $Y=\mathrm{diag}\{y_1, \dots, y_n\}$ such that $\mathbf{M}^1=X\mathbf{L}^1 Y$.
Let $\mathbf{M}^2=X\mathbf{L}^2 Y$ and $C=\max_{ij}\{x_iy_j\}$. Then $d(\mathbf{L}^1, \mathbf{L}^2) \leq \epsilon$ $\implies$ $|l^1_{ij}-l^2_{ij}|\leq \epsilon$ $\implies$ $|x_i\cdot l^1_{ij}\cdot y_j-x_i\cdot l^2_{ij}\cdot y_j|\leq C\epsilon$ $\implies$ $|m^1_{ij}-m^2_{ij}|\leq C\epsilon$. Thus, $d(\mathbf{M}^1, \mathbf{M}^2)\leq C\epsilon$.
\end{proof}
\textbf{Construction of Homeomorphic $\Phi$.}
As mentioned above, for any $\mathbf{M}\in \overbar{\A}$, there exist two diagonal matrices $X$ and $Y$ such that $\mathbf{M}=X\Phi(\mathbf{M})Y$. Note the choice of $X$ and $Y$ is unique only up to a scalar.
This can be made deterministic by requiring the last positive element of $Y$ to be $1$, i.e. $y_n=1$. In this way $\Phi$ can be viewed as a map : $\overbar{\A} \to \mathcal{R}^{2n-1}_{+}\times \mathcal{B}$ where $\mathbf{M} \mapsto [(x_1, \dots, x_n, y_1, \dots, y_{n-1}), \Phi(\mathbf{M})]$. \cite{tverberg1976sinkhorn} showed that:
\begin{prop}
$\Phi:\overbar{\A}\to \mathcal{R}^{2n-1}_{+}\times \mathcal{B}$ is continuous, invertible and the inverse is also continuous. Thus $\Phi$ is homeomorpic.
\end{prop}
\textbf{Role of zeros}: Results derived in Section~\ref{sec: rectangular}-\ref{sec:cr_sn} do not depend on zero elements. The lower bounds of CI derived in Section~\ref{sec:bounds} are closely related to the amount of zeros and their locations. However, together with the sensitivity analysis, these bounds can still be used as an approximation for lower bounds of CI for matrices with very small elements (instead of exact zeros). In some models, zero elements could appear. For instance, in linguistic applications, if an utterance is not consistent with a referent, its corresponding element would be zero \citep{golland2010game}. More generally, it is an interesting question as to whether more models should assign zero probability to some possible outcomes. As noted, most probabilistic models do not currently assign zero probability to any outcomes. However, if one, for example, wants models that are explainable via examples our results show that assigning zero probability to some outcomes is a desirable feature. Beyond explainability, as far as we know, there are no principled reason for not assigning zero probability to some possible outcomes. Finally, having zeros reduces the number of positive diagonals, which is a special case of the more general problem of establishing bounds based on cross-ratio (Corollary~\ref{cor:total_support}). This is considerably more challenging and a direction for future work.
\textbf{Other connections.} Sinkhorn iteration finds its way in many other applications in variety of fields. To name a few: transportation planning to predict flow in a traffic network \citep{fienberg1970iterative}, contingency table analysis which has many uses in biology, economics etc. \citep{fienberg1970iterative}, decreasing condition numbers which is of importance in numerical analysis \citep{osborne1960pre}. Moreover, there are many algorithms implemented as generalizations of Sinkhorn matrix balancing to solve problems such as Edmonds problem \citep{gurvits2003classical}, Sudoku Solvers \citep{moon2009sinkhorn} and web page ranking algorithms \citep{knight2008sinkhorn}. More applications and a comprehensive discussion can be found in \citep{idel2016review} and references therein.
| {'timestamp': '2019-02-15T02:01:36', 'yymm': '1810', 'arxiv_id': '1810.02423', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02423'} | arxiv |
\section{Introduction}
Since the beginning of its foundations, classification of problems, by
various models of computation,
either by their complexity or by their computability properties, is a
thriving field of computer science.
Nowadays, classical (digital) computer science problems
also deal with continuous data coming from different areas and modeling
involves the use of tools like numerical analysis, probability theory
or differential equations. Thus new characterizations related to
theses fields have been proposed.
On a dual way, the quest for
new type of computers recently leaded to revisit the power of some
models for analog machines based on differential equations, and to
compare them to modern digital models.
In both contexts, when discussing the related issues, one has to
overcome the fact that today's (digital) computers are by essence
discrete machines while the objects under study are continuous and
naturally correspond to Ordinary Differential Equations (ODEs).
We consider here an original approach in
between the two worlds: discrete oriented computation with
differential equations.
Indeed, ODE
appear to be a natural way of expressing properties and
are intensively used, in particular in applied science.
The theory of classical (continuous) ODEs is rather very well
understood, broadly studied and taught with a plethoric literature, see
e.g. \cite{Arn78, BR89, CL55}.
We are here interested here in a discrete more recent
counterpart of classical continuous ODEs: discrete ODEs, whose
theory is sometimes called \emph{discrete calculus}, or \emph{finite
calculus}. See for e.g.
\cite{graham1989concrete,gleich2005finite,izadi2009discrete,urldiscretecalculuslau}
or our brief presentation in Appendix \ref{sec:dcal}.
In this article, we prove that various classes of complexity and
computability theory can be very elegantly and simply defined using
discrete ordinary differential equations.
We also demonstrate through this discussion how some techniques from
analog world such as changes of variables can be used to solve
efficiently some (classical, digital) problems.
As far as we know, this is the first time that computations with
discrete ODEs and their related complexity aspects have been considered. By contrast, characterizations have been recently obtained
with classical (continuous) ODEs of various classes of functions,
mostly in the framework of computable analysis. The hardness of
solving continuous ODEs has been intensively discussed: for example
\cite{Ko83} establishes somes basis of the complexity aspects of ODEs
and more recent work like \cite{kawamura2009lipschitz} or
\cite{collins2008effectivesimpl} establishes links between complexity
or effective aspects of such differential equations.
Hence, the computational power of continuous ODEs is much more understood.
We believe that investigating the expressive power of discrete ODE, can really help to better understand complexity of computation for both the discrete and continuous settings.
Indeed, on one hand, as a consequence, our work relates classical
(discrete) complexity classes to analog computations,
i.e. computations over the reals, as analog computation have been
related in various ways to continuous ordinary differential equations,
and as discrete ordinary differential equations provide clear hints
about their continuous counterparts.
But on the other hand, it also opens a new perspective on classical
discrete computations, i.e. computation that deals
with bits, words, or integers. In this discrete setting,
our work falls under the scope of so-called implicit complexity, i.e.
characterization complexity measures in a machine independent
way. Combining these two approaches, it helps to clearly point out
which aspects of the statements are related to continuous computations
versus discrete computations.
This original work point out the fundamental role of linear (discrete)
ordinary differential equations in computability and complexity
theory: when considered in general, this provides a characterization
of elementary functions. When considered with suitable (length
related) changes of
variables, this provides a characterization of polynomial time. This
work also opens a way to revisit seminal results such as Cobham's \cite{cob65} and Bellantoni and Cook's \cite{bs:impl} definition of
polynomial time as syntactic constraints imposing only linear discrete
ODEs.
\subsection{Related works}
\subsubsection{Analog computations:}
In the context of analog computations there have been several results
relating classical complexity to various classes of continuous
ODEs. In particular, a serie of papers has been devoted to study
various classes of the so-called $\R$-recursive functions, after
their introduction in \cite{Moo95b}. At the complexity level,
characterizations of complexity classes such as $\Ptime$ and $\cp{NPTIME}$ using
$\R$-recursive algebra have been obtained \cite{MC06}, motivated in
particular by the idea of transferring classical questions from
complexity theory to the context of real and complex analysis
\cite{LCM07b, MC06,MC05Eatcs}. More recently, is has been proved that
polynomial differential equations can be considered as a very simple
and elegant model in which computable functions over the reals and
polynomial time computable functions over the reals can be defined
without any reference to concepts from discrete computation theory
\cite{JournalACM2017,TheseAmaury}.
Refer to
\cite{DBLP:journals/corr/BournezGP16,ArxivSurvey} for an up to date
survey about various works on analog computations, in particular in a
computation theory perspective.
\subsubsection{Classical complexity theory:}
Implicit complexity has been developed in many ways
to provide machine independant characterizations of various computability and complexity
classes in the discrete setting.
This includes
characterizations of complexity classes based
on lambda calculus (e.g.\ \cite{LM93}), finite model theory and descriptive complexity (e.g.\
\cite{Fag74}), on function algebra (e.g.\ \cite{cob65,bs:impl,lm:pspace,Rose}), or yet one
combining the latter two approaches (e.g.\ \cite{Gur83,Saz80}).
This approach has also been proved useful to measure the expressive
power of various formalisms with wide applications in database and
constraint theory and programming languages: See \cite{Clo95,LivreFiniteModelTheory,Imm99} for more complete
references.
\subsection{Structure of the paper}
In Section~\ref{sec:discrete differentiability} a short introduction to discrete differentiability is given followed in Section~\ref{sec:programming with ODE} by an illustration, through examples, of the programming ability of discrete ODE.
First formal definitions of discrete ODE are given in
Section~\ref{sec:Computability and Discrete ODEs} together with
characterizations of primitive recursion and elementary functions in
this context. Section~\ref{sec:restrict} introduces the notion (and
basic theory) of length-ODE which is central in the characterization
of $\cp{FPTIME}$ (Section~\ref{sec:A characterization of polynomial
time}). Section~\ref{sec:extension}
discusses some extensions of the results. Details about discrete
differentiability and the associated calculus, as well about Random
access machines are given in
Appendix.
\section{Discrete differentiability}\label{sec:discrete differentiability}
In this section, we review some basic notions of discrete calculus to help intuition in the rest of the paper (see Appendix~\ref{sec:dcal} for a more complete review).
\subsection{Discrete derivation, integration and exponentiation}
Discrete derivatives are usually intended to concern functions over the
integers of type $\tu f: \N^p \to \Z^d$, but the statements and concepts
considered in our discussions are also valid more generally for functions
of type $\tu f: \Z^p \to \Z^d$, for some integers $p,d$, or even functions
$\tu f: \R^p \to \R^d$.
The basic idea is to consider the following concept of
derivative.
\begin{definition}[Discrete Derivative] The discrete derivative of
$\tu f(x)$ is defined as $\Delta \tu f(x)= \tu f(x+1)-\tu
f(x)$. We will also write $\tu f^\prime$ for
$\Delta \tu f(x)$ to help to understand
statements with respect to their classical continuous counterparts.
\end{definition}
Several results from classical derivatives generalize
to these settings: this includes linearity of derivation $(a \cdot
f(x)+ b \cdot g(x))^\prime = a \cdot f^\prime(x) + b \cdot
g^\prime(x)$, formulas for products
and division such as
$(f(x)\cdot g(x))^\prime =
f^\prime(x)\cdot g(x+1)+f(x) \cdot g^\prime(x)$.
A fundamental concept is the following:
\begin{definition}[Discrete Integral]
Given some function $\tu f(x)$, we write $\dint{a}{b}{\tu f(x)}{x}$
as a synonym for $$\dint{a}{b}{\tu f(x)}{x}=\sum_{x=a}^{x=b-1}
\tu f(x)$$ with the convention that it values $0$ when $a=b$ and
$\dint{a}{b}{\tu f(x)}{x}=- \dint{b}{a}{\tu f(x)}{x}$ when $a>b$.
\end{definition}
The telescope formula yields the so-called Fundamental Theorem of
Finite Calculus:
\begin{theorem}[Fundamental Theorem of Finite Calculus]
Let $\tu F(x)$ be some function.
Then,
$$\dint{a}{b}{\tu F^\prime(x)}{x}= \tu F(b)-\tu F(a).$$
\end{theorem}
As for classical functions, any function has a set of primitives
defined up to some additive constant, and techniques such as
integration by part can be used.
\newcommand\ENONCEINTEGRALPARAMETER[1]{
\begin{lemma}[Derivation of an integral with parameters] #1
Consider $$\tu F(x) = \dint{a(x)}{b(x)} {\tu f(x,t)}{t}.$$
Then $$\tu F'(x) = \dint{a(x)}{b(x)}{ \frac{\partial \tu f}{\partial
x} (x,t)}{t} + \dint{0}{-a^\prime(x)}{\tu f(x+1,a(x+1)+t)}{t}
+ \dint{0}{b'(x)}{ \tu f(x+1,b(x)+t ) } {t}
$$
In particular, when $a(x)=a$ and $b(x)=b$ are constant functions, $$\tu F'(x) = \dint{a}{b}{ \frac{\partial \tu f}{\partial
x} (x,t)}{t}$$
\end{lemma}
}
{
\ENONCEINTEGRALPARAMETER{}
}
A classical concept in discrete calculus is the one of falling
power defined as $x^{\underline{m}}=x\cdot (x-1)\cdot (x-2)\cdots(x-(m-1))$.
This notion is motivated by a derivative formula similar to the classical
one for powers in the continuous setting.
In a similar spirit, we
introduce the following concept. This seems not standard (as far as
the authors know) but of clear interest.
\begin{definition}[Falling exponential]
Given some function $\tu U(x)$, the expression $\tu U$ to the
falling exponential $x$,
denoted by $\fallingexp{\tu U(x)}$, stands
for $$\fallingexp{\tu U(x)}= (1+ \tu U^\prime(x-1)) \cdots
(1+ \tu U^\prime(1)) \cdot (1+ \tu U^\prime(0)) =
\prod_{t=0}^{t=x-1} (1+ \tu U^\prime(t)). $$
with the convention that $\prod_{0}^{0}=\tu {id}$, where $\tu
{id}$ is the identity (sometimes denoted $1$ hereafter)
\end{definition}
This is motivated by the remark that for all $x \in \Z$,
$2^x=\fallingexp{x}$, and:
\begin{theorem}[Derivative of a falling exponential] The discrete
derivative of a falling exponential is given by
$$\left(\fallingexp{\tu U(x)}\right )^\prime = \tu U^\prime(x) \cdot
\fallingexp{\tu U(x)}.$$
\end{theorem}
\subsection{Discrete Ordinary Differential Equations (ODE)}
We will focus in this article on discrete Ordinary Differential
Equations (ODE) on functions with several variables, that is to say
for example on equations of the (possibly vectorial) form:
\begin{equation}\label{lodepv}
\dderiv{\tu f(x,\tu y)}{x}= \tu h(\tu f(x,\tu y),x,\tu y).
\end{equation}
As expected $\dderiv{\tu f(x,\tu y)}{x}$ stands for the derivative of
functions $f(x,\tu y)$ considered as a function of $x$, when $\tu y$
is fixed.
When some initial value is given, this is called an \emph{Initial Value
Problem (IVP)}, also called a \emph{Cauchy Problem}.
{That is to say, we are
given a problem of type:
\begin{oureqnarray}\label{cauchy}
\dderiv{\tu f(x,\tu y)}{x}&=&\tu h(\tu f (x,\tu y),x,\tu y )\\
\tu f(0,\tu y)&=& \tu g(\tu y )
\end{oureqnarray}
\noindent with functions $\tu g,\tu h$ of suitable dimensions and domains:
}
Our aim here is to discuss total functions whose domain and range
is either of the form $\mathcal{D}=\N$, $\Z$, or possibly a finite
product $\mathcal{D}= \mathcal{D}_1 \times \dots \times \mathcal{D}_k$
where each $\mathcal{D}_i=\N$, $\Z$.
By considering that $\N \subset \Z$, we assume that the range is
always
$\Z^d$ for some $d$.
The concept of solution for such ODEs is as expected: assume $h: \Z^d \times \N \times \Z^{p} \to \Z$
(or $h: \Z^d \times \Z \times \Z^{p} \to \Z$),
a solution
over $\mathcal{D}$ is a function $f: \mathcal{D}
\times \Z^{p} \to \Z^d$
that satisfies the equations for all $x,\tu y$.
We will only consider well-defined ODEs such as above in this
article (but variants with partially defined function could be considered as well).
Observe that an IVP of the form \eqref{lodepv} always admits a
(necessarily unique) solution over $\N$ since $f$ can be defined
inductively with $\tu f(0,\tu y)=\tu g(\tu y)$ and $\tu f(x+1,\tu
y)= \tu f(x,\tu y)
+ \tu h(\tu f(x,\tu y),x, \tu y)$.
\begin{remark}
Notice that this is not necessarily true over $\Z$: As an
example, consider
$f^\prime(x) = - f(x) + 1$, $f(0) = 0$.
By definition of $f^\prime(x)$, we must have $f(x+1)=1$ for all $x$,
but if $x = -1$, $f(0)=1 \neq 0$.
\end{remark}
\begin{remark}[Sign function] It is very instructive to realize that the solution of this
IVP
over $\N$ is the sign $\signn{x}$ function defined by
$\signn{x}=1$ if $x>0$ and $\signn{x}=0$ in the other case.
\end{remark}
Affine (also called linear) ordinary differential equations will play a very important role
in what follows, i.e. discrete ordinary differential equations of the
form $\tu f^\prime(x)=\tu A(x) \cdot \tu f(x) + \tu B(x)$.
\begin{remark}
Recall that the solution of $ f^\prime(x)= a(x) f(x) + b(x)$ for
classical continous derivatives turns out to be given by (This is usually obtained by the variation of parameter method
- see Appendix \ref{sec:dcal} for a short review of the method
and for other classical ODE):
\begin{equation} \label{eq:affine}
f(x) = f(0) e^{\int_0^{x} a(t)
dt} + \int_{0}^{x} b(u) e^{\int_u^{x} a(t)
dt }
du.
\end{equation}
This
generalizes to discrete ordinary
differential equations, and this works even vectorially:
\end{remark}
\begin{lemma}[Solution of ODE $\tu f’(x,\tu y)= \tu A (x,\tu y) \cdot
\tu f(x,\tu y)
+ \tu B(x,\tu y)$] \label{def:solutionexplicitedeuxvariables}
For matrices $\tu A$ and vectors $\tu B$ and $\tu G$,
the solution of equation $\tu f’(x,\tu y)= \tu A(x,\tu y) \cdot \tu f(x,\tu y)
+ \tu
B (x,\tu y)$ with initial conditions $\tu f(0,\tu y)= \tu G(\tu y)$ is
\begin{equation}\label{soluce}
\tu f(x,\tu y) = \left( \fallingexp{\dint{0}{x}{\tu A(t,\tu y)}{t}} \right) \cdot \tu G (\tu y) +
\dint{0}{x}{ \left(
\fallingexp{\dint{u+1}{x}{\tu A(t,\tu y)}{t}} \right) \cdot
\tu B(u,\tu y)} {u}.
\end{equation}
\end{lemma}
\section{Programming with discrete ODE}\label{sec:programming with ODE}
In this section, we show that several algorithms can actually be
naturally solved using discrete ODEs, or viewed as discrete ODEs:
Basically, for now, we suppose that composition of functions, constant
and the following basic functions can be used freely as functions
from $\Z$ to $\Z$:
\begin{itemize}
\item arithmetic operations: $+$, $-$, $\times$
\item $\length{x}$ returns the length in binary of $x \in \N$.
\item $\sign{x}: \Z \to \Z$ defined by $\sign{x}=1$ if $x>0$ and
$\sign{x}=0$ in the other case.
$\signn{x}: \N \to \Z$ defined by $\signn{x}=1$ if $x>0$ and
$\signn{x}=0$ in the other case.
\end{itemize}
Recall that $\signn{x}$ is
the solution over $\N$ of some IVP
and hence is very natural in this context.
From these basic functions, for readability, one may define useful functions as
synonyms:
\begin{itemize}
\item $\signcomp{x}$ stands for
$\signcomp{x}=(1-\sign{x})\times (1-\sign{-x})$: it tests if
$x=0$ for $x \in \Z$.
$\signcompn{x}$ stands for
$\signcompn{x}=1-\signn{x}$: it tests if $x=0$ for $x \in \N$.
\item $\cond{x}{y}{z}$ stands for $\cond{x}{y}{z}=y +
\signcomp{x}\cdot (z-y) $ and
$\condn{x}{y}{z}$ stands for $\condn{x}{y}{z}=y +
\signcompn{x}\cdot (z-y) $.
We have for both versions (The point is that the first considers $x \in \Z$ while the second
assumes $x \in \N$):
\[
\cond{x}{y}{z}=\left\{\begin{array}{l}
y \mbox{ if } x=0\\
z \mbox{ otherwise }
\end{array}\right.
\quad
\condn{x}{y}{z}=\left\{\begin{array}{l}
y \mbox{ if } x=0\\
z \mbox{ otherwise }
\end{array}\right.
\]
\item
We will
extensively use these functions below:
$\cond{x<x'}{y}{z}$ will be a synonym for
$\cond{\sign{x-x'-1}}{y}{z}$.
$\cond{x=x'}{y}{z}$
will be a synonym for $\cond{\signcomp{x-x'}}{y}{z}$.
\end{itemize}
\begin{example}[Computing the minimum of a function: ]
The minimum of a function
$\min f : x \mapsto min \{f(y) : 0 \le y \le x\}$
is given by $F(x,x)$ where $F$
can be computed recursively by
\begin{eqnarray*}
F(0) &=& f(0) \\
F(t+1,x) &=& \textsf{if}(F(t,x) < f(x), F(t,x), f(x))
\end{eqnarray*}
This can be interpreted as a discrete ordinary differential equation:
$$\dderiv{F(t,x)}{t} = H(F(t,x),f(x),t,x)=
\left\{
\begin{array}{lll}
0 & \mbox{ if } & F(t,x)<f(x) \\
- F(t,x) + f(x) & \mbox{ if } & F(t,x) \ge f(x).\\
\end{array}
\right.
$$
The value $\min f (x) = F(x,x)$ can then be computed
using the solution of the above discrete ODE. In integral form, we
have:
\[
F(x,y) = F(0) + \dint{0}{x}{H(F(t,y),t,y)}{t}.
\]
\end{example}
\begin{remark}
We also see through this example that such an integral (equivalently
discrete ODE) can
always be considered as a (recursive) algorithm:
compute the integral from its definition as a sum to compute the
function.
Notice that this algorithm is not polynomial
as this basically takes
time $x$ to compute $\min f$,
i.e. not polynomial with respect to the usual convention for
measuring complexity based on the binary length of arguments.
\end{remark}
\begin{example}[Computing the integer part and divisions,
Length-ODE:] \label{ex:some}
\label{sec:racine}
Suppose that we want to compute $\lfloor \sqrt{x} \rfloor = \max \{ y \le x : y \cdot y \leq x \}$ and $\lfloor
\frac{x}{y} \rfloor = \max
\{z \le x : z \cdot y = x \}$. It can be done by the following uniform method. Let $f,h$ be some functions with $h$ being non decreasing. We compute $\fonction{some}_h$ with $\fonction{some}_h(x)=y$ s.t. $|f(x)-h(y)|$ is minimal.
When $h(x)=x^2$ and $f(x)=x$, it holds that:
$
\lfloor \sqrt{x} \rfloor = \textsf{if}(\fonction{some}_h(x)^2 \leq x,\fonction{some}_h(x),\fonction{some}_h(x)-1).
$
The function $\fonction{some}_h$ can be computed
as a solution of an ODE
as in the preceding example. However, there is a more efficient way to do it based on what one
usually does
with classical ordinary differential equations:
performing a
change of variable so that it becomes logarithmic in $x$.
Indeed, we write
$
\fonction{some}_h(x) = G(\length{x},x)
$
for some function $G(t,x)$ defined by:
\begin{eqnarray*}
G(0,x)&=&x \\
G(t+1,x) &=& \textsf{if}( h(G(t,x)) = f(x), G(t,x) , \\
&& \textsf{if}(h(G(t,x)) > f(x), G(t,x) + 2^{\length{x}-t-1}, G(t,x) -2^{\length{x} - t -1}))
\end{eqnarray*}
Or, if one prefers, $G(t,x)$ is solution of
$$\dderiv{G(t,x)}{t} = E(G(t,x),t,x)=
\left\{
\begin{array}{lll}
+ 2^{\length{x}-t-1} & \mbox{ if } & h(G(t,x))>g(x) \\
0 & \mbox{ if } & h(G(t,x))=g(x)\\
- 2^{\length{x}-t-1} & \mbox{ if } & h(G(t,x))<g(x) \\
\end{array}
\right.
$$
This is indeed a differential equation whose solution is
converging fast (in polynomial time) to what we want. Reformulating
what we just did,
we wrote $\fonction{some}_h(x) = G(\length{x},x)$
using the solution of the above discrete ODE, i.e. the solution of
$
G(T,y) = x + \dint{0}{T}{E(G(t,y),t,y)}{t}.
$
This provides a polynomial time algorithm to solve our problems
using
a new parameter $t=\length{x}$ logarithmic in $x$. Such techniques
will be at the heart of the coming results.
\end{example}
Notice that the theory of ODEs also provides very natural alternative
ways to compute various quantities. This is very clear when
considering numeric functions such as $\tan$, $\sin$, etc.
\begin{example}[Computing $\tan$ with discrete ODEs, iterative algorithms]
As an illustration, suppose you want to compute $\tan(x_0)$ for say $x_0=72$.
One way to do it is to observe that $\tan(x)^\prime= (1+\tan(x) \tan(x+1))$.
From fundamental theorem of finite calculus
we can hence write:
\begin{eqnarray}
\label{eq:tran}
tan(x_0)&=&0 + \dint{0}{x_0}{\tan(x)}{x} \label{eq:unt}
\\
&=& 0 + \tan(1) \cdot
\dint{0}{x_0}{(1+\tan(x)\tan(x+1))}{x} \label{eq:untt}
\end{eqnarray}
Inspired from previous remarks, the point is that Equation
\eqref{eq:unt} can be interpreted as an algorithm: it provides a
way to compute $\tan(x_0)$ as an integral (or if you prefer as a
sum).
Thinking about what means this integral, discrete ODE \eqref{eq:tan},
also encoded by \eqref{eq:untt}, can also be interpreted as
$\tan(x+1)-\tan(x)= \tan(1) \cdot [1 + \tan(x) \tan(x+1)]$
that is to say
$\tan(x+1)= f(\tan(x))$
where $f(X)= \frac{X+\tan(1)}{1-\tan(1)X}$.
Hence, this is suggesting a way to compute $\tan(72)$ by a method close to
express that $tan(x_0)=f^{[x_0]}(0).$
That is to say Equations \eqref{eq:unt} and \eqref{eq:untt} can be
interpreted as providing a way to compute $\tan(72)$ using an
iterative algorithm: they basically encode some recursive way of
computing $\tan$.
\end{example}
Of course, a similar principle would hold for $\sin$, or $\cos$ using
discrete ODEs obtained above, and for many other functions starting
from expression of their derivative.
\begin{remark}
Given $x_0$, (even if we put aside how to deal with involved real
quantities) a point is that computing $\tan(x_0)$ using this method can not be
considered as
polynomial time, as the (usual) convention is that
time complexity is measured in term of the length of $x_0$, and not on
$x_0$.
\end{remark}
Could we do the same computation faster using a change of variables?
This is at the heart of the coming constructions and discussions.
\begin{example}[Computing suffixes with discrete ODEs]
Discrete ODEs turns out to be very natural in many other contexts, in particular non numerical ones,
where they would probably not be expected.
We illustrate the discussion by a way to compute fast (in polynomial
time) the suffix function:
{
The suffix function, $\textsf{suffix}(x,y)$ takes as input two integers $x$ and $y$ and outputs the $\length{y}=t$ least significant bits of the binary decomposition of $x$.
We describe below a way to compute a suffix working over a
parameter $t$, that is logarithmic in $x$.}
Consider the following amazing algorithm that can be interpreted as a
fix-point definition of the function: $\textsf{suffix}(x,y)=F(\length{x},y)$ where
%
\[
F(T,y) = x + \dint{0}{T}{
\cond{\length{F(t,x)} = 1}{0}{- 2^{\length{F(t,x)} -1}}
}{t}.
\]
\end{example}
\section{Bounded schemes in computation
theory}
After this teaser, the rest of this article aims at discussing which
problems can be solved using discrete ordinary differential equations,
and with which complexity. Before doing so, we need to
review some
basic concepts and results from computation theory that we will be
needed in the rest of this article and that have been obtained at this date.
\subsection{Computability theory and bounded schemes}
Classical recursion theory deals with functions over integers, that is
to say with functions $\tu f: \N^p \to \N^d$ for some positive integers
$p,d$.
It is well known that all main classes of classical recursion theory can be
characterized as closures of a set of
basic functions by a finite number of basic
rules to build new functions: See
e.g. \cite{Rose,Odi92,clote2013boolean}:
\begin{theorem}[Total Recursive functions]
A total function over the integers is computable if and only if it belongs
to the smallest set of functions that contains constant function
$\mathbf{0}$, the projection functions $\projection{i}{p}$, the function successor $\mathbf{s}$,
that is closed under composition, primitive recursion and
safe minimization.
\end{theorem}
In this statement, $\mathbf{0}$, $\projection{i}{p}$ and $\mathbf{s}$ are
respectively the functions from, $\N \to \N$,
$\N^p \to \N$ and $\N \to \N$ defined as $n \mapsto 0$,
$(n_1,\dots,n_p) \mapsto n_i$, and $n \mapsto n+1$.
We also recall here the basic definitions used in the above statement:
\begin{definition}[Primitive recursion] \label{def:classique}
Given functions $g: \N^p \to \N$ and $h: \N^{p+2} \to \N$, function
$f=\REC(g,h)$ defined by primitive recursion from $g$ and $h$ is the function $\N^{p+1} \to \N$ satisfying
\begin{eqnarray*}
f(0,\tu y) &=& g(\tu y) \\
f(x+1,\tu y)&=&h(f(x,\tu y),x,\tu y). \\
\end{eqnarray*}
\end{definition}
\begin{definition}[Primitive recursive functions]
A function over the integers is primitive recursive if and only if it belongs
to the smallest set of functions that contains constant function
$\mathbf{0}$, the projection functions $\projection{i}{p}$, the functions successor $\mathbf{s}$,
that is closed under composition and primitive recursion.
\end{definition}
Primitive recursive functions have been stratified into various subclasses.
We recall here the \Greg{} hierarchy in the rest of this subsection.
\begin{definition}[Bounded sum] \label{def:bsumclassique}
Given functions $g(\tu y): \N^p \to \N$,
\begin{itemize}
\item function $f=\BSUM(g): \N^{p+1} \to \N$ is defined by
$f : (x,\tu y) \mapsto \sum_{z \le x} g(z,\tu y)$.
\item function
$f=\BSUMs(g): \N^{p+1} \to \N$ is defined by
$f : (x,\tu y) \mapsto \sum_{z < x} g(z,\tu y)$ for $x \neq 0$, and
$0$ for $x=0$.
\end{itemize}
\end{definition}
\begin{definition}[Bounded product] \label{def:bprodclassique}
Given functions $g: \N^p \to \N$,
\begin{itemize}
\item function $f=\BPROD(g) : \N^{p+1} \to \N$ is defined by
$f: (x,\tu y) \mapsto \prod_{z \le x} g(z,\tu y)$.
\item function $f=\BPRODs(g)$ is defined by
$f: (x,\tu y) \mapsto \prod_{z < x} g(z,\tu y)$ for $x \neq 0$, and
$1$ for $x=0$.
\end{itemize}
\end{definition}
We have
\begin{eqnarray*}
\BSUM(g)(x,\tu y) &=&\BSUMs(g)(x,\tu y)+g(x,\tu y) \\
\BPROD(g)(x,\tu y)&=&\BPRODs(g)(x,\tu y) \cdot g(x,\tu y)\\
\end{eqnarray*}
\begin{definition}[Elementary functions]
A function over the integers is elementary if and only if
it belongs to the smallest set of functions that contains constant
function $\mathbf{0}$, the projection functions $\projection{i}{p}$, the functions
successor $\mathbf{s}$, addition $\plus$, limited subtraction $\myominus: (n_1,n_2) \mapsto
max(0,n_1-n_2)$, and that is closed under composition, bounded sum
$\BSUM$ and
bounded product $\BPROD$.
We denote by $\Elem$ the class of elementary functions.
\end{definition}
Class $\Elem$ contains many classical functions.
In particular:
\begin{lemma}[{\cite[Lemma 2.5, page 6]{Rose}}] $(x,y)\mapsto \lfloor
x/y \rfloor$ is in $\Elem$. \label{lem:derose}
\end{lemma}
\begin{lemma}[{\cite{Rose}}] $(x,y) \mapsto x \cdot y$ is in $\Elem$.
\end{lemma}
The following normal form is also well-known. We consider safe
minimization instead of classical minimization as we focus in this
article only on total functions.
\begin{definition}[(Safe) Minimization] \label{def:classiquesm}
Given function $g: \N^{p+1} \to \N$, such that for all $x$ there
exists $\tu y$ with $g(x,\tu y)=0$, function $f = \SMIN(g)$ defined
by (safe) minimization
from $g$ is the (total) function $\N^{p} \to \N$ satisfying $
\SMIN(g) : \tu y \mapsto \min\{x; g(x,\tu y)=0\}$.
\end{definition}
\begin{theorem}[Normal form for computable functions
\cite{Kal43,Rose}] \label{normalform}
Any total recursive function $f$ can be written as $f = g (
\SMIN(h))$ for some elementary functions $g$ and $h$.
\end{theorem}
Consider the family of functions $E_n$ defined by induction
as follows. When $f$ is a function, $f^{[d]}$ denotes its $d$-th
iterate: $f^{[0]}(\vx)=x$, $f^{[d+1]}(\vx)=f(f^{[d]}(\vx))$:
\begin{eqnarray*}
\gE_0(x) &=& s(x) = x+1, \\
\gE_1(x,y) &=& x+y, \\
\gE_2(x, y) &=& (x+1) \cdot (y+1),\\
\gE_3(x) &=& 2^x,\\
\gE_{n+1}(x)&=& \gE_n^{[x]}(1) \mbox{ for $n \geq 3$.}
\end{eqnarray*}
\begin{definition}[Bounded recursion ] \label{def:limclassique}
Given functions $g(\tu y): \N^p \to \N$ and $h(f,x,\tu
y): \N^{p+2} \to \N$ and $i(x,\tu y): \N^{p+1} \to \N$, the function
$f=\limREC(g,h)$ defined by bounded recursion from $g$ and $h$ is defined as the function $\N^{p+1} \to \N$
verifying
\begin{eqnarray*}
f(0,\tu y) &=& g(\tu y) \\
f(x+1,\tu y) &=&h(f(x,\tu y),x,\tu y) \\
\mbox{
under the condition that: } \\
f(x,\tu y) &\le& i(x, \tu y).
\end{eqnarray*}
\end{definition}
\begin{definition}[\Greg{} hierarchy (see \cite{Rose})]
Class $\E^0$ denotes the class that contains the constant function
$\mathbf{0}$, the projection functions $\projection{i}{p}$, the successor
function $\mathbf{s}$, and that is closed under composition and bounded
recursion.
Class $\E^{n}$ for $n \geq 1$ is defined similarly except that
functions max and $\gE_n$ are added to the list of initial functions.
\end{definition}
\begin{theorem}[\cite{Odi92, Cam01}] \label{rqBsumbprod} Let $n
\geq 3 $. A function is in class $\Gregn$ iff it belongs to the
smallest set of functions that contains constant function $\mathbf{0}$,
the projection functions $\projection{i}{p}$, the functions
successor $\mathbf{s}$, addition $\plus$, subtraction $\myominus$, and
the function $\gE_{n}$ and that is closed under composition, bounded
sum and bounded product.
\end{theorem}
The above proposition means that closure under bounded recursion is
equivalent to using both closure under bounded sum and closure under
bounded product. Indeed, as explained in chapter $1$ of \cite{Rose}
(see Theorem 3.1 for details), bounded recursion can be expressed as a
minimization of bounded sums and bounded products, itself being
expressed as a bounded sum of bounded products.
The following facts are known:
\begin{theorem}[\cite{Rose,Odi92,clote2013boolean}]
\begin{eqnarray*}
\Elem_3 &=& \Elem \subsetneq \PR
\\
\Elem_{n} &\subsetneq& \Elem_{n+1} \mbox{ for $n \geq 3$} \\
\PR &=& \bigcup_{i} \Elem_i
\end{eqnarray*}
\end{theorem}
\subsection{Complexity theory and bounded schemes}
We suppose the reader familiar with the well-known complexity classes $\Ptime$
(polynomial time), $\cp{NPTIME}$ or (non-deterministic polynomial time) or
$\cp{PSPACE}$ (polynomial space). We denote by $\cp{FPTIME}$ (resp. $\cp{FPSPACE}$) the class of functions, $f:\N^k\rightarrow \N$ with $k\in \N$, computable in polynomial time (resp. polynomial space) on deterministic Turing machines. Note that if $\cp{FPTIME}$ is closed by composition, it is not the case of $\cp{FPSPACE}$ since the size of the output can be exponentially larger than the size of the input.
It turns out that the main complexity classes have also been characterized
algebraically, by restricted form of recursion scheme.
A foundational result in that spirit is due to Cobham, who gave in
\cite{cob65} a characterization of function computable in polynomial time. The idea is to consider schemes similar to primitive
recursion, but with restricting the number of
induction steps.
Let $\succzero{.}$ and $\succun{.}$ be the successor functions defined by
$\succzero{x}=2.x$
and $\succun{x}=2.x+1$.
\begin{definition}[Bounded recursion on notations]
A function $f$ is defined by bounded recursion scheme on notations
from $g, h_0, h_1, k$, denoted by $f=\BRN(g,h_0,h_1)$, if
\begin{eqnarray*}
f(0, \tu y) &=& g(\tu y)\\
f(\succzero{x}, \tu y) &=& h_0(f(x, \tu y) , x, \tu y) \mbox{ for $x \neq 0$} \\
f(\succun{x}, \tu y) &=& h_1(f(x, \tu y), x, \tu y) \\
\mbox{
under the condition that: } \\
f(x, \tu y) &\le & k(x, \tu y)
\end{eqnarray*}
for all $x,\tu y$.
\end{definition}
Based on this scheme, Cobham proposed the following class of functions:
\begin{definition}[$\mathcal{F}_p$]
The class $\mathcal{F}_p$ is the smallest class of primitive
recursive functions containing $\mathbf{0}$, the projections $\projection{i}{p}$, the
successor functions $\succzero{x}=2.x$ and $\succun{x}=2.x+1$, the function
$\# $ defined by $x \# y = 2 ^{\length{x} \times \length{y}}$ and closed by
composition and by bounded recursion scheme on notations.
\end{definition}
This class turns out to be a characterization of polynomial time:
\begin{theorem}[\cite{cob65}, see \cite{Clo95} for a proof]
$\mathcal{F}_p = \cp{FPTIME}$.
\end{theorem}
Cobham's result opened the way to various characterizations of
complexity classes, or various ways to
control recursion schemes. This includes the famous
characterization of $\Ptime$ from Bellantoni and Cook
in~\cite{bs:impl} and by Leivant in~\cite{Lei-LCC94}. Refer to
\cite{Clo95,clote2013boolean} for monographies presenting a whole
serie of results in that spirit.
The task to capture $\cp{FPSPACE}$ is less easy since the principle of such characterizations is to use classes of functions closed by composition. However, for function with a reasonable output size some characterizations have been obtained.
Let us denote by $\mathcal{F}_\cp{PSPACE}$, the class of functions of polynomial growth i.e. of functions $f:\N^k \rightarrow \N$, such that, for all $\tu x \in \N^k$, $\length{f(\tu x)}=O(\max_{1\leq i \leq k} \length{x_i})$. The following then holds:
\begin{theorem}[{\cite{thompson1972subrecursiveness},\cite[Theorem 6.3.16]{clote2013boolean}}]
A function over the integers is in $\mathcal{F}_\cp{PSPACE}$ if and only if it belongs
to the smallest set of functions that contains the constant function
$\mathbf{0}$, the projection functions $\projection{i}{p}$, the functions
successor $\mathbf{s}$, function $\#$
that is closed under composition and bounded recursion.
\end{theorem}
\section{Computability and Discrete ODEs}\label{sec:Computability and Discrete ODEs}
Before coming back to efficient algorithms and complexity theory, we consider functions defined by ODE under the prism of
computability. This part is clearly inspired by ideas from \cite{Cam01,
cam:moo:fgc:00}, but adapted here for our framework of discrete ODEs
that we believe to provide simpler explanations of statements of these
papers.
Our settings in
particular avoid discussions related to how to deal with noise in
computations, as we are living in a world where computations are
exact. Furthermore, we
believe it
clearly helps the intuition of many of the constructions done in all
these references.
\subsection{About positive and negative integers and encodings}
As classical
computability is mainly dealing with functions over the natural
integers, i.e. over $\N$, while schemes with discrete ODEs naturally deals with
functions over the integers, i.e. over $\Z$, we need to fix some
conventions to be able to compare classes over the integers. Notice
that this is
very natural in our framework to consider functions that may
take negative values.
\begin{definition}[Representation of integers]\label{def:representation of integers}
The set $\Z$ of integers can be encoded by the set $\{0,1\} \times \N$: couple $(s,n)$
with $s \in \{0,1\}$, $n \in \N$
encodes $(-1)^s n$. Notice that $0$ corresponds both to $(0,0)$ and
$(1,0)$.
To avoid confusion, we will denote by $\tZ$ the set $\{0,1\} \times \N$.
\end{definition}
We will only deal with classes $\mathcal{C}$ of functions over
either the natural integer $\N$ or integers $\Z$.
We basically use the same convention for functions : let $f:\N^k\times
\Z^h \rightarrow \N^r \times \Z^s$, we denote by $\tilde{f}:\N^k\times
\tilde{\Z}^h \rightarrow \N^r \times \tilde{\Z}^s$ the function
equivalent to $f$ with above representation.
Note that, if $x,y$ and $z$ are such that $x=y+z$ then $\tilde{x}=\tilde{y} \tilde{+} \tilde{z}$ and $\tilde{+}$ is primitive recursive. The same holds for multiplication and subtraction.
\subsection{Recursive and subrecursive classes of functions}
A first key remark is that at a computability level, many schemes can
actually be seen as particular natural types of ODEs.
\subsection{Subrecursive functions and discrete ODEs}
First, the purpose of this subsection is to observe that primitive
recursion is basically a discrete ODE schemata:
\begin{definition}[(Scalar) Discrete ODE schemata] \label{def:dode2}
Given $g: \N^p \to \N$ and
$h: \Z\times \N^{p+1} \to \Z$, we say that $f$ is
is defined by discrete ODE solving from $g$ and $h$, denoted by
$f=\ODE(g,h)$, if $f: \N^{p+1} \to \Z$
corresponds to the (necessarily unique) solution of Initial Value
Problem
\begin{oureqnarray}
\label{eq:cauchy2}
\dderiv{f(x,\tu y)}{x} &=& h(f(x,\tu y),x,\tu y)\\
f(0,\tu y)&=& g(\tu y ).
\end{oureqnarray}
\end{definition}
\begin{remark}
To be more general, we could take $g:\N^p \to \Z$. However, this would be of no use in the context of this paper.
\end{remark}
\begin{lemma}[Primitive recursion vs Discrete ODEs] \label{thm: primrecVsDODE}
\begin{enumerate}
\item Consider $g$ and $h$ as in Definition \ref{def:dode2} and $f=\ODE(g,h)$. Then
$\tilde{f}$ is primitive recursive when $g$ and $\tilde{h}$ are.
When $f:\N^{p+1}\rightarrow \N$, then $f$ is primitive recursive under the same conditions
\item Consider $g$ and $h$ as in Definition
\ref{def:classique}. Then $f=\REC(g,h)$ corresponds also to
$f=\ODE(g,\overline{h})$ where $\overline{h}: \N^{p+2} \to \Z$ is
defined by
$$\overline{h} (f(x,\tu y),x,\tu y)= h(f(x,\tu y),x,\tu y)-f(x,\tu y).$$
\end{enumerate}
\end{lemma}
\begin{proof}
For statement 1., applying the ODE schemata on primitive recursive
functions $\tilde{h}$ and $g$, it holds that: $f(0,\tu y) = g(\tu y)$ and
$\tilde{f}(x+1,\tu y)=\tilde{h}(\tilde{f}(x,\tu y),x,\tu y)+
\tilde{f}(x,\tu y)$, where addition is redefined to apply to elements of $\tilde{\Z}$. This is easily seen to be primitive recursive. When $f:\N^{p+1}\rightarrow \N$, one can extract $f(x,\tu y)$ from $\tilde{f}(x,\tu y)$ by a primitive recursive function.
For statement 2., remark that $h(f(x,\tu y),x,\tu y)-f(x,\tu y) = f(x+1,\tu
y) - f(x, \tu y) = \dderiv{f(x,\tu y)}{x}$.
\end{proof}
Lemma~\ref{thm: primrecVsDODE} combined with Definition
\ref{def:classique} provides the following important characterization
of primitive recursive functions in terms of discrete ODEs.
\begin{theorem}[A discrete ODE characterization of primitive recursive
functions]
The set of primitive recursive functions $\PR$ is the intersection
with $\N^\N$ of the smallest set of functions that contains the zero
functions $\mathbf{0}$, the projection functions $\projection{i}{p}$, the addition and subtraction functions $\plus$ and $\minus$, and that is closed under composition and discrete $\ODE$
schemata.
\end{theorem}
\subsection{Elementary functions, \Greg{} hierarchy and linear
discrete ODEs}
\label{sec:greg}
Actually, this is even possible to be more precise, and provide a
characterization of the various subrecursive classes introduced up to
now. This part is clearly inspired from ideas from \cite{Cam01,
cam:moo:fgc:00}, adapted here for discrete ODEs.
This is very natural to
restrict to linear
ODEs. This provides natural ways to talk about elementary functions and levels of the \Greg{}
hierarchy.
\begin{definition}[(Scalar) Linear ODE schemata] \label{def:lode2}
Given $g: \N^p \to \N$, $a: \N^{p+1} \to \Z$ and $b: \N^{p+1} \to \Z$, we say that
$f$ is obtained by linear ODE solving from $g,a$ and $b$, denoted by $f=\LI(g,a,b)$,
if $f: \N^{p+1} \to \Z$ corresponds to the (necessarily unique) solution of Initial Value
Problem
\begin{oureqnarray}
\label{eq:lincauchy2}
\dderiv{f(x,\tu y)}{x} &=& a(x,\tu y) \cdot f(x,\tu y) + b(x,\tu y)\\
f(0,\tu y)&=& g(\tu y ).
\end{oureqnarray}
\end{definition}
First observe that bounded sums and products are of this specific
form:
\begin{lemma}[Bounded sum]\label{bsum}
Let $k:\N^{p+1} \to \N$ be given.
Then
$f=\BSUMs(k)$ is the unique solution of initial value problem
\begin{eqnarray*}
\dderiv{f(x,\tu y)}{x} &=& k(x,\tu y)\\
f(0,\tu y)&=& 0
\end{eqnarray*}
\end{lemma}
\begin{lemma}[Bounded product]\label{bprod}
Let $k:\N^{p+1} \to \N$ be given.
Then
$f=\BPRODs(k)$ is the unique solution of initial value problem
\begin{eqnarray*}
\dderiv{f(x,\tu y)}{x} &=& f(x,\tu y) \cdot (k(x,\tu y)-1)\\
f(0,\tu y)&=& 1
\end{eqnarray*}
\end{lemma}
In the context of Ordinary Differential Equations, this is very natural
not to restrict to scalar functions, and the
following makes a clear natural sense.
\begin{definition}[Linear ODE schemata] \label{def:lode3}
Given a vector $\tu G=(G_i)_{1 \le i \le k}$
matrix $\tu A=(A_{i,j})_{1 \le i,j \le k}$,
$\tu B= (B_i)_{1 \le i \le k}$ whose coefficients corresponds to functions
$g_i: \N^p \to \N^k$, and
$a_{i,j}: \N^{p+1} \to \Z$ and $b_{i,j}: \N^{p+1} \to \Z$
respectively, we say that
$\tu f$ is obtained by linear ODE solving from $g,A$ and $B$, denoted
by $\tu f=\LI(\tu G,\tu A, \tu B)$,
if $f: \N^{p+1} \to \Z^k$ corresponds to the (necessarily unique) solution of Initial Value
Problem
\begin{oureqnarray}
\label{eq:lincauchy3}
\dderiv{\tu f(x,\tu y)}{x} &=& \tu A(x,\tu y) \cdot \tu f(x,\tu y) + \tu B(x,\tu y)\\
\tu f(0,\tu y)&=& \tu G(\tu y ).
\end{oureqnarray}
\end{definition}
One key observation behind the coming characterizations is the following:
\begin{lemma}[Elementary vs Linear ODEs]\label{elemVsLinODE}
Consider $\tu G,\tu A$ and $\tu B$ as in Definition \ref{def:lode3}. Then
$\tilde{\tu f}=\LI(\tu G,\tu A, \tu B)$ is elementary when $\tu G,
\tilde{\tu A}$ and $\tilde{\tu B}$ are.
\end{lemma}
\begin{proof}
We do the proof in the scalar case, writing
$a,b,g$ for $\tu A,\tu B, \tu G$. The
general (vectorial) case follows from similar arguments.
By Lemma~\ref{def:solutionexplicitedeuxvariables}, it follows that:
\[f(x,\tu y) = \left( \prod_{t=0} ^{t=x-1} (1+a(t,\tu y)) \right) \cdot g(\tu y) +
b (x-1,\tu y) +
\sum_{u=0}^{x-2} \left( \prod_{t=u+1}^{x-1} (1+a(t,\tu y)) \right) \cdot b(u,\tu y).\]
Clearly, $ \prod_{t=0} ^{t=x-1} (1+a(t,\tu y))=\BPRODs(1+a(t,\tu y))(x,\tu y)$. Similarly,
\[
p(u,x,\tu y) =^{def} \prod_{t=u+1}^{x-1} (1+a(t,\tu y))=\frac{\BPRODs(1+a(t,\tu y))(x,\tu y)}{\BPRODs(1+a(t,\tu y))(u+1,\tu y)}
\]
As the function $(x,y)\mapsto \lfloor x/y \rfloor$ is elementary from
Lemma \ref{lem:derose}, we get that $p(x,\tu y)$ is elementary.
As multiplication is elementary, it follows that $$\sum_{u=0}^{x-2}
p(x,\tu y) b(u,\tu y) = \BSUMs(p(u,x,\tu y) b(u,\tu y) )(x-2,\tu y)$$ is also
elementary , and $\tilde{f}$ is elementary using closure by
composition and multiplication.
\end{proof}
We get the following elegant characterization of the Elementary
functions in terms of Linear ODEs.
\begin{theorem}[A discrete ODE characterization of elementary
functions] \label{th:elem2}
The set of elementary functions $\Elem$ is the intersection
with $\N^\N$ of the smallest set of functions
that contains the zero functions $\mathbf{0}$, the projection functions $\projection{i}{p}$,
the successor function $\mathbf{s}$, addition
$\plus$, subtraction $\minus$, and that is closed under composition and
discrete linear ODE schemata (respectively: scalar discrete linear
ODE schemata) $\LI$.
\end{theorem}
Inspired by bounded recursion, this also makes sense to consider the
following (as expected, we write $\tu u \leq \tu v$ if it holds componentwise):
\begin{definition}[Bounded discrete ODE schemata] \label{def:limdode}
Given $\tu g(\tu y): \N^p \to \N^k$ and
$\tu h(\tu f,x,\tu y): \Z^k \times \N^{p+1} \to \Z^k$, and $\tu i(x,\tu y):\N^{p+1} \to \Z^k$,
we say that $\tu f$ is
is defined by bounded discrete ODE solving from $\tu g$,$\tu h$ and $\tu i$, denoted by
$\tu f=\limODE(\tu g,\tu h,\tu i)$, if $\tu f: \N^{p+1} \to \Z^k$
corresponds to the (necessarily unique) solution of Initial Value
Problem
\begin{eqnarray*} \label{eq:cauchy3}
\dderiv{\tu f(x,\tu y)}{x} &=& \tu h(\tu f(x,\tu y),x,\tu y)\\
\tu f(0,\tu y)&=& \tu g(\tu y ) \\
\mbox{ under the condition that: } \\
\tu f(x,\tu y ) &\le& \tu i(x, \tu y)
\end{eqnarray*}
\end{definition}
\begin{lemma}[Primitive recursion vs Discrete ODEs]\label{primRecODEequ}
\begin{enumerate}
\item Consider $\tu g$, $\tu h$, $\tu i$ as in Definition \ref{def:limdode}. Then
$\tilde{\tu f}=\limODE(\tu g,\tilde{\tu h},\tu i)$ is in $\E_n$ when $\tu g$ and $\tu h$
and $\tu i$ are, and $n \ge 3$.
\item Consider $\tu g$, $\tu h$, $\tu i$ as in Definition
\ref{def:limclassique}. Then $\tu f=\limREC(\tu g,\tu h,\tu i)$ corresponds also to
$\tu f=\limODE(\tu g,\overline{\tu h},\tu i)$ where $\overline{\tu h}: \N^{p+2} \to \Z^k$ is
defined by
$\overline{\tu h} (\tu f,x,\tu y)= \tu h(\tu f,x,\tu y)-\tu f.$
\end{enumerate}
\end{lemma}
\begin{proof} For statement 1., this follows from exactly the same proof as
for Lemma \ref{elemVsLinODE}.
Second item can be proved by observing that $\dderiv{\tu f(x,\tu y)}{x}
= \overline{\tu h}(\tu f(x,\tu y),x,\tu y) = \tu f(x+1, \tu y) - \tu f(x, \tu y)$
which is equal to $\tu h(\tu f(x, \tu y), x, \tu y) - \tu f(x, \tu y)$ by
Definition~\ref{def:limdode}.
\end{proof}
This provide the following elegant characterizations of the levels of
the \Greg{} hierarchy in terms of bounded linear ODEs.
\begin{theorem}[A discrete ODE characterization of $\Gregn$ for $n \ge
3$]
For all $n \ge 3$, the set of functions in $\E_{n}$ is the smallest set of functions
that contains $\gE_n$, constant function
$\mathbf{0}$, the projection functions $\projection{i}{p}$, the functions successor $\mathbf{s}$,
and that is closed under composition and $\limODE$.
\end{theorem}
\begin{proof}
Using Theorem~\ref{rqBsumbprod}, this follows from Lemmas
\ref{bsum}, \ref{bprod} and \ref{primRecODEequ}.
\end{proof}
\subsection{Computability and discrete ODEs}
If we want to talk about computable functions, and not only about
subrecursive functions, a first method is to add directly minimization
to considered operators.
\subsubsection{By adding a minimization operator}
\begin{theorem}[A discrete ODE characterization of total recursive
functions]
The set of total recursive functions $\Elem$ is the intersection
with $\N^\N$ of the smallest set of functions
that contains the zero functions $\mathbf{0}$, the projection functions $\projection{i}{p}$,
the successor function $\mathbf{s}$, addition
$\plus$, subtraction $\minus$, and that is closed under composition and
discrete (even linear) ODE schemata $\LI$, and safe minimization.
\end{theorem}
\begin{proof}
One direction follows from Theorem \ref{th:elem2} (characterization of
elementary functions) and Theorem \ref{normalform} (normal form
theorem) in one
direction. And from a clear generalization of previous arguments in
the other direction.
\end{proof}
\subsubsection{By programming minimization}
But actually, minimization can be programmed using discrete ODEs \emph{in some
sense}.
Indeed, minimization can be programmed in the following sense.
\begin{theorem}[Programming Minimization]
Consider a function $g: \N^{p+1} \to \N$.
Then the solution of initial value problem
\begin{eqnarray*}
f(0,\tu y) &=& 0 \\
\dderiv{f(x,\tu y)}{x} &=& \cond{g(f(x,\tu y))}{1}{0} \\
\end{eqnarray*}
\noindent is such that for all $\tu y$, $f(x,\tu y)$ is eventually a
constant $k=k(\tu y)$ when $x$ increases if and only if there is some
$x$ with $g(x,\tu y)=0$. This constant $k(\tu y)$ corresponds to $\SMIN(g)(\tu y)$ for all $\tu
y$.
\end{theorem}
This leads to the following natural concept: The idea is that $\SMIN(g)$ is computable in
the following sense considering $h_1(x,\tu y) = f(x,\tu y)$ and
$h_2(x,\tu y)=\signcompn{g(f(x,\tu y))}$.
\begin{definition}[Discrete ODEs as a computational model]
We say that a total function $f: \N^p \to \N$ is ODE computable if there
exist some function $h_1,h_2: \N^{p+1} \to \N^2$ in the smallest set of functions
that contains the zero functions $\mathbf{0}$, the projection functions $\projection{i}{p}$,
the successor function $\mathbf{s}$, and that is closed under composition and
discrete $\ODE$ schemata such that:
for all $\tu y$,
\begin{itemize}
\item there exists some $T=T(\tu y)$ with
$h_2(T,\tu y) \neq 0$;
\item $f(\tu y) = h_1 (T,\tu y)$ where $T$ is the smallest such $T$.
\end{itemize}
\end{definition}
The following is then easy to establish:
\begin{theorem}[Discrete ODE computability = classical computability]
A total function $f$ is ODE computable if and only if it is total
recursive.
\end{theorem}
\section{Restricted recursion and integration schemes}
\label{sec:restrict}
In order to talk about complexity instead of computability, we need to
put some restrictions on integrations schemes.
{
\begin{remark} Observe that this is necessary. Indeed, the solution of a polynomial ordinary differential
equation (ODE) can grow very very fast.
Indeed:
\begin{eqnarray*}
\left(\fallingexp{x}\right)^\prime &=& \fallingexp{x} \\
\left(\fallingexp{\fallingexp{x}}\right)^\prime &=& \fallingexp{x}
\cdot \fallingexp{\fallingexp{x}} \\
\left(\fallingexp{\fallingexp{\fallingexp{x}}}\right)^\prime &=&
\fallingexp{x} \cdot
\fallingexp{\fallingexp{x}} \cdot
\fallingexp{\fallingexp{\fallingexp{x}}}
\\
&\vdots& \\
\end{eqnarray*}
and so on,
is solution of degree 2 polynomial ODE:
\begin{eqnarray*}
y^\prime_1&=& y_1 \\
y^\prime_2&=& y_1 \cdot y_2 \\
y^\prime_3&=& y_2 \cdot y_3 \\
&\vdots&
\end{eqnarray*}
with initial condition $y_1(0)=y_2(0)=y_3(0)=\dots=1$.
That means that if we consider a two general integration
scheme, then we get such towers of exponentials. Clearly, such
a function is not polynomial time computable, as only writing
its value in binary cannot be done in polynomial time.
\end{remark}
}
We propose to introduce the following variation on the notion of
derivation: derivation along some function $\mathcal{L}(x, \tu y)$.
\begin{definition}[$\mathcal{L}$-ODE] Let $\mathcal{L}:\N^{p+1} \rightarrow \Z$. We write
\begin{equation}\label{lode}
\dderivL{\tu f(x,\tu y)}= \dderiv{\tu f(x,\tu y)}{\mathcal{L}(x,\tu
y)} = \tu h(\tu f(x,\tu y),x,\tu y),
\end{equation}
as a formal synonym for
$$ \tu f(x+1,\tu y)= \tu f(x,\tu y) + (\mathcal{L}(x+1,\tu y)-\mathcal{L}(x,\tu y)) \cdot
\tu h(\tu f(x,\tu y),x,\tu y).$$
%
\end{definition}
\begin{remark}
This is motivated by the fact that the latter expression is similar to
classical formula for classical continuous ODEs:
$$\frac{\delta f(x,\tu y )}{\delta x} = \frac{\delta
\mathcal{L} (x,\tu y) }{\delta x} \cdot \frac{\delta f(x,\tu
y)}{\delta \mathcal{L}(x, \tu y)}.$$
\end{remark}
This will allow us to simulate suitable change
of variables using this analogy.
We
will talk about $\mathcal{L}$-IVP when some initial condition is added. An important special case is when $\mathcal{L}(x, \tu y)$ corresponds to the
length $\mathcal{L}(x,\tu y)=\length{x}$
function: we will call this special case length-ODEs.
\begin{example}[Example \ref{ex:some} continued]
The trick used in Example \ref{ex:some} can be read as using a new parameter
$t=\length{x}$ logarithmic in $x$, using relation
$$ \dderiv{\fonction{some}_h(x)}{\length{x}} = E(\fonction{some}_h(x),\length{x},x).$$
\end{example}
\begin{example}[Function $2^{\length{x}}$ and $2^{\length{x}^2}$]
To compute function $f: x \mapsto
2^{\length{x}}$,
a method would consist in computing $f(x)$ using the fact $f(x) =
\dint{0}{x}{f'(t)}{t}$ which would \textit{a priori}
requires time
$x$;
%
But a more efficient method consists in stating that
$f(x)=F(\length{x})$ where $F(t)=2^t$ is solution of IVP
$F'(t)= F(t)$, $F(0)=1$.
This is a fast (polynomial) algorithm to solve our problem. Once
again,
we have used a change of variable in order to
compute faster.
Thinking about what we have just done, we have basically observed the
fact that
\[
(2^{\length{x+1}} ) '=
\length{x}'
\cdot 2^{\length{x}}
\mbox{ that is to say }
\dderiv{2^{\length{x}}}{\length{x}} = \length{x}' \cdot 2^{\length{x}}
\]
This is what leaded us to consider change of variable $t=
\length{x}$ and what leaded to above more efficient algorithm,
considering $F(t)$ instead of $f(x)$, with similarities with the
relation for continuous derivative
$\frac{\delta f(x )}{\delta t} = \frac{\delta
t}{\delta x} \cdot \frac{\delta f(x)}{\delta t}$.
Suppose now that we want to compute function $f: x \mapsto
2^{\length{x}^2}$.
We can use the same principle, observing that
$$
(2^{\length{x+1}^2 } ) '=
(\length{x+1}^2-\length{x}^2)
\cdot 2^{\length{x}^2}
$$
\mbox{ that is to say }
$$
\dderivL{ 2^{\length{x}^2}}= \left(\length{x}^2\right)' \cdot
2^{\length{x}^2}
\mbox{ considering } \mathcal{L}(x) = \length{x}^2
$$
and then noticing that $f$ is consequently computed fast (in polynomial time) as
$F(\length{x}^2)$.
\end{example}
{
\begin{example}
$f(x,y)=2^{\length{x}\cdot \length{y}}$ is the solution of the
following length-IVP:
\begin{eqnarray*}
f(0, y)&=&2^{|y|} \\
\dderivl{f(x, y)} &=& f(x,y)\cdot (2^{\length{y}}-1),
\end{eqnarray*}
\noindent since $2^{\length{x+1}\cdot \length{y}}=2^{\length{x}\cdot
\length{y}} + \length{x}' \cdot
2^{\length{x}\cdot \length{y}}\cdot (2^{\length{y}}-1).$
\end{example}
}
\subsection{General theory}
The following result
though simple, illustrate one key property of the $\mathcal{L}$-ODE scheme under a computational point of view: it's dependence on the number of distinct values of function $\mathcal{L}$.
\begin{definition}[$Jump_\mathcal{L}$]
Let $\mathcal{L}(x,\tu y)$ be some function.
Fixing $\tu y$, we write $Jump_\mathcal{L}(x,\tu y)=\{0 \le i \le x-1 | \mathcal{L}(i+1,\tu y) \neq \mathcal{L}(i,\tu
y)\}$
(that is to say the set of points where $\mathcal{L}$ has a value that changes)
and $\alpha:[0..|Jump_\mathcal{L}(x,\tu y)|-1]\rightarrow Jump_\mathcal{L}(x,\tu y)$ for an
increasing function enumerating these points: If $i_0 < i_1 < i_2 <
\dots < i_{card(Jump_\mathcal{L}(x,\tu y))-1}$ denote
all elements of $Jump_\mathcal{L}(x,\tu y)$, then
$\alpha(j)=i_j\in Jump_\mathcal{L}(x,\tu y)$.
\end{definition}
\begin{lemma}[Fundamental Observation]\label{lem:fundamental observation} Let $k\in \N$, $f: \N^{p+1}\rightarrow \Z^d$ and
$\mathcal{L}:\N^{p+1}\rightarrow \Z$ be some functions.
Assume that \eqref{lode} holds.
Then:
$$\tu f(x,\tu y) =
\tu f(0,\tu y) + \dint{0}{card(Jump_\mathcal{L}(x,\tu y))}{
{\Delta
\mathcal{L}(\alpha(u),\tu y)
\cdot \tu h(\tu f(\alpha(u),\tu y),\alpha(u),\tu y)}{u}$$
\end{lemma}
\begin{proof}
By definition, we have
$$\tu f(x+1,\tu y) = \tu f(x,\tu y) + (\mathcal{L}(x+1,\tu y)-\mathcal{L}(x,\tu
y)) \cdot \tu h(\tu f(x,\tu y),x,\tu y).$$
Hence,
\begin{itemize}
\item as soon as $i \not\in Jump_\mathcal{L}(x,\tu y)$, then $\tu
f(i+1,\tu y)=\tu f(i,\tu y)$, since
$\mathcal{L}(i+1,\tu y)-\mathcal{L}(i,\tu y)=0$. In other words, $$\Delta
\tu f(i,\tu y)=0.$$
\item as soon as $i \in Jump_\mathcal{L}(x,\tu y)$, say $i=i_j$,
then $$\Delta \tu f(i_j,\tu y) = (\mathcal{L}(i_j+1
,\tu y)-\mathcal{L}(i_j,\tu y)) \cdot \tu h(\tu f(i_j,\tu y),i_j,\tu y)$$
I.e.
$$
\Delta \tu f(i_j,\tu y) =
\Delta \mathcal{L}(i_j,\tu y) \cdot \tu h(\tu f(i_j,\tu y),i_j,\tu y) $$
\end{itemize}
Now
\begin{eqnarray*}
\tu f(x,\tu y) &=& \tu f(0,\tu y) + \dint{0}{x}{\Delta
{\tu f(t,\tu y)}}{t} \\
&=& \tu f(0,\tu y) +
\sum_{t=0}^{x-1} \Delta {\tu f(t,\tu y)} \\
&=& \tu f(0,\tu y) + \sum_{i_j
\in Jump_\mathcal{L}(x,\tu y)} \Delta
{\tu f(i_j,\tu y)} \\
&=& \tu f(0,\tu y) + \sum_{i_j \in Jump_\mathcal{L}(x,\tu y)} \Delta \mathcal{L}(i_j,\tu y) \cdot
\tu h(\tu f(i_j,\tu y),i_j,\tu y) \\
&=& \tu f(0,\tu y) + \sum_{j=0}^{card(Jump_\mathcal{L}(x,\tu y))-1} \Delta \mathcal{L}(\alpha(j),\tu y) \cdot
\tu h(\tu f(\alpha(j),\tu y),\alpha(j),\tu y) \\
&=& \tu f(0,\tu y) + \dint{0}{card(Jump_\mathcal{L}(x,\tu y))}{\Delta
\mathcal{L}(\alpha(u),\tu y) \cdot \tu h (\tu f(\alpha(u),\tu
y),\alpha(u),\tu y)}{u}
\end{eqnarray*}
which corresponds to the expression.
\end{proof}
The proof of the Lemma is based on (and illustrates) some fundamental
aspect of $\mathcal{L}$-ODE from their definition: for fixed $\tu y$, the value of $\tu f(x,\tu y)$ only
changes when the value of $\mathcal{L}(x,\tu y)$ changes. This implies that
the value of $\tu f(x,\tu y)$ must then depend on $\tu y$ and
$\mathcal{L} (x,\tu
y)$.
{
We formalize this in the following definition.
\begin{definition}[$\mathcal{L}$-expressiveness]
Let $k\in \N$, $f: \N^{p+1}\rightarrow \Z^d$ and
$\mathcal{L}:\N^{p+1}\rightarrow \Z$ be some functions.
We say that $\tu f(x,\tu y)$ is $\mathcal{L}$-expressible if
there exists some function $\tu g:\N^{p+1}\rightarrow \Z$ such
that $\tu f(x,\tu y)=\tu g(\mathcal{L}(x,\tu y),\tu y)$.
\end{definition}
\begin{corollary}
Let $k\in \N$, $f: \N^{p+1}\rightarrow \Z^d$ and
$\mathcal{L}:\N^{p+1}\rightarrow \Z$ be some functions as above.
Then $\tu f(x,\tu y)$ is $\mathcal{L}$-expressible.
\end{corollary}
} Let's make a pause to ponder. From the above results, if $\mathcal{L}$ is chosen such that
$|Jump_\mathcal{L}(x,\tu y)|=|\{0 \le
i \le
x - 1| \mathcal{L}(i+1,\tu y) = \mathcal{L}(i,\tu y)\}| \leq P(\length{x}, \length{\tu y})$
for some polynomial $P$ then, the number of distinct values
of $\tu f(x',\tu y)$ with $x'\leq x$ that are necessary to compute
$\tu f(x,\tu y)$ is polynomial in $\length{x}$ and $\length{\tu y}$. Hence, at least in
terms of the number of steps (not necessarily in terms of the size of
the intermediate objects), $\tu f(x,\tu y)$ can be computed fast.
\subsection{Fundamental alternative view}
If previous hypotheses hold, there is then an alternative view to
understand the integral, by using a change of variable, and by
building a discrete ODE that mimics the computation of the
integral.
Basically, we are using the fact that we can consider some
parameter $t$ corresponding to $\mathcal{L}(x,\tu y)$.
Indeed:
\begin{lemma}[Fundamental alternative view] \label{fundob}
Let $k\in \N$, $f: \N^{p+1}\rightarrow \Z^d$,
$\mathcal{L}:\N^{p+1}\rightarrow \Z$ be some functions and assume that \eqref{lode} holds.
Then $\tu f(x,\tu y)$ is given by
$\tu f(x,\tu y)= \tu F(\mathcal{L}(x,\tu y),\tu y)$
where $\tu F$ is the solution of initial value problem
\begin{eqnarray*}
\dderiv{\tu F(t,\tu y)}{t} &=&
{\Delta\mathcal{L}(t,\tu y)
\cdot
\tu h(\tu F(t, \tu y),t,\tu y) \\
\tu F(0,\tu y)&=&\tu f(\mathcal{L}(0,\tu x),\tu y).
\end{eqnarray*}
We will say in that case the IVP is converging ``in time $\mathcal{L}(x,\tu y)$''
to $\tu f(x,\tu y)$.
Conversely, if there is such a function $\tu F$, then a discrete ODE
of the type of \eqref{lode} can easily be derived.
\end{lemma}
{
\begin{example}
The previous discussion about the complexity of computing $x \mapsto
2^{\length{x}}$ and $x \mapsto 2^{\length{x}^2}$ is a
concrete applications of all these remarks.
\end{example}
}
\begin{example}
Let us consider an example, where $\mathcal{L}(x)$ is not
$\length{x}$ (or a power of it): Suppose we want to compute
$f: x \mapsto 2^{ \lfloor \sqrt{x} \rfloor }$:
Consider
$\mathcal{L}(x) = \lfloor \sqrt{x} \rfloor$.
We have $$ \dderiv{f(x)}{\mathcal{L}(x)} = \mathcal{L}'(x) \cdot f(x) = \left(
\lfloor \sqrt{x+1} \rfloor -
\lfloor \sqrt{x} \rfloor \right) \cdot f(x).
$$
One may think that the number
$|Jump_\mathcal{L}(x)|$ of $\mathcal{L}$, i.e. the number of jumps
of factor $(\lfloor \sqrt{x+1} \rfloor -
\lfloor \sqrt{x} \rfloor)$ is hard to predict, but the point is to
look at the method we devised to compute $ \lfloor \sqrt{x} \rfloor$
in Example \ref{sec:racine}: It is basically expressing $\lfloor \sqrt{x}
\rfloor$ as some function $G$ of $\fonction{some}_h(x)$: We wrote $\lfloor \sqrt{x}
\rfloor = G( \fonction{some}_h(x))$ for some function $G$.
Consequently, we could
also consider variable $\mathcal{L}_2(x)=\fonction{some}_h(x)$, and see
from expressions that the
number of jumps $|Jump_\mathcal{L}(x)|$ of previous $\mathcal{L}$ is actually
related to the $|Jump_{\mathcal{L}_2}(x)|$ of
this new $\mathcal{L}_2(x)$.
We also have
$$ \dderiv{f(x)}{\mathcal{L}_2(x)} = \mathcal{L}_2'(x) \cdot f(x) = \left(
G( \fonction{some}_h(x+1))- G( \fonction{some}_h(x) \right) \cdot f(x).
$$
Observing
that $\fonction{some}_h(x)$ is in turn
computed in ``time'' $\length{x}$ using the method of Example
\ref{sec:racine}, the number of jumps
for all these $\mathcal{L}(x)$ are always polynomials, and we are guarantee
that all these
expressions lead to fast (polynomial) algorithms.
\end{example}
\begin{remark}
This method clearly extends to more general functions: Generalizing
the above reasoning, we can compute fast functions of type $x \mapsto g(
\lfloor \sqrt{x} \rfloor)$ as soon as we have a fast ODE computing
$g$. Similarly, $\lfloor \sqrt{x} \rfloor$ can be replaced by
anything that can be computed fast basically using similar
techniques.
\end{remark}
{
\subsection{Length-ODEs}
An important and natural case is the special case where $\mathcal{L}(x,\tu y)$ is the
usual one variable length function $\mathcal{L}(x,\tu y)=\length{x}$.
We will of course write $\dderivl{\tu f(x,\tu y)
$ in that
case for $\dderivL{\tu f(x,\tu y)}$.
We can adapt the Lemma above to
this special case of a what we will call length-ODE. Namely:
\begin{corollary}[First view]~\label{corollary:fundamental observation}
Let $\mathcal{L}:\N\rightarrow \N$ be defined by $\mathcal{L}(x)=\length{x}$ for all integer $x$ and $f$ satisfies the hypothesis of Lemma~\ref{lem:fundamental observation}. Then,
$$\tu f(x,\tu y) =
\tu f(0,\tu y) + \dint{0}{\length{x}}{\tu h(\tu f(2^u-1,\tu y),2^u-1,\tu y)}{u}$$
\noindent Or, equivalently:
$$\tu f(x,\tu y) = \tu f(0,\tu y) + \sum_{i=0}^{\length{x}-1}
\tu h(\tu f(2^i-1,\tu y),2^i-1,\tu y)$$
\end{corollary}
\begin{proof} Immediate consequence of Lemma~\ref{lem:fundamental observation}. Function $\alpha$ is such that $\alpha(i)=2^i-1$.
\end{proof}
\begin{corollary}[Alternative view]
Let $\mathcal{L}:\N\rightarrow \N$ be defined by $\mathcal{L}(x)=\length{x}$ for all
integer $x$ and $f$ satisfies the hypothesis of
Lemma~\ref{lem:fundamental observation}.
Then $\tu f(x,\tu y)$ is given by $\tu f(x, \tu y) =
F(\length{x},\tu y)$
\noindent where $\tu F$ is the solution of initial value problem
\[ \dderiv{\tu F(t,\tu y)}{t} = \tu h ( \tu F(t,\tu y ),t,\tu y)
\mbox{ with } \tu F(0,\tu y)=\tu f(0,\tu y)
\]
\end{corollary}
In other words, for $\mathcal{L}(x)=\length{x}$, this offers us also two ways to present a length-ODE for
a function $f(x,\tu y)$: either by considering equation of the type
of~\eqref{lode} or by considering $\tu f(x,\tu y) = \tu
F(\length{x},\tu y)$ where $\tu F$ given by an equation of the form:
\begin{equation}\label{lode2}
\dderiv{\tu F(t,\tu y)}{t} = \tu h(\tu F(t,\tu y),t,\tu y)
\end{equation}
with $\tu F(0,\tu y)=\tu f(0,\tu y)$. As before, the idea is that $t$ is a parameter logarithmic in $x$, namely
$t=\length{x}$.
}
\newcommand\vectorp[2]{\left(\begin{array}{l}
#1 \\ #2 \\
\end{array} \right)}
Our purpose now is to discuss which kind of problems can be solved
efficiently using similar techniques: it turns out to be exactly all of $\cp{FPTIME}$
It will be made clear from the incoming discussion and results.
\subsection{Linear length-ODEs}
\begin{remark}
In all previous reasoning, we considered that a function over the integers is polynomial time
computable if it is in the length of all its arguments, as this is the
usual convention. When not
explicitely stated, this is our convention.
As usual, we also say that some vectorial function (respectively:
matrix) is polynomial time computable if all its components are.
%
We will need sometimes to consider also polynomial dependency directly
in some of the variables and not on their length: This happens in the
next fundamental lemma.
\end{remark}
\newcommand\norm[1]{\| #1 \|}
We write $\norm{\cdots}$ for the sup norm: given some matrix $\tu
A=(A_{i,j})_{1 \le i \le n, 1 \le j \le m}$,
$\norm{A}=\max_{i,j}
A_{i,j}$.
\begin{lemma}[Fundamental observation] \label{fundamencore}
Consider ODE
\begin{equation} \label{eq:bc}
\tu f’(x,\tu y)= {\tu A} ( \tu f(x,\tu y),
x,\tu y) \cdot
\tu f(x,\tu y)
+ {\tu B} ( \tu f(x,\tu y),
x,\tu y).
\end{equation}
Assume:
\begin{enumerate}
\item Initial condition $\tu G(\tu y) = ^{def}
\tu f(0, \tu y)$, as well as Matrix $\tu A$
and vector $\tu B$ are polynomial time computable
\item $\length{ \norm{{\tu A} ( f, x,\tu y)} } \le
\length{\norm{\tu f}} + p_{\tu A}(x,\length{\tu y})$ for some polynomial $p_A$
\item $\length{ \norm{{\tu B} ( f, x,\tu y)} } \le
\length{\norm{ \tu f}} + p_{\tu B}(x,\length{\tu y})$ for some polynomial $p_B$
\end{enumerate}
Then its solution $\tu f(x, \tu y)$ is polynomial time computable in $x$ and the length
of $\tu y$.
\end{lemma}
\begin{proof}
We know by Lemma \ref{def:solutionexplicitedeuxvariables} that we
must have:
\begin{equation} \label{autreec}
\tu f(x,\tu y) = \left( \fallingexp{\dint{0}{x}{\tu A( \tu f(t,\tu y) ,
t,\tu y)}{t}} \right) \cdot \tu G (\tu y)+
\dint{0}{x}{ \left(
\fallingexp{\dint{u+1}{x}{\tu A(\tu f(t,\tu y) ,
t,\tu
y)}{t}} \right) \cdot \tu B( \tu f(u,\tu y) ,
u,\tu y)}{u}.
\end{equation}
The key point is that Equation \eqref{autreec} provides a (recursive)
algorithm to compute $\tu f(x, \tu y)$ for all $x$.
To see it, it may help to see that this can also be expressed as
\begin{equation} \label{autreecc}
\tu f(x, \tu y) =
\sum_{u=-1}^{x-1 } \left(
\prod_{t=u+1}^{x-1} (1+\tu A( \tu f(t,\tu y),
t,\tu y)) \right) \cdot \tu B(\tu f(u,\tu y) ,
u,\tu y).
\end{equation}
with the conventions that $\prod_{x}^{x-1} \tu \kappa(x) = 1$ and $\tu
B( \cdot ,
-1,\tu y)=\tu G(\tu y)$.
Clearly the number of arithmetic operations to evaluate $\tu f(x, \tu y)$
by this method is polynomial in $x$: basically we have to sum $x+1$
terms, each of them involving at most $x-1$ multiplications. This can
be done in the requested complexity if we are sure that the size of
the involved quantities remains polynomial in $x$ and the length of
$\tu y$.
Since the length of $\tu B(\tu f(u,\tu y) , u,\tu y)$ and of
$\tu A( \tu f(t,\tu y), t,\tu y)$ is at most polynomial in the length
of $\tu f(t,\tu y)$ we only need to be convinced that the size of
$\tu f(x, \tu y)$ remains polynomial.
But it holds, as from \eqref{eq:bc} we get
$$ \tu f(x+1, \tu y) = (1 + \tu A(\tu f(x, y), x , \tu y)) \cdot \tu
f(x,\tu y)
+ \tu B(\tu f(x, \tu y), x, \tu y) $$
\noindent and hence
\begin{eqnarray*}
\length{ \tu f(x+1, \tu y) } &\le& \max ( \length{(1 + \tu A(\tu f(x, y), x , \tu y))} +
\length{\tu f(x,\tu y)} , \length{B(\tu f(x, \tu y), x, \tu y)} ) \\
& \le & \length{\tu f(x, \tu y)} + p_{\tu f}(x, \length{\tu y}) + 1
\end{eqnarray*}
\noindent for polynomial $p_f$, that we may assume
without loss of generality to be increasing in its first argument.
It follows from an easy induction that we must have
$$\length{\tu f(x, \tu y) } \le \length{G(\tu y)} + x \cdot p_{\tu f}(x, \length{ \tu y}).$$
\end{proof}
We now go to specific forms of linear ODEs.
\newcommand\polynomial{ \fonction{sg}-polynomial}
\begin{definition}
A \polynomial{} expression $P(x_1,...,x_h)$ is a expression built-on
$+,-,\times$ (often denoted $\cdot$) and $\sign{}$ functions over a set of variables $V=\{x_1,...,x_h\}$ and integer constants.
The degree $\deg(x,P)$ of a term $x\in V$ in $P$ is defined inductively as follows:
\begin{itemize}
\item $\deg(x,x)=1$ and for $x'\in X\cup \Z$ such that $x'\neq x$, $\deg(x,x')=0$
\item $\deg(x,P+Q)=\max \{\deg(x,P),\deg(x,Q)\}$
\item $\deg(x,P\times Q)=\deg(x,P)+\deg(x,Q)$
\item $\deg(x,\sign{P})=0$
\end{itemize}
A \polynomial{} expression $P$ is \textit{essentially constant} in
$x$ if $\degre{x,P}=0$.
\end{definition}
Compared to the classical notion of degree in polynomial expression,
all subterms that are within the scope of a sign function contributes
for $0$ to the degree.
A vectorial function (resp. a matrix or a vector) is said to be a \polynomial{} expression if all
its coordinates (resp. coefficients) are.
it is said to be
\textit{essentially constant} if all its coefficients are.
A (possibly vectorial) \polynomial{} expression $\tu g(\tu f(x, \tu y), x,
\tu y)$ is said to \textit{essentially linear} in $\tu f(x, \tu y)$ if
it is of the form $$
\tu g(\tu f(x, \tu y), x,
\tu y) =
\tu A [\tu f(x,\tu y), \tu h(x,\tu y),
x,\tu y] \cdot \tu f(x,\tu y) + \tu B [\tu f(x,\tu y), \tu h(x,\tu y),
x,\tu y ]
$$
where $\tu A$ and $\tu B$ are \polynomial{} expressions essentially
constant in $\tu f(x, \tu y)$.
\begin{example}
The expression $P(x,y,z)=x\cdot \sign{(x^2-z)\cdot y} + y^3$ is linear in $x$, essentially constant in $z$ and not linear in $y$.
The expression $P(x,2^{\length{y}},z)=\sign{x^2 - z}\cdot z^2 + 2^{\length{y}}$ is essentially constant in $x$, essentially linear in $2^{\length{y}}$ (but not essentially constant) and not essentially linear in $z$. The expression:
$
\cond{x}{y}{z}=y +
\signcomp{x}\cdot (z-y)=
y + (1-\sign{x})\cdot (z-y)
$
is essentially constant in $x$ and linear in $y$ and $z$.
\end{example}
\begin{definition}
Function $\tu f$ is linear $\mathcal{L}$-ODE definable (from $\tu u$ and
$\tu g)$ if it corresponds to the
solution of $\mathcal{L}$-IVP
\begin{oureqnarray}\label{SPLode}
\dderivL{\tu f(x,\tu y)}&=& \tu u(\tu f(x,\tu y), \tu h(x,\tu y),
x,\tu y) \\
f(0,\tu y) &=& \tu g(\tu y)
\end{oureqnarray}
\noindent where $\tu u$ is \textit{essentially linear} in $\tu f(x, \tu y)$. When $\mathcal{L}(x,\tu y)=\length{x}$, such a system is called linear length-ODE.
\end{definition}
The previous statements lead to the following:
\begin{lemma}[Fundamental Observation for linear $\mathcal{L}$-ODE]~\label{lem:fundamental observation linear length ODE}
Assume that $\tu f(x,\tu y)$ is solution of \eqref{SPLode}.
Then $\tu f(x, \tu y)$
can be computed in polynomial time
under the following conditions:
\begin{enumerate}
\item $\tu f(0, \tu y)= \tu g(\tu
y)$ is computable in polynomial-time.
\item\label{fund obs cond 2} function $\tu h$ is computable in polynomial
time.
\item\label{fund obs cond 13} there exist $c\in \N$, such that, for each
$\tu y$, $|Jump_\mathcal{L}(\tu y)|\leq \length{x}^c$.
\end{enumerate}
\end{lemma}
\begin{proof}
Thanks to condition~\label{fund obs cond 3} above, we can replace
parameter $x$ and derivation in $\mathcal{L}(x,\tu y)$ by a parameter $t\leq
\length{x}^c$ and derivation in $t$ by Lemma \ref{fundob}.
This leads to an ODE of the form:
$$
\tu f’(x,\tu y)= \overline {\tu A} ( \tu f(x,\tu y),
x,\tu y) \cdot
\tu f(x,\tu y)
+ \overline {\tu B} ( \tu f(x,\tu y),
x,\tu y).
$$
by setting
\begin{eqnarray*}
\overline {\tu A} ( \tu f(x,\tu y),
x,\tu y) &=& {\tu A} ( \tu f(x,\tu y), h(x, \tu y),
x,\tu y) \\
\overline {\tu B} ( \tu f(x,\tu y),
x,\tu y) &=&
{\tu B} ( \tu f(x,\tu y), h(x, \tu y),
x,\tu y)
\end{eqnarray*}
But then Lemma \ref{fundamencore} applies, and we get precisely the
conclusion, observing that the fact that the
corresponding matrix $\overline {\tu A}$ and vector $\overline {\tu
B}$ are essentially constant in $\tu f(x, \tu y)$ guarantees
hypotheses of Lemma \ref{fundamencore}.
\end{proof}
\section{A characterization of polynomial time}
\label{sec:A characterization of polynomial time}
\subsection{Register machines}
A register machine program (a.k.a. \textsf{goto} program) is a finite sequence of ordered labeled instructions acting on a finite set of registers of one of the following type:
\begin{itemize}
\item increment the $j$th register $R_j$ by the value of $k$th
register $R_k$ and go the next instruction:
$$
R_j:=R_j+R_k$$
\item decrement the $j$th register $R_j$ by the value of $k$th
register $R_k$ and go the next instruction: $$
R_j:=R_j-R_k$$
\item set the $j$th register $R_j$ to integer $k$, for $\ell \in
\{0,1\}$ and go the next instruction: $$
R_j:=k$$
\item if register $j$ is equal to $0$, go to instruction $p$ else go to next instruction.
$$
\mathsf{if} R_j = 0 \ \textsf{goto} \ p$$
\item halt the program:
$
\mathsf{halt}
$
\end{itemize}
In the following, since coping with negative numbers on classical
models of computation can be done through simple encodings, we will
not restrict ourself to non-negative numbers.
\begin{definition} Let $t:\N \rightarrow \N$.
A function $f:\N^p\rightarrow \Z$ is computable in time $t$
by a register machine $M$ with $k$ registers if:
\begin{itemize}
\item when starting in initial configuration with registers $R_1,\dots, R_{\min(p,k)}$ set to $x_1,\dots,x_{\min(p,k)}$ and all other registers to $0$ and
\item starting on the first instruction (of label $0$),
\end{itemize}
\noindent Machine $M$ ends its computation after at most
$t(\length{\tu x})$ instructions where $\length{\tu x}=\length{x_1}+\cdots+\length{x_p}$ and with register $R_0$ containing $f(x_1,\dots,x_p)$.
A function is computable in polynomial time by $M$ if there exists
$c\in \N$ such that $t(\length{\tu x})\leq \length{\tu x}^c$ for all
$\tu x=(x_1,...,x_p)$.
\end{definition}
The definition of register machines might look rudimentary however,
the following is easy (but tedious) to prove for any reasonable encoding of integer by Turing machines.
\begin{theorem}
A function $f$ from $\N^p\rightarrow \Z$ is computable in polynomial time on Turing machines iff it is computable in polynomial time on register machines.
\end{theorem}
\subsection{A characterization of polynomial time}
The above result shows that function defined by linear length-ODE from function computable in polynomial time, are indeed polynomial time. We are now ready to introduce a recursion scheme based on solving linear differential equation to capture polynomial time.
\begin{remark}
Since the function we define take their values in $\N$ and have output
in $\Z$, composition is an issue. Instead of considering restrictions
of these function with output in $\N$ (which is always possible, even
by syntactically expressible constraints), we simply admit that
composition may not be defined in some cases.
\end{remark}
\begin{definition}
Let $\mathbb{DL}$ be the smallest subset of functions,
that contains $\mathbf{0}$, $\mathbf{1}$, projections
$\projection{i}{p}$, the length function $\length{x}$,
the addition function $x \plus y$, the subtraction function $x \minus y$, the multiplication function $x\times y$ (often denoted $x\cdot y$), the sign function $\sign{x}$
and closed under composition (when defined) and linear length-ODE
scheme. \end{definition}
\begin{remark}
As our results will show, the definition of $\mathbb{DL}$ would remain the same by considering closure under any kind of $\mathcal{L}$-ODE with $\mathcal{L}$ satisfying the hypothesis of Lemma~\ref{lem:fundamental observation linear length ODE}.
\end{remark}
\begin{example}
A number of natural functions are in $\mathbb{DL}$. the following result is immediate by inspection of the example from Section~\ref{sec:programming with ODE} and~\ref{sec:restrict}.
Functions $2^{\length{x}}$, $2^{\length{x}\cdot \length{y}}$, $\cond{x}{y}{z}$, $\textsf{suffix}(x,y)$,
$\lfloor \sqrt{x}\rfloor $, $\lfloor \frac{x}{y}\rfloor$, $2^{\lfloor \sqrt{x}\rfloor}$
all belong to $\mathbb{DL}$.
\end{example}
\begin{theorem}\label{th:ptime characterization 2}
$\mathbb{DL}= \cp{FPTIME}$
\end{theorem}
\begin{proof}
The inclusion $\mathbb{DL} \subseteq \cp{FPTIME}$ is a consequence of the fundamental observation proved in Lemma~\ref{lem:fundamental observation linear length ODE}, on the fact that arithmetic operations that are allowed can be computed in polynomial time and that $\cp{FPTIME}$ is closed under composition of functions.
We now prove that $\cp{FPTIME}\subseteq \mathbb{DL}$.
Let $f:\N^p\longrightarrow \N$ be computable in polynomial time and $M$ a $k$ registers machine that compute $f$ in time $\length{\tu x}^c$ for some $c\in \N$.
We first describe the computation of $M$ by simultaneous recursion scheme on length for functions $R_0(t,\tu x), ..., R_k(t,\tu x)$ and $\mathsf{inst}(t,\tu x)$ that give, respectively, the values of each register and the label of the current instruction at time $\length{t}$.
We start with an informal description of the characterization. Initializations of the functions are given by:
$R_0(0,\tu x)=0, R_1(0,\tu x)=x_1$, \dots, $R_p(0,\tu x)=x_p$, $R_{p+1}(0,\tu x)=\cdots = R_k(0,\tu x)=0$ et $\mathsf{inst}(0,\tu x)=0$.
Let $m\in \N$ be the number of instructions of $M$ and let $l\leq m$. Recall that, for a function $f$, $\dderiv{f}{L}(t,\tu x)$ represents a manner to describe $f(t+1,\tu x)$ from $f(t,\tu x)$ when $L(t+1)=L(t)+1$. We denote by, $\mathsf{next}_l^{I}$, $\mathsf{next}_l^{h}$, $h\leq k$, the evolution of the instruction function and of register $R_h$ after applying instruction $l$ at any such instant $t$. They are defined as follows:
\begin{itemize}
\item If instruction of label $l$ if of the type $R_j:=R_j+R_k$, then:
\begin{itemize}
\item $\mathsf{next}_l^{I}=1$ since $\mathsf{inst}(t+1,\tu x)=\mathsf{inst}(t,\tu x)+1$
\item $\mathsf{next}_l^{j}=R_k(t,\tu x)$ since $R_j(t+1,\tu x)=R_j(t,\tu x)+R_k(t,\tu x) $
\item $\mathsf{next}_l^{h}=0$ since $R_h(t,\tu x)$ does not change for $h\neq j$
\end{itemize}
\item If instruction of label $l$ if of the type $R_j:=R_j-R_k$, then:
\begin{itemize}
\item $\mathsf{next}_l^{I}=1$ since $\mathsf{inst}(t+1,\tu x)=\mathsf{inst}(t,\tu x)+1$
\item $\mathsf{next}_l^{j}=-R_k(t,\tu x)$ since $R_j(t+1,\tu x)=R_j(t,\tu x) -R_k(t,\tu x) $
\item $\mathsf{next}_l^{h}=0$ since $R_h(t,\tu x)$ does not change for $h\neq j$
\end{itemize}
\item If instruction of label $l$ if of the type $R_j:=\ell$, for
$\ell \in \{0,1\}$ then:
\begin{itemize}
\item $\mathsf{next}_l^{I}=1$ since $\mathsf{inst}(t+1,\tu x)=\mathsf{inst}(t,\tu x)+1$
\item $\mathsf{next}_l^{j}=\ell-R_j(t,\tu x)$ since $R_j(t+1,\tu x)=\ell $
\item $\mathsf{next}_l^{h}=0$ since $R_h(t,\tu x)$ does not change for $h\neq j$
\end{itemize}
\item If instruction of label $l$ if of the type $\mathsf{if}$ $R_j = 0 \ \textsf{goto} \ p$, then:
\begin{itemize}
\item $\mathsf{next}_l^{I}=\cond{R_j(t,\tu x)}{p-\mathsf{inst}(t,\tu x)}{1}$ since, in case $R_j(t,\tu x)=0$ instruction number goes from $\mathsf{inst}(t,\tu x)$ to $p$.
\item $\mathsf{next}_l^{h}=0$
\end{itemize}
\item If instruction of label $l$ if of the type $\mathbf{Halt}$, then:
\begin{itemize}
\item $\mathsf{next}_l^{I}=0$ since the machine stays in the same instruction when halting
\item $\mathsf{next}_l^{h}=0$.
\end{itemize}
\end{itemize}
The definition of function $\mathsf{inst}$ by derivation on length is now given by (we use a more readable "by case" presentation):
\[
\dderivl{\mathsf{inst}}(t,\tu x)= \fonction{case}
\left\{\begin{array}{l}
\mathsf{inst}(t,\tu x)=1 \quad \mathsf{next}_1^I \\
\mathsf{inst}(t,\tu x)=2 \quad \mathsf{next}_2^I\\
\vdots \\
\mathsf{inst}(t,\tu x)=m \quad \mathsf{next}_m^I\\
\end{array}
\right.
\]
Expanded as an arithmetic expression, this give:
\[
\dderivl{\mathsf{inst}
(t,\tu x)= \sum_{l=0}^m \big(\prod_{i=0}^{l-1} \sign{\mathsf{inst}(t,\tu x)- i}\big)\cdot \signcomp{\mathsf{inst}(t,\tu x) - l}\cdot \mathsf{next}_l^I
\]
Note that each $\mathsf{next}_l^I$ is an expression in terms of $\mathsf{inst}(t,\tu x)$ and, in some cases, in $\sign{R_j(t,\tu x)}$, too (for a conditional statement).
Similarly, for each $j\leq k$:
\[
\dderivl{R_j
(t,\tu x)= \sum_{l=0}^m \big(\prod_{i=0}^{l-1} \sign{\mathsf{inst}(t,\tu x)- i}\big)\cdot \signcomp{\mathsf{inst}(t,\tu x)- l}\cdot \mathsf{next}_l^j
\]
It is easily seen that, in each of these expressions above, there is
at most one occurence of $\mathsf{inst}(t,\tu x)$ and $R_j(t,\tu x)$ that is
not under the scope of an essentially constant function (i.e. the sign
functions). Hence, the expressions are of the prescribed form.
We know $M$ works in time $\length{\tu x}^c$ for some fixed
$c\in\N$. Both functions $\length{\tu x}=\length{x_1}+ \ldots
\length{x_p}$ and $B(\tu x)=2^{\length{\tu x}\cdot \length{\tu x}}$ are in $\mathbb{DL}$. It is easily seen that : $\length{\tu x}^c\leq B^{(c)}(\length{\tu x}))$ where $B^{(c)}$ is the $c$-fold composition of function $B$.
We can conclude by setting $f(\tu x)=R_0(B^{(c)}(\max(\tu x)),\tu x)$.
\end{proof}
The following normal form theorem can also be obtained (Compared to
Definition~\ref{SPLode}, no function $\tu h$ is allowed on the right
hand side):
\begin{definition}[Normal linear $\mathcal{L}$-ODE (N$\mathcal{L}$-ODE)]~\label{def:system of SLL
ODE} Functions $\tu f
$ are definable by a normal linear $\mathcal{L}$-ODE if it corresponds to the
solution of $\mathcal{L}$-ODE
$\dderivL{\tu f(x,\tu y)}= \tu u(\tu f(x,\tu y), x,\tu y)$
\noindent where $\tu u$ is \textit{essentially linear} in $\tu f(x, \tu y)$.
\end{definition}
\begin{definition}[$\mathbb{SLL}$]
A function $\tu f:\N^k\to \N^k$ is in $\mathbb{SLL}$ if there exists
$\tu g: \N^{k+1}\to \N$ and $h:\N^k\to \N$ such that:
\begin{itemize}
\item $g$ is solution of a normal linear length-ODE
\dderiv{\tu g(x,\tu y)}{\length{x}} = \tu u(\tu g(x,\tu y), x,\tu y);
\item $h$ is the solution of a single linear length-ODE;
\item and, for all $\tu y\in \N^k$:
for some integer $c$.
\end{itemize}
\end{definition}
From the proof of Theorem~\ref{th:ptime characterization 2} the result below can be easily obtained. It expresses that composition need to be used only once as exemplified in the above definition.
\begin{theorem} \label{th:pspace}
$\mathbb{SLL}= \cp{FPTIME}$
\end{theorem}
\begin{proof}
In the proof of Theorem~\ref{th:ptime characterization 2}, the
definition of each function $\mathsf{inst}$, $R_0$,..., $R_k$ are done
through a linear system of $\mathbb{SLL}$-ODE that uses only the basic
arithmetic and sign functions. Composition is used only to
bound the computation by $B^{(c)}(\max(\tu x))$, whose
definition can be obtained through a simple length-ODE.
\end{proof}
\section{Further works}
\label{sec:extension}
Previous ideas can be extended to provide a characterization of
$\cp{FPSPACE}$ by considering random access machines (RAM) instead of register
machines (see Appendix \ref{sec:ram} for definitions) with
specific instructions sets. Depending on the set of basic
operations allowed in the RAM model, polynomial time computation
relates to very different complexity classes as witnessed by the
following statements (see formal statement and proof of Theorem \ref{theorem:ram for
pspace2} in appendix):
\begin{enumerate}
\item A function $f:\N^k\to \Z$ is computable in polynomial time, i.e. is in $\cp{FPTIME}$, iff it is computable in polynomial time on a $\{+,-\}$-RAM with unit cost.
\item A function $f:\N^k\to \Z$ is computable in $\cp{FPSPACE}$ iff it is computable in polynomial time on a $\{+,-, \times, \div\}$-RAM with unit cost.
\end{enumerate}
Second item follows from the following arguments: It as been
proved in \cite{Galota:2005bo}, that a function $f$ is in $\cp{FPSPACE}$
iff it is the difference of two functions $f_1,f_2:\N\to \N$ in
$\cp{\sharp PSPACE}$, the class of functions that counts the number of accepting
computations of a non deterministic polynomial space Turing machine.
It follows from the result from \cite{Bertoni:1981fs}, that a
function is computable in polynomial time on a
$\{+,\mathrel{\dot{-}}, \times, \div\}$-RAM if and only if it belongs to
$\cp{\sharp PSPACE}$.
Using random access machines (RAM) instead of register
machines, $\cp{FPSPACE}$ can be shown to correspond to functions of
type $f(\tu y) = g_1(h(\tu y), \tu y)$ where $\tu g$ is defined
as a specific class of polynomial length-ODE with substitutions,
and conversely.
We leave this characterization for future work, as we believe
that this statement can be improved to an even simpler
statement, and scheme.
| {'timestamp': '2018-10-09T02:02:26', 'yymm': '1810', 'arxiv_id': '1810.02241', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02241'} | arxiv |
\section{Systems of Communicating Finite State Machines}
\label{sect:cfsm}
In this section we recall (partly following \cite{CF05,DY12,TY15}) the definitions of communicating finite state machine (CFSM) and systems of CFSMs.
Throughout the paper we assume given a countably infinite set
$\mathbf{P}_\mathfrak{U}$ of role (participant) names (ranged over by $\mathtt{p},\mathtt{q},\mathtt{r},\mathtt{s},\tt{A},\tt{B},{\tt H},{\tt I},\ldots$) and a countably infinite alphabet $\mathbb{A}_\mathfrak{U}$ (ranged over by $a,b,c,\ldots$)
of messages.\\
\begin{definition}[CFSM]\label{def:cfsm}
Let $\mathbf{P}$ and $\mathbb{A}$ be finite subsets of $\mathbf{P}_\mathfrak{U}$ and $\mathbb{A}_\mathfrak{U}$ respectively.
\begin{enumerate}[i)]
\item
The set $C_\mathbf{P}$ of {\em channels} over $\mathbf{P}$ is defined by\\
\centerline{
$C_\mathbf{P}=\Set{\mathtt{p}\mathtt{q} \mid \mathtt{p},\mathtt{q}\in \mathbf{P}, \mathtt{p}\neq\mathtt{q}}$
}
\item
The set $\mathit{Act}_{\mathbf{P},\mathbb{A}}$ of {\em actions} over $\mathbf{P}$ and $\mathbb{A}$ is defined by\\
\centerline{
$\textit{Act}_{\mathbf{P},\mathbb{A}} = C_\mathbf{P}\times\Set{!,?}\times\mathbb{A}$
}
\item
A {\em communicating finite-state machine over} $\mathbf{P}$ \emph{and} $\mathbb{A}$
is a finite transition system given by a tuple\\
\centerline{ $M=(Q,q_0,\mathbb{A},\delta)$ }
where $Q$ is a finite set of states, $q_0\in Q$ is the initial state, and
$\delta\subseteq Q\times\textit{Act}_{\mathbf{P},\mathbb{A}}\times Q$ is a set of transitions.
\end{enumerate}
\end{definition}
Notice that the above definition of a CFSM is generic w.r.t.\ the underlying sets
$\mathbf{P}$ of roles and $\mathbb{A}$ of messages.
This is necessary, since we shall not deal with a single system of CFSMs but with an arbitrary number of open systems that can be
{\em composed}.
We shall write $C$ and $\mathit{Act}$ instead of $C_\mathbf{P}$ and $\mathit{Act}_{\mathbf{P},\mathbb{A}}$ when no ambiguity can arise.
We assume $\mathit{l},\mathit{l}',\ldots$ to range over $\textit{Act}$;
$\varphi,\varphi',\ldots$ to range over $\textit{Act}^*$ (the set of finite words over $\textit{Act}$), and
$w,w',\ldots$ to range over $\mathbb{A}^*$ (the set of finite words over $\mathbb{A}$).
$\varepsilon\,(\notin \mathbb{A}\cup\textit{Act})$ denotes the empty word and $\mid v\mid$ the lenght of a word $v\in \textit{Act}^*\cup\mathbb{A}^*$.
The transitions of a CFSM are labelled by actions; a label $\mathtt{s}\mathtt{r}!a$ represents
the asynchronous sending of message $a$ from machine $\mathtt{s}$ to $\mathtt{r}$ through channel $\mathtt{s}\mathtt{r}$ and, dually,
$\mathtt{s}\mathtt{r}?a$ represents the reception (consumption) of $a$ by $\mathtt{r}$ from channel
$\mathtt{s}\mathtt{r}$.
We write $\lang{M}\subseteq\textit{Act}^*$ for
the language over $\textit{Act}$ accepted by the automaton corresponding
to machine $M$, where each state of $M$ is an accepting state. A state
$q\in Q$ with no outgoing transition is final; $q$ is a {\em sending} (resp. {\em receiving})
state if all its outgoing transitions are labelled with sending
(resp. receiving) actions; $q$ is a {\em mixed} state otherwise.
\vspace{2mm}
A CFSM $M = (Q,q_0,\mathbb{A},\delta)$ is:
\begin{enumerate}[a)]
\item
{\em deterministic} if for all states $q\in Q$ and all actions $\mathit{l}$:
$(q,\mathit{l}, q'), (q,\mathit{l},q'')\in \delta$ imply $q'=q''$;
\item
{\em ?-deterministic} (resp. {\em !-deterministic}) if for all states $q\in Q$ and all actions
$(q,\mathtt{r}\mathtt{s}?a, q'), (q,\mathtt{p}\mathtt{q}?a,q'')\in \delta$ (resp. $(q,\mathtt{r}\mathtt{s}!a, q'), (q,\mathtt{p}\mathtt{q}!a,q'')\in \delta$) imply $q'=q''$;
\item
{\em ?!-deterministic} if it is both ?-deterministic and !-deterministic.
\end{enumerate}
The notion of ?!-deterministic machine is more demanding than in usual CFSM settings. It will be needed in order to guarantee safety-properties preservation when systems are connected. \\
\begin{definition}[Communicating systems and configurations
Let $\mathbf{P}$ and $\mathbb{A}$ be as in Def.~\ref{def:cfsm}.
\begin{enumerate}[i)]
\item
A {\em communicating system (CS)
over} $\mathbf{P}$ \emph{and} $\mathbb{A}$ is a tuple $S= (M_\mathtt{p})_{\mathtt{p}\in\mathbf{P}}$
where\\
for each $\mathtt{p}\in \mathbf{P}$,
$M_\mathtt{p}=(Q_\mathtt{p},q_{0\mathtt{p}},\mathbb{A},\delta_\mathtt{p})$ is a CFSM over $\mathbf{P}$ and $\mathbb{A}$.
\item
A {\em configuration} of a system $S$ is a pair $s = (\vec{q},\vec{w})$
where \\
- $\vec{q}= (q_\mathtt{p})_{\mathtt{p}\in\mathbf{P}}$ with $q_\mathtt{p} \in Q_\mathtt{p}$;\\
- $\vec{w} = (w_{\mathtt{p}\mathtt{q}})_{\mathtt{p}\mathtt{q}\in C}$ with $w_{\mathtt{p}\mathtt{q}}\in\mathbb{A^*}$.\\
The component $\vec{q}$ is the control state of the system and $q_\mathtt{p} \in Q_\mathtt{p}$ is the local
state of machine $M_\mathtt{p}$.
The component $\vec{w}$ represents the state of the channels of the system and $w_{\mathtt{p}\mathtt{q}} \in \mathbb{A}^*$ is the state of the channel for messages sent from $\mathtt{p}$ to $\mathtt{q}$. The initial configuration of $S$ is $s_0= (\vec{q_0},\vec{\varepsilon})$
with $\vec{{q_0}} = (q_{0_\mathtt{p}})_{\mathtt{p}\in\mathbf{P}}$.
\end{enumerate}
\end{definition}
\begin{definition}[Reachable configurations
Let $S$ be a communicating system, and let $s= (\vec{q},\vec{w})$ and $s'= (\vec{q'},\vec{w'})$
be two configurations of $S$.
Configuration $s'$ {\em is reachable from} $s$
{\em by firing a transition} with action $\mathit{l}$, written $s\lts{\mathit{l}}s'$, if there is $a\in\mathbb{A}$
such that one of the following conditions holds:
\begin{enumerate}
\item
$\mathit{l} = \mathtt{s}\mathtt{r}!a$ and $(q_\mathtt{s},\mathit{l},q'_\mathtt{s})\in\delta_\mathtt{s}$ and
\begin{enumerate}[a)]
\item
for all $\mathtt{p}\neq\mathtt{s}: ~ q'_\mathtt{p} = q_\mathtt{p}$ and
\item
$w'_{\mathtt{s}\mathtt{r}} = w_{\mathtt{s}\mathtt{r}}\cdot a$ and for all $\mathtt{p}\mathtt{q}\neq\mathtt{s}\mathtt{r}: ~ w'_{\mathtt{p}\mathtt{q}} = w_{\mathtt{p}\mathtt{q}}$;
\end{enumerate}
\item
$\mathit{l} = \mathtt{s}\mathtt{r}?a$ and $(q_\mathtt{r},\mathit{l},q'_\mathtt{r})\in\delta_\mathtt{r}$ and
\begin{enumerate}[a)]
\item
for all $\mathtt{p}\neq\mathtt{r}: ~ q'_\mathtt{p} = q_\mathtt{p}$ and
\item
$w_{\mathtt{s}\mathtt{r}} = a\cdot w'_{\mathtt{s}\mathtt{r}}$ and for all $\mathtt{p}\mathtt{q}\neq\mathtt{s}\mathtt{r}: ~w'_{\mathtt{p}\mathtt{q}} = w_{\mathtt{p}\mathtt{q}}$.
\end{enumerate}
We write $s\lts{}s'$ if there exists $\mathit{l}$ such that $s\lts{\mathit{l}}s'$.\\
As usual, we denote the reflexive and transitive
closure of $\lts{}$ by $\lts{}^*$
\item
The set of {\em reachable configurations} of S is $RS(S) = \Set{s \mid s_0\lts{}^* s}.$
\end{enumerate}
\end{definition}
\noindent
According to the last definition, communication happens via buffered channels following the FIFO principle.
\begin{definition}[Safety properties \cite{DY12,CF05}]\hfill\\
\label{def:safeness}
Let $S$ be a communicating system, and let $s= (\vec{q},\vec{w})$ be a configuration of $S$.
\begin{enumerate}[i)]
\item
\label{def:safeness-i}
$s$ is a {\em deadlock configuration} if
$$\vec{w}=\vec{\varepsilon}
~~\wedge~~ \forall \mathtt{p}\in\mathbf{P}.~q_\mathtt{p} \text{ is a receiving state}
$$
i.e. all buffers are empty, but all machines are waiting for a message.\\
We say that $S$ is {\em deadlock-free} whenever, for any $s\in RS(S)$, $s$ is not a deadlock configuration.
\item
$s$ is an {\em orphan-message configuration} if
$$(\forall \mathtt{p}\in\mathbf{P}. ~ q_\mathtt{p} \text{ is final}) ~~\wedge~~ \vec{w}\neq \vec{\varepsilon}$$
i.e. each machine is in a final state, but there is still at least one non-empty buffer.
\item
\label{def:safeness-ur}
$s$ is an {\em unspecified reception configuration} if
$$\exists \mathtt{r} \in\mathbf{P}. ~ q_\mathtt{r} \text{ is a receiving state }
~~\wedge~~\forall\mathtt{s}\in\mathbf{P}.[~(q_\mathtt{r},\mathtt{s}\mathtt{r}?a,q'_\mathtt{r})\in\delta_\mathtt{r} \implies
(|w_{\mathtt{s}\mathtt{r}}| > 0~~\wedge~~ w_{\mathtt{s}\mathtt{r}}\not\in a\mathbb{A}^*)~ ]$$
i.e. there is a receiving state $q_\mathtt{r}$
which is prevented from
receiving any message from any of its buffers.
(In other words, in each channel $\mathtt{s}\mathtt{r}$ from which role $\mathtt{r}$ could consume there
is a message which cannot be received by $\mathtt{r}$ in state $q_\mathtt{r}$.)
\item
$S$ is {\em safe} if, for each $s\in RS(S)$, $s$
is neither a deadlock, nor an orphan-message, nor an unspecified reception
configuration.
\end{enumerate}
\end{definition}
The above definitions of safety properties are the same as in~\cite{DY12}.
They follow, for the notions of deadlock and unspecified reception, the definitions in~\cite{CF05}. The deadlock definition in~\cite{TY15} is slightly weaker, but coincides
with~\cite{DY12} if the local CFSMs have no final states. Still weaker definitions of deadlock are used in~\cite{TG18} and in~\cite{BZ83}.
\section{Conclusions}
\label{sect:conclusions}
We have proposed the GTIR formalism (Global Types with Interface Roles) to support the usage of global types
in the context of open systems,
whenever the underlying global type formalism, like~\cite{DY12,TY15,TG18}, allows the interpretation of global
types in terms of systems of communicating finite state machines (CFSMs),
Our main result is that safety properties (deadlock-freeness, no orphan messages, no unspecified receptions)
are preserved by composing open systems when interface roles are compatible.
In \cite[Sect. 6]{GMY80}, the authors use the same compatibility notion for CFSMs showing that a system made of two CFSMs, which both are deterministic and do not have mixed states, is free from deadlocks and unspecified receptions.
The general aim of enhancing the expressive power of global type formalisms has been variously pursued in the literature.
For example, in \cite{Tanter14} the authors define a formalism where global types with initial and end points can be combined.
The results in \cite{MY13} are slightly more related to our approach. It is shown how to define choreographies partially specified, where only some processes are provided.
In case two choreographies are composable, some completely specified process of one
can be used instead of the unspecified ones in the other.
Even if some loose connections can be envisaged with the approach of {\em interface automata} of \cite{deAlfaro2001,deAlfaro2005},
our approach to open global types diverges from them in many relevant points:
First of all, an interface automaton describes the communication abilities of an automaton
with its environment in terms of input and output actions while internal behavior is described by internal actions.
GTIRs, however, emulate the expected behavior of the environment by providing distinguished interface roles
and their CFSMs, while internal behavior is modelled by the CFSMs of the other roles.
Interface automata
rely on synchronous communication while we consider asynchronous communication via FIFO buffers.
The crucial idea of compatibility for interface automata is that no error state should be reachable in the synchronous product
of two automata. An error state is a state, in which one automaton wants to send a message to the other but the other
automaton is not ready to accept it. This situation is related to unspecified reception in the asynchronous context.
The speciality of interface automata is, however, that an error state must be autonomously reachable,
i.e.\ without influence of the environment.
Since interface automata use synchronous message passing, the problem of orphans is empty.
Moreover, the theory of interface automata does not consider deadlock-freedom.
On the other hand, interface automata consider also refinement and preservation of compatibility by refinement.
In the future, we first want to study whether our conditions for compatibility could be relaxed
still guaranteeing preservation of safety.
Moreover,
it would be worth taking into account, besides safety properties, also liveness properties.
In particular, the generalised global types of \cite{DY12},
at the cost of being less expressive than global types in \cite{TY15,TG18},
guarantee also liveness properties.
Properties preserved by connecting CFSM systems via {\em gateways} are worth to be investigated also
for systems unrelated to global type formalisms.
For instance, a variety of communication properties are formalised for asynchronous I/O-transition systems in~\cite{HaddadHM13}.
Preservation by composition is shown there but using bags instead of FIFO buffers for communication.
Finally, the current composition operator for GTIRs is binary and thus can only lead to tree-like
compositions of global graphs. Therefore it would be challenging to see, how we could get
cyclic architectures.
\paragraph{Acknowledgements}
We are grateful to the anonymous referees for several helpful comments and suggestions.
We also thank Emilio Tuosto for some macros used to draw Figure \ref{fig:examplegg}.
The first author is also thankful to Mariangiola Dezani for her everlasting support.
\section{Global Types with Interface Roles}
\label{sec:gtir}
Our aim is the development of a formalism \gt\!-\textsc{ir}\ suitable for the composition of open systems which ensures preservation
of safety properties and hence is suitable for modular system construction.
The idea is that our approach should be usable for any global type formalism
$\mathcal{G}\!\!\mathcal{T}$ which satisfies the following assumptions: For each global type $G$ in $\mathcal{G}\!\!\mathcal{T}$,
\begin{enumerate}
\item
there is associated a finite set of roles $\mathbf{P}(G) \subset \mathbf{P}_\mathfrak{U}$ and a finite set of actions
$\mathbb{A}(G) \subset \mathbb{A}_\mathfrak{U}$,
\item
there is a {\em projection} function, denoted by $\projecton{\_}{\_}$,
such that for any $\mathtt{p}\in\mathbf{P}(G)$, $\projecton{G}{\mathtt{p}}$ is a CFSM
over $\mathbf{P}(G)$ and $\mathbb{A}(G)$.
\end{enumerate}
Global types are considered as syntactic objects while the projection function
yielding a communicating system $(\projecton{G}{\mathtt{p}})_{\mathtt{p}\in\mathbf{P}(G)}$ over $\mathbf{P}(G)$ and $\mathbb{A}(G)$ is considered
as the semantics of a global type $G$.
A $\mathcal{G}\!\!\mathcal{T}$\ formalism satisfying the above requirements could be, for instance, the formalism of generalised global types in~\cite{DY12}
or that of global graphs in~\cite{TY15,TG18}.
Under certain conditions on the form of a global type $G$, safety properties are guaranteed
for the system obtained by projecting all roles of $G$ to a CFSM.
For instance, Theorem 3.1 in~\cite{DY12} states that a communicating system generated from the projections of a well-formed global type is safe in the sense of
Def.~\ref{def:safeness}.
Therefore, if we can assure that safety is preserved by composition, we get a safe system
whenever the underlying global types denote safe (sub)systems.
In order to look at global types as {\em open}, we shall identify some of their roles as {\em interface roles}.
An interface roles represents (part of) the expected communication behaviour of the environment. Interface roles are the basis to compose systems.
In this section, we introduce
Global Types with Interface Roles (GTIRs)
and provide their syntax and semantics.
First we define the syntactic notion of a pre-GTIR.
Then we present our working example which already points out that
we need a semantic compatibility relation between interfaces for safe composition.
Interface compatibility and a few additional conditions must be respected
to get a proper GTIR. The semantics of a GTIR is then defined
in terms of a system of CFSMs obtained, in the base case, by the projections
of a global type with distinguished interface roles, and, in the composite case,
by composing open CFSM systems by means of suitable ``gateway'' CFSMs.
\subsection{Pre-GTIRs}
A pre-GTIR is either just
a global type where some roles are declared as interface roles
or it is a syntactic expression composed from two pre-GTIRs by connecting
certain interface roles. The non-connected interface roles remain open.
\begin{definition}[pre-GTIR]
\label{def:pre-gtir}
The set of {\em pre-GTIR} expressions $\GTIR{{{\bf G}}}{\mathbf{I}}$ with set of {\em interface roles} $\mathbf{I}$ is defined by simultaneous induction together with
their sets of roles $\mathbf{P}(\GTIR{{\bf G}}{\mathbf{I}})$ and
{\em components} $\mathcal{C}(\GTIR{{\bf G}}{\mathbf{I}})$:
\begin{enumerate}[i)]
\item $\GTIR{G}{\mathbf{I}}\in \textit{pre-GTIR}$ and
$\mathbf{P}(\GTIR{{\bf G}}{\mathbf{I}}) = \mathbf{P}(G)$ and
$\mathcal{C} (\GTIR{G}{\mathbf{I}}) = \Set{G}$ if
\begin{enumerate}
\item $G$ is a global type of $\mathcal{G}\!\!\mathcal{T}$,
\item $\mathbf{I}\subseteq \mathbf{P}(G)$,
\end{enumerate}
\item $\GTIR{\GTIR{{{\bf G}}_1}{\mathbf{H}}\connect{{\tt H}}{{\tt K}}\GTIR{{{\bf G}}_2}{\mathbf{K}}}{\mathbf{I}} \in \textit{pre-GTIR}$
and
$\mathbf{P}(\GTIR{\GTIR{{{\bf G}}_1}{\mathbf{H}}\connect{{\tt H}}{{\tt K}}\GTIR{{{\bf G}}_2}{\mathbf{K}}}{\mathbf{I}}) =
\mathbf{P}({\GTIR{{{\bf G}}_1}{\mathbf{H}}}) \cup \mathbf{P}(\GTIR{{{\bf G}}_2}{\mathbf{K}})$
and\\
$\mathcal{C}(\GTIR{\GTIR{{{\bf G}}_1}{\mathbf{H}}\connect{{\tt H}}{{\tt K}}\GTIR{{{\bf G}}_2}{\mathbf{K}}}{\mathbf{I}}) =
\mathcal{C}({\GTIR{{{\bf G}}_1}{\mathbf{H}}}) \cup \mathcal{C}(\GTIR{{{\bf G}}_2}{\mathbf{K}})$ if
\begin{enumerate}
\item $\GTIR{{{\bf G}}_1}{\mathbf{H}}, \GTIR{{{\bf G}}_2}{\mathbf{K}}\in\textit{pre-GTIR}$ with
${\tt H}\in\mathbf{H}, \; {\tt K}\in\mathbf{K}$,
\item $\mathbf{I} = (\mathbf{H}\cup\mathbf{K})\setminus\Set{{\tt H},{\tt K}}$,
\item
$\mathbf{P}(\GTIR{{{\bf G}}_1}{\mathbf{H}}) \cap \mathbf{P}(\GTIR{{{\bf G}}_2}{\mathbf{K}})
=\emptyset.$
\end{enumerate}
\end{enumerate}
\end{definition}
Notice that in a composed pre-GTIR, the notation of the set $\mathbf{I}$ is actually redundant and it is used just to immediately spot the interface roles.
By the above definition, a pre-GTIR is an expression formed by either a global type in $\mathcal{G}\!\!\mathcal{T}$\ or a number of global types in $\mathcal{G}\!\!\mathcal{T}$\ ``composed'' via symbols of the form $\ \connect{{\tt H}}{{\tt K}}$, and where sets of interface roles are identified by means of superscripts.
These global types are what we have defined as the {\em components} of the pre-GTIR.
\subsection{Working example}
We introduce the compatibility relation we have in mind and the composition operator that we want to use
for constructing GTIRs
by means of a working example inspired by one in \cite{deAlfaro2005}.
Let us assume we wish to develop an open system, let us dub it $S$, which can receive a text message from the outside.
Once a text is received, the system tries to transmit it at most $n$ times (where also the number $n$ of possible trials is provided from the outside when the system is initialized).
A successful transmission is acknowledged by an {\sf ack} message; a {\sf nack} message
represents instead an unsuccessful transmission.
An {\sf ok} message is sent back in case of a successful transmission; a {\sf fail} message
in case of $n$ unsuccessful trials.
Before any transmission trial, a semantically-invariant transformation is applied to the message.
The system can hence be used to send messages to social networks which are particularly
strict for what concerns propriety of language. If the message is not accepted by the
social network, our system automatically transforms it maintaining its sense, and sending it again and again up to $n$ times, invariantly transforming it each time.
A counter is used to keep track of the number of trials and it is reset to $n$ each time
a message is successfully transmitted. It is instead automatically reset to $n$ each time $0$ is reached, before
issuing a failure message and restarting the protocol with some new message.\\
If we consider the formalism of generalized global types of \cite{DY12},
the overall behaviour of the above system $S$ can be described by the
graph $G$ shown in Fig.~\ref{fig:examplegg}, where the roles (participants) are:\\
{\tt M}: the manager of the system;\\
{\tt T}: the process implementing the semantically-invariant message transformation;\\
{\tt C}: the trials counter;\\
{\tt I}, {\tt J} and {\tt H}: the roles (that we identify as {\em interface roles}) representing those
parts of the environment which, respectively: initializes the system; sends the text message
and receives back the {\sf ok} or {\sf fail} message: receives the messages transmitted
by the systems and acknowledges its propriety, if so.\\
\begin{figure}[t]
\hrule
\vspace{4mm}
\begin{center}
\begin{tikzpicture}
\mkint{}{x9}[][H][ack][M];
\mkint{below=0.5 of x9}{x11}[][M][reset][C];
\mkint{below=0.5 of x11}{x13}[][M][ok][J];
\mkint{right=of x11}{x15}[][C][zero][M];
\mkint{right=of x15}{x16}[][C][notzero][M];
\mkbranch{x15,x16}[x15x16][][-0.7][@][15pt];
\mkint{above =0.18 of x15x16}{x10}[][H][nack][M];
\mkint{below = 0.5 of x15}{x17}[][M][fail][J];
\mkseq{x9}{x11};
\mkseq{x11}{x13};
\mkseq{x10}{x15x16};
\mkseq{x15}{x17};
\mkbranch{x9,x10}[x9x10][][0.8][@][15pt];
\mkint{above = 0.5 of x9x10}{x6}[][M][text][H];
\mkint{above = 0.5 of x6}{x7}[][T][text][M];
\mkint{above = 0.5 of x7}{x5}[][M][text][T];
\mkseq{x5}{x7};
\mkseq{x7}{x6};
\mkseq{x6}{x9x10};
\mklooptwo[0.5][-97]{x5}{x16}{}{};
\mkint{above = 1.3 of x5}{x2}[][J][text][M];
\path[line] (x2) -- (entryx5);
\mkmerge{x13,x17}[x13x17][][0.8][@][15pt];
\mklooptwobelow[0.5][-24]{x2}{x13x17}{}{};
\mkint{above = 1.3 of x2}{x0}[][I][trialsNum][C];
\mkseq{x0}{entryx2};
\node[source,above = 0.5 of x0] (src) {};
\mkseq{src}{x0};
\end{tikzpicture}
\end{center}
\vspace{4mm}
\hrule
\caption{The global type $G$ of the working example}
\label{fig:examplegg}
\end{figure}
Informally, in the graph $G$ in Fig.~\ref{fig:examplegg}, a label $\mathtt{s}\rightarrow \mathtt{r} : a$ represents an interaction where $\mathtt{s}$ sends a message
$a$ to r. A vertex with label {\small $\bigcirc$} represents the source of the
graph and {\huge $\diamond$}\hspace{-8.5pt}{$^+$} marks vertexes corresponding
to branch or merge points, or to entry points of loops.
In our formalism, we can look at $G$ as a global type with interface roles by identifying the roles ${\tt I},{\tt J}$ and ${\tt H}$ as {\em interface roles}.
We do that by writing, according to the syntax of Def.~\ref{def:pre-gtir}(i):
$$\GTIR{G}{\Set{{\tt I},{\tt J},{\tt H}}}$$
Given a global type with interface roles, it is reasonable to expect all its roles to be implemented but the interface ones,
since they are actually used to describe the behaviour of the ``environment'' of the system.
The projections of global types with interface roles onto their interface roles yield CFSMs which are used instead to check whether
two systems can be connected in a safe way. In particular, to check whether interface roles are ``compatible''.
According to the projection algorithm for generalized global types (see \S 3.1 and Def. 3.4 of \cite{DY12}), the projection on role ${\tt J}$ of the graph $G$ of Fig.~\ref{fig:examplegg} is the following CFSM $M_{\tt J} = \projecton{G}{{\tt J}}$ (see (1))
which describes the behaviour of that part of the environment of system $S$ which sends a text and waits for a positive or negative answer.
\vspace{-2mm}
\begin{equation}
\footnotesize
\label{pic:I2}
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=1.5cm,semithick]
\node[state] (one) {$1$};
\node[draw=none,fill=none] (start) [above left = 0.3cm of one]{{\tt J}};
\node[state] (two) [below of=one] {$2$};
\path (start) edge node {} (one)
(one) edge node {\edgelabel{JM}!{text}} (two)
(two) edge [bend left=100] node [pos=0.1, left] {\edgelabel{MJ}{?}{ok}} (one)
edge [bend right=100] node [pos=0.1, right] {\edgelabel{MJ}{?}{fail}} (one);
\end{tikzpicture}
\end{equation}
Going on with our example,
let us consider now another open system $S'$, having, among others, roles \AA, \texttt{B}\ and {\tt K}, where {\tt K}\ is one of its interface roles.
In $S'$, the roles {\tt A} and \texttt{B}\ keep on sending, in an alternating manner, a text message to {\tt K}, which replies with a positive or negative
acknowledgement ({\sf ok} or {\sf fail}, respectively).
Role \texttt{B}\ can send its message only after a successful sending by \AA, and vice versa.
A {\sf fail} message from {\tt K}\ forces the resending of the message.
Let us assume
that the behavior of interface role {\tt K}\ is given by the following CFSM $M_{\tt K}$ (see (2)):
\begin{equation}
\footnotesize
\label{pic:J}
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=1.5cm,semithick]
\node[state] (one) {$1$};
\node[draw=none,fill=none] (start) [above left = 0.3cm of one]{{\tt K}};
\node[state] (two) [below of=one] {$2$};
\node[state] (three) [left = 1.8cm of one] {$3$};
\node[state] (four) [left = 1.8cm of two] {$4$};
\path (start) edge node {} (one)
(one) edge node [pos=0.6, above] {\edgelabel{AK}?{text}} (two)
(two) edge node [pos=0.0, left] {\edgelabel{KA}{!}{ok}} (three)
edge [bend right=100] node [pos=0.1, right] {\edgelabel{KA}{!}{fail}} (one)
(three) edge node [pos=0.6, above] {\edgelabel{BK}?{text}} (four)
(four) edge node [pos=0.0, right] {\edgelabel{KB}{!}{ok}} (one)
edge [bend left=100] node [pos=0.1, left] {\edgelabel{KB}{!}{fail}} (three);
\end{tikzpicture}
\end{equation}
The interface roles ${\tt J}$ and ${\tt K}$ are {\em compatible}, in that
the {\sf text} message asked for by ${\tt K}$ can be the one provided by ${\tt J}$ to system $S$, whereas the
{\sf ok} and {\sf fail} messages ${\tt J}$ receives can be the ones that ${\tt K}$ sends to system $S'$.
In a nutshell, if we do not take into account channels in the labels, the language accepted by ${\tt J}$ is the
dual (i.e. '!' and '?' are exchanged) of that accepted by ${\tt K}$.
Once the compatibility of ${\tt J}$ and ${\tt K}$ is ascertained, the behaviours of two {\em gateways} processes could be easily
constructed from $M_{\tt J}$ and $M_{\tt K}$.
The idea is to insert an intermediate state with appropriate transitions in the middle of any transition of $M_{\tt J}$ (and similarly of $M_{\tt K}$) enabling to pass messages from the interface role of one system to the other. For instance, the transition of $M_{\tt J}$ from state $1$ to state $2$ labelled with $\edgelabel{JM}{!}{text}$ is split into two transitions (see Fig. \ref{eq:JK} , left), where ${\tt J}$ first receives a text from ${\tt K}$ and then sends it to $\mathtt{M}$.
Such {\em gateways} processes can be constructed by means of an algorithm that we dub
$\gateway{\cdot}$. It takes two arguments: the CFSM to be transformed and
the name of the interface role of the other system, and returns a ``gateway'' CFSM which
enables systems to interact.
For what concerns our example, by applying $\gateway{\cdot}$ to $M_{\tt J}$ and ${\tt K}$
and by applying $\gateway{\cdot}$ to $M_{\tt K}$ and ${\tt J}$, we get the two CFSMs depicted in Figure \ref{eq:JK}.\\
By assuming $\GTIR{{\bf G}'}{\mathbf{I}\cup\Set{{\tt K}}}$ to be the GTIR denoting the open system $S'$ above,
the pre-GTIR
$$\GTIR{ \GTIR{G}{\Set{{\tt I},{\tt J},{\tt H}}} \connect{{\tt J}}{{\tt K}} \GTIR{{\bf G}'}{\mathbf{I}\cup\Set{{\tt K}}} }{\mathbf{I}\cup\Set{{\tt I},{\tt H}}}$$
is actually a proper GTIR, since the interface roles ${{\tt J}}$ and ${{\tt K}}$ are compatible.
Its semantics is the system obtained by connecting $S$ and $S'$ by means of the gateways $\gateway{M_{\tt J},{\tt K}}$ and $\gateway{M_{\tt K},{\tt J}}$.
Notice that the GTIR now exposes the remaining interface roles $\mathbf{I}\cup\Set{{\tt I},{\tt H}}$.
\begin{remark}
We could choose to connect systems by implementing a single ``two-sided'' gateway process, but this would imply to
change all the names in the channels of $S$ and $S'$ from and to ${\tt J}$ and ${\tt K}$. This is not feasible
if, as it is likely, $S$ and $S'$ have been separately implemented. Also there would be no straightforward generation of a single ``two-sided'' gateway process.
\end{remark}
\begin{remark}
One could wonder what would change if, instead of using gateways, one simply renamed
the target of communications to interface nodes.
That is unfeasible (unless a rather strict relation of compatibility were used).
It is enough to take into account our working example: if we tried to rename the target of
communications between $M_{\mathtt{M}}$ and $M_{\tt J}$, machine $M_{\mathtt{M}}$
should be completely rewritten. In fact, whereas both in $S$ and in the new system with gateways
$M_{\mathtt{M}}$ receives the text from $M_{\tt J}$, in a new system without gateways
$M_{\mathtt{M}}$ would receive the text both from $M_{\mathtt{A}}$ and $M_{\mathtt{B}}$.
\end{remark}
\begin{figure}[t]
\footnotesize
\hrule
\vspace{4mm}
$$
\begin{array}{c@{\hspace{2cm}}c}
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=1.5cm,semithick]
\node[state] (one) {$1$};
\node[draw=none,fill=none] (start) [above left = 0.3cm of one]{{\tt J}};
\node[state] (two) [below of=one] {$\widehat 1$};
\node[state] (three) [below of=two] {$2$};
\node[state] (four) [left of=two] {$\widehat 2'$};
\node[state] (five) [right of=two] {$\widehat 2''$};
\path (start) edge node {} (one)
(one) edge node {\edgelabel{KJ}?{text}} (two)
(two) edge node {\edgelabel{JM}{!}{text}} (three)
(four) edge [bend left] node [pos=0.1, left] {\edgelabel{JK}{!}{ok}} (one)
(five) edge [bend right] node [pos=0.1,right] {\edgelabel{JK}{!}{fail}} (one)
(three) edge [bend left] node [pos=0.1, left] {\edgelabel{MJ}{?}{ok}} (four)
edge [bend right] node [pos=0.1, right] {\edgelabel{MJ}{?}{fail}} (five);
\end{tikzpicture}
&
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=1.5cm,semithick]
\node[state] (one) {$1$};
\node[draw=none,fill=none] (start) [above left = 0.3cm of one]{{\tt K}};
\node[state] (two) [below of=one] {$\widehat{1}$};
\node[state] (three) [below of=two] {$2$};
\node[state] (four) [left of=two] {$\widehat 2'$};
\node[state] (five) [right of=two] {$\widehat 2''$};
\node[state] (six) [left = 3.5cm of one] {$3$};
\node[state] (seven) [left = 3.5cm of two] {$\widehat 3$};
\node[state] (eight) [below of=seven] {$4$};
\node[state] (nine) [right = 0.8cm of seven] {$\widehat 4''$};
\node[state] (ten) [left = 0.8cm of seven] {$\widehat 4'$};
\path (start) edge node {} (one)
(one) edge node [pos=0.6, above] {\edgelabel{AK}?{text}} (two)
(two) edge node [pos=0.6, above] {\edgelabel{KJ}{!}{text}} (three)
(three) edge [bend right] node [pos=0.1, right] {\edgelabel{JK}{?}{fail}} (five)
edge [bend left] node [pos=0.1, left] {\edgelabel{JK}{?}{ok}} (four)
(five) edge [bend right] node [pos=0.3, right] {\edgelabel{KA}!{fail}} (one)
(six) edge node [pos=0.6, above] {\edgelabel{BK}?{text}} (seven)
(seven) edge node [pos=0.6, above] {\edgelabel{KJ}{!}{text}} (eight)
(eight) edge [bend left] node [pos=0.1, left] {\edgelabel{JK}{?}{fail}} (ten)
edge [bend right] node [pos=0.1, right] {\edgelabel{JK}{?}{ok}} (nine)
(ten) edge [bend left] node [pos=0.3, left] {\edgelabel{KB}!{fail}} (six)
(nine) edge [bend left] node [pos=0.1, left] {\edgelabel{KB}!{ok}} (one)
(four) edge [bend right] node [pos=0.1, right] {\edgelabel{KA}!{ok}} (six);
\end{tikzpicture}
\end{array}
$$
\vspace{4mm}
\hrule
\caption{ $\gateway{M_{\tt J},{\tt K}}$ and $\gateway{M_{\tt K},{\tt J}}$ }
\label{eq:JK}
\end{figure}
\subsection{Interface compatibility and GTIRs}
The following definitions are preliminary to the formal definition of
interface compatibility and hence of a proper GTIR.
First, we extend the projection function of the global type formalism $\mathcal{G}\!\!\mathcal{T}$\ to pre-GTIRs.
The projection of interface roles to CFSMs can then be used below to check interface compatibility.
\begin{definition}
Let $\GTIR{{{\bf G}}}{\mathbf{I}}$ be a pre-GTIR and let ${\tt p}\in \mathbf{P}(\GTIR{{{\bf G}}}{\mathbf{I}}) $.
We define
$$\projecton{\GTIR{{{\bf G}}}{\mathbf{I}}}{{\tt p}} =
\projecton{G}{{\tt p}} \hspace{3mm}\text{ where } G\in\mathcal{C}(\GTIR{{{\bf G}}}{\mathbf{I}}) \text{ such that } {\tt p}\in \mathbf{P}({G}).$$
\end{definition}
At next we want to consider the dual of the language accepted by a CFSM
when input and output are reversed and the names of communication
channels are forgotten. For that purpose we need the following definition:
\begin{definition}
\begin{enumerate}[i)]
\item
Let $\varphi\in\mathit{ Act}^*$, we define $\varphi^{\not\mathit{C}}\in(\Set{!,?}\times\mathbb{A})^*$ inductively by:\\
\centerline{
$\varepsilon^{\not\mathit{C}} = \varepsilon$ \hspace{8mm}$(\mathtt{p}\mathtt{q} ?a\cdot \varphi)^{\not\mathit{C}}= ?a\cdot \varphi^{\not\mathit{C}}$ \hspace{8mm} $(\mathtt{p}\mathtt{q} !a\cdot \varphi)^{\not\mathit{C}}= !a\cdot \varphi^{\not\mathit{C}}$.
}
Moreover, for $A\subseteq\mathit{ Act}^*$, $A^{\not\mathit{C}} = \Set{\varphi^{\not\mathit{C}} \mid \varphi\in A}$.
\item
We define $\Dual{(\cdot)} : (\Set{!,?}\times\mathbb{A}) \rightarrow (\Set{!,?}\times\mathbb{A})$ by:\hspace{4mm}
$\Dual{!a} = ? a$ \hspace{8mm} $\Dual{?a} = !a$.\\
$\Dual{(\cdot)}$ is then straightforwardly extended also to words and finite sets of words.
\end{enumerate}
\end{definition}
Finally, we define interface compatibility by requiring that the CFSMs
of two interface roles are dual to each other.
Additionally we require the absence of mixed states as well as input and output
determinism for each of the two CFSMs. In fact, if either of these two conditions were omitted
one can provide counterexamples showing that our results on preservation of safety properties
would generally no longer be valid.
\begin{definition}[Interface compatibility]\label{interface-comp}
\hfill
\begin{enumerate}[i)]
\item
\label{interface-comp-i}
Let $M$ and $M'$ be two CFSMs over $\mathbf{P}$ and $\mathbb{A}$
($\mathbf{P}'$ and $\mathbb{A}'$ resp.). $M$ and $M'$ are {\em compatible}, denoted by $M\!\leftrightarrow\! M'$, whenever
\begin{enumerate}[1)]
\item
$\lang{M}^{\not\mathit{C}} = \Dual{\lang{M'}^{\not\mathit{C}}}.$
\item
\label{interface-comp-ia}
$M$ and $M'$ do not contain mixed states.
\item
$M$ and $M'$ are ?!-deterministic.
\end{enumerate}
\item
\label{interface-comp-ib}
Let $\GTIR{{\bf G}_1}{\mathbf{H}}$ and $\GTIR{{\bf G}_2}{\mathbf{K}}$
be two pre-GTIRs.
Two interface roles ${\tt H} \in \mathbf{H}$ and ${\tt K} \in \mathbf{K}$ are \emph{interface compatible},
denoted by ${{\tt H}}\!\leftrightarrow\! {{\tt K}}$, if\,
$\projecton{\GTIR{{\bf G}_1}{\mathbf{H}}}{{{\tt H}}}\!\leftrightarrow\!\projecton{\GTIR{{\bf G}_2}{\mathbf{K}}}{{{\tt K}}}$.
\end{enumerate}
\end{definition}
\noindent
It is easy to check that in our working example we have ${\tt J} \!\leftrightarrow\! {\tt H}$, since the CFSMs (\ref{pic:I2}) and (\ref{pic:J}) are compatible, i.e. one accepts the dual language of the other if channel names are not taken into account;
they have no mixed states and are ?!-deterministic.
We are now ready to introduce our notion of GTIR.
The syntactic construction of proper GTIRs follows the construction of pre-GTIRs but imposes two semantic conditions for the underlying CFSMs formulated in i) and ii) of the next definition.
\begin{definition}[GTIR]\hfill
\label{def:gtir}
\begin{enumerate}[i)]
\item
A pre-GTIR $\GTIR{G}{\mathbf{I}}$ formed by a global type $G$ and interface roles
$\mathbf{I}\subseteq \mathbf{P}(G)$ is a GTIR if
no communication between interface roles (i.e. roles in $\mathbf{I}$) is present,
i.e.\ for each $p \in \mathbf{P}(G)$ the projection
$\projecton{G}{\mathtt{p}}$ has no transition with a label of the form
${\tt I}{\tt J}!a$ or ${\tt I}{\tt J}?a$ with ${\tt I},{\tt J}\in\mathbf{I}$.
\item
A pre-GTIR $\GTIR{\GTIR{{{\bf G}}_1}{\mathbf{H}}\connect{{\tt H}}{{\tt K}}\GTIR{{{\bf G}}_2}{\mathbf{K}}}{\mathbf{I}}$
obtained by the composition of two GTIRs $\GTIR{{\bf G}_1}{\mathbf{H}}$
and $\GTIR{{\bf G}_2}{\mathbf{K}}$ via interface roles ${\tt H}\in\mathbf{H}, \; {\tt K}\in\mathbf{K}$ is a GTIR if\, ${\tt H}$ and ${\tt K}$ are interface compatible, i.e.\ ${{\tt H}}\!\leftrightarrow\! {{\tt K}}$.
\end{enumerate}
\end{definition}
\subsection{Semantics of GTIRs}
To provide semantics for GTIRs we first define the {\em gateway} transformation $\gateway{\cdot}$ previously mentioned.
By means of such a function it is possible to construct the gateway processes enabling the CFSM systems described by
GTIRs to be connected.
The $\gateway{\cdot}$
function takes as input a CFSM $M_{\tt H}$ of some role ${\tt H}$ and a role name ${\tt K}$. In our application ${\tt H}$ and ${\tt K}$ will be interface roles where ${\tt H}$ is the interface role to be connected to the interface role ${\tt K}$. The gateway function transforms $M_{\tt H}$ by ``inserting'' a new state ``in between'' any
transition. In such a way a transition from $q$ to $q'$ receiving a message $a$ from a role $\mathtt{s} (\neq {\tt K})$ is transformed
into two transitions: one from $q$ to the new state $\widehat{q}$ receiving $a$ from $\mathtt{s}$, and one from
$\widehat{q}$ to $q'$ sending $a$ to ${\tt K}$.
Conversely, a transition from $q$ to $q'$ sending a message $a$ to a role $\mathtt{s} (\neq {\tt K})$ is transformed
into two transitions: one from $q$ to the new state $\widehat{q}$ receiving $a$ from ${\tt K}$, and one from
$\widehat{q}$ to $q'$ sending $a$ to $\mathtt{s}$. We distinguish the new ``inserted'' states by superscripting them
by the transition they are ``inserted in between''.
\begin{definition}[The $\gateway{\cdot}$ transformation]\hfill\\
\label{def:gateway}
Let $M_{\tt H}=(Q,q_0,\mathbb{A},\delta)$ be the CFSM of a role ${\tt H}$, and let ${\tt K}$ be a role name.
We define
$$\gateway{M_{\tt H},{\tt K}}=(Q',q_0,\mathbb{A},\delta')$$
where\\
-
$Q' = Q \cup \widehat{Q_\delta}$, with
$\widehat{Q_\delta} =\bigcup_{q\in Q}\Set{q^{(q,\mathit{l},q')} \mid (q,\mathit{l},q')\in\delta}$, and\\
-
$\delta' = \hspace{12pt}\Set{(q,{\tt K}{\tt H}?a,q^{(q,{\tt H}\mathtt{s}!a,q')}), (q^{(q,{\tt H}\mathtt{s}!a,q')},{\tt H}\mathtt{s}!a,q') \mid (q,{\tt H}\mathtt{s}!a,q')\in\delta}$\\
\hphantom{$\bullet a \delta' =$}$\cup\
\Set{(q,\mathtt{s}{\tt H}?a,q^{(q,\mathtt{s}{\tt H}?a,q')}), (q^{(q,\mathtt{s}{\tt H}?a,q')},{\tt H}{\tt K}!a,q') \mid (q,\mathtt{s}{\tt H}?a,q')\in\delta}$
\end{definition}
\medskip
\noindent
For the sake of readability, we shall often denote elements $q^{(q,\mathit{l},q')}, q^{(q,\mathit{l}',q'')},q^{(q,\mathit{l}'',q''')}, \ldots$
of $\widehat{Q_\delta}$ \linebreak
by $\widehat{q}, \widehat{q'}, \widehat{q''},\ldots$.
We shall also refer to $\widehat{Q_\delta}$ simply as $\widehat{Q}$ when clear from the context.
We can now define the composition of two communicating systems $S_1$ and $S_2$ w.r.t.\ compatible interface roles ${\tt H}$ and ${\tt K}$.
We take the union of the CFSMs of $S_1$ and $S_2$ \emph{but} replace the CFSMs
$M_{\tt H}$ and $M_{\tt K}$ of the interface roles
${\tt H}$ and ${\tt K}$ by their \emph{gateway CFSMs} $\gateway{M_{\tt H},{\tt K}}$ and $\gateway{M_{\tt K},{\tt H}}$.
\begin{definition}[Composition of communicating systems]\hfill\\
\label{def.semconn}
Let $S_1 = (M^1_\mathtt{p})_{\mathtt{p}\in\mathbf{P}_1}$ and $S_2 = (M^2_\mathtt{q})_{\mathtt{q}\in\mathbf{P}_2}$ be two communicating systems
over $\mathbf{P}_1$ and $\mathbb{A}_1$ ($\mathbf{P}_2$ and $\mathbb{A}_2$ resp.)
such that $\mathbf{P}_1\cap\mathbf{P}_2 = \emptyset$.
Moreover, let ${\tt H}\in\mathbf{P}_1$ and ${\tt K}\in\mathbf{P}_2$ be such that
${\tt H} \!\leftrightarrow\! {\tt K}$ (i.e.\ $M^1_{\tt H} \!\leftrightarrow\! M^2_{\tt K}$). \\
The \emph{composition of $S_1$ and $S_2$ w.r.t. ${\tt H}$ and ${\tt K}$} is the communicating system
$${S_{1}}\connect{{\tt H}}{{\tt K}} {S_{2}} = (M_\mathtt{p})_{\mathtt{p}\in(\mathbf{P}_1\cup\mathbf{P}_2)}$$
over $\mathbf{P}_1\cup\mathbf{P}_2$ and $\mathbb{A}_1 \cup \mathbb{A}_2$
where $M_{\tt H} = \gateway{M^1_{\tt H}, {\tt K}}$, $M_{\tt K} = \gateway{M^2_{\tt K}, {\tt H}}$,
$M_\mathtt{p} =M^1_\mathtt{p}$ for all $\mathtt{p}\in\mathbf{P}_1$ and
$M_\mathtt{p} =M^2_\mathtt{p}$ for all $\mathtt{p}\in\mathbf{P}_2$.\footnote{The CFSMs over $\mathbf{P}_1$ and $\mathbb{A}_1$
($\mathbf{P}_2$ and $\mathbb{A}_2$ resp.) are considered here as CFSMs over $\mathbf{P}_1\cup\mathbf{P}_2$
and $\mathbb{A}_1 \cup \mathbb{A}_2$.}
\end{definition}
The semantics of a GTIR is inductively defined following its syntactic construction.
In the base case, its semantics is the communicating system obtained by the projections
of the underlying global graph. The semantics of a composite GTIR is the composition
of the CFSM systems denoted by its constituent parts.
\begin{definition}[GTIR semantics]\hfill\\
\label{def.semgtir}
The communicating system $\Sem{\GTIR{{{\bf G}}}{\mathbf{I}}}$ denoted by a GTIR $\GTIR{{{\bf G}}}{\mathbf{I}}$
is inductively defined as follows:
\begin{itemize}
\item[-]
$\Sem{\GTIR{{G}}{\mathbf{I}}} = (\projecton{G}{\mathtt{p}})_{\mathtt{p}\in\mathbf{P}(G)}$ where $G$ is a global type in $\mathcal{G}\!\!\mathcal{T}$;
\item[-]
$\Sem{\GTIR{\GTIR{{{\bf G}}_1}{\mathbf{H}}\connect{{\tt H}}{{\tt K}}\GTIR{{{\bf G}}_2}{\mathbf{K}}}{\mathbf{I}}}
= \Sem{ \GTIR{{{\bf G}}_1}{\mathbf{H}} } \connect{{\tt H}}{{\tt K}} \Sem{\GTIR{{{\bf G}}_2}{\mathbf{K}}}.$
\end{itemize}
\end{definition}
\noindent
It is immediate to check that the operation of ``connecting'' GTIRs is semantically commutative and associative,
i.e. the following holds:\\
({\em comm}) \hspace{4pt}
$ \Sem{\GTIR{\GTIR{{{\bf G}}_1}{\mathbf{H}}\connect{{\tt H}}{{\tt K}}\GTIR{{{\bf G}}_2}{\mathbf{K}}}{\mathbf{I}}}
= \Sem{\GTIR{\GTIR{{{\bf G}}_2}{\mathbf{K}}\connect{{\tt K}}{{\tt H}}\GTIR{{{\bf G}}_1}{\mathbf{H}}}{\mathbf{I}}} $ \\
({\em ass})\hspace{19pt}
$\Sem{
\GTIR{\GTIR{\GTIR{{{\bf G}}_1}{\mathbf{H}}\connect{{\tt H}}{{\tt K}}\GTIR{{{\bf G}}_2}{\mathbf{K}}}{\mathbf{I}}
\connect{{\tt I}}{{\tt J}}
\GTIR{{{\bf G}}_3}{\mathbf{J}} }
{\mathbf{I'}}
}
=
\Sem{\GTIR{
\GTIR{{{\bf G}}_1}{\mathbf{H}}\connect{{\tt H}}{{\tt K}}
\GTIR{
\GTIR{{{\bf G}}_2}{\mathbf{K}} \connect{{\tt I}}{{\tt J}} \GTIR{{{\bf G}}_3}{\mathbf{J}}
}{\mathbf{J'}}
}{\mathbf{I'}}
}
$\\
\hphantom{({\em ass})\hspace{19pt}} where {\scriptsize ${\mathbf{J'}} = \mathbf{K}\cup\mathbf{J}\setminus\Set{{\tt I},{\tt J}}$}\\
\section{Introduction}
\label{sect:Intro}
The intrinsic difficulties programmers have to face when developing and verifying distributed applications
have been variously attacked by the theoretical computer science community with the aim of devising formal systems
enabling
(1) to describe in a structured way the overall behavior of a system, and
(2) to steer the implementation
of the system components, guaranteeing their compliance with the overall behaviour together with some relevant
properties of communications.
Several formalisms based on the notion of {\em global type} have been proposed in the literature to pursue such an aim
\cite{CHY07,CDP12,CDYP16}.
The expressiveness of the investigated formalisms kept on increasing during the last decade, recently leading to
representations of global behaviours as graphs \cite{DY12,TY15,TG18}, where the local
end-point projections are interpreted by communicating finite state machines (CFSMs), a widely investigated
formalism for the description and the analysis of distributed systems \cite{BZ83}.
For systems of CFSMs, most of the relevant properties of communications are, in general, undecidable
\cite{CF05} or computationally hard. Instead, systems of CFSMs obtained by projecting
the generalised
global types of~\cite{DY12} or the global graphs of~\cite{TY15,TG18} (more precisely those which satisfy a {\em well-formedness} condition)
are guaranteed to satisfy desired properties of communications like
deadlock-freeness, that any sent message is eventually consumed
or that each participant will eventually receive any message s/he is waiting for~\cite{DY12}.
The centralised viewpoint offered by the global type approaches makes them naturally suitable for describing
{\em closed} systems. This prevents a system described/developed by means of global types
to be looked at as a module that can be connected to other systems.
The description and analysis of {\em open} systems has been investigated, instead, in the context of CFSMs in~\cite{HB18,H16}
and for synchronous communication in the context of interface automata in~\cite{deAlfaro2001,deAlfaro2005}.
In the present paper we address the problem of
generalising the notion of {\em global type} in order to encompass the description of {\em open systems}
and, in particular, open systems of CFSMs; so paving the way towards a fruitful interaction between the investigations on open systems carried out in automata theory and those on global types. \\
In our approach, an ``open global type'' -- that we dub ``global type with interface roles'' (GTIR) -- denotes
a number of connected open systems of CFSMs where some participants (roles\footnote{We prefer to use the word {\em role} rather then {\em participant} since {\em interface role}
sounds more suitable for the present setting than {\em interface participant.}}) are identified as interfaces rather than proper participants.
We have no necessity to stick to any particular global type formalism as a basis for our GTIRs,
as long as the local end-point behaviours of a global type $G$ can be interpreted as CFSMs.
So we introduce a {\em parametric} syntax which, given a global type formalism $\mathcal{G}\!\!\mathcal{T}$,
extends its syntax by essentially
enabling to identify some roles as {\em interface roles} and to
define a composition of open global types, semantically interpreted by systems of CFSMs.
We call \gt\!-\textsc{ir}\ ($\mathcal{G}\!\!\mathcal{T}$-with-\textsc{i}nterface-\textsc{r}oles) the so obtained formalism.
Syntactically, a GTIR is either a global type $G$ (formulated in $\mathcal{G}\!\!\mathcal{T}$) together with a distinguished subset of the roles of $G$ declared as interface roles, or it is
a composite expression where two GTIRs are composed via compatible interfaces.
The non-connected interface roles remain open after composition.
The semantics of a GTIR is always a set of CFSMs. In the case of a basic GTIR,
i.e.\ a global type $G$ equipped with interface roles,
it is just the set of CFSMs obtained by projecting $G$ to its end-point CFSMs.
Those CFSMs interpreting interface roles model
the expected behaviour of an external environment of the open system.
Interface roles are \emph{compatible} if their CFSMs have no mixed states, are input and output deterministic
and if their languages are dual to each other.
If a GTIR ${\bf G}$ is a composite expression, composing GTIRs
${\bf G}_1$ and ${\bf G}_2$ via compatible interface roles ${\tt H}$ and ${\tt K}$,
then the semantics of ${\bf G}$ is the union of the two CFSM systems
denoted by ${\bf G}_1$ and ${\bf G}_2$ where the CFSMs
$M_{{\tt H}}$ and $M_{{\tt K}}$, interpreting
the interface roles ${\tt H}$ and ${\tt K}$, are replaced by appropriate gateway CFSMs
$\gateway{M_{\tt H},{\tt K}}$ and $\gateway{M_{\tt K},{\tt H}}$.
These gateways are
constructed by a simple algorithm out of $M_{{\tt H}}$ and $M_{{\tt K}}$.
A main objective of our work is to study the preservation of safety properties under composition. We consider three kinds of properties: deadlock-freedom, freedom of orphan messages and freedom of unspecified receptions following the definitions in~\cite{DY12} (which in turn follow definitions in~\cite{CF05}).
The main result of the present paper is that these
safety properties hold for the CFSM system $S$ denoted by a GTIR ${\bf G}$
whenever they hold singularly for all subsystems $S_i$ obtained by the semantics of the
global types $G_i$ that are used for the construction of ${\bf G}$.
In particular, it has been shown in~\cite{DY12} that the safety properties are ensured whenever the $G_i$'s are
{\em well-formed} generalised global types
\noindent
{\em Overview.} In Section~\ref{sect:cfsm} the main definitions concerning CFSMs and systems of CFSMs are recalled, together with the definitions of safety properties. Syntax and semantics of global types with interface roles are introduced in Section~\ref{sec:gtir}.
Section~\ref{sect:safetypreservation} studies the preservation of safety properties for systems connected via gateways and proves
our main result.
Section~\ref{sect:conclusions} concludes
by pointing to related work and describing directions for further investigations.
\section{Preservation of Safety-Properties}
\label{sect:safetypreservation}
In the present section we show that if we take two safe communicating systems
$S_1$ and $S_2$ such that $S_1$ possesses a CFSM $M^1_{\tt H}$ and $S_2$ a CFSM $M^2_{\tt K}$ which is compatible with $M^1_{\tt H}$, replace both CFSMs by their gateway transformations and then join the resulting systems, we get a a safe system.
\vspace{2mm}
\textbf{General assumption:} In the following of this section we generally assume given a
system \linebreak
{$S={S_{1}}\connect{{\tt H}}{{\tt K}} {S_{2}}$} composed
as described in Def.~\ref{def.semconn}
from systems $S_1$ and $S_2$ with compatible CFSMs $M^1_{\tt H}$ and $M^2_{\tt K}$.
\vspace{2mm}
\textbf{Notation:}
The channels of $S$ are $C=\Set{\mathtt{p}\mathtt{q} \mid \mathtt{p},\mathtt{q}\in \mathbf{P}, \mathtt{p}\neq\mathtt{q}}$
and the channels of $S_i$ are \linebreak $C_i=\Set{\mathtt{p}\mathtt{q} \mid \mathtt{p},\mathtt{q}\in \mathbf{P}_i, \mathtt{p}\neq\mathtt{q}}$ for $i=1,2.$
If $s= (\vec{q},\vec{w})$ is a configuration of $S$, where $\vec{q}=(q_\mathtt{p})_{\mathtt{p}\in\mathbf{P}}$
and $\vec{w} = (w_{\mathtt{p}\mathtt{q}})_{\mathtt{p}\mathtt{q}\in C}$,
we write $\restrict{s}{i}$ for $(\restrict{\vec{q}}{i},\restrict{\vec{w}}{i})$
where $\restrict{\vec{q}}{i} = (q_\mathtt{p})_{\mathtt{p}\in\mathbf{P}_i}$ and
$\restrict{\vec{w}}{i} = (w_{\mathtt{p}\mathtt{q}})_{\mathtt{p}\mathtt{q}\in C_i}$ ($i = 1,2$).
Notice that $\restrict{s}{i}$ is not necessarily a configuration of $S_i$, because of possible states in $\widehat{Q}$,
which are the additional states of the gateways.\\
The following technical properties easily descend from the definition of $\gateway{\cdot}$.
In particular from the fact that the gateway transformation of a machine $M$ does insert an intermediate state
between any pair of states of $M$ connected by a transition. By definition, the intermediate state
possesses exactly one incoming transition and one outgoing transition.
\begin{fact}
\label{fact:uniquesending}
Let $s= (\vec{q},\vec{w}) \in RS(S)$ be a reachable configuration of
$S ={S_{1}}\connect{{\tt H}}{{\tt K}} {S_{2}}$.
\begin{enumerate}
\item
\label{fact:uniquesending-i}
If ${q_{\tt H}}= \widehat{q} \in\widehat{Q_{\tt H}}$ then
${q_{\tt H}}$ is not final and
there exists a unique transition $({q_{\tt H}},\_,\_)\in\delta_{\tt H}$.\\
Moreover such a transition is of the form
$(q_{\tt H},{\tt H}\mathtt{s}!a,q')$ with $q'\not\in\widehat{Q_{\tt H}}$.\\
Similarly for ${\tt K}$.
\item
\label{fact:uniquesending-ii}
If ${q_{\tt H}}\not\in\widehat{Q_{\tt H}}$ then either $q_{\tt H}$ is final, or any transition $({q_{\tt H}},\_,\_)\in\delta_{\tt H}$
is an input one, that
is of the form $({q_{\tt H}},\mathtt{s}{\tt H}?a,\widehat{q'_{\tt H}})$ with $\widehat{q'_{\tt H}}\in\widehat{Q_{\tt H}}$. Similarly for ${\tt K}$.
\item
\label{fact:uniquesending-iii}
If ${q_{\tt H}}\not\in\widehat{Q_{\tt H}}$ then
\begin{enumerate}[a)]
\item
If $(q_{\tt H},{\tt K}{\tt H}?a,\widehat{q'_{\tt H}})\in\delta_{\tt H}$ then there exists $(\widehat{q'_{\tt H}},{\tt H}\mathtt{s}!a,q''_{\tt H})\in\delta_{\tt H}$ with $\mathtt{s} \neq {\tt K}$
such that $(q_{\tt H},{\tt H}\mathtt{s}!a,q''_{\tt H})\in\delta^1_{\tt H}$.
The same holds for $\delta^2_{\tt K}$ by exchanging ${\tt H}$ with ${\tt K}$ and vice versa.
\item
If $(q_{\tt H},\mathtt{s}{\tt H}?a,\widehat{q'_{\tt H}})\in\delta_{\tt H}$ with $\mathtt{s}\neq{\tt K}$ then there exists $(\widehat{q'_{\tt H}},{\tt H}{\tt K}!a,q''_{\tt H})\in\delta_{\tt H}$
such that $(q_{\tt H},\mathtt{s}{\tt H}?a,q''_{\tt H})\in\delta^1_{\tt H}$.
The same holds for $\delta^2_{\tt K}$ by exchanging ${\tt H}$ with ${\tt K}$ and vice versa.
\end{enumerate}
\end{enumerate}
\end{fact}
If a reachable configuration of the connected system $S={S_{1}}\connect{{\tt H}}{{\tt K}} {S_{2}}$ does not involve an intermediate state of the gateway
$M_{\tt H} = \gateway{M^1_{\tt H}, {\tt K}}$,
then by taking into account only the states of machines of $S_1$ and disregarding
the channels between the gateways,
we get a
reachable configuration of $S_1$. Similarly for $S_2$.
\begin{lemma}\hfill\\
\label{lem:nohatrestrict}
Let $s= (\vec{q},\vec{w}) \in RS(S)$ be a reachable configuration of $S ={S_{1}}\connect{{\tt H}}{{\tt K}} {S_{2}}$.
\begin{enumerate}[i)]
\item
\label{lem:nohatrestrict-i}
$q_{\tt H}\not\in\widehat{Q_{\tt H}} \implies
\restrict{s}{1}\in RS(S_1)$;
\item
\label{lem:nohatrestrict-ii}
$q_{\tt K}\not\in\widehat{Q_{\tt K}} \implies
\restrict{s}{2}\in RS(S_2)$.
\end{enumerate}
\end{lemma}
\begin{proof}\,
[{\it Sketch}]
(\ref{lem:nohatrestrict-i})
If $s \in RS(S)$, then there exists $s_0\lts{}s_1\lts{} \ldots\lts{} s_{n-1}\lts{}s_n=s$. Let $s_i = (\vec{q_i},\vec{w_i})$ $(i=0,..n)$.
Let $j \geq 0$ be the smallest index such that ${q_j}_{\tt H}\not\in \widehat{Q_{\tt H}}$ and ${q_{j+1}}_{\tt H}\in \widehat{Q_{\tt H}}$
(if there is not such a $j$, then the thesis follows immediately).
By definition of $\gateway{\cdot}$ we have that $s_j\lts{\mathtt{r}{\tt H}?a} s_{j+1}$ for a certain $\mathtt{r}$.
Now let $t\geq j+1$ be the smallest index such that ${q_t}_{\tt H} = {q_{j+1}}_{\tt H}$ and ${q_{t+1}}_{\tt H}\not\in \widehat{Q_{\tt H}}$.
Such an index $t$ does exist because of the hypothesis $q_{\tt H}\not\in\widehat{Q_{\tt H}}$
(moreover, notice that no-self loop transitions are possible out of a state in $\widehat{Q_{\tt H}}$).
By definition of $\gateway{\cdot}$ we have that $s_{t}\lts{{\tt H}\mathtt{s}!a} s_{t+1}$ for a certain $\mathtt{s}$.
It is now possible to build a configuration-transitions sequence like the following one\\
\centerline{
$s_0\lts{}s_1\lts{}\ldots s_j\lts{\mathtt{r}{\tt H}?a} s_{j+1}\lts{{\tt H}\mathtt{s}!a} s'_{j+2} \lts{} \ldots \lts{}s'_{n-1}\lts{}s_n=s$
}
where ${q_{j+2}}_{\tt H}\not\in \widehat{Q_{\tt H}}$.\\
By iterating this procedure, we can get a sequence
\\
\centerline{
$s_0\lts{}s_1\lts{}\ldots s_j\lts{} s_{j+1}\lts{} s'_{j+2}\lts{} s''_{j+3} \lts{} \ldots \lts{}s''_{n-1}\lts{}s_n=s$
}
such that any transition of the form $\mathtt{r}{\tt H}?a$ is immediately followed by a transition ${\tt H}\mathtt{s}!a$.
Now, it is possible to check that
\begin{enumerate}[a)]
\item
for $z=0..j-1$, either $\restrict{s_z}{1} \ltsone{} \restrict{s_{z+1}}{1}$
or $\restrict{s_z}{1} = \restrict{s_{z+1}}{1}$, and
\item
$\restrict{s_j}{1} \ltsone{} \restrict{s'_{j+2}}{1}$.
\end{enumerate}
By doing that for any transition of the form $\mathtt{r}{\tt H}?a$ which is immediately followed by a transition ${\tt H}\mathtt{s}!a$,
we can get a sequence $\restrict{s_0}{1} \lts{}^* \restrict{s}{1}$. So $\restrict{s}{1}\in RS(S_1)$.\\
(\ref{lem:nohatrestrict-ii}) This case can be treated similarly to (\ref{lem:nohatrestrict-i}).
\end{proof}
In a reachable configuration of a connected system, if the states of the gateways are not
among those introduced by the transformation $\gateway{\cdot}$ and not final, and if the channels between
the gateways are empty, then one of the two gateways is ready to receive messages that
the other gateway is ready to receive from its system's participants.
This property relies on compatibility.
\begin{lemma
\label{lem:alltrans}
Let $s= (\vec{q},\vec{\varepsilon}) \in RS(S)$ be a reachable configuration of
$S={S_{1}}\connect{{\tt H}}{{\tt K}} {S_{2}}$
such that
\begin{enumerate}
\item
$q_{\tt H}\not\in\widehat{Q_{\tt H}}$ and $q_{\tt K}\not\in\widehat{Q_{\tt K}}$, and
\item
$q_{\tt H}$ and $q_{\tt K}$ are not final.
\end{enumerate}
Then either
\begin{enumerate}[a)]
\item
\label{lem:alltrans-a}
all the transitions from $q_{\tt H}$ in $\delta_{\tt H}$ are of the form $(q_{\tt H},{\tt K}{\tt H}?\_,\_)$ and\\
all the transitions from $q_{\tt K}$ in $\delta_{\tt K}$ are of the form $(q_{\tt K},\mathtt{s}{\tt K}?\_,\_)$ with $\mathtt{s}\neq{\tt H}$, or
\item
\label{lem:alltrans-b}
all the transitions from $q_{\tt K}$ in $\delta_{\tt K}$ are of the form $(q_{\tt K},{\tt H}{\tt K}?\_,\_)$ and\\
all the transitions from $q_{\tt H}$ in $\delta_{\tt H}$ are of the form $(q_{\tt H},\mathtt{s}{\tt H}?\_,\_)$ with $\mathtt{s}\neq{\tt K}$
\end{enumerate}
\end{lemma}
\begin{proof}\,
[{\it Sketch}]
Let \\
\centerline{
$s_0\lts{\mathit{l}_1}s_1\lts{\mathit{l}_2} \ldots \lts{\mathit{l}_{n-1}}s_{n-1}\lts{\mathit{l}_n}s_n=s$
}
be a configuration-transitions sequence leading to $s\in RS(S)$.
Let $\restrictup{s}{{\tt H}}$ be the sequence of transitions $\lts{\mathit{l}_{i_{1}}}\ldots\lts{\mathit{l}_{i_{{\tt H}}}}$
of the above sequence such that, for any $m\in\Set{i_1,..i_{\tt H}}$, $\mathit{l}_{m}\in\delta_{\tt H}$.
We define similarly the sequence $\restrictup{s}{{\tt K}}$.
By definition of $\gateway{\cdot}$, and by the fact that
$q_{\tt H}\not\in\widehat{Q_{\tt H}}$,
we have that $\restrictup{s}{{\tt H}}$ is made of consecutive pairs of the form
$\lts{(\_,{\tt K}{\tt H}?a,\_)}\lts{(\_,{\tt H}\mathtt{s}!a,\_)}$, with $\mathtt{s}\neq{\tt K}$, or $\lts{(\_,\mathtt{s}{\tt H}?a,\_)}\lts{(\_,{\tt H}{\tt K}!a,\_)}$, with $\mathtt{s}\neq{\tt K}$.
Similarly for $\restrictup{s}{{\tt K}}$.\\
Since $w_{{\tt H}{\tt K}} =w_{{\tt K}{\tt H}} = \varepsilon$ (which immediately follows from the hypothesis
$s= (\vec{q},\vec{\varepsilon})$), the number of
pairs $\lts{(\_,{\tt K}{\tt H}?\_,\_)}\lts{(\_,{\tt H}\mathtt{s}!\_,\_)}$ in $\restrictup{s}{{\tt H}}$ is equal to the number of pairs
$\lts{(\_,\mathtt{r}{\tt K}?\_,\_)}\lts{(\_,{\tt K}{\tt H}!\_,\_)}$ in $\restrictup{s}{{\tt K}}$; and vice versa.
This implies that $\mid\restrictup{s}{{\tt H}}\mid = \mid \restrictup{s}{{\tt K}}\mid$.\\
Now, by extending to sequences $\restrictup{s}{{\tt K}}$ and $\restrictup{s}{{\tt H}}$
the following symbols function on pairs\\
\centerline{
$\mathit{symb}(\lts{(\_,{\tt K}{\tt H}?a,\_)}\lts{(\_,{\tt H}\mathtt{s}!a,\_)}) =!a$ \hspace{5mm} $\mathit{symb}(\lts{(\_,\mathtt{s}{\tt H}?a,\_)}\lts{(\_,{\tt H}{\tt K}!a,\_)}) =?a$
}
(and the clauses got by exchanging ${\tt H}$ and ${\tt K}$),
we get $\mathit{symb}(\restrictup{s}{{\tt H}}) \in \lang{M^1_{\tt H}}^{\not\mathit{C}}$ and $\mathit{symb}(\restrictup{s}{{\tt K}}) \in \lang{M^2_{\tt K}}^{\not\mathit{C}}$. Moreover,
$\mathit{symb}(\restrictup{s}{{\tt H}}) = \Dual{\mathit{symb}(\restrictup{s}{{\tt K}})}$.
Notice that, by ?!-determinism of $M^1_{\tt H}$ and $M^2_{\tt K}$ and absence of mixed states, there are no other sequences of pairs
for which the previous properties hold.\\
Now, by contradiction, and by recalling that $q_{\tt H}$ and $q_{\tt K}$ are not final, let us assume that either
\begin{enumerate}[I)]
\item
\label{I}
all the transitions from $q_{\tt H}$ in $\delta_{\tt H}$ are of the form $(q_{\tt H},{\tt K}{\tt H}?\_,\_)$ and\\
all the transitions from $q_{\tt K}$ in $\delta_{\tt K}$ are of the form$(q_{\tt K},{\tt H}{\tt K}?\_,\_)$ or
\item
\label{II}
all the transitions from $q_{\tt H}$ in $\delta_{\tt H}$ are of the form $(q_{\tt H},\mathtt{s}{\tt H}?\_,\_)$ with $\mathtt{s}\neq{\tt H}$ and\\
all the transitions from $q_{\tt K}$ in $\delta_{\tt K}$ are of the form $(q_{\tt K},\mathtt{s}{\tt K}?\_,\_)$ with $\mathtt{s}\neq{\tt H}$.
\end{enumerate}
Notice that no other possibilities are given because, by compatibility, $M^1_{\tt H}$ and $M^2_{\tt K}$ have no mixed state.\\
If (\ref{I}) holds, we get a contradictrion, since, by Fact \ref{fact:uniquesending}(\ref{fact:uniquesending-iii}),
we would get both $\mathit{symb}(\restrictup{s}{{\tt H}})\cdot !a\in \lang{M^1_{\tt H}}^{\not\mathit{C}}$ and
$\mathit{symb}(\restrictup{s}{{\tt K}})\cdot !b \in \lang{M^2_{\tt K}}^{\not\mathit{C}}$ for some $a$ and $b$, which is impossible by compatibility.\\
In case (\ref{II}) we get a contradiction by arguing analogously as in the previous case.
\end{proof}
\begin{lemma}\label{lem:restrRS}
Let $s= (\vec{q},\vec{\varepsilon}) \in RS(S)$ be a deadlock configuration for $S$.
Then, either $\restrict{s}{1}\in RS(S_1)$ is a deadlock configuration for $S_1$
or $\restrict{s}{2}\in RS(S_2)$ is a deadlock configuration for $S_2$ (or both).
\end{lemma}
\begin{proof}
By definition of deadlock configuration and by Fact \ref{fact:uniquesending}(\ref{fact:uniquesending-i}), we have that
neither $q_{\tt H}\in\widehat{Q_{\tt H}}$ nor $q_{\tt K}\in\widehat{Q_{\tt K}}$. Otherwise
there will be an output transition from either $q_{\tt H}$ or $q_{\tt K}$, contradicting $s$ to be a deadlock configuration.
Hence necessarily $q_{\tt H}\not\in\widehat{Q_{\tt H}}$ and $q_{\tt K}\not\in\widehat{Q_{\tt K}}$.
So, by Lemma \ref{lem:nohatrestrict} we get $\restrict{s}{i}\in RS(S_i)$ for $i=1,2$.
We show that under the assumption either $\restrict{s}{1}\in RS(S_1)$ or $\restrict{s}{2}\in RS(S_2)$ is a deadlock configuration
Since $s= (\vec{q},\vec{\varepsilon}) \in RS(S)$ is a deadlock configuration for $S$, we have
that for all $\mathtt{r}\in\mathbf{P}$, $q_r$ is a receiving state of $M_\mathtt{r}$.
In particular, for all $\mathtt{r}\in \mathbf{P}_1\setminus\Set{{\tt H}}$, $q_r$ is a receiving state
of $M_\mathtt{r} = M^1_\mathtt{r}$ and
for all $\mathtt{r}\in \mathbf{P}_2\setminus\Set{{\tt K}}$, $q_r$ is a receiving state of $M_\mathtt{r} = M^2_\mathtt{r}$.
It remains to show that either $q_{\tt H}$ is a receiving state of $M^1_{\tt H}$
or $q_{\tt K}$ is a receiving state of $M^1_{\tt K}$,
whereby we can assume that $q_{\tt H}$ is a receiving state of
$M_{\tt H} = \gateway{M^1_{\tt H}, {\tt K}}$
and $q_{\tt K}$ is a receiving state of $M_{\tt K} = \gateway{M^2_{\tt K}, {\tt H}}$.
Without loss of generality we consider $q_{\tt H}$. The proof for $q_{\tt K}$ is analogous.
By Lemma~\ref{lem:alltrans} we have two possibilities to take into account
\begin{description}
\item
All the transitions from $q_{\tt H}$ in $\delta_{\tt H}$ are of the form $(q_{\tt H},{\tt K}{\tt H}?\_,\_)$.\\
In such a case, still resorting to Lemma \ref{lem:alltrans}, we have that
all the transitions from $q_{\tt K}$ in $\delta_{\tt K}$ are of the form $(q_{\tt K},\mathtt{s}{\tt K}?\_,\_)$ with $\mathtt{s}\neq{\tt H}$
and, by Fact \ref{fact:uniquesending}(\ref{fact:uniquesending-iii}),\\
$(q_{\tt K},\mathtt{s}{\tt K}?a,\widehat{q'_{\tt K}})\in\delta_{\tt K}$ implies
$(\widehat{q'_{\tt K}},{\tt K}{\tt H}!a,q''_{\tt K})\in\delta_{\tt K}$ and
$(q_{\tt K},\mathtt{s}{\tt K}?a, q''_{\tt K})\in\delta^2_{\tt K}$.\\
Hence $q_{\tt K}$ is a receiving state
of $M^{2}_{\tt K}$. In summary,
$\restrict{s}{2}$ is a deadlock configuration for $S_2$.
\item
All the transitions from $q_{\tt H}$ in $\delta_{\tt H}$ are of the form $(q_{\tt H},\mathtt{s}{\tt H}?\_,\_)$ with $\mathtt{s}\neq{\tt H}$.\\
In such a case, by Fact \ref{fact:uniquesending}(\ref{fact:uniquesending-iii}), we have that \\
$(q_{\tt H},\mathtt{s}{\tt H}?a,\widehat{q'_{\tt H}})\in\delta_{\tt H}$ implies
$(\widehat{q'_{\tt H}},{\tt H}{\tt K}!a,q''_{\tt H})\in\delta_{\tt H}$ and
$(q_{\tt H},\mathtt{s}{\tt H}?a,q''_{\tt H})\in\delta^1_{\tt H}.$\\
Hence $q_{\tt H}$ is a receiving state
of $M^{1}_{\tt H}$. In summary, $\restrict{s}{1}$ is a deadlock configuration for $S_1$.
\end{description}
\end{proof}
\begin{corollary}[Preservation of deadlock-freeness]\hfill\\
\label{prop:dfPreservation}
Let $S_1$ and $S_2$ be deadlock-free.
Then $S = {S_{1}} \connect{{\tt H}}{{\tt K}} {S_{2}}$ is deadlock-free.
\end{corollary}
\begin{proof}
By contradiction, let us assume there is an $s\in RS(S)$ such that $s=(\vec{q},\vec{\varepsilon})$ is a deadlock configuration.
We get immediately a contradiction by Lemma \ref{lem:restrRS} and the fact that $S_1$ and $S_2$ are two deadlock-free systems.
\end{proof}
Compatibility of interface roles forces all the messages sent by a gateway to be correctly received by the other one.
This implies that if the gateways both reach final states, the channels connecting them are empty.
\begin{lemma}
\label{lem:wempty}
If $s= (\vec{q},\vec{w}) \in RS(S)$ is a reachable configuration of $S={S_{1}}\connect{{\tt H}}{{\tt K}} {S_{2}}$
such that both states $q_{\tt H}$ and $q_{\tt K}$ are final,
then $w_{{\tt H}{\tt K}} = w_{{\tt K}{\tt H}} = \varepsilon$.
\end{lemma}
\begin{proof}\,
[{\it Sketch}]
By Fact. \ref{fact:uniquesending}(\ref{fact:uniquesending-i}), $q_{\tt H}\notin \widehat{Q_{\tt H}}$ and $q_{\tt K}\notin \widehat{Q_{\tt K}}$. We now proceed as in the first part of the proof of Lemma \ref{lem:alltrans}.
Let \\
\centerline{
$s_0\lts{\mathit{l}_1}s_1\lts{\mathit{l}_2} \ldots \lts{\mathit{l}_{n-1}}s_{n-1}\lts{\mathit{l}_n}s_n=s$
}
be a configuration-transitions sequence leading to $s\in RS(S)$.\\
Let $\restrictup{s}{{\tt H}}$ be the sequence of transitions $\lts{\mathit{l}_{i_1}}\ldots\lts{\mathit{l}_{i_{\tt H}}}$
of the above sequence such that, for any $m\in\Set{i_1,..i_{\tt H}}$, $\mathit{l}_{m}\in\delta_{\tt H}$.
We define similarly the sequence $\restrictup{s}{{\tt K}}$.
By definition of $\gateway{\cdot}$, and by the fact that
$q_{\tt H}\not\in\widehat{Q_{\tt H}}$,
we have that $\restrictup{s}{{\tt H}}$ is made of consecutive pairs of the form
$\lts{(\_,{\tt K}{\tt H}?a,\_)}\lts{(\_,{\tt H}\mathtt{s}!a,\_)}$, with $\mathtt{s}\neq{\tt K}$, or
$\lts{(\_,\mathtt{s}{\tt H}?a,\_)}\lts{(\_,{\tt H}{\tt K}!a,\_)}$, with $\mathtt{s}\neq{\tt K}$.
Similarly for $\restrictup{s}{{\tt K}}$.\\
Without loss of generality, let us assume $\restrictup{s}{{\tt H}}$ to begin with a pair of the form
$\lts{(\_,\mathtt{s}{\tt H}?a,\_)}\lts{(\_,{\tt H}{\tt K}!a,\_)}$.
(Otherwise $\restrictup{s}{{\tt K}}$ would begin with a pair of the form
$\lts{(\_,\mathtt{s}{\tt K}?a,\_)}\lts{(\_,{\tt K}{\tt H}!a,\_)}$
since $\lang{M^1_{\tt H}}^{\not\mathit{C}} = \Dual{\lang{M^2_{\tt K}}^{\not\mathit{C}}}$).)
Hence, up to the role $\mathtt{s}$, the symbols of $\restrictup{s}{{\tt K}}$ are uniquely determined by $\restrictup{s}{{\tt H}}$ because of
?!-determinism and absence of mixed states.
Then $\mathit{symb}(\restrictup{s}{{\tt H}}) \in \lang{M^1_{\tt H}}$ and $\mathit{symb}(\restrictup{s}{{\tt K}}) \in \lang{M^2_{\tt K}}$. Moreover,
$\mathit{symb}(\restrictup{s}{{\tt H}}) = \Dual{\mathit{symb}(\restrictup{s}{{\tt K}})}$.
By assuming either $w_{{\tt H}{\tt K}} \neq \varepsilon$ or $w_{{\tt K}{\tt H}} \neq \varepsilon$ we would get a contradiction.
In fact, by the above, $\mid\restrictup{s}{{\tt H}}\mid = \mid \restrictup{s}{{\tt K}}\mid$.
\end{proof}
\begin{lemma
\label{lem:restrRSom}
Let $s= (\vec{q},\vec{w}) \in RS(S)$ be an orphan-message configuration for $S$.
Then,
either $\restrict{s}{1}$ is an orphan-message configuration for $S_1$
or $\restrict{s}{2}$ is an orphan-message configuration for $S_2$.
\end{lemma}
\begin{proof}
By Fact \ref{fact:uniquesending}(\ref{fact:uniquesending-i}), no state in $\widehat{Q_{\tt H}}\cup \widehat{Q_{\tt K}}$ can be final. So, by definition
of orphan-message configuration, $q_{\tt H}\not\in \widehat{Q_{\tt H}}$ and $q_{\tt K}\not\in \widehat{Q_{\tt K}}$.
Hence, for $i=1,2$, $\restrict{s}{i}\in RS(S_i)$ by Lemma \ref{lem:nohatrestrict}.
Now, by definition of orphan-message configuration, both $q_{\tt H}$ and $q_{\tt K}$ are final
in $M_{\tt H}$ and $M_{\tt K}$ respectively.
Hence, by Lemma~\ref{lem:wempty}, $w_{{\tt H}{\tt K}} = w_{{\tt K}{\tt H}} = \varepsilon$.
This implies that either $\restrict{w}{1}\neq\vec{\varepsilon}$ or
$\restrict{w}{2}\neq\vec{\varepsilon}$.
Moroeover, $q_{\tt H}$ and $q_{\tt K}$ must also be final
in $M^1_{\tt H}$ and $M^2_{\tt K}$ respectively.
The rest of the thesis follows then by definition of orphan-message configuration.
\end{proof}
\begin{corollary}[Preservation of no orphan-message
\label{prop:nomPreservation}
Let $S_1$ and $S_2$ be such that both $RS(S_{1})$ and $RS(S_{2})$ do not contain any orphan-message configuration.
Then there is no orphan-message configuration in $RS(S)$.
\end{corollary}
\begin{proof}
By contradiction, let us assume there is an $s\in RS(S)$ which is an orphan-message configuration. We get
immediately a contradiction by Lemma \ref{lem:restrRSom}.
\end{proof}
\begin{proposition}[Preservation of no unspecified reception]
\label{prop:nurPreservation}
Let $S_1$ and $S_2$ be such that both $RS(S_{1})$ and $RS(S_{2})$ do not contain any unspecified reception configuration.
Then there is no unspecified reception configuration in $RS(S)$.
\end{proposition}
\begin{proof}\,
[{\it Sketch}]
By contradiction, let us assume there is an $s= (\vec{q},\vec{w})\in RS(S)$ which is an unspecified reception configuration.
Moreover, let $\mathtt{r} \in \textbf{P}$ and $q_\mathtt{r}$ be the receiving state of $M_\mathtt{r}$ prevented from
receiving any message from any of its buffers (Definition \ref{def:safeness}(\ref{def:safeness-ur})).
Without loss of generality, we assume $\mathtt{r}\in\mathbf{P}_1$.
The following cases can occur:
\begin{description}
\item
$q_{\tt H}\not\in \widehat{Q_{\tt H}}$.\\
By Lemma \ref{lem:nohatrestrict} we get $\restrict{s}{1}\in RS(S_1)$.
Two sub-cases are possible:
\begin{description}
\item
$\mathtt{r}\neq{\tt H}$\\
In such a case we get immediately a contradiction by the hypothesis that $RS(S_{1})$ does not contain any unspecified reception configuration.
\item
$\mathtt{r}={\tt H}$\\
$q_{\tt H}\,(= q_\mathtt{r})$ is hence a receiving state. So let $\Set{(q_{\tt H},\mathtt{s}_j{\tt H}?a_j,\widehat{q_j})}_{j=1..m}$ be the set
of all the outgoing transitions from $q_{\tt H}$ in $\delta_{\tt H}$.
By definition of unspecified reception configuration, for any $j=1..m$, $\mid w_{\mathtt{s}_j{\tt H}}\mid > 0$
and $w_{\mathtt{s}{\tt H}}\not\in a_j\cdot\mathbb{A}^*$.
By compatibility, and in particular by the absence of mixed states, we have just the following two possibilities:
\begin{description}
\item
$\mathtt{s}_j\neq{\tt K}$ for any $j=1..m$.\\
By Fact \ref{fact:uniquesending}(\ref{fact:uniquesending-iii}) and definition of $\gateway{\cdot}$ we have that
$$[(q_{\tt H},\mathtt{s}_j{\tt H}?a_j,\widehat{q_j})\in\delta_{\tt H} ~~\wedge ~~
\mathtt{s}_j\neq{\tt K}] \iff
(q_{\tt H},\mathtt{s}{\tt H}?a_j,q_j)\in\delta^1_{\tt H}$$
This implies $\restrict{s}{1}$ to be an unspecified reception configuration for $S_1$. Contradiction.
\item
$\mathtt{s}_j = {\tt K}$ for any $j=1..m$.\\
Let $\restrictup{s}{{\tt H}}$ and $\restrictup{s}{{\tt K}}$ be defined as in the proofs of Lemmas
\ref{lem:alltrans} and \ref{lem:wempty}. We define now
\begin{itemize}
\item[-]
$\restrictup{s}{{\tt H}!}$ as the sequence made of the transition pairs in $\restrictup{s}{{\tt H}}$
of the form $\lts{(\_,{\tt K}{\tt H}?a,\_)}\lts{(\_,{\tt H}\mathtt{s}!a,\_)}$ with $\mathtt{s}\neq{\tt K}$, and
\item[-]
$\restrictup{s}{{\tt K}?}$ as the sequence made of the transition pairs in $\restrictup{s}{{\tt K}}$
of the form $\lts{(\_,\mathtt{s}{\tt K}?a,\_)}\lts{(\_,{\tt K}{\tt H}!a,\_)}$ with $\mathtt{s}\neq{\tt H}$.
\end{itemize}
Let now $n=\mid \restrictup{s}{{\tt H}!} \mid$ and let $\restrictup{s}{{\tt H}!}_{/n}$ be the sequence of the messages of the first $n$
elements of $\restrictup{s}{{\tt H}!}$.
By compatibility, in particular $\lang{M^1_{\tt H}}^{\not\mathit{C}} = \Dual{\lang{M^2_{\tt K}}^{\not\mathit{C}}}$, it follows that,
if $w_{{\tt K}{\tt H}} \in b\cdot\mathbb{A}^*$, then $\restrictup{s}{{\tt K}?}_{/n+1}=\restrictup{s}{{\tt K}?}_{/n}\cdot b$
and $\exists j. a_j = b$. So contradicting that, for any $j=1..m$,
$w_{{\tt K}{\tt H}}\not\in a_j\cdot\mathbb{A}^*$.
\end{description}
\end{description}
\item
$q_{\tt H}=\widehat{q}\in \widehat{Q_{\tt H}}$.\\
By Fact \ref{fact:uniquesending}(\ref{fact:uniquesending-i})
$q_{\tt H}\in \widehat{Q_{\tt H}}$ is a sending state such that $(q_{\tt H},{\tt H}\mathtt{s}!a,q''_{\tt H})\in{\delta}_{\tt H}$. Hence it is impossible that $\mathtt{r}={\tt H}$.
So, let $\mathtt{r}\neq{\tt H}$.
In such a case, by definition of $\gateway{\cdot}$,
we have necessarily a unique transition of the form $(q'_{\tt H},\mathtt{p}{\tt H}?a,q_{\tt H})\in{\delta}_{\tt H}$.
Moreover, $q'_{\tt H}\not\in \widehat{Q_{\tt H}}$. So
there exists necessarily an element $s'\in RS(S)$ such that
$s'=(\vec{q'},\vec{w'})\lts{\mathtt{p}{\tt H}?a}s$ with $q'_{\tt H}\not\in \widehat{Q_{\tt H}}$. It follows that also $s'$ is
an unspecified-reception configuration and $\restrict{s'}{1} \in RS(S_1)$.
Then we get a contradiction by arguing like in the first case, sub-case $\mathtt{r} \neq {\tt H}$.
\end{description}
\end{proof}
We are now ready to state our main results.
\begin{corollary}[Safety properties preservation]\hfill
\label{cor:safetypres}
\begin{enumerate}
\item
Let $S={S_{1}}\connect{{\tt H}}{{\tt K}} {S_{2}}$ be the system composed
from systems $S_1$ and $S_2$ with compatible CFSMs for the roles ${\tt H}$ and ${\tt K}$.
If $S_1$ and $S_2$ are both safe, then $S$ is safe.
\item
Let $\GTIR{{\bf G}}{\mathbf{I}} =\GTIR{\GTIR{{{\bf G}}_1}{\mathbf{H}}\connect{{\tt H}}{{\tt K}}\GTIR{{{\bf G}}_2}{\mathbf{K}}}{\mathbf{I}}$
be the GTIR composed from GTIRs $\GTIR{{\bf G}_1}{\mathbf{H}}$
and $\GTIR{{\bf G}_2}{\mathbf{K}}$ via compatible interface roles ${\tt H}$ and ${\tt K}$.
If $\Sem{\GTIR{{\bf G}_1}{\mathbf{H}}}$ and $\Sem{\GTIR{{\bf G}_2}{\mathbf{K}}}$ are both safe,
then $\Sem{\GTIR{{\bf G}}{\mathbf{I}}}$ is safe.
\end{enumerate}
\end{corollary}
As a consequence, by induction on the pairwise composition of GTIRs,
we obtain the following desired result.
\begin{corollary}
Let $\GTIR{{\bf G}}{\mathbf{I}}$ be a GTIR such that, for any global graph $G\in \mathcal{C} (\GTIR{G}{\mathbf{I}})$,\\
the system $(\projecton{G}{\mathtt{p}})_{\mathtt{p}\in\mathbf{P}(G)}$ is safe.
Then $\Sem{\GTIR{{\bf G}}{\mathbf{I}}}$ is safe.
\end{corollary}
| {'timestamp': '2018-10-08T02:04:23', 'yymm': '1810', 'arxiv_id': '1810.02468', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02468'} | arxiv |
\section{Introduction}
In the paper \cite{yu2018wyner}, we defined a new notion, the R\'enyi
common information, which is a generalization of Wyner's common information.
This generalization involves using the unnormalized and normalized
R\'enyi divergences, instead of the relative entropy, to measure the
level of approximation between the induced and target distributions.
For a given target distribution $\pi_{XY}$, the minimum rate needed
to ensure that the unnormalized R\'enyi divergence $D_{1+s}(P_{X^{n}Y^{n}}\|\pi_{X^{n}Y^{n}})$
(resp. normalized R\'enyi divergence $\frac{1}{n}D_{1+s}(P_{X^{n}Y^{n}}\|\pi_{X^{n}Y^{n}})$)
vanishes asymptotically is defined as the R\'enyi common information,
and denoted as $T_{1+s}(\pi_{XY})$ (resp. $\widetilde{T}_{1+s}(\pi_{XY})$).
Here $\pi_{X^{n}Y^{n}}:=\pi_{XY}^{n}$. The case of $s=0$ corresponds
to Wyner's common information, which is equal to\footnote{In \cite{yu2018wyner}, $C_{\mathsf{Wyner}}(\pi_{XY})$ was denoted
as $C_{\mathsf{Wyner}}(X;Y)$.} $C_{\mathsf{Wyner}}(\pi_{XY})$ defined in \cite[Eqn. (1)]{yu2018wyner}.
In \cite{yu2018wyner}, we focused on the cases that $\pi_{XY}$ has
a finite alphabet and the R\'enyi parameter $1+s\in[0,2]$. In Theorem
1 of \cite{yu2018wyner}, we claimed that for these cases, the R\'enyi
common information was equal to Wyner's common information. However,
in fact, this is incorrect. There is an error in the achievability
proof part of Theorem 1 for $s\in(0,1]$. Obviously, for $s\in(0,1]$,
by definition, $T_{1+s}(\pi_{XY})$ and $\widetilde{T}_{1+s}(\pi_{XY})$
are lower bounded by $C_{\mathsf{Wyner}}(\pi_{XY})$. But the proof
for that they are upper bounded by $C_{\mathsf{Wyner}}(\pi_{XY})$
(the achievability part) for the case $s\in(0,1]$ is incorrect. Specifically,
in the proof given in Appendix A of \cite{yu2018wyner}, equation
(79) is incorrect, since for a tuple $(w^{n},x^{n},y^{n})$, the conditions
that $(w^{n},x^{n})$ has joint type $T_{W}V_{X|W}$ and $(w^{n},y^{n})$
has joint type $T_{W}V_{Y|W}$ do not necessarily imply that $(x^{n},y^{n})$
has joint type $\sum_{w}T_{W}(w)V_{X|W}(\cdot|w)V_{Y|W}(\cdot|w)$.
In fact, the type of $(x^{n},y^{n})$ can be any element of the set
\begin{align}
& \Bigl\{\sum_{w}T_{W}(w)V_{XY|W}'(\cdot|w):\:T_{W}V_{XY|W}'\textrm{ is a type s.t. }\nonumber \\
& \qquad V_{X|W}'=V_{X|W},V_{Y|W}'=V_{Y|W}\Bigr\}.
\end{align}
In this document, we correct the erroneous statement in Theorem 1
of \cite{yu2018wyner} and provide a corresponding proof of the new,
albeit weaker, claim.
Denote the \emph{coupling sets} of $(P_{X},P_{Y})$ and $(P_{X|W},P_{Y|W})$
respectively as
\begin{align}
C(P_{X},P_{Y}) & :=\bigl\{ Q_{XY}\in\mathcal{P}(\mathcal{X}\times\mathcal{Y}):\nonumber \\
& \qquad Q_{X}=P_{X},Q_{Y}=P_{Y}\bigr\},\\
C(P_{X|W},P_{Y|W}) & :=\bigl\{ Q_{XY|W}\in\mathcal{P}(\mathcal{X}\times\mathcal{Y}|\mathcal{W}):\nonumber \\
& \qquad Q_{X|W}=P_{X|W},Q_{Y|W}=P_{Y|W}\bigr\}.\label{eq:-33-2}
\end{align}
Define the \emph{maximal $s$-mixed Shannon-cross entropy} with respect
to $\pi_{XY}$ over couplings $C(P_{X},P_{Y})$ as\footnote{Throughout this paper, we use $H(Q_{X})$ or $H_{Q}(X)$ to denote
the entropy of $X\sim Q_{X}$. When the distribution is denoted by
$P_{X}$, we omit the subscript, i.e., $H(X):=H_{P}(X)$. This notation
convention also applies to the conditional entropy and mutual information.}
\begin{align}
& \mathcal{H}_{s}(P_{X},P_{Y}\|\pi_{XY})\nonumber \\
& :=\max_{Q_{XY}\in C(P_{X},P_{Y})}\sum_{x,y}Q_{XY}(x,y)\log\frac{1}{\pi\left(x,y\right)}+\frac{1}{s}H(Q_{XY}).\label{eq:maximalcrossentropy}
\end{align}
For $s\in(0,\infty)$, define
\begin{align}
\Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY}) & :=\min_{P_{W}P_{X|W}P_{Y|W}:P_{XY}=\pi_{XY}}-\frac{1+s}{s}H(XY|W)\nonumber \\
& \qquad+\sum_{w}P(w)\mathcal{H}_{s}(P_{X|W=w},P_{Y|W=w}\|\pi_{XY})\label{eq:-35-4}
\end{align}
and
\begin{align}
\Gamma_{1+s}^{\mathrm{LB}}(\pi_{XY}) & :=\inf_{P_{W}P_{X|W}P_{Y|W}:P_{XY}=\pi_{XY}}-\frac{1+s}{s}H(XY|W)\nonumber \\
& \qquad+\inf_{Q_{WW'}\in C(P_{W},P_{W})}\sum_{w,w'}Q(w,w')\nonumber \\
& \qquad\times\mathcal{H}_{s}(P_{X|W=w},P_{Y|W=w'}\|\pi_{XY}).\label{eq:-35-4-1}
\end{align}
Define $\Gamma_{1}^{\mathrm{UB}}(\pi_{XY}),\Gamma_{1}^{\mathrm{LB}}(\pi_{XY}),\Gamma_{\infty}^{\mathrm{UB}}(\pi_{XY}),$
and $\Gamma_{\infty}^{\mathrm{LB}}(\pi_{XY})$ as the continuous extensions
of $\Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY})$ and $\Gamma_{1+s}^{\mathrm{LB}}(\pi_{XY})$
as $s$ tends to $0$ or $\infty$.
We introduce a condition on the distribution $\pi_{XY}$, which will
be used to characterize the necessary and sufficient condition for
$\Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY})=C_{\mathrm{Wyner}}(\pi_{XY})$.
Condition $(*)$: There exists some optimal distribution $P_{W}P_{X|W}P_{Y|W}$
attaining $C_{\mathrm{Wyner}}(\pi_{XY})$ such that $\pi_{XY}$ is
product on $\supp\left(P_{X|W=w}\right)\times\supp\left(P_{Y|W=w}\right)$
for each $w\in\supp\left(P_{W}\right)$, i.e., $\pi_{XY}\left(\cdot|\supp\left(P_{X|W=w}\right)\times\supp\left(P_{Y|W=w}\right)\right)$
is a product distribution for each $w\in\supp\left(P_{W}\right)$.
Now we provide some useful properties of $\Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY})$
and $\Gamma_{1+s}^{\mathrm{LB}}(\pi_{XY})$.
\begin{lem}
\label{lem:property} 1) In \eqref{eq:-35-4}, it suffices to restrict
the alphabet size of $W$ such that $|\mathcal{W}|\le|\mathcal{X}||\mathcal{Y}|$.
\\
2) $\Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY})$ and $\Gamma_{1+s}^{\mathrm{LB}}(\pi_{XY})$
are non-decreasing in $s\in(0,\infty)$.\\
3) The following limiting cases hold.
\begin{align}
\Gamma_{1}^{\mathrm{LB}}(\pi_{XY}) & \leq\Gamma_{1}^{\mathrm{UB}}(\pi_{XY})=C_{\mathsf{Wyner}}(X;Y),\label{eq:-42}\\
\Gamma_{\infty}^{\mathrm{UB}}(\pi_{XY}) & =\min_{\substack{P_{W}P_{X|W}P_{Y|W}:\\
P_{XY}=\pi_{XY}
}
}-H(XY|W)+\sum_{w}P(w)\nonumber \\
& \quad\times\max_{\substack{Q_{XY}\in\\
C(P_{X|W=w},P_{Y|W=w})
}
}\sum_{x,y}Q(x,y)\log\frac{1}{\pi\left(x,y\right)},\label{eq:-36-5}\\
\Gamma_{\infty}^{\mathrm{LB}}(\pi_{XY}) & =\inf_{\substack{P_{W}P_{X|W}P_{Y|W}:\\
P_{XY}=\pi_{XY}
}
}-H(XY|W)\nonumber \\
& \quad+\inf_{\substack{Q_{WW'}\in\\
C(P_{W},P_{W})
}
}\sum_{w,w'}Q(w,w')\nonumber \\
& \quad\times\max_{\substack{Q_{XY}\in\\
C(P_{X|W=w},P_{Y|W=w'})
}
}\sum_{x,y}Q(x,y)\log\frac{1}{\pi\left(x,y\right)}.\label{eq:-41}
\end{align}
4) For $s\in(0,\infty]$, $\Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY})=C_{\mathrm{Wyner}}(\pi_{XY})$
if and only if $\pi_{XY}$ satisfies the condition $(*)$.
\end{lem}
The proof of Lemma \ref{lem:property} is provided in Appendix \ref{sec:Proof-of-Lemma-property}.
Now we provide the promised correction of \cite[Theorem 1]{yu2018wyner}.
\begin{thm}[R\'enyi Common Informations]
\label{thm:RenyiCI} The unnormalized and normalized and R\'enyi common
informations satisfy
\begin{align}
\widetilde{T}_{1+s}(\pi_{XY}) & =T_{1+s}(\pi_{XY})\\
& =\begin{cases}
C_{\mathsf{Wyner}}(X;Y) & s\in(-1,0]\\
0 & s=-1
\end{cases},
\end{align}
\begin{align}
T_{1+s}(\pi_{XY}) & \geq\widetilde{T}_{1+s}(\pi_{XY})\nonumber \\
& \geq\max\left\{ \Gamma_{1+s}^{\mathrm{LB}}(\pi_{XY}),C_{\mathsf{Wyner}}(\pi_{XY})\right\} ,\;s\in(0,\infty],\label{eq:-28}
\end{align}
and
\begin{align}
& \widetilde{T}_{1+s}(\pi_{XY})\leq T_{1+s}(\pi_{XY})\leq\Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY}),\;s\in(0,1]\cup\{\infty\}.
\end{align}
Furthermore, for $s\in(-1,1]\cup\{\infty\}$, the optimal R\'enyi divergence
$D_{1+s}(P_{X^{n}Y^{n}}\|\pi_{X^{n}Y^{n}})$ in the definitions of
the R\'enyi common informations decays at least exponentially fast in
$n$ when $R>C_{\mathsf{Wyner}}(X;Y)$ for $s\in(-1,0]$ and $R>\Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY})$
for $s\in(0,1]\cup\{\infty\}$.
\end{thm}
\begin{rem}
By Statement 4) of Lemma \ref{lem:property}, we know that for any
pseudo-product distribution $\pi_{XY}$, the (unnormalized and normalized)
R\'enyi common informations with $s\in(-1,\infty]$ are equal to Wyner's
common information, i.e.,
\begin{equation}
\widetilde{T}_{1+s}(\pi_{XY})=T_{1+s}(\pi_{XY})=C_{\mathrm{Wyner}}(\pi_{XY}),\forall s\in(-1,\infty].
\end{equation}
\end{rem}
The upper bound for the case $s\in(0,1]$ is proved in Section \ref{sec:Upper-Bound-for}.
The lower bound for the case $s\in(0,\infty]$ is proved in Section
\ref{sec:Lower-Bound-for}. The upper and lower bounds for the case
$s=\infty$ were derived by the present authors in \cite{yu2018on}.
Hence for the achievability part, here we only provide a proof for
$s\in(0,1]$. (The converse proof that we present here includes the
case $s=\infty$).
To illustrate that the upper bound $\Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY})$
and the lower bound $\Gamma_{1+s}^{\mathrm{LB}}(\pi_{XY})$ may coincide
for certain sources, we now consider a doubly symmetric binary source
(DSBS) $\left(X,Y\right)$ with joint distribution
\begin{equation}
\pi_{XY}:=\left[\begin{array}{cc}
\alpha_{0} & \beta_{0}\\
\beta_{0} & \alpha_{0}
\end{array}\right]
\end{equation}
where $\alpha_{0}=\frac{1}{2}\left(a^{2}+(1-a)^{2}\right),\beta_{0}=a(1-a)$
with $a\in(0,\frac{1}{2})$. That is equivalent to the setting that
$W\sim\mathrm{Bern}(\frac{1}{2})$, $X=W\oplus A$, $Y=W\oplus B$,
$A\sim\mathrm{Bern}(a)$ and $B\sim\mathrm{Bern}(a)$ are independent.
Then by using Theorem \ref{thm:RenyiCI}, we can obtain the following
results.
\begin{cor}
\label{cor:For-a-DSBS}For a DSBS $\left(X,Y\right)$ with distribution
$\pi_{XY}$, we have that:\\
1) For $s\in(-1,0]$,
\begin{align}
& \widetilde{T}_{1+s}(\pi_{XY})\nonumber \\
& =T_{1+s}(\pi_{XY})\\
& =-2H_{2}(a)-\left(a^{2}+(1-a)^{2}\right)\log\left[\frac{a^{2}+(1-a)^{2}}{2}\right]\nonumber \\
& \qquad-2a(1-a)\log\left[a(1-a)\right],
\end{align}
where $H_{2}(a):=-a\log a-(1-a)\log(1-a)$ denotes the binary entropy
function.\\
2) For $s\in(0,1]$,
\begin{align}
& \widetilde{T}_{1+s}(\pi_{XY})\nonumber \\
& \leq T_{1+s}(\pi_{XY})\\
& \leq-\frac{1+s}{s}2H_{2}(a)+\frac{1}{s}\bigl\{-p^{*}\log p^{*}-2(a-p^{*})\log(a-p^{*})\nonumber \\
& \qquad-(1+p^{*}-2a)\log(1+p^{*}-2a)\nonumber \\
& \qquad-s(1+2p^{*}-2a)\log\alpha_{0}-s(2a-2p^{*})\log\beta_{0}\bigr\},\label{eq:-26}
\end{align}
where $p^{*}=\frac{\sqrt{k^{2}\left(\overline{a}-a\right)^{2}+4ka\overline{a}}-\left(k\left(\overline{a}-a\right)+2a\right)}{2\left(k-1\right)}$
and $k=\left(\frac{\alpha_{0}}{\beta_{0}}\right)^{2s}$.\\
3) For $s=\infty$,
\begin{align}
\widetilde{T}_{\infty}(\pi_{XY}) & =T_{\infty}(\pi_{XY})\\
& =-2H_{2}(a)-(1-2a)\log\left[\frac{a^{2}+(1-a)^{2}}{2}\right]\nonumber \\
& \qquad-2a\log\left[a(1-a)\right].\label{eq:-27}
\end{align}
\end{cor}
\begin{IEEEproof}
For the DSBS, Wyner \cite{Wyner} showed that
\begin{align}
& C_{\mathrm{Wyner}}(\pi_{XY})\nonumber \\
& =-2H_{2}(a)-\left(a^{2}+(1-a)^{2}\right)\log\left[\frac{1}{2}\left(a^{2}+(1-a)^{2}\right)\right]\nonumber \\
& \qquad-2a(1-a)\log\left[a(1-a)\right].\label{eq:-25}
\end{align}
Combining this with Theorem \ref{thm:RenyiCI}, we obtain Statement
1).
For Statement 2), we set $W\sim\mathrm{Bern}(\frac{1}{2})$, $X=W\oplus A$,
and $Y=W\oplus B$, where $A,B\sim\mathrm{Bern}(a)$ with $a\in(0,\frac{1}{2})$
are independent. For this setting,
\begin{align}
& C(P_{X|W=w},P_{Y|W=w})\nonumber \\
& =\left\{ \left[\begin{array}{cc}
p & a-p\\
a-p & 1+p-2a
\end{array}\right]:0\le p\le a\right\} .
\end{align}
Therefore,
\begin{align}
& s\mathcal{H}_{s}(P_{X|W=w},P_{Y|W=w}\|\pi_{XY})\nonumber \\
& =\max_{\substack{Q_{XY}\in\\
C(P_{X|W=w},P_{Y|W=w})
}
}\sum_{x,y}Q(x,y)\log\frac{1}{\pi\left(x,y\right)^{s}Q(x,y)}\label{eq:-54}\\
& =-p^{*}\log p^{*}-2(a-p^{*})\log(a-p^{*})\nonumber \\
& \qquad-(1+p^{*}-2a)\log(1+p^{*}-2a)\nonumber \\
& \qquad-s(1+2p^{*}-2a)\log\alpha_{0}-s(2a-2p^{*})\log\beta_{0}\Bigr\},
\end{align}
where the optimal $Q_{XY}$ in \eqref{eq:-54} is
\begin{equation}
\left[\begin{array}{cc}
p^{*} & a-p^{*}\\
a-p^{*} & 1+p^{*}-2a
\end{array}\right].
\end{equation}
Hence $\Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY})$ is upper bounded by
the expression in \eqref{eq:-26}. Combining this with Theorem \ref{thm:RenyiCI},
$T_{1+s}(\pi_{XY})$ is also upper bounded by the expression in \eqref{eq:-26}.
Statement 3) was proven in \cite[Theorem 3]{yu2018on}.
\end{IEEEproof}
The upper bound and lower bound for the R\'enyi common informations,
as well as Wyner's common information for the DSBS are illustrated
in Fig.~\ref{fig:Common-informations-for}.
\begin{figure*}
\centering \includegraphics[width=0.6\textwidth]{Fig1a}
\centering \includegraphics[width=0.6\textwidth]{Fig1b}
\caption{\label{fig:Common-informations-for}Illustrations of the upper bound
in \eqref{eq:-26} and lower bound in \eqref{eq:-28} for the R\'enyi
common informations, as well as Wyner's common information in \eqref{eq:-25}
for the DSBS $(X,Y)$ such that $X\sim\mathrm{Bern}(\frac{1}{2})$
and $Y=X\oplus E$ with $E\sim\mathrm{Bern}(p)$ independent of $X$.
In the top figure, $s=1$; and in the bottom figure, $p=0.2$ (i.e.,
$\alpha_{0}=0.4$). For the lower bound, we gradually increase the
alphabet size of $W$ from $2$ to $10$. Numerical results show that
the resulting curve does not change when we increase the alphabet
size. That is, for the DSBS, it appears that restricting the alphabet
size of $W$ to $2$ suffices to attain the lower bound. }
\end{figure*}
It is easy to verify that the expression in \eqref{eq:-27} (and also
the upper bound in Corollary \ref{cor:For-a-DSBS} for $s>0$) is
strictly larger than the expression in \eqref{eq:-25}. Hence, for
the DSBS, the R\'enyi common information of order $\infty$ is strictly
larger than Wyner's common information; also see \cite[Corollary 1]{yu2018on}.
Furthermore, when we evaluate the lower bound $\Gamma_{1+s}^{\mathrm{LB}}(\pi_{XY})$
for the DSBS, the numerical results (in Fig.~\ref{fig:Common-informations-for})
show that the lower bound coincides with the upper bound in Corollary
\ref{cor:For-a-DSBS}. Hence it is natural to conjecture the upper
bound in Corollary \ref{cor:For-a-DSBS} for the DSBS is tight. To
show this, one may follow the proof idea used in \cite[Theorem 3]{yu2018on}
for the case $s=\infty$. However, for $s\in(0,\infty)$, the proof
is not straightforward and we leave this to future work.
\section{\label{sec:Upper-Bound-for}Upper Bound for Case $s\in(0,1]$}
\begin{IEEEproof}
Here we only prove that $T_{1+s}(\pi_{XY})\leq\Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY})$
for $s\in(0,1]$. Other parts have been proven in the original paper
\cite{yu2018wyner}.
We continue from \cite[Eqn.~(74)]{yu2018wyner}. Analogously to the
definition of ${\cal A}$ in (74), here we define
\begin{align}
& \mathcal{A}_{\epsilon}':=\Bigl\{ P_{XY|W}\in\mathcal{P}(\mathcal{X}\times\mathcal{Y}|\mathcal{W}):\nonumber \\
& \forall(w,x),\left|\left[Q_{W}P_{X|W}\right](w,x)-Q_{WX}(w,x)\right|\leq\epsilon Q_{WX}(w,x),\nonumber \\
& \forall(w,y),\left|\left[Q_{W}P_{Y|W}\right](w,y)-Q_{WY}(w,y)\right|\leq\epsilon Q_{WY}(w,y)\Bigr\}.
\end{align}
Note that in \cite[Eqn.~(74)]{yu2018wyner}, we omit the dependence
of ${\cal A}$ on $\epsilon$. It is also worth noting that the set
${\cal A}$ defined in \cite[Eqn.~(74)]{yu2018wyner} can be written
as
\begin{align}
{\cal A} & =\Bigl\{ T_{w^{n}x^{n}y^{n}}:w^{n}\in\mathcal{T}_{\epsilon'}^{n}\left(Q_{W}\right),\nonumber \\
& \qquad x^{n}\in\mathcal{T}_{\epsilon}^{n}\left(Q_{WX}|w^{n}\right),y^{n}\in\mathcal{T}_{\epsilon}^{n}\left(Q_{WY}|w^{n}\right)\Bigr\},
\end{align}
where $T_{w^{n}x^{n}y^{n}}$ denotes the joint type of $(w^{n},x^{n},y^{n})$.
Let
\begin{align}
\delta_{0,n} & :=1-Q_{W}^{n}\left(\mathcal{T}_{\epsilon'}^{n}\left(Q_{W}\right)\right),\\
\delta_{1,n} & :=1-\min_{w^{n}\in\mathcal{T}_{\epsilon'}^{n}}Q_{X|W}^{n}\bigl(\mathcal{T}_{\epsilon}^{n}(Q_{WX}|w^{n})|w^{n}\bigr),\\
\delta_{2,n} & :=1-\min_{w^{n}\in\mathcal{T}_{\epsilon'}^{n}}Q_{Y|W}^{n}\bigl(\mathcal{T}_{\epsilon}^{n}(Q_{WY}|w^{n})|w^{n}\bigr).
\end{align}
By \cite[Lemma 4]{yu2018wyner}, $\delta_{0,n},\delta_{1,n},\delta_{2,n}\to0$
as $n\to\infty$. Let
\begin{equation}
\delta_{012,n}:=\frac{1}{ns}\log\left[(1-\delta_{0,n})(1-\delta_{1,n})^{1+s}(1-\delta_{2,n})^{1+s}\right].
\end{equation}
Hence $\delta_{012,n}\to0$ as $n\to\infty$.
Consider that \eqref{eq:-24-1}-\eqref{eq:-38} (given on the page
\pageref{eq:-24-1}), where \eqref{eq:-32} follows from the definition
of typical sets and the definitions of ${\cal A},\delta_{0,n},\delta_{1,n},\delta_{2,n}$,
\eqref{eq:-8} follows since $\left|\mathcal{T}_{T_{WXY}}\right|\le{\rm e}^{nH(T_{WXY})}$
(see \cite[Lemma 2.3]{Csiszar}), in \eqref{eq:-9-1}, $\delta_{n}:=\frac{1}{n}\log|{\cal A}|\to0$
as $n\rightarrow\infty$ since the number of types is polynomial in
$n$ (see \cite[Lemma 2.2]{Csiszar}), and \eqref{eq:-38} follows
since $D(T_{W}\|Q_{W})\ge0$ and $\left\{ P_{XY|W}:\ \exists P_{W}\;\textrm{s.t.}\;P_{XY|W}P_{W}\in{\cal A}\right\} \subseteq\mathcal{A}_{\epsilon}'.$
\begin{figure*}[t]
\begin{align}
& \frac{1}{n}D_{1+s}\left(P_{W^{n}X^{n}Y^{n}}\|P_{W^{n}}\pi_{X^{n}Y^{n}}\right)\nonumber \\
& =\frac{1}{ns}\log\sum_{w^{n},x^{n},y^{n}}P\left(w^{n}\right)\left(P\left(x^{n}|w^{n}\right)P\left(y^{n}|w^{n}\right)\right)^{1+s}\pi^{-s}(x^{n},y^{n})\label{eq:-24-1}\\
& =\frac{1}{ns}\log\sum_{T_{WXY}}\sum_{\substack{(w^{n},x^{n},y^{n})\in\mathcal{T}_{T_{WXY}}}
}\frac{Q_{W}^{n}\left(w^{n}\right)1\left\{ w^{n}\in\mathcal{T}_{\epsilon'}^{n}\left(Q_{W}\right)\right\} }{Q_{W}^{n}\left(\mathcal{T}_{\epsilon'}^{n}\left(Q_{W}\right)\right)}\nonumber \\*
& \qquad\times\left(\frac{Q_{X|W}^{n}\left(x^{n}|w^{n}\right)1\left\{ x^{n}\in\mathcal{T}_{\epsilon}^{n}\left(Q_{WX}|w^{n}\right)\right\} }{Q_{X|W}^{n}\left(\mathcal{T}_{\epsilon}^{n}\left(Q_{WX}|w^{n}\right)|w^{n}\right)}\frac{Q_{Y|W}^{n}\left(y^{n}|w^{n}\right)1\left\{ y^{n}\in\mathcal{T}_{\epsilon}^{n}\left(Q_{WY}|w^{n}\right)\right\} }{Q_{Y|W}^{n}\left(\mathcal{T}_{\epsilon}^{n}\left(Q_{WY}|w^{n}\right)|w^{n}\right)}\right)^{1+s}\pi_{X^{n}Y^{n}}^{-s}(x^{n},y^{n})\\
& \leq\frac{1}{ns}\log\sum_{T_{WXY}\in{\cal A}}\sum_{\substack{(w^{n},x^{n},y^{n})\in\mathcal{T}_{T_{WXY}}}
}\frac{{\rm e}^{n\sum_{w,x}T\left(w\right)\log Q\left(w\right)}}{1-\delta_{0,n}}\nonumber \\
& \qquad\times\left(\frac{{\rm e}^{n\sum_{w,x}T\left(w,x\right)\log Q\left(x|w\right)}}{1-\delta_{1,n}}\frac{{\rm e}^{n\sum_{w,y}T\left(w,y\right)\log Q\left(y|w\right)}}{1-\delta_{2,n}}\right)^{1+s}{\rm e}^{-ns\sum_{x,y}T\left(x,y\right)\log\pi\left(x,y\right)}\label{eq:-32}\\
& \leq-\delta_{012,n}+\frac{1}{ns}\log\sum_{T_{WXY}\in{\cal A}}{\rm e}^{nH(T_{WXY})+n\sum_{w,x}T\left(w\right)\log Q\left(w\right)}\nonumber \\
& \qquad\times{\rm e}^{\left(1+s\right)n\sum_{w,x}T\left(w,x\right)\log Q\left(x|w\right)+\left(1+s\right)n\sum_{w,y}T\left(w,y\right)\log Q\left(y|w\right)-ns\sum_{x,y}T\left(x,y\right)\log\pi\left(x,y\right)}\label{eq:-8}\\
& \leq\max_{T_{WXY}\in{\cal A}}\frac{1}{s}\left(H_{T}(XY|W)-D(T_{W}\|Q_{W})\right)+\frac{1+s}{s}\left(\sum_{w,x}T\left(w,x\right)\log Q\left(x|w\right)+\sum_{w,y}T\left(w,y\right)\log Q\left(y|w\right)\right)\nonumber \\
& \qquad-\sum_{x,y}T\left(x,y\right)\log\pi\left(x,y\right)-\delta_{012,n}+\frac{1}{s}\delta_{n}\label{eq:-9-1}\\
& \leq\sup_{P_{XY|W}\in\mathcal{A}_{\epsilon}'}\left((1+\epsilon')\frac{1}{s}H(P_{XY|W}|Q_{W})-(1-\epsilon)\frac{1+s}{s}H_{Q}(XY|W)-\sum_{x,y}P\left(x,y\right)\log\pi\left(x,y\right)\right)\nonumber \\
& \qquad-\delta_{012,n}+\frac{1}{s}\delta_{n},\label{eq:-38}
\end{align}
\hrulefill{}
\end{figure*}
Letting $n\rightarrow\infty$ in \eqref{eq:-38}, we have
\begin{align}
& \limsup_{n\to\infty}\frac{1}{n}D_{1+s}\left(P_{W^{n}X^{n}Y^{n}}\|P_{W^{n}}\pi_{X^{n}Y^{n}}\right)\nonumber \\
& \leq\sup_{P_{XY|W}\in\mathcal{A}_{\epsilon}'}\Bigl\{(1+\epsilon')\frac{1}{s}H(P_{XY|W}|Q_{W})\nonumber \\
& \qquad-(1-\epsilon)\frac{1+s}{s}H_{Q}(XY|W)-\sum_{x,y}P\left(x,y\right)\log\pi\left(x,y\right)\Bigr\}.\label{eq:-15-1}
\end{align}
Since 1) $\epsilon>\epsilon'>0$ are arbitrary, 2) $H(P_{XY|W}|Q_{W})\leq\log\left\{ |\mathcal{X}||\mathcal{Y}|\right\} $,
and 3) $H_{Q}(X|W),H_{Q}(Y|W),\log\pi\left(x,y\right)$ are bounded
for $x,y\in\supp\left(\pi_{XY}\right)$, we have
\begin{align}
& \inf\left\{ R:D_{1+s}(P_{X^{n}Y^{n}|U_{n}}\|\pi_{X^{n}Y^{n}}|P_{U_{n}})\rightarrow0\right\} \nonumber \\
& \leq\lim_{\epsilon\to0}\sup_{P_{XY|W}\in\mathcal{A}_{\epsilon}'}\Bigl\{\frac{1}{s}H(P_{XY|W}|Q_{W})\nonumber \\
& \qquad-(1-\epsilon)\frac{1+s}{s}H_{Q}(XY|W)-\sum_{x,y}P\left(x,y\right)\log\pi\left(x,y\right)\Bigr\}.\label{eq:-33}
\end{align}
Let $\left\{ \epsilon_{k}\right\} _{k=1}^{\infty}$ be a sequence
of decreasing positive numbers with $\lim_{k\to\infty}\epsilon_{k}=0$.
Assume $\left\{ P_{XY|W}^{\left(k\right)}\right\} _{k=1}^{\infty}$
is a sequence of optimal distributions $P_{XY|W}^{\left(k\right)}\in\mathcal{A}_{\epsilon_{k}}'$
that attains the sup in \eqref{eq:-33} with $\epsilon$ there replaced
by $\epsilon_{k}$ (the sup is attained because we are optimizing
a continuous function over a compact set). Since $\mathcal{P}(\mathcal{X}\times\mathcal{Y}|\mathcal{W})$
is compact, there must exist some subsequence $P_{XY|W}^{\left(k_{i}\right)}$
that converges to some distribution $\widetilde{P}_{XY|W}$ as $i\to\infty$.
Since $\lim_{i\to\infty}\epsilon_{k_{i}}=0$, we must have
\begin{align}
\widetilde{P}_{X|W} & =Q_{X|W}\textrm{ and }\widetilde{P}_{Y|W}=Q_{Y|W}.
\end{align}
Since $H(P_{XY|W}|Q_{W})$ and $\sum_{x,y}P\left(x,y\right)\log\pi\left(x,y\right)$
are continuous in $P_{XY|W}$, we have
\begin{align}
& \lim_{i\to\infty}\frac{1}{s}H(P_{XY|W}^{\left(k_{i}\right)}|Q_{W})-\sum_{x,y}P^{\left(k_{i}\right)}\left(x,y\right)\log\pi\left(x,y\right)\nonumber \\
& =\frac{1}{s}H(\widetilde{P}_{XY|W}|Q_{W})-\sum_{x,y}\widetilde{P}\left(x,y\right)\log\pi\left(x,y\right).
\end{align}
Since the limit in \eqref{eq:-33} exists (by the monotonicity and
boundedness of the function in $\epsilon$), this limit must equal
the limit in \eqref{eq:-33} with $\epsilon$ replaced by the sequence
$\left\{ \epsilon_{k_{i}}\right\} _{i=1}^{\infty}$. Hence we obtain
that
\begin{align}
& \lim_{\epsilon\to0}\sup_{P_{XY|W}\in\mathcal{A}_{\epsilon}'}\Bigl\{\frac{1}{s}H(P_{XY|W}|Q_{W})\nonumber \\
& \quad-\frac{1+s}{s}H_{Q}(XY|W)-\sum_{x,y}P\left(x,y\right)\log\pi\left(x,y\right)\Bigr\}\nonumber \\
& =\frac{1}{s}H(\widetilde{P}_{XY|W}|Q_{W})\nonumber \\
& \qquad-\sum_{x,y}\widetilde{P}\left(x,y\right)\log\pi\left(x,y\right)-\frac{1+s}{s}H_{Q}(XY|W).\label{eq:-34}
\end{align}
Therefore,
\begin{align}
& \inf\left\{ R:D_{1+s}(P_{X^{n}Y^{n}|U_{n}}\|\pi_{X^{n}Y^{n}}|P_{U_{n}})\rightarrow0\right\} \nonumber \\
& \leq\max_{\substack{P_{XY|W}:P_{X|W}=Q_{X|W},\\
P_{Y|W}=Q_{Y|W}
}
}\Bigl\{\frac{1}{s}H(P_{XY|W}|Q_{W})\nonumber \\
& \qquad-\sum_{x,y}P\left(x,y\right)\log\pi\left(x,y\right)\Bigr\}-\frac{1+s}{s}H_{Q}(XY|W).\label{eq:-39}
\end{align}
Furthermore, since the distribution $Q_{WXY}$ is arbitrary, we can
minimize the bound above over all distributions satisfying $Q_{XY}=\pi_{XY}$
and $X-W-Y$. Hence
\begin{align}
& \inf\left\{ R:D_{1+s}(P_{X^{n}Y^{n}|U_{n}}\|\pi_{X^{n}Y^{n}}|P_{U_{n}})\rightarrow0\right\} \nonumber \\
& \leq\Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY}).
\end{align}
By the argument given at the end of the proof in \cite[Appendix A-A]{yu2018wyner},
the bound above is also an upper bound on the minimum rate for deterministic
codes.
\end{IEEEproof}
\section{\label{sec:Lower-Bound-for}Lower Bound for Case $s\in(0,\infty]$}
The proof in this section is similar to those of Theorems 1 and 2
in \cite{yu2018on}. By definition, we know that $\widetilde{T}_{1+s}(\pi_{XY})\leq T_{1+s}(\pi_{XY})$
and both of them are non-decreasing in $s$. On the other hand, $\widetilde{T}_{1}(\pi_{XY})=T_{1}(\pi_{XY})=C_{\mathsf{Wyner}}(X;Y)$.
Hence we have
\begin{equation}
C_{\mathsf{Wyner}}(X;Y)\leq\widetilde{T}_{1+s}(\pi_{XY})\leq T_{1+s}(\pi_{XY}),\;s\in(0,\infty].
\end{equation}
We next prove
\begin{equation}
\widetilde{T}_{1+s}(\pi_{XY})\geq\Gamma_{1+s}^{\mathrm{LB}}(\pi_{XY}).
\end{equation}
The proof for this inequality is divided into three parts: Multi-letter
Expression for the Lower Bound, Single-letterization, Simplifying
Constraints.
\subsection{Multi-letter Expression for the Lower Bound}
To derive a multi-letter lower bound for $\widetilde{T}_{1+s}(\pi_{XY})$,
we need the following one-shot converse bound, which was proven in
\cite{yu2019renyi}.
\begin{lem}[One-Shot Bound for Converse Part]
\cite{yu2019renyi} \label{lem:oneshotcon} Assume $M\sim\mathrm{Unif}\{1,\ldots,{\rm e}^{R}\}$.
For any random mapping $P_{X|M}$, we define
\begin{equation}
P_{MX}(m,x):={\rm e}^{-R}P_{X|M}(x|m).\label{eq:-113-1-1}
\end{equation}
Then for $s\in[0,\infty]$ and any distribution $\pi_{X}$, we have
\begin{align}
& D_{1+s}(P_{X}\|\pi_{X})\nonumber \\
& \geq\max\left\{ D_{1+s}\left(P_{MX}\|P_{M}\pi_{X}\right)-R,D_{1+s}(P_{X}\|\pi_{X})\right\} .\label{eq:-146}
\end{align}
\end{lem}
By setting the tuple $\left(\pi_{X},P_{X|M},P_{M},R\right)$ to be
$\left(\pi_{XY}^{n},P_{X^{n}|M}P_{Y^{n}|M},P_{M},nR\right)$, Lemma
\ref{lem:oneshotcon} implies that
\begin{align}
\widetilde{T}_{1+s}(\pi_{XY}) & \geq\inf_{\substack{\left\{ P_{M}P_{X^{n}|M}P_{Y^{n}|M}\right\} :\\
\frac{1}{n}D_{1+s}\left(P_{X^{n}Y^{n}}\|\pi_{XY}^{n}\right)\to0
}
}\nonumber \\
& \qquad\limsup_{n\to\infty}\frac{1}{n}D_{1+s}\left(P_{MX^{n}Y^{n}}\|P_{M}\pi_{XY}^{n}\right).\label{eq:-146-1}
\end{align}
To lower bound the RHS of the inequality above, we need the following
lemma.
\begin{lem}
\label{lem:Assume-.-Then}Assume $P,Q\in\mathcal{P}(\mathcal{X})$.
Then for $s\in(0,\infty]$, we have
\begin{align}
D_{1+s}(P\|Q) & =\sup_{R\in\mathcal{P}(\mathcal{X})}\frac{1}{s}\Bigl\{\sum_{x}R(x)\log P^{1+s}(x)Q^{-s}(x)\nonumber \\
& \qquad-\sum_{x}R(x)\log R(x)\Bigr\}.\label{eq:-29}
\end{align}
\end{lem}
\begin{IEEEproof}
Observe that the objective function in the RHS of \eqref{eq:-29}
is concave in $R$. Define the Lagrangian function
\begin{align}
\mathcal{L}(R,\lambda) & =\frac{1}{s}\Bigl\{\sum_{x}R(x)\log P^{1+s}(x)Q^{-s}(x)\nonumber \\
& \qquad-\sum_{x}R(x)\log R(x)\Bigr\}+\lambda\left(\sum_{x}R(x)-1\right).
\end{align}
Hence letting the derivative of $\mathcal{L}(R,\lambda)$ respect
to $R(x)$ equal zero, we obtain that
\begin{align}
\frac{\partial\mathcal{L}(R,\lambda)}{\partial R(x)} & =\frac{1}{s}\left\{ \log P^{1+s}(x)Q^{-s}(x)-\left(1+\log R(x)\right)\right\} +\lambda\\
& =0.
\end{align}
That is,
\begin{equation}
R(x)=\frac{P^{1+s}(x)Q^{-s}(x)}{\sum_{x}P^{1+s}(x)Q^{-s}(x)}.
\end{equation}
Hence
\begin{align}
& \textrm{RHS of }\eqref{eq:-29}\nonumber \\
& =\frac{1}{s}\left\{ \sum_{x}R(x)\log P^{1+s}(x)Q^{-s}(x)-\sum_{x}R(x)\log R(x)\right\} \\
& =D_{1+s}(P\|Q).
\end{align}
\end{IEEEproof}
By Lemma \ref{lem:Assume-.-Then} with $P\leftarrow P_{MX^{n}Y^{n}},Q\leftarrow P_{M}\pi_{XY}^{n},R\leftarrow P_{M}Q_{X^{n}Y^{n}|M}$
for $Q_{X^{n}Y^{n}|M}\in C(P_{X^{n}|M},P_{Y^{n}|M})$, we immediately
obtain \eqref{eq:-51}-\eqref{eq:-30} (given on the page \pageref{eq:-51}),
where in \eqref{eq:-30}, the $P(m)$'s in the logarithm have been
cancelled out.
\begin{figure*}[t]
\begin{align}
& D_{1+s}\left(P_{MX^{n}Y^{n}}\|P_{M}\pi_{XY}^{n}\right)\nonumber \\
& \geq\max_{Q_{X^{n}Y^{n}|M}\in C(P_{X^{n}|M},P_{Y^{n}|M})}\frac{1}{s}\biggl\{\sum_{m,x^{n},y^{n}}P(m)Q(x^{n},y^{n}|m)\log\left[P^{1+s}(m,x^{n},y^{n})P^{-s}(m)\pi_{XY}^{n}(x^{n},y^{n})^{-s}\right]\nonumber \\
& \qquad-\sum_{m,x^{n},y^{n}}P(m)Q(x^{n},y^{n}|m)\log\left[P(m)Q(x^{n},y^{n}|m)\right]\biggr\}\label{eq:-51}\\
& =\max_{Q_{X^{n}Y^{n}|M}\in C(P_{X^{n}|M},P_{Y^{n}|M})}\left\{ \frac{1}{s}\sum_{m,x^{n},y^{n}}P(m)Q(x^{n},y^{n}|m)\log\frac{1}{\pi_{XY}^{n}(x^{n},y^{n})^{s}Q(x^{n},y^{n}|m)}\right\} -\frac{1+s}{s}H(X^{n}Y^{n}|M).\label{eq:-30}
\end{align}
\hrulefill{}
\end{figure*}
Therefore, we obtain the multi-letter lower bound given in \eqref{eq:-18}
(given on the page \pageref{eq:-18}).
\begin{figure*}[t]
\begin{align}
\widetilde{T}_{1+s}(\pi_{XY}) & \geq\frac{1}{n}\inf_{\substack{\left\{ P_{M}P_{X^{n}|M}P_{Y^{n}|M}\right\} :\\
\frac{1}{n}D_{1+s}\left(P_{X^{n}Y^{n}}\|\pi_{XY}^{n}\right)\to0
}
}\limsup_{n\to\infty}-\frac{1+s}{s}H(X^{n}Y^{n}|M)\nonumber \\
& \qquad+\frac{1}{s}\max_{Q_{X^{n}Y^{n}|M}\in C(P_{X^{n}|M},P_{Y^{n}|M})}\left\{ \sum_{m,x^{n},y^{n}}P(m)Q(x^{n},y^{n}|m)\log\frac{1}{\pi_{XY}^{n}(x^{n},y^{n})^{s}Q(x^{n},y^{n}|m)}\right\} .\label{eq:-18}
\end{align}
\hrulefill{}
\end{figure*}
\subsection{Single-letterization}
Next we derive a single-letter lower bound for the RHS of \eqref{eq:-18}.
Denote $J\sim P_{J}:=\mathrm{Unif}[1:n]$ as a time index independent
of $(M,X^{n},Y^{n})$. Then
\begin{align}
& -\frac{1}{n}\sum_{i=1}^{n}H(X_{i}|X^{i-1}M)-\frac{1}{n}\sum_{i=1}^{n}H(Y_{i}|Y^{i-1}M)\nonumber \\
& =-H(X_{J}|X^{J-1}MJ)-H(Y_{J}|Y^{J-1}MJ).\label{eq:-21}
\end{align}
Next we single-letterize the last term in \eqref{eq:-18}. Observe
that
\begin{align}
& \sum_{x^{n},y^{n}}Q(x^{n},y^{n}|m)\log\frac{1}{\pi_{XY}^{n}(x^{n},y^{n})^{s}Q(x^{n},y^{n}|m)}\nonumber \\
& =\sum_{i=1}^{n}\sum_{x_{i},y_{i}}\sum_{x^{i-1},y^{i-1}}Q(x^{i-1},y^{i-1}|m)Q(x_{i},y_{i}|x^{i-1},y^{i-1},m)\nonumber \\
& \qquad\times\log\frac{1}{\pi\left(x_{i},y_{i}\right)^{s}Q(x_{i},y_{i}|x^{i-1},y^{i-1},m)}\\
& \geq\sum_{i=1}^{n}\min_{\substack{\widetilde{Q}_{X^{i-1}Y^{i-1}|M}\in\\
C(P_{X^{i-1}|M},P_{Y^{i-1}|M})
}
}\sum_{x_{i},y_{i}}\sum_{x^{i-1},y^{i-1}}\widetilde{Q}(x^{i-1},y^{i-1}|m)\nonumber \\
& \qquad\times Q(x_{i},y_{i}|x^{i-1},y^{i-1},m)\nonumber \\
& \qquad\times\log\frac{1}{\pi\left(x_{i},y_{i}\right)^{s}Q(x_{i},y_{i}|x^{i-1},y^{i-1},m)}.\label{eq:-19}
\end{align}
Now we employ the following ``chain rule'' on coupling sets. Since
the following lemma is easy to verify, we omit its proof.
\begin{lem}[Chain Rule on Coupling Sets]
\label{lem:coupling} For a pair of conditional distributions $(P_{X^{n}|W},P_{Y^{n}|W})$,
we have
\begin{equation}
\prod_{i=1}^{n}C(P_{X_{i}|X^{i-1}W},P_{Y_{i}|Y^{i-1}W})\subseteq C(P_{X^{n}|W},P_{Y^{n}|W}),
\end{equation}
where for $i\in[1:n]$,
\begin{align}
& C(P_{X_{i}|X^{i-1}W},P_{Y_{i}|Y^{i-1}W})\nonumber \\
& :=\Bigl\{ Q_{X_{i}Y_{i}|X^{i-1}Y^{i-1}W}:\,Q_{X_{i}|X^{i-1}Y^{i-1}W}=P_{X_{i}|X^{i-1}W},\nonumber \\
& \qquad\:Q_{Y_{i}|X^{i-1}Y^{i-1}W}=P_{Y_{i}|Y^{i-1}W}\Bigr\}
\end{align}
and
\begin{align}
& \prod_{i=1}^{n}C(P_{X_{i}|X^{i-1}W},P_{Y_{i}|Y^{i-1}W})\nonumber \\
& :=\Bigl\{\prod_{i=1}^{n}Q_{X_{i}Y_{i}|X^{i-1}Y^{i-1}W}:\,Q_{X_{i}Y_{i}|X^{i-1}Y^{i-1}W}\nonumber \\
& \qquad\in C(P_{X_{i}|X^{i-1}W},P_{Y_{i}|Y^{i-1}W}),\forall i\in[1:n]\Bigr\}.
\end{align}
\end{lem}
By Lemma \ref{lem:coupling}, we have that for any function $f:\mathcal{P}\left(\mathcal{X}^{n}\times\mathcal{Y}^{n}\right)\to\mathbb{R}$,
\begin{align}
& \max_{Q_{X^{n}Y^{n}|W}\in C(P_{X^{n}|W},P_{Y^{n}|W})}f\left(Q_{X^{n}Y^{n}|W}\right)\nonumber \\
& \geq\max_{\substack{Q_{X^{n}Y^{n}|W}\in\\
\prod_{i=1}^{n}C(P_{X_{i}|X^{i-1}W},P_{Y_{i}|Y^{i-1}W})
}
}f\left(\prod_{i=1}^{n}Q_{X_{i}Y_{i}|X^{i-1}Y^{i-1}W}\right).\label{eq:-57}
\end{align}
Therefore, substituting \eqref{eq:-19} into the last term in \eqref{eq:-18}
and utilizing \eqref{eq:-57}, we obtain \eqref{eq:-52}-\eqref{eq:-36}
(given on the page \pageref{eq:-52}). Here \eqref{eq:-22} follows
from \eqref{eq:-57}. The swapping of min and max in \eqref{eq:-14}
follows since on one hand, minimax is no smaller than maximin, and
on the other hand,
\begin{align}
\eqref{eq:-22} & \geq\sum_{m}P(m)\sum_{i=1}^{n}\min_{\substack{\widetilde{Q}_{X^{i-1}Y^{i-1}|M}\in\\
C(P_{X^{i-1}|M},P_{Y^{i-1}|M})
}
}\nonumber \\
& \qquad\sum_{x^{i-1},y^{i-1}}\widetilde{Q}(x^{i-1},y^{i-1}|m)\nonumber \\
& \qquad\times\sum_{x_{i},y_{i}}Q^{*}(x_{i},y_{i}|x^{i-1},y^{i-1},m)\nonumber \\
& \qquad\times\log\frac{1}{\pi\left(x_{i},y_{i}\right)^{s}Q^{*}(x_{i},y_{i}|x^{i-1},y^{i-1},m)}\label{eq:-15-2}\\
& =\eqref{eq:-14}
\end{align}
with
\begin{align}
& Q_{X_{i}Y_{i}|X^{i-1}Y^{i-1}M}^{*}\nonumber \\
& :=\arg\max_{\substack{Q_{X_{i}Y_{i}|X^{i-1}Y^{i-1}M}\in\\
C(P_{X_{i}|X^{i-1}M},P_{Y_{i}|Y^{i-1}M})
}
}\sum_{x_{i},y_{i}}Q(x_{i},y_{i}|x^{i-1},y^{i-1},m)\nonumber \\
& \qquad\times\log\frac{1}{\pi\left(x_{i},y_{i}\right)^{s}Q(x_{i},y_{i}|x^{i-1},y^{i-1},m)}.
\end{align}
\begin{figure*}[t]
\begin{align}
& \max_{\substack{Q_{X^{n}Y^{n}|M}\in\\
C(P_{X^{n}|M},P_{Y^{n}|M})
}
}\left\{ \sum_{m,x^{n},y^{n}}P(m)Q(x^{n},y^{n}|m)\log\frac{1}{\pi_{XY}^{n}(x^{n},y^{n})^{s}Q(x^{n},y^{n}|m)}\right\} \nonumber \\
& \geq\sum_{m}P(m)\max_{\substack{Q_{X^{n}Y^{n}|M}\in\\
C(P_{X^{n}|M},P_{Y^{n}|M})
}
}\sum_{i=1}^{n}\min_{\substack{\widetilde{Q}_{X^{i-1}Y^{i-1}|M}\in\\
C(P_{X^{i-1}|M},P_{Y^{i-1}|M})
}
}\sum_{x_{i},y_{i}}\sum_{x^{i-1},y^{i-1}}\widetilde{Q}(x^{i-1},y^{i-1}|m)Q(x_{i},y_{i}|x^{i-1},y^{i-1},m)\nonumber \\
& \qquad\times\log\frac{1}{\pi\left(x_{i},y_{i}\right)^{s}Q(x_{i},y_{i}|x^{i-1},y^{i-1},m)}\label{eq:-52}\\
& \geq\sum_{m}P(m)\sum_{i=1}^{n}\max_{\substack{Q_{X_{i}Y_{i}|X^{i-1}Y^{i-1}M}\in\\
C(P_{X_{i}|X^{i-1}M},P_{Y_{i}|Y^{i-1}M})
}
}\min_{\substack{\widetilde{Q}_{X^{i-1}Y^{i-1}|M}\in\\
C(P_{X^{i-1}|M},P_{Y^{i-1}|M})
}
}\sum_{x_{i},y_{i}}\sum_{x^{i-1},y^{i-1}}\widetilde{Q}(x^{i-1},y^{i-1}|m)Q(x_{i},y_{i}|x^{i-1},y^{i-1},m)\nonumber \\
& \qquad\times\log\frac{1}{\pi\left(x_{i},y_{i}\right)^{s}Q(x_{i},y_{i}|x^{i-1},y^{i-1},m)}\label{eq:-22}\\
& =\sum_{m}P(m)\sum_{i=1}^{n}\min_{\substack{\widetilde{Q}_{X^{i-1}Y^{i-1}|M}\in\\
C(P_{X^{i-1}|M},P_{Y^{i-1}|M})
}
}\sum_{x^{i-1},y^{i-1}}\widetilde{Q}(x^{i-1},y^{i-1}|m)\max_{\substack{Q_{X_{i}Y_{i}|X^{i-1}Y^{i-1}M}\in\\
C(P_{X_{i}|X^{i-1}M},P_{Y_{i}|Y^{i-1}M})
}
}\sum_{x_{i},y_{i}}Q(x_{i},y_{i}|x^{i-1},y^{i-1},m)\nonumber \\
& \qquad\times\log\frac{1}{\pi\left(x_{i},y_{i}\right)^{s}Q(x_{i},y_{i}|x^{i-1},y^{i-1},m)}\label{eq:-14}\\
& =n\sum_{m}P(m)\sum_{i=1}^{n}P_{J}(i)\min_{\substack{\widetilde{Q}_{X^{J-1}Y^{J-1}|MJ}\in\\
C(P_{X^{J-1}|MJ},P_{Y^{J-1}|MJ})
}
}\sum_{x^{i-1},y^{i-1}}\widetilde{Q}_{X^{J-1}Y^{J-1}|MJ}(x^{i-1},y^{i-1}|m,i)\max_{\substack{Q_{X_{J}Y_{J}|X^{J-1}Y^{J-1}MJ}\in\\
C(P_{X_{J}|X^{J-1}MJ},P_{Y_{J}|Y^{J-1}MJ})
}
}\nonumber \\
& \qquad\sum_{x,y}Q_{X_{J}Y_{J}|X^{J-1}Y^{J-1}MJ}(x,y|x^{i-1},y^{i-1},m,i)\log\frac{1}{\pi\left(x,y\right)^{s}Q_{X_{J}Y_{J}|X^{J-1}Y^{J-1}MJ}(x,y|x^{i-1},y^{i-1},m,i)}.\label{eq:-36}
\end{align}
\hrulefill{}
\end{figure*}
Denote
\begin{equation}
W:=MJ,U:=X^{J-1},V:=Y^{J-1},X:=X_{J},Y:=Y_{J}.\label{eq:-37}
\end{equation}
It is easy to verify that for $s>0$, $\frac{1}{n}D_{1+s}\left(P_{X^{n}Y^{n}}\|\pi_{XY}^{n}\right)\le\epsilon$
implies $D\left(P_{XY}\|\pi_{XY}\right)\le\epsilon$. Since $\pi_{XY}$
has a finite support, $D\left(P_{XY}\|\pi_{XY}\right)\to0$ if and
only if $D_{\infty}\left(P_{XY}\|\pi_{XY}\right)\to0$. Therefore,
substituting \eqref{eq:-21} and \eqref{eq:-36} into \eqref{eq:-18}
and utilizing the identification of the random variables in \eqref{eq:-37},
we obtain \eqref{eq:-40} (given on the page \pageref{eq:-40}).
\begin{figure*}[t]
\begin{align}
\widetilde{T}_{1+s}(\pi_{XY}) & \geq\lim_{\epsilon\downarrow0}\inf_{\substack{P_{W}P_{U|W}P_{V|W}P_{X|UW}P_{Y|VW}:\\
D_{\infty}\left(P_{XY}\|\pi_{XY}\right)\le\epsilon
}
}-\frac{1+s}{s}\left(H(X|UW)+H(Y|VW)\right)\nonumber \\
& \quad+\frac{1}{s}\sum_{w}P(w)\inf_{\substack{\widetilde{Q}_{UV|W}\in\\
C(P_{U|W},P_{V|W})
}
}\sum_{u,v}\widetilde{Q}(u,v|w)\max_{\substack{Q_{XY|UVW}\in\\
C(P_{X|UW},P_{Y|VW})
}
}\sum_{x,y}Q(x,y|u,v,w)\log\frac{1}{\pi\left(x,y\right)^{s}Q(x,y|u,v,w)}.\label{eq:-40}
\end{align}
\hrulefill{}
\end{figure*}
For $\widetilde{Q}_{UV|W}\in C(P_{U|W},P_{V|W})$, define the following
induced joint distribution as
\begin{align}
& \widehat{Q}_{\left(U,V',W\right),\left(U',V,W'\right)}(u,v',w,u',v,w')\nonumber \\
& :=P_{W}(w)\widetilde{Q}_{UV|W}(u,v|w)1\left\{ w'=w\right\} \nonumber \\
& \qquad\times P_{V|W}(v'|w)P_{U|W}(u'|w').
\end{align}
Then this joint distribution satisfies the following marginal constraints:
\begin{align}
\widehat{Q}_{UVW}(u,v,w) & =P_{W}(w)\widetilde{Q}_{UV|W}(u,v|w)\label{eq:-47}\\
\widehat{Q}_{UV'W}(u,v',w) & =P_{UVW}(u,v',w)\\
\widehat{Q}_{U'VW'}(u',v,w') & =P_{UVW}(u',v,w').\label{eq:-48}
\end{align}
Utilizing this induced distribution, its properties in \eqref{eq:-47}-\eqref{eq:-48},
and the lower bound in \eqref{eq:-40}, we obtain \eqref{eq:-53}-\eqref{eq:-49}
(given on the page \pageref{eq:-53}).
\begin{figure*}[t]
\begin{align}
\widetilde{T}_{1+s}(\pi_{XY}) & \geq\lim_{\epsilon\downarrow0}\inf_{\substack{P_{W}P_{U|W}P_{V|W}P_{X|UW}P_{Y|VW}:\\
D_{\infty}\left(P_{XY}\|\pi_{XY}\right)\le\epsilon
}
}-\frac{1+s}{s}\left(H(X|UW)+H(Y|VW)\right)\nonumber \\
& \quad+\frac{1}{s}\inf_{\substack{\widetilde{Q}_{UV|W}\in\\
C(P_{U|W},P_{V|W})
}
}\sum_{u,u',v,v',w,w'}\widehat{Q}(u,v',w,u',v,w')\max_{\substack{Q_{XY}\in\\
C(P_{X|UW=u,w},P_{Y|VW=v,w'})
}
}\sum_{x,y}Q(x,y)\log\frac{1}{\pi\left(x,y\right)^{s}Q(x,y)}\label{eq:-53}\\
& \geq\lim_{\epsilon\downarrow0}\inf_{\substack{P_{W}P_{U|W}P_{V|W}P_{X|UW}P_{Y|VW}:\\
D_{\infty}\left(P_{XY}\|\pi_{XY}\right)\le\epsilon
}
}-\frac{1+s}{s}\left(H(X|UW)+H(Y|VW)\right)\nonumber \\
& \quad+\frac{1}{s}\inf_{\substack{\widehat{Q}_{\left(U,V',W\right),\left(U',V,W'\right)}\in\\
C(P_{UVW},P_{UVW})
}
}\sum_{u,u',v,v',w,w'}\widehat{Q}(u,v',w,u',v,w')\nonumber \\
& \quad\times\max_{\substack{Q_{XY}\in\\
C(P_{X|\left(U,V,W\right)=\left(u,v',w\right)},P_{Y|\left(U,V,W\right)=\left(u',v,w'\right)})
}
}\sum_{x,y}Q(x,y)\log\frac{1}{\pi\left(x,y\right)^{s}Q(x,y)}.\label{eq:-49}
\end{align}
\hrulefill{}
\end{figure*}
Substituting $W\leftarrow\left(U,V,W\right)$, we can simplify \eqref{eq:-49}
as \eqref{eq:-23} (given on the page \pageref{eq:-23}).
\begin{figure*}[t]
\begin{align}
\widetilde{T}_{1+s}(\pi_{XY}) & \geq\lim_{\epsilon\downarrow0}\inf_{P_{W}P_{X|W}P_{Y|W}:D_{\infty}\left(P_{XY}\|\pi_{XY}\right)\le\epsilon}-\frac{1+s}{s}\left(H(X|W)+H(Y|W)\right)\nonumber \\
& \qquad+\frac{1}{s}\inf_{Q_{WW'}\in C(P_{W},P_{W})}\sum_{w,w'}Q_{WW'}(w,w')\max_{Q_{XY}\in C(P_{X|W=w},P_{Y|W=w'})}\sum_{x,y}Q(x,y)\log\frac{1}{\pi\left(x,y\right)^{s}Q(x,y)}.\label{eq:-23}
\end{align}
\hrulefill{}
\end{figure*}
\subsection{Simplifying Constraints}
Next we prove that the constraint $D_{\infty}\left(P_{XY}\|\pi_{XY}\right)\le\epsilon$
in \eqref{eq:-23} can be replaced by $P_{XY}=\pi_{XY}$. For two
distributions $\left(P_{XY},\pi_{XY}\right)$ such that $D_{\infty}\left(P_{XY}\|\pi_{XY}\right)\le\epsilon$,
we can write
\begin{equation}
\pi_{XY}\left(x,y\right)=e^{-\epsilon}P_{XY}\left(x,y\right)+\left(1-e^{-\epsilon}\right)\widehat{P}_{XY}\left(x,y\right),\label{eq:-100-2}
\end{equation}
where
\begin{equation}
\widehat{P}_{XY}\left(x,y\right):=\frac{e^{\epsilon}\pi_{XY}\left(x,y\right)-P_{XY}\left(x,y\right)}{e^{\epsilon}-1}.
\end{equation}
Note that $\supp\left(\widehat{P}_{XY}\right)\subseteq\supp\left(\pi_{XY}\right).$
Define
\begin{align}
& \widetilde{P}_{XYWU}(x,y,w,u)\nonumber \\
& =\begin{cases}
e^{-\epsilon}P_{W}(w)P_{X|W}(x|w)P_{Y|W}(y|w) & \textrm{if }u=1\\
\left(1-e^{-\epsilon}\right)\widehat{P}_{WXY}\left(w,x,y\right) & \textrm{if }u=0
\end{cases},\label{eq:-43}
\end{align}
where $\widehat{P}_{WXY}\left(w,x,y\right):=\widehat{P}_{XY}\left(x,y\right)1\left\{ w=(x,y)\right\} $.
Obviously,
\begin{equation}
X\to(U,W)\to Y\label{eq:-45}
\end{equation}
forms a Markov chain under the distribution $\widetilde{P}$, and
moreover,
\begin{align}
\widetilde{P}_{XY} & =\pi_{XY}.\label{eq:-17}
\end{align}
Now consider the expression in \eqref{eq:-50} (on the page \pageref{eq:-50})
induced by $\left(\widetilde{P}_{XYWU},\pi_{XY}\right)$. Then we
have the following upper bound on $\varphi_{s}\left(\widetilde{P}_{XYWU},\pi_{XY}\right)$.
\begin{figure*}[t]
\begin{align}
\varphi_{s}\left(\widetilde{P}_{XYWU},\pi_{XY}\right) & :=-\frac{1+s}{s}H_{\widetilde{P}}(XY|WU)+\frac{1}{s}\inf_{Q_{WUW'U'}\in C(\widetilde{P}_{WU},\widetilde{P}_{WU})}\sum_{w,u,w',u'}Q(w,u,w',u')\nonumber \\
& \qquad\times\max_{\substack{Q_{XY}\in\\
C(\widetilde{P}_{X|(W,U)=(w,u)},\widetilde{P}_{Y|(W,U)=(w',u')})
}
}\sum_{x,y}Q(x,y)\log\frac{1}{\pi\left(x,y\right)^{s}Q(x,y)}.\label{eq:-50}
\end{align}
\hrulefill{}
\end{figure*}
\begin{lem}
Given the definition of $\widetilde{P}_{XYWU}$ in \eqref{eq:-43},
we have
\begin{align}
& \varphi_{s}\left(\widetilde{P}_{XYWU},\pi_{XY}\right)\nonumber \\
& \leq e^{-\epsilon}\biggl(-\frac{1+s}{s}H(XY|W)+\frac{1}{s}\inf_{\substack{Q_{WW'}\in\\
C(P_{W},P_{W})
}
}\sum_{w,w'}Q(w,w')\nonumber \\
& \qquad\times\max_{\substack{Q_{XY}\in\\
C(P_{X|W=w},P_{Y|W=w'})
}
}\sum_{x,y}Q(x,y)\log\frac{1}{\pi\left(x,y\right)^{s}Q(x,y)}\biggr)\nonumber \\
& \qquad+o(\epsilon),\label{eq:-44}
\end{align}
where
\begin{equation}
o(\epsilon)=\left(1-e^{-\epsilon}\right)\max_{\left(x,y\right)\in\supp(\pi_{XY})}\log\frac{1}{\pi\left(x,y\right)}
\end{equation}
vanishes as $\epsilon\downarrow0$.
\end{lem}
\begin{IEEEproof}
Starting from the definition of $\varphi_{s}\left(\widetilde{P}_{XYWU},\pi_{XY}\right)$
in \eqref{eq:-50}, we have \eqref{eq:-13}-\eqref{eq:-15} (given
on the page \pageref{eq:-13}), where \eqref{eq:-13} follows since
$H_{\widetilde{P}}(XY|WU)\geq e^{-\epsilon}H(XY|W)$ (from the definition
of $\widetilde{P}_{XYWU}$ in \eqref{eq:-43}) and
\begin{align}
& \widetilde{P}_{U}(u)1\left\{ u'=u\right\} Q_{WW'|\left(U,U'\right)=\left(u,u'\right)}(w,w')\nonumber \\
& \in C(\widetilde{P}_{WU},\widetilde{P}_{WU})
\end{align}
for any $Q_{WW'|\left(U,U'\right)=\left(u,u'\right)}\in C(\widetilde{P}_{W|U=u},\widetilde{P}_{W|U=u'})$;
and \eqref{eq:-15} follows from the definition of $\widetilde{P}_{XYWU}$
in \eqref{eq:-43}. Observe that if we set $Q_{WW'}(w,w')=\widehat{P}_{W}(w)1\{w'=w\}$
in the last term in \eqref{eq:-15}, then this term would be equal
to $\left(1-e^{-\epsilon}\right)\sum_{x,y}\widehat{P}_{XY}(x,y)\log\frac{1}{\pi\left(x,y\right)}$
which is no larger than $\left(1-e^{-\epsilon}\right)\max_{\left(x,y\right)\in\supp(\pi_{XY})}\log\frac{1}{\pi\left(x,y\right)}=o(\epsilon)$
(since $\supp\left(\widehat{P}_{XY}\right)\subseteq\supp\left(\pi_{XY}\right)$).
Hence we have inequality \eqref{eq:-44}.
\begin{figure*}[t]
\begin{align}
& \varphi_{s}\left(\widetilde{P}_{XYWU},\pi_{XY}\right)\nonumber \\
& \leq-e^{-\epsilon}\frac{1+s}{s}H(XY|W)+\frac{1}{s}\sum_{u,u'}\widetilde{P}_{U}(u)1\left\{ u'=u\right\} \inf_{Q_{WW'}\in C(\widetilde{P}_{W|U=u},\widetilde{P}_{W|U=u'})}\sum_{w,w'}Q(w,w')\nonumber \\
& \qquad\times\max_{Q_{XY}\in C(\widetilde{P}_{X|(W,U)=(w,u)},\widetilde{P}_{Y|(W,U)=(w',u')})}\sum_{x,y}Q(x,y)\log\frac{1}{\pi\left(x,y\right)^{s}Q(x,y)}\label{eq:-13}\\
& =-e^{-\epsilon}\frac{1+s}{s}H(XY|W)+e^{-\epsilon}\frac{1}{s}\inf_{Q_{WW'}\in C(P_{W},P_{W})}\sum_{w,w'}Q(w,w')\max_{Q_{XY}\in C(P_{X|W=w},P_{Y|W=w'})}\sum_{x,y}Q(x,y)\log\frac{1}{\pi\left(x,y\right)^{s}Q(x,y)}\nonumber \\
& \qquad+\left(1-e^{-\epsilon}\right)\frac{1}{s}\inf_{Q_{WW'}\in C(\widehat{P}_{W},\widehat{P}_{W})}\sum_{w,w'}Q(w,w')\max_{Q_{XY}\in C(\widehat{P}_{X|W=w},\widehat{P}_{Y|W=w'})}\sum_{x,y}Q(x,y)\log\frac{1}{\pi\left(x,y\right)^{s}Q(x,y)}.\label{eq:-15}
\end{align}
\hrulefill{}
\end{figure*}
\end{IEEEproof}
Using \eqref{eq:-44} and the lower bound in \eqref{eq:-23}, we obtain
that
\begin{align}
& \widetilde{T}_{1+s}(\pi_{XY})\nonumber \\
& \geq\lim_{\epsilon\downarrow0}\inf_{\substack{P_{W}P_{X|W}P_{Y|W}:\\
D_{\infty}\left(P_{XY}\|\pi_{XY}\right)\le\epsilon
}
}e^{\epsilon}\left(\varphi_{s}\left(\widetilde{P}_{XYWU},\pi_{XY}\right)+o(\epsilon)\right)\\
& =\lim_{\epsilon\downarrow0}\inf_{\substack{P_{W}P_{X|W}P_{Y|W}:\\
D_{\infty}\left(P_{XY}\|\pi_{XY}\right)\le\epsilon
}
}\varphi_{s}\left(\widetilde{P}_{XYWU},\pi_{XY}\right)\label{eq:-16}\\
& \geq\inf_{\substack{\widetilde{P}_{WU}\widetilde{P}_{X|WU}\widetilde{P}_{Y|WU}:\\
\widetilde{P}_{XY}=\pi_{XY}
}
}\varphi_{s}\left(\widetilde{P}_{XYWU},\pi_{XY}\right)\label{eq:-12}\\
& =\Gamma_{1+s}^{\mathrm{LB}}(\pi_{XY}).
\end{align}
where \eqref{eq:-16} follows since $e^{\epsilon}$ and any implied
constants in the notation $o(\epsilon)$ do not depend on $P_{W}P_{X|W}P_{Y|W}$,
and \eqref{eq:-12} follows since the distribution $\widetilde{P}_{XYWU}$
in \eqref{eq:-16} satisfies $X\to(U,W)\to Y$ and $\widetilde{P}_{XY}=\pi_{XY}$
(see \eqref{eq:-45} and \eqref{eq:-17}).
\appendices{}
\section{\label{sec:Proof-of-Lemma-property}Proof of Lemma \ref{lem:property}}
1) Observe that
\begin{align*}
& -\frac{1+s}{s}H(XY|W)\\
& \qquad+\sum_{w}P(w)\mathcal{H}_{s}(P_{X|W=w},P_{Y|W=w}\|\pi_{XY})
\end{align*}
is a linear function of $P_{W}$. Hence Statement 1) can be proven
by standard cardinality bounding techniques (e.g., the support lemma
in \cite[Appendix C]{Gamal}).
2) Observe that $\Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY})$ can be rewritten
as
\begin{align}
& \Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY})\nonumber \\
& =\min_{\substack{P_{W}P_{X|W}P_{Y|W}:\\
P_{XY}=\pi_{XY}
}
}\max_{\substack{Q_{XY|W}\in\\
C(P_{X|W},P_{Y|W})
}
}\psi_{s}\left(P_{W}P_{X|W}P_{Y|W},Q_{XY|W}\right),\label{eq:}
\end{align}
where
\begin{align}
& \psi_{s}\left(P_{W}P_{X|W}P_{Y|W},Q_{XY|W}\right)\nonumber \\
& :=\sum_{w,x,y}P(w)Q(x,y|w)\log\frac{P(x|w)P(y|w)}{P\left(x,y\right)}\nonumber \\
& \qquad+\frac{1}{s}\left(H(Q_{XY|W}|P_{W})-H(XY|W)\right).\label{eq:-35}
\end{align}
On the other hand, under the constraint $Q_{XY|W}\in C(P_{X|W},P_{Y|W})$,
\begin{align}
H(Q_{XY|W}|P_{W}) & \le H(Q_{X|W}|P_{W})+H(Q_{Y|W}|P_{W})\\
& =H(XY|W).\label{eq:-4}
\end{align}
Hence for any $0<s<s'$,
\begin{align}
& \frac{1}{s}\left(H(Q_{XY|W}|P_{W})-H(XY|W)\right)\nonumber \\
& \leq\frac{1}{s'}\left(H(Q_{XY|W}|P_{W})-H(XY|W)\right).\label{eq:-1}
\end{align}
Combining \eqref{eq:} and \eqref{eq:-1}, we obtain that $\Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY})\le\Gamma_{1+s'}^{\mathrm{UB}}(\pi_{XY})$,
i.e., $\Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY})$ is non-decreasing in
$s\in(0,\infty)$.
Now we consider $\Gamma_{1+s}^{\mathrm{LB}}(\pi_{XY})$. Following
similar steps above, one can obtain that $\Gamma_{1+s}^{\mathrm{LB}}(\pi_{XY})$
is non-decreasing in $s\in(0,\infty)$.
3) For distribution $P_{W}P_{X|W}P_{Y|W}$ such that $P_{XY}=\pi_{XY}$
and distribution $Q_{XY|W}\in C(P_{X|W},P_{Y|W})$, we have that
\begin{equation}
-H(\pi_{XY})\leq H(Q_{XY|W}|P_{W})-H(XY|W)\leq0,\label{eq:-31}
\end{equation}
where the first inequality above follows since $H(Q_{XY|W}|P_{W})\ge0$
and $H(XY|W)\le H(\pi_{XY})$; and the second inequality follows by
\eqref{eq:-4}.
Define
\begin{align}
\Gamma^{\mathrm{UB}}(\pi_{XY}) & :=\min_{\substack{P_{W}P_{X|W}P_{Y|W}:\\
P_{XY}=\pi_{XY}
}
}\max_{\substack{Q_{XY|W}\in\\
C(P_{X|W},P_{Y|W})
}
}\sum_{w,x,y}P(w)\nonumber \\
& \qquad\times Q(x,y|w)\log\frac{P(x|w)P(y|w)}{\pi\left(x,y\right)}.\label{eq:-2}
\end{align}
Hence by combining \eqref{eq:} and \eqref{eq:-31}, for $s\in(0,\infty)$,
\begin{equation}
\Gamma^{\mathrm{UB}}(\pi_{XY})-\frac{1}{s}H(\pi_{XY})\leq\Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY})\leq\Gamma^{\mathrm{UB}}(\pi_{XY}).
\end{equation}
Letting $s\to\infty$, we obtain $\Gamma_{\infty}^{\mathrm{UB}}(\pi_{XY})=\Gamma^{\mathrm{UB}}(\pi_{XY})$,
i.e., equality \eqref{eq:-36-5}. Equality \eqref{eq:-41} can be
proven similarly.
By choosing $Q_{XY|W}=P_{X|W}P_{Y|W}$ in \eqref{eq:}, we obtain
for $s\in(0,\infty)$,
\begin{equation}
\Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY})\geq C_{\mathsf{Wyner}}(X;Y).\label{eq:-6}
\end{equation}
Let $\left\{ s_{k}\right\} _{k=1}^{\infty}$ be a sequence of decreasing
positive numbers with $\lim_{k\to\infty}s_{k}=0$. Assume that $(P_{W},P_{X|W},P_{Y|W})$
attains $C_{\mathsf{Wyner}}(X;Y)$. For this optimal $(P_{W},P_{X|W},P_{Y|W})$,
assume that $\left\{ Q_{XY|W}^{(k)}\right\} _{k=1}^{\infty}$ is a
sequence of optimal distributions in which $Q_{XY|W}^{(k)}$ attains
the maximum in the following optimization:
\begin{equation}
\gamma_{k}:=\max_{Q_{XY|W}\in C(P_{X|W},P_{Y|W})}\psi_{s_{k}}\left(P_{W}P_{X|W}P_{Y|W},Q_{XY|W}\right)\label{eq:-11}
\end{equation}
where $\psi_{s}\left(\cdot\right)$ is defined in \eqref{eq:-35}.
Since the space $\mathcal{P}(\mathcal{X}\times\mathcal{Y}|\mathcal{W})$
of finitely-supported conditional distributions $Q_{XY|W}$ is compact,
there exists some subsequence $Q_{XY|W}^{\left(k_{i}\right)}$ that
converges to some distribution $\widetilde{Q}_{XY|W}$ as $i\to\infty$.
Since $Q_{XY|W}^{\left(k_{i}\right)}\in C(P_{X|W},P_{Y|W})$ and $H(Q_{XY|W}^{\left(k_{i}\right)}|P_{W})\leq H(P_{X|W}P_{Y|W}|P_{W})$
(see \eqref{eq:-4}), we must have
\begin{align}
\widetilde{Q}_{X|W} & =P_{X|W}\\
\widetilde{Q}_{Y|W} & =P_{Y|W}\\
H(\widetilde{Q}_{XY|W}|P_{W}) & \leq H(P_{X|W}P_{Y|W}|P_{W}).\label{eq:-10}
\end{align}
Now we claim that equality holds in \eqref{eq:-10}. Suppose, to the
contrary, that the inequality in \eqref{eq:-10} is strict. Then observe
that
\begin{align}
\gamma_{k_{i}} & =\max_{Q_{XY|W}\in C(P_{X|W},P_{Y|W})}\psi_{s_{k_{i}}}\left(P_{W}P_{X|W}P_{Y|W},Q_{XY|W}\right)\label{eq:-11-2}\\
& =\psi_{s_{k_{i}}}\left(P_{W}P_{X|W}P_{Y|W},Q_{XY|W}^{\left(k_{i}\right)}\right).
\end{align}
Hence by the definition of $\psi_{s}\left(\cdot\right)$ in \eqref{eq:-35},
and the assumption $H(\widetilde{Q}_{XY|W}|P_{W})<H(P_{X|W}P_{Y|W}|P_{W})$,
we have that $\gamma_{k_{i}}$ diverges to $-\infty$ as $i\to\infty$.
However, in the RHS of \eqref{eq:-11-2}, by choosing $Q_{XY|W}$
as the specific distribution $P_{X|W}P_{Y|W}$, we know that $\gamma_{k_{i}}\ge I(XY;W)=C_{\mathsf{Wyner}}(X;Y).$
Hence the limit of $\gamma_{k_{i}}$ cannot be $-\infty$, which implies
equality in \eqref{eq:-10} holds, i.e.,
\begin{equation}
H(\widetilde{Q}_{XY|W}|P_{W})=H(P_{X|W}P_{Y|W}|P_{W}).\label{eq:-5}
\end{equation}
By \eqref{eq:-4} we know that \eqref{eq:-5} holds if and only if
$\widetilde{Q}_{XY|W}=P_{X|W}P_{Y|W}$. Hence
\begin{align}
& \Gamma_{1}^{\mathrm{UB}}(\pi_{XY})\nonumber \\
& \leq\limsup_{i\to\infty}\sum_{w,x,y}P(w)Q^{\left(k_{i}\right)}(x,y|w)\log\frac{P(x|w)P(y|w)}{\pi\left(x,y\right)}\nonumber \\
& \qquad+\frac{1}{s_{k_{i}}}\left(H(Q_{XY|W}^{\left(k_{i}\right)}|P_{W})-H(XY|W)\right)\label{eq:-3}\\
& \leq\limsup_{i\to\infty}\sum_{w,x,y}P(w)Q^{\left(k_{i}\right)}(x,y|w)\log\frac{P(x|w)P(y|w)}{\pi\left(x,y\right)}\label{eq:-46}\\
& =\sum_{w,x,y}P(w)\widetilde{Q}_{XY|W}(x,y|w)\log\frac{P(x|w)P(y|w)}{\pi\left(x,y\right)}\\
& =\sum_{w,x,y}P(w)P(x|w)P(y|w)\log\frac{P(x|w)P(y|w)}{\pi\left(x,y\right)}\\
& =C_{\mathsf{Wyner}}(X;Y),\label{eq:-7}
\end{align}
where \eqref{eq:-3} follows by the definition of $\Gamma_{1}^{\mathrm{UB}}(\pi_{XY})$
(below \eqref{eq:-35-4-1}) and \eqref{eq:-46} follows by \eqref{eq:-4}.
Combining \eqref{eq:-6} and \eqref{eq:-7}, we obtain that $\Gamma_{1}^{\mathrm{UB}}(\pi_{XY})=C_{\mathsf{Wyner}}(X;Y)$.
4) Proof of ``if'': If $\pi_{XY}$ satisfies the condition $(*)$,
then by \cite[Lemma 1]{yu2018on}, we have that $\Gamma_{\infty}^{\mathrm{UB}}(\pi_{XY})=C_{\mathrm{Wyner}}(\pi_{XY})$.
On the other hand, by Statement 2), $\Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY})$
is non-decreasing in $s\in(0,\infty)$ and by Statement 3), $\Gamma_{1}^{\mathrm{UB}}(\pi_{XY})=C_{\mathrm{Wyner}}(\pi_{XY})$.
Hence $\Gamma_{1+s}^{\mathrm{UB}}(\pi_{XY})=C_{\mathrm{Wyner}}(\pi_{XY})$
for all $s\in(0,\infty]$.
Proof of ``only if'': This can be proven by a perturbation method,
which is similar to the proof of \cite[Lemma 1]{yu2018on}. Hence
we omit the proof.
\bibliographystyle{unsrt}
| {'timestamp': '2020-02-18T02:12:38', 'yymm': '1810', 'arxiv_id': '1810.02534', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02534'} | arxiv |
\section{Introduction}
Several recent works show that recycling analysis tools that have been developed for natural images (photographs) can yield surprisingly good results for analysing paintings or drawings. In particular, impressive classification results are obtained on painting databases by using convolutional neural networks (CNNs) designed for the classification of photographs~\cite{crowley_search_2014,yin2016object}. These results occur in a general context were methods of transfer learning~\cite{donahue_decaf_2013} (changing the task a model was trained for) and domain adaptation (changing the nature of the data a model was trained on) are increasingly applied. Classifying and analysing paintings is of course of great interest to art historians, and can help them to take full advantage of the massive artworks databases that are built worldwide.
More difficult than classification, and at the core of many recent computer vision works, the object detection task (classifying and localising an object) has been less studied in the case of paintings, although exciting results have been obtained, again using transfer techniques~\cite{crowley_art_2016,westlake_detecting_2016,inoue_crossdomain_2018}.
Methods that detect objects in photographs have been developed thanks to massive image databases on which several classes (such as cats, people, cars) have been manually localised with bounding boxes. The PASCAL VOC~\cite{everingham_pascal_2007} and MS COCO~\cite{lin_microsoft_2014} datasets have been crucial in the development of detection methods and the recently introduced Google Open Image Dataset (2M images, 15M boxes for 600 classes) is expected to push further the limits of detection. Now, there is no such database (with localised objects) in the field of Art History, even though large databases are being build by many institutions or academic research teams, e.g.~\cite{rijksmuseum_online_2018,rmn_online,europeana_collections_2018,met_image_2018,pharosconsortium_pharos_2018,wilber_bam_2017}. Some of these databases include image-level annotations, but none includes location annotations. Besides, manually annotating such large databases is tedious and must be performed each time a new category is searched for. Therefore, it is of great interest to develop {\it weakly supervised} detection methods, that can learn to detect objects using image-level annotations only. While this aspect has been thoroughly studied for natural images, only a few studies have been dedicated to the case of painting or drawings.
Moreover, these studies are mostly dedicated to the cross depiction problem: they learn to detect the same objects in photographs and in paintings, in particular man-made objects (cars, bottles ...) or animals. While these may be useful to art historians, it is obviously needed to detect more specific objects or attributes such as ruins or nudity, and characters of iconographic interest such as Mary, Jesus as a child or the crucifixion of Jesus, for instance. These last categories can hardly be directly inherited from photographic databases.
For these two reasons, the lack of location annotations and the specificity of the categories of interest, a general method allowing the weakly supervised detection on specific domains such as paintings would be of great interest to art historians and more generally to anyone needing some automatic tools to explore artistic databases. We propose some contributions in this direction:
\begin{itemize}
\item We introduce a new multiple-instance learning (MIL) technique that is simple and quick enough to deal with large databases,
\item We demonstrate the utility of the proposed technique for object detection on weakly annotated databases, including photographs, drawings and paintings. These experiments are performed using image-level annotations only.
\item We propose the first experiments dealing with the recognition and detection of iconographic elements that are specific to Art History, exhibiting both successful detections and some classes that are particularly challenging, especially in a weakly supervised context.
\end{itemize}
We believe that such a system, enabling one to detect new and unseen category with minimal supervision, is of great benefit for dealing efficiently with digital artwork databases. More precisely, iconographic detection results are useful for different and particularly active domains of humanities: Art History (to gather data relative to the iconography of recurrent characters, such as the Virgin Mary or San Sebastian, as well as to study the formal evolution of their representations), Semiology (to infer mutual configurations or relative dimensions of the iconographic elements), History of Ideas and Cultures (with category such as nudity, ruins), Material Culture Studies, etc.
In particular, being able to detect iconographic elements is of great importance for the study of spatial configurations, which are central to the reading of images and particularly timely given the increasing importance of Semiology. To fix ideas, we can give two examples of potential use. First, the order in which iconographic elements are encountered (e.g. Gabriel and Mary), when reading an image from left to right, has received much attention from art historians~\cite{gasparro2008dal}. In the same spirit, recent studies~\cite{deBosio2017} on the meaning of mirror images in early modern Italy could benefit from the detection of iconographic elements.
\section{Related Work}
\textbf{Object recognition and detection in artworks}
Early works on cross-domain (or cross-depiction) image comparisons were mostly concerned with sketch retrieval, see e.g.~\cite{del1997visual}. Various local descriptors were then used for comparing and classifying images, such as
part-based models \cite{shrivastava2011data} or mid-level discriminative patches \cite{aubry2014painting,crowley2014state}. In order to enhance the generalisation capacity of these approaches, it was proposed in~\cite{wu2014learning} to model object through graphs of labels. More generally, it was shown in~\cite{hall2015cross} that structured models are more prone to succeed in cross-domain recognition than appearance-based models.
Next, several works have tried to transfer the tremendous classification capacity of convolutional neural networks to perform cross-domain object recognition, in particular for paintings. In~\cite{crowley_search_2014}, it is shown that recycling CNNs directly for the task of recognising objects in paintings, without fine-tuning, yields surprisingly good results. Similar conclusions were also given in~\cite{yin2016object} for artistic drawings. In~\cite{li_deeper_2017}, a robust low rank parametrized CNN model is proposed to recognise common categories in an unseen domain (photo, painting, cartoon or sketch).
In~\cite{wilber_bam_2017}, a new annotated database is introduced, on which it is shown that fine-tuning improves recognition performances. Several works have also successfully adapted CNNs architectures to the problem of style recognition in artworks~\cite{lecoutre_recognizing_2017,bianco2017deep,mao_deepart_2017}. More generally, the use of CNNs opens the way to other artwork analysis tasks, such as visual links retrieval~\cite{seguin_visual_2016}, scene classification~\cite{florea_domain_2017}, author classification~\cite{vannoord_learning_2017} or possibly to generic artwork content representation~\cite{strezoski_omniart_2017}.
The problem of {\it object detection} in paintings, that is, being able to both localise and recognise objects, has been less studied. In~\cite{crowley_art_2016}, it is shown that applying a pre-trained object detector (Faster R-CNN~\cite{ren_faster_2015}) and then selecting the localisation with highest confidence can yield correct detections of PASCAL VOC classes. Other works attacked this difficult problem by restricting it to a single class. In~\cite{ginosar2014detecting}, it is shown that deformable part model outperforms other approaches, including some CNNs, for the detection of people in cubist artworks. In~\cite{redmon_you_2016}, it is shown that the YOLO network trained on natural images can, to some extend, be used for people detection in cubism.
In~\cite{westlake_detecting_2016}, it is proposed to perform people detection in a wide variety of artworks (through a newly introduced database) by fine-tuning a network in a supervised way. People can be detected with high accuracy even though the database has very large stylistic variations and includes paintings that strongly differs from photographs in the way they represent people.
\textbf{Weakly supervised detection} refers to the task of learning an object detector using limited annotations, usually image-level annotations only. Often, a set of detections (e.g. bounding boxes) is considered at image level, assuming we only know if at least one of the detection corresponds the category of interest. The corresponding statistical problem is referred to as multiple instance learning (MIL) \cite{dietterich1997solving}. A well-known solution to this problem through a generalisation of Support Vector Machine (SVM) has been proposed in \cite{andrews_support_2003}. Several approximations of the involved non-convex problem have been proposed, see e.g. \cite{gehler2007deterministic} or the recent survey~\cite{carbonneau_multiple_2016}.
Recently, this problem has been attacked using classification and detection neural networks. In \cite{song_learning_2014}, it is proposed to learn a smooth version of an SVM on the features from R-CNN \cite{girshick_rich_2014} and to focus on the initialisation phase which is crucial due to the non-convexity of the problem.
In \cite{redmon2016}, it is proposed to learn to detect new specific classes by taking advantage of the knowledge of wider classes.
In \cite{bilen_weakly_2016} a weakly supervised deep detection network is proposed based on Fast R-CNN \cite{girshick_fast_2015}. Those works have been improved in \cite{tang_multiple_2017} by adding a multi-stage classifier refinement.
In \cite{cinbis_weakly_2016} a multi-fold split of the training data is proposed to escape local optima.
In \cite{li_weakly_2016}, a two step strategy is proposed, first collecting good regions by a mask-out classification, then selecting the best positive region in each image by a MIL formulation and then fine-tuning a detector with those propositions as "ground truth" bounding boxes.
In \cite{durand_wildcat_2017} a new pooling strategy is proposed to efficiently learn localisation of objects without doing bounding boxes regression.
Weakly supervised strategies for the cross domain problem have been much less studied. In~\cite{crowley_art_2016}, a relatively basic methodology is proposed, in which for each image the bounding box with highest (class agnostic) "objectness" score is classified.
In \cite{inoue_crossdomain_2018}, it is proposed to do mixed supervised object detection with cross-domain learning based on the SSD network \cite{liu2016}. Object detectors are learnt by using instance-level annotations on photographs and image-level annotations on a target domain (watercolor, cartoon, etc.). We will perform comparisons of our approach with these two methods in Section~\ref{sec:experiments}.
\section{Weakly supervised detection by transfer learning}
In this section, we propose our approach to the weakly supervised detection of visual category in paintings. In order to perform transfer learning, we first apply Faster R-CNN~\cite{ren_faster_2015} (a detection network trained on photographs) which is used as a feature extractor, in the same way as in~\cite{crowley_art_2016}. This results in a set of candidate bounding boxes. For a given visual category, the goal is then, using image-level annotations only, to decide which boxes correspond to this category. For this, we propose a new multiple-instance learning method, that will be detailed in Section~\ref{MILsection}. In contrast with classical approaches to the MIL problem such as~\cite{andrews_support_2003} the proposed heuristic is very fast. This, combined with the fact that we do not need fine-tuning, permits a flexible on-the-fly learning of new category in a few minutes.
Figure~\ref{fig:angel-Bag} illustrates the situation we face at training time. For each image, we are given a set of bounding boxes which receive a label $+1$ (the visual category of interest is present at least once) or $-1$ (the category is not present in this image).
\begin{figure}
\centering
\includegraphics[height=4.5cm]{{Bag_pos1}.jpg} \hspace{2cm}
\includegraphics[height=4.5cm]{{Bag_neg1}.jpg}
\caption{Illustration of positive and negative sets of detections (bounding boxes) for the {\it angel} category.}
\label{fig:angel-Bag}
\end{figure}
\subsection{Multiple Instance Learning}
\label{MILsection}
The usual way to perform MIL is through the resolution of a non-convex energy minimisation~\cite{andrews_support_2003}, although efficient convex relaxations have been proposed~\cite{joulin2012convex}. One disadvantage of these approaches is their heavy computational cost. In what follows, we propose a simple and fast heuristic to this problem.
For simplicity of the presentation, we assume only one visual category. Assume we have $N$ images at hand, each of which contains $K$ bounding boxes. Each image receives a label $y = +1$ when it is a positive example (the category is present) and $y = -1$ otherwise. We denote by $n_1$ the number of positive examples in the training set, and by $n_{-1}$ the number of negative examples.
Images are indexed by $i$, the $K$ regions provided by the object detector are indexed by $k$, the label of the $i$-th image is denoted by $y_i$ and the high level semantic feature vector of size M associated to the $k$-th box in the $i$-th image is denoted $X_{i,k}$. We also assume that the detector provides a (class agnostic) "objectness" score for this box, denoted $s_{i,k}$.
We make the (strong) hypothesis that if $y_{i} = +1 $, then there is at least one of the $K$ regions in image $i$ that contains an occurrence of the category. In a sense, we assume that the region proposal part is robust enough to transfer detections from photography to the target domain.
Following this assumption, our problem boils down to the classic multiple-instance classification problem~\cite{dietterich1997solving}: if for image $i$ we have $y_i=+1$, then at least one of the boxes contains the category, whereas if $y_i=-1$ no box does. The goal is then to decide which boxes correspond to the category. Instead of the classical SVM generalisation proposed in \cite{andrews_support_2003} and based on an iterative procedure, we look for an hyperplan minimising the functional defined below. We look for $w \in \mathbf{R}^M$, $b\in\mathbf{R}$ achieving
\begin{equation}
min_{(w,b)} \mathcal{L} (w,b)
\end{equation}
with
\begin{equation}
\phi(w,b) = \sum_{i=1}^{N} \frac{-y_{i}}{n_{y_i}} Tanh \left\lbrace \max_{ k \in \{1..K \} } \left( w^{T} X_{i,k} + b \right) \right\rbrace
\end{equation}
and
\begin{equation}
\label{eqn:LossReg}
\mathcal{L} (w,b) =\phi(w,b) + C * ||w||^2,
\end{equation}
where $C$ is a constant balancing the regularisation term.
The intuition behind this formulation is that minimising $\mathcal{L} (w,b) $ amounts to seek a hyperplan separating the most positive element of each positive image from the least negative element of the negative image, sharing similar ideas as in
MI-SVM \cite{andrews_support_2003} or Latent-SVM \cite{felzenszwalb_object_2010}. The $\mathop{Tanh}$ is here to mimic the SVM formulation in which only the worst margins count.
We divide by $n_{y_i}$ to account for unbalanced data. Indeed most example images are negative ones ($n_{-1}>>n_{1})$).
The main advantage of this formulation is that it can be realised by a simple gradient descent, therefore avoiding costly multiple SVM optimisation.
If the dataset is too big to fit in the memory, we switch to a stochastic gradient descent by considering random batches in the training set.
As this problem is non-convex, we try several random initialisation and we select the couple $w,b$ minimising the classification function $\phi(w,b)$. Although we did not explore this possibility it may be interesting to keep more than one vector to describe a class, since one iconographic element could have more that one specific feature, each stemming from a distinctive part.
In practice, we observed consistently better results when modifying slightly the above formulation by considering the (class-agnostic) "objectness" score associated to each box (as returned by Faster R-CNN). Therefore we modify function $\phi$ to
\begin{equation}
\label{eqn:MILS}
\phi^s(w,b) = \sum_{i=1}^{N} \frac{-y_{i}}{n_{y_i}} Tanh \left\lbrace \max_{k \in \{1..K\} } \left( \left( s_{i,k} + \epsilon \right) \left(w^{T} X_{i,k} + b \right) \right) \right\rbrace
\end{equation}
with $ \epsilon \geq 0$.
The motivation behind this formulation is that the score $s_{i,k}$, roughly a probability that there is an object (of any category) in box $k$, provides a prioritisation between boxes.
Once the best couple ($w^{\star},b^{\star}$) has been found, we compute the following score, reflecting the meaningfulness of category association :
\begin{equation}
S(x) = Tanh \lbrace \left( s(x) + \epsilon \right) \left(w^{\star T} x + b^{\star} \right) \rbrace
\label{eq:scoreMILS}
\end{equation}
At test time, each box with a positive score \eqref{eq:scoreMILS} (where $s(x)$ is the objectness score associated to $x$) is affected to the category. The approach is then straightforwardly extended to an arbitrary number of categories, by computing a couple $(w^{\star},b^{\star})$ per category. Observe, however, that this leads to non-comparable scores between categories.
Among all boxes affected to each class, a non-maximal suppression (NMS) algorithm is then applied in order to avoid redundant detections. The resulting multiple instance learning method is called {\bf \MIL{}}.
\subsection{Implementation details}
\label{sec:implementation}
\paragraph{\bf Faster R-CNN} We use the detection network Faster R-CNN~\cite{ren_faster_2015}. We only keep its region proposal part (RPN) and the features corresponding to each proposed region. In order to yield and efficient and flexible learning of new classes, we choose to avoid retraining or even fine-tuning.
Faster R-CNN is a meta-network in which a pre-trained network is enclosed. The quality of features depends on the enclosed network and we compare several possibility in the experimental part.
Images are resized to 600 by 1000 before applying Faster R-CNN. We only keep the 300 boxes having best "objectness" scores (after a NMS phase), along with their high-level features\footnote{The layer $fc7$ of size $M=2048$ in the ResNet case, often called 2048-D.}.
An example of extracted boxes is shown in figure \ref{fig:FasterRCNNBOX}. %
About 5 images per second can be obtained on a standard GPU. This part can be performed offline since we don't fine-tune the network.
As mentioned in \cite{kornblith_better_2018}, residual network (ResNet) appears to be the best architecture for transfer learning by feature extractions among the different ImageNet models, and we therefore choose these networks for our Faster R-CNN versions. One of them (denoted RES-101-VOC07) is a 101 layers ResNet trained for the detection task on PASCAL VOC2007.
The other one (denoted RES-152-COCO) is a 152 layers ResNet trained on MS COCO~\cite{lin_microsoft_2014}. We will also compare our approach to the plain application of these networks for the detection tasks when possible, that is when they were trained on classes we want to detect. We refer to these approaches as FSD (fully supervised detection) in our experiments.
For implementation, we build on the Tensorflow\footnote{\url{https://www.tensorflow.org/}} implementation of Faster R-CNN of Chen and al. \cite{chen_implementation_2017}\footnote{Code can be found on GitHub \url{https://github.com/endernewton/tf-faster-rcnn}.}.
\begin{figure}[!tbp]
\centering
\hfill
\includegraphics[height=5cm]{{im/threshold_07_reduceBoxes}.jpg} \hfill
\includegraphics[height=5cm]{{im/TheMysticMarriageofStCatherinebyVeronese_threshold_00}.jpg}\hfill
\caption{Some of the regions of interest generated by the region proposal part (RPN) of Faster R-CNN.}
\label{fig:FasterRCNNBOX}
\end{figure}
\paragraph{\bf \MIL{}} When a new class is to be learned, the user provides a set of weakly annotated images. The \MIL{} framework described above is then run to find a linear separator specific to the class. Note that both the database and the library of classifiers can be enriched very easily. Indeed, adding an image to the database only requires running it through the Faster R-CNN network and adding a new class only requires a MIL training.
For training the \MIL{}, we use a batch size of 1000 examples (for smaller sets, all features are loaded into the GPU), 300 iterations of gradient descent with a learning rate of 0.01 and $\epsilon=0.01$ \eqref{eqn:MILS}. The whole process takes 750s for 20 classes on PASCAL VOC07 trainval (5011 images) with 12 random start points per class, on a consumer GPU (GTX 1080Ti). Actually the random restarts are performed in parallel to take advantage of the presence of the features in the GPU memory since the transfer of data from central RAM to the GPU memory is a bottleneck for our method. The 20 classes can be learned in parallel.
For the experiments of Section~\ref{sec:iconart}, we also perform a grid search on the hyper-parameter C \eqref{eqn:LossReg} by splitting the training set into training and validation sets. We learn several couples ($w$,$b$) for each possible value of C (different initialisation) and the one that minimises the loss \eqref{eqn:MILS} for each class is selected.
%
\section{Experiments}
\label{sec:experiments}
In this section, we perform weakly supervised detection experiments on different databases, in order to illustrate different assets of our approach.
In all cases, and besides other comparisons, we compare our approach (\MIL{}) to the following baseline, which is actually the approach chosen for the detection experiments in~\cite{crowley_art_2016} (except that we do not perform box expansion): the idea is to consider that the region with the best "objectness" score is the region corresponding to the label associated to the image (positive or negative). This baseline will be denoted as \MAX{}. Linear-SVM classifier are learnt using those features per class in a one-vs-the-rest manner. The weight parameter that produces the highest AP (Average Precision) score is selected for each class by a cross validation method\footnote{We use a 3-fold cross validation while \cite{crowley_art_2016} use constant training and validation set.} and then a classifier is retrained with the best hyper-parameter on all the training data per class. This baseline requires to train several SVMs and is therefore costly.
At test time, the labels and the bounding boxes are used to evaluate the performance of the methods in term of AP par class. The generated boxes are filtered by a NMS with an Intersection over Union (IoU) \cite{everingham_pascal_2007} threshold of 0.3 and a confidence threshold of 0.05 for all methods.
\subsection{Experiments on PASCAL VOC}
Before proceeding with the transfer learning and testing our method on paintings, we start with a sanity check experiment on PASCAL VOC2007~\cite{everingham_pascal_2007}. We compare our weakly supervised approach, \MIL{}, to the plain application of the fully supervised Faster R-CNN~\cite{ren_faster_2015} and to the weakly supervised MAX procedure recalled above. We perform the comparison using two different architectures (for the three methods), RES-101-VOC07 and RES-512-COCO, as explained in the previous section.
\begin{savenotes}
\begin{table}
\caption{ \textbf{VOC 2007 test} Average precision (\%). Comparison of the Faster R-CNN detector (trained in a fully supervised manner : FSD) and our \MILS{} algorithm (trained in a weakly supervised manner) for two networks RES-101-VOC07 and RES-152-COCO.}
\label{table:VOC2007}
\resizebox{\columnwidth}{!}{
\begin{tabular}{|c|c|cccccccccccccccccccc|c|}
Net & Method & aero & bicy & bird & boa & bot & bus & car & cat & cha & cow & dtab & dog & hors & mbik & pers & plnt & she & sofa & trai & tv & mean \\ \hline \hline
RES- & FSD \cite{he_deep_2015} & 73.6 & 82.3 & 75.4 & 64.0 & 57.4 & 80.2 & 86.5 & 86.2 & 52.7 & 85.2 & 66.9 & 87.0 & 87.1 & 82.9 & 81.2 & 45.7 & 76.8 & 71.2 & 82.6 & 75.5 & 75.0 \\
%
101- & \MAX{} & 20.8 & 47.0 & 26.1 & 20.2 & 8.3 & 41.1 & 44.9 & 60.1 & 31.7 & 54.8 & 46.4 & 42.9 & 62.2 & 58.7 & 20.9 & 21.6 & 37.6 & 16.7 & 42.0 & 19.8 & 36.2 \\
%
%
%
VOC07 & \MILS{}\footnote{It is the average performance on 100 runs of our algorithm.} & 63.5 & 78.4 & 68.5 & 54.0 & 50.7 & 71.8 & 85.6 & 77.1 & 52.7 & 80.0 & 60.1 & 78.3 & 80.5 & 73.5 & 74.7 & 37.4 & 71.2 & 65.2 & 75.7 & 67.7 & 68.3 $\pm$ 0.2 \\
\hline
RES- & FSD \cite{he_deep_2015} & 91.0 & 90.4 & 88.3 & 61.2 & 77.7 & 92.2 & 82.2 & 93.2 & 67.0 & 89.4 & 65.8 & 88.0 & 92.0 & 89.5 & 88.5 & 56.9 & 85.1 & 81.0 & 89.8 & 85.2 & 82.7 \\
152- & \MAX{}~\cite{crowley_art_2016} & 58.8 & 64.7 & 52.4 & 8.6 & 20.8 & 55.2 & 66.8 & 76.1 & 19.4 & 66.3 & 6.7 & 59.7 & 56.4 & 43.3 & 15.5 & 18.3 & 80.3 & 7.6 & 71.8 & 32.6 & 44.1 \\
%
%
%
COCO & \MILS{}\textsuperscript{\thefootnote} & 88.0 & 90.2 & 84.3 & 66.0 & 78.7 & 93.8 & 92.7 & 90.7 & 63.7 & 78.8 & 61.5 & 88.4 & 90.9 & 88.8 & 87.9 & 56.8 & 75.5 & 81.3 & 88.4 & 86.1 & 81.6 $\pm$ 0.3 \\
%
\end{tabular}
}
\end{table}
\end{savenotes}
As shown in Table \ref{table:VOC2007} our weakly supervised approach (only considering annotations at the image level~\footnote{However, observe that since we are relying on Faster R-CNN, our system uses a subpart trained using class agnostic bounding boxes.})
yields performances that are only slightly below the ones of the fully supervised approach (using instance-level annotations).
On the average, the loss is only 1.1\% of mAP when using RES-512-COCO (for both methods). The baseline \MAX{} procedure (used for transfer learning on paintings in~\cite{crowley_search_2014}) yields notably inferior performances.
\subsection{Detection evaluation on Watercolor2k and People-Art databases}
We compare our approach with two recent methods performing object detection in artworks, one in a fully supervised way~\cite{westlake_detecting_2016} for detecting people, the other using a (partly) weakly supervised method to detect several VOC classes on watercolor images~\cite{inoue_crossdomain_2018}. For the learning stage, the first approach uses instance-level annotations on paintings, while the second one uses instance-level annotations on photographs and image-level annotations on paintings. In both cases, it is shown that using image-level annotations only (our approach, \MIL{}) only yields a light loss of performances.
\paragraph{\bf Experiment 1 : Watercolor2k} This database, introduced in \cite{inoue_crossdomain_2018}, and available online\footnote{\url{https://github.com/naoto0804/cross-domain-detection}}, is a subset of watercolor artworks from the \textbf{BAM!} database \cite{wilber_bam_2017} with instance-level annotations for 6 classes (bike, bird, dog, cat, car, person) that are included in the PASCAL VOC, in order to study cross-domain transfer learning.
%
On this database, we compare our approach to the methods from~\cite{inoue_crossdomain_2018} and from~\cite{bilen_weakly_2016}, to the baseline \MAX{} discussed above, as well as to the classical MIL approach MI-SVM~\cite{andrews_support_2003} (using a maximum of 50 iterations and no restarts).
In \cite{inoue_crossdomain_2018}, a style transfer transformation (Cycle-GAN \cite{zhu2017a}) is applied to natural images with instance-level annotation. The images are transferred to the new modality (i.e. watercolor) in order to fine-tune a detector pre-trained on natural images. This detector is used to predict localisation of objects on watercolor images annotated at the image level. The detector is then fine-tuned on those images in a fully supervised manner. Bilen and Vedaldi \cite{bilen_weakly_2016} proposed a Weakly Supervised Deep Detection Network (WSDDN), which consists in transforming a pre-trained network by replacing its classification part by a two streams network (a region proposal stream and a classification one) combined with a weighted MIL pooling strategy.
\begin{savenotes}
\begin{table}
\caption{\textbf{Watercolor2k (test set)} Average precision (\%). Comparison of the proposed \MILS{} method to alternative approaches.}
\label{table:Watercolor2k}
\resizebox{\columnwidth}{!}{
\begin{tabular}{|c|c|cccccc|c|}
Net & Method & bike &bird &car &cat &dog &person & mean \\ \hline \hline
VGG & WSDDN \cite{bilen_weakly_2016} \footnote{The performance come from the original paper \cite{inoue_crossdomain_2018}.} & 1.5 & 26.0 & 14.6 & 0.4 & 0.5 & 33.3 & 12.7 \\
SSD & DT+PL \cite{inoue_crossdomain_2018} \textsuperscript{\thefootnote} & 76.5 & 54.9 & 46.0 & 37.4 & 38.5 & 72.3 & 54.3 \\
\hline %
%
%
%
%
%
\multirow{2}{*}{RES-152-COCO} & \MAX{}~\cite{crowley_art_2016} & 74.0 & 34.5 & 26.8 & 17.8 & 21.5 & 21.0 & 32.6 \\
%
& MI-SVM \cite{andrews_support_2003} & 66.8 & 23.5 & 6.7 & 13.0 & 8.4 & 14.1 & 22.1 \\
%
%
%
%
%
%
\hline \hline
& \MILS{} [Our] \footnote{Standard deviation computed on 100 runs of the algorithm.} & 85.2 & 48.2 & 49.2 & 31.0 & 30.0 & 57.0 & 50.1 $\pm$ 1.1 \\ %
\end{tabular}}
\end{table}
\end{savenotes}
From Table~\ref{table:Watercolor2k}, one can see that our approach performs clearly better than the other ones using image-level annotations only (\cite{bilen_weakly_2016}, \MAX{}, MI-SVM). We also observe only a minor degradation of average performances (54.3 \% versus 48.9 \%) with respect to the method~\cite{inoue_crossdomain_2018}, which is retrained using style transfer and instance-level annotations on photographs.
\paragraph{\bf Experiment 2 : People-Art} This database, introduced in \cite{westlake_detecting_2016}, is made of artistic images and bounding boxes for the single class {\it person}. This database is particularly challenging because of its high variability in styles and depiction techniques. The method introduced in~\cite{westlake_detecting_2016} yields excellent detection performances on this database, but necessitates instance-level annotations for training. The authors rely on Fast R-CNN \cite{girshick_fast_2015}, of which they only keep the three first layers, before re-training the remaining of the network using manual location annotations on their database.
In Table~\ref{tab:People-Art_detection}, one can see that our approach MI-max yields detection results that are very close to the fully supervised results from~\cite{westlake_detecting_2016}, despite a much lighter training procedure. In particular, as already explained, our procedure can be trained directly on large, globally annotated database, for which manually entering instance-level annotations is tedious and time-costly.
\begin{savenotes}
\begin{table}
\centering
\caption{\textbf{People-Art (test set)} Average precision (\%). Comparison of the proposed \MILS{} method to alternative approaches.}
\label{tab:People-Art_detection}
\begin{tabular}{|c|c|c|}
Net & Method & person \\
\hline
\hline
Fast R-CNN (VGG16) & Fine tuned \cite{westlake_detecting_2016}\footnote{The performance come from the original paper.} & 59 \\
\hline
\multirow{2}{*}{RES-152-COCO} & \MAX{}~\cite{crowley_art_2016} & 25.9 \\
& MI-SVM \cite{andrews_support_2003} & 13.3 \\
\hline \hline
RES-152-COCO & \MILS{} [Our] & 55.4 $\pm$ 0.7 \\
%
%
\end{tabular}
\end{table}
\end{savenotes}
\subsection{Detection on \NB{} database}
\label{sec:iconart}
In this last experimental section, we investigate the ability of our approach to learn and detect new classes that are specific to the analysis of artworks, some of which cannot be learnt on photographs. Typical such examples include iconic characters in certain situations, such as Child Jesus, the crucifixion of Jesus, Saint Sebastian, etc.
Although there has been a recent effort to increase open-access databases of artworks by academia and/or museums workforce \cite{mensink_rijksmuseum_2014,crowley_search_2014,lecoutre_recognizing_2017,mao_deepart_2017,strezoski_omniart_2017,rijksmuseum_online_2018,europeana_collections_2018,met_image_2018}, they usually don't include systematic and reliable keywords. One exception is the database from the Rijkmuseum, with labels based on the IconClass classification system \cite{iconclass_home_2018}, but this database is mostly composed of prints, photographs and drawings. Moreover, these databases don't include the localisation of objects or characters.
In order to study the ability of our (and other) systems to detect iconographic elements, we gathered 5955 painting images from Wikicommons\footnote{\url{https://commons.wikimedia.org/wiki/Main_Page}}, ranging from the 11th to the 20th century, which are partially annotated by the Wikidata\footnote{\url{https://www.wikidata.org/wiki/Wikidata:Main_Page}} contributors. We manually checked and completed image-level annotations for 7 classes. The dataset is split in training and test sets, as shown in Table \ref{tab:WikiDataSet}.
For a subset of the test set, and only for the purpose of performance evaluation, instance-level annotations have been added. The resulting database is called \NB{}\footnote{The database is available online \url{https://wsoda.telecom-paristech.fr/downloads/dataset/IconArt_v1.zip}.}. Example images are shown in Figure \ref{fig:NotreBase}. To the best of our knowledge, the presented experiments are the first investigating the ability of modern detection tools to classify and detect such iconographic elements in paintings. Moreover, we investigate this aspect in a weakly supervised manner.
\begin{table}
\centering
\resizebox{\columnwidth}{!}{
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}
\hline
Class & Angel & Child Jesus & Crucifixion & Mary & nudity & ruins & Saint Sebastian & None & Total \\
\hline
Train & 600 & 755 & 86 & 1065 & 956 & 234 & 75 & 947 & 2978 \\
\hline
Test for classification & 627 & 750 & 107 & 1086 & 1007 & 264 & 82 & 924 & 2977 \\
Test for detection & 261 & 313 & 107 & 446 & 403 & 114 & 82 & 623 & 1480 \\
\hline
Number of instances & 1043 &320 & 109 & 502 & 759 & 194 & 82 & & 3009 \\
\hline
\end{tabular}}
\caption{Statistics of the IconArt database}
\label{tab:WikiDataSet}
\end{table}
\begin{figure}
%
\centering
\hfill
\includegraphics[height=2.55cm]{angel/Q549847.jpg} \hfill
\includegraphics[height=2.55cm]{im/angel/Q560027.jpg} \hfill
\includegraphics[height=2.55cm]{im/angel/Q3851971.jpg} \hfill
\includegraphics[height=2.55cm]{im/angel/Q16622023.jpg} \hfill
\includegraphics[height=2.55cm]{im/angel/Q18572264.jpg} \hfill \\
\centering
%
\hfill
%
\includegraphics[height=2.55cm]{SS/Q3213794.jpg} \hfill \includegraphics[height=2.55cm]{SS/Q2343939.jpg} \hfill
\includegraphics[height=2.55cm]{SS/Q18748497.jpg} \hfill
\includegraphics[height=2.55cm]{SS/Q20188782.jpg} \hfill
\includegraphics[height=2.55cm]{im/SS/Q3842548.jpg} \hfill \\
\centering
%
%
%
%
%
%
%
\caption{Example images from the \NB{} database. Angel on the first line, Saint Sebastian on the second. We can see some of the challenges posed by this database: tiny objects, occlusions and large pose variability.}
\label{fig:NotreBase}
\end{figure}
To fix ideas on the difficulty of dealing with iconographic elements, we start with a classification experiment. For this, we use the same classification approach as in~\cite{crowley_search_2014}, using InceptionResNetv2 \cite{szegedy_inceptionv4_2016} as a feature extractor\footnote{Only the center of the image is provided to the network and extracted features are 1536-D.}. We also perform classification-by-detection experiments, using the previously described \MAX{} approach (as in~\cite{crowley_art_2016}) and our approach, \MILS{}. In both cases, for each class, the score at the image level is the highest confidence detection score for this class on all the regions of the image. Results are displayed in Table~\ref{tab:WikiTenLabels_classif}. First, we observe that classification results are very variable depending on the class. Classes such as Jesus Child, Mary or crucifixion have relatively high classification scores. Others, such as Saint Sebastian, are only scarcely classified, probably due to a limited quantity of examples and a high variability of poses, scales and depiction styles. We can also observe that, as mentioned in \cite{crowley_art_2016}, the classification by detection can provide better scores than global classification, possibly because of small objects, such as angels in our case. Observe that these classification scores can probably be increased using multi-scale learning (as in \cite{vannoord_learning_2017}), augmentation schemes and an ensemble of networks \cite{crowley_art_2016}.
\begin{table}
\caption{\textbf{\NB{} classification test set} \textit{classification} average precision (\%).}
\label{tab:WikiTenLabels_classif}
\resizebox{\columnwidth}{!}{
\begin{tabular}{|c|c|ccccccc|c|}
Net & Method &angel & JCchild & crucifixion & Mary & nudity & ruins & StSeb & mean \\ \hline
\hline
InceptionResNetv2 \cite{szegedy_inceptionv4_2016} & & 44.1 & 77.2 & 57.8 & 81.1 & 77.4 & 74.6 & 26.8 & 62.7 \\
\hline
& \MAX{}~\cite{crowley_art_2016} & 49.3 & 74.7 & 30.3 & 67.5 & 57.4 & 43.2 & 7.0 & 47.1 \\
RES-152-COCO & \MILS{} [Our] & 57.4 & 60.7 & 79.9 & 70.4 & 65.3 & 45.9 & 17.0 & 56.7 $\pm$ 1.0 \\
& \MILSCV{} [Our] & 61.0 & 68.9 & 80.2 & 71.4 & 66.3 & 51.7 & 14.8 & 59.2 $\pm$ 1.2
\end{tabular}}
\end{table}
Next, we evaluate the detection performance of our method, first with a restrictive metric : AP per class with an IoU $\geqslant$0.5 (as in all previous detection experiments in this paper), then with a less restrictive metric with IoU $\geqslant$0.1. Results are displayed in Table \ref{tab:WikiTenLabels_detection}. Results on this very demanding experiment are a mixed-bag. Some classes, such as crucifixion, and to a less extend nudity or Jesus Child are correctly detected. Others, such as angel, ruins or Saint Sebastian, hardly get it up to 15\% detection scores, even when using the relaxed criterion IoU $\geqslant$0.1. Beyond a relatively small number of examples and very strong scale and pose variations, there are further reasons for this :
\begin{itemize}
\item The high in-class depiction variability (for Saint Sebastian for instance)
\item The many occlusions between several instances of a same class (angel)
\item The fact that some parts of an object can be more discriminative than the whole object (nudity)
\end{itemize}{}
\begin{table}
\caption{\textbf{\NB{} detection test set} \textit{detection} average precision (\%). All methods based on RES-152-COCO.}
\label{tab:WikiTenLabels_detection}
\resizebox{\columnwidth}{!}{
\begin{tabular}{|c|c|ccccccc|c|}
Method & Metric &angel & JCchild & crucifixion & Mary & nudity & ruins & StSeb & mean \\ \hline
\hline
\multirow{2}{*}{\MAX{}~\cite{crowley_art_2016}} & AP IoU $\geqslant$0.5 & 1.4 & 3.9 & 7.4 & 2.8 & 3.9 & 0.3 & 0.9 & 2.9 \\
& AP IoU $\geqslant$0.1 & 10.1 & 36.2 & 28.2 & 18.4 & 14.0 & 1.6 & 2.8 & 15.9 \\
\hline
\hline
%
\multirow{2}{*}{\MILS{} [Our]} & AP IoU $\geqslant$0.5 & 0.3 & 0.9 & 37.3 & 3.8 & 21.2 & 0.5 & 10.9 & 10.7 $\pm$ 1.7 \\
& AP IoU $\geqslant$0.1 & 6.4 & 25.3 & 74.4 & 44.6 & 30.9 & 6.8 & 17.2 & 29.4 $\pm$ 1.7 \\
\hline
%
%
\multirow{2}{*}{\MILSCV{} [Our] } & AP IoU $\geqslant$0.5 & 3.0 & 17.7 & 32.6 & 4.8 & 23.5 & 1.1 & 9.6 & 13.2 $\pm$ 3.1 \\
& AP IoU $\geqslant$0.1 & 12.3 & 41.2 & 74.4 & 46.3 & 31.2 & 13.6 & 16.1 & 33.6 $\pm$ 2.2 \\
\end{tabular}}
\end{table}
Illustrations of successes and failures are displayed, respectively on Figures \ref{fig:NotreBaseSuccesful} and \ref{fig:Failures}. On the negative examples, one can see that often a larger region than the element of interest is selected or that a whole group of instances is selected instead of a single one.
Future work could focus on the use of several couples ($w$,$b$) instead of one to prevent those problems.
\begin{figure}
\centering
\hfill
%
\includegraphics[height=2.55cm]{im/DetectionsCorrect/Q22672592_Regions_over075.jpg}\hfill
\includegraphics[height=2.55cm]{im/DetectionsCorrect/Q369582_Regions_over075.jpg} \hfill
\includegraphics[height=2.55cm]{im/DetectionsCorrect/Q3947946_Regions_over075.jpg} \hfill
\includegraphics[height=2.55cm]{im/DetectionsCorrect/Q6043567_Regions_over075.jpg} \hfill
\includegraphics[height=2.55cm]{im/DetectionsCorrect/Q743787_Regions_over075.jpg} \hfill
\includegraphics[height=2.55cm]{im/DetectionsCorrect/Q19900890_Regions_over075.jpg} \hfill
%
\includegraphics[height=2.55cm]{im/DetectionsCorrect/Q18572427_Regions_over075.jpg} \hfill
\includegraphics[height=2.55cm]{im/DetectionsCorrect/Q27896612_Regions_over075.jpg} \hfill
\includegraphics[height=2.55cm]{im/DetectionsCorrect/Q28059074_Regions_over075.jpg} \hfill
%
\includegraphics[height=2.55cm]{im/DetectionsCorrect/Q3213763_Regions_over075.jpg} \hfill
\caption{Successful examples using our \MILSCV{} detection scheme. We only show boxes whose scores are over 0.75.}
\label{fig:NotreBaseSuccesful}
\end{figure}
\begin{figure}
\centering
\hfill
\includegraphics[height=2.55cm]{im/Failures/Q153441_Regions_over075.jpg} \hfill \includegraphics[height=2.55cm]{im/Failures/Q1984131_Regions_over075.jpg} \hfill
%
\includegraphics[height=2.55cm]{im/Failures/Q3947943_Regions_over075.jpg} \hfill
\includegraphics[height=2.55cm]{im/Failures/Q3842537_Regions_over075.jpg} \hfill
\includegraphics[height=2.55cm]{im/Failures/Q3947949_Regions_over075.jpg} \hfill
%
\caption{Failure examples using our \MILSCV{} detection scheme. We only show boxes whose scores are over 0.75.}
\label{fig:Failures}
\end{figure}
%
%
%
%
%
%
%
%
%
\section{Conclusion}
Results from this paper confirm that transfer learning is of great interest to analyse artworks databases. This was previously shown for classification and fully supervised detection schemes, and was here investigated in the case of weakly supervised detection. We believe that this framework is particularly suited to develop tools helping art historians, because it avoids tedious annotations and opens the way to learning on large datasets. We also show, in this context, experiments dealing with iconographic elements that are specific to Art History and cannot be learnt on natural images.
In future works, we plan to use localisation refinement methods, to further study how to avoid poor local optima in the optimisation procedure, to add contextual information for little objects, and possibly to fine-tune the network (as in \cite{durand_wildcat_2017}) to learn better features on artworks. Another exciting direction is to investigate the potential of weakly supervised learning on large databases with image-level annotations, such as the ones from the Rijkmuseum \cite{rijksmuseum_online_2018} or the French Museum consortium \cite{rmn_online}.
{\noindent \bf Acknowledgements.}
This work is supported by the "IDI 2017" project funded by the IDEX Paris-Saclay, ANR-11-IDEX-0003-02.
\clearpage
\bibliographystyle{splncs04}
| {'timestamp': '2018-10-08T02:08:12', 'yymm': '1810', 'arxiv_id': '1810.02569', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02569'} | arxiv |
\section{Introduction}
Haze is a common atmospheric phenomena produced by small floating particles such as dust and smoke in the air. These floating particles absorb and scatter the light greatly, resulting in degradations on image quality. Under severe hazy conditions, many practical applications such as video surveillance, remote sensing, autonomous driving etc are easily put in jeopardy, as shown in Figure~\ref{fig:hazyexample}. High-level computer vision tasks like detection and recognition are hardly to be completed. Therefore, image dehazing (a.k.a haze removal) becomes an increasingly desirable technique.
\begin{figure}[!h]
\centering
\includegraphics[width=0.8\textwidth]{hazyimage}
\caption{Examples of realistic hazy images}
\label{fig:hazyexample}
\end{figure}
Being an ill-posed restoration problem, image dehazing is a very challenging task. Similar to other ill-posed problem like super-resolution, earlier image dehazing methods assumed the availability of multiple images from the same scene. However, in practical settings, dehazing from single image is more realistic and gains more dominant popularity\cite{Fattal2008}. Therefore, in this paper, we focus on the problem of single image dehazing.
Most state-of-the-art single image dehazing methods\cite{DCP:hekaiming2011}\cite{colorprior:dehaze}\cite{Menggaofeng2013}\cite{Codruta2013}\cite{NLD2016:dehaze}\cite{DehazeNet}\cite{mscnn:dehaze} are based on a classic atmospheric scattering model\cite{scattermodel1978} which is formulated as following Equation \ref{eq:scattemodel}:
\begin{equation}
\label{eq:scattemodel}
I\left( x \right) = J\left( x \right)t\left( x \right) + A \cdot \left( {1 - t\left( x \right)} \right)
\end{equation}
where, $I\left( x \right)$ is the observed hazy image, $J\left( x \right)$ is the clear image. $t\left( x \right)$ is called medium transmission function. $A$ is the global atmospheric light. $x$ represents pixel locations.
The physical model explained the degradations of a hazy image. The medium transmission function $t\left( x \right) = {e^{ - \beta \cdot d\left( x \right)}}$ is a distance dependent factor that reflects the fraction of light reaching camera sensor. The atmospheric light $A$ indicates the intensity of ambient light. It is not difficult to find that haze essentially brings in non-uniform, signal-dependent noise, as the scene attenuation caused by haze is correlated with the physical distance between object's surface and the camera.
Apart from a few works that focused on estimating the atmospheric light\cite{atomLight1:2014}, most of popular algorithms concentrate more on accurately estimation of transmission function $t\left( x \right)$ with either prior knowledge or data-driven learning. Based on the estimated $\hat t\left( x \right)$ and $\hat A$, the clear image $\hat J$ is then recovered by using following Equation~\ref{eq:recover} .
\begin{equation}
\label{eq:recover}
J\left( x \right) = \frac{{I\left( x \right) - \hat A \cdot \left( {1 - \hat t\left( x \right)} \right)}}{{\hat t\left( x \right)}} = \frac{1}{{\hat t\left( x \right)}}I\left( x \right) - \frac{{\hat A}}{{\hat t\left( x \right)}} + \hat A
\end{equation}
Though tremendous improvements have been made, as we know, the traditional separate pipeline does not directly measure the objective reconstruction errors. The inaccuracies resulted from both transmission function and atmospheric light estimation would potentially amplify each other and hinder the overall dehazing performance.
The recently proposed AOD-Net\cite{ADONet2017} was the first end-to-end trainable image dehazing model. It reformulated a new atmospheric scattering model from the classic one by leveraging a linear transformation to integrate both the transmission function and the atmospheric light into an unified map $K\left( x \right)$, as shown in Equation~\ref{eq:reformua}.
\begin{equation}
\label{eq:reformua}
J\left( x \right) = K\left( x \right)I\left( x \right) - K\left( x \right) + b
\end{equation}
where the $K\left( x \right)$ was an input-dependent transmission function. A light-weight CNN was built to estimate the $K\left( x \right)$ map, and jointly trained to further minimize the reconstruction error between the recovered output $J\left( x \right)$ and the ground-truth clear image.
Going deeper, we consider the general relationship between observed input $I$ and recovered output $J$ as $J\left( x \right) = \Phi \left( {I\left( x \right);\theta } \right)$, where $\Phi \left( * \right)$ represents some potential highly nonlinear transformation function whose parameters set is $\theta$. Then the relationship represented by AOD-Net could be viewed as a specific case of the general function $\Phi$.
In this paper, we argue that the formation of hazy image has complicated mechanism, and the classic atmospheric scattering model\cite{scattermodel1978} is just an elegant simplified physical model based on the assumption of single-scattering and homogeneous atmospheric medium. There potentially exists some highly nonlinear transformation between the hazy image and its haze-free ground-truth. With that in mind, instead of limitedly learning the intermediate transmission function or its reformulated one from classic scattering model as AOD-Net did, we propose to build a real complete end-to-end deep network from an observed hazy image $I$ to its recovered clear image $J$. To avoid making efforts on find "real" intermediate physical model, our strict end-to-end network pay much concerns on the qualities of dehazed output.
We employ an encoder-decoder architecture similar to the U-Net\cite{U-Net2015} to directly learn the input-adaptive restoration model $\Phi$. The encoder convolves input image into several successive spatial pyramid layers. The decoder then successively recovers image details from the encoded feature mappings. In order to make full use of input information and accurately estimate structural details, progressive feature fusions are performed on different level mappings between encoder and decoder. We evaluate our proposed network on two public image dehazing benchmarks. The experimental results have shown that our method can achieve great improvements on final restoration performance, when compared with several state-of-the-art methods.
The contributions of this paper are two-fold:\\
\begin{itemize}
\item We have proposed an effective trainable U-Net like end-to-end network for image dehazing. The encoder-decoder architecture via progressive feature fusion directly learns the input-adaptive restoration model. The essential formulation mechanism of a hazy image is taken as "black box", and efforts are made on restoring the final high quality, clear output. At this viewpoint, our proposed network is in a real sense the first end-to-end deep learning based image dehazing model.
\item Our proposed network can directly process ultra high-definition realistic hazed image up to 4K resolution with superior restoration performance at a reasonable speed and memory usage. Many popular deep learning based image dehazing network can not afford image of such high resolution on a single TITAN X GPU. We owe our advantage to the effective encoder-decoder architecture.
\end{itemize}
\section{Related work}
Single image dehazing is a very challenging ill-posed problem. In the past, various prior-based and learning-based methods have been developed to solve the problem. On basis of the classic atmospheric scattering model proposed by Cantor\cite{scattermodel1978}, most of image dehazing methods followed a three-step pipeline: (a) estimating transmission map $t\left(x\right)$; (b) estimating global atmospheric light $A$; (c) recovering the clear image $J$ via computing Equation~\ref{eq:recover}. In this section, we would focus on some representative methods. More related works can be referred to surveys~\cite{review1:zidonghuaxuebao}\cite{review2:IEEEAccess}\cite{Youshaodi2017}.
A milestone work was the effective dark channel prior (DCP) proposed by He Kaiming et al.\cite{DCP:hekaiming2011} for outdoor images. They discovered that the local minimum of the dark channel of a haze-free image was close to zero. Base on the prior, transmission map could be reliably calculated. Zhu et al\cite{colorprior:dehaze} proposed a color attenuation prior by observing that the concentration of the haze was positively correlated with the difference between the brightness and the saturation. They created a linear model of scene depth for the hazy image. Based the recovered depth information, a transmission map was well estimated for haze removal. Dana et al\cite{NLD2016:dehaze} proposed a non-local prior that colors of a haze-free image could be well approximated by a few hundred distinct color clusters in RGB space. On assumption that each of these color clusters became a line in the presence of haze, they recovered both the distance map and the haze-free image.
With the success of convolutional neural network in computer vision area, several recent dehazing algorithms directly learn transmission map $t\left(x\right)$ fully from data, in order to avoid inaccurate estimation of physical parameters from a single image. Cai et al. \cite{DehazeNet} proposed a DehazeNet, an end-to-end CNN network for estimating the transmission with a novel BReLU unit. Ren et al. \cite{mscnn:dehaze} proposed a multi-scale deep neural network to estimate the transmission map. The recent AOD-Net\cite{ADONet2017} introduced a newly defined transmission variable to integrate both classic transmission map and atmospheric light. As AOD-Net needed learn the new intermediate transmission map, it still fell into a physical model. The latest proposed Gated Fusion Network(GFN)\cite{GFN2018:dehaze} learned confidence maps to combine several derived input images into a single one by keeping only the most significant features of them. We should note that, for GFN, handcrafted inputs were needed to be specifically derived for fusion and intermediate confidence maps were needed to be estimated. In contrast, our proposed network directly learns the transformation from input hazy image to output dehazed image, needn't learning any specific intermediate maps.
\section{Progressive Feature Fusion Network (PFFNet) for Image Dehazing}
In this section, we will describe our proposed end-to-end image dehazing network in details. The architecture of our progressive feature fusion network is illustrated in Figure~\ref{fig:PFFNet}. It consists of three modules: encoder, feature transformation and decoder.
\begin{figure}
\centering
\includegraphics[width=\textwidth]{PFFNet}
\caption{The architecture of the progressive feature fusion network for image dehazing}
\label{fig:PFFNet}
\end{figure}
The encoder module consists of five convolution layers, each of which is followed by a nonlinear ReLU activation. For the convenience of description, we denote the $i$-{th} "conv+relu" layer as $Conv_{en}^i, i = \left\{ {0,1,2,3,4} \right\}$. The first layer $Conv_{en}^0$ is for aggregating informative features on a relatively large local receptive field from original observed hazy image $I$. The following four layers then sequentially perform down-sampling convolutional operations to encode image's information in pyramid scale.
\begin{equation}
{D_i} = Conv_{en}^i\left( {{D_{i - 1}}} \right),i = \left\{ {0,1,2,3,4} \right\},{\rm{where, }}{D_{ - 1}} = I
\end{equation}
We denote $k_i, s_i, c_i$ as the receptive field size, step size, and output channels of layer $Conv_{en}^i$ respectively.
In this paper, empirically, for $conv_{en}^0$, we set $k_0=11, s_0=1, c_i=16$. Consequently, the corresponding output $D_0$ keeps the same spatial size as input $I$. For $conv_{en}^i,i=\left\{ {1,2,3,4} \right\}$ layers, we keep their receptive field size and step size the same. And each one learns feature mappings with double channels more than its previous layer. The super-parameters are set $k_i=3, s_i=2, {c_i} = 2{c_{i - 1}},i = \left\{ {1,2,3,4} \right\}$. As a result, we can easily calculate that if the size of input hazy image is $w \times h \times c$, the size of the output of encoder $D_4$ is consequently ${\textstyle{1 \over {16}}}w \times {\textstyle{1 \over {16}}}h \times 256$, where $w,h,c$ are image width, image height, image channels in respective.
That means if an input image is with 4K resolution level, the resulted feature map is with 256 spatial resolution level after encoder module, which benefits greatly the following processing stages for reducing memory usage.
The feature transformation module denoted as $\Psi\left(*\right)$ consists of residual based subnetworks. As we know, the main benefit of a very deep network is that it can represent very complex functions and also learn features at many different levels of abstraction. However, traditional deep networks often suffer gradient vanish or expansion disaster. The popular residual networks \cite{resnet:2016}\cite{wideresnet:2016} explicitly reformulated network layers as learning residual functions with reference to the layer inputs, instead of learning unreferenced functions. It allows training much deeper networks than were previously practically feasible. Therefore, to balance between computation efficiency and GPU memory usage, in this module, we empirically employed eighteen wide residual blocks for feature learning.
Let $B\left(M\right)$ denotes the structure of a residual block, where $M$ lists the kernel sizes of the convolutional layers in a block. In this paper, we accept $B\left(3,3\right)$ as the basic residual block, as shown in the left part of Figure~\ref{fig:PFFNet}. The channels of convolution layer are all 256, which are the same as the channels of the feature map $D_4$ from encoder module. The step size is constantly kept to be 1.
The decoder module consists of four deconvolution layers followed by a convolution layer. In opposite to encoder, the deconvolution layers of decoder are sequentially to recover image structural details. Similarly, we denote the $j$-{th} "relu+deconv" layer as $DeConv_{dec}^j,j = \left\{ {4,3,2,1} \right\}$.
\begin{equation}
{F_{j - 1}} = DeConv_{dec}^j\left( {{U_j}} \right),j = \left\{ {4,3,2,1} \right\}
\end{equation}
where, $U_j$ is an intermediate feature map.
Through deconvolution (a.k.a transposed) layer, the $DeConv_{dec}^j$ performs up-sample operations to obtain intermediate feature mappings with double spatial size and half channels than its previous counterpart. Concretely, the receptive field size, step size and output channels are set $k_j=3, s_j=2, {c_{j - 1}} = {\textstyle{1 \over 2}}{c_j}, j = \left\{ {4,3,2,1} \right\}$. It is not difficult to find that, in our network setting, the output map $F_{j}$ from $DeConv_{dec}^j$ enjoys the same feature dimensions as corresponding input $D_i$ of $Conv_{en}^i$ has, when $i=j \in \left\{ {3,2,1,0} \right\}$.
In order to maximize information flow along multi-level layers and guarantee better convergence, skip connections are employed between corresponding layers of different level from encoder and decoder. A global shortcut connection is applied between input and output of the feature transformation module, as shown in Figure~\ref{fig:PFFNet}.
\begin{equation}
\begin{array}{l}
{U_i} = {D_i} \oplus {F_i},i = \left\{ {3,2,1,0} \right\}\\
{U_4} = {D_4} \oplus {\mathop{\Psi}\nolimits} \left( {{D_4}} \right)
\end{array}
\end{equation}
where $\oplus$ is an channel-wise addition operator.
The dimension of the transposed feature map $U_0$ is therefore $w \times h \times 16$, as the same as $D_0$. A convolution operation is further applied on $U_0$, and generates the final recovered clear image $J$. Herein, for this convolution layer, the kernel size $k$ is 3; the step size is 1; and the channels is the same as $J$.
The proposed image dehazing network progressively performs feature fusion on spatial pyramid mappings between encoder and decoder, which enables maximally preserved structural details from inputs for deconvolution layers, and further makes the dehazing network more input-adaptive.
\section{Experiments}
\subsection{Dataset}
We evaluate the effectiveness of our proposed method on two public dehazing benchmarks. The source code is available on GitHub\footnote{source code: \url{https://github.com/MKFMIKU/PFFNet}}.
\subsubsection{NTIRE2018 Image Dehazing Dataset} The dataset was distributed by NTIRE 2018 Challenge on image dehazing\cite{NTIRE2018}. Two novel subsets (I-HAZE\cite{I-HAZE} and O-HAZE\cite{O-HAZE}) with real haze and their ground-truth haze-free images were included. Hazy images were both captured in presence of real haze generated by professional haze machines. The I-HAZE dataset contains 35 scenes that correspond to indoor domestic environments, with objects of different colors and speculates. The O-HAZE contains 45 different outdoor scenes depicting the same visual content recorded in haze-free and hazy conditions, under the same illumination parameters. All images are ultra high definition images on 4K resolution level.
\subsubsection{RESIDE\cite{RESIDE:2018}} The REISDE is a large scale synthetic hazy image dataset. The training set contains 13990 synthetic hazy images generated by using images from existing indoor depth datasets such as NYU2\cite{NYU2012} and Middlebury\cite{Middlebury2003}. Specifically, given a clear image $J$, random atmospheric lights $A \in \left[ {0.7,1.0} \right]$ for each channel, and the corresponding ground-truth depth map $d$, function $t\left( x \right) = {e^{ - \beta \cdot d\left( x \right)}}$ is applied to synthesize transmission map first, then a hazy image is generated by using the physical model in Equation~(\ref{eq:scattemodel}) with randomly selected scattering coefficient $\beta \in \left[ {0.6,1.8} \right]$. In RESIDE dataset, images are on ${\rm{620}} \times {\rm{460}}$ resolution level.
The \emph{Synthetic Objective Testing Set} (SOTS) of RESIDE is used as our test dataset. The SOTS contains 500 indoor images from NYU2\cite{NYU2012} (non-overlapping with training images), and follows the same process as training data to synthesize hazy images.
\subsection{Comparisons and Analysis}
Several representative state-of-the-art methods are compared in our experiment: Dark-Channel Prior (DCP)\cite{DCP:hekaiming2011}, Color Attenuation Prior (CAP)\cite{colorprior:dehaze}, Non-Local Dehazing(NLD)\cite{NLD2016:dehaze}, DehazeNet\cite{DehazeNet}, Multi-scale CNN(MSCNN)\cite{mscnn:dehaze}, AOD-Net\cite{ADONet2017}, and Gated Fusion Network(GFN)\cite{GFN2018:dehaze}. The popular full-reference PSNR and SSIM metrics are accepted to evaluate the dehazing performance.
\subsubsection{Training details} As our PFF-Net was initially proposed to take part in the NTIRE2018 challenge on image dehazing, the GPU memory usage of our network is efficient so that we can directly recover an ultra high definition realistic hazy image on 4K resolution level on a single TITAN X GPU.
In this paper, we train our network both on I-HAZE and O-HAZE training images, which has 80 scenes in all. Based on these scenes, we further perform data augmentation for training. We first use sliding window to extract image crops of $520 \times 520$ size from the realistic hazy images. The stride is 260 pixels. For each image crop, we obtain its 12 variants at four angles $\left\{ {0,\frac{\pi }{2},\pi ,\frac{3}{2}\pi } \right\}$ and three mirror flip cases $\left\{ No Flip, Horizontal Flip, Vertical Flip\right \}$. In consequence, about 190K patches are augmented as the training dataset.
The ADAM\cite{Adam2015} is used as the optimizer. The initial learning rate we set is $\eta = 0.0001$, and kept a constant during training. Mean Square Errors (MSE) between recovered clear image and haze-free ground-truth is taken as our objective loss. The batch-size is 32. During training, we recorded every 2000 iterations as an epoch and the total num of training epoches is empirically 72 in practice. The testing curve on PSNR performance is shown in Figure~\ref{fig:traincurve}. We found that the network started to converge at the last 10 epoches.
\begin{figure}
\begin{center}
\begin{tabular}{cc}
\includegraphics[width=0.48\textwidth]{comparisons/NTIRE-TestingCurve} &
\includegraphics[width=0.48\textwidth]{comparisons/RESIDE-TestingCurve} \\
NTIRE2018 & RESIDE\\
\end{tabular}
\caption{The testing curves of our proposed PFF-Net on NTIRE2018 (\emph{Left}) and RESIDE (\emph{Right}). In both sub-figures, the horizontal axis shows training epoches. The vertical axis shows PSNR performance tested on training model at corresponding epoch.}
\label{fig:traincurve}
\end{center}
\end{figure}
\subsubsection{Ablation parameter comparisons on networks settings} Before fixing the architecture of our PFFNet in this paper, we have done several ablation experiments on parematers setting. We have experimented four different blocks sizes in feature transformation module: $\{6, 12, 18, 24\}$. The testing performances are shown in following Figure~\ref{fig:ablation}-Left. Increasing the size of residual blocks would improve the testing performance. By considering the balance between the performance and the available computing resources, we finally adopted the feature transformation module with 18 residual blocks in this paper.
We have also compared the performance of networks with / without skip connections between encoder module and encoder module. The comparisons was experimented through training our network with 12 residual blocks in feature transformation module. In terms of the speed of convergence and the performance, network without skip connections is much worse than network with skip connections, as shown in Figure~\ref{fig:ablation}-Right. The conclusion is consistent with observations in many residual based learning models and also validates the necessaries of progressive feature fusion between encoder and decoder stages.
\begin{figure}
\centering
\begin{tabular}{cc}
\includegraphics[width=0.48\textwidth]{comparisons/psnrplot} &
\includegraphics[width=0.48\textwidth]{comparisons/nscpsnrplot}
\end{tabular}
\caption{\textbf{\emph{Left:}} The testing performance comparisons on NTIRE2018 outdoor scenes in different block size cases.
\textbf{\emph{Right:}} The testing performance comparisons of network with/without skip connection between encoder and decoder module on NTIRE2018 outdoor scenes. The "12\_resblock" represents network with skip connections; "nsc\_resblock" represents network without skip connections. The network is trained about 40 epoches.}
\label{fig:ablation}
\end{figure}
\subsubsection{Experiment results}
We have taken part in the NTIRE2018 challenge on image dehazing based on the proposed network. In the final testing phase, our network has achieved top 6 ranking out of 21 teams on I-HAZE track without using any data from O-HAZE and won the NTIRE 2018 honorable mentioned award. It should be noted that our network is very straight-forward and we haven't applied any specific training trick to further boost performance during training period and we haven't re-trained our model for O-HAZE track at that submission time.
Compared with other top methods in NTIRE Dehazing Challenge, our proposed network has several distinguished differences: (1) Most of other top methods use denseblock in their networks while we just use simple residual block then. Empirically, denseblock has better learning power and will have much potentials to boost output performance. (2) Multi-scale or multi-direction ensemble inferences at testing stage are used in some top methods to achieve better performance. In contrary, we haven't applied this tricky strategy. We just use the single output for testing. Using ensemble inference strategy empirically has great potentials to achieve better performance. (3) The last is not the least. As the images used in NTIRE Dehazing Challenge are very large with 4K high-resolution, all these top methods use patch based training strategy without taking entire image as input. Their network can not afford such large image. In contrary, our proposed network can directly process the ultra high-definition realistic hazed image up to 4K resolution with superior restoration performance at a reasonable speed and memory usage.
Several dehazed examples on realistic images from NTIRE2018 are shown in Figure~\ref{fig:Indoor} and Figure~\ref{fig:Outdoor}. All these images are at 4K resolution level which most current dehazed model cannot afford. Though challenging these examples are, our network still can obtain relatively satisfactory dehazed results with natural color saturation and acceptable perceptual quality.
With the aim to compare with state-of-the-art methods, we evaluate our method on the commonly referred public benchmark. We first pre-train our network on DIV2K\cite{timofte2017ntire}, then fine-tune the pre-trained network on RESIDE training data without data augmentation. The training curve of fine-tuning process on RESIDE is shown in Figure~\ref{fig:traincurve}. After about 8 epoches, the network begins to converge.
\begin{figure}
\centering
\includegraphics[width=0.9\textwidth]{I-HAZE}
\caption{Several challenging realistic dehazed examples from I-HAZE by using PFF-Net}
\label{fig:Indoor}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=0.9\textwidth]{O-HAZE}
\caption{Several challenging realistic dehazed examples from O-HAZE by using PFF-Net}
\label{fig:Outdoor}
\end{figure}
We evaluate the performance of our network on the SOTS. The comparison results on SOTS are shown in Table~\ref{tab:sots}. From the experimental comparisons, it has been demonstrated that our proposed network outperforms the current state-of-the-art methods, and achieves superior performance with great improvements.
\begin{table}[h]
\small
\centering
\caption{The dehazing performance evaluated on SOTS of RESIDE}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|}
\hline
& DCP & CAP & NLD &DehazeNet & MSCNN & AOD-Net & GFN & PFF-Net(ours)\\
\hline
PSNR & 16.62 & 19.05 & 17.29 & 21.14 & 17.57 & 19.06 & 22.30 & \textbf{24.78} \\
\hline
SSIM & 0.8179 & 0.8364 & 0.7489 & 0.8472 & 0.8102 & 0.8504 & 0.88 &\textbf{0.8923} \\
\hline
\end{tabular}
\label{tab:sots}
\end{table}
Some qualitative comparisons on real-world hazy image are further shown in Figure~\ref{fig:realisticcomparisons}. These collected hazy images are at resolution around $500\times600$ pixels and captured from natural environment, best viewed on high-resolution display. As shown, the dehazed results from our method are clear and the details of the scenes are enhanced moderately better with natural perceptual qualities.
\begin{figure*}
\begin{center}
\begin{tabular}{ccccccccc}
\includegraphics[width=0.1\textwidth]{comparisons/1/hazy} &
\includegraphics[width=0.1\textwidth]{comparisons/1/DCP} &
\includegraphics[width=0.1\textwidth]{comparisons/1/CAP} &
\includegraphics[width=0.1\textwidth]{comparisons/1/NLD} &
\includegraphics[width=0.1\textwidth]{comparisons/1/DehazeNet} &
\includegraphics[width=0.1\textwidth]{comparisons/1/MSCNN} &
\includegraphics[width=0.1\textwidth]{comparisons/1/AOD-Net} &
\includegraphics[width=0.1\textwidth]{comparisons/1/gfn} &
\includegraphics[width=0.1\textwidth]{comparisons/1/pffnet} \\
\includegraphics[width=0.1\textwidth]{comparisons/2/hazy} &
\includegraphics[width=0.1\textwidth]{comparisons/2/DCP} &
\includegraphics[width=0.1\textwidth]{comparisons/2/CAP} &
\includegraphics[width=0.1\textwidth]{comparisons/2/NLD} &
\includegraphics[width=0.1\textwidth]{comparisons/2/DehazeNet} &
\includegraphics[width=0.1\textwidth]{comparisons/2/MSCNN} &
\includegraphics[width=0.1\textwidth]{comparisons/2/AOD-Net} &
\includegraphics[width=0.1\textwidth]{comparisons/2/gfn} &
\includegraphics[width=0.1\textwidth]{comparisons/2/pffnet} \\
\includegraphics[width=0.1\textwidth]{comparisons/3/hazy} &
\includegraphics[width=0.1\textwidth]{comparisons/3/DCP} &
\includegraphics[width=0.1\textwidth]{comparisons/3/CAP} &
\includegraphics[width=0.1\textwidth]{comparisons/3/NLD} &
\includegraphics[width=0.1\textwidth]{comparisons/3/DehazeNet} &
\includegraphics[width=0.1\textwidth]{comparisons/3/MSCNN} &
\includegraphics[width=0.1\textwidth]{comparisons/3/AOD-Net} &
\includegraphics[width=0.1\textwidth]{comparisons/3/gfn} &
\includegraphics[width=0.1\textwidth]{comparisons/3/pffnet} \\
\includegraphics[width=0.1\textwidth]{comparisons/4/hazy} &
\includegraphics[width=0.1\textwidth]{comparisons/4/DCP} &
\includegraphics[width=0.1\textwidth]{comparisons/4/CAP} &
\includegraphics[width=0.1\textwidth]{comparisons/4/NLD} &
\includegraphics[width=0.1\textwidth]{comparisons/4/DehazeNet} &
\includegraphics[width=0.1\textwidth]{comparisons/4/MSCNN} &
\includegraphics[width=0.1\textwidth]{comparisons/4/AOD-Net} &
\includegraphics[width=0.1\textwidth]{comparisons/4/gfn} &
\includegraphics[width=0.1\textwidth]{comparisons/4/pffnet} \\
\includegraphics[width=0.1\textwidth]{comparisons/5/hazy} &
\includegraphics[width=0.1\textwidth]{comparisons/5/DCP} &
\includegraphics[width=0.1\textwidth]{comparisons/5/CAP} &
\includegraphics[width=0.1\textwidth]{comparisons/5/NLD} &
\includegraphics[width=0.1\textwidth]{comparisons/5/DehazeNet} &
\includegraphics[width=0.1\textwidth]{comparisons/5/MSCNN} &
\includegraphics[width=0.1\textwidth]{comparisons/5/AOD-Net} &
\includegraphics[width=0.1\textwidth]{comparisons/5/gfn} &
\includegraphics[width=0.1\textwidth]{comparisons/5/pffnet} \\
\includegraphics[width=0.1\textwidth]{comparisons/6/hazy} &
\includegraphics[width=0.1\textwidth]{comparisons/6/DCP} &
\includegraphics[width=0.1\textwidth]{comparisons/6/CAP} &
\includegraphics[width=0.1\textwidth]{comparisons/6/NLD} &
\includegraphics[width=0.1\textwidth]{comparisons/6/DehazeNet} &
\includegraphics[width=0.1\textwidth]{comparisons/6/MSCNN} &
\includegraphics[width=0.1\textwidth]{comparisons/6/AOD-Net} &
\includegraphics[width=0.1\textwidth]{comparisons/6/gfn} &
\includegraphics[width=0.1\textwidth]{comparisons/6/pffnet} \\
\multirow{2}{*}{\begin{tabular}{c} Hazy \\ Image \end{tabular}} & DCP & CAP & NLD & DehazeNet & MSCNN & AOD-Net & GFN & PFF-Net \\
\end{tabular}
\end{center}
\caption{Comparisons with state-of-the-art methods on some real-world hazy images.}
\label{fig:realisticcomparisons}
\end{figure*}
\section{Conclusion}
In this paper, we have proposed an effective trainable U-Net like end-to-end network for image dehazing. Progressive feature fusions are employed to learn input adaptive restoration model. Owing to the proposed U-Net like encoder-decoder architecture, our dehazing network has efficient memory usage and can directly recover ultra high definition hazed image up to 4K resolution. We evaluate our proposed network on two public dehazing benchmarks. The experimental results demonstrate that our network can achieve superior performance with great improvements when compared with several popular state-of-the-art methods.
\section*{Acknowledgment}
This work was supported by National Natural Science Foundation of China (Grant No. 61365002 and 61462045) and Provincial Natural Science Foundation of Jiangxi (Grant No. 20181BAB202013).
| {'timestamp': '2018-10-05T02:13:35', 'yymm': '1810', 'arxiv_id': '1810.02283', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02283'} | arxiv |
\section{Related Works}
\label{sec:related_works}
The standard VQA evaluation assumes identically distributed train and test set~\cite{antol2015vqa, malinowski2014multi, zhu2016visual7w}.
As this evaluation setting turns out to be vulnerable to models exploiting biases in training set~\cite{goyal2017making}, several alternatives have been proposed.
One approach is to reduce observed biases either by balancing answers for individual questions~\cite{goyal2017making} or by providing different biases to train and test sets intentionally~\cite{agrawal2017don}.
Another approach is to construct compositional generalization split~\cite{agrawal2017c, johnson2017clevr} whose question and answer pairs in test set are formed by novel compositions of visual concepts and question types appearing in the training set.
This split is constructed by repurposing an existing VQA dataset~\cite{agrawal2017c} or by constructing a synthetic dataset~\cite{johnson2017clevr}.
The problem setting studied in this paper is similar to \cite{kafle2018dvqa, teney2016zero} in the sense that out-of-vocabulary answers are used for testing, but unlike the prior work, we formulate the problem as a transfer learning, where out-of-vocabulary answers are learned from external visual data.
External data are often employed in VQA for better generalization.
Convolutional neural networks~\cite{he2016deep, krizhevsky2012imagenet} pretrained on ImageNet~\cite{Imagenet} is a widely accepted standard for diverse VQA models~\cite{fukui2016multimodal, yang2016stacked}.
As an alternative, object detector~\cite{ren2015faster} trained on the Visual Genome dataset~\cite{krishna2017visual} is employed to extract pretrained visual features~\cite{anderson2017updown}.
Pretrained language models such as word embeddings~\cite{pennington2014glove} or sentence embeddings~\cite{kiros2015skip} are frequently used to initialize parameters of question encoders~\cite{fukui2016multimodal, noh2016image, teney2017tips}.
Exploiting information retrieval from knowledge base~\cite{auer2007dbpedia,bollacker2008freebase} or external vision algorithms~\cite{wang2017vqa} to provide additional inputs to VQA models are investigated in~\cite{wang2017fvqa, wang2017vqa, wu2016ask}.
Transfer between VQA datasets is studied in~\cite{hu2018learning}.
Sharing aligned image-word representations between VQA models and image classifiers has been proposed in~\cite{gupta2017aligned} to exploit external visual data.
Transfer learning from external data to cope with out-of-vocabulary words has hardly been studied in VQA, but is actively investigated in novel object captioning~\cite{hendricks2016deep, lu2018neural, venugopalan2017captioning, yao2017incorporating}.
For example, \cite{hendricks2016deep} and \cite{venugopalan2017captioning} decompose image captioning task into visual classification and language modeling, and exploit unpaired visual and linguistic data as additional resources to train visual classifier and language model, respectively.
Recent approaches incorporate pointer networks~\cite{vinyals2015pointer} and learn to point an index of word candidates~\cite{yao2017incorporating} or an associated region~\cite{lu2018neural}, where the word candidates are detected by a multi-label classifier~\cite{yao2017incorporating} or an object detector~\cite{lu2018neural} trained with external visual data.
However, these algorithms are not directly applicable to our problem setting because they focus on predicting object words without task specification while the task conditional visual recognition is required for VQA.
Our problem setting is closely related to zero-shot learning~\cite{frome2013devise, huang2015learning, lampert2014attribute, larochelle2008zero, xian2017zero}, where out of vocabulary answers are considered in classification.
Zero-shot learning aims to recognize objects or classes that are unseen during training.
As it aims generalization to completely unseen classes, any exposure to zero-shot classes during training is strictly prohibited~\cite{xian2017zero}.
On the contrary, our goal is to exploit class labels available in external dataset.
\iffalse
\hyeonwoo{TODO: add related works on zero-shot learning. Must cite \cite{xian2017zero} Let's emphasize that our work has different motivation and put different emphasis, result in different evaluations .. justify..}
\fi
\section{Transfer Learning Framework}
\label{sec:algorithm_overview}
The main goal of our work is to handle out-of-vocabulary answers in VQA by learning visual concepts from off-the-shelf visual dataset and transfering the concepts to VQA for answering the questions.
Inspired by the fact that VQA can be thought of as a task conditional classification problem, where tasks are defined by questions, we introduce a task conditional visual classifier, which generates an answer from a visual input and a task specification, as a medium for learning and transfering visual concepts.
Figure~\ref{fig:overview} illustrates the overall framework of the proposed approach.
We pretrain the task conditional visual classifier using visual dataset without questions or task specifications via unsupervised task discovery, and adapt it to VQA models by transferring the learned parameters.
We describe the task conditional visual classifier and how it is pretrained and transferred to VQA in the rest of this section.
\subsection{Task conditional visual classifier}
\label{subsec:taskcondtionalclassifier}
Task conditional visual classifier is a function taking a visual feature $v \in \mathbb{R}^d$ and a task feature $\tau \in \mathbb{R}^k$ and producing a probability distribution of answers or labels $\mathbf{a}\in [0, 1]^{l}$, where the terms answer and label are used interchangeably based on context hereafter.
The classifier formulated as a neural network with parameter $\theta$ models a conditional distribution $\text{p}_\theta(\mathbf{a} | v, \tau)$.
Note that two inputs $v$ and $\tau$ are typically obtained by encoders $v_\phi(\cdot)$ and $\tau_\eta(\cdot)$.
In the proposed transfer learning scenario, a task conditional visual classifier is pretrained with off-the-shelf visual dataset, \eg, Visual Genome~\cite{krishna2017visual}, and transfered to VQA.
In the pretraining stage, the parameters of the classifier and two feature encoders $\theta$, $\phi_\text{pre}$ and $\eta_\text{pre}$ are jointly learned.
This stage allows the task conditional visual classifier to handle diverse visual recognition tasks by learning the task feature $\tau$.
Transfer learning to VQA is achieved by reusing parameter $\theta$ and adapting new encoders $v_{\phi_\text{vqa}}(\cdot)$ and $\tau_{\eta_\text{vqa}}(\cdot)$ to the learned task conditional visual classifier.
\begin{figure}[t]
\centering
\includegraphics[width=0.98\linewidth] {figures/unsupervised_task_discovery.png}
\vspace{0.05cm}
\caption{
\textbf{Unsupervised task discovery with two different linguistic knowledge sources.} (a) For visual description, task specification is generated by replacing a visual word (label) from the description into a blank. (b) For WordNet, task specification is a synset from one of the labels hypernyms. We use {\em inverted wordset} to sample a synset from an input label.
See Section~\ref{sec:task_discovery} for details.
}
\label{fig:unsupervised_task_discovery}
\vspace{-0.2cm}
\end{figure}
\begin{figure*}[t]
\centering{
\begin{minipage}[t]{0.245\linewidth}
\includegraphics[width=0.99\linewidth] {figures/example_wordnet_notitle.jpg}
\end{minipage}
\begin{minipage}[t]{0.72\linewidth}
\raisebox{0.9\height}{
\small
\begin{tabular}
{
@{}C{2.2cm}@{} | @{}L{10.4cm}@{}
}
\hline
task $\mathbf{t}_w$ & word groups \vspace{0.02cm} \\
\hline
\vspace{0.02cm}
appliance.n.02 & freezer, hair dryer, refrigerator, fridge, oven, dishwasher, washing machine, ... \vspace{0.02cm}\\
opening.n.10 & manhole, rear window, exit, nozzle, car window, coin slot, spout, vent, ... \vspace{0.02cm}\\
food.n.02 & potatoes, french fries, chicken, melted cheese, tomatoes, sausage, vegetable, ... \vspace{0.02cm}\\
move.v.03 & twisted, ruffled, curving, curved, wheeled, rolled, coiled, turned, rippled, ... \vspace{0.02cm}\\
act.n.02 & fishing, skateboarding, sailing, playing baseball, surfing, traveling, driving, ... \vspace{0.02cm}\\
area.n.01 & middle, in corner, center, parking space, playground, landscape, neighborhood, ...\vspace{0.02cm}\\
color.n.01 & yellow, pink, red, beige, royal blue, amber, aqua, dark red, olive green, teal, ... \vspace{0.02cm}\\
\hline
\end{tabular}
}
\end{minipage}
}
\vspace{0.1cm}
\caption{
\textbf{Illustration of WordNet and constructed word group table.}
(Left) A subgraph of the WordNet~\cite{fellbaum1998wordnet}.
Complex hierarchy of words reveals the diverse categorization of each words.
(Right) A set of words sharing common parents in the tree is grouped as a single word group. Diverse grouping of words reveals diverse visual recognition tasks that can be defined on each word group.
}
\vspace{-0.3cm}
\label{fig:wordset_examples}
\end{figure*}
\subsection{Pretraining}
\label{subsec:pretraining}
Learning the task conditional visual classifier is naturally formulated as the problem to maximize the following expected log likelihood:
\begin{equation}
\theta^*, \phi^*_\text{pre}, \eta^*_\text{pre} =
\argmax_{\theta, \phi_\text{pre}, \eta_\text{pre}}
\mathbb{E}_{\text{p}_\mathcal{D}}
\left[ \text{log} \, \text{p}_\theta(\mathbf{a} |
v_{\phi_\text{pre}}(\mathbf{I}, \mathbf{b}),
\tau_{\eta_\text{pre}}(\mathbf{t})) \right],
\label{eq:pretrain}
\end{equation}
where $v_{\phi_\text{pre}}(\mathbf{I}, \mathbf{b})$ is a visual feature based on an image $\mathbf{I}$ and a bounding box $\mathbf{b}$, and $\tau_{\eta_\text{pre}}(\mathbf{t})$ is a task feature encoded from a task specification $\mathbf{t}$, $\mathbf{a}$ is an answer sampled from data distribution and it satisfies $\mathbf{a} \in \mathcal{A}$, and $\{ \theta, \phi_\text{pre}, \eta_\text{pre} \}$ are model parameters.
We obtain $v_{\phi_\text{pre}}(\mathbf{I}, \mathbf{b})$ using a learnable attention network parametrized by $\phi_\text{pre}$ on top of off-the-shelf feature extractor~\cite{anderson2017updown}, where the bounding box position $\mathbf{b}$ is used as a key to the attention.
The optimization in Eq.~\eqref{eq:pretrain} requires a joint distribution, $\text{p}_\mathcal{D}(\mathbf{a}, \mathbf{I}, \mathbf{b}, \mathbf{t})$, which is not accessible in the external datasets in our setting due to missing task specifications $\mathbf{t}$.
Section~\ref{sec:task_discovery} describes how to model the joint distribution $\text{p}_\mathcal{D}(\mathbf{a}, \mathbf{I}, \mathbf{b}, \mathbf{t})$ with the visual annotations and linguistic knowledge sources.
\subsection{Transfer learning for VQA}
\label{subsec:transfer_vqa}
As illustrated in Figure~\ref{fig:overview}, the proposed VQA model contains a task conditional visual classifier $\text{p}_\theta(\mathbf{a} | v, \tau)$.
The pretrained visual concepts are transferred to VQA by sharing the learned parameters $\theta$.
Then, learning a VQA model is now formulated as learning input representations $v$ and $\tau$ for $\text{p}_\theta(\mathbf{a}| v, \tau)$, which is given by
\begin{equation}
\phi_\text{vqa}^*, \eta_\text{vqa}^* = \argmax_{\phi_\text{vqa}, \eta_\text{vqa}} \mathbb{E}_{\text{p}_\text{vqa}} \left[ \log \, \text{p}_\theta(\mathbf{a}|v_{\phi_\text{vqa}}(\mathbf{I}, \mathbf{q}), \tau_{\eta_\text{vqa}}(\mathbf{q})) \right],
\label{eq:transfer}
\end{equation}
where $v_{\phi_\text{vqa}}(\mathbf{I}, \mathbf{q})$ is an encoded visual feature with an image $\mathbf{I}$ and a question $\mathbf{q}$ using an attention mechanism with parameter $\phi_\text{vqa}$ and a off-the-shelf feature extractor~\cite{anderson2017updown}.
A task feature $\tau_{\eta_\text{vqa}}(\mathbf{q})$ encodes a question $\mathbf{q}$ using parameter $\eta_\text{vqa}$.
The joint distribution of a training dataset for VQA, $\text{p}_\text{vqa}(\mathbf{a}, \mathbf{I}, \mathbf{q})$, is required for optimization, where answers from the distribution satisfy $\mathbf{a} \in \mathcal{A} - \mathcal{B}$.
We learn $\phi_\text{vqa}$ and $\eta_\text{vqa}$ by maximizing the likelihood of the objective in Eq.~\eqref{eq:transfer} while the parameter for the pretrained task conditional visual classifier $\theta$ remains fixed.
\vspace{-0.3cm}
\paragraph{Weakly supervised task regression}
Utilizing a pretrained task conditional visual classifier for the visual recognition specified by a question $\mathbf{q}$ requires to infer an optimal task feature $\tau^*_\mathbf{q}$.
This requirement introduces a learning problem---task regression---that optimizes an encoder $\tau_{\eta_\text{vqa}}(\mathbf{q})$ to predict $\tau^*_\mathbf{q}$ correctly.
Because directly minimizing error $\mathcal{E}(\tau^*_\mathbf{q}, \tau_{\eta_\text{vqa}}(\mathbf{q}))$ requires additional supervision about the tasks, we instead exploit VQA data as a source of weak supervision.
We optimize indirect loss $-\mathbb{E}_{\tau^*_\mathbf{q}(\mathbf{a}|v)}[\log \, \text{p}_\theta(\mathbf{a}|v, \tau_{\eta_\text{vqa}}(\mathbf{q}))]$, which encourages the answer distributions conditioned on $\tau^*_\mathbf{q}$ and $\tau_{\eta_\text{vqa}}(\mathbf{q})$ to be similar.
By assuming that true task conditional answer distribution $\tau^*_\mathbf{q}(\mathbf{a}|v)$ is implicitly modeled in VQA dataset, we employ Eq.~\eqref{eq:transfer} as the objective function for weakly supervised task regression.
\vspace{-0.3cm}
\paragraph{Out-of-vocabulary answering}
We learn a VQA model by adapting input representations while fixing the pretrained task conditional visual classifier $\text{p}_\theta(\mathbf{a}|v, \tau)$.
This strategy allows a model to focus on learning to infer a visual recognition task $\tau_{\eta_\text{vqa}}(\mathbf{q})$ from questions, which does not require data for all possible answers.
Once the task feature $\tau$ is inferred, the learned task conditional visual classifier $\text{p}_\theta(\mathbf{a}|v, \tau)$ can answer the pretrained visual concepts including out-of-vocabulary ones.
\vspace{-0.3cm}
\paragraph{Matching visual features}
To reuse pretrained visual classifier in VQA without fine-tuning, semantics of visual features $v$ should not change by learning with VQA dataset.
This is fulfilled in recent approaches for VQA models that do not fine-tune pretrained visual feature extractors and focus on learning attention mechanism~\cite{kim2016hadamard} over the extracted feature map.
In our setting, we simply use the identical visual feature extractor~\cite{anderson2017updown} for both pretraining and VQA.
\iffalse
\textbf{Intuition for zero-shot generalization}
Let $\mathcal{A}$ be a set of all possible answers for VQA and $\mathcal{B}$ be a subset of the answers that appear in the training set.
The proposed zero-shot VQA requires to perform a visual recognition task over $\mathcal{A}$ by learning only with $\mathcal{B}$.
This problem is challenging because learning to approximate the true visual recognition task $\text{p}_{\tau^*_\mathbf{q}}(\mathbf{a}_{\in \mathcal{B}}|v)$ with $\mathcal{B}$ usually result in degenerate solutions with randomly determined distribution for $\mathcal{A} - \mathcal{B}$ due to the lack of realistic prior.
We tackle this challenge by pre-training $\text{p}_\theta(\mathbf{a}_{\in \mathcal{A}} | v, \tau)$ to model diverse realistic distribution on $\mathcal{A}$ and adapting only the input representation.
The proposed zero-shot generalization provides a set of training answers $\mathcal{B}$
Let $\mathcal{A}$ be a set of all possible answers for VQA and $\mathcal{B}$ be a subset of the answers that appear in the training set.
The objective of the proposed zero-shot VQA is to approximate a distribution $\text{p}_{\tau^*_\mathbf{q}}(\mathbf{a}_{\in \mathcal{A}}|v)$ for all answers $\mathbf{a} \in \mathcal{A}$ by learning with $\text{p}_{\tau^*_\mathbf{q}}(\mathbf{a}_{\in \mathcal{B}}|v)$.
This problem is challenging because approximating $\text{p}_{\tau^*_\mathbf{q}}(\mathbf{a}_{\in \mathcal{B}}|v)$ from scratch usually results in many degenerate solutions that the distribution for $\text{p}_{\tau^*_\mathbf{q}}(\mathbf{a}_{\in \mathcal{A} - \mathcal{B}}|v)$ is randomly determined due to the lack of realistic prior.
We tackle this challenge by pre-training $\text{p}_\theta(\mathbf{a}_{\in \mathcal{A}} | v, \tau)$ to model diverse realistic distributions corresponding to highly probable visual recognition tasks for various choice of $\tau$.
As we formulate the transfer learning as a task regression that finds $\tau_{\eta_\text{vqa}}(\mathbf{q})$, not learning the whole distribution, resulting VQA model $\text{p}_\theta(\mathbf{a}_{\in \mathcal{A}} | v, \tau_{\eta_\text{vqa}}(\mathbf{q}))$ becomes a realistic distribution that approximates $\text{p}_{\tau^*_\mathbf{q}}(\mathbf{a}_{\in \mathcal{B}}|v)$ well and corresponds to a highly probable visual recognition task.
We believe this distribution is likely to be a $\text{p}_{\tau^*_\mathbf{q}}(\mathbf{a}_{\in \mathcal{A}}|v)$ based on the assumption that a hypothesis space of a highly probable visual recognition task that approximates $\text{p}_{\tau^*_\mathbf{q}}(\mathbf{a}_{\in \mathcal{B}}|v)$ is reasonably small.
The proposed zero-shot gener
The proposed method learns input representations while the transferred task conditional visual classifier fixed.
\fi
\section{Experiments}
\label{sec:experiments}
We evaluate how effectively the proposed framework leverages the external data without questions to answer out-of-vocabulary words in visual question answering.
We compare the proposed method with the baselines equipped with idea for zero-shot image classification~\cite{frome2013devise} and novel object captioning~\cite{hendricks2016deep, venugopalan2017captioning}, which are related to the proposed problem.
We also analyze the impact of the external data used for pretraining, and visualize the mapping between questions and task specifications learned by weakly supervised task regression.
Notably, the evaluation setting is not comparable to that from zero-shot learning literature~\cite{xian2017zero}, as our objective is not generalization to completely unseen classes, but exploiting class labels exposed in the external data.
We open-sourced all the codes and datasets used in the experiments to facilitate reproducing the result in this paper~\footnote{\footnotesize \url{https://github.com/HyeonwooNoh/vqa\_task\_discovery}}.
\subsection{Datasets}
\paragraph{Pretraining}
We learn visual concepts of most frequently observed 3,000 objects and 1,000 attributes in the Visual Genome dataset~\cite{krishna2017visual}.
To pretrain the task conditional visual classifier, we construct external visual data with bounding box annotations, which are provided with region descriptions.
Then, visual words (answers) are extracted from region descriptions to construct visual data quadruples $(\mathbf{a}, \mathbf{I}, \mathbf{b}, \mathbf{d})$.
We use 1,169,708 regions from 80,602 images to construct the training data.
To use WordNet~\cite{fellbaum1998wordnet}, we map visual words to synsets using synset annotations from Visual Genome dataset, and the words that are not covered by the annotations are mapped to synsets using Textblob~\cite{textblob}.
\begin{figure*}[!t]
\centering
\includegraphics[width=0.95\linewidth] {figures/qualitative_new.png}
\vspace{0.15cm}
\caption{
\textbf{Out-of-vocabulary answers with diverse types of concepts.}
Green color denotes correct answers. All predicted answers are from out-of-vocabulary answers. The proposed model successfully predicts diverse out-of-vocabulary answers depending on questions.
}
\label{fig:qualitative}
\end{figure*}
\begin{table*}[!t]\small
\centering
\caption{
\textbf{Result of weakly supervised task discovery.}
We retrieve questions for each task specification based on the similarity score with task features.
Results show that appropriate task specifications are regressed from each question.
Note that no explicit supervision is used for learning the mapping between questions and task specifications.
}
\vspace{0.15cm}
\scalebox{1.0}{
\begin{tabular}
{
@{}L{3.0cm}@{}| @{}L{13.3cm}@{}
}
\hline
Task specification $\mathbf{t}_w$ & Questions \vspace{0.02cm} \\
\hline
organic\_process.n.01 & what are the giraffes doing? / what are the animals doing? / what are the giraffes doing in this picture?\\
athletic\_game.n.01 & what type of sport ball is shown? / what type of sport are the men participating in? \\
furniture.n.01 & what piece of furniture are the cats sitting on? / what furniture is the cat sitting on?\\
fruit.n.01 & what type of fruit is the animal eating? / what type of fruit juice is on the counter?\\
time\_period.n.01 & what kind of season is it? / what type of season is it? / what holiday season is it? / which season is it?\\
tool.n.01 & what utensil is in the person 's hand? / what utensil is laying next to the bread? \\
hair.n.01 & what hairstyle does the surfer have ? / what type of hairstyle does this man have ? \\
\hline
\end{tabular}
}
\label{tab:task_regression}
\vspace{-0.2cm}
\end{table*}
\vspace{-0.3cm}
\paragraph{Dataset construction}
We repurpose VQA v2 dataset to construct a training/test split as illustrated in Figure~\ref{fig:zeroshot_setting}.
We use training and validation set of VQA v2.
To ensure that every out-of-vocabulary answer appears during pretraining, we randomly select out-of-vocabulary answers from all the visual words used for pretraining (954 out of 3,813).
Since we focus on transferability of visual words, answers about yes/no and numbers are not considered in our evaluation.
Based on the selected out-of-vocabulary answers, we generate 3 questions splits---462,788 for training, 51,421 for validation, and 20,802 for testing.
The training and validation splits do not contain out-of-vocabulary answers while the test split consist of out-of-vocabulary answers only.
For evaluation of models, we follow the standard VQA protocol with $10$ ground-truth answers for each question~\cite{antol2015vqa}.
\subsection{Baselines}
Since leveraging external visual data for visual question answering with out-of-vocabulary answers has hardly been explored, there is no proper evaluation benchmark and we employ the following baselines to compare with our algorithm:
1) \textit{answer embedding}, which employs idea from zero-shot image classification~\cite{frome2013devise} that learns mapping from visual features to pretrained answer embedding, where we use GloVe~\cite{pennington2014glove} to embed each answer, and
2) \textit{separable classifier}, which adopts idea from novel object captioning~\cite{hendricks2016deep, venugopalan2017captioning} that learns visual and language classifier separately and combines them by element-wise sum of logits for joint inference.
Note that the separable classifier and our proposed model are trained with the same data.
\begin{figure*}[!t]
\centering
\includegraphics[width=0.95\linewidth] {figures/model_comparison_with_std_seen_in_test.png}
\vspace{-0.1cm}
\caption{
\textbf{Combining knowledge from VQA and external visual data.}
Evaluation results on a test set containing both out-of-vocabulary answers and trained answers.
The proposed model shows relatively lower performance on trained answers but significantly better performance on out-of-vocabulary answers.
In total, the proposed model shows the best performance.}
\label{supple_fig:vqa_all}
\vspace{-0.2cm}
\end{figure*}
\subsection{Results}
\paragraph{Model comparisons}
Figure~\ref{fig:vqa_model_comparison} illustrates model comparison results with the baselines.
For this experiment, we perform VQA adaptation with 6 different random seeds and plot their mean and standard deviation.
The standard VQA model fails to predict any out-of-vocabulary answers (\ie, 0 VQA score) because there is no clue for inferring out-of-vocabulary answers.
Answer embedding baseline generalizes slightly better by exploiting the similarity of answer words in the embedding space, but the improvement is marginal.
Using off-the-shelf visual data and task specifications from linguistic knowledge sources dramatically improves performance both on the separable classifier and the proposed model.
However, independent consideration of visual data and task specifications in separable classifier has a critical limitation of modeling joint interaction between task specifications and visual features.
Especially, this baseline shows substantially lower performance on attribute answers, which have significant variations depending on tasks.
Note that the bias in the VQA training set cannot be exploited in the proposed evaluation setting, as the evaluation is performed with out-of-distribution answers only.
\vspace{-0.3cm}
\paragraph{Data comparisons}
Figure~\ref{fig:vqa_data_comparison} illustrates the effect of different linguistic sources in our algorithm.
Two models learned using visual description and WordNet, respectively, have complementary characteristics and additional improvement is achieved by exploiting both data.
More detailed complementary characteristics of models are illustrated in Figure~\ref{fig:score_per_answer}, where we visualize average VQA scores for 20 answers.
\iffalse
We analyze the characteristics of the VQA models transferred from the task conditional visual classifiers learned using different two linguistic sources---Wordnet and visual description.
For the purpose, we present the average VQA scores for 50 answers in Figure~\ref{fig:score_per_answer}.
Wordnet based VQA model has advantage on the questions about fine-grained classification such as species of a bird (\eg, \textit{goose} and \textit{pigeon}).
This is because this categorization is explicitly modeled in Wordnet.
On the other hand, visual description is more effective on the questions related to type of interactions (\eg, \textit{holding}).
As a result, Wordnet based model works better on object answers while a model using visual description correctly answers questions about attributes, which is shown in Figure~\ref{fig:vqa_data_comparison}.
This complementary property
\fi
\vspace{-0.3cm}
\paragraph{Qualitative results}
Figure~\ref{fig:qualitative} shows examples of predicted answers from the proposed model.
The proposed model correctly predicts out-of-vocabulary answers for questions asking diverse visual concepts such as type of flooring, material, type of sport and brand.
\vspace{-0.3cm}
\paragraph{Weakly supervised task regression}
Given that task specifications extracted from WordNet models diverse visual recognition tasks, matching them to relevant questions is useful for categorization of VQA data and model interpretation.
As we learn VQA models by task regression, this matching can be performed by comparing the encoded task feature from a question $\tau_{\eta_\text{vqa}}(\mathbf{q})$ and the vector from a task specification $\tau_{\eta_\text{pre}}(\mathbf{t}_w)$.
For each $\tau_{\eta_\text{pre}}(\mathbf{t}_w)$, we sorted questions in a descending order of dot product similarity between $\tau_{\eta_\text{pre}}(\mathbf{t}_w)$ and $\tau_{\eta_\text{vqa}}(\mathbf{q})$.
In the sorted question list, the most similar questions are visualized in Table~\ref{tab:task_regression}.
The visualization shows that the weakly supervised task regression successfully trains a question encoder that match a question to a relevant task feature.
\subsection{Combining knowledge learned by VQA}
While we focus on learning visual concepts from external visual data, VQA dataset is still a valuable source of learning diverse knowledges.
Especially, some answers are not visual words and require visual reasoning.
For example, yes and no are one of the most frequent answers in the VQA dataset~\cite{antol2015vqa} but it is not straightforward to learn these answers only with the external visual data.
Therefore, we consider combining knowledge learned from VQA dataset and from external visual data.
We construct a split of the VQA dataset consisting of 405,228 training, 37,031 validation, and 172,681 test questions.
The training and validation set do not contain any out-of-vocabulary answers and test set contains out-of-vocabulary answers.
However, contrary to the main experiment, the test set also contains training answers which include logical answers, numbers and visual words.
The list of out-of-vocabulary answers are identical to that of the main experiment.
Among 172,681 test questions, 103,013 questions can be answered only with the training answers.
To combine knowledges from VQA dataset and external visual data, we learn a VQA model with two task conditional visual classifiers;
we fine-tune one classifier for adapting answers requiring visual reasoning (\ie, numbers and yes/no) and fix the other classifier for visual answers including out-of-vocabulary answers.
After training the VQA model, we combine two logits by element-wise sum and pick the answer with the highest score in the inference.
\iffalse
To combine knowledge from VQA and external visual data, we construct two task conditional visual classifier and fine-tune one classifier to learn newly appearing answers from VQA training set and fix one classifier to answer known visual answers including out-of-vocabulary answers.
After training, we simply combine two logits by elementwise sum and pick answer with largest score for prediction
\fi
The results are presented in Figure~\ref{supple_fig:vqa_all}.
Models in each method are trained with 6 different random seeds and their mean and standard deviation are plotted.
Overall, the proposed model performs the best.
While the standard VQA model achieves the best performance for training answers, it fails to predict any out-of-vocabulary answers.
The answer embedding baseline somewhat generalizes to out-of-vocabulary answers, but constraints in the answer embedding degrade its performance on answers in training set.
\section{Introduction}
Human sees and understands a visual scene based on diverse visual concepts.
For example, from a single image of a chair, human effortlessly recognizes diverse visual concepts such as its color, material, style, usage, and so on.
Such diverse visual concepts may be associated with different questions in natural languages defining a recognition task for each of the visual concepts ({\it e.g.}, what color is the chair?).
Recently visual question answering (VQA)~\cite{antol2015vqa} is proposed as an effort to learn deep neural network models with capability to perform diverse visual recognition tasks defined adaptively by questions.
Approaches to VQA rely on a large-scale dataset of image, question and answer triples, and train a classifier taking an image and a question as inputs and producing an answer.
Despite recent remarkable progress~\cite{anderson2017updown, fukui2016multimodal, yang2016stacked}, this direction has a critical limitation that image, question and answer triples in datasets are the only source for learning visual concepts.
Such drawback may result in lack of scalability because the triplets may be collected artificially by human annotators with limited quality control and have weak diversity in visual concepts.
In fact, VQA datasets~\cite{agrawal2017don, goyal2017making} suffer from inherent bias, which hinders learning true visual concepts from the datasets.
On the contrary, human answers a question based on visual concepts learned from diverse sources such as books, pictures, videos, and personal experience that are not necessarily associated with target questions.
Even for machines, there exist more natural and scalable sources for learning visual concepts: image class labels, bounding boxes and image descriptions.
Such information is already available in large-scale~\cite{Imagenet, openimages, krishna2017visual} and can scale further with reasonable cost~\cite{papadopoulos2016we,papadopoulos2017extreme}.
This observation brings a natural question; can we learn visual concepts without question annotations and transfer them for VQA?
To address this question, we introduce a VQA problem with out-of-vocabulary answers, which is illustrated in Figure~\ref{fig:zeroshot_setting}.
External visual dataset provides a set of labels $\mathcal{A}$ and only a subset of these labels $\mathcal{B} \subset \mathcal{A}$ appears in VQA training set as answers.
The goal of this task is to handle out-of-vocabulary answers $\mathbf{a} \in \mathcal{A} - \mathcal{B}$ successfully by exploiting visual concepts learned from external visual dataset.
\begin{figure*}[t]
\centering
\includegraphics[width=0.98\linewidth] {figures/zeroshot_setting_new.png}
\vspace{0.05cm}
\caption{
\textbf{VQA with out-of-vocabulary answers.}
Given a set of labels in visual dataset $\mathcal{A}$ and a set of answers in VQA training set $\mathcal{B}$, we evaluate a model on VQA test set with answers $\mathbf{a} \in \mathcal{A} - \mathcal{B}$.
External visual dataset provides a set of bounding box labels and visual descriptions for all answers in VQA training set and test set. See text for details.
}
\vspace{-0.3cm}
\label{fig:zeroshot_setting}
\end{figure*}
This paper studies how to learn visual concepts without questions and how to transfer the learned concepts to VQA models.
To learn transferable visual concepts, we train a task conditional visual classifier, whose task is defined by a task feature.
The classifier is used as an answering unit, where a task feature is inferred from a question.
To train the task conditional visual classifier without task annotations, we propose an unsupervised task discovery technique based on linguistic knowledge sources such as structured lexical databases, \eg, WordNet~\cite{fellbaum1998wordnet} and region descriptions~\cite{krishna2017visual}.
We claim that the proposed transfer learning framework helps generalization in VQA with out-of-vocabulary answers.
The main contribution of our paper is three-fold:
\vspace{-0.1cm}
\begin{itemize}
\item{We present a novel transfer learning algorithm for visual question answering based on a task conditional visual classifier.} \vspace{-0.1cm}
\item{We propose an unsupervised task discovery technique for learning task conditional visual classifiers without explicit task annotations.} \vspace{-0.1cm}
\item{We show that the proposed approach handle out-of-vocabulary answers through knowledge transfer from visual dataset without question annotations.}
\vspace{-0.1cm}
\end{itemize}
The rest of the paper is organized as follows. Section~\ref{sec:related_works} discusses prior works related to our approach.
We describe the overall transfer learning framework in Section~\ref{sec:algorithm_overview}.
Learning visual concepts by unsupervised task discovery is described in Section~\ref{sec:task_discovery}.
Section~\ref{sec:experiments} analyzes experimental results and Section~\ref{sec:conclusion} makes our conclusion.
\section{Weakly Supervised Task Regression}
This section describes how task regression is performed by \eqref{eq:pretrain} in the main paper.
\iffalse
Visual question answering (VQA), is usually formulated as a subsequent problem of reference and answering~\cite{yang2016stacked, fukui2016multimodal}, where the reference step make attention on a region that is relevant to a question and the answering perform visual recognition specified by a question.
Hereby, the pretrained conditional visual classifier could be used for the answering step.
The conditional visual classifier is trained to perform diverse visual recognition by putting appropriate task vector $\tau$, so it could be utilized to VQA by inferring a task vector from a question.
We call this problem a task regression, where a task vector should be regressed from a natural language question.
\fi
Let $\mathbf{q}$ be a question from a VQA dataset and $\tau^*_\mathbf{q}$ be a true task specification defined by a question.
Our intuition is that a task is defined by a mapping from visual inputs to a set of answers, which is represented by a conditional distribution $\text{p}_{\tau_\mathbf{q}^*}(\mathbf{a} | v)$.
As the task is defined by a conditional distribution, the objective of a task regression becomes to find a task specification vector $\tau_{\eta_\text{vqa}}(\mathbf{q})$ that approximates this conditional distribution using a pretrained task conditional visual classifier $\text{p}_\theta(\mathbf{a}|v, \tau_{\eta_\text{vqa}}(\mathbf{q}))$.
We can formulate this objective as a maximum log-likelihood, which is formally written as follows.
\begin{equation}
\mathbb{E}_{\text{p}(v|\mathbf{q})}
\mathbb{E}_{\tau^*_\mathbf{q}(\mathbf{a}|v)}
[\log \, \text{p}_\theta(\mathbf{a}|v, \tau_{\eta_\text{vqa}}(\mathbf{q}))],
\end{equation}
where $\text{p}(v|\mathbf{q})$ is conditional distribution of visual features $v$ given a question $\mathbf{q}$.
As we are interested in learning $\eta_\text{vqa}$, which is a parameter of a question encoder working over all question $\mathbf{q}$, we need to optimized the objective expected over the distribution of $\mathbf{q}$, which is formally written as follows.
{\color{red}
\begin{equation}
\begin{split}
\mathbb{E}&_{\text{p}(\mathbf{q})}
\mathbb{E}_{\text{p}(v|\mathbf{q})}
\mathbb{E}_{\tau^*_\mathbf{q}(\mathbf{a}|v)}
[\log \, \text{p}_\theta(\mathbf{a}|v, \tau_{\eta_\text{vqa}}(\mathbf{q}))]\\
&=
\mathbb{E}_{\text{p}(\mathbf{q})}
\mathbb{E}_{\text{p}(v_{\phi_\text{vqa}}(\mathbf{I}, \mathbf{q})|\mathbf{q})}
\mathbb{E}_{\tau^*_\mathbf{q}(\mathbf{a}|v_{\phi_\text{vqa}}(\mathbf{I}, \mathbf{q}))}
[\log\, \text{p}_\theta(\mathbf{a}|v_{\phi_\text{vqa}}(\mathbf{I}, \mathbf{q}), \tau_{\eta_\text{vqa}}(\mathbf{q}))]\\
&=
\mathbb{E}_{\text{p}(\mathbf{q})}
\mathbb{E}_{\text{p}(\mathbf{I}|\mathbf{q})}
\mathbb{E}_{\tau^*_\mathbf{q}(\mathbf{a}|\mathbf{I}, \mathbf{q})}
[\log\, \text{p}_\theta(\mathbf{a}|v_{\phi_\text{vqa}}(\mathbf{I}, \mathbf{q}), \tau_{\eta_\text{vqa}}(\mathbf{q}))]\\
&=
\mathbb{E}_{\text{p}_\text{vqa}(\mathbf{a}, \mathbf{I}, \mathbf{q})}
[\log\, \text{p}_\theta(\mathbf{a}|v_{\phi_\text{vqa}}(\mathbf{I}, \mathbf{q}), \tau_{\eta_\text{vqa}}(\mathbf{q}))],
\end{split}
\end{equation}
}
where, $\text{p}_\text{vqa}(\mathbf{a}, \mathbf{I}, \mathbf{q}) = \tau^*_\mathbf{q}(\mathbf{a}|\mathbf{I}, \mathbf{q})\text{p}(\mathbf{I}|\mathbf{q})\text{p}(\mathbf{q})$ and a visual feature $v$ is altered to $v_{\phi_\text{vqa}}(\mathbf{I}, \mathbf{q})$ because the visual feature is inferred by a visual encoder from an image $\mathbf{I}$.
This derivation relates the task regression to standard VQA objective in \eqref{eq:transfer} in the main paper.
\iffalse
\section{Combining Knowledge Learned by VQA}
While we focus on learning visual concepts from external visual data, VQA dataset is still a valuable source of learning diverse knowledges.
Especially, some answers in the VQA dataset are not visual words and require visual reasoning.
For example, yes and no are one of the most frequent answers in the VQA dataset~\cite{antol2015vqa} but it is not straightforward to learn these answers only with the external visual data.
Therefore, we consider combining knowledge learned from VQA and from external visual data.
We construct a split of the VQA dataset consisting of 405,228 training, 37,031 validation, 43,171 test-validation and 172,681 test questions.
The training and validation set does not contain any out-of-vocabulary answers and test-validation and test set contains out-of-vocabulary answers.
Contrary to the split used in the main paper, this split also contains training answers in the test-validation and test set and the training answers includes logical answers, numbers and visual words.
The list of out-of-vocabulary answers are identical to the main paper.
Among 172,681 test questions, 103,013 questions could be correctly answered only with the training answers.
To combine knowledge from VQA and external visual data, we construct two task conditional visual classifier and fine-tune one classifier to learn newly appearing answers from VQA training set and fix one classifier to answer known visual answers including out-of-vocabulary answers.
After training, we simply combine two logits by element-wise sum and pick answer with largest score for prediction.
The result is illustrated in Figure~\ref{supple_fig:vqa_all}.
We compare the proposed model with the standard VQA model and the answer embedding baseline.
Each models are trained with 3 different random seeds and their mean and standard deviation are plotted.
Overall, the proposed model performs the best.
While the standard VQA model achieved the best performance for training answers, it cannot predict any out-of-vocabulary answers.
The answer embedding baseline achieves some generalization to out-of-vocabulary answers, but constraints in the answer embedding degrades its performance on training answers.
\fi
\section{Additional Task Regression Results}
Table~\ref{tab:task_regression_sup} shows examples of task regressed questions corresponding to each answers sets, which are represented as the synset of common hypernyms.
Similarity is computed by dot product between task specification vector of the answer set embedding $\tau_{\eta_\text{pre}}(\mathbf{t}_s)$ and the task specification vector regressed by a question $\tau_{\eta_\text{vqa}}(\mathbf{q})$.
We manually select top ranked questions that fit within the table in terms of the number of characters.
\begin{figure*}[!t]
\centering
\includegraphics[width=0.9\linewidth] {supple_figures/qualitative_diverse_type.jpg}
\caption{
\textbf{Out-of-vocabulary answers with diverse types of concepts.}
Green and red color denote correct and wrong answers respectively. Asterisk~(*) denotes answers appearing in the training set. Answers without asterisks are out-of-vocabulary answers.
The proposed model correctly predicts out-of-vocabulary answers for diverse visual recognition tasks.
}
\label{supple_fig:qualitative1}
\end{figure*}
\iffalse
\begin{figure}[h]
\begin{center}
\parbox{0.32\columnwidth}{
\centering
\includegraphics[width=0.3\textwidth]{supple_figures/sep-cls-mlp.png}
\raggedright
\normalsize
Figure 10: Separable classifier with MLP
}
\parbox{0.32\columnwidth}{
\centering
\includegraphics[width=0.3\textwidth]{supple_figures/variance_answer_splits.png}
\raggedright
\normalsize
Figure 11: Variance with answer splits
}
\parbox{0.32\columnwidth}{
\centering
\includegraphics[width=0.3\textwidth]{supple_figures/Upper_bound.png}
\raggedright
\normalsize
Figure 12: Upper bound performance
}
\end{center}
\vspace{-0.5cm}
\end{figure}
\section{Separable classifier with MLP}
Our framework for unsupervised task discovery enables us to use unpaired data for training joint classifier in any architecture.
However, in case of separable classifier with Multilayer Perceptron (MLP), two independent classifiers in vision and language domains are trained with unpaired data while the MLP needs to be trained with paired data only.
Hence, as illustrated in Figure~10, performance of the separable clasifier with MLP is worse than its original version with elementwise addition.
This result makes sense because unpaired data cannot be used to guide final answers when MLP is employed for fusion of two separate classifiers.
\section{Variance with different answer splits}
Figure~11 shows mean and standard deviation of VQA score with 3 different answer splits.
The absolute performance varies across splits, but the relative performance of the proposed model and baselines are consistent across splits.
We believe that the variance across splits is natural because the amount of pre-trained information for each answer is different depending on the statistics of the external data.
\section{Upper bound performance for VQA with unseen answers}
Figure~12 presents the upper bound performance for VQA with unseen answers, where standard VQA model is trained with test-validation including unseen answers.
The upper bound is 64.9 with standard deviation 0.7, which is comparable to a single model performance in VQA v2 dataset.
\fi
\section{Additional Qualitative Results}
To illustrate that the proposed model could answer diverse questions with out-of-vocabulary answers, we present additional qualitative results.
Figure~\ref{supple_fig:qualitative1} illustrates that the proposed model correctly predicts out-of-vocabulary answers to diverse visual recognition tasks.
Figure~\ref{supple_fig:qualitative23} illustrates that the proposed model performs question and image dependent answering and could predict out-of-vocabulary answers depending on both image and question.
\begin{figure*}[!t]
\centering
\subfigure[
\textbf{Same task with different out-of-vocabulary answers.}
Pair of questions are asking similar visual recognition task.
The proposed model correctly predict out-of-vocabulary answers depending on different images.
]{
\includegraphics[width=0.90\linewidth] {supple_figures/qualitative_same_task_different_answer.jpg}
\label{supple_fig:qualitative2}
}
\subfigure[
\textbf{Same image with diverse tasks}
This qualitative example visualizes diverse question answering for a single image.
The proposed model correctly predicts out-of-vocabulary answers depending on the question.
]{
\includegraphics[width=0.90\linewidth] {supple_figures/qualitative_same_image_different_task.jpg}
\label{supple_fig:qualitative3}
}
\caption{
\textbf{Image and question dependent answering.}
Green and red color denote correct and wrong answers respectively. Asterisk(*) denotes answers appearing in the training set. Answers without asterisks are out-of-vocabulary answers.
}
\label{supple_fig:qualitative23}
\end{figure*}
\section{Conclusion}
\label{sec:conclusion}
We present a transfer learning approach for visual question answering with out-of-vocabulary answers.
We pretrain a task conditional visual classifier with off-the-shelf visual and linguistic data based on unsupervised task discovery.
The pretrained task conditional visual classifier is transferred to VQA adaptively.
The experimental results show that exploiting external visual and linguistic data boosts performance in the proposed setting and training with unsupervised task discovery is important to model interaction between visual features and task specifications.
\section{Unsupervised Task Discovery}
\label{sec:task_discovery}
\iffalse
Learning a task conditional visual classifier with the off-the-shelf visual data~\cite{krishna2017visual} is not straightforward due to missing annotation for task specifications, which is necessary to encode a task specification vector $\tau$.
To address this issue, we propose unsupervised task discovery, which is a technique to sample a task specification $\mathbf{t}$ based on linguistic knowledge sources.
The motivation of this approach is that output domain of a visual recognition task reflects our understanding about hierarchy of concepts or knowledge of the world.
For example, classification problems about \textit{electronic devices} and \textit{holdable objects} both restricts possible outputs to the corresponding word groups such as $\{\text{phone, tv, ..}\}$ and $\{\text{ball, racket,cup, ..} \}$, which are defined by our prior knowledge.
This knowledge is often accessible with linguistic knowledge sources, which is used for sampling a task specification $\mathbf{t}$.
\jh{
We will describe how to construct the joint distributions with task specification $\text{p}_\mathcal{D}(\mathbf{a}, \mathbf{I}, \mathbf{b}, \mathbf{t})$ using visual data with linguistic knowledge sources---visual description and WordNet---in following sections.
}
\fi
Learning a task conditional visual classifier with the off-the-shelf visual dataset~\cite{krishna2017visual} is not straightforward due to missing annotation for task specifications, which is necessary to learn an encoder for a task specification vector $\tau$.
To address this issue, we propose unsupervised task discovery which samples a task specification $\mathbf{t}$ from a task distribution modeled by exploiting linguistic knowledge sources.
\iffalse
This training objective is formally written as follows:
\begin{equation}
\mathcal{L} = \mathbb{E}_{\text{p}_\text{visual}(a, \mathbf{v})}\left[
\mathbb{E}_{\text{p}_\text{condition}(\tau | a, \mathbf{v})} {\text{log} \, \text{p}}(a | \mathbf{v}, \tau)
\right].
\end{equation}
\fi
\iffalse
\begin{minipage}[t]{0.6\linewidth}
\lipsum[1]
\end{minipage}
\hfill
\begin{minipage}[t]{0.3\linewidth}
\lipsum[2]
\end{minipage}
\fi
\iffalse
\begin{table}[!t]\footnotesize
\centering
\caption{
Illustration of wordset extracted from Wordnet~\citep{fellbaum1998wordnet} lexical database.
A set of words sharing a common parents in the tree is grouped as a single wordset.
Diverse grouping of words reveal diverse level of understanding about the world.
{\color{blue}TODO(hyeonwoonoh): add example wordnet hierarchy figure}
}
\begin{tabular}
{
@{}C{2.0cm}@{} | @{}C{11.9cm}@{}
}
\hline
wordset name & items \vspace{0.02cm} \\
\hline
\vspace{0.02cm}
appliance.n.02 & freezer, cooler, washing machine, hair dryer, refrigerator, fridge, oven, dishwasher, .. \vspace{0.02cm}\\
opening.n.10 & manhole, spout, rear window, vents, muzzle, exit, vent, nozzle, car window, coin slot, .. \vspace{0.02cm}\\
food.n.02 & potatoes, french fries, berry, sprinkles, chicken, melted cheese, steak, bagels, tomatoes, .. \vspace{0.02cm}\\
move.v.03 & twisted, ruffled, curving, curved, wheeled, rolled, sheer, coiled, parted, turned, rippled, .. \vspace{0.02cm}\\
act.n.02 & fishing, skateboarding, sailing, baking, playing baseball, pulling, breaking, cutting, surfing, .. \vspace{0.02cm}\\
area.n.01 & middle, in corner, center, open, seat, parking space, playground, shrubbery, landscape, ..\vspace{0.02cm}\\
color.n.01 & yellow, pink, red, beige, royal blue, amber, blue, aqua, blue green, dark red, purple, .. \vspace{0.02cm}\\
\hline
\end{tabular}
\label{tab:wordset_examples}
\end{table}
\fi
\subsection{Leveraging linguistic knowledge sources}
\label{subsec:linguistic_sources}
\iffalse
A visual recognition task defines a mapping from visual inputs to a set of answers, where a range of the mapping is a finite set of answers, which is a subset of a common category set.
Especially, when there is no ambiguity about which entity in a visual scene is referenced\footnote{In the proposed VQA model, ambiguity of reference is usually resolved by an attention model.}, a visual recognition task is uniquely defined by specifying the range of a mapping.
\fi
A visual recognition task given by a question typically defines a mapping from visual inputs to a set of possible visual concepts, that is, a word group.
For example, a question of ``what is the woman holding?" defines a visual recognition task finding \textit{holdable objects} in an image, which is a classification over a word group $\{\text{ball, racket, cup, ...} \}$.
This intuition leads to a simple approach for modeling distribution of task description $\mathbf{t}$ by treating a task as a word group (\ie \textit{holdable objects}).
The main reason to use linguistic knowledge sources for the unsupervised task discovery is that the word groups are often accessible in the linguistic knowledge sources.
We consider two linguistic knowledge sources: 1) visual descriptions provided with a visual data and 2) a structured lexical database called WordNet~\cite{fellbaum1998wordnet}.
Figure~\ref{fig:unsupervised_task_discovery} illustrates the overview of our approach.
\iffalse
The motivation of the unsupervised task discovery is that output domain of a visual recognition task reflects our understanding about hierarchy of concepts or knowledge of the world.
For example, recognition tasks about \textit{electronic devices} and \textit{holdable objects} both restrict possible outputs to the corresponding word groups such as $\{\text{phone, tv, camera, ...}\}$ and $\{\text{ball, racket, cup, ...} \}$.
The knowledge about word groups is often accessible in linguistic knowledge sources, which is used for sampling a task specification $\mathbf{t}$
A visual recognition task defines a mapping from visual inputs to a set of answers, where the answers belong to a same word group such as {\em electronic devices} and {\em holdable objects}.
This intuition leads to a simple approach for modeling distribution of task specifications $\mathbf{t}$ by treating a task as a set of answers.
We exploit linguistic knowledge sources to extract answer sets and corresponding task specification $\mathbf{t}$.
Specifically, we consider the following two sources: 1) visual descriptions that are provided with a visual data and 2) a structured lexical database called Wordnet~\cite{fellbaum1998wordnet}.
Overview of our approach is illustrated in Figure~\ref{fig:unsupervised_task_discovery}.
\hyeonwoo{Check later whether we need $\mathbf{t}_d$, $\mathbf{t}_w$ separately}
\fi
\subsection{Visual description}
\label{subsec:visual_description}
We use Visual Genome~\cite{krishna2017visual} as an off-the-shelf visual dataset, which determines a data distribution $\text{p}_\mathcal{V}(\mathbf{a}, \mathbf{I}, \mathbf{b}, \mathbf{d})$ based on a set of quadruples $(\mathbf{a}, \mathbf{I}, \mathbf{b}, \mathbf{d})$ including visual descriptions $\mathbf{d}$.
The description in this dataset is designed to mention answer $\mathbf{a}$ explicitly, so that relation between the answer and the description is clear.
To this end, we define task specification $\mathbf{t}_d$ by replacing the answer in visual description to a special word $<$blank$>$, which is formally denoted as $\mathbf{t}_d=\rho(\mathbf{d}, \mathbf{a})$, where $\rho(\mathbf{d}, \mathbf{a})$ is a function generating a blanked description.
The subscript in $\mathbf{t}_d$ means that a task specification is extracted based on a visual description.
Based on this definition, joint distribution, $\text{p}_\mathcal{D}(\mathbf{a}, \mathbf{I}, \mathbf{b}, \mathbf{t}_d) = \int \text{p}(\mathbf{a}, \mathbf{I}, \mathbf{b}, \mathbf{t}_d, \mathbf{d}) d\mathbf{d}$, with task specification is given by
\begin{align}
\text{p}(\mathbf{a}, \mathbf{I}, \mathbf{b}, \mathbf{t}_d, \mathbf{d}) = \text{p}(\mathbf{t}_d|\mathbf{d}, \mathbf{a})\text{p}_\mathcal{V}(\mathbf{a}, \mathbf{I}, \mathbf{b}, \mathbf{d})
\label{eq:sample_description}
\end{align}
where $\text{p}(\mathbf{t}_d|\mathbf{d}, \mathbf{a}) = \delta\big(\mathbf{t}_d, \rho(\mathbf{d}, \mathbf{a})\big)$ is a delta function that returns $1$ if two inputs are identical and $0$ otherwise.
As illustrated in Figure~\ref{fig:unsupervised_task_discovery}a, we sample data required for pretraining $(\mathbf{a}, \mathbf{I}, \mathbf{b}, \mathbf{t}_w)$ by first sampling a visual data $(\mathbf{a}, \mathbf{I}, \mathbf{b}, \mathbf{d})$ and then sampling a task specification $\mathbf{t}_d$ from $\text{p}(\mathbf{t}_d|\mathbf{d},\mathbf{a})$.
This procedure results in sampling description $\mathbf{d}$ as well, but we do not care about it when we pretrain the task conditional visual classifier.
For pretraining, we encode $\mathbf{t}_d$ into a task feature $\tau_{\eta_\text{pre}}(\mathbf{t}_d)$ based on a gated recurrent unit~\cite{chung2014empirical} because $\mathbf{t}_d$ is a sequence of words.
The main reason to use a blanked description for a task specification is that it is effective to define a set of candidate words.
For example, a blanked description ``\textit{a man is holding \underline{\hspace{0.8cm}}}" restricts candidate words for the blank to a set of objects that can be held.
Therefore, a blanked description can be used to determine a word group implicitly that represents a visual recognition task.
\begin{figure*}[!t]
\centering
\includegraphics[width=0.95\linewidth] {figures/model_comparison_with_std_new.png}
\vspace{-0.2cm}
\caption{
\textbf{Model comparisons.}
Exploiting external data with the unsupervised task discovery boosts performance of the proposed model and separable classifier significantly while the separable classifier shows limited gains on attribute answers with large variations.
\iffalse
The proposed model and separable classifier baseline uses the same visual data linguistic knowledge sources.
The proposed model outperforms the separable classifier for attribute answers which varies significantly depending on tasks.
\fi }
\label{fig:vqa_model_comparison}
\end{figure*}
\subsection{WordNet}
\label{subsec:wordnet}
WordNet~\cite{fellbaum1998wordnet} is a lexical database represented with a directed acyclic graph of disambiguated word entities, called synsets.
A sample subgraph of WordNet is illustrated in Figure~\ref{fig:wordset_examples} (left).
The graph represents a hierarchical structure of words, where the parents of a node correspond to hypernyms of the word in the child.
In WordNet, we define a task specification $\mathbf{t}_w$ as a synset for a node that is a common ancestor of multiple words because a set of words sharing a common ancestor constructs a word group and the word group may also define a visual recognition task.
A procedure for sampling a task specification $\mathbf{t}_w$ based on WordNet and a visual data $(\mathbf{a}, \mathbf{I}, \mathbf{b}, \mathbf{d})$ is illustrated in Figure~\ref{fig:unsupervised_task_discovery}b.
The main idea for the procedure is to model a task distribution conditioned on an answer $\text{p}(\mathbf{t}_w|\mathbf{a})$ as a uniform distribution over possible word groups that the answer belongs to, where a task specification $\mathbf{t}_w$ is a common ancestor of words in an word group.
Modeling the distribution $\text{p}(\mathbf{t}_w|\mathbf{a})$ requires two stages: 1) constructing a word group table, which maps a task specification to a word group and 2) constructing an inverted word group table, which maps an answer word to a set of task specifications.
The inverted word group table is used to retrieve a set of possible task specifications for an answer $\mathbf{a}$ and the distribution $\text{p}(\mathbf{t}_w|\mathbf{a})$ is the uniform distribution over task specifications in the set.
Given the distribution $\text{p}(\mathbf{t}_w|\mathbf{a})$, the joint distribution, $\text{p}_\mathcal{D}(\mathbf{a}, \mathbf{I}, \mathbf{b}, \mathbf{t}_w) = \int \text{p}(\mathbf{a}, \mathbf{I}, \mathbf{b}, \mathbf{t}_w, \mathbf{d}) d\mathbf{d}$, is given by
\begin{equation}
\text{p}(\mathbf{a}, \mathbf{I}, \mathbf{b}, \mathbf{t}_w, \mathbf{d}) = \text{p}(\mathbf{t}_w|\mathbf{a})\text{p}_\mathcal{V}(\mathbf{a},\mathbf{I},\mathbf{b}, \mathbf{d}).
\end{equation}
Therefore we sample a quadruple $(\mathbf{a}, \mathbf{I}, \mathbf{b}, \mathbf{d})$ from the visual dataset and sample a task specification $\mathbf{t}_w$ subsequently.
While this procedure samples a description as well, we marginalize it out.
For pretraining, we encode $\mathbf{t}_w$ into a task specification vector $\tau_{\eta_\text{pre}}(\mathbf{t}_w)$ based on a word embedding function that is learned from scratch.
The word group table is constructed by selecting a synset of a node in WordNet as a task specification $\mathbf{t}_w$ and mapping it to a set of words (a word group) corresponding to all its descendants.
Any word group can be defined regardless of its level in WordNet hierarchy and the part-of-speech of its members; the biggest word group contains all words in WordNet and its task specification corresponds to the root of WordNet.
We illustrate the constructed word group table in Figure~\ref{fig:wordset_examples}.
The inverted word group table is constructed in a similar way to an inverted index of the word group table, but the range of mapping is not a set of indices but a set of task specifications.
\iffalse
Given a list of answer sets extracted from Wordnet, a task specification $\mathbf{t}_s$ is a name of the answer set $\mathcal{W}_{\mathbf{t}_s}$ in the list.
A task distribution is modeled by a distribution of answer set $\text{p}_\mathcal{T}(\mathbf{t}_s| \mathbf{a})$ given an answer $\mathbf{a}$, where a task specification $\mathbf{t}_s$ is independent of region annotation $\mathbf{r}$.
We assign zero probability for answer sets that do not contain the target answer $\left\{\mathbf{t}_s | \mathbf{a} \not\in \mathcal{W}_{\mathbf{t}_s} \right\}$ and uniform probability to all answer sets that contain the answer $\left\{\mathbf{t}_s | \mathbf{a} \in \mathcal{W}_{\mathbf{t}_s} \right\}$, where $\mathcal{W}_{\mathbf{t}_s}$ denotes an answer set named $\mathbf{t}_s$.
Word embedding is used to encode $\mathbf{t}_s$ into a task specification vector $\tau_{\eta_\text{pre}^s}(\mathbf{t}_s)$.
\fi
| {'timestamp': '2019-04-09T02:17:06', 'yymm': '1810', 'arxiv_id': '1810.02358', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02358'} | arxiv |
\section{Introduction}
Predictive inference and feature selection for generalized linear models (GLMs) in problems with scarce data but high-dimensional feature space---regime known as ``small $n$, large $p$''\,\footnote{Due to this historical naming we stick with these symbols but also use $p$ to denote density functions. We hope this does not confuse the reader.}---remains a topic of active research.
Often, albeit not always, the goals are twofold: the desire is to find a model that predicts unseen data well but utilizes only a small subset of features thereby facilitating the interpretation and making the model more convenient to use at prediction time.
A vast variety of different approaches have been proposed.
Frequentist approaches typically formulate an estimator with a penalty that enforces sparsity in the solution \citep[e.g.,][]{breiman1995,tibshirani1996,fan2001,zou2005,candes2007}.
A useful overview has been written by~\cite{hastie2015book}.
Among Bayesians, the most common approach is to use a sparsifying prior that favors solutions with a small number of active predictors \citep[e.g.,][]{george1993,raftery1997,ishwaran2005,johnson2012,carvalho2010}.
These approaches do not automatically produce truly sparse solutions since there is always nonzero probability for each feature being included in the model, but sparse models can be obtained for instance by removing features with estimated posterior effect below certain threshold \citep{barbieri2004,ishwaran2005,narisetty2014}.
All these approaches attempt to solve the two problems---prediction and feature selection---simultaneously.
In this paper we argue that in many situations one can gain if these problems are solved in two stages, by first finding a model that predicts well (not caring about true sparsity) and then finding a minimal subset of features that provide similar predictions as this model which we shall call a \emph{reference model}.
This strategy not only solves many issues that one might encounter in traditionally used Bayesian approaches (as we will discuss in Sec.~\ref{sec:traditional_approaches}) but has also shown empirically very good performance in comparison to many other methods with good tradeoff between sparsity and predictive accuracy~\citep{piironen2017a}.
Our discussion will be mainly from the Bayesian viewpoint but is aimed to provide several insights also for a non-Bayesian oriented reader since the reference model approach is not intrinsically limited only to the Bayesian paradigm.
A piece of pioneering work in this line was carried out by~\cite{lindley1968}, who considered prediction in linear regression model when some of the features are unavailable at prediction time.
A related but slightly different approach was proposed by~\cite{goutis1998} and~\cite{dupuis2003} who introduced the concept of \emph{projecting} the posterior information in the reference model to smaller submodels, although they were mainly interested in feature selection and less so about predicting with the submodels.
A few related papers are due to \cite{nott2010} and \cite{tran2012}, who introduced variants of the original projection of Goutis, Dupuis and Robert.
These ideas are also very closely related to the frequentist technique known as ``preconditioning'' for feature selection~\citep{paul2008}.
Also the approach of \cite{hahn2015} utilizes essentially the same idea but formulates the projection in a slightly different way.
It is worth pointing out that the same conceptual idea of replacing a large complex model with a smaller one has also successfully been used in the neural networks literature---where it is known as ``model compression'' or ``knowledge distillation''---although there the interests are reduced memory costs and faster out-of-sample predictions rather than feature selection~\citep{bucila2006,hinton2015}.
In general we assume that the phenomena we are modeling are so complex that the true model is not included in the list of models under consideration.
Hence we adopt the $\mc M$-open view although the projective approach is partially using also the $\mc M$-completed view.\footnote{As there are alternative definitions of $\mc M$-closed, -open, and -completed, we emphasize that we use definitions as in \cite{bernardo1994book} and \cite{vehtari2012}.}
More specifically, in the first stage where we attempt to construct a model that predicts well, we assume $\mc M$-open case.
If we are able to construct a sensible model that passes model assessment and checking \citep[see, e.g.,][]{gelman2013book,gabry2018}, we can use that model as the reference model in $\mc M$-completed setting.
We assume the reference model is our best description of the future data, and in $\mc M$-completed setting the predictive performances of other models are evaluated with respect to that reference model.
The use of a reference model reduces the variance in the model selection in a same way as use of model assumptions reduce the uncertainty in the usual data modeling.
Finally, as we do select a single model, we estimate the effect of selection process with $\mc M$-open style using cross-validation (see Section~\ref{sec:validation}).
\subsection{Our contributions}
This paper makes several contributions which are summarized as follows:
\begin{itemize}
\item We review the aforementioned projection techniques under unified notation, illustrate their differences in detail and give recommendations about the preferred approaches depending on the problem at hand.
\item We develop a new type of projection---called clustered projection---that can be considered as a unification of the approach of Goutis, Dupuis and Robert and that of Tran et al., and show that it gives a good balance between speed and accuracy.
\item We propose a new efficient method for validating the selection process using approximate leave-one-out (LOO) cross-validation.
This technique can be used to assess the predictive accuracy of the submodels which allows for intuitive model size selection.
\item We discuss the typical difficulties encountered with the traditional Bayesian approaches via small examples and show how the projective approach yields much more satisfactory results.
Since an extensive comparison showing the superiority of the projection (in terms of sparsity-accuracy tradeoff) to many other Bayesian model selection strategies over a variety of data sets has already been carried out earlier~\citep{piironen2017a}, here we focus only on some of the most commonly used techniques and illustrate via small examples \emph{why} they are problematic.
\item We discuss the connection of the projection to the popular Lasso estimator~\citep{tibshirani1996} in detail together with several empirical results that demonstrate the benefit of the proposed approach in the ``small $n$, large $p$'' - setting.
\item We prove a theorem that---at least in our knowledge---for the first time gives a theoretical argument of why and under which conditions the use of reference model could be beneficial for parameter learning in linear models.
\item We provide an R software package {\tt projpred} that implements all the discussed methods. The package is freely available and makes the method easily accessible to a wide audience.\,\footnote{The codes with installation instructions and examples are available at~\url{https://github.com/stan-dev/projpred}.}
\end{itemize}
\subsection{Why does a reference model improve feature selection?}
\label{sec:intro_example}
We begin with a simple example that motivates why use of a reference model can be useful for feature selection.
Although the details are different, this example is greatly inspired by the one presented by \cite{paul2008}.
Assume we have collected $n$ measurements of $p$ features $x_j$,\, $j=1,\dots,p$ along with measurements of some target variable $y$.
Assume also that the data are generated according to the following mechanism:
\begin{equation}
\begin{alignedat}{2}
f &\sim \Normal{0,1}, && \\
y \given f &\sim \Normal{f, 1} && \\
x_j \given f &\sim \Normal{\sqrt{\rho}f,\, 1-\rho}, \qquad && j = 1,\dots,p_\tx{rel} \,, \\
x_j \given f &\sim \Normal{0, 1}, && j = p_\tx{rel}+1,\dots,p \,.
\end{alignedat}
\label{eq:toy_data}
\end{equation}
The target variable values $y$ are noisy observations from the latent function values $f$ which are drawn randomly from a standard Gaussian distribution.
The first $p_\tx{rel}$ features~$x_j$ are also noisy observations from the latent function $f$, which makes them correlated and on average equally predictive about~$y$.
The multiplier $\sqrt{\rho}$ and the noise variance $1-\rho$ are chosen so that the marginal variance of each~$x_j$ is~$1$ and the pairwise correlations between the first $p_\tx{rel}$ features are all equal to~$\rho$.
The rest of the features are drawn randomly from a standard normal distribution and are thus uncorrelated and irrelevant for predicting $y$.
Suppose our goal is to assess how predictive each of the features is about the target variable.
A simple strategy would be to compute the sample correlation $R(x_j,y)$ between each feature and the target variable and then rank the features based on the absolute values $|R(x_j,y)|$.
Since the features are related to the target variable via the latent $f$, clearly our task would be easier if we had access to the noiseless values $f$ instead of the noisy ones~$y$, since the additional noise weakens the correlations, that is, $|\cor{x_j,y}| < |\cor{x_j,f}|$ for $j=1,\dots,p_\tx{rel}$.
In practice we do not observe $f$ directly, but intuitively if we could build up a model whose output $f_*$ is fairly close to the true~$f$, we might expect to benefit by making the assessment based on the sample correlations $R(x_j,f_*)$ instead of $R(x_j,y)$.
Figure~\ref{fig:univariate_example} illustrates this idea.
The left graph shows the absolute sample correlations $|R(x_j,y)|$ versus $|R(x_j,f)|$ for one data realization from~\eqref{eq:toy_data} with $p=500$, $p_\tx{rel}=150$, $n=30$ and $\rho=0.5$.
The relevant features (red dots) are much better separated from the irrelevant ones (gray dots) when we consider their correlation with $f$ instead of $y$.
The right graph demonstrates that this holds also when we replace the unknown $f$ with predictions $f_*$ of a reference model we can actually compute.
Here the reference fit is obtained by Bayesian linear regression of $y$ on the first three supervised principal components of all the features (the procedure is discussed in detail in Sec.~\ref{sec:refmodel_construction}).
Figure~\ref{fig:univariate_rank} shows that this pattern holds for a wide range of values for $\rho$ and $p_\tx{rel}$.
Parameter $\rho$ describes how strongly the relevant features are predictive about $y$, so when $\rho$ is close to 1, they all are almost perfect copies of $f$ and therefore easy to distinguish from the noise features.
On the other hand when $\rho$ gets smaller, the predictive power of the relevant features decreases and hence they are more difficult to identify.
It is quite remarkable that above $\rho=0.4$ the reference model approach gives nearly oracle results.
\begin{figure}%
\centering
\minput[pdf]{univariate_example}
%
\caption{ {\it Introductory example:} Left: Absolute sample correlations of each feature $x_j$ with the observed target variable $y$ (horizontal axis) and with the noiseless latent value $f$ (vertical axis) for $n=30$ observations generated according to~\eqref{eq:toy_data}, with $p=500$, $p_\tx{rel}=150$ and $\rho=0.5$. Red dots denote the truly relevant features and gray dots irrelevant noise features. Right: The same but the true latent $f$ replaced by the predictions $f_*$ of a reference model we can actually compute (see the text for details). The relevant features are much better separated from the irrelevant ones when we consider their correlations with either the true~$f$ or the reference model predictions $f_*$ instead of the observed $y$ (the amount of overlap between the two groups is depicted by the black lines). }
\label{fig:univariate_example}
\end{figure}
\begin{figure}%
\centering
\minput[pdf]{univariate_rank}
\vspace{-0.5cm}
\caption{ {\it Introductory example:} Average rank of the truly relevant features when the features are sorted based on their absolute sample correlations with $y$ (orange) or with the reference model predictions $f_*$ (blue). The results are averages over 100 data realizations from mechanism~\eqref{eq:toy_data}, with $n=30$ and $p=500$, and the results are shown for three different values of~$p_\tx{rel}$ with varying $\rho$. Lower values are better and the dashed lines denote the oracle results (that is, if all truly relevant features are ranked before the irrelevant ones). The standard errors (vertical lines) are in most cases smaller than the dot sizes.}
\label{fig:univariate_rank}
\end{figure}
\subsection{Note on the terminology}
\label{sec:selection_terminology}
To avoid confusion, it is useful to distinguish between two different problems both of which could be considered as ``feature selection'':
\begin{enumerate}
\item Find a \emph{minimal} subset of features that yield a good predictive model for $y$, so that adding more features does not considerably improve predictive accuracy.
\item Identify \emph{all} features that are predictive about (that is, statistically related to) the target variable~$y$.
\end{enumerate}
In the remainder of this paper, we shall focus on the first problem.
The latter problem---which is often a considerably more difficult one---is usually referred to as \emph{multiple hypothesis testing}, and different means are more suitable for solving that.
Still, as the previous example illustrates (Sec.~\ref{sec:intro_example}), we expect the reference model approach to be beneficial also there.
We shall touch upon this issue in the final discussion (Sec.~\ref{sec:multiple_hypothesis}).
\section{Traditional Bayesian approaches}
\label{sec:traditional_approaches}
This section briefly reviews some of the most common Bayesian approaches for inference with large number of features and highlights their main difficulties.
\subsection{Sparsifying priors}
Consider the standard Gaussian linear regression model
\begin{align}
\begin{split}
y_i &= \vs \beta^\mathsf{T} \vc x_i + \varepsilon_i, \quad \varepsilon_i \sim \Normal{0,\sigma^2}, \quad i=1,\dots,n \,,
\end{split}
\label{eq:lgm}
\end{align}
where $\vc x$ is the $p$-dimensional vector of features, $\vs \beta$ contains the corresponding regression coefficients and $\sigma^2$ is the noise variance.
A very popular Bayesian approach for assessing the relevances of the different features is to assign a sparsifying prior on each $\beta_j$, and then perform the relevance assessment based on the marginal distributions for each $\beta_j$ (see Sec.~\ref{sec:marg_relevances}).
A popular prior choice is the \emph{spike-and-slab}, which is often written as a mixture of two Gaussians
\begin{align}
\begin{split}
\beta_j\given\lambda_j,c,\,\varepsilon &\sim \lambda_j\,\Normal{0,c^2} + (1-\lambda_j)\, \Normal{0,\varepsilon^2}, \\
\lambda_j \given \pi &\sim \Ber{\pi}, \qquad j=1,\dots,p,
\end{split}
\label{eq:ss_prior}
\end{align}
where $\varepsilon \ll c$ and the indicator variable $\lambda_j\in \{0,1\}$ denotes whether the coefficient $\beta_j$ is close to zero (comes from the ``spike'', $\lambda_j=0$) or nonzero (comes from the ``slab'', $\lambda_j=1$).
The width of the spike $\varepsilon$ is either taken to be exactly zero or set to a small positive value~\citep{george1993,ishwaran2005}.
The prior inclusion probability $\pi$ is either fixed (typically to $\pi=0.5$) or given a hyperprior such as $\pi \sim \Unif{0,1}$ \citep{ishwaran2005}.
In some variants, the Gaussians are replaced by more heavy-tailed distributions, such as Laplacians~\citep{johnstone2004}.
A popular alternative to the spike-and-slab is to formulate the prior for $\beta_j$s as a continuous mixture of Gaussians.
This approach can be computationally more appealing and can avoid some issues that are due to sensitivity to the choices for $\varepsilon$, $c$ and $\pi$.
Several such priors have been proposed \citep[e.g.][]{carvalho2010,armagan2011,bhattacharya2015,bhadra2017}, but the most popular one is probably the \emph{horseshoe}
\begin{align}
\begin{split}
\beta_j \given \lambda_j,\tau &\sim \Normal{0, \tau^2 \lambda_j^2}, \\
\lambda_j &\sim \halfCauchy{0,1} \,, \quad j=1,\dots,p,
\end{split}
\label{eq:hs_prior}
\end{align}
which has been shown to possess several attractive properties and has enjoyed a great empirical success \citep{carvalho2009, polson2011, vanderpas2014}.
The intuition is that the global scale $\tau$ drives all the coefficients toward zero, while the thick Cauchy-tails for the local scales $\lambda_j$ allow some of the coefficients to escape the shrinkage.
\cite{piironen2017c} proposed an extension to the formulation~\eqref{eq:hs_prior}, called the \emph{regularized horseshoe}
\begin{align}
\begin{split}
\beta_j \given \lambda_j,\tau,c &\sim \Normal{0, \tau^2 \ti \lambda_j^2}, \quad \ti \lambda_j^2 = \frac{c^2 \lambda_j^2}{c^2 + \tau^2 \lambda_j^2}, \\
\lambda_j &\sim \halfCauchy{0,1} \,, \quad j=1,\dots,p, \\
c^2 &\sim \InvChi{\nu, s^2},
\end{split}
\label{eq:rhs_prior}
\end{align}
which introduces an additional regularization parameter $c$ that brings the characteristics of the horseshoe even closer to those of the spike-and-slab~\eqref{eq:ss_prior}.
The idea is that unlike in the original horseshoe where the largest coefficients are only very weakly penalized (horseshoe has Cauchy-tails), here they face a regularization equivalent to a Student-$t$ slab with scale $s$ and $\nu$ degrees of freedom.
For a fixed but finite slab width $c=s$ (obtained by letting $\nu \rightarrow \infty$), the prior is operationally similar to the spike-and-slab~\eqref{eq:ss_prior} with the same $c$, whereas the original horseshoe~\eqref{eq:hs_prior} (obtained by letting also $s \rightarrow \infty$) resembles the spike-and-slab with infinite slab width $c \rightarrow \infty$ \citep[see][for the derivations, more detailed discussion and illustrations]{piironen2017c}.
This additional regularization is useful if the parameters are weakly identified (e.g. coefficients in separable logistic regression) and often robustifies and speeds up the Markov chain Monte Carlo (MCMC) posterior inference.
It is possible to place a prior for the global parameter $\tau$ based on the sparsity assumptions analogous to the prior for $\pi$ in spike-and-slab~\eqref{eq:ss_prior}.
Under certain assumptions, \cite{piironen2017b,piironen2017c} showed that to concentrate prior mass onto solutions where $p_0$ coefficients are far from zero, most of the prior mass for $\tau$ should be concentrated near the reference value
\begin{align}
\tau_0 = \frac{p_0}{p-p_0} \frac{\sigma}{\sqrt{n}}.
\label{eq:tau0}
\end{align}
A recommended weakly informative prior is then $\tau \given \sigma \sim \halfCauchy{0,\tau_0^2}$, which we shall also use throughout this paper unless otherwise stated.
\subsection{Bayes factors and marginal posterior relevance assessment}
\label{sec:marg_relevances}
It should be made explicit that neither the spike-and-slab~\eqref{eq:ss_prior} nor the (regularized) horseshoe~\eqref{eq:rhs_prior} performs actual feature \emph{selection} in the sense that some of the variables would have exactly zero coefficient with probability one, which is true for many of the non-Bayesian penalized estimators (see Sec.~\ref{sec:search_heuristics}).
Although often overlooked, the actual selection problem can remain highly non-trivial even after successfully fitting the model with a sparsifying prior.
In the spike-and-slab literature, the actual selection is most often carried out either by selecting the most probable feature combination (that is, using Bayes factors) or by selecting those features with posterior inclusion probability above some threshold, typically 0.5, although several thresholding rules have been proposed~\citep{ishwaran2005,narisetty2014}.
The selection based on posterior inclusion probabilities is known to yield a submodel which minimizes the expected squared predictive error under some fairly strict and unrealistic assumptions, most notably that the model and prior are correct, and the features are orthogonal \citep{barbieri2004}.
Analogous decision rule based on the posterior estimates for the so called shrinkage factors could also be devised for the horseshoe~\citep{carvalho2010}.
This is essentially equivalent to simply investigating the marginal posteriors of the regression coefficients, and then choosing those features with the coefficient posterior mass significantly away from zero with some pre-defined credible level.
Unfortunately both the Bayes factors and the marginal relevance assessment have difficulties that make them unsatisfactory in our opinion.
First of all, the posterior inference via MCMC for multimodal posterior resulting from one of the sparsifying priors can be a great challenge for high-dimensional feature spaces.
Even when the posterior inference would not be a problem, the prior sensitivity of the Bayes factors has been long known \cite[see, e.g.,][]{jeffreys1961book, kass1995} and the approach does not lend itself to the continuous shrinkage priors.
In addition, for large number of features $p$ the Bayes factors typically have high Monte Carlo errors due to the fact that only a vanishingly small proportion of the $2^p$ models is visited during MCMC, and almost all models are not visited at all.
The relevance assessment based on the marginal posteriors on the other hand can produce unintuitive results in the case of correlating features, since it can be that the marginals of two or more coefficients overlap with zero but the joint distribution is clearly distinguished from zero (see Sec.~\ref{sec:toy_example}).
Another major issue is that neither of these approaches provides a satisfactory answer to how to perform \emph{post-selection inference} for the selected model, in particular, how to make inference and predictions after the selection, conditional on all the information available.
This makes it also problematic to perform tradeoff analysis between the number of included variables and the model accuracy (that is, how much predictive accuracy would be gained or lost if one or more features were included or excluded).
For an example of how the projective approach can improve predictions using the selected model even when marginal posterior probabilities are used for selecting the features, see Figure 6 in \cite{piironen2017a}.
\subsection{An illustrative example}
\label{sec:toy_example}
We illustrate the difficulties with the marginal relevance assessment discussed in Section~\ref{sec:marg_relevances} with similar data as in the introductory example, see Equation~\eqref{eq:toy_data}.
We generated one data realization with $n=50$ observations for three different number of features, $p=4$, $p=10$ and $p=50$, each using $\rho = 0.8$ and $p_\tx{rel} = \frac{p}{2}$, so in each case the first half of the features were truly relevant.
For illustration purposes, we did this by first generating the data for $p=4$ and then adding the right number of relevant and irrelevant features for cases $p=10$ and $p=50$.
This way, the realized values for the first two relevant features $x_1$ and $x_2$ and the target variable $y$ did not vary between the three data sets, which lets us illustrate how the total number of features $p$ affects the relevance assessment of the two features.
\begin{figure}[t]
\centering
\minput[pdf]{toy_marginals}
\vspace{-0.5cm}
\caption{ {\it Simulated example:} The rows denote the results for the three different priors, Gaussian, regularized horseshoe (RHS) and spike-and-slab (SS), and the columns show the results for the three different number of features $p$. For the Gaussian and RHS priors the graphs show the posterior median (dots) with 50\% and 90\% credible intervals (thick and slim lines, respectively) for the regression coefficients $\beta_j$. For SS prior, the graphs show the posterior inclusion probabilities for each variable. As the dimensionality $p$ increases, all the marginals start to overlap with zero, and the SS posterior inclusion probabilities get smaller.}
\label{fig:toy_marginals}
\end{figure}
A Bayesian linear regression model was fitted to these data with three different priors on the regression coefficients:
\begin{itemize}
\item Gaussian $\beta_j \given \tau \sim \Normal{0,\tau^2}$ with $\tau \sim \halfCauchy{0,1}$
\item Regularized horseshoe (RHS) with $p_0=1$, $\nu=4$, $s^2=1$ (See Eq.~\eqref{eq:rhs_prior} and \eqref{eq:tau0})
\item Spike-and-slab (SS)\footnote{For inference, we used the R-package {\tt spikeslab} \citep{ishwaran2010}.} with $\pi \sim \Unif{0,1}$
\end{itemize}
Figure~\ref{fig:toy_marginals} visualizes the posterior median and credible intervals for the regression coefficients under Gaussian and RHS priors, along with the marginal posterior inclusion probabilities for the different features obtained from the SS-posterior.
With only $p=4$ features and Gaussian prior, both $x_1$ and $x_2$ are detected to be relevant as the marginal posteriors of $\beta_1$ and $\beta_2$ are distinguished from zero.
As the number of features grows, the marginals become more overlapping with zero and with $p=50$ the marginals of all the relevant features are substantially overlapping with zero.
The same applies also for the RHS prior, in fact it appears that the marginals start to concentrate around zero faster than for Gaussian prior.
Also for the SS prior, the marginal inclusion probabilities generally decrease for all the relevant features as the dimensionality grows, and for $p=50$ only one of them just barely has probability over 0.5.
Notice how the marginals of the coefficients for the relevant variables are not substantially different from those of the irrelevant ones when $p=50$ regardless of the prior.
\begin{figure}
\centering
\minput[pdf]{toy_b1b2}
%
\caption{ {\it Simulated example:} Posterior draws for $\beta_1$ and $\beta_2$ with Gaussian and regularized horseshoe (RHS) priors (top and bottom row, respectively) when the total number of features $p$ varies. In each graph, the observed data for $x_1,x_2$ and $y$ are exactly the same, only the prior and the total number of features $p$ varies. Notice how the marginal posteriors are always more overlapping with zero than the joint posterior. As the dimensionality increases (in particular, when the number of features correlating with $x_1$ and $x_2$ increases), the joint posterior becomes more closer to the product of the two marginals and more overlapping with zero.}
\label{fig:toy_b1b2}
\end{figure}
\begin{figure}
\centering
\minput[pdf]{toy_selection_rep}
%
\caption{ {\it Simulated example:} Relative proportion of data sets where at least one feature is found to be significant. With SS prior feature is considered significant if its posterior probability exceeds 0.5 and with Gaussian and RHS priors if its coefficient is either positive or negative with posterior probability 0.95 or more. The results are computed from 50 randomly generated data sets generated according to \eqref{eq:toy_data} with $n=50$, $\rho = 0.8$ and $p_\tx{rel} = \frac{p}{2}$. Vertical bars denote one standard error intervals}
\label{fig:toy_selection_rep}
\end{figure}
The reason for this behaviour is quite simple: as the number of features carrying similar information grows, the coefficients of most of the relevant features could be set to zero as long as one (or a few) of them obtain nonzero coefficient.
In other words, none of the features is so precious that it could not be removed, and therefore the marginals of all the features become more overlapping with zero.
Figure~\ref{fig:toy_b1b2} further illustrates what happens to the posterior of $\beta_1$ and $\beta_2$ when the dimensionality changes.
For $p=4$ where $x_1$ and $x_2$ are the only relevant features, the posterior dependency between their coefficients is very strong; if one of the coefficients is set to zero, then the other one must be large.
As the number of features $p$ grows, the posterior dependency between $\beta_1$ and $\beta_2$ becomes weaker; when there are many features that carry similar information as $x_1$ and $x_2$, both coefficients could be set to zero because there are many substitutes.
The results for $p=50$ really summarize why the marginals and the pairwise posterior plots can be very challenging to interpret and even misleading: $x_1$ and $x_2$ have correlation of $\rho=0.8$ and their correlation with $y$ both exceed 0.6,\footnote{The correlation between each relevant $x_j$ and $y$ is $\sqrt{\frac{\rho}{2}} \approx 0.63$} yet there is no apparent posterior dependency and both marginals clearly overlap zero!
Figure~\ref{fig:toy_selection_rep} simply confirms that these observations are not due to cherry-picking a specific data set.
For each of the three priors the relative propotion of data sets where at least one feature is found to be significant goes down when $p$ increases.
With Gaussian and RHS priors this probability is already fairly close to zero with $p=50$, and even with SS we fail to find any relevant features in about half of the data sets.
The exact proportions are naturally dependent on the selected thresholding rules (posterior probability of 0.5 in SS and credible level 0.95 for Gaussian and RHS) but these do not affect the main conclusions.
\subsection{Why not to use cross-validation for selecting the feature combination?}
Cross-validation (CV) and information criteria (IC) are widely used generic methods for estimating predictive performance of essentially any learning algorithm.
One might be wondering why not to use them also for feature selection?
While it is certainly true that for example cross-validation can be a robust and convenient method for comparing a few competing models, in feature selection the number of model comparisons becomes quickly impractically large even for a relatively small number of candidate features.
The computational burden of fitting a large number of models becomes an obvious problem especially if Bayesian approach with MCMC is used for inference.
Another complication is that the prior needs to be specified separately for each model.
On the other hand, in projective approach (Sec.~\ref{sec:projection}) the prior must be specified only for the reference model and projecting the reference model posterior onto the submodels is usually hugely faster than performing MCMC for the submodels.
Another problem that is not always so well understood is that when many models are compared using cross-validation, the selection process is liable to overfitting which can lead to selection of non-optimal model due to relatively high variance in the cross-validation estimates.
We have discussed this in detail in our earlier work~\citep{piironen2017a} where we also show that the projective approach is considerably more resilient to this phenomenon.
The selection induced bias has also been discussed by other authors, see for example~\cite{ambroise2002}, \cite{reunanen2003} and \cite{cawley2010}.
\section{Predictive projection}
\label{sec:projection}
This section discusses the projective approach in detail.
We start by describing the projective idea in general, and then discuss the exponential family models and GLMs as special cases.
\subsection{Remarks on notation}
We shall denote the training data by $\data$.
The `tilde' notation is used to denote future measurements, for example symbol $\ti y$ denotes unseen measurement for $y$.
To simplify notation, we use $\ti y_i$ to denote a new observation at the $i$th observed feature values~$\vc x_i$, which allows us to drop the conditioning on~$\vc x_i$ from the conditional distributions.
Notice though that $\ti y_i$ is in general different from the observed $y_i$.
\subsection{General idea}
\label{sec:projection_idea}
In generic terms, {\it posterior projection} refers to a procedure of replacing the posterior distribution $p(\vs \theta_* \given \data)$ of the reference model with a simpler distribution $q_\perp(\vs \theta)$ that is restricted in some way.
For example, in feature selection context for GLMs, this would mean constraining some of the regression coefficients to be exactly zero.
In general the domain of the projected parameters $\vs \theta \in \vs \Theta$ can and typically will be different from the domain of the reference model parameters $\vs \theta_* \in \vs \Theta_*$.
For this reason, it is not meaningful to define the projection directly via the discrepancy between $p(\vs \theta_* \given \data)$ and $q_\perp(\vs \theta)$.
Instead, a natural approach would be to define it via the discrepancy between the induced {\it predictive} distributions
\begin{align}
\KL{p(\ti y \given \data)}{q(\ti y)}
&= \phantom{-} \mean[\ti y]{ \log p(\ti y \given \data) - \log q(\ti y)} \nonumber \\
&= - \mean[\ti y]{ \log q(\ti y)} + \tx{const.} \nonumber \\
&= - \mean[\ti y]{ \log \mean[\vs \theta]{p(\ti y \given \vs \theta) } } + \tx{const.} \nonumber \\
&= - \mean[\vs \theta_*]{ \mean[\ti y \given \vs \theta_*]{ \log \mean[\vs \theta]{p(\ti y \given \vs \theta) } } } + \tx{const.}
\label{eq:kl_distr}
\end{align}
Here $\mean[\vs \theta_*]{\cdot}$, $\mean[\ti y \given \vs \theta_*]{\cdot}$ and $\mean[\vs \theta]{\cdot}$ denote expectations over $p(\vs \theta_* \given \data)$, $p(\ti y \given \vs \theta_*)$ and $q_\perp(\vs \theta)$, respectively.
Optimal projection of posterior $p(\vs \theta_* \given \data)$ from parameter space $\vs \Theta_*$ to $\vs \Theta$ in terms of minimal predictive loss would then be the distribution $q_\perp(\vs \theta)$ that minimizes functional~\eqref{eq:kl_distr}.
In practice minimizing this is difficult even for relatively simple models and projected posterior $q_\perp(\vs \theta)$ due to the many expectations, but expression~\eqref{eq:kl_distr} serves as the ideal when re-formulating the projection in a more tractable way.
Below we define three different projections.
\subsection{Practical projection techniques}
\label{sec:projection_methods}
\noindent\textbf{Draw-by-draw\quad}
Instead of trying to minimize the functional \eqref{eq:kl_distr} assuming some parametric form for $q_\perp(\vs \theta)$, we can obtain an easier optimization problem by formulating the projection as a pointwise mapping from a given $\vs \theta_* \in \vs \Theta_*$ to $\vs \theta_\perp \in \vs \Theta$ as
\begin{align}
\vs \theta_\perp
&= \arg \min_{\vs \theta \in \,\vc \Theta}
\KL{p(\ti y \given \vs \theta_*)} { p(\ti y \given \vs \theta) } \nonumber \\
&= \arg \max_{\vs \theta \in \,\vc \Theta}
\mean[\ti y \given \vs \theta_*]{ \log p(\ti y \given \vs \theta) }.
\label{eq:proj_pointwise}
\end{align}
For models where the predictions are conditioned on some set of observed predictors $\vc {\ti x}$, one takes the average of~\eqref{eq:proj_pointwise} over the distribution of the predictors.
As the distribution of the future predictors $p(\vc{\ti x})$ is typically not available, the expectations over this are most conveniently approximated by a sample mean over the observed $\{\vc x_i\}_{i=1}^n$.
This results in a projection equation
\begin{align}
\vs \theta_\perp
&= \arg \max_{\vs \theta \in \,\vc \Theta}
\frac{1}{n}\sum_{i=1}^n \mean[\ti y_i \given \vs \theta_*]{ \log p(\ti y_i \given \vs \theta) },
\label{eq:proj_pointwise_x}
\end{align}
which is the original formulation of \citep{goutis1998,dupuis2003} (they used minimization of KL-divergence in their formulation, but this is equivalent to maximizing the expected likelihood in Eq.~\eqref{eq:proj_pointwise_x}).
Given draws $\{\vs \theta_*^s\}_{s=1}^S$ from the posterior $p(\vs \theta_* \given \data)$ we can project each of these separately via~\eqref{eq:proj_pointwise_x} to obtain the corresponding draws $\{\vs \theta_\perp^s\}_{s=1}^S$ in the projection space~$\vs \Theta$.
These can be thought of as draws from a projected posterior distribution $q_\perp(\vs \theta)$ (although this may not be available analytically), and hence they are used exactly as we would use posterior draws for that particular submodel.
The appealing property of the draw-by-draw projection is that it is computationally feasible for many commonly used models such as the GLMs because the optimization problem will have the same form as the problem of finding the maximum likelihood parameter values (see Sec.~\ref{sec:glm}).
The introduced projection error or loss is then defined as the average loss over the draws
\begin{align}
\delta_{\vc \Theta} = \frac{1}{S} \sum_{s=1}^S
\KL{p(\ti y \given \vs \theta_*^s)} { p(\ti y \given \vs \theta_\perp^s) }.
\end{align} \\
\noindent\textbf{Single point (one cluster)\quad}
Draw-by-draw projection (above) maps each parameter value $\vs \theta_*$ into a corresponding value $\vs \theta_\perp$ in the projection space.
The single point projection (which is a special case of the clustered projection that we will introduce in a moment) instead maps the whole posterior $p(\vs \theta_* \given \data)$ into a single value $\vs \theta_\perp$.
This can be obtained from~\eqref{eq:kl_distr} by assuming $q_\perp(\vs \theta)$ is a point mass at~$\vs \theta \in \vs \Theta$, taking expectation over the predictors $\vc{\ti x}$ and then optimizing the expression with respect to~$\vs \theta$
\begin{align}
\vs \theta_\perp
&= \arg \max_{\vs \theta \in \,\vc \Theta}
\frac{1}{n}\sum_{i=1}^n \mean[\ti y_i]{ \log p(\ti y_i \given \vs \theta) }.
\label{eq:proj_point}
\end{align}
This is the formulation of~\cite{tran2012}.
Notice that~\eqref{eq:proj_point} is otherwise same as \eqref{eq:proj_pointwise_x} except that here the expectation is computed over the posterior predictive distribution of the reference model, that is, $\mean[\ti y_i]{\cdot} = \mean[\vs \theta_*]{\mean[\ti y_i \given \vs \theta_*]{\cdot}}$, where $\mean[\vs \theta_*]{\cdot}$ denotes expectation over $p(\vs \theta_* \given \data)$.
In practice the expectation $\mean[\ti y_i]{\cdot}$ is approximated using the posterior draws.
Equation~\eqref{eq:proj_point} can be used to compute optimal point estimates in the projection space.
Also, when $\vs \Theta = \vs \Theta_*$ this computes the optimal predictive point estimates in the original parameter space~\citep[for a related approach, see][]{bernardo2003}.
It is worth noticing that in general the result is often different from the usual point estimates, such as the posterior mean or median.
The benefit of the single point projection over the draw-by-draw is that it is much lighter computationally.
For instance, for GLMs (Sec.~\ref{sec:glm}), solving \eqref{eq:proj_point} has the same computational complexity as solving \eqref{eq:proj_pointwise_x}, and since the latter must be solved separately for each of the~$S$ posterior draws, single point projection essentially reduces the computations by a factor of~$S$.
Another benefit of formulation~\eqref{eq:proj_point} is that it allows convenient search techniques, such as the Lasso type $L_1$-penalty, to be used for finding good submodels~\citep{tran2012}.
We will discuss this more closely in Section~\ref{sec:search_heuristics}.
The drawback is that it can be somewhat less accurate than the one-to-one projection, meaning that the predictive accuracy of the submodel can be compromised.
To address this point, we shall introduce the clustered projection below. \\
\noindent\textbf{Clustered \quad} The clustered projection is our novel approach that can be thought of as a unification of the draw-by-draw and single point projections.
In this approach one clusters the posterior draws~$\{\vs \theta_*^s\}_{s=1}^S$ of the reference model into $C$ clusters $\{\vs \theta_*^s : s \in I_c\}, \,\, c=1,\dots,C$, and then performs a single point projection within each cluster.
Here $I_1,\dots, I_C$ denote the index sets that indicate which draw belongs to which cluster (we discuss in a moment how to come up with such a division).
The projection for the $c$th cluster then becomes
\begin{align}
\vs \theta_\perp
&= \arg \max_{\vs \theta \in \,\vc \Theta}
\frac{1}{n}\sum_{i=1}^n \mean[\ti y_i \given I_c]{ \log p(\ti y_i \given \vs \theta) },
\label{eq:proj_clustered}
\end{align}
where $\mean[\ti y_i | I_c]{\cdot}$ denotes the predictive distribution of the reference model computed over the posterior draws in that cluster $I_c$.
In other words, $\mean[\ti y_i | I_c]{h(\ti y_i)} = \frac{1}{|I_c|}\sum_{s \in I_c} \mean[\ti y_i\given \vs \theta_*^s]{h(\ti y_i)}$ for any function~$h(\ti y_i)$.\footnote{Here we are slightly abusing the notation by using the symbol $\mean{\cdot}$ to denote sample mean computed over a finite number of posterior draws, but we do this to simplify the notation.}
Solving~\eqref{eq:proj_clustered} for each or the $C$ clusters yields a set of projected parameters $\{\vs \theta_\perp^c\}_{c=1}^C$.
Each of these is given a weight $\omega_c$ proportional to the number of draws in that cluster, $\omega_c = \frac{|I_c|}{S}$, and these weights are taken into account when computing expectations over the projected posterior. For example, the projected predictive density at future $\ti y$ is then given by
\begin{align}
q(\ti y) = \sum_{c=1}^C \omega_c \, p(\ti y \given \vs \theta_\perp^c).
\label{eq:pred_clustered}
\end{align}
More generally, the expectation of an arbitrary function $h(\vs \theta_\perp)$ over the projected posterior is calculated as $\sum_{c=1}^C \omega_c h(\vs \theta_\perp^c)$.
A simple but generic and effective approach is to cluster the draws~$\{\vs \theta_*^s\}_{s=1}^S$ based on the expected values they impose for $y$ in the unconstrained (latent) space.
That is, if $\vc f_s = g(\mean{\vc {\ti y} \given \vs \theta_*^s})$, where $\vc {\ti y}=(\ti y_1,\dots,\ti y_n)$ and~$g(\cdot)$ denotes the link function, we would cluster the vectors $\{\vc f_s\}_{s=1}^S$.
This approach is convenient since it makes the clustering independent of the dimensionality of the parameter space of the reference model, and since in practice for projection we need only the vectors~$\vc f_s$ (see Sec.~\ref{sec:exponential_family} and~\ref{sec:glm}), we can perform the clustering with access only to the predictions of the reference model (without access to the actual parameter values).
As a clustering algorithm, we use $k$-means.
An alternative approach would be to minimize the locations of the projected parameters $\{\vs \theta_\perp^c\}_{c=1}^C$ jointly using for example the method of \cite{snelson2005}, but this is computationally much more expensive.
Both the draw-by-draw~\eqref{eq:proj_pointwise_x} and the single point projection~\eqref{eq:proj_point} are obtained as special cases of the clustered projection~\eqref{eq:proj_clustered}.
The draw-by-draw approach is obtained by setting the number of clusters $C$ equal to the number of posterior draws $C=S$ and assigning each posterior draw into its own cluster.
The single point projection is obtained by setting $C=1$ and assigning all draws into the same cluster.
The benefit of the clustered projection is that it improves the accuracy compared to the single point (one cluster) projection already with a small number of clusters, and thereby gives a good tradeoff between speed and accuracy.
We will illustrate this with an example in Sec.~\ref{sec:clusterdemo}.
\subsection{Exponential family models}
\label{sec:exponential_family}
Assuming the observation model for $y_i$ belongs to the exponential family with canonical parameter~$\xi_i$ and dispersion $\phi$, the log-likelihood has the form \citep[][ch.~2]{mccullagh1989book}
\begin{align}
\mc L_i = \log p(y_i \given \xi_i) = \frac{y_i \xi_i - B(\xi_i)}{A(\phi)} + H(y_i,\phi),
\label{eq:expfam_ll}
\end{align}
for some specific functions $A(\cdot)$, $B(\cdot)$ and $H(\cdot)$.
Here the natural parameter is a function of the model parameters, $\xi_i = \xi_i(\vs \theta)$.
The maximum likelihood solution for the parameters $\vs \theta$ reduces to
\begin{align}
\vs \theta_\tx{ML}
= \arg \max_{\vs \theta \in \,\vc \Theta} \sum_{i=1}^n \big(y_i \xi_i(\vs \theta) - B(\xi_i(\vs \theta)) \big),
\label{eq:exponential_ml}
\end{align}
which does not depend on the value for the dispersion $\phi$ (function $A(\phi)$ is assumed to be strictly positive).
Let $\ti y_i$ denote a new measurement at the $i$th observed feature values $\vc x_i$.
Now, if we denote the expected value of $\ti y_i$ over some reference distribution as $\mu_i^* = \mean{\ti y_i}$, we can write the draw-by-draw, single point and clustered projections (Eq.~\eqref{eq:proj_pointwise_x}, \eqref{eq:proj_point} and~\eqref{eq:proj_clustered}) all as
\begin{align}
\vs \theta_\perp
&= \arg \max_{\vs \theta \in \,\vc \Theta}
\sum_{i=1}^n \big(\mu_i^* \xi_i(\vs \theta) - B(\xi_i(\vs \theta)) \big).
\label{eq:exponential_proj}
\end{align}
Thus when the observation model of the submodel is in the exponential family, the projection of the model parameters $\vs \theta$ is equivalent to finding the maximum likelihood solution with the observed targets $\vc y=(y_1,\dots,y_n)$ replaced by their expected values $\vs \mu_* = (\mu_1^*,\dots, \mu_n^*)$ as predicted by the reference model.
Thus the projection can be considered as ``fitting to the fit'' of the reference model.
As discussed in Section~\ref{sec:projection_methods}, in draw-by-draw projection these fitted values $\mu_i^*$ are computed separately for each posterior draw in the reference model, in clustered projection separately for each cluster, and ultimately in the one cluster (single point) projection over the whole posterior with the parameters $\vs \theta_*$ integrated out.
Notice also that the projection of the parameters $\vs \theta$ does not depend on the value for the dispersion parameter $\phi$.
It is worth emphasizing that this result assumes only that the observation model of the reduced model belongs to exponential family.
In particular, we are not making any assumptions about the observation model of the reference model (which need not belong to the exponential family) or about the functional form of $\xi(\vs \theta)$ or about how the reference fit $\vs \mu_*$ is formed.
In principle this means that the projection could be applied to a wide class of learning algorithms simply by plugging in the fit of the reference model in place of the observed targets $y_i$ in maximum likelihood estimation.
In practice, though, this does not work for nonparametric models such as Gaussian processes where the parameters are the values $\xi_i$ themselves without further assumptions.
After computing the projected values for the model parameters $\vs \theta$ (Eq.~\eqref{eq:exponential_proj}), the dispersion $\phi$ is computed from
\begin{align}
\phi_\perp
&= \arg \max_\phi
\sum_{i=1}^n \left( \frac{r_i(\vs \theta_\perp)}{A(\phi)} + \mean[\ti y_i]{H(\ti y_i,\phi)} \right),
\label{eq:exponential_proj_disp}
\end{align}
where $r_i(\vs \theta_\perp) = \mu_i^* \xi_i(\vs \theta_\perp) - B(\xi_i(\vs \theta_\perp))$ does not depend on $\phi$.
Again, in draw-by-draw and clustered projection, the expectation in Equation~\eqref{eq:exponential_proj_disp} is computed separately for each draw or cluster, and in single point projection by integrating over the whole posterior.
\subsection{Generalized linear models}
\label{sec:glm}
GLMs have their observation model in the exponential family and thus the discussion of Section~\ref{sec:exponential_family} applies.
Let us first consider the projection onto a linear Gaussian model with feature matrix $\vc X$, where the parameters are the regression coefficients $\vs \beta$ and dispersion is the noise variance~$\sigma^2$.
For simplicity, let us now assume also that the reference model is a linear Gaussian model with feature matrix $\vc Z$ and parameters $(\vs \beta_*, \sigma^2_*)$ and that we have drawn a posterior sample $\{ \vs \beta_*^s, \sigma^2_{*,s}\}_{s=1}^S$.
In terms of Equation~\eqref{eq:expfam_ll}, we have
\begin{align*}
\xi_i &= \vs \beta^\mathsf{T} \vc x_i, \quad
A(\sigma^2) = \sigma^2, \\
B(\xi_i) &= \frac{\xi_i^2}{2}, \quad
H(y_i,\sigma^2) = -\frac{1}{2} \left( \frac{y_i^2}{\sigma^2} + \log 2\pi \sigma^2 \right).
\end{align*}
Consider now the clustered projection with $C$ clusters.
As discussed in Section~\ref{sec:exponential_family}, the projection solution for $\vs \beta$ within each cluster is obtained by plugging in the fit of the reference model in place of~$\vc y$ into the familiar maximum likelihood solution
\begin{align}
\vs \beta_c = (\vc X^\mathsf{T} \vc X)^{-1} \vc X^\mathsf{T} \vs \mu_*^c,
\label{eq:proj_coeff}
\end{align}
where $\vs \mu_*^c = \frac{1}{|I_c|}\sum_{s\in I_c} \vc Z \vs \beta_*^s$ denotes the prediction within the $c$th cluster.
In the single point projection ($C=1$) this reduces to $\vs \mu_* = \frac{1}{S}\sum_{s=1}^S \vc Z \vs \beta_*^s$, whereas in the draw-by-draw ($C=S$) we have $\vs \mu^s_* = \vc Z \vs \beta_*^s$.
After plugging~\eqref{eq:proj_coeff} into~\eqref{eq:exponential_proj_disp},
it is straightforward to show that the projection of the noise variance becomes
\begin{align}
\sigma_c^2
= \frac{1}{n} \sum_{i=1}^n V_i^c + \frac{1}{n} ||\vc X \vs \beta_c - \vs \mu_*^c||^2,
\label{eq:proj_sigma2}
\end{align}
where $V_i^c$ denotes the predictive variance of $\ti y_i$ in the reference model within the $c$th cluster.
This is given by
\begin{align}
V_i^c = \var{\ti y_i\given I_c}
&= \mean{\var{ \ti y_i \given \vs \beta_*, \sigma^2_* } \given I_c}
+ \var{\mean{\ti y_i \given \vs \beta_*, \sigma^2_* } \given I_c} \nonumber \\
&= \mean{\sigma_*^2 \given I_c} + \var{ \vc z_i^\mathsf{T} \vs \beta_*^s \given I_c } \nonumber \\
&= \frac{1}{|I_c|}\sum_{s\in I_c} \sigma^2_{*,s} +
\svar[s \in I_c]{}{ \vc z_i^\mathsf{T} \vs \beta_*^s },
\label{eq:predvar}
\end{align}
where $\svar[s \in I_c]{}{\cdot}$ denotes sample variance over indices $s\in I_c$.
Result~\eqref{eq:proj_sigma2} has a natural interpretation; the projected noise variance is the average predictive variance of the reference model plus the mismatch between the projected and the reference model.
Therefore any systematic variation in the data captured by the reference model but not by the reduced model will be added to the unstructured noise term in the reduced model.
Notice also that the predictive uncertainty of the projected model can never be smaller than in the reference model which shows why the projection provides guard against overfitting in the submodels.
Above we assumed that also the reference model is linear with Gaussian noise.
As already pointed out in Section~\ref{sec:exponential_family}, we emphasize that Equations~\eqref{eq:proj_coeff} and~\eqref{eq:proj_sigma2} hold even without these assumptions.
For instance, $\vs \mu_*^c$ could come from an arbitrary model, such as Gaussian process (GP), neural network or some complex simulation model, and in the projection we investigate how much accuracy is sacrificed by replacing it with a linear model.
Even when the reference model does not account for uncertainty in $\vs \mu_*$, that is, when no clustering can be made, the single point projection is always available for the reference fit $\vs \mu_*$.
Also, the reference model noise could be non-Gaussian---Student-$t$, for instance---but we could still project this model onto a Gaussian noise.
When the observation model of the projected model is non-Gaussian or when the link is non-identity, the maximum likelihood solution is not available analytically, and therefore no closed form solutions for the projected regression coefficients or dispersion parameters exist.
For solving the regression coefficients, the standard approach then is to use iteratively reweighted least squares algorithm (IRLS), where each of the log-likelihood terms $\mc L_i$ is replaced by a pseudo Gaussian observation whose mean and variance are determined either by second order Taylor series expansion to $\mc L_i$ \citep[e.g.][ch.~16.2]{gelman2013book} or by linear approximation to the link function \citep[][ch.~2.5]{mccullagh1989book} at the current iterate (with canonical link functions the two approaches are equivalent).
The process is then iterated until convergence.
Given the solution to the regression coefficients, one can then plug that into Equation~\eqref{eq:exponential_proj_disp} and solve the corresponding value for the dispersion (which might also require an iterative procedure).
\section{Search strategies}
\label{sec:search_heuristics}
Due to the combinatorial explosion, even for relatively small number of features it is impossible to go through all the combinations when finding the optimal reduced model for a given number of features.
Therefore one has to rely on approximate search heuristics for exploring promising submodels.
Probably the simplest alternative is to use a forward stepwise excursion.
This procedure starts from the model with only the intercept term and sequentially adds the feature that decreases the projection error the most.
Forward search can be used together with any of the three projection techniques presented in Section~\ref{sec:projection_methods} and often works well, but it can be computationally expensive for large number of features.
In the case of single point projection~\eqref{eq:proj_point}, a viable alternative is to use either a Lasso-type $L_1$-penalization \citep{tibshirani1996} or the more general elastic net penalty \citep{zou2005} which contains $L_1$-penalty as a special case.
The single point projection for GLMs with elastic net penalty can be written as
\begin{align}
\min_{\vs \beta}\left\lbrace -\frac{1}{n}\sum_{i=1}^n \mean[\ti y_i]{\mc L_i(\vs \beta,\ti y_i)}
+ \lambda \left( \frac{1}{2}(1-\alpha)||\vs \beta||_2^2 + \alpha ||\vs \beta||_1\right) \right\rbrace.
\label{eq:elnet_projection}
\end{align}
Here the first term is the expectation of the negative of the expected log-likelihood of the submodel with coefficient vector $\vs \beta$ over the predictive distribution of the reference model, and $\alpha$ is the elastic net mixing parameter that bridges the gap between Lasso ($\alpha=1$) and ridge ($\alpha=0$).
Solving this for $\alpha > 0$ over a grid of values for $\lambda$ yields a sequence of models with varying number of regression coefficients different from zero, which can then be used to order the features, for instance by recording the order in which their coefficients break nonzero as $\lambda$ is decreased\footnote{Notice that this is not necessarily the same order in which the coefficients go to zero as the penalty term $\lambda$ is increased. This is because a coefficient that is nonzero can go back to zero as $\lambda$ is reduced, but most of the time the two orderings are the same.}.
It is known that in the case of correlating predictors, Lasso tends to select only one or a few of them discarding the others, while elastic net with $0 < \alpha < 1$ tends to select correlating predictors in groups~\citep{hastie2015book}.
Often $\alpha$ is treated as a higher level parameter and is selected on more subjective grounds.
One of the key advantages of elastic net over the forward stepwise search is that it is computationally very efficient.
In particular, the coordinate descent algorithm of \cite{friedman2010} that exploits warm starts can often compute the solution path over the entire $\lambda$ grid in comparable time to a single IRLS fit for a fixed variable combination.
We shall not discuss the algorithm but instead refer to the original paper for more information.
However, we do emphasize that unlike in the penalized GLM literature, we use the penalization \emph{only} to find promising submodels, not to regularize their fit after selection.
In other words, after we have solved problem \eqref{eq:elnet_projection} for a grid of values~$\lambda$, we order the features from the most relevant to the least relevant, and find the projected parameter values (or projected posteriors) of the submodels {\it without} any penalization, or using only a small $L_2$-regularization to improve numerical stability.
This is because the projection conditions on the information in the reference model and is therefore much more resilient to overfitting than maximum likelihood estimation for the parameters after selection.
See Section~\ref{sec:clusterdemo} for an illustration of this point, and Section~\ref{sec:benefit_of_reference} for a demonstration of how the predictive accuracy can greatly benefit from not using the penalization for the submodels after selection.
In addition to Lasso and elastic net, there is a wide literature on different penalties for the (generalized) linear models, that are used to induce sparsity in the solution, and therefore could be used as search heuristics to find promising submodels for the projection also.
One such method is the adaptive Lasso \citep{zou2006} which is obtained from \eqref{eq:elnet_projection} by introducing penalty factors $\gamma_j$ that result in different penalization for different variables $\lambda_j = \gamma_j \lambda$,\, $j=1,\dots,p$.
Plugging the local penalties into the regularization term in \eqref{eq:elnet_projection}, the regularizer becomes
\begin{align*}
J(\vs \beta)
= \lambda \sum_{j=1}^p \gamma_j \left( \frac{1}{2}(1-\alpha) \beta_j^2 + \alpha | \beta_j | \right).
\end{align*}
Using pilot estimates $\vs \beta'$ for the coefficients (that can be the univariate regression coefficients, for example) and setting $\gamma_j = 1/|\beta_j'|^\nu$ for some $\nu > 0$, adaptive Lasso reduces the excessive shrinkage of the relevant coefficients and recovers the true model under more general conditions than does the Lasso.
Adaptive Lasso can also be used to encode preferences for different variables, for instance, due to varying measurement costs.
In the projection context, \cite{tran2012} proposed to set $\vs \beta'$ to the posterior mode of the reference model (assuming it is also a GLM) whereas \cite{hahn2015} proposed to use the posterior mean (the two choices are in general different for GLMs with non-Gaussian priors for the reference model).
Our approach differs from these in that we set $\gamma_j=1$ for each feature in the selection phase but then relax completely $\gamma_j=0$ after the feature selection is done.
We also utilize clustered or draw-by-draw projection after selection when appropriate (see Sec.~\ref{sec:clusterdemo}).
Another difference to the approach of Hahn and Carvalho is that they used squared error instead of the KL-divergence to measure the discrepancy to the reference model.
\cite{nott2010} also used $L_1$-penalization but for the draw-by-draw projection.
In this method the different draws can generally project onto different feature combinations even for fixed $\lambda$, and thus this approach does not perform feature selection in the sense we are interested.
Another useful search heuristic is the group Lasso penalty \citep[see, e.g.,][]{hastie2015book} which allows selecting features in groups meaning that all features in the same group are either selected or discarded simultaneously.
Other sparsity enforcing penalties that could be used as search heuristics include the smoothly clipped absolute deviation (SCAD) \citep{fan2001} and the Dantzig selector \citep{candes2007}, but we shall not discuss these further.
\section{Validation and decision rules for model size selection}
\label{sec:validation}
Although we can find the optimal reduced model for a given model complexity by selecting the model with minimal projection loss, making the decision about the appropriate model complexity using the KL-divergences is often difficult.
Firstly, it is not easy to assess how much predictive accuracy is lost for a given amount of projective loss introduced.
Secondly, since the reference model is never perfect in practice, it is possible to find a submodel with nonzero projection loss but which gives as good predictions as the reference model \citep{piironen2017a}.
Therefore a natural way of deciding the model complexity is to validate the predictive utility of both the reference model and the candidate reduced models on a validation set using a metric that is easy to interpret, and then make the decision based on these validation results.
A generic and useful utility function is the mean log predictive density (MLPD) over the validation points \citep[see, e.g.][]{vehtari2012}, which has the advantage that it measures not only the point predictions but also how well the predictive uncertainties are calibrated.
Various other utility and loss functions could also be used, such as mean squared error (MSE) or classification accuracy in classification problems, which are often easier to interpret.
If plenty of data are available and computation time is an issue, this assessment can be done on hold-out data.
However, when data are scarce, more accurate assessment can be obtained using either leave-one-out (LOO) or $K$-fold cross-validation, which we shall discuss next.
\subsection{$K$-fold cross-validation}
\label{sec:kfold_validation}
In $K$-fold cross-validation both the reference model fitting and the selection is performed $K$ times each time computing the utilities on the corresponding validation set~\citep{peltola2014}.
This gives us the cross-validated pointwise utilities $u_k^{(i)}$ for a given model complexity $k$ (number of features) at each datapoint $i$.
For instance, with log predictive density as the utility function, $u_k^{(i)}$ is the log predictive density of the submodel with $k$ features evaluated at the left out $y_i$.
These can then be used to make the final decision about the appropriate level of complexity.
Our approach is to estimate the utility of each model size $k$ relative to the reference model, that is, $\Delta U_k = U_k - U_*$, where~$U_k$ and~$U_*$ denote the true (unknown) utilities for the reduced and the reference model, respectively.
The point estimate and the standard error for the relative utility $\Delta U_k$ in such pairwise comparison are given by
\begin{align}
\Delta \bar U_k &= \frac{1}{n} \sum_{i=1}^n \left( u_k^{(i)} - u_*^{(i)} \right),
\label{eq:rel_util_mean} \\
s_k &= \sqrt{\frac{1}{n} \svar[i=1]{n}{u_k^{(i)} - u_*^{(i)}}},
\label{eq:rel_util_se}
\end{align}
where $\svar[i=1]{n}{\cdot}$ denotes the sample variance.
Given the point estimate and its standard error it is easy to construct desired confidence intervals for $\Delta U_k$.
A natural choice is then to choose the simplest model that has acceptable difference relative to the reference model with some confidence~\citep{piironen2017a}.
A simple choice is to select the smallest model for which the utility estimate is no more than one standard error away from that of the reference model, that is, the smallest $k$ that satisfies $\Delta \bar U_k + s_k \ge 0$, which means that the submodel is no worse than the reference model with probability approximately $\alpha=0.16$.
This approach has the drawback that such a model is not guaranteed to be found if the submodels all introduce a considerable loss in utility.
Instead one could compare the utilities relative to the best submodel found, that is, in Equation~\eqref{eq:rel_util_mean} replace $u_*^{(i)}$ by $u_{k_\tx{best}}^{(i)}$ where $k_\tx{best} = \arg \max_k \Delta \bar U_k$.
Based on the experiments in Section~\ref{sec:microarray_data} the two choices perform quite similarly, the latter tending to select less parsimonious models but also with slightly better predictive accuracy.
Depending on the application, one might be willing to sacrifice more utility in order to simplify the model ever further, and the decision about the appropriate model size could naturally be made on more subjective grounds also.
\subsection{Leave-one-out cross-validation}
\label{sec:loo_validation}
\subsubsection{Pareto smoothed importance sampling}
The drawback in the $K$-fold cross-validation is that it requires fitting the reference model $K$ times.
Here we propose an alternative approach using approximate leave-one-out (LOO) validation using the Pareto smoothed importance sampling (PSIS) \citep{vehtari2017b}, which avoids the repeated fitting of the reference model.
In (PS)IS-LOO, the posterior draws can be treated as draws from the LOO posteriors given the importance weights.
The weight for draw $\vs \theta_*^s$ after leaving $i$th observation out, $w_s^{(i)}$, is given by $w_s^{(i)} \propto \frac{1}{p(y_i \given \vs \theta_*^s)}$.
These raw weights are then regularized using Pareto smoothing to stabilize the LOO estimates in case the importance weight distribution has a thick tail \citep[see][for the procedure]{vehtari2017b}.
It is then easy to approximate the desired quantities for the LOO folds using these weights.
For instance, in the clustered projection for the Gaussian linear model we need the predictive means $\vs \mu_*^c$ and variances $(V_1^c,\dots,V_n^c)$ from the reference model for each cluster $c$.
If the reference model is also linear with Gaussian noise, using the notation from Section~\ref{sec:glm}, the predictive means at the observed inputs for the $i$th LOO are given by
\begin{align}
\vs \mu_*^c = \sum_{s\in I_c} w_s^{(i)} \, \vc Z \vs \beta_*^s,
\end{align}
where the weights are assumed to be normalized $\sum_{s\in I_c} w_s^{(i)} = 1$.
Correspondingly, the predictive variance at point $j$ for the $i$th LOO is given by
\begin{align}
V_j^{c}
&= \sum_{s\in I_c} w_s^{(i)} \, \sigma^2_{*,s} +
\svar[s \in I_c]{}{ \vc z_j^\mathsf{T} \vs \beta_*^s, w_s^{(i)} } %
\label{eq:predvar_loo}
\end{align}
where $\svar[s \in I_c]{}{\, \cdot, v_s}$ denotes the weighted sample variance over indices $s \in I_c$ with weights $v_s$.
Equation~\eqref{eq:predvar_loo} is merely the weighted version of formula~\eqref{eq:predvar}.
The feature selection and the projection onto the submodels at the search path are then carried out for each LOO exactly as in the $K$-fold case.
Exactly the same decision rules as with the $K$-fold validation can be used to decide the appropriate model size, the LOO method simply gives an alternative procedure for computing the pointwise utilities, $u_k^{(i)}$ and $u_*^{(i)}$, for the reduced and reference models, respectively.
PSIS has the benefit that it gives us the Pareto $\hat k$-diagnostics for each LOO describing the accuracy of the importance sampling approximation.
\cite{vehtari2017b} discuss the interpretation of the $\hat k$-values in detail. Based on theoretical and empirical considerations, they conclude that values $\hat k\le 0.7$ indicate reliable approximation.
Larger values indicate that the calculated utilities $u_k^{(i)}$ and $u_*^{(i)}$ for such observation $i$ have high variance and can be biased (optimistic).
In Section~\ref{sec:toy_revisited} we demonstrate empirically that even when a few $\hat k$-values exceed this threshold the relative utility estimate~\eqref{eq:rel_util_mean} can be nearly unbiased since the bias in both $u_k^{(i)}$ and $u_*^{(i)}$ tends to cancel out in the subtraction.
\subsubsection{Subsampling}
\label{sec:subsampling_loo}
Although the (PS)IS-LOO validation avoids the repeated fitting of the reference model, the computation can still get quite involved for large data sets if the selection and projection onto the reduced models is repeated $n$ times.
In such situations it is usually advisable to resort to $K$-fold validation (or hold-out), but an alternative approach would be to compute only a subset of the LOO folds.
Selecting a random subsample of $m < n$ datapoints gives us an unbiased estimate of the submodel utilities but with higher variance than would be obtained by computing all the $n$ LOOs.
This method is analogous to the hold-out method, but with the difference that the full model is learned using all the data.
Since we expect the whole projective idea to be most advantageous when $n$ is small (and hence uncertainties high), we do not focus on large data sets but provide some further ideas of reducing the variance of the subsampling LOO estimate in appendix~\ref{app:subsampling_loo}.
\subsection{Importance of validating the search}
\label{sec:search_validation}
In order to reduce computations, it might be tempting to perform the reference model fitting and feature selection only once using all the available data, and then simply use LOO or $K$-fold CV to estimate the performance of the found submodels.
We strongly advice \emph{not} to employ this strategy, as this is known to produce biased performance estimates, and the bias can be substantial especially for small $n$ and large number of features~\citep[see][for illustrations]{piironen2017a}.
To avoid the selection induced bias, it is important that the same data are never used simultaneously for selection and assessment, meaning that the selection must be performed separately for each of the cross-validation folds regardless of the feature selection method.
Section~\ref{sec:toy_revisited} shows an example of the resulting bias when the selection process is not taken into account in the model assessment.
\section{On the construction of the reference model}
\label{sec:refmodel_construction}
How to construct a good reference model is naturally a central issue in the whole projective approach.
It should be clear that this is essentially an open-ended question with no definite answer; for each problem there are endless choices.
For simple linear and logistic regressions with moderate number (say less than a hundred) features we recommend using all the features with a sparsifying prior, which can work better than a non-sparse prior like Gaussian.
If one is uncertain about the prior, the recommended strategy is to try different choices and compare the resulting fits with cross-validation.
In high-dimensional problems, say with hundreds of features or more, fully Bayesian approach can still provide a good fit but can also prove computationally expensive~\citep{piironen2017c}.
Using either feature screening, dimension reduction or the combination of the two can be very successful for alleviating the computational burden without sacrificing the predictive accuracy~\citep{neal2006,fan2008,piironen2018}.
In our experience this is true especially for data sets that have plenty of features many of which are correlated with each other and predictive about the target variable.
Microarray data sets (Sec.~\ref{sec:microarray_data}) are typical examples that fall into this category.
For these problems a simple but useful recipe combining feature screening and dimension reduction is known as supervised principal components (SPCs)~\citep{bair2006}, which works as follows.
First, univariate correlations $R(x_j,y)$ between each feature $x_j$ and the class label $y$ are computed, and only features with $|R(x_j,y)|$ above some threshold $\gamma$ are retained.
This yields a reduced feature matrix $\vc X_\gamma$, from which one then computes the first $n_c$ principal components $(z_1,\dots,z_{n_c})$ and uses these as the predictors for the reference model.
The advantage over the unsupervised principal components is that the screening step anticipates variation in the original features unrelated to the variance in $y$, and therefore the predictive power is typically more heavily loaded on the first few components.
In the experiments of this paper, the screening threshold $\gamma$ is selected using fivefold cross-validation from a coarse grid of $n_\gamma=7$ values evenly spaced between $\gamma_\tx{min}$ and $\gamma_\tx{max}$, where $\gamma_\tx{min}$ is the largest $\gamma$ such that none of the features are discarded and $\gamma_\tx{max}$ the smallest $\gamma$ such that only one feature survives the screening.
Furthermore, we use $n_c=3$ SPCs with a Gaussian prior $\Normal{0,\tau^2}$ for the regression coefficients and hyperprior $\tau \sim \halfStudent[4]{0,s_\tx{max}^{-2}}$ where $s_\tx{max}$ denotes the standard deviation of the largest principal component (this is done only to make the prior roughly the same regardless of the scale of the SPCs).
We emphasize that we do \emph{not} argue that this gives a foolproof method for constructing a good reference model.
Rather the purpose is to demonstrate that even with such a simple, easy-to-implement and computationally light method it is possible to come up with a reference model that gives good results and improves feature selection in many cases.
Indeed, in our earlier work we found that the optimal method is in general data set dependent, and in some cases better results can be obtained by other choices such as the iterative version of the above algorithm~\citep{piironen2018}.
Again, cross-validation and posterior predictive checks should be used to guide the selection of the reference model~\citep{gelman2013book,vehtari2017b,gabry2018}.
A~generic strategy for improving the prediction accuracy is also to average over several models, using either stacking or (pseudo) Bayesian model averaging~\citep{yao2018}, or boosting or bagging in non-Bayesian context~\citep[see, e.g.,][]{hastie2009book}.
\section{Experiments}
This section presents several examples of the projective method.
We shall first demonstrate the basic usage of the different projection techniques and the new LOO validation for the model size selection, and then compare the projective approach to the elastic net family estimators.
For fitting the Bayesian reference models we use Stan~\citep{stan_manual}, with the convenient interfaced to GLMs provided by R-packages {\tt rstanarm}~\citep{rstanarm} and {\tt brms}~\citep{burkner2017}.
All the projections are computed using our R-package {\tt projpred}.
The results for the elastic net family methods are computed using R-package {\tt glmnet}~\citep{friedman2010}.
\subsection{Illustration of different projections}
\label{sec:clusterdemo}
This section illustrates the differences between the three projection techniques introduced in Section~\ref{sec:projection_methods}.
Consider the following synthetic binary classification data.
For instances belonging to the first class, the first three features are drawn from independent Gaussians with mean $1$ and scale $0.5$, whereas for the observations from the second class the mean and scale of these features are $-1$ and $0.5$, respectively.
In addition, the data has 27 additional noise features that are drawn from independent standard Gaussians, so the data has 30 features altogether (out of which the only the first three are predictive about the class label).
We generated one data realization with $n=50$ observations and fitted Bayesian logistic regression model to those data using the RHS prior~\eqref{eq:rhs_prior} with hyperparameter choices $p_0=1$, $s^2=1$ and $\nu=4$.
This serves as our reference model.
\begin{figure}[t]
\centering
\minput[pdf]{clusterdemo}
%
\caption{ {\it Demonstration of different projections:} The full posterior with $p=30$ features projected onto the first two features using the draw-by-draw approach (left column), single point projection (middle column) or 10 clusters projection (right column). Top row shows the observed data and the contours (from 0.1 to 0.9) of the predictive probability for $\ti y = 1$, whereas middle row shows the predictive probabilities at the observed input locations (vertical axis denoting the result for the full model with all features, and horizontal axis for the projection of the corresponding column). Bottom row shows the projected regression coefficients (black dots) as well as the draws from the full posterior (gray crosses). In bottom row plots, the dot sizes denote the relative weights (the dot sizes between different columns are not comparable).}
\label{fig:clusterdemo}
\end{figure}
Figure~\ref{fig:clusterdemo} illustrates the posterior projection onto the first two features for the three different projections: draw-by-draw (left column), single point (middle column) and 10 clusters (right column).
We observe that even with the single point projection, the predictive probabilities are very close to those of the draw-by-draw projection (see top and middle row), and projecting 10 clusters gives predictions indistinguishable from the draw-by-draw projection for all practical purposes.
This result is insightful, as one might think that the single point projection would be substantially inferior because it computes only point estimates for the projected model.
The key insight is that these point estimates are computed so as to take into account the uncertainty in the parameters of the full model.
Therefore the resulting predictive distribution is much closer to that of the full model than what would be obtained by projecting only the posterior mean of the full model or by computing the maximum likelihood estimates for the submodel (which in this case do not even exist because the classes are separable).
Another important point is that even for the draw-by-draw method the projected posterior is in general different from the marginal posterior for those parameters in the full model (see the bottom left plot in Fig.~\ref{fig:clusterdemo}).
In particular, the projected posterior has vanishingly little mass near the origin $\beta_1=\beta_2=0$, although the full posterior has substantial mass there.
This makes sense: after removing feature $x_3$ which is predictive and highly correlated with $x_1$ and $x_2$ the coefficients of $x_1$ and $x_2$ can not \emph{both} be set to zero, otherwise the predictions would seriously be affected.
As discussed earlier, the benefit of the clustered projection compared to the draw-by-draw projection is its speed; projecting only $C$ clusters cuts down the computations by a factor of $C/S$, where $S$ is the number of draws that would be projected in the draw-by-draw projection.
The computational savings can be huge when projections need to be computed onto many models, such as with the LOO validation.
For instance, for this data set computing the projections of each of the $n=50$ LOO posteriors for all model sizes up to 30 features in a naive fashion would require a total of 1500 projections, each of which takes around a second or two depending on the hardware.
Thereby with the clustered projection we can reduce the computation time from the order of 25--50 minutes to about 4--8 seconds\footnote{In a careful implementation the difference would not be quite as dramatic since some of the submodels would be visited in many of the $n=50$ folds, so their projections would not need to be computed again every time, but this example still gives a good idea of the computational gain.}.
The additional benefit of the single point projection is that it can be combined with the sparsity enforcing penalty functions (Sec.~\ref{sec:search_heuristics}) which allows for fast searching for promising submodels.
For these reasons, our preferred choice is to use one cluster projection in the selection phase, and a small number of clusters (such as 5--10) when making predictions with the submodels, especially if many submodels need to be considered.
Still, we find the draw-by-draw projection most convenient for visualizing the projected posterior distributions for instance when credible intervals or regions are of interest.
It also serves as a useful yardstick for checking and confirming the accuracy of the clustered projection.
\subsection{Simulated example revisited with projection and LOO}
\label{sec:toy_revisited}
We shall now revisit the simulated example discussed in Section~\ref{sec:toy_example} and illustrate the steps of projective selection as well as our new LOO validation technique.
The first step is to decide the reference model, which we would in practice do by assessing the fits of each of the candidate models using cross-validation and posterior predictive checks.
The sums of LOO log predictive densities for the Gaussian and RHS priors are $-76.8$ and $-77.6$ with standard errors $6.8$ and $6.2$, respectively, so there is no significant difference between the predictive fits between these models (this holds also if we make the comparison in pairwise fashion, like in Eq.~\eqref{eq:rel_util_mean} and~\eqref{eq:rel_util_se}).
The R package {\tt spikeslab} does not provide the posterior draws for the regression coefficients and thus we cannot compute LOO for the SS prior, so we ignore it for now.
Suppose we select the model with RHS prior as our reference model (the results for Gaussian prior are shown in Appendix~\ref{app:extra_results}).
We then run the projective feature selection with the $L_1$-search and assess the accuracy of the submodels using the LOO approach (Sec.~\ref{sec:loo_validation}).
The MLPD for the submodels relative to the reference model are shown in the bottom left subplot of Figure~\ref{fig:toy_assessment_rhs} (blue curve).
The one standard error -rule (Sec.~\ref{sec:kfold_validation}) would suggest selecting one feature, which results in a small loss in accuracy on test data (black curve) compared to the reference model.
The top left subplot shows the MLPD on the actual scale, which demonstrates how much larger the uncertainty is about the actual MLPD than about the relative MLPD.
\begin{figure}[t]
\centering
\minput[pdf]{toy_assessment_rhs}
%
\caption{ {\it Simulated example, projective selection:} Left column: MLPD and relative MLPD with one standard error intervals on independent test data of 1000 points (black) and using LOO (blue) for the selected and projected submodels. The data has $p=50$ features and the reference fit is the linear model with RHS prior (the same as in the right middle subplot of Figure~\ref{fig:toy_marginals}). Right column: The same but results are averaged over 200 data realizations. The orange curves show the LOO for the submodels if the feature selection is done only once, and not separately for each of the $n$ folds. The difference to the blue curve comes from the selection induced bias. }
\label{fig:toy_assessment_rhs}
\end{figure}
The right column of Figure~\ref{fig:toy_assessment_rhs} shows the average LOO curves for both MLPD and relative MLPD over 200 data replications.
These graphs demonstrate that the actual LOO values for the submodels are slightly biased (optimistic).
This is due to a small bias in the PSIS-LOO for the reference model, which is also diagnosed by a few $\hat k$-values that exceed 0.7 in most data realizations.
Notice though, that the results for the relative MLPD are still essentially unbiased for submodels with performance close to the reference model, because the bias cancels out in subtraction~\eqref{eq:rel_util_mean} (see Sec.~\ref{sec:loo_validation}).
In other words, even if we have only a biased estimate of the reference model utility, we can still get a good indication of whether our submodel performance is close to that of the reference model.
Right column subplots of Figure~\ref{fig:toy_assessment_rhs} also show the expected LOO results if we do \emph{not} take into account the selection induced bias but perform the selection only once (not separately for the $n$ folds) and then compute LOO for the submodels (see Sec.~\ref{sec:search_validation}).
The selection induced bias is clear although only moderate in this particular example.
For assessing the submodel accuracies, LOO validation is very useful in this particular example because of a few reasons.
Firstly, PSIS-LOO works pretty well for the full model (only a few $k$-values above 0.7 in most data realizations).
Secondly, the number of features is only moderate and hence the feature selection is very fast.
Thirdly, the number of observations is small, so the number of selection paths we need to compute is also small.
Consequently, the whole validation process takes only a few seconds, which is much less than a single model fit with the horseshoe prior (around half a minute with a standard laptop), so the computational savings compared to $K$-fold cross-validation are clear.
\subsection{The benefit of using a reference model}
\label{sec:benefit_of_reference}
This section demonstrates the benefits of a reference model for feature selection and parameter estimation in the submodels.
We again utilize simulated data generated by mechanism~\eqref{eq:toy_data}, and consider both regression with the original $y$ regressed on $(x_1,\dots,x_p)$, and binary classification with target variable defined as an indicator $y_\tx{class} = \indicator{y>0}$.
We used a setup with $n=50$ training observations with $p=500$ features, out of which first $p_\tx{rel}=50$ were relevant, and report average results over 50 data realizations for $\rho$-values of $0.3$, $0.5$ and $0.8$.\footnote{We also considered varying values for $p_\tx{rel}$ but the conclusions are not sensitive to the selected value $p_\tx{rel}=50$.}
The reference model is fitted using SPCs as discussed in Section~\ref{sec:refmodel_construction}.
We tested four different strategies for selecting features and making predictions with the selected subsets of features:
\begin{enumerate}
\item \emph{Lasso}: Sort the variables from the most relevant to least relevant according to the order in which they enter the model as the regularization coefficient $\lambda$ is decreased. For a given number of features, the submodel coefficients are computed using the smallest~$\lambda$ for which other variables do not enter the model. In the regression problems, the noise variance~$\sigma^2$ is estimated as proposed by \cite{reid2016}, that is, by dividing the sum of the squared residuals by $n-p_\tx{act}$ where $p_\tx{act}$ denotes the number of active features in the submodel.
\item \emph{Lasso, relaxed}: Same as Lasso, but after sorting the variables, the submodel coefficients and predictions are computed without any regularization (which affects also the estimated noise variance in regression).\footnote{We are aware that the term `relaxed Lasso' has been used to denote a more general method where after feature selection the coefficients are computed with a small but nonzero $L_1$-penalty~\citep{meinshausen2007}. The complete relaxation (i.e., zero penalty after selection) was referred to as `Lasso-OLS hybrid' by \cite{efron2004}}
\item \emph{$L_1$-projection}: $L_1$-penalized projection~\eqref{eq:elnet_projection} varying $\lambda$ similarly as in Lasso. In regression, the projected noise variance is computed according to Equation~\eqref{eq:proj_sigma2} (where $C=1$).
\item \emph{$L_1$-projection, relaxed}: Same as $L_1$-projection, but after sorting the variables, the submodel coefficients are projected without any regularization (which affects also the projected noise variance in regression).
\end{enumerate}
Notice that all these methods utilize only point estimates for the model parameters in the submodels, the difference is only how they are computed.
\begin{figure}[t]
\centering
\minput[pdf]{proj_vs_lasso_reg}
\vspace{-0.5cm}
\caption{ {\it Benefit of reference model, regression:} MLPD and MSE on test data, along with the estimated noise standard deviation as a function of number of features selected after $L_1$-penalized search, before and after relaxation (dashed and solid, respectively), with and without utilizing the reference model (blue and orange, respectively). Different columns show results for different values of $\rho$ (see Eq.~\eqref{eq:toy_data}). Errorbars indicate one standard error intervals and black dashed lines the reference model result. In the bottom row plots the gray line denotes the true noise standard deviation.}
\label{fig:proj_vs_lasso_reg}
\end{figure}
\begin{figure}[t]
\centering
\minput[pdf]{proj_vs_lasso_classif}
\vspace{-0.5cm}
\caption{ {\it Benefit of reference model, classification:} Results analogous to those in Figure~\ref{fig:proj_vs_lasso_reg} but for the classification data. Here shown are MLPD and classification accuracy on test data.}
\label{fig:proj_vs_lasso_classif}
\end{figure}
Figure~\ref{fig:proj_vs_lasso_reg} shows the regression MLPD and MSE on independent test data as well as the projected noise standard deviation for different submodel sizes.
The blue curves demonstrate the benefit of relaxation for $L_1$-projection: both eventually achieve the performance of the reference model but without relaxation this requires many more features.
The reason is the inherent tradeoff between shrinkage and selection: in order to force most of the regression coefficients to zero, the regularization coefficient $\lambda$ must be made large, but this will also overshrink the nonzero coefficients.
Therefore projecting without any penalization after selection achieves greatly improved tradeoff between accuracy and model complexity.
Notice in particular that here no regularization is needed to avoid overfitting in projection; when more features are added the projected submodels simply get closer to the reference model.
However, the picture is quite different when the parameter estimates are computed based on the observed data without utilizing the reference model (Fig.~\ref{fig:proj_vs_lasso_reg}, orange curves).
The relaxation improves the fit in terms of MSE for submodels with only a few features but results in overfitting for larger models.
In terms of MLPD the relaxed Lasso performs worst overall indicating badly calibrated uncertainties in the predictive distributions, which is mostly due to underestimation of the noise variance (bottom row) for most model sizes.
Projection methods on the other hand show very good calibration of predictive uncertainties which is evident from superior MLPD and noise variance estimation for most model sizes.
Overall the projection approach shows a bigger edge for~$\rho=0.3$ and $\rho=0.5$ where the individual features are less predictive.
Figure~\ref{fig:proj_vs_lasso_classif} shows the analogous results for the classification data.
The conclusions are very similar to those drawn from the regression example.
Here the relaxed Lasso overfits even more severely; although the classification accuracy is similar to the Lasso, the MLPD is very low indicating bad calibration in the predicted class probabilities.
Again, the edge for projection is more pronounced for $\rho=0.3$ and $\rho=0.5$, but we observe that for these cases also the relaxed projection struggles to achieve the same MLPD as the reference model, and for larger number of features (15--25) the penalized projection achieves slightly better results.
This is due to a small instability of the projection in data sets where some of the reference class probabilities are close to 0 and 1 and shows that even the projection, although very resilient, is not always entirely immune to overfitting.
\subsection{Real world benchmarks}
\label{sec:microarray_data}
This section shows how the projection compares in high-dimensional real world problems.
We use microarray data sets\footnote{All except the Ovarian data are available at \url{http://featureselection.asu.edu/datasets.php}.} some of which have been used as benchmarks by several authors~\citep{li2002,lee2003,hernandezlobato2010}.
All data sets deal with binary classification, and the number of features and data set sizes can be found in Table~\ref{tab:computation_times}.
Again, as a reference model we use the one described in Section~\ref{sec:refmodel_construction} and call it here `Bayes SPC'.
For the projection method, we used $L_1$-search and made the submodel predictions using five clusters projection.
Notice that although the reference model employed only a reduced set of features (those that survived the screening), the projective selection considered all the features (no pre-selection).
The number of features was decided based on fivefold cross-validation.
To investigate the effect of the model size selection heuristic discussed in Section~\ref{sec:kfold_validation}, we report results for the smallest number of features that had its cross-validated MLPD within one standard error away from the reference model (`Proj-ref-1se') or from the best submodel ('Proj-best-1se').
We also report results ('Proj-ref-1se-reg' and 'Proj-best-1se-reg') that are otherwise exactly the same as the two above but utilize a little bit of ridge regularization (with $\lambda=0.1$) in the submodel projections which was observed to improve the numerical stability in cases where some of the reference model class probabilities are close to~0 and~1.
For comparison, we computed results for Lasso, elastic net (with $\alpha=0.7$ and $\alpha=0.3$) and ridge.
To investigate the sensitivity of these to the selection of the regularization parameter $\lambda$, we report results for two choices: $\lambda_\tx{opt}$ denotes the value that minimizes the tenfold CV-error whereas $\lambda_\tx{1se}$ (default in {\tt glmnet}) denotes the largest $\lambda$ which has its CV-error within one standard error of that of~$\lambda_\tx{opt}$.
To avoid any possible biases in the comparisons, the out-of-sample predictive accuracies for all the methods were assessed using an outer tenfold cross-validation.
That is, the reference model, projected submodels as well as the baseline methods were computed ten times, each time leaving one tenth of the data out and then validating the found models on this left-out data.
The MLPD and classification accuracies from the outer cross-validation are shown in the first two rows of Figure~\ref{fig:realdata}.
Overall the differences between the methods are fairly small compared to the standard errors in the estimates.
In terms of MLPD, the reference model Bayes SPC gives somewhat better results than Lasso, elastic net and ridge with $\lambda_\tx{1se}$, but all these give similar results when $\lambda_\tx{opt}$ is used, and in fact ridge gives a bit better results for Leukemia data.
All projections have statistically indistinguishable MLPD compared to Bayes SPC, but the model size selection with `best-1se' performs slightly better in terms of classification accuracy.
Adding a little bit of regularization does not hurt predictive accuracy but we noticed that it makes the projection numerically more stable in cases where the reference class probabilities are close to 0 and 1.
The bottom row of Figure~\ref{fig:realdata} shows the number of selected features for each method.
The projection methods produce by far the most parsimonious models (notice the log scale).
The only data set where Lasso (with $\lambda_\tx{1se}$) selects fewer variables is Leukemia, but there it also yields inferior results in terms of MLPD.
This is perfectly in accordance with the results shown in Figures~\ref{fig:proj_vs_lasso_reg} and~\ref{fig:proj_vs_lasso_classif}: the projection finds very good tradeoff between sparsity and accuracy.
To fully respect the differences in the number of features used, we have also reported them using hard numbers in Table~\ref{tab:nfeat} (appendix~\ref{app:extra_results}) since an accurate comparison on the log scale is somewhat cumbersome.
The computation times are shown in Table~\ref{tab:computation_times}.
After forming the reference model, the projection is computationally only slightly more expensive than Lasso and the increase comes from the relaxed projections (the predictions are computed without the $L_1$-penalty).
Although not as highly optimized as {\tt glmnet}, our software is reasonably fast even for the largest problems.
Forming the reference model (Bayes SPC) is computationally the most expensive part, though still very affordable considering that all the computations (reference model construction and projection) for the largest number of features can be done in about two minutes.
Indeed, this demonstrates that the projection can be very feasible computationally and it can yield improved results to the standard approaches, as were shown in Figure~\ref{fig:realdata}.
\section{Theoretical results}
In this section we present a theorem that helps us to understand when the reference model could be helpful for parameter learning in linear submodels.
Here we only state the results, the proofs can be found in appendix~\ref{app:proofs}.
\begin{figure}%
\vspace{-0.99cm}
\centering
\minput[pdf]{realdata}
%
\vspace{-1cm}
\caption{ {\it Microarray benchmark data sets:} MLPD (top row), classification accuracy (middle row) and the number of features used (bottom row) with one standard error intervals for the different data sets. The last column denotes the average. In all plots the dashed vertical line denotes the results for the Bayes SPC that is used as the reference for the projections. Many methods produce comparable predictive accuracy but the projection methods achieve the same accuracy with far fewer features (notice log scale in the bottom row plots). }
\label{fig:realdata}
\end{figure}%
\begin{table}%
\vspace{-0.1cm}
\centering
\abovetopsep=2pt
\begin{tabular}{ lccrrrrr }
\toprule
Data set & $n$ & $p$ & \multicolumn{5}{c}{Computation time} \\
\cmidrule(r){4-8}
& & & Bayes SPC & Projection & Lasso ({\tt \small projpred}) & Lasso & Ridge \\
\midrule
Ovarian & 54 & 1536 & 30.4 & 3.6 & 1.3 & 0.2 & 1.5 \\
Colon & 62 & 2000 & 31.0 & 4.0 & 1.6 & 0.3 & 2.2 \\
Prostate & 102 & 5966 & 49.4 & 7.6 & 5.0 & 0.8 & 7.5 \\
Leukemia & 72 & 7129 & 47.0 & 6.3 & 5.6 & 0.7 & 9.4 \\
Glioma & 85 & 22283 & 95.8 & 14.2 & 15.6 & 2.6 & 52.2 \\
\bottomrule
\end{tabular}
\caption{{\it Microarray benchmark data sets:} Average computation time (in seconds) over five repeated runs. In all cases the time contains the cross-validation of the tuning parameters and/or the model size. The first result for Lasso is computed using our software ({\tt projpred}) whereas the second result (and that of ridge) is computed using the R-package {\tt glmnet} which is more highly optimized. }
\label{tab:computation_times}
\end{table}
Let $\vc X = (\vc x_1^\mathsf{T},\dots, \vc x_n^\mathsf{T}) \in \Re^{n \times p}$ be the design matrix and $\vc y = (y_1, \dots, y_n) \in \Re^n$ the target measurements.
Assume the target measurements decompose as $y_i = \mu(\vc x_i) + \varepsilon_i$, where $\mu(\vc x)$ is the true expected value of $y$\, given $\vc x$, $\mu(\vc x) = \mean{y \given \vc x}$, and $\varepsilon_i$ are i.i.d. random numbers independent of~$\vc x$ with zero mean and finite variance $\sigma^2$ denoting the variation in $y$ that cannot be explained by~$\vc x$.
It should be emphasized that although we assume $\varepsilon$ denotes random error independent of $\vc x$, it may contain systematic variation related to some other (unobserved) features not included in $\vc x$, and hence the magnitude of $\varepsilon$ should be interpreted as the irremovable error for this particular set of features $\vc x$.
In vector notation, $\vc y$ decomposes as $\vc y = \vs \mu + \vs \varepsilon$, where $\vs \mu = (\mu(\vc x_1),\dots,\mu(\vc x_n))$ and $\vs \varepsilon = (\varepsilon_1,\dots,\varepsilon_n)$.
Furthermore, in what follows we shall use the shorthand notation $||\vc v||^2_{\vc M} = \vc v^\mathsf{T} \vc M \vc v$, where $\vc v$ is a vector and $\vc M$ a positive definite matrix.
Consider two methods of estimating the regression coefficients when regressing $\vc y$ on $\vc X$, namely
\begin{align}
\vs {\hat \beta} = (\vc X^\mathsf{T} \vc X)^{-1} \vc X^\mathsf{T} \vc y \quad \tx{and} \quad
\vs \beta_\perp = (\vc X^\mathsf{T} \vc X)^{-1} \vc X^\mathsf{T} \vs \mu_*.
\label{eq:coeff_ls_and_ref}
\end{align}
Here $\vs{\hat \beta}$ is the familiar least squares estimate, and $\vs \beta_\perp$ a projection of an arbitrary reference fit $\vs \mu_* \in \Re^n$.
Let us then define the expected prediction error for any vector of coefficients $\vs \beta$ as
\begin{align*}
\Delta(\vs \beta) = \mean[\vc{\ti y}]{ \frac{1}{n}|| \vc X \vs \beta - \vc{\ti y} ||^2 }.
\end{align*}
Notice that although we consider here the predictions at the observed input locations $\vc X$, the expectation is with respect to a set of \emph{new} measurements $\vc{\ti y} = \vs \mu + \vc {\ti e}$, where $\vc{\ti e}$ is a vector of new noise terms $\ti \varepsilon_1,\dots,\ti \varepsilon_n$.
The gain from using $\vs \beta_\perp$ instead of $\vs{\hat \beta}$ is defined as the reduction in the expected prediction error
\begin{align}
G = \Delta(\vs{\hat \beta}) - \Delta(\vs \beta_\perp).
\label{eq:gain}
\end{align}
We have the following lemma.
\begin{lemma}
Assume regression coefficient estimators $\vs{\hat \beta}$ and $\vs \beta_\perp$ as defined by Equation~\eqref{eq:coeff_ls_and_ref}. The gain~$G$ (Eq.~\eqref{eq:gain}) of using $\vs \beta_\perp$ instead of $\vs{\hat \beta}$ satisfies
\begin{align*}
G = \frac{1}{n}\left( ||\vc y - \vs \mu||_{\vc P}^2 - ||\vs \mu_* - \vs \mu||_{\vc P}^2 \right),
%
\end{align*}
where $\vc P = \vc X (\vc X^\mathsf{T} \vc X)^{-1} \vc X^\mathsf{T}$.
\label{lemma:gain}
\end{lemma}
Since both $||\vc y - \vs \mu||_{\vc P}^2$ and $||\vs \mu_* - \vs \mu||_{ \vc P}^2$ are non-negative, the interpretation of Lemma~\ref{lemma:gain} is that for linear submodels, one can expect to gain (that is, $G \ge 0$) from using a reference model when the reference fit $\vs \mu_*$ is closer to the best possible prediction $\vs \mu$ (with features $\vc x$) than the observed noisy target values $\vc y$ (with the norms taken with respect to the projection matrix $\vc P$).
This makes perfect sense: if we fit our model to pseudo-data $\vs \mu_*$ instead of the actual data $\vc y$, we expect to do better if the pseudo-data are closer to the true underlying conditional mean $\mu(\vc x) = \mean{y\given \vc x}$, that is, less noisy than the actual data.
Notice that the lemma makes no assumptions about the form of the true underlying mean $\mu(\vc x)$ that captures the relationship between $y$ and~$\vc x$.
In particular, $\mu(\vc x)$ need not be linear in $\vc x$, not even smooth or continuous.
Neither does the lemma assume anything about how the reference fit $\vs \mu_*$ is constructed.
Let us now assume the differences $\vc e_* = \vs \mu_* - \vs \mu$ are random numbers with mean $\vc b$ and covariance~$\vc K$.
These describe the bias and variance in the reference fit.\footnote{Here we mean bias and variance both due to fitting the reference model to a finite data set and having unobserved features. For example, even if our reference model was a completely deterministic function of $\vc x$ and some other features $\vc z$, then its value in a particular location $\vc x_i$ is still random as it depends on the realized value for $\vc z$.}
We have the following theorem
\begin{theorem}
Assume the terms $\vc e_* = \vs \mu_* - \vs \mu$ have mean $\vc b \in \Re^n$ and covariance $\vc K \in \Re^{n\times n}$. Then the expected gain can be written as
\begin{align*}
\mean{G} = \frac{1}{n}\left( \sigma^2 p - \tr{\vc P \vc K} - ||\vc b||_{\vc P}^2 \right).
\end{align*}
\label{thm:gain}
\end{theorem}
Theorem~\ref{thm:gain} further decomposes the reference model error into bias and variance.
The term $\tr{\vc P \vc K}$ is difficult to grasp without further assumptions, but the theorem can be understood more easily by the following immediate corollary.
\begin{corollary}
Assume the reference model errors are uncorrelated with a common variance, that is, $\vc K = \sigma_{\mu_*}^2 \vc I$.
Then the expected gain $\mean{G}$ simplifies to
\begin{align*}
\mean{G} = \frac{p}{n} \left( \sigma^2 - \sigma_{\mu_*}^2 - \frac{1}{p} ||\vc b||_{\vc P}^2 \right).
\end{align*}
\label{clry:uncor_err}
\end{corollary}
This corollary states that with an unbiased reference model ($\vc b = 0$) we can expect to gain when the variance of the residuals $\vs \mu_*-\vs \mu$ is smaller than the variance of $\vc y - \vs \mu$.
Furthermore, the gain increases with the dimensionality of the projection space $p$, but on the other hand goes to zero when $n \rightarrow \infty$.
This is also in perfect accordance with the empirical results, for instance those shown in the middle row of Figure~\ref{fig:proj_vs_lasso_reg}.
There the difference in predictive MSE between relaxed Lasso and projection is small up to about $p=2$, but then starts to increase gradually.
On the other hand we know the least squares fit gives us the optimal coefficients at the limit $n \rightarrow \infty$ and hence we do not expect to gain anything then with a reference model.
The above analysis assumes the future predictions are made at the observed input locations.
Usually this is not quite a realistic assumption, but it still gives us some idea when the reference model could be useful.
Extending the result to different $\vc {\ti x}$ would require assumptions about the functional form of $\mu(\vc x)$.
Furthermore, here we used squared error as the loss function as it allows for tractable analysis, but we expect one of the major advantages of the projection to be that it conserves the predictive uncertainties well which are not measured by the squared error.
Finally, this analysis considers only parameter learning in the submodels but it says little about when the reference model can improve the \emph{selection} of a better feature combination.
In principle it is possible to improve selection even when the reference model is not unbiased, as long as the bias is ``in the right direction'', for instance so that it favors certain features over the others.
We have discussed in a bit more detail in our earlier work, see Section~3 in \cite{piironen2017a}.
The empirical evidence about the improved selection is convincing (Sec.~\ref{sec:intro_example}) but currently we are not aware of any theoretical analysis on this topic.
\section{Discussion}
Below we provide some final remarks, together with recommendations for practitioners and possible directions for future research.
\subsection{Projection versus Lasso and related methods}
Although our results indicate that with a reasonable reference model the relaxed $L_1$-projection outperforms Lasso in terms of tradeoff between sparsity and accuracy, there is no question that Lasso and the whole elastic net family are useful methods.
These methods are fast to fit and often provide good results without any hand tuning, so they are very useful for getting a good predictive baseline for almost any problem.
In addition to better tradeoff between sparsity and accuracy, the projection has the upside that it provides a principled approach to handling also parameters other than the regression coefficients.
For instance, projecting the noise variance in linear regression is trivial and analytical solution exists (see Sec.~\ref{sec:glm}) whereas for Lasso this is considered to be a difficult problem~\citep{reid2016}.
This property is very beneficial in all settings where additional dispersion parameters need to be estimated.
These situations come up frequently, such as in survival analysis with parametric observation models~\citep{peltola2014}.
Another benefit is that the projection gives a principled answer to how to make predictions when some of the features we would like to use are unavailable at prediction time (missing data)~\citep{lindley1968}.
\subsection{Multiple hypothesis testing}
\label{sec:multiple_hypothesis}
In this paper we have focused on selecting a minimal subset of features that are sufficient for achieving accurate predictions.
As pointed out in Section~\ref{sec:selection_terminology}, this is a different problem from what is known as multiple hypothesis testing, where one is less interested in predictive accuracy but the desire is to identify all the features that are statistically related to the target variable.
For instance, in gene expression studies it is conventional to try to identify genes whose expressions are different between two groups (say between control and cancer patients).
This is often done by computing some statistic for each feature (say two sample $t$-statistic) and then based on these trying to distinguish between significant and non-significant features using either frequentist of Bayesian approaches.
For a nice overview, see \cite{efron2010book}, and for more recent Bayesian accounts, see \cite{bhattacharya2015,bhadra2017} and \cite{vanderpas2017}.
The empirical evidence indicates that the reference model approach could be highly useful also in this problem setting since it tends to help rank the truly relevant features before the irrelevant ones (Sec.~\ref{sec:intro_example}).
Still, it is an open question which approach to use for detecting the truly relevant features, but this is a research area on its own.
\subsection{Future directions}
There are several natural directions to continue this work.
An obvious topic for generalized linear models would be implementing the projection to multiclass classification which has not been done yet but would be straightforward.
Another useful noise model would Student-$t$ which can find applications in data sets with outliers.
This likelihood is not log-concave, but the minimization of the KL-divergence could be implemented using the EM-approach that can be used to find the maximum likelihood solution for the regression coefficients.
Other relatively straightforward extensions would be hierarchical GLMs and generalized additive models (GAM) which provide more flexibility but for which the projection should be implementable using the methodology presented in Section~\ref{sec:projection}.
Ultimately we would like to extend the projection framework to nonlinear models such as Gaussian processes (GP).
This topic was tentatively pursued in \cite{piironen2016} with promising results, but that approach is computationally too expensive and prohibitive for large data sets.
It could be possible to formulate the projection in a more clever way by borrowing ideas from the stochastic variational inference algorithms that have proven useful for GP learning with large data sets.
Another difficulty with GPs is that due to their flexibility, the minimization of KL-divergence locally at training inputs does not necessarily guarantee small divergence elsewhere.
We also believe the projective approach could find more applications in improving interpretability and transparency of complex black box models such as deep neural networks, an idea that was explored recently by \cite{ribeiro2016} and \cite{peltola2018}.
For example, in image classification one could approximate the prediction surface of the complex classifier with a linear model in the vicinity of a misclassified image to figure out which of the pixels had high weight in making the decision.
\acks{
We thank Michael Riis Andersen for helpful discussions.
}
\begin{appendices}
\section{Subsampling LOO}
\label{app:subsampling_loo}
As discussed in Section~\ref{sec:subsampling_loo}, one approach to perform validation for large $n$ is to use only a subset of $m<n$ points in LOO validation.
This gives an unbiased utility estimate for each submodel but with higher variance than if we used all $n$ LOOs.
The variance can be reduced by a semi-random subsampling.
The PSIS procedure does not only smooth the importance weights but gives also an indication of the tail thickness of the importance weight distribution, measured by the $\hat k$-value for each of the $n$ datapoints.
The larger the $\hat k$-value, the fatter the tail indicating more influential data point.
In particular, if $k \le 0.5$, the raw importance weights have a finite variance, central limit theorem kicks in and the Monte Carlo error decreases quickly. For
$0.5 < k \le 1$ the raw weights have infinite variance, but generalized central limit theorem holds and the importance sampling estimate is asymptotically consistent. However, pre-asymptotic behavior is such that for $k>0.7$ infeasible high sample sizes would be needed for reasonable error rates. For $k<0.7$ the Pareto smoothing regularizes the estimate so that it has a finite variance with a cost of small bias, and empirical results indicate practically useful convergence rate \citep[see][for more thorough discussion]{vehtari2017b,vehtari2017a}.
We divide the data points into 3 strata: those with $\hat k < 0.5$ (good), those with $0.5 < \hat k < 0.7$ (OK) and those with $\hat k > 0.7$ (bad).
Denote the sizes of these strata as $n_1$, $n_2$ and $n_3$, respectively.
We then randomly draw $\min(m/3, n_j)$ points without replacement from each stratum $j=1,2,3$.
If the number of drawn points is less than $m$, the rest of the points are drawn randomly from the remaining points so that $m$ points are selected in total.
Let $m_j, \,j=1,2,3$ denote the number of points drawn from each stratum.
To account for the fact that sizes of the strata are different, the points are weighted according to the stratum sizes when computing the utility estimates.
Jumping straight to the result, the point estimate and its standard error for the quantity $\Delta U_k$ (analogous to Equations~\eqref{eq:rel_util_mean} and~\eqref{eq:rel_util_se}) are given by
\begin{align}
\Delta \bar U_k &= \sum_{i=1}^n v_i \left( u_k^{(i)} - u_*^{(i)} \right),
\label{eq:rel_util_mean_ss} \\
s_k &= \sqrt{\frac{1}{m} \svar[i=1]{n}{u_k^{(i)} - u_*^{(i)}, v_i}},
\label{eq:rel_util_se_ss}
\end{align}
where $\svar[i=1]{n}{\, \cdot, v_i}$ denotes the weighted sample variance with weights $v_i$.
Each of the $m_1$ points in the `good' category is given weight $ n_1/(n m_1)$, and the weights for the points in the `ok' and `bad' categories are $n_2/(n m_2)$ and $n_3/(n m_3)$, respectively.
The points that did not get selected in the subsample are assigned zero weight $v_i = 0$.
The standard error~\eqref{eq:rel_util_se_ss} will be higher than~\eqref{eq:rel_util_se}, but often a fairly small number of points, such as $m=200$ is enough for obtaining reasonably accurate estimates of the difference between the reference and submodels.
This is because the submodels become closer to the reference model as more features are added, and therefore also the differences between their pointwise utilities become ever smaller and hence the standard errors for the models with good performance can get small already for small number of LOOs.
It is worth noting though, that although the standard error for the utility difference would be small, the standard error for the {\it actual} utility $U_k$ can be substantial for small $m$.
If all LOOs are computed for the reference model, it is possible to combine the standard errors for $U_*$ and $U_k'$ to get a smaller standard error for $U_k$ but we shall not discuss this further here.
\section{Extra experimental results}
\label{app:extra_results}
\subsection{Toy example}
Figure~\ref{fig:toy_assessment_g} shows the analogous results to Figure~\ref{fig:toy_assessment_rhs} but using the full model with Gaussian prior as the reference model.
The results are otherwise similar to those in Figure~\ref{fig:toy_assessment_rhs}, but here the submodels with 3 to 14 features achieve a slightly better generalization performance than the reference model.
This is simply due to the fact that the Gaussian prior is not the optimal choice in this particular case since it does not help to shrink the coefficients of the truly irrelevant features, and hence we can gain by removing those features.
This does not mean that the Gaussian prior would always be inappropriate even for very high-dimensional problems, see for instance the results for the microarray data sets in Section~\ref{sec:microarray_data} where the ridge regression performs very well (corresponds to maximum a posteriori solution with the Gaussian prior).
\subsection{Real world benchmarks}
Table~\ref{tab:nfeat} shows the average number of features selected by the different methods in the microarray examples (Sec.~\ref{sec:microarray_data}).
The projection methods clearly select the most parsimonious models.
\begin{figure}
\centering
\minput[pdf]{toy_assessment_g}
%
\caption{ {\it Toy example, projective selection:} The same as in Figure~\ref{fig:toy_assessment_rhs} but using the full model with Gaussian prior as the reference model. }
\label{fig:toy_assessment_g}
\end{figure}
\begin{table}%
\centering
\abovetopsep=2pt
\begin{tabular}{ lrrrrrr }
\toprule
Method & Ovarian & Colon & Prostate & Leukemia & Glioma & Average \\
\midrule
Bayes SPC & 633.0 & 881.0 & 7.7 & 1030.4 & 736.2& 657.7\\
Proj ref-1se & 3.3 & 2.2 & 2.9 & 8.6 & 1.6 & 3.7\\
Proj ref-1se-reg & 7.2 & 3.9 & 3.8 & 11.0 & 7.2 & 6.6\\
Proj best-1se & 3.1 & 2.1 & 2.9 & 16.2 & 1.6 & 5.2\\
Proj best-1se-reg & 7.2 & 4.3 & 4.6 & 18.8 & 6.2 & 8.2\\
Lasso, $\lambda_\text{1se}$ & 11.7 & 5.1 & 12.7 & 15.3 & 9.2 & 10.8\\
Lasso, $\lambda_\text{best}$ & 18.6 & 11.1 & 23.6 & 23.2 & 25.0 & 20.3\\
Enet $\alpha=0.7$, $\lambda_\text{1se}$ & 22.5 & 8.1 & 23.2 & 25.9 & 23.7 & 20.7\\
Enet $\alpha=0.7$, $\lambda_\text{best}$ & 42.6 & 21.3 & 49.3 & 50.6 & 56.1 & 44.0\\
Enet $\alpha=0.3$, $\lambda_\text{1se}$ & 57.7 & 24.8 & 53.6 & 74.5 & 74.1 & 56.9\\
Enet $\alpha=0.3$, $\lambda_\text{best}$ & 114.3 & 64.2 & 124.8 & 188.0 & 187.7 & 135.8\\
Ridge, $\lambda_\text{1se}$ &1536 &2000 & 5966 & 7129 &22283 &7782.8\\
Ridge, $\lambda_\text{best}$ &1536 &2000 & 5966 & 7129 &22283 &7782.8\\
\bottomrule
\end{tabular}
\caption{Average number of features selected for the different methods in the microarray examples over the ten outer cross-validation folds. The last column denotes average over all data sets. The projection methods select by the most parsimonious models. The sparsest other method with similar predictive accuracy (Lasso with $\lambda_\tx{best}$, see Fig.~\ref{fig:realdata}) selects on average over twice as many features as the most dense projection (Proj best-1se-reg).}
\label{tab:nfeat}
\end{table}
\section{Proofs of the theoretical results}
\label{app:proofs}
\subsection{Proof of Lemma~\ref{lemma:gain}}
First plug in the definitions~\eqref{eq:coeff_ls_and_ref} into the formula of the expected gain~\eqref{eq:gain} and expand
\begin{align*}
nG &= n\left( \Delta(\vs{\hat \beta}) - \Delta(\vs \beta_*) \right) \\
&= \mean[\vc{\ti y}]{ || \vc X \vs{\hat \beta} - \vc{\ti y} ||^2 }
- \mean[\vc{\ti y}]{ || \vc X \vs \beta_* - \vc{\ti y} ||^2 } \\
&= \vs{\hat \beta}^\mathsf{T} \vc X^\mathsf{T} \vc X \vs{\hat \beta}
- 2 \mean{\vc{\ti y}}^\mathsf{T} \vc X \vs{\hat \beta}
+ \mean{\vc{\ti y}^\mathsf{T} \vc{\ti y}} -
\vs \beta_*^\mathsf{T} \vc X^\mathsf{T} \vc X \vs \beta_*
+ 2 \mean{\vc{\ti y}}^\mathsf{T} \vc X \vs \beta_*
- \mean{\vc{\ti y}^\mathsf{T} \vc{\ti y}} \\
&= \vc y^\mathsf{T} \vc X (\vc X^\mathsf{T} \vc X)^{-1} \vc X^\mathsf{T} \vc y
-2 \mean{\vc{\ti y}}^\mathsf{T} \vc X (\vc X^\mathsf{T} \vc X)^{-1} \vc X^\mathsf{T} \vc y \\
&\phantom{=} - \vs \mu_*^\mathsf{T} \vc X (\vc X^\mathsf{T} \vc X)^{-1} \vc X^\mathsf{T} \vs \mu_*
+ 2 \mean{\vc{\ti y}}^\mathsf{T} \vc X (\vc X^\mathsf{T} \vc X)^{-1} \vc X^\mathsf{T} \vs \mu_*.
\end{align*}
By plugging in $\mean{\vc{\ti y}} = \vs \mu$ and the definition $\vc P = \vc X (\vc X^\mathsf{T} \vc X)^{-1} \vc X^\mathsf{T}$, we get
\begin{align*}
n G &= \vc y^\mathsf{T} \vc P \vc y
-2 \vs \mu^\mathsf{T} \vc P \vc y
- \vs \mu_*^\mathsf{T} \vc P \vs \mu_*
+ 2 \vs \mu^\mathsf{T} \vc P \vs \mu_* \\
&= \vc y^\mathsf{T} \vc P \vc y
-2 \vs \mu^\mathsf{T} \vc P \vc y
- \vs \mu_*^\mathsf{T} \vc P \vs \mu_*
+ 2 \vs \mu^\mathsf{T} \vc P \vs \mu_*
- \vs \mu^\mathsf{T} \vc P \vs \mu
+ \vs \mu^\mathsf{T} \vc P \vs \mu \\
&= (\vc y - \vs \mu)^\mathsf{T} \vc P (\vc y - \vs \mu)
- (\vs \mu_* - \vs \mu)^\mathsf{T} \vc P (\vs \mu_* - \vs \mu) \\
&= ||\vc y - \vs \mu||_{\vc P}^2
- ||\vs \mu_* - \vs \mu||_{\vc P}^2.
\end{align*}
Hence $G = \frac{1}{n} \left( ||\vc y - \vs \mu||_{\vc P}^2 - ||\vs \mu_* - \vs \mu||_{\vc P}^2 \right)$ .
\subsection{Proof of Theorem~\ref{thm:gain}}
By Lemma~\ref{lemma:gain}, $G = \frac{1}{n} \left( ||\vs \varepsilon||_{\vc P}^2 - ||\vs \mu_* - \vs \mu||_{\vc P}^2 \right)$, where $\vs \varepsilon = \vc y - \vs \mu$.
Taking the expectation of $G$ with respect to the $\vs \varepsilon$ as well as the randomness in the reference fit $\vs \mu_*$ yields
\begin{align*}
\mean{G}
&= \frac{1}{n}\left( \mean{\vs \varepsilon^\mathsf{T} \vc P \vs \varepsilon}
- \mean{(\vs \mu_* - \vs \mu)^\mathsf{T} \vc P (\vs \mu_* - \vs \mu)} \right)\\
&= \frac{1}{n} \left( \tr{\vc P \cov{\vs \varepsilon}} - \tr{\vc P \cov{\vs \mu_* - \vs \mu}}
- \mean{\vs \mu_*-\vs \mu}^\mathsf{T} \vc P \mean{\vs \mu_* - \vs \mu} \right) \\
&= \frac{1}{n} \left( \sigma^2 \tr{\vc P} - \tr{\vc P \vc K} - \vc b^\mathsf{T} \vc P \vc b \right).
\end{align*}
Now we have
\begin{align*}
\tr{\vc P}
= \tr{\vc X (\vc X^\mathsf{T} \vc X)^{-1} \vc X^\mathsf{T}}
= \tr{\vc X^\mathsf{T} \vc X (\vc X^\mathsf{T} \vc X)^{-1}}
= \tr{\vc I_p}
= p,
\end{align*}
so the expected gain simplifies to
\begin{align}
\mean{G} = \frac{1}{n} \left( \sigma^2 p - \tr{\vc P \vc K} - ||\vc b||_{\vc P}^2 \right).
\label{eq:gain_thm}
\end{align}
\subsection{Proof of Corollary~\ref{clry:uncor_err}}
If the errors in the reference model are uncorrelated, that is, $\vc K = \sigma_{\mu_*}^2 \vc I$, the expected gain~\eqref{eq:gain_thm} reduces to
\begin{align*}
\mean{G} &= \frac{1}{n} \left( \sigma^2 p - \sigma_{\mu_*}^2 p - ||\vc b||_{\vc P}^2 \right) \\
&= \frac{p}{n} \left( \sigma^2 - \sigma_{\mu_*}^2 - \frac{1}{p} ||\vc b||_{\vc P}^2 \right).
\end{align*}
\end{appendices}
| {'timestamp': '2018-10-08T02:01:43', 'yymm': '1810', 'arxiv_id': '1810.02406', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02406'} | arxiv |
\section{Acknowledgment}
The authors would like to thank Dina Papagiannaki for advice and multiple suggestions while this experiment and analysis was conducted. This material is based upon work supported by the National Science Foundation under Grant No.1254035 and 1514437.
\section{Incentives for Adoption}
\label{sec:deployment}
\begin{table*}[t]
\begin{minipage}[c]{0.26\linewidth}
\begin{center}
\textbf{Mediated marketplace}
\vspace{2ex}
{\small
\begin{tabular}[c]{c|c}
$\setS$ & $\textrm{\texttt{Int}}_a(u)$
\\ \hline
$\emptyset$,
$\{ u \}$,
$\{ a \}$,
$\{ m \}$, & $\textrm{\texttt{Impl}}_a(u)$
\\%+ B(u,p)$\\
$\lset u,a \rset$,
$\lset a,m \rset$ & $\textrm{\texttt{Impl}}_a(u)$
\\%+ B(u,p)$\\
$\lset u,m \rset$ & $1$
\\%+ B(u,p)$\\
$\lset u,a,m \rset$ & $\textrm{\texttt{Expl}}(u)$
\\%+ B(u,p)$\\
\end{tabular}
\begin{tabular}[c]{c|c}
& Shapley value
\\ \hline
$u$, $m$ & $\frac{\textrm{\texttt{Expl}}(u)-1-\frac{3}{2}{(\textrm{\texttt{Impl}}_a(u)-1)}}{3}$
\\
$a$ & $\textrm{\texttt{Impl}}_a(u)+\frac{\textrm{\texttt{Expl}}(u)-1}{3}$
\\
\end{tabular}
}
\end{center}
\end{minipage}
\begin{minipage}[c]{0.26\linewidth}
\begin{center}
\textbf{Direct marketplace}
\vspace{2ex}
{\small
\begin{tabular}[c]{c|c}
$\setS$ & $\textrm{\texttt{Int}}_a(u)$
\\ \hline
$\emptyset$ & $\textrm{\texttt{Impl}}_a(u)$
\\%+ B(u,p)$\\
$\lset u \rset$ & $1$
\\%+ B(u,p)$\\
$\lset a \rset$ & $\textrm{\texttt{Impl}}_a(u)$
\\% + B(u,p)$\\
$\lset u,a \rset$ & $\textrm{\texttt{Expl}}(u)$
\\%+ B(u,p)$\\
\end{tabular}
\begin{tabular}[c]{c|c}
& Shapley value
\\ \hline
$u$ & $\frac{\textrm{\texttt{Expl}}(u)-1-2(\textrm{\texttt{Impl}}_a(u)-1)}{2}$
\\
$a$ & $\textrm{\texttt{Impl}}_a(u)+\frac{\textrm{\texttt{Expl}}(u)-1}{2}$
\\
\end{tabular}
}
\end{center}
\end{minipage}
\begin{minipage}[c]{0.24\linewidth}
\begin{center}
\textbf{Publ. DNT mediated}
\vspace{2ex}
{\small
\begin{tabular}[c]{c|c}
$\setS$ & $\textrm{\texttt{Int}}_a(u)$
\\ \hline
$\emptyset$,
$\{ u \}$,
$\{ a \}$,
$\{ m \}$, & 1
\\%+ B(u,p)$\\
$\lset u,a \rset$,
$\lset a,m \rset$ & 1
\\%+ B(u,p)$\\
$\lset u,m \rset$ & $1$
\\%+ B(u,p)$\\
$\lset u,a,m \rset$ & $\textrm{\texttt{Expl}}(u)$
\\%+ B(u,p)$\\
\end{tabular}
\begin{tabular}[c]{c|c}
& Shapley value
\\ \hline
$u$, $m$ & $\frac{\textrm{\texttt{Expl}}(u)-1}{3}$
\\ $a$ & $\frac{\textrm{\texttt{Expl}}(u)-1}{3}$
\\
\end{tabular}
}
\end{center}
\end{minipage}
\begin{minipage}[c]{0.22\linewidth}
\begin{center}
\textbf{Publ. DNT direct}
\vspace{2ex}
{\small
\begin{tabular}[c]{c|c}
$\setS$ & $\textrm{\texttt{Int}}_a(u)$
\\ \hline
$\emptyset$ & 1
\\%+ B(u,p)$\\
$\lset u \rset$ & $1$
\\%+ B(u,p)$\\
$\lset a \rset$ & $1$
\\% + B(u,p)$\\
$\lset u,a \rset$ & $\textrm{\texttt{Expl}}(u)$
\\%+ B(u,p)$\\
\end{tabular}
\begin{tabular}[c]{c|c}
& Shapley value
\\ \hline
$u$ & $\frac{\textrm{\texttt{Expl}}(u)-1}{2}$
\\
$a$ & $\frac{\textrm{\texttt{Expl}}(u)-1}{2}$
\\
\end{tabular}
}
\end{center}
\end{minipage}
\caption{Various market types and coalition scenarios: coefficient multiplying advertising revenue for each coalition scenario (top), Shapley value for each party (bottom).}
\vspace{-0.1in}
\label{tab:revenue}
\end{table*}
An information market affects the revenue produced by advertisement overall and also how it is shared. We capture this effect first in a model focusing on the transaction associated with a single user. We then describe data used to feed this model for millions of users, and a simple adoption dynamics based on immediate financial incentive. Putting those together, we can then study the spread of adoption and the effect of information market at web scale.
\subsection{Incentive for a single user}
\label{sec:econmarket}
Our model leverages recent modeling of online advertising~\cite{Gill:2013} to understand how advertising revenue changes with availability of information. Understanding how revenue is to be distributed among all parties is more difficult to predict. But one way is to apply the theory of cooperative games~\cite{Shapley:1953ty} which offers a principled approach to compute the expected outcome of a negotiation in the presence of alternative offers.
\subsubsection{Advertising revenue model and assumptions}
Our model is inspired from prior work~\cite{Gill:2013} breaking down the value of ad-impression, or cost-per-mille (CPM), into a function of three factors:
\begin{equation}
\textrm{\texttt{CPM}}(u,p,a)=\ron \times \tqm \times \textrm{\texttt{Int}}_a(u) \vf
\label{eqn:cpm}
\end{equation}
where $\ron$ (run-on-network) is an ad's nominal cost in ad network $a$, $\tqm$ (traffic quality multiplier) captures the quality of the publisher $p$ (\eg reputable publishers vs. sites distributing copyright infringing content), and $\textrm{\texttt{Int}}_a(u)$ (intent) depends on the value of information gleaned about the user $u$ by the ad network.
Intent captures the fact that an impression can be sold for a larger price if the ad network knows that the user has performed some previous actions (\eg frequent or recent visits to a product related webpage).
We include three cases for intent. 1) If the user chooses not to reveal any information, this coefficient is
by convention equal to 1. 2) When tracking is not blocked, it takes on the value which we refer to as \emph{implicit} intent, $\textrm{\texttt{Impl}}_a(u)\geq 1$,
which depends on how much
information the ad-network can collect about the user's browsing.
3) If the user decides to release \emph{all} legitimate
sites available to $a$, the impression can be sold with a higher \emph{explicit} intent $\textrm{\texttt{Expl}}(u)\geq\textrm{\texttt{Impl}}_a(u)$
independent of $a$.
\myparab{Revenue sharing.}
We treat the advertising transaction as a cooperative game capturing a simple dynamic: the more user information is known by the ad-network, if they cooperate via an information market, the larger the revenue. We assume that each player is incentivized by receiving a share of the revenue computed using the \emph{Shapley value}~\cite{Shapley:1953ty}. This mechanism has two advantages: it ensures some form of fairness, and\AMdel{ it typically lies in the \emph{core}, which} maximizes the likeness of cooperation, \ie users and aggregators participating in the market
(see Apx.~\ref{apx:shapley} an overview of the Shapley value).
In practice, the aggregator $a$ typically collects payments from advertisers, gives a constant fraction $(1-\alpha)$ to the publisher, and then pays for data on the market at price set by this user's Shapley value. The market provider also receives its Shapley value from $a$.
\subsubsection{Allocation of revenue to each player}
\label{subsec:alloc}
In this section we investigate the impacts on the Shapley value of different cooperative scenarios between players, \ie users, aggregators, and the market, under various market implementations. Table~\ref{tab:revenue} shows the intent, $\textrm{\texttt{Int}}_a(u)$, which impacts the revenue that different cooperating subsets of players, $S$, can produce.
We start with the situation in which a \textbf{mediated market} $m$ centralizes data collection and/or analytics as in~\cite{Saikat:2011tt,Riederer:2011} (leftmost subtable in Table~\ref{tab:revenue}). Without any cooperation, as in today's status quo, a user is tracked implicity, $\textrm{\texttt{Int}}_a(u)=\textrm{\texttt{Impl}}_a(u)$. However, if user and aggregator join the market, a higher revenue can be obtained corresponding to $\textrm{\texttt{Int}}_a(u)=\textrm{\texttt{Expl}}_a(u)$. In one case, assuming $m$ and $u$ collaborate (\ie~user sells her data) but $a$ does not (\ie~$a$ decides not to buy it), revenue effectively decreases as implicit tracking is now blocked, $\textrm{\texttt{Int}}_a(u)=1$.
The analysis of this game yields Shapley values for each player (shown in Table~\ref{tab:revenue} bottom). These values specify how much each player receives from the \emph{surplus}, \ie the potential revenue that is not produced today due to lack of cooperation, which is proportional to the added value of $\textrm{\texttt{Expl}}(u)$ over $\textrm{\texttt{Impl}}_a(u)$.
Based on Table 3 we make the following observations:
\myparab{i) Ad-networks are always better off buying the users' data.} Buying data makes them join the coalition, always leading to a revenue increase. Hence they always receive a positive Shapley value (Table~\ref{tab:revenue}).
\myparab{ii) Users are not always better off selling their data.} Precisely, a user is able to claim a positive share of the surplus only if this surplus is large enough to compensate for the blocking of implicit tracking. In a mediated market, it occurs as
\(
\left(\textrm{\texttt{Expl}}(u)-1\right)-\frac{3}{2}(\textrm{\texttt{Impl}}_a(u)-1)>0
\)\(
\midwor{or} r_{a}(u)>\frac{3}{2}
\),
where
\(
r_{a}(u) = \frac{\textrm{\texttt{Expl}}(u) - 1}{\textrm{\texttt{Impl}}_a(u) - 1}
\)
{is the \emph{consent tracking lift}.}
\myparab{iii) Mediated markets lower the bar for users to gain revenue from the market compared with direct markets.} Our analysis extends to different market implementations. While mediated markets simplify deployment, and offers a single point of sale to aggregators, other architectures run data collection and/or analytics on users' end~\cite{repriv,Toubiana:2010tm}. This creates a \textbf{direct market} with aggregators entering transactions with users directly (Table~\ref{tab:revenue} second from the left). All previous observations generalize except that users are better off only if
$r_{a}(u)>2$.
\myparab{iv) Publishers enforcing Do Not Track create ideal conditions to deploy an information market}.
We also analyze information markets deployed over sites that enforce Do Not Track (Table~\ref{tab:revenue}, third and fourth from left). In these scenarios publishers comply with regulations or aim to improve their image vis-a-vis privacy watchdogs and aggregators \emph{and} users are \emph{always} better off buying/selling data via the market.
\myparab{v) As soon as the possibility of users adopting an information market is credible, a publisher always benefits in the long term by enforcing DNT}. Note that publishers are driven by revenue, and since they receive a fixed share, they have an incentive to keep intent (and thus revenue) as high as possible. Enforcing DNT might initially undermine publishers' profit, however it does\AMdel{ redistribute claims to surplus in a way that} incentivize users to sell their data, making\AMdel{ intent and hence a} publishers' revenue higher in the long term.
Information markets increase ad-revenue and redistribute part of the surplus to all participating entities. The price of data set by the market always ensures that aggregators make a profit. However, it does not necessarily mean that a user is always better off selling their data. In addition, a user's decision to join a market is done only once, affecting all of its related ad-revenue.
Here we apply our model to traces containing billions of Web requests made by millions of users to understand how information markets adopt at scale and the effect they have on total and individuals' revenue.
\subsection{Data and adoption dynamics}
\myparab{Browsing data-sets}
We use anonymized HTTP traces from a university network, a neighborhood of broadband users, and a country wide
mobile ISP with approximately 8k, 5k, and 3M users, respectively. We process these traces into HTTP sessions and identify publishers and aggregators for each session, for each user. Intent values $\textrm{\texttt{Impl}}_a(u)$ and $\textrm{\texttt{Expl}}_a(u)$ are computed using browsing profiles observed with partial/global views (see~\cite{Gill:2013}). \AMdel{This is conservative as in practice, a market may facilitate the sale of more valuable data not readily mined from Web activity, increasing $\textrm{\texttt{Expl}}_a(u)$ and hence facilitating adoption.}
\myparab{Distribution of consent tracking lift}. The increased value of data in the market, relative to what aggregators can infer ($r_{a}(u)$) is shown in Fig~\ref{fig:rua} for all user-aggregator pairs.
Only 30-40\% of user-aggregator pairs have $r_{a}(u)$ above 1.5 (threshold for a user to sell data with a benefit in a mediated market as shown in Sec.~\ref{subsec:alloc}) and 28-34\% have $r_{a}(u)$ above 2 (same threshold for a direct market). At first glance, the surplus appears often too small for the information market to positively benefit users. This is especially true in the mHTTP dataset, where the aggregators appear to make accurate inferences, leading to high implicit intent which limits the value of $r_a(u)$.
\myparab{Myopic best response dynamics}
We assume each player aims to maximize its immediate profit as it decides whether to join an information market or not: \textbf{A user} will not join an information market unless there exists an ad-network for which it can claim positive profit (\ie $r_{a}(u)>2$ for a direct market, or $r_{a}(u)>3/2$ for a mediated one). Note that by doing that, it also blocks tracking of other aggregators\AMdel{, but it does not pay the associated negative Shapley value since the ground to enforce it appears weak (users received currently no payment for this ad-revenue)}. \textbf{An ad-network} joins an information market
as soon as joining the market will increase its revenue across all users and publishers in the ecosystem. Note that if many users have joined the information market (and blocked tracking) the aggregator may increase its revenue by joining the market, but still fall short of its initial revenue values before any market deployment. We analyze this in more detail in~\ref{subsec:effectonrev}.
\subsection{Spread of adoption}
\begin{figure}[t]
\centering
\vspace{-1.1cm}
\includegraphics[width=0.4\textwidth ]{graphs/rua.pdf}
\vspace{-0.2in}
\caption{Distribution of consent tracking lift $r_u(a)$, defined as the ratio of advertising value with explicit intent (obtained at user consent) divided by implicit intent (obtained from tracking).}
\vspace{-0.1in}
\label{fig:rua}
\end{figure}
\begin{figure}[t]
\centering
\vspace{0.15in}
\includegraphics[width=0.44\textwidth ]{graphs/percInMarket.pdf}
\vspace{-0.1in}
\caption{Percentage of users and aggregators in the market at the end of the simulation.
\vspace{-0.19in}
}
\label{fig:fracusersagg}
\end{figure}
\ifnum\full=1
\begin{figure}[t]
\centering
\includegraphics[width=0.45\textwidth ]{graphs/aggsBuying.pdf}
\vspace{-0.7cm}
\caption{Fraction of aggregators in the market in each iteration.}
\label{fig:aggsbuying}
\end{figure}
\fi
Fig.~\ref{fig:fracusersagg} shows the percentage of users and aggregators that eventually join the market. In contrast with what our preliminary analysis of $r_u(a)$'s distribution predicted, we see a higher adoption rate, especially among aggregators. This shows that even a small number of pairs $(u,a)$ with high $r_u(a)$ is sufficient to generate a network effect of adoption. Indeed, more than 87\% of the aggregators purchase data from at least one user, and 14-22\% of those do so only because a user previously joined a market. As predicted, the mediated market has a higher percentage of adoptions with an increase of 4-8\% relative to the direct market.
\ifnum\full=1
Fig.~\ref{fig:aggsbuying} shows the fraction of aggregators that join the market in each iteration of the simulation.
\fi
\iffalse
To investigate this further, we isolated the users
who led to this effect. We found low correlation between the number of aggregators these users `strong-arm' into joining
and the revenue of these users ($r$ value - 0.23 in mHTTP). Like wise we also found low correlation with the number of sessions
per users ($r$ value - 0.28 in mHTTP). This is in contrast to our result in Sec.~\ref{sec:today} where users' revenue to be correlated
with the number of sessions. We leave a further investigation of this to future work.
\fi
The same effect, although not as pronounced, is true for users: more than {35\% and up to 92\% see a positive profit and hence sell their data.} Note that here we are only considering economic incentives for users to join, while some additional users may do so for other concerns such as privacy.
\subsection{Effects on ad-revenue}
\label{subsec:effectonrev}
\myparab{i) Markets increase overall revenue by 9-12\%}. Fig.~\ref{fig:totalrev} shows revenue at the end of
the simulation normalized to initial utility, both overall and for aggregators. There is no significant difference between
the direct and mediated markets in terms of overall revenue increase, with both increasing overall revenue between 9-12\%.
\myparab{ii) Direct markets increase revenues for users.} Fig.~\ref{fig:userrev} shows projected monthly revenue for users in the
direct and mediated markets. Users derive more revenue in
the direct market since revenue is not shared with the trusted third party. The median monthly revenue in a direct market is 50\% higher than in a mediated one.
\AMdel{We note here that these numbers should be viewed relatively and absolute values may vary in practice.}
\myparab{iii) User revenue is highly correlated with the number of aggregators.} Monthly revenue for users in the HTTP dataset is signficantly
higher than in the university or mHTTP datasets. This stems from a high degree of correlation between aggregators the user comes in
contact with and their revenue (correlation coefficients of 0.6-0.9). Indeed, the average number of
aggregators per user is 43 in HTTP but only 5 in mHTTP and 9 in the university dataset. The higher
number of aggregators per user in HTTP can be due to multiple users sharing a connection (recall this is a residential broadband trace).
\AMdel{We do not have enough additional information to investigate this.}
Next we consider how the market impacts revenue, overall and for aggregators.
\myparab{iv) Aggregator revenue decreases.} Revenue for aggregators decreases by 16-37\% as compared to today's status-quo after information market adoption. This result contrasts with the prediction seen in Sec.~\ref{sec:econmarket} that, for a \emph{single} transaction, aggregators always benefit from {an information market}. This emerges when the system is analyzed at scale because a user interacts with multiple aggregators. If it joins an information market to obtain revenue from a transaction with an aggregator (typically, one that has high $r_{a}(u)$) part of the consequence is that tracking is blocked and this negatively affects another aggregator revenue (typically, one with low $r_{a}(u)$). However, if we compare these revenues to what would happen if users, publishers, or a regulation were to block tracking with DNT~\cite{dnt}, estimated in \cite{Gill:2013} to drop ad revenues by up to 75\%, deploying an information market allows aggregators to recover from this loss. It also addresses privacy concerns of the users, as information is obtained legally and transparently.
\begin{figure}[t]
\centering
\vspace{-1.1cm}
\includegraphics[width=0.4\textwidth ]{graphs/monthlyrev.pdf}
\vspace{-0.2in}
\caption{Monthly revenue for users that participate in the direct and mediated market.}
\vspace{-0.1in}
\label{fig:userrev}
\end{figure}
\begin{figure}[t]
\centering
\vspace{0.25in}
\includegraphics[width=0.44\textwidth ]{graphs/normalizedRev.pdf}
\vspace{-0.1in}
\caption{Total revenue normalized to initial revenue overall and for aggregators.}
\vspace{-0.2in}
\label{fig:totalrev}
\end{figure}
\section{Extracting HTTP sessions}
\section{Auction mechanism}
\label{app:auction}
\AMnote{We only mention this mechanism enforces truth telling, but do not explain why that's the case. We don't necessarily have to if this has been shown in the literature and it's a know fact. I just wasn't sure.}
Here we explain the exponential auction mechanism~\cite{exp-mechanism} that has the truth telling properties, and has been shown to be close to optimal in terms of revenue for the seller. Note that users are independent from each other and auctions are run per user.
We denote the user as $u$ and the set of aggregators by $\setA = \{a_0, a_1, ..., a_m\}$. The good being sold on the market is access to the user, \ie the ability to track the user on her whitelisted sites and serve her targeted ads for a given time interval. A user's browsing behavior can be sold to multiple aggregators with no marginal cost of reproduction, hence the market can be thought of as having an unlimited supply. Intuitively, aggregator $a$ should be willing to pay to access $u$ as long as the price to acquire her is smaller than the additional revenue, $v_{a}$, gained by having access to $u$. \AMdel{Extensions for an aggregator to buy exclusive access can be included although beyond the scope of this paper.}
In the auction, we assume that each aggregator $a$ in $\setA$ who is interested in accessing $u$ bids a maximum price $p_{a}(u)$ that it is willing to pay for access to user $u$.
Assuming the final winning bid value is $p(u)$, every winning bidder, \ie bidders with bids higher than this value, pay $p(u)$, hence the total revenue of $u$ is given by:
\vspace{-0.2mm}
\[
R\left[ (p_{a}(u)_{a\in\setA}, p(u) \right] = \sum_{a\in\setA} p(u) \times \ind{p(u)\leq p_{a}(u) }
\;.
\]
\vspace{-0.1in}
When $p(u)>\max_{a\in\setA} p_{a}(u)$, the revenue will be zero, as the price exceeds what aggregators are willing to pay. We wish to choose $p(u)$ to maximize this sum; all bids higher than this value are considered winners
and hence are given access to the user. The winners pay $p(u)$.
Following \cite{exp-mechanism} we first assign an initial value to $p(u)$ according to a measure $\nu(p(u))$ on $\Real$ and then re-weigh this measure to choose the actual price used. To re-weigh, we use an exponential function that puts more weight on high value of $R$, according to a parameter $\varepsilon>0$.
PDF of the chosen price to track a given user is given by:
\[
P(p(u)) =
\frac{\exp\left( \varepsilon R\left[ (p_{a}(u))_{a\in\setA}, p(u) \right] \right) \nu(p) }{ \int_{0}^{\infty}
\exp\left(\varepsilon R\left[ (p_{a}(u))_{a\in\setA}, s \right]\right) \nu(s) ds }
\]
A standard approach is then to choose the initial distribution of $p(u)$ according to the Lebesgue measure on $\Real$, such that $\nu(p(u))=1$.
By using $\varepsilon$, we have added noise around the value maximizing the revenue, given the set of bids. Although it seems counter-intuitive to use a suboptimal price, ~\cite{exp-mechanism} shows that this (1) prevents any bidder from winning more than a factor $\exp(\varepsilon)$ when cheating and
(2) still reaches a revenue that is within a good bound of the optimal value if the number of aggregators is large. The expected revenue is at least $OPT - 3 \frac{\ln(e + OPT \epsilon^2 m ) }{ \epsilon}$, where $OPT$ denotes the optimal revenue and $m$ is the number of buyer aggregators in the optimal case.
\AMdel{Thus, although the randomization causes revenue from a given set of bids to be lower, truthful bidding means the set of bids will be higher, ending up with better revenue than if we allowed bidders to cheat.}
\section{Valuing user data}
\label{apx:eval}
The goal is to estimate, for a given period [0, T], the advertisement revenue that can be generated from a user based on her whitelist and impressions that she generates (frequency of visits). We want the model to be simple, and intuitively monotone in the number of impressions and size of whitelists. We rely on keywords associated with websites to estimate the ad-placing strategy maximizing the total clicks generated. We assume: 1) the period is short enough so that any advertiser would like to receive a single click from the same user. Equivalently, the user would never click twice on an ad by the same advertiser in the given period. In both cases, playing an ad after is was clicked creates no revenue. 2) the period is short enough that a visit to a website at any time denotes a topic of relevance to that user for the entire period and 3) the period is long enough (or the system loses memory sufficiently quickly) so that any action (ads shown, clicks, revenue generated) from the past period is irrelevant.
\newcommand{\pi^{\textrm{click}}}{\pi^{\textrm{click}}}
\newcommand{\textrm{\texttt{CPC}}}{\textrm{\texttt{CPC}}}
We denote users by $u$, publisher or website by $j$, and advertisers by $a$. Each website is associated with one or several keywords that we denote by $\kappa(j)$. Similarly, each advertiser has a set of relevant keywords denoted by $\kappa(a)$. Whenever a user visits a website $j$ and reveals that information, she effectively discloses the associated keywords. We denote by $\kappa(u) = \cup_{j \textrm{visited by} u} \kappa(j)$ the set of all these keywords and are all relevant to target ads to $u$.
We assume that when $u$ visits $j$ and sees an ad from advertiser $a$, she decides independently with probability $\pi^{\textrm{click}} (u, j, a)$ to click on the ad, unless it has clicked on it already during that period. For simplicity we start with a constant probability, but in general this depends on the website, the advertiser (typically through the associated keyword), and the user. For instance, one may imagine that a user is more likely to click for an advertiser associated with a keyword that is associated with many sites she visits.
Advertiser $a$ can serve an ad to a user $u$ if and only if they share one relevant keywords $\kappa(u)\cap\kappa(a)\neq\emptyset$. It typically obtains this slot through a bidding process. We will assume for simplicity that all advertisers' bids are equal to the average cost per click (CPC) for a keyword that they have in common, and we denote this value by $\textrm{\texttt{CPC}}(k)$. If this intersection has multiple keywords, then the advertiser will typically bid with the highest keywords as it denotes higher interest in the user. These values are estimated using Google AdWords keyword planner tool.
During the period, a user generates $N(u,j)$ impressions on a website $j$. Out of the total number of impressions created, the system decides to display a number of ads associated with $a$, $n_a$. The probability that all of these fail to generate a click is $(1-\pi^{\textrm{click}}(u, j, a))^{n_a}$. Hence the optimal expected value generated by clicks, depending on which ads are played, can be found as the solution of the following optimization problem, which can be solved by a simple greedy algorithm:
\[
\begin{disarray}[c]{c}
\max \sum_{k\in\kappa(u)} \textrm{\texttt{CPC}}(k) \sum_{a \text{ such that } k(a)=k} \left(1 - \pi^{\textrm{click}}(u, j, a) \right)^{n_a} \\
\midwor{such that}
\sum_a n_a = \sum_j N(u,j) = N(u)
\end{disarray}
\]
\section{Shapley value overview}
\label{apx:shapley}
In a cooperative game, the set of players is denoted as $\setN$. We call any subset $\setS \subseteq N$ a \emph{coalition} of players.
For each coalition $\setS$, we denote by $V(\setS)$ the \emph{worth function}, which measures the total revenue produced
as a result of the coalition $\setS$.
We define the \emph{marginal contribution} of player $i$ to a coalition ${\setS} \subseteq {\setN}\backslash \{i\}$ as
$\Delta_i({\setS},V) = V({\setS}\cup \{i\})-V({\setS})$.
Note that the contribution of a player only depends on the worth function $V({\setS})$.
Shapley value determines
how the total worth of the coalition, captured by $V(\setS)$, should be shared among the players in $\setS$. More specifically, the Shapley value of player $i$ is denoted by
$\varphi_i\left( \setS,V \right)$
and is uniquely defined by the following three axioms:
{\bf Axiom 1:} (Efficiency) $\sum_{i\in {\setS}}\varphi_{i}({\setS},V)=V({\setS})$. This ensures that revenue assigned to the players is the total revenue created by the coalition.
{\bf Axiom 2:} (Symmetry)
If for all ${\setS' \subseteq {\setS}} \backslash \{i,j\}$, $\ds V({\setS'} \cup \{i\})=V({\setS'} \cup \{j\})$, then $\varphi_{i}({\setS},V)=\varphi_{j}({\setS},V)$. This means that two players who contribute the same amount to revenue receive an equal share of the revenue created.
{\bf Axiom 3:} (Fairness/Balanced Contribution)
For any $i, j\in \setS$, $j$'s contribution to $i$ equals $i$'s contribution to $j$, or, in other words
$\varphi_{i}({\setS},V)-\varphi_{i}({\setS} \backslash \{j\},V)=\varphi_{j}({\setS},V)-\varphi_{j}({\setS} \backslash \{i\},V)$. This addresses fairness between any pair of players.
\iffalse
\vspace*{0.2in}
\noindent The efficiency axiom states that the total revenue
assigned across all player equals the actual revenue created by the coalition.
In other words, the mechanism does not generate extra revenue.
The symmetry axiom requires that if two players contribute the same to
every subset of other players, they should receive the same share of the revenue.
Finally, the balanced contribution axiom addresses the fairness
between any pair of players.
It may be illustrated on a two-player system where $\setN=\lset 1\vf 2 \rset$.
By efficiency we have that, for a coalition of a single player, $\varphi_i(\{i\},V)=V(\{i\})$. The fairness axiom
states that the gain (or loss) of revenue from cooperation, as seen by player $1$ and $2$, should be
the same $\varphi_1(\setN,V) - V(\{1\})= \varphi_2(\setN,V) - V(\{2\})$. In that case it means that the
global gain of cooperation, defined as $V(\setN)-V(\{1\})-V(\{2\})$, is split evenly among players.
The balanced contribution axiom preserves and generalizes this
egalitarian property~\cite{andreu-microeco}.
\fi
Based on the axioms above, one can show that the {\it Shapley value}
$\varphi$ can be computed as follows~\cite{shapley-orig}:
\begin{equation}
\forall \ i\in \setS \vf
\varphi_i({\setS}, V) = \frac{1}{|\setS|!} \sum_{\pi \in \Pi}
\Delta_i(S(\pi,i), V) \hspace{5mm}
\label{equation:Shapley}
\end{equation} where $\Pi$ is the set of all $|\setS|!$ orderings of $\setS$
and $S(\pi,i)$ is the set of players preceding $i$ in the ordering $\pi$.
\noindent The Shapley value of a player $i$ can thus be
interpreted as the \emph{expected} marginal contribution
$\Delta_i(\setS',V)$ where $\setS'$ is the set of players in $\setS$ preceding $i$ in a uniformly
distributed random ordering of $\setS$.
\section{Background and requirements}
\label{ref:sysreq}
\iffalse
In this section we provide a brief primer on online advertising (Sec \ref{ref:threat}) and overview the requirements of an information market system (Sec \ref{subsec:req}).
\fi
\iffalse
Before we describe our system, we discuss
the set of requirements that any information market system that aims to co-exist with the advertising industry would
have to have. A \emph{non-goal} of this paper is to present the best possible system that implements an information market
or to argue strongly for economic incentives; we want to investigate \emph{if} economically driven solutions like information
markets can address privacy concerns. So while a comprehensive threat model forms a lesser purpose here, we still outline one
to aid us in various design choices.
\fi
\iffalse
\subsection{Online tracking background}
\label{ref:threat}
\fi
Targeted advertising has increased in usage over the last few years and generally comes in multiple varieties: contextual, retargeting and behavioral~\cite{Liu:2013}. The last one has been offered by Google since 2009~\cite{googlead}. While contextual advertising serve ads based on the content of the page embedding the ads, both retargeting and behavioral utilize the browsing history of a user to place relevant ads.
Past browsing behavior is obtained by aggregators via embedding themselves in Web pages as \emph{3rd-parties} in combination with setting cookies in the browser (NB: Other techniques such as fingerprinting exist; we discuss them in Sec.~\ref{subsec:ppp}). Consider the following example: (i) user Alice visits publisher \texttt{pubA.com} which contains references to a 3rd-party aggregator: \texttt{agg.com}.
(ii) If Alice is visiting \texttt{pubA.com} for the first time, the HTTP response is the content of the page being requested along with
a \texttt{Set-Cookie} HTTP header, with cookies pertaining to \texttt{pubA.com}. Likewise, if Alice has never visited \texttt{agg.com} (or any page with them as a 3rd-party), the responses from this domain will also include \texttt{Set-Cookie} header.
(iii) Alice next visits publisher \texttt{pubB.com} that also contains references to aggregator \texttt{agg.com}. As a cookie for \texttt{agg.com} was set when she visited \texttt{pubA.com}, Alice's browser sends this cookie to \texttt{agg.com} along with its request. Thus, \texttt{agg.com} now knows that Alice visited both \texttt{pubA.com}, and \texttt{pubB.com} and can use this to customize which ads to show.
This type of 3rd-party tracking is considered objectionable by many, because it results in Alice's browsing history being revealed to 3rd-parties that she is unaware of. While publishers themselves may also track Alice over time -- 1st-party tracking -- Alice is generally aware of 1st-parties that she is dealing with. In contrast, a publisher may embed any number of 3rd-parties without notifying the user.
\emph{The first goal of our system is to give transparency and control to Alice in the context of 3rd-party tracking.}
A key difference with previous solutions to that problem is that Alice - aware that part of her browsing history may boost the revenue of the ads shown on the websites she visits - may sometimes be eager to disclose some of that information \emph{selectively} for an appropriate reward. \emph{Permitting such a data transaction is the second goal of our system.}
Overall, we hope to design an information system that can be built and used experimentally. It should hence satisfy the following requirements:
\begin{enumerate}
\item \textbf{Selective Privacy protection.}
The system should protect users' browsing history from being revealed to 3rd-party aggregators. Note that this protection is critical even for the data the user intends to sell. Without privacy protection there is no incentive for aggregators to enter the market as they can obtain users' data via conventional means. The system should generally enable users to disclose only a fine-grained subset of their browsing.
\item \textbf{Backwards and incentive compatibility.} First, this means that the system should work with today's tracking and online advertising systems, with minimal modifications required for the delivery of ads. This helps in reducing friction in adoption for data aggregators and ad-networks. Second, it should encourage adoption by providing different parties with the right economic incentives. Note that this last requirement is more complex as decisions of several parties together interact to change revenue. This is why we will carefully study how different designs affect online revenue sharing.
\item \textbf{Access to data.} Unlike existing proposals~\cite{Chen:2013, Guha:2011kn,Toubiana:2010tm} {an information market} should not require aggregators to communicate targeting algorithms--which may be considered trade secrets--to the system. Instead, aggregators should be able to purchase raw data about users' browsing habits (\ie when and what sites the user has visited).
\item \textbf{Avoid having users price data.} Since aggregators have knowledge of the relative value of user data (\eg somebody who visits Rolex.com may have higher value) they are in the best position to determine prices in the market. Further, having users assign value to their own
data~\cite{Carrascal:2013} or calculate the loss of utility with their information release~\cite{Ghosh:2011jy} is non-trivial. We design an information market where the price is set by the demand for data from aggregators; we believe they are in a better position to price the data appropriately.
\end{enumerate}
\iffalse
and hence \texttt{agg.com} knows that
Alice has visited both \texttt{pubA.com}, and \texttt{pubB.com}. The aggregator \texttt{agg.com} can now use this information to target Alice and
display ads that are tailored to Alice based on her browsing history. Since Alice directly and voluntarily navigated to these sites, she
is aware that they know about her visit (1st-party tracking). However Alice is not aware of \texttt{agg.com}'s presence on \texttt{pubA.com}
and \texttt{pubB.com} and the fact that \texttt{agg.com} is tracking her and profiling her browsing history (3rd-party tracking).
{an information market} is concerned with protection against 3rd-party tracking only. 1st-party transactions are not considered and as a consequence, search keywords, uploads etc are \emph{not} currently handled. Also, 1st-parties can forward personal information and tracking data to 3rd-party aggregators. While {an information market} cannot prevent such sharing of information, we focus on limiting the \emph{usage} of this information, without the consent of the user, via economic compensation.
\fi
\section{Conclusions}
\label{sec:conc}
Can a system for online privacy be mutually beneficial to users and online advertisers? In this paper we take a first step towards answering this question by designing an information market focusing on 3rd-party tracking. We discussed the requirements for an information market, and designed and implemented our system to provide privacy, Web performance, and revenue to users. We evaluate feasibility of the market using a one-month field study with 63 users and observed that users actively engage with the system and are willing to sell parts of their browsing data, however these disclosures do not necessarily match up with their stated privacy concerns. Users also declared that using an information market affected their privacy attitudes.
We then proposed a model to capture the effects of information markets on advertising revenue and investigated their viability. Further, we considered the system at scale using traces containing billions of Web requests made by millions of users, to understand economic ramifications of an information market at scale and showed that it can be profitable to all parties. We found that advertising revenue increases by 9-12\% overall when all players, i.e., users and data aggregators, cooperate -- an observation that is at odds with most current beliefs about privacy preserving techniques.
\section{Introduction}
\label{sec:intro}
Most online services currently provide users with the same standard terms of usage: users may use them free of charge but those uses are monetized through data collection used for online advertising. This economic model was long criticized by privacy advocates, due to the growing amount of information collected about each user~\cite{Gill:2013,Krishnamurthy:2010ta}, and the lack of effective control it provides her over how it is used. Indeed, this model recently came under a new stress: Softwares that block ads and/or limit some third party tracking~\cite{adblock,noscript,dnt} are no more confined to a minority of savvy users: Adoption by Internet users is already reported up to 35\% in two European countries in 2015, and more importantly, quickly growing everywhere, including the largest advertising markewith the same standard terms of usage: ts~\cite{Anonymous:2015wp}. Some ad-blocking even comes shipped for the default browser on mobile platforms such as Apple iOS 9~\cite{ios-adblock}. Those users who \emph{in effect} opt-out of tracking or advertising (at least partially) are estimated to negatively affect ad revenues in the tens of billions~\cite{Anonymous:2015wp}. Those revenue losses motivated multiple research prototypes and development for alternative ways to collect, manage and exploit personal data: personal data store, lockers, intent-casting and privacy preserving ad personalization, see \cite{Anonymous:bkd81APP,Mun:2010uz,deMontjoye:2014bs} and more than 50 related development efforts mentioned at \texttt{cyber.law.harvard.edu/projectvrm/}.
Online privacy solutions such as those mentioned above typically struggle with restricted deployment due to the incentives (or lack thereof) that they produce. On the one hand a unilateral opt-out solution - deployed by a user herself, such as blocking~\cite{adblock,noscript} - may be difficult to configure as it often impacts service quality~\cite{cranor-adblock}.
The incentive actually exists for ad-networks, aggregators, and publishers to cause disruption in service for such opt-out users, as its adoption by a user significantly reduces the value she generates ~\cite{Aziz:uz,Gill:2013ts}.
In contrast, a cooperative solution - deployed jointly by multiple parties (\eg aggregators, publishers, users)~\cite{Guha:2011kn,Toubiana:2010tm} - may in principle offer incentives to all. However, most of these systems offer users enhanced privacy but no more, and little is formally known about the incentives offered to other parties. Much evidence suggests that enhanced privacy alone can be difficult for users to perceive and treat as a rational choice, even among users self-reporting a concern for tracking~\cite{Acquisti:2009tb} (a trend we confirm in our experiment).
Here we evaluate through experiments and data-driven analysis the promise of a different online privacy solution: \emph{an information market}. In contrast to all the above systems, an information market implements an incentive for all parties to participate. Users, for instance, can enjoy enhanced privacy by selecting which of their data can be used and be compensated for those. Depending on how the information market is designed, other parties may find it profitable to use for their interaction with online users. The idea of information markets is not new~\cite{Laudon:1996jj,Ghosh:2015el,Cvrcek:2006vv,Riederer:2011ta}, and is even offered by some products today~\cite{datacoup,blackbox,socialdatacollective}\footnote{For simplicity we focus on financial incentives here, but compensation can be in the forms of upgrade or discounts.} but very little is known of their economic viability. Even less is known about how they should be designed to engage users, let alone how they could gradually encourage an incremental adoption. This paper provides a much needed evaluation of each of those aspects, concluding that information markets show some promise. While information markets could be applied to multiple forms of personal data, in this work we focus on their application to third party tracking during web browsing, for two reasons: First, third party tracking is a critical component of today's online advertising; second, the sharing of browsing data with third parties is often cited first among causes of concern by online users~\cite{Anonymous:2015vw}.
This paper presents the following contributions
\begin{itemize}
\item We design and build a simplified information market for third party web tracking. Through a simple architecture, this system enables selective privacy protection and economic transactions over data. Our design seamlessly integrates with today's web tracking and ad-network functions to be backward compatible. In fact, it even allows users to benefit from a performance boost as we show it can easily be combined with web acceleration features.
(\S\ref{sec:system})
\item We conduct a 30-day experiment with 63 participants in two metropolitan areas to observe the effect of economic incentive on online users' behaviors. We confirm that self-reported privacy attitudes may not always align with actual data disclosures by users. More importantly, we validate that the two features of an information market, \ie privacy when you want it, compensation when you do not, are effectively used and managed by users. Every user has some data they choose to protect, although disclosing it would increase their earning up to 52\%. As their browsing expands and new data gets created, users also often choose economic returns over data protection. In fact, we observe a growing engagement during our user study, and an overwhelming majority claims to be likely to use such a system if it was deployed.
(\S\ref{sec:experiment})
\item We study the potential for an incremental deployment of an information market at a large scale. To do so, we extend a model predicting today's online advertising revenue per user. Through cooperative game theory we analyze how market forces may affect revenue redistribution to different parties should information market be offered as an option. We then assume that a party adopts an information market only when positive benefits are gained, which may in turn affect others' decision to adopt. We use this model to analyze spread of adoption in several HTTP traces containing up to 3 million users, along with the publishers and third parties they interact with. This model predicts significant revenue growth (up to 9-12\%) as information market expands the availability of high quality data about users. A significant fraction of the users (from 35\% to 92\% depending on the traces) adopt information market and receive monetary gain.
(\S\ref{sec:deployment})
\end{itemize}
To our knowledge these results present the first data driven evaluation of information markets and their potential to scale to the web. We recognize that deployment of an information market remains a hard problem: Online user privacy is increasingly more complicated, as new forms of tracking or re-identification~\cite{Acar:2014bg} come into play. The complexity of the online advertising ecosystem creates multiple frictions to deployment\cite{Yuan:2012th}. Moreover, there is economic incentives for users to game the system (we monitored our user study closely and confirm we did not observe any instances of gaming to pollute our data and findings, and discuss in \S\ref{subsec:result} how gaming can be detected). Given those limitations, it is important to interpret our results in their context: First, they assume that the information market operates in a way that allows users to technically opt-out.
Also our architecture allows the privacy preserving module to evolve to handle new forms of tracking and re-identification.
Second, our analysis of online revenue and its redistribution necessarily makes some assumptions (following bargaining resolution as classically drawn by Nash and later Shapley). Our results prove at least that a few conventional wisdoms about online privacy may not always hold. Solutions offering privacy choices and compensating users for data may not necessarily reduce overall advertising revenue; they may even benefit publishers. This contributes to the ongoing debate over who benefits from targeted advertising~\cite{Marotta:vi}. Finally, in terms of design, our results help in proving the promise of enabling selective privacy: our experiments show that users are able to determine the data they want to protect, and those they are eager to sell. For the latter, our trace analysis revealed for the first time that opportunities abound for an information market to make data more widely available, fueling more revenue. These trends may be reproduced under different conditions and assumptions than ours. Our findings contribute to argue that the arms race we experience between blocking and more invasive tracking techniques may not necessarily in the long term serve the interests of online publishers and the advertising industry overall.
\section{Related Work}
\label{sec:related}
The work presented in this paper lies at the intersection of online advertisements, privacy, and economics.
\myparab{Privacy preserving advertisements and analytics.}
\hspace{-0.13in}There has been recent interest in solutions that protect users' privacy while still enabling aggregators to provide targeted advertisements, perform analytics
and personalized services \cite{Juels, Hub, Guha:2011kn, Toubiana:2010tm, Chen:2013, repriv, Riederer:2011}.
Privad~\cite{Saikat:2011tt}, Adnostic~\cite{Toubiana:2010tm} and RePriv~\cite{repriv} are
browser based systems that block access by 3rd parties to varying degrees and
enable targeted ads to be shown to the user, without leaking personal information.
Information markets~\cite{Riederer:2011, datacoup, Laudon} also address the concerns of aggregators to collect information,
while allowing users to choose what information about them can be released for suitable
economic compensation. Our goal in this paper is to study the viability and effectiveness of such economically driven solutions
by designing, implementing and testing the solution in the wild with real users.
\myparab{Privacy and economics.} Our work is closely tied to work which considers personal
information, through the lens of economics~\cite{Reznichenko:2011tx, evans, Ghosh:2011jy, Kleinberg:2001vz}.
Both Reznichenko \etal~\cite{Reznichenko:2011tx} and Ghosh \etal~\cite{Ghosh:2011jy} study and design auction mechanisms; the former deals with ad-space auctions and the latter deals with direct personal
information (similar to~\cite{Riederer:2011}). Our work is different, in that we propose and implement a system that
combines privacy and performance, and study the \emph{implications}
of selling information (via a direct or mediated market) to various parties involved at a large scale using Web traces.
\section{System Description}
\label{sec:system}
\begin{figure}[t]
\begin{center}
\includegraphics[width=0.47\textwidth ]{graphs/TP_system_overview.png}
\caption{Overview of our system. Alice opts in and creates a whitelist, comprising of sites she's willing to disclose her visit to. Alice's Web requests are routed through our system. See Sections~\ref{subsec:ppp}-\ref{subsec:econ} for detailed descriptions for each module shown.}
\label{fig:sys_overview}
\end{center}
\end{figure}
\begin{figure}[t]
\begin{center}
\includegraphics[width=0.47\textwidth ]{graphs/TP_whitelists.png}
\caption{Sample of whitelists along with visit frequencies shown to aggregators to valuate users and bid on them. Note that aggregators will not know who users 1 and 2 are until they bid on them and win the auction on these users. They are then granted \emph{access} to these users and can track them on their whitelisted sites.}
\label{fig:whitelists}
\end{center}
\end{figure}
\begin{figure*}[t]
\begin{center}
\includegraphics[width=1\textwidth ]{graphs/TP_system.eps}
\caption{Alice visits a whitelisted site \texttt{fooA.com} with two trackers \texttt{B.com} and \texttt{C.com}. Since \texttt{B.com} has paid to access Alice, it receives cookies. \texttt{C.com}'s cookies are dropped in both directions. Note \texttt{B.com}'s cookies would be dropped if \texttt{fooA.com} is not whitelisted.}
\label{fig:system}
\end{center}
\end{figure*}
Our market solution, designed for the aforementioned requirements, is deployed in the network by a trusted third party \eg a government body or an ISP, as illustrated in Fig. \ref{fig:sys_overview}. First, we implement a privacy preservation module to keep user's browsing history private from 3rd-party aggregators. Users who opt-in to the market have all their Web requests routed through our system, which provides privacy protection by blocking known forms of Web tracking (Sec.~\ref{subsec:ppp}). Note that we do not block ads (or any other requests) and allow them to be shown to the user. The system only prevents leakage of personally identifiable information (PII) to advertisers.
Each user then creates a \emph{whitelist}, which is a list of Web sites, if any, they are willing to be tracked on by 3rd-party aggregators in return for monetary compensation. Users' whitelists along with their frequency of visits to those sites are then anonymized and presented to participating aggregators. Fig. \ref{fig:whitelists} shows a sample of what aggregators see. Aggregators can then valuate each anonymized user based on their whiteliste and frequency of visits to these sites, and bid on them if interested (Apx. \ref{apx:eval}). The system then runs an auction (Sec. \ref{subsec:econ}) for each user to determine the winning aggregators, if any, and the winning bid. Each winning aggregator then pays that user the winning amount and in return gets \emph{access} to the user for the duration of the next auction period. We define access as the ability to track the user across their whitelisted sites and use this information as input to any proprietary targeting algorithms to serve targeted ads to the user on those sites.. Note that adding a Web site to the whitelist by itself does not allow aggregators to track the user on that site. Aggregators still have to bid, win, and compensate the user before they can track them.
\iffalse
Consider the different types of information that can be gleaned from the web browser:
(i) the clickstream of the user; all the websites the user
browses, (ii) any activity on these websites; includes search keywords, uploads, location information (via geolocalized network address),
personal information like credit card information \etc., (iii) inferred information about the user; behavioral profile constructed by tracking the user across the web and over time, (iv) ad impression data; the specific ads that were shown to the user, (v) ad click data; the ads a user has clicked on
and the related landing pages the user is directed towards.
{an information market} empowers the user to decide which part of the clickstream they want to release. Hence, any websites that
are not revealed (for commensurate economic return) are kept private from aggregators by blocking tracking (Sec.~\ref{}) and hence the
behavioral profile will only be a function of the websites that are revealed by the user herself.
As one of the objectives of {an information market} is to keep the current online advertising mechanisms intact, we let the ads
to be shown to the user. However, the ad-networks also do not know the network address of the user and we also strip out any possible
identifying information like the \texttt{referer} header, limiting the information the ad-networks can obtain, apart from knowledge of
ad impressions. With regards to ad-click data, most ad-clicks are handled by re-directs via the ad-networks to the advertisers. We do not
change this practice. We treat that as a first party transaction and any information that the user chooses
to exchange with the advertiser is not protected. We note that this information can be used by ad-networks and advertisers for accounting
reasons as well as for combating click-fraud~\cite{}.
Our solution requires a trusted third party.
Reducing the required level of trust is left for future work. Our solution also requires an active participation by the users, by releasing data
in exchange of monetary compensation. Users therefore have an incentive to cheat. We discuss this issue in detail in Sec.~\ref{}.
\fi
Next, we discuss each module in more detail.
\begin{enumerate}
\item \textit{Privacy preserving module:} handles all web requests of all users and provides privacy.
\item \textit{Web acceleration module:} compensates for any performance loss due to the added privacy protection.
\item \textit{Economic module} handles auctions and economic transactions between the users and aggregators.
\end{enumerate}
\vspace{0.01in}
\subsection{Privacy preserving module}
\label{subsec:ppp}
The privacy preserving module handles all HTTP requests and responses for users with the objective to provide privacy protection
against 3rd-party tracking, \emph{without} blocking any requests, including advertisements. Below we discuss different tracking methods and how the privacy preserving module deals with each of them:
\myparab{Cookies:}HTTP cookies are the most prevalent method for online tracking. Using cookies, a tracker can assign a unique identifier
to each user, which is consistent across different websites, and gives them the power to track users browsing behavior. Today's browsers ship with options to block 3rd-party cookies. However, blocking 3rd-party cookies will not necessarily prevent 3rd-party tracking since most browsers only block \texttt{Set-Cookie} in HTTP responses, meaning if a 3rd-party already has its respective cookies set, \eg via popups as a 1st-party, then these previously set cookies will indeed be sent out by the browser to the 3rd-party tracker, defeating the purpose~\cite{Roesner:2012}.
To prevent unwanted 3rd-party tracking via cookies, we first classify each HTTP request as either \textit{1st-party-request} or \textit{3rd-party-request}. A HTTP request is a 1st-party-request if the \texttt{Host} and \texttt{Referer} headers belong to the same root domain, and a 3rd-party-request otherwise~\footnote{With some exception cases, such as CDNs, which are treated as 1st-party. Our technique also wrongly classifies the following as a 1st party request: when a \texttt{publisher.com} uses CNAME to set the DNS to point part of their traffic, such as \texttt{metrics.publisher.com} to a 3rd party.}. Next, if
a request is marked as a 3rd-party-request, we will only let its cookies go through along with the request if both of the following
conditions are satisfied:
\begin{description}
\item[ ] (a) the user making this request has whitelisted the root domain of the \texttt{Referer},\ie the top domain the user is visiting in their browser,
\item[ ] (b) the root domain of the \texttt{Host}, \ie the 3rd-party destination of the request, has paid to access this user (Sec.~\ref{subsec:econ}).
\end{description}
Cookies are stripped off from the 3rd-party-request and its response otherwise (Fig.~\ref{fig:system}). \texttt{Set-Cookie} per-se does not leak any PII, but it is dropped to preserve user's cookie jar consistency. Note that since we only strip information off of requests and don't block them, ads would still be rendered properly in the browser.
\myparab{Referers:}Referer headers may contain unnecessary PII~\cite{Krishnamurthy:2011uv}, and we treat them the same way as cookies, \ie drop if
3rd-party-request and one or both of the conditions mentioned above are not satisfied.
\myparab{Web bugs:} 1x1 pixel bugs on a page are invisible to the user and serve no content. Their sole purpose is user tracking. The prior steps render these useless.
\myparab{\texttt{Etag} and \texttt{If-None-Match}:}These optional headers are generally used for web cache validation but can also be used for tracking~\cite{Krishnamurthy:2011uv}.
When a web server is responding to a request, it can send an \texttt{Etag} header that is an identifier for the version of the resource being requested.
When the user makes the request to the same resource in the future, she can send a conditional request using the \texttt{If-None-Match} header.
Instead of a resource identifier, \texttt{Etag} can contain a unique user identifier for all new users, \ie users with no \texttt{If-None-Match} header in
their request. When the same user returns to the web server, they identify themselves by sending the unique identifier
as \texttt{If-None-Match} header, hence enabling tracking. We drop \texttt{Etag} and \texttt{If-None-Match} headers\footnote{The web acceleration module (Sec~\ref{subsec:web}) mitigates any possible bandwidth overhead to the web server.}.
\myparab{Flash cookies and LocalStorage:}Flash cookies and LocalStorage can be used to respawn deleted cookies~\cite{flash}.
However the way we deal with 3rd-party cookies, renders respawning useless.
\myparab{JavaScript:}
JS can be used instead of \texttt{Set-Cookie} header. We already deal with this in the same way we deal with cookies.
JS can be used by 3rd-parties to collect information about users, \AMadd{using techniques such as fingerprinting~\cite{Anonymous:2013hd}}. Such code can be fingerprinted and blocked. This may be included in future versions of the system, but is beyond the scope of this paper.
\subsection{Web acceleration module}
\label{subsec:web}
To mitigate overhead of the privacy protection, we include a Web acceleration module. \AMdel{We implement a standard Web acceleration module, similar to Varnish~\cite{varnish} with some modifications. }To boost performance we use standard acceleration methods such as performing on-the-fly prefetching of static objects (images, JS, css), prioritizing traffic, image compression, and maintaining persistent TCP connections with both the user and the origin server and using the same connection for multiple requests.
\myparab{Benchmarks:} In order to test our web acceleration and privacy preserving modules for performance and functionality, we wrote a script using PhantomJS~\cite{phantomjs} and ySlow~\cite{yslow} to load each Alexa top 100 sites once via our system and once directly. We repeat this test 10 times and look at the average difference in load time and number of objects as a measure of functionality\footnote{The expectation is that privacy protection mechanisms do not block any legitimate content that can lead to lower quality of experience for the end-users.}. Fig.~\ref{fig:awazza_performance} shows that roughly 80\% of sites load faster with our accelerator. With regards to the number of objects, while most sites have the exact same number, some have fewer or more objects when loaded via our system. This is an expected result since most pages are dynamic and the content does not necessarily remain the same over the course of the experiment. We manually inspected pages with different numbers of objects to confirm that the difference is mostly due to content change.
\begin{figure}[t]
\begin{center}
\includegraphics[width=0.47\textwidth ]{graphs/awazza_performance.eps}
\caption{Performance and functionality of web acceleration and privacy preservation module. Positive percentages mean we are doing better.}
\label{fig:awazza_performance}
\end{center}
\end{figure}
\subsection{Economic module}
\label{subsec:econ}
At the beginning of each auction period, the economic module does the following:
\begin{enumerate}
\item Presents aggregators with \emph{anonymized} whitelists and frequency of visits.
\item Collects aggregators bids on users. Aggregators bid independent from each other.
\item Runs an auction per user and determines the winning value and winning aggregators (if any) for each of the users. Note that a user's browsing behavior can be sold to multiple aggregators.
\item Handles transactions between users and aggregators and makes sure every aggregator pays all the users they won access to. It then notifies the privacy preserving module to grant appropriate access for the duration of the next auction period.
\end{enumerate}
We let aggregators compute the value of access to a user for the following reasons. First, aggregators have experience deriving value from PII. Second, they are able to assess revenues on a short-term basis through the sale of goods or ad-space, compared to the long-term risk a user must calculate in dealing with privacy. Finally, aggregators deal with many customers, and can take more risk in over- or underestimating the value of access, as opposed to users who are more risk-averse.
However, there can be strong incentives for aggregators to lie about their valuation by under-bidding, which results in lowering the user's revenue. To prevent such behavior, the auction should have a truth telling mechanism where aggregators gain no additional benefit by under-bidding.
For this purpose, we rely on an auction mechanism called the exponential mechanism~\cite{exp-mechanism} that has truth telling properties, and has been shown to be close to optimal in terms of revenue for the seller (user in our case)\footnote{We choose this latter objective, while noting that other objective functions (\emph{e.g.},~maximizing revenue for all players in the value chain) can be chosen.}. Apx. \ref{app:auction} explains the auction mechanism in detail.
\section{User study}
\label{sec:experiment}
We implemented our system and performed a field study to understand user engagement, usability\AMdel{aspects of an information market}, and how users perceive economic rewards for their data.
\subsection{Implementation}
\label{subsec:impl}
\AMnote{This subsection was moved from Section \ref{sec:userstud} to here}
The privacy preserving and web acceleration modules are managed by a proxy, hosted on Amazon EC2, that handles all requests and treats 3rd-party-requests according to the mechanisms described in ~\ref{subsec:ppp}. For each user, the proxy maintains a whitelist, as well as a \emph{buyers list} that includes aggregators who have paid to access that user.
We developed a browser extension to serve as an interface for users to interact with the market. Figure \ref{fig:extension} shows a screenshot of the extension. It places a color-coded icon in the address bar; green for whitelisted sites, red otherwise. Users can click to add/remove sites to/from the whitelist, or check their current whitelist, buyers list, and past earning.
\begin{figure}[h]
\begin{center}
\vspace{-0.1in}
\includegraphics[width=0.2\textwidth ]{graphs/TP_extension.png}
\vspace{-0.13in}
\caption{Screenshot of our browser extension. User is visiting \texttt{google.com} which is not in their whitelist.}
\vspace{-0.25in}
\label{fig:extension}
\end{center}
\end{figure}
\subsection{Experimental setting}
\label{subsec:eval}
\myparab{User study description}
A total of 63 participants located in New York City and Boston used our system for 30 days. Our population overrepresents male (75\%), and young (85\% under 25) users, and has wide variations in income (median around \$35k), technical proficiency and Internet use.
Every user was initially assigned a default whitelist containing 108 websites chosen from Alexa top 125 sites excluding social network and adult sites. Users could modify their whitelist at any time. Auctions, using the mechanism shown in Sec.~\ref{subsec:econ}, were conducted every three days, resulting in 10 data points per user. At each auction, the goods for sale are
the ability to track users for the upcoming period.
Each winning aggregator pays the winning bid value to the user and gains access to her browsing activity \emph{on her whitelisted sites only} during the subsequent auction period to deliver targeted ads.
As an example, aggregator \texttt{agg.com} wins access to user $u$ with whitelist $WL_u$. This implies that, until the next auction, the privacy preserving module will NOT modify 3rd-party-requests to \texttt{agg.com}
caused by $u$ while visiting sites in $WL_u$.
We did not have access to real aggregators for our study, hence we \emph{emulated} 128 aggregators, including big players such as DoubleClick and Facebook. The challenge when emulating aggregators is computing their valuation for users' data.
For this we use a simple model based on keywords and their estimated cost-per-click commonly made available by ad-networks (details in Apx.~\ref{apx:eval}). Note that, based on the emulated valuation of their data and the auction's results, users were paid using \emph{real} money.
Each user was also asked to answer a questionnaire before and after the study, The pre-study questionnaire included demographical questions as well as self reported assessment of the user's view on online privacy. The post-study questionnaire contained questions about the user's experience with the system, and assessed if using our system changed her view on online privacy. Table~\ref{table:questions} shows the questions and answers we received.
\subsection{Users and information markets}
\label{subsec:result}
\AMnote{The structure of this section was changed to (1) state what we see (2) give supporting data that backs up what we see}
\AMadd{We made the following observations during the user study:}
\myparab{i) Users actively engage with the system and edit their whitelists.}
We first studied users' engagement with the tool and how they reacted to different facets of the system.
We logged the number of HTTP requests coming from each user, which we refer to as \textit{activity}.
The average activity stays in the [10k,14k] range per user during all 10 auction periods, which indicates users were using the system on a regular basis. Users actively added/removed sites to/from their whitelists, showing their engagement with the system, and we observed a sustained growth of the whitelists used, with an average user adding overall 50 new sites (a net 45\% increase from default whitelist) during the experiment.
As the post-study responses suggest Table~\ref{table:questions}, the majority of users were happy with the system's performance, receiving micro-payments, and the amount they were making for the data they released.
\AMdel{We also observed a sustained growth of the whitelists used, with an average user adding overall 50 new sites (a net 45\% increase from default whitelist) during the experiment.}
\myparab{ii) Users' disclosure does not match up with their stated privacy attitudes.}
We looked into users' behavior with regards to data disclosure and how it correlates with their \emph{self-reported} privacy concerns \AMdel{(refer to Table \ref{table:questions} for question details and summary of answers)}. We took the sum of the 5-point Likert Scale answers that users gave to privacy related questions \AMdel{(numbered 1, 2, 3, 5, and 7)} in the pre-study survey. This gives a \textit{privacy score} for each user, ranging from 8 to 20, where higher scores indicates higher privacy concerns. Surprisingly, we found \emph{no} sign of negative correlation between users' privacy score and size of their whitelist; the associated correlation coefficient is low: $-0.1$. This, along with previous results~\cite{Acquisti:2009tb}, suggests that users stated privacy concerns are at odds with their behavior. One possible explanation for this is that users are swayed by the economic returns.
\begin{table}[]
\small
\centering
\begin{tabular}{ c | c | c | c | c }
Bucket & {earning} & {size of WL*} & {\#WL visits} & {WL/ALL} \\
& (USD) & & & {activity} \\
\hline
HD & 2.76 & 230.6 & 151.6 & 0.71\\
\hline
MD & 2.12 & 128 & 128.1 & 0.52\\
\hline
LD & 1.55 & 115.1 & 67.4 & 0.48\\
\end{tabular}
\caption{averages of earning per auction, size of whitelist, number of whitelisted visits during auction period, and the fraction of activity which is whitelisted for different buckets. *WL = Whitelist}
\vspace{-0.15in}
\label{table:pri_money}
\end{table}
\myparab{iii) Users trade off their revenues to preserve privacy of their browsing behavior.}
To understand earning potentials of different users, we sort users based on their whitelists' size and split them into three equal size buckets: high, moderate, and low volume disclosers (resp. HD, MD and LD). Table~\ref{table:pri_money} shows earning, whitelist size, number of whitelisted visits,
and fraction of whitelisted activity for each buckets, averaged across users and auction periods. HD users earn 31\%/79\% more than MD/LD users. A primary factor is that they have larger whitelists (80\%/100\% more than MD/LD) that results in 71\% of their activities coming from whitelisted sites, in contrast with 52\%/48\% for MD/HD users.
If users were to disclose everything, \ie add \emph{all} the sites they browse to their whitelist, HD, MD, and LD users could potentially increase their earnings by 29\%, 48\%, and 52\% respectively.
\AMdel{In other words, users may not follow what they initially self-report but a user do select a \emph{different} tradeoff between economic returns and privacy, and they leave money on the table when privacy is at stake.}
\AMadd{In other words, while users' behavior may not exactly follow their initial self-reported concerns, they\AMdel{ are willing to leave money for privacy} are willing to trade off their revenues to preserve privacy of their browsing behavior.}
\myparab{iv) Users pay attention to their earning and have incentive to game the system.}
\label{subsubsec:gaming}
\AMnote{Following crossed out paragraph might seem contradicting to previous observation we make and confuse the reader. It also doesn't really fit here.}
\AMdel{As Table~\ref{table:corr} shows, earning primarily correlates with whitelisted visits, that generates impressions with aggregators.
We saw high volume disclosers (HD) earning more, but the size of whitelist is not itself a great predictor: a user might have a large whitelist and small activity, or vice versa.
As there are economic incentives in play, it is only natural to expect gaming by users -- users may decide to browse more as they expect economic returns. A key challenge is to differentiate between users who are abusing the system and users who are genuinely releasing more data, by choosing to be less private or not all.}
As there are economic incentives in play, it is only natural to expect gaming by users -- users may decide to expand their whitelists and browse more in order to increase their economic returns. A key challenge is to differentiate between users who are abusing the system and those who are genuinely releasing more data, by choosing to be less private and/or are more active than average users.
To study this aspect, we sorted users based on their total earning in auctions 1 to 5, and divided them into three groups: top-earners (8 users), low-earners (8 users), and avg-earners (rest). On average top-earners made 6X more money than low-earners and we observed, as expected, top-earners have indeed bigger whitelists (36\% bigger than low-earners on average) and browse more (4.5X more than low-earners on average).
To evaluate whether users would adjust their behavior and ``game'' the system to increase their earnings,
for the rest of the auctions, \ie auctions 6 -10, we gave top-earners a third of their earning and low-earners 3 times their earning. While this change did not have any significant effect on \AMdel{most users'} \AMadd{low-earners'} behavior -- pointing to normal behavior -- we did make a few interesting observations \AMadd{about top-earners}: 1) we received an email from one of the top earners complaining that the earning suddenly dropped even though their browsing habits had not changed 2) two top earners completely abandoned the system after the 7th auction, 3) three top-earners roughly doubled their whitelist \AMadd{trying to raise their earning back to previous range}, 4) one top earner doubled his/her browsing activity.
\AMdel{We did not observe behavioral changes for low-earners.} This suggests users pay attention to their earning, especially once it is significant, and that there is room for gaming the system\AMdel{, although none of these users are necessarily malicious}. Our experiment did not prevent gaming, it is however feasible in the future to include anomaly detection methods to detect abnormal activities.
\myparab{v) Information market impacts privacy attitudes.}
Most users agree after the experiment that the system gives them better transparency \AMadd{(96\%), increases their awareness of data monetization (83\%),} and they claim to be likely to use it if it is deployed (91\%); see Table~\ref{table:questions}. The experiment did not noticeably increase their privacy concerns, nor did it affect substantially the \AMdel{\emph{median or average}} price they would pay for privacy.
In other words, while users may still not pay for privacy, information markets did help them form a more consistent opinion about their online privacy and value of their data.
\AMdel{However, we notice two interesting secondary effects: the distribution narrows as its extreme values noticeably drop, and users are less willing to pay for online services that are currently free. These findings suggest that users of information markets may not fear or even pay for their privacy but could form more consistent opinions about the value of their data.}
| {'timestamp': '2018-10-05T02:14:41', 'yymm': '1810', 'arxiv_id': '1810.02318', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02318'} | arxiv |
\section{Method}
\label{sec:method}
\subsection{Problem statement}
Given a simulator that samples data as $\left(\vx,\vy\right) \sim q(\rvx,\rvy;\genparams)$, our goal is to adjust $\genparams$ such that the MTM $h_{\mtnparams}$ trained on that simulated data minimizes the risk on real data $\left(\vx,\vy\right) \sim p(\rvx,\rvy)$.
Assume we are given a validation set from real data $\dataset_{\mathrm{val}}$ and we can sample synthetic datasets $\dataset_{q\left(\dataInstRv,\labelInstRv | \genparams\right)} \sim q(\rvx,\rvy|\genparams)$.
Then, we can can train $h_{\mtnparams}$ on $\dataset_{q\left(\dataInstRv,\labelInstRv | \genparams\right)}$ by minimizing~\eqref{eq:main_bilevel_lower}.
Note the explicit dependence of the trained model parameters $\mtnparams^*$ on the underlying data generating parameters $\genparams$ in~\eqref{eq:main_bilevel_lower}.
To find $\genparams^*$, we minimize the empirical risk over the held-out validation set $\dataset_{\mathrm{val}}$, as defined in~\eqref{eq:main_bilevel_upper}.
Our desired overall objective function can thus be formulated as the bi-level optimization problem in~\eqref{eq:main_bilevel}.
Attempting to solve it with a gradient-based approach poses multiple constraints on the lower-level problem~\plaineqref{eq:main_bilevel_lower} like smoothness, twice differentiability and an invertible Hessian~\citep{sam:Bracken73,sam:Colson07a}.
For our case, even if we choose the model $h_{\mtnparams}$ to fulfill these constraints, the objective would still be non-differentiable as we (i) sample from a distribution that is parameterized by the optimization variable and (ii) the underlying data generation process (e.g.\@, an image rendering engine) is assumed non-differentiable for the sake of generality of our approach.
In order to cope with the above defined objective, we resort to policy gradients~\citep{reinforce} to optimize $\genparams$.
\subsection{Learning to simulate data with policy gradients}
Our goal is to generate a synthetic dataset such that the main task model (MTM) $h_{\mtnparams}$, when trained on this dataset until convergence, achieves maximum accuracy on the test set.
The test set is evidently not available during train time.
Thus, the task of our algorithm is to maximize MTM's performance on the validation set by generating suitable data.
Similar to reinforcement learning, we define a policy $\pi_{\policyparams}$ parameterized by $\policyparams$ that can sample parameters $\genparams \sim \pi_{\policyparams}$ for the simulator.
The simulator can be seen as a generative model $G(\rvx, \rvy | \genparams)$ which generates a set of data samples $\left(\vx, \vy\right)$ conditioned on $\genparams$.
We provide more details on the interface between the policy and the data generating function in the following section and give a concrete example for computer vision applications in~\Secref{sec:experiments}.
The policy receives a reward that we define based on the accuracy of the trained MTM on the validation set.
Figure~\ref{fig:lts-pipeline.png} provides a high-level overview.
\begin{figure}
\input{img/lts-pipeline.tex}
\vspace{-0.3cm}
\caption{A high-level overview of our ``learning to simulate'' approach. A policy $\pi_{\policyparams}$ outputs parameters $\genparams$ which are used by a simulator to generate a training dataset. The main task model (MTM) is then trained on this dataset and evaluated on a validation set. The obtained accuracy serves as reward signal $R$ for the policy on how good the synthesized dataset was. The policy thus learns {\em how to generate data to maximize the validation accuracy.}}
\label{fig:lts-pipeline.png}
\end{figure}
Specifically, we want to maximize the objective
\begin{equation}
J(\policyparams) = \mathbb{E}_{\genparams \sim \pi_{\policyparams}}[R]
\end{equation}
with respect to $\policyparams$.
The reward $R$ is computed as the negative loss $\lossSym$ or some other accuracy metric on the validation set.
Following the REINFORCE rule~\citep{reinforce} we obtain gradients for updating $\policyparams$ as
\begin{equation}
\nabla_{\policyparams} J(\policyparams) = E_{\genparams \sim \pi(\policyparams)}\big[\nabla_{\policyparams} \log(\pi_{\policyparams}) R(\genparams) \big] \;.
\end{equation}
An unbiased, empirical estimate of the above quantity is
\begin{equation}
\lossSym(\policyparams) = \frac{1}{K} \sum_{k=1}^{K} \nabla_{\policyparams} \log( \pi_{\policyparams})\hat{A}_k \;,
\label{eq:policy_update}
\end{equation}
where $\hat{A}_k = R(\genparams_k) - b$ is the advantage estimate and $b$ is a baseline~\citep{reinforce} that we choose to be an exponential moving average over previous rewards.
In this empirical estimate, $K$ is the number of different datasets $\dataset_{q\left(\dataInstRv,\labelInstRv | \genparams_k\right)}$ sampled in one policy optimizing batch and $R(\genparams_k)$ designates the reward obtained by the $k$-th MTM trained until convergence.
Given the basic update rule for the policy $\pi_{\policyparams}$, we can design different variants of our algorithm for learning to simulate data by introducing three control knobs.
First, we define the number of training epochs $\xi$ of the MTM in each policy iteration as a variable.
The intuition is that a reasonable reward signal may be obtained even if MTM is not trained until full convergence, thus reducing computation time significantly.
Second, we define the size $M$ of the data set generated in each policy iteration.
Third, we either choose to retain the MTM parameters $\mtnparams$ from the previous iteration and fine-tune on the newly created data or we estimate $\mtnparams$ from scratch (with a random initialization).
This obviously is a trade-off because by retaining parameters the model has seen more training data in total but, at the same time, may be influenced by suboptimal data in early iterations.
We explore the impact of these three knobs in our experiments and appendix.
\Algref{alg:main_alg} summarizes our approach.
\begin{algorithm}[]
\SetAlgoLined
\DontPrintSemicolon
\For{iteration=1,2,...}{
Use policy $\pi_{\policyparams}$ to generate $K$ model parameters $\genparams_k$\;
Generate $K$ datasets $\dataset_{q\left(\dataInstRv,\labelInstRv | \genparams_k\right)}$ of size $M$ each\;
Train or fine-tune $K$ main task models (MTM) for $\xi$ epochs on data provided by $\mathcal{M}_k$\;
Obtain rewards $R(\genparams_k)$, i.e.\@, the accuracy of the trained MTMs on the validation set\;
Compute the advantage estimate $\hat{A}_k = R(\genparams_k) - b$\;
Update the policy parameters $\policyparams$ via~\eqref{eq:policy_update}\;
}
\caption{Our approach for ``learning to simulate'' based on policy gradients.}
\label{alg:main_alg}
\end{algorithm}
\subsection{Interfacing a simulator with the policy}
We defined a general black-box simulator as a distribution $G(\rvx,\rvy | \genparams)$ over data samples $\left(\vx,\vy\right)$ parameterized by $\genparams$.
In practice, a simulator is typically composed of a deterministic ``rendering'' process $\mathcal{R}$ and a sampling step as $G(\rvx,\rvy | \genparams) = \mathcal{R}(S(\sceneparams|\genparams), P(\renderparams|\genparams))$, where the actual data description $\sceneparams$ (e.g.\@, what objects are rendered in an image) is sampled from a distribution $S$ parametrized by the provided simulation parameters $\genparams$ and specific rendering settings $\renderparams$ (e.g.\@, lighting conditions) are sampled from a distribution $P$ also parameterized by $\genparams$.
To enable efficient sampling (via ancestral sampling)~\citep{Bishop:2006:PRM:1162264}, the data description distribution is often modeled as a Bayesian network (directed acyclic graph) where $\genparams$ defines the parameters of the distributions in each node, but more complex models are possible too.
The interface to the simulator is thus $\genparams$ which describes parameters of the internal probability distributions of the black-box simulator.
Note that $\genparams$ can be modeled as an unconstrained continuous vector and still describe various probability distributions.
For instance, a continuous Gaussian is modeled by its mean and variance.
A K-dimensional discrete distribution is modeled with K real values.
We assume the black-box normalizes the values to a proper distribution via a softmax.
With this convention all input parameters to the simulator are unconstrained continuous variables.
We thus model our policy as the multivariate Gaussian $\pi_{\policyparams}(\sceneparams, \renderparams) = \mathcal{N}(\policyparams, \sigma^{2})$ with as many dimensions as the sum of the dimensions of parameters $\sceneparams$ and $\renderparams$.
For simplicity, we only optimize for the mean and set the variance to $0.05$ in all cases, although the policy gradients defined above can handle both.
Note that our policy can be extended to a more complicated form, e.g.\@, by including the variance.
\section{Introduction}
\label{sec:intro}
In\blfootnote{$\ddagger$ This work was part of N. Ruiz's internship at NEC Labs America.} order to train deep neural networks, significant effort has been directed towards collecting large-scale datasets for tasks such as machine translation~\citep{luong-pham-manning:2015:EMNLP}, image recognition~\citep{imagenet} or semantic segmentation~\citep{kitti,cityscapes}. It is, thus, natural for recent works to explore simulation as a cheaper alternative to human annotation~\citep{virtualkitti,synthia,playing_for_data}. Besides, simulation is sometimes the most viable way to acquire data for rare events such as traffic accidents.
However, while simulation makes data collection and annotation easier, it is still an open question {\em what distribution} should be used to synthesize data.
Consequently, prior approaches have used human knowledge to shape the generating distribution of the simulator \citep{SDV18}, or synthesized large-scale data with random parameters \citep{playing_for_data}.
In contrast, this paper proposes to {\em automatically determine simulation parameters} such that the performance of a model trained on synthesized data is maximized.
Traditional approaches seek simulation parameters that try to model a distribution that resembles real data as closely as possible, or generate enough volume to be sufficiently representative. By learning the best set of simulation parameters to train a model, we depart from the above in three crucial ways. First, the need for laborious human expertise to create a diverse training dataset is eliminated. Second, learning to simulate may allow generating a smaller training dataset that achieves similar or better performances than random or human-synthesized datasets \citep{playing_for_data}, thereby saving training resources. Third, it allows questioning whether mimicking real data is indeed the best use of simulation, since a different distribution might be optimal for maximizing a test-time metric (for example, in the case of events with a heavy-tailed distribution).
More formally, a typical machine learning setup aims to learn a function $h_{\mtnparams}$ that is parameterized by $\mtnparams$ and maps from domain $\mathcal{X}$ to range $\mathcal{Y}$, given training samples $\left(\vx,\vy\right) \sim p(\rvx,\rvy)$.
Data $\vx$ usually arises from a real world process (for instance, someone takes a picture with a camera) and labels $\vy$ are often annotated by humans (someone describing the content of that picture).
The distribution $p(\rvx,\rvy)$ is assumed unknown and only an empirical sample $\mD = \{\left(\vx_i,\vy_i\right)\}_{i=1}^{\datasetSize}$ is available.
The simulator attempts to model a distribution $q(\rvx,\rvy; \genparams)$. In prior works, the aim is to adjust the form of $q$ and parameters $\genparams$ to mimic $p$ as closely as possible.
In this work, we attempt to automatically learn the parameters of the simulator $\genparams$ such that the loss $\lossSym$ of a machine learning model $h_{\mtnparams}$ is minimized over some validation data set $\dataset_{\mathrm{val}}$.
This objective can be formulated as the bi-level optimization problem
\begin{subequations}\label{eq:main_bilevel}
\begin{align}
\genparams^* &= \argmin_{\genparams}\sum_{\left(\vx,\vy\right) \in \dataset_{\mathrm{val}}} \loss{y, h_{\mtnparams}(\vx; \mtnparams^*(\genparams))}\label{eq:main_bilevel_upper}\\
\textrm{s.t.}\quad \mtnparams^*(\genparams) &= \argmin_{\mtnparams} \sum_{\left(\vx,\vy\right) \in \dataset_{q\left(\dataInstRv,\labelInstRv | \genparams\right)}} \loss{\vy, h_{\mtnparams}(\vx, \mtnparams)}\label{eq:main_bilevel_lower},
\end{align}
\end{subequations}
where $h_{\mtnparams}$ is parameterized by model parameters $\mtnparams$, $\dataset_{q\left(\dataInstRv,\labelInstRv | \genparams\right)}$ describes a data set generated by the simulator and $\mtnparams(\genparams)$ denotes the implicit dependence of the model parameters $\mtnparams$ on the model's training data and consequently, for synthetic data, the simulation parameters $\genparams$.
In contrast to~\citet{l2t}, who propose a similar setup, we focus on the actual data generation process $q(\rvx,\rvy; \genparams)$ and are not limited to selecting subsets of existing data.
In our formulation, the upper-level problem (\eqref{eq:main_bilevel_upper}) can be seen as a meta-learner that learns {\em how} to generate data (by adjusting $\genparams$) while the lower-level problem (\eqref{eq:main_bilevel_lower}) is the main task model (MTM) that learns to solve the actual task at hand.
In Section~\ref{sec:method}, we describe an approximate algorithm based on policy gradients~\citep{reinforce} to optimize the objective~\plaineqref{eq:main_bilevel}.
For our algorithm to interact with a black-box simulator, we also present an interface between our model's output $\genparams$ and the simulator input.
In various experiments on both toy data and real computer vision problems, Section \ref{sec:experiments} analyzes different variants of our approach and investigates interesting questions, such as: ``Can we train a model $h_{\mtnparams}$ with less but targeted high-quality data?'', or ``Are simulation parameters that approximate real data the optimal choice for training models?''.
The experiments indicate that our approach is able to quickly identify good scene parameters $\genparams$ that compete and in some cases even outperform the actual validation set parameters for
synthetic as well as real data, on computer vision problems such as object counting or semantic segmentation.
\section{Experiments}
\label{sec:experiments}
The intent of our experimental evaluation is (i) to illustrate the concept of our approach in a controlled toy experiment (\secref{sec:toyexps}), (ii) to analyze different properties of the proposed~\algref{alg:main_alg} on a high-level computer vision task (\secref{sec:carcnt1}) and (iii) to demonstrate our ideas on real data for semantic image segmentation (\secref{sec:realsemseg}).
\subsection{Toy experiments on gaussian mixtures}
\label{sec:toyexps}
To illustrate the concept of our proposed ideas we define a binary classification task on the 2-dimensional Euclidean space, where data distribution $p(\rvx,\rvy | \genparams_{\textrm{real}})$ of the two classes is represented by Gaussian mixture models (GMM) with 3 components, respectively.
We generate validation and test sets from $p(\rvx,\rvy | \genparams_{\textrm{real}})$.
Another GMM distribution $q(\rvx,\rvy|\genparams)$ reflects the simulator that generates training data for the main task model (MTM) $h_{\mtnparams}$, which is a non-linear SVM with RBF-kernels in this case.
To demonstrate the practical scenario where a simulator is only an approximation to the real data, we fix the number of components per GMM in $\genparams$ to be only 2 and let the policy $\pi_{\policyparams}$ only adjust mean and variances of the GMMs.
Again, the policy adjusts $\genparams$ such that the accuracy (i.e.\@, reward $R$) of the SVM is maximized on the validation set.
The top row of~\figref{fig:toy_data} illustrates how the policy gradually adjusts the data generating distribution $q(\rvx,\rvy|\genparams)$ such that reward $R$ is increased.
The learned decision boundaries in the last iteration (right) well separate the test data.
The bottom row of~\figref{fig:toy_data} shows the SVM decision boundary when trained with data sampled from $p(\rvx,\rvy | \genparams_{\textrm{real}})$ (left) and with the converged parameters $\genparams^{*}$ from the policy (middle).
The third figure in the bottom row of~\figref{fig:toy_data} shows samples from $q(\rvx,\rvy|\genparams^{*})$.
The sampled data from the simulator is clearly different than the test data, which is obvious given that the simulator's GMM has less components per class.
However, it is important to note that the decision boundaries are still learned well for the task at hand.
\begin{figure}
\captionsetup[subfigure]{labelformat=empty}
\begin{subfloatrow*}
\sidesubfloat[]{
\includegraphics[width=0.3\textwidth, trim={1.2cm 0.6cm 1.6cm 0.6cm}, clip]{policy_dec_epoch_0.png}
}
\hspace{-0.3cm}
\sidesubfloat[]{
\includegraphics[width=0.3\textwidth, trim={1.2cm 0.6cm 1.6cm 0.6cm}, clip]{policy_dec_epoch_4.png}
}
\hspace{0.1cm}
\sidesubfloat[]{
\includegraphics[width=0.3\textwidth, trim={1.2cm 0.6cm 1.6cm 0.6cm}, clip]{policy_dec_epoch_10.png}
}
\end{subfloatrow*}
\begin{subfloatrow*}
\sidesubfloat[]{
\includegraphics[width=0.3\textwidth, trim={1.2cm 0.6cm 1.6cm 0.6cm}, clip]{val_decision_test.png}
}
\hspace{-0.3cm}
\sidesubfloat[]{
\includegraphics[width=0.3\textwidth, trim={1.2cm 0.6cm 1.6cm 0.6cm}, clip]{final_decision_test.png}
}
\hspace{0.1cm}
\sidesubfloat[]{
\includegraphics[width=0.3\textwidth, trim={1.2cm 0.6cm 1.6cm 0.6cm}, clip]{final_generated_samples.png}
}
\end{subfloatrow*}
\caption{\textbf{Top row:} The decision boundaries (shaded areas) of a non-linear SVM trained on data generated by $q(\rvx,\rvy|\genparams_i)$ for three different iterations $i$ of our policy $\pi_{\policyparams}$. The data points overlaid are the test set. \textbf{Bottom row:} Decision boundary when trained on data sampled from $p(\rvx,\rvy|\genparams_{\textrm{real}})$ (left) and on the converged parameters $\genparams^*$ (middle); Data sampled from $q(\rvx,\rvy|\genparams^*)$ (right).}
\label{fig:toy_data}
\end{figure}
\subsection{Generating data with a parameterized traffic simulator}
\label{sec:simdetails}
For the following experiments we use computer vision applications and thus require a generative scene model and an image rendering engine.
We focus on traffic scenes as simulators/games for this scenario are publicly available (CARLA~\citep{carla} with Unreal engine~\citep{unreal} as backend).
However, we need to note that substantial extensions were required to actually generate different scenes according to a scene model rather than just different viewpoints of a static map.
Many alternative simulators like~\citep{ue4sim,playing_for_data,airsim} are similar where an agent can navigate a few pre-defined maps, but the scene itself is not parameterized and cannot be changed on the fly.
To actually synthesize novel scenes, we first need a model $S(\sceneparams|\genparams)$ that allows to sample instances of scenes $\sceneparams$ given parameters $\genparams$ of the probability distributions of the scene model.
Recall that $\genparams$ is produced by our learned policy $\pi_{\policyparams}$.
Our traffic scene model $S(\sceneparams|\genparams)$ handles different types of intersections, various car models driving on the road, road layouts and buildings on the side. Additionally our rendering model $P(\renderparams|\genparams)$ handles weather conditions.
Please see the appendix for more details.
In our experiments, the model is free to adjust some of the variables, e.g.\@, the probability of cars being on the road, weather conditions, etc.
Given these two distributions, we can sample a new scene and render it as $\mathcal{R}(S(\sceneparams|\genparams), P(\renderparams|\genparams))$.
\Figref{fig:carla_examples} shows examples of rendered scenes.
\begin{figure}
\begin{subfloatrow*}
\sidesubfloat[]{
\includegraphics[width=0.28\textwidth]{sim_screenshot1.png}
}
\hspace{-0.4cm}
\sidesubfloat[]{
\includegraphics[width=0.28\textwidth]{sim_screenshot2.png}
}
\sidesubfloat[]{
\includegraphics[width=0.28\textwidth]{sim_screenshot3.png}
}
\end{subfloatrow*}
\vspace{-0.2cm}
\caption{Example of rendered traffic scene with CARLA~\citep{carla} and the Unreal engine~\citep{unreal}.}
\label{fig:carla_examples}
\end{figure}
\subsection{Learning to simulate on a high-level vision task}
\label{sec:carcnt1}
As a first high-level computer vision task we choose counting cars in rendered images, where the goal is to train a convolutional neural network $h_{\mtnparams}$ to count all instances individually for five types of cars in an image.
The evaluation metric and (also the loss) is the $\ell_1$ distance between predicted and ground truth count, averaged over the different car types.
The reward $R$ is the negative $\ell_1$ loss.
For this experiment, we generate validation and test sets with a fixed and pre-defined distribution $\genparams_{\textrm{real}}$.
\paragraph{Initialization:} We first evaluate our proposed policy (dubbed ``LTS'' in the figures) for two different initializations, a ``standard'' random one and an initialization that is deliberately picked to be suboptimal (dubbed ``adversarial''). We also compare with a model trained on a data set sampled with $\genparams_{\textrm{real}}$, i.e.\@, the test set parameters.
\Figref{fig:car_count_exp} explains our results.
We can see in~\figref{fig:car_count_exp_val} that our policy $\pi_{\policyparams}$ (``LTS'') quickly reaches high reward $R$ on the validation set, equal to the reward we get when training models with $\genparams_{\textrm{real}}$.
\Figref{fig:car_count_exp_test} shows that high rewards are also obtained on the unseen test set for both initializations, albeit convergence is slower for the adversarial initialization.
The reward after convergence is comparable to the model trained on $\genparams_{\textrm{real}}$.
Since our policy $\pi_{\policyparams}$ is inherently stochastic, we show in~\figref{fig:car_count_exp_rndinits} convergence for different random initializations and observe a very stable behavior.
\vspace{-0.2cm}
\begin{figure}
\begin{subfloatrow*}%
\sidesubfloat[]{%
\hspace{-0.15cm}%
\includegraphics[width=0.3\textwidth, trim={0.2cm 0.6cm 1.6cm 1.2cm}, clip]{standard_init_val_reward.png}%
\label{fig:car_count_exp_val}
}
\hspace{-0.3cm}%
\sidesubfloat[]{%
\hspace{-0.15cm}%
\includegraphics[width=0.3\textwidth, trim={0.2cm 0.6cm 1.6cm 1.2cm}, clip]{hard_init_test_reward.png}%
\label{fig:car_count_exp_test}
}
\sidesubfloat[]{%
\hspace{-0.15cm}%
\includegraphics[width=0.3\textwidth, trim={0.2cm 0.6cm 1.6cm 1.2cm}, clip]{random_inits_test_reward.png}%
\label{fig:car_count_exp_rndinits}
}
\end{subfloatrow*}
\vspace{-0.2cm}
\caption{\textbf{(a)} shows the reward on the validation set evolving over policy iterations. \textbf{(b)} shows the reward on the unseen test set. We observe that even when using the ``adversarial'' initialization of parameters, our approach converges to the same reward $R$, but at a slower rate. \textbf{(c)} shows the reward on the unseen test for different random parameter initializations.}
\label{fig:car_count_exp}
\end{figure}
\paragraph{Accumulating data:}
Next, we explore the difference between training the MTM $h_{\mtnparams}$ from scratch in each policy iteration or retaining its parameters and fine-tune, see~\algref{alg:main_alg}.
We call the second option the ``accumulated main task model (AMTM)'' because it is not re-initialized and accumulates information over policy iterations.
The intention of this experiment is to analyze the situation where the simulator is used for generating large quantities of data, like in~\citep{playing_for_data}.
First, by comparing figures~\ref{fig:car_count_exp_test} and~\ref{fig:acc_test_reward_1}, we observe that the reward $R$ gets significantly higher than when training MTM from scratch in each policy iteration. Note that we still use the MTM reward as our training signal, we only observe the AMTM reward for evaluation purposes.
For the case of accumulating the MTM parameters, we further compare with two baselines.
First, replicating a hand-crafted choice of simulation parameters, we assume no domain expertise and randomly sample simulator parameters (within a sensible range) in each iteration (``random policy params'').
Second, we take the parameters given by our learned policy after convergence (``final policy params'').
For reference, we train another AMTM with the ground truth validation set parameters (``validation params'') as our upper-bound.
All baselines are accumulated main task models, but with fixed parameters for sampling data, i.e.\@, resembling the case of generating large datasets.
We can see from~\figref{fig:acc_test_reward_1} that our approach gets very close to the ground truth validation set parameters and significantly outperforms the random parameter baseline.
Interestingly, ``LTS'' even outperforms the ``final policy params'' baseline, which we attribute to increased variety of the data distribution.
Again, ``LTS'' converges to a high reward $R$ even with an adversarial initialization, see~\figref{fig:acc_test_reward_2}
\vspace{-0.2cm}
\paragraph{Number of epochs:} Similar to the previous experiment, we now analyze the impact of the number of epochs $\xi$ used to train the main task model $h_{\mtnparams}$ in the inner loop of learning to simulate.
\Figref{fig:epoch_experiment_fig1} shows the reward of the accumulated MTM for four different values of $\xi$ (1, 3, 7, 10).
Our conclusion, for the car-counting task, is that learning to simulate is robust to lower training epochs, which means that even if the MTM has not fully converged yet the reward signal is good enough to provide guidance for our system leading to a potential wall-time speed up of the overall algorithm.
All four cases converge, including the one where we train the MTM for only one epoch.
Note that this is dependent on the task at hand, and a more complicated task might necessitate convergence of the main task model to provide discriminative rewards.
\begin{figure}
\begin{subfloatrow*}
\sidesubfloat[]{%
\hspace{-0.15cm}%
\includegraphics[width=0.3\textwidth, trim={0.2cm 0.6cm 1.6cm 1.2cm}, clip]{accumulated_test_reward_1.png}%
\label{fig:acc_test_reward_1}
}%
\hspace{-0.3cm}%
\sidesubfloat[]{%
\hspace{-0.15cm}%
\includegraphics[width=0.3\textwidth, trim={0.2cm 0.6cm 1.6cm 1.2cm}, clip]{accumulated_test_reward_2.png}%
\label{fig:acc_test_reward_2}
}%
\sidesubfloat[]{%
\hspace{-0.15cm}%
\includegraphics[width=0.3\textwidth, trim={0.2cm 0.6cm 1.6cm 1.2cm}, clip]{epoch_experiment.png}%
\label{fig:epoch_experiment_fig1}
}
\end{subfloatrow*}
\vspace{-0.1cm}
\caption{\textbf{(a)} Reward $R$ of the accumulated main task model on the car-counting task using different training schemes. We observe that training an accumulated main task network using a learning policy at each step is superior to training it with a dataset generated either using the final parameters of the policy or random parameters. \textbf{(b)} Learning-to-simulate converges even with an ``adversarial'' initialization of parameters, albeit in more epochs. \textbf{(c)} Reward of the accumulated main task model using different number of training epochs $\xi$ for $h_{\mtnparams}$.}
\label{fig:acc_test_reward_gen}
\end{figure}
\subsection{Semantic segmentation on Simulated Data}
\label{sec:simsemseg}
For the next set of experiments we use semantic segmentation as our test bed, which aims at predicting a semantic category for each pixel in a given RGB image~\citep{deeplabv3plus2018}.
Our modified CARLA simulator~\citep{carla} provides ground truth semantic segmentation maps for generated traffic scenes, including categories like road, sidewalk or cars.
For the sake of these experiments, we focus on the segmentation accuracy of cars, measured as intersection-over-union (IoU), and allow our policy $\pi_{\policyparams}$ to adjust scene and rendering parameters to maximize reward $R$ (i.e.\@, car IoU).
This includes the probability of generating different types of cars, length of road and weather type.
The main task model $h_{\mtnparams}$ is a CNN that takes a rendered RGB image as input and predicts a per-pixel classification output.
We first generate validation set parameters $\genparams_{\textrm{val}}$ that reflect traffic scenes moderately crowded with cars, unbalanced car types, random intersections and buildings on the side.
As a reference point for our proposed algorithm, we sample a few data sets with the validation set parameters $\genparams_{\textrm{val}}$, train MTMs and report the maximum reward (IoU of cars) achieved.
We compare this with our learned policy $\pi_{\policyparams}$ and can observe in~\figref{fig:carla_cariou_val_fig1} that it actually outperforms the validation set parameters.
This is an interesting observation because it shows that the validation set parameters $\genparams_{\textrm{val}}$ may not always be the optimal choice for training a segmentation model.
\begin{figure}
\begin{subfloatrow*}
\hspace{0.5cm}%
\sidesubfloat[]{%
\hspace{0.cm}%
\includegraphics[width=0.35\textwidth, trim={0.5cm 0.5cm 1.4cm 1.4cm}, clip]{cariou_sim.png}%
\label{fig:carla_cariou_val_fig1}
}
\hspace{0.7cm}%
\sidesubfloat[]{%
\hspace{-0.cm}%
\includegraphics[width=0.35\textwidth, trim={0.5cm 0.5cm 1.4cm 1.5cm}, clip]{kitti_resnet50_cariou_val.png}%
\label{fig:kitti_cariou_val_fig2}
}
\end{subfloatrow*}
\vspace{-0.2cm}
\caption{\textbf{(a)} Reward curves of our approach compared to a model trained on data generated with the actual validation set parameters on the synthetic semantic segmentation task. \textbf{(b)} Reward curves on the real validation set of KITTI for semantic segmentation. We plot the learning-to-simulate, the maximum reward achieved using random search and the maximum and mean using random parameters. All methods use 600 iterations.}
\label{fig:semseg_exp_cariou}
\end{figure}
\vspace{-0.2cm}
\subsection{Semantic segmentation on Real Data}
\label{sec:realsemseg}
We demonstrate the practical impact of our learning-to-simulate approach on semantic segmentation on KITTI~\cite{kitti} by training a main task model (MTM) $h_{\mtnparams}$ with a {\em reward signal coming from real data}.
Using simulated data for semantic segmentation was recently investigated from a domain adaptation perspective~\cite{Tsai_2018_CVPR,playing_for_data}, where an abundant set of simulated data is leveraged to train models applicable on real data.
Here, we investigate targeted generation of simulated data and its impact on real data.
Since the semantic label space of KITTI and our CARLA simulator are not identical, we again focus on segmentation of cars by measuring IoU for that category.
For our main task model $h_{\mtnparams}$ we use a CNN that takes a rendered RGB image as input and predicts a per-pixel classification output with a ResNet-50 backbone.
As our baseline we train the main task model separately 600 times, with data generated by the simulator using different sets of random parameters for each one. We monitor the validation Car IoU metric for each of these networks and pick the one with highest validation reward. We then test it on the unseen KITTI test set and report the Car IoU in table~\ref{tbl:kitti-test-cariou}. For illustration purposes we show the reward curve of our approach on the validation set as well as the maximum for random search and the maximum and mean for random parameters in Figure~\ref{fig:kitti_cariou_val_fig2}.
However, it is important to mention that parameters which are actually good for training an MTM $h_{\mtnparams}$ are unknown, making our automatic approach attractive in such situations.
The results on the unseen real KITTI {\em test set} in table~\ref{tbl:kitti-test-cariou} confirm the superior results of learning-to-simulate. We train using synthetic data generated by random or learned parameters for 600 epochs of each. We pick the epoch with highest validation reward and test it on the KITTI test set. For reference, we also report the maximum car IoU obtained by our network by training on 982 annotated real KITTI training images.
Additionally, we verify empirically that parameter optimization using policy gradients (learning to simulate) outperforms random search for this problem. Results are reported in table~\ref{tbl:kitti-test-cariou}.
\begin{table}[t]
\begin{center}
\begin{tabular}{lllll}
\toprule
{\bf Training data} & random params & random search & LTS & KITTI train set \\
\midrule
{\bf Car IoU} & $0.480$ & $0.407$ & $\bf{0.579}$ & $\bf{0.778}$ \\
\bottomrule
\end{tabular}
\end{center}
\vspace{-0.3cm}
\caption{Segmentation Car IoU on the unseen KITTI test set for a ResNet-50 segmentation network trained using synthetic data generated by random parameters or learned parameters using random search or learning to simulate (LTS) for 600 epochs of each. We test the epoch with highest validation reward on the KITTI test set. We also report the maximum car IoU obtained by training on 982 annotated real KITTI training images.}
\label{tbl:kitti-test-cariou}
\end{table}
\section{Discussion and related work}
\label{sec:discussion}
The proposed approach can be seen as a meta-learner that alters the data a machine learning model is trained on to achieve high accuracy on a validation set.
This concept is similar to recent papers that learn policies for neural network architectures~\citep{archsearch} and optimizers~\citep{optsearch}.
In contrast to these works, we are focusing on the data generation parameters and actually create new, randomly sampled data in each iteration.
While~\citep{l2t} proposes a subset selection approach for altering the training data, we are actually creating new data.
This difference is important because we are not limited to a fixed probability distribution at data acquisition time.
We can thus generate or oversample unusual situations that would otherwise not be part of the training data.
Similar to the above-mentioned papers, we also choose a variant of stochastic gradients (policy gradients~\citep{reinforce}) to overcome the non-differentiable sampling and rendering and estimate the parameters of the policy $\pi_{\policyparams}$.
While alternatives for black-box optimization exist, like evolutionary algorithms~\citep{es} or sampling-based methods~\citep{Bishop:2006:PRM:1162264}, we favor policy gradients in this work for their sample efficiency and success in prior art.
\citet{Ganin2018SynthesizingPF} train a policy to generate a program that creates a copy of an input image. Similar to us, they use policy gradients to train the policy, although they use an adversarial loss to construct their reward. Again, \citet{louppe2017adversarial} seek to tune parameters of a simulator such that the marginal distribution of the synthetic data matches the distribution of the observed data. In contrast to both works, we learn parameters of a simulator that maximize performance of a main task model on a specific task. The learned distribution need not match the distribution of the observed data.
When relying on simulated data for training machine learning models, the issue of ``domain gap'' between real and synthetic data arises.
Many recent works~\citep{Ganin:2016:DTN:2946645.2946704,Chen_2017_ICCV,Tsai_2018_CVPR} focus on bridging this domain gap, particularly for computer vision tasks. Even if we are able to tune parameters perfectly, there exists a simulation-to-real domain gap which needs to be addressed.
Thus, we believe the contributions of our work are orthogonal.
\section{Conclusion}
\label{sec:conclusion}
Learning to simulate can be seen as a meta-learning algorithm that adjusts parameters of a simulator to generate synthetic data such that a machine learning model trained on this data achieves high accuracies on validation and test sets, respectively.
Given the need for large-scale data sets to feed deep learning models and the often high cost of annotation and acquisition, we believe our approach is a sensible avenue for practical applications to leverage synthetic data.
Our experiments illustrate the concept and demonstrate the capability of learning to simulate on both synthetic and real data.
For future work, we plan to expand the label space in our segmentation experiments, apply the algorithm to other tasks like object detection and to explore a dynamic memory of previously generated data for improving our learning to simulate procedure.
\section{Traffic scene model}
Our model comprises the following elements:
\begin{itemize}
\item A straight road of variable length.
\item Either an L, T or X intersection at the end of the road.
\item Cars of 5 different types which are spawned randomly on the straight road.
\item Houses of a unique type which are spawned randomly on the sides of the road.
\item Four different types of weather.
\end{itemize}
All of these elements are tied to parameters:
$\rho_k$ can be decomposed into parameters which regulate each of these objects. The scene is generated "block" by "block". A block consists of a unitary length of road with sidewalks. Buildings can be generated on both sides of the road and cars can be generated on the road. $\rho_{k, car}$ designates the probability of car presence in any road block. Cars are sampled block by block from a Bernouilli distribution $X \sim \operatorname{Bern} \left({\rho_{k, car}}\right)$. To determine which type of car is spawned (from our selection of 5 cars) we sample from a Categorical distribution which is determined by 5 parameters $\rho_{k, car_{i}}$ where $i$ is an integer representing the identity of the car and $i \in [1,5]$. $\rho_{k, house}$ designates the probability of house presence in any road block. Houses are sampled block by block from a Bernouilli distribution $X \sim \operatorname{Bern} \left({\rho_{k, house}}\right)$.
Length to intersection is sampled from a Categorical distribution determined by 10 parameters $\rho_{k, length_{i}}$ with $i \in [8,18]$ where $i$ denotes the length from the camera to the intersection in "block" units. Weather is sampled randomly from a Categorical distribution determined by 4 parameters $\phi_{k, weather_{i}}$ where $i$ is an integer representing the identity of the weather and $i \in [1,4]$. L, T and X intersections are sampled randomly with equal probability.
\section{Quantitative results on toy experiment}
In table~\ref{table:toy-accuracies}, we present classification accuracy for the toy problem in Section~\ref{sec:toyexps} with $Q$ distributions using different number of gaussians. We can observe that by using learning to simulate we obtain better classification results than using a dataset generated using the test set parameters (mean and variance of gaussians in $P$ distribution).
\begin{table}[t]
\begin{center}
\begin{tabular}{ll}
\toprule
{\bf Gaussians per Class} & {\bf Accuracy} \\
\midrule
1 & 0.670\\
2 & \textbf{0.996}\\
val params & 0.995\\
\bottomrule
\end{tabular}
\end{center}
\vspace{-0.3cm}
\caption{Accuracies on toy test set with learned $Q$ distributions with differing number of gaussians.}
\label{table:toy-accuracies}
\end{table}
\section{Learning of parameters in car counting}
In this section we visualize learning of parameters in the car counting problem described in Section~\ref{sec:carcnt1}. In particular we show how the parameters of weather type and car type evolve in time in Figure~\ref{fig:car_count_prob_learn}.
\begin{figure}
\begin{subfloatrow*}
\sidesubfloat[]{%
\hspace{-0.15cm}%
\includegraphics[width=0.45\textwidth, trim={0.2cm 0.6cm 1.6cm 1.2cm}, clip]{car_counting_cartypes.png}%
\label{fig:car_count_prob_learn_1}
}%
\hspace{-0.3cm}%
\sidesubfloat[]{%
\hspace{-0.15cm}%
\includegraphics[width=0.45\textwidth, trim={0.2cm 0.6cm 1.6cm 1.2cm}, clip]{img/car_counting_weathertypes.png}%
\label{fig:car_count_prob_learn_2}
}%
\end{subfloatrow*}
\caption{\textbf{(a)} Shows the evolution of the non-normalized probabilities (logits) of spawning different car types in time while the parameters are learned using our method in the car counting task. \textbf{(b)} Shows the evolution of the non-normalized probabilities (logits) of rendering different weather types in time.}
\label{fig:car_count_prob_learn}
\end{figure}
\section{Car counting dataset size}
We explore the parameter $M$ of our algorithm that controls the dataset size generated in each policy iteration.
For example, when $M = 100$, we generate at each policy step a dataset of 100 images using the parameters from the policy which are then used to train our main task model $h_{\mtnparams}$.
We evaluate policies with sizes 20, 50, 100 and 200.
In~\figref{fig:dataset_error_gen} we show a comparative graph of final errors on the validation and test sets for different values of $M$.
For a fair comparison, we generate 40,000 images with our final learned set of parameters and train $h_{\mtnparams}$ for 5 epochs and evaluate on the test set.
We observed that for this task a dataset size of just 20 suffices for our model to converge to good scene parameters $\genparams$, which is highly beneficial for the wall-time convergence speed.
Having less data per policy iteration means faster training of the MTM $h_{\mtnparams}$.
\begin{figure}
\begin{subfloatrow*}
\sidesubfloat[]{
\label{fig:dataset_val_error}
\includegraphics[width=0.45\textwidth]{dataset_val_error.png}
}
\sidesubfloat[]{
\label{fig:dataset_test_error}
\includegraphics[width=0.45\textwidth]{dataset_test_error.png}
}
\end{subfloatrow*}
\caption{\label{fig:dataset_error_gen}Test and validation error from main task networks trained on 40,000 images during 5 epochs using final learned parameters for different sizes of datasets generated per policy iteration.}
\end{figure}
\section{Reproducibility}
Since our method is stochastic in nature we verify that ``learning to simulate'' converges in the car counting task using different random seeds. We observer in~\figref{fig:random_seed_reward} that the reward converges to the same value with three different random seeds. Additionally, in ~\figref{fig:random_seed_acc_test_reward}, we observe that the accumulated main task network test reward also converges with different random seeds.
\begin{figure}
\begin{subfloatrow*}
\sidesubfloat[]{
\label{fig:random_seed_reward}
\includegraphics[width=0.45\textwidth]{random_seeds_valreward.png}
}
\sidesubfloat[]{
\label{fig:random_seed_acc_test_reward}
\includegraphics[width=0.45\textwidth]{random_seeds_acc_test_reward.png}
}
\end{subfloatrow*}
\caption{\label{fig:random_seed_exp}Main task network reward and accumulated MTN reward converge using different random seeds.}
\end{figure}
| {'timestamp': '2019-05-15T02:07:27', 'yymm': '1810', 'arxiv_id': '1810.02513', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02513'} | arxiv |
\section{Introduction}
\emph{Abstraction} is a powerful idea widely used in science to explain phenomena at the required granularity. Think of explaining a heart disease in terms of its anatomical components versus its molecular composition. Think of understanding the political dynamics of elections by studying micro level phenomena (say, voter grievances in counties) versus macro level events (e.g., television advertisements, gerrymandering). In particular, in computer science, it is often understood as the process of mapping one representation onto a simpler representation by suppressing irrelevant information.
The motivation is three-fold:
\begin{enumerate}
\item[(a)] When representing complex pieces of knowledge, abstraction can provide a way to structure that knowledge, hierarchically or otherwise, so as to yield descriptive clarity and modularity.
\item[(b)] Reasoning over large graphs, programs, and other structures is almost always computationally challenging, and so abstracting the problem domain to a smaller search space is attractive. Even in the case of tractable representations, such as arithmetic circuits {\cite{a-knowledge-compilation-map}}, reasoning is polynomial in the circuit size, so clearly a smaller circuit is more effective.
\item[(c)] Lastly, and perhaps most significantly,
abstraction features pervasively in commonsense reasoning, and there is much discussion in the fields of cognitive science and philosophy on the role of abstractions for explanations \cite{jorland1994idealization,doi:10.1111/tops.12278}; for example, \cite{garfinkel1981forms} argues that concrete explanations containing too much detail are sensitive to perturbations and are impractical for understanding physical phenomena. Thus, abstractions will likely be critical for {\it explainable AI} \cite{explainable-artificial-intelligence-xai}, and indeed, much of that literature focuses on extracting high-level symbolic and/or programmatic representations from low-level data (e.g., \cite{DBLP:journals/corr/PenkovR17,sreedharan2018hierarchical}).
%
\end{enumerate}
Formal perspectives on abstraction have matured considerably over the years \cite{giunchiglia1992theory,milner1989communication,banihashemi2017abstraction}. In particular, the work of \cite{banihashemi2017abstraction} is noteworthy as it identifies how notions of soundness and completeness relate to the model-theoretic properties of a high-level abstraction and the corresponding low-level theory.
However, the formal analysis of abstraction has largely focused on categorical (deterministic and non-probabilistic) domains; that is, both the high-level and the low-level representations are assumed to be categorical assertions.
In that regard, existing frameworks are not immediately applicable to the fields of probabilistic modeling and statistical machine learning. Indeed, we do not yet have a full understanding of which aspects of one probabilistic model, representing some low-level phenomena, can be omitted when building a less granular (possibly non-probabilistic) model standing for a high-level understanding of the domain.
%
In this paper, we provide a semantical framework for analyzing such abstractions from first principles. We develop the framework in a general way, allowing for expressive languages, including logic-based ones that admit relational and hierarchical constructs with stochastic primitives \cite{probabilistic-models-for-relational-data,an-introduction-to-statistical-relational-learning}. Representative examples of such languages include probabilistic databases and statistical knowledge bases, which have received considerable attention both in the academic and industry circles \cite{probabilistic-databases,markov-logic-networks,probase:-a-probabilistic-taxonomy-for-text,knowledge-vault:-a-web-scale-approach,deepdive:-web-scale-knowledge-base-construction,toward-an-architecture-for-never-ending-language}.
In this work, we motivate a definition of consistency between a high-level (probabilistic or logical) model and its low-level (probabilistic) counterpart, but also treat the case when the high-level model is missing critical information present in the low-level model.
We go on to prove properties of abstractions, both at the level of the parameter as well as the structure of the models. Put differently, we first motivate a definition of abstraction purely at the level of the model theory, which then provides the basis for analyzing the properties of ``unweighted abstractions.'' (That is, probabilities are simply ignored in that construction.) We use that analysis to investigate how ``weighted abstractions'' can be defined. We then study how to incorporate low-level evidence and reason about it in the high-level representation.
We conclude with some observations about how abstractions can be derived automatically.
With the development of this framework, we hope to provide a formal basis for developing probabilistic abstractions in service of increased modularity, tractability and interpretability.
\section{Desiderata} %
\label{sec:desiderata}
Before developing a framework for abstraction, let us briefly reflect on what is desired of such a framework. To a first approximation, a formal theory of abstraction can be approached in three stages:
\begin{enumerate}
\item How should abstraction be defined between a high-level representation \( \kb\high \) and a low-level one \( \kb\low \)?
\item Given \( \kb\high \) and \( \kb\low, \)
how do we prove that \( \kb\high \) is an abstraction of \( \kb\low \)?
\item Given \( \kb\low \) and a target high-level vocabulary, how do we find \( \kb\high? \)
\end{enumerate}
At the outset, in this work, we are concerned with (1) and (2), but we will also consider a preliminary investigation of (3).
In essence, abstractions are about omitting irrelevant details, while providing a less granular language to capture and reason about the underlying probabilistic components. To motivate that using an example, consider a \emph \emph{probabilistic relational model} (PRM) on entity-relationships for a university database \( {\cal U} \) (adapted from \cite{probabilistic-models-for-relational-data}). The model instantiates constraints for a (parameterised) Bayesian network:
%
%
\tikz {
\node (a) at (0,2) {Difficulty};
\node (b) at (2,2) {Grades};
\node (c) at (4,2) {IQ};
\draw (a) edge[->] (b) (c) edge[->] (b);
}
\newcommand{\dis}[1]{{\{#1\}}}
\newcommand{{\it friends}}{{\it friends}}
\newcommand{{\it diff}}{{\it diff}}
\newcommand{{\it iq}}{{\it iq}}
\newcommand{{\it advises}}{{\it advises}}
\newcommand{{\it takes}}{{\it takes}}
\newcommand{{\it teaches}}{{\it teaches}}
\newcommand{{\it grades}}{{\it grades}}
\newcommand{{E}}{{E}}
\newcommand{{M}}{{M}}
\newcommand{{H}}{{H}}
\newcommand{{P}}{{P}}
\newcommand{{F}}{{F}}
\newcommand{{L}}{{L}}
\newcommand{{N}}{{N}}
\newcommand{{B}}{{B}}
\newcommand{{O}}{{O}}
\newcommand{{G}}{{G}}
as follows, referred to as the low-level theory \( \U\sub l}%{\kb\sub 1 \) in the sequel: \begin{itemize}
%
%
\item[\textbf{0.7}] \( {\it diff}(x,{E}) \)
\item[\textbf{0.1}] \( {\it diff}(x,{M}) \)
\item[\textbf{0.2}] \( {\it diff}(x,{H}) \)
\item[\textbf{0.25}] \( {\it iq}(x,{L}) \land {\it diff}(y,{E}) \land {\it takes}(x,y) \supset {\it grades}(x,y,u) \) for \( u \in \set{7,8,9,10} \)
\item[\textbf{0.25}] \( {\it iq}(x,{L}) \land \neg {\it diff}(y,{E}) \land {\it takes}(x,y) \supset {\it grades}(x,y,u) \) for \( u \in \set{5,6,7,8} \)
\end{itemize}
where the constants \( {E},{M}, {H}, {L} \) stand for \emph{easy, medium, hard, low} respectively. (A precise encoding will be presented in a subsequent section.)
The first constraint says that for any given course, say \( B, \) the probability that its difficulty level is easy is 0.7. The fourth constraint says that for any low IQ student taking an easy course, the probability that his grade is 7 is \( 0.25 \), and likewise, the probability that his grade is 8 is \( 0.25 \), and so on.
More generally, this theory says that courses come in three levels of difficulty, and when a low IQ student takes an easy course, his grades can be modeled as a uniform distribution on \( \set{7,8,9,10} \), and when he does not take an easy course, it is a uniform distribution on \( \set{5,6,7,8} \).
A simple yet powerful type of abstraction to apply here is to abstract away the domain.
Assuming the above sentences are the only ones of interest to us, we can lump the constants \( \set{{M}, {H}} \) as \( {N} \), standing for \emph{not easy}, and lump the mentioned grade values together as \( \set{5,6}, \set{7,8}, \set{9,10} \) and denote them as \( {B}, {O}, {G} \), standing for \emph{bad, ok} and \emph{good} respectively. Then, we would obtain the following model, referred to as the high-level theory \( \U\sub h}%{\kb\sub 2 \) in the sequel:\footnote{Although the abstraction uses the same predicates as \( \U\sub l}%{\kb\sub 1, \) note that some of these are essentially new predicates, with different domains. For example, in \( \U\sub l}%{\kb\sub 1, \) the difficulty ranges over \( \set{{E},{M},{H}} \) whereas in \( \U\sub h}%{\kb\sub 2, \) it ranges over \( \set{{E},{N}}. \) The context will make clear whether the predicates and constants are from \( \U\sub l}%{\kb\sub 1 \) or from \( \U\sub h}%{\kb\sub 2, \) and so we do not distinguish symbols from \( \U\sub h}%{\kb\sub 2 \) by means of superscripts and such. } \begin{itemize}
\item[{\bf .7}] \( {\it diff}(x,{E}) \)
\item[{\bf .3}] \( {\it diff}(x,{N}) \)
\item[\textbf{.5}] \( {\it iq}(x,{L}) \land {\it diff}(y,{E}) \land {\it takes}(x,y) \supset {\it grades}(x,y,u) \) for \( u \in \set{{O},{G}} \)
\item[\textbf{.5}] \( {\it iq}(x,{L}) \land {\it diff}(y,{N}) \land {\it takes}(x,y) \supset {\it grades}(x,y,u) \) for \( u \in \set{{B},{O}} \)
\end{itemize}
On closer inspection, the reader may observe that \( \U\sub h}%{\kb\sub 2 \) is, in fact, a very faithful abstraction of \( \U\sub l}%{\kb\sub 1 \), in terms of accurately grouping together probabilistic events. Indeed, we will formally show that the two models agree on a large class of probabilistic queries. The benefit, of course, is that \( \U\sub h}%{\kb\sub 2 \) is defined over a smaller set of random variables.
However, such a faithful alignment may not always be needed, or even feasible. Consider a case where we abstract by grouping definitions and complex formulas using new predicates. Suppose we had a course listing database \( {\cal C}. \) Let \( {\cal C}_ l \) be a low-level theory: \begin{itemize}
\item[{\bf .9}] \( {\it CS(x)} \supset {\it diff}(x,{H}) \)
\item[{\bf .8}] \( {\it Physics(x)} \supset {\it diff}(x,{E}) \)
\item[{\bf 1}] \( ({\it AI}(x) \supset {\it CS}(x)) \land ({\it Astronomy}(x) \supset {\it Physics}(x)) \)
\end{itemize}
We may want to define a high-level theory \( {\cal C}_ h \) that simply uses \( {\it Science}(x) \) in place of \( {\it CS}(x) \) and \( {\it Physics}(x) \).
But then the weight on rules such as \( {\it Science}(x) \supset {\it diff}(x,{H}) \) or \( {\it Science}(x) \supset {\it diff}(x,{E}) \)
may not be immediate to derive, in general. %
%
Predicate abstraction can also be used as a strategy to check for probabilistically significant events. For example, an administrator may only be interested in ensuring that all low IQ students enroll in an easy course: \( \emph{alert} \doteq \neg~ [\forall x, \exists y ~({\it iq}(x,L) \supset ({\it takes}(x,y) \land {\it diff}(y,{E})))] \)
and specifically, whether that atom ever obtains a non-zero probability.
Indeed, the literature on verification and security often approach the reasoning of complex systems by distinguishing \emph{bad} states (e.g., invalid paths, safety conditions) \cite{sharma2013verification}, and correspondingly, checking whether such states are probable or improbable. Naturally, by means of a relational language, such definitions can be arbitrarily complex and hierarchical, and different from classical works on categorical abstraction, predicates at every level can denote stochastic primitives.
In that spirit, we show that abstraction can be understood both from the viewpoint of the parameters (i.e., weights and/or probabilities) and
structure (i.e., the logical sentences). While we do discuss the case of aligning probabilities exactly between the high-level and low-level models, we also consider the most immediate case of parameter abstraction where one obtains an alignment between the probable and improbable events. When it comes to abstracting structure, we show that one wants to ensure that the high-level model is consistent, and perhaps additionally that it is not missing critical information present at the low-level model. This then motivates a definition of \textit{soundness} and \textit{completeness}.
Our starting point was the work of~\cite{banihashemi2017abstraction}, which introduces a simple way to logically characterize the differences between a high-level theory and the low-level one, via the well-understood notion of isomorphisms. We show how that account can be extended to reason about probabilities by appealing to the formulation of \emph{weighted model counting} \cite{on-probabilistic-inference-by-weighted-model}, which serves as an assembly language for many popular PRMs. The resulting treatment can be seen to share much of the simplicity of \cite{banihashemi2017abstraction}, thereby providing an amenable framework for understanding probabilistic and logical abstractions of PRMs.
We reiterate that our focus here is primarily about the semantic constraints for analyzing abstractions. Thus, at the outset, we assume that we are given a \emph{high-level theory}, capturing the more abstract probabilistic model, and a \emph{low-level theory}, understood as the underlying probabilistic model that is to be abstracted. Nonetheless, we conclude our technical treatment by discussing some ideas for deriving abstractions automatically.
\section{Preliminaries}
Our technical development will discuss the semantical constraints between different representations, defined in terms of a mapping between probabilistic events. For the purpose of our results, it will be useful to think in terms of these representations being knowledge bases (i.e., sentences in some logical language), over which one defines a measurable space \( (S, {\cal F}_S) \) \cite{halpern2004representation}. In particular, for any given knowledge base \( \Delta \), we imagine \( S \) to be some subset of the set of interpretations of \( \Delta \). Moreover, when analyzing how precisely two representations agree, we will be considering the probabilities of queries that additionally use logical connectives such as conjunction and negation, and so we will require that measures be well-defined over such connectives. \smallskip
Concretely, define a relational language \( \textit{Lang} \) with predicate symbols of every arity \[ \set{P_1(x), \ldots, P_2(x,y), \ldots, P_3(x,y,z), \ldots}, \] variables \( \set{x,y, z, \ldots} \), connectives \( {\lor, \neg, \land, \forall} \) and a set of constants \( \set{c_ 1, c_ 2, \ldots} \),
serving as the {\it domain of discourse} for quantification.
To facilitate comparisons between vocabularies, we assume that for each high/low-level theory the relations and domain are finite subsets of this fixed infinite vocabulary. For simplicity, we restrict our attention to probability spaces over finitely many random variables, as would be instantiated from our assumption. This would be applicable to most statistical relational languages, such as probabilistic databases, Markov logic networks and knowledge graphs \cite{probabilistic-databases,markov-logic-networks,knowledge-vault:-a-web-scale-approach}. Although from a logical viewpoint, we could simply have used a propositional one, we will introduce a relational language, as is usual in the literature \cite{statistical-relational-ai:-logic-probability}.\footnote{If there are infinitely many random variables instantiated from the first-order language, we may consider countably additive probability measures \cite{concerning-measures-in-first-order,reasoning-about-uncertainty} or other syntactic conditions, as in, for example, \cite{graphical-markov-models-for-infinitely,reasoning-about-infinite-random,markov-logic-in-infinite-domains,approximate-inference-for-infinite-contingent,open-universe-weighted-model-counting}.}
Standard abbreviations apply for connectives: we write \( \alpha\supset \beta \) (material implication) to mean \( \neg\alpha\lor \beta \), \( \alpha\equiv \beta \) (equivalence) to mean \( (\alpha\supset \beta) \land (\beta\supset\alpha) \),
and \( \exists x\alpha \) (existential quantification) to mean \( \neg\forall x \neg \alpha \). In particular, when the domain is fixed to a finite set $D$, we write $\forall x~ \alpha(x)$ to mean $\bigwedge_{c\in D} \alpha(c)$. Moreover, $\alpha \land \beta$ is equivalent to $\neg(\neg \alpha \lor \neg \beta)$, so in proofs, we only consider the connectives \( \set{\land,\neg}. \)
The set of ground atoms is defined as: \[
\set{P(c_ 1, \ldots, c_ k) \mid \textrm{$P$ is a relation, $c_ i \in D$}}.
\] The set of ground literals is obtained from the set of atoms, and their negations. Henceforth, when we write atoms and literals, we will implicitly mean ground ones. We often use \( p \) and \( q \) to denote atoms, and \( l \) and \( d \) to denote literals.
A model \( M \) is a \( \set{0,1} \) assignment to the set of atoms. Using \( \models \) to denote satisfaction, the semantics for a formula \( \phi \) is defined inductively: $M \models p$ for atom $p$ iff $M[p] = 1$; $M \models \neg \phi$ iff $M \models \phi$ does not hold (also written \( M\not\models \phi \)); $M \models \phi\lor \psi$ iff $M \models\phi$ or $M\models \psi$; and \( M\models \phi\land \psi \) iff \( M\models \phi \) and \( M\models \psi \). We write $l\in M$ to mean that \( M \models l \) for literal \( l. \)
We say a formula \( \phi \) is \emph{satisfiable} iff there is a model \( M \) such that \( M\models\phi. \)
We write \( \Delta \models \phi \) to mean that in every model $M$ such that $M\models \Delta$, it is also the case that $M \models\phi$. In particular, we say that \( \phi \) is \emph{valid}, written \( \models \phi, \) iff for every model \( M \), \( M\models \phi \).
To prepare for our technical discussion, we discuss some notational conventions. Given a formula \( \Delta \),
we write \( \textit{Lang}(\Delta) \) to mean the the logical sub-language implicit in \( \Delta \): that is, the set of well-formed formulas constructed from relations \( \set{P_1(x), \ldots} \) and constants \( D \) mentioned in \( \Delta \). We can then write $\alpha \in \textit{Lang}(\Delta)$ to mean such as well-formed formula. Analogously, we write \( \textit{Lits}(\Delta) \) to mean the set of literals obtained from \( \textit{Lang}(\Delta) \). For example, if \( \Delta = P(c) \lor Q(c,a) \), then
$\neg P(a) \in \textit{Lang}(\Delta), Q(a,a) \in \textit{Lang}(\Delta)$, \( P(a) \in \textit{Lits}(\Delta), \neg Q(a,c) \in \textit{Lits}(\Delta) \), and so on.
We often abuse notation and write \( \vec c\in D \) to mean that each of the constants mentioned in \( \vec c \) is taken from \( D. \) Finally, given a \( \Delta, \) when we write \( M\models \Delta \), it is implicit here that we take \( M \) to be a model for the language \( \textit{Lang}(\Delta) \); that is, it is a \( \set{0,1} \) assignment to the set of atoms in \( \textit{Lang}(\Delta) \). We can make this explicit by writing \( M \in \textit{Models}(\textit{Lang}(\Delta)) \), or simply \( M\in \textit{Models}(\Delta) \) for short.\footnote{The reason we go to some length to discuss our notational conventions is this: when we work with a fixed language, the set of relations, literals, and models to consider is immediate. That will no longer be true when we are thinking of different logical languages for high-level and low-level theories, in which case our notation will provide context.} \smallskip
As hinted above, we will now assume that for any \( \Delta \), we are given a measurable space \( (S, {\cal F}_S) \), where \( S\subseteq \textit{Models}(\Delta) \) \cite{halpern2004representation}. Since \( \textit{Models}(\Delta) \) is finite, let \( S = \textit{Models}(\Delta) \) for simplicity. For this measurable space, we further assume that for every \( \alpha\in \textit{Lang}(\Delta) \), \( \Pr(\alpha) \) is a numeric term; that is, every well-defined formula is accorded a probability. We further interpret a conditional probability expression as \[ \Pr(\alpha\mid \beta ) = \frac{\Pr(\alpha\land\beta)}{\Pr(\beta)} \]
This interpretation places very little restrictions on the computational machinery that one may use \cite{halpern2004representation}.
For the sake of concreteness, {\it weighted model counting} (WMC) {\cite{solving-sat-and-bayesian-inference-with}}, for example, is a reasonable fit. We remark that nothing in our technical treatment hinges on using WMC, and we only use the framework to illustrate examples and the encoding for the university PRM. In some cases, we state useful properties of WMC, but these would hold in virtually all statistical relational languages and probabilistic logics \cite{halpern2004representation,statistical-relational-ai:-logic-probability,reasoning-about-knowledge-and-probability}.
%
WMC is defined over the models of a propositional formula, and serves as an assembly language for a number of heterogeneous representations, including factor graphs, Bayesian networks, probabilistic databases and probabilistic programs \cite{solving-sat-and-bayesian-inference-with,probabilistic-databases,inference-in-probabilistic-logic-programs}.
WMC enjoys a number of interesting properties that makes it particularly well-suited for our endeavor. First, it separates the symbolic representation (i.e., a logical encoding of the probabilistic model) from a weight function denoting the probabilities of variables, which allows us to investigate abstractions both at the level of structures and at the level of parameters. Second, WMC provides a semantic as well as a computational view for probabilistic reasoning. Semantically, the models of propositional formulas map to \emph{states} in probability spaces (i.e., assignments of values to random variables). Computationally, we are able to reuse SAT technology for building exact and approximate solvers \cite{model-counting}, while still leveraging context-specific independences {\cite{context-specific-independence}}.
In particular, recent approaches for WMC \cite{on-probabilistic-inference-by-weighted-model} such as knowledge compilation \cite{a-knowledge-compilation-map} provide effective ways for enumerating and testing properties on propositional interpretations.
Essentially, WMC extends \textit{model counting}, which is the task of counting the models of a propositional formula \cite{model-counting}. In WMC, weights are additionally accorded to literals, and we are interested in summing the weights of the models, which is then defined in terms of the product of the literal weights. Standard probabilistic inference, WMC and model counting are, in fact, closely related problems, with polynomial time reductions to each other, with their decision versions being \#P-hard \cite{solving-sat-and-bayesian-inference-with,the-complexity-of-enumeration-and-reliability-problems}. Formally,\footnote{We define WMC at the level of the ground theory. In the literature, however, a special case of WMC is sometimes considered for relational languages, where the weight function maps predicates directly to numbers (e.g., \cite{lifted-inference-and-learning-in-statistical}). The intuitive idea is to treat this weight function as a template for all instances of the corresponding predicate, which, on the one hand, simplifies the specification of the weight function, and on the other, admits effective inference. We do not discuss such ideas here as it is orthogonal to the main thrust of this work (cf. penultimate section).}
\begin{definition} Suppose \( \Delta \) is a ground first-order sentence. Suppose $w$ is a function that maps the elements of \( \textit{Lits}(\Delta) \) to \( {\mathbb{R}}^ {[0,\infty)} \). Then the WMC of \( \Delta \) is defined as: \[
\textsc{WMC}(\Delta,w) = \sum_{M\models \Delta} \prod_{l\in M} w(l)
\]
Given a formula \( \phi \in \textit{Lang}(\Delta) \), we can query \( \phi \) wrt evidence \( e \) for theory \( (\Delta,w) \) using: \begin{equation}\label{eq:cond}\begin{array}{r}\tag{$\ddag$}
\displaystyle \Pr(\phi\mid e, \Delta, w) = \frac{\textsc{WMC}(\phi\land e\land \Delta, w)}{\textsc{WMC}(e\land \Delta, w)} \\ = \displaystyle \frac{\Pr(\phi \land e,\Delta,w)}{\Pr( e,\Delta,w)}
\end{array}
\end{equation}
\end{definition}
When \( e = true, \) we simply write \( \Pr(\phi,\Delta,w). \)
We remark for \( \Pr(\phi,\Delta,w) \) to be well-defined, which is assumed, \( \textsc{WMC}(\Delta,w) \neq 0. \) (Thus, it is assumed that \( \Delta \) is satisfiable, and that $w$ does not map all the corresponding literals to 0.) If the context is clear, we often refer to \( \Delta \) as the \emph{theory}, and to \( \phi \) as the \emph{query} or \emph{event}.
We immediately observe the following property from the definition of \( \textsc{WMC} \).
\begin{theorem}\label{prop:wmc entailment} If \( \Delta\models \phi, \) then \( \Pr(\phi,\Delta,w) = 1. \) If \( \Delta\land\phi \) is not satisfiable, then \( \Pr(\phi,\Delta,w) = 0. \)
\end{theorem}
\begin{proof}
For the first property, every \( M \) such that \( M\models\Delta \), \( M\models \phi \) also, and so \( \textsc{WMC}(\phi\land\Delta,w) = \textsc{WMC}(\Delta,w) \). For the second, \( \textsc{WMC}(\phi\land \Delta,w) = 0. \)
\end{proof}
\begin{example} We illustrate a WMC encoding for \( \U\sub l}%{\kb\sub 1 \) based on the university PRM; the encoding for others considered in this work are analogous. First, note that in atoms such as \( {\it diff}(x,y) \), the logical variable \( y \) captures the possible values of a random variable. Thus, they are to behave like logical functions. Formally, let \( \U\sub l}%{\kb\sub 1 \) be the union of the following, the free variables being implicitly universally quantified from the outside:
\begin{itemize}
\item ${\it diff}(y,E) \lor {\it diff}(y,M) \lor {\it diff}(y,H)$
\item \( f_ 1 (x,y, u) \equiv [{\it iq}(x,{L}) \land {\it diff}(y,{E}) \land {\it takes}(x,y) \supset {\it grades}(x,y,u) ] \) for \( u \in \set{7,8,9,10} \)
\item \( f_ 2 (x,y,u) \equiv [{\it iq}(x,{L}) \land \neg {\it diff}(y,{E}) \land {\it takes}(x,y) \supset {\it grades}(x,y,u) ] \) for \( u \in \set{5,6,7,8} \)
\end{itemize} The reason we need to introduce auxiliary predicates \( f_ 1 \) and \( f_ 2 \) is because WMC only allows weights on (ground) literals.
We also need the following hard constraints for capturing the logical functions: \begin{itemize}
\item[] \( \exists u ({\it diff}(y,u)), {\it diff}(y,u) \land {\it diff}(y,v) \supset u = v \)
\item[] \( \exists u ({\it grades}(x,y,u)), {\it grades}(x,y,u) \land {\it grades}(x,y,v) \supset u = v \)
\end{itemize}
Suppose the domain of quantification for the students is only \( \set{A} \) and for courses is only \( \set{B} \). We then obtain atoms such as: \begin{itemize}
\item[] \( {\it diff}(B,E), {\it diff}(B,M), {\it diff}(B,H), {\it iq}(A,{L}), \) \( {\it diff}(B,{E}), {\it takes}(A,B), {\it grades}(A,B,7), \ldots \)
\end{itemize}
with a weight function \( \wl \) for positive atoms derived from the parametric specification in an obvious fashion: \begin{itemize}
\item[] \( w_ l({\it diff}(B,E)) = .7, \ldots, \wl(f_ 1(A,B,7)) = .25, \ldots \)
\end{itemize}
We let the weight of a negated atom \( \wl(\neg a) \) to be \( 1 - \wl(a). \) Moreover, the ground instances \( f_ 1 \) and \( f_ 2 \) obtain the weights discussed in the parameterized version. The weights of all atoms not mentioning predicates \( {\it diff}, f_ 1, f_ 2 \) is taken to be 1.
It then follows that \( \Pr( {\it diff}(B,E), \U\sub l}%{\kb\sub 1, w) = .7 \), and \( \Pr({\it grades}(A,B,7) \mid e, \U\sub l}%{\kb\sub 1, w) = .25 \), where \( e = {\it takes}(A,B) \land {\it iq}(A,L) \land {\it diff}(A,E). \)
%
%
\end{example}
\section{Abstraction Framework} %
\label{sec:formulating_abstraction}
We assume that the abstraction framework is realized in terms of two types of representations: a \emph{high-level/abstract theory} that is mapped to a pre-existing \emph{low-level/concrete theory}. Essentially, the logical symbols (predicates and constants) may differ arbitrarily between the two theories. In terms of notation, we use the subscript \( h \) to refer to components of the high-level theory, and \( l \) to refer to that of the low-level theory.
The first step is to formally establish the construct of a \emph{refinement mapping} between the two theories: the mapping associates each high-level \emph{atom} to a low-level \emph{formula}, which may be arbitrarily complex.
\begin{definition} Suppose \( \kb\high \) and \( \kb\low \) are two theories. We say \( m \) is a \emph{refinement mapping} from \( \kb\high \) to \( \kb\low \) iff for all high-level atoms \( p \in \textit{Lang}(\kb\high), \) \( m(p) = \theta _ {p} \) for some \( \theta_ {p} \in \textit{Lang}(\kb\low) \).\footnote{When the high-level and low-level theories are defined over the same domain of discourse \( D \), \( m \) can have a compact specification of the form \( m(P(\vec{x})) = \theta_ P (\vec{x}) \), where \( P(\vec{x}) \) is a non-ground predicate, and \( \vec{x} \) are the only free variables in \( \theta_ P \). So effectively the mapping works by substitutions: for every instance \( P(\vec c) \), we have \( m(P(\vec c)) = \theta_ P(\vec c), \) where \( \theta_ P(\vec c) \) is obtained from \( \theta_ P (\vec{x}) \) by substituting the free variables \( \vec x \) by \( \vec c. \)
}
The mapping \( m \) is assumed to extend to complex formulas \( \phi \in \textit{Lang}(\kb\high) \) inductively: for atoms \( \phi = p \), \( m(\phi) \) is as above; \( m(\neg \phi) = \neg m(\phi) \); \( m(\phi \land \psi) = m(\phi) \land m(\psi) \).
%
\end{definition}
It is worth noting that a mapping is deliberately asymmetrical in the sense that its range need not include all the atoms of the low-level theory. That is, there may be atoms \( q \in \textit{Lang}(\kb\low) \), and consequently, also constants and relations, that do not appear in \( m(p) \) for every \( p \in \textit{Lang}(\kb\high). \) After all, abstractions are about omitting irrelevant details.
In general, we will want to use these mappings to discuss model-theoretic properties of the two theories, so we introduce the notion of an isomorphism:
\begin{definition} Given a refinement mapping \( m \) as above, we say that \( M\sub{h} \in \textit{Models}(\kb\high) \) is \( m \)-isomorphic to \( M\sub{l} \in \textit{Models}(\kb\low) \) iff for all atoms \( p \in \textit{Lang}(\kb\high), \) we have \( M\sub{h} \models p \) iff \( M\sub{l} \models m(p) \). We write this as \( M\sub{h} \sim\sub m M\sub{l}. \)
\end{definition}
Thus, isomorphism provides a way to align the truth values between high-level atom and low-level formulas. In particular, because of how refinement mappings can be defined for complex formulas, we obtain the following property:
\begin{theorem}\label{thm iso} Suppose \( M\high \sim\sub m M\low. \) Then for all \( \phi \in \textit{Lang}(\kb\high), \) \( M\high \models \phi \) iff \( M\low\models m(\phi) \).
\end{theorem}
\begin{proof}
We prove by induction on \( \phi. \) Base case immediate by definition. Negation: \( M\high \models \neg \phi \) iff \( M\high \not \models \phi \) iff (by hypothesis) \( M\low \not\models m(\phi) \) iff (by semantics) \( M\low \models \neg m(\phi) \) iff (by definition) \( M\low \models m(\neg \phi) \). Conjunction: \( M\high \models \phi \land \psi \) iff \( M\high \models \phi \) and \( M\high \models \psi \) iff (by hypothesis) \( M\low \models m(\phi) \) and \( M\low \models m(\psi) \) iff (by semantics) \( M\low \models m(\phi) \land m(\psi) \) iff (by definition) \( M\low \models m(\phi\land \psi). \)
\end{proof}
\newcommand{\m}{m_ {{\cal U}}}%
\begin{example} For the university PRM, we provide a mapping \( \m \) below. When free variables appear, we take it to mean that the mapping applies to all substitutions. So, let $\m$ map \( {\it diff}(x,E) \), \( {\it takes}(x,y), {\it iq}(x,L) \) from \( \U\sub h}%{\kb\sub 2 \) to the same atoms in \( \U\sub l}%{\kb\sub 1, \) \( \m({\it diff}(x,{N})) = {\it diff}(x,{M}) \lor {\it diff}(x,{H}) \), \( \m({\it grades}(x,y,{B})) = {\it grades}(x,y,5) \lor {\it grades}(x,y,6) \), \( \m({\it grades}(x,y,{O})) = {\it grades}(x,y,7) \lor {\it grades}(x,y,8) \), and \( \m({\it grades}(x,y,{G})) = {\it grades}(x,y,9) \lor {\it grades}(x,y,10) \).
Suppose the domain includes a single student \( A, \) who takes course \( B \). Suppose \( M_ h \) is a model of \( \U\sub h}%{\kb\sub 2 \) where \( \{ {\it iq}(A,L), {\it takes}(A,B), \) \( {\it diff}(B,{E}), {\it grades}(A,B,{O}) \} \) holds. Now consider the model \( M_ l \) of \( \U\sub l}%{\kb\sub 1 \) where \\ \( \{ {\it iq}(A,L), {\it takes}(A,B), {\it diff}(B,{E}), {\it grades}(A,B,7) \} \) holds. It is easy to verify that \( M_ h \sim\sub m M\low \), because the main question is whether \( M\low \) satisfies \( \m({\it grades}(A,B,{O})) = {\it grades}(A,B,7) \lor {\it grades}(A,B,8) \), which it does.
\end{example}
In the following sections, we will discuss the properties of abstractions based on mappings and isomorphisms.
\section{Unweighted Abstractions} %
\label{sec:unweighted_abstractions}
To obtain intuitions about the properties of abstract models from first principles, we will consider a fundamental type of abstraction: the absence of probabilities.\footnote{Thus, this section can be seen to establish a framework for abstraction in classical (unweighted) model counting.} In so much as probabilistic assertions quantify the likelihood of worlds, omitting probabilities still informs us about the possible and the certain, thus allowing us to test whether \( \kb\high \) is consistent with \( \kb\low. \)
\begin{definition} Given a weighted theory \( (\Delta,w) \), the unweighted setting refers to the case when for all atoms \( p \in \textit{Lang}(\Delta) \), we have \( w(p) = w(\neg p) = 1. \)
\end{definition}
Since probabilities do not occur in the setting, we can establish consistency by checking whether all conclusions by \( \kb\high \) (that is, certain events) are also conclusions by \( \kb\low \): in other words, are the conclusions \emph{sound}? We define:
\begin{definition}\label{defn sound abs} The theory \( \kb\high \) is a \emph{sound abstraction} of \( \kb\low \) relative to refinement mapping \( m \) iff for all \( M\low \in \textit{Models}(\kb\low) \), there is a \( M\high \in\textit{Models}(\kb\high) \) such that \( M\high \sim\sub m M\low. \)
\end{definition}
\begin{theorem}\label{thm sound abs} Suppose \( \kb\high \) is a sound abstraction of \( \kb\low \) relative to \( m. \) Then for all \( \phi \in \textit{Lang}(\kb\high) \): \\
(a) if \( \Pr(m(\phi),\kb\low,\wl) > 0 \) then \( \Pr(\phi,\kb\high,w\high) > 0 \); and (b) if \( \Pr(\phi,\kb\high,w\high) = 1\) then \( \Pr(m(\phi),\kb\low,\wl) = 1. \)
\end{theorem}
\begin{proof}
For (a), suppose the antecedent holds, which means there is a \( M_ l \in \textit{Models}(\kb\low) \) such that \( M_ l \models m(\phi). \)
By assumption, there is a \( M\high\in \textit{Models}(\kb\high) \) such that \( M\high \sim\sub m M\low, \) so \( M\high \models \phi, \) and \( \Pr(\phi,\kb\high,w\high) \neq 0. \) (In the unweighted setting, the weight of \( M\high \) cannot be 0, since literals cannot get a 0 weight.)
For (b), suppose antecedent, but not consequent. That is only possible when there is a \( M\low \in \textit{Models}(\kb\low) \) such that \( M\low\not\models m(\phi) \). But by assumption, there must be \( M\high \in\textit{Models}(\kb\high) \) such that \( M\high \sim\sub m M\low. \) So, \( M\high \not\models \phi \) by Theorem \ref{thm iso}. Thus, \( \Pr(\phi,\kb\high,w\high) \neq 1 \). Contradiction. \end{proof}
\newcommand{\rhd}{m_ {{\cal C}}}%
\begin{example} It is easy to check that for the university PRM, \( \U\sub h}%{\kb\sub 2 \) is a sound abstraction of \( \U\sub l}%{\kb\sub 1 \) wrt \( \m. \)
It is fairly straightforward to construct trivially unsound abstractions.
To see a less obvious example, consider
\( \C\sub l}%{\kb\sub 1 \) from before, and suppose it also included: \( {\it CS}(x) \supset {\it Programming}(x) \) and \( {\it Physics}(x) \supset {\it Fieldwork}(x). \) And as discussed, let \( \C\sub h}%{\kb\sub 2 \) be a high-level theory consisting of the same sentences but with the predicate \emph{Science(x)} used everywhere instead of \emph{CS(x)} and \emph{Physics(x)}.
Suppose \( B \) is a \emph{CS}-course. Suppose \( \rhd \) is a mapping that replaces \emph{Science(x)} by \( {\it CS}(x) \lor {\it Physics}(x) \), but maps every other predicate to itself. Then, we have \( \Pr(\phi \mid e,\C\sub h}%{\kb\sub 2,w\high) = 1 \) for \( \phi = {\it Programming}(B) \land {\it Fieldwork}(B) \) and \( e = {\it Science}(B) \), whereas, \( \Pr(m(\phi) \mid m(e), \C\sub l}%{\kb\sub 1, \wl) \neq 1 \), because
there will be possible worlds where \( {\it CS}(B) \land \neg {\it Fieldwork}(B). \)
\end{example}
Sound abstractions ascertain that conclusions by \( \kb\high \) are consistent with \( \kb\low. \) What about events considered \emph{possible} by \( \kb\high \)? Because we are omitting information when constructing an abstract model, it may be that \( \kb\high \) entertains an event as possible even though \( \kb\low \) does not.
\begin{definition}\label{defn complete abs} The theory \( \kb\high \) is a \emph{complete abstraction} of \( \kb\low \) relative to \( m \) iff for all \( M\high \in \textit{Models}(\kb\high) \), there is a \( M\low \in \textit{Models}(\kb\low) \) such that \( M\high \sim\sub m M\low. \)
\end{definition}
\begin{theorem}\label{thm complete abs} Suppose \( \kb\high \) is a complete abstraction of \( \kb\low \) relative to \( m. \) Then for all \( \phi \in \textit{Lang}(\kb\high) \): (a) if \( \Pr(\phi,\kb\high,w\high) > 0 \) then \( \Pr(m(\phi),\kb\low,\wl) > 0 \); and (b) if \( \Pr(m(\phi),\kb\low,\wl) = 1 \) then \( \Pr(\phi,\kb\high,w\high) =1. \)
\end{theorem}
\begin{proof}
For (a), suppose antecedent. Then there is a \( M\high \in \textit{Models}(\kb\high) \) such that \( M\high \models \phi \). By assumption, there is a \( M\low \in \textit{Models}(\kb\low) \) such that \( M\high\sim\sub m M\low \) and so \( M\low \models m(\phi) \), and \( \Pr(m(\phi), \kb\low, \wl) \neq 0. \)
For (b), suppose antecedent but not consequent. Then, there is a \( M\high \in \textit{Models}(\kb\high) \) such that \( M\high \not\models \phi \). But by assumption, there is a \( M\low \in \textit{Models}(\kb\low) \) such that \( M\high \sim\sub m M\low \), and so \( M\low \not\models m(\phi) \) by Theorem \ref{thm iso}. Thus, \( \Pr(m(\phi),\kb\low,\wl) \neq 1 \). Contradiction. \end{proof}
\begin{example}\label{ex:incomplete abstraction} The university PRM can be seen as a complete abstraction wrt \( \m \).
To see a case where it is not complete, consider a variant high-level theory \( \U\sub h}%{\kb\sub 2' \) where we ignore the difficulty of courses and have only one rule: ${\it iq}(x,{L}) \land {\it takes}(x,y) \supset {\it grades}(x,y,u)$ where \( u \in \{{B},{O},{G}\}. \)
Suppose the low-level theory is \( \U\sub l}%{\kb\sub 1 ' = {\it diff}(B,{H}) \land \U\sub l}%{\kb\sub 1, \) and \( A \) is a low-IQ student who takes \( B. \) It is easy to see that \( \Pr(\phi,\U\sub h}%{\kb\sub 2',w\high) > 0 \) for \( \phi = {\it iq}(A,{L}) \land {\it takes}(A,B) \land {\it grades}(A,B,{G}) \), because \( \U\sub h}%{\kb\sub 2' \) says that any of the three grades levels are possible. But clearly, \( B \) being a hard course means that \( {\it diff}(B,{H}) \land \m(\phi) \) cannot be satisfiable, and so it is a zero-probability event wrt \( \U\sub l}%{\kb\sub 1'. \)
\end{example}
\begin{definition} The theory \( \kb\high \) is a \emph{sound and complete abstraction} of \( \kb\low \) relative to \( m \) iff \( \kb\high \) is both a sound and a complete abstraction of \( \kb\low \) relative to \( m. \)
\end{definition}
\begin{theorem}\label{thm sound complete abs} Suppose \( \kb\high \) is a sound and complete abstraction of \( \kb\low \) relative to \( m. \) Then for every \( \phi\in\textit{Lang}(\kb\high) \), (a) \( \Pr(\phi,\kb\high,w\high) > 0 \) iff \( \Pr(m(\phi),\kb\low,\wl) > 0 \); and (b) \( \Pr(\phi,\kb\high,w\high) = 1 \) iff \( \Pr(m(\phi),\kb\low,\wl) = 1. \)
\end{theorem}
\begin{proof}
Follows from Theorems \ref{thm sound abs} and \ref{thm complete abs}.
\end{proof}
\section{Weighted Abstractions} %
\label{sec:weighted_abstractions}
Clearly the above theorems would not hold in general when considering non-trivial weights. It is easy to imagine a weight function that redistributes weights such that zero probability events in \( \kb\low \) have high probabilities in \( \kb\high \), and vice versa. So, outside the case of probabilities mapping exactly between \( \kb\high \) and \( \kb\low \) (discussed in the next section), we need to understand how to abstract weighted theories. The previous section provided a recipe for abstractions, from which properties discussed in Theorems \ref{thm sound abs} and \ref{thm complete abs} followed.
To a first approximation, then, we can motivate a definition for weighted abstractions by requiring that those properties hold categorically, in the form of \emph{constraints}. But it turns out, we can do better. We can show that if the property about probable events hold as a constraint wrt a sound or complete abstraction, then the corresponding property about certain events follows as a consequence. (Recall that this duality is not about an event and its negation, which would follow from the axioms of probability, but about how the high-level and low-level theories align.)
To prepare for this approach, let us begin with a few properties that follow from the axioms of probability \cite{reasoning-about-knowledge-and-probability}, but are established here using WMC:
\begin{theorem}\label{thm wmc properties} Suppose \( (\Delta,w) \) is a weighted theory. Then the following hold for all \( \phi, \psi \in \textit{Lang}(\Delta) \): \begin{enumerate}
\item If \(\Delta \models \phi \) then \( \Pr(\phi,\Delta,w) = 1 \).
\item If \( \phi\land \Delta \) is not satisfiable, then \( \Pr(\phi,\Delta,w) =0. \)
\item \( \Pr(\neg \phi,\Delta,w) = 1 - \Pr(\phi,\Delta,w) \).
\item \( \Pr(\phi \lor \psi,\Delta,w) = \Pr(\phi,\Delta,w) + \Pr(\psi,\Delta,w) - \Pr(\phi\land\psi,\Delta,w) \).
\item If \( \Pr(\phi, \Delta,w) = 0 \) then \( \Pr(\phi \land \psi, \Delta,w) = 0. \)
\item If \( \Pr(\phi,\Delta,w) > 0 \) then \( \Pr(\phi\lor \psi, \Delta,w) > 0. \)
\item \( \Pr(\phi, \Delta, w) \geq \Pr(\phi\land \psi, \Delta, w) \).
\end{enumerate}
\end{theorem}
\begin{proof}
Proofs for (1) and (2) are already discussed in Theorem \ref{prop:wmc entailment}.
%
For (3), we use the fact that \( \textit{Models}(\Delta) = \textit{Models}(\Delta\land\phi) \cup \textit{Models}(\Delta\land \neg\phi) \), and \( | \textit{Models}(\Delta) | = | \textit{Models}(\Delta\land\phi) | + | \textit{Models}(\Delta\land \neg\phi) | \).
For (4), we use \( \textit{Models}((\phi \lor \psi)\land \Delta) = \textit{Models}(\phi\land \Delta) \cup \textit{Models}(\psi\land \Delta) \) but \( | \textit{Models}((\phi \lor \psi)\land \Delta) | = | \textit{Models}(\phi\land \Delta) | + | \textit{Models}(\psi\land \Delta) | - | \textit{Models}(\psi\land\phi\land\Delta) |. \) For (5), we see that \( \Delta \land \phi \) has no model (or only zero weight models), and so that clearly also holds for \( \Delta \land \phi\land\psi. \) For (6), the models for \( \Delta \land \phi \) yield a non-zero probability, and these are clearly included in the models for \( \Delta \land (\phi \lor \psi). \) For (7), the models of \( \phi\land \psi \) must be a subset (not necessarily proper) of the models of \( \phi. \) \end{proof}
\begin{definition}\label{defn weighted sound abs} The theory \( (\kb\high,w\high) \) is a \emph{weighted sound abstraction} of \( (\kb\low,\wl) \) relative to refinement mapping \( m \) iff \( \kb\high \) is a sound abstraction of \( \kb\low \) relative to \( m \), and for all \( d \in \textit{Lits}(\kb\high) \), if \( \Pr(m(d), \kb\low,\wl) > 0 \) then \( \Pr(d,\kb\high,w\high) > 0. \)
\end{definition}
We will now show that this stipulation at the level of literals immediately implies the validity of the constraint for all formulas:
\begin{theorem}\label{thm weighted sound abs extension for formulas} Suppose \( (\kb\high,w\high) \) is a weighted sound abstraction of \( (\kb\low,\wl) \) relative to \( m. \) Then for all \( \phi \in \textit{Lang}(\kb\high) \), if \( \Pr(m(\phi), \kb\low,\wl) > 0 \) then \( \Pr(\phi,\kb\high,w\high) > 0. \)
\end{theorem}
\begin{proof}
By induction on \( \phi. \) The case of atoms and negations is immediate by definition. So we only need an argument for disjunctions. Suppose \( \Pr(m(\phi\lor\psi), \kb\low,w) > 0 \), that is, by definition, \( \Pr(m(\phi) \lor m(\psi), \kb\low,w) > 0 \). By Theorem \ref{thm wmc properties} (4), \( \Pr(m(\phi), \kb\low,w) + \Pr(m(\psi), \kb\low,w) - \Pr(m(\phi) \land m(\psi), \kb\low, w) > 0. \) This is of the form \( x + y - z > 0, \) where \( x, y, z \geq 0 \) since these are probabilities. We have 3 cases.
Case $x=0$: We note that \( z=0 \) too, by Theorem \ref{thm wmc properties} (5).
So \( y > 0. \) By hypothesis, \( \Pr(\psi,\kb\high,w\high) > 0 \), and therefore \( \Pr(\phi\lor\psi,\kb\high,w\high) > 0 \) by Theorem \ref{thm wmc properties} (6).
Case \( y= 0\): Symmetric to \( x=0. \)
Case \( x\neq 0 \) and \( y \neq 0 \): By hypothesis, \( \Pr(\phi, \kb\high,w\high) > 0 \) and \( \Pr(\psi,\kb\high,w\high) > 0 \). Even if \( \Pr(\phi\land\psi,\kb\high, w\high) > 0 \), by Theorem \ref{thm wmc properties} (7), it must be that it must be smaller or equal to the other probabilities. (That is, if \( a, b,c > 0 \), \( c \leq a \) and \( c\leq b \), then \( a+b-c > 0. \)) So, \( \Pr(\phi \lor \psi, \kb\high,w\high) > 0. \)
\end{proof}
The key result of this definition is that the property on certain events, seen in Theorem \ref{thm sound abs} follows as a consequence:
\begin{theorem}\label{thm weighted sound abs} Suppose \( (\kb\high,w\high) \) is a weighted sound abstraction of \( (\kb\low,\wl) \) relative to \( m. \) Then for all \( \phi\in \textit{Lang}(\kb\high) \), if \( \Pr(\phi,\kb\high,w\high) = 1 \) then \( \Pr(m(\phi), \kb\low,\wl) = 1. \)
\end{theorem}
\begin{proof}
Suppose antecedent but not consequent. Then there is some \( M\low \in\textit{Models}(\kb\low) \) such that \( M\low \not\models m(\phi) \) and it has non-zero weight. (If all such \( M\low \) have zero weight, then the consequent cannot be falsified because these models do not influence the probability.) By assumption, there is a \( M\high \in \textit{Models}(\kb\high) \) such that \( M\high \sim\sub m M\low, \) and so \( M\high \not\models \phi \).
There are now two cases, depending on the weight of the model \( M\high \). (And so the proof deviates from that for Theorem \ref{thm sound abs}.)
Case \( w\high(M\high) \neq 0 \): The proof follows as in Theorem \ref{thm sound abs}, yielding a contradiction.
Case \( w\high(M\high) = 0 \): Let \( M\high^\downarrow \) be a formula denoting the conjunction of the literals true at \( M\high. \) (Since there are finitely many atoms, such a formula can be obtained.) Because \( M\high \sim\sub m M\low, \) \( M\low \models m(M\high ^ \downarrow). \) Overloading the notation \( M^\downarrow \) to mean conjunction and set of literals true at \( M \), \( m(M\high^\downarrow ) \subseteq M\low^\downarrow, \) the latter being the set of literals true at \( M\low. \) But by assumption \( M\low \) has non-zero weight, which means \( \Pr(M\low^\downarrow, \kb\low,\wl) > 0 \). It follows that \( \Pr(m(M\high^\downarrow ), \kb\low,\wl) > 0 \), because otherwise Theorem \ref{thm wmc properties} (5) would be contradicted. By Theorem \ref{thm weighted sound abs extension for formulas}, \( \Pr(M\high^\downarrow, \kb\high,w\high) > 0 \), and so \( w\high(M\high) \neq 0 \). Contradiction. \end{proof}
\begin{example} The university PRM can be seen to be a weighted sound abstraction wrt \( \m \).
Consider the university PRM with a variant high-level theory \( \U\sub h}%{\kb\sub 2'' \), where the third constraint is the following instead: \begin{itemize}
\item[{\bf 1}] \( {\it iq}(x,L) \land {\it diff}(y,E) \land {\it takes}(x,y) \supset {\it grades}(x,y,G) \)
\end{itemize}
Consider the query \( \phi = {\it iq}(A,L) \land {\it diff}(B,E) \land {\it takes}(A,B) \supset {\it grades}(A,B,O) \). Clearly, the low-level theory accords a non-zero probability to \( \m(\phi) \), but because of the third constraint, \( \U\sub h}%{\kb\sub 2'' \) accords a zero probability to \( \phi. \) Thus, this is not a sound weighted abstraction.
\end{example}
Following these results, extending complete abstractions as well as sound and complete abstractions is analogous, which we state here for the sake of completeness. (The proofs are also analogous and hence omitted.)
\begin{definition}\label{defn weighted complete abs} The theory \( (\kb\high,w\high) \) is a \emph{weighted complete abstraction} of \( (\kb\low,\wl) \) relative to refinement mapping \( m \) iff \( \kb\high \) is a complete abstraction of \( \kb\low \) relative to \( m \), and for all \( d \in \textit{Lits}(\kb\high) \), if \( \Pr(d, \kb\high,w\high) > 0 \) then \( \Pr(m(d),\kb\low,\wl) > 0. \)
\end{definition}
\begin{theorem}\label{thm weighted complete abs} Suppose \( (\kb\high,w\high) \) is a weighted complete abstraction of \( (\kb\low,\wl) \) relative to \( m. \) Then for all \( \phi\in \textit{Lang}(\kb\high) \), (a)
if \( \Pr(m(\phi),\kb\low,\wl) = 1 \) then \( \Pr(\phi, \kb\high,w\high) = 1 \); and (b) if \( \Pr(\phi,\kb\high,w\high) > 0 \) then \( \Pr(m(\phi),\kb\high,w\high) > 0. \)
\end{theorem}
\begin{example}\label{ex:weighted incomplete} The university PRM can be seen to be a weighted complete abstraction wrt \( \m \).
Example \ref{ex:incomplete abstraction} also applies as an instance of an abstraction that is not weighted complete via: \begin{itemize}
\item[{\bf .33}] ${\it iq}(x,{L}) \land {\it takes}(x,y) \supset {\it grades}(x,y,u)$ where \( u \in \{{B},{O},{G}\}. \)
\end{itemize}
Mainly because the difficulty of courses is ignored, an event is considered probable by the high-level theory but not by the low-level one.
\end{example}
\begin{definition}\label{defn weighted sound complete abs} The theory \( (\kb\high,w\high) \) is a \emph{weighted sound and complete abstraction} of \( (\kb\low,\wl) \) relative to refinement mapping \( m \) iff it is both a weighted sound and a weighted complete abstraction.
\end{definition}
\begin{theorem}\label{thm weighted sound complete abs} Suppose \( (\kb\high,w\high) \) is a weighted sound and complete abstraction of \( (\kb\low,\wl) \) relative to \( m. \) Then for all \( \phi\in \textit{Lang}(\kb\high) \), (a) \( \Pr(m(\phi),\kb\low,\wl) = 1 \) iff \( \Pr(\phi, \kb\high,w\high) = 1 \); and (b) \( \Pr(m(\phi),\kb\low,\wl) > 0 \) iff \( \Pr(\phi,\kb\high, w\high) > 0. \)
\end{theorem}
\begin{proof}
Follows as a corollary from the results on weighted sound, and weighted complete abstractions.
\end{proof}
\section{Exact Abstractions} %
\label{sec:full_alignment}
The most faithful case of aligning the high-level and low-level theories is when the probabilities coincide for all high-level queries.\footnote{The distribution on the high-level theory is essentially a ``push-forward" measure \cite{introduction-to-real-analysis}.}
\begin{definition}\label{defn weighted exact} The theory \( (\kb\high,w\high) \) is a \emph{weighted exact abstraction} of \( (\kb\low,\wl) \) relative to refinement mapping \( m \) iff \( \kb\high \) is a sound and complete abstraction of \( \kb\low \) relative to \( m \), and
for all \( \phi \in \textit{Lang}(\kb\high) \), \( \Pr(\phi, \kb\high, w\high) = \Pr(m(\phi), \kb\low, \wl) \).
\end{definition}
\begin{example} The university PRM can be seen to be an instance of a weighted exact abstraction wrt \( \m \).
In contrast, the variant in Example \ref{ex:incomplete abstraction}/\ref{ex:weighted incomplete} does not belong to this type because the high-level theory accords a probability of 1/3 to a low-IQ student taking a difficult course and still getting a good grade, whereas the low-level theory considers that improbable.
%
\end{example}
\section{Abstracting Evidence} %
\label{sec:explanations}
Recall that we can query \( \phi \) wrt evidence \( e \) for theory \( (\Delta,w) \) using : \[
\Pr(\phi\mid e, \Delta, w) = \frac{\textsc{WMC}(\phi\land e\land \Delta, w)}{\textsc{WMC}(e\land \Delta, w)} = \frac{\Pr(\phi \land e,\Delta,w)}{\Pr( e,\Delta,w)}
\]
We assumed so far that \( \phi, e \in \textit{Lang}(\Delta) \).
However, in many applications needing abstraction, it is often the case that observations are low-level (e.g., readings on sensor), whereas the query is at the high-level (e.g., interactions with user). In this section, we discuss some ways to reconcile this issue.\footnote{It is conceivable that there may be other approaches for this reconciliation, and in our inquiry as well, it will become clear that a number of variants present themselves. We also limit the discussion to exact abstractions for simplicity.
}
\newcommand{m\su {-1}}{m^ {-1}}
Consider low-level evidence \( e \in \textit{Lits}(\kb\low) \). For simplicity, let \( e \) be a literal. Without loss of generality, let mappings be in conjunctive normal form (CNF).
We say a literal is \emph{pure} in a CNF \( \theta \) if its complement does not appear in \( \theta. \) (E.g., \( p \) is pure in \( p\lor q \) but not in \( \neg p \lor q \); in contrast, \( \neg p \) is pure in \( \neg p \lor q \) but not in \( p\lor q \).) We observe that, by construction, there may be many high-level atoms that map to formulas involving \( e. \)
So, given a mapping \( m, \) let us retrieve these by \emph{concretization}: \[\begin{array}{l}
m\su {-1} (e) = \{ \textrm{atom } p \in \textit{Lang}(\kb\high) \mid e \textrm{ is mentioned \& pure in }m(p) \}.
\end{array}
\]
(That is, $m(p)$ is a CNF formula.)
Here, \( m\su {-1}(e) \) is equivalently expressed as a formula: \( \bigvee p_ i \). The idea is that by looking at high-level atoms where \( e \) is pure under the mapping, we are essentially finding atoms that agree with the evidence (and not its negation).
We can now retrieve all low-level sentences these map to by re-applying \( m \) as follows: \( m(m\su {-1} (e)) = \bigvee m(p_ i ). \) (It is easy to see that \( e \) will remain pure in \( m(m\su {-1}(e)) \).)
An immediate case, then, of conditioning being straightforward is when \( e = m(m\su {-1}(e)) \):
\begin{theorem}\label{thm exact evidence} Suppose \( (\kb\high,w\high) \) is a weighted exact abstraction of \( (\kb\low,\wl) \) relative to \( m. \) Suppose \( e \in \textit{Lits}(\kb\low) \) and \( e = m(m\su {-1}(e)). \) Then for any \( \phi \in \textit{Lang}(\kb\high), \) \( \Pr(\phi \mid m\su {-1}(e), \kb\high, w\high) = \Pr(m(\phi) \mid e, \kb\low, \wl). \)
\end{theorem}
\begin{proof}
By assumption, the probability of \( \phi \land m\su {-1}(e) \) wrt \( \kb\high \) must be the same as that of \( m(\phi) \land m(m\su {-1}(e)) \) at the low-level.
\end{proof}
A simple example is the case of \( {\it diff}(x,E) \) in the university PRM, as it was mapped to the same atom at both levels.
But beyond this simple case, it is not always possible to reason about low-level events in an exact manner at the high-level. Indeed, as mentioned before, omitting details is the very goal of abstraction. For example, in the university PRM, given any course \( B, \) \( \Pr({\it diff}(B,M), \U\sub l}%{\kb\sub 1, \wl) = .1, \) but clearly there is no way to syntactically arrange \( \set{{\it diff}(B,E), {\it diff}(B,N)} \) in \( \U\sub h}%{\kb\sub 2 \) to obtain that number. Of course, it would not be hard to show a more involved property, such as \( \Pr({\it diff}(B,N), \U\sub h}%{\kb\sub 2, w\high) \geq \Pr({\it diff}(B,M), \U\sub l}%{\kb\sub 1, \wl) \).
\newcommand{\m\su {-1}}{\m^ {-1}}
Rather than treating such properties, we will consider the case where probabilities can correspond exactly. Then, one way to incorporate low-level evidence is to \emph{weaken} it, in the sense that conditioning wrt the low-level theory would suffer from a loss in detail, which is precisely the problem faced by the high-level theory. We may think of using \( m(m\su {-1}(e)) \), for example.
However, that is not sufficient for conditioning to be \emph{correct}, because \( m(m\su {-1}(e)) \) can say \emph{more} and \emph{less} than \( e. \) For example, in the university PRM, suppose we have evidence \( e = {\it diff}(B,M) \) for \( \U\sub l}%{\kb\sub 1 \). So \( \m^ {-1}(e) = {\it diff}(B,N) \), and \( \m(\m\su {-1}(e)) = {\it diff}(B,M) \lor {\it diff}(B,H) \), which is saying less than \( e. \) This is reasonable. But suppose for the sake of the argument, \( \m(\m\su {-1}(e)) = ({\it diff}(B,M) \lor {\it diff}(B,H)) \land {\it diff}(C,H) \). (This is somewhat artificial but well-defined.)
The problem is that \( e \) does not \emph{imply} anything about the difficulty of course \( C. \) Thus, if we use \( \m(\m\su {-1}(e))\) as evidence, we will be falsely assuming facts that were not observed.
To get around this, we stipulate this implication formally:
%
\begin{definition} Given evidence \( e \) and mapping \( m \), we define the \( m \)-weakening of \( e \) as \( m(m\su {-1}(e)) \). It is definable iff \( e \models m(m\su {-1}(e)). \)
\end{definition}
The most obvious (and reasonable) case where definability follows is when \( m(m\su {-1}(e)) \) is a clause, that is, a disjunction of literals. Because \( e \) is pure in \( m(m\su {-1} (e)) \), it immediately follows that \( e\models m(m\su {-1} (e)) \). (E.g., \( p \) is pure in \( p\lor q \), and of course \( p\models p\lor q. \))
\begin{theorem} Suppose \( (\kb\high,w\high) \) is a weighted exact abstraction of \( (\kb\low,\wl) \) relative to \( m. \) Suppose \( e\in \textit{Lits}(\kb\low) \) and its \( m \)-weakening is definable. Then, \( \Pr(\phi \mid m\su {-1}(e), \kb\high, w\high) = \Pr(m(\phi) \mid m(m\su {-1}(e)), \kb\low,\wl ) \).
\end{theorem}
\begin{proof}
Proof analogous to Theorem \ref{thm exact evidence}.
\end{proof}
\begin{example} For the university PRM and \( e = {\it diff}(B,M) \), its \( \m \)-weakening is \( {\it diff}(B,M) \lor {\it diff}(B,H) \). And indeed, \( e \models \m(\m\su {-1}(e)).\) For the query \( \phi = {\it iq}(A,L) \land {\it takes}(A,B) \land {\it grades}(A,B,O) \), its probability given \( \m\su {-1}(e) = {\it diff}(B,N) \) at the high-level coincides with the probability of \( {\it iq}(A,L) \land {\it takes}(A,B) \land ({\it grades}(A,B,7) \lor {\it grades}(A,B,8)) \) given \( \m(\m\su {-1}(e)) \) at the low-level.
\end{example}
\section{Weak Exact Abstractions}
\label{sec:weak_abstractions}
Definition \ref{defn weighted exact} naturally generalizes previous definitions on weighted and unweighted abstractions in terms of first stipulating that the logical representations align, and then insisting that probabilities match. One might wonder, of course, why stipulate the former, and not simply rely on the latter, which would make the treatment much simpler. In particular, we put forward a definition of \emph{weak exact abstractions}:
\begin{definition}\label{defn weak exact} The theory \( (
\kb\high,w\high) \) is a \emph{weak exact abstraction} of \( (\kb\low,\wl) \) relative to refinement mapping \( m \) iff for all \( \phi\in\textit{Lang}(\kb\high) \), \( \Pr(\phi,\kb\high,w\high) = \Pr(m(\phi),\kb\low,\wl) \).
\end{definition}
It is immediate to see that since the constraint for weak exact abstraction is embedded in the notion of a weighted exact abstraction, if a high-level theory is a weighted exact abstraction then it also a weak exact abstraction.
\begin{proposition} Suppose \( (\kb\high,w\high)\) and \( (\kb\low,\wl ) \) are theories and \( m \) is a refinement mapping. Suppose \( (
\kb\high,w\high) \) is a weighted exact abstraction of \( (\kb\low,\wl) \). Then \( (
\kb\high,w\high) \) is a weak exact abstraction of \( (\kb\low,\wl) \).
\end{proposition}
\begin{proof} By assumption, (a) \(
\kb\high \) is a sound and complete abstraction of \( \kb\low \) relative to \( m, \) and (b) for all \( \phi\in\textit{Lang}(\kb\high) \), \( \Pr(\phi,\kb\high,w\high) = \Pr(m(\phi),\kb\low,\wl) \). Because of (b), the claim is immediate. \end{proof}
Needless to say, weak exact abstractions do not imply weighted exact abstractions, as there is no requirement that isomorphisms hold between the models of \( \kb\high \) and \( \kb\low. \) Formally:
\begin{theorem} Suppose \( (\kb\high,w\high)\) and \( (\kb\low,\wl ) \) are theories and \( m \) is a refinement mapping. Suppose \( (
\kb\high,w\high) \) is a weak exact abstraction of \( (\kb\low,\wl) \) relative to \( m \). Then it does not follow that \( (
\kb\high,w\high) \) is a weighted exact abstraction of \( (\kb\low,\wl) \).
\end{theorem}
To prove this claim, it suffices to provide an example that is a weak exact abstraction but not a weighted exact abstraction. So any unsound and/or incomplete abstraction where the probabilities of high-level atoms are made to match the low-level mappings would do.
Here is a particularly extreme case involving an inconsistency:
\begin{example} Let \( \kb\low \) be any theory and let \( \kb\high = \kb\low \land (p \lor q) \), where \( \set{p,q} \) are fresh propositions not present in \( \kb\low. \) Let \( \wl \) be any weight function for \( \kb\low \) which maps atoms \( r \) in \( \kb\low \) to a number in \( [0,1] \), with the understanding that \( \wl(\neg r) = 1 - \wl(r). \)
Let $s$ be any atom in $\kb\low$, and so $s$ is an atom in $\kb\high$ by construction.
Let \( m \) be a mapping that maps every atom in \( \kb\low \) to itself, and \( m(p) = s \lor \neg s \) and \( m(q) = s\land \neg s \). Furthermore, for every atom \( r \in \kb\high - \set{p,q}, \) let \( w\high(r) = \wl(r) \), \( w\high(p) = 1 \) (so, \( w\high(\neg p) \) = 0) and \( w\high(q) = 0 \) (so, \( w\high(\neg q) = 1 \)). That is, \( \Pr(p,\kb\high,w\high) = 1 = \Pr(m(p),\kb\low,\wl), \Pr(q,\kb\high,w\high) = 0 = \Pr(m(q),\kb\low,\wl) \), and
the probabilities of all others atoms in \( \kb\low \) are the same in \( \kb\high. \) It is thus clear that \( (
\kb\high,w\high) \) is a weak exact abstraction of \( (\kb\low,\wl) \). In particular, for any \( M\high \in \textit{Models}(\kb\high) \) such that \( M\high \models q \), we have \( w\high(M\high) = 0 \) and by extension, letting \( M\high^ \downarrow \) be the formula denoting the conjunction of literals that are true at \( M\high, \) \( \Pr(M\high^\downarrow,\kb\high,w\high) = 0 \). It follows also that \( \Pr(m(M\high^\downarrow),\kb\low,\wl) = 0\). Analogously, for all models \( M\high \in \textit{Models}(\kb\high) \) such that \( M\high \not\models q, \) by construction, we have \( \Pr(M\high^\downarrow,\kb\high,w\high) = \Pr(m(M\high^\downarrow),\kb\low,\wl) \).
However, by construction, there is a \( M\high \in \textit{Models}(\kb\high) \) (for example, one where \( M\high\models q \)) such that there is no \( M\low \in \textit{Models}(\kb\low) \) where \( M\low \models m(q) \). So \( \kb\high \) is not a sound and complete abstraction of \( \kb\low \) relative to \( m. \)
\end{example}
Thus, weighted exact abstractions is a stronger requirement than weak exact abstractions. Clearly, weak exact abstractions would be much more attractive as they involve fewer checks than weighted exact abstractions, the former only requiring probabilistic alignment whilst the latter also insisting on logical alignment.
So what is to be gained by the stronger requirement?
The answer may depend on the application context. The stronger requirement guarantees downward compatibility with results like Theorems \ref{thm sound complete abs} and \ref{thm weighted sound complete abs}, and so we can be assured about the correctness of the abstraction at the qualitative level. For example, when there is only partial knowledge about probabilities, one may express this knowledge in the form of constraints (e.g., the probability of event \( \alpha \) is \( \geq 0.4 \)), as in \cite{reasoning-about-uncertainty,reasoning-about-knowledge-and-probability,a-first-order-logic-of-probability-and-only}. In this case, establishing logical alignment may be worthwhile in the first instance, either until that partial knowledge is resolved, or in addition to abstracting such constraints. Analogously, probabilities in most real-world applications are typically learnt from data in a parameter estimation step \cite{probabilistic-graphical-models:-principles}. In this case, either because the data is not complete or because observations are obtained at run-time in an online setting, the posteriors might change and so constructing weak exact abstractions
may not be worthwhile. Indeed, if we expect the parameters of the low-level theory to change, we could consider unweighted abstractions so as to construct a high-level theory that is not sensitive to weights. We would then match probabilities for a particular training epoch with the added assurance that at least the syntactic form of the high-level theory does not change from epoch to epoch.
\section{Deriving Abstractions}
\label{sec:deriving_abstractions}
The main thrust of this paper is on the semantical properties of abstractions, formulated under the assumption that we are given the high-level and low-level theory and the appropriate refinement mapping. Based on these properties, we will now motivate a few directions for deriving abstractions automatically.
These directions are to be seen as schemas that appeal to exhaustive search, and so are not necessarily efficient. In particular, they identify general properties that hold, based on which special tractable cases, or variations, may be considered.
\subsection{Formula substitutions}
\label{sub:syntactic_substitutions}
Rather than deploying a general search procedure (as motivated in the following section),
it is arguably easier to consider syntactic substitutions where possible.
A simple yet useful case where correctness is not compromised is when complex formulas in the low-level theory appear in the same way everywhere, and so can be abstracted as a high-level atom. For example, suppose \( \kb\low \) mentions the atoms \( \set{p_ 1, \ldots, p_ k, q, \ldots, r} \). For simplicity, suppose \( \kb\low \) is in conjunctive normal form, that is, \( \kb\low = \phi _ 1 \land \ldots \land \phi _ n, \) where \( \phi_ i \) are clauses,
and let \( \lambda \) be a clause only mentioning \( \set{q,\ldots,r} \). Suppose for every \( i, \) either \( \phi_ i \) does not mention \( \set{q,\ldots,r} \) or \( \phi _ i = \lambda \lor \psi_ i, \) where \( \psi_ i \) is a clause only mentioning \( \set{p_ 1, \ldots, p_ k}. \) In English: the symbols \( \set{q,\ldots,r} \) do not appear in \( \phi_ i \) except as the clause \( \lambda. \) We can construct a high-level theory that replaces \( \lambda \) with a new atom \( t. \) So let \( \kb\high \) be exactly like \( \kb\low \) except that every instance of \( \lambda \) is replaced by \( t \). Clearly the refinement mapping \( m \) maps \( t \) to \( \lambda \) and all other atoms to themselves.
Further, let \( \Pr(p_ i, \kb\high,w\high) = \Pr(p_ i, \kb\low,\wl) \) and \( \Pr(t,\kb\high,w\high) = \Pr(\lambda, \kb\low,\wl) \). It is now not hard to see that \( (\kb\high,w\high) \) is not only a weak exact abstraction of \( (\kb\low,\wl) \) relative to \( m, \) but a weighted exact abstraction too.
\begin{proposition}\label{prop:formula subs} Suppose \( \kb\high,w\high, \kb\low,\wl,m \) are as above, and \( \lambda \) is satisfiable. Then \( (\kb\high,w\high) \) is a weighted exact abstraction of \( (\kb\low,\wl) \) relative to \( m. \)
\end{proposition}
\begin{proof} We will first prove that for every \( M\high \in \textit{Models}(\kb\high) \) there is a \( M\low \in \textit{Models}(\kb\low) \) such that \( M\high \sim\sub m M\low \), and vice versa. So let \( M\high \) be any model of \( \kb\high. \)
By assumption, \( \lambda \) is satisfiable, and suppose \( M' \) is one such satisfying assignment (note: \( M' \) is essentially a partial model for the atoms in \( \textit{Lang}(\kb\low) \)). Let \( M\low \) be exactly like \( M\high \) in interpreting \( \set{p_ 1, \ldots, p_ k} \), and for the atoms in \( \set{q,\ldots,r} \), let \( M\low \) assign exactly as \( M' \) would. It now follows that for every atom \( u \in \textit{Lang}(\kb\high) \), that is, \( u \in \set{p_ 1, \ldots, p_ k, t} \), we have that \( M\high \models u \) iff \( M\low \models m(u) \). The case of finding a high-level model for every low-level model is analogous. Thus, \( \kb\high \) is a sound and complete abstraction of \( \kb\low \) relative to \( m. \)
In terms of aligning probabilities, the case is immediate by construction. \end{proof}
A slight variant of this idea could be
used for abstracting multi-valued (or even continuous) random variables, provided the queries can be reasoned as Boolean variables (as seen in \cite{michels2016approximate,holtzen2017probabilistic,probabilistic-inference-in-hybrid-domains}). We demonstrate using an example below.
\begin{example} Let us consider a random variable \( X \) that is uniformly drawn from \( \set{0,1,\ldots,9} \) and suppose we are only interested in queries about \( X\geq 8 \) or its negation. In our terms, we could imagine \( X \in \set{0,1,\ldots,9} \) to be represented using the formula \( p_ 0 \lor \ldots \lor p_ 9, \) and \( X\geq 8 \) to mean \( p_ 8 \lor p_ 9 \). More precisely, suppose the low-level theory \( (\kb\low,\wl) \) is one where \( \kb\low \) contains the following formulas: \begin{itemize}
\item \( p_ 0 \lor \ldots \lor p_ 9 \)
\item \( p_ 0 \equiv \neg (p_ 1 \lor \ldots \lor p_ 9), \ldots, p_ 9 \equiv \neg (p_ 0\lor \ldots \lor p_ 8) \)
\end{itemize}
and \( \wl \) is such that \( \Pr(p_ 0, \kb\low,\wl) = 0.1, \ldots, \Pr(p_ 9, \kb\low,\wl) = 0.1. \) Thus \( \Pr(p_ 8 \lor p_ 9, \kb\low,\wl) = 0.2 \).
A high-level theory \( \kb\high \) could be constructed as an abstraction containing the single atom \( q \) provided:\begin{itemize}
\item \( m \) is a mapping \( m(q) = p_ 0 \lor \ldots \lor p_ 7 \);
\item \( w\high \) is defined so that \( \Pr(q,\kb\high,w\high) = 0.8 \) as a result of which \( \Pr(\neg q, \kb\high,w\high) = 0.2 \).
\end{itemize}
It is now easy to see that \( (\kb\high,w\high) \) is a weighted exact abstraction of \( (\kb\low,\wl) \) relative to \( m \).
\end{example}
What is interesting about this example in relation to Proposition \ref{prop:formula subs} is that the \( \lambda \) \( = p_ 0 \lor \ldots \lor p_ 7 \) in question is abstracted as an atom \( q \) as usual, but we are using \( \neg q \) to mean \( p_ 8 \lor p_ 9 \), which is not purely syntactical substitution. We are appealing to the property that \( \kb\low \models (p_ 0 \lor \ldots \lor p_ 7) \equiv \neg (p_ 8 \lor p_ 9) \) obtained by logical equivalence relative to \( \kb\low. \) Thus, like in Proposition \ref{prop:formula subs}, we are replacing a low-level formula \( \lambda \) with a high-level atom \( t \) but unlike that setting, we are replacing a low-level formula \( \gamma \) with \( \neg t \) provided \( \kb\low \models \gamma \equiv m(\neg t). \) It is not hard to show that a correctness result also holds in this extended setting.
\subsection{A Generic Search Algorithm}
\label{sub:a_generic_algorithm}
Let us now consider a generic search algorithm for deriving abstractions. We will begin with weak exact abstractions, as they are clearly simpler to treat than weighted exact abstractions. We return to the latter in a subsequent section.
The starting point here is that as input we are given the low-level theory \( (\kb\low,\wl) \). We are then interested in constructing a high-level theory and we assume to be also given the set of high-level predicates \[ P_ h ^ 1 (x, \ldots, y), \ldots, P_ h ^ k (x, \ldots, z) \] from which \( \kb\high \) is to be constructed.
If we now guess a \( (\kb\high, w\high) \) and a mapping \( m \), we know from Definition \ref{defn weak exact} that testing for the following property would ascertain that the current guess is a weak exact abstraction: \begin{equation}\label{eq cond weighted exact}
\text{for all \( \phi \in \textit{Lang}(\kb\high), \Pr(\phi,\kb\high,w\high) =\Pr(m(\phi),\kb\low,\wl) \) } \tag{\( \star \)}
\end{equation}
Thus, a general schema might then look as follows:
\vspace{.4cm}
\begin{algorithm}[H]
\SetAlgoLined
\KwData{Low-level theory \( (\kb\low,\wl), \{P_ h ^ 1 (x, \ldots, y), \ldots, P_ h ^ k (x, \ldots, z)\} \)}
\KwResult{\bf{success} / \bf{failure}}
\( (\kb\high,w\high,m) = \set{} \) \\
\While{true}{
Guess \( (\kb\high,w\high,m) \) that is different from previous guesses, where
\( \kb\high \)
only uses the mentioned predicates \\
\textbf{if} \eqref{eq cond weighted exact} is true \textbf{then} \\
\quad return {\bf success} \\
\textbf{if} no more unique guesses \textbf{then} \\
\quad return {\bf failure}
}
\caption{Guessing \( (\kb\high,w\high) \) and refinement mapping \( m \)}
\label{alg:find one}
\end{algorithm}
\vspace{.4cm}
It is not hard to argue that the algorithm is correct:
\begin{theorem}\label{thm alg correctness} Suppose Algorithm \ref{alg:find one} returns \textbf{success}.
Then \( (\kb\high,w\high) \) together with \( m \) is a weak exact abstraction.
Suppose there are one or more weak exact abstractions only using \( \{P_ h ^ 1 (x, \ldots, y), \ldots, P_ h ^ k (x, \ldots, z)\} \), then Algorithm \ref{alg:find one} returns \textbf{success} with one such abstraction.
Finally, Algorithm \ref{alg:find one} returns \textbf{failure} iff there is no weak exact abstraction.
\end{theorem}
\begin{proof} Algorithm \ref{alg:find one} returns \textbf{success} only when the current guess \( (\kb\high,w\high,m) \) satisfies \eqref{eq cond weighted exact}. So soundness follows. Since we do exhaustive search, completeness follows.
Analogously, Algorithm \ref{alg:find one} returns \textbf{failure} iff none of the guesses from the exhaustive search satisfy \eqref{eq cond weighted exact}.
\end{proof}
\subsection{Effective Testability}
\label{sub:effective_testability}
In the above algorithm, the test \eqref{eq cond weighted exact} is challenging, because we would need to compute the probabilities for every formula. Even though we are assuming a finite vocabulary, we would still need to consider the set of all well-defined formulas over Boolean connectives of arbitrary but finite length, which is very large.
Therefore, one might wonder if this test could be made easier, the most natural case being that of testing the probabilities of literals, which can be enumerated easily. Indeed, for a language with \( k \) predicates of arity \( w \) and a domain of size \( n, \) there will be at most \( k \times n^w \) atoms, and so at most \( 2\times k \times n^w \) literals. We will now show that such a result is possible, but we will need \emph{separable} refinement mappings.
\begin{definition} Suppose \( \kb\high \) and \( \kb\low \) are theories. We say a refinement mapping \( m \) from \( \kb\high \) to \( \kb\low \) is \emph{separable} iff for every \( \alpha \land \beta \in \textit{Lang}(\kb\high) \) such that \( \alpha \) and \( \beta \) do not share (high-level) atoms, then it also the case \( m(\alpha) \in \textit{Lang}(\kb\low) \) and \( m(\beta) \in \textit{Lang}(\kb\low) \) do not share (low-level) atoms.
\end{definition}
We do not expect this stipulation to be problematic in the least, and it seems entirely natural.
For separable refinement mappings, we obtain the following property:
\begin{theorem}\label{defn weighted exact lits} Suppose \( (\kb\high,w\high) \) and \( (\kb\low,\wl) \) are two theories and \( m \) is a separable refinement mapping from \( \kb\high \) to \( \kb\low. \) Suppose
for all literals \( d\in \textit{Lits}(\kb\high) \), \( \Pr(d, \kb\high, w\high) = \Pr(m(d), \kb\low, \wl) \). Then for all \( \phi\in \textit{Lang}(\kb\high) \), \( \Pr(\phi,\kb\high,w\high) = \Pr(m(\phi), \kb\low,\wl). \)
\end{theorem}
\begin{proof}
Proof by induction on the length of \( \phi. \) The base case is immediate by definition, so assume for all \( \phi \in \textit{Lang}(\kb\high) \) of length \( k, \) \( \Pr(\phi,\kb\high,w\high) = \Pr(m(\phi),\kb\low,\wl) \). Consider \( \phi\in \textit{Lang}(\kb\high) \) of length \( k+1, \) and let \( d \) be any atom mentioned in \( \phi. \) Observe \( \phi \equiv (\phi\land d) \lor (\phi \land
\neg d) \). Let \( \phi_ i \) be \( \phi \) but with every occurrence of \( d \) replaced by \( i \in \set{0,1} \) (denoting \emph{false} and \emph{true}) and every occurrence of \( \neg d \) replaced by \( 1-i. \) Observe that \( \phi \land d \equiv \phi_ 1 \land d \), that is, \( \phi \) is simplified by setting all occurrences of \( d \) with 1 (\emph{true}) and by setting all occurrences of \( \neg d \) with 0 (\emph{false}). Analogously, \( \phi \land \neg d \equiv \phi _ 0 \land \neg d. \)
Because \( \phi_ i \) eliminates at least one literal from \( \phi \), its length is \( \leq k \) and by hypothesis, \( \Pr(\phi_ i, \kb\high, w\high) = \Pr(m(\phi_ i), \kb\low, \wl) \). Moreover, since \( d \) is not mentioned in \( \phi_ i \), it follows that \( \Pr(\phi_ i \land d, \kb\high,w\high) = \Pr(\phi_ i, \kb\high, w\high) \times \Pr(d, \kb\high, w\high) \), and analogously for \( \Pr(\phi_ i \land \neg d, \kb\high, w\high) \), \( \Pr(m(\phi_ i) \land m(d), \kb\low,\wl) \), and so on.
From Theorem \ref{thm wmc properties}, we know that \( \Pr(\alpha \lor \beta) = \Pr(\alpha) + \Pr(\beta) - \Pr(\alpha\land\beta).\) Let us now apply this to \(
\phi \). So, \( \Pr(\phi, \kb\high, w\high) \) \begin{itemize}
\item[$=$] $ \Pr((\phi_ 1 \land d) \lor (\phi_ 0\land \neg d), \kb\high, w\high)$
\item[$=$] \( \Pr(\phi_ 1\land d, \kb\high, w\high) + \Pr(\phi_ 0\land \neg d,\kb\high,w\high) - \Pr((\phi_ 1 \land d) \land (\phi_ 0\land \neg d), \kb\high, w\high) \)
\item[\( = \)] \( \Pr(\phi_ 1\land d, \kb\high, w\high) + \Pr(\phi_ 0\land \neg d,\kb\high,w\high) \) because \( \Pr((\phi_ 1 \land d) \land (\phi_ 0\land \neg d), \kb\high, w\high) = 0 \) owing to \( (\phi_ 1 \land d) \land (\phi_ 0\land \neg d) \) being inconsistent
\item[\( = \)] \( \Pr(\phi_ 1, \kb\high, w\high) \times \Pr(d,\kb\high,w\high) + \Pr(\phi_ 0, \kb\high, w\high) \times \Pr(\neg d,\kb\high,w\high) \) because \( d \) or its negation is not mentioned in \( \phi_ i \)
\item[\( = \)] \( \Pr(m(\phi_ 1), \kb\low, \wl) \times \Pr(m(d),\kb\low,\wl) + \Pr(m(\phi_ 0), \kb\low, \wl) \times \Pr(m(\neg d),\kb\low,\wl) \) by induction hypothesis
\item[\( = \)] \( \Pr(m(\phi_ 1) \land m(d), \kb\low, \wl) + \Pr(m(\phi_ 0) \times m(\neg d), \kb\low, \wl) \) owing to \( m \) being separable (that is, \( m(\phi_ i) \) and \( m(d) \) do not share atoms)
\item[\( = \)] \( \Pr(m(\phi_ 1\land d), \kb\low, \wl) + \Pr(m(\phi_ 0\land \neg d),\kb\low,\wl) - \Pr(m(\phi_ 1 \land d) \land m(\phi_ 0\land \neg d), \kb\low, \wl) \) where \( \Pr(m(\phi_ 1 \land d) \land m(\phi_ 0\land \neg d), \kb\low, \wl) = 0 \) owing to its inconsistency (so is vacuously added)
\item[\( = \)] \( \Pr(m(\phi), \kb\low,\wl) \).
\end{itemize}
%
Therefore, \( \Pr(\phi,\kb\high,w\high) = \Pr(m(\phi), \kb\low,\wl) \). \end{proof}
Thus, when restricting to separable mappings, we can replace \eqref{eq cond weighted exact} in Algorithm \ref{alg:find one} with: \begin{equation}\tag{\( \star\star \)}
\text{for all literals \( d\in \textit{Lits}(\kb\high) \), \( \Pr(d, \kb\high, w\high) = \Pr(m(d), \kb\low, \wl) \)}
\end{equation}
In line 4, moreover, we would only be guessing separable mappings.
It is then not hard to show that correctness still holds for the modified Algorithm \ref{alg:find one}, provided the existence of abstractions is stipulated as being limited to separable mappings.\footnote{Observe that although our language is relational, most of the results essentially resort to ground theories.
This is not uncommon in the literature on statistical relational learning (e.g., \cite{inference-in-probabilistic-logic-programs}), and as argued earlier, exploiting the relational structure for computational purposes \cite{lifted-inference-and-learning-in-statistical} is orthogonal to the main thrust of this work. Nonetheless, if we were to make further assumptions about the theory, such as stipulating that all instances of a predicate occur with the same probability \cite{symmetric-weighted-first-order-model}, we could perhaps simplify \( (\star\star) \) further. It might suffice, for example, to simply check the probabilities of any arbitrary instance of the predicate to ascertain abstractions.}
\subsection{Effective Testability: Beyond Weak Abstractions}
\label{sec:beyond_weak_abstractions}
The constraints for weighted exact abstractions are clearly more involved, which, at first glance, would involve enumerating models and checking for isomorphic structures. Although this may be possible via techniques like knowledge compilation \cite{a-knowledge-compilation-map}, one might wonder if simpler tests, like the ones asserted in \( (\star\star) \) above, could also be obtained for weighted exact abstractions.
What is really needed in addition to \( (\star\star) \), of course, is a way to establish that \( \kb\high \) is a sound and complete abstraction of \( \kb\low \) relative to a mapping \( m. \) What we want to avoid, ideally, is a strategy for establishing the latter via tests involving the set of all well-defined formulas like in \( (\star) \). We now show that this is indeed possible.
Below, given a theory \( \Delta, \) we sometimes think of it as a set of formulas \( \set{\phi_ 1, \ldots, \phi_ k} \), with the understanding that the theory is equivalent to \( \phi_ 1 \land \ldots \land \phi_ k. \) We write \( \phi_ i\in \Delta \) to mean that \( \phi_ i \) is one of the formulas of that set \( \Delta. \) We will also assume separable mappings for establishing our results:
\begin{theorem} Suppose \( \kb\high \) and \( \kb\low \) are logical theories, and \( m \) is a separable refinement mapping from \( \kb\high \) to \( \kb\low \). Suppose for all \( \phi \in \kb\high, \) \( \kb\low \models m(\phi) \).
Then \( \kb\high \) is a sound abstraction of \( \kb\low \) relative to \( m. \)
\end{theorem}
\begin{proof} Suppose \( M\low \) is any model of \( \kb\low. \) Now, by assumption, for every \( \phi\in \kb\high, \) \( \kb\low \models m(\phi) \), that is, \( \kb\low \models m(\kb\high) \). Because \( M\low\in \textit{Models}(\kb\low), \) \( M\low \models m(\kb\high). \)
Given all the atoms \( p_ 1, \ldots, p_ k \) of $\textit{Lang}(\kb\high)$, let \( d_ 1, \ldots, d_ k \) be the literals (say, \( d_ 1 = p_ 1 \), \( d_ 2 = \neg p_ 2 \), and so on) such that \( M\low \models m(d_ 1) \land \ldots \land m(d_ k). \) (By separability, note that for atoms \( p,q\in \textit{Lang}(\kb\high)\), \( m(p) \) and \( m(q) \) do not share low-level atoms.) Let \( M\high \) be an interpretation of \( \textit{Lang}(\kb\high) \) such that \( M\high \models d_ 1 \land \ldots \land d_ k. \)
By construction then \( M\high \sim\sub m M\low. \) By Theorem \ref{thm iso}, for every \( \phi \in \textit{Lang}(\kb\high) \), \( M\high \models \phi \) iff \( M\low\models m(\phi) \). Since \( M\low \models m(\kb\high) \), it follows that \( M\high \models \kb\high \). Since such a high-level model can be constructed for any \( M\low\in \textit{Models}(\kb\low) \), \( \kb\high \) must be a sound abstraction of \( \kb\low \) relative to \( m \). \end{proof}
We now turn to completeness:
\begin{theorem}\label{thm completeness proof test} Suppose \( \kb\high \) and \( \kb\low \) are logical theories, and \( m \) is a separable refinement mapping from \( \kb\high \) to \( \kb\low \). Suppose for all literals \( d \in \textit{Lang}(\kb\high) \), if \( d\land \kb\high \) is satisfiable then so is \( m(d) \land \kb\low \). Then \( \kb\high \) is a complete abstraction of \( \kb\low \) relative to \( m. \)
\end{theorem}
\begin{proof} Suppose \( M\high \) is any model of \( \kb\high. \) Consider the formula \(
M\high^ \downarrow \), which is the conjunction of literals that are true at \( M\high \).
In particular, suppose \( M\high^\downarrow = d_ 1 \land \ldots \land d_ k \). Clearly, \( d_ i \land \kb\high \) is satisfiable, and so by assumption, \( m(d_ i) \land \kb\low \) is satisfiable: let \( M\low ^ i \) be such a model where \( m(d_ i) \land \kb\low \) is true. In particular, let \( l^ i_ 1 \land \ldots \land l^ i_ {u_ i} \) be a conjunction of literals true at \( M\low^ i \) such that these literals mention all the atoms in \( m(d_ i) \) and only them. Put differently, \( l^ i_ 1 \land \ldots \land l^ i_ {u_ i} \models m(d_ i) \), and we can also see \( l^ i_ 1 \land \ldots \land l^ i_ {u_ i} \) as a partial interpretation for \( \kb\low. \) When we consider such partial interpretations for \( i\neq j, \) by separability it follows that \( m(d
_ i) \) and \( m(d_ j) \) do not share atoms, so \( L^ i = l^ i_ 1 \land \ldots \land l^ i_ {u_ i} \) and \( L^ j = l^ j_ 1 \land \ldots \land l^ j_ {u_ j} \) do not share atoms, and thus are consistent with each other. In other words, we now have the partial interpretation \( L^ 1 \land \ldots \land L^ k \) of \( \kb\low \) such that for each \( i\): (a) \( L^ i \models m(d_ i) \), (b) \( L^ i \) mentions all and only the atoms in \( m(d_ i) \). Let \( M\low \) be an interpretation of \( \kb\low \) where \( L^ 1 \land \ldots \land L^ k \) holds. Then for every atom \( p \in \textit{Lang}(\kb\high) \), \( M\high \models p \) iff \( M\low\models m(p) \), so \( M\high \sim\sub m M\low. \) \end{proof}
Putting it all together, in Algorithm \ref{alg:find one}, to test whether a guess \( (\kb\high,w\high,m) \) is a weighted exact abstraction, we would need three checks: \begin{enumerate}
\item for all \( \phi\in\kb\high, \kb\low\models m(\phi) \);
\item for all literals \( d\in \textit{Lang}(\kb\high), \) if \( d\land \kb\high \) is satisfiable then so is \( m(d)\land \kb\low \); and
\item \( (\star\star) \).
\end{enumerate}
So of course the test involves more computations than for weighted exact abstractions, but as we discuss above, we additionally obtain logical alignment should that be desired.
\subsection{Constraining search}
\label{sub:discussion}
Algorithm \ref{alg:find one} is discussed at a general level, which is deliberate, but that also means that no commitment has been made yet on how to define and constrain the search space.\footnote{One could imagine that if the high-level predicates are not provided as input for Algorithm \ref{alg:find one}, we might then parameterize the algorithm by providing a vocabulary bound \( k \) and an arity bound \( z \), and attempt to guess a high-level theory from \( k \) predicates of maximum arity \( z \). If that fails, the bound could be incremented.}
The case of formula replacements was discussed in Section \ref{sub:syntactic_substitutions}. Below, we discuss two other strategies. We reiterate that to make the process of deriving abstractions effective some combination of such strategies along with a suitably restricted fragment is likely needed. \smallskip
\textbf{Partial knowledge:} The user might be in a position to suggest (and constrain) the space of possible mappings and the syntactical form of the high-level theory.
For example, for some unknown \(
\kb\high \) over the predicates \( \{P_ h ^ 1 (x, \ldots, y), \ldots, P_ h ^ k (x, \ldots, z)\} \), suppose the user decides to use the same domain as \( \kb\low \). Suppose she provides partial information about the refinement mapping: let \( m' \) be a mapping from atoms \( p \in L \) to \( \theta_ {p} \), where \( \theta_ {p} \in \textit{Lang}(\kb\low) \) and \( L \subseteq \textit{Lits}(\kb\high) \).
Let us further assume the user provides partial knowledge of the sentences in \( \kb\high, \) say \( \kb\high'. \) Then line 4 of Algorithm \ref{alg:find one} would guess functions \( m \) that extends \( m' \)
(that is, possible completions of \( m \)), and line 3 would guess \( \kb\high \) such that \( \kb\high' \subseteq \kb\high. \) It would then follow that with exhaustive search, correctness would still be shown to hold, provided the existence of abstractions is stipulated as being limited to extensions of the partial knowledge (that is, the partial knowledge is assumed to be correct in the simplest case). If the user were to provide examples \( \set{e_ 1, \ldots, e_ k} \) instead of a sub-theory \( \kb\high' \), we might take an approach akin to inductive logic programming \cite{inductive-logic-programming:-theory}. That is, we first define a syntactic bias, that is, a hypothesis space \(
\cal H \), and find a \( \kb\high \in \cal H \) satisfying a semantic bias (say, \( \kb\high \models e_ 1 \land \ldots \land e_ k. \)) In this case, if Algorithm \ref{alg:find one} were to return \textbf{success}, soundness is immediate, but further investigations are needed to show that an appropriate \(
\cal H \) also promises completeness. \smallskip
\textbf{Decomposability:} Rather than searching for abstractions by treating \( \kb\low \) as a monolithic entity, a pragmatic alternative is possible when the low-level theory is \emph{decomposable}: that is, it is a set of sentences that are logically independent of each other. Then, we can identify \emph{local} abstractions and compose those to obtain a \emph{global} solution. Consider the case where \(
\kb\low = \phi_ 1 \land \ldots \land \phi_ k \), where \( \phi_ i \) does not share atoms with \( \phi_ j \) for all \( i \neq j. \) Such decompositions may appear naturally when a joint distribution is characterized over a set of disjoint Markov networks \cite{inducing-features-of-random-fields,markov-logic-networks,probabilistic-inference-in-hybrid-domains}, or may be obtained by knowledge compilation \cite{a-knowledge-compilation-map} from a more involved theory. Recent advances in tractable learning \cite{gens2013learning}, which have their roots in knowledge compilation, also identify clusters of random variables that are independent of each other. It follows that \(
\Pr(\phi_ i \land \phi _ j) = \Pr(\phi_ i) \times \Pr(\phi _ j) \) and \( \Pr(\phi_ i \lor \phi_ j) = \Pr(\phi_ i) + \Pr(\phi_ j) - \Pr(\phi_ i) \times \Pr(\phi_ j) \). Basically then we can identify \( \kb\high = \psi_ 1 \land \ldots \land \psi_ k \), where \( \psi_ i \) abstracts \( \phi_ i, \) and shares the structural restriction that \( \psi_ i \) and \( \psi_ j \) do not share atoms for all \( i\neq j. \) The abstraction search would be limited locally to \( \phi_ i \), that is, for example, wrt each low-level Markov network.
Fortunately, we are able to show that this intuitive idea is correctness preserving. We prove the case of complete abstractions, and the other cases are analogous.
\begin{theorem} Suppose \( \psi_ i \) is a complete abstraction of \( \phi_ i \) relative to \( m_ i. \) Suppose \( \phi_ i \) and \( \phi_ j \) do not share atoms for all \( i\neq j, \) and analogously, \( \psi_ i \) and \( \psi_ j \) do not share atoms for all \( i\neq j. \)
Then \( \kb\high = \psi_ 1 \land \ldots \land \psi_ k \) is a complete abstraction of \( \kb\low = \phi _ 1 \land \ldots \land \phi_ k \) relative to \( m = m_ 1 \land \ldots \land m_ k \) (that is, the composite mapping obtained by extending \( m_ 1 \) to include the vocabulary and mapping of \( m_ 2 \), which is then extended for \( m_ 3 \), and so on.)
\end{theorem}
\begin{proof} Suppose \(
M\high \) is any model of \( \kb\high. \) Consider the formula \( M\high^ \downarrow \), which is the conjunction of literals that are true at \( M\high. \) Consider that \( M\high^\downarrow \) can be written as \( h_ 1 ^ \downarrow \land \ldots \land h_ k^ \downarrow \), where: \begin{itemize}
\item \( h_ i \) is an interpretation for \( \textit{Lang}(\psi_ i) \);
\item following our notation, \( h_ i^ \downarrow \) is a conjunction of literals; and so
\item \( h_ i ^ \downarrow \) only mentions the atoms from \( \textit{Lang}(\psi_ i) \).
\end{itemize} By construction, since \( M\high \) is a model of \( \kb\high, \)
\( h_ i \) must be a model of \( \psi_ i. \) By assumption, there is a model \( l_ i \) of \( \phi _ i \) such that \( h_ i \) is isomorphic to \( l_ i \) relative to \( m_ i. \) Then let \( M\low \) be the model corresponding to the formula \( M\low^\downarrow = l_ 1 ^\downarrow \land \ldots \land l_ k^ \downarrow \). By construction, \( M\low \) must be a model of \( \kb\low \), and moreover, from the isomorphism that holds for \( h_ i \) and \( l_ i \) relative to \( m_ i \), \( M\high \sim\sub m M\low. \) \end{proof}
\section{Related Work and Discussion} %
\label{sec:related_work}
Abstraction is a major topic in knowledge representation \cite{giunchiglia1992theory,erol1996complexity,saitta2013abstraction,banihashemi2017abstraction}. The idea of establishing mappings between models to yield a semantic theory for abstraction owes its origin to works such as \cite{milner1989communication}. But formal treatments have been mostly restricted to categorical and non-probabilistic domains. Nonetheless, there have been various developments in different communities, and we discuss the lineage in more detail below. \smallskip
\textbf{Knowledge representation and automated planning:}
Our framework here is inspired by, and indeed builds on the proposal in \cite{banihashemi2017abstraction}, where isomorphism as well as sound and complete abstractions are investigated for (non-probabilistic) situation calculus agent programs. Here, we sought to extend those ideas to establish probabilistically interesting properties for probabilistic models, including probabilistic relational models (PRMs). For this, we motivated the notion of unweighted abstractions, which roughly corresponds (at the level of satisfaction and entailment) to the categorical setting \cite{banihashemi2017abstraction}. But by piggybacking on these properties, weighted abstractions and evidence incorporation were motivated and formulated. We then identified the relationship of that framework to a purely stochastic one (weak exact abstractions), and further studied the automatic derivation of abstractions. Our observations about decomposability, among other things, need not be limited to stochastic models and
may also be applicable in the categorical setting.
We refer interested readers to the references in \cite{banihashemi2017abstraction} for a comprehensive discussion on the use of abstraction in knowledge representation and automated planning (e.g., hierarchical planning). A particularly interesting direction in this landscape is the work of \cite{giunchiglia1992theory}, where operations on abstractions are studied at the level of the logical theories. We suspect these results can be generalized (and adapted) to our framework with some effort. \smallskip
%
\textbf{Program synthesis and verification:}
In the area of program verification, static analysis and abstraction interpretations are commonplace to test the correctness of programs and probabilistic programs. See \cite{mciver2005abstraction} for a book length treatment, for example.
A number of additional concerns present themselves in a programmatic setting, including the branching in the presence of stochastic primitives, and stochastic transitions between program states. The motivation then is to deduce sound abstractions for verifying correctness (e.g., termination) properties.
While some of these works do not consider abstractions themselves to be probabilistic,
the developments are related to our goals. Thus, it would be interesting to study how ideas and techniques from the program analysis literature can be carry over to our framework, and vice versa.
For example, \cite{Zhang:2017:CLP:3088525.3088563} consider statistical properties of program behavior to advise abstractions, \cite{sharma2013verification} relate verification to the learnability of concepts, \cite{holtzen2017probabilistic} study abstract predicates for loop-free probabilistic programs, and \cite{monniaux2001abstract} defines abstract representations for probabilistic program path analysis. On the semantical front, \cite{cousot2012probabilistic} present a detailed and careful analysis for reasoning about (probabilistic) nondeterminism in programs, but as argued in \cite{holtzen2017probabilistic}, they do consider the abstractions themselves to be probabilistic structures. This is precisely the focus of \cite{holtzen2017probabilistic}, where they want to abstract loop-free probabilistic programs as possibly simpler and smaller probabilistic programs. These latter programs may then be amenable to automated verification, for example. Roughly, the idea is to transform a concrete program (in our terms: low-level) to an abstract program (in our terms: high-level).
So this work is closest in spirit to our thrust. They mainly motivate a notion of sound probabilistic over-approximation, with the intent of capturing a distribution over feasible states. In a sense, this is akin to Definition \ref{defn weighted sound complete abs}, but without any stipulation of logical alignment, so it is \emph{weak} (as in Section \ref{sec:weak_abstractions}). In follow up work, \cite{holtzen2018sound} introduce the notion of distributional soundness, which asserts that the probability of a high-level event is equal to the probability of the low-level event. Thus, in a sense, this is akin to weak exact abstractions. Finally, they also investigate a strategy for finding high-level programs that roughly corresponds to replacing atomic formulas in the low-level program with an appropriate high-level random variable \cite[Algorithm 1]{holtzen2018sound}. That procedure is similar in spirit to our generic search procedure, in the sense of requiring exponential search in the worst case, but considerably easier given the predefined structural syntax of the sought after abstraction. They discuss an implementation that also leverages many state-of-the-art techniques from the program verification community, such as counterexample-guided refinement \cite{clarke2000counterexample}.
Put differently, the setting of loop-free probabilistic programs built from Bernoulli or other univariate distributions is often much more constrained than a first-order language in that the grammar only allows conjunctions of positive statements (as in most loop-free sequential programs), and programs allow the use of the predicate transformer semantics \cite{dijkstra2012predicate} to abstract atomic assertions.
Our setting is more general, in that: (a) high-level abstractions may map onto arbitrarily complex well-defined low-level formulas, (b) along with weak abstractions, we also motivate theory alignment (such as Definition \ref{defn weighted exact}), and (c) the treatment of evidence at the first-order/logical level allows for a richer perspective. Nonetheless, restricted settings such as the one investigated for probabilistic programs may represent cases that offer reasonable expressiveness/tractability tradeoffs. In that regard, refining schemas such as Algorithm \ref{alg:find one} to also leverage state-of-the-art techniques from the program verification community may identify other interesting fragments.
Finally, in the context of inductive logic programming and meta-interpretative learning, there is a long history of predicate invention and learning abstract programs \cite{cropper2016learning} and their affect on human comprehensibility \cite{predicate-invention-comprehensibility}. Although the semantic constraints for abstracting is somewhat different, it is possible that our setup regarding partial knowledge in Section \ref{sec:deriving_abstractions} could be realized using such methods. \smallskip
\textbf{Probabilistic logical modeling:}
In the PRM literature, a few recent developments seem to be close in spirit to abstraction. In \cite{exploiting-shared-correlations-in-probabilistic}, the question of making inference more efficient in classes of probabilistic databases (PDBs) that share certain structural properties is investigated. Roughly, what they are after is a possibly ``compressed" PDB that answers queries exactly as would the original PDB in the manner that inference computations are not repeated for the shared features. Of course, our framework differs in that the high-level and low-level theory do not need to have any structural similarities. Moreover, if they do share structural similarities, at this point, we disregard the issue of how probabilistic computations can be made efficient, as this is somewhat orthogonal to the main thrust of the paper. We suspect, under some conditions, it might be possible to show that classes of PDBs with shared features may correspond to abstractions, but conversely, reiterating the point above, simply because \( \kb\high \) and \( \kb\low \) are abstractions need not imply that they share structural features. Along these lines, a recent thrust in PRMs is the question of how to make inference more efficient by exploiting the relational vocabulary, referred to as ``lifted reasoning'' \cite{lifted-inference-and-learning-in-statistical, bisimulation-based-approximate-lifted-inference}. This is justifiably sometimes referred to as a type of ``abstraction'' \cite{ludtke2018state}.
There seem to be two implications for our work. The first is computational: verifying that \( \kb\high \) is an abstraction of \( \kb\low \) could be made more efficient by appealing to lifted reasoning. (This is, as argued elsewhere, somewhat orthogonal to the main thrust of the paper.) The second revisits our observations about compressed PDBs \cite{exploiting-shared-correlations-in-probabilistic}. One could, for example, see a non-ground PRM as the high-level abstraction of the low-level ground PRM, in that none of the domain constants are explicitly mentioned in the former. So, in that sense, a non-ground PRM would turn out to be an abstraction of a ground PRM, but simply because \( \kb\high \) and \( \kb\low \) are abstractions need not imply that they share the same vocabulary. For the future, we hope to study the connections between these strands of work and abstraction in more detail, so as to attempt to formalize these intuitions.
On the topic of reasoning, our framework has some overlap with the principles of \emph{representation-independent} probabilistic inference \cite{halpern2004representation}. Here,
one is usually interested in the computed conditional queries not being different if the knowledge base is represented differently, (say) using an abstract logical language.
So, \cite{halpern2004representation} motivate a notion of correctness where if a query \( \phi \) follows a knowledge base \( \Delta, \) it should also be the case that \( f(\phi) \) follows from \( f(\Delta) \) where \( f \) is a mapping from one representation to another. Then, a \emph{robust} inference procedure is one that respects semantically justifiable properties such as those in Theorem \ref{thm wmc properties} for reasonable mappings.
While there is some similarity at first glance, there is a crucial conceptual difference: as already argued in \cite{halpern2004representation},
unlike the work in representation-independent inference,
the two representations are not required to be equivalent in an exercise on abstraction, because, by definition, an abstraction ignores irrelevant facts. The technical thrust is also different in our work, such as the identification of weighted exact vs weak exact abstractions, the handling of evidence, and our analysis on generating abstractions.
Following the work in \cite{halpern2004representation}, a broader treatment is given in \cite{jaeger1996representation}, where the notion of representation independence is studied for non-classical consequence more generally, of which probability measures is a special case. Very similar in spirit to our own work as well as the categorical setting \cite{banihashemi2017abstraction} that we build on, the purely logical question of when two sentences represent the same information is considered first, prompting a definition that is virtually identical to unweighted sound and complete abstractions. As argued above for the case of \cite{halpern2004representation}, there are numerous differences in terms of technical thrust, however. In our work, for example: (a) abstractions were analyzed at the level of soundness and completeness; (b) weighted abstractions were derived by piggybacking on constraints noted in the unweighted setting; (c) we investigated the difference between probabilistic alignment in the presence and absence of logical alignment; (d) we considered the incorporation of evidence; and (e) we identified properties for the verification and generation of abstraction. \smallskip
\textbf{Statistics:} When establishing the alignment between the high-level and low-level theory, we looked solely at the marginal probabilities between two discrete probability distributions. Summarizing distributions is a standard problem in statistics, and the use of means and moments is common \cite{machine-learning:-a-probabilistic-perspective}; it is an interesting question whether such constructs could be useful for defining and/or deriving abstractions (in our sense).
A more standard case of statistical abstraction is when continuous distributions are cast as discrete events by appealing to the cumulative distribution function. We touched upon this in Section \ref{sub:syntactic_substitutions}, and we note that such ideas have been used for inference in continuous domains via a generalized variant of weighted model counting~\cite{probabilistic-inference-in-hybrid-domains}, and for probabilistic program abstractions \cite{holtzen2017probabilistic}.
In causal modeling, mapping macro and micro level events is a long-standing concern, which correspond in our terms to hig-level and low-level models.
In recent work, for example, \cite{rubenstein2017causal} study consistency between micro and macro-level random variables via structural equation models, and so are close in spirit to abstractions. \smallskip
Let us conclude this section with some observations.
Firstly, despite the tremendous amount of attention that abstraction has received, the framework presented here is useful for a number of reasons: (a) it is downward compatible with the categorical (and first-order) setting \cite{banihashemi2017abstraction}; (b) it identifies probabilistic alignment together with a notion of logical alignment, the former closely mirroring the analysis on probabilistic program abstractions \cite{holtzen2017probabilistic,holtzen2018sound}; and (c) it seems to agree with the intuitions regarding representation-independence probabilistic inference \cite{halpern2004representation}; and (d) it can leverage the advances in weighted model counting, including lifted reasoning. Let us now reflect on a few critical points.
It is interesting to note that although the level of generality of our framework allows us to easily draw comparisons to results from the categorical literature and representation independence, which is useful from a theoretical standpoint,
it may mean that the formal results are somewhat removed from the concerns of high-level modeling languages. For example, a major issue with PRMs is ensuring that the ground model is acyclic so that inference and sampling methods can be designed easily. To understand how those issues carry over to abstraction algorithms, we need to understand how high-level PRMs can be designed that ensure that such properties are not lost on abstraction if present in the low-level PRM. Conversely, even if the low-level PRM does not enjoy effective inference properties, can a high-level PRM be obtained that is amenable to those properties? In this work, since our focus was on understanding the semantical properties of abstractions, such concerns are orthogonal but they may impact our choice for guessing an appropriate high-level theory.
To that end, existing empirical observations on abstraction-type frameworks are somewhat mixed. Early work on categorical abstractions \cite{giunchiglia1992theory}, for example, noted that `` \( \ldots \) shows that there are situations where abstraction saves time but also situations where it results in less efficiency." In a similar vein, as discussed in \cite{holtzen2018sound}, factor graph abstractions for probabilistic programs do not always maintain structural decompositions.
On the one hand, if one takes a worst-case view of the inference problem, it immediately follows that given reasoning with (say) \( n \) atoms in \( \kb\low \) versus \( m \ll n \) atoms in \( \kb\high \), the latter seems preferable. For the case of loop-free sequential probabilistic programs built from Bernoulli random variables and conditional statements, \cite{holtzen2018sound} also empirically show that abstractions can be effective. Moreover, as already mentioned, abstraction is a very successful strategy in the verification communities. Thus, we think there is a broader question of choosing the most reasonable abstraction, one that is indeed amenable to effective inference, perhaps more so than the low-level theory.
A parallel concern is about the choosing of a vocabulary that offers maximum comprehensibility \cite{predicate-invention-comprehensibility}. A minor observation to be made here is that if comprehensibility is all we care about (as opposed to being concerned about both comprehensibility and tractability), then it is not clear that one would need to fully abstract a theory. Indeed, we could introduce/invent definitional or semi-definitional predicates of the form \( P(\vec x) \supset \phi(\vec x) \) or \( \phi(\vec x) \supset P(\vec x) \), where \( \phi(\vec x) \) corresponds to low-level information, the idea being that the user is only exposed to instances of \( P \). Such a construction would invariably increase the size of the theory, but we would be taking steps toward comprehensibility by designing predicates to correspond closely to the user's vocabulary. In fact, the user could be exposed to a combination of high-level and low-level predicates to provide explanations of a suitable granularity.
Such concerns, of course, affect all frameworks on abstraction, and are not unique to our endeavor. A semantic theory of correctness such as the one considered in this paper, in that regard, would indeed be at the level of interpretations and not necessarily in the language of the user-specific domain knowledge, perhaps analogous to a theory on program correctness. We would not expect a mathematical analysis on correct programs to necessarily involve the syntactic constructs of the programming language represented as is, but rather in terms of suitable mathematical objects that captures its computational underpinnings (e.g., variable assignment, recursion). In this sense, a semantical theory on abstraction is (in the non-technical sense) {\it abstract}. Owing to our observations and building on this theory, we do hope that it becomes possible to define and inspect the choosing of effective abstractions in the future.
\section{Conclusions}
\label{sec:conclusions}
In this work,
we were motivated in the development of a formal framework for abstractions, based on isomorphisms between models, where atoms in a high-level theory can be mapped to complex formulas at the low-level.
From that, we developed a number of accounts of abstraction, as well as the handling of low-level evidence, all of which motivated some observations about how abstractions can be derived automatically.
Given the increasing interest in abstraction for statistical AI, we hope our framework will be helpful in developing probabilistic abstractions for increased clarity, modularity and tractability, and perhaps interpretability. \smallskip
\bibliographystyle{abbrv}
| {'timestamp': '2020-01-14T02:21:06', 'yymm': '1810', 'arxiv_id': '1810.02434', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02434'} | arxiv |
\section{Introduction}
\label{sec:intro}
Predictive modeling for data streams is becoming an increasingly-relevant task, in particular with the increasing advent of sensor networks and tasks in artificial intelligence, including robotics, reinforcement learning, system monitoring, anomaly detection, social network and media analysis.
In a data stream, we assume that data arrives
\[
(\x_t,y_t) \sim p_t(\dX,\dY)
\]
over time $t=1,\ldots,\infty$. A model observes test instance $\x_t$ and is required to make a prediction
\[
\yp_t = h_t(\x_t)
\]
\emph{at time} $t$. Hence the amount of computational time spent per instance must be less that the rate of arrival of new instances (i.e., the real clock time between time steps $t-1$ and $t$). A usual assumption is that true label $y_{t-1}$ becomes available at time $t$, thus allowing to update the model.
This is in contrast to a standard batch setting, where a dataset $\{\x_t,y_t\}_{t=1}^N$ of fixed $N$ is observed prior to inducing the model.
See \cite{IndresSurvey} for introduction and definitions.
\subsection{Building Predictive Models from Data Streams}
\label{sec:learning_from_data_streams}
We wish to build a model that approximates, either directly or indirectly, the generating distribution. For example, a MAP estimate for classification
\[
\yp_t = h_t(\x_t) = \argmax_{y} \papprox_t(\x_t,y)
\]
The incremental nature of data streams has encouraged a focus on fast and incremental, i.e., updateable, models; both in the classification and regression contexts. \cout{Although batch classifiers can sometimes be employed competitively (so-called `batch-incremental'; see, e.g., \cite{Kolter2007} -- and \cite{IDA2012} for an empirical comparison) the literature shows a clear preference for incremental models where the learning model is updated one instance at a time. }
Incremental decision trees such as the Hoeffding tree (HT, \cite{HT}) have had a huge impact on the data-streams literature and dominate recent output in this area. They are fast, incremental, easy to deploy, and offer powerful non-linear decision boundaries. Dozens of modifications have been made, including ensembles \cite{LeveragingBagging,EnsembleDriftSurvey,DataStreamEnsembleSurvey,AdaptiveRF}, and adaptive trees \cite{HAT}.
High performance in data streams has also been obtained by $k$-nearest neighbors ($k$NN) methods, e.g., \cite{SAMkNN,MicroClusterKNN,kNNstream}. As a lazy method, there is no training time requirement other than simply storing examples to which -- as a distance-based approach -- it compares current instances, in order to make a prediction. The buffer of examples should be large enough to represent the current concept adequately, but not too large as to be prohibitively expensive to query.
Methods employing stochastic gradient descent (SGD)\footnote{i.e., incremental gradient descent; SGD usually implies drawing randomly from a dataset in i.i.d.\ fashion. Typically a stream is assumed to be i.i.d., and thus equivalent in that sense. We challenge the i.i.d.\ assumption later, but keep this terminology to be in line with that of the related literature} have been surprisingly underutilized in this area of the literature. Baseline linear approaches obtained relatively poor results,
but can be competitive with appropriate non-linearities \cite{RTStreams2} and have been used within other methods, e.g., at the leaves of a tree \cite{SGDleaves}. In this work, we argue that the effectiveness of SGD methods on data-stream learning has been underappreciated and in fact offer great potential for future work in streams.
\subsection{Dealing with Concept Drift}
\label{sec:drift}
Dealing with \textit{concept drift}, where the generating distribution $p_{t-1} \neq p_{t}$ in at least some part of the stream, is a major focus of the data-stream literature, since it means that the model current $h_t$ has become partially or fully invalid. Almost all papers on the topic propose some way to tackle its implications, e.g., \cite{HOFER2013377,TransferLearningForDrift,IndresSurvey,LeveragingBagging,EnsembleDriftSurvey,KatakisRecurring,Kolter2007}. A comprehensive survey to concept drift in streams is given in \cite{IndresSurvey}.
The limited-sized buffer of $k$NN methods imply a natural forgetting mechanism where old examples are purged, as dictated by available computational (memory and CPU) resources. \cout{A similar principle applies to ensembles of batch models (i.e., batch-incremental), where older or less-relevant models from the ensemble are dropped as new ones are created.} Any impact by concept drift is inherently temporary in these contexts. Of course, adaptation can be increased by flushing the buffer when drift is detected
HTs can efficiently and incrementally build up a model over an immense number of instances without needing to prune or purge from a batch. However, a permanent change in concept (generating distribution) will permanently invalidate the current tree (or at least weaken the relevance of it -- depending on severity of drift) therefore dealing with drift becomes essential. The usual approach is to deploy a mechanism to detect the change, and reset a tree or part of a tree when this happens, so that more relevant parts may be grown on the new concept. Common detection mechanisms include ADWIN \cite{ADWIN}, CUMSUM \cite{egCUMSUM}, Page Hinkley \cite{HanenPageHinkley}, and various geometric moving average and statistical tests \cite{Gama2004}. For example, the Hoeffding Adaptive Tree (HAT, \cite{HAT}) uses an off-the-shelf ADWIN detector at each node of a tree, and cuts a branch at a node where changes in registered. It is expected that the branch will be regrown on new data and thus represent the new concept. Tree approaches are almost universally employed in ensembles to mitigate potential fallout from mis-detections.
In this paper we argue strongly for the potential importance of a third option -- of continuous adaptation, where knowledge (e.g., a set of parameters determining a decision boundary) is transferred as best as possible to a newer/updated concept rather than discarded or reset as in currently the case with the popular \emph{detect and reset} approach. This possibility can be enacted with SGD. SGD is intimately known and widely used across swathes of the machine learning literature, however, we note that it is markedly absent from the bulk of the data-stream methods, and often only compared to only as a baseline in experiments. In this paper we argue that it has been discarded prematurely and underappreciated. We analyse and parameterize it specifically in reflection to performance in concept-drifting data-streams, and show it to be very competitive with other approaches in the literature (results in \Sec{sec:discussion}).
To summarize the main mechanisms to deal with concept drift:
\begin{enumerate}
\item Forgetting mechanism\\ (e.g., $k$NN, and batch-incremental ensembles)
\item Detect and reset mechanisms\\
(e.g., HATs and HT-ensembles with ADWIN)
\item Continuous adaptation\\ (e.g., SGD-based models incl.\ neural networks)
\end{enumerate}
\subsection{Organization and contributions}
In spite of the enormous popularity of ensembled trees and distance-based ($k$NN) approaches, we will show that continuous adaptation can be more suited to concept-drifting data streams. We do this by breaking with a common assumption.
Namely, existing work in data streams is mostly based on the assumption of i.i.d.\ data within a particular concept; therefore seeking as an objective to detect a change in concept, so that off-the-shelf i.i.d.\ models can be (re)-deployed. A model belonging to a previous concept is seen as invalid. This leads to the detect-and-reset approach to dealing with concept drift mentioned above. In this work, on the contrary, we show that drift inherently implies temporal dependence; that all concept-drifting streams are in some way a time series, and can be treated as such. We propose to treat the concept as a temporal sequence, to enable continuous adaptation as an effective alternative to detect-and-reset approaches. For this purpose we derive gradient descent approaches; and we show scenarios where they compare very favorably in comparison with more popular tree and distance-based methods.
The contributions of this work can be summarized as follows:
\begin{itemize}
\item We show that concept-drifting data streams can be considered as time series problems (\Sec{sec:time_series})
\item Following a fresh analysis on concept drift (\Sec{sec:revision}), we conduct a bias-variance analysis of learning under drift, and derive gradient descent approaches for concept-drifting data streams in the framework of continuous adaptation (\Sec{sec:novel})
\item We give an analytical and empirical investigation (\Sec{sec:experiments}) which highlights properties of our suggested approach; and from the results (displayed and discussed in \Sec{sec:discussion}) we outline the implications and make a number of recommendations before making concluding remarks (\Sec{sec:conclusion}).
\end{itemize}
\section{Concept-drifting
Streams are Time Series}
\label{sec:time_series}
Concept-drifting data streams have been widely treated under the assumption of independent samples (see, e.g., \cite{Gama2004,LeveragingBagging,IndresSurvey,Persistent} and references therein). In this section, we argue that if a data stream involves concept drift, then the independence assumption is violated.
If data points are drawn independently, we should be able to write
\begin{align}
p_t(y_t,x_t,x_{t-1}) &= p_t(y_t|x_t)p_t(x_{t-1}) \label{eq:ind}\\
p_t(y_t|x_t,x_{t-1}) &= p_t(y_t|x_t) \notag
\end{align}
see \Fig{fig:main_figure.a} for illustration, where the lack of an edge between time-steps indicates the independence.
\cout{
Indeed, we can use the joint distributions by \Fig{fig:pre_main_figure} to derive probabilistic methods, such as the naive Bayes (a typical data-streams baseline classifier):
\begin{equation}
\label{eq:map}
\yp_t = h(\x_t) = \argmax_{y_t} P(y_t,\x_t)
\end{equation}
}
The subscript of $p_t$ reminds us of the possibility of concept drift (in which case, $p_t \neq p_{t-1}$).
\begin{proposition}
\textit{A data stream that exhibits a concept drift also exhibits temporal dependence.}
\end{proposition}
\begin{figure}
\centering
\subfloat[][]{
\includegraphics[scale=0.9]{DS_std.pdf}
\label{fig:main_figure.a}
}
\quad
\subfloat[][]{
\includegraphics[scale=0.9]{DS_gen.pdf}
\label{fig:main_figure.a_bis}
}
\caption{\label{fig:pre_main_figure}The `standard' discriminative \fref{fig:main_figure.a} and generative \fref{fig:main_figure.a_bis} models for prediction in data streams; as directed probabilistic graphical models.}
\end{figure}
\begin{proof}
Let $p_t(y_t|x_t) = p(y_t|x_t,C_t)$ where $C_t \in \{0,1\}$ denotes the concept at time-step $t$,
and let the drift occur at point $0 < \tau < \infty$. Thus $C_t = 0$ for $t < \tau$, and $C_t = 1$ for $t \geq \tau$. Under independence,
\[
P(C_{t}) = P(C_{t} | C_{t-1})
\]
However, it is obvious that
\[
P(C_{t}=0) \neq P(C_{t}=0 | C_{t-1}=1),
\]
namely, after the drift we no longer expect instances from the first concept.
We can use the joint distribution, \Eq{eq:ind}, to check for independence, for any particular time step $t$,
marginalizing out $C$ which is not observed:
\begin{align}
p(y_t|x_t,x_{t-1}) &\propto p(y_t,x_t,x_{t-1}) \nonumber \\
&= \sum_{c_t,c_{t-1}} p(y_t,x_t,c_t, c_{t-1}, x_{t-1}) \nonumber \\
&= p(y_t|x_t)\underbrace{ \sum_{j=1}^{t} \sum_{c_j,c_{j-1}}p(x_{j}|c_{j})p(c_j|c_{j-1})}_{p(x_t|x_{t-1})} \nonumber \\
&= p(y_t|x_t)p(x_t|x_{t-1}) \label{eq:deriv}
\end{align}
which \emph{does not} equal \Eq{eq:ind}, thereby indicating temporal dependence (via the presence of $t-1$).
\end{proof}
This can be visualized as a probabilistic graphical model in \Fig{fig:main_figure.b} (observed variables are shaded); and
in \Fig{fig:main_figure.c} with concept drift marginalized out.
\begin{figure}
\centering
\subfloat[][]{
\label{fig:main_figure.b}
\includegraphics[width=0.42\columnwidth]{DS_drift.pdf}
}
\quad
\quad
\subfloat[][]{
\includegraphics[width=0.42\columnwidth]{DS_marg.pdf}
\label{fig:main_figure.c}
}
\caption{\label{fig:pre_main_figure2}A discriminative model \fref{fig:main_figure.b} for prediction in data streams with concept drift (dashed lines simply indicate that these connections are not usually explicitly addressed). When drift is taken into account and marginalized out \fref{fig:main_figure.c}, inputs become connected.
}
\end{figure}
We have shown above that data streams with concept drift exhibit temporal dependence, which essentially means that all such streams can be seen as a time series.
We have done this analysis in the most extreme case of a switch in concepts over a single time step (a sudden change in concept). One might argue that as $t \rightarrow \infty$, the importance of the dependence resulting from this one-time drift becomes negligible, since \emph{after} drift, $P(C_t=1)=P(C_{t-1})=1$ and could thus be considered a constant essentially rendering independence \emph{within} each concept. However we do not observe $\tau$; we cannot know exactly when the drift will occur or if it has ocurred. As a result, an instantaneous drift between two time steps can manifest itself as temporal dependence in the error signal over many instances. It is surprising that this is not explicit across the literature, since it is indeed implicit in most change-detection algorithms,
in the sense that they measure the change in the error \emph{signal} of predictive models.
The relationship between the predictive model and the error is clearly seen in the relation
\[
E_t =E(h_t(\x_t), y_t)
\]
where $E$ is the error function (e.g., mean-squared or classification error, depending on the problem). Clearly if $h_t$ is poorly adapted to deal with a concept drift, this will appear in increasing $E_t$ (i.e., a time series). It is illustrated (for incremental drift\footnote{We will review this type of drift in \Sec{sec:revision}}) in \Fig{fig:drift_series}. Rather than monitoring $\{E_t\}$ for drift so as to reset $h_t$, in this paper, we look at adapting $h_t$ directly.
Having argued that concept drifting streams are time series -- should we just apply off-the-shelf time series models? Expanding on some differences mentioned in \cite{Persistent}, we can point out that
\begin{enumerate}
\item Only data streams exhibiting \emph{concept drift} are guaranteed to have time series elements, and only in consideration specifically of these parts of the stream
\item Time dependence in data streams it is seen as a problem (something to deal with), rather than as part of the solution (something to explicitly model)
\item In data streams the \emph{final} estimation of each $\yp_t$ is required at time $t$, and thus retrospective/forward-backward (smoothing) inference (as is typical in state-space models) is not applicable
\item A common assumption in data streams is that the ground truth is available at time $t-1$, providing a stream of training examples $(\x_{t-1},y_{t-1})$ whereas time series models are typically built offline before being deployed live \label{i:3}
\item Data streams are assumed to be of infinite length (therefore, also training data, on account of item \ref{i:3}
\end{enumerate}
Some of these assumptions are broken on a paper-by-paper level. For example, changes to point \ref{i:3} have been addressed in, e.g., \cite{AdaptiveRF,HOFER2013377}.
The most closely related time series task to prediction\footnote{Of the current time step} in streams is that known as \emph{filtering}. Actually, \Eq{eq:deriv} is a starting point for state space models such as hidden Markov models, Kalman and paricle filters (see \cite{Barber} for a thorough review) for which \emph{filtering} is a main task, although these models are not usually expected to be updated at each timestep as in the streaming case (a possibility due to point \ref{i:3} above).
Although we cannot always apply state-space models directly to data streams, we nevertheless remark again that temporal dependence plays a non-negligible role, and can be leveraged as an advantage. In particular, in reflection of this section, we next make a revision of concept drift -- in \Sec{sec:revision} -- which then allows us to employ efficient and effective methods (\Sec{sec:novel}), allowing us to draw conclusions that have important repercussions in data streams mining.
\begin{figure}
\centering
\subfloat[][]{
\includegraphics[width=0.32\columnwidth]{demo_line_drift.pdf}
\label{fig:drift_series.a}
}
\subfloat[][]{
\includegraphics[width=0.32\columnwidth]{demo_coef_drift.pdf}
\label{fig:drift_series.b}
}
\subfloat[][]{
\includegraphics[width=0.32\columnwidth]{demo_erro_drift.pdf}
\label{fig:drift_series.c}
}
\caption{\label{fig:drift_series}Concept drift (incremental drift): decision boundary on $y_t = \sigma(\theta_t^\top\x_t)$ shown for $t=\tau,\tau+1,\ldots,\tau+10$ \fref{fig:drift_series.a}; corresponding value of the coefficients over these time-steps \fref{fig:drift_series.b} -- forming a time series with obvious temporal dependence: $\theta_\tau,\ldots,\theta_{\tau+10}$; and the error rate over time -- also a clear time series \fref{fig:drift_series.c}. }
\end{figure}
\section{Types of Concept Drift: A Fresh Analysis}
\label{sec:revision}
Sudden, complete, and immediate drift is widely considered in the literature (and for this reason we worked with it in the previous section), yet we could also argue that gradual, or incremental drift fit better a dictionary definition which implies a \emph{movement} or tendency\footnote{Cambridge dictionary offers, among others: ``\textit{a slow movement}''} and are more widespread in practice. A complete change in concept simply means we have changed problem domains.
The idea of a movement inherently includes the implication of dependence (e.g., across time and space) -- and dependence (among instances) implies naturally a time \emph{series} -- as we have elaborated in the previous section.
Let us review and revise concept drift, based on the types of drift identified in \cite{IndresSurvey}, which relist for convenience:
\begin{enumerate}
\item Sudden/abrupt \label{l:1}
\item Incremental \label{l:2}
\item Gradual \label{l:3}
\end{enumerate}
additionally noting the possibility of reoccurring drift which may involve any of these types and, noting also the related task of dealing with outliers, which are \emph{not} concept drift.
In the following, we denote $\theta_t \in \Theta$ as the \emph{true} (unknown) parameters defining the current concept at time $t$, i.e., $p_{\theta_t}$. This allows for a smooth \emph{drift} across concept space $\Theta$ (for example, a set of coefficients defining a hyperplane; see \Fig{fig:drift_series}) but also allows for a qualitative view of categorical concepts $C_t \in \{1,\ldots,K\}$; such that $\theta^{c}$ represents the parameters of the $c$-th concept; i.e., we would speak of drift between concepts $\theta^{{1}}$ and $\theta^{{2}}$
\subsection{Abrupt change}
If the concept changes abruptly, in either a partial or complete manner, we may denote
\begin{equation}
\label{eq:1}
\theta_t = \CaseCond{\theta^{c_1}}{t < \tau}{\theta^{c_2}}{t \geq \tau}
\end{equation}
for some time index $\tau$ where the `drift'\footnote{As noted above, we would prefer the term \emph{shift} for this particular case. Nevertheless, we inherent this terminology from the literature for the sake of consistency} occurs. The drift may be total ($\theta^1$ and $\theta^2$ are drawn independently from $\Theta$) or partial (only a local change, to some part\footnote{Recalling that $\theta$ is likely to be multi-dimensional} of $\theta$.
\subsection{Incremental drift}
\label{sec:d_2}
Incremental drift denotes a change over time. It can be denoted as an additive operation, where the current concept can be written as
\begin{equation}
\label{eq:2}
\theta_t = \theta_{t-1} + \Delta_t\theta
\end{equation}
i.e., an increment of $\Delta_t\theta$.
We generally assume that drift is active in range $\tau_1 \leq t \leq \tau_2$ (and that $\Delta \theta = 0$ outside of this range); where concept $c_1$ before, $c_2$ after, and a blended mixture inbetween).
\subsection{Gradual drift}
\label{sec:d_3}
In gradual drift, drift also occurs over time, but in a stochastic way. We may write
\begin{equation}
\label{eq:3}
\theta_t = \theta^{c_t} \quad\text{ where }\quad {c_t} \sim \dB(\alpha_{t})
\end{equation}
where $c_t=1$ with probability $\alpha_t$, and $c_t=2$ otherwise; $\dB$ being a Bernoulli distribution. Note that $\alpha_{t}$ is itself is an incremental drift (see \Eq{eq:2}) between values $0$ and $1$. The stream thus increasingly-often generates examples from the new concept $c_2$; where drift $\alpha_{t < \tau_1} = 0$ and $\alpha_{t > \tau_2} = 1$ outside of the drift range $\tau_1,\ldots,\tau_2$.
Note that neither incremental nor gradual drift need be smooth or monotonically increasing, although that is a common simplification. A sigmoid function is often used in the literature; as in many of the stream generators of the MOA framework \cite{MOA}.
\subsection{Re-occurring drift}
\label{sec:reoccurring_drift}
Re-occurring drift may be any of the above cases (sudden, gradual, or incremental) where a concept may repeat at different parts of the stream.
It is very much related to the idea of state-space models such as hidden Markov models, and switching models (both are reviewed in \cite{Barber}).
We remark that there is no technical difference between modelling states, and tracking concepts. Usually we can distinguish a state as something that we \emph{want to model} (e.g., a weather system), and a concept drift as something we wish to adapt to or take into account (e.g., change/degradation of in the monitoring sensors, or climate change).
\section{Learning under Drift: Theoretical Insights}
\label{sec:novel}
In this section we investigate an approach to adapt to drift continuously as part of the learning process, rather than reactively (i.e., the detect-and-reset approach) using explicit drift detection mechanisms, as has previously been the main approach (see \Sec{sec:intro}).
It is well known that prediction error of supervised learners breaks down into \textit{variance}, \textit{bias}, and \textit{irreducible error} (see, e.g., \cite{Barber,DuSwamy}). Let $f : \dX \rightarrow \R$ represent the true underlying (unknown) model parametrized by $\theta_c$, which produces observations $y_t = f(\x_t; \theta_c) + \epsilon_t$, where $\epsilon_t \sim \N(0,\sigma^2)$. The expected mean squared error (MSE) over the data, with some estimated model $h$, can be expressed as
\begin{align}
\Exp_{\x_t}[\textsf{MSE}(h,y|\x_t)] & = \Exp_{\x_t} \Exp_{y_t, \epsilon_t}[ (y_t - h)^2 | \x_t]\nonumber \\
&= \sigma^2 + \Vxp[h] + \Exp[f - h]^2 \label{eq:bvt_normal}
\end{align}
i.e., irreducible noise, variance, and bias$^2$ terms, respectively.
The result in \Eq{eq:bvt_normal} hinges on the assumption that
\(
\Exp[y] = \Exp[f + \epsilon] = f
\)
due to the fact that $\Exp[\epsilon_t] = 0$.
However, recall that in the case of concept drifting data streams, $f$ is not constant, but inherits randomness from random variable $C_t$ (see Sections~\ref{sec:time_series} and \ref{sec:revision}). We can get around this problem by
taking the expectation of $\textsf{MSE}$ within each concept; wrt the point of a single change (which we denote $\tau$), then for time $t \geq \tau$),
\[
y_t = \underbrace{\left[f_{t<\tau} + \Delta(f_{t<\tau},f_{t\geq\tau})\right]}_{f_{t \geq \tau}}(\x_t) + \epsilon_t
\]
where $\Delta(f_{t<\tau},f_{t\geq\tau})$ represents the change in concept. Regarding \Eq{eq:bvt_normal}: At $t=\tau$ the
third term (bias) is now essentially the difference between the current true concept, and an estimated old concept.
In other words (in terms of parameters),
\begin{equation}
\label{eq:tracking}
(\theta_t - \thest_t)^2
\end{equation}
and clearly the obvious goal (in terms of reducing bias), is moving $\thest_t$ (an estimate of the previous concept) towards $\theta_2$ (the true \emph{current} concept), and over a concept drifting stream of multiple drifts of different types: to model the journey of $\theta$.
In the data streams literature, ensemble models with drift-detection strategies have blossomed (see, \cite{DataStreamEnsembleSurvey,EnsembleDriftSurvey} for surveys).
We can now describe theoretical insights to this popularity in this particular area\footnote{Aside from the popularity and effectiveness of ensembles in supervised learning in general}: By resetting a model when drift is detected, it is possible to reduce the bias implied by the drift in those models. However, this may increase the variance component of the error (since variance can be higher on smaller datasets \cite{SmallDataVariance}). Ensembles are precisely renown for reducing the variance component of the error (see., e.g., \cite{DuSwamy} and references therein) and thus desirable to counteract it.
This analysis also leads us once more to the downside of this approach: Under long and intensive drift, a vicious circle develops; increased efforts to detect drift lead to more frequent detections and thus frequent resetting of models (implicitly, to reduce bias), which encourages the deployment of ever-larger ensembles (to reduce the variance caused precisely by resetting models). As seen in the literature, ensemble sizes continue to grow; and our experiment section confirm that such implementations can require significant computational time.
Methods with an explicit forgetting mechanism (e.g., $k$NN, batch-incremental methods -- also popular in the literature) will automatically establish `normal' bias as $(t - \tau)$ becomes as large as the maximum number of instances stored in memory. However, this can be a long time if that size is large; and not a solution when the drift is sustained over a long time or occurs regularly
Finally, we remark again that detectors will fire when the error signal has \emph{already} shown a significant change,
by which time many (possibly very biased) predictions may have been made.
In the following section we discuss how to avoid this trade-off. Namely, we propose strategies of continuous adaptation which do not detect drift, but \emph{track} drift through time.
\section{Continuous Adaptation under Concept Drift}
\label{sec:proposal}
Drift detection methods usually monitor the error signal retrospectively for change (is $\epsilon_t$ statistically different from $\epsilon_{t-1}, \epsilon_{t-2}, \ldots$; a warning can be raised). However, since -- as argued above -- concept drift can be seen as a time series we can attempt to forecast and track the drift, and adapt continuously
In this sense, solving the concept drift problem is identical to solving the forecasting problem of predicting $\theta_t$ which defines the true unknown concept (see \Eq{eq:tracking}).
Using all the stream we have seen up to timestep $t$, we could write
\[
\thest_{t} = g(\x_{1},\ldots,\x_{t}, y_{1},\ldots,y_{t-1})
\]
which at first glance appears unusable because it is a function over an increasingly large window of data. However, using a recursion on $\thest_{t-1}$, for minimizing least mean squares, there is a closed-form solution: \emph{recursive least squares} (RLS), which uses recursion to approximate
\[
\thest_t = \thest_{t-1} + \inv{\mR}_t \x_t (y_t - \x_t^\top \thest_{t-1})
\]
where $\inv{\mR}_t = \inv{\mR}_{t-1} - \inv{\mR}_{t-1}\x_t\inv{(1 + \x_t^\top\inv{\mR}_{t-1}\x_t)} \x^\top_{t}\inv{\mR}_{t-1}$.
RLS is a well known adaptive filter, which can be easily extended to \emph{forgetting}-RLS and Kalman filters (see, e.g., \cite{DuSwamy}).
Noting that $\x_t (y_t - \x_t^\top \thest_{t-1}) = \nabla E_{\thest_t}$ and replacing $\inv{\mR}_t$ with learning rate $\lambda$ we derive stochastic gradient descent (SGD), as follows.
For $t=1,\ldots,\infty$:
\begin{align*}
\yp_t & = h(x_t;\thest_t) \\
\Delta \thest_t &= \lambda \nabla E_{\thest_t}(\yp_{t},y_{t}) \\
\thest_{t+1} & \gets \thest_{t} + \lambda \nabla E_{\thest} = \thest_t + \Delta \thest_t
\end{align*}
where the last line is essentially forecasting the concept for the following timestep (note the connection to, e.g., \Eq{eq:2}). Note the data-stream assumption that at time-point $t+1$ we have already observed the true value $y_t$.
This may be viewed as a trivial result, but it has important implications regarding much of the data-stream research and practice, which traditionally relies predominantly on ensembles of decision trees or $k$-nearest neighbor-based methods; see \Sec{sec:learning_from_data_streams}. We have argued that it has been underappreciated. Unlike Hoeffding tree methods, a gradient-descent based approach can learn from a concept-drifting stream without explicit concept drift detection. Unlike $k$NN, time complexity is much more favourable.
We remark that for SGD to perform robustly over the length of a stream, we have to ensure certain conditions. In particular, to \emph{not} decay the learning rate $\lambda$ towards zero over time. In batch scenarios wish wish to converge to a \emph{fixed} point and such learning rate scheduling is common and effective practice. However, under as stream this would cause SGD to react more and more slowly to concept drift until eventually becoming stuck in one concept.
An illustration of how SGD performs in a constant-drift setting is given in \Fig{fig:missing} on a synthetic data stream (which is detailed later in \Sec{sec:experiments}). We clearly see how no drift detection or model reset is necessary, and a concept can be smoothly tracked in its drift through concept space.
\begin{figure*}
\centering
\subfloat[][]{
\label{f:a}
\includegraphics[width=0.30\textwidth]{ax1_figure.png}
}
\subfloat[][]{
\label{f:b}
\includegraphics[width=0.30\textwidth]{ax2_figure.png}
}
\subfloat[][]{
\label{f:c}
\includegraphics[width=0.30\textwidth]{ax3_figure.png}
}
\caption{\label{fig:missing} Data points from a stream exhibiting concept drift \fref{f:a}; where the true concept is represented as a decision boundary $\theta^\top\x = 0$
shown in green) which is rotating clockwise; and estimates $\thest_t$ (in blue and yellow) are following it. Both are SGD methods with learning rate $\lambda=0.5$, and the blue has an additional momentum term $\beta = 0.5$. We see the path through weight/concept space \fref{f:b}, i.e., the \emph{concept drift}. Rather than a reactive approach monitoring the error rate retrospectively, $\thest_{t+1} \approx \theta_{t+1}$ can be tracked and pre-empted.
Drift is constant across this time window, yet error rate $\epsilon_t|t=1,2,\ldots$ recedes \fref{f:c} as $\thest$ converges on the true moving concept. We emphasise that predictive performance improves \emph{during} the drift.}
\end{figure*}
Recall that under gradual drift, it is the $\alpha_t$ (see \Eq{eq:3}) rather than $\theta_t$ which forms a time series. A detailed treatment is left for future work.
Since \emph{abrupt drift} cannot necessarily be forecast in advanced, one might argue that traditional drift detectors are best suited to this case. We remark that this argument can be clearly accepted only under the condition of a complete change in concept; where the two tasks are not at all related; a scenario unlikely to be the case in practice.
If the drift is partial (i.e., the two concepts are partially related), then we wish to transfer part of the old concept (i.e., \emph{not} discard it when drift is detected). We note that SGD, in this sense, performs a kind of transfer learning; namely continuous transfer learning. The literature on transfer learning (see, e.g., \cite{TransferLearning}) indicates that we are thus likely to learn the new concept much faster.
\cout{
\subsection{Strategies for Gradual Drift}
{\color{green}
Under gradual drift, both concepts $\theta_{c_1}$ and $\theta_{c_2}$.
Traditional off-the-shift HT and $k$NN approaches offer no particular solution to this.
There are approaches, but we don't have space to deal with them in this paper
}
Note that it is $\alpha_t$ (see \Eq{eq:3}) rather than $\theta_t$ which forms a time series. We can instead estimate $\hat \alpha_t$. Thus we at least have a suitable prior $P(c_{t+1} = 1) \approx \hat \alpha_{t+1}$.
\subsection{Strategies for Abrupt Drift}
{\color{green}
This is tricky -- except 1) partial drift and 2) recurring drift; both are very common.
}
Since abrupt drift cannot necessarily be forecast (predicted) in advanced. One might therefore argue that traditional drift detectors are best suited to this case: detect change as quickly as possible, and initialize a new model and train it only on instances arriving since the point of change.
However, this is only true in the case where drift is complete, and permanent.
If the drift is partial, then it makes sense to \emph{adapt} the concept should be of interest, rather than simply resetting models. Furthermore, in this case, no drift detection is necessary and the risk of false-positives is not a concern. This will happen automatically under SGD (and kNN models). In fact, this is a case of transfer learning,
itself a large area (see \cite{TransferLearning}). It has been considered in a data stream context \cite{TransferLearningForDrift}, but we can also remark that in fact most existing data-stream methods can be considered as doing some form of transfer learning; Hoeffding adaptive trees (HATs) \cite{HAT} keep some of the tree; $k$NN methods gradually transfer knowledge to the new concept over the length of their internal buffer, and SGD methods adjust their decision boundaries, without having to be freshly initialized from scratch. The particular advantages of SGD is the smooth and automatic adaptation without storing a buffer of examples.
If a drift is reoccurring, actually this is a special case of gradual drift, where we wish to track which $\theta_{t}$ is in use at any particular time.
}
\section{Experiments}
\label{sec:experiments}
\cout{In this section we design and carry out a number of experiments which will enrich the discussion following; namely to examine the strategies we outlined, in regards to concept drift and different types of synthetic and real-world stream settings.
}
We carried out a series of experiments to enrich the discussion and support the arguments made in this work.
All methods are implemented in Python and evaluated in the \textsc{Scikit-MultiFlow} framework \cite{MultiFlow} under prequential evaluation (testing then training with each instance). Experiments are carried out on a desktop machine, 2.60GHz, 16GB RAM.
First, we generated synthetic data using a weight matrix $\theta_{c} \sim \N(\vec{0},\mI)$ to represent the $c$-th concept. We introduced drift using the equations \Eq{eq:1}, \Eq{eq:2}, \Eq{eq:3}, under parameters in \Tab{tab:synth}.
\cout{We generate synthetic data of the dimensions detailed in \Tab{tab:synth}: a stream of $T$ instances, with concept drift from time $t=\tau_1,\ldots,\tau_2$, and an initial period from time $t=1,\ldots,\tau_0$ where accuracy is not yet recorded. \count{This pre-training is sound in terms of evaluation, since accuracy will be quite unstable at the beginning as methods are still `burning in' and realistic because in real-world applications some sample of data is typically available prior to launching a live system. The true concept $\theta_t$ is represented by a weight matrix, initially $\theta_1 \sim \N(\vec{0},\mI)$.} We then draw $\x_t \sim \N(0,1) | t = 1,\ldots$, and set corresponding label $y_t = \tup{\theta_t^\top\x_t \geq 0}$ (where $\tup{\cdot} = 1$ if the condition holds and $0$ otherwise). For incremental drift, we apply (in reference to \Eq{eq:2}),}
For incremental drift,
\[
\theta_t = A_{0.01}^\top\theta_{t-1} = \theta_{t-1} + \Delta_t\thet
\]
where $A_{0.01}$ is a rotational matrix (of angle $0.01$ in radians); for gradual drift,
\[
\alpha_t = p(c_t=1) = \frac{1}{\tau_2 - \tau_1} (t - \tau_1).
\]
and, for sudden drift a new $\theta_t \sim \Theta$ is simply re-sampled after timestep $\tau_1$.
\begin{table}
\centering
\caption{\label{tab:synth}Parameters for synthetic data, except: $\tau_2=\tau_1+1$ in the case of sudden drift, and clearly $\tau_1,\tau_2$ are not used at all if no drift. In all experiments, accuracy is recorded over instances $\tau_0,\ldots,T$.}
\begin{tabular}{lll}
\hline
Sym. & $t$ & Description \\
\hline
$\tau_0$ & $T/10$ & pre-training ends \\
$\tau_1$ & 5K & start of drift\\
$\tau_2$ & 6K & end of drift (gradual, incr.)\\
$\tau_2$ & $\tau_1 + 1$ & end of drift (sudden)\\
$T$ & 10K & length of stream\\
\hline
\end{tabular}
\end{table}
\cout{This synthetic data is designed to aid the interpretation of results in a relatively simplistic manner. One could argue that it favours SGD-based learners since it is based on a rotating decision boundary. Therefore, to test in a more competitive environment, we also generate more complex synthetic data of a different nature, namely by the \textit{random tree generator} (RTG, generator available in MOA \cite{MOA}; based on \cite{DomingosH00}). The RTG builds a random tree, assigning a random class to each leaf, then assigns random values to attributes which determine the classes via the tree structure. Clearly, such data should favour heavily decision tree learners like Hoeffding-tree based methods.}
We additionally look at two common benchmark datasets from the data-streams literature involving real-world data: the \textsf{Electricity} and \textsf{CoverType} datasets. \textsf{Electricity} contains 45,312 instances, with has $6$ attributes describing an electricity market (the goal is to predict the demand). \textsf{CoverType} contains 581,012 instances of 54 attributes, as input to predict one of seven classes representing forest cover type. See, e.g., \cite{Gama2004,IDA2012,HAT,AdaptiveRF} for details\footnote{The data is available at \url{https://moa.cms.waikato.ac.nz/datasets/}}.
\cout{
\subsection{Experimental Procedure and Results}
\label{sec:proc}
}
We employed the three main approaches discussed in this work (listed in \Tab{tab:methods}); both a vanilla configuration (`stardard' $k$NN, SGD, HT) and an `advanced' configuration of the same methodologies. For HT and $k$NN we used state-of-the-art adaptations. For SGD, we simply employed basis expansion to accommodate non-linear decision boundaries.
\begin{table}
\centering
\caption{\label{tab:methods}Methods and their parameterization, both for a `standard' implementation (Vanilla Configuration) and high-performance (Advanced Configuration). Values for any parameters not shown can be found as the default parameters in \textsc{ScikitMultiflow} (v0.1.0 used here).}
\begin{tabular}{|lp{0.70\columnwidth}|}
\hline
$k$NN & $k=10$, buffer size 100 \\
SGD & $L_2$ regularization; $\lambda=0.01$, hinge loss \\
HT & $10^{-7}$ split confidence, 0.05 tie threshold, naive Bayes at leaves \\
\hline
SAM$k$NN & Self-adjusting memory $k$NN \cite{SAMkNN} \\
PBF-SGD& SGD with deg.\ $3$ polynomial basis expansion, e.g., \cite{DuSwamy} \\
RF-HT & Adaptive Random Forest \cite{AdaptiveRF}: an ensemble of $100$ HTs, ADWIN drift detection, $\lambda=6$, $n_{min}=50$ \\
\hline
\end{tabular}
\end{table}
First we had a look at performance on the synthetic data (\Fig{fig:synth}), then on real world data (\Fig{fig:difficult}), and
finally, on an especially challenging scenario (\Fig{fig:syncremental}) over a sustained incremental drift.
\Tab{tab:accuracy} summarizes the predictive performance and \Tab{tab:time} provides some running time results.
\cout{
The initially generated synthetic data is used for illustration purposes. It is relatively simple, with a linear decision boundary. But secondly, we compare methods on more complex and challenging data sources (the real-world data and the RTG stream, as per \Sec{sec:real} and \Sec{sec:synth}, respectively). For competing methods $k$NN and HTs, we use advanced state-of-the-art approaches that build on these methods, namely Self-adjusting memory $k$NN (SAM$k$NN, \cite{SAMkNN}), and adaptive random forests (RF-HT, \cite{AdaptiveRF}). To render SGD more powerful, we simply apply polynomial basis expansion (of degree 3), an elementary trick to obtain a non-linear decision boundary with a linear learner (such as SGD as defined above). We denote this basis expansion as PBF-SGD. Most machine learning textbooks adequately cover the idea of basis expansion, e.g., \cite{DuSwamy}.
}
\section{Discussion}
\label{sec:discussion}
We present and discuss results from the experiments outlined in the previous section.
\begin{figure*}[h]
\centering
\subfloat[][Stationary concept]{
\label{f:synth.a}
\includegraphics[width=0.44\textwidth]{res_stationary.pdf}
}
\subfloat[][Sudden drift]{
\label{f:synth.b}
\includegraphics[width=0.44\textwidth]{res_sudden.pdf}
}\\
\subfloat[][Incremental drift]{
\label{f:synth.c}
\includegraphics[width=0.44\textwidth]{res_incremental.pdf}
}
\subfloat[][Gradual drift]{
\label{f:synth.d}
\includegraphics[width=0.44\textwidth]{res_gradual.pdf}
}
\caption{\label{fig:synth}Results (classification accuracy over a sliding window of $200$ instances on synthetic streams. Notice that the vertical axes are scaled for greater visibility of separation.}
\end{figure*}
\subsubsection*{Hoeffding Trees are fast but conservative}
We observe how HTs grow conservatively (\Fig{f:synth.a}). This behaviour is intended by design, since they have no natural forgetting mechanism and thus it is important to make a statistically safe split (based on the Hoeffding bound).
Indeed, note after $t=7000$ accuracy jumps 10 percentage points; indicating the initial split.
This conservative approach provides strong confidence that we may produce tree equivalent to one built from a batch, but only within a single concept. It necessarily means that Hoeffding trees will struggle when the true target concept $\theta_t$ is a \emph{moving} target rather than a fixed point in concept space.
And we observe this: Figures \ref{f:synth.b}---\ref{f:synth.d} show how the performance of a standalone HT is damaged by concept drift (as opposed to SGD- and $k$NN-based methods which are able to recover more quickly. \cout{If a new split is made, recovery can be carried out to some extent, but unlikely to be a complete solution.}
\subsubsection*{Destructive adaptation is costly}
In the literature sophisticated concept-drift detectors and ensembles are used to counteract this disadvantage, and provide robust prediction in dynamic data streams. And we confirm that this approach is effective in many cases (as seen in \Fig{fig:difficult})
but at a significant cost:
\cout{Such approaches are not parsimonious, but rather overcome limitations by force of ensembles in a kind of creative destruction. We can see this this in \Fig{fig:syncremental}, where advanced methods (see \Tab{tab:methods} column 3 for respective parameterizations) including the adaptive forest of Hoeffding trees (RF-HT), are deployed on a stream of constant drift. Despite a state-of-the-art drift detection and ensemble adaptation scheme, this powerful ensemble is unable to achieve higher performance than a relatively simpler single-model SGD-based method. Whereas the ensemble involves ongoing destruction of decision trees in order to catch up with new dynamics of the stream, SGD adapts to the drift in an instance-by-instance fashion. Accuracy alone does not distinguish any of the three, methods, but the difference in}
the computational time (see \Tab{tab:time}) of the detect-and-reset approach clearly enunciates the overhead of destroying (resetting) and regrowing HTs constantly, so as to adapt to a changing concept.
\begin{figure*}[h]
\centering
\includegraphics[width=1.0\textwidth]{res_kincremental_A.pdf}
\caption{\label{fig:syncremental}An incremental drift scenario like that of \Fig{fig:synth} except that the drift is constant across the entire stream ($\tau_1=\tau_0$, and $\tau_2=T$ wrt \Tab{tab:synth}).}
\end{figure*}
\cout{
The synthetic data used in initial experiments is based on a rotating decision line, for illustration of several mechanisms. We also compare more powerful renditions of each approach on on real-world benchmark datasets and the RTG stream that is certainly expected to favor tree-based methods. Results are shown graphically in \Fig{fig:difficult} over a window, and tabulated in \Tab{tab:accuracy}.}
\cout{As specified above (\Sec{sec:proc}, \Tab{tab:methods}) we compare to the recent and state-of-the-art adaptive random forest (RF-HT) and self-adjusting memory $k$NN (SAM$k$NN); and we employ a relatively simple polynomial basis-function expansion for SGD (calling it thus PBF-SGD).}
\cout{The main goal of this work has not been to present a novel method but to investigate deeper on concept-drifting data streams and more effective and efficient methods of adaptation. Hence it need not be a concern to see that in several cases accuracy is often not significantly distinguishable from one method to another, as is the case on the benchmark datasets including the RTG stream. To the contrary, this is an intriguing result which backs up our argument -- a simple and fast learner is able to obtain state of the art performance. }
\cout{The literature shows HT-based methods performing strongly over a range of datasets, and this would seem to contradict our results. The explanation, we argue, is that SGD is in fact not inherently poorly suited to data streams (indeed -- we have shown the contrary), but most existing experiments were carried out using SGD in its simplest form (for example, as defined in \Tab{tab:methods} column 2). A justified parameterization and relatively simple feature engineering (polynomial basis functions) results in high performance
and hence shows that SGD has been underestimated.
}
\begin{figure*}[ht]
\centering
\subfloat[][Electricity]{
\includegraphics[width=0.90\textwidth]{res_elec_A.pdf}
}\\
\subfloat[][CoverType]{
\includegraphics[width=0.90\textwidth]{res_covtype_A.pdf}
}\\
\subfloat[][Random Tree Generated (RTG) stream]{
\includegraphics[width=0.90\textwidth]{res_rtg_A.pdf}
}
\caption{\label{fig:difficult} Average accuracy over sliding window of 200 for methods detailed in column 3 of \Tab{tab:methods}. For visualization, we plot only a subset of CoverType. See \Tab{tab:accuracy} for total accuracy over the streams.}
\end{figure*}
\subsubsection*{Buffer-based methods are limited}
Respective of its buffer size, $k$NN-methods can respond to drift by forgetting old instances (from old concepts) and taking in (i.e., learning from) new ones.
This mechanism allows it to recover quickly from drift (\Fig{f:synth.b}--\Fig{f:synth.d}). Nevertheless predictive power is always limited in proportion to the number of instances stored in this buffer and, as observable in \Subfig{f:synth.a}, sometimes this is insufficient (we note there is no upward trend here, as opposed to the other methods, despite more instances from the same concept). If buffer size is widened, performance can be higher, but adaptation to drift will take correspondingly longer or require explicit drift detection methods as with HT approaches.
\subsubsection*{SGD for Efficient Continuous Adaptation}
SGD is a simple method which has been around a long time. With a non-decayed learning rate, we find that it behaves as well as we hypothesized on synthetic data: it continues to learn a static concept better over time (in \Fig{f:synth.a} it recovers quickly from sudden and gradual drift, and its performance is almost unaffected under incremental drift where (as we see in \Fig{f:synth.c}) it is able to adapt continuously.
We suspect that SGD has not been widely considered in state-of-the-art data-stream evaluations because it performs poorly on real-world and complex data when deployed in an off-the-shelf manner, especially if the learning rate is decayed -- as is often the standard. However, we put together the PBF-SGD method from elementary components and find that it performs strongly in these scenarios (\Fig{fig:syncremental}, \Fig{fig:difficult}).
We do see that performance of the advanced/state-of-the-art methods (HT and $k$-NN based) is also competitive, as expected, yet it is crucial to emphasise the difference in computational performance (see \Tab{tab:time}): running time is up to an order of magnitude or more higher for the decision tree ensemble, compared to other methods; even greater than PBF-SGD, which has a feature space cubicly greater than the original.
\subsubsection*{An analysis of time and memory complexity}
The worst-case complexity is outlined in \Tab{tab:complexity} (for the vanilla methods, which does not take into account the additional overhead of ensembles and drift detectors nor basis expansion for PBF-SGD).
We can further remark computational time and memory expectations of SGD are constant across time (the expected running time is the same for each instance in the stream), as also with $k$NN (given a fixed batch size). On the other hand, HT costs are not constant, but continue to grow with the depth of the tree (the $\ell$ term in \Tab{tab:complexity}). This is an issue which as, to our knowledge, not been considered in depth in the literature: as trees in an ensemble grow and are reset under drift, time and space complexity fluctuates -- making practical requirements difficult to estimate precisely in advance. If there is no drift -- then the trees may, in theory, grow unbounded and use up all available memory.
\begin{table}
\centering
\caption{\label{tab:accuracy}Overall accuracy (average over entire stream) of methods; seen also in experiments of \Fig{fig:syncremental} (regarding the Synthetic stream) and \Fig{fig:difficult} for the others.}
\begin{tabular}{llll}
\hline
& SAM$k$NN & PBF-SGD & RF-HT \\
\hline
Electricity & 79.8 & 85.9 & 86.2 \\
RTG & 78.8 & 81.8 & 77.9 \\
CoverType & 93.3 & 92.6 & 93.9 \\
Synthetic & 96.0 & 95.1 & 93.6 \\
\hline
\end{tabular}
\end{table}
\begin{table}[h]
\centering
\caption{\label{tab:complexity}An outline of time and space complexity for different methods, with a moving window of $w$ examples, taking the $k$ nearest neighbors (for $k$NN), in a problem of $d$ attributes. For HT, $\ell$ is the number of leaves, but note that this is $O(n)$ in the worst case. To simplify, we have considered a binary ($2$ class) problem with one split considered per attribute in the case of trees.}
\begin{tabular}{lll}
\hline
Method & Time & Space \\
\hline
$k$NN & $O(wdk)$ & $O(wd)$ \\
HT & $O(d)$ & $O(\ell d)$ \\
SGD & $O(d)$ & $O(d)$ \\
\hline
\end{tabular}
\end{table}
\cout{Furthermore, we add that there is no theoretical limitation to gradient descent methods in terms of concept modelling -- even one additional feature layer of non-linear functions can be a universal approximator \cite{UniversalApproxRBF}. Therefore, with the right basis functions in sufficient quantity it is possible to represent any concept.}
\begin{table}[ht]
\centering
\includegraphics[width=0.5\columnwidth]{time_plot.pdf}
\caption{\label{tab:time}Total running time under prequential evaluation (in seconds) on a selection of the datasets. We compare SGD with both polynomial of degree 2 and 3 (PBF-SGD(2) and (3), respectively) -- for sake of comparison. \textsf{Synth} refers to the data of \Fig{fig:syncremental}. The time including the initial block (which is not evaluated in terms of accuracy). Note that for all timing experiments we only considered the first 10,000 instances.}
\end{table}
\subsubsection*{Limitations and Further Considerations}
We need to acknowledge that an incremental decision-tree based approach continues to be a powerful competitor, and more efficient implementations exist than the Python framework we used in this work. Furthermore, it is clear that more work is needed to investigate performance under sudden and gradual and mixed types of drift. There are other state-of-the-art HT methods as well as $k$NN methods which could be additionally experimented with.
However, we have shown analytically and empirically that the most desirable and efficient option is supported naturally by gradient descent (and by extension, neural networks), given certain constraints wrt the learning rate, namely that is significantly greater than zero. This indicates that more attention in the streaming literature should be paid to neural networks, in particularly on ways to parameterize them effectively for data-stream scenarios, so that they are more easy to deploy.
In general it is a more promising strategy to model the drift and pre-empt its development, rather than waiting for an indication that drift has already occurred and following such an indication retrospectively, to reset models that have been previously built.
\section{Conclusions}
\label{sec:conclusion}
The literature for data streams is well furnished with a great number and diversity of ensembles and drift-detection methodologies for employing incremental decision tree learners such as Hoeffding trees. These methods continue to obtain success in empirical evaluations. In this paper we have taken a closer analytical look at the reasons for this performance, but also we have been able to highlight its limitations, namely the cost involved of its performance under sustained drift, where it forced to carry out a continued destructive adaptation.
In particular, we showed that concept-drifting data streams can be treated as time series, which in turn suggests predictability, thus encouraging an approach of tracking and estimating the evolution of a concept, and carrying out continuous adaptation to concept drift. To demonstrate this we derived an appropriate approach based on stochastic gradient descent. The method we used was simple, but results clearly supported our analytical and theoretical argument which carries important implications: gradient-based methods offer and effective and parsimonious way to deal with dynamic concept drifting data streams and should be considered more seriously in future research in this area. This is especially true with the advent of more powerful and easy-to-deploy neural networks and recent improvements in gradient descent.
\cout{In this work, we have made the case for pre-emptive adaptation to concept-drift in data streams. This is as opposed to the commonly-taken method of drift detection and resetting models, which adapts in a reactive and destructive way by resetting models (such as Hoeffding trees) which are already built. Initializing new models inevitably leads to high variance, which can be counteracted by large and complex ensembles. Constant-forgetting methods (namely, $k$NN-based) do not need explicit drift detection, but these exhibit other disadvantages linked to the unlimited nature of a data stream.
}
\cout{We have put forward the view that all concept-drifting streams are time series, and shown that they can benefit from being treated as such. In particular, following this insight, we derived a stochastic gradient descent (SGD) approach. SGD was known in the data-stream literature but we demonstrated in a new light its capacity for adaption under concept drift, and thus showed that it has been undervalued. In analytic and empirical results, we highlighted certain disadvantages of Hoeffding tree methods which had not previously been considered in depth in the literature.}
\cout{Rather than a relatively destructive and computationally intensive detect-and-reset ensemble, the approach we employed follows and adapts to drift without an external drift detection mechanism, and without resetting models or sub-models (unlike Hoeffding-tree based methods) and is not limited to a relatively small window of instances (as in $k$NN-based methods). We obtained state-of-the-art performance comparable to these other methods on a range of data-stream sources. The success obtained indicates that this approach deserves more attention and analysis from the data-streams community, especially for domains where parsimonious models are strongly desired.
}
\cout{
In future work we will consider more complex drift scenarios such as oscillating drift, mixtures of drift occurring simultaneously (such as gradual and incremental drift occurring together). In particular, we will explore in greater depth the strategies we outlined for gradual and abrupt drift. Our study already indicates that further investigation along these lines may offer promising results.
}
In the future will investigate more complex scenarios involving oscillating and mixtures of different times of drift, and experiment with more state-of-the-art gradient-descent approaches, such as deep learning. Our study already indicates that further investigation along these lines will yield promising results.
\bibliographystyle{plain}
| {'timestamp': '2018-10-05T02:12:50', 'yymm': '1810', 'arxiv_id': '1810.02266', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02266'} | arxiv |
\section{Introduction} \label{sec:intro}
\begin{figure*}[t]
\centering
\includegraphics[scale=0.36]{emotion_shift}
\caption[]{Emotion shift of speakers in a dialogue in comparison with their previous emotions.}
\label{fig:emoc}
\end{figure*}
\begin{figure}[t]
\centering
\includegraphics[width=\linewidth]{multimodal_examples.png}
\caption[]{Importance of multimodal cues. Green shows primary modalities responsible for sentiment and emotion.}
\label{fig:multimodal_examples}
\end{figure}
With the rapid growth of Artificial Intelligence (AI), multimodal emotion recognition has become a major research topic, primarily due to its potential applications in many challenging tasks, such as dialogue generation, user behavior understanding, multimodal interaction, and others. A conversational emotion recognition system can be used to generate appropriate responses by analyzing user emotions~\cite{zhou2017emotional,rashkin2018know}.
Although significant research work has been carried out on multimodal emotion recognition using audio, visual, and text modalities~\citep{zadeh2016deep,wollmer2013youtube}, significantly less work has been devoted to emotion recognition in conversations (ERC). One main reason for this is the lack of a large multimodal conversational dataset.
According to~\citet{poria2019emotion}, ERC presents several challenges such as conversational context modeling, emotion shift of the interlocutors, and others, which make the task more difficult to address. Recent work proposes solutions based on multimodal memory networks~\cite{hazarika2018conversational}. However, they are mostly limited to dyadic conversations, and thus not scalable to ERC with multiple interlocutors. This calls for a multi-party conversational data resource that can encourage research in this direction.
In a conversation, the participants' utterances generally depend on their conversational context. This is also true for their associated emotions. In other words, the context acts as a set of parameters that may influence a person to speak an utterance while expressing a certain emotion. Modeling this context can be done in different ways, e.g., by using recurrent neural networks (RNNs) and memory networks~\cite{hazarika2018conversational,porcon,serban2017hierarchical}. Figure~\ref{fig:emoc} shows an example where the speakers change their emotions (emotion shifts) as the dialogue develops. The emotional dynamics here depend on both the previous utterances and their associated emotions. For example, the emotion shift in utterance eight (in the figure) is hard to determine unless cues are taken from the facial expressions and the conversational history of both speakers. Modeling such complex inter-speaker dependencies is one of the major challenges in conversational modeling.
Conversation in its natural form is multimodal. In dialogues, we rely on others' facial expressions, vocal tonality, language, and gestures to anticipate their stance. For emotion recognition, multimodality is particularly important. For the utterances with language that is difficult to understand, we often resort to other modalities, such as prosodic and visual cues, to identify their emotions. Figure~\ref{fig:multimodal_examples} presents examples from the dataset where the presence of multimodal signals in addition to the text itself is necessary in order to make correct predictions of their emotions and sentiments.
Multimodal emotion recognition of sequential turns encounters several other challenges. One such example is the classification of short utterances. Utterances like ``\textit{yeah}'', ``\textit{okay}'', ``\textit{no}'' can express varied emotions depending on the context and discourse of the dialogue. However, due to the difficulty of perceiving emotions from text alone, most models resort to assigning the majority class (e.g., \textit{non-neutral} in EmotionLines). Approximately $42\%$ of the utterances in MELD are shorter than five words. We thus provide access to the multimodal data sources for each dialogue and posit that this additional information would benefit the emotion recognition task by improving the context representation and supplementing the missing or misleading signals from other modalities. Surplus information from attributes such as the speaker's facial expressions or intonation in speech could guide models for better classification. We also provide evidence for these claims through our experiments.
The development of conversational AI thus depends on the use of both contextual and multimodal information. The publicly available datasets for multimodal emotion recognition in conversations -- IEMOCAP and SEMAINE -- have facilitated a significant number of research projects, but also have limitations due to their relatively small number of total utterances and the lack of multi-party conversations. There are also other multimodal emotion and sentiment analysis datasets, such as MOSEI~\cite{zadeh2018multimodal}, MOSI~\cite{zadeh2016multimodal}, and MOUD~\cite{perez2013utterance}, but they contain individual narratives instead of dialogues. On the other hand, EmotionLines~\citep{chen2018emotionlines} is a dataset that contains dialogues from the popular TV-series \textit{Friends} with more than two speakers. However, EmotionLines can only be used for textual analysis as it does not provide data from other modalities.
In this work, we extend, improve, and further develop the EmotionLines dataset for the multimodal scenario. We propose the \textit{Multimodal EmotionLines Dataset} (MELD), which includes not only textual dialogues, but also their corresponding visual and audio counterparts. This paper makes several contributions:
\begin{itemize}[leftmargin=*]
\itemsep0em
\item MELD contains multi-party conversations that are more challenging to classify than dyadic variants available in previous datasets.
\item There are more than 13,000 utterances in MELD, which makes our dataset nearly double the size of existing multimodal conversational datasets.
\item MELD provides multimodal sources and can be used in a multimodal affective dialogue system for enhanced grounded learning.
\item We establish a strong baseline, proposed by \citet{majumder2018dialoguernn}, which is capable of emotion recognition in multi-party dialogues by inter-party dependency modeling.
\end{itemize}
The remainder of the paper is organized as follows: Section~\ref{sec:emotionlines} illustrates the EmotionLines dataset; we then present MELD in Section~\ref{sec:meld}; strong baselines and experiments are elaborated in Section~\ref{sec:experiment}; future directions and applications of MELD are covered in Section~\ref{sec:future} and~\ref{sec:appli}, respectively; finally, Section~\ref{sec:conclusion} concludes the paper.
\section{EmotionLines Dataset}
\label{sec:emotionlines}
The MELD dataset has evolved from the EmotionLines dataset developed by \citet{chen2018emotionlines}. EmotionLines contains dialogues from the popular sitcom \textit{Friends}, where each dialogue contains utterances from multiple speakers.
EmotionLines was created by crawling the dialogues from each episode and then grouping them based on the number of utterances in a dialogue into four groups of [5, 9], [10, 14], [15, 19], and [20, 24] utterances respectively. Finally, 250 dialogues were sampled randomly from each of these groups, resulting in the final dataset of 1,000 dialogues.
\subsection{Annotation}
The utterances in each dialogue were annotated with the most appropriate emotion category. For this purpose, Ekman's six universal emotions (\emph{Joy, Sadness, Fear, Anger, Surprise, and Disgust}) were considered as annotation labels. This annotation list was extended with two additional emotion labels: \emph{Neutral} and \textit{Non-Neutral}.
Each utterance was annotated by five workers from the Amazon Mechanical Turk (AMT) platform. A majority voting scheme was applied to select a final emotion label for each utterance. The overall Fleiss' kappa score of this annotation process was $0.34$.
\begin{table}[h]
\centering
\resizebox{\linewidth}{!}{
\begin{tabular}{c|c|c|c|c|c|c}
\hlinewd{1.5pt}
\multirow{2}{*}{Dataset}&\multicolumn{3}{c|}{$\#$ Dialogues}&\multicolumn{3}{c}{$\#$ Utterances}\\
&train&dev&test&train&dev&test\\
\hlinewd{0.8pt}
EmotionLines &720&80&200&10561&1178&2764\\
MELD &1039&114&280&9989&1109&2610\\
\hlinewd{0.8pt}
\end{tabular}
}
\caption{Comparison between the original EmotionLines dataset and MELD.}
\label{tab:data}
\end{table}
\section{Multimodal EmotionLines Dataset (MELD)}
\label{sec:meld}
We start the construction of the MELD corpus by extracting the starting and ending timestamps of all utterances from every dialogue in the EmotionLines dataset. To accomplish this, we crawl through the subtitles of all the episodes and heuristically extract the respective timestamps. In particular, we enforce the following constraints:
\begin{enumerate}[leftmargin=*]
\itemsep0em
\item Timestamps of the utterances in a dialogue must be in an increasing order.
\item All the utterances in a dialogue have to belong to the same episode and scene.
\end{enumerate}
These constraints revealed a few outliers in EmotionLines where some dialogues span across scenes or episodes. For example, the dialogue in Table~\ref{tab:errorEmo} contains two natural dialogues from episode 4 and 20 of season 6 and 5, respectively. We decided to filter out these anomalies, thus resulting in a different number of total dialogues in MELD as compared to EmotionLines (see Table~\ref{tab:data}).
Next, we employ three annotators to label each utterance, followed by a majority voting to decide the final label of the utterances. We drop a few utterances where all three annotations were different, and also remove their corresponding dialogues to maintain coherence. A total of 89 utterances spanning 11 dialogues fell under this category.
Finally, after obtaining the timestamp of each utterance, we extract their corresponding audio-visual clips from the source episode followed by the extraction of audio content from these clips. We format the audio files as 16-bit PCM WAV files for further processing. The final dataset includes visual, audio, and textual modalities for each utterance.\footnote{We consulted a legal office to verify that the usage and distribution of very short length videos fall under the \textit{fair use} category.}
\begin{table*}[h]
\centering
\small
\resizebox{\linewidth}{!}{
\begin{tabular}{ccccc}
\hlinewd{1.5pt}
Episode&Utterance& Speaker& Emotion& Sentiment \\
\hlinewd{0.8pt}
\parbox[c]{2mm}{\multirow{6}{*}{\rotatebox[origin=c]{90}{S6.E4}}}&What are you talkin’ about? I never left you! You’ve always been my agent! & Joey & surprise & negative \\
&Really?! & Estelle & surprise & positive\\
&Yeah! & Joey & joy & positive\\
&Oh well, no harm, no foul. & Estelle & neutral & neutral\\
\hdashline
\parbox[t]{2mm}{\multirow{3}{*}{\rotatebox[origin=c]{90}{S5.E20}}}&\textcolor{maroon}{Okay, you guys free tonight?} & \textcolor{maroon}{Gary} & \textcolor{maroon}{neutral}&\textcolor{maroon}{neutral} \\
&\textcolor{maroon}{Yeah!!} & \textcolor{maroon}{Ross} & \textcolor{maroon}{joy} & \textcolor{maroon}{positive}\\
&\textcolor{maroon}{Tonight? You-you didn't say it was going to be at nighttime.} & \textcolor{maroon}{Chandler} & \textcolor{maroon}{surprise}& \textcolor{maroon}{negative}\\
\hlinewd{.8pt}
\end{tabular}
}
\caption{A dialogue in EmotionLines where utterances from two different episodes are present. The first four utterances in this dialogue have been taken from episode 4 of season 6. The last three utterances in red font are from episode 20 of season 5.}
\label{tab:errorEmo}
\end{table*}
\subsection{Dataset Re-annotation}
The utterances in the original EmotionLines dataset were annotated by looking only at the transcripts. However, due to our focus on multimodality, we re-annotate all the utterances by asking the three annotators to also look at the available video clip of the utterances. We then use majority-voting to obtain the final label for each utterance.
The annotators were graduate students with high proficiency in English speaking and writing. Before starting the annotation, they were briefed about the annotation process with a few examples.
We achieve an overall Fleiss' kappa score of $0.43$ which is higher than the original EmotionLines annotation whose kappa score was $0.34$ (kappa of IEMOCAP annotation process was $0.4$), thus suggesting the usefulness of the additional modalities during the annotation process.
2,772 utterances in the EmotionLines dataset were labeled as \emph{non-neutral} where the annotators agreed that the emotion is not neutral but they could not reach agreement regarding the correct emotion label. This hampers classification, as the \emph{non-neutral} utterance space and the other emotion-label spaces get conflated. In our case, we remove the utterances where the annotators fail to reach an agreement on the definite emotion label.
The number of disagreements in our annotation process is 89, which is much lower than the 2,772 disagreements in EmotionLines, reflecting again the annotation improvement obtained through a multimodal dataset. Table~\ref{tab:annotation} shows examples of utterances where the annotators failed to reach consensus.
\begin{table}[b]
\small
\resizebox{\linewidth}{!}{
\begin{tabular}{cccc}
\hlinewd{1.5pt}
Utterance & Annotator 1 & Annotator 2 & Annotator 3\\
\hlinewd{0.8pt}
You know? Forget it! & sadness & disgust & anger \\
Oh no-no, give me & \multirow{2}{*}{anger} & \multirow{2}{*}{sadness} & \multirow{2}{*}{neutral} \\
some specifics. & & & \\
I was surprised to see a & \multirow{2}{*}{surprise} & \multirow{2}{*}{anger} & \multirow{2}{*}{joy}\\
kangaroo in a World War epic. & & &\\
Or, call an ambulance. & anger & surprise & neutral\\
\hlinewd{0.8pt}
\end{tabular}
}
\caption{Some examples of the utterances for which annotators could not reach consensus.}
\label{tab:annotation}
\end{table}
Table~\ref{tab:emomeldvsemotionlines} shows the label-wise comparison between EmotionLines and MELD dataset. For most of the utterances in MELD, the annotations match the original annotations in EmotionLines. Yet, there exists a significant amount of samples whose utterances have been changed in the re-annotation process. For example, the utterance \emph{This guy fell asleep!} (see Table~\ref{tab:emovsmeld}), was labeled as \emph{non-neutral} in EmotionLines but after viewing the associated video clip, it is correctly re-labeled as \emph{anger} in MELD.
The video of this utterance reveals an angry and frustrated facial expression along with a high vocal pitch, thus helping to recognize its correct emotion. The annotators of EmotionLines had access to the context, but this was not sufficient, as the availability of additional modalities can sometime bring more information for the classification of such instances.
These scenarios justify both \textit{context} and \textit{multimodality} to be important aspects for emotion recognition in conversation.
\begin{table}[t]
\centering
\small
\resizebox{\linewidth}{!}{
\begin{tabular}{cc|ccc|ccc}
\hlinewd{1.5pt}
&& \multicolumn{3}{c}{{EmotionLines}} & \multicolumn{3}{c}{{MELD}} \\
\cline{3-8}
\multicolumn{2}{c|}{{Categories}} & Train & Dev & Test & Train & Dev & Test \\
\hlinewd{0.8pt}
\parbox[t]{2mm}{\multirow{7}{*}{\rotatebox[origin=c]{90}{\scriptsize{Emotion}}}}&anger & 524 & 85 & 163 & 1109 & 153 & 345 \\
&disgust & 244 & 26 & 68 & 271 & 22 & 68 \\
&fear & 190 & 29 & 36 & 268 & 40 & 50 \\
&joy & 1283 & 123 & 304 & 1743 & 163 & 402 \\
&neutral & 4752 & 491 & 1287 & 4710 & 470 & 1256 \\
&sadness & 351 & 62 & 85 & 683 & 111 & 208 \\
&surprise & 1221 & 151 & 286 & 1205 & 150 & 281 \\
\hlinewd{0.8pt}
\parbox[t]{2mm}{\multirow{3}{*}{\rotatebox[origin=c]{90}{\scriptsize{Sentiment}}}}&negative&-&-&-& 2945 & 406 & 833 \\
& neutral &-&-&-& 4710 & 470 & 1256 \\
&positive &-&-&-& 2334 & 233 & 521 \\
\hlinewd{0.8pt}
\end{tabular}
}
\caption{Emotion and Sentiment distribution in MELD vs. EmotionLines.}
\label{tab:emomeldvsemotionlines}
\end{table}
\paragraph{Timestamp alignment.}
There are many utterances in the subtitles that are grouped within identical timestamps in the subtitle files. In order to find the accurate timestamp for each utterance, we use a transcription alignment tool \emph{Gentle},\footnote{\scriptsize{\url{http://github.com/lowerquality/gentle}}} which automatically aligns a transcript with the audio by extracting word-level timestamps from the audio (see Table~\ref{tab:pruning}). In \cref{tab:dataformat},
we show the final format of the MELD dataset.
\paragraph{Dyadic MELD.} We also provide another version of MELD where all the non-extendable contiguous dyadic sub-dialogues of MELD are extracted. For example, let a three-party dialogue in MELD with speaker ids $1,2,3$ have their turns in the following order: $[1,2,1,2,3,2,1,2]$.
From this dialogue sequence, dyadic MELD will have the following sub-dialogues as samples: $[1,2,1,2], [2,3,2]$ and $[2,1,2]$.
However, the reported results in this paper are obtained using only the multiparty variant of MELD.
\begin{table}[h]
\resizebox{\linewidth}{!}{
\begin{tabular}{cccc}
\hlinewd{1.5pt}
Utterance & Speaker & MELD & EmotionLines \\
\hlinewd{0.8pt}
I'’m so sorry! & Chandler & sadness & sadness \\
Look! & Chandler & surprise & surprise \\
This guy fell asleep! & Chandler & \textcolor{maroon}{anger} & non-neutral \\
\hlinewd{0.8pt}
\end{tabular}
}
\caption{Difference in annotation between EmotionLines and MELD.
}
\label{tab:emovsmeld}
\end{table}
\begin{table*}[htbp!]
\small
\centering
\begin{tabular}{ccccccc}
\hlinewd{1.5pt}
\multicolumn{3}{c}{\text{}} & \multicolumn{2}{c}{{Incorrect Splits}} & \multicolumn{2}{c}{{Corrected Splits}} \\
\cline{2-7}
{Utterance} & {Season} & {Episode} & Start Time & End Time & Start Time & End Time \\
\hlinewd{0.8pt}
Chris says they're closing & \multirow{2}{*}{3} & \multirow{2}{*}{6} & \multirow{2}{*}{00:05:57,023} & \multirow{2}{*}{00:05:59,691} & \multirow{2}{*}{00:05:57,023} & \multirow{2}{*}{00:05:58,734} \\
down the bar. &&&&&& \\
No way! & 3 & 6 & 00:05:57,023 & 00:05:59,691 & 00:05:58,734 & 00:05:59,691 \\
\hlinewd{0.8pt}
\end{tabular}
\caption{Example of timestamp alignment using the Gentle alignment tool.}
\label{tab:pruning}
\end{table*}
\subsection{Dataset Exploration}
As mentioned before, we use seven emotions for the annotation, i.e., \textit{anger, disgust, fear, joy, neutral, sadness}, and \textit{surprise}, across the training, development, and testing splits (see Table~\ref{tab:emomeldvsemotionlines}). It can be seen that the emotion distribution in the dataset is expectedly non-uniform with the majority emotion being \emph{neutral}.
\begin{table*}[h]
\small
\resizebox{\linewidth}{!}{
\begin{tabular}{ccccccccc}
\hlinewd{1.5pt}
Utterance & Speaker & Emotion & D\_ID & U\_ID & Season & Episode & StartTime & EndTime \\
\hlinewd{0.8pt}
But then who? The waitress I went out & \multirow{2}{*}{Joey} & \multirow{2}{*}{surprise} & \multirow{2}{*}{1} & \multirow{2}{*}{0} & \multirow{2}{*}{9} & \multirow{2}{*}{23} & \multirow{2}{*}{00:36:40,364} & \multirow{2}{*}{00:36:42,824}\\
with last month? &&&&&&&&\\
You know? Forget it! & Rachel & sadness & 1 & 1 & 9 & 23 & 00:36:44,368 & 00:36:46,578 \\
\hlinewd{0.8pt}
\end{tabular}
}
\caption{MELD dataset format for a dialogue. Notations: D\_ID = dialogue ID, U\_ID = utterance ID. StartTime and EndTime are in hh:mm:ss,ms format.
}
\label{tab:dataformat}
\end{table*}
We have also converted these fine-grained emotion labels into more coarse-grained sentiment classes by considering \emph{anger, disgust, fear, sadness} as \emph{negative}, \emph{joy} as \emph{positive}, and \emph{neutral} as \emph{neutral} sentiment-bearing class. \emph{Surprise} is an example of a complex emotion which can be expressed with both positive and negative sentiment. The three annotators who performed the utterance annotation further annotated the \textit{surprise} utterances into either positive or negative sentiment classes. The entire sentiment annotation task reaches a Fleiss' kappa score of 0.91. The distribution of \emph{positive, negative, neutral} sentiment classes is given in Table~\ref{tab:emomeldvsemotionlines}.
\begin{table}[b]
\centering
\small
\resizebox{\linewidth}{!}{
\begin{tabular}{cccc}
\hlinewd{1.5pt}
{MELD Statistics} & {Train} & {Dev} & {Test} \\
\hlinewd{0.8pt}
{\# of modalities} & \{a,v,t\} & \{a,v,t\} & \{a,v,t\}\\
{\# of unique words} & 10,643 & 2,384 & 4,361 \\
{Avg./Max utterance length} & 8.0/69 & 7.9/37 & 8.2/45 \\
{\# of dialogues} & 1039 & 114 & 280 \\
{\# of dialogues dyadic MELD} &2560 &270 &577\\
{\# of utterances} & 9989 & 1109 & 2610 \\
{\# of speakers} & 260 & 47 & 100 \\
{Avg. \# of utterances per dialogue} & 9.6 & 9.7 & 9.3 \\
{Avg. \# of emotions per dialogue} & 3.3 & 3.3 & 3.2 \\
{Avg./Max \# of speakers per dialogue} &2.7/9 &3.0/8 & 2.6/8 \\
{\# of emotion shift} & 4003 & 427 & 1003 \\
{Avg. duration of an utterance} & 3.59s & 3.59s & 3.58s \\
\hlinewd{0.8pt}
\end{tabular}
}
\caption{Dataset Statistics. \{a,v,t\} = \{audio, visual, text\}}
\label{tab:datasetstat}
\end{table}
Table~\ref{tab:datasetstat} presents several key statistics of the dataset. The average utterance length -- i.e. number of words in an utterance -- is nearly the same across training, development, and testing splits. On average, three emotions are present in each dialogue of the dataset. The average duration of an utterance is $3.59$ seconds. The emotion shift of a speaker in a dialogue makes emotion recognition task very challenging. \begin{figure*}[htbp]
\centering
\includegraphics[width=0.81\linewidth]{character_dist}
\caption{Character distribution across MELD.}
\label{fig:character_dist}
\end{figure*}
We observe that the number of such emotion shifts in successive utterances of a speaker in a dialogue is very frequent: $4003$, $427$, and $1003$ in train/dev/test splits, respectively. Figure~\ref{fig:emoc} shows an example where speaker's emotion changes with time in the dialogue.
\paragraph{Character Distribution.}
In Figure~\ref{fig:character_dist}, we present the distributional details of the primary characters in MELD. Figure a and b illustrate the distribution across the emotion and sentiment labels, respectively. Figure c shows the overall coverage of the speakers across the dataset. Multiple infrequent speakers ($<1\%$ utterances) are grouped as \textit{Others}.
\subsection{Related Datasets}
\label{sec:rel}
Most of the available datasets in multimodal sentiment analysis and emotion recognition are non-conversational. MOSI~\cite{zadeh2016multimodal}, MOSEI~\cite{zadeh2018multimodal}, and MOUD~\cite{perez2013utterance} are such examples that have drawn significant interest from the research community. On the other hand, IEMOCAP and SEMAINE are two popular dyadic conversational datasets where each utterance in a dialogue is labeled by emotion.
\textbf{The SEMAINE Databas
}
is an audiovisual database created for building agents that can engage a person in a sustained and emotional conversation~\cite{mckeown2012semaine}. It consists of interactions involving a \textit{human} and an \textit{operator} (either a machine or a person simulating a machine). The dataset contains 150 participants, 959 conversations, each lasting around 5 minutes. A subset of this dataset was used in AVEC 2012's \textit{fully continuous sub-challenge}~\cite{schuller2012avec} that requires predictions of four continuous affective dimensions: \textit{arousal, expectancy, power,} and \textit{valence}. The gold annotations are available for every $0.2$ second in each video for a total of $95$ videos comprising $5,816$ utterances.
\textbf{The Interactive Emotional Dyadic Motion Capture Database (IEMOCAP
} consists of videos of dyadic conversations among pairs of 10 speakers spanning 10 hours of various dialogue scenarios~\cite{iemocap}. Videos are segmented into utterances with annotations of fine-grained emotion categories: \textit{anger, happiness, sadness, neutral, excitement,} and \textit{frustration}. IEMOCAP also provides continuous attributes: \textit{activation}, \textit{valence}, and \textit{dominance}. These two types of discrete and continuous emotional descriptors facilitate the complementary insights about the emotional expressions of humans and emotional communications between people. The labels in IEMOCAP were annotated by at least three annotators per utterance and self-assessment manikins (SAMs) were also employed to evaluate the corpus~\cite{bradley1994measuring}.
\subsection{Comparison with MELD}
\label{sec:comparison}
\begin{table}[b]
\centering
\resizebox{\linewidth}{!}{
\begin{tabular}{c|c|c|c|c|c|c|c}
\hlinewd{1.5pt}
\multirow{2}{*}{Dataset}&Type&\multicolumn{3}{c|}{$\#$ dialogues}&\multicolumn{3}{c}{$\#$ utterances}\\
&&train&dev&test&train&dev&test\\
\hlinewd{0.8pt}
IEMOCAP&acted&\multicolumn{2}{c|}{120}&31&\multicolumn{2}{c|}{5810}&1623\\
SEMAINE&acted&\multicolumn{2}{c|}{58}&22&\multicolumn{2}{c|}{4386}&1430\\
MELD&acted&1039&114&280& 9989& 1109& 2610\\
\hlinewd{.8pt}
\end{tabular}
}
\caption{Comparison among IEMOCAP, SEMAINE, and proposed MELD datasets}
\label{tab:compare}
\end{table}
Both resources mentioned above are extensively used in this field of research and contain settings that are aligned to the components of MELD. However, MELD is different in terms of both complexity and quantity.
Both IEMOCAP and SEMAINE contain dyadic conversations, wherein the dialogues in MELD are multi-party.
Multi-party conversations are more challenging compared to dyadic. They provide a flexible setting where multiple speakers can engage. From a research perspective, such availability also demands proposed dialogue models to be scalable towards multiple speakers.
MELD also includes more than 13000 emotion labeled utterances, which is nearly double the annotated utterances in IEMOCAP and SEMAINE. Table~\ref{tab:compare} provides information on the number of available dialogues and their constituent utterances for all three datasets, i.e., IEMOCAP, SEMAINE, and MELD.
\cref{tab:IEMOCAPvsMELD} shows the distribution for common emotions as well as highlights a few key statistics of IEMOCAP and MELD.
\begin{table*}[h!]
\centering
\resizebox{\linewidth}{!}{
\begin{tabular}{c|c|c|c|c|c|c|c|c|c}
\hlinewd{1.5pt}
\multirow{3}{*}{Dataset}&\multicolumn{6}{c|}{ Emotions}&\multicolumn{3}{c}{Other Statistics}\\
\cline{2-10}
&{Happy/Joy} & {Anger} & {Disgust} &{Sadness} &{Surprise} &{Neutral}&\begin{tabular}{cc}&Avg.\\ &utterence length\end{tabular}&\begin{tabular}{cc}&$\#$Unique\\& words\end{tabular}&\begin{tabular}{cc}&Avg.\\ &conversation length\end{tabular}\\
\hlinewd{0.8pt}
IEMOCAP&648&1103&2&1084&107&1708&15.8&3,598&49.2\\
MELD&2308&1607&361&1002&1636&6436&8.0&10,643&9.6\\
\hlinewd{.8pt}
\end{tabular}
}
\caption{Comparison among IEMOCAP and proposed MELD datasets.}
\label{tab:IEMOCAPvsMELD}
\end{table*}
\section{Experiments}
\label{sec:experiment}
\subsection{Feature Extraction}
\label{sec:feature_extraction}
We follow \citet{porcon} to extract features for each utterance in MELD. For textual features, we initialize each token with pre-trained 300-dimensional GloVe vectors~\cite{pennington2014glove} and feed them to a 1D-CNN to extract 100 dimensional textual features. For audio, we use the popular toolkit openSMILE~\cite{eyben2010opensmile}, which extracts 6373 dimensional features constituting several low-level descriptors and various statistical functionals of varied vocal and prosodic features.
As the audio representation is high dimensional, we employ L2-based feature selection with sparse estimators, such as SVMs, to get a dense representation of the overall audio segment. For the baselines, we do not use visual features, as video-based speaker identification and localization is an open problem. Bimodal features are obtained by concatenating audio and textual features.
\subsection{Baseline Models}
\label{sec:baseline_models}
To provide strong benchmarks for MELD, we perform experiments with multiple baselines. Hyperparameter details for each baseline
can be found at \url{http://github.com/senticnet/meld}.
\textbf{text-CNN} applies CNN to the input utterances without considering the context of the conversation~\cite{kim2014convolutional}. This model represents the simplest baseline which does not leverage context or multimodality in its approach.
\textbf{bcLSTM} is a strong baseline proposed by~\citet{porcon}, which represents context using a bi-directional RNN. It follows a two-step hierarchical process that models uni-modal context first and then bi-modal context features. For unimodal text, a CNN-LSTM model extracts contextual representations for each utterance taking the GloVe embeddings as input. For unimodal audio, an LSTM model gets audio representations for each audio utterance feature vector. Finally, the contextual representations from the unimodal variants are supplied to the bimodal model for classification. bcLSTM does not distinguish among different speakers and models a conversation as a single sequence.
\textbf{DialogueRNN} represents the current state of the art for conversational emotion detection~\cite{majumder2018dialoguernn}. It is a strong baseline with effective mechanisms to model context by tracking individual speaker states throughout the conversation for emotion classification. DialogueRNN is capable of handling multi-party conversation so it can be directly applied on MELD. It employs three stages of gated recurrent units (GRU)~\cite{DBLP:journals/corr/ChungGCB14} to model emotional context in conversations. The spoken utterances are fed into two GRUs: \textit{global} and \textit{party GRU} to update the context and speaker state, respectively. In each turn, the party GRU updates its state based on 1) the utterance spoken, 2) the speaker's previous state, and 3) the conversational context summarized by the global GRU through an attention mechanism. Finally, the updated speaker state is fed into the \textit{emotion GRU} which models the emotional information for classification. Attention mechanism is used on top of the \textit{emotion GRU} to leverage contextual utterances by different speakers at various distances. To analyze the role of multimodal signals, we analyze DialogueRNN and bcLSTM on MELD for both uni and multimodal settings.
Training involved usage of class weights to alleviate imbalance issues.
\subsection{Results}
We provide results for the two tasks of sentiment and emotion classification on MELD. Table~\ref{tab:sentiment_results} shows the performance of sentiment classification by using DialogueRNN, whose multimodal variant achieves the best performance (67.56\% F-score) surpassing multimodal bcLSTM (66.68\% F-score). Multimodal DialogueRNN also outperforms its unimodal counterparts. However, the improvement due to fusion is about 1.4\% higher than the textual modality which suggests the possibility of further improvement through better fusion mechanisms. The textual modality outperforms the audio modality by about 17\%, which indicates the importance of spoken language in sentiment analysis. For positive sentiment, audio modality performs poorly. It would be interesting to analyze the clues specific to positive sentiment bearing utterances in MELD that the audio modality could not capture. Future work should aim for enhanced audio feature extraction schemes to improve the classification performance.
\begin{table*}[t!]
\centering
\scalebox{0.85}{
\begin{tabular}{cc|cccccccc}
\hlinewd{1.5pt}
\multicolumn{2}{c|}{\multirow{2}{*}{Models}}&\multicolumn{8}{c}{{Emotions}}\\\cline{3-10}
&& anger & disgust & fear & joy & neutral & sadness & surprise& w-avg.\\
\hlinewd{0.8pt}
\multicolumn{2}{c|}{text-CNN} & 34.49 & 8.22 & 3.74 & 49.39 & 74.88 & 21.05 & 45.45 & 55.02 \\ \cline{1-2}
\multirow{1}{*}{cMKL}&text+audio &39.50 &16.10 &3.75 &51.39 &72.73 &23.95 &46.25 & 55.51 \\ \cline{1-2}
\multirow{3}{*}{bcLSTM}&text &42.06 &21.69 &7.75 &54.31 &71.63 &26.92 &48.15 & 56.44 \\
&audio & 25.85 &6.06 &2.90 &15.74 &61.86 &14.71 &19.34 &39.08 \\
&text+audio &43.39 &23.66 &9.38 &54.48 &76.67 &24.34 &51.04 &59.25 \\ \cline{1-2}
\multirow{3}{*}{DialogueRNN}&text &40.59 &2.04 &8.93 &50.27 &75.75 &24.19 &49.38 &57.03 \\
&audio & 35.18 &5.13 &5.56 &13.17 &65.57 &14.01 &20.47 &41.79 \\
&text+audio &43.65 &7.89 &11.68 &54.40 &77.44 &34.59 &52.51 &\textbf{60.25} \\
\hlinewd{0.8pt}
\end{tabular}
}
\caption{Test-set weighted F-score results of DialogueRNN for emotion classification in MELD. Note: \textit{w-avg} denotes weighted-average. text-CNN and cMKL: contextual information were not used.}
\label{tab:emotion_results_7way}
\end{table*}
Table~\ref{tab:emotion_results_7way} presents the results of the baseline models on MELD emotion classification. The performance on the emotion classes \textit{disgust}, \textit{fear}, and \textit{sadness} are particularly poor. The primary reason for this is the inherent imbalance in the dataset which has fewer training instances for these mentioned emotion classes (see Table~\ref{tab:emomeldvsemotionlines}). We partially tackle this by using class-weights as hyper-parameters.
Yet, the imbalance calls for further improvement for future work to address. We also observe high mis-classification rate between the \textit{anger}, \textit{disgust}, and \textit{fear} emotion categories as these emotions have subtle differences among them causing harder disambiguation. Similar to sentiment classification trends, the textual classifier outperforms (57.03\% F-score) the audio classifier (41.79\% F-score).
Multimodal fusion helps in improving the emotion recognition performance by 3\%. However, multimodal classifier performs worse than the textual classifier in classifying sadness. To analyze further, we also run experiments on 5-class emotions by dropping the infrequent \textit{fear} and \textit{disgust} emotions (see Table~\ref{tab:emotion_results_5way}). Not surprisingly, the results improve over the 7-class setting with significantly better performance by the multimodal variant.
Overall, emotion classification performs poorer than sentiment classification. This observation is expected as emotion classification deals with classification with more fine-grained classes.
\begin{table}[b]
\centering
\small
\resizebox{\linewidth}{!}{
\begin{tabular}{cc|cccccccc}
\hlinewd{1.5pt}
&\multirow{2}{*}{Mode}&\multicolumn{8}{c}{{Emotions}}\\\cline{3-10}
&& ang & joy & neu & sad & surp & w-avg.\\\hlinewd{0.8pt}
bcLSTM&T+A &45.9 &52.2 &77.9 &11.2 &49.9 &60.6 \\ \cline{1-2}
\multirow{3}{*}{dRNN$^*$}&T &41.7 &53.7 &77.8 &21.2 &47.7 & 60.8 \\
&A & 34.1 &18.8 &66.2 &16.0 &16.6 &44.3 \\
&T+A &48.2 &53.2 &77.7 &20.3 &48.5 &\textbf{61.6} \\
\hlinewd{0.8pt}
\multicolumn{8}{l}{$^*$dRNN: DialogueRNN, T: text, A: audio }
\end{tabular}
}
\caption{Test-set weighted F-score results of DialogueRNN for 5-class emotion classification in MELD. Note: \textit{w-avg} denotes weighted-average. \textit{surp}: surprise emotion.}
\label{tab:emotion_results_5way}
\end{table}
\subsection{Additional Analysis}
\label{sec:analysis}
\paragraph{Role of Context.}
One of the main purposes of MELD is to train contextual modeling in a conversation for emotion recognition. Table~\ref{tab:emotion_results_7way} and~\ref{tab:sentiment_results} show that the improvement over the non-contextual model such as text-CNN -- which only uses a CNN (see Section~\ref{sec:feature_extraction}) -- is 1.4\% to 2.5\%.
\paragraph{Inter-speaker influence.} One of the important considerations while modeling conversational emotion dynamics is the influence of fellow speakers in the multi-party setting. We analyze this factor by looking at the activation of the attention module on the \textit{global GRU} in DialogueRNN. We observe that in $63\%$ ($882/1381$) of the correct test predictions, the highest historical attention is given to utterances from different speakers. This significant proportion suggests inter-speaker influence to be an important parameter.
\begin{table}[htbp!]
\centering
\small
\resizebox{\linewidth}{!}{
\begin{tabular}{cc|cccc}
\hlinewd{1.5pt}
&\multirow{2}{*}{Mode}&\multicolumn{4}{c}{{Sentiments}}\\\cline{3-6}
&& pos. & neg. & neu. &w-avg.\\
\hlinewd{0.8pt}
&text-CNN & 53.23 & 55.42 & 74.69 & 64.25 \\ \cline{1-2}
bcLSTM&T+A &74.68 &57.87 &60.04 &66.68 \\ \cline{1-2}
\multirow{3}{*}{dRNN$^*$}&T & 54.35 & 60.10 & 74.94 & 66.10 \\
&A & 25.47 & 45.53 & 62.33 & 49.61 \\
&T+A & 54.29 & 58.18 & 78.40 & \textbf{67.56}\\
\hlinewd{0.8pt}
\end{tabular}
}
\caption{Test set weighted F-score results of DialogueRNN for sentiment classification in MELD.
}
\label{tab:sentiment_results}
\end{table}
Unlike DialogueRNN, bcLSTM does not utilize speaker information while detecting emotion. Table ~\ref{tab:emotion_results_7way} shows that in all the experiments, DialogueRNN outperforms bcLSTM by 1-2\% margin. This result supports the claim by~\citet{majumder2018dialoguernn} that speaker-specific modeling of emotion recognition is beneficial as it helps in improving context representation and incorporates important clues such as inter-speaker relations.
\paragraph{Emotion shifts.} The ability to anticipate the emotion shifts within speakers throughout the course of a dialogue has synergy with better emotion classification. In our results, DialogueRNN achieves a recall of $66\%$ for detecting emotion shifts.
However, in the ideal scenario, we would want to detect shift along with the correct emotion class. For this setting, DialogueRNN gets a recall of $36.7\%$. The deterioration observed is expected as solving both tasks together has a higher complexity. Future methods would need to improve upon their capabilities of detecting shifts to improve the emotion classification.
\paragraph{Contextual distance.}
Figure~\ref{fig:context_dist} presents the distribution of distances between the target utterance and its second highest attended utterance within the conversation by DialogueRNN in its \textit{emotion GRU}. For the highest attention, the model largely focuses on utterances nearby to the target utterance. However, the dependency on distant utterances increases with the second highest attention. Moreover, it is interesting to see that the dependency exists both towards the historical and the future utterances, thus incentivizing utilization of bi-directional models.
\section{Future Directions}
\label{sec:future}
Future research using this dataset should focus on improving contextual modeling. Helping models reason about their decisions, exploring emotional influences, and identifying emotion shifts are promising aspects.
Another direction is to use visual information available in the raw videos. Identifying face of the speaker in a video where multiple other persons are present is very challenging.
\begin{figure}[htbp!]
\centering
\includegraphics[width=\linewidth]{context_distance.pdf}
\caption[]{Histogram of $\Delta t=$ distance between the target and its context utterance based on \textit{emotion GRU} attention scores.}
\label{fig:context_dist}
\end{figure}
This is the case for MELD too as it is a multi-party dataset. Enhancements can be made by extracting relevant visual features through processes utilizing audio-visual speaker diarization. Such procedures would enable utilizing a visual modality in the baselines. In our results, audio features do not help significantly. Thus, we believe that it is necessary to improve the feature extraction for these auxiliary modalities in order to improve the performance further.
So far, we have only used concatenation as a feature fusion approach, and showed that it outperforms the unimodal baselines by about 1-3\%. We believe there is room for further improvement using other more advanced fusion methods such as MARN~\citep{zadeh2018multimodal}.
\section{Applications of MELD}
\label{sec:appli}
MELD has multiple use-cases. It can be used to train emotion classifiers to be further used as emotional receptors in generative dialogue systems. These systems can be used to generate empathetic responses~\cite{zhou2017emotional}. It can also be used for emotion and personality modeling of users in conversations~\citep{li2016persona}.
By being multimodal, MELD can also be used to train multimodal dialogue systems. Although by itself it is not large enough to train an end-to-end dialogue system (Table~\ref{tab:data}), the procedures used to create MELD can be adopted to generate a large-scale corpus from any multimodal source such as popular sitcoms. We define \emph{multimodal dialogue system} as a platform where the system has access to the speaker's voice and facial expressions which it exploits to generate responses. Multimodal dialogue systems can be very useful for real time personal assistants such as Siri, Google Assistant where the users can use both voice and text and facial expressions to communicate.
\section{Conclusion}
\label{sec:conclusion}
In this work, we introduced MELD, a multimodal multi-party conversational emotion recognition dataset. We described the process of building this dataset, and provided results obtained with strong baseline methods applied on this dataset. MELD contains raw videos, audio segments, and transcripts for multimodal processing. Additionally, we also provide the features used in our baseline experiments. We believe this dataset will also be useful as a training corpus for both conversational emotion recognition and multimodal empathetic response generation.
Building upon this dataset, future research can explore the design of efficient multimodal fusion algorithms, novel ERC frameworks, as well as the extraction of new features from the audio, visual, and textual modalities.
\section*{Acknowledgments}
This material is based in part upon work supported by the National Science Foundation (grant \#1815291), by the John Templeton Foundation (grant \#61156), and by DARPA (grant \#HR001117S0026-AIDA-FP-045).
| {'timestamp': '2019-06-05T02:21:15', 'yymm': '1810', 'arxiv_id': '1810.02508', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02508'} | arxiv |
\section{Introduction}
Orthogonal frequency division multiplexing with index modulation (OFDM-IM) \cite{bacsar2013orthogonal} is a novel multicarrier technique, which extends the concept of spatial modulation (SM) \cite{mesleh2008spatial} into the frequency domain. In OFDM-IM, the subcarriers are divided into a series of subblocks, where the information bits are carried by two entities, the subcarrier indices and the modulated symbols. That is, the subcarriers have two states, active and idle, and the indices of the active subcarriers carry information.
The special design of OFDM-IM makes it more capable of combating inter-carrier interference (ICI) and gives better bit error rate (BER) performance in the low-to-medium data rate than the conventional OFDM \cite{bacsar2013orthogonal}. Also, it is possible to construct energy-efficient transmit signals compared to the conventional OFDM systems \cite{zhao2012high}.
As pointed out in \cite{ishikawa2016subcarrier}, OFDM-IM inherits the high peak-to-average power ratio (PAPR) problem from OFDM. As well known, high PAPR can cause in-band distortion and out-of-band radiation when the OFDM-IM signal passes through high power amplifier (HPA). Lots of PAPR reduction methods have been researched in OFDM literatures \cite{han2005overview}. To address the high PAPR problem in OFDM-IM, a way is to borrow the methods designed for OFDM directly. However, those methods may be not very efficient because they do not consider the unique characteristic of OFDM-IM structure \cite{zheng2017peak}.
Therefore, the authors in \cite{zheng2017peak} proposed an efficient PAPR reduction method through utilizing the idle subcarriers. Specifically, the scheme in \cite{zheng2017peak} introduces a dither signal with an amplitude constraint in the idle subcarrier, which is the first PAPR reduction method utilizing the characteristic of OFDM-IM.
However, this work does not consider the fact that the characteristics of the subblocks are various if quadrature amplitude modulation (QAM) is employed in the active subcarriers even though the index modulation and demodulation in OFDM-IM are performed subblock by subblock. It naively adopts the same amplitude constraint for every subblock.
In this letter, multilevel (multi amplitudes) dither signals are used, where the amplitude constraint can be varied and determined by the characteristic of each subblock. Specifically, the values of the modulated symbols in the subblock determine the according subblock's amplitude constraint. As a result, the proposed scheme gives the dither signals more freedom (a larger radius of dithering) in average and can provide better PAPR reduction performance than the previous work.
\section{System Model}
\subsection{Notations}
The superscript $T$ and $H$ denote the transpose and Hermitian transpose, respectively. $\mathbb{C}$ denotes the complex number domain. $|I|$ denotes the cardinality of the set $I$. Furthermore, $\|\zeta\|_{p}$ denotes the $p$-norm of the vector $\zeta$.
$\Re(\cdot)$ and $\Im(\cdot)$ present the real part and the imaginary part of the complex number, respectively.
\subsection{OFDM-IM}
In the OFDM-IM system, a total of $m$ information bits enter the OFDM-IM transmitter for the transmission of each OFDM-IM block. These $m$ bits are split into $g$ groups each containing $p$ bits, i.e., $m=pg$. Each group of $p$ bits is mapped to an OFDM subblock of length $n$ in frequency domain, where $n = N/g$ and $N$ is the number of subcarriers.
Unlike classical OFDM, this mapping operation is not only performed by means of the modulated symbols, but also by the indices of the subcarriers \cite{bacsar2013orthogonal}.
Inspired by the SM concept, additional information bits are transmitted by exploiting the OFDM subcarrier indices. For each
subblock, only $k$ out of $n$ available indices are activated for this purpose and they are determined by a selection procedure from a predefined set of active indices, based on the first $p_1$ bits of the incoming $p$-bit sequence.
We set the symbols corresponding to the inactive (or idle) subcarriers to zero, and therefore, we do not transmit data with them. The remaining $p_2=k \log_2M$ bits of this sequence are mapped onto the $M$-ary signal constellation to determine the symbols having active indices. Therefore, we have $p = p_1 + p_2$. In other words, in the OFDM-IM system, the information is conveyed by both of the $M$-ary modulated symbols and the indices of the modulated subcarriers (active subcarriers) \cite{bacsar2013orthogonal}.
Denote the set of the indices of the $k$ active subcarriers in the $\beta$-th subblock, $\beta=1,2,\cdots,g$, as
\begin{equation}
I_{\beta} = \{i_{\beta,1},i_{\beta,2},\cdots,i_{\beta,k}\}
\end{equation}
with $i_{\beta,\gamma} \in \{1,2,\cdots,n\}$ for $\beta = 1,2,\cdots,g$ and $\gamma = 1,2,\cdots,k$.
Correspondingly, the set of $k$ modulated symbols is denoted by
\begin{equation}
S_{\beta} =\{S_{\beta,1},S_{\beta,2},\cdots,S_{\beta,k}\}
\end{equation}
where $S_{\beta,\gamma} \in \mathcal{S}$ and $\mathcal{S}$ is the used signal constellation.
The OFDM-IM transmitter creates all of the subblocks by taking into account $I_{\beta}$ and $S_{\beta}$ for all $\beta$ first and it then forms the $N\times 1$ symbol sequence
\begin{equation}
\mathbf{X} = [X(1)~X(2)~\cdots~X(N)]^T
\end{equation}
where $X(\alpha) \in \{0, \mathcal{S}\},\alpha = 1,2,\cdots,N$, by concatenating these $g$ subblocks. Unlike the classical OFDM, in OFDM-IM $\mathbf{X}$ contains some zeros.
After these point, the same procedure as classical OFDM are applied. The symbol sequence in frequency domain is processed by the inverse discrete Fourier transform (IDFT) to generate the OFDM-IM signal sequence in time domain
\begin{equation}
\mathbf{x} = \mathbf{F}^H \mathbf{X}
\end{equation}
where $\mathbf{F}$ is the unitary DFT matrix and then $\mathbf{F}^H$ is the IDFT matrix. Then cyclic prefix (CP) is appended followed by parallel-to-serial (P/S) and digital-to-analog (D/A) conversion.
Also, the PAPR of the OFDM-IM signal sequence $\mathbf{x}$ is defined by
\begin{equation}
\mbox{PAPR}=\frac{\|\mathbf{x}\|_{\infty}^2}{\mathbb{E}[\|\mathbf{x}\|_2^2]/N}
\end{equation}
where $\mathbb{E}[\cdot]$ denotes the expectation operator.
The receiver's task is to detect the indices of the active subcarriers, which is called index demodulation in this letter, and demodulate the corresponding modulated symbols. There are several types of detection algorithms for the OFDM-IM system \cite{bacsar2013orthogonal}, \cite{siddiq2016low} and it is remarkable that the index demodulation is performed subblock by subblock.
After detection of the active indices by one of the detectors, the information is passed to the index demapper to provide an estimate of the $p_1$ bits. Once the active indices are determined, demodulation of the modulated symbols is straightforward and it provides an estimate of the $p_2$ bits.
\section{PAPR Reduction Using Multilevel Dither Signals}
\subsection{PAPR Reduction with Single Level Dither Signals \cite{zheng2017peak}}
First, we denote the set of the indices of the idle subcarriers in $\mathbf{X}$ as $U$, whose cardinality is $N-K$ and $K=kg$ is the number of active subcarriers in $\mathbf{X}$.
In \cite{zheng2017peak}, a dither signal with an amplitude constraint $R$ is introduced in the idle subcarrier and no signal change is required in the active subcarrier. The motivation of this amplitude constraint is to control the impact of the dither signal on the index demodulation error. The design of the optimal dither signal can be solved by the convex programming.
That is, the PAPR optimization problem can be presented by
\begin{align}\label{eq:sdscvx}
\min_{\zeta} &\| \mathbf{F}_{U}^H \zeta + \mathbf{x} \|^2_{\infty}\nonumber\\
\mbox{s.t.}~&\|\zeta\|_{\infty} \leq R
\end{align}
where $\mathbf{x}=\mathbf{F}^H \mathbf{X}$ is the initial OFDM-IM signal sequence in time domain, $\mathbf{F}^H_{U}\in \mathbb{C}^{N\times (N-K)}$ is obtained from $\mathbf{F}^H$ by collecting the columns whose indices belong to $U$, and $\zeta$ is the $(N-K) \times 1$ dither signal in frequency domain. To solve the convex optimization problem, CVX \cite{grantcvx}, a package for specifying and solving convex programs, may be used.
The super constellation after adding the dither signals is shown in Fig. \ref{fig:SDS}. Obviously, the signal in the active subcarrier keeps fixed, while the dither signals in the idle subcarrier are moved around the origin with the single amplitude constraint $R$.
\begin{figure}[htbp]
\centering
\includegraphics[width=\linewidth]{OFDM_IM_TR.pdf}
\caption{The super constellation when 16-QAM is employed in the active subcarriers and the scheme in \cite{zheng2017peak} with $R=0.5$ is used. The original signal constellation points are $\Re(X(\alpha))\in\{\pm 1, \pm 3\}$ and $\Im(X(\alpha))\in\{\pm 1, \pm 3\}$.}
\label{fig:SDS}
\end{figure}
\subsection{The Proposed PAPR Reduction with Multilevel Dither Signals}
\subsubsection{$\mu_{\beta}$, $\lambda_{\beta}$, $\delta_{\beta}$, and $\nu$}
In this subsubsection, we introduce four notations. First, the minimum amplitude of the modulated symbols in the active subcarriers in the $\beta$-th subblock is denoted by
\begin{equation}\label{eq:mubeta}
\mu_{\beta} = \min_{\gamma = 1,2,\cdots,k} |S_{\beta,\gamma}|
\end{equation}
where $|S_{\beta,\gamma}|$ denotes the amplitude of $S_{\beta,\gamma}$.
If we use QAM in the active subcarriers, the amplitude of the modulated symbols $|S_{\beta,\gamma}|$ is various. We denote the possible values of $|S_{\beta,\gamma}|$ as $A_1 < A_2 < \cdots < A_L$, where $L$ is the number of distinct amplitude levels. For example, let us consider 16-QAM, where $\Re(X(\alpha))\in\{\pm 1, \pm 3\}$ and $\Im(X(\alpha))\in\{\pm 1, \pm 3\}$. In this case, $L=3$ and we have $A_1 =\sqrt{1^2 + 1^2}=\sqrt{2}$, $A_2 =\sqrt{1^2 + 3^2}= \sqrt{10}$, and $A_3=\sqrt{3^2 + 3^2}=\sqrt{18}$. Therefore, $\mu_{\beta}$ in (\ref{eq:mubeta}) can also be varied for $\beta$ and be one of $\{A_1, A_2, \cdots, A_L\}$.
Second, the maximum amplitude of the dither signals in the idle subcarriers in the $\beta$-th subblock is denoted as $\lambda_{\beta}$. Without any dither signals, $\lambda_{\beta} = 0$ for all $g$ subblocks. Also, the scheme in \cite{zheng2017peak} guarantees $\lambda_{\beta} \leq R$ for all $g$ subblocks.
Third, the index demodulation error in the $\beta$-th OFDM-IM subblock mainly depends on the difference between $\mu_{\beta}$ and $\lambda_{\beta}$, which is denoted as
\begin{equation}
\delta_{\beta} = \mu_{\beta} - \lambda_{\beta}.
\end{equation}
As $\delta_{\beta}$ becomes smaller, the index demodulation error in the $\beta$-th subblock occurs more frequently.
If we take all $g$ subblocks into account, the minimum value of $\delta_{\beta}$ for all $g$ subblocks is dominant for index demodulation error in one OFDM-IM block, which is
\begin{equation}\label{eq:nu}
\nu=\min_{\beta =1,2,\cdots,g} \delta_{\beta}.
\end{equation}
That is, the index demodulation error occurs more frequently as $\nu$ in the OFDM-IM system becomes smaller. In conclusion, we have to keep $\nu$ as large as possible in OFDM-IM systems. Without any dither signals, it is clear that $\nu \geq A_1$ is guaranteed and the scheme in \cite{zheng2017peak} guarantees $\nu \geq A_1 - R$.
\subsubsection{The Proposed PAPR Reduction Scheme}
Using the fact that $\nu$ in (\ref{eq:nu}) is the minimum value among $g$ $\delta_{\beta}$'s and $\mu_{\beta}$ in $\delta_{\beta}$ is various for $\beta$, we propose the PAPR reduction scheme with multilevel dither signals. In the proposed scheme, the amplitude constraint in the idle subcarriers in the $\beta$-th subblock is determined according to $\mu_{\beta}$. Specifically, in the proposed scheme, the subblock whose $\mu_{\beta}$ is $A_l$ uses $R_l$, $l=1,2,\cdots,L$, as the amplitude constraint on the dither signals in the idle subcarriers.
To cast the convex problem, we introduce $L$ index sets $U_1, U_2, \cdots, U_{L}$ which are disjoint and the subsets of $U$. The $U_l$ consists of the indices of the idle subcarriers whose subblock has $\mu_{\beta} = A_l$.
Then, the PAPR optimization in the proposed scheme can be presented by
\begin{align}\label{eq:mdscvx}
\min_{\zeta_1, \zeta_2, \cdots, \zeta_{L}} &\| \mathbf{F}_{U_1}^H \zeta_1 + \mathbf{F}_{U_2}^H \zeta_2 + \cdots + \mathbf{F}_{U_{L}}^H \zeta_{L} + \mathbf{x} \|^2_{\infty}\nonumber\\
\mbox{s.t.}~&\|\zeta_1\|_{\infty} \leq R_1\nonumber\\
&\|\zeta_2\|_{\infty} \leq R_2\nonumber\\
&~~~\vdots\nonumber\\
&\|\zeta_{L}\|_{\infty} \leq R_{L}
\end{align}
where $\mathbf{F}_{U_l}^H\in \mathbb{C}^{N\times |U_l|}$ is obtained from $\mathbf{F}^H$ by collecting the columns whose indices belong to $U_l$ and $\zeta_l$ is the dither signals with length $|U_l|$, $l=1,2,\cdots,L$.
Note that the computational complexity to solve the convex problem in (\ref{eq:mdscvx}) is the same as that for (\ref{eq:sdscvx}) because the dimensions of the variables and the constraints are the same in total.
Now, in order to guarantee $\nu \geq c$ and give the dither signals more freedom at the same time, the following criterion may be the optimal one;
\begin{equation}\label{eq:cri}
A_1 - R_1 = A_2 - R_2 = \cdots = A_L - R_L = c.
\end{equation}
By using this criterion, in the subblock having large $\mu_{\beta}$, the dither signals with large amplitudes may be added in the idle subcarriers.
\subsubsection{Comparison between the Proposed Scheme and the Scheme in \cite{zheng2017peak}}
As we mentioned, the scheme in \cite{zheng2017peak} guarantees $\nu \geq A_1 - R$. If we set $R_1 = R$ in the proposed scheme, the proposed scheme also guarantees $\nu \geq A_1 - R$. However, it is clear that the proposed scheme gives the dither signals more freedom because $R_l = A_l - A_1 + R_1 > R_1$ for $l \neq 1$ from (\ref{eq:cri}).
In this case, the proposed scheme can achieve the better PAPR reduction performance while keeping the index demodulation error the same compared to the scheme in \cite{zheng2017peak}.
The super constellation of the proposed scheme is shown in Fig. \ref{fig:MDS}. We obey the criterion in (\ref{eq:cri}) and use $R_1 = 0$, which means $R_2 = A_2 -A_1 = \sqrt{10}-\sqrt{2} \simeq 1.75$ and $R_3 = A_3 - A_1 = \sqrt{18}-\sqrt{2} \simeq 2.83$. (In simulations, we found that even $R_1=0$ is enough to provide good PAPR reduction performance.)
Obviously, the signal in the active subcarrier keeps fixed, while the signal in the idle subcarrier can be moved around the origin with various amplitude constraints $R_1, R_2, \cdots, R_L$. Also, it is clear that if the constant amplitude modulation such as quadrature phase shift keying (QPSK) is used, the proposed scheme is the same as the scheme in \cite{zheng2017peak}.
\begin{figure}[htbp]
\centering
\includegraphics[width=\linewidth]{OFDM_IM_TR_MDS.pdf}
\caption{The super constellation when 16-QAM is employed in the active subcarriers and the proposed scheme with $R_1=0$, $R_2=1.75$, and $R_3=2.83$ is used. The original signal constellation points are $\Re(X(\alpha))\in\{\pm 1, \pm 3\}$ and $\Im(X(\alpha))\in\{\pm 1, \pm 3\}$.}
\label{fig:MDS}
\end{figure}
\section{Simulation Results}
In this section, we present our simulation results of the PAPR reduction and BER performance of the proposed scheme, the scheme in \cite{zheng2017peak}, and the original OFDM-IM signal. We employ the low complexity power based index demodulation algorithm \cite{siddiq2016low}, where the elements with $k$ highest powers in the subblock are considered as the active subcarriers. We use $N=128$, $n=4$, and $k=2$. For modulating the symbols in the active subcarriers, 16-QAM is used, where $\Re(X(\alpha))\in\{\pm 1, \pm 3\}$ and $\Im(X(\alpha))\in\{\pm 1, \pm 3\}$.
The scheme in \cite{zheng2017peak} uses $R=0.5$. The proposed scheme uses $R_1=0$ and the other $R_l$'s for $l\neq 1$ are selected to satisfy the criterion in (\ref{eq:cri}) because we found that $R_1=0$ in the proposed scheme is enough through several simulations. Even $R_1=0$ means the idle subcarriers whose indices are in $U_1$ cannot have any dither signals, instead $R_2$ and $R_3$ are large enough ($R_2= 1.75$ and $R_3= 2.83$).
Fig. \ref{fig:BER} shows the BER performance of the three schemes. The SNR means the average energy per bit over the additive white Gaussian noise power. In Fig. \ref{fig:BER}, the proposed scheme performs well even though there is a degradation about 0.6dB in comparison with the original OFDM-IM. This is mainly comes from the fact that the dither signals in the idle subcarriers in the proposed scheme increase the transmit power of the OFDM-IM signal and then the average energy per bit in SNR increases. (From simulations, the average energy per bit of the proposed scheme is 0.6dB larger than that of the original OFDM-IM signal.) Note that the proposed scheme has the same lower bound $\nu \geq A_1$ as the original OFDM-IM signal when the proposed scheme uses $R_1 = 0$. However, the scheme in \cite{zheng2017peak} shows a bad BER degradation especially for high SNR region because it has the smaller lower bound $\nu \geq A_1 - R = A_1 - 0.5$ than the other schemes.
\begin{figure}[htbp]
\centering
\includegraphics[width=\linewidth]{BER.pdf}
\caption{The BER performance of the proposed scheme, the scheme in \cite{zheng2017peak}, and the original OFDM-IM signal.}
\label{fig:BER}
\end{figure}
\begin{figure}[htbp]
\centering
\includegraphics[width=\linewidth]{PAPR.pdf}
\caption{The PAPR performance of the proposed scheme, the scheme in \cite{zheng2017peak}, and the original OFDM-IM signal.}
\label{fig:PAPR}
\end{figure}
Fig. \ref{fig:PAPR} shows the PAPR reduction performance of the three schemes. The ordinate is the complementary cumulative distribution function (CCDF) of the PAPR. In Fig. \ref{fig:PAPR}, the proposed scheme shows the best PAPR reduction performance because it has the largest freedom of dithering in the idle subcarriers in average. Even $R_1=0$ means the idle subcarriers whose indices are in $U_1$ cannot have any dither signals, instead $R_2$ and $R_3$ are large enough.
\section{Conclusion}
In this letter, the novel PAPR reduction scheme for OFDM-IM using the multilevel dither signals is proposed. By giving the variable amplitude constraints to the idle subcarriers according to the characteristic of each subblock, the freedom of dithering in the idle subcarriers is maximized while keeping $\nu$ as large as possible. As a result, the proposed scheme has much better PAPR reduction performance than the previous work with a slight BER performance degradation compared to the original OFDM-IM signal case.
\section*{Acknowledgment}
Acknowledgment
\bibliographystyle{IEEEtran}
| {'timestamp': '2018-10-08T02:06:27', 'yymm': '1810', 'arxiv_id': '1810.02533', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02533'} | arxiv |
\section{Appendix}
\revised{
\paragraph{Proof of Proposition \ref{prop:dg_to_gc}}
We have:
\[
\begin{aligned}
(\overline{\exp}^X_{x})^{*}\tilde{f}(p)
&
=
\tilde{f}(\exp^X_x(p), \Gamma_{x, p}(p / ||p||)
\\
&
=
f(\exp^X_x(p))
:=
((\exp^X_x)^*f)(p)
\end{aligned}
\]
thus:
\[
\begin{aligned}
\max_{v \in T_x X} (\tilde{f} \star k)(x, v)
&
=
\max_{v \in T_x X} \langle(\overline{\exp}^X_{x})^{*}\tilde{f}, \tau_{x,v}^*k \rangle_{L^2}.
\\
&
=
\max_{v \in T_x X} \langle(\exp^X_{x})^{*}f, \tau_{x,v}^*k \rangle_{L^2}.
\\
&
=:
f \circledast k ( x )
\end{aligned}
\]
}
\paragraph{Proof of Proposition \ref{prop:equivar}}
\revised{The first equality holds directly by definition. Namely, by applying the definition of directional convolution of the angular function $\varphi_{Re}$ with reference direction $Re$ we have:
\[
\varphi_{Re} \star k := (\varphi \star k)_{Re}.
\]
To prove the second equality observe that $Re_x$ is simply the rotation of $e_x$ by angle $\theta_x$ therefore:
\[
\begin{aligned}
(\varphi \star k)_{Re}(x, \theta)
&
:=
(\varphi \star k)(x, Re_x(\theta))
\\
&
=
(\varphi \star k)(x, e_x(\theta +\theta_x))
\\
&
=:
(\varphi \star k)_e(x, \theta +\theta_x)
\\
&
=:
(\varphi_e \star k)(x, \theta +\theta_x)
\end{aligned}
\]
which proves the proposition using the coordinate free definition of the directional convolution
operator.
Below, we provide an alternative proof that shows that Proposition \ref{prop:equivar} still holds
when the directional convolution operator $\star$ is defined in the angular coordinate setting,
which thus provides a more direct link to the practical setting.} The
family of unit vectors $e_x \in T_x X$ defines polar coordinate systems on each tangent plane
$T_x X$. A tangent vector $p \in T_x X$ is then represented by a tuple $(r, \theta)$ where $r$ is
its radius and $\theta$ is the angle between $e_x$ and \revised{$p = re_x(\theta)$ where
$e_x(\theta)$ denote the direct rotation of $e_x$ by angle $\theta$}. We represent unit vectors
only by their angle. Adapting the notations of Eq. (\ref{eq:dirconv}) in the polar coordinate systems
defined by $e$ we denote:
\[
\begin{aligned}
&
\tau_{x, \theta}^{e} := \tau_{x, e_x(\theta)}
\\
&
\exp_{x, e_x}^X(r, \theta) := \exp_{x}^X(r.e_x(\theta))
\end{aligned}
\]
\revised{and $\Gamma_{x, (r, \theta_1)}^{e}( \theta_2 )$ is the angle between $e_{\exp_{x, e_x}^X(r, \theta)}$ and $\Gamma_{x, re_x(\theta_1)}( e_x(\theta_2) )$ i.e.}
\[
\revised{e_{\exp_{x, e_x}^X(r, \theta)}(\Gamma_{x, (r, \theta_1)}^{e}( \theta_2 )) := \Gamma_{x, re_x(\theta_1)}( e_x(\theta_2) )}
\]
We first observe that:
\[
\begin{aligned}
&
\varphi_{R.e}(x, \theta) = \varphi_{e}(x, \theta + \theta_x),
\\
&
\tau_{x, \theta}^{R.e} = \tau_{x,\theta + \theta_x}^e,
\\
&
\exp_{x, R_x.e_x}^X(r, \theta) = \exp_{x, e_x}^X(r, \theta + \theta_x).
\\
&
\revised{\Gamma^{R.e}_{x, \theta_1}(\theta_2) = \Gamma^{e}_{x, \theta_1 + \theta_x}(\theta_2 + \theta_x )}
\end{aligned}
\]
\revised{We have:
\[
\begin{aligned}
&
(R.e)_{\exp^X_{x, R.e_x}(r, \theta_1)}(\Gamma^{R.e}_{x,(r, \theta_1)}(\theta_2))
=
\\
&
e_{\exp^X_{x, e_x}(r, \theta_1 + \theta_x)}(\Gamma^{e}_{x,(r, \theta_1 + \theta_x)}(\theta_2 + \theta_x))
=
\\
&
R.e_{\exp^X_{x,R.e_x}(r, \theta_1)}(\Gamma^{e}_{x,(r, \theta_1 + \theta_x)}(\theta_2 + \theta_x) - \theta_{\exp^X_{x, e_x}(r, \theta + \theta_x)} )
\end{aligned}
\]
Thus:
\[
\Gamma_{x, (r, \theta_1)}^{R.e}( \theta_2 )
=
\Gamma_{x, (r, \theta_1+\theta_x)}^{e}( \theta_2 + \theta_x) - \theta_{\exp^X_{x, e_x}(r, \theta + \theta_x)}
\]}
\iffalse
The parallel transport being orthogonal and orientation preserving it maps unit vectors to unit vectors and act on their angular representation by adding an offset, therefore:
\[
\begin{aligned}
&
\Gamma_{x, (r, \theta_1)}^{R.e}( \theta_2 )
=
\Gamma_{x, (r, \theta_1+\theta_x)}^{e}( \theta_2 ) + \theta_x - \theta_{\exp^X_{x, e_x}(r, \theta + \theta_x)}
\end{aligned}
\]
\fi
Therefore
\[
\begin{aligned}
&
(\overline{\exp}^{X,R.e}_{x})^{*}\varphi_{R.e}(x, (r,\theta))
\\
&
:=
\varphi_{R.e}\big(\exp_{x, R_x.e_x}^X(r, \theta), \Gamma_{x, (r, \theta)}^{R.e}( \theta )\big)
\\
&
=
\varphi_{R.e}(\exp_{x, e_x}^X(r, \theta + \theta_x), \Gamma_{x, (r, \theta +\theta_x)}^{e}( \theta + \theta_x) - \theta_{\exp^X_{x, e_x}(r, \theta + \theta_x)})
\\
&
=
\varphi_e(\exp_{x, e_x}^X(r, \theta + \theta_x), \Gamma_{x, (r, \theta +\theta_x)}^{e}( \theta + \theta_x))
\\
&
=:
(\overline{\exp}^{X,e}_{x})^{*}\varphi_{e}(x, (r,\theta + \theta_x)).
\end{aligned}
\]
So that:
\[
\begin{aligned}
&
\revised{(\varphi_{R.e} \star k) (x,\theta)}
\\
&
=
\langle (\overline{\exp}^{X, R.e}_{x})^{*}\varphi_{R.e}, (\tau_{x,\theta}^{R.e})^*k \rangle.
\\
&
=
\langle (\overline{\exp}^{X, e}_{x})^{*}\varphi_{e}(\bullet, \bullet + \theta_x), (\tau_{x,\theta+\theta_x}^e)^*k \rangle
\\
&
=
\revised{(\varphi_{e} \star k) (x,\theta + \theta_x)}
\end{aligned}
\]
\subsection{Details on the implementation of convolution \label{app:impl_details}}
Our practical implementation of geodesic convolution relies on dense tensors for efficiency optimization. We describe it in the following subsection.
Let $X$ be a triangle mesh with $N_v$ vertexes. The exponential map over $X$ is given by geodesic
polar coordinates (GPC) around each vertex. We model it as two $N_v$ by $N_v$ matrices $r$ and
$\theta$ where $r_{ij}$ and $\theta_{ij}$ represent the radius and angle at vertex $j$ of the GPC
centered at vertex $i$. The associated Euclidean coordinates $(x_{ij}, y_{ij})_{ij}$, extend inside
triangles by linear interpolation. We use the GPC to construct windows at each vertex along which we
can transfer signals on the mesh. The windows are defined by their radius $R$. The window attached to vertex $i$ consists of the points of polar coordinates are $(\frac{j.R}{N_{\rho}}, \frac{2k.\pi}{N_{\theta}})_{j \in [|1,N_{\rho}|], k \in [|1,N_{\theta}|]}$ in the GPC at $i$. Each window vertex lies inside a triangle we denote by $E_{ijkl}$ the index of the $l$-th vertex of the triangle containing $p_{ijk}$ the $jk$-th point of $i$-th window and by $W_{ijkl}$ the associated barycentric coordinate. That is:
\[
p_{ijk} = \sum_{l=1}^3 W_{ijkl} (x_{i,E_{ijkl}}, y_{i,E_{ijkl}}).
\]
A $a$-dimensional signal $f$ on the mesh consist of a $N_{v}$ by $a$ matrix, it can be pulled back to the window system by the following formula:
\[
E^*f_{ijkl} := \sum_{m=1}^3 W_{ijkm}f_{E_{ijkm},l}
\]
this can be seen as a discretization of the pull back by exponential map. Template functions are stacked in $ab$-polar kernel tensors of shape $(N_{\rho}, N_{\theta}, a, b)$ to be convolved with $a$-dimensional signals. In our context we define the \revised{geodesic convolution} of a $a$ dimensional signal $f$ by the a $ab$-polar kernel $K$ as the $b$-dimensional directional signal:
\[
(f \circledast K)_{ijk} := \sum_{r,m,l} E^*f_{irml} K_{r,(m+j) \ \mathrm{mod} \ N_{\theta}, l,k}
\]
We adapt the original definition of geodesic convolutional layer:
\begin{Definition}[geodesic convolutional layer]
The geodesic convolutional layer of $ab$-kernel $K$, central kernel $C$ and bias vector $B$ and activation function $\xi$ transforms any $a$-dimensional signal $f$ into the $b$-dimensional signal:
\[
\revised{\mathrm{gc}_{K,C,B,\xi}(f)_{ij}} := \max_k \xi( f \circledast K_{ikj} + \sum_{l}C_{jl}f_{il} + B_j )
\]
\end{Definition}
We model the parallel transport as a $N_v$ by $N_v$ matrix $\gamma$ where $\gamma_{ij}$ is the angular offset in the angular coordinates $\theta$ of the GPC induced by the parallel transport along the geodesic joining vertex $i$ to vertex $j$. We discretize the transport of angles by the $4$D tensor $\Gamma$ of shape $(N_v, N_{\rho}, N_{\theta}, 3)$ defined by:
\[
\Gamma_{ijkl} := \frac{\gamma_{i,E_{ijkl}}}{2\pi} + \frac{k}{N_{\theta}}
\]
is the normalized angle representing the unit radial vector at $jk$-vertex of $i$-th window in its GPC. The tensor $\Gamma$ stores exact angular values however since discretized directional functions are defined using $N_{\theta}$ evenly spaced angles we consider the lower and upper transport tensors $\lfloor \Gamma \rfloor$ and $\lceil \Gamma \rceil$. We can interpolate directional signals inside the resulting angular sectors by using the fractional part $\{ \Gamma \} := \Gamma - \lfloor \Gamma \rfloor$. We define \revised{the discrete pull back} of a directional signal $\varphi$ and \revised{by the "completed" exponential map} as the tensor:
\[
\begin{aligned}
\varphi(E,\Gamma)_{ijkl} :=
\sum_{m} W_{ijkm}
\big(
&
(1-\{\Gamma\}_{ijkm})\varphi_{E_{ijkm}, \lfloor \Gamma \rfloor_{ijkm},l}
\\
&
+
\{\Gamma\}_{ijkm}\varphi_{E_{ijkm}, \lceil \Gamma \rceil_{ijkm},l}\big)
\end{aligned}
\]
We define the discrete \revised{directional geodesic convolution} of a $a$-dimensional directional signal $\varphi$ by the $ab$-polar kernel $K$ as the $b$-dimensional directional signal:
\[
\varphi \star K_{ijk}
:=
\sum_{r,m,l} \varphi(E,\Gamma)_{irml} K_{r,(m+j) \ \mathrm{mod} \ N_{\theta}, l,k}
\]
\begin{Definition}[\revised{Directional geodesic convolutional layer}]
The \revised{directional geodesic convolution} of $ab$-polar kernel $K$, central kernel $C$ and bias vector $B \in \maths{R}^b$ and activation function $\xi$ transforms any $a$-dimensional directional signal $\varphi$ to the $b$-dimensional directional signal:
\[
\revised{\mathrm{dir}_{K, C, B, \xi}(\varphi)_{ijk}}
:=
\xi(f \star K_{ijk} + \sum_{l}C_{kl}f_{ijl} + B_k)
\]
\end{Definition}
\subsection{\revised{A Stronger Notion of Directional Convolution \label{app:stronger_dc}}}
Several definition of \revised{directional convolution} are possible we chose to transport tangent directions along geodesic to produce a local radial vector field on the surface which is rotation invariant this simplifies implementation. There is an other natural choice \revised{to pull back directional signals to the tangent plane} we can set:
\[
\overline{\exp}^X_{x, v}(p) = (\exp_x^X(p), ~\Gamma_{x, p}(v)),
\]
and define \revised{convolution} of a directional function $\varphi$ over $X$ by a template $k$ by:
\[
\revised{(\varphi \star_X k) (x,v)} = \langle (\overline{\exp}^X_{x,v})^{*}\varphi, \tau_{x,v}^*k \rangle
\]
On the plane ($X = \maths{R}^2$) the above formula can be simplified, we have:
\[
\overline{\exp}^{\maths{R}^2}_{x, v}(p) = (x+p, v)
\]
To ease notation we identify $\maths{R}^2$ with $\maths{C}$. The map $\tau$ simply rotates the template:
\[
\tau_{x, e^{i\theta}}^* k := k(e^{-i\theta} \bullet)
\]
therefore for any directional function $\varphi$ over $\maths{R}^2$:
\[
\revised{(\varphi \star_{\maths{R}^2} k) (x,e^{i\theta}) = (\varphi(\bullet, e^{i\theta}) * k(e^{-i\theta} \bullet ))(x)}
\]
Let $f$ be a function over $\maths{R}^2$ denote by $(x,v) \mapsto \tilde{f}(x, v) := f(x)$ the associated directional function then:
\[
\revised{(\tilde{f} \star_{\maths{R}^2} k) (x,e^{i\theta}) = (f * k)(e^{-i\theta}\bullet)(x)}
\]
The resulting directional function essentially stores the result of the usual convolution with the
rotated kernel in each direction. Thanks to the above observation we can show that an image based
CNN using this notion of \revised{directional convolution} is equivalent to taking the maximal
response under rotations of the kernels with its standard CNN counterpart as shown by the following
proposition. For simplicity we consider one dimensional signals although the property still holds in
higher dimensions.
\begin{Proposition}
Let $f$ a function over $\maths{R}^2$, $(K_l)_l$ a sequence of template kernels, $(b_l)_l$ a sequence of
real numbers $(\xi_l)_l$ a sequence of activation functions. We define the sequence
$(\varphi_l)_l$ of directional functions over $\maths{R}^2$ and the sequence $(f_l^{\theta})_l$ of
function over $\maths{R}^2$ by:
\[
\left\{
\begin{array}{ll}
\varphi_0 = \tilde{f}\\
\varphi_{l+1} = \xi_{l} \circ \big(\varphi_l \star_{\maths{R}^2} K_l + b_l\big)
\end{array}
\right.
\left\{
\begin{array}{ll}
f^{\theta}_0 = f\\
f^{\theta}_{l+1} = \xi_{l} \circ \big(\revised{(f^{\theta}_l * K_l(e^{-i\theta}\bullet)} + b_l\big)
\end{array}
\right.
\]
Then for all $n$ we have:
\[
\varphi_n(x, e^{i\theta}) = f^{\theta}_n(x).
\]
\end{Proposition}
\begin{proof}
We proceed by recurrence. The property is true for $n = 0$ by definition, suppose it is true for $n = k$. We have:
\[
\begin{aligned}
&
\varphi_{k+1}(x, e^{i\theta})
\\
&
=
\xi_k(\varphi_{k} \star_{\maths{R}_2} K_k(x, e^{i\theta}) + b_k)
\\
&
=
\xi_k( \revised{(\varphi_k(\bullet, e^{i\theta}) * K_k)(e^{-i\theta} \bullet )(x)} + b_k)
\\
&
=
\xi_k( \revised{(f^{\theta}_k * K_k(e^{-i\theta} \bullet ))(x)} + b_k)
\\
&
:=
f^{\theta}_{k+1}(x)
\end{aligned}
\]
which proves the property for $n = k+1$ and concludes the proof.
\end{proof}
\section{Headings in Appendices}
\section{Conclusion}
In the this work we presented a novel approach to define convolution over curved surfaces that do not admit global or canonical coordinate systems. Namely, we proposed a way to align \emph{local} systems of coordinates allowing to build and learn consistent filters that can then be naturally used across different domains. Our approach is built on the notion of directional functions, which generalize real-valued signals. We proposed a technique to convolve such directional functions with learned template (or filter) functions to produce new directional functions. This allows us to compose these convolution operations, without any loss of directional information across layers of a neural network.
We showed that our new approach compares favorably to its most direct analogues producing smoother and more robust results and can compete with more recent techniques, even when using ``weak'' input signals such as the 3D coordinates of the points. We believe that idea of \revised{multi-directional convolution can be generalized} and can open the door to addressing many other situations where the data representation is ambiguous \revised{by allowing} a neuron \revised{to} have different ways of interpreting its input \revised{and to communicate with its contributors}. For example, in our case a neuron can process its input depending on the choice of reference direction and propagate this information to its contributors. However, other types of \revised{alignment between layers} can be thought of across different types of ambiguities in the signal as well.
\section{\emph{\emph{directional convolution}} over Discrete Surfaces}}
We assume that all shapes are represented as connected manifold triangle meshes, possibly with
boundary. In this section we describe our general approach for implementing \revised{directional convolution}
in practice. To simplify the presentation, we describe only the main steps necessary for the
implementation, and defer the exact implementation details to Section \revised{\ref{app:impl_details}} in the Appendix.
To implement \revised{directional convolution}, we need to decide on the discrete representation of template
functions, angular functions on the surface, the exponential map and parallel transport. These are
described as follows:
\vspace{2mm}
\subsection{Template Functions}
To discretize template functions of the form $k: \maths{R}^2 \rightarrow \maths{R}$,
we represent them via windows of discrete polar coordinates in the plane: $(\rho_i, \theta_j)$, where
$\rho_i := \frac{(i+1)R}{N_{\rho} + 1}$ is a set of radii, for $i$ varying between $0$ and $N_{\rho} - 1$ bounded by the window radius $R$ and $\theta_j := \frac{2j\pi}{N_{\theta}}$ is a uniform discrete sampling of angles $[0, 2\pi)$. This means that each $k$ associates a real value to each pair $(\rho_i, \theta_j)$, and can therefore be stored as a matrix of size $N_\rho, N_\theta$. \iffalse In practice CNNs use $(a,b)$-dimensional matrix valued templates to define convolution filters over $a$-dimensional signals. In our case they are stored as 4D tensors of size $(N_\rho, N_\theta, a, b)$.\fi Note that during training these are the unknowns that need to be trained.
\subsection{Angular Functions}
Angular functions are real-valued functions that depend on the point on a
given surface and on a direction in its tangent plane. For a mesh with $N_v$ vertices, we represent
these as matrices of size $(N_v, N_{\theta})$, where $N_\theta$ is defines a discrete angular sampling, in the same way as for template functions above, but with respect to some arbitrary reference direction in the tangent plane of each point. \iffalse We store $a$-dimensional directional functions as $3D$ tensors of size $(N_v, N_{\theta}, a)$.\fi
\subsection{Exponential Map}
To discretize the exponential map, similarly to previous approaches, we use
Geodesic Polar Coordinates (GPC), which associate a window to every point, and represent other
points in its neighborhood, through the geodesic distance $\rho$ and angle $\theta$ to the base point
in its window. We discretize GPC using the same set of discrete polar pairs $(\rho_i, \theta_j)$ as
for the template functions. This means, in particular, that given a vertex $i$, the points in its
GPC might not fall on the vertices of the mesh. We therefore use barycentric coordinates inside
triangles to interpolate values at points in the GPC windows, based on the values at the vertices of
the mesh. This procedure is crucial since it helps us gain resilience against changes in mesh
structure. We can model the GPC using a tensor $E$ of size $(N_v, N_\rho, N_\theta, N_v)$,
such that $E_{vijw}$ stores, the barycentric coordinates \revised{with respect to vertex $w$} of the point \revised{having polar coordinates $\rho_i$, $\theta_j$} in the GPC of the window of vertex $v$. Note that
by definition, generically, $E_{vijw}$ will have exactly three non-zero values for fixed $v,i,j$.
\subsection{Parallel Transport}
Finally, we need to discretize the parallel transport operation in order to define the
discrete analogue of the (completed) exponential map $\overline{\exp}$ defined in Eq. (\ref{eq:complete_exp}). Note that
a key feature of our definition is that parallel transport needs to be defined only for unit vectors connecting a point
$p$ in the tangent plane of $v$ to the origin, which correspond, in our discretization, to the angular polar coordinate
$\theta$ of $p$. This means that we need to compute the angle difference between $\theta$ in the window of $v$ and the
corresponding angle in the GPC of the exponential map of $p$. However due to angular discretization the transported
angle does not necessarily fall into the angles $(\theta_j)_j$ of the window at $p$. We therefore interpolate
between consecutive discrete angles to compute angular functions. Similarly to the exponential map above, the
parallel transport can be discretized as a $5D$ tensor $\Gamma$ of size $(N_v, N_{\rho}, N_{\theta}, N_v, N_{\theta})$
where $\Gamma_{vijwk}$ stores the interpolating coordinate \revised{with respect to the
angle $\theta_k$ at vertex $w$} of the geodesic parallel transport of angle $\theta_j$ to the point with polar coordinates $(\rho_i,\theta_j)$ in the GPC of the window of vertex $v$. The (completed) angular exponential map $\overline{\exp}$ can then be
interpolated in both the spatial and angular domains as a 5D tensor $\overline{E}$ of size
$(N_v, N_{\rho}, N_{\theta}, N_v, N_{\theta})$ such that:
\begin{align*}
\overline{E}_{vijwk} := E_{vijw}\Gamma_{vijwk}.
\end{align*}
With these constructions at hand, discretizing the generalized convolution, defined in Eq. (\ref{eq:dirconv}) can be done simply by matrix multiplication. Note that aligning the template
function with the tangent plane at $x$ via a map $\tau_{x}$ simply corresponds to aligning the angular coordinate of the template with the angular coordinate of the GPC at $x$. While
aligning a rotated template function via $\tau_{x,v}$ corresponds to applying a circular
permutation to the angular indexing of $k$. We define \revised{geodesic convolution} of a template $K$ and a function $f$ by:
\begin{align*}
\revised{(f \circledast k)_{v}} := \max_{k} \sum_{ij} f_w E_{vijk} K_{i,(j+k) \ \mathrm{mod} \ N_{\theta}}
\end{align*}
Likewise \revised{directional convolution} of an angular function $\varphi$ by $K$ is defined \revised{by}:
\begin{align*}
\revised{(\varphi \star K)_{vl}} = \sum_{ij} \varphi_{wk}\overline{E}_{vijwk}.K_{i, (j+l) \ \mathrm{mod} \ N_{\theta}}.
\end{align*}
We also note that the above definitions extend to the case of multidimensional filters and matrix-valued templates. Remark that only the triangles supporting the window points will contribute to the result of the convolution, while the value of the signal at the central point will not be taken into account. To achieve this, we add the result of a dense layer to the convolution. That is we multiply the signal at the central point (and direction for \revised{dir-conv}) by the some fixed (learned) matrix and add the resulting vector to the result of the convolution at every point.
\vspace{3mm}
\subsection{Spatial Pooling}
In traditional CNNs pooling layers refer to a way of sampling the signal. They reduce the resolution
of the image by mapping groups of pixels of the original image to a single pixel of a reduced
image. The advantage is two-fold: first it allows to summarize the information over a group of
pixels and to achieve robustness to local perturbations of the signal and second it reduces
computation time and space. A common option called max-pooling is to separate the original image into
consecutive square blocks of pixels, where each block is mapped to a single pixel of the reduced
image by taking the maximal response over the block in each channel. A
closely related notion, which is easily generalizable to meshes is the notion of strided
convolution (\revised{Figure} \ref{strided conv}). It consists of spacing the pixels of the filter window by $D-1$ pixels and applying it
every $D$ pixels thus reducing the output resolution by a factor $D$.
\begin{figure}[H]
\centering
\includegraphics[scale=0.3]{images/strided_conv}
\vspace{-0.5mm}
\caption{Strided convolution on images with convolution kernel in blue. Stride of $0$ (left), $1$ (middle) and $2$ (right).\vspace{-2mm}
\label{strided conv}}
\end{figure}
We can see strided convolution as a regular convolution applied to the sub-sampled image. For meshes
we define a similar notion by transferring the signal to a coarser mesh and then applying geodesic
convolution on the new mesh. In practice, we simplify the original mesh using the classic quadratic
edge collapse approach \cite{garland97}, which also produces a mapping between the original and the
simplified meshes. We use this to transfer both a signal from the original to the simplified mesh (pooling), or from the simplified mesh to the original (un-pooling) by simply picking the value stored at the closest vertex, among those collapsed to it.
To define pooling for directional (angular) functions we need to also transfer angles from the original mesh to its simplified counterpart.
To transfer local angles from a mesh $M$ to a mesh $N$ given a map from $M$ to $N$ we first compute the $3D$ rotation
sending the normal at each vertex to the normal at its image, this allows us to compare the reference directions on both
shapes in the tangent plane to $N$ and to deduce the oriented angular offset between them. We then simply transfer the
angles by adding the offset to all discretized angles and interpolating the result between consecutive discrete bins,
similarly to our construction of parallel transport.
\section{Evaluation}
\label{sec:eval}
\subsection{Architecture\label{subsec:arch}}
\begin{figure*}[!tbp]
\centering
\begin{minipage}[b]{0.3\textwidth}
\scalebox{1.0}{\includegraphics[scale=0.35]{images/resnet_block}}
\caption{ResNet block \label{ResnetBlock}}
\end{minipage}
\hfill
\begin{minipage}[b]{0.3\textwidth}
\scalebox{1.0}{\includegraphics[scale=0.30, angle=90]{images/resnet}}
\caption{Our ResNet architecture \label{ResNet}}
\end{minipage}
\hfill
\begin{minipage}[b]{0.3\textwidth}
\scalebox{1.0}{\includegraphics[scale=0.35]{images/U_resnet}}
\caption{U-ResNet architecture \label{Uresnet}}
\end{minipage}
\end{figure*}
We implemented our deep learning pipeline with Keras \citep{chollet2015keras} using Tensorflow backend \citep{tensorflow2015-whitepaper}. We based our architecture on Residual networks \cite{he2016deep}. For classification tasks we used an architecture organized in stacks of ResNet blocks (Figure \ref{ResnetBlock}).
\iffalse
\begin{figure}[H]
\centering
\includegraphics[scale=0.3]{images/resnet_block}
\caption{ResNet block}
\label{ResnetBlock}
\end{figure}
\fi
Each stack is the composition of a fixed number of ResNet blocks. After each stack the mesh is \revised{down-sampled} by a factor 4 using a pooling layer. The radius and number of filters is multiplied by two to preserve time and space complexity across stacks (Figure \ref{ResNet}).
\iffalse
\begin{figure}[H]
\centering
\includegraphics[scale=0.3, angle=90]{images/resnet}
\caption{Our ResNet architecture}
\label{ResNet}
\end{figure}
\fi
For classification tasks we apply angular max pooling and average the signal over the shape we then apply softmax classifier on the resulting vector. For segmentation tasks we need to produce a point-wise prediction therefore the signal needs to be up-sampled back to the original shape. We combined our ResNet architecture with U-net ~\citep{ronneberger2015u}. \revised{Our U-ResNet architecture (Figure \ref{Uresnet})} consists of two blocks an encode and a decode block. The encode block is a copy of our ResNet architecture, the decode block is similar but pooling is replaced by un-pooling. After each stack the window radius is divided by 2, the signal dimension is divided by two and its up-sampled by 4. Shortcut connection are added to help keeping spatial localization information:
\iffalse
\begin{figure}[H]
\centering
\includegraphics[scale=0.3]{images/U_resnet}
\caption{U-ResNet architecture}
\label{Uresnet}
\end{figure}
\fi
\subsection{Experiments}
\revised{In our experiments we compared MDGCNN to GCNN \cite{MasBosBroVan15} and PointCNN
\cite{li2018pointcnn} in image classification and to GCNN, PointNet++
\cite{qi2017pointnet++} and Dynamic Graph CNN \cite{wang2017cnn} in shape segmentation and
shape matching tasks using various input features. We trained all networks using ADAM
\cite{kingma2014adam} optimizer with learning rate 0.001. Since MDGCNN and GCNN are closely
related we used the same architectures and window radii for both to make the comparison as fair as
possible. } For experiments with varying domains we first center the shapes and
normalize them so that they have unit variance, then we use a fixed initial radius for the whole
dataset. The memory complexity is linear in the number of vertices, the number of radial bins and
the number of directional bins of the windows. \revised{MDGCNN} and \revised{GCNN} have similar time
and memory complexity but \revised{MDGCNN} uses more complex tensor indexing to \revised{align}
local windows and performs directional interpolation of the result of convolution. Therefore our
implementation of \revised{MDGCNN} is slightly \revised{slower} in practice. \revised{For example} in our image
classification experiment on \revised{50000 images mapped to spheres with 3000 vertexes} we observed
times of 7 min 13s for one epoch with \revised{GCNN} and 10 min 13 with \revised{MDGCNN} using \revised{a} GTX
1080 graphics card. This speed advantage however is compensated by a the significantly faster convergence of
\revised{MDGCNN as shown in Figure \ref{fig:seg_convergence}}.
\subsection{Image classification \label{img_classification}}
In our first experiment we compare \revised{MDGCNN}, \revised{GCNN} \revised{and PointCNN} on the CIFAR-10 image classification
benchmark ~\citep{krizhevsky2009learning} on different domains. We do not try to achieve state-of-the-art
performance. Our purpose is to demonstrate that \revised{MDGCNN} is able to learn complex signals over mesh domains and is superior
to \revised{GCNN}. The CIFAR-10 dataset consists of $60000$ $32$ by $32$ RGB images in $10$ classes, (airplane, automobile, bird,
cat, deer, dog, frog, horse, ship, truck) with $6000$ images per class. There are $50000$ training images and $10000$
test images. We mapped the images to two different meshes, a regular grid and a sphere. In the case of the sphere, we
parametrized two opposite hemispheres in polar coordinates and then used elliptical mapping ~\citep{fong2015analytical}
\revised{(shown in Figure \ref{fig:elliptical_map})} to map the images to both hemispheres.
\begin{wrapfigure}{l}{3.0cm}
\vspace{-13pt}
\includegraphics[scale=0.35]{images/squirc2.jpg}
\vspace{-20pt}
\caption{Elliptical mapping from a disc to a square \label{fig:elliptical_map}}
\vspace{-10pt}
\end{wrapfigure} Once the mapping is computed every mesh vertex is equipped with 2D coordinates which allows us to pull back the images using bilinear interpolation inside pixels.
The resulting image on the sphere is then linearly interpolated
inside each triangle as shown on Figure \ref{cifar10 spheres}. Let us note that in both the grid and the sphere case, using
principal curvature directions to fix the reference orientation, as done in \cite{MasBosBroVan16,monti2017}, would not
be meaningful as every point is an umbilic on these domains, so that \emph{every} direction is a principal one.
\begin{figure}[H]
\centering
\includegraphics[width=0.55in]{images/cifar_10_123_bird.png}\hfill%
\includegraphics[width=0.55in]{images/cifar_10_212_car.png}\hfill%
\includegraphics[width=0.55in]{images/cifar_10_213_plane.png}\hfill%
\includegraphics[width=0.55in]{images/cifar_10_221_boat.png}\hfill%
\includegraphics[width=0.55in]{images/cifar_10_226_car.png}\hfill%
\includegraphics[width=0.55in]{images/cifar_10_227_car.png}\hfill%
\includegraphics[width=0.55in]{images/cifar_10_343_deer.png}\hfill%
\includegraphics[width=0.55in]{images/cifar_10_2890_truck.png}\hfill%
\includegraphics[width=0.55in]{images/cifar_10_6006_truck.png}\hfill%
\includegraphics[width=0.55in]{images/cifar_10_6348_cat.png}\hfill%
\includegraphics[width=0.55in]{images/cifar_10_6513_horse.png}\hfill%
\includegraphics[width=0.55in]{images/cifar_10_7744_boat.png}\hfill%
\caption{Examples of CIFAR-10 images mapped to a sphere using elliptical mapping}
\label{cifar10 spheres}
\end{figure}
We trained our ResNet architecture (Figure \ref{ResNet}) in batch of 10 images with 3 ResNet stacks, one ResNet block (Figure \ref{ResnetBlock}) per stack and 16 filters for the first stack, we chose an initial radius of $1.8$ pixels, that is $1.8$ in the grid case and $(32 \times 1.8)/\pi$ on the sphere. The network converged after 50 epochs.
\begin{table}
\centering
\caption{Classification accuracy on the CIFAR-10 dataset using different methods on different domains.\label{class acc}}
\begin{tabular}{ |p{1.5cm}||p{1.5cm}|p{1.5cm}|p{1.5cm}| }
\hline
\multicolumn{3}{|c|}{CIFAR 10 - classification} \\
\hline
Method & Domain & Accuracy\\
\hline
{GCNN} & sphere & 0.6712\\
\textbf{MDGCNN} & sphere & $\textbf{0.7706}$\\
{GCNN} & grid & 0.6767\\
\textbf{MDGCNN} & grid & $\textbf{0.7932}$\\
\revisedt{PointCNN} & \revisedt{grid} & \revisedt{0.7669}\\
\hline
\end{tabular}
\end{table}
The results scores in Table \ref{class acc} show a clear advantage for \revised{MDGCNN over GCNN},
we also observe similar scores \revised{for MDGCNN} on different domains despite the important
stretching introduced by the elliptical mapping of images to the sphere and the irregularity of the
sphere meshing compared to a grid mesh. \revised{In their recent work \cite{li2018pointcnn} Li et
al. applied PointCNN to the CIFAR-10 classification benchmark. The results summarized in Table
\ref{class acc} suggest that our method compares favorably to PointCNN in the image classification context.}
\subsection{Shape segmentation}
In our second experiment we compared our \revised{MDGCNN against GCNN
and several other state-of-the-art methods: Toric cover CNN \cite{maron2017convolutional},
PointNet++ \cite{qi2017pointnet++} and Dynamic graph CNN \cite{wang2018dynamic}.} We evaluated
all methods on the human segmentation benchmark proposed by \cite{maron2017convolutional}. This
dataset consists of 370 models from SCAPE, FAUST, MIT and Adobe Fuse \citep{fuse}. All models are
manually segmented into eight labels, three for the legs, two for the arms, one for the body and one
for the head. The test set is the 18 models from the SHREC07 dataset in human category.
\begin{figure}[H]
\centering
\includegraphics[width=0.13\linewidth]{images/async3D_shrec_7.jpg}\hfill%
\includegraphics[width=0.13\linewidth]{images/sync3D_shrec_7.jpg}\hfill%
\includegraphics[width=0.13\linewidth]{images/seg_shrec_7.jpg}
\includegraphics[width=0.13\linewidth]{images/async3D_shrec_4.jpg}\hfill%
\includegraphics[width=0.13\linewidth]{images/sync3D_shrec_4.jpg}\hfill%
\includegraphics[width=0.13\linewidth]{images/seg_shrec_4.jpg}
{\includegraphics[width=0.15\linewidth]{images/async3D_shrec_9.jpg}}\hfill%
{\includegraphics[height=1.2in]{images/sync3D_shrec_9.jpg}}\hfill%
{\includegraphics[width=0.15\linewidth]{images/seg_shrec_9.jpg}} \\
\vspace{-2mm}
\subcaptionbox{\revised{GCNN}}{\hspace{2cm}}\hfill
~~~~~~~~~\subcaptionbox{\revised{MDGCNN}}{\hspace{1.6cm}}\hfill
~~~~~~~~\vspace{5mm}\subcaptionbox{Ground truth}{\hspace{2cm}}\hfill
\vspace{-3.5mm}
\caption{Human shapes segmentation comparison between standard GCNN and \revised{MDGCNN (ours)} using the 3D coordinates of the shapes as
input. The data is augmented by random rotations and scaling at training to ensure rigid motion invariance and
improve robustness of the learning. \label{fig:seg_examples} \vspace{-2mm}}
\end{figure}
\begin{table}[t!]
\caption{\revised{Segmentation accuracy of several methods on the human body dataset introduced in \cite{maron2017convolutional}.}}
\begin{tabular}{ |p{1.85cm}||p{2.15cm}|p{1.cm}|p{0.9cm}|p{1.05cm}| }
\hline
\multicolumn{5}{|c|}{Human body segmentation} \\
\hline
Method & Input feat.& \# feat. & epochs & accuracy\\
\hline
Toric cover & WKS, AGD, curv.& 20+2+4 & 20 &$0.88$\\
\revisedt{Pointnet++} & \revisedt{3D coords} & \revisedt{3} & \revisedt{200} & \revisedt{\textbf{0.9077}} \\
\revisedt{DynGraphCNN} & \revisedt{3D coords} & \revisedt{3} & \revisedt{200} & \revisedt{0.8972} \\
\hline
GCNN & 3D coords & 3 & 200 &0.7649\\
\textbf{MDGCNN} & 3D coords & 3 & 50 &$\textbf{0.8861}$\\
GCNN & WKS, curv. & 20+4 & 50 &0.8489\\
\textbf{MDGCNN} & WKS, curv. & 20+4 & 50 &\textbf{0.8612}\\
GCNN & SHOT$_{6}$ & 64 & 50 &0.3888\\
\textbf{MDGCNN}& SHOT$_{6}$ & 64 & 50 &\textbf{0.8530}\\
GCNN& SHOT$_{9}$ & 64 & 50 & 0.7410\\
\textbf{MDGCNN}& SHOT$_{9}$ & 64 & 50 & \textbf{0.8879}\\
GCNN& SHOT$_{12}$ & 64 & 50 & 0.8640\\
\textbf{MDGCNN}& SHOT$_{12}$ & 64 & 50 &$\textbf{0.8947}$\\
\hline
\end{tabular}
\vspace{-3mm}
\label{seg acc}
\end{table}
\begin{table}[H]
\caption{Standard deviation of test accuracy of MDGCNN and GCNN across 5 independent runs.}
\begin{tabular}{ |p{1.5cm}||p{1.5cm}|p{1.5cm}|p{1.4cm}| }
\hline
\multicolumn{4}{|c|}{Human body segmentation} \\
\hline
method & Input & epochs & standard deviation\\
\hline
\textbf{MDGCNN} & 3D coords & 50 & \textbf{0.01059} \\
GCNN & 3D coords & 50 & 0.11487 \\
\textbf{MDGCNN} & 3D coords & 100 & \textbf{0.02831} \\
GCNN & 3D coords & 100 & 0.08007 \\
\textbf{MDGCNN} & 3D coords & 200 & \textbf{0.00454} \\
GCNN & 3D coords & 200 & 0.05513 \\
\hline
\end{tabular}
\label{seg var}
\end{table}
\begin{figure}[H]
\center
\vspace{-3mm}
\includegraphics[width=0.9\linewidth]{images/sig17_seg_acc}\hfill%
\vspace{-1mm}
\caption{\revised{Validation accuracy per epoch on the human body segmentation benchmark introduced in \cite{maron2017convolutional} using global 3D coordinates as input.}}
\label{fig:seg_convergence}
\end{figure}
We used our U-ResNet architecture with $2\times2$ of two blocks, $16$ filters on the first layer and an initial
radius of $0.1$. Since we did not have access to the same features as used in
\cite{maron2017convolutional}, we used different inputs, SHOT \cite{salti2014shot} and WKS
\cite{aubry2011wave} descriptors as well as the $3$D coordinates of the shape, we denote by
SHOT$_{k}$ the $64$-dimensional \revised{SHOT} descriptor with window radius equal to $k$ percent of the shape
area. For the experiments taking the $3$D coordinates of the shape as input we first apply a random
rotation and scaling between $0.85$ and $1.15$ to learn features that are robust to global
transformations. \revised{Table \ref{seg acc} summarizes the scores obtained by different methods.}
\revised{In addition to improving accuracy, we have also observed that training MDGCNN can be
significantly more stable compared to GCNN. In Table \ref{seg var} we report the standard
deviation of the validation accuracy of MDGCNN and GCNN across 5 independent runs with
different number of epochs. Here the training data is fixed and the variance is only due to the
stochastic nature of the optimization procedure. }
\iffalse
\begin{table}[t!]
\caption{\revised{Segmentation accuracy of several methods on the human body dataset introduced in \cite{maron2017convolutional}.}}
\begin{tabular}{ |p{1.85cm}||p{2.15cm}|p{1.cm}|p{0.9cm}|p{1.05cm}| }
\hline
\multicolumn{5}{|c|}{Human body segmentation} \\
\hline
Method & Input feat.& \# feat. & epochs & accuracy\\
\hline
Toric cover & WKS, AGD, curv.& 20+2+4 & 20 &$0.88$\\
\revisedt{Pointnet++} & \revisedt{3D coords} & \revisedt{3} & \revisedt{200} & \revisedt{\textbf{0.9077}} \\
\revisedt{DynGraphCNN} & \revisedt{3D coords} & \revisedt{3} & \revisedt{200} & \revisedt{0.8972} \\
\hline
GCNN & 3D coords & 3 & 200 &0.7649\\
\textbf{MDGCNN} & 3D coords & 3 & 50 &$\textbf{0.8861}$\\
GCNN & WKS, curv. & 20+4 & 50 &0.8489\\
\textbf{MDGCNN} & WKS, curv. & 20+4 & 50 &\textbf{0.8612}\\
GCNN & SHOT$_{6}$ & 64 & 50 &0.3888\\
\textbf{MDGCNN}& SHOT$_{6}$ & 64 & 50 &\textbf{0.8530}\\
GCNN& SHOT$_{9}$ & 64 & 50 & 0.7410\\
\textbf{MDGCNN}& SHOT$_{9}$ & 64 & 50 & \textbf{0.8879}\\
GCNN& SHOT$_{12}$ & 64 & 50 & 0.8640\\
\textbf{MDGCNN}& SHOT$_{12}$ & 64 & 50 &$\textbf{0.8947}$\\
\hline
\end{tabular}
\vspace{-3mm}
\label{seg acc}
\end{table}
\begin{table}[t!]
\caption{Standard deviation of test accuracy of MDGCNN and GCNN across 5 independent runs.}
\begin{tabular}{ |p{1.5cm}||p{1.5cm}|p{1.5cm}|p{1.4cm}| }
\hline
\multicolumn{4}{|c|}{Human body segmentation} \\
\hline
method & Input & epochs & standard deviation\\
\hline
\textbf{MDGCNN} & 3D coords & 50 & \textbf{0.01059} \\
GCNN & 3D coords & 50 & 0.11487 \\
\textbf{MDGCNN} & 3D coords & 100 & \textbf{0.02831} \\
GCNN & 3D coords & 100 & 0.08007 \\
\textbf{MDGCNN} & 3D coords & 200 & \textbf{0.00454} \\
GCNN & 3D coords & 200 & 0.05513 \\
\hline
\end{tabular}
\label{seg var}
\end{table}
\begin{figure}[t!]
\center
\includegraphics[width=0.9\linewidth]{images/sig17_seg_acc}\hfill%
\vspace{-1mm}
\caption{\revised{Validation accuracy per epoch on the human body segmentation benchmark introduced in \cite{maron2017convolutional} using global 3D coordinates as input.}}
\label{fig:seg_convergence}
\end{figure}
\begin{figure}[t!]
\centering
\includegraphics[width=0.13\linewidth]{images/async3D_shrec_7.jpg}\hfill%
\includegraphics[width=0.13\linewidth]{images/sync3D_shrec_7.jpg}\hfill%
\includegraphics[width=0.13\linewidth]{images/seg_shrec_7.jpg}
\includegraphics[width=0.13\linewidth]{images/async3D_shrec_4.jpg}\hfill%
\includegraphics[width=0.13\linewidth]{images/sync3D_shrec_4.jpg}\hfill%
\includegraphics[width=0.13\linewidth]{images/seg_shrec_4.jpg}
{\includegraphics[width=0.15\linewidth]{images/async3D_shrec_9.jpg}}\hfill%
{\includegraphics[height=1.2in]{images/sync3D_shrec_9.jpg}}\hfill%
{\includegraphics[width=0.15\linewidth]{images/seg_shrec_9.jpg}} \\
\vspace{-2mm}
\subcaptionbox{\revised{GCNN}}{\hspace{2cm}}\hfill
~~~~~~~~~\subcaptionbox{\revised{MDGCNN}}{\hspace{1.6cm}}\hfill
~~~~~~~~\vspace{5mm}\subcaptionbox{Ground truth}{\hspace{2cm}}\hfill
\vspace{-3.5mm}
\caption{Human shapes segmentation comparison between standard GCNN and \revised{MDGCNN (ours)} using the 3D coordinates of the shapes as
input. The data is augmented by random rotations and scaling at training to ensure rigid motion invariance and
improve robustness of the learning. \label{fig:seg_examples} \vspace{-2mm}}
\end{figure}
\fi
We observe in Figure \ref{fig:seg_examples} that \revised{MDGCNN} is better than \revised{GCNN} at learning features that are invariant to rigid motion directly from the
3D coordinates of the shape without \emph{a priori} descriptors assumed in the data, simply via data
augmentation. Learning global features from the $3$D coordinates of the shape vertices requires aggregating information
between possibly distant points. Since \revised{directional convolution} allows better communication between distant points, \revised{MDGCNN}
noticeably outperforms \revised{GCNN} when using $3$D coordinates as input, producing much smoother results. This is also
illustrated in the qualitative results shown in Figure \ref{fig:seg_examples}. On the other hand, shape descriptors
often carry more global information about the points for example SHOT relies on local histograms counting the mesh
vertexes and normals into bins, while WKS relies on diffusion processes along the surface. We observe close performance
in favor of \revised{MDGCNN} when using WKS. For SHOT we notice that \revised{GCNN} performance considerably degrades when reducing the
radius of the SHOT windows while \revised{MDGCNN} is able to maintain its performance much better. \revised{ PointNet++ and Dynamic Graph CNN behaved similarly on this benchmark we observed slightly slower convergence compared to MDGCNN but slightly better final results (see Figure \ref{fig:seg_convergence}).
We observe similar accuracy between MDGCNN and the Toric Cover method of
\cite{maron2017convolutional}. We note, however, that the Toric Cover method is based on
non-canonical mappings from the torus to the surface and requires considerable data augmentation by
examining many such mappings. This results in long training and prediction computation times. According to \cite{maron2017convolutional}
it takes about 5 hours for the Toric Cover method to complete one epoch at training using 6 Nvidia K80 GPUs. Using 50 different mappings, it takes 45 minutes to calculate predictions on the human class of SHREC07 while it takes 1 min 10s to train our MDGCNN network on one epoch using a single Nvidia TITAN Xp card and 2.2317s to calculate predictions on the test set.}
\subsection{Shape matching}
\begin{figure}[t!]
\centering
\includegraphics[width=0.99\linewidth]{images/faust_matching_mdgcnn6}
\caption{Performance of shape correspondence on the
FAUST dataset and its re-meshed version (5k) evaluated by plotting the fraction of correspondences within a geodesic
radius of the ground truth. Higher curve corresponds to better performance.\label{fig:geod_err}}
\end{figure}
\begin{figure}[t!]
\centering
\includegraphics[width=0.32\linewidth]{images/async_shot_1_bin_12_89_92.jpg}
\includegraphics[width=0.32\linewidth]{images/sync_shot_1_bin_12_89_92.jpg}
\includegraphics[width=0.32\linewidth]{images/nn_shot_1_bin_12_89_92.jpg}\\
\includegraphics[width=0.32\linewidth]{images/async_shot_1_bin_12_matching.jpg}
\includegraphics[width=0.32\linewidth]{images/sync_shot_1_bin_12_matching.jpg}
\includegraphics[width=0.32\linewidth]{images/nn_shot_1_bin_12_matching.jpg}\\
\subcaptionbox{\revised{GCNN}}{\hspace{2cm}}\hfill
\subcaptionbox{\revised{Ours}}{\hspace{1cm}}
\subcaptionbox{NN in descriptor space}{\hspace{4cm}}
\vspace{-1mm}
\caption{Shape correspondence on the
a remeshed (5k) version of the FAUST dataset using : (a) GCNN \cite{MasBosBroVan15} (b) Our method
\revised{MDGCNN}, and (c) using the nearest neighbor in the SHOT descriptors space. \label{fig:matching_examples}}
\end{figure}
Finally, we also applied our pipeline in the context of non-rigid shape matching on the FAUST
dataset, used in \cite{MasBosBroVan15}. In this experiment, goal is to predict the index corresponding to each vertex in
the $0$-th shape of the dataset. The original experiment in \cite{MasBosBroVan15} used the GCNN architecture using SHOT
descriptors as input. In order to remove the bias present in the data, due to all meshes sharing the same connectivity,
we also re-meshed the FAUST shapes from $6890$ vertexes to $5000$ vertexes to evaluate the robustness of both
algorithms. We used our U-ResNet architecture with $2\times2$ stacks of two blocks \revised{with} $16$ filters on the first
layer and an initial radius of $0.1$ taking SHOT$_{12}$ as input. The network was trained for 100 epochs for \revised{MDGCNN} and
200 for \revised{GCNN}. We measured the geodesic error between the predicted labels and the ground truth on the $0$-th shape for
both the original FAUST shapes and the re-meshed ones (5k) \revised{(Figure \ref{fig:geod_err})}.
Contrary to \cite{MasBosBroVan15} we do not use post
processing on the predictions of the algorithm, and measure the accuracy directly on the output of the networks.
As a baseline we also measured the geodesic error of correspondences obtained on $100$ random pairs
of the test set using nearest neighbors in the space of SHOT descriptors. We see that learning
techniques vastly outperform the baseline. On the original set with shapes having the same
connectivity \revised{MDGCNN} and \revised{GCNN} behave similarly. On the re-meshed set
\revised{GCNN} noticeably degrades while \revised{MDGCNN} is able to maintain its precision. Figure
\ref{fig:matching_examples} shows several examples \revised{of correspondences between pairs of
shapes computed using different methods}.
\revised{Figure \ref{fig:geod_err} also shows a
comparison with PointNet++ \cite{qi2017pointnet++} and Dynamic graph CNN \cite{wang2018dynamic}
using 3D coordinates as input (trained for 200 epochs). Note that these methods are designed for
segmentation tasks and are not suited for shape matching in their current form.}
\iffalse
\begin{figure}[h]
\centering
\includegraphics[width=2.5in, height=2.5in]{images/async_shot_1_bin_12_matching.jpg}
\caption{Matching on re-meshed faust using \revised{GCNN}}
\end{figure}
\begin{figure}[h]
\centering
\includegraphics[width=2.5in, height=2.5in]{images/sync_shot_1_bin_12_matching.jpg}
\caption{Matching on re-meshed faust using \revised{MDGCNN}}
\end{figure}
\begin{figure}[h]
\centering
\includegraphics[width=2.5in, height=2.5in]{images/nn_shot_1_bin_12_matching.jpg}
\caption{Matching on re-meshed faust using nn in SHOT space}
\end{figure}
\fi
\subsection{Limitations \& Future Work}
Our pipeline still has important limitations. The learning process depends on the construction of local coordinate
systems which might not be suited to describe certain types of patterns possibly introducing a bottleneck to the
learning. More specifically constructions such as geodesic polar coordinates and parallel transport are purely intrinsic
based on the metric of the surface, therefore some areas that are close in the embedding space might be considered far
in this representation. A typical limiting case of purely intrinsic pipelines such as ours is when some region of the
shape is made of multiple parts that seem to merge in a single object, they might very well fail to recognize it as as a
such. We illustrate this by applying our segmentation pipeline to the bird class of PSB dataset, shown in Figure
\ref{fig:bird_bad}. From a purely \revised{topological} perspective the bird's wings are locally disconnected as they are made of
many feathers.
\begin{figure}[t!]
\centering
\subcaptionbox{\revised{MDGCNN} 3D}{\includegraphics[width=1.5in,height=1.5in]{images/sync3D_Bird_258.png}}\hfill%
\subcaptionbox{Ground truth}{\includegraphics[width=1.5in,height=1.5in]{images/seg_Bird_258.png}}
\caption{Limiting case of purely intrinsic pipelines\label{fig:bird_bad}}
\end{figure}
As we can see in Figure \ref{fig:bird_bad} our pipeline most likely recognized each independent feather as a bird tail,
failing to recognize the wing in its entirety. Another limiting case of pipelines based on local coordinates is the
presence of very thin nearly degenerate parts as the bird's legs and claws. Two dimensional systems of coordinates might
not be appropriate to model \revised{near} one dimensional parts. On the other hand, Figure \ref{fig:bird_good} shows that in
the absence of such limiting cases a bird shape can be properly segmented by \revised{MDGCNN}.
\begin{figure}[t!]
\centering
\subcaptionbox{\revised{MDGCNN} 3D}{\includegraphics[width=1.3in, height=1.5in]{images/sync3D_Bird_259.jpg}}\hfill%
\subcaptionbox{Ground truth}{\includegraphics[width=1.3in, height=1.5in]{images/seg_Bird_259.jpg}}
\caption{Successful segmentation with our approach.\label{fig:bird_good}}
\end{figure}
\revised{Another limitation shared by CNNs for image processing is the choice of scale (size) of
local windows. The same features can have different meaning depending on the scale at which they are detected. Since our current implementation only uses a single fixed scale, this may limit the generalization power of our method in situations where relative proportions of object parts are different from the examples in the training set.
In image processing the scale issue has been addressed e.g. by using the notion of
Inception modules \cite{szegedy2015going}. We leave implementation of inception modules within the
MDGCNN framework for future work.
Our discretization also has some issues. For example, the parallel transport of a direction might fall between
angular bins attached to the target vertex. For this reason we used linear interpolation between
the two adjacent directions. However this still introduces a non-negligible error which grows with the number of layers especially for low number of angular bins. A possible alternative is to
use the Fourier basis to represent directional signals at all points. This would allow exact
direction transfer since rotations act linearly on the basis functions. However activation
functions and operations such as angular max pooling would be harder to perform.}
Perhaps the most immediate, and relatively straightforward extension of our work would be to use our \revised{multi directional} approach in the context of local parameterizations via anisotropic diffusion kernels \cite{MasBosBroVan16}, but
without assuming a canonical reference direction at every point. More generally, it would be interesting to use multi-scale approaches with different ways of computing
the coordinate systems and transporting the information depending on the scale possibly using extrinsic information to help the network learning different semantic interpretations across different scales in order to improve the
overall robustness. \revised{Finally other constructions of directional convolution with potentially
stronger properties are possible, and we give an example in the Appendix Section \ref{app:stronger_dc}.}
\section{GPC and parallel transport}
To compute GPC at each vertex of the mesh we used the algorithm proposed by
\cite{melvaer2012geodesic} which is a variation of the fast marching algorithm
\cite{sethian1999level} \revised{which} allows to compute the angular coordinate as well as the geodesic
distance. We extended the algorithm of \cite{melvaer2012geodesic} to also compute the parallel
transport of angles. Fast marching-like algorithms allow to propagate information along meshes, and
rely on a local transfer subroutine. A vertex is selected among a set of candidates based on a
priority criterion, the information stored at the vertex is then propagated to some of its neighbors
based on an update criterion using the local transfer subroutine. The algorithm stops once a
certain final condition is met. In our case a vertex is updated until the radius exceeds a certain threshold $R_{\mathrm{max}} > 0$. In practice, we follow the basic approach of \cite{melvaer2012geodesic} for propagating information, but in addition to
updating the geodesic distance $\rho$ and polar angle $\theta$ we also keep track of the difference in angles between
the reference directions at the source and target points. The original algorithm \cite{melvaer2012geodesic} has a subroutine for updating the GPC
angle at a vertex inside a triangle given estimates at the two other vertices. We use the same subroutine to update the
transported angle given estimates at the two other vertices. Since the representation of directions is different at each
vertex, we must transfer estimates to every new vertex. We transfer the angles along the edges connecting the
vertices. To transport an angle from vertex $i$ to a neighbor $j$ along the edge $e_{ij}$ we first apply rotations to
the GPCs of $i$ and $j$ so that $e_{ij}$ gives the reference direction at $i$ and $e_{ji}$ gives reference direction at
$j$. The rotated GPCs at $i$ and $j$ have a relative angular offset of $\pi$ which allows to deduce the angular offset between the original GPCs. We transfer the angle at $i$ to $j$ along $e_{ij}$ by adding the angular offset between the GPCs at $i$ and $j$. We use the same edge transfer to transfer the reference direction at the source
to its neighbors in order to initialize the algorithm candidates set. This modified version allows us to compute the
angle difference between the initial and final reference directions, which in turn provides the estimate for the
parallel transport of the unit directions along geodesics between points.
\iffalse
The basic structure of the algorithm is described in Algorithm \ref{algo:gpc}:
\begin{algorithm}[H]
\caption{GPC and transport algorithm}\label{algo:gpc}
\begin{algorithmic}[1]
\State $\mathrm{candidates.Empty}()$\Comment{free candidates list}
\For{$i = 1, \dots N_v$}
\State $r_{si} = +\infty$
\EndFor
\State $D(s) = \{S\} \cup \{j \sim s\}$
\State $\mathrm{initNeigbourhood}(s)$\Comment{init estimates on $D(s)$}
\State $\mathrm{candidates.Push}(D(s))$\Comment{add $D(s)$ to candidates}
\While{$\mathrm{candidates.notEmpty()}$}
\State $j = \mathrm{candidates.smallestNode()}$ \Comment{w.r.t. r}
\For{$k \in \mathcal{N}^M(j)$}
\If{$r_{si} > (1+\epsilon).\tilde{r}_{si}$} \Comment{precision $\epsilon > 0$}
\State \Comment{update estimates}
\State $r_{si} \gets \tilde{r}_{si}$
\State $\theta_{si} \gets \tilde{\theta}_{si}$
\State $\gamma_{si} \gets \tilde{\gamma}_{si}$ \Comment{transport extension}
\State \Comment{if stopping criterion is not met}
\If{!$\mathrm{stopCriterion}(i)$}
\State \Comment{add $i$ to candidates}
\State $\mathrm{candidates.push(i)}$
\EndIf
\EndIf
\EndFor
\EndWhile\label{endwhile}
\end{algorithmic}
\end{algorithm}
Where the stopping criterion is $\tilde{r}_{si} > R_{\mathrm{max}}$ to save computation and memory. \fi
Figure \ref{fig:partransport} illustrates a single GPC window and parallel transport on a sphere. Namely, Figure \ref{fig:5a}
illustrates the angular coordinates of the GPC window via color coding, and the parallel transport of a particular
direction from the center vertex to other vertices in the window, whereas Figure \ref{fig:5b} illustrates our
discretization of the angular and radial bins.
\vspace{-3mm}
\begin{figure}[htp]
\centering
\subcaptionbox{Parallel transport of reference direction at origin and angular coordinate of the GPC. \label{fig:5a}}{\includegraphics[width=1.15in]{images/transport_sphere.jpg}}\hfill%
\subcaptionbox{GPC window with 2 radial and 8 angular bins and its contributing points (white) \label{fig:5b}}{\includegraphics[width=1.3in]{images/window_sphere.jpg}}
\vspace{-1mm}
\caption{An example of parallel transport and the GPC window on a sphere. The colors
represent the angular coordinate in the GPC window.\label{fig:partransport}}
\end{figure}
\section{Introduction}
The success of convolutional neural networks (CNNs) for image processing tasks \cite{krizhevsky2012imagenet} has brought attention from the geometry processing community. In recent years multiple techniques have been developed to reproduce the success of CNNs in the context of geometry of curved surfaces with applications including shape recognition \cite{su2015multi}, segmentation \cite{kalo17,maron2017convolutional} or shape matching \cite{boscaini2015learning}, among many others. A key aspect of CNNs is that they rely on convolution operations. In the Euclidean domain the notion of convolution is well-defined whereas on non-Euclidean spaces, \revised{in general,} there is no direct analogue that satisfies all the same properties.
Different approaches have been proposed to overcome this limitation. Perhaps the simplest and most common consist in either performing convolution directly on the surrounding Euclidean 3D space (using so-called volumetric approaches \cite{maturana2015voxnet}, \cite{qi2016volumetric}), or constructing multiple projections (views) of an embedded object from different angles and applying standard CNNs in 2D \cite{su2015multi}. This idea has also been extended to using more general mappings onto canonical domains, including the plane \cite{sinha2016deep,ezuz2017gwcnn}, or e.g. toric domains which admit a global parameterization and where convolution can be defined naturally \cite{maron2017convolutional}. Unfortunately, such mappings can induce significant distortion and might be restricted to only certain topological classes.
\begin{figure}
\centering
\subcaptionbox{\revised{GCNN 3D}}{\includegraphics[width=0.3\linewidth]{images/async3D_shrec_17.jpg}}\hfill%
\subcaptionbox{\revised{Ours 3D}}{\includegraphics[width=0.3\linewidth]{images/sync3D_shrec_17.jpg}}\hfill%
\subcaptionbox{Ground truth}{\includegraphics[width=0.3\linewidth]{images/seg_shrec_17.jpg}}
\caption{Our approach (middle) enables a variety of learning applications, including shape segmentation using ``weak'' signals, such as 3D coordinates as input, via a richer and more accurate notion of convolution on surfaces. This leads to practical improvements compared to previous methods such as GCNN \cite{boscaini2015learning} as shown on the left.\label{fig:teaser}}\vspace{-3mm}
\end{figure}
On the other hand, several \emph{intrinsic} approaches have been proposed to define analogues of convolution directly on the manifold \cite{boscaini2015learning,MasBosBroVan15,MasBosBroVan16}. These techniques aim at learning local template (or kernel) functions, which can be mapped onto a neighborhood of each point on a surface and convolved with signals defined on the shape. These methods are general, can be applied regardless of the shape topology and moreover are not sensitive to the changes in shape embedding, making them attractive in non-rigid shape matching applications, for example. Unfortunately, general surfaces lack even \emph{local} canonical coordinate systems, which means that the mapping of a template onto the surface is defined only up to the choice of an orthonormal basis of the tangent plane at every point. To overcome this limitation, previous methods either only consider the maximal response over a certain number of rotations \cite{boscaini2015learning} or aim to resolve these ambiguities using principal curvature directions \cite{MasBosBroVan15,MasBosBroVan16}. Unfortunately such approaches can either lead to more instabilities or, in the case of angular max pooling, lose the relative orientation of the kernels across multiple convolutional layers.
In this paper, we propose to overcome this key limitation of intrinsic methods by \revised{aligning} the convolutional layers of the network. Our idea is to consider \emph{directional} (or, equivalently, \emph{angular}) functions defined on surfaces, and to define a notion of convolution for them which results, again, in \emph{directional functions} without loss of information. This allows us to impose specific canonical relations across the layers of a neural network, lifting the directional ambiguity to only the last layer. We then need to take the maximal response over all rotations \emph{only on the last layer}. This allows us to better capture the relative response at different points, leading to an overall improvement in training and test accuracy.
\section{Related Work}
Geometric Deep Learning is an emerging field aimed at applying machine learning techniques in the
context of geometric data analysis and processing. Below we review the techniques most closely
related to ours, and especially concentrate on various ways to define and use convolution on
geometric (3D) shapes and refer the interested reader to several recent surveys, e.g.
\cite{xu2016data,bronstein2017geometric}.
\subsection{Extrinsic and Volumetric Techniques}
Perhaps the most common approach for exploiting the
power of Convolutional Neural Networks (CNNs) on 3D shapes is to transform them into 2D images, for
example by rendering multiple views of the object. Some of the earliest variants of this idea
include methods that represent shapes as unordered collections of views (or range images)
\cite{su2015multi,wei2016dense,kalo17} or exploit the panorama image representation
\cite{shi2015deeppano,sfikas2017exploiting} among others, as well as techniques based on Geometry Images \cite{sinha2016deep}, which represent the 3D geometry by mapping the coordinates onto the plane.
Another common set of methods considers 3D shapes as volumetric objects and defines convolution
simply in the Euclidean 3D space, e.g. \cite{wu20153d,maturana2015voxnet} among others. Due to the
potential memory complexity of this approach, several efficient extensions have been proposed, e.g.,
\cite{wang2017cnn,klokov2017escape}, and a comparison between view-based and volumetric approaches
has been presented in \cite{qi2016volumetric}.
Other recent techniques analyze 3D shapes simply as collections of points and define deep neural
network architectures on point clouds, including, most prominently PointNet \cite{qi2017pointnet},
PointNet++ \cite{qi2017pointnet++} \revised{and several extensions such as PointCNN
\cite{li2018pointcnn} and Dynamic Graph CNN \cite{wang2018dynamic}} for shape classification and
segmentation, and PCPNet \cite{guerrero2018pcpnet} for normal and curvature estimation, among others.
Despite their efficiency and accuracy in certain situations, these techniques rely directly on
the embedding of the shapes, and are thus very sensitive to changes in shape pose, which can limit
their use, for example in non-rigid shape matching.
\subsection{Intrinsic and Graph-based Techniques}
To overcome this limitation, several \emph{intrinsic}
methods have been proposed, for defining and exploiting convolution directly on the surface of the
shape. This includes spectral methods, which exploit the relation between convolution and
multiplication in the spectral domain \cite{boscaini2015learning}, and which have also been applied
on general graphs \cite{defferrard2016convolutional}. A similar technique, treating shapes as
graphs, has been used for analyzing arbitrary shape collections \cite{syncspeccnn}, while
synchronizing their laplacian eigenbases with functional maps
\cite{ovsjanikov2012functional}. Another recent method \cite{ezuz2017gwcnn} consists in optimizing
an embedding of the shape onto the planar domain using intrinsic metric alignment
\cite{solomon2016entropic}. \revised{Finally, a very recent Surface Networks approach
\cite{2017arXiv170510819K} is based on stacking layers consiting of combinations of features
and their images by the Laplace or Dirac operator to exploit intrinsic and extrinsic information.}
More closely related to our approach are techniques based on \emph{local} shape parameterization,
which define convolution of a signal with a learned kernel on a region of the shape surface. A
seminal work in this direction was done in \cite{MasBosBroVan15} where the authors defined Geodesic
Convolutional Neural Networks (GCNNs), which locally align a given kernel with the shape surface at
each point, and perform convolution in the tangent plane. Unfortunately, the absence of canonical
coordinate systems on surfaces leads to a one-directional ambiguity in the alignment. To rectify
this, the authors of \cite{MasBosBroVan15} proposed to take the maximal response across all possible
alignments. Several later extensions of this approach have used different local patch
parameterizations, \cite{MasBosBroVan16,monti2017} and also used prinicipal curvature directions to
resolve the directional ambiguity. Unfortunately, principal curvature directions can be highly
unstable, and not uniquely defined even on basic domains such as the sphere and the torus, which can
lead to over-fitting in the training. Finally, a recent approach has been proposed for defining
convolution via mapping onto a toric domain \cite{maron2017convolutional}, which admits a global
parameterization.
\subsection{Contribution}
In our work, we show that the directional ambiguity that exists when mapping
a template (kernel) onto the surface, as done in \cite{MasBosBroVan15,MasBosBroVan16,monti2017}
\emph{can be maintained} across the layers of the deep neural network without relying on a
canonical direction choice or only keeping the maximal response across all directions. To achieve this,
we first extend real-valued signals to more general \emph{directional functions}. We then show that
a directional function can be convolved with a template
to produce another directional function, and can thus be stacked in a deep neural network. As a
result the directional ambiguity is lifted up to the last layer, where it can be resolved by
taking the maximum response only once. We demonstrate through extensive experiments that this leads to
overall improvement in accuracy and robustness in a range of applications. Finally, we extend
previous approaches such as \cite{MasBosBroVan16,monti2017} by adding spatial pooling layers through
mesh simplification and exploiting residual learning (ResNet) blocks \cite{he2016deep} in the architecture.
\section{Convolution over manifolds}
Throughout our work, we assume that we are dealing with 3D shapes, represented as oriented
(manifold) 2D surfaces, embedded in 3D. For simplicity of the discussion, we also assume that the shapes are without boundary, although our practical implementation does not have this
limitation.
Throughout our discussion, the input signal is assumed to be a tuple of real-valued functions defined
on each shape in the collection. These can either represent some geometric descriptors, or even
simply the 3D coordinates of each point. In this section, we describe how the convolution operation
is applied to a given signal for a fixed template. Our approach follows the general structure
proposed in \cite{MasBosBroVan15}, but we highlight the key differences, arising from our use of
\revised{\emph{directional convolution}}. Finally, let us note that for simplicity we concentrate on oriented
two-dimensional manifolds, although most of our discussion can be adapted easily to more general settings.
Recall that in the standard two-dimensional Euclidean setting, the cross-correlation or convolution of a real-valued
function $f$ by a smooth compactly supported (template) function $k: \maths{R}^2 \rightarrow \maths{R}$ is defined for all
$x \in \maths{R}^2$ by:
\[
\revised{(f * k) ( x )}
:=
\int_{\maths{R}^2} f(t) k(t+x) dt.
\]
Convolution is a way to compare the function $f$ to a template function $k$ at every point. We can
reinterpret convolution in the following way: first, for every point $x$ we identify the tangent
space to $x$ with with a copy of \revised{$\maths{R}^2$} whose origin has been shifted to $x$. Then, translation
by $x$ can be seen as linear isometry:
\[
\tau_{x}: T_x \maths{R}^2 \rightarrow \maths{R}^2 \simeq T_0 \maths{R}^2, ~~ \tau_x(p) = p + x ~\forall~ p,
\]
where $\maths{R}^2 \simeq T_0 \maths{R}^2$ simply means that the tangent plane at the origin can be identified
with the whole of $\maths{R}^2$. Moreover, the identity map ``centered at $x$'' can be seen as another isometry:
\[
\mathrm{Id}_x: T_x \maths{R}^2 \rightarrow \maths{R}^2, ~~ \mathrm{Id}_x(p) = p ~\forall~ p.
\]
Therefore can rewrite the convolution of $f$ by $k$ at $x$, as:
\[
\revised{(f * k) ( x )}
=
\langle \mathrm{Id}_x^*f, \tau_{x}^*k \rangle_{L^2},
\]
where the supperscript $^{*}$ means the pull-back of the function with respect to the map, and $\langle, \rangle_{L^2}$
is the standard $L^{2}$ inner product. We can
now generalize this construction to two-dimensional manifolds by generalizing the maps $\mathrm{Id}_x^*$ and
$\tau_{x}^*$. At every point $x$ of a Riemannian manifold $X$ the exponential map:
\[
\exp^X_x : T_x X \rightarrow X
\]
generalizes the previous map $\mathrm{Id}_x: T_x \maths{R}^2 \rightarrow \maths{R}^2$ in the sense that
$ \exp^{\maths{R}^2}_x = \mathrm{Id}_x.$ Following \cite{MasBosBroVan15}, we assume that the template
function $k$ is defined over a copy of $\maths{R}^2$, denoted by $T_0\maths{R}^2$, and generalize the map
$\tau_x$ by isometrically aligning this copy with the tangent plane $T_x X$ at $x$. \revised{That is,}
the map $\tau_x : T_x X\rightarrow T_0 \maths{R}^2$ \revised{must be a linear isometry}. This map is uniquely-defined
given a choice of the correspondence of the coordinate axes of $\maths{R}^2$ with a coordinate frame \revised{of} $T_x X$.
For oriented surfaces, this reduces to the alignment of one coordinate axis.
If \revised{$e_1 := (1,0)$} is the first coordinate axis on $\maths{R}^2$, this means that the inverse of the map
$\tau$ must send \revised{$e_1$} to all tangent spaces, and that $k$ can be pulled-back onto $T_x X$ for any $x$,
via $\tau_x^{*}k$.
Since unlike the Euclidean case, there is no global choice of \revised{reference direction} on a surface, an arbitrary
choice of the pre-image of \revised{$e_1$} on every tangent space $T_x X$ can lead to biased results, which
furthermore will not generalize across different (e.g., training and test) shapes.
To resolve this ambiguity, the authors of \cite{MasBosBroVan15} consider the family of maps
$\tau_{x,v}$ parameterized by a choice of a unit vector $v$ in the tangent plane of $x$, which is
mapped to the first coordinate axis in $\maths{R}^2$, i.e. $\tau_{x,v}(v) = \revised{e_1}$. They then define \revised{geodesic
convolution} by taking the maximum response of the signal to the template function $k$ mapped via
$\tau_{x,v}$ across all choices of $v$.
\begin{align}
\revised{(f \circledast k) ( x )}
= \max_v ~ \langle (\mathrm{exp}^X_x)^{*}f, \tau_{x,v}^{*}k \rangle_{L^2}.
\end{align}
The two main advantages of this procedure are that: 1) it does not depend on the choice of
reference direction in the tangent planes, and 2) the output of $f \circledast k$ is again a real-valued
function, so that convolutions can be applied successively within a deep network.
Unfortunately, only keeping the maximum response also results in a loss of directional information,
which can make it more difficult to detect certain types of features in the signal. In particular,
since the maximum is applied independently at every point, directional information of the response
of the signal to the template is not shared across nearby points.
\begin{figure}[t!]
\centering
\includegraphics[width=0.9\linewidth]{images/notation_figure_v2}
\vspace{-2mm}
\caption{\revised{The \emph{completed} exponential map at a point $x \in X$ sends any non null
tangent vector $p \in T_x X$ to the couple
$(y = \exp_x^X(p), v = \Gamma_{x, p}(\frac{p}{||p||}))$ where $v \in T_y X$ is the result of
parallel transport of $\frac{p}{||p||}$ along the geodesic from $x$ to $y$, with the initial
direction given by $p$.
\label{fig:comp_exp}}}
\end{figure}
\revised{\subsection{Convolution of Directional Functions}}
\label{subsec:dirconv}
We propose to address these limitations by considering convolution of a template function with a
more general notion of \revised{\emph{directional functions}} defined on arbitrary \revised{surfaces}.
We call a directional function, any function $\varphi(x,v)$ that depends on both the point
$x$ on a surface $X$, and on the unit direction $v$ in the tangent plane $T_x X$ at $x$. \revised{
Clearly any real-valued function $f : X \rightarrow \maths{R}$ can be lifted to a directional
function $\tilde{f}$, simply by ignoring the directional argument and setting $\tilde{f}(x,v) =
f(x)$ for any $v$. }
\iffalse
\begin{figure}[H]
\centering
\includegraphics[scale=0.65]{images/transport_theory}
\vspace{-1mm}
\caption{Pull-back of a directional function by the completed exponential map at point $x \in X$ and $p \in T_x X$. We construct a geodesic starting at $x$ in the direction of $p$ and evaluate $\varphi$ at a distance $||p||$ on the curve.
\label{fig:exp_example}\vspace{-2mm}}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[scale=0.4]{images/pull_back_to_tangent_plane}
\vspace{-1mm}
\caption{\revised{Pull-back of a directional function by the completed exponential map at point $x \in X$ and $p \in T_x X$. We construct a geodesics starting at $x$ in the directions $e^{\theta}_x$ and evaluate $\varphi$ at different distances $t > 0$ in the transported directions $\Gamma_{x,t}^{\theta}$}
\label{fig:exp_example}\vspace{-2mm}}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[scale=0.5]{images/tangent_plane}
\vspace{-1mm}
\caption{\revised{The pull back of the directional function $\varphi$ produces a regular function on the tangent plane at $x$, $T_x X$ defined using polar coordinates $(r, \theta) \mapsto \varphi_{x,t}^{\theta}$}
\label{fig:exp_example}\vspace{-2mm}}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[scale=0.45]{images/dir_conv}
\vspace{-1mm}
\caption{\revised{The template kernel $k$ is mapped to the tangent plane in all directions to produce a rotational convolution with the pulled-back signal resulting in a directional signal over $x$}
\label{fig:exp_example}\vspace{-2mm}}
\end{figure}
\fi
Our key observation is that the convolution of a \emph{directional function} $\varphi$ with respect to a
template $k : T_0 \maths{R}^2 \rightarrow \maths{R}$ can be defined naturally, so that the result of the
convolution is, once again, a directional function. For this we first complete the exponential map,
so that for any point $p \in T_xX$ in the tangent plane of $x$, it produces both a point $y$ on $X$
and a unit direction in the tangent plane of $y$. To achieve this we define the completed
exponential map:
\begin{align}
\overline{\exp}^X_{x}(p) = (\exp_x^X(p), ~\Gamma_{x, p}(p/\|p\|)),
\label{eq:complete_exp}
\end{align}
where $\Gamma_{x, p}(p/\|p\|)$ is the parallel transport of the unit vector $p/\|p\|$ from
the tangent plane of $x$ to the tangent plane of $y=\exp_x^X(p)$ along the geodesic between $x$ and
$y$ with initial velocity $p/\|p\|$ \revised{(see Figure \ref{fig:comp_exp})}. Thus, for any point $p$ in the tangent plane of $x$, $\overline{\exp}^X_{x}(p)$ outputs a point
$y$ on the manifold and a vector in the tangent plane of $y$. Moreover, since parallel transport
along geodesics preserves the norms of vectors, $\Gamma_{x, p}(p/\|p\|)$ must also be
a unit vector. This map is well-defined everywhere, except at the origin $p=0$. This does not pose a
problem in our setting, however, since we only use this map inside an integral.
We now define \revised{\emph{multi-directional geodesic convolution}, or \emph{directional convolution} for short,} of a template
$k : T_0 \maths{R}^2 \rightarrow \maths{R}$ with a directional function $\varphi$ \revised{by}:
\begin{align}
\revised{(\varphi \star k) (x,v)} = \langle (\overline{\exp}^X_{x})^{*}\varphi, \tau_{x,v}^*k \rangle_{L^2}.
\label{eq:dirconv}
\end{align}
Note that, $\psi_x = (\overline{\exp}^X_{x})^{*}\varphi$ is a real-valued function in the tangent
plane of $x$, where $\psi_x(p) = \varphi(\overline{\exp}^X_{x}(p))$ \revised{(see Figure
\ref{fig:dir_conv_fig})}. Moreover, note that the result of a convolution of a directional
function $\varphi$ and a template $k$ is once again a directional function, as it depends both on
the point $x$ and on the direction $v$. \revised{We also remark that directional convolution can be
extended to regular-valued functions. Thus, for any $f:X \rightarrow \maths{R}$ we simply set:
$f \star k := \tilde{f} \star k$ where $\tilde{f}$ is the lifting of $f$ to a directional function,
as described above.}
\iffalse
Finally, observe that the template $k$ is rotated so that the reference direction is aligned
with $v$ before convolving it with $\psi$. This is crucial in the following, as it allows us to show
that this convolution does not depend on the arbitrary choice of a reference direction in each
tangent plane.
\fi
\vspace{2mm}
\subsection{\revisedt{Directional vs. Geodesic Convolution}}
As suggested in the previous section, \revised{geodesic convolution} introduced in
\cite{MasBosBroVan15} and our \revised{directional convolution} are closely related. Indeed, below
we show that \revised{directional convolution} is strictly more informative than \revised{geodesic
convolution}. The following proposition (proved in the Appendix) shows that \revised{geodesic
convolution} can be factorized by taking the maximal directional response of \revised{directional
convolution} thus losing the directional information.
\begin{Proposition}
Let $f$ a function on $X$ and $k$ a template. Denote by $\tilde{f} = (x, v) \mapsto f(x)$ the
directional function obtained via $\tilde{f}(x,v) = f(x)$ for all unitary $v\in T_x X$. Then:
\begin{align*}
f \circledast k ( x ) = \max_{v \in T_x X} \revised{(\tilde{f} \star k)(x, v)}
\end{align*}
\label{prop:dg_to_gc}
\end{Proposition}
\vspace{-3mm}
\revised{Intuitively, applying directional convolution allows to keep track of the direction \revised{that}
the signal \revised{comes from}. To illustrate this, we consider the directional convolution of the
indicator function $\mathbf{1}_{x}$ of a point $x$, by a shifted Dirac kernel $\delta_{(t, 0)}$
for some $t > 0$. It is easy to see that the result of $\mathbf{1}_{(x, v)} \star \delta_{(t, 0)}$
is the indicator function of the set of couples $(y, v)$ such that $y \in X$ is at (geodesic)
distance $t$ from $x$ and $v \in T_y X$ points in the direction of $x$ (see Figure \ref{fig:dirac}
for an illustration). Moreover, as also illustrated in Figure \ref{fig:dirac}, applying
directional convolution by $\delta_{(t, 0)}$ multiple times will propagate the signal along
geodesics from the source point $x$ while maintaining the directional information \revised{attached} to it.
In contrast, after angular max-pooling directional information to the source point is lost. This
means that when applying the basic geodesic convolution repeatedly (e.g. when stacking multiple
convolution layers in a neural network) the signal does not necessarily travel along geodesic
paths. Thus, for example,
$(\mathbf{1}_{x} \circledast \delta_{(t, 0)}) \circledast \delta_{(t, 0)}$ is a geodesic
\emph{ball} instead of a circle of radius $2t$ around $x$
(see Figure \ref{fig:dirac2}). This might
result in a loss of information and makes stacks of filters based on geodesic convolution less
efficient in estimating the distance between features or their relative position, compared to
directional convolution shown in Figure \ref{fig:3c}.
}
\begin{figure}[t!]
\centering
\subcaptionbox{\revised{$n$ dir-conv, \\ $\mathbf{1}_x \star \delta_t \star \dots \star \delta_t$} }{\includegraphics[width=1.2in, scale=1.0]{images/dirac_conv_big}}\hfill%
\subcaptionbox{\revised{ $n$ dir-conv, \\
$(\mathbf{1}_x + \mathbf{1}_y) \star \delta_t \star \dots \star \delta_t$} \label{fig:3c}}{\includegraphics[width=1.8in,
scale=1.0]{images/angle_dirac}}
\vspace{-1mm}
\caption{\revised{(left) The result of applying $n$ times the directed convolution \revised{by the shifted Dirac kernel $\delta_{(t,
0)}$ to the} indicator function $\mathbf{1}_x$ of point $x$. We obtain a response along the circle of radius $nt$ in the directions pointing to
$x$. This allows to detect the presence of a feature at a given distance and to point in the
direction of that feature. (right) The response of the convolution with two isolated signals at $x$ and $y$ is located along two circles, if they intersect the intersection points store information about the relative angle and distance between the features at $x$ and $y$.} \label{fig:dirac}}
\end{figure}
\begin{figure}[t!]
\centering
\subcaptionbox{$1$ conv + amp, \\ $\mathbf{1} \circledast \delta = \\ \max_v \mathbf{1} \star \delta(\bullet, v)$ \label{fig:dirac2a}}{\includegraphics[width=1.0in, scale=0.15]{images/fig5a}}\hfill%
\subcaptionbox{$2$ \revised{geod}-conv, \\ $(\mathbf{1} \circledast \delta)\circledast \delta$ \label{fig:dirac2b}}{\includegraphics[width=1.0in, scale=0.15]{images/fig5b}}\hfill%
\subcaptionbox{$2$ \revised{dir}-conv + amp,\\ $\max_v (\mathbf{1} \star \delta) \star \delta (\bullet, v)$ \label{fig:dirac2c}}{\includegraphics[width=1.0in,
scale=0.15]{images/fig5c}}
\vspace{-1mm}
\caption{\revised{Comparison between repeated geodesic (\revised{geod}, middle) and directional
convolution (\revised{dir}, right) of the indicator of a point $\mathbf{1}$ by a shifted
Dirac kernel $\delta = \delta_{t}$. (b) With directional convolution we obtain a response
along the circle of radius $2t$ indicating the presence of a feature at \emph{exactly}
distance $2t$ (c) With geodesic convolution, we obtain a response along the full disc of
radius $2t$ only indicating the presence of a feature at distance $\leqslant 2t$.}
\vspace{-3mm} \label{fig:dirac2}}
\end{figure}
\revised{
We also note briefly that directional geodesic convolution does not admit an identity kernel
but identity can be obtained as a limit of convolutions by shifted Dirac kernels since:
\begin{align*}
\lim_{t \rightarrow 0} \overline{\exp}^X_x(tv) = (x,v).
\end{align*}
}
\begin{figure*}[t!]
\includegraphics[width=\textwidth]{images/pipeline_figure_v2_2}
\iffalse\caption{\revised{Illustration of directional convolution, we start by a directional function (left). To each point we attach the circle formed by its unit tangent vector, a directional function associate a value to any such vector. The completed exponential map at a point $x \in X$ sends tangent vectors at $x$ to unit tangent vectors at other points this allow to pull-back the directional function to the tangent plane at $x$ (middle). Given a unit vector $v$ tangent at $x$ there is a unique orthogonal orientation preserving linear map $\tau_{x,v}$ from $T_x X$ to $\maths{R}^2$ sending $v$ to $e := (1, 0)$. We can pull back a kernel $k$ defined over $\maths{R}$ to $T_x X$ and take its $L^2$ product with the pull-back of the directional function. That way we obtain a single values for each unit tangent vector at $x$, repeating this procedure at every point we obtain a directional function which is the directional convolution by of the original directional function by the kernel $k$.}}\fi
\caption{\revised{Overview of our directional convolution: \textbf{(left)} we start with a surface
$X$ and a directional function $\varphi$, which assigns a real value to every unit
direction in the tangent plane of every point of $X$, shown here as a cone above some
points. \textbf{(middle)} given a point $x \in X$, we pull back $\varphi$ onto the tangent plane
of $x$ by computing for every point $p \in T_x X$, its image $y \in X$ via the
exponential map, and the transport of the unit vector $p/\|p\|$ to the tangent plane of $y =
\exp^X_x(p)$. We assign to $p$ the value of $\varphi$ at $y$ and the transported vector. By
repeating this for every $p$ we obtain a real-valued function $\psi_x$ over the tangent plane of
$x$. \textbf{(right)} Given a unit vector $v$ tangent at $x$ there is a unique orthogonal
orientation-preserving linear map $\tau_{x,v}$ from $T_x X$ to $\maths{R}^2$ sending $v$ to $e := (1,
0)$. We pull back a kernel $k$ defined over $\maths{R}^2$ to $T_x X$ and take its $L^2$ product with
$\psi_x$ giving us a real-number for each unit tangent vector at $x$. Repeating this procedure
for every $x\in X$ we obtain a new directional function which is the directional convolution of $\varphi$ by the kernel $k$.
\label{fig:dir_conv_fig}}}
\end{figure*}
\revised{\subsection{Directional Convolution in Angular Coordinates}}
The expression in Eq. (\ref{eq:dirconv}) is coordinate-free, however to implement it we must choose a particular
coordinate system to represent directional functions. In practice, we represent tangent vectors in polar coordinates in
their tangent plane. This representation implies an arbitrary choice of reference direction $e_x \in T_x X$ in each
tangent plane. For any angle $\theta \in [0, 2\pi)$ we denote by $e_x(\theta) = R_{\theta} e_x$, the vector obtained
by rotating $e_x$ by angle $\theta$ in the tangent plane at $x$. Instead of operating with directional functions,
we then work with \emph{angular functions} as follows: given a directional function $\varphi$, and a choice of reference
direction $e_x$ for each point $x$, we define an angular function $\varphi_e$ by:
\[
\varphi_e ( x, \theta ) := \varphi(x, e_x(\theta )).
\]
\revised{that is, $\varphi_e$ is just the function $\varphi$ expressed in polar coordinates in each tangent plane with respect to the reference direction $e$.}
Note also that given \revised{reference directions $e_x \in T_x X$ for all $x \in X$}, both the exponential map and the
parallel transport can be expressed for points and vectors described in polar coordinates in each
tangent plane \revised{(see Appendix)}. Finally, given the family of reference directions \revised{$e = (e_x)_{x \in X}$} \iffalse(with a slight notation abuse with $e$
referring to a reference direction in the plane and a family of reference directions on $X$),\fi and the angular function
$\varphi_e$ we denote by $\varphi_e \star k$ its \revised{directional convolution} with kernel $k$ w.r.t. $e$. To define this
operation, we first convert $\varphi_e$ to its directional counterpart, using the reference directions $e$
and then simply apply the definition given in Eq. (\ref{eq:dirconv}) above \revised{and convert it back to an angular function using the same reference directions:
\[
\varphi_e \star k := (\varphi \star k)_e
\]
The following proposition (proved in the Appendix) shows that the result of \revised{directional convolution} of angular functions is
\emph{equivariant} with respect to the change of the reference directions. Namely:}
\begin{Proposition}
\label{prop:equivar}
Let $e_x \in T_x X$ be a family of unit tangent vectors defined at every point $x \in X$ then for any family of rotations $R_x$ of angle $\theta_x$ at point $x$ we have:
\[
\revised{(\varphi_{R e} \star k)( x, \theta )
=
(\varphi \star k)_{R e}(x, \theta)
=
(\varphi_{e} \star k)(x, \theta + \theta_x )}
\]
Where $(R e)_x := R_xe_x$ at each point $x$.
\end{Proposition}
This proposition guarantees that even if we pick an arbitrary reference direction in the tangent
plane of every point $x$, the result of possibly multiple \revised{directional convolution} steps is the
same up to an angle offset. Moreover, this offset is fixed and is the angle difference between the
two reference directions.
\revised{When directional convolution operator $\star$ is defined directly in angular coordinates,
and angles are discretized in angular bins, as they are in our practical implementation, this
implies that changing the reference direction at a given point by applying a circular permutation
to the angular bins' indices will lead to the same permutation of the result of \revised{directional
convolution}.} Thus, no further ambiguity is introduced between layers of \revised{directional convolution}, and the
initial rotational ambiguity is lifted to the last layer. We resolve it by applying angular max
pooling. This is crucial to learning since it allows learn the same features independently of the
\revised{reference directions used to define the angular coordinates}.
\revised{
\subsection{Multi-Directional Convolutional Neural Networks}
Our main motivation for introducing directional convolution is to use it as a layer inside a deep
neural network for shape analysis tasks. We define a directional convolution layer simply by
replacing the standard convolution (resp. geodesic convolution) operator and regular functions by
directional functions in the convolutional layer definition.
Crucially, since directional convolution by a template kernel results in another
directional function, we can stack \emph{directional convolutional layers} in a neural network.
Since the input of the network is typically given as a regular signal $f: X \rightarrow \maths{R}^d$ we first
convert it into a directional function, by setting $\tilde{f}(x, v) := f(x)$ for all
$x \in X$ and any unit vector $v \in T_x X$. A convolutional neural network has stacks of learnable
template kernels $k^i_{pq}: \maths{R}^2 \rightarrow \maths{R}$, a collection of learnable bias vectors $b^i$, and
activation functions $\xi_i$. In the simplest setting, we can stack layers sequentially so that the
output of $(i+1)^{\text{st}}$ layer of the network is defined by:
\[
\left\{
\begin{array}{ll}
y_0(f) = \tilde{f} \\
(y_{i+1})_p := \xi_{i+1} (\sum_q ((y_i)_q \star k^i_{pq}) + b^i_p)
\end{array}
\right.
\]
Our goal during training is then to learn the parameters $k_{pq}^i$ and $b^i$ so that the output function
minimizes some error for a set of examples. In practice, we consider more complex
architectures, as described in Section \ref{sec:eval}. In all cases, angular max pooling is applied
to the last layer $y_n$ to obtain a regular signal over $X$. We call networks based on
directional convolution MDGCNN for Multi Directional Geodesic Convolutional Neural Networks. }
\subsection{Synchronized Convolution in practice}
The expression $(3)$ is coordinate free, however to implement it we must choose a representation of the data.
We represent tangent vectors in polar coordinates in their tangent plane. This representation implies an arbitrary choice of origin direction $e_x \in T_x X$ in each tangent plane. For any (non null ) tangent vector $v \in T_x X$ we denote by $e_x ( v )$ the angle corresponding to the vector $v$. We express directional functions as functions over $X \times [0, 2\pi[$ we call them angular functions. Given a directional function $\varphi$ we obtain an angular function $\varphi_e$ defined by:
\[
\varphi_e ( x, \theta ) := \varphi(x, e_x^{-1}( \theta )).
\]
We express the exponential map and the parallel transport with respect to $e_x$ for any radius $r > 0$ and angles $\theta, \theta_1, \theta_2 \in [0, 2\pi[:$
\[
\exp_{x, e_x}^X(r, \theta) := \exp_x^X( re_x^{-1}(\theta) )
\]
\[
\Gamma_{x, (r, \theta_1)}^{e}( \theta_2 ) := e_{\exp^X_{x, e_x}(r,\theta_1)} \big( \Gamma_{x, e_x^{-1}(\theta_1)} \big)
\]
\[
\overline{\exp}_{x}^{X,e}(r, \theta) = (\exp_{x, e_x}^X(r, \theta), \Gamma_{x, (r, \theta)}^{e}( \theta ))
\]
\begin{figure}[H]
\centering
\includegraphics[scale=0.65]{images/transport_practice}
\caption{Pull-back of angular function}
\end{figure}
we also express the kernel alignment map by:
\[
\tau_{x, \theta}^e := \tau_{x, e_x^{-1}(\theta)}.
\]
Given an angular function $\tilde{\varphi}$ we denote by $\tilde{\varphi} *_e k$ it synchronized convolution with kernel $k$:
\begin{align}
\tilde{\varphi} \star_e k (x,\theta) = \langle (\overline{\exp}^{X,e}_{x})^{*}\tilde{\varphi}, (\tau_{x,\theta}^e)^*k \rangle.
\end{align}
The following proposition/theorem shows that this construction of synchronized convolution is equivariant with respect to the choice of reference direction. Namely,
\begin{Proposition}
Let $e_x \in T_x X$ be a family of unit tangent vectors defined at every point $x \in X$ then for any family of rotation matrices $R_x$ of angle $\theta_x$ we have:
\[
\varphi_{R.e} \star_{R.e} k( x, \theta ) = \varphi_{e} \star_e k(x, \theta + \theta_x )
\]
Where $(R.e)_x := R_x.e_x$.
\end{Proposition}
\begin{proof}
\[
\varphi_{R.e}(x, \theta) = \varphi_{e}(x, \theta + \theta_x)
\]
\[
\tau_{x, \theta}^{R.e} = \tau_{x,\theta + \theta_x}^e.
\]
\[
\exp_{x, R.e_x}^X(r, \theta) = \exp_{x, e_x}^X(r, \theta + \theta_x)
\]
Thanks to orthogonality of parallel transport we have:
\[
\begin{aligned}
&
\Gamma_{x, (r, \theta_1)}^{R.e}( \theta_2 )
\\
&
=
\Gamma_{x, (r, \theta_1+\theta_x)}^{e}( \theta_2 + \theta_x) + \theta_{\exp^X_{x, e_x}(r, \theta + \theta_x)}
\\
&
=
\Gamma_{x, (r, \theta_1+\theta_x)}^{e}( \theta_2 ) + \theta_x + \theta_{\exp^X_{x, e_x}(r, \theta + \theta_x)}
\end{aligned}
\]
Thus
\[
\begin{aligned}
&
(\overline{\exp}^{X,R.e}_{x})^{*}\varphi_{R.e}(x, (r,\theta))
\\
&
=
\varphi_{R.e}(\exp_{x, e_x}^X(r, \theta + \theta_x), \Gamma_{x, (r, \theta_1+\theta_x)}^{e}( \theta_2 ) + \theta_x + \theta_{\exp^X_{x, e_x}(r, \theta + \theta_x)}
\\
&
=
\varphi_e(\exp_{x, R.e_x}^X(r, \theta + \theta_x), \Gamma_{x, (r, \theta_1+\theta_x)}^{e}( \theta_2 ) + \theta_x)
\\
&
=:
(\overline{\exp}^{X,e}_{x})^{*}\varphi_{e}(x, (r,\theta + \theta_x)).
\end{aligned}
\]
Hence:
\[
\begin{aligned}
&
\varphi_{R.e} \star_{R.e} k (x,\theta)
\\
&
=
\langle (\overline{\exp}^{X, R.e}_{x})^{*}\varphi_{R.e}, (\tau_{x,\theta}^{R.e})^*k \rangle.
\\
&
=
\langle (\overline{\exp}^{X, e}_{x})^{*}\varphi_{e}(\bullet, \bullet + \theta_x), (\tau_{x,\theta+\theta_x}^e)^*k \rangle
\\
&
=
\varphi_{e} \star_{e} k (x,\theta + \theta_x)
\end{aligned}
\]
\end{proof}
To define an analogue of convolutional neural networks as defined in the previous section over triangle meshes we must discretize its key ingredients:
\begin{itemize}
\item Volume measure
\item Tangent space
\item Exponential map
\item Frame transporter
\end{itemize}
\begin{Definition}[Triangle mesh]
A triangle mesh $M$ is the data of two matrices $V^M \in M_{\mathrm{nv}(M), 3}$ and $F^M \in M_{\mathrm{nf}(M),3}(\mathbb{N})$. Such that for all $ i, j, F^M_{ij} \in [|1; \mathrm{nv}(M)|]$ and $F^M_{i,1}, F^M_{i,2}, F^M_{i,3}$ are distinct. The rows of $V^M$ are the vertices coordinates in $\maths{R}^3$ and the rows of $F^M$ the triangles. We also require that two triangles have either $0$ or $2$ vertices in common and three triangles can’t have more than one vertex in common.
\end{Definition}
We refer to the vertices by the index of the corresponding row of $V^M$. Two vertices $ i,j$ are said to be neighbors if there exist a triangle containing them both, we denote this relation by $i \sim_M j$.
We say that a triangle $F_j$ is adjacent to a vertex $i$ if it contains $i$ and we also denote this relation by $F_j \sim_M i$. For any vertex $i$ we denote by:
\[
\mathcal{N}^M( i ) := \{ j \vert \ i \sim_M j, j \neq i\}
\]
its set of neighbors. We denote by $n^M(i) := |\mathcal{N}^M(i)|$ the number of neighbors of $i$.
\begin{Definition}[Volume measure]
The volume measure of a triangle mesh $M$ is the measure $\mu^M$ on the set of vertices of $M$ such that for each vertex $i$, $\mu^M_i$ is the sum of the areas of the triangles adjacent to $i$.
\end{Definition}
\begin{Definition}[Neighbors listing procedure]
Let $i$ a vertex of a triangle mesh $M$ denote by:
\[
\mathcal{S}^M(i) := \{(j,k) \in \mathcal{N}^M(i)^2 \ \vert \ k \sim_M j \}
\]
Let $(s_1, s_2) \in \mathcal{S}^M(i)$, we define its successor $s_3 = s^M(j_1, j_2) \in \mathbb{N}$ to be the neighbor by the conditions $s_3 \neq j_2$, $s_3 \sim_M i$, $s_3 \sim_M s_2$ if they can be satisfied or by $-1$ otherwise. We can define the list $s = L^M(j_1, j_2)$ recursively by $s_{i+1} = s^M(s_{i-1},s_{i})$ until $s_i$ has already been listed or $s_i = -1$.
Denote by $l = l^M(s_1, s_2)$ the length of this list. If $l = n^M(i)$ for any choice of $(s_1, s_2)$ we say that $i$ is an interior point, otherwise we say that $i$ is a boundary point.
\end{Definition}
For simplicity we may assume that our mesh has no boundary points.
\begin{Definition}[Tangent bundle of a mesh]
Let $i$ be an interior vertex of a mesh $M$ let $s_1, \dots , s_{n^M(i)}$ a listing of $\mathcal{N}^M(i)$ according to the previously described procedure. For each $j$ denote by $e_j$ the edge $(i, s_{j})$ and by $\theta_j$ the angle between edges $e_j$ and $e_{(j+1) \ \mathbf{mod} \ n^M(i)}$ we normalize the $(\theta_j)$ to produce angles
$
\alpha_j := (2\pi\theta_j)/(\sum_{k=1}^{n^M(i)} \theta_k)
$.
This gives polar coordinates on $D^M(i) := \{i\} \cup \mathcal{N}^M(i)$, $i$ being at the origin and $s_{j}$ having norm $\Vert V^M_{s_{j},\bullet} - V^M_{i,\bullet} \Vert_2$ and angle $\sum_{k = 1}^{i-1} \alpha_k$. Using this system of polar coordinates we an embedding $\iota: D^M(i) \hookrightarrow \maths{R}^2$ and a surjective linear map $f: \mathrm{Span}_{\maths{R}}((e_j)_j) \rightarrow \maths{R}^2$ defined by $f(e_j) :=
\iota(s_j) - \iota(i)$ we define the tangent space $T_i M$ to $M$ at vertex $i$ to be the quotient space:
\[
T_i M = \mathrm{Span}_{\maths{R}}(e_1, \dots, e_{n^M(i)}) \big/ \mathrm{Ker}(f) \simeq \maths{R}^2.
\]
This construction is independent of the particular choice of indexing made to construct the listing. The space $T_i M$ inherits the inner product of $\maths{R}^2$. We denote by $g_i^M$ the inner product on $T_i M$ defined by:
\[
g_i^M( e_j, e_{(j+1) \ \mathbf{mod} \ n^M(i)} ) = \alpha_i.\Vert e_j \Vert_2.\Vert e_{(j+1) \ \mathbf{mod} \ n^M(i)} \Vert_2.
\]
We denote by $\Vert \bullet \Vert_i^M$ the associated norm. The collection of tangent spaces $(T_i M)$ gives a bundle $TM$ over the discrete space of vertices of $M$ called the tangent bundle of $M$. Each tangent space being equipped with an inner product we also have a notion of orthonormal frame bundle $F_{\mathrm{O}} M$.
\end{Definition}
Now that we have defined the tangent bundle we must define the exponential map and the frame transporter. The set of vertices of the mesh $M$ is discrete and the tangent space to a vertex being continuous it is more convenient to compute geodesic polar coordinates (GPC) (inverse of the exponential map) which gives us an embedding of the set of vertices to the tangent space. A construction of GPC inspired by the methods of fast marching \cite{sethian1999level} has been proposed in \cite{melvaer2012geodesic}. The idea is to compute GPC on $D^M(s)$ and to extend them to the whole mesh using an update procedure that takes the GPC estimates over two adjacent vertices and produces an estimate of the GPC over their common neighbors. We propose an extension of the update scheme to compute the frame transporter jointly. First we describe the update procedure at a vertex $i$ of $M$. For all vertex $i$ we denote by $r_{si}, \theta_{si}$ the estimates at $i$ of the radius and angle of the GPC centered at $s$. We list all $\mathcal{N}^M(i)$ according to the neighbors listing procedure. This defines GPC $(r_{ij}, \theta_{ij})$ on each $D^M(i)$ those GPC are defined up to cyclic permutation and order reversion of the listing. We can represent tangent vectors using these local GPC, in particular tangent vectors can be represented only by their angle. We denote by $u^1_{s}$ and $u^2_{s}$ the angles corresponding to the first and second vector of the orthonormal basis induced by the local GPC at vertex $s$ and by $u^1_{si}$ and $u^2_{si}$ the angles corresponding to the estimates of transport to vertex $i$. This gives us an estimate of the parallel transport along a "virtual" geodesic going from $s$ to $i$ in the bases $(u_s^1, u_s^2)$ and $(u_i^1, u_i^2)$. For all $(j,k) \in \mathcal{S}^M(i)$ denote by $e_{ij}, e_{ik} \in T_i M$ the corresponding edges considered as tangent vectors. Denote by $s_{ijk} \in T_i M$ the vector such that:
\[
\Vert e_{ij} - s_{ijk} \Vert_i^M = r_{sj}, \ \ \Vert e_{ik} - s_{ijk} \Vert_i^M = r_{sk}.
\]
The new estimate $\tilde{r}_{si}$ of the radius at $i$ is obtained by:
\[
\tilde{r}_{si,jk} := \min \big\{ \Vert y - s_{ijk} \Vert_i^M + \Vert y \Vert_i^M \ \big\vert \ y \in [e_{ij}, e_{ik}] \big\}.
\]
Denote by $y_{ijk} \in T_i M$ the vector achieving the above minimum, by $\phi_{ij}$ the angle between $e_{ij} - s_{ijk}$ and $-s_{ijk}$ and by $\phi_{kj}$ the angle between $e_{ij} - s_{ijk}$ and $e_{ik} - s_{ijk}$ and by $\alpha = \phi_{ij} / \phi_{ik}$. angles $a_1$ and $a_2$ they define two angular sectors, we suppose that one is smaller, thus it the one that smaller than $\pi$. For $t \in [0, 1]$ the convex combination $(1-t).a_1 + t.a_2$ can be defined in two ways depending on which angular sector we consider. We denote by $\mathrm{mix}(t, a_1, a_2)$ the angle corresponding to the convex combination according to the smaller angular sector. The update $\tilde{\theta}_{si}$ of the angle coordinate at vertex $i$ is defined by:
\[
\tilde{\theta}_{si,jk}
:=
\left\{
\begin{array}{l}
\theta_{sj}, \ \text{if} \ \ y_{ijk} = e_{ij} \\
\theta_{sk}, \ \text{if} \ \ y_{ijk} = e_{ik} \\
\mathrm{mix}(\alpha, \theta_{ij}, \theta_{ik}), \ \text{else}
\end{array}
\right.
\]
We extend the update scheme to compute the parallel transport. We need a way to transfer unit vectors from a vertex $j$ to an adjacent vertex $i \sim_M j$. We have listings $s_{k,1}, \dots , s_{k,n^M(k)}$ of $\mathcal{N}^M(k)$ for all vertex $k$, define $i_{ji}$ by $i = s_{j,i_{ji}}$ we say that vertices $j$ and $i$ have compatible orientation if:
\[
s_{j,(i_{ji}+1) \ \mathbf{mod} \ n^M(j)} = s_{i,(i_{ij}-1) \ \mathbf{mod} \ n^M(i)}.
\]
If two vertices are not orientation compatible we can reverse the order of the listing of the second vertex to make them compatible. Starting from one seed vertex we can propagate its orientation to other vertices using a Dijkstra like traversal of the mesh, therefore we can assume that all adjacent vertices are orientation compatible. Let $u \in T_j M$ a unit tangent vector at $j$ given as an angle in the local GPC of $j$ then we define its transport along $e_{ji}$ by:
\[
\rho_{ji}(u) = u + \theta_{ij} - \theta_{ji} + \pi.
\]
The updates $\tilde{u}^{l}_{si}$ (for $l = 1, 2$) of the transported basis $(u^1_s, u^2_s)$ is defined by:
\[
\tilde{u}^{l}_{si,jk}
:=
\left\{
\begin{array}{l}
\rho_{ji}(u^l_{sj}), \ \text{if} \ \ y_{ijk} = e_{ij} \\
\rho_{ki}(u^l_{sk}), \ \text{if} \ \ y_{ijk} = e_{ik} \\
\mathrm{mix}(\alpha, u^l_{ij}, u^l_{ik}), \ \text{else}
\end{array}
\right.
\]
For any vertex $i$ we denote by:
\begin{itemize}
\item $\tilde{r}_{si} := \min \big\{ \tilde{r}_{si, jk} \ \big\vert \ (j,k) \in \mathcal{S}^M(i) \big\}$.
\item $\tilde{\theta}_{si} := \tilde{\theta}_{si,jk}$ for $\tilde{r}_{si,jk} = \tilde{r}_{si}$.
\item $\tilde{u}_{si} := \tilde{u}_{si,jk}$ for $\tilde{r}_{si,jk} = \tilde{r}_{si}$.
\end{itemize}
We initialize the frame transport at each neighborhoods $D^M(i)$ by setting $u_{ii}^l = u^l_i$ and for all $j \in \mathcal{N}^M(i)$, $u^l_{ij} = \rho_{ij}(u^l_i)$. The basic structure of the algorithm for computing the GPC and frame transport centered at a vertex $s$ is the following:
\begin{algorithm}
\caption{GPC and frame transport algorithm}\label{}
\begin{algorithmic}[1]
\State $\mathrm{candidates.Empty}()$\Comment{free candidates list}
\For{$i = 1, \dots \mathrm{nv}(M)$}
\State $r_{si} = +\infty$
\EndFor
\State $\mathrm{initNeigbourhood}(s)$\Comment{init estimates on $D^M(s)$}
\State $\mathrm{candidates.Push}(D^M(s))$\Comment{add $D^M(s)$ to candidates}
\While{$\mathrm{candidates.notEmpty()}$}
\State $j = \mathrm{candidates.smallestNode()}$ \Comment{w.r.t. r}
\For{$k \in \mathcal{N}^M(j)$}
\If{$r_{si} > (1+\epsilon).\tilde{r}_{si}$} \Comment{precision $\epsilon > 0$}
\State \Comment{update estimates}
\State $r_{si} \gets \tilde{r}_{si}$
\State $\theta_{si} \gets \tilde{\theta}_{si}$
\State $u_{si} \gets \tilde{u}_{si}$
\State \Comment{if stopping criterion is not met}
\If{!$\mathrm{stopCriterion}(i)$}
\State \Comment{add $i$ to candidates}
\State $\mathrm{candidates.push(i)}$
\EndIf
\EndIf
\EndFor
\EndWhile\label{endwhile}
\end{algorithmic}
\end{algorithm}
Different choices of stopping criterion are possible we may choose $\tilde{r}_{si} > R_{\mathrm{max}}$ to save computations and memory.
\subsection{Patch operator}
\begin{Definition}[Patch operator]
Let $k : (\maths{R}^n)^2 \rightarrow \maths{R}$ a kernel for any $x \in X$ and $e \in F_x X$ we can pull it back to $\maths{R}^n \times T_x X$ by $\mathrm{Id} \times e$. The (normalized) patch operator at $x$ associated to the kernel $k$ is the operator sending each function $f: X \rightarrow \maths{R}$ to the function:
\[
\begin{array}{l|rcl}
f * k : & (X\times \maths{R}^n) \times_X FX & \longrightarrow & \maths{R} \\
& (y, e) \in \maths{R}^n \times F_x X & \longmapsto & \frac{f * k(y, \bullet)(e)}{ 1 * k(y, \bullet)(e) } .
\end{array}
\]
where $(X\times \maths{R}^n) \times_X FX = \bigsqcup_{x \in X} \maths{R}^n \times F_x X$.
\end{Definition}
A close construction of the patch operator for surfaces has been proposed by Kokkinos et al.\cite{kokkinos2012intrinsic}.
In practice for surfaces it is more convenient to work with geodesic polar coordinates instead of exponential maps. That is around each point $x \in X$ we have an open subset $x \in U_x \subset X$ given a frame $e\in F_x X$ we have polar coordinates:
\[
\theta_x^e: U_x \rightarrow [0, 2\pi[, \ \ r_x^e: U_x \rightarrow \maths{R}_+
\]
defined by:
\[
\left\{
\begin{array}{l}
\theta_x^e(\exp_x^X(r(\cos(\theta)e_1 + \sin(\theta)e_2))
=
\theta
\\
r_x^e(\exp_x^X(r(\cos(\theta)e_1 + \sin(\theta)e_2))
=
r
\end{array}
\right.
\]
Following the construction of \cite{kokkinos2012intrinsic} we can define the patch operator at $x$ by:
\[
f * k (y, e)
:=
\frac{1}{K}\int_{U_x} f( z ) k(y, r_x^e(z) \exp(i \theta_x^e(z) ) ) d\mu^X( z )
\]
where
\[
K
=
K(x,y,e)
:=
\int_{U_x} k(y, r_x^e(z) \exp(i \theta_x^e(z) ) ) d\mu^X( z ).
\]
Note that if $k(y, r_x^e(\bullet) \exp(i \theta_x^e(\bullet) ) )$ is supported on $U_x$ for all $x \in X$ and $y \in \maths{R}^n$ this construction coincides with our definition of patch operator. From now on we assume that we have a kernel $K$ is of the form:
\[
\begin{array}{l|rcl}
K : & (\maths{R}^2) & \longrightarrow & \maths{R}_+ \\
& (r_1e^{i\theta_1}, r_2e^{i\theta_2}) & \longmapsto & \tilde{K}(r_1, r_2, \theta_2 - \theta_1) .
\end{array} (*)
\]
for some map $\tilde{K}: \maths{R}_+^2 \times S^1 \rightarrow \maths{R}_+$ so that applying rotation on $\maths{R}^2$ or on the tangent plane is equivalent in the sense that for any angle $\theta$ we have:
\[
f * K (e^{-i\theta}y, e) = f * K (y, \theta.e)
\]
where $\theta.e$ is the rotation of the frame $e$ by angle $\theta$.
\subsection{Geodeisc convolutional neural networks}
In \cite{MasBosBroVan15} Boscaini et al. use the above patch operator construction to introduce the notion of geodesic convolutional layer on which they build a deep learning framework. Suppose $X$ is an oriented surface the geodesic convolutional operator is defined for an arbitrary choice positively oriented frame $e_x$ at every point $x$ by:
\[
\mathrm{gc}(a, f)(x, \theta)
:=
\int_{\maths{R}_+} \int_{S^1} a(t - \theta, r)f*k(re^{it}, e_x) \ dt dr.
\]
for any weight function $a: S^1 \times \maths{R}_+ \rightarrow \maths{R}$. In a geodesic convolutional layer the map $a$ is discretized, the goal is to learn a vector contaning its values at certain locations. In general there is no canonical choice for the family $(e_x)_x$ therefore \cite{MasBosBroVan15} propose to follow the geodesic convolutional operator by angular max pooling defined for any function $h : X \times S^1 \rightarrow \maths{R}$ by:
\[
\mathrm{amp}(h)(x) := \sup \{ |h(x, \theta)|, \ \theta \in S^1 \}
\]
This method however has a major drawback compared to usual convolutional neural networks on euclidean domains (e.g. images). Due to the angular max pooling the directional relationship between the filters of two convolutional layers is lost. We propose to remedy to this limitation by synchronizing the convolutional layers by transporting the frames used to compute the second layer to the rest of the surface using parallel transport so that the choice of frame used to compute the output the second layer induces choices of frames for the previous layer so that we know the relationship between the frames used to compute consecutive layers. To motivate our construction further we may come back to our interpretation of convolution over $\maths{R}^n$:
\[
f * k ( x )
=
\langle \mathrm{Id}_x^*f, \tau_{-x}^*k \rangle_{L^2(T_x \maths{R}^n)}
\]
As we saw the exponential map can be seen as a generalization of $\mathrm{Id}_x$, we propose to also generalize $\tau_{-x}$. We have the following identification: $T_0 \maths{R}^n = \maths{R}^n$, therefore we can see $\tau_{-x}: T_x \maths{R}^n \rightarrow T_0 \maths{R}^n$ as a linear isometry. Note that $\tau_{-x}$ is the inverse of parallel transport operator along the geodesic joining $0$ to $x$. The choice of origin in $\maths{R}^n$ and of orthonormal frame at the origin is arbitrary but whatever choice we do we can always transport the frame to all other points. We generalize this observation by introducing the notion of frame transporter, Let $X$ be a Riemannian manifold, for all $x \in X$ and $v \in T_x X$ denote by
\[
\rho_{(x,v)}^X: T_x X \rightarrow T_{\exp^X_x(v)}
\]
the parallel transport operator along the geodesic path $t \in [0, 1] \mapsto \exp_x^X(tv)$ starting at $x$ with speed $v$. The map $\rho_{(x,v)}^X$ being a linear isometry it sends frames over $x$ to frames over $\exp^X_x(v)$.
\begin{Definition}[Frame transporter]
Let $X$ be a Riemannian manifold and
\[
TX \times_X FX := \bigsqcup_{x \in X} T_x X \times F_x X
\]
The frame transporter of $X$ is the map:
\[
\begin{array}{l|rcl}
F^X : & TX \times_X FX & \longrightarrow & FX \\
& (v, e) \in T_x X \times F_x X & \longmapsto & \rho_{(x,v)}^X(e)
\end{array}
\]
\end{Definition}
We define the convolution of a function $\tilde{f}: TX \times_X FX \rightarrow \maths{R}$ by a template $k: \maths{R}^n \rightarrow \maths{R}$ by:
\[
\begin{array}{l|rcl}
\tilde{f} * k : & FX & \longrightarrow & \maths{R} \\
& e \in F_x X & \longmapsto & \int_{T_x X} \tilde{f}\vert_{T_x X \times F_x X}(\bullet, e) \ e^*k \ d\mu_x^X.
\end{array}
\]
We can now define the notion of synchronized convolution:
\begin{Definition}
Let $f: FX \rightarrow \maths{R}$ a function. We define its "synchronized" convolution by a function $k: \maths{R}^n \rightarrow \maths{R}$ by:
\[
f \star k := \big( (F^X)^*f \big) * k : FX \rightarrow \maths{R}
\]
\end{Definition}
We have a projection map $\pi_{FX}: FX \rightarrow X$ sending $F_x X$ to $\{x\}$ therefore we can extend the notion of synchronized convolution to functions $f: X \rightarrow \maths{R}$ by setting:
\[
f \star k := (\pi_{FX}^*f) \star k.
\]
We observe that this construction generalizes the usual notion of convolution in the following way: Let $f: \maths{R}^n \rightarrow \maths{R}$ we have:
\[
f \star k( e_x ) = f * k ( x )
\]
where $e_x$ is the transport of the canonical basis of $\maths{R}^n$ to $T_x \maths{R}^n$ and $f * k$ is the usual convolution. Notice that with this definition of convolution the convolution of a function over the frame bundle is still a function over the frame bundle. Following the definition of original patch operator proposed by \cite{MasBosBroVan15} We define the synchronized patch operator as follows:
\begin{Definition}[Synchronized patch operator]
Let $K: (\maths{R}^n)^2 \rightarrow \maths{R}_+$ a kernel the synchronized patch operator associated with $K$ is the map $\mathrm{SP}[K]$ sending any function $f: FX \rightarrow \maths{R}$ to the function:
\[
\begin{array}{l|rcl}
f \star K : & (X \times \maths{R}^n) \times_X FX & \longrightarrow & \maths{R} \\
& (y, e) \in \maths{R}^n \times F_x X & \longmapsto & \frac{f \star K(y, \bullet)( e ) }{1 \star K(y, \bullet)( e )}
\end{array}
\]
\end{Definition}
For the associated synchronized geodesic convolutional layer on surfaces we propose a slightly different definition that \cite{MasBosBroVan15}. First, we no longer assume that the surface is oriented an second we take into account the distortion induced by passing to polar coordinates when evaluating the layer at a weight function $a: S^1 \times \maths{R}_+$. Recall that the orthogonal group $\mathrm{O}(2)$ is composed of two connected components $\mathrm{O}_+(2) := \mathrm{SO}(2)$ and $\mathrm{O}_-(2)$ that are both isomorphic to the unit circle $S^1$. Denote by $\tau$ the complex conjugation and identify $e^{i\theta}$ with the rotation matrix of angle $\theta$. We have:
\[
\left\{
\begin{array}{l}
\mathrm{O}_+(2) = \{e^{i\theta} \ \vert \ \theta \in [0, 2\pi] \} \} \\
\mathrm{O}_-(2) = \{e^{i\theta}\tau \ \vert \ \theta \in [0, 2\pi] \} \}
\end{array}
\right.
\]
\begin{Definition}[Synchronized geodesic convolutional layer (SGCL)]
Fix an arbitrary choice of frames $e_x$ over all $x \in X$. The synchronized geodesic convolutional layer associated to a kernel $K$ satisfying the symmetry condition $(*)$ is defined for any function $f: FX \rightarrow \maths{R}$ and weight function $a: S^1 \times \maths{R}_+ \rightarrow \maths{R}$ by:
\[
\begin{aligned}
&
\mathrm{sgc}^X_K(a,f)(e^{i\theta}e_x)
:=
\int_{\maths{R}_+} \int_{S^1} a(t-\theta,r)f \star K(re^{it}, e_x) \ dt dr
\\
&
\mathrm{sgc}^X_K(a,f)(e^{i\theta}\tau e_x)
:=
\int_{\maths{R}_+} \int_{S^1} a(t-\theta,r)f \star K(re^{-it}, \tau e_x) \ dt dr
\end{aligned}
\]
\end{Definition}
Note that the choice of local frames $e_x$ defining the SGCL is arbitrary therefore we must study the impact of rotations and reflexions of the frames on the definition. We define the orthogonal group of $TX$ as the free product of the orthogonal groups of the tangent spaces over all points of $X$:
\[
\mathrm{O}(TX) := \prod_{x \in X} \mathrm{O}(T_x X)
\]
The group $\mathrm{O}(TX)$ acts transitively on $FX$ by:
\[
(\theta_x)_{x \in X}.(e_x)_{x \in X}
:=
(\theta_x(e_x))_{x \in X}
\]
This action also extends to the space of function over $FX$ by:
\[
\theta.f( e )
:=
f( \theta^{-1}.e ).
\]
Suppose we are given two choices of frames $(e_x)_{x \in X}$ and $(u_x)_{x \in X}$ then there exists a unique $\theta \in \mathrm{O}(TX)$ such that:
\[
u_x := \theta_x^{-1} e_x, \ \forall x \in X.
\]
We have
We say that an operator $\rho$ sending functions over $FX$ to function over $FX$ is rotation equivariant if:
\[
\rho( \theta.f ) = \theta.\rho( f ), \
\forall f: FX \rightarrow \maths{R}, \ \forall \theta \in \mathrm{O}(FX).
\]
\begin{Proposition}[Equivariance of SGCL]
For any $a: S^1 \times \maths{R}_+ \rightarrow \maths{R}$ the operator $\mathrm{sgc}_K^X(a, \bullet)$ is rotation equivariant and
\end{Proposition}
\begin{proof}
\end{proof}
The definition of SGCL can be extended to handle multiple channels. Let $k \in \maths{N}^*$, denote by
\[
F^k X
:=
\bigsqcup_{x \in X} (F_x X)^k.
\]
for each $i \in [|1,k|]$ denote by $F^{k,i} X \simeq FX$ the $i$-th component of $F^k X$. Let $f = (f_1, \dots, f_p): F^p X \rightarrow \maths{R}$, a matrix $a \in M_{q,p}(L^2(S^1 \times \maths{R}_+, \maths{R}))$ and a collection of frames $(e^1_x, \dots, e^q_x) \in (F_X X)^q$ we define the multi channel SGCL $\mathrm{sgc}^X_{K,p,q}(a, f): F^q X \rightarrow \maths{R}$ by:
\[
\mathrm{sgc}^X_{K,p,q}(a, f)(e_x^i)
:=
\sum_{j = 1}^p \mathrm{sgc}_K^X(a_{ij}, f_j)(e_x^i).
\]
The action of $\mathrm{O}(TX)$ extends to $F^k X$ and the space of function over $F^k X$ by acting on each of the factors $F^{k,i} X$. A parametric operator $\rho_{\theta \in \Theta}$ is a family of operators indexed by a parameter space $\Theta$. We denote by $\mathrm{Op}^X(p, q, \Theta)$ the space of parametric rotationally equivariant operators on $X$ with parameter space $\Theta$ sending functions over $F^pX$ to function over $F^qX$.
The equivariance still holds in the multichannel setting, that is for any subset $V \subset M_{q,p}(L^2(S^1 \times \maths{R}_+, \maths{R}))$ :
\[
\mathrm{sgc}^X_{K,p,q}(a, \bullet)_{a \in V}
\in
\mathrm{Op}^X(p, q, V)
\]
\begin{Definition}[SGCNN]
A rotationally synchronized neural network is the data of a sequence of integers $q_1, \dots, q_n$ and a sequence of parametric operators
\end{Definition}
Note that the choice of frames $e_x$ used to define the synchronized geodesic convolutional layer is arbitrary however. The following proposition is a key component of our contribution it shows that this ambiguity is consistent across layers in construction of synchronized geodesic convolutional neural network is equivariant under the action of the orthogonal group on frames,
\begin{Proposition}
\end{Proposition}
\subsection{synchronized covolution}
define the synchronized convolution
\subsection{synchronized patch operators}
define the synchronized and composite synchronized patch operators and their discretization.
\subsection{synchronized GCNN}
\section{Discretization over triangle meshes} | {'timestamp': '2018-10-05T02:14:14', 'yymm': '1810', 'arxiv_id': '1810.02303', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02303'} | arxiv |
\section{Introduction}
Binary Search Tree (BST) is a common data structure broad elaborated in many literatures and textbooks as that regular. At first, the construct on it can be referred to a binary tree in which besides each unit incident a \emph{key} (or value), each even carries three \emph{link}s mutually to comprise a compact structure, whose pointers respectively point to its own members in family the \emph{parent} and two \emph{children} that resides in the \emph{left} side and the \emph{right} side but maybe in\emph{null} for link in \emph{open}\cite{1,2,5}; especially the one without parent as \emph{root} or \emph{ancestor} to all others.
Inside a BST, analogous constitution may occur by generating roots and trees recursively\textemdash each can as minor \emph{root} on which new twigs can bloom from although there has existed a chief root to all items in tree.
If refer to maintain or build a tree, which must comply a Protocol of constitution; say the least, all incident keys must obey the clause that each at left link or right link which in charge by its \emph{parent} should smaller than or larger than \emph{parent}'s. Consider within a more large rank, of two subtrees the left one or the right one and their common root, correspondently at the left or the right, each key of \emph{descendant} in tree is smaller or larger than ancestor’s.
Hence that law strongly conducts the operation of adding a fresh item into a BST, upon that, building a tree is actually accounted as a row of item insertions. Meanwhile, the single insertion can be outlined as a course of comparison as a path\cite{5}, called \emph{depth} by us. In theory, with the longest one among them, we can use to measure the shape of a BST.
We can define a \emph{proper} tree with $\log{n}$ depth by such a \emph{bi}furcated structure above-mentioned on each item as a standard pattern, where variable $n$ is the number of items inside tree. For an accessing in a tree to achieve an operation, complexity can be estimated for lower bound in $\Theta(\log{n})$ or for upper bound in $O(n)$\cite{5}, clearly, both are decided by the shape of tree, frankly speaking, by a temporal series of insertions in building period.
Thus the flavor of cognition becomes interesting when we study the shape of BST: the future shape of BST has actually been destined by the permutation of that ready sequence in advance; in contrast, we either have not got any way to carry an arbitrary permutation suitable to guarantee the proper shape of building.
Worst still, that is a challenge to us so far; upon that, people turned to reduce the estimation of shape refer to a conception which surveys major likelihood of \emph{average} depth if the BST made up with a random sequence. In \cite{5} reported by the empirical of many retrials through, the average depth can into $2\ln n$ in most cases, which approximate to $1.39\log{n}$.
In substance, the conclusion Robert Sedgewick et al made is enough preferable to solve many estimations applied on algorithms executing on BST, at that in the book authors yet conceded those existing methods in a poor performance at worst case. In practice the tractability about manipulating a BST sometimes becomes vulnerable in some perhaps, at least to render the performance with instability.
\subsection{Results}(1) Develop the BST into a synthesis by integrating distinct structures and to survey those novel correspondences among them. (2) Discuss the operations involved so as to exert the advantages that have embedded in those new components and make them support mutually to raise whole performance. (3) Completely solve the issue of building a proper tree when with a stochastic sequence as input and guarantee the cost of building invested by a \emph{logarithm} time. (4) Estimate the batch works on BST than the traditional.
\subsection{Perliminated}
Of a tree, it must refer to a set $T=t_1,t_2,\ldots,t_n$ to denote all items in that tree where letter $n$ is the amount of items. We denote a depth by $\mathcal{D}.t_i$ for $t_i\in{T}$. In default, all keys in set $T$ are distinct one another unless other claim made, denote item and key with $\mathcal{K}.t_i $.
Excepted the \emph{terminal} in a tree without any child, the others called \emph{knot}, furthermore the \emph{Complete Knot} (CK) has two children in charge; another, the \emph{Partial Knot} (PK) with only one the left or the right.\\
\textbf{Contents Arrangement.} The 2nd section will prove some associated corollaries and introduce the new synthesis. The 3rd expands the essential methods on that structure. The 4th will get estimate the batch work on a representative pattern. The summary is arranged in last section.
\section{Morphology}
For item set $T$ on a BST, there may be a \emph{reference} (or \emph{ref}) set and further it conducts these two sets in a relationship of member mapping\textendash the pattern of \emph{bijection} so as to access that BST at each item can be done via the interface of \emph{ref} set. Furthermore this \emph{ref} set is permutable ordered by sorting their incident keys. Apparently of so doing, the correspondent permutation of \emph{ref}s should in a strictly ordered with all incident keys in ascent, for this, we can maintain a \emph{ref} set in a queue $(\rho_1,\rho_2,\ldots,\rho_n)$ denoted by $\mathcal{T}$; for two ordinals $0<i\leq j\leq n$ in queue, such that $\mathcal{K}.\rho_i\leq\mathcal{K}.\rho_j$, which is a prerequisite on this queue $\mathcal{T}$.
We call the item in BST \emph{Preimage} relating to its ref. Moreover on a member $\rho_{s}\in\mathcal{T}$, the reach in $\mathcal{T}$ embraced by $\rho_{1}$ and $\rho_{s-1}$ we call \emph{Left Subqueue} or LS otherwise at right side the \emph{Right Subqueue} or RS by $\rho_{s+1}$ and $\rho_{n}$.
Without question, the queue $\mathcal{T}$, which is the axiomatic, as an invariant to BST\cite{5}; herein we call \emph{Adjoint Reference Axis} or ARA.
By the account of definition of an ARA, we can give a set of features on the relevance between two structures the ARA and the BST: For a pair of contiguous refs $\rho_{s}, \rho_{s+1}\in\mathcal{T}$ and with their preimages $t_{i}, t_{k}\in{T}$ respectively, some corollaries can be given as follow.
\begin{enumerate}
\item $\mathcal{D}.t_{i}(\rho_{s}) \neq\mathcal{D}.t_{k}(\rho_{s+1})$.
\item If $\mathcal{D}.\rho_{s}(t_{i})<\mathcal{D}.\rho_{s+1}(t_{k})$, then $t_{i}$ is an ancestor to $t_{k}$ otherwise inverse.
\item $t_{i}, t_{k}$ concurrently are neither as CKs nor as terminals.
\end{enumerate}
These proofs are as follows.
\begin{proof}
Contrary to $\mathcal{D}.t_{i}(\rho_{s}) = \mathcal{D}.t_{k}(\rho_{s+1})$; refer to their depths which both from root to themselves, there must be a nonempty intersection on that both; moreover a member $t$ therein may as their common ancestor. Since at least there root of BST in that set, for oneself has been as the chief ancestor to all others, thus the form
\begin{equation}\label{ieq}\mathcal{K}.\rho_{s}(t_{i})<\mathcal{K}.\rho(t)<\mathcal{K}.\rho_{s + 1}(t_{k}).\end{equation}
should hold. That will be a contradiction to prerequisite of two refs $\rho_{s}$ and $\rho_{s+1}$ contiguous in ARA; or else case, items $t_i$ and $t_k$ both are same one. The \emph{first} holds and we call the inequality\eqref{ieq} The First Essential Correlation or TFEC. \\
\textbf{Second}, suppose $\mathcal{D}.t_{i}(\rho_{s}) > \mathcal{D}.t_{k}(\rho_{s+1})$. The \emph{second} could hold if $t_k$ as the root of BST. Assume $t_i$ not in the left subtree that subjects to root $t_k$, but they always have themselves to root a common ancestor $t$ according to the constitution of tree; further the TFEC holds for three $t_{i}, t_k$ and $t$ but it violates the prerequisite on ARA like the \emph{first}; another case that $t_k$ and $t$ be same one. Analogously for $\mathcal{D}.t_{i}(\rho_{s}) < \mathcal{D}.t_{k}(\rho_{s+1})$.\\
\textbf{Third}, (1) A terminal cannot be ancestor to another. (2) Contrary to $t_i$ and $t_k$ both as CKs, further suppose $t_k$ is an ancestor to $t_i$.
Thus $t_i$ in the \emph{left} subtree that in charge by root $t_k$. Over there at least an item $t$ as child at $t_i$ \emph{right} link such that there is existence of $\mathcal{K}.t_{i}(\rho_{s})<\mathcal{K}.t$ and $\mathcal{K}.t_{i}(\rho_{s}), \mathcal{K}.t<\mathcal{K}.t_{k}(\rho_{s+1})$, then $t$'s ref will among $\rho_{s}$ and $\rho_{s+1}$ to lead to a contradiction. The \emph{third} holds.
\end{proof}
In 1979, J. H. Morris had invented a similar linear sequence made in $O(n\log{n})$ the lower boundary, he aimed to traverse a BST in a convenience\cite{4}. Robert Sedgewick et al even had projected the all items in a BST instance on a horizon in their book\cite{5} to render such a queue and sounded it is an invariant to a BST, moreover to detail something for that conception.
We here study the morphology of this synthesis that composed of two structures which thicker than theirs. The goal we longing is to attempt to find out some delicate features concealed inside unknown before, by which we can develop more quick algorithms than the existing and make two structures can support one another to reach a preferable execution upon manage data structure.
\section{Operations}
\subsection{Deletion}
The existing method of deleting an item off a BST is fairly in perplexity to people. The central issue is the deletion concerns the perhaps of damage to logical structure. In fact, the focus about this problem is on deleting a CK off, upon that it needs an alternate in the tree to charge the vacant position made by deleting; the selected condition at alternate clearly requires that one with the capable to hold on those trees again which ever rooted in that CK before.
T. Hibbard in 1962 proposed the \emph{successor} as alternate\cite{5} which at the leftmost position in the \emph{right} subtree rooting CK which needs a progress of examination like $(>, <,\ldots,<)$ for seeking. Analogously to $(<, >,\ldots,>)$, Robert Sedgewick et al suggested the \emph{predecessor} in \emph{left} subtree the rightmost\cite{5}.
However for both routes, the cost at least is involved to $\log{n}$; In ARA model, we have an analysis about this selection as follows.
Deleting a \emph{terminal}, that may in $O(1)$ without overplus from other actions since no child in charge by terminal. For a PK with unique child, its child actually can as a root to hold on a subtree or null. However, the child can as the alternate for charge the vacant position that the deleted PK left down. At the worst case, the process will be \emph{deleting} one and \emph{moving} one, so the cost can in the $O(2)$ at the worst case.
Therefore, of deleting a CK, if a terminal as the alternate, then equivalently to delete two and move one, the cost in $O(3)$ time; instead, for a PK as the alternate, the cost will become deleting two and move two. Eventually, the cost may in $O(4)$ at the worst case for deleting a CK.
Now in ARA model, we advise the two members in ARA with their preimages as alternates which by that \emph{CK}, either at the \emph{right} side or at the \emph{left} side, both contiguous to \emph{CK}; actually they are the \emph{successor} and \emph{predecessor} in tree to that CK which mentioned by Hibbard or Sedgewick; their opinions both are right.
Our advice may at least involves two grounds: (1) Either of two alternates in ARA, the key on it is the \emph{extremum} in LS (maximum) or RS (minimum) that means it has the qualification as new root to charge that tree which in the past to rooting CK, since the relationship for each key on descendant in that tree to new root likewise consists with that protocol of constitution of BST; the alternative whether as a parent or whether as an ancestor. (2) By our proof, there is not any likelihood for these alternates being CKs concurrently.
Via the dimension of ARA we readily seek out the alternate so we gain a constant complexity that of $O(4)$ on deleting operation, which far less than logarithm.
\subsection{Insertion}
In contrast to deletion, insertion is more important that relating to building our synthesis that composed of a BST and an ARA; besides these, the insertion yet concerns to the function of offline manage a linear list. For example, the \emph{thread binary tree} invented by J. H. Morris in 1979\cite{4}, that can be referred to the result in executing an \emph{offline} method to obtain that list. When a set of \emph{online} accessing with frequent insertions upon that tree, the \emph{offline} will pay off a high price for a plenty of requirements of resorting.
What will changes happen in ARA when an insertion accomplishes in the BST? That we will survey is the key point that concerns if it in a proper tractability to us. The following proof will describe this evolution between the new item and its parent in BST, and their refs in ARA.
\begin{lemma}
As an item $t$ added into a BST as $t_{i}$'s child, consider their refs $\rho(t), \rho_{s}(t_i)\in\mathcal{T}$, the ref $\rho(t)$ will by $\rho_{s}(t_i)$ at the left side or the right side in ARA.
\end{lemma}
\begin{proof}
If the fresh $t$ as \emph{left} child of its parent $t_{i}$, If $t_{i}$'s LS is empty in ARA, then the $\rho(t)$ will be interpolated by $\rho_{s}(t_i)$ at left side, the lemma holds.
Instead, assume there is an item $\rho_{s-1}(t')$, the fresh $\rho(t)$ by it at the \emph{left} side in ARA. Since the fresh is a terminal in tree, then by those corollaries above-mentioned there should be an assertion come true: $t'$ is an ancestor to $t$.
Also, the assertion will further lead to three cases about item $t_{i}$ and $t'$: (1) the $t'$ also is the ancestor to parent $t_i$; (2) or conversely; (3) $t_i$ and $t'$ are the same one.
If the \emph{first} case holds, $t_{i}$ should have stayed in the \emph{right} subtree that in charge by root $t'$ for $\mathcal{T}.t_{i} >\mathcal{T}t'$, then it is clearly a contradiction the fresh impossible as the \emph{left} child of its parent since its parent in right subtree. Inversely for (2), then someone has been occupied the left link of $t_{i}$, maybe $t'$.
Finally the \emph{third} case is truth\textendash $\rho(t)$ by $\rho_{s}(t_i)$ at left side. Analogously to fresh $t$ as $t_i$'s right child, the lemma holds.
\end{proof}
This lemma presents a clear correspondence that a sorted system with two dimensions the BST and the ARA. That not only makes our two building works concur on a routine to easy\textendash an adding operation in BST also being an insertion on ARA, both are fresh by its parent; on the other hand, this lemma has exposed the affinity of two structures: the BST can carry the information over ARA. In next subsection, we will exploit this feature.
Herein, we lay the Doubly Linked List (DLL) on ARA as data structure to condition the dynamical insertion that may be caused from the frequently online. To the new data structure $T\oplus\mathcal{T}$, we call \emph{Compound Binary Search Tree} or CBST.
\subsection{A Simple Query}
Although ARA is a strictly sorted list by keys in ascent, yet there instantly appears to a challenge while an accessing on ARA merely with two ordinals, which try to obtain a piece-wise data like on a common sorted list whose items numbered by natural number; on account of such compact data structure and its kinds always with a fat chance in hashing or none the preferable to go.
At the aspect of maintaining a numbering system on an ARA, it never is none the easy: the incidence of point-wise renumbering in list which brought about by someone's change maybe reaches all corners through the whole; especially worse still for online algorithms than you imagine. For this query, we can convert the operation of location with ordinal to calculate the position in ARA. The new model will supply the maintainability in logarithm complexity.
Of an insertion in ARA meanwhile as being adding item into BST, we learn two means to extend an ARA along axis: one is adding member at the left or right end of a present ARA; another, the fresh one interpolated between two. So we define a structure in BST.
\textbf{Definition. }\emph{Given an item family composed of a \emph{grandpa}, a \emph{father} and a \emph{grandson}, we call the \emph{father} \emph{Flexed Node} (or FN), within their familial relationship, if and only if two links the \emph{grandpa}\textendash \emph{father} and \emph{father}\textendash \emph{ grandson}, both in distinct sides.}
For an instance: father at grandpa's \emph{left} link contrasted with grandson at father's \emph{right} link which to \textquotedblleft\emph{replicate}\textquotedblright~the path at father; the two links can comprise a \emph{Flexed Pipe} or FP; we call the left-right pattern of FP \emph{Clockwise} inversely $Anticlockwise$.
Thus, we can observe an interest process: \textquotedblleft Suppose an ordinal for ARA be known on \emph{grandpa}, there is a visit occurs repetitively along such bearing that at parent bound for child. If this progress reflected on ARA, it can render the ordinal in \emph{cumulation} or \emph{degression} upon that the visiting in forward or retreat among those refs which are two distinct bearings. For this \emph{one-step} the leaping does over those members in ARA, the ordinal’s change merely for correcting into one, we can reckon it as an \emph{invariance} addressing the fixed one on numbering ordinal. Instead, on a FN, the \emph{grandson}'s ref inserted among \emph{grandpa}'s and \emph{father}'s in ARA, the counting on ordinal should have to re-treat the one-point the \emph{grandson} into one. At this time, the reckoning on ordinal must be yielded to the changes on both the tree and the queue, because once a tree rooted in the \emph{grandson}, the treatment will be done with the \emph{variant} maybe many that relevant to the scalar of that tree other than singleton of invariance.\textquotedblright
Hence, we measure the case on that replication with variable \emph{Flexion} the number of items in that subtree; denoted by $\mathcal{F}$. Of that, a progressive visit along the clue of \emph{parent-child} in a tree actually evolves a leaping over an interval on that axis of ARA; the flexion can measure the thick of interval which embraced by \emph{grandpa} and \emph{father}.
We hence design the structure and functor in following, at first we suppose a visiting list $\phi=\varv_1, \varv_2,\ldots$ consisting of items that will be visited by functor $\varPhi$ and, the calculation is in the queue with ascending ordinal.\\
\textbf{The Structure}
\begin{enumerate}
\item \emph{For the \emph{root} of BST, let flexion $\mathcal{F}.\text{\emph{root}}$ equal of the number of items in its left subtree.}
\item \emph{The flexion on clockwise FN is of \emph{negative}; \emph{positive} for anticlockwise; none of the two into 0.}
\item \emph{If item at the left link as child, the fixed \emph{counting} for oneseft into $-1$, otherwise $1$; herein denoted by $\mathcal{S}$, especially $\mathcal{S}.\text{\emph{root}} = 1$.}
\end{enumerate}
The functor $\varPhi$ with visiting list $\phi$ will start at \emph{root} and assume the input ordinal is $N$:
\begin{align*}
\varPhi(\varv_{i+1}&) =\varPhi(\varv_{i}) + \mathcal{F}.\varv_{i+1}+\mathcal{S}.\varv_{i + 1};\\
\text{\textbf{s.t.} }&\left\{
\begin{array}{ll}
\varv_{1} = \text{root};~\varPhi(\varv_{0}) = 0 &\text{if}~i = 0;\\
\text{return}~\varv_{i}&\text{if}~\varPhi(\varv_{i}) = N;\\
\varv_{i+1} = \varv_{i}.\text{L\emph{child}}&\text{if}~\varPhi(\varv_{i}) > N;\\
\varv_{i+1} = \varv_{i}.\text{R\emph{child}}&\text{if}~\varPhi(\varv_{i}) < N;
\end{array}\right.
\end{align*}
The search of route on functor $\varPhi$ is likewise drawn from root to someone inside a tree step-by-step without distinct difference to an ordinary query. Therefore the lower bound of cost definitely involves to $\log{n}$. In addition to in ARA model, those intervals processed by functor $\varPhi$ in ARA incessantly shrinks over time, in this way the numeric can approach to the exact in the range as thin as possible till reach.
The same course can be inversed to follow the clue of \emph{child-parent} applied on deletion certainly.
Because in need of the function of ordinal query on CBST, these flexions incident FNs on that route that involving to the item has been deleted must be corrected with 1 or -1. Hereby the cost on deleting operation becomes involved to $\log{n}$ rather than ours above-mentioned.
We have introduced all principal operations in a CBST with FN model. Which these operations on each item, whether doing an \emph{insertion} or whether doing a \emph{query} or whether doing a \emph{deletion}, this model can always conduct them to obtain the ordinal involved in ARA simultaneously.
On the other hand, it also maintains in a logarithm system a quick\textendash algorithm set. Meanwhile, we solve a challenge for a compact linear list with a well responsiveness in logarithm times, however on implementation or on maintaining.
\subsection{Building}
We have got rid of the influence out from shape of BST in deletion, but the true of matter is not likelihood there for us to do some analogue things for other operations. Hence in this section we will discuss how to build a \emph{proper} BST from the dimension of ARA. That conducts building a CBST is not concurrently to construct two structures other than the insertion above-mentioned instead to fabricate it, of a rather manner of industrialization.
As building a Pyramid as following pseudo code show over there assume $n=2^{k}-1$, algorithm recursively extracts items from ARA as parents to connect with their children that have been reserved down.
\begin{center}
\small{\textbf{Construct BST}}
\end{center}
\begin{flushleft}
/$\ast$~~\emph{Parameters}~~$\ast$/\\ $\eth = \xi= 2;$ ~\emph{//~the cursors, $\eth$ backup $\xi$}\\$\theta = 4;$~~\emph{//~offset for next extracted one} \\$\kappa = 1;$~~\emph{//~ the width between parent $\&$ children} \\
~\\
/$\ast$ $\ast$ $\ast$~~\emph{Building Module}~~$\ast$ $\ast$ $\ast$/\\
\small{
01. Loop($\xi<n$)\\
02. ~~$dl = \xi - \kappa; ~~ dr=\xi + \kappa;$~~\emph{// addresses for left $\&$ right}\\
03. ~~$\mathcal{T}(\xi).\text{L}link \coloneqq \mathcal{T}(dl);~~\mathcal{T}(dl).Parent \coloneqq \mathcal{T}(\xi);$\\
04. ~~$\mathcal{T}(\xi).\text{R}link \coloneqq \mathcal{T}(dr);~~\mathcal{T}(dr).Parent \coloneqq \mathcal{T}(\xi);$ \\
05. ~~$\xi\coloneqq \xi + \theta;$\\
06. ~~\textbf{if} $\xi> n$ and $\eta < n/2$ \\
07. ~~\textbf{then} $\kappa =\eth;~\eth=\xi= \theta; ~\theta\coloneqq 2\theta;$ \emph{// start next round}\\
08. \textbf{return} the tree $T$.
}
\end{flushleft}
In this algorithm, the process can swift convert the roles for items from parent to child. In every round, algorithm is equivalently to execute this converting module on an abstracted bed against the previous results. In this pattern, the primitive bed is ARA and, only the items on \emph{event}\textendash position in ARA can be permitted to participate.
For example, in the \emph{first} round, initially these items at 2\emph{nd}, 6\emph{th}, 10\emph{th}, $\ldots, (n - 1)th$ positions are involved in a new list as parents, where with \emph{offset} the argument equals of 4 to pick up \emph{parents}; on the other hand, with \emph{width} the argument equals of 1, the $odd$s are picked up as \emph{children}.
Against the new sequence of parents, the \emph{second} round will do the similar performance which chooses the 4\emph{th}, 12\emph{th}, 20\emph{th}, $\ldots, (n - 3)th$ in ARA to as parents by \emph{offset} counted of 8, upon that those parents in \emph{first} round, 2\emph{nd}, 6\emph{th}, $\ldots$, now become children pointing to new parents, in which the \emph{width} argument equals of 2 always half of \emph{offset} argument.
In this way, the course will terminate when the \emph{middle} item at the $2^{k-1}$\emph{th} cups the rising \emph{pyramid} as chief root to whole, which inverses the course of existing building method that begins at root of BST.
As to ARA as a sorted linear list, the parameter $\kappa$ at 02\emph{th} step can utilize this feature to control the selection of children\textendash left element can but as left child, right child as well as left one; of that, this measure guarantees those keys comply the regulation about parent and children.
It wants us to answer a question about the detail of this kind of fabrication: There is any foul about each key in parent-child pattern, but not equivalent to in \emph{ancestor-descendent} one. For example, one key in \emph{right} subtree but smaller than the root's by which that subtree in charge. The cause is the foul member at that position in ARA ahead of the root but selected as child by a lower descendent in that subtree. We so far cannot confirm if our tactic of picking children is reliable to avoid this foul, specifically on using parameter $\kappa$. In\cite{5}, Robert Sedgewick et al ever mentioned this kind of error.
The proof is simply to prove the extremum in a tree, its ref impossibly outs the cordon the position at which the ancestor stays. Hereby, we will only discuss the case\textendash ancestor versus its right subtree, thus it requires us prove the \emph{leftmost} item in subtree that ref’s position in ARA always at its ancestor’s right side.
Given a $j$th round (for $j>1$), and $t_{j}$ as parent in this round, so it with a right width $d_{R}(j) = 2^{j-1}$ for $t_{j}$ to pick up right child. Suppose a tree is rooted in $t_{j}$’s right child $t$ and, thus there is a \emph{path} containing $j-2$ links to catenate the left extremum and the root that right child $t$.
To measure the parameter $\kappa$'s change on every link in that path whose scalar can be quantified with the number of members that leaped over for picking child, which can be described by a series $\bigcup_{i=0}^{i\leq j-2}2^{i}$; among them each numeric has been applied as \emph{width} in every round to capture children before $j$th.
Well, a total number $d_{L}(j-1) = \sum_{i=0}^{i\leq j-2}2^{i}$ results in an interval the left extremum off the root the $t$. By binary addition, it is easy to compare $d_{L}(j-1)$ and $d_{R}(j)$ and results in $d_{R}(j) - d_{L}(j-1) =1$ deduced from the exponent on $d_{R}(j)$ more than $d_{L}(j-1)$ for one degree. That means the foul is impossible in PM.
Meanwhile the proof does matter in another critical quality in PM that algorithm cannot pick up any item as parent or child repeatedly; because in very round, the candidates for in roots always outside those present trees that have been built up.
Of course, there is most likelihood to $n\neq 2^k - 1$ in practice; herein we can read it as $n=m+m'$ for $m=2^k-1$ and $n\slash{2}\leq {m}\leq{m}$; thus the \textquotedblleft\emph{overplus}\textquotedblright~$m'$ smaller than $m$. It is clear that these overplus ones can be settled at the most bottom as children before proceeding PM. The shape only just depends on user's tactic to arrange the positions for them maybe for balance. Anyway, the depth of CBST can be $\lfloor \log{n}\rfloor$ at all.
It is certainly that the PM works on a sorted sequence. Hereby we will introduce a sorting algorithm which developed from \emph{Tournament Method} that has been introduced in\cite{6} whose complexity has been known in $O(n\log n)$. We reformed it for condition the data structure the DLL, called \emph{Card Game Sorting Method} or CGSM\footnote{The source code and files involving to test this algorithm has been hosted in this website: \emph{https://github.com/snatchagiant/CGSM} which encoded by C++ and executed in console platform.}.
The pseudo code CGSM (1) about the \emph{engine} is in following.
\begin{center}
\small{\textbf{CGSM (1)}}
\end{center}
\begin{flushleft}
\small{Function: Insert$(s, ~t)$ \emph{// inserting in DLL, s precedes t}}\\
\small{Function: Follow$(s, ~t)$ \emph{// t follows s in DLL}}\\
~\\
/$\ast$ $\ast$ $\ast$ \small{Merger Method} $\ast$$\ast$ $\ast$ /\\
~\\
\small{Function: Merger($x,~ y$) \emph{// $x\in{X}; y\in{Y}$; the heads of queues} \\
01. $H = x;$ \textbf{if} $\mathcal{K}.x > \mathcal{K}.y$ \textbf{then} $H = y;$~~\emph{// elect the new head}\\
~\\
02. \textbf{Loop} ($y \neq\varnothing$)~~\emph{// not out the range of Y}\\
03. ~~\textbf{if} $\mathcal{K}.x < \mathcal{K}.y$ \\
04. ~~\quad\textbf{if} $x$ at the end of $X$\\
05. ~~\quad\textbf{then} Follow$(x, ~y)$; \textbf{break};~\emph{// follow x, the y $\&$ RS}\\
06. ~~\quad\textbf{else} $x\coloneqq x.\text{Later};$~~\emph{// continue on X.}\\
07. ~~\textbf{else} $\text{Insert}(y, ~x);$ $y\coloneqq y.\text{Later}$~~\emph{//insert $\&$ continue on Y}\\
08. \textbf{return} $H$;\\
}
\end{flushleft}
The sequence $Y$ can as well as sorted heap in ascent where the member that with the min key among all always springs out from the top of heap; for the outside member $y_{j}\in Y$, Merger Method attempts to seek out an appropriate interval in sequence $X$ for inserting it by moving the cursor in sequence $X$, whose process as sorting cards in card game.
Which maintains the kernel logic, by a pair of two neighbors the $x_{i-1}, x_{i}\in{X}$ and member $y_{j}\in{Y}$ commonly carry the inequality $\mathcal{K}.x_{i-1}<\mathcal{K}.y_{j}<\mathcal{K}.x_{i}$ about three keys of theirs.
If functor to the end of $X$ and $Y$ no empty, then the rest subsequence in $Y$ would join to the right end of new $X$ together to compose the new sequence $X\biguplus{Y}$; than whole course end. Conversely none springing out $Y$ for search either leads to procedure terminate likewise.
\emph{Complexity. }Let $\vert X\vert = t$ and $\vert Y\vert =s$, we can describe the process of comparisons by a set $Y'$ as:
\[Y'=\bigcup^{s}_{i = 1}y_i\times{X_{i}}\colon{X_{i}}=x_k,\ldots, x_j\text{ for }{1\leq k, j\leq t}.\]
A Cartesian product in favor of present the detail on each member $y_i\in{Y}$. If a member $y_i$ inserted in sequence $X$ and ahead of member $x_{j}\in{X}$, than for shift to next member $y_{i+1}$, the proceeding will start at $x_{j}$. Thus there is a nonempty intersection $\vert{X_{i}}\cap{X_{i+1}}\vert=1$, of that at worst case it is equivalent to $(s+t)$ times of comparisons implemented on this algorithm which tallies the sum of scalars of two sequences the $X$ and the $Y$; therefore the complexity can in $O(n)$ where $n= \vert X\vert +\vert Y\vert$; likewise, each member in that two also may be consider as equivalently being invoked for precisely once.
To a random sequence with $n$th members, certainly, by a way to scan the sequence through, it is easy on the level of procedure to yield a group of components within the sequence where each with a sorted subqueue. The sorting job eventually becomes a multi sequences merging.
The pseudo code CGSM (2) in following, we only relate another means that has the treatment on each member in sequence as a singleton set in order to exhibit the course of merging multitude of components based on the pairwise.
\begin{center}
\small{\textbf{CGSM (2)}}
\end{center}
\begin{flushleft}
/$\ast$~~\emph{Parameters}~~$\ast$/\\
\small{
$\Theta$; $\kappa= \vert \Theta\vert$;~~\emph{// store the heads of subsequences}.\\
$s = 1; ~ \pi = 0;$ \emph{// two cursors in $\Theta$}\\
~\\
/$\ast$~~\emph{Merger Rounds}~~$\ast$/\\
\textbf{Loop} ($\kappa > 1$)\\
01. $\pi++; \Theta[\pi] \coloneqq \text{Merger}(\Theta[s],~ \Theta[s + 1])$; $s\coloneqq s + 2$\\
02. \textbf{if} $s = \kappa$ \textbf{then} $\Theta[\pi] \coloneqq \Theta[s]$;~~\emph{// backup the last if $\kappa$ is odd}\\
03. \textbf{if} $s > \kappa$ \textbf{then} $\kappa = \pi; ~s=1; \pi = 0;$~~\emph{// start the next round}\\
}
\end{flushleft}
It is easy to count of $\lfloor\log{n}\rfloor$ rounds for whole merger and, moreover by the analysis above-mentioned, the cost can in $O(n\log{n})$.
Of course in this way, many CBSTs merger can be looked like a process of CGSM, the cost for BSTs merger can be in $O(n\log\kappa+n)$ where variable $\kappa$ is the number of trees. This means let we gets rid of much more annoying troubles that results from a mass of relations intertwined by tree's shape.
In addition to about concurrently building a FN system in PM, we give a solution for a module in algorithm which in following.
\begin{flushleft}
/$\ast$~~\emph{Structure}~~$\ast$/\\
\small{$t\in{T};~t.\ell = 0;~t.r = 0;$~~\emph{// two counters for left $\&$ right.}}\\
~\\
/$\ast$~~\emph{Module}~~$\ast$/\\
\small{
01. \textbf{As} \emph{Parent} \textbf{then} \emph{record the number of items in subtree.}\\
02. $t.\ell = \lambda.\ell +\lambda.r + 1$;\quad\emph{// $\lambda$ is the left child.}\\
03. $t.r = \rho.\ell + \rho.r + 1$;\quad\emph{// $\rho$ is the right child.}\\
04. \textbf{As} \emph{Child} ~~\textbf{if} $\mathcal{K}.t< \mathcal{K}.\pi$\quad\emph{// $t$ at the parent $\pi$ left link}\\
05. \textbf{then} $\mathcal{F}.t = (-1)\ast{\varv.r}; ~~\mathcal{S}.t = -1;$\quad\emph{// clockwise}\\
06. \textbf{otherwise} $\mathcal{F}.t = \varv.\ell; ~~\mathcal{S}.t = 1;$~~\quad\emph{// anticlockwise.}\\
}
\end{flushleft}
There is another alternative, the building course may begin at the \emph{median} position in ARA in manner of \emph{top to bottom} completely, by recursively bisection sequence to work out the BST. Here we don't intend to have a length to introduce, over there it may occasion the tree depth in $\lceil\log{n}\rceil + 1$.
\section{Bacth of Works}
It is apparently that we have reduced more trivial and unnecessary steps in our Merger method contrasted with \emph{merge sort} introduced in \cite{5}. Hence we naturally propose a theme the batch of works on CBST since the ARA also as another dimension supporting BST where they might in equivalence. Thus we can look the algorithm on two sequences in the manner of \emph{many-many} other than the traditional method which everyone in a fixed sequence in turn invoked for accessing on the whole BST, the character of \emph{one-many}.
Of course, in some occasion, such as one-time locking database for a bunch of jobs may spare much more resources than many-time ones. As a theoretical discussion, we merely reduce the issue simply to the preferable or not by the way of complexity analysis which is applicability. So we aim that: (1) Mark off the boundary for two methods, the \emph{batch} and the \emph{traditional} if instance in proper shape. (2) What is the index in a BST? By this guide we learn which alternative is more preferable with tree being inharmonic. (3) Analyze the instance of locality of accessing.
Here we only discuss the case of \emph{query} inasmuch with others they are similarly one another. We firstly let sequence $X=x_{1},\ldots,x_{n}$ as an ARA; otherwise, refer sequence $Y=y_{1},\ldots,y_{\kappa}$ to as the query sequence.
Than we add a module in Merger method and have a bit of reforming. The routine will process a \emph{success hit}\cite{5} that referred to a query in BST with a ref, the ref succeeds to match the item inside that tree; now here a member in sequence $Y$ instead of that ref, it matches a member in set $X$ as well as $\mathcal{K}.x_{i}=\mathcal{K}.y_{j}$. Functor will return \emph{yes} to sound the success hit.
Conversely, with no match and concurrently $\mathcal{K}.x_{i}>\mathcal{K}.y_{j}$ come true, it states the member $y_{j}$ \emph{failure} for match; no hit happen. These additions have barely to increase the overall complexity nevertheless have added a conditional for execution.
Let $\kappa = \lambda{n}$ (for $0<\lambda\leq{1}$). In the case of sequence $Y$ been sorted in ascent, the cost of the \emph{batch} could be in $(1+\lambda)n$ approach to $O(2n)$.
Contrast to the \emph{traditional} in the lower bound $\lambda{n}\log{n}$ with members in set $Y$ in turn for query on BST; if $\lambda{n}\log{n}\geq{(1+\lambda)n}$, we have \emph{boundary} $\lambda\geq\log^{-1}{n\slash{2}}$ such that \[\lambda=\rho^{-1} \text{ for } \rho=\lceil\log{n}\rceil.\] If the scalar of set $Y$ beyond, the batch is worthwhile.
Consider plus a sorting on sequence $Y$ in $\kappa\log\kappa$, as the measure with a delicate difference to $\kappa\log{n}$ the traditional, our task hence has to be altered to estimate the shape of BST.
Assume the cost is $\lambda{n}\hbar$ of using traditional query in CBST where $\hbar$ is the depth of tree. Thus an inequality
\[\lambda{n}\hbar\geq(1+\lambda){n} + \lambda{n}\log \lambda{n}= n+\lambda{n}\log{2}\lambda{n}.\]
Eventually $\hbar= \lambda^{-1}+\log2\lambda{n}$. Consider $\varg=\hbar - \log{n}$ then $\varg = \lambda^{-1}+\log{2}\lambda{n} -\log{n}$.
Such that $\varg=1 + \lambda^{-1} - \log\lambda^{-1}$. For $0<\lambda\leq 1$, having $\log\lambda^{-1}\lll\lambda^{-1}$ so $\varg > 0$, means the existence of the depth $\hbar$ in a CBST can as an index to measure that tree. For example, $\lambda = 1/4$ then $\hbar\geq{4+\log{(2n\slash{4})}}$, further if $\hbar\geq\log{8n}$, we can execute the batch.
It is interesting that if two extremums with extreme keys in sequence $Y$ in use to reduce a subqueue in ARA for query, where is boundary?
At first, the variable $\theta{n}$ ($0\leq\theta\leq{1}$) represents the scalar of that queue locked up in ARA, then the following equation marks out the boundary which has involved the cost of sorting on sequence $Y$
\[\lambda{n}\log{n} - \lambda{n}\log\lambda{n} = (\theta + \lambda)n.\]
Where the cost for the queries that with two extreme keys for lock a field inside a proper CBST, it can be considered to be ignored as negligible quantity.
Thus we have the boundary $\theta = \lambda\log(2\lambda)^{-1}$. When $\lambda = 1$ the $\theta$ into \emph{null}, the batch none the worthy; when $\lambda = 1\slash{2}$ the $\theta$ into 0 that means the traditional still worthwhile; if $\lambda\leq{1\slash{4}}$, then $\theta$ always larger than or equal of $\lambda$ by a constant-fold. The boundary indeed is rather volatile.
\section{Summary}
It is interest to develop a common data structure BST into a synthesis. In fact, more and more features covert in the CBST model needs us to reveal, such as maintain a proper BST at a lower cost or further reform the structure for special purpose for clients. On the other hand, we have improved the situation of poor performance at worst case on BST better than before to serve database management.
| {'timestamp': '2018-10-05T02:12:54', 'yymm': '1810', 'arxiv_id': '1810.02270', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02270'} | arxiv |
\section{Input urgent asynchronous timed session types} \label{sec:a-tst}
In this section we introduce input urgent asynchronous semantics,
the associated notion of progress, and we show some relationships
with the synchronous semantics.
\paragraph{Input urgent asynchronous semantics.}
We now introduce the input urgent semantics of TSTs. Note that here we use
configurations (\Cref{def:configuration}), i.e.\@\xspace queues can be unbounded.
\begin{definition}{\bf(Input urgent asynchronous semantics of TSTs)}
\label{def:tst:a-semantics}
The input urgent asynchronous semantics of TSTs is defined as the smallest
labelled relation between
configuration closed under the
rules in \Cref{fig:tst:as_semantics}.
As usual, we denote with $\asmove{}^*$ the reflexive and transitive
closure of the relation $\asmove{}$.
\end{definition}
Rule~\nrule{[$\oplus$]} allows to append the message
$\atom{a}$ to the queue, when the corresponding
guard is satisfied in the clock valuation $\clockN$.
Rule \nrule{[{\textup{\texttt{\symbol{`\!}}}}]} just says that the message in the head of the queue
can be consumed by the communication partner.
Rule~\nrule{[{\textup{\texttt{\symbol{`\?}}}}]} allows an external choice to fire any of its
enabled input actions.
Rule~\nrule{[Del]} allows time to pass;
this is always possible for external choices and success term,
while for an internal choice we require, through the function $\rdy{}$,
that some guard remains satisfiable.
Rule~\nrule{[S-Del]} allows time to pass for composite systems.
While the first two premises are standard, the third one is what
makes the semantics urgent: we require, through the predicate $\delta$-sync,
that elapsing of time does not prevent nor delay any possible communication.
The other rules are almost standard.
\begin{figure}[t]
\[
\begin{array}{c}
\begin{array}{cll}
{( {\TsumI{\atomOut{a}}{\guardG,\resetR}{\tsbP}}
\oplus \tsbPi,\;\rho,\; \clockN)
\;\asmove{\tau}\;
(\tsbP,\; \rho;\atom{a},\;\reset{\clockN}{\resetR})
}
\hspace{20pt}
& \text{if } \clockN \in \sem{\guardG}
& \nrule{[$\oplus$]}
\\[4pt]
{(\tsbP,\; \atom{a};\rho,\;\clockN)
\;\asmove{\atomOut{a}}\;
(\tsbP,\; \rho,\;\clockN)
}
&
& \nrule{[{\textup{\texttt{\symbol{`\!}}}}]}
\\[4pt]
{(\TsumE{\atomIn{a}}{\guardG,\resetR}{\tsbP} + \tsbPi, \;\rho ,\;\clockN)
\;\asmove{\atomIn{a}}\;
(\tsbP, \; \rho,\;\reset{\clockN}{\resetR})}
& \text{if } \clockN \in \sem{\guardG}
& \nrule{[{\textup{\texttt{\symbol{`\?}}}}]}
\\[4pt]
(\tsbP,\; \rho,\;\clockN)\asmove{\; \delta \; }
(\tsbP,\;\rho,\; \clockN+\delta)
& \text{if } \clockN + \delta \in \rdy{\tsbP}
& \nrule{[Del]} \\[4pt]
\irule{(\tsbP\setenum{\bind{\tsbX}{\tsbP}},\;\rho,\;\clockN) \;\asmove{\alpha}\;
(\tsbPi,\;\rho',\;\clockNi)}
{(\color{Orange}{\mathord{rec}} \tsbX \tsbP,\;\rho,\;\clockN) \;\asmove{\alpha}\;
(\tsbPi,\;\rho',\;\clockNi)}
& & \nrule{[Rec]}
\end{array} \\[40pt]
\begin{array}{cl}
\irule{(\tsbP,\rho,\clockN) \asmove{\; \tau \; } (\tsbPi,\rho',\clockNi)}
{(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE)\asmove {\; \tau \;}
(\tsbPi,\rho',\clockNi) \mid (\tsbQ,\sigma,\clockE)}
& \nrule{[S-$\oplus$]}
\\[13pt]
\irule
{
\begin{array}{c}
(\tsbP,\rho,\clockN) \asmove{\; \delta \; } (\tsbP,\rho,\clockNi) \quad
(\tsbQ,\sigma,\clockE) \asmove{\; \delta \; } (\tsbQ,\sigma,\clockEi)\\
\forall \delta' < \delta: (\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE)
\text{ not }\delta'-\text{sync}
\end{array}}
{(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE) \asmove{\; \delta \;}
(\tsbP,\rho,\clockNi) \mid (\tsbQ,\sigma,\clockEi)}
& \nrule{[S-Del]}
\\[18pt]
\irule
{(\tsbP,\rho,\clockN) \asmove{\; \atomOut{a} \; } (\tsbPi,\rho',\clockNi) \quad
(\tsbQ,\sigma,\clockE) \asmove{\; \atomIn{a} \; } (\tsbQi,\sigma',\clockEi)}
{(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE) \asmove{\; \tau \;}
(\tsbPi,\rho',\clockNi) \mid (\tsbQi,\sigma',\clockEi)}
& \nrule{[S-$\tau$]}
\end{array}\\[42pt]
(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE)\; \delta-\text{sync} \Longleftrightarrow
\exists \atom{a}: \begin{cases}
(\tsbP,\rho,\clockN + \delta) \asmove{\atomOut{a}} \land
(\tsbQ,\sigma,\clockE + \delta) \asmove{\atomIn{a}} & \text{or}\\
(\tsbP,\rho,\clockN + \delta) \asmove{\atomIn{a}} \land
(\tsbQ,\sigma,\clockE + \delta) \asmove{\atomOut{a}}
\end{cases}
\end{array}
\]
\caption{Urgent semantics of asynchronous timed session types
(symmetric rules omitted).}
\label{fig:tst:as_semantics}
\end{figure}
\begin{example}\label{ex:as-semantics}
Let
\(
\tsbP =
\TsumI{\atomOut{a}}{\clockT \leq 2}{\TsumI{\atomOut{b}}{\clockT \leq 3}{}}
\),
\(
\tsbQ =
\TsumE{\atomIn{a}}{\clockT \geq 4}{\TsumE{\atomIn{b}}{\clockT \geq 5}{}}
\),
a possible execution of the system is:
\[
(\tsbP,\emptyset,\clockN[0]) \mid (\tsbQ,\emptyset,\clockE[0]) \asmove{\tau}
\asmove{\tau}({\color{Magenta}{\mathbf{1}}},\atom{a};\atom{b},\clockN[0]) \mid (\tsbQ,\emptyset,\clockE[0])
\asmove{4}\asmove{\tau}\asmove{1}\asmove{\tau}
\]
Where the for $\tau$ actions represent, respectively, an output of $\atom{a}$,
an output of $\atom{b}$, an input of $\atom{a}$, and an input of $\atom{b}$.
Note that urgency prevents transitions
$({\color{Magenta}{\mathbf{1}}},\atom{a};\atom{b},\clockN[0]) \mid (\tsbQ,\emptyset,\clockE[0])
\asmove{\delta}$ if $\delta > 4$.
Let $\tsbQi = \TsumE{\atomIn{a}}{\clockT > 4}{\TsumE{\atomIn{b}}{\clockT \geq 5}{}}$,
i.e. $\tsbQi$ is like $\tsbQ$ but the constraint $\clockT \geq 4$ is substituted with
$\clockT > 4$. Message $\atom{a}$ cannot be consumed anymore:
\[
(\tsbP,\emptyset,\clockN[0]) \mid (\tsbQ,\emptyset,\clockE[0]) \asmove{\tau}
\asmove{\tau}\asmove{4}
({\color{Magenta}{\mathbf{1}}},\atom{a};\atom{b},\clockN[0] + 4) \mid (\tsbQ,\emptyset,\clockE[0] + 4)
\]
Configuration $({\color{Magenta}{\mathbf{1}}},\atom{a};\atom{b},\clockN[0] + 4) \mid (\tsbQ,\emptyset,\clockE[0] + 4)$
cannot read $\atom{a}$ (because $\clockN[0] + 4 (\clockT) = 4$ and $4 \not> 4$),
and cannot delay, because for any $\delta$ there is a $\delta' < \delta$ such that
$({\color{Magenta}{\mathbf{1}}},\atom{a};\atom{b},\clockN[0] + 4) \mid (\tsbQ,\emptyset,\clockE[0] + 4)$
is $\delta'-$sync. Problems like that are well-known when dealing with urgency
\cite{BornotST97}, therefore it is usually assumed that there is a first instant in which an
urgent action becames enabled. In our setting, this assumption corresponds to forbid guards
in the form $\clockX > n$. We do not make this assumption here just because our result
does not rely on it.
\end{example}
\paragraph{Synchrony vs asynchrony.}
We remark some differences between the semantics in
\Cref{fig:tst:s_semantics,fig:tst:as_semantics}:
\begin{itemize}
\item Synchronous semantics is defined on synchronous configurations,
namely buffers are 1-bounded;
asynchronous semantics is defined on configurations, where buffers are unbounded.
\item With synchronous semantics, by rule \nrule{[Del]} of \Cref{fig:tst:s_semantics},
time can pass only if all buffer are empty. With asynchronous semantics,
time may pass even if buffers are not empty. However, by rule \nrule{[S-Del]} of
\Cref{fig:tst:as_semantics}, not empty buffers still constrain time passing:
message comsumption is never delayed.
\end{itemize}
\begin{example}
Let $\tsbP$ and $\tsbQ$ be as in \Cref{ex:as-semantics}.
Intuitively, their composition should not succeed with synchronous semantics,
as $\tsbP$ writes $\atom{a}$ strictly earlier then when $\tsbQ$ is going to read it.
A possible complete execution is:
\[
(\tsbP,\emptyset,\clockN[0]) \mid (\tsbQ,\emptyset,\clockE[0]) \smove{\tau}
(\tsbP,\atom{a},\clockN[0]) \mid (\tsbQ,\emptyset,\clockE[0])
\]
Where $(\tsbP,\atom{a},\clockN[0]) \mid (\tsbQ,\emptyset,\clockE[0])$ is
s-deadlock: it is not success, it cannot perform actions, and it cannot delay
(one buffer is not empty).
\end{example}
Below, we sketch a proof of some relations between synchronous and asynchronous semantics.
Namely, asynchronous semantics simulates the synchronous one. Furthermore,
when queues are empty, asynchronous delays are mimicked by the synchronous semantics.
\begin{lemma}\label{lem:async-simulates-sync}
Let $(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE)$ be a synchronous configuration.
Then:
\[
(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE) \smove{\alpha}
(\tsbPi,\rho',\clockNi) \mid (\tsbQi,\sigma',\clockEi) \implies
(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE) \asmove{\alpha}
(\tsbPi,\rho',\clockNi) \mid (\tsbQi,\sigma',\clockEi)
\]
Furthermore:
\[
(\tsbP,\emptyset,\clockN) \mid (\tsbQ,\emptyset,\clockE) \asmove{\delta}
(\tsbPi,\rho',\clockNi) \mid (\tsbQi,\sigma',\clockEi) \implies
(\tsbP,\emptyset,\clockN) \mid (\tsbQ,\emptyset,\clockE) \smove{\delta}
(\tsbPi,\rho',\clockNi) \mid (\tsbQi,\sigma',\clockEi)
\]
\end{lemma}
\begin{proof}
First note the following facts (can be easily proved by rule induction):
\begin{equation}\label{lem:async-simulates-sync-eq1}
\forall (\tsbP,\rho,\clockN),(\tsbPi,\rho',\clockNi):\;\;
(\tsbP,\rho,\clockN) \smove{\alpha} (\tsbPi,\rho',\clockNi)\; \implies\;
(\tsbP,\rho,\clockN) \asmove{\alpha} (\tsbPi,\rho',\clockNi)
\end{equation}
\begin{equation}\label{lem:async-simulates-sync-eq2}
\forall (\tsbP,\rho,\clockN):\;\;
(\tsbP,\rho,\clockN) \smove{\delta}\; \implies
\rho =\emptyset
\end{equation}
\begin{equation}\label{lem:async-simulates-sync-eq3}
\forall \tsbP,\clockN,\tsbPi,\clockNi:\;\;
(\tsbP,\emptyset,\clockN) \asmove{\delta} (\tsbPi,\emptyset,\clockNi)\; \implies\;
(\tsbP,\emptyset,\clockN) \smove{\delta} (\tsbPi,\emptyset,\clockNi)
\end{equation}
Back to the main statement, the first part can be proved by cases on the rule used
in the derivation of $(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE) \smove{\alpha}
(\tsbPi,\rho',\clockNi) \mid (\tsbQi,\sigma',\clockEi)$.
We only show the more complicated case, namely rule \nrule{[S-Del]}. Suppose:
\[
\irule
{(\tsbP,\rho,\clockN) \smove{\; \delta \; } (\tsbP,\rho,\clockNi) \quad
(\tsbQ,\sigma,\clockE) \smove{\; \delta \; } (\tsbQ,\sigma,\clockEi)}
{(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE) \smove{\; \delta \;}
(\tsbP,\rho,\clockNi) \mid (\tsbQ,\sigma,\clockEi)}
\]
By \Cref{lem:async-simulates-sync-eq2}: $\sigma = \emptyset = \rho$.
Therefore, by an inspection of the rules in \Cref{fig:tst:as_semantics},
we can conclude that, for all $\delta'$ and for all $\atom{a}$,
both $(\tsbP,\rho,\clockN) \not\asmove{\; \atomOut{a} \; }$ and
$(\tsbQ,\sigma,\clockE) \not\asmove{\; \atomOut{a} \; }$. So,
$(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE)$ not $\delta'-$sync
for any $\delta'$. Therefore, thanks to \Cref{lem:async-simulates-sync-eq1},
we can use rule \nrule{[S-Del]}:
\[
\irule{(\tsbP,\rho,\clockN) \asmove{\; \delta \; } (\tsbP,\rho,\clockNi) \quad
(\tsbQ,\sigma,\clockE) \asmove{\; \delta \; } (\tsbQ,\sigma,\clockEi)
\quad \forall \delta' < \delta: (\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE)
\text{ not }\delta'-\text{sync}}
{(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE) \asmove{\; \delta \;}
(\tsbP,\rho,\clockNi) \mid (\tsbQ,\sigma,\clockEi)}
\]
For the furthermore case, the only possibility is:
\[
\irule
{(\tsbP,\emptyset,\clockN) \asmove{\; \delta \; } (\tsbP,\emptyset,\clockNi) \quad
(\tsbQ,\emptyset,\clockE) \asmove{\; \delta \; } (\tsbQ,\emptyset,\clockEi)
\quad \forall \delta' < \delta:
(\tsbP,\emptyset,\clockN) \mid (\tsbQ,\emptyset,\clockE) \text{ not }\delta'-\text{sync}}
{(\tsbP,\emptyset,\clockN) \mid (\tsbQ,\emptyset,\clockE) \asmove{\; \delta \;}
(\tsbP,\emptyset,\clockNi) \mid (\tsbQ,\emptyset,\clockEi)}
\nrule{[S-Del]}
\]
By \Cref{lem:async-simulates-sync-eq3}:
\[
\irule
{(\tsbP,\emptyset,\clockN) \smove{\; \delta \; } (\tsbP,\emptyset,\clockNi) \quad
(\tsbQ,\emptyset,\clockE) \smove{\; \delta \; } (\tsbQ,\emptyset,\clockEi)}
{(\tsbP,\emptyset,\clockN) \mid (\tsbQ,\emptyset,\clockE) \smove{\; \delta \;}
(\tsbP,\emptyset,\clockNi) \mid (\tsbQ,\emptyset,\clockEi)}
\nrule{[S-Del]}
\]
\end{proof}
\paragraph{Asynchronous progress.} \label{sec:tst-acompliance}
We extend the notion of progress to the asynchronous setting.
It differs from \Cref{def:compliance}
only in that it uses the asynchronous semantics.
\begin{definition}[Asynchronous compliance]
\label{def:adeadlock}
\label{def:acompliance}
We say that $(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE)$ is \emph{a-stuck}
whenever $(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE) \not\asmove{\tau}$ and
there is no $\delta$ such that $(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE)
\smove{\delta}\asmove{\tau}$.
We say that $(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE)$
is \emph{a-deadlock} whenever
$(i)$ $(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE)$ not success,
and $(ii)$ $(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE)$ is a-stuck..
%
We then write $(\tsbP,\clockN) \acompliant (\tsbQ,\clockE)$
whenever:
\[
(\tsbP,\emptyset,\clockN) \mid (\tsbQ,\emptyset,\clockE)
\asmove{}^*
(\tsbPi,\rho,\clockNi) \mid (\tsbQi,\sigma,\clockEi)
\quad \text{ implies } \quad
(\tsbPi,\rho,\clockNi) \mid (\tsbQi,\sigma,\clockEi)
\text{ not a-deadlock}
\]
We say that $\tsbP$ and $\tsbQ$ are \emph{asynchronous compliant}
whenever $(\tsbP,\clockN[0]) \acompliant (\tsbQ,\clockE[0])$
(in short, $\tsbP \acompliant \tsbQ$).
\end{definition}
\section{Conclusions and related work} \label{sec:related-work}
Following \cite{BartolettiCM17}, we pursued a line of research
aimed at lifting key properties of session types to the timed setting.
We have shown that the interesting property of
preservation of untimed synchronous progress when passing to asynchronous
semantics (discovered in \cite{BSZ14concur}), can be recovered using a
certain urgent asynchronous semantics, that closely models
realistic programming primitives.
Timed session types have been introduced in \cite{Bocchi14concur},
in the multiparty asynchronous version,
where they have been used to statically type check a timed $\pi$-calculus. Their
theory has subsequently been extended to dynamic verification \cite{NBY17}.
\cite{BartolettiCM17} introduced the binary and synchronous theory, subsequently
applied in a contract-oriented middleware \cite{CO2} and the
companion verification tool-chain \cite{AtzeiB16}.
\cite{Bocchi15concur} studies progress in the context of Communicating Timed Automata
\cite{KrcalY06}.
Several works study urgency in timed systems, here we mention \cite{BornotST97}.
As far as we know, urgency in the context of asynchronous communication
has only been studied in \cite{ctaRefinement},
where the idea of modelling input primitives
with input urgency originates.
\section{Introduction} \label{sec:introduction}
Session types are abstractions of communication protocols~\cite{TakeuchiHK94},
used to statically or dynamically check that distributed programs interact correctly.
The original binary synchronous theory has subsequently been extended in
several directions: explicit support for multiparty protocols and
choreographies \cite{Honda16jacm}, asynchronous communication through FIFO buffers
\cite{Honda16jacm},
time \cite{Bocchi14concur,BartolettiCM17}, and others \cite{Dezani09wsfm}.
In this paper, we start an investigation on the relationships between synchronous
and asynchronous session types in the timed binary setting. A related study has been performed
in the untimed setting \cite{BSZ14concur}, where, among other things,
it has been proved that deadlock freedom in
session types interacting with synchronous communication is
preserved if messages are buffered. As reasoning about
synchronous systems is easier (synchronous progress is decidibile,
asynchronous one is not), concurrent applications
can be designed and verified
with synchronous communication in mind, and then run on top of real-world
asynchronous mediums (e.g.\@\xspace, TCP) while
preserving correctness. We refer to this practice as
\emph{design synchronous/deploy asynchronous} methodology.
In the timed setting, as noted in \cite{BartolettiCM17}, this property
is lost, at least with the asynchronous semantics of \cite{Bocchi14concur}.
In this work, we propose an alternative semantics of asynchronous session types,
that forbids delays when reading actions are possible, similar to
an urgent semantics of Communicating Timed Automata \cite{ctaRefinement}.
As noted in \cite{ctaRefinement}, this semantics,
that we call \emph{input urgent} asynchronous semantics, better captures
common reading primitives of programming languages/APIs,
that return as soon as a message is available. Our semantics makes therefore
session types abstract models of \emph{programs}.
The semantics of \cite{Bocchi14concur}, instead, being more general (allows more behaviour),
seems preferable for modelling \emph{protocols} at a higher level of abstraction.
The main contribution of this paper is that the preservation result of \cite{BSZ14concur}
can be lifted to the timed setting, when using input urgent semantics.
As timed synchronous progress is decidable \cite{BartolettiCM17}, and, as discussed above,
input urgent semantics models programs, our result
paves the way for the application of the design synchronous/deploy asynchronous
methodology to time-sensitive distributed software.
\section{Results} \label{sec:tst-results}
In this section we sketch a proof of the main result of the paper
(\Cref{th:scompliant-impies-acompliant}), namely that synchronous progress implies
asynchronous progress.
The proof is quite standard: we introduce a property (being the composition of
\emph{r-compliant} TSTs, \Cref{def:coind-compliance-async})
that is enjoyed by $(\tsbP,\emptyset,\clockN[0]) \mid (\tsbQ,\emptyset,\clockE[0])$,
provided $\tsbP \compliant \tsbQ$.
We then show that r-compliance is preserved by transitions
(\Cref{lem:rcompliance-preservation})
and that configurations of r-compliant TSTs are not a-deadlock.
(\Cref{lem:rcompliance-deadlock-free}).
R-compliance is defined below. It is based on the notion of \emph{reminder}, that, given a
configuration and a queue,
returns the configuration obtained after consuming the given queue immediately (without delays).
Note that the remainder is a partial operation, and it is not defined if the queue cannot be
consumed, or some delay is required.
Then, r-compliance requires that:
\begin{itemize}
\item Queues can be consumed immediately.
\item The resulting configuration is composed by synchronous compliant TSTs.
\end{itemize}
\begin{definition}
\label{def:coind-compliance-async}
\label{def:remainder}
We define the remainder of $(\tsbP,\rho,\clockN)$ and queue $\sigma$, in symbols
$(\tsbP,\rho,\clockN) - \sigma$, inductively as follows:
\[
\begin{array}{rcll}
(\tsbP,\rho,\clockN) - \emptyset & = & (\tsbP,\rho,\clockN)\\
(\tsbP,\rho,\clockN) - \atom{a};\sigma & = & (\tsbPi,\rho',\clockNi) - \sigma &
\quad\text{ if }(\tsbP,\rho,\clockN) \asmove{\atomIn{a}} (\tsbPi,\rho',\clockNi)
\end{array}
\]
We say that $(\tsbP,\rho,\clockN)$ is \emph{r-compliant} with $(\tsbQ,\sigma,\clockE)$
(in symbols $(\tsbP,\rho,\clockN) \rcompliant (\tsbQ,\sigma,\clockE)$)
if, for some $\tsbPi,\clockNi,\tsbQi,\clockEi$:
\[
(\tsbP,\rho,\clockN) - \sigma = (\tsbPi,\rho,\clockNi) \;\land\;
(\tsbQ,\sigma,\clockE) - \rho = (\tsbQi,\sigma,\clockEi) \;\land\;
(\tsbPi,\clockNi) \compliant (\tsbQi,\clockEi)
\]
\end{definition}
The following auxiliary lemma says that the r-compliant configurations, under asynchronous
semantics, never allow delays unless both the queues are empty.
\begin{lemma}\label{lem:asyn-compliance-delta}
If $(\tsbP,\rho,\clockN)\; \rcompliant\; (\tsbQ,\sigma,\clockE)$ and
$(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE) \asmove{\delta}$, then
$\rho = \emptyset = \sigma$.
\end{lemma}
\begin{proof}
Suppose $(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE) \asmove{\delta}$.
First note that the only appliable rule is $\nrule{[S-Del]}$.
We have to show $\rho = \emptyset = \sigma$. Suppose, by contradiction, this is not the case,
and assume that, say, $\rho = \atom{a};\rho''$ for some $\atom{a},\rho''$.
By rule \nrule{[$\oplus$]}, $(\tsbP,\rho,\clockN) \asmove{\atomOut{a}}$.
Since $(\tsbP,\rho,\clockN) \rcompliant (\tsbQ,\sigma,\clockE)$,
it follows that $(\tsbQ,\sigma,\clockE) - \atom{a};\rho''$ is defined.
Then, by \Cref{def:remainder}, it must be $(\tsbQ,\sigma,\clockE) \asmove{\atomIn{a}}$.
But then $(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE)$ is $0$-sync, and so
rule \nrule{[S-Del]} does not apply: contradiction.
\end{proof}
The following proposition states that r-compliance is preserved by asynchronous transitions.
\begin{proposition}\label{lem:rcompliance-preservation}
Let $(\tsbP,\rho,\clockN)\; \rcompliant\; (\tsbQ,\sigma,\clockE)$ and
$(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE) \asmove{\alpha}
(\tsbPi,\rho',\clockNi) \mid (\tsbQi,\sigma',\clockEi)$. Then:
\[(\tsbPi,\rho',\clockNi)\; \rcompliant\; (\tsbQi,\sigma',\clockEi)\]
\end{proposition}
\begin{proof}
Since $(\tsbP,\rho,\clockN) \rcompliant (\tsbQ,\sigma,\clockE)$,
there exist $\tsbPii,\clockNii,\tsbQii,\clockEii$ such that:
\[
(\tsbP,\rho,\clockN) - \sigma = (\tsbPii,\rho,\clockNii) \;\land\;
(\tsbQ,\sigma,\clockE) - \rho = (\tsbQii,\sigma,\clockEii) \;\land\;
(\tsbPii,\clockNii) \compliant (\tsbQii,\clockEii)
\]
We proceed by cases on the rule used.
\begin{itemize}
\item \nrule{[S-$\oplus$]}. It must be $(\tsbQ,\sigma,\clockE) = (\tsbQi,\sigma',\clockEi)$,
$\rho' = \rho;\atom{a}$ for some $\atom{a}$, and $(\tsbP,\rho,\clockN) \asmove{\; \tau \; }
(\tsbPi,\rho',\clockNi)$. By an inspection of rules in \Cref{fig:tst:as_semantics},
we can conclude
that $(\tsbP,\rho,\clockN) \not\asmove{\; \atomIn{b} \; }$ for all $\atom{b}$.
Then $\sigma = \emptyset$: otherwise, $(\tsbP,\rho,\clockN) - \sigma$ would be undefined.
Therefore, $(\tsbP,\rho,\clockN) = (\tsbPii,\rho,\clockNii)$ and
$(\tsbPi,\rho',\clockNi) - \sigma = (\tsbPi,\rho',\clockNi)$. By a simple induction
on the length of $\rho$, we can conclude $(\tsbQ,\sigma,\clockE) - \rho;\atom{a} =
(\tsbQii,\sigma,\clockEii) - \atom{a}$. We have to show that
$(\tsbQii,\sigma,\clockEii) - \atom{a} = (\tsbQiii,\sigma,\clockEiii)$ for some
$\tsbQiii,\clockEiii$ such that $(\tsbPi,\clockNi) \compliant (\tsbQiii,\clockEiii)$.
Note that, since $(\tsbPii,\clockNii) \compliant (\tsbQii,\clockEii)$ and
$(\tsbPii,\clockNii)$ writes $\atom{a}$, it must be (by lemmas A.2 and 3.6 of
\cite{BartolettiCM17}, modulo minor notational differences)
$(\tsbQii,\sigma,\clockEii) \smove{\;\atomIn{a}\;} (\tsbQiii,\sigma,\clockEiii)$,
with $(\tsbPi,\clockNi) \compliant (\tsbQiii,\clockEiii)$.
By \Cref{lem:async-simulates-sync-eq1} in the proof of \Cref{lem:async-simulates-sync},
$(\tsbQii,\sigma,\clockEii) \asmove{\;\atomIn{a}\;} (\tsbQiii,\sigma,\clockEiii)$.
Therefore, $(\tsbQii,\sigma,\clockEii) - \atom{a} = (\tsbQiii,\sigma,\clockEiii)$ with
$(\tsbPii,\clockNii) \compliant (\tsbQii,\clockEii)$, and we are done.
\item \nrule{[S-Del]}. By \Cref{lem:asyn-compliance-delta}, it follows
$\rho = \emptyset = \sigma$, and by rule \nrule{[S-Del]} $\rho' = \emptyset = \sigma'$ as well.
By \Cref{def:coind-compliance-async},
$(\tsbP,\clockN) \compliant (\tsbQ,\clockE)$. By \Cref{lem:async-simulates-sync} and
\Cref{def:compliance}, it follows $(\tsbPi,\clockNi) \compliant (\tsbQi,\clockEi)$, and so,
since $\rho'$ and $\sigma'$ are both empty,
$(\tsbPi,\rho',\clockNi) \rcompliant (\tsbQi,\sigma',\clockEi)$.
\item \nrule{[S-$\tau$]}. It must be $(\tsbP,\rho,\clockN) \asmove{\; \atomOut{a} \; }
(\tsbPi,\rho',\clockNi)$ and
$(\tsbQ,\sigma,\clockE) \asmove{\; \atomIn{a} \; } (\tsbQi,\sigma',\clockEi)$.
By a simple induction on the rules in \Cref{fig:tst:as_semantics}, we can
conclude $\rho = \atom{a};\rho'$, $\sigma = \sigma'$, $\tsbP = \tsbPi$
(up to unfolding of recursion), and $\clockN = \clockNi$.
Since $(\tsbQ,\sigma,\clockE) \asmove{\; \atomIn{a} \; } (\tsbQi,\sigma',\clockEi)$,
by \Cref{def:remainder} it follows that
$(\tsbQ,\sigma,\clockE) - \atom{a};\rho' = (\tsbQi,\sigma,\clockEi) - \rho'$.
Clearly, up to unfolding of recursion,
$(\tsbP,\rho,\clockN) - \sigma = (\tsbPi,\rho,\clockN) - \sigma'$.
Therefore, since $(\tsbP,\rho,\clockN) \rcompliant (\tsbQ,\sigma,\clockE)$ by assumption,
also $(\tsbPi,\rho',\clockNi) \rcompliant (\tsbQi,\sigma',\clockEi)$.
\end{itemize}
\end{proof}
The following proposition states a-deadlock freedom of r-compliant configurations.
\begin{proposition}\label{lem:rcompliance-deadlock-free}
If $(\tsbP,\rho,\clockN)\; \rcompliant\; (\tsbQ,\sigma,\clockE)$, then
$(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE)$ is not a-deadlock.
\end{proposition}
\begin{proof}
We have two cases:
\begin{itemize}
\item $\rho = \emptyset \land \sigma = \emptyset$.
Then, $(\tsbP,\rho,\clockN) - \sigma = (\tsbP,\rho,\clockN)$ and
$(\tsbQ,\sigma,\clockE) - \rho = (\tsbQ,\sigma,\clockE)$, with
$(\tsbP,\clockN) \compliant (\tsbQ,\clockE)$.
Therefore, $(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE)$ is not s-deadlock.
By \Cref{def:deadlock}, if $\tsbP = {\color{Magenta}{\mathbf{1}}} = \tsbQ$, then
$(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE)$ is success and therefore not a-deadlock.
If it is not the case that $\tsbP = {\color{Magenta}{\mathbf{1}}} = \tsbQ$, by \Cref{def:deadlock}
there is $\delta$ such that
$(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE) \smove{\delta}\smove{\tau}$
(we omit the simpler case where the $\tau$ move is performed without delay).
Then, by \Cref{lem:async-simulates-sync},
$(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE) \asmove{\delta}\asmove{\tau}$.
Therefore $(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE)$ is not a-deadlock.
\item $\rho \neq \emptyset \lor \sigma \neq \emptyset$.
We show only the case $\rho \neq \emptyset$. The other is similar.
It must be $\rho = \atom{a};\rho'$ for some $\atom{a}$ and $\rho'$.
Since $(\tsbQ,\sigma,\clockE) - \rho$ is defined, it must be
$(\tsbQ,\sigma,\clockE) \asmove{\atomIn{a}}$. Therefore, by rule \nrule{[S-$\tau$]},
$(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE) \asmove{\tau}$, and so
$(\tsbP,\rho,\clockN) \mid (\tsbQ,\sigma,\clockE)$ is not a-deadlock.
\end{itemize}
\end{proof}
The main result follows.
\begin{theorem}\label{th:scompliant-impies-acompliant}
If $\tsbP \compliant \tsbQ$ then $\tsbP \acompliant \tsbQ$.
\end{theorem}
\begin{proof}
Let $\tsbP \compliant \tsbQ$, and assume
$(\tsbP,\emptyset,\clockN_0) \mid (\tsbQ,\emptyset,\clockE_0) \asmove{}^*
(\tsbPi,\rho',\clockNi) \mid (\tsbQi,\rho',\clockEi)$. We have to show
$(\tsbPi,\rho',\clockNi) \mid (\tsbQi,\rho',\clockEi)$ is not a-deadlock.
First note that, since queues are empty and $\tsbP \compliant \tsbQ$,
it holds that $(\tsbP,\emptyset,\clockN_0) \rcompliant (\tsbQ,\emptyset,\clockE_0)$.
By \Cref{lem:rcompliance-preservation} and a simple induction
on the length of the reduction, we can derive
$(\tsbPi,\rho',\clockNi) \rcompliant (\tsbQi,\rho',\clockEi)$.
By \Cref{lem:rcompliance-deadlock-free},
$(\tsbPi,\rho',\clockNi) \mid (\tsbQi,\rho',\clockEi)$ is not a-deadlock.
\end{proof}
\section{Synchronous timed session types} \label{sec:tst}
We now introduce timed session types (TST),
their synchronous semantics and the associated notion of progress.
The material of this section is taken from \cite{BartolettiCM17}, with minor variations.
The clock based model of time is borrowed from Timed Automata \cite{Alur94theory}.
| {'timestamp': '2018-10-08T02:04:24', 'yymm': '1810', 'arxiv_id': '1810.02472', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02472'} | arxiv |
\section{Introduction}
Policy optimization with continuous state and action spaces is a central, long-standing problem in robotics and computer animation. In the general case, one does not have a differentiable model of the dynamics and must proceed by trial and error, i.e., try something (sample actions from an exploration distribution, e.g., a neural network policy conditioned on the current state), see what happens, and learn from the results (update the exploration distribution such that good actions become more probable). In recent years, such approaches have achieved remarkable success in previously intractable tasks such as real-time locomotion control of (simplified) biomechanical models of the human body \cite{bergamin2019drecon}. One of the most popular policy optimization algorithms to achieve this is Proximal Policy Optimization (PPO) \cite{bergamin2019drecon,peng2018deepmimic,schulman2017proximal}.
In this paper, we make the following contributions:
\begin{itemize}
\item We provide novel evidence of how PPO's exploration variance can shrink prematurely, which leads to slow progress. Figure \ref{fig:teaser} illustrates this in a simple didactic problem.
\item We propose PPO-CMA, a method that dynamically expands and contracts the exploration variance, inspired by the Covariance Matrix Adaptation Evolution Strategy (CMA-ES) optimization method. This only requires minor changes to vanilla PPO but improves performance considerably.
\end{itemize}
\begin{figure}[t!]
\begin{center}
\includegraphics[width=3.3in]{Images/teaser_ICML.png}
\caption{Comparing PPO and PPO-CMA with a simple "stateless" quadratic objective. Sampled actions $\mathbf{a} \in \mathbb{R}^2$ are shown in blue. PPO shrinks the sampling/exploration variance prematurely, which leads to slow final progress. The proposed PPO-CMA method dynamically expands the variance to speed up progress, and only shrinks the variance when close to the optimum. Source code and animated visualization can be found at: \protect\url{https://github.com/ppocma/ppocma}.} \label{fig:teaser}
\end{center}
\end{figure}
\section{Preliminaries}
\subsection{Reinforcement Learning}\label{sec:RL}
We consider the discounted formulation of the policy optimization problem, following the notation of \cite{schulman2015high}. At time $t$, the agent observes a state vector $\mathbf{s}_t$ and takes an action $\mathbf{a}_t \sim \pi_\theta(\mathbf{a}_t | \mathbf{s}_t)$, where $\pi_\theta$ denotes the policy parameterized by $\mathbf{\theta}$, e.g., neural network weights. We focus on on-policy methods where the optimized policy also defines the exploration distribution. Executing the sampled action results in observing a new state $\mathbf{s}_t'$ and receiving a scalar reward $r_t$. The goal is to find $\mathbf{\theta}$ that maximizes the expected future-discounted sum of rewards $\mathbb{E}[\sum_{t=0}^{\infty}\gamma^t r_t]$, where $\gamma$ is a discount factor in the range $[0,1]$. A lower $\gamma$ makes the learning prefer instant gratification instead of long-term gains.
Both PPO and the PPO-CMA collect experience tuples $[\mathbf{s}_i,\mathbf{a}_i,r_i,\mathbf{s}_i']$ by simulating a number of \textit{episodes} in each optimization iteration. For each episode, an initial state $\mathbf{s_0}$ is sampled from some application-dependent stationary distribution, and the simulation is continued until a terminal (absorbing) state or a predefined maximum episode length $T$ is reached. After the iteration simulation budget $N$ is exhausted, $\mathbf{\theta}$ is updated.
\subsection{Policy Gradient with Advantage Estimation}
Policy gradient methods update policy parameters by estimating the gradient $\mathbf{g}=\nabla_\theta \mathbb{E}[\sum_{t}^{\infty}\gamma^t r_t]$. PPO utilizes the following policy gradient loss
\begin{equation}
\mathcal{L}_\theta=-\frac{1}{M}\sum_{i=1}^M A^\pi(\mathbf{s}_i,\mathbf{a}_i) \log \pi_\theta(\mathbf{a}_i | \mathbf{s}_i),\label{eq:pgLoss}
\end{equation}
where $i$ denotes minibatch sample index and $M$ is minibatch size. $A^\pi(\mathbf{s}_i,\mathbf{a}_i)$ denotes the \emph{advantage function}, which measures the benefit of taking action $\mathbf{a}_i$ in state $\mathbf{s}_i$. Positive $A^\pi$ means that the action was better than average and minimizing the loss function will increase the probability of sampling the same action again. Note that $A^\pi$ does not directly depend on $\theta$ and thus acts as a constant when computing the gradient of Equation \ref{eq:pgLoss}. A maximum likelihood view of Equation \ref{eq:pgLoss} is that the policy distribution is fitted to the data, each data point weighted by its advantage \cite{AWRPeng19}. Same as PPO, we use Generalized Advantage Estimation (GAE) \cite{schulman2015high}, a simple but effective way to estimate $A^\pi$
\subsection{Continuous Action Spaces}
With a continuous action space, it is common to use a Gaussian policy. In other words, the policy network outputs state-dependent mean $\mathbf{\mu}_\theta(\mathbf{s})$ and covariance $\mathbf{C}_\theta(\mathbf{s})$ for sampling the actions. The covariance defines the exploration-exploitation balance. In the most simple case of isotropic unit Gaussian exploration, $\mathbf{C}= \mathbf{I}$, the loss function in Equation \ref{eq:pgLoss} becomes:
\begin{equation}
\mathcal{L}_\theta=\frac{1}{M}\sum_{i=1}^M A^\pi(\mathbf{s}_i,\mathbf{a}_i) || \mathbf{a}_i - \mathbf{\mu}_\theta(\mathbf{s}_i)||^2,\label{eq:isotropicGaussianLoss}
\end{equation}
Intuitively, minimizing the loss drives the policy mean towards positive-advantage actions and away from negative-advantage actions.
Following the original PPO paper, we use a diagonal covariance matrix parameterized by a vector $\mathbf{c}_\theta(\mathbf{s})=diag (\mathbf{C}_\theta(\mathbf{s}))$. In this case, the loss becomes:
\begin{eqnarray}
\mathcal{L}_\theta&=&\frac{1}{M}\sum_{i=1}^M A^\pi(\mathbf{s}_i,\mathbf{a}_i)\sum_{j} \Big[\frac{(a_{i,j} - \mu_{j;\theta}(\mathbf{s}_i) )^2}{c_{j;\theta}(\mathbf{s}_i)} \nonumber \\
&& + 0.5 \log c_{j;\theta}(\mathbf{s}_i)\Big],\label{eq:gaussianLoss}
\end{eqnarray}
where $i$ indexes over a minibatch and $j$ indexes over action variables.
\subsection{Proximal Policy Optimization}
The basic idea of PPO is that one performs not just one but multiple minibatch gradient steps with the experience of each iteration. Essentially, one reuses the same data to make more progress per iteration, while stability is ensured by limiting the divergence between the old and updated policies \cite{schulman2017proximal}. PPO is a simplification of Trust Region Policy Optimization (TRPO) \cite{schulman2015trust}, which uses a more computationally expensive approach to achieve the same.
The original PPO paper \cite{schulman2017proximal} proposes two variants: 1) using an additional loss term that penalizes KL-divergence between the old and updated policies, and 2) using the so-called clipped surrogate loss function. The paper concludes that the clipped surrogate loss is the recommended choice. This is also the version that we use in this paper in all PPO vs. PPO-CMA comparisons.
\section{Problem Analysis and Visualization}
To allow simple visualization of actions sampled from the policy, the didactic problem in Figure \ref{fig:teaser} simplifies policy optimization into a generic black-box optimization problem in a 2D action space.
To achieve this, we set $\gamma=0$, which simplifies the policy optimization objective $\mathbb{E}[\sum_{t=0}^{\infty}\gamma^t r_t]=\mathbb{E}[r_0]=\mathbb{E}[r(\mathbf{s},\mathbf{a})]$, where $\mathbf{s}$ and $\mathbf{a}$ denote the first state and action of an episode. Thus, we can use $T=1$ and focus on visualizing only the first timesteps of each episode. Further, we use a state-agnostic $r(\mathbf{s},\mathbf{a})=r(\mathbf{a})=-\mathbf{a}^T\mathbf{a}$. Thus, we have a simple quadratic optimization problem and it is enough to only visualize the action space. The optimal policy Gaussian has zero mean and variance.
\subsection{The Instability Caused by Negative Advantages}
Considering the Gaussian policy gradient loss functions in Equations \ref{eq:isotropicGaussianLoss} and \ref{eq:gaussianLoss}, we note a fundamental problem: \emph{Actions with a negative advantages may cause instability} when performing multiple minibatch gradient steps in PPO style, as each step drives the policy Gaussian further away from the negative-advantage actions. This visualized in Figure \ref{fig:pg} (top row). The policy diverges, gravitating away from the negative-advantage actions.
Note that policy gradient does not diverge if one collects new experience and re-estimates the advantages between each gradient step; this, however, is what PPO aims to avoid for better sample efficiency.
\subsection{PPO: Stable But May Converge Prematurely}
As visualized in Figure \ref{fig:teaser}, the clipped surrogate loss of PPO prevents divergence, but the exploration variance can shrink prematurely when performing the updates over multiple iterations. Possibly to mitigate this, PPO also adds an entropy loss term that penalizes low variance. However, the weight of the entropy loss can be difficult to finetune.
Although the original PPO paper \cite{schulman2017proximal} demonstrated good results in MuJoCo problems with a Gaussian policy, the most impressive Roboschool results did not adapt the variance through gradient updates. Instead, the policy network only output the Gaussian mean and a linearly decaying variance with manually tuned decay rate was used. Thus, our observation of variance adaptation issues complements their work instead of contradicting it
\begin{figure}[t]
\begin{center}
\includegraphics[width=3.2in]{Images/didactic_singleIter_singlecolumn.png}
\end{center}
\caption{Policy evolution over the minibatch gradient steps of a single iteration in our didactic problem. Figure \ref{fig:teaser} shows how the same methods perform over multiple iterations. The black ellipses denote the policy mean and standard deviation according to which actions are sampled/explored. Positive-advantage actions are shown in green, negative advantages in red. The green non-filled circles show the negative-advantage actions converted to positive ones (Section \ref{sec:mirroring}). Policy gradient diverges. PPO limits the update before convergence or divergence. PPO-CMA expands the variance in the progress direction, improving exploration in subsequent iterations.}\label{fig:pg}
\end{figure}
\subsection{How CMA-ES Solves the Problems}\label{sec:cmaes}
The Evolution Strategies (ES) literature has a long history of solving similar Gaussian exploration and variance adaptaion problems, culminating in the widely used CMA-ES optimization method and its recent variants \cite{hansen2006cma,loshchilov2017limited}. CMA-ES is a black-box optimization method for finding a parameter vector $\mathbf{x}$ that maximizes some objective or fitness function $f(\mathbf{x})$. The key difference to PPO is that the exploration distribution's mean and covariance are plain variables instead of neural networks, and not conditioned on an agent's current state. However, as we propose in Section \ref{sec:PPOCMA}, one can adapt the key ideas of CMA-ES to policy optimization.
The CMA-ES core iteration is summarized in Algorithm \ref{alg:CMAES}. Although there is no convergence guarantee, CMA-ES performs remarkably well on multimodal and/or noisy functions if using enough samples per iteration. For full details of the update rules, the reader is referred to Hansen's excellent tutorial \cite{hansen2016cma}.
\begin{algorithm}[h]
\begin{algorithmic}[1]
\FOR{iteration=1,2,...}
\STATE Draw samples $\mathbf{x}_i \sim \mathcal{N}(\bm{\mu},\mathbf{C})$.
\STATE Evaluate $f(\mathbf{x}_i)$.
\STATE Sort the samples based on $f(\mathbf{x}_i)$ and compute weights $\mathbf{w}_i$ based on the ranks, such that best samples have highest weights.
\STATE Update $\bm{\mu}$ and $\mathbf{C}$ using the samples and weights.
\ENDFOR
\end{algorithmic}
\caption{High-level summary of CMA-ES}\label{alg:CMAES}
\end{algorithm}
CMA-ES avoids premature convergence and instability through the following:
\begin{enumerate}
\item When fitting the sampling distribution to weighted samples, only positive weights are used.
\item The so-called rank-$\mu$ update and evolution path heuristic elongate the exploration variance in the progress direction, making premature convergence less likely.
\end{enumerate}
Below, we overview these key ideas, providing a foundation for Section \ref{sec:PPOCMA}, which adapts the ideas for episodic RL. Note that CMA-ES is not directly applicable to RL, as instead of a single action optimization task, RL is in effect solving multiple action optimization tasks in parallel, one for each possible state. With a continuous state space, one cannot enumerate the samples for each state, which means that the sorting operation of Algorithm \ref{alg:CMAES} is not feasible.
\subsubsection{Computing Sample Weights}\label{sec:pruning_and_weights}
Using the default CMA-ES parameters, the weights of the worst 50\% of samples are set to 0, i.e., samples below median fitness are pruned and have no effect. The exploration mean $\bm{\mu}$ is updated in maximum likelihood manner to weighted average of the samples (similar to minimizing the loss in Equation \ref{eq:isotropicGaussianLoss} with the advantages as the weights). Because CMA-ES uses only non-negative weights, the maximum likelihood update does not diverge from the sampled actions. This suggests that one could similarly only use positive advantage actions (the better half of the explored actions) in PPO.
\subsubsection{The rank-$\mu$ update}\label{sec:cmarankmu}
Superficially, the core iteration loop of CMA-ES is similar to other optimization approaches with recursive sampling and distribution fitting such as the Cross-Entropy Method \cite{de2005tutorial} and Estimation of Multivariate Normal Algorithm (EMNA) \cite{larranaga2001estimation}. However, there is a crucial difference: in the so-called Rank-$\mu$ update, \textit{CMA-ES first updates the covariance and only then updates the mean} \cite{hansen2016cma}. This has the effect of elongating the exploration distribution along the best search directions instead of shrinking the variance prematurely, as shown in Figure \ref{fig:cmaVsEmna}.
\begin{figure}[h]
\begin{center}
\includegraphics[width=0.9\linewidth]{Images/cmaupdate_singlecolumn.png}
\end{center}
\caption{The difference between joint and separate updating of mean and covariance, denoted by the black dot and ellipse. A) sampling, B) pruning and weighting of samples based on fitness, C) EMNA-style update, i.e., estimating mean and covariance based on weighted samples, D) CMA-ES rank-$\mu$ update, where covariance is estimated before updating the mean. This elongates the variance in the progress direction, improving exploration in the next iteration. }\label{fig:cmaVsEmna}
\end{figure}
\subsubsection{Evolution path heuristic}\label{sec:evpathcma}
CMA-ES also features the so-called evolution path heuristic, where a component $\alpha \mathbf{p}^{(i)} \mathbf{p}^{(i)T}$ is added to the covariance, where $\alpha$ is a scalar, the $(i)$ superscript denotes iteration index, and $\mathbf{p}$ is the evolution path \cite{hansen2016cma}:
\begin{equation}
\mathbf{p}^{(i)}=\beta_0 \mathbf{p}^{(i-1)}+\beta_1 (\bm{\mu}^{(i)} - \bm{\mu}^{(i-1)}). \label{eq:evpath}
\end{equation}
Although the exact computation of the default $\beta_0$ and $\beta_1$ multipliers is rather involved, Equation \ref{eq:evpath} essentially amounts to first-order low-pass filtering of the steps taken by the distribution mean $\bm{\mu}$ between iterations. When CMA-ES progresses along a continuous slope of the fitness landscape, $||\mathbf{p}||$ is large, and the covariance is elongated and exploration is increased along the progress direction. Near convergence, when CMA-ES zigzags around the optimum in a random walk, $||\mathbf{p}|| \approx 0$ and the evolution path heuristic has no effect.
\section{PPO-CMA}\label{sec:PPOCMA}
Building on the previous section, we can now describe our PPO-CMA method, summarized in Algorithm \ref{alg:PPOCMA}. PPO-CMA is simple to implement, only requiring the following changes to PPO
\begin{itemize}
\item Instead of the clipped surrogate loss, we use the standard policy gradient loss in Equation \ref{eq:gaussianLoss} and train only on actions with positive advantage estimates to ensure stability, as motivated in Section \ref{sec:pruning_and_weights}. However, as setting negative advantages to zero discards information, we also propose a mirroring technique for converting negative-advantage actions to positive ones (Section \ref{sec:mirroring}).
\item We implement the rank-$\mu$ update (Section \ref{sec:cmarankmu}) using separate neural networks for policy mean and variance. This way, the variance can be updated before updating the mean.
\item We maintain a history of training data over $H$ iterations, used for training the variance network. This approximates the CMA-ES evolution path heuristic, as explained below.
\end{itemize}
Together, these features result in the emergence of PPO-CMA variance adaptation behavior shown in Figures \ref{fig:teaser} and \ref{fig:pg}. Despite the differences to original PPO, we still consider PPO-CMA a proximal policy optimization method, as fitting the new policy to the positive-advantage actions prevents it diverging far from the current policy.
\begin{algorithm}[b]
\caption{PPO-CMA}
\label{alg:PPOCMA}
\begin{algorithmic}[1]
\FOR{iteration=1,2,...}
\WHILE{iteration simulation budget $N$ not exceeded}
\STATE Reset the simulation to a (random) initial state
\STATE Run agent on policy $\pi_\theta$ for $T$ timesteps or until a terminal state
\ENDWHILE
\STATE Train critic network for $K$ minibatches using the experience from the current iteration
\STATE Estimate advantages $A^\pi$ using GAE \cite{schulman2015high}
\STATE Clip negative advantages to zero, $A^\pi \leftarrow \max(A^\pi,0)$ \label{row:clip} or convert them to positive ones (Section \ref{sec:mirroring})
\STATE Train policy variance for $K$ minibatches using experience from past $H$ iterations and Eq. \ref{eq:gaussianLoss}
\STATE Train policy mean for $K$ minibatches using the experience from this iteration and Eq. \ref{eq:gaussianLoss} \label{row:trainMean}
\ENDFOR
\end{algorithmic}
\end{algorithm}
\subsection{Approximating the Evolution Path Heuristic}\label{sec:evpath}
We approximate the CMA-ES evolution path heuristic (Section \ref{sec:evpathcma}) by keeping a history of $H$ iterations of data and sampling the variance training minibatches from the history instead of only the latest data. Similar to the original evolution path heuristic, this elongates the variance for a given state if the mean is moving in a consistent direction. We do not implement the CMA-ES evolution path heuristic directly, because this would need yet another neural network to maintain and approximate a state-dependent $\mathbf{p}(\mathbf{s})$. Similar to exploration mean and variance, $\mathbf{p}$ is a CMA-ES algorithm state variable; in policy optimization, such variables become functions of agent state and need to be encoded as neural network weights.
\subsection{Mirroring Negative-Advantage Actions}\label{sec:mirroring}
Disregarding negative-advantage actions may potentially discard valuable information. We observe that assuming linearity of advantage around the current policy mean $\bm{\mu}(\mathbf{s}_i)$, it is possible to mirror negative-advantage actions about the mean to convert them to positive-advantage actions. More precisely, we set $\mathbf{a}_i'=2\bm{\mu}(\mathbf{s}_i)-\mathbf{a}_i, A^\pi(\mathbf{a}_i')=-A^\pi(\mathbf{a_i})\psi(\mathbf{a}_i,\mathbf{s}_i)$, where $\psi(\mathbf{a}_i,\mathbf{s}_i)$ is a Gaussian kernel (we use the same shape as the policy) that assigns less weight to actions far from the mean. This is visualized at the bottom of Figure \ref{fig:pg}. The mirroring drives the policy Gaussian away from worse than average actions, but in a way consistent with the weighted maximum likelihood estimation perspective which requires non-negative weights for stability. If the linearity assumption holds, the mirroring effectively doubles the amount of data informing the updates.
In the CMA-ES literature, a related technique is to use a negative covariance matrix update procedure \cite{hansen2010benchmarking}, but the technique does not improve the estimation of the mean.
\section{Evaluation}\label{sec:evaluation}
A key issue in the usability of an RL method is sensitivity to hyperparameters. As learning complex tasks can take hours or days, finetuning hyperparameters is tedious. Thus, we conducted hyperparameter searches to investigate following questions:
\begin{itemize}
\item Can PPO-CMA produce better results than PPO without precise tuning of hyperparameters?
\item Can hyperparameters optimized for simple tasks generalize to complex tasks?
\item Is PPO-CMA less prone to getting stuck in local optima?
\end{itemize}
As elaborated below, our data indicates a positive answer to all the questions. Furthermore, we conducted an ablation study that verifies that all the proposed PPO-CMA algorithm features improve the results.
We used the 9 2D OpenAI Gym Roboschool continuous control environments \cite{OpenAI_roboschool} for the hyperparameter searches and the ablation study and tested generalization on the OpenAI Gym MuJoCo Humanoid \cite{brockman2016openai}. We performed 5 training runs with different random seeds for environment and setting (total 31500 runs). The same codebase was used for both PPO and PPO-CMA, only toggling PPO-CMA features on/off, to ensure no differences due to code-level optimizations \cite{engstrom2019implementation}.
\subsection{Sensitivity to Hyperparameters}
\begin{figure}[t]
\begin{center}
\includegraphics[width=1.0\linewidth]{Images/GridPlot.png}
\end{center}
\caption{PPO and PPO-CMA performance as a function of key hyperparameters, using average normalized scores from 9 Roboschool environments (1 is the best observed score). The batch sizes and entropy loss weight $w$ values are the ones that produced the best results in our hyperparameter searches. PPO-CMA performs overall better, is not as sensitive to the hyperparameter choices, and the hyperparameters can be adjusted more independently. In contrast, PPO requires careful finetuning of both the $\epsilon$ and $N$ parameters.}\label{fig:PPOvsPPO-CMA}
\end{figure}
Figure \ref{fig:PPOvsPPO-CMA} visualizes sensitivity to key hyperparameters, i.e., iteration simulation budget $N$, PPO-CMA's history buffer size $H$, and PPO's clipping parameter $\epsilon$ that determines how much the updated policy can diverge from the old one. The scores in Figure \ref{fig:PPOvsPPO-CMA} are normalized averages over all runs for a hyperparameter and algorithm choice, such that the best best parameter combination and algorithm has score 1. We tested minibatch sizes 128, 256, 512, 1024, 2048 and use the best performing ones for Figure \ref{fig:PPOvsPPO-CMA}. The figure reveals the following:
\begin{itemize}
\item PPO-CMA performs better with a wide range of hyperparameters, in particular with $H \ge 5$. Similar to CMA-ES, the main parameter to adjust is $N$. A large $N$ makes progress more robust and less noisy. On the other hand, a large $N$ means less iterations and possibly less progress within some total simulation budget, which shows as the lower scores for the largest $N$ in Figure \ref{fig:PPOvsPPO-CMA}.
\item There is a strong interaction of PPO's $\epsilon$ and $N$; if one is changed, the other must be also changed. This makes finetuning the parameters difficult, especially considering that PPO has the additional entropy loss weight parameter to tune. Interestingly, the optimal parameter combination appears to be a very low $\epsilon$ together with a very low $N$. On the other hand, $N$ should not be decreased below the episode time limit $T$. Most of the Roboschool environments use $T=1000$.
\end{itemize}
\subsection{Generalization and Scaling to Complex Problems}
The 9 environments used for the hyperparameter search are all relatively simple 2D tasks. To test generalization and scaling, we ran both algorithms on the more challenging MuJoCo Humanoid-v2 environment \cite{brockman2016openai}. We used the best-performing hyperparameters of Figure \ref{fig:PPOvsPPO-CMA} and also tested a larger simulation budget $N$. The agent is a 3D humanoid that gets rewards for forward locomotion. The results are shown in Figure \ref{fig:HumanoidPlot}. PPO-CMA yields clearly better results, especially with the increased $N$.
\begin{figure}[h]
\begin{center}
\includegraphics[width=3.2in]{Images/HumanoidPlot.png}
\end{center}
\caption{Comparing PPO and PPO-CMA in the MuJoCo Humanoid-v2 environment, showing means and standard deviations of training curves from 3 runs with different random seeds.}\label{fig:HumanoidPlot}
\end{figure}
\subsection{Ablation study}
To ensure that PPO-CMA has no redundant features, we tested different ablated versions on the 9 Roboschool environments used for Figure \ref{fig:PPOvsPPO-CMA}. Table \ref{table:ablation} shows the resulting normalized scores. The results indicate that all the proposed algorithm components improve performance.
\begin{table}[h]
\small
\begin{center}
\begin{tabular}{| c | c |}
\hline
\textit{Algorithm version} & \textit{Score} \\
\hline
No mirroring, no evolution path, no rank-$\mu$ & 0.57 \\
No mirroring, no evolution path heuristic & 0.71 \\
No mirroring of negative-advantage actions & 0.82 \\
Full PPO-CMA & 1 \\
\hline
\end{tabular}
\caption{Ablation study results, showing normalized scores similar to Figure \ref{fig:PPOvsPPO-CMA}. Note that not using the rank-$\mu$ heuristic amounts to using a single policy network that outputs both mean and variance.}\label{table:ablation}
\end{center}
\end{table}
\section{Related Work}\label{sec:related}
Our work is closely related to Continuous Actor Critic Learning Automaton (CACLA) \cite{van2007reinforcement}. CACLA uses the sign of the advantage estimate -- in their case the TD-residual -- in the updates, shifting policy mean towards actions with positive sign. The paper also observes that using actions with negative advantages can have an adverse effect. However, using only positive advantage actions guarantees that the policy stays in the proximity of the collected experience. Thus, CACLA can be viewed as an early PPO approach, which we extend with CMA-ES -style variance adaptation.
PPO represents on-policy RL methods, i.e., experience is assumed to be collected on-policy and thus must be discarded after the policy is updated. Theoretically, off-policy RL should allow better sample efficiency through the reuse of old experience, often implemented using an experience replay buffer. PPO-CMA can be considered as a hybrid method, since the policy mean is updated using on-policy experience, but the history or replay buffer for the variance update also includes older off-policy experience.
CMA-ES has been also applied to continuous control in the form of trajectory optimization. In this case, one can use CMA-ES to search for a sequence of optimal controls given an initial state \cite{babadi2018intelligent}. Although trajectory optimization approaches have demonstrated impressive results with complex humanoid characters, they require more computing resources in run-time. Trajectory optimization has also been leveraged to inform policy search using the principle of maximum entropy control \cite{levine2013guided}, which leads to a Gaussian policy. Furthermore, Differential Dynamic Programming (DDP) has been formulated in the terms of Gaussian distributions, which permits using CMA-ES for sampling the actions of each timestep in trajectory optimization \cite{rajamaki2018regularizing}.
PPO-CMA is perhaps most closely related to \cite{abdolmaleki2018maximum,abdolmaleki2018relative}. Maximum a posteriori Policy Optimization (MPO) \cite{abdolmaleki2018maximum} also fits the policy to the collected experience using a weighted maximum likelihood approach, but negative weights are avoided through exponentiated Q-values, based on the control-inference dualism, instead of our negative advantage mirroring. Concurrently with our work, MPO has also been extended with decoupled optimization of policy mean and variance, yielding similar variance adaptation behaviour as CMA-ES and PPO-CMA; on a quadratic objective, variance is first increased and shrinks only when close to the optimum \cite{abdolmaleki2018relative}.
Finally, it should be noted that PPO-CMA falls in the domain of model-free reinforcement learning approaches. In contrast, there are several model-based methods that learn approximate models of the simulation dynamics and use the models for policy optimization, potentially requiring less simulated or real experience. Both ES and RL approaches can be used for the optimization. Model-based algorithms are an active area of research, with recent work demonstrating excellent results in limited MuJoCo benchmarks \cite{chua2018deep}, but model-free approaches still dominate the most complex continuous problems such as humanoid movement.
\section{Limitations}
We only compare PPO-CMA to PPO, and recognize that there are more recent RL algorithms that may offer better performance \cite{abdolmaleki2018maximum, abdolmaleki2018relative,chua2018deep}. However, PPO is a widely used algorithm due to its combination of simplicity and good performance, which calls for better understanding of its limitations.
\section{Conclusion}
Proximal Policy Optimization (PPO) is a simple, powerful, and widely used model-free reinforcement learning approach. However, we have observed that PPO can prematurely shrink the exploration variance, leading to slow convergence. As a solution to the variance adaptation problem, we have proposed the PPO-CMA algorithm that adopts the rank-$\mu$ update and evolution path heuristics of CMA-ES to episodic RL.
PPO-CMA improves PPO results in the tested Roboschool continous control tasks while not sacrificing mathematical and conceptual simplicity. We add the separate neural networks for policy mean and variance and the $H$ hyperparameter, but on the other hand, we do not need PPO's clipped surrogate loss function, the $\epsilon$ parameter, or the entropy loss term. Similar to CMA-ES, PPO-CMA can be said to be quasi-parameter-free; according to our experience, once the neural network architecture is decided on, one mainly needs to increase the iteration sampling budget $N$ for more difficult problems.
\section*{Acknowledgments}
This work has been supported by Academy of Finland grants 299358 and 305737.
\section{Implementation Details}
Similar to previous work, we use a fully connected policy network with a linear output layer and treat the variance output as log variance $\mathbf{v}=\log (\mathbf{c})$. In our initial tests with PPO, we ran into numerical precision errors which could be prevented by soft-clipping the mean as $\bm{\mu}_{clipped}= \mathbf{a}_{min} + (\mathbf{a}_{max} - \mathbf{a}_{min})\ \otimes \sigma(\bm{\mu})$, where $\mathbf{a}_{max}$ and $\mathbf{a}_{min}$ are the action space limits. Similarly, we clip the log variance as $\mathbf{v}_{clipped}=\mathbf{v}_{min} + (\mathbf{v}_{max} - \mathbf{v}_{min})\ \otimes \sigma(\mathbf{v)}$, where $\mathbf{v}_{min}$ is a lower limit parameter, and $\mathbf{v}_{max}=2\log(\mathbf{a}_{max}-\mathbf{a}_{min})$.
We use a lower standard deviation limit of 0.01. Thus, the clipping only ensures numerical precision but has little effect on convergence. The clipping is not necessary for PPO-CMA in our experience, but we still use with both algorithms it to ensure a controlled and fair comparison.
To ensure a good initialization, we pretrain the policy in supervised manner with randomly sampled observation vectors and a fixed target output $\mathbf{v}_{clipped}=2\log(0.5(\mathbf{a}_{max}-\mathbf{a}_{min}))$ and $\bm{\mu}_{clipped}=0.5(\mathbf{a}_{max}+\mathbf{a}_{min})$. The rationale behind this choice is that the initial exploration Gaussian should cover the whole action space but the variance should be lower than the upper clipping limit to prevent zero gradients. Without the pretraining, nothing quarantees sufficient exploration for all observed states.
We train both the policy and critic networks using Adam. Table \ref{table:hyperparams} lists all our hyperparameters not included in the hyperparameter searches.
\begin{table}[H]
\small
\begin{center}
\begin{tabular}{| c | c |}
\hline
\textit{Hyperparameter} & \textit{Value} \\
\hline
Training minibatch steps per iteration ($K$) & 100 \\
Adam learning rate & 0.0003 \\
Network width & 128 \\
Number of hidden layers & 2 \\
Activation function & Leaky ReLU \\
Action repeat & 2 \\
Critic loss & L1 \\
\hline
\end{tabular}
\caption{Hyperparameters used in our PPO and PPO-CMA implementations.}\label{table:hyperparams}
\end{center}
\end{table}
We use the same network architecture for all neural networks. Action repeat of 2 means that the policy network is only queried for every other simulation step and the same action is used for two steps. This speeds up training.
We use L1 critic loss as it seems to make both PPO and PPO-CMA less sensitive to the reward scaling. For better tolerance to varying state observation scales, we use an automatic normalization scheme where observation variable $j$ is scaled by $k_{j}^{\left(i\right)}=min\left(k_{j}^{\left(i-1\right)},1/\left(\rho_{j}+\kappa\right) \right)$, where $\kappa=0.001$ and $\rho_{j}$ is the root mean square of the variable over all iterations so far. This way, large observations are scaled down but the scaling does not constantly keep adapting as training progresses.
Following Schulman's original PPO code, we also use episode time as an extra feature for the critic network to help minimize the value function prediction variance arising from episode termination at the environment time limit. Note that as the feature augmentation is not done for the policy, this has no effect on the usability of the training results.
Our implementation trains the policy mean and variance networks in separate passes, keeping one network fixed while the other is trained. An alternative would be to train both networks at the same time, but cache the policy means and variances when sampling the actions, and use the cached mean for the variance network's loss function, and the cached variance for the mean network's loss.
\section{Hyperparameter Search Details}
The PPO vs. PPO-CMA comparison of Section \ref{sec:evaluation} uses the best hyperparameter values that we found through an extensive search process. We performed the following searches:
\begin{enumerate}
\item A 3D search over PPO's $N$, $\epsilon$, and minibatch size, using the values in Figure \ref{fig:PPOvsPPO-CMA} plus minibatch sizes 128, 256, 512, 1024, 2048.
\item A 3D search over PPO's $N$, $\epsilon$, and entropy loss weight $w \in \left\lbrace0, 0.01, 0.05, 0.1, 0.15\right\rbrace$, keeping the minibatch size at 128, which yielded the best results in the search above. Instead of a full 4D search, we chose this simplification to conserve computing resources and because the minibatch size was found to only have a minor effect on PPO's performance, as shown in Figure \ref{fig:GridPackPlot}.
\item A 3D search over PPO-CMA's $N$, $H$, and minibatch size, using the values in Figure \ref{fig:PPOvsPPO-CMA} plus minibatch sizes 128, 256, 512, 1024, 2048.
\end{enumerate}
Each hyperparameter combination was tested using 5 independent training runs of the following 9 Roboschool environments: \textit{Inverted pendulum, Inverted pendulum swing-up, Inverted double pendulum, Reacher, Hopper, Walker2d, HalfCheetah, Ant,} and \textit{Pong.} In total, we performed 31500 training runs, totaling roughly two CPU years.
Each hyperparameter combination score in Figure \ref{fig:PPOvsPPO-CMA} is the average of 45 normalized scores: 5 training runs with different random seeds up to 1M simulation steps, using the 9 OpenAI Gym Roboschool tasks. The scores were normalized as $R_{norm}=(R - R_{min})/(R_{max} - R_{min})$, where $R$ is a training run's average of the non-discounted episode return $\sum_{t} r_t$ from the last iteration, and $R_{min},R_{max}$ are the minimum and maximum $R$ of the same task over all training runs and tested hyperparameters. After the averaging, we perform a final normalization over all tested parameter combinations and algorithms such that the best combination and algorithm has score 1, i.e., PPO-CMA with minibatch size 512, $N=8k$, and $H=9$ in Figure \ref{fig:PPOvsPPO-CMA}.
We did not have the computing resources to conduct the hyperparameter searches using all the Roboschool tasks such as the Atlas humanoid robot simulation; thus, we focused on the more simple 2D tasks that could be assumed to be solved within the limit of 1M simulation steps. The results in Figure \ref{fig:HumanoidPlot} indicate that the found parameters generalize beyond the simple tasks.
\section{Additional Results}\label{sec:additionalResults}
Figure \ref{fig:ConvergencePlot} shows the training curves (mean and standard deviation of 5 runs) of all the 9 Roboschool environments used in the hyperparameter search.
Overall, PPO-CMA performs clearly better in all environments except the inverted pendulum, where initial progress is slower.
\begin{figure*}[htb]
\begin{center}
\includegraphics[width=0.75\textwidth]{Images/GridPackPlot.png}
\end{center}
\caption{Slices of 3D hyperparameter search spaces, comprising minibatch size, $N$, and $\epsilon$ for PPO, and minibatch size, $N$, and $H$ for PPO-CMA. Minibatch size has only minor effect, and the slices with different minibatch sizes look approximately similar.}\label{fig:GridPackPlot}
\end{figure*}
\begin{figure*}[tb]
\begin{center}
\includegraphics[width=0.75\textwidth]{Images/ConvergencePlot.png}
\end{center}
\caption{Training curves from the 9 Roboschool environments used in the hyperparameter search. The plots use the best hyperparameter combinations in Figure \ref{fig:PPOvsPPO-CMA}.}\label{fig:ConvergencePlot}
\end{figure*}
| {'timestamp': '2020-08-04T02:30:29', 'yymm': '1810', 'arxiv_id': '1810.02541', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02541'} | arxiv |
\section{Introduction}
\label{sec:in}
As compared to the previous cellular system generations, fifth-generations (5G) is considered to be more innovative while promising the seamless connectivity for massive machine type communications (mMTC) and ultra-reliable and low latency communications (URLLC) \cite{R016}. Considering URLLC, achieving a low latency in conjunction with a very high reliability is a challenging task. However, with latency as much low as 1ms and 99.999\% reliability, mission critical communications can be ensured. This feature can support the ballooning demands of critical applications such as Tactile Internet, autonomous vehicles, and factory automation \cite{R007}.
Non-orthogonal multiple access (NOMA) technology has been introduced to address the need for high data rate while supporting multiple users within same time/frequency resource block \cite{R145}. When compared to the orthogonal multiple access (OMA), NOMA can provide higher performance in terms of spectral efficiency and energy efficiency. The potential benefits of NOMA can be exploited while integrated it with other technologies such as short-packet communications. On the other hand, grant-free NOMA has been proposed as a potential enabler technology for URLLC to support the time-critical applications \cite{R136}.
Researchers have come out with different designs paradigm to achieve the URLLC. This technology, infact, is envisioned as a potential solution for achieving low-latency in URLLC. With the short packet communications of finite blocklength, the conventional shannon capacity has been replaced with a new formula proposed in \cite{R139}.
In most of the existing studies, only the transmission delay and transmission error probability have been taken into account to model the required delay and reliability for the URLLC. However, we note that the queueing-delay could consist the highest latency in the system. In this regard, the concept of effective-bandwidth has been used to model the queuing delay of short packet communications in \cite{R007} which also considers the transmission error probability, queueing-delay violation probability, and proactive packet dropping probability. The proposed scheme proactively drops some packets to ensure the high reliability and low latency. Other designs paradigm has also been adopted to improve the transmission error probability in \cite{R141,R142,R143,R144}. Particularly, the polar codes are introduced in \cite{R141} to minimize the various delays that caused from the signal processing, coding, and transmission. Various diversity schemes have also been exploited to minimize the transmission and other delays while supporting the URLLC. Spatial diversity has been used to improve the reliability in \cite{R142}, while the frequency diversity has been investigated in \cite{R143}. Further, \cite{R144} shows that delay and reliability requirements for URLLC can be achieved with increased number of antennas at the BS.
On the other hand, performance of NOMA with short packet commications has been investigated in \cite{R140} where in the Transmission error probability has been translated into the block error length with finite blocklength and short transmission time. Simulations results demonstrate the effectiveness of the NOMA as compared to the OMA for reducing the transmission latency. However, the queueing-delay and queueing delay violation probability has not been taken into consideration in modelling the reliability and latency requirements in \cite{R140}.
With the above background study coverage, in this paper, we aim to answer the following question:
\textit{Given the low latency and high reliability requirements of URLLC, how much latency can NOMA reduce while satisfying the given reliability constraints. }
Employing the NOMA with short packet commications can result in the following advantages,
\begin{itemize}
\item As compared to NOMA, in conventional OMA schemes, base station (BS) has to employ the contention-based access scheme to mitigate the collision among multiple users. This can result into the increased delay/latency due to the increased collisions with the increased number of users. Hence, for the ultra-low latency, OMA cannot be employed.
\item NOMA does not use the grant acquisition as it uses the grant-free access. This grant-free access is helpful in satisfying the required delay and reliability requirements when the number of users increases.
\item NOMA can also be easily integrated with the other coding schemes such as polar codes to achieve the low latency for ultra-delay sensitive applications.
\end{itemize}
This paper will be a first attempt to analyse the performance limitations of NOMA in short packet communications for URLLC. The major contributions of our work can be summarized as follows:
\begin{itemize}
\item A performance analysis of NOMA for URLLC has been provided while considering the queueing-delay, error-rate, and packet sizes.
\item Transmission error probability and queueing-delay violation probability with finite blocklength codes has been taken into consideration to ensure the overall reliability.
\item Analysis of effective-bandwidth for the NOMA in URLLC has been provided. This analysis is then used to find the required SNR for the given latency and erro-rate.
\item Extensive simulations have been carried out to investigate the performance of NOMA for URLLC while taking into consideration the required SNR, transmission-error probability, delay exponent, and different packet sizes.
\end{itemize}
The rest of the paper is organized as follows. Section \ref{sec:system-model} provides the system model and problem formulation. Section \ref{sec:per-evaluation} shows the performance evaluation of the proposed analysis, and Section \ref{sec:conclusion} concludes the paper with future research directions.
\section{System Model and Problem Formulation}
\label{sec:system-model}
We consider a two users power-domain NOMA operation. Out of the two users, one user is getting a better channel condition such that,
\begin{equation}
\left | h_{1} \right |^2\geq \left | h_{2} \right |^2,
\end{equation}
where $h_{i}$ is the channel coefficient between the user $k_i$ and the BS, where $i=\left \{ 1,2 \right \}$.
According to the NOMA operation, the broadcast signal from the BS to the users can be defined as:
\begin{equation}
x=\sum_{i=1}^{2}\sqrt{\alpha_{i}Pm_{i}},
\end{equation}
where $\alpha_i$ is the power allocation coefficient, $P$ is the transmitted power, and $m_i$ is the message of user $k_i$. The received signal at user $i$ is hence given by
\begin{equation}
y_i=h_i\sum_{i=1}^{2} \sqrt{\alpha_{i}Pm_i} + n_i,
\end{equation}
where $n_i$ is the additive white Gaussian noise at user $i$. According to the conventional NOMA operation, $k_2$ decodes the $m_2$ first. The resulting signal-to-interference-plus-noise ratio (SINR) at $k_2$ to decode $m_2$, hence can be approximated as follows,
\begin{equation}
\label{eq:snr22}
\gamma_{22}=\frac{\alpha_{2}\left | h_{2} \right |^2 }{(\alpha_{1}\left | h_{2} \right |^2+\frac{1}{\rho })}
\end{equation}
where $\rho$ is the transmit signal-to-noise ratio (SNR). Similarly, $k_1$ first decodes $m_2$. The received SINR at $k_1$ for decoding first the $m_2$ is given as follows,
\begin{equation}
\label{eq:snr12}
\gamma_{12}=\frac{\alpha_{2}\left | h_{1} \right |^2 }{(\alpha_{1}\left | h_{2} \right |^2+\frac{1}{\rho })},
\end{equation}
after successfully decoding the $m_2$, the received SNR at $k_1$ to decode $m_1$ is,
\begin{equation}
\label{eq:snr11}
\gamma_{11}=\alpha_{1}\rho\left | h_1 \right |^2 .
\end{equation}
\noindent The overall reliability is the overall packet loss probability $\varepsilon _{D}$ of a single user which is the combination of transmission error probability and queueing-delay violation probability:
\begin{equation}
\label{eq:overallreb}
\varepsilon _{D}=\varepsilon _{C}+\varepsilon _{Q},
\end{equation}
where $\varepsilon _{C}$ is the transmission-error probability and $\varepsilon _{Q}$ is the queuing-delay violation probability. Normal operation of NOMA revolves around the principle of superposition coding (SC) at the transmitter and interference cancellation at the receiver. After considering the queueing delays and successive interference cancellation at the two users, the overall reliability can be summarized as follows,
\begin{equation}
\varepsilon _D=\varepsilon _{C_{ij}}+\varepsilon _{Q_{ij}},
\end{equation}
where $\varepsilon _{C_{ij}}$ and $\varepsilon _{Q_{ij}}$ are the transmission error probabilities and queuing-delays violation probabilities of user $k_i$ to decode the message $m_j$, where $i,j=\left \{ 1,2 \right \}$.
\noindent In this paper, we use the concept of effective bandwidth which models the performance of the system when taking into consideration the queuing-delay violation probability. Effective bandwidth can be defined as the minimal constant service rate while satisfying a certain queueing delay constraint for a given arrival process. It can be derived through large-deviation approximation. For poisson arrival process \{$ A_{p}$\}, the effective-bandwidth can be defined as \cite{R146}
\begin{equation}
\begin{split}
E_{ij}^{B}(\theta_{ij})=\frac{1}{T_{f} \theta_{ij}} {\rm ln} \left \{ \mathbb{E} \left [ {\rm exp}\left ( \theta_{ij} A_{p}\right ) \right ] \right \},
\end{split}
\end{equation}
where $\theta_{ij}$ is the quality-of-service (QoS) exponent for the user $k_i$ to decode the message $m_j$, smaller value of $\theta_{ij}$ indicates the larger queuing-delay bound. $T_{\rm{f}}$ is the frame duration and $\mathbb{E}[.]$ is the expectation operator. If the arrival rate is constant then the queueing-delay violation probability can be derived as \cite{R147}
\begin{equation}
\label{eq:qdviolation}
{\rm Pr}\left \{ D_{ij}(\infty)> D_{{\rm max}}^{q} \right \}\approx \eta_{ij}{\rm exp}\left \{-\theta_{ij} E_{ij}^{B}(\theta_{ij})D_{{\rm max}}^{q} \right \},
\end{equation}
where Pr$\{a>b\}$ shows the probability of $a$ being bigger than $b$, $D_{{\rm max}}^{q}$ is the delay bound, $\approx$ shows the approximation, and $\eta_{ij}$ is the probability of non-empty buffer and is approximated accurately when the queue length tends to infinity. For $\eta_{ij}\leq 1$, the queueing-delay violation probability can be,
\begin{equation}
{\rm Pr}\left \{ D_{ij}(\infty)> D_{{\rm max}}^{q} \right \}\approx{\rm exp}\left \{-\theta_{ij} E_{ij}^{B}(\theta_{ij})D_{{\rm max}}^{q} \right \}.
\end{equation}
From (\ref{eq:qdviolation}), the queuing-delay violation probability for user $k_i$ to decode message $m_j$ can be approximated as,
\begin{equation}
\varepsilon _{Q_{ij}}\approx{\rm exp}\left \{-\theta_{ij} E_{ij}^{B}(\theta_{ij})D_{{\rm max}}^{q} \right \}.
\end{equation}
The maximum number of packets that can be transmitted to any single user in frame $n$ can be approximated as \cite{R118}
\begin{equation}
\begin{split}
s_{ij}(n)=\frac{\phi B}{u{\rm ln}(2)}
\left \{{\rm ln}\left [ 1+\frac{\alpha_{i} P h_{i}}{N_{o} B} \right ] - \sqrt{\frac{V_{ij}}{\phi B}}Q^{-1}{(\varepsilon_{C_{ij}})}\right \} \\ {\rm (packets)},
\end{split}
\end{equation}
\noindent where $\phi$ is the data transmission phase, $B$ is the bandwidth. $\phi B$ is the block-length that can be used for the short packet communications, $u$ is the size of packet in bits, $N_{o}$ is the spectral density of noise, $Q^{-1}(.)$ is the inverse of Gaussian Q-function, and $V_{ij}$ is the channel dispersion of user $k_i$ to decode the message $m_j$, that can be approximated by \cite{R148}
\begin{equation}
V_{ij}=1-\frac{1}{[ 1+\frac{\alpha_{i} Ph_{i}}{N_{o} B}]}.
\end{equation}
If the $k_{th}$ user is served with the constant rate, i.e., $E_{ij}^{B}(\theta_{ij})$, then we can approximate the number of packets transmitted in frame $n$ using \cite{R007},
\begin{equation}
\label{eq:arrival-approximate}
s_{ij}(n)=T_{f}E_{ij}^{B}(\theta_{ij}) \quad {\rm (packets)}.
\end{equation}
From (\ref{eq:snr22}), (\ref{eq:snr12}), (\ref{eq:snr11}), and (\ref{eq:arrival-approximate}), the required SINR at user $k_i$ to decode message $m_j$ can be approximated using:
\begin{equation}
\begin{split}
{\rm ln}(1+\gamma_{ij})=\frac{T_{f}u{\rm ln}(2)}{\phi B}E_{ij}^{B}(\theta_{ij})+
\sqrt \frac{V_{ij}}{\phi B}Q^{-1}(\varepsilon_{C_{ij}}).
\end{split}
\end{equation}
The performance of the proposed NOMA for achieving URLLC can be compared with the OMA for URLLC. For any single user $k_i$, the performance of orthogonal frequency-division multiplexing (OFDM) for URLLC can be derived as:
\begin{equation}
\begin{split}
s_i(n)=\frac{\phi B}{2u{\rm ln}(2)} \left \{{\rm ln}\left [ 1+\frac{\alpha_{i} P h_{i}}{N_{o} B} \right ] -\sqrt{\frac{2V_{i}}{\phi B}}Q^{-1}{(\varepsilon_{C_{i}})}\right \},
\end{split}
\end{equation}
where $V_i$ and $\varepsilon_{C_{i}}$ is the channel dispersion and the transmission error probability of the $k_{ith}$ user employing the OMA operation.
From (\ref{eq:arrival-approximate}) the required SNR to calculate the transmission error probability $(\varepsilon_{C_i})$ and queueing-delay violation probability $(\varepsilon_{Q_i})$ for $k_{ith}$ user under OFDMA operation can be described as follows:
\begin{equation}
\begin{split}
{\rm ln}(1+\gamma_{i})=\frac{2T_{f}u{\rm ln}(2)}{\phi B}E_{i}^{B}(\theta_{i}) + \sqrt \frac{2V_{i}}{\phi B}fQ^{-1}(\varepsilon_{C_{i}}),
\end{split}
\end{equation}
where $\gamma_{i}$ is SNR and $E_{i}^{B}(\theta_{i})$ is the effective-bandwidth with $\theta_i$ as the QoS exponent of the $k_{ith}$ user.
\section{Performance Evaluation}
\label{sec:per-evaluation}
\begin{table}
\footnotesize
\centering
\caption{Simulation Parameters}
\label{tab_sim_para}
\begin{tabular}{|p{3.7cm}|p{2cm}|}
\hline
Frame duration $T_f$ & 0.5 ms \\\hline
Overall reliability $\varepsilon _{D}$ & 1 - 99.999\% \\\hline
Queuing Delay $D_{\rm max}$ & 0.8 ms \\\hline
Bandwidth $B$ &100 kb/s \\\hline
Packet size $u$ &5,15, and 25 bytes \\\hline
Duration of data transmission $\phi$ & $10^{-5}$ and $3\times10^{-4}$ \\\hline
Average number of events per event $\lambda$ & 0.01 \\\hline
\end{tabular}
\end{table}
\begin{figure}
\centering
\includegraphics[width=8.5cm,height=7.5cm]{Figure1}
\caption{SNR requirements for the given transmission error probability ($10^{-5}$ to $10^{-3}$) with different packet sizes. }
\label{Figure1}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=8.5cm,height=7.5cm]{Figure2}
\caption{SNR requirements for the given transmission error probability ($10^{-5}$ to $10^{-3}$) with different duration of data transmission ($\phi$). }
\label{Figure2}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=8.5cm,height=7.5cm]{Figure3}
\caption{SNR requirements for the given delay QoS exponent ($\theta_{ij}=10^{-3}$ to 1 ) with different packet sizes. }
\label{Figure3}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=8.5cm,height=7.5cm]{Figure4}
\caption{SNR requirements for the given delay QoS exponent ($\theta_{ij}=10^{-3}$ to 1 ) with different duration of data transmission ($\phi$). }
\label{Figure4}
\end{figure}
In this section, we analyse the effective-bandwidth of NOMA for URLLC. Simulations have been performed to find the required SNR/SINR for a certain error-rate and latency requirement. Simulation parameters have been described in Table \ref{tab_sim_para}, unless otherwise specified in different simulation results.
For a given transmission-error probability and queueing-delay violation probability, the required SNR for the NOMA user has been analysed in detail. Queueing-delay with extremely short delay bound has been derived from the effective bandwidth using the Poisson process. In Fig. \ref{Figure1}, SNR requirements for the given transmission error probability ($\varepsilon_D= 10^{-5}$ to $10^{-3}$) and delay QoS exponent ($\theta_{ij}=0.1$) with differen packets sizes are shown. The required SNR is small with small packet size and as the packet size increases the required SNR increased. However, with increase in the channel errors (transmission error probability), the required SNR decreases. It shows that, for tighter reliability requirements, a higher SNR is needed.
The duration of data transmission within one frame duration has also been analysed in Fig. \ref{Figure2}. The increase in data transmission duration with the given frame duration of $T_{\rm{f}}=0.5 \rm{ms}$ also results into the lower requierd SNR. From Fig. \ref{Figure1} and \ref{Figure2}, it is clear that with the short packet and short data transmission duration the required SNR decreases.
Queuing-delay for NOMA in URLLC with extremely short delay bound ($D_{\rm max}= 0.8 \rm{ms}$) has also been investigated through simulations. In Fig. \ref{Figure3}, required SNR with the different values of delay QoS exponent has been shown. The increased value of $\theta_{ij}$ shows the increased in the delay (more stringent delay requirements). With increased in the delay, the required SNR increased. From $\theta_{ij}=0.1$ to $1$, the delay requirements are more stringent, which shows that the SNR requirements will also be high. This trend has also been investigated with different packet size of 5, 15, and 25 bytes while keeping the data transmission duration fixed. Here, also the short packets with different delay requirements show small SNR requirements as compared to the large packets. The delay analysis for different data transmission duration with packet size of 15 bytes has been shown in Fig. \ref{Figure4}. The short data transmissions duration seems to be more susceptible with more stringent delay requirements as compared to the slighter larger data transmission duration. For this analysis the frame duration has been kept fixed at $T_{\rm{f}}=0.5 \rm{ms}$.
From Fig. \ref{Figure1} to \ref{Figure4}, the SNR requirements for the NOMA systems for ultra-reliable and low latency communications have been analysed while considering the different transmission error probability and queueing-delay violation probability. It is clear from the simulation results that employment of short packets to ensure the ultra-reliability and latency has a significant impact on SNR requirements to achieve the certain latency and error rate for NOMA in URLLC.
As a future work, we will perform an-depth performance analysis of NOMA for URLLC communications with different arrival rate and by optimizing the different resources in the system. We will also integrate other state-of-the-art technologies such as cogntive radio networks \cite{R149,R152} and wireless sensor networks \cite{R151} with NOMA-URLLC to investigate the delay-sensitive applications.
\section{Conclusion}
\label{sec:conclusion}
In this paper, the performance of the power-domain non-orthogonal multiple access (NOMA) for ultra-reliable and low latency communications (URLLC) has been analysed with the help of effective-bandwidth. Queuing-delay and transmission delay has been considered to model the latency, while the reliability is modelled using the transmission error probability and queueing-delay violation probability. NOMA has significantly reduced the physical layer latency and improved the reliability for URLLC to support the time-critical applications. Extensive simulations have been carried out to show the SNR requirements while considering transmission error probability, delay QoS exponent, and different packet sizes.
| {'timestamp': '2018-10-05T02:13:20', 'yymm': '1810', 'arxiv_id': '1810.02276', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02276'} | arxiv |
\section{Introduction}
\cfoot{This is the author-created version of the work accepted at the 19th International Conference on Product-Focused Software Process Improvement 2018 (PROFES 2018). A link to the final authenticated version will be added when it is available.}
Software development is a human-centric and socio-technical activity. The complex interaction of different values, attitudes, behavioural patterns, beliefs and communication approaches of members of a project can give rise to misunderstanding and misinterpretation of intent. This misunderstanding can result in conflict, mistrust and under-utilisation of expertise \cite{beecham2015motivates}.
Globalisation implies cultural heterogeneity \cite{noll2010global} requiring organisations to develop high cross-cultural understanding, intercultural communication skills and management competencies. Global organisations that take the cultural context of their teams into account generally experience greater project success \cite{richardson2012process}. Global software development (GSD) is an established field of application and research. Developing software offshore, in different parts of the world, amongst other economic benefits, gives access to skills and knowledge over and above those available in the local environment \cite{beecham2015assessing}.
GSD is widespread, and therefore it is important to have a good understanding of the effects of cultural differences within multi-site teams. Culture will have a strong bearing on how individuals are motivated and therefore needs to be taken into account when managing, interacting with and rewarding individual software engineers \cite{beecham2015motivates}. The implications of such cultural factors are amplified within global teams increasing project risk and uncertainty \cite{marinho2017managing}.
In managing GSD projects, differences between various dimensions of team members' cultures can lead to increased conflict, reduced quality of cooperation and increased effort required to obtain trust \cite{noll2010global}. Cultural diversity is shown to be an issue in GSD, leading to a significant amount of research on how to manage cultural differences, in fact culture is one of the mature research areas in Global Software Engineering research \cite{ebert2016global}.
The existing GSD literature also suggests that many software GSD organisations have the potential benefits, resulting in project delays \cite{niazi2016challenges}. For this reason, several studies have looked at methods for improving the results of GSD. Although there has been a significant growth in GSD practice and agile scalability frameworks \cite{razzak2017transition}, this particular strand of research is generally focussed on technical problems and often overlooks cultural difference issues.
Richardson et al. \cite{richardson2012process} developed a global teaming model (GTM) that presented a set of practices for effective management of software teams in GSD scenarios. Although the GTM addresses the need to acknowledge cultural differences and provides some relevant recommendations, the model is focussed on general practices in GSD and does not present clear implementable practices for solving problems arising from cultural differences.
This paper contributes to the GSD the body of knowledge by presenting a set of practices for managing culture in distributed teams. These cultural practices are the result of a systematic synthesis of recommendations found in the related GSD. We present 12 distilled best practices that address how global practitioners can manage cultural differences in GSD. These practices are aligned with Scaled Agile Framework (SAFe) roles \cite{leffingwell2007scaling}.
This paper is organized as follows: in Section \ref{sec:background}, we introduce the background to the problem and define our research questions. Section \ref{sec:method} describes the method we apply. Sections \ref{sec:results} and \ref{sec:discussion}, present the results, their implications and limitations, respectively. Finally, in Section \ref{sec:conclusions} presents conclusions and future research directions.
\section{Background} \label{sec:background}
\subsection{Global Software Development - GSD}
GSD involves the use of teams located in scattered locations worldwide to develop commercially viable software \cite{beecham2015assessing}. The GSD approach allows companies to leverage development benefits in terms of time, cost and access to appropriate and a wider set of resources \cite{beecham2015assessing}. In developed countries, there is an increasing interest in using GSD to benefit from cost disparities with developing-country labour markets; and some organisations have adopted GSD found a reduction in software development costs and increased product quality as objectives \cite{niazi2016challenges}.
However, cultural differences associated with geographically distributed teams and the need to work across different time zones are problematic for GSD-based projects \cite{noll2010global}, and several key GSD challenges have been identified, namely, lack of customer involvement, lack of knowledge transfer, hidden costs and communication problems \cite{niazi2016challenges}. Certainly cost advantages are not guaranteed with evidence pointing to increased communication overhead as a costly problem \cite{smite2011whisper}.
The GTM \cite{richardson2012process} has been proposed as a solution to problems in GSD. The GTM was developed as a mechanism for guiding project managers in a global context based on recommendations for addressing time, culture and geographic problems.
\subsection{Global Teaming Model - GTM}
The GTM is a global software engineering model with a particular emphasis on the organisation, governance and management of globally distributed development teams. The specific practices are further elaborated into sub-practices that are used to provide one or more recommendations for implementing detailed actions. Overall, GTM comprises five specific practices, twenty sub-practices and sixty-four recommendations, all of which have been validated against real industrial scenarios \cite{beecham2014motivating,beecham2015motivates}.
Based on their empirical studies, Richardson et al. \cite{richardson2012process} further recommended that ``Cultural differences should be identified and communicated to the management and team members''. However, GTM does not specify how, or by whom, practices should be implemented.
\subsection{Cultural Differences in GSD}
Culture, the sum of the learned values and behaviours shared by a group of people, plays a vital role in guiding how a person performs his/her work through their individual patterns of thinking, feeling and acting \cite{macgregor2005impact}. Given that global virtual team members have diverse national, organisational, professional and cultural backgrounds, cultural diversity is inherent in GSD \cite{richardson2012process}. Studies have shown that cultural diversity can be beneficial in increasing creativity and innovation, which are essential to the knowledge-intensive work of software development \cite{richardson2012process}. Nevertheless, cultural diversity can also become a barrier to communication, coordination and knowledge-sharing and transference, adding difficulties to the management of GSD \cite{noll2010global,monasor2012cultural,niazi2016challenges}.
\section{Method} \label{sec:method}
In carrying out this study, we took a systematic yet focussed approach to examining the relevant literature. Our goal was not to uncover all recorded practices but to select a sufficient collection of studies to enable the identification of recurring themes.
Established systematic review guidelines \cite{kitchenham2007guidelines} recommend that a reviewer carry out the following steps: (i) identify the need for a systematic literature review; (ii) formulate review research question(s); (iii) carry out a search for relevant studies. (iv) assess and record the quality of included studies; (v) classify the data needed to answer the research question(s); (vi) extract data from each included study; (vii) summarise and synthesise study results (meta-analysis); (viii) interpret results to determine their applicability; and (ix) write up the study results as a report.
The need for this review was established through an examination of the software engineering literature, which revealed no comprehensive survey addressing the research question regarding practices with respect to managing, identifying and communicating cultural differences in GSD projects.
We therefore sought to answer the following research question: \emph{How should cultural differences be managed, identified and communicated to a GSD team?}
We used the following boolean search string to ensure that we captured a wide variety of papers: \emph{(((Global OR distributed) AND (``software engineering'' OR ``software development'')) AND ``cultural differences'')}.
We used this string to search the metadata relating to journals and conference proceedings in the IEEEXplore, ACM Digital Library, Elsevier ScienceDirect and Scopus bibliographic databases.
\subsection{Document selection}
The search produced 451 references (IEEE = 73; ACM = 58; Scopus = 72; and Science = 248). The idealised selection process had two components: (sp1) an initial selection of research results that could reasonably satisfy the selection criteria (outlined next) based on a reading of the articles' titles and abstracts; followed by (sp2) a final selection against these criteria from the initially selected list of papers based on a reading of their introductions and conclusions.
\emph{Inclusion/Exclusion criteria}: The following criteria guided the selection of papers that helped us address the research questions.
We \emph{included}: (i) complete, peer reviewed, published articles; and (ii) empirical studies that fully or partially addressed one or more of our research questions. Texts had to be (iii) published between January 2007 and February 2018. (The start date relates to the year that the Scaled Agile Framework (SAFe) \cite{leffingwell2007scaling} was introduced, and limited the number of studies down to a manageable size).
We \emph{excluded}: (i) texts not published in English; (ii) lacking in proven scientific relevance; (iii) incomplete papers; and (iv) articles that not clearly related to the research questions.
Before accepting a paper into the final set for review, we checked to ensure that there was no replication. For example, if a given study was published in two different journals with a different order of primary authors, only one study would be included in the review; this would usually be the most comprehensive or recent study. Besides, we checked to ensure that there was no duplication. For example, the same paper listed in more than one database, only one study would be included in the review.
We identified 21 duplicate articles and none replication. After excluding duplicated results from the dataset, we identified 430 articles for inclusion in the initial selection (sp1). Of these, 31 were passed on to the sp2 stage, in which a further twelve were eliminated and nineteen were passed on to the data extraction and data synthesis phase.
\subsection{Study Quality} \label{quality}
The quality assessment criteria adopted for our study are based on principles and good practices established for driving empirical research in software engineering \cite{dyba2007applying}, are briefly summarised as follows. We answered the following questions using \emph{Yes, No, Partially}: (i) Is there a clear definition of the study objectives?; (ii) Is there a clear definition of the justifications of the study?; (iii) Is there a clear definition of how the research was carried out?; (iv) Is validity threat addressed in the study discussion?; and (v) Are the findings of the research clearly stated?
\subsection{Data Extraction}
We examined each selected publication to extract the following elements: (i) study aim or research question; (ii) identified practices for addressing cultural diverse in GSD teams; (iii) other results relevant to the study; and (iv) potential themes emerging from the study's conclusions.
We synthesised the data by first identifying each paper's recommendation as to how to identify and communicate cultural differences to the GSE team. We then generated a summary showing the number of papers mentioning each practice (see Table \ref{practices}). As we gave each occurrence the same weight, the frequencies presented simply reflect how many papers mention a given practice; frequencies therefore reflect prevalence of a theme and not its potential importance.
\section{Results} \label{sec:results}
Of the initial 451 papers examined, 19 met the criteria established in Section \ref{sec:method} as sources for this study; these are listed in Table \ref{tab1}. Analysis of these papers with respect to our research questions revealed practices for identifying and communicating cultural differences in GSD.
\begin{table}
{\scriptsize
\caption{Paper Accepted for Analysis.}\label{tab1}
\begin{tabular}{|l|l|l|}
\hline
Author(s) & Title & Ref\\
\hline
Ayed et al. & Agile Cultural Challenges in Europe and Asia: Insights from Practitioners & \cite{ayed2017agile} \\
Bannerman et al. & Scrum Practice Mitigation of Global Software Development Coordination & \\
& Challenges: A Distinctive Advantage? & \cite{bannerman2012scrum}\\
Breth and & Toward an Integrative Model of Influence Factors for Success of Global & \\
Drechsler & software development projects & \cite{breth2014toward} \\
Boden et al. & Knowledge Management in Distributed Software Development Teams - & \\
& Does Culture Matter? & \cite{boden2009knowledge} \\
Casey & Leveraging or Exploiting Cultural Difference? & \cite{casey2009leveraging} \\
Chang and B{\'u}rca & An Investigation into how Small Companies in London and the South East & \\
& UK Engage in IT Offshore Outsourcing and the Impact of Culture on this & \\
& Phenomenon & \cite{chang2016investigation} \\
Cramton and Hinds & An Embedded Model of Cultural Adaptation in Global Teams & \cite{cramton2014embedded} \\
Deshpande et al. & Culture in Global Software Development - A Weakness or Strength? & \cite{deshpande2010culture} \\
Dorairaj et al. & Bridging Cultural Differences: A Grounded Theory Perspective & \cite{dorairaj2011bridging} \\
Giuffrida and & A Conceptual Framework to Study the Role of Communication Through & \\
Dittrich & Social Software for Coordination in Globally-Distributed Software Teams & \cite{giuffrida2015conceptual} \\
Holtkamp et al. & Soft Competency Requirements in Requirements Engineering, Software & \\
& Design, Implementation, and Testing & \cite{holtkamp2015soft} \\
Huang and Trauth & Cultural Influences on Temporal Separation and Coordination in Globally & \\
& Distributed Software Development & \cite{huang2008cultural} \\
Mishra and Mishra & Cultural Issues in Distributed Software Development: A Review & \cite{mishra2014cultural}\\
Spohrer et al. & Global Sourcing of Information Systems Development - Explaining Project & \\
& Outcomes based on Social, cultural, and Asset-Related Characteristics & \cite{spohrer2012global} \\
Schloegel et al. & Age Stereotypes in Distributed Software Development: The Impact of & \\
& Culture on Age-Related Performance Expectations & \cite{schloegel2018age} \\
Tugrul et al. & Exploring the Communication Breakdown in Global Virtual Teams & \cite{daim2012exploring} \\
van Marrewijk & Situational Construction of Dutch--Indian Cultural Differences in Global & \\
& IT Projects & \cite{van2010situational} \\
Zaghloul et al & Communication in Firm-Internal Global Software Development with China & \cite{zaghloul2015communication} \\
Zeid & Using Simulation Games to Teach Global Software Engineering Courses & \cite{zeid2015using} \\ \hline
\end{tabular}}
\end{table}
Each study was assessed independently by two researchers according to five possible quality criteria (see Section \ref{quality}). Only one studies \cite{huang2008cultural} received the maximum score. The other papers were evaluated on the following scales: 12 between 4,5-4,0; 3 between 3,5-3,0 and 3 less or equal 2,5 points.
\begin{table}
{\scriptsize
\caption{Practices to deal with cultural differences in GSD }\label{practices}
\begin{tabular}{|l|l|l|}
\hline
Practice & Citations\\
\hline
Understand and be aware of cultural differences &
\cite{breth2014toward,casey2009leveraging,chang2016investigation,daim2012exploring,dorairaj2011bridging,huang2008cultural,mishra2014cultural,van2010situational,zeid2015using} \\
Make onsite visits & \cite{boden2009knowledge,chang2016investigation,deshpande2010culture,dorairaj2011bridging,huang2008cultural,schloegel2018age,zeid2015using} \\
Standardise skills required for global team members & \cite{ayed2017agile,cramton2014embedded,deshpande2010culture,huang2008cultural,schloegel2018age,spohrer2012global,zeid2015using} \\
Identify and establish the cultural context of each global team & \cite{casey2009leveraging,cramton2014embedded,daim2012exploring,giuffrida2015conceptual,huang2008cultural,schloegel2018age,spohrer2012global} \\
Provide cultural training & \cite{bannerman2012scrum,casey2009leveraging,deshpande2010culture,huang2008cultural,schloegel2018age,spohrer2012global} \\
Look out for cultural misunderstanding in Requirement & \cite{chang2016investigation,breth2014toward,holtkamp2015soft,huang2008cultural,mishra2014cultural,spohrer2012global} \\
Develop and maintain cultural knowledge base & \cite{breth2014toward,cramton2014embedded,huang2008cultural,schloegel2018age,zeid2015using} \\
Assign a local manager with the skills needed for a global team & \cite{boden2009knowledge,chang2016investigation,deshpande2010culture,holtkamp2015soft,huang2008cultural} \\
Offer English language training sessions & \cite{deshpande2010culture,huang2008cultural,schloegel2018age,zaghloul2015communication} \\
Plan how to mitigate issues caused by cultural misunderstanding & \cite{bannerman2012scrum,boden2009knowledge,deshpande2010culture,dorairaj2011bridging} \\
Prepare for distributed meetings & \cite{dorairaj2011bridging,zaghloul2015communication,zeid2015using} \\
Project managers should take into account cultural differences during & \\ group exercises & \cite{chang2016investigation,huang2008cultural} \\ \hline
\end{tabular}}
\end{table}
\subsection{Understand and be aware of cultural differences}
Project managers must recognise and understand the cultural needs of their global teams with respect to their differing organisational, geographic, national, religious, gender and power relations \cite{mishra2014cultural}.
Understanding the challenges associated with cultural differences at an early stage can help workgroups in more effectively managing their cross-cultural communication and conflict management techniques \cite{zeid2015using}.
To address problems in software development while maintaining an atmosphere of mutual respect and team spirit, a global team needs to be aware of its members' respective cultural norms. To develop a better understanding of cultural differences, it is important to consider the personal experiences of team members \cite{dorairaj2011bridging}. In developing an understanding of the subtleties of cultural influence on GSD development, it is also important to draw upon the subjective experience and understanding of the participants \cite{huang2008cultural,van2010situational}.
Because certain activities and types of behaviour that are acceptable in one culture might be unacceptable in another, project managers and participants seeking more effective interaction must understand the multiple individual historical, political, economic, social and cultural contexts of team members \cite{casey2009leveraging}.
The first step to bridging cultural differences is stimulating cultural awareness \cite{dorairaj2011bridging}, and GSD project team members should be prepared for intercultural collaboration by raising an initial awareness of cultural differences \cite{breth2014toward,daim2012exploring,van2010situational,huang2008cultural}.
Cultural awareness helps global teams in collaborating efficiently to achieve the goals and visions of projects \cite{dorairaj2011bridging}. Team members should have an understanding of other members' cultural backgrounds to enable an atmosphere of mutual respect in the software development process \cite{chang2016investigation,dorairaj2011bridging}.
\subsection{Make onsite visits}
Another useful practice is conducting face-to-face meetings at remote sites to provide socialisation opportunities that enhance trust-building \cite{huang2008cultural}.
Some studies \cite{chang2016investigation,deshpande2010culture,dorairaj2011bridging,boden2009knowledge,huang2008cultural} have reported that onsite visits help team members to improve mutual understanding, resolve issues and become familiar with others' work practices, priorities and environments. The results of time spent at outside sites have revealed that personal, face-to-face contact plays a significant role in knowledge exchange \cite{boden2009knowledge,huang2008cultural}.
In addition to building trust in the skills of remote team members, personal meetings play an essential role in learning how to approach offsite personnel. Such face-to-face meetings constitute an essential basis for building social ties, which are reinforced by informal exchange of personal information online \cite{boden2009knowledge,zeid2015using}.
As building an understanding of different values and norms takes some time, management should, despite the additional cost, consider sending team members abroad for more extended periods or even maintaining mixed-cultural teams at project locations \cite{schloegel2018age}.
\subsection{Standardise skills required for global team members}
Spohrer et al. \cite{spohrer2012global} suggested that success on a project level is contingent on the quality of the relationship between both the partner organisations and the respective employee teams.
Team members and managers encounter cultural differences in terms of expectations, meanings and norms that are stubbornly anchored in local institutions, societies and contexts. By applying an embedded view of cultural adaptation, project managers can become more aware of and effective in responding to the challenges team members face as they bridge worlds \cite{cramton2014embedded,schloegel2018age}.
Understanding the subtleties of cultural influence on a global project requires drawing on the subjective experiences and understandings of the global virtual team members who are engaged in the work \cite{huang2008cultural}.
Attributes to be considered in understanding other team members include: the language used for communication, which is essential to the interpretation of discussion and communication; gender, which is crucial in identifying the role of female participants as team members while managing cultural diversity \cite{deshpande2010culture}; geography, i.e., where the team members are located; age, as age stereotypes and problems in a GSD context can create considerable barriers to the complex task of software development \cite{schloegel2018age}; Hofstede cultural measures \cite{hofstede1991cultures}, which can help in gaining insight to differing national cultures \cite{deshpande2010culture,zeid2015using,ayed2017agile,schloegel2018age}; and, finally, skills in terms of identifying requirements, developing designs, implementation, testing, leadership and knowledge of other cultures \cite{cramton2014embedded,zeid2015using}.
\subsection{Identify and establish the cultural context of each global team}
Culture has many interacting layers that cannot be examined in isolation. Virtual partners can differ in terms of organisational culture, resulting in work practice differences that impact project success \cite{spohrer2012global,daim2012exploring}.
Different cultures often have different values, attitudes, beliefs, behavioural norms and approaches to communication and problem-solving; these differences can lead to, on one hand, creativity and innovation and, on the other hand, misunderstandings and conflict in the GSD process \cite{schloegel2018age,cramton2014embedded,spohrer2012global,casey2009leveraging}.
Spohrer et al.'s \cite{spohrer2012global} literature and practice investigation revealed that differences in terms of modes of thinking and acting can affect the quality of the relationship between teams. The authors commented that high variance in habits can in some cases be traced back to differences in culture. However, standardised procedures, working practices and roles could decrease misunderstanding and disagreement as to responsibilities.
Huang and Trauth \cite{huang2008cultural} reported on a global project in which members discussed the effects of organisational culture on values and norms and the effects of bridging some of these cultural differences on time estimation, commitment and adherence to schedule. The project established and promoted global value procedures to leverage its diverse talents and enhance the synergies amongst different company sites. Team members reported that they felt that the organisation valued local cultural diversity while striving to develop a global culture that could serve as a sensemaking device to guide and shape the behaviours of its global workforce.
Identifying and establishing the cultural context of a global team based on respective social customs can help in understanding organisational categorisations, establishing practices in new distributed teams and re-negotiating practices in established teams \cite{giuffrida2015conceptual}.
\subsection{Provide a Cultural Training}
Culture and language differences in particular can quickly lead to misunderstandings and/or offense, alienating people and resulting in cooperation barriers \cite{bannerman2012scrum}.
In \cite{spohrer2012global}, a global project with Indian and German teams had an Indian manager at its German site who had been living in Germany for three years. According to the report, this cultural experience provided the manager with an improved understanding of the differences in terms of culture, behaviour and work practices between the two teams.
Training can aid in the education of team members from different cultures or with different religious values and in the interpretation of the behaviours of geographically distinct team members and clients, resulting in an enhanced level of understanding \cite{spohrer2012global,deshpande2010culture,casey2009leveraging,huang2008cultural}.
Schloegel et al. \cite{schloegel2018age} identified cultural training in a GSD context as one of the most important best practices for global teams and posited that it is an economically efficient route to achieving better understanding amongst project participants and, therefore, improved prospects for project success. As a result, cultural diversity training for global team members has become a commonly used strategy for promoting cultural awareness \cite{huang2008cultural}.
\subsection{Look out for cultural misunderstanding in Requirements}
In the early phases of the software development process, many projects must cope with volatile and ambiguous requirements or specifications that can only be resolved through communication amongst all stakeholders. These early phases are, consequently, the most critical of the GSD process \cite{breth2014toward}, and it is necessary that a sufficient understanding of specifications be reached on the vendor side before technical specification of the system begins \cite{mishra2014cultural}.
Chang and B{\'u}rca \cite{chang2016investigation} reported a case study in which there was a misunderstanding of delivery obligations as a result of cultural issues. Following this, the project members worked together to establish social criteria for the delivery of requirements.
In complement, Spohrer et al. \cite{spohrer2012global} and Huang and Trauth \cite{huang2008cultural} reinforce the role of national cultural mindset for the ``problem solving processes'', which in turn, is an essential element of requirements engineering ``to decode the meanings behind each other's language'' about ``business needs'', and transform those needs in software requirements. Hence, Holtkamp et al. \cite{holtkamp2015soft} point out that ``intercultural competences seem to be specifically important in tasks with a high level of communication''.
\subsection{Develop and maintain a cultural knowledge base}
During the team-building phase, GSD project members require ample time to get to know each other and to reflect on culture-specific communication and collaboration behaviours \cite{breth2014toward}.
Although culturally driven divergences in terms of modes of communication are common, consultation or attempts to obtain more information on other cultures leads to improvements in communication among project members \cite{cramton2014embedded,zeid2015using}
Different cultural backgrounds in GSD projects lead to different team member experiences and knowledge bases; increasing the similarity of the knowledge bases and the extent of a shared understanding will lead to less ambiguity and more successful exchange between project members \cite{breth2014toward}.
Schloegel et al. \cite{schloegel2018age} explained that team members from different national cultures have different communication and problem-solving processes, leading to problems in creating collective knowledge, a shared mental model, social ties and trust, all of which can negatively impact the product quality.
It is therefore vital to create a technical knowledge-base for decoding the meanings behind each member's language, develop a protocol for sharing information and apprising the team of cultural differences and the use of the knowledge-base \cite{huang2008cultural}.
\subsection{Assign a local manager with the skills needed for a global team}
Onsite managers can help manage cultural diversity in GSD \cite{deshpande2010culture}. Local project managers play a critical role in temporal coordination through their responsibility for evaluating available resources, setting realistic goals, monitoring processes, making resource and schedule adjustments when needed and communicating and coordinating with other remote sites concerning changes and progress \cite{huang2008cultural}.
Boden and Liam \cite{boden2009knowledge} found that people with relevant technical and domain knowledge who can connect between cultures make natural facilitators for managing and mediating communication. Similarly, Huang and Trauth underlined the necessity of educating qualified local GSD project managers \cite{huang2008cultural,holtkamp2015soft}.
Chang and B{\'u}rca \cite{chang2016investigation} presented a case in which the local manager became essential to the coordination of cultural challenges. Their finding suggests the importance to the overall GSD process of having a local manager to mediate communication issues and conduct project activities.
\subsection{Offer English language training sessions}
In situations in which team members do not share a common English language proficiency, training can be provided to enhance language skills \cite{deshpande2010culture}. Such language training can be essential to promoting cultural understanding and facilitating communication \cite{huang2008cultural}.
English language training is best facilitated through the provision of training sessions to all virtual teams with a focus on business terms used in the industry \cite{zaghloul2015communication}. Creating mutual understanding by increasing contact in various ways is even more critical when projects face cultural differences \cite{schloegel2018age}.
\subsection{Plan how to mitigate issues caused by cultural misunderstanding}
Teams with frequent contact and mutual development in which a good professional working relationship is fostered among teams tend to outperform disconnected teams \cite{bannerman2012scrum,deshpande2010culture}.
The project manager should plan responses in the form of shared artefacts and repositories that can mitigate problems caused by cultural differences \cite{boden2009knowledge}. Additionally, the establishment of backup teams at various geographical locations can help international GSD project managers address unforeseen or surplus events that arise as a result of cultural differences \cite{deshpande2010culture}. Global teams should also develop shared work practices to strengthen their team relationships \cite{dorairaj2011bridging}.
\subsection{Prepare for distributed meetings}
Clear meeting agendas and minutes must be written and disseminated early enough to provide team members with the chance to prepare for meetings \cite{zeid2015using}. Using minutes, team members can write down issues that they wish to discuss during the meeting, enabling them to express themselves clearly and be better understood by other team members \cite{dorairaj2011bridging}.
In general, managers and participants should not provide simple ``yes'' or ``no'' answers. In some cultures it is a common practice for respondents to write up a document outlining their opinions following important sessions.
It is essential that the project manager repeatedly underline the importance of open conversation and to be understanding of reporting mistakes during projects \cite{zaghloul2015communication}.
\subsection{Project managers should take into account cultural differences during group exercises}
Cultural differences can occur even when teams share a common language and/or nationality, as differences in ``corporate culture'' can lead to conflicting approaches to problem-solving and communication, which in turn might be misinterpreted as rudeness or incompetence \cite{chang2016investigation}.
Such ``clashes of cultures'' in the form of misunderstandings and schedule delays are common occurrences in global projects. It is therefore necessary to foster an open atmosphere and establish trust relationships at the team level to make team members more willing to raise issues, express concerns and seek and offer help \cite{chang2016investigation,huang2008cultural}. The project manager should repeatedly convey the importance of open conversation. This process can be abetted through the use of a progress-tracking system in which a developer updates the status of his/her task each day to avoid late notifications \cite{huang2008cultural}.
\section{Discussion} \label{sec:discussion}
In this study, we extracted practices for managing, identifying and communicating cultural differences amongst GSD team members. From a directed search of the literature, we have isolated and identified 12 practices that help to align cultural differences amongst members operating in across multi-site and multi-cultural teams. Research suggests that implementing these practices are important to the success of global software development projects. Such practices can be used in the context of GSD teams that adopt specific approaches by combining well-structured comprehensive methods (traditional) or flexible agile practices or yet the combination between traditional and Agile, a hybrid approach \cite{kuhrmann2017hybrid}; for instance, they can be used in the context of scaling Agile \cite{razzak2017transition}. We believe that this would represent a successful contribution to the Scaled Agile Framework (SAFe).
Although SAFe focusses on large enterprises and takes a scaled approach to Agile adoption, it does not currently represent practices with a cultural difference focus.
To help implement our set of identified practices, we convert each practice into a pattern. We replicate this \emph{patternizing} of a practice method as introduced in Noll et al \cite{noll2014patternizing}. Patterns break down a process into: goals, inputs and outputs, artefacts, and suggested steps. Steps are defined by an action and a role (\emph{who} - a person responsible for carrying out the action (s)). We have defined these roles according to those delineated under SAFe \cite{leffingwell2007scaling}: Development Team (DT); Scrum Master (SM); Release Train Engineer (RTE); Solution Train Engineer (STE); Product Owner (PO); Product Management (PM); and Solution Management (SM).
\subsubsection{Understand and be aware of cultural differences} \emph{Goal}: Understand and raise awareness of cultural differences. \emph{Who}: SM; RTE; STE; \emph{Inputs}: Preliminary understanding of cultural differences; \emph{Outputs}: Preliminary understanding is conveyed to the teams.
\begin{enumerate}
\item Foster awareness of other cultures to enable problem solving in the software development process for mutual respect and team spirit;
\item Prepare team members (DT) for intercultural collaboration by making them aware of cultural differences;
\item Develop an understanding of the subtleties of cultural influences;
\item Encourage mutual respect of differences to create an environment in which everyone can voice their opinions;
\item Enable team members to think through the lens of other cultural perspectives.
\end{enumerate}
\subsubsection{Make on-site visits} \emph{Goal}: Provide socialisation opportunities for trust building. \emph{Who}: SM; RTE; STE; \emph{Input}: Initial familiarity with other team members; Project initial understanding and knowledge gained; \emph{Output}: Integration amongst team members.
\begin{enumerate}
\item Send team members (DT) abroad for more extended periods;
\item Arrange face-to-face meetings at remote sites.
\end{enumerate}
\subsubsection{Standardise skills required for global team members} \emph{Goal}: Establish guidelines for recruiting and selecting team members who compliment the global team culture. \emph{Who}: PO; PM; SM; \emph{Input}: Organisational guidelines; Project needs; Current profiles of team global members; \emph{Output}: Mapping of team members' skills.
\begin{enumerate}
\item Identify all global team members in terms of skills, knowledge, experience and behaviours;
\item Explain to each project team member what is expected from him/her and assess the individual's personal circumstances, motivations, interests and goals.
\end{enumerate}
\subsubsection{Identify and establish the cultural context of each global team} \emph{Goal}: Establish procedures for each global team. \emph{Who}: SM; RTE; STE; \emph{Input}: Cultural information from all involved remote teams; \emph{Output}: Guide for valuing cultural differences and directions for the global project.
\begin{enumerate}
\item Standardise procedures, working practices and roles;
\item Identify and establish the cultural context and communication style of each global team based on knowledge of their social customs;
\item Explain that team members from different national and cultural contexts use different communication and problem-solving approaches;
\item Ensure that cultural differences are valued while developing a global culture that can serve as a sensemaking device to guide and shape the behaviours of the global workforce.
\item Establish how each team member is motivated according to the cultural identity.
\end{enumerate}
\subsubsection{Provide cultural training} \emph{Goal}: Ensure cultural diversity in the context of the project is well understood by all stakeholders. \emph{Who}: SM; RTE; STE; \emph{Input}: Cultural information from all involved remote teams; \emph{Output}: Ability to interact with different cultures.
\begin{enumerate}
\item Create openness based on mutual respect among all individuals and group representatives involved with the project;
\item Educate team members on cultural and religious value differences to enable mutual interpretation of the behaviour of geographically dispersed team members to attain a required level of understanding.
\item Explain to individuals that some cultures are more direct than others (e.g. English can be indirect and over-polite when asking someone to do a task, whereas Americans will just tell people what to do and can appear abrupt to some people).
\end{enumerate}
\subsubsection{Look out for cultural misunderstanding in Requirements} \emph{Goal}: Define requirements, according to customer expectations and acceptance criteria. \emph{Who}: PO; PM; SM; \emph{Input}: Cultural information from all remote teams; \emph{Output}: Establishment correct set of requirements and expectations.
\begin{enumerate}
\item Identify the national cultural mindset of each global team for improvements to communication in requirements;
\item Clearly and unambiguously define the project results (objectives, deliverables) expected for all parties;
\item Be aware of the ``mum'' effect dominant in some cultures (hesitation to share bad news).
\item Be explicit as to which stakeholders' expectations will not be part of the project objectives and the various results or deliverables to be produced.
\item Be aware of ``false friends'' (words that appear in two languages but have different meanings (for example English magazine and French magasin ``shop'').
\end{enumerate}
\subsubsection{Develop and maintain cultural knowledge base} \emph{Goal}: Establish a system that captures cultural diversity. \emph{Who}: SM; RTE; STE; \emph{Input}: Cultural information from all involved remote teams;\emph{Output}: Structured information on the varying cultures of project teams.
\begin{enumerate}
\item Collect and register types of behaviour that might be acceptable in one culture but unacceptable in another;
\item Collect and register technical knowledge to be used at different sites;
\item Collect information on the interests of the respective parties associated with the project and assess its reliability on a personal and working level;
\item Incorporate prevailing societal values (as influenced by political opinion, group pressure, interested parties, etc.) that can affect the project;
\item Develop a protocol for sharing information and making the team aware of cultural differences and the use of the knowledge base.
\end{enumerate}
\subsubsection{Assign a local manager with the skills needed for a global team} \emph{Goal}: Help manage and be responsible for cultural diversity. \emph{Who}: RTE; STE; \emph{Input}: A team member with relevant technical, domain knowledge and people skills; \emph{Output}: Designation of this person as a local leader.
\begin{enumerate}
\item Designate a team member as a leader (referred to as a coach or scrum master) for bridging cultures.
\end{enumerate}
\subsubsection {Offer English language training sessions}: \emph{Goal}: To promote cultural understanding and facilitate communication. \emph{Who}: SM; RTE; STE; \emph{Input}: English Language fluency levels of all members in global team; \emph{Output}: Improvement in the linguistic skills of team members.
\begin{enumerate}
\item Promote English training to enhance team member language skills;
\item Promote English training with a focus on business terms used in the industry;
\item Standardise jargon and vocabulary to be used within the project.
\end{enumerate}
\subsubsection{Plan how to mitigate issues caused by cultural misunderstanding} \emph{Goal}: Minimise misunderstanding due to cultural differences and reduce likelihood of problems arising from cultural differences in the future. \emph{Who}: DT; SM; RTE; STE; PO; PM; SM; \emph{Input}: Cultural information from all involved remote teams; \emph{Output}: Set of responses for mitigating identified occurrences.
\begin{enumerate}
\item Get feedback from stakeholders on how they would like to deal with cultural misunderstanding;
\item Plan responses for mitigating circumstances that occur due to cultural differences;
\item Establish backup teams at various geographical locations;
\item Develop work practices and share these with all team members.
\end{enumerate}
\subsubsection{Prepare for distributed meetings} \emph{Goal}: Enable each team member to express themselves clearly and for the other team members to understand what they convey. \emph{Who}: SM; RTE; STE; \emph{Input}: Cultural information from all involved remote teams; \emph{Output}: Improvements in communication and in the relationship among team members.
\begin{enumerate}
\item Consider the factual arguments around particular issues;
\item Prepare a presentation that includes rebuttals to possible counter-arguments;
\item Assess the people who will be involved in the discussion and their likely points of view, interests and relationships;
\item Prepare an agenda for the meeting in which the issues will be discussed;
\item Express thanks to the meeting participants for their interest and show appreciation for their input;
\item Cultivate sustainable relationships with interested parties;
\item Continuously learn from the experience and apply this learning in the future.
\end{enumerate}
\subsubsection{Project managers should take into account cultural differences during group exercises}: \emph{Goal}: Avoid misunderstandings and scheduling delays arising from cultural differences. \emph{Who}: SM; RTE; STE; PM; \emph{Input}: Cultural information from all involved remote teams; \emph{Output}: Establishment of estimated normalised according to cultural differences.
\begin{enumerate}
\item Standardise a set of norms for communication and conflict management, for a shared team identity and shared performance expectations;
\item Create opportunities to stimulate openness amongst the team;
\item Learn from each situation and continue to improve methods for retaining openness;
\item Constantly follow verbal and non-verbal cues passed along by the team;
\item Provide feedback and encourage people to listen.
\end{enumerate}
\subsection{Limitations}
Our search string was intentionally constructed to produce a highly focussed set of candidate papers for review. By including additional terms in the search string (by, for example, adding ``diversity'') and searching additional libraries, we might have produced a larger initial pool of candidates. IEEEXplore, ACM, Science Direct and Scopus comprise a broad array of literature from conferences and journals, ensuring that our findings represent a cross-section of available results. Although our search was focussed, it revealed multiple studies discussing each of the practices for addressing our identified cultural differences in GSD. Although broadening either the set of search terms or target libraries might have revealed additional practices; in our current corpus of papers we started to reach saturation (where on further reading no new themes emerged), and we therefore believe that a larger candidate pool would more likely have only produced additional evidence in support of the practices we have already identified.
\section{Conclusions} \label{sec:conclusions}
It is necessary to take into account many technical, organisational and temporal issues in the interactive and cooperative delivery of GSD solutions, a requirement that is enhanced in situations involving increased team sizes, structures involving teams of teams and more complex management structures.
In such settings, cultural difference can be seen as an enriching factor in which different bodies of knowledge are brought together; it can also lead to severe misunderstanding and conflicts.
As the existing literature did not adequately address particular approaches to successfully implementing practices for managing cultural differences in GSD, we performed an SLR of existing studies to extract specific practices.
Our analysis of these practices revealed a number of actions that organisations can apply in their development processes. In future studies, we will apply the practices identified in this study to a specific organisation with the goal of identifying relevant changes to be taken to enhance the organisation's intercultural effectiveness.
\section*{Acknowledgment}
This work was supported, in part, by Science Foundation Ireland grant no. 13/RC/2094.
\bibliographystyle{splncs04}
| {'timestamp': '2018-10-05T02:15:25', 'yymm': '1810', 'arxiv_id': '1810.02350', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02350'} | arxiv |
\section{Step~\ref{step-1}: Construction of the rooted clique-tree}\label{sec:clique-tree}
Our main result in this section is that every chordal graph has a polynomial-time computable rooted clique-tree where some technical conditions must hold on the minimal separators that can label an edge (Theorem~\ref{thm:final-clique-tree}).
We will use these special properties of our rooted clique-tree in order to ensure that our main algorithm runs in polynomial time.
\smallskip
We start digressing on the motivations behind our construction.
Given a rooted clique-tree \cliquetree{G}~of $G$ and an arbitrary maximal clique $\ensuremath{K}_i$, recall that $G_i$ is the subgraph induced by all the maximal cliques in the subtree $\cliquetree{G}^i$ rooted at $\ensuremath{K}_i$.
Assume that $\unlabeledsubtree{\ensuremath{S}_i}$: the subtree induced by the minimal separator $\ensuremath{S}_i := \ensuremath{K}_i \cap \ensuremath{K}_{p(i)}$, is fixed.
We ask for the number of possible distance profiles $\left( dist_{\labeledsubtree{i}{}}(r, V_i \setminus \ensuremath{S}_i) \right)_{r \in V(\unlabeledsubtree{\ensuremath{S}_i})}$ over all possible {\em well-structured} $4$-Steiner roots of $G_i$ that contain $\unlabeledsubtree{\ensuremath{S}_i}$.
By Theorem~\ref{thm:x-free}, one way to bound this number would be to force most vertices in $\ensuremath{S}_i$ to be {\em $\ensuremath{K}_i$-free} in the subgraph $G_i$.
Guided by this intuition, our construction aims at preventing $\ensuremath{S}_i$ to contain, or to be contained, in a minimal separator of $G_i$.
Since both objectives are conflicting, this results in a technical compromise.
\medskip
We present a first, simpler construction in Section~\ref{sec:flat-clique-tree} that only reaches half of the goal.
Then, we introduce the new notion of (weak) convergence, and we show its relationship with $4$-Steiner powers (Section~\ref{sec:weak-convergence}).
We end up proving the main result of this part in Section~\ref{sec:final-clique-tree}.
\subsection{A flat clique-tree}\label{sec:flat-clique-tree}
We start with an intermediate construction.
\begin{theorem}\label{thm:flat-clique-tree}
Given $G=(V,E)$ chordal, we can compute in polynomial time a rooted clique-tree $\cliquetree{G}$ such that, for any $\ensuremath{S}_i = \ensuremath{K}_i \cap \ensuremath{K}_{p(i)}$ and for any child $\ensuremath{K}_j$ of $\ensuremath{K}_{p(i)}$, there is no minimal separator of $G_j$ that is contained into $\ensuremath{S}_i$.
\end{theorem}
\begin{proof}
We modify an arbitrary clique-tree $\cliquetree{G}$ of $G$ until the property of the theorem is satisfied.
Specifically, root $\cliquetree{G}$ at some arbitrary maximal clique $\ensuremath{K}_0$.
We consider all the minimal separators $\ensuremath{S} \in \SEP{G}$ by decreasing size.
Let $\ensuremath{K}_{\ensuremath{S}}$ be incident to an edge in $\superedgeset{G}{\ensuremath{S}}$ and the closest possible to the root.
We observe that $\ensuremath{K}_{\ensuremath{S}}$ is the least common ancestor of all maximal cliques that are incident to an edge in $\superedgeset{G}{\ensuremath{S}}$.
Furthermore all edges in $\edgeset{G}{\ensuremath{S}}$ can be made incident to $\ensuremath{K}_{\ensuremath{S}}$, as follows.
Assume there exists $\ensuremath{K}_i\ensuremath{K}_{p(i)} \in \edgeset{G}{\ensuremath{S}}$ such that $\ensuremath{K}_{\ensuremath{S}} \notin \{\ensuremath{K}_i,\ensuremath{K}_{p(i)}\}$.
By the above observation, $\ensuremath{K}_i,\ensuremath{K}_{p(i)}$ are into the subtree rooted at $\ensuremath{K}_{\ensuremath{S}}$.
Since $\ensuremath{S} \subseteq \ensuremath{K}_{\ensuremath{S}} \cap \ensuremath{K}_i$, $\ensuremath{S}$ is contained into all the maximal cliques on the $\ensuremath{K}_{\ensuremath{S}}\ensuremath{K}_i$-path.
In particular, we still obtain a clique-tree of $G$ if we replace $\ensuremath{K}_i\ensuremath{K}_{p(i)}$ by $\ensuremath{K}_i\ensuremath{K}_{\ensuremath{S}}$ and in doing so, $\ensuremath{S} \subseteq \ensuremath{K}_{\ensuremath{S}} \cap \ensuremath{K}_i \subseteq \ensuremath{K}_{p(i)} \cap \ensuremath{K}_i = \ensuremath{S}$.
Furthermore after this transformation, $\ensuremath{K}_{\ensuremath{S}}$ became the new father node of the maximal clique $\ensuremath{K}_i$ in $\cliquetree{G}$.
It now remains to prove that the gotten clique-tree $\cliquetree{G}$ satisfies the conditions of the theorem.
Suppose for the sake of contradiction that there exist $i > 0 $ and $\ensuremath{S}_k \subseteq \ensuremath{S}_i$ a minimal separator of $G_j$, where $\ensuremath{K}_j$ is a child of $\ensuremath{K}_{p(i)}$ (possibly, $i=j$).
We observe that after we processed $\ensuremath{S}_i$, all edges in $\edgeset{G}{\ensuremath{S}_i}$ must label an edge between $\ensuremath{K}_{\ensuremath{S}_i} = \ensuremath{K}_{p(i)}$ and its children nodes.
Therefore, our transformation ensures $\ensuremath{S}_k \neq \ensuremath{S}_i$, {\it i.e.}, $\ensuremath{S}_k \subset \ensuremath{S}_i$.
Since the subtree rooted at $\ensuremath{K}_j$ is a rooted clique-tree of $G_j$, there must exist some edge $\ensuremath{K}_k\ensuremath{K}_{p(k)}$ in this subtree such that $\ensuremath{K}_k \cap \ensuremath{K}_{p(k)} = \ensuremath{S}_k$.
However, since we consider minimal separators by increasing size, the edge $\ensuremath{K}_i\ensuremath{K}_{p(i)}$ should already exist when we process $\ensuremath{S}_k$.
It implies that the maximal clique $\ensuremath{K}_{\ensuremath{S}_k}$ to which we connected all edges in $\edgeset{G}{\ensuremath{S}_k}$ should be an ancestor of $\ensuremath{K}_{p(i)}$, that is a contradiction.
\end{proof}
\subsection{Weak convergence}\label{sec:weak-convergence}
Unfortunately, the ``flat'' clique-tree of Theorem~\ref{thm:flat-clique-tree} does not prevent the case when a minimal separator $\ensuremath{S}_i$ {\em is contained} into a minimal separator of $G_i$.
As a new step toward our final construction, we now introduce the following notions:
\begin{definition}\label{def:cvgt}
Given a clique-tree $\cliquetree{G}$ of $G = (V,E)$, we say that a minimal separator $\ensuremath{S}$ is {\em weakly $\cliquetree{G}$-convergent} if there exists some maximal clique $\ensuremath{K}_{\ensuremath{S}}$ that is incident to all edges in $\superstrictedgeset{G}{\ensuremath{S}}$.
$\ensuremath{S}$ is termed {\em $\cliquetree{G}$-convergent} if it is weakly $\cliquetree{G}$-convergent and the maximal clique $\ensuremath{K}_{\ensuremath{S}}$ is also incident to all edges in $\edgeset{G}{\ensuremath{S}}$.
\end{definition}
In order to motivate Definition~\ref{def:cvgt}, in what follows are two observations on the relationships between clique-trees, minimal separators and $4$-Steiner roots:
\begin{lemma}\label{lem:bistar-center}
Given $G=(V,E)$ and $\tree$ any $4$-Steiner root of $G$, let $\ensuremath{K}_i \in \MAXK{G}$ and let $\ensuremath{X} \subset \ensuremath{K}_i$ be a clique-intersection.
If $\unlabeledsubtree{\ensuremath{X}}$ is a bistar then, $\centre{\unlabeledsubtree{\ensuremath{K}_i}} \subset \centre{\unlabeledsubtree{\ensuremath{X}}}$.
In particular, there are exactly two maximal cliques that contain $\ensuremath{X}$.
\end{lemma}
\begin{proof}
We have by Theorem~\ref{thm:clique-intersection} $diam(\unlabeledsubtree{\ensuremath{K}_i}) > diam(\unlabeledsubtree{\ensuremath{X}})$, and so, $diam(\unlabeledsubtree{\ensuremath{K}_i}) = 4$.
In particular, write $\centre{\unlabeledsubtree{\ensuremath{K}_i}} = \{c_i\}$.
Every component in $\unlabeledsubtree{\ensuremath{K}_i} \setminus \{c_i\}$ has diameter at most two, thereby implying $c_i \in V(\unlabeledsubtree{\ensuremath{X}})$.
Furthermore since $ecc_{\unlabeledsubtree{\ensuremath{X}}}(c_i) \leq rad(\unlabeledsubtree{\ensuremath{K}_i}) = 2$, $c_i$ cannot be a leaf of $\unlabeledsubtree{\ensuremath{X}}$.
Equivalently, $c_i \in \centre{\unlabeledsubtree{\ensuremath{X}}}$.
By Lemma~\ref{lem:no-center-intersect}, there can be no two maximal cliques $\ensuremath{K}_i,\ensuremath{K}_j \in \MAXK{G}$ such that $\centre{\unlabeledsubtree{\ensuremath{K}_i}} = \centre{\unlabeledsubtree{\ensuremath{K}_j}}$.
Therefore, the above implies that $\ensuremath{X}$ can only be contained in at most two maximal cliques.
Finally, since $\ensuremath{X}$ is not a maximal clique, it is contained into exactly two maximal cliques.
\end{proof}
\begin{lemma}\label{lem:star-center}
Given $G=(V,E)$ and $\tree$ any $4$-Steiner root of $G$, let $\ensuremath{S} \in \SEP{G}$.
If $\unlabeledsubtree{\ensuremath{S}}$ is a non-edge star then, $\ensuremath{S}$ is weakly $\cliquetree{G}$-convergent for {\em any} clique-tree $\cliquetree{G}$ of $G$.
\end{lemma}
\begin{proof}
We may assume that $\ensuremath{S}$ is strictly contained into at least one minimal separator $\ensuremath{S}'$ for otherwise there is nothing to prove.
By Theorem~\ref{thm:clique-intersection}, $\unlabeledsubtree{\ensuremath{S}'}$ is a bistar and $\ensuremath{S}'$ must be inclusion wise maximal in $\SEP{G}$.
This implies $\centre{\unlabeledsubtree{\ensuremath{S}}} \subset \centre{\unlabeledsubtree{\ensuremath{S}'}}$.
Furthermore, it follows from Lemma~\ref{lem:bistar-center} that $\ensuremath{S}'$ must be contained into exactly two maximal cliques $\ensuremath{K}_i,\ensuremath{K}_j$ and $\centre{\unlabeledsubtree{\ensuremath{K}_i}} \cup \centre{\unlabeledsubtree{\ensuremath{K}_j}} = \centre{\unlabeledsubtree{\ensuremath{S}'}}$.
In particular, we may assume w.l.o.g. that $\centre{\unlabeledsubtree{\ensuremath{S}}} = \centre{\unlabeledsubtree{\ensuremath{K}_i}}$.
But then, still by Lemma~\ref{lem:bistar-center}, any minimal separator $\ensuremath{S}''$ that strictly contains $\ensuremath{S}$ must be contained into $\ensuremath{K}_i$ and exactly one other maximal clique $\ensuremath{K}_{\ensuremath{S}''}$.
Let $\cliquetree{G}$ be an arbitrary clique-tree of $G$.
By Theorem~\ref{thm:clique-tree-pties}, the above implies $\ensuremath{K}_i\ensuremath{K}_{\ensuremath{S}''} \in E(\cliquetree{G})$ and $\ensuremath{K}_i \cap \ensuremath{K}_{\ensuremath{S}''} = \ensuremath{S}''$.
In particular, one obtains by setting $\ensuremath{K}_{\ensuremath{S}} := \ensuremath{K}_i$ that $\ensuremath{S}$ is weakly $\cliquetree{G}$-convergent.
\end{proof}
Roughly, in order to prove Theorem~\ref{thm:final-clique-tree} we will slightly modify the construction of Theorem~\ref{thm:flat-clique-tree} so as to force weak convergence to imply convergence.
In doing so we will obtain that for a fixed minimal separator $\ensuremath{S}$, we may encounter some ``inclusion issue'' between \ensuremath{S}~and another minimal separator \ensuremath{S}'~at most {\em once}.
We will show in Sec.~\ref{sec:encoding} that this above ``local'' property of our clique-tree is enough in order to bound the number of possible distance profiles at each node of the clique-tree by a polynomial.
\subsection{The final construction}\label{sec:final-clique-tree}
The remaining of this section is now devoted to prove the following technical result:
\begin{theorem}\label{thm:final-clique-tree}
Given $G=(V,E)$ chordal, we can compute in polynomial time a rooted clique-tree $\cliquetree{G}$ where the following conditions are true for any $\ensuremath{S}_i := \ensuremath{K}_i \cap \ensuremath{K}_{p(i)}, i > 0$:
\begin{enumerate}[label=\textbullet,ref=P-\ref{thm:final-clique-tree}.\theenumi]
\item\label{pty-fct:1}({\small Prop.~\ref{pty-fct:1}.}) If $\ensuremath{S}_i$ is weakly $\cliquetree{G}$-convergent and $|\ensuremath{S}_i| \geq 3$ then, $\ensuremath{S}_i$ is $\cliquetree{G}$-convergent;
\item\label{pty-fct:2}({\small Prop.~\ref{pty-fct:2}.}) Any minimal separator of $G_i$ that is contained into $\ensuremath{S}_i$ is $\cliquetree{G}$-convergent, it has at least three vertices and it is strictly contained into a minimal separator of $G_i$.
\end{enumerate}
\end{theorem}
We stress that in the above two statements, $3$ can be replaced by any positive integer $q$.
However, please note that such a change would affect both properties of the theorem.
\begin{proof}
We start describing the algorithm before proving its correctness.
In what follows, let $\SEP{G} = ( \ensuremath{S}_1, \ensuremath{S}_2, \ldots, \ensuremath{S}_{\ell} )$ be totally ordered in such a way that $|\ensuremath{S}_i| < |\ensuremath{S}_j| \Longrightarrow i < j$.
For every phase of the algorithm, we consider all the minimal separators of $G$ by decreasing order, {\it i.e.}, from $\ensuremath{S}_{\ell}$ to $\ensuremath{S}_1$.
\begin{enumerate}[label={\bf Phase~\theenumi}]
\item Let $\cliquetree{G}$ be an arbitrary {\em unrooted} clique-tree.
We consider all the minimal separators $\ensuremath{S} \in \SEP{G}$ by decreasing order.
Let $\ensuremath{S}^1, \ensuremath{S}^2, \ldots, \ensuremath{S}^p$ be the list of all minimal separators containing $\ensuremath{S}$ by decreasing order.
-- In particular, $\ensuremath{S}^p = \ensuremath{S}$, and $\ensuremath{S}^1$ is a largest minimal separator containing $\ensuremath{S}$. --
For every maximal clique $\ensuremath{K}$, we can define a binary vector $\overrightarrow{v_{\ensuremath{S}}}(\ensuremath{K}) = (\delta_{\ensuremath{S}^1}^{\ensuremath{K}},\delta_{\ensuremath{S}^2}^{\ensuremath{K}},\ldots,\delta_{\ensuremath{S}^p}^{\ensuremath{K}})$: where $\delta_{\ensuremath{S}^i}^{\ensuremath{K}} = 1$ if and only if $\ensuremath{K}$ is incident to an edge in $\edgeset{G}{\ensuremath{S}^i}$.
Then, we choose $\ensuremath{K}_{\ensuremath{S}}^1 \in \MAXK{G}$ such that $\overrightarrow{v_{\ensuremath{S}}}(\ensuremath{K}_{\ensuremath{S}}^1)$ is lexicographically maximal.
While there exists an edge $\ensuremath{K}\maxk' \in \edgeset{G}{\ensuremath{S}}$ such that $\ensuremath{K}_{\ensuremath{S}}^1 \notin \{\ensuremath{K},\ensuremath{K}'\}$, we do as follows.
W.l.o.g., $\ensuremath{K}$ is on the $\ensuremath{K}_{\ensuremath{S}}^1\ensuremath{K}'$-path.
We replace the edge $\ensuremath{K}\maxk'$ by $\ensuremath{K}_{\ensuremath{S}}^1\ensuremath{K}'$.
Doing so, all edges in $\edgeset{G}{\ensuremath{S}}$ are now incident to $\ensuremath{K}_{\ensuremath{S}}^1$.
\item We root $\cliquetree{G}$ at some arbitrary maximal clique $\ensuremath{K}_0$.
Then, we consider all the minimal separators $\ensuremath{S} \in \SEP{G}$ by decreasing order.
Let $\ensuremath{K}_{\ensuremath{S}}^2$ be, under the following conditions, the closest possible to the root:
\begin{itemize}
\item $\ensuremath{K}_{\ensuremath{S}}^2$ is incident to an edge in $\superedgeset{G}{\ensuremath{S}}$;
\item and if $|\ensuremath{S}| \geq 3$ and $\ensuremath{S}$ is $\cliquetree{G}$-convergent then, $\ensuremath{K}_{\ensuremath{S}}^2$ is incident to all edges in $\superstrictedgeset{G}{\ensuremath{S}}$.
\end{itemize}
Note that $\ensuremath{K}_{\ensuremath{S}}^2$ is always an ancestor of $\ensuremath{K}_{\ensuremath{S}}^1$.
In particular if $|\ensuremath{S}| \geq 3$ and $\ensuremath{S}$ is $\cliquetree{G}$-convergent then, $\ensuremath{K}_{\ensuremath{S}}^2$ is either $\ensuremath{K}_{\ensuremath{S}}^1$ or its parent node (with the latter being possible only if $|\superstrictedgeset{G}{\ensuremath{S}}|\leq 1$).
Then, we use the same operation as in the proof of Theorem~\ref{thm:flat-clique-tree} in order to make all edges in $\edgeset{G}{\ensuremath{S}}$ incident to $\ensuremath{K}_{\ensuremath{S}}^2$.
\item We end up considering all the minimal separators $\ensuremath{S} \in \SEP{G}$ by decreasing order.
If $|\ensuremath{S}| \geq 3$ and $\ensuremath{S}$ is {\em not} $\cliquetree{G}$-convergent then, we search for a child $\ensuremath{K}_{\ensuremath{S}}^3$ of $\ensuremath{K}_{\ensuremath{S}}^2$ that is incident to all edges in $\superstrictedgeset{G}{\ensuremath{S}}$.
For simplicity of our analysis, we will also set $\ensuremath{K}_{\ensuremath{S}}^3 = \ensuremath{K}_{\ensuremath{S}}^2$ when $|\ensuremath{S}| \leq 2$, or $\ensuremath{S}$ is already $\cliquetree{G}$-convergent, or there is no child node of $\ensuremath{K}_{\ensuremath{S}}^2$ which satisfies the desired property.
Then, we consider all the children $\ensuremath{K}$ of $\ensuremath{K}_{\ensuremath{S}}^2$, $\ensuremath{K} \neq \ensuremath{K}_{\ensuremath{S}}^3$, such that $\ensuremath{K} \cap \ensuremath{K}_{\ensuremath{S}}^2 = \ensuremath{S}$.
We replace the edge $\ensuremath{K}\maxk_{\ensuremath{S}}^2$ by $\ensuremath{K}\maxk_{\ensuremath{S}}^3$.
\end{enumerate}
Before proving correctness of this above algorithm, we want to emphasize two of its main invariants.
In what follows, let $\ensuremath{S} \in \SEP{G}$ be of size at least three.
\begin{enumerate}[label=\textbullet,ref=I\theenumi]
\item\label{invariant-1}({\it Inv.~\ref{invariant-1}}) Assume that at the time we considered $\ensuremath{S}$ during Phase 2, $\ensuremath{S}$ was $\cliquetree{G}$-convergent.
We observe that our choice for $\ensuremath{K}_{\ensuremath{S}}^2$ preserved this property. In particular, $\ensuremath{S}$ is $\cliquetree{G}$-convergent in the final clique-tree $\cliquetree{G}$ that we output.
\item\label{invariant-2}({\it Inv.~\ref{invariant-2}}) If $\ensuremath{K}_{\ensuremath{S}}^3 \neq \ensuremath{K}_{\ensuremath{S}}^2$ (or equivalently, we modify $\edgeset{G}{\ensuremath{S}}$ during Phase 3) then, we also claim that $\ensuremath{S}$ is $\cliquetree{G}$-convergent in the final clique-tree $\cliquetree{G}$ that we output. For that, by the definition of Phase 3 it suffices to prove that the edge between $\ensuremath{K}_{\ensuremath{S}}^2$ and its parent node (if any) cannot be labelled by $\ensuremath{S}$. According to Invariant~\ref{invariant-1}, $\ensuremath{S}$ was not $\cliquetree{G}$-convergent when it was considered during Phase 2 (otherwise, it should have stayed so until we considered $\ensuremath{S}$ during Phase 3, and so we could have not modified $\edgeset{G}{\ensuremath{S}}$). Therefore by the definition of Phase 2, $\ensuremath{K}_{\ensuremath{S}}^2$ is the least common ancestor in $\cliquetree{G}$ of all the maximal cliques that are incident to an edge in $\superedgeset{G}{\ensuremath{S}}$, thereby proving the claim.
\end{enumerate}
We will often use these above two invariants in the remaining of the proof.
We finally prove that both properties of the theorem are true for $\cliquetree{G}$.
\paragraph{Proof of Property~\ref{pty-fct:1}.}
Suppose for the sake of contradiction $\ensuremath{S} \in \SEP{G}$ is weakly $\cliquetree{G}$-convergent but not $\cliquetree{G}$-convergent, and $|\ensuremath{S}| \geq 3$.
For clarity, we divide the proof into small claims.
\begin{myclaim}\label{claim:final-1}
After Phase 2 was completed, $\ensuremath{S}$ was not $\cliquetree{G}$-convergent.
\end{myclaim}
\begin{proofclaim}
Otherwise, every minimal separator $\ensuremath{S}' \supset \ensuremath{S}$ should also be $\cliquetree{G}$-convergent after Phase 2.
But then, the edge-set $\superedgeset{G}{\ensuremath{S}}$ could not be modified during Phase 3.
This would imply $\ensuremath{S}$ is $\cliquetree{G}$-convergent, a contradiction.
\end{proofclaim}
\begin{myclaim}\label{claim:final-2}
From the time we considered $\ensuremath{S}$ during Phase 2 until the end of the algorithm, $\ensuremath{K}_{\ensuremath{S}}^2$ is the least common ancestor of all maximal cliques incident to an edge in $\superedgeset{G}{\ensuremath{S}}$.
\end{myclaim}
\begin{proofclaim}
We recall that whenever we consider a minimal separator of size at least three during Phase 2, we preserve the property of being $\cliquetree{G}$-convergent (Invariant~\ref{invariant-1}).
Therefore, Claim~\ref{claim:final-1} implies that at the time we considered $\ensuremath{S}$ during Phase 2, $\ensuremath{S}$ was not $\cliquetree{G}$-convergent.
In particular, we chose $\ensuremath{K}_{\ensuremath{S}}^2$ to be the least common ancestor of all maximal cliques incident to an edge in $\superedgeset{G}{\ensuremath{S}}$.
This must stay so until the end of the algorithm because during Phase 3, the edges in $\edgeset{G}{\ensuremath{S}}$ were not modified (Invariant~\ref{invariant-2}) and all the edges in $\superstrictedgeset{G}{\ensuremath{S}}$ could only be made incident to a descendant of $\ensuremath{K}_{\ensuremath{S}}^2$.
\end{proofclaim}
\begin{myclaim}\label{claim:final-3}
After Phase 2 was completed, $\ensuremath{K}_{\ensuremath{S}}^2$ was not incident to any edge in $\superstrictedgeset{G}{\ensuremath{S}}$.
\end{myclaim}
\begin{proofclaim}
Suppose for the sake of contradiction that $\ensuremath{K}_{\ensuremath{S}}^2$ was incident to such an edge.
We recall that $\ensuremath{K}_{\ensuremath{S}}^2$ is the least common ancestor of all maximal cliques incident to an edge in $\superedgeset{G}{\ensuremath{S}}$ (Claim~\ref{claim:final-2}).
Therefore, the only possibility left for $\ensuremath{S}$ being weakly $\cliquetree{G}$-convergent but not $\cliquetree{G}$-convergent is that, during Phase $3$, all edges in $\superstrictedgeset{G}{\ensuremath{S}}$ that were incident to $\ensuremath{K}_{\ensuremath{S}}^2$ were made incident to one of its children $\ensuremath{K}$.
But then, during Phase 3 all edges in $\edgeset{G}{\ensuremath{S}}$ should have been made incident to $\ensuremath{K}$.
This contradicts our assumption that $\ensuremath{S}$ is not $\cliquetree{G}$-convergent.
\end{proofclaim}
In what follows, recall that $\ensuremath{S}^1$ is a largest minimal separator containing $\ensuremath{S}$.
Since $\ensuremath{S}$ is weakly $\cliquetree{G}$-convergent but not $\cliquetree{G}$-convergent, we have $\ensuremath{S} \neq \ensuremath{S}^1$.
\begin{myclaim}\label{claim:final-4}
$\ensuremath{K}_{\ensuremath{S}^1}^3 = \ensuremath{K}_{\ensuremath{S}^1}^2 = \ensuremath{K}_{\ensuremath{S}}^1$.
\end{myclaim}
\begin{proofclaim}
By maximality of $\ensuremath{S}^1$ there is no minimal separator of $G$ which strictly contains $\ensuremath{S}^1$.
In particular, it easily follows from this observation that we have $\ensuremath{K}_{\ensuremath{S}^1}^3 = \ensuremath{K}_{\ensuremath{S}^1}^2$.
So, we will only prove $\ensuremath{K}_{\ensuremath{S}^1}^2 = \ensuremath{K}_{\ensuremath{S}}^1$.
By maximality of $\overrightarrow{v_{\ensuremath{S}}}(\ensuremath{K}_{\ensuremath{S}}^1)$, $\ensuremath{K}_{\ensuremath{S}}^1$ was incident to an edge in $\edgeset{G}{\ensuremath{S}^1}$ after Phase 1 was completed.
Therefore, at the time we considered $\ensuremath{S}^1$ during Phase 2, we chose a maximal clique $\ensuremath{K}_{\ensuremath{S}^1}^2$ such that: either $\ensuremath{K}_{\ensuremath{S}^1}^2 = \ensuremath{K}_{\ensuremath{S}}^1$ or $\ensuremath{K}_{\ensuremath{S}^1}^2$ was a strict ancestor of $\ensuremath{K}_{\ensuremath{S}}^1$.
Suppose by contradiction $\ensuremath{K}_{\ensuremath{S}^1}^2$ was a strict ancestor of $\ensuremath{K}_{\ensuremath{S}}^1$ (otherwise, we are done).
By Claim~\ref{claim:final-2}, $\ensuremath{K}_{\ensuremath{S}}^2$ is an ancestor of $\ensuremath{K}_{\ensuremath{S}^1}^2$.
But then, $\ensuremath{K}_{\ensuremath{S}}^2$ should have been incident to an edge in $\superstrictedgeset{G}{\ensuremath{S}}$ after Phase 2 was completed.
The latter would contradict Claim~\ref{claim:final-3}.
\end{proofclaim}
\begin{myclaim}\label{claim:final-5}
From the time we considered $\ensuremath{S}$ during Phase 2 until the end of the algorithm, $\ensuremath{K}_{\ensuremath{S}}^2$ is the father node of $\ensuremath{K}_{\ensuremath{S}}^1$.
Moreover, $\ensuremath{K}_{\ensuremath{S}}^1 \cap \ensuremath{K}_{\ensuremath{S}}^2 = \ensuremath{S}$.
\end{myclaim}
\begin{proofclaim}
By Claim~\ref{claim:final-3}, $\ensuremath{K}_{\ensuremath{S}}^2$ cannot be incident to any edge in $\superstrictedgeset{G}{\ensuremath{S}}$.
We also know that all edges in $\edgeset{G}{\ensuremath{S}}$ are incident to $\ensuremath{K}_{\ensuremath{S}}^1$.
Thus, either $\ensuremath{K}_{\ensuremath{S}}^1 = \ensuremath{K}_{\ensuremath{S}}^2$ or $\ensuremath{K}_{\ensuremath{S}}^2$ is the father node of $\ensuremath{K}_{\ensuremath{S}}^1$.
But then in the former case, $\ensuremath{K}_{\ensuremath{S}}^2$ would be incident to an edge in $\superstrictedgeset{G}{\ensuremath{S}}$ (Claim~\ref{claim:final-4}), a contradiction.
As a result, $\ensuremath{K}_{\ensuremath{S}}^2$ is the father node of $\ensuremath{K}_{\ensuremath{S}}^1$, and then we must have $\ensuremath{K}_{\ensuremath{S}}^1 \cap \ensuremath{K}_{\ensuremath{S}}^2 = \ensuremath{S}$.
\end{proofclaim}
Finally, since we did not modify $\edgeset{G}{\ensuremath{S}}$ during Phase 3 (cf. Invariant~\ref{invariant-2}), not all edges in $\superstrictedgeset{G}{\ensuremath{S}}$ can be incident to the same child node of $\ensuremath{K}_{\ensuremath{S}}^2$.
Then, by Claim~\ref{claim:final-5}, not all edges in $\superstrictedgeset{G}{\ensuremath{S}}$ can be incident to $\ensuremath{K}_{\ensuremath{S}}^1$.
By Claim~\ref{claim:final-4} we get that all the edges in $\superstrictedgeset{G}{\ensuremath{S}}$ must be incident to some child $\ensuremath{K}$ of $\ensuremath{K}_{\ensuremath{S}}^1$.
\begin{myclaim}\label{claim:final-6}
There must be a second largest minimal separator $\ensuremath{S}^2$ that strictly contains $\ensuremath{S}$.
\end{myclaim}
\begin{proofclaim}
Otherwise it would follow from Claim~\ref{claim:final-4} that at the time we considered $\ensuremath{S}$ during Phase 2, $\ensuremath{S}$ was $\cliquetree{G}$-convergent, thereby contradicting Claim~\ref{claim:final-1}.
\end{proofclaim}
Let $\ensuremath{S}^2$ be as in Claim~\ref{claim:final-6}.
Suppose for the sake of contradiction that we modified the edges in $\edgeset{G}{\ensuremath{S}^2}$ during Phase 3.
As we have $\ensuremath{K}_{\ensuremath{S}^2}^3 = \ensuremath{K}$, this implies that $\ensuremath{K}_{\ensuremath{S}^2}^2$ was the father node of $\ensuremath{K}$.
Then, since $\ensuremath{S}^1$ was considered before $\ensuremath{S}^2$, and that we have $\ensuremath{K} \cap \ensuremath{K}_{\ensuremath{S}}^1 = \ensuremath{S}^1$, we would get $\ensuremath{K}_{\ensuremath{S}^2}^2 = \ensuremath{K}_{\ensuremath{S}}^1$.
Recall that all edges in $\edgeset{G}{\ensuremath{S}^1}$ are incident to $\ensuremath{K}_{\ensuremath{S}}^1$.
However by maximality of $|\ensuremath{S}^2|$, $\ensuremath{S}^2$ can only be contained into $\ensuremath{S}^1$.
Hence, we should have not modified the edges in $\edgeset{G}{\ensuremath{S}^2}$ during Phase 3, that is a contradiction.
As a result, $\ensuremath{K}_{\ensuremath{S}^2}^2 = \ensuremath{K}$.
We now prove that at the time we considered $\ensuremath{S}^2$ during Phase 2, $\ensuremath{K}$ was already incident to an edge in $\edgeset{G}{\ensuremath{S}^2}$.
Indeed, suppose for the sake of contradiction that this was not the case.
Then, there would exist $\ensuremath{S}' \supset \ensuremath{S}^2$ such that $\ensuremath{K}$ was incident to an edge in $\edgeset{G}{\ensuremath{S}'}$.
Since we chose $\ensuremath{K}$ instead of $\ensuremath{K}_{\ensuremath{S}}^1$, by Claim~\ref{claim:final-4} we can always assume $\ensuremath{S}' \neq \ensuremath{S}^1$, a contradiction.
Overall, after Phase 1 was completed, $\ensuremath{K}$ was incident to an edge in $\edgeset{G}{\ensuremath{S}^2}$.
We claim that more generally, $\ensuremath{K}$ was incident to an edge in $\edgeset{G}{\ensuremath{S}^1}$ and $\edgeset{G}{\ensuremath{S}^2}$ after Phase 1 was completed.
Indeed, by Claim~\ref{claim:final-4}, we have $\ensuremath{K} \neq \ensuremath{K}_{\ensuremath{S}^1}^2$.
In this situation, since $\ensuremath{K}$ was incident to an edge in $\edgeset{G}{\ensuremath{S}^1}$ after Phase 2, then it must be the case that $\ensuremath{K}$ was already incident to such an edge after Phase 1 was completed.
We observe that at the time that we considered $\ensuremath{S}$ during Phase 1, we already considered both $\ensuremath{S}^1$ and $\ensuremath{S}^2$.
So, it was already the case that $\ensuremath{K}$ was incident to an edge in $\edgeset{G}{\ensuremath{S}^1}$ and $\edgeset{G}{\ensuremath{S}^2}$.
Furthermore we claim that after Phase 1, $\ensuremath{K}_{\ensuremath{S}}^1$ was not incident to any edge in $\edgeset{G}{\ensuremath{S}^2}$.
Indeed, this is because $\ensuremath{K}_{\ensuremath{S}^2}^2$, and so $\ensuremath{K}_{\ensuremath{S}^2}^1$, is a strict descendant of $\ensuremath{K}_{\ensuremath{S}}^1$, and by Claim~\ref{claim:final-4} we have $\ensuremath{K}_{\ensuremath{S}^2}^2 \cap \ensuremath{K}_{\ensuremath{S}}^1 = \ensuremath{S}^1 \neq \ensuremath{S}^2$.
However, the latter contradicts the maximality of $\overrightarrow{v_{\ensuremath{S}}}(\ensuremath{K}_{\ensuremath{S}}^1)$.
\paragraph{Proof of Property~\ref{pty-fct:2}.}
Finally, for any $i > 0$, let us assume the existence of a minimal separator $\ensuremath{S}$ of $G_i$ that is contained into $\ensuremath{S}_i$.
In particular, $\ensuremath{K}_{\ensuremath{S}}^3$ is a descendant of $\ensuremath{K}_i$.
We only need to consider the following two cases:
\begin{itemize}
\item Case $\ensuremath{K}_{\ensuremath{S}}^3 \neq \ensuremath{K}_{\ensuremath{S}}^2$.
Then, as we modified $\edgeset{G}{\ensuremath{S}}$ during Phase 3, we must have $|\ensuremath{S}| \geq 3$ and $\ensuremath{S}$ is $\cliquetree{G}$-convergent (cf. Invariant~\ref{invariant-2}).
It implies $\ensuremath{K}_{\ensuremath{S}}^3 = \ensuremath{K}_i$ because we assume $\ensuremath{S} \subseteq \ensuremath{S}_i$.
In this situation, $\ensuremath{K}_{\ensuremath{S}}^2 = \ensuremath{K}_{p(i)}$.
Furthermore, we recall that at the time we considered $\ensuremath{S}$ during Phase 3, $\ensuremath{S}$ was not $\cliquetree{G}$-convergent.
So there is at least one edge in $\superstrictedgeset{G}{\ensuremath{S}}$ to which $\ensuremath{K}_{p(i)}$ is not incident.
In particular, such an edge is incident to $\ensuremath{K}_i$, and so, it is labeled by a minimal separator of $G_i$.
Overall, we obtain as desired that $\ensuremath{S}$ is strictly contained into a minimal separator of $G_i$.
\item Case $\ensuremath{K}_{\ensuremath{S}}^3 = \ensuremath{K}_{\ensuremath{S}}^2$.
Note that $\ensuremath{K}_{p(i)}$ is incident to an edge in $\edgeset{G}{\ensuremath{S}_i}$, and so to an edge in $\superedgeset{G}{\ensuremath{S}}$.
However, at the time we considered $\ensuremath{S}$ during Phase 2, we chose a $\ensuremath{K}_{\ensuremath{S}}^2$ that was {\em not} an ancestor of $\ensuremath{K}_{p(i)}$ (otherwise, this should have stayed so during Phase 3).
In particular, we chose a $\ensuremath{K}_{\ensuremath{S}}^2$ that was not the least common ancestor of all the maximal cliques incident to an edge in $\superedgeset{G}{\ensuremath{S}}$.
As a result, $|\ensuremath{S}|\geq 3$ and $\ensuremath{S}$ was $\cliquetree{G}$-convergent.
We observe that in this situation, after Phase 2 was completed all the minimal separators $\ensuremath{S}'$ containing $\ensuremath{S}$ were $\cliquetree{G}$-convergent.
Therefore the set $\superedgeset{G}{\ensuremath{S}}$ was not modified during Phase 3.
Since $\ensuremath{S} \subseteq \ensuremath{S}_i$ and $\ensuremath{K}_{\ensuremath{S}}^2 \neq \ensuremath{K}_{p(i)}$, we so obtain $\ensuremath{K}_{\ensuremath{S}}^2 = \ensuremath{K}_{i}$.
Furthermore, $\ensuremath{K}_{p(i)}$ is not incident to all edges in $\superstrictedgeset{G}{\ensuremath{S}}$ (otherwise, during Phase 2 we could have chosen $\ensuremath{K}_{\ensuremath{S}}^2 = \ensuremath{K}_{p(i)}$).
Overall, it implies that $\ensuremath{S}$ is $\cliquetree{G}$-convergent and, since $\ensuremath{K}_{p(i)}$ is not incident to all edges in $\superstrictedgeset{G}{\ensuremath{S}}$, $\ensuremath{S}$ is strictly contained into a minimal separator of $G_i$.
\end{itemize}
\end{proof}
\section{Conclusion}\label{sec:ccl}
There are essentially two dominant approaches in order to solve \KLP[k]~and \KSP[k]~in the literature.
The first one, and by far the most elegant, is based on structural characterization of the corresponding graph classes~\cite{BaBV06,BLS08}.
Unfortunately such characterizations -- mostly based on forbidden induced subgraphs -- look challenging to derive for larger values of $k$.
Furthermore, some recent work suggests that even a nice characterization of $k$-leaf powers ($k$-Steiner powers, resp.) by forbidden induced subgraphs might not be enough in order to obtain a polynomial-time recognition algorithm~\cite{Laf17}.
The second approach consists in a clever use of dynamic programming.
Although this approach is much less satisfying on the graph-theoretic side, it may be more promising than the first one.
For instance, the only known algorithms so far for recognizing $5$-leaf powers and $3$-Steiner powers are based on this approach~\cite{ChK07}.
Unfortunately, standard dynamic programming techniques are challenging to apply as the value of $k$ increases, which is probably why no improvement has been obtained for this problem for over a decade -- until this paper.
We propose several new avenues for research on dynamic programming algorithms for $k$-leaf powers and $k$-Steiner powers.
In particular, we hope that our structural analysis of these roots -- based on a renewed interest for clique-intersections -- can be helpful in order to generalize our algorithmic framework to larger values of $k$.
Some of our side contributions, especially the design of a problem-specific clique-tree and our greedy procedures in order to select partial solutions, can also be of independent interest for future research on this topic.
\section{Step~\ref{step-3}: Deciding the partial solutions to store}\label{sec:encoding}
The next two Sections are devoted to the main loop of our algorithm proving Theorem~\ref{thm:main-steiner-power}.
Specifically, let $\cliquetree{G}$ be the rooted clique-tree we defined in Section~\ref{sec:clique-tree}.
We consider all the maximal cliques $\ensuremath{K}_i$ that are {\em internal nodes} in $\cliquetree{G}$, starting from the twigs ({\it a.k.a.}, internal nodes whose all children nodes are leaves).
For every such a $\ensuremath{K}_i$ we must execute a same procedure: that corresponds to Step~\ref{step-3} of the algorithm, and is the main focus of this section.
During this procedure, we activate each child node $\ensuremath{K}_{i_j}$ of $\ensuremath{K}_i$ sequentially, by sending a message.
This activation message contains a series of constraints on the $4$-Steiner roots of $G_{i_j}$ that we want to compute.
Overall, after it has been activated, we complete Step~\ref{step-4} for $\ensuremath{K}_{i_j}$ (detailed in the next Section~\ref{sec:greedy}) using the series of constraints it has received from its father node $\ensuremath{K}_i$.
The output is a set ${\cal T}_{i_j}$ of partial solutions whose size is polynomial in $|\ensuremath{S}_{i_j}|$.
Finally, after we received ${\cal T}_{i_j}$, we can compute and send the activation message for the next child of $\ensuremath{K}_i$ to be activated (if any).
As a way to formalize the constraints that we need to include in activation messages, we now introduce the following problem:
\begin{center}
\fbox{
\begin{minipage}{.95\linewidth}
\begin{problem}[\textsc{Distance-Constrained Root}]\
\label{prob:distances-constraints}
\begin{description}
\item[Input:] a graph $G=(V,E)$ and a rooted clique-tree $\cliquetree{G}$, a maximal clique $\ensuremath{K}_{i_j}$, a tree $\labeledsubtree{\ensuremath{S}_{i_j}}{}$ s.t. $Real(\labeledsubtree{\ensuremath{S}_{i_j}}{}) = \ensuremath{S}_{i_j}$, and a sequence $(d_r)_{r \in V(\labeledsubtree{\ensuremath{S}_{i_j}}{})}$ of positive integers.
\item[Output:] Either a $4$-Steiner root $\labeledsubtree{i_j}{}$ of $G_{i_j}$ s.t. $\labeledsubtree{\ensuremath{S}_{i_j}}{} \equiv_G \labeledsubtree{i_j}{\ensuremath{S}_{i_j}}$ and, $\forall r \in V(\labeledsubtree{\ensuremath{S}_{i_j}}{})$: $dist_{\labeledsubtree{i_j}{}}(r, V_{i_j} \setminus \ensuremath{S}_{i_j}) \geq d_r$; Or $\bot$ if there is no such a partial solution which can be extended to some well-structured $4$-Steiner root $\tree$ of $G$.
\end{description}
\end{problem}
\end{minipage}
}
\end{center}
\begin{theorem}\label{thm:encoding}
Given $G=(V,E)$ chordal and a rooted clique-tree $\cliquetree{G}$ as in Theorem~\ref{thm:final-clique-tree}, let $\ensuremath{K}_i$ be an internal node with children $\ensuremath{K}_{i_1},\ensuremath{K}_{i_2},\ldots,\ensuremath{K}_{i_p}$.
If we can solve \textsc{Distance-Constrained Root} in time $P(n,|\ensuremath{S}_{i_j}|)$ for some polynomial $P$ then, we can compute in time ${\cal O}(n|\ensuremath{K}_i|^5P(n,|\ensuremath{K}_i|))$ a family ${\cal T}_{i_1}, {\cal T}_{i_2}, \ldots, {\cal T}_{i_p}$ of $4$-Steiner roots for $G_{i_1}, G_{i_2}, \ldots, G_{i_p}$, respectively, such that:
\begin{enumerate}
\item For any $j \in \{1,2,\ldots,p\}$, $|{\cal T}_{i_j}| = {\cal O}(|\ensuremath{S}_{i_j}|^5)$;
\item For any well-structured $4$-Steiner root $\tree$ of $G$, there exists a $\tree[2]$ such that: $\unlabeledsubtree{\ensuremath{K}_i} \equiv_G \unlabeledsubtree[2]{\ensuremath{K}_i}$, $\unlabeledsubtree[2]{V_{i_j}} \in {\cal T}_{i_j}$ for any $j \in \{1,2,\ldots,p\}$, and (only if $\ensuremath{K}_i \neq \ensuremath{K}_0$) $dist_{\tree[2]}(r,V_i \setminus \ensuremath{S}_i) \geq dist_{\tree}(r,V_i \setminus \ensuremath{S}_i)$ for any node $r \in V(\unlabeledsubtree{\ensuremath{S}_i})$.
\end{enumerate}
\end{theorem}
We postpone the proof that we can solve {\sc Distance-Constrained Root} in polynomial time to Section~\ref{sec:greedy}.
This above result can be seen as a pre-processing phase for $\ensuremath{K}_i$, that is crucial in order to bound the runtime of our algorithm by a polynomial.
Note that the technical condition on the nodes in $\unlabeledsubtree{\ensuremath{S}_i}$ is simply there to ensure that when later in the algorithm, we will need to solve \textsc{Distance-Constrained Root} at $\ensuremath{K}_i$, we cannot miss a solution.
\medskip
The remaining of this subsection is now devoted to the proof of Theorem~\ref{thm:encoding}.
We will use some additional terminology that we define next:
\begin{definition}\label{def:op}
Given $G=(V,E)$, let $A,B,\ensuremath{S} \subset V$ satisfy $A \cup B = V$ and $A \cap B = \ensuremath{S}$.
Two trees $\labeledsubtree{A}{},\labeledsubtree{B}{}$, where $Real(\labeledsubtree{A}{}) = A$ and $Real(\labeledsubtree{B}{}) = B$, are {\em compatible} if $\labeledsubtree{A}{\ensuremath{S}} \equiv_G \labeledsubtree{B}{\ensuremath{S}}$.
Then, $\labeledsubtree{A}{} \odot \labeledsubtree{B}{}$ is the tree obtained from $\labeledsubtree{A}{},\labeledsubtree{B}{}$ by the identification of $\labeledsubtree{A}{\ensuremath{S}}$ with $\labeledsubtree{B}{\ensuremath{S}}$.
\smallskip
In particular, assume $G$ to be chordal and let $\cliquetree{G}$ be a rooted clique-tree of $G$.
For any $\ensuremath{K}_i \in \MAXK{G}$, let $\ensuremath{S}_i := \ensuremath{K}_i \cap \ensuremath{K}_{p(i)}$, let $V_i := V(G_i)$ and let $W_i := V_i \setminus \ensuremath{S}_i$.
Given $\tree,\tree[2]$ $4$-Steiner roots of $G$, we say that $\tree[2]$ is {\em $i$-congruent} to $\tree$ if $\tree[2] \equiv_G \unlabeledsubtree{V \setminus W_i} \odot \labeledsubtree[2]{i}{}$, for some $4$-Steiner root $\labeledsubtree[2]{i}{}$ of $G_i$.
\end{definition}
Note that in particular, any two Steiner roots of $G$ are trivially $0$-congruent ({\it i.e.}, assuming $\ensuremath{S}_0 = \emptyset$ by convention).
Finally in what follows we also use $d_{\labeledsubtree{i_j}{}}(r)$ as a shorthand for $dist_{\labeledsubtree{i_j}{}}(r,W_{i_j})$.
We observe that for any $r \in V(\unlabeledsubtree{\ensuremath{S}_{i_j}})$ we have $dist_{\labeledsubtree{i_j}{}}(r,W_{i_j}) \leq dist_{\labeledsubtree{i_j}{}}(r,\ensuremath{K}_{i_j} \setminus \ensuremath{S}_{i_j}) \leq 4$.
\paragraph{Outline of the proof.}
We process the children nodes $\ensuremath{K}_{i_j}$ sequentially by increasing size of the minimal separators $\ensuremath{S}_{i_j}$.
For that, we start constructing the family ${\cal T}_{\ensuremath{S}_{i_j}}$ of Theorem~\ref{thm:minsep}, and we consider the subtrees $\labeledsubtree{\ensuremath{S}_{i_j}}{} \in {\cal T}_{\ensuremath{S}_{i_j}}$ sequentially.
We divide the proof into several cases depending on $|\ensuremath{S}_{i_j}|$ and on $diam(\labeledsubtree{\ensuremath{S}_{i_j}}{})$.
\begin{itemize}
\item If $|\ensuremath{S}_{i_j}| \leq 2$ then, there can only be ${\cal O}(1)$ different possibilities for the pair $\labeledsubtree{\ensuremath{S}_{i_j}}{}, (d_r)_{r \in V(\labeledsubtree{\ensuremath{S}_{i_j}}{})}$.
We can solve \textsc{Distance-Constrained Root} for all these possibilities, thereby obtaining the family ${\cal T}_{i_j}$.
However, for some reasons that will become clearer in Section~\ref{sec:greedy}, we only keep in ${\cal T}_{i_j}$ the solutions which satisfy some local optimality criteria.
See Section~\ref{sec:small}.
\item The processing of the minimal separators $\ensuremath{S}_{i_j}$ with at least three elements is more intricate (Sections~\ref{sec:star} and~\ref{sec:bistar}).
For a fixed $\labeledsubtree{\ensuremath{S}_{i_j}}{}$ we define an encoding with only $|\ensuremath{S}_{i_j}|^{{\cal O}(1)}$ possibilities, that essentially summarizes at ``guessing'' the central nodes of $\unlabeledsubtree{\ensuremath{K}_i}$ and $\unlabeledsubtree{\ensuremath{K}_{i_j}}$.
Then, we show that only one solution per possible encoding needs to be stored in ${\cal T}_{i_j}$.
The correctness of this part crucially depends on some additional distances' constraints that are derived from the smaller separators contained into $\ensuremath{S}_{i_j}$, and on Theorem~\ref{thm:final-clique-tree}.
Indeed, our approach could not work with an arbitrary rooted clique-tree.
\end{itemize}
\subsection{Case $diam(\labeledsubtree{\ensuremath{S}_{i_j}}{}) \leq 1$.}\label{sec:small}
In this situation, $|\ensuremath{S}_{i_j}| \leq 2$ and so, there can only be ${\cal O}(1)$ possibilities for the distances' constraints $(d_r)_{r \in \ensuremath{S}_{i_j}}$.
We can solve \textsc{Distance-Constrained Root} for all possible values, thereby obtaining the family ${\cal T}_{i_j}$.
However, for reasons which will become clearer in the remaining of this Section and in the proofs of Section~\ref{sec:greedy}, storing all these possibilities would increase the runtime of our algorithm.
We confront this issue with a local optimality criterion.
Specifically:
\begin{myclaim}\label{claim:cut-vertex}
Assume $\ensuremath{S}_{i_j} = \{v\}$ and let $\labeledsubtree[M]{i_j}{} \in {\cal T}_{i_j}$ maximize $d_{\labeledsubtree[M]{i_j}{}}(v)$.
If $\tree$ is a $4$-Steiner root of $G$ and $\unlabeledsubtree{V_{i_j}} \in {\cal T}_{i_j}$ then, $\unlabeledsubtree{V \setminus W_{i_j}} \odot \labeledsubtree[M]{i_j}{}$ is also a $4$-Steiner root of $G$.
\end{myclaim}\hfill $\diamond$ \medskip
By Claim~\ref{claim:cut-vertex}, we so conclude that if $\ensuremath{S}_{i_j}$ is a cut-vertex then, we can keep exactly one solution in the family ${\cal T}_{i_j}$.
\begin{myclaim}\label{claim:edge}
Assume $\ensuremath{S}_{i_j} = \{u,v\}$.
Let $\tree$ be a $4$-Steiner root of $G$ such that $\unlabeledsubtree{\ensuremath{S}_{i_j}}$ is an edge and $dist_{\tree}(v, W_{i_j}) \geq dist_{\tree}(u, W_{i_j})$.
Then, $\tree[2] := \unlabeledsubtree{V \setminus W_{i_j}} \odot \labeledsubtree[v]{i_j}{}$ is also a $4$-Steiner root of $G$, where $\labeledsubtree[v]{i_j}{} \in {\cal T}_{i_j}$ is, among all solutions in this set such that $\labeledsubtree{i_j}{\ensuremath{S}_{i_j}}$ is an edge and $d_{\labeledsubtree{i_j}{}}(v)$ is maximized, one maximizing $d_{\labeledsubtree{i_j}{}}(u)$.
Moreover, $dist_{\tree[2]}(v, W_{i_j}) \geq dist_{\tree}(v, W_{i_j})$ and $dist_{\tree[2]}(u, W_{i_j}) \geq dist_{\tree}(u, W_{i_j})$.
\end{myclaim}
\begin{proofclaim}
It suffices to prove $dist_{\tree[2]}(u, W_{i_j}) \geq dist_{\tree}(u, W_{i_j})$.
We first observe $d_{\labeledsubtree[v]{i_j}{}}(v) - d_{\labeledsubtree[v]{i_j}{}}(u) \leq 1$ because $\labeledsubtree[v]{i_j}{\ensuremath{S}_{i_j}}$ is an edge.
Therefore, there are two cases.
Either $dist_{\tree}(v, W_{i_j}) = d_{\labeledsubtree[v]{i_j}{}}(v)$ was already maximized, and so we have $d_{\labeledsubtree[v]{i_j}{}}(u) \geq dist_{\tree}(u, W_{i_j})$. Or $d_{\labeledsubtree[v]{i_j}{}}(v) \geq dist_{\tree}(v, W_{i_j}) + 1$, and so $d_{\labeledsubtree[v]{i_j}{}}(u) \geq d_{\labeledsubtree[v]{i_j}{}}(v) -1 \geq dist_{\tree}(v, W_{i_j}) \geq dist_{\tree}(u, W_{i_j})$.
\end{proofclaim}
By Claim~\ref{claim:edge}, if $\ensuremath{S}_{i_j} = \{u,v\}$ and $\labeledsubtree{\ensuremath{S}_{i_j}}{}$ is an edge then, we only need to keep two solutions, namely: among all those maximizing $d_{\labeledsubtree{i_j}{}}(v)$ ($d_{\labeledsubtree{i_j}{}}(u)$, resp.) the one maximizing $d_{\labeledsubtree{i_j}{}}(u)$ ($d_{\labeledsubtree{i_j}{}}(v)$, resp.).
\subsection{Case $\labeledsubtree{\ensuremath{S}_{i_j}}{}$ is a non-edge star.}\label{sec:star}
If $|\ensuremath{S}_{i_j}| = 2$ then, as already observed in Section~\ref{sec:small}, there can only be ${\cal O}(1)$ different possibilities for the constraints.
We can solve \textsc{Distance-Constrained Root} for all possible values, thereby obtaining the family ${\cal T}_{i_j}$.
Thus from now on we assume $|\ensuremath{S}_{i_j}| \geq 3$.
\smallskip
Although there may be exponentially many possible sets of constraints in this case, we show that only a few of the distances' constraints we impose truly need to be considered by our algorithm.
Specifically, write $\centre{\labeledsubtree{\ensuremath{S}_{i_j}}{}} = \{c\}$.
We consider all possible pairs of nodes $c_i,c_{i_j}$ that are either in $\ensuremath{S}_{i_j}$ or Steiner.
For every such a fixed pair, we are interested in the existence of (well-structured) $4$-Steiner roots $\tree$ of $G$ such that: $c_i \in \centre{\unlabeledsubtree{\ensuremath{K}_i}} \cap N_{\tree}[c]$ and $c_{i_j} \in \centre{\unlabeledsubtree{\ensuremath{K}_{i_j}}} \cap N_{\tree}[c]$.
In order for our algorithm to decide whether such Steiner roots exist, we will prove that we only need to consider the distances between ${\cal O}(1)$ nodes in $\labeledsubtree{\ensuremath{S}_{i_j}}{}$ and $W_{i_j}$.
-- In particular, we will prove that we only need to store ${\cal O}(1)$ partial solutions in ${\cal T}_{i_j}$. --
On our way to prove this result, we also use various properties of $4$-Steiner powers in order to impose additional distances' constraints on the solutions in ${\cal T}_{i_j}$ which we prove to be necessary in order to extend such a partial solution to all of $G$.
This second phase is crucial in proving correctness of our approach.
Overall, by Lemma~\ref{lem:center-in-star}, we can always relate {\em any} $4$-Steiner root of $G$ with a pair $c_i,c_{i_j}$ as defined above.
Since there are ${\cal O}(|\ensuremath{S}_{i_j}|)$ possibilities for every of $\labeledsubtree{\ensuremath{S}_{i_j}}{}, c_i,c_{i_j}$, we are left with only ${\cal O}(|\ensuremath{S}_{i_j}|^3)$ different possibilities to store for stars.
\medskip
Recall that $\cliquetree{G}$ is a rooted clique-tree of $G$ as stated in Theorem~\ref{thm:final-clique-tree}.
Before starting our analysis, we need to derive a few properties from $\cliquetree{G}$.
Indeed, our approach could not work with an arbitrary rooted clique-tree.
\begin{myclaim}\label{claim:not-a-container}
If $\ensuremath{S}_{i_j}$ strictly contains a minimal separator of $G_{i_j}$ then, in any $4$-Steiner root $\tree$ of $G$, $\unlabeledsubtree{\ensuremath{S}_{i_j}}$ is a bistar.
\end{myclaim}
\begin{proofclaim}
Suppose by contradiction $\unlabeledsubtree{\ensuremath{S}_{i_j}}$ is a star.
Any minimal separator of $G_{i_j}$ that is strictly contained into $\ensuremath{S}_{i_j}$ should have size at most two. However, Property~\ref{pty-fct:2} of Theorem~\ref{thm:final-clique-tree} ensures that all such minimal separators should have size at least three.
A contradiction.
\end{proofclaim}
By Claim~\ref{claim:not-a-container}, we may assume from now on that $\ensuremath{S}_{i_j}$ does not strictly contain any minimal separator of $G_{i_j}$ (otherwise, $\labeledsubtree{\ensuremath{S}_{i_j}}{}$ cannot be a star, and we are done with this case).
We are now left with two possibilities:
\subsubsection{Subcase no minimal separator of $G_{i_j}$ contains $\ensuremath{S}_{i_j}$.}\label{sec:star-uncontained}
Given any $4$-Steiner root $\labeledsubtree{i_j}{}$ of $G_{i_j}$ where $\labeledsubtree{i_j}{\ensuremath{S}_{i_j}} \equiv_G \labeledsubtree{\ensuremath{S}_{i_j}}{}$, we define an encoding as follows:
$${\tt short-encode}(\labeledsubtree{i_j}{}) := \langle c, c_{i_j}, d_{\labeledsubtree{i_j}{}}(c), d_{\labeledsubtree{i_j}{}}(c_{i_j}) \rangle,$$
where $c_{i_j} \in \centre{\labeledsubtree{i_j}{\ensuremath{K}_{i_j}}} \cap N_{\labeledsubtree{i_j}{}}[c]$ is arbitrary.
The relationship between short encodings and {\sc Distance-Constrained Root} is discussed at the end of the section.
First we prove the following result:
\begin{myclaim}\label{claim:star-1}
If ${\tt short-encode}(\labeledsubtree{i_j}{}) = {\tt short-encode}(\labeledsubtree[2]{i_j}{})$ and $\tree := \tree[0] \odot \labeledsubtree{i_j}{}$ is a $4$-Steiner root of $G$ then, $\tree[2] := \tree[0] \odot \labeledsubtree[2]{i_j}{}$ is also a $4$-Steiner root of $G$.
\end{myclaim}
\begin{proofclaim}
It suffices to prove $d_{\labeledsubtree{i_j}{}}(v) = d_{\labeledsubtree[2]{i_j}{}}(v)$ for every $v \in \ensuremath{S}_{i_j}$.
For that, we need to analyze the possible intersections between $\ensuremath{S}_{i_j}$ and the minimal separators in $\ensuremath{K}_{i_j}$.
Recall that $\ensuremath{S}_{i_j}$ is not a minimal separator of $G_{i_j}$ by the hypothesis.
\begin{itemize}
\item Moreover, assume $c_{i_j} \neq c$.
By Lemma~\ref{lem:center-in-star} we have $Real(N_{\tree}[c]) = \ensuremath{S}_{i_j}$.
Combined with the fact that a minimal separator of $G_{i_j}$ can neither contain $\ensuremath{S}_{i_j}$ nor be strictly contained into $\ensuremath{S}_{i_j}$ (Claim~\ref{claim:not-a-container}), this implies all the paths between $\ensuremath{S}_{i_j}$ and $W_{i_j}$ must pass by $c,c_{i_j}$ (see Fig.~\ref{fig:star-encoding-1} for an illustration).
In this situation, our partial encoding already contains all the distances' information we need.
\begin{figure}[h!]
\centering
\includegraphics[width=.25\textwidth]{Fig/star-encoding-1}
\caption{A schematic view of $\unlabeledsubtree{V_{i_j}}$.}
\label{fig:star-encoding-1}
\end{figure}
\item Otherwise, $c_{i_j} = c$.
A simple transformation of the construction proposed in Lemma~\ref{lem:almost-simplicial-placement} shows that we can always assume the simplicial vertices among $\ensuremath{S}_{i_j} \setminus \{c\}$ (in $G_{i_j}$) to be leaves adjacent to $c$ in $T$.
Namely, we can make all these vertices leaves of $\unlabeledsubtree{\ensuremath{K}_{i_j}}$ in such a way that they are connected to $c$ via a path with one Steiner node.
We complete this construction by contracting each such simplicial vertex with its Steiner neighbour.
\begin{figure}[h!]
\centering
\includegraphics[width=.25\textwidth]{Fig/star-encoding-2}
\caption{The case $c = c_{i_j}$. Two minimal separators $\ensuremath{S},\ensuremath{S}'$ overlapping $\ensuremath{S}_{i_j}$ are drawn in bold.}
\label{fig:star-encoding-2}
\end{figure}
\smallskip
We end up showing that {\em all} the vertices in $\ensuremath{S}_{i_j} \setminus \{c\}$ that are contained into another minimal separator $\ensuremath{S}$ of $G_{i_j}$ are adjacent in $\tree$ to some vertex in $W_{i_j}$ (hence, their distance to this set is known implicitly and does not need to be stored in the encoding).
Indeed, since $\ensuremath{S}$ and $\ensuremath{S}_{i_j}$ overlap, we cannot have $\unlabeledsubtree{\ensuremath{S}}$ is a bistar (otherwise, $\ensuremath{S}_{i_j} \subseteq \ensuremath{S}$ by Lemma~\ref{lem:bistar-center}).
In particular: either $\unlabeledsubtree{\ensuremath{S}}$ is an edge with exactly one end in $\ensuremath{S}_{i_j}$; or $\unlabeledsubtree{\ensuremath{S}}$ is a non edge star and, by Lemma~\ref{lem:center-in-star}, the unique vertex in $(\ensuremath{S} \cap \ensuremath{S}_{i_j}) \setminus \{c\}$ is its center.
See Fig.~\ref{fig:star-encoding-2} for an illustration.
\end{itemize}
\end{proofclaim}
Finally given ${\tt short-encode}(\labeledsubtree{i_j}{})$, we can transform such a short encoding into the constraints $(d_r)_{r \in V(\labeledsubtree{i_j}{\ensuremath{S}_{i_j}})}$ where:
\begin{itemize}
\item $d_c = d_{\labeledsubtree{i_j}{}}(c)$
\item If $c_{i_j}$ is a real node that is different than $c$ then, $d_{c_{i_j}} = d_{\labeledsubtree{i_j}{}}(c_{i_j})$;
\item For all other nodes $r \in \ensuremath{S}_{i_j}$: $$d_r = \begin{cases}
d_c + 1 \ \text{if} \ c \neq c_{i_j} \ \text{or} \ r \ \text{is simplicial in} \ G_{i_j} \\
1 \ \text{otherwise.}
\end{cases}.$$
\end{itemize}
Note that in doing so, $d_c \in \{2,3\} \ \text{and when it is defined} \ d_{c_{i_j}} \in \{1,2\}$.
Overall, there are at most $2^2 = 4$ possibilities for a fixed pair $\labeledsubtree{\ensuremath{S}_{i_j}}{}, c_{i_j}$.
Furthermore, this above transformation is not injective, and we can so obtain the same constraints for different short encodings (thereby further reducing the size of ${\cal T}_{i_j}$).
The reason why this does not matter is that assuming we made a correct guess for ${\tt short-encode}(\labeledsubtree{i_j}{})$, we proved in Claim~\ref{claim:star-1} that we have $d_{\labeledsubtree{i_j}{}}(r) = d_r$ for any $r \in V(\labeledsubtree{\ensuremath{S}_{i_j}}{})$.
In particular, if $\labeledsubtree{i_j}{}$ can be extended to a $4$-Steiner root of $G$ then, so could be any partial solution $\labeledsubtree[2]{i_j}{}$ that would satisfy these above constraints as we would have $d_{\labeledsubtree[2]{i_j}{}}(r) \geq d_{\labeledsubtree{i_j}{}}(r)$ for any $r \in V(\labeledsubtree{\ensuremath{S}_{i_j}}{})$.
\subsubsection{Subcase a minimal separator of $G_{i_j}$ contains $\ensuremath{S}_{i_j}$.}\label{sec:star-contained}
As for the previous subcase, we start introducing a short encoding then, we explain its relationship with {\sc Distance-Constrained Root} at the end of this section.
The novelty here is that we need to complete our encoding with additional distances' conditions, that we will also use in order to define our distances' constraints in the input.
Specifically, let us fix a pair $c_i,c_{i_j}$ and let us only consider the partial solutions $\labeledsubtree{i_j}{}$ where $\labeledsubtree{i_j}{\ensuremath{S}_{i_j}} \equiv_G \labeledsubtree{\ensuremath{S}_{i_j}}{}$ and $c_{i_j} \in \centre{\labeledsubtree{i_j}{\ensuremath{K}_{i_j}}} \cap N_{\labeledsubtree{i_j}{}}[c]$.
We set:
$${\tt short-encode-2}(\labeledsubtree{i_j}{}) = \left[ \langle c, c_{i}, d_{\labeledsubtree{i_j}{}}(c), d_{\labeledsubtree{i_j}{}}(c_{i}) \rangle \,\middle\vert\, d_{\labeledsubtree{i_j}{}}(v), \ \forall v \in \ensuremath{S}_i \cap \ensuremath{S}_{i_j} \right].$$
In order to bound the number of possible such encodings, we prove that:
\begin{myclaim}
$|\ensuremath{S}_i \cap \ensuremath{S}_{i_j}| = {\cal O}(1)$.
\end{myclaim}
\begin{proofclaim}
Recall that by Lemma~\ref{lem:star-center}, $\ensuremath{S}_{i_j}$ must be weakly $\cliquetree{G}$-convergent.
Since we assume $|\ensuremath{S}_{i_j}| \geq 3$, by Property~\ref{pty-fct:1} of Theorem~\ref{thm:final-clique-tree}, $\ensuremath{S}_{i_j}$ is $\cliquetree{G}$-convergent.
Moreover since there is a minimal separator of $G_{i_j}$ that contains $\ensuremath{S}_{i_j}$, the maximal clique incident to all edges in $\superedgeset{G}{\ensuremath{S}_{i_j}}$ must be $\ensuremath{K}_{i_j}$.
This implies that $\ensuremath{S}_i := \ensuremath{K}_i \cap \ensuremath{K}_{p(i)}$ cannot contain $\ensuremath{S}_{i_j}$.
In particular, $|\ensuremath{S}_i \cap \ensuremath{S}_{i_j}| \leq 2$.
\end{proofclaim}
This new encoding above may not be informative enough in some cases.
We complete it with additional {\em distances' conditions}.
Specifically,
we consider all the other minimal separators $\ensuremath{S}_{i_k} := \ensuremath{K}_i \cap \ensuremath{K}_{i_k}$ between $\ensuremath{K}_i$ and one of its children nodes such that $\ensuremath{S}_{i_k} \subset \ensuremath{S}_{i_j}$.
Note that since we assume $\labeledsubtree{\ensuremath{S}_{i_j}}{}$ to be a star, we must have $|\ensuremath{S}_{i_k}| \leq 2$.
There are two possibilities:
\begin{itemize}
\item If $\ensuremath{S}_{i_k} = \{v_{i_k}\}$ then, by Claim~\ref{claim:cut-vertex} there is only one solution left in ${\cal T}_{i_k}$.
Specifically, this solution $\labeledsubtree{i_k}{} \in {\cal T}_{i_k}$ maximizes $d_{i_k} := d_{\labeledsubtree{i_k}{}}(v_{i_k})$.
We are left ensuring $d_{\labeledsubtree{i_j}{}}(v_{i_k}) > 4 - d_{i_k}$.
\item Otherwise, $\ensuremath{S}_{i_k} = \{u_{i_k},v_{i_k}\}$.
Then, $\labeledsubtree{i_j}{\ensuremath{S}_{i_k}}$ must be an edge and we may assume w.l.o.g. $c_{i_j} = u_{i_k}$.
We are left to ensure that $d_{\labeledsubtree{i_j}{}}(v_{i_k}) \geq 2$.
\end{itemize}
\begin{myclaim}\label{claim:star-2}
For any $\labeledsubtree{i_j}{}$ that satisfies the above distances' conditions, one of the following properties must be true:
\begin{enumerate}
\item $\labeledsubtree{i_j}{}$ can be extended to a $4$-Steiner root of $G$;
\item For any $4$-Steiner root $\labeledsubtree[2]{i_j}{}$ of $G_{i_j}$ such that {\small${\tt short-encode-2}(\labeledsubtree{i_j}{}) = {\tt short-encode-2}(\labeledsubtree[2]{i_j}{})$}, we cannot extend $\labeledsubtree[2]{i_j}{}$ to a {\em well-structured} $4$-Steiner root of $G$.
\end{enumerate}
\end{myclaim}
\begin{figure}
\centering
\includegraphics[width=.4\textwidth]{Fig/star-encoding-3}
\caption{To the proof of Claim~\ref{claim:star-2}.}
\label{fig:star-encoding-3}
\end{figure}
\begin{proofclaim}
See Fig.~\ref{fig:star-encoding-3} for an illustration.
Assume that there is a $\labeledsubtree[2]{i_j}{}$ as stated in the claim that can be extended to a well-structured $4$-Steiner root $\tree[2]$ of $G$.
In order to prove the claim, it suffices to prove that $\tree := \unlabeledsubtree[2]{V \setminus W_{i_j}} \odot \labeledsubtree{i_j}{}$ (or a slight modification of it) is also a $4$-Steiner root of $G$.
For that, since $E(G \setminus W_{i_j}) \cup E(G_{i_j}) = E(G)$ (all edges are covered), it suffices to prove $dist_{\tree}(V \setminus V_{i_j},W_{i_j}) > 4$.
We start observing that according to Property~\ref{pty-fct:2} of Theorem~\ref{thm:final-clique-tree}, there is a minimal separator $\ensuremath{S}'$ of $G_{i_j}$ that strictly contains $\ensuremath{S}_{i_j}$.
Such a minimal separator $\ensuremath{S}'$ must induce a bistar in $\tree[2]$ and $\tree$.
Then, as $c$ must be the center of one of the two maximal cliques containing $\ensuremath{S}'$ ({\it i.e.}, see Lemmata~\ref{lem:bistar-center} and~\ref{lem:star-center}), we so obtain $c \neq c_i$.
In particular, all the paths between $\ensuremath{S}_{i_j}$ and $\ensuremath{K}_i \setminus \ensuremath{S}_{i_j}$ will need to pass by $c_i$, and so:
$$dist_{\tree}(\ensuremath{K}_i \setminus \ensuremath{S}_{i_j},W_{i_j}) = dist_{\tree[2]}(\ensuremath{K}_i \setminus \ensuremath{S}_{i_j},W_{i_j}) > 4.$$
We now prove as a subclaim that we also have $dist_{\tree}(V \setminus V_i,W_{i_j}) = dist_{\tree[2]}(V \setminus V_i,W_{i_j}) > 4$.
Indeed, in order to have $dist_{\tree}(u,v) \leq 4$ for some $u \notin V_i, v \in W_{i_j}$, we need an intermediate node $r \in \unlabeledsubtree{\ensuremath{S}_i} \cap \unlabeledsubtree{\ensuremath{S}_{i_j}}$ onto the unique $uv$-path in $\tree$.
However, such a node $r$ should be either $c$ or in $\ensuremath{S}_i \cap \ensuremath{S}_{i_j}$.
By definition of our short encoding, this would imply $dist_{\tree[2]}(u,v) \leq 4$, a contradiction.
We finally consider the other minimal separators $\ensuremath{S}_{i_k} := \ensuremath{K}_i \cap \ensuremath{K}_{i_k}$ between $\ensuremath{K}_i$ and one of its children nodes that intersect $\ensuremath{K}_{i_j}$.
We have $\ensuremath{S}_{i_j} \not\subseteq \ensuremath{S}_{i_k}$ (otherwise, $\ensuremath{S}_{i_j}$ could not be $\cliquetree{G}$-convergent, thereby contradicting Property~\ref{pty-fct:1} of Theorem~\ref{thm:final-clique-tree}).
Thus, $|\ensuremath{S}_{i_k} \cap \ensuremath{S}_{i_j}| \leq 2$.
Furthermore since we have $c \neq c_i$, Lemma~\ref{lem:center-in-star} implies that either $\ensuremath{S}_{i_k} \subset \ensuremath{S}_{i_j}$ or $\ensuremath{S}_{i_k} \cap \ensuremath{S}_{i_j} \subseteq \{c_i,c\}$.
In the latter case: $$dist_{\tree}(W_{i_k},W_{i_j}) = dist_{\tree[2]}(W_{i_k},W_{i_j}) > 4.$$
Thus from now on assume $\ensuremath{S}_{i_k} \subset \ensuremath{S}_{i_j}$ (and so, $|\ensuremath{S}_{i_k}| \leq 2$).
If $\ensuremath{S}_{i_k}$ is a cut-vertex then, it follows from Claim~\ref{claim:cut-vertex} and the distances' conditions satisfied by $\labeledsubtree{i_j}{}$ that we can always assume $d_{\labeledsubtree{i_j}{}}(\ensuremath{S}_{i_k}) > 4 - dist_{\tree[2]}(\ensuremath{S}_{i_k},W_{i_k})$.
In particular, $dist_{\tree}(W_{i_k},W_{i_j}) > 4$.
We end up with the case $\ensuremath{S}_{i_k} = \{u_{i_k},v_{i_k}\}$.
Then, $\unlabeledsubtree{\ensuremath{S}_{i_k}}$ must be an edge and we may assume w.l.o.g. $c = u_{i_k}$.
Since we assume $\unlabeledsubtree{\ensuremath{S}_{i_j}}$ is a non-edge star, $c$ is adjacent to some other leaf than $v_{i_k}$.
In other words, $dist_{\tree}(c,V \setminus W_{i_k}) = 1$ is minimized.
Then, since we have $dist_{\tree[2]}(W_{i_k},W_{i_j}) > 4$ we must have $dist_{\tree[2]}(c,W_{i_k}) = 4$ and so, $dist_{\tree[2]}(v_{i_k},W_{i_k}) = 3$.
It follows from Claim~\ref{claim:edge} and the distances' conditions satisfied by $\labeledsubtree{i_j}{}$ that we can always assume $dist_{\tree}(W_{i_k},W_{i_j}) = dist_{\tree[2]}(v_{i_k},W_{i_k}) + d_{\labeledsubtree{i_j}{}}(v_{i_k}) \geq 3 + 2 > 4$.
\end{proofclaim}
Finally given ${\tt short-encode-2}(\labeledsubtree{i_j}{})$, we can transform such a short encoding into the constraints $(d_r)_{r \in V(\labeledsubtree{\ensuremath{S}_{i_j}}{})}$ where:
\begin{itemize}
\item $d_c = d_{\labeledsubtree{i_j}{}}(c)$
\item For any $v \in \ensuremath{S}_{i_j} \cap \ensuremath{S}_i$, $d_v = d_{\labeledsubtree{i_j}{}}(v)$.
\item If $c_i$ is a real node that is not in $\ensuremath{S}_i \cup \{c\}$ then, $d_{c_i} = d_{\labeledsubtree{i_j}{}}(c_i)$;
\item If $v_{i_k} \in \ensuremath{S}_{i_k} \subset \ensuremath{S}_{i_j}$ has a distance-condition then, $d_{v_{i_k}}$ is set to the largest such condition.
\item Finally, for all other nodes $r \in V(\labeledsubtree{\ensuremath{S}_{i_j}}{})$: $d_r = 1$ (trivial constraint).
\end{itemize}
For any fixed $\labeledsubtree{\ensuremath{S}_{i_j}}{}$ the mapping $\varphi : {\tt short-encode-2}(\labeledsubtree{i_j}{}) \to \langle c_i, (d_r)_{r \in V(\labeledsubtree{\ensuremath{S}_{i_j}}{})} \rangle$ is injective.
Moreover we proved in Claim~\ref{claim:star-2} that, in any $4$-Steiner root $\tree$ of $G$, all the paths between $\unlabeledsubtree{\ensuremath{S}_{i}}$ and $W_{i_j}$ must go by $\{c,c_i\} \cup (\ensuremath{S}_i \cap \ensuremath{S}_{i_j})$.
Therefore, our short encodings always preserve a yes-instance of {\sc Distance-Constrained Root} at $\ensuremath{K}_i$ provided one exists.
\subsection{Case $\labeledsubtree{\ensuremath{S}_{i_j}}{}$ is a bistar}\label{sec:bistar}
We follow the same approach as in Section~\ref{sec:star}.
In fact, the proof is a bit simpler in this case.
For instance by Lemma~\ref{lem:bistar-center}, in {\em any} $4$-Steiner root $\tree$ of $G$ such that $\unlabeledsubtree{\ensuremath{S}_{i_j}} \equiv_G \labeledsubtree{\ensuremath{S}_{i_j}}{}$, we must have $\centre{\labeledsubtree{\ensuremath{S}_{i_j}}{}} = \{c_i,c_{i_j}\}$ where $c_i$ and $c_{i_j}$ are the unique central nodes of $\unlabeledsubtree{\ensuremath{K}_i}$ and $\unlabeledsubtree{\ensuremath{K}_{i_j}}$, respectively.
\paragraph{Preliminaries.}
Before choosing our short encoding, we will need to prove some new properties of the rooted clique-tree $\cliquetree{G}$ (given by Theorem~\ref{thm:final-clique-tree}).
\begin{myclaim}\label{claim:bistar-1}
Let $\labeledsubtree{i_j}{}$ be a $4$-Steiner root of $G_{i_j}$ such that $\labeledsubtree{i_j}{\ensuremath{S}_{i_j}} \equiv_G \labeledsubtree{\ensuremath{S}_{i_j}}{}$ is a bistar.
If $\labeledsubtree{i_j}{}$ can be extended to a $4$-Steiner root of $G$ then, all the vertices in $N_{\labeledsubtree{i_j}{}}(c_i) \setminus \{c_{i_j}\}$ are simplicial in $G_{i_j}$
(hence, their distance to $W_{i_j}$ is always equal to $d_{\labeledsubtree{i_j}{}}(c_i) + 1$).
\end{myclaim}
\begin{proofclaim}
This may not be the case only if some of these vertices are contained into a minimal separator $\ensuremath{S}$ of $G_{i_j}$.
Then, since $N_{\labeledsubtree{i_j}{}}[c_i] \setminus \{c_{i_j}\}$ is a connected component of $\labeledsubtree{i_j}{\ensuremath{K}_{i_j}} \setminus \{c_{i_j}\}$, we should have $\ensuremath{S} \subseteq \ensuremath{S}_{i_j}$.
By Property~\ref{pty-fct:2} of Theorem~\ref{thm:final-clique-tree} we obtain that $|\ensuremath{S}| \geq 3$.
Furthermore, $\ensuremath{S} \subset \ensuremath{S}_{i_j}$ because, by Lemma~\ref{lem:bistar-center}, $G \setminus \ensuremath{S}_{i_j}$ has exactly two full components.
This implies that the only possibility for $\labeledsubtree{i_j}{\ensuremath{S}}$ is a star; moreover, $Real(N_{\labeledsubtree{i_j}{}}[c_i]) = \ensuremath{S}$ by Lemma~\ref{lem:star-center}.
However, by Property~\ref{pty-fct:2} of Theorem~\ref{thm:final-clique-tree}, there should exist a minimal separator of $G_{i_j}$ that strictly contains $\ensuremath{S}$.
As proved in Lemma~\ref{lem:star-center}, $\ensuremath{S}$ must be weakly $\cliquetree{G}$-convergent.
Hence, all edges in $\superstrictedgeset{G}{\ensuremath{S}}$ must be incident to $\ensuremath{K}_{i_j}$.
This implies that in fact, the bistars $\labeledsubtree{i_j}{\ensuremath{S}'}, \ \ensuremath{S}' \supset \ensuremath{S}$ can only intersect in $N_{\labeledsubtree{i_j}{}}[c_{i_j}]$.
So, $Real(N_{\labeledsubtree{i_j}{}}[c_{i_j}]) = \ensuremath{S}$, that is a contradiction since $c_{i_j} \neq c_i$.
\end{proofclaim}
\begin{myclaim}\label{claim:bistar-2}
Let $\labeledsubtree{i_j}{}$ be a $4$-Steiner root of $G_{i_j}$ such that $\labeledsubtree{i_j}{\ensuremath{S}_{i_j}} \equiv_G \labeledsubtree{\ensuremath{S}_{i_j}}{}$ is a bistar, and let $\tree$ be a $4$-Steiner root of $G$ extending $\labeledsubtree{i_j}{}$.
One of the following conditions is true:
\begin{enumerate}
\item
Either every real node in $N_{\tree}(c_{i_j})$ is simplicial in $G_{i_j}$ or is adjacent in $\tree$ to a vertex of $W_{i_j}$.
\item
Or $|\ensuremath{S}_i \cap N_{\tree}[c_{i_j}]| \leq 2$, and in the same way $|\ensuremath{S}_{i_k} \cap N_{\tree}[c_{i_j}]| \leq 2$ for any other child $\ensuremath{K}_{i_k}$ of $\ensuremath{K}_i$.
\end{enumerate}
\end{myclaim}
\begin{proofclaim}
Recall that according to Lemma~\ref{lem:bistar-center}, $\ensuremath{S}_{i_j}$ is only contained into the maximal cliques $\ensuremath{K}_i$ and $\ensuremath{K}_{i_j}$.
In particular if we prove $\ensuremath{K} \cap \ensuremath{K}' \subseteq \ensuremath{S}_{i_j}$ for some $\{\ensuremath{K},\ensuremath{K}'\} \neq \{\ensuremath{K}_i,\ensuremath{K}_{i_j}\}$ then, this inclusion is strict.
We implicitly use this fact in what follows.
Specifically if $\ensuremath{S}_i \subseteq \ensuremath{S}_{i_j}$ (resp., $\ensuremath{S}_{i_k} \subseteq \ensuremath{S}_{i_j}$ for some child $\ensuremath{K}_{i_k}$ of $\ensuremath{K}_i, \ k \neq j$, or $\ensuremath{S} \subseteq \ensuremath{S}_{i_j}$ for some minimal separator $\ensuremath{S}$ of $G_{i_j}$) then, we must have $\ensuremath{S}_i \subset \ensuremath{S}_{i_j}$ (resp., $\ensuremath{S}_{i_k} \subset \ensuremath{S}_{i_j}$ or $\ensuremath{S} \subset \ensuremath{S}_{i_j}$).
For the remaining of the proof we may assume $|N_{\tree}[c_{i_j}]| \geq 3$ (otherwise we are done).
Our proof is based on the following two observations:
\begin{enumerate}
\item By Property~\ref{pty-ci:2} of Theorem~\ref{thm:clique-intersection}, having $|\ensuremath{S}_i \cap N_{\tree}[c_{i_j}]| \geq 3$ ($|\ensuremath{S}_{i_k} \cap N_{\tree}[c_{i_j}]| \geq 3$, resp.) would imply $Real(N_{\tree}[c_{i_j}]) \subseteq \ensuremath{S}_i$ ($Real(N_{\tree}[c_{i_j}]) \subseteq \ensuremath{S}_{i_k}$, resp.).
Since $N_{\tree}[c_{i_j}] \setminus \{c_i\}$ is a connected component of $\unlabeledsubtree{\ensuremath{K}_i} \setminus \{c_i\}$, this would in turn imply $\ensuremath{S}_i \subset \ensuremath{S}_{i_j}$ ($\ensuremath{S}_{i_k} \subset \ensuremath{S}_{i_j}$, resp.).
As a result, we would have $\ensuremath{S}_i = Real(N_{\tree}[c_{i_j}])$ (resp., $\ensuremath{S}_{i_k} = Real(N_{\tree}[c_{i_j}])$).
\item By Property~\ref{pty-fct:2} of Theorem~\ref{thm:final-clique-tree} any minimal separator of $G_{i_j}$ that is strictly contained into $\ensuremath{S}_{i_j}$ must have size at least $3$, be $\cliquetree{G}$-convergent, and be strictly contained into a minimal separator of $G_{i_j}$.
So, the only possibility for such a separator is also $\ensuremath{S} = Real(N_{\tree}[c_{i_j}])$.
\end{enumerate}
If $\ensuremath{S}_{i_j}$ contains a minimal separator $\ensuremath{S}$ of $G_{i_j}$ then, by the above two observations we cannot have $\ensuremath{S} = \ensuremath{S}_i$, neither $\ensuremath{S} = \ensuremath{S}_{i_k}$ for any other child $\ensuremath{K}_{i_k}$ of $\ensuremath{K}_i$ (otherwise, $\ensuremath{S}$ could not be $\cliquetree{G}$-convergent).
In particular, we cannot have $|\ensuremath{S}_i \cap N_{\tree}[c_{i_j}]| \geq 3$, neither $|\ensuremath{S}_{i_k} \cap N_{\tree}[c_{i_j}]| \geq 3$, and so we always fall in Case 2 of the claim.
From now on we assume that $\ensuremath{S}_{i_j}$ does not strictly contain any minimal separator of $G_{i_j}$.
We prove as a subclaim that either $Real(N_{\tree}[c_{i_j}]) \neq \ensuremath{S}_i$ and $Real(N_{\tree}[c_{i_j}]) \neq \ensuremath{S}_{i_k}$ for any child $\ensuremath{K}_{i_k}$, or there is no separator of $G_{i_j}$ that contains $Real(N_{\tree}[c_{i_j}])$.
Indeed, suppose by contradiction $Real(N_{\tree}[c_{i_j}]) = \ensuremath{S}_i$ and there exists a separator $\ensuremath{S}'$ of $G_{i_j}$ that contains $Real(N_{\tree}[c_{i_j}])$.
It implies by Lemma~\ref{lem:star-center} $\ensuremath{S}_i$ is weakly $\cliquetree{G}$-convergent but not $\cliquetree{G}$-convergent, thereby contradicting Property~\ref{pty-fct:1} of Theorem~\ref{thm:final-clique-tree}.
The proof for $\ensuremath{S}_{i_k}$ is identical as the one above, thereby proving the subclaim.
Finally, let us assume either $Real(N_{\tree}[c_{i_j}]) = \ensuremath{S}_i$ or $Real(N_{\tree}[c_{i_j}]) = \ensuremath{S}_{i_k}$ for some child $\ensuremath{K}_{i_k}$ (otherwise, according to our first observation above, we always fall in Case 2 of the claim).
Since no minimal separator of $G_{i_j}$ can contain $Real(N_{\tree}[c_{i_j}])$, we can reuse the same proof as for Claim~\ref{claim:star-1} (Case $c = c_{i_j}$) in order to prove that we always fall in Case 1 of the claim.
Specifically, we end up showing that {\em all} the vertices in $N_{\tree}(c_{i_j})$ that are contained into another minimal separator $\ensuremath{S}$ of $G_{i_j}$ are adjacent in $\tree$ to some vertex in $W_{i_j}$.
Indeed, $\ensuremath{S}$ and $Real(N_{\tree}[c_{i_j}])$ must overlap because we assume $\ensuremath{S} \not\subseteq \ensuremath{S}_{i_j}$ and $Real(N_{\tree}[c_{i_j}]) \not\subseteq \ensuremath{S}$.
Then, we cannot have $\unlabeledsubtree{\ensuremath{S}}$ is a bistar (otherwise, $Real(N_{\tree}[c_{i_j}]) \subseteq \ensuremath{S}$ by Lemma~\ref{lem:bistar-center}).
In particular: either $\unlabeledsubtree{\ensuremath{S}}$ is an edge with exactly one end in $N_{\tree}[c_{i_j}]$; or $\unlabeledsubtree{\ensuremath{S}}$ is a non edge star and, by Lemma~\ref{lem:center-in-star}, the unique vertex in $(\ensuremath{S} \cap \ensuremath{S}_{i_j}) \setminus \{c_{i_j}\}$ is its center.
\end{proofclaim}
\paragraph{The encoding.}
For any $4$-Steiner root $\labeledsubtree{i_j}{}$ of $G_{i_j}$ such that $\labeledsubtree{i_j}{\ensuremath{S}_{i_j}} \equiv_G \labeledsubtree{S_{i_j}}{}$ is a bistar, we include in our short encoding the following information:
\begin{flalign*}
\left[ c_i, d_{\labeledsubtree{i_j}{}}(c_i),d_{\labeledsubtree{i_j}{}}(c_{i_j}) \right] \ \text{and} \
\begin{cases}
\text{only if} \ |Real(N_{\labeledsubtree{i_j}{}}[c_{i_j}])| \leq 2 \text{)} \ d_{\labeledsubtree{i_j}{}}(r), \ \forall r \in N_{\labeledsubtree{i_j}{}}[c_{i_j}] \\
\text{or (only if} \ |\ensuremath{S}_i \cap N_{\labeledsubtree{i_j}{}}[c_{i_j}]| \leq 2 \text{)} \ d_{\labeledsubtree{i_j}{}}(v), \ \forall v \in N_{\labeledsubtree{i_j}{}}[c_{i_j}] \cap \ensuremath{S}_i
\end{cases}
\end{flalign*}
As usual, the relationship between this above encoding and {\sc Distance-Constrained Root} is made explicit at the end of the section.
There are only ${\cal O}(1)$ possibilities for a fixed $\labeledsubtree{\ensuremath{S}_{i_j}}{}$. By Theorem~\ref{thm:minsep}, we so obtain ${\cal O}(|\ensuremath{S}_{i_j}|^5)$ different encodings.
However, we need to complete this case with similar distances' conditions as for the star case (Section~\ref{sec:star}).
\paragraph{Additional conditions.}
Specifically, assume $|Real(N_{\labeledsubtree{\ensuremath{S}_{i_j}}{}}[c_{i_j}])| \geq 3$ and $|N_{\labeledsubtree{\ensuremath{S}_{i_j}}{}}[c_{i_j}] \cap \ensuremath{S}_{i_k}| \leq 2$ for any other child $\ensuremath{K}_{i_k}$ of $\ensuremath{K}_i$ (otherwise, no additional constraint is needed).
We consider all the other minimal separators $\ensuremath{S}_{i_k} := \ensuremath{K}_i \cap \ensuremath{K}_{i_k}$ between $\ensuremath{K}_i$ and one of its children nodes such that $\ensuremath{S}_{i_k} \subseteq N_{\labeledsubtree{\ensuremath{S}_{i_j}}{}}[c_{i_j}]$.
In particular, $|\ensuremath{S}_{i_k}| \leq 2$.
There are two possibilities:
\begin{itemize}
\item If $\ensuremath{S}_{i_k} = \{v_{i_k}\}$ then, by Claim~\ref{claim:cut-vertex} there is only one solution left in ${\cal T}_{i_k}$.
Specifically, this solution $\labeledsubtree{i_k}{} \in {\cal T}_{i_k}$ maximizes $d_{i_k} := d_{\labeledsubtree{i_k}{}}(v_{i_k})$.
We are left ensuring $d_{\labeledsubtree{i_j}{}}(v_{i_k}) > 4 - d_{i_k}$.
\item Otherwise, $\ensuremath{S}_{i_k} = \{u_{i_k},v_{i_k}\}$.
We have $\ensuremath{S}_{i_k} \neq Real(N_{\labeledsubtree{i_j}{}}[c_{i_j}])$.
Then, the tree $\labeledsubtree{\ensuremath{S}_{i_j}}{\ensuremath{S}_{i_k}}$ must be an edge and we may assume w.l.o.g. $c_{i_j} = u_{i_k}$.
We are left to ensure that $d_{\labeledsubtree{i_j}{}}(v_{i_k}) \geq 2$.
\end{itemize}
\begin{myclaim}\label{claim:bistar-3}
For any $\labeledsubtree{i_j}{}$ that satisfies all of the above distances' conditions, one of the following properties is true:
\begin{enumerate}
\item Either $\labeledsubtree{i_j}{}$ can be extended to a $4$-Steiner root of $G$;
\item Or for any $4$-Steiner root $\labeledsubtree[2]{i_j}{}$ of $G_{i_j}$ with the same short encoding as $\labeledsubtree{i_j}{}$, we cannot extend $\labeledsubtree[2]{i_j}{}$ to a {\em well-structured} $4$-Steiner root of $G$.
\end{enumerate}
\end{myclaim}
\begin{proofclaim}
Assume there is a $\labeledsubtree[2]{i_j}{}$ as stated in the claim that can be extended to a well-structured $4$-Steiner root $\tree[2]$ of $G$.
In order to prove the claim, it suffices to prove that $\tree := \unlabeledsubtree[2]{V \setminus W_{i_j}} \odot \labeledsubtree{i_j}{}$ (or a slight modification of it) is also a $4$-Steiner root of $G$.
Equivalently, we are left proving that $dist_{\tree}(V \setminus V_{i_j},W_{i_j}) > 4$.
By Theorem~\ref{thm:x-free}, we have $dist_{\tree}(v,W_{i_j}) = 2 + dist_{\labeledsubtree{i_j}{}}(c_{i},W_{i_j})$ and in the same way $dist_{\tree[2]}(v,W_{i_j}) = 2 + dist_{\labeledsubtree[2]{i_j}{}}(c_{i},W_{i_j})$ for any simplicial vertex $v \in \ensuremath{K}_i$.
In particular:
$$dist_{\tree}(v,W_{i_j}) = dist_{\tree[2]}(v,W_{i_j}) > 4. $$
So, we are left to consider the other minimal separators $\ensuremath{S}_{i_k} := \ensuremath{K}_i \cap \ensuremath{K}_{i_k}$ between $\ensuremath{K}_i$ and any other node (including its father node $\ensuremath{K}_{p(i)}$).
Note that $\ensuremath{S}_{i_k}$ cannot both intersect $N_{\tree}(c_{i_j})$ and $N_{\tree}(c_{i})$ (otherwise, $\ensuremath{S}_{i_k} = \ensuremath{S}_{i_j}$, thereby contradicting Lemma~\ref{lem:bistar-center}).
Moreover by Claim~\ref{claim:bistar-1}, any real node in $N_{\tree}(c_i) \setminus \{c_{i_j}\}$ is simplicial in $G_{i_j}$.
Let us first assume $\ensuremath{S}_{i_k} \cap \ensuremath{S}_{i_j} \subseteq N_{\tree}[c_i]$.
If $i_k \neq i$ then, we have in this situation:
\begin{align*}
dist_{\tree}(W_{i_j},W_{i_k}) = \min\{ &dist_{\tree}(W_{i_k},c_{i}) + dist_{\labeledsubtree{i_j}{}}(c_{i},W_{i_j}), \\
&dist_{\tree}(W_{i_k},c_{i_j}) + dist_{\labeledsubtree{i_j}{}}(c_{i_j},W_{i_j})\},
\end{align*}
and in the same way:
\begin{align*}
dist_{\tree[2]}(W_{i_j},W_{i_k}) = \min\{ &dist_{\tree[2]}(W_{i_k},c_{i}) + dist_{\labeledsubtree[2]{i_j}{}}(c_{i},W_{i_j}), \\
&dist_{\tree[2]}(W_{i_k},c_{i_j}) + dist_{\labeledsubtree[2]{i_j}{}}(c_{i_j},W_{i_j})\}.
\end{align*}
In particular:
$$dist_{\tree}(W_{i_j},W_{i_k}) = dist_{\tree[2]}(W_{i_j},W_{i_k}) > 4. $$
Otherwise, $i_k = i$, and we also obtain that:
$$dist_{\tree}(W_{i_j},V \setminus V_i) = dist_{\tree[2]}(W_{i_j},V \setminus V_{i}) > 4. $$
As a result, we are only interested in the situation $\ensuremath{S}_{i_k} \cap N_{\tree}(c_{i_j}) \neq \emptyset$ -- that implies $\ensuremath{S}_{i_k} \subseteq N_{\tree}[c_{i_j}]$.
We further assume $|\ensuremath{S}_{i_k}| \leq 2$ since otherwise, we are done by Case 1 of Claim~\ref{claim:bistar-2} and the fact that $\labeledsubtree{i_j}{},\labeledsubtree[2]{i_j}{}$ have the same short encoding.
Then, there are two cases ({\it i.e.}, exactly the same as for the star case):
\begin{itemize}
\item Assume $\ensuremath{S}_{i_k} = \{v_{i_k}\}$.
If $i_k=i$ then, the distance between $v_{i_k}$ and $W_{i_j}$ is part of our short encoding, and so we are done.
Otherwise, as explained above (Section~\ref{sec:small}), we only kept in ${\cal T}_{i_k}$ a partial solution $\labeledsubtree{i_k}{}$ maximizing $d_{i_k} := d_{\labeledsubtree{i_k}{}}(v_{i_k})$. In this situation, it follows from the distances' conditions over $\labeledsubtree{i_j}{}$ that we have $dist_{\tree}(W_{i_k},W_{i_j}) > 4$.
\item Otherwise, $\ensuremath{S}_{i_k} = \{u_{i_k},v_{i_k}\}$.
Recall that $\ensuremath{S}_{i_k} \subset \ensuremath{S}_{i_j}$.
We may further assume $|Real(N_{\tree}[c_{i_j}])| \geq 3$ and $\ensuremath{S}_i \neq \ensuremath{S}_{i_k}$ (otherwise, the encoding already includes the distance to $W_{i_j}$ from any node in $\unlabeledsubtree{\ensuremath{S}_{i_k}}$, and so we are done).
Thus, $\unlabeledsubtree{\ensuremath{S}_{i_k}}$ must be an edge and we may assume w.l.o.g. $c_{i_j} = u_{i_k}$.
Since we assume $|Real(N_{\tree}[c_{i_j}])| \geq 3$, $c_{i_j}$ is adjacent to some other real node than $v_{i_k}$.
In other words, $dist_{\tree}(c_{i_j},V \setminus W_{i_k}) = 1$ is minimized.
Then, since we have $dist_{\tree[2]}(W_{i_k},W_{i_j}) > 4$ we must have $dist_{\tree[2]}(c_{i_j},W_{i_k}) = 4$ and so, $dist_{\tree[2]}(v_{i_k},W_{i_k}) = 3$.
It follows from Claim~\ref{claim:edge} and the distances' conditions over $\labeledsubtree{i_j}{}$ that we can always assume $dist_{\tree}(W_{i_k},W_{i_j}) > 4$.
\end{itemize}
\end{proofclaim}
Finally, an encoding for bistars is transformed into distances' constraints as follows:
\begin{itemize}
\item If $d_{\labeledsubtree{i_j}{}}(r)$ is included in the short encoding then, $d_r := d_{\labeledsubtree{i_j}{}}(r)$. In particular, this will be the case for $c_i,c_{i_j}$.
\item If $v_{i_k} \in \ensuremath{S}_{i_k} \cap \ensuremath{S}_{i_j}$ needs to satisfy some specified distance-condition then, $d_{v_{i_k}}$ is set to the largest such a condition.
\item For all other vertices $v \in \ensuremath{S}_{i_j}$, $d_v = 1$ (trivial constraint).
\end{itemize}
For any fixed bistar $\labeledsubtree{\ensuremath{S}_{i_j}}{}$ the mapping from the encodings to the distances' constraints is bijective.
Indeed, in order to prove it is the case, the only difficulty is to prove that we can correctly identify from the constraints the nodes $c_i,c_{i_j}$.
Since we will always impose $d_{c_{i_j}} \leq 2$ whereas $d_{c_i} \geq 3$, this is always possible.
\section{Step~\ref{step-4}: The dynamic programming}\label{sec:greedy}
In what follows, let $||G|| := \sum_{\ensuremath{K}_i \in \MAXK{G}} |\ensuremath{K}_i|$.
For a chordal graph, $||G|| = {\cal O}(n+m)$~\cite{BlP93}.
We can now state the core result of this paper:
\begin{theorem}\label{thm:dyn-prog}
Let $G=(V,E)$ be strongly chordal, let $\cliquetree{G}$ be a rooted clique-tree as in Theorem~\ref{thm:final-clique-tree} and let $\ensuremath{K}_i \in \MAXK{G}$.
There is some polynomial $P$ such that, after a pre-processing in time ${\cal O}(n || G_i ||^5 P(n))$, we can solve {\sc Distance-Constrained Root} for any input $\labeledsubtree{\ensuremath{S}_i}{},(d_r)_{r \in V(\labeledsubtree{\ensuremath{S}_i}{})}$ in time ${\cal O}(P(n))$.
\end{theorem}
Theorem~\ref{thm:dyn-prog} proves Theorem~\ref{thm:main-steiner-power} directly.
Note that we made no effort in order to improve the running time in our analysis.
A very rough analysis shows that we have $P(n) = {\cal O}(n^{15})$.
\begin{proofof}{Theorem~\ref{thm:dyn-prog}}
If $\ensuremath{K}_i$ is a leaf of $\cliquetree{G}$ then, we construct the family given by Theorem~\ref{thm:leaf}.
We only keep the trees $\labeledsubtree{i}{} \in {\cal T}_i$ that satisfy the additional constraints we have.
Thus from now on, assume $\ensuremath{K}_i$ is an internal node with children $\ensuremath{K}_{i_1},\ensuremath{K}_{i_2},\ldots,\ensuremath{K}_{i_p}$.
\medskip
\noindent
{\bf Preprocessing.}
Let ${\cal T}_{i_1}, {\cal T}_{i_2}, \ldots, {\cal T}_{i_p}$ be as in Theorem~\ref{thm:encoding}.
By induction on $\cliquetree{G}$, the computation of all the ${\cal T}_{i_j}$'s requires total preprocessing time $\sum_{j=1}^p {\cal O}(n||G_{i_j}||^{5}P(n))$, and $\sum_{j=1}^p{\cal O}(|\ensuremath{S}_{i_j}|^5 P(n))$ additional time.
We also need to construct the family ${\cal F}_i$ of Proposition~\ref{prop:internal}, that takes ${\cal O}(|\ensuremath{K}_i|^7 \cdot n^3m\log{n})$-time.
-- Recall that the elements in ${\cal F}_i$ are of the form $(\labeledsubtree{Y_i}{},{\cal C}_i)$ where $Y_i \subseteq \ensuremath{K}_i$ and ${\cal C}_i$ must represent the center of $\unlabeledsubtree{\ensuremath{K}_i}$ (missing vertices of $\ensuremath{K}_i \setminus Y_i$ are supposed to be located in thin branches, see Lemma~\ref{lem:thin:branch}). --
Overall, if we assume w.l.o.g. that $P(n) = \Omega(n^4m\log{n})$ then, this pre-processing phase takes total time:
\begin{align*}
&\sum_{j=1}^p {\cal O}(n||G_{i_j}||^{5}P(n)) + \sum_{j=1}^p{\cal O}(|\ensuremath{S}_{i_j}|^5 P(n)) + {\cal O}(|\ensuremath{K}_i|^7 \cdot n^3m\log{n}) \\
=& \ {\cal O}(nP(n) \cdot \sum_{j=1}^p ||G_{i_j}||^{5}) + {\cal O}(p|\ensuremath{K}_i|^5P(n)) + {\cal O}(n|\ensuremath{K}_i|^5P(n)) \\
=& \ {\cal O}(nP(n) \cdot ( ||G_i||^5 - |\ensuremath{K}_i|^5 )) + {\cal O}(n|\ensuremath{K}_i|^5P(n)) \\
=& \ {\cal O}(nP(n)||G_i||^5).
\end{align*}
\medskip
\noindent
{\bf Answering a query.}
In what follows let $\labeledsubtree{\ensuremath{S}_i}{}$ and $(d_r)_{r \in \labeledsubtree{\ensuremath{S}_i}{}}$ be fixed.
Recall that for every $(\labeledsubtree{Y_i}{},{\cal C}_i) \in {\cal F}_i$ we have $\ensuremath{S}_i \subseteq Y_i$, and so, we can check whether $\labeledsubtree{\ensuremath{S}_i}{} \equiv_G \labeledsubtree{Y_i}{\ensuremath{S}_i}$.
This takes total time ${\cal O}(|\ensuremath{S}_i||{\cal F}_i|) = {\cal O}(n|\ensuremath{K}_i|^9)$.
Then, we consider each $(\labeledsubtree{Y_i}{},{\cal C}_i) \in {\cal F}_i$ that passes this first test above sequentially.
Simply put, we use a series of filtering rules in order to greedily find a solution to {\sc Distance-Constrained Root}, or to correctly conclude that there is none.
\medskip
\underline{Assume first $Y_i = \ensuremath{K}_i$ (no thin branch).}
For every $r \in \labeledsubtree{\ensuremath{S}_i}{}$ we check whether we have: $$dist_{\labeledsubtree{Y_i}{}}(r, \ensuremath{K}_i \setminus \ensuremath{S}_i) \geq d_r$$ (otherwise, we violate our distances' constraints).
We will assume from now on it is the case.
In the same way, for every $r_{i_j} \in \labeledsubtree{Y_i}{\ensuremath{S}_{i_j}}, \ j \in \{1,2,\ldots,p\}$, we only keep in ${\cal T}_{i_j}$ those solutions $\labeledsubtree{i_j}{}$ such that we have: $$dist_{\labeledsubtree{Y_i}{}}(r,r_{i_j}) + d_{\labeledsubtree{i_j}{}}(r_{i_j}) \geq d_r.$$
Overall, since $|{\cal T}_{i_j}| = {\cal O}(|\ensuremath{S}_{i_j}|^5) = {\cal O}(|\ensuremath{K}_i|^5)$, this new verification phase takes total time ${\cal O}(p|\ensuremath{S}_i||\ensuremath{K}_i|^5) = {\cal O}(n|\ensuremath{K}_i|^6)$.
Furthermore in doing so, we ensure that {\em any} $4$-Steiner root of $G_i$ that we can obtain from $\labeledsubtree{Y_i}{}$ and the remaining solutions in the ${\cal T}_{i_j}$'s will satisfy all our distances' constraints.
Conversely, if no such a solution can be found then, we can correctly report that our distances' constraints cannot be satisfied in any well-structured $4$-Steiner root of $G$ (by Theorem~\ref{thm:encoding}).
\smallskip
We now introduce another filtering rule, quite similar as the one above, that we will keep using throughout the remaining of the proof.
Specifically, for every $j \in \{1,2,\ldots,p\}$ and $r_{i_j} \in \labeledsubtree{Y_i}{\ensuremath{S}_{i_j}}$, we assign some value $\ell^{i_j}(r_{i_j})$ that intuitively represents the distance of $r_{i_j}$ to $V_i \setminus V_{i_j}$.
Every time the rule is applied, we discard all solutions $\labeledsubtree{i_j}{} \in {\cal T}_{i_j}$ such that $d_{\labeledsubtree{i_j}{}}(r_{i_j}) + \ell^{i_j}(r_{i_j}) \leq 4$.
We set initially $\ell^{i_j}(r_{i_j}) := dist_{\labeledsubtree{Y_i}{}}(r_{i_j}, \ensuremath{K}_i \setminus \ensuremath{S}_{i_j})$ and we apply the rule.
Overall, updating (initializing, resp.) the values $\ell^{i_j}$ for every $j$ takes time $\sum_{j=1}^p {\cal O}(|\ensuremath{S}_{i_j}|) = {\cal O}(n|\ensuremath{K}_i|)$.
Applying the rule takes time $\sum_{j=1}^p {\cal O}(|\ensuremath{S}_{i_j}||{\cal T}_{i_j}|) = \sum_{j=1}^p {\cal O}(|\ensuremath{S}_{i_j}|^6) = {\cal O}(n|\ensuremath{K}_i|^6)$.
In what follows, we explain how to greedily construct a solution (if any), starting from $\labeledsubtree{i}{} := \labeledsubtree{Y_i}{}$.
The procedure is divided into a constant number of phases. Every time we complete one of these phases, we need to apply this above filtering rule.
\begin{itemize}
\item{\it Phase 1: Processing the cut-vertices.}
We consider all the indices $j \in \{1,2,\ldots,p\}$ such that $\ensuremath{S}_{i_j} = \{v\}$ is a cut-vertex.
By Claim~\ref{claim:cut-vertex} there is exactly one solution left in ${\cal T}_{i_j}$.
We add it to the solution, {\it i.e.}, we set $\labeledsubtree{i}{} := \labeledsubtree{i}{} \odot \labeledsubtree{i_j}{}$.
Furthermore, for every $k \in \{1,2,\ldots,p\} \setminus \{j\}$ and $r_{i_k} \in \labeledsubtree{Y_i}{\ensuremath{S}_{i_k}}$ (possibly, $r_{i_k} = v$) we set $\ell^{i_k}(r_{i_k}) := \min\{ \ell^{i_k}(r_{i_k}), \ dist_{\labeledsubtree{Y_i}{}}(r_{i_k},v) + d_{\labeledsubtree{i_j}{}}(v) \}$.
We end up applying the filtering rule above. \\
\item{\it Phase 2: Processing the edges.}
We consider all the indices $j \in \{1,2,\ldots,p\}$ such that $\ensuremath{S}_{i_j} = \{u,v\}$ and $\labeledsubtree{Y_i}{\ensuremath{S}_{i_j}}$ is an edge.
The following claim shows that we can proceed similarly as for Phase 1 provided we know which among $u$ or $v$ will be closest to $V_i \setminus V_{i_j}$.
Therefore, computing this information is the main objective of this phase.
\begin{myclaim}\label{claim:edge-old}
Assume $\ensuremath{S}_{i_j} = \{u,v\}$.
Let $\tree$ be a $4$-Steiner root of $G$ such that $\unlabeledsubtree{\ensuremath{S}_{i_j}}$ is an edge and $dist_{\tree}(u, V \setminus V_{i_j}) \geq dist_{\tree}(v, V \setminus V_{i_j})$.
Then, $\tree[2] := \unlabeledsubtree{V \setminus W_{i_j}} \odot \labeledsubtree[v]{i_j}{}$ is also a $4$-Steiner root of $G$, where $\labeledsubtree[v]{i_j}{} \in {\cal T}_{i_j}$ is, among all solutions in this set such that $\labeledsubtree[v]{i_j}{\ensuremath{S}_{i_j}}$ is an edge and $d_{\labeledsubtree[v]{i_j}{}}(v)$ is maximized, one maximizing $d_{\labeledsubtree[v]{i_j}{}}(u)$.
\end{myclaim}
\begin{proofclaim}
By maximality of $d_{\labeledsubtree[v]{i_j}{}}(v)$ the resulting $\tree[2]$ would not be a $4$-Steiner root of $G$ only if $dist_{\tree}(u, V \setminus V_{i_j}) + d_{\labeledsubtree[v]{i_j}{}}(u) \leq 4$.
But then, since $d_{\labeledsubtree[v]{i_j}{}}(v) - d_{\labeledsubtree[v]{i_j}{}}(u) \leq 1$ (because $\unlabeledsubtree{\ensuremath{S}_{i_j}}$ is an edge), one would obtain $dist_{\tree}(u,V \setminus V_{i_j}) = dist_{\tree}(v,V \setminus V_{i_j})$ and $dist_{\tree}(v,V \setminus V_{i_j}) + d_{\labeledsubtree[v]{i_j}{}}(v) = 5$.
In particular, we should have in the original Steiner root $\tree$: $$\min\{ dist_{\tree}(u,W_{i_j}), dist_{\tree}(v,W_{i_j})\} \geq d_{\labeledsubtree[v]{i_j}{}}(v).$$
As $\labeledsubtree[v]{i_j}{}$ maximizes $d_{\labeledsubtree[v]{i_j}{}}(v)$ and, under this latter condition, $d_{\labeledsubtree[v]{i_j}{}}(u)$ is maximized, we obtain that $d_{\labeledsubtree[v]{i_j}{}}(u) \geq dist_{\tree}(u,W_{i_j}) \geq d_{\labeledsubtree[v]{i_j}{}}(v)$.
\end{proofclaim}
By Claim~\ref{claim:edge-old} we are left to decide which amongst $u$ or $v$ will minimize its distance to $V_i \setminus V_{i_j}$ in the final solution.
If either $u$ or $v$ has a real neighbour in $\labeledsubtree{i}{} \setminus \ensuremath{S}_{i_j}$ then, we are done.
Thus from now on we assume this is not the case.
There may be several other indices $k$ such that $\ensuremath{S}_{i_k} = \ensuremath{S}_{i_j}$.
As an intermediate step, we explain how to merge the solutions in ${\cal T}_{i_j}$ and in ${\cal T}_{i_k}$ into a new set ${\cal T}_{i_j}'$ when this happens.
For that, we consider all the $\labeledsubtree{i_j}{},\labeledsubtree{i_k}{}$ sequentially.
We put $\labeledsubtree{i_j}{} \odot \labeledsubtree{i_k}{}$ into ${\cal T}_{i_j}'$ if and only if we have $\min\{ d_{\labeledsubtree{i_j}{}}(v) + d_{\labeledsubtree{i_k}{}}(v), d_{\labeledsubtree{i_j}{}}(u) + d_{\labeledsubtree{i_k}{}}(u) \} > 4$.
If so then, $d_{\labeledsubtree{i_j}{} \odot \labeledsubtree{i_k}{}}(u) = \min\{d_{\labeledsubtree{i_j}{}}(u), d_{\labeledsubtree{i_k}{}}(u)\}$, and in the same way $d_{\labeledsubtree{i_j}{} \odot \labeledsubtree{i_k}{}}(v) = \min\{d_{\labeledsubtree{i_j}{}}(v), d_{\labeledsubtree{i_k}{}}(v)\}$.
Overall, since there are at most two solutions stored in each of ${\cal T}_{i_j}$ and ${\cal T}_{i_k}$, this takes constant-time.
We end up applying Claim~\ref{claim:edge} in order to replace ${\cal T}_{i_j}$ by the at most two best solutions in ${\cal T}_{i_j}'$.
By repeating this above procedure, we can assume w.l.o.g. that there is no other index $k$ such that $\ensuremath{S}_{i_k} = \ensuremath{S}_{i_j}$.
We may further assume that there is no index $k$ such that $\ensuremath{S}_{i_k} = \{u\}$ ($\ensuremath{S}_{i_k} = \{v\}$, resp.) for otherwise we already ensured at the last step $d_{\labeledsubtree{i_k}{}}(u) = 4$ ($d_{\labeledsubtree{i_k}{}}(v) = 4$, resp.).
Then, let us assume $dist_{\labeledsubtree{i}{}}(u, {\cal C}_i) \leq dist_{\labeledsubtree{i}{}}(v, {\cal C}_i)$ ($u$ is closer than $v$ to the center of $\labeledsubtree{Y_i}{}$).
In most cases, $u$ will be the closest to $V_i \setminus V_{i_j}$.
Indeed, as we assume $v$ has no real neighbour in $\labeledsubtree{i}{} \setminus \ensuremath{S}_{i_j}$, it is a leaf in $\labeledsubtree{Y_i}{}$.
Therefore, a necessary condition for having $v$ closer than $u$ to $V_i \setminus V_{i_j}$ is that there exists another minimal separator $\ensuremath{S}_{i_k}$ containing $v$.
Let us assume from now on that such a separator $\ensuremath{S}_{i_k}$ exists (otherwise we are done).
Since $v$ is a leaf, this implies $\ensuremath{S}_{i_j} \subset \ensuremath{S}_{i_k}$.
In particular, as we also assume $u$ and $v$ have no real neighbour in $\labeledsubtree{i}{} \setminus \ensuremath{S}_{i_j}$, $\labeledsubtree{Y_i}{\ensuremath{S}_{i_k}}$ must be a bistar.
We divide our analysis in several subcases:
\begin{itemize}
\item Subcase $\ensuremath{S}_{i_j} = \centre{\labeledsubtree{Y_i}{\ensuremath{S}_{i_k}}}$.
Both $u$ and $v$ should have a real neighbour in $\labeledsubtree{i}{} \setminus \ensuremath{S}_{i_j}$.
A contradiction.
\item Subcase ${\cal C}_i = \{u\}$. By Claim~\ref{claim:bistar-1}, $v$ is simplicial in $G_{i_k}$. This proves $u$ will be closest than $v$ to $V_i \setminus V_{i_j}$ in this subcase.
\item Otherwise, as $u$ minimizes its distance to the center we must have $\centre{\labeledsubtree{i_k}{\ensuremath{K}_{i_k} }} = \{u\}$ (this can only be true for at most one index $i_k$).
Note that $v$ is the only leaf of $\labeledsubtree{Y_i}{\ensuremath{S}_{i_k}}$ that is adjacent to $u$.
Therefore, by Lemma~\ref{lem:bistar-center}, $v$ is the only real neighbour of $u$ in any $\labeledsubtree{i_k}{} \in {\cal T}_{i_k}$ {\em and} $v$ must stay the only real neighbour of $u$ in $\labeledsubtree{i}{}$.
This implies that we always have $d_{\labeledsubtree{i_k}{}}(u) = 2$.
We must ensure that the solution $\labeledsubtree{i_j}{} \in {\cal T}_{i_j}$ that we will choose satisfies $d_{\labeledsubtree{i_j}{}}(u) \geq 3$.
Conversely, among all the partial solutions in ${\cal T}_{i_j}$ that satisfies this necessary condition, we can always choose the one $\labeledsubtree{i_j}{}$ maximizing $d_{\labeledsubtree{i_j}{}}(v)$.
\end{itemize}
\item{\it Phase 3: Processing the bistars.}
We consider all the indices $j \in \{1,2,\ldots,p\}$ such that $\labeledsubtree{Y_i}{\ensuremath{S}_{i_j}}$ is a bistar.
Let ${\cal C}_i = \{c_i\}$ and let $\centre{\labeledsubtree{Y_i}{\ensuremath{S}_{i_j}}} = \{c_i,c_{i_j}\}$.
We keep only the solutions $\labeledsubtree{i_j}{} \in {\cal T}_{i_j}$ such that $\centre{\labeledsubtree{i_j}{\ensuremath{K}_{i_j}}} = \{c_{i_j}\}$.
Then, we have by Claim~\ref{claim:bistar-1} $d_{\labeledsubtree{i_j}{}}(v) = d_{\labeledsubtree{i_j}{}}(c_i) + 1$ for any $v \in N_{\labeledsubtree{i}{}}(c_i) \setminus \{c_{i_j}\}$.
So, we would like to pick $\labeledsubtree{i_j}{} \in {\cal T}_{i_j}$ that maximizes $d_{\labeledsubtree{i_j}{}}(c_i)$.
We prove next that except for one case easy to solve, we can always choose greedily an {\em arbitrary} partial solution $\labeledsubtree{i_j}{}$ which maximizes $d_{\labeledsubtree{i_j}{}}(c_i)$.
Indeed, the only case where we cannot do that w.l.o.g. is when there exists another minimal separator $\ensuremath{S}_{i_k}$ such that $\labeledsubtree{Y_i}{\ensuremath{S}_{i_k}} \cap N_{\labeledsubtree{Y_i}{}}[c_{i_j}] \setminus \{c_i\} \neq \emptyset$.
In fact, as by Lemma~\ref{lem:bistar-center} we will always have $d_{\labeledsubtree{i_j}{}}(c_{i_j}) = 2$ (for any choice for $\labeledsubtree{i_j}{}$), we are only interested in the case when $\ensuremath{S}_{i_k} \cap \left( N_{\labeledsubtree{i}{}}(c_{i_j}) \setminus \{c_i\} \right) \neq \emptyset$.
Then, $\ensuremath{S}_{i_k} \subseteq N_{\labeledsubtree{i}{}}[c_{i_j}]$.
We may further assume $diam(\labeledsubtree{Y_i}{\ensuremath{S}_{i_k}}) \geq 2$ (otherwise, due to Phases 1 and 2, this was already taken into account).
There are two cases:
\begin{itemize}
\item Assume $|\ensuremath{S}_{i_k}| \geq 3$.
By Claim~\ref{claim:bistar-2} and its proof, this implies that there is only one possibility for $d_{\labeledsubtree{i_j}{}}(r)$, for every $r \in \labeledsubtree{Y_i}{\ensuremath{S}_{i_j}}$.
Specifically (Case 1 of the claim), $d_{\labeledsubtree{i_j}{}}(c_{i_j}) = 2$, and for every $u \in N_{\labeledsubtree{Y_i}{\ensuremath{S}_{i_j}}}(c_{i_j})$ either $d_{\labeledsubtree{i_j}{}}(u) = 3$ or (if and only if $u$ belongs to a minimal separator of $G_{i_j}$) $d_{\labeledsubtree{i_j}{}}(u) = 1$.
So, in this situation, there is only one solution stored in ${\cal T}_{i_j}$, and we need to pick this one.
\item Otherwise, $|\ensuremath{S}_{i_k}| = 2$. Then, we impose different properties on the partial solution $\labeledsubtree{i_j}{}$ to choose. Specifically, we will show that we can always choose greedily any solution $\labeledsubtree{i_j}{}$ which maximizes $\sum_{r \in N_{\labeledsubtree{i}{}}[c_{i_j}]} d_{\labeledsubtree{i_j}{}}(r)$.
For that, we start deriving some necessary conditions on the valid partial solutions $\labeledsubtree{i_k}{}$ which we may choose later during the algorithm.
\smallskip
We recall that $diam(\labeledsubtree{Y_i}{\ensuremath{S}_{i_k}}) \geq 2$, and so $\labeledsubtree{Y_i}{\ensuremath{S}_{i_k}}$ is a non-edge star with central node $c_{i_j}$.
By Prop.~\ref{pty-ci:2} of Theorem~\ref{thm:clique-intersection}, it implies that $c_{i_j}$ is Steiner and $Real(N_{\labeledsubtree{i}{}}[c_{i_j}]) = \ensuremath{S}_{i_k}$.
Furthermore, by Lemma~\ref{lem:star-center}, $\ensuremath{S}_{i_k}$ is weakly $\cliquetree{G}$-convergent.
Since $\ensuremath{S}_{i_k} \supset \ensuremath{S}_{i_j}$, this implies that no minimal separator of $G_{i_k}$ can strictly contain $\ensuremath{S}_{i_k}$.
By Prop.~\ref{pty-fct:2} of Theorem~\ref{thm:final-clique-tree}, we so obtain the stronger property that no minimal separator of $G_{i_k}$ can contain $\ensuremath{S}_{i_k}$ ({\it i.e.}, we fall in the situation described in Sec.~\ref{sec:star-uncontained}).
By Lemma~\ref{lem:no-center-intersect}, we must also impose $c_{i_j} \notin \centre{\labeledsubtree{i_k}{\ensuremath{K}_{i_k}}}$.
Therefore by Lemma~\ref{lem:center-in-star}, there must exist a node $c_{i_k} \in N_{\labeledsubtree{i_k}{}}(c_{i_j}) \cap \centre{\labeledsubtree{i_k}{\ensuremath{K}_{i_k}}}$ (possibly, $c_{i_k} \in \ensuremath{S}_{i_k}$).
Altogether combined, we fall in Case 1 of Claim~\ref{claim:star-1}, namely: $d_{\labeledsubtree{i_k}{}}(c_{i_j}) = d_{\labeledsubtree{i_k}{}}(c_{i_k}) + 1$; and for every $v \in \ensuremath{S}_{i_k} \setminus \{c_{i_k}\}$, $d_{\labeledsubtree{i_k}{}}(v) = d_{\labeledsubtree{i_k}{}}(c_{i_k}) + 2$.
In particular, we must have $d_{\labeledsubtree{i_k}{}}(c_{i_k}) = 2$ (otherwise, we would get $d_{\labeledsubtree{i_k}{}}(c_{i_j}) + d_{\labeledsubtree{i_j}{}}(c_{i_j}) = 4$, regardless of our exact choice for $\labeledsubtree{i_j}{}$).
Then, $d_{\labeledsubtree{i_k}{}}(c_{i_j}) = 3$, and for every $v \in \ensuremath{S}_{i_k} \setminus \{c_{i_k}\}$, $d_{\labeledsubtree{i_k}{}}(v) = 4$.
\smallskip
If we knew $c_{i_k}$ in advance then, we could choose any partial solution $\labeledsubtree{i_j}{}$ such that $d_{\labeledsubtree{i_j}{}}(c_{i_k}) \geq 3$.
Since we do not have this information, we prove the existence of a partial solution $\labeledsubtree{i_j}{}$ such that, for any $v \in \ensuremath{S}_{i_k}$, we have $d_{\labeledsubtree{i_j}{}}(v) < 3$ {\em if and only if} $d_{\labeledsubtree[2]{i_j}{}}(v) < 3$ for any partial solution $\labeledsubtree[2]{i_j}{}$.
Specifically, we prove that any $\labeledsubtree{i_j}{}$ which maximizes $\sum_{r \in N_{\labeledsubtree{i}{}}[c_{i_j}]} d_{\labeledsubtree{i_j}{}}(r)$ has this property.
For that, let us fix such a solution $\labeledsubtree{i_j}{}$ and let $v \in \ensuremath{S}_{i_k}$ be such that $d_{\labeledsubtree{i_j}{}}(v) < 3$ (if any).
Then, there must be a minimal separator $\ensuremath{S} \subset \ensuremath{K}_{i_j}$ such that $v \in \ensuremath{S}$.
Note that we cannot have $\ensuremath{S} \subseteq \ensuremath{S}_{i_j}$ (otherwise, by Prop.~\ref{pty-fct:2} of Theorem~\ref{thm:final-clique-tree} we have $|\ensuremath{S}| \geq 3$, but then we also have $\ensuremath{S} \subseteq Real(N_{\labeledsubtree{i}{}}[c_{i_j}]) = \ensuremath{S}_{i_k}$ and $|\ensuremath{S}_{i_k}| = 2$, a contradiction).
So, there are only two possibilities:
\begin{itemize}
\item
If $\ensuremath{S}_{i_k} \not\subseteq \ensuremath{S}$ then, in any $\labeledsubtree[2]{i_j}{}$, the only possibility for $\labeledsubtree{i_j}{\ensuremath{S}}$ is to be a star of which $v$ is a central node (possibly, $\labeledsubtree{i_j}{\ensuremath{S}}$ is an edge).
In particular, we have that $d_{\labeledsubtree[2]{i_j}{}}(v) \leq dist_{\labeledsubtree[2]{i_j}{}}(v, \ensuremath{S} \setminus \ensuremath{S}_{i_j}) = 1 < 3$.
\item
Otherwise, $\ensuremath{S}_{i_k} \subseteq \ensuremath{S}$.
Since $\ensuremath{S} \not\subseteq \ensuremath{S}_{i_j}$ we have in fact $\ensuremath{S}_{i_k} \subset \ensuremath{S}$, and so, in any $\labeledsubtree[2]{i_j}{}$, we must have $\labeledsubtree[2]{i_j}{\ensuremath{S}}$ is a bistar.
By the hypothesis we have $d_{\labeledsubtree{i_j}{}}(v) < 3$, that is possible only if $\centre{\labeledsubtree{i_j}{\ensuremath{S}}} = \{c_{i_j},v\}$.
Then, by maximality of $\sum_{r \in N_{\labeledsubtree{i}{}}[c_{i_j}]} d_{\labeledsubtree{i_j}{}}(r)$, $v$ must be the vertex outputted by the canonical completion method of Lemma~\ref{lem:real-center-bistar} (applied to $\ensuremath{S}, \ensuremath{K}, R = \ensuremath{S}_{i_k}$ and $c_{i_j}$, where $\ensuremath{S} = \ensuremath{K} \cap \ensuremath{K}_{i_j}$).
Conversely, by the intermediate Claims~\ref{claim:op2-before} and~\ref{claim:op2-before-b} we obtain that in any $\labeledsubtree[2]{i_j}{}$, we also have $\centre{\labeledsubtree[2]{i_j}{\ensuremath{S}}} = \{c_{i_j},v\}$.
As a result, $d_{\labeledsubtree[2]{i_j}{}}(v) < 3$.
\end{itemize}
\end{itemize}
Finally, as in the two previous phases, for every $k \in \{1,2,\ldots,p\} \setminus \{j\}$ and $r_{i_k} \in \labeledsubtree{Y_i}{\ensuremath{S}_{i_k}}$ we update $\ell^{i_k}(r_{i_k})$ and then, we end up applying the filtering rule above. \\
\item{\it Phase 4: Processing the stars.}
We finally consider all the indices $j \in \{1,2,\ldots,p\}$ such that $\labeledsubtree{Y_i}{\ensuremath{S}_{i_j}}$ is a star.
Let $\centre{\labeledsubtree{Y_i}{\ensuremath{S}_{i_j}}} = \{c\}$.
We divide the analysis in two subphases:
\begin{itemize}
\item {\it Subphase 4.a: Processing a star when $c \in {\cal C}_i$.}
As a guidance towards our next choices, we start analyzing the possibilities we still have among ${\cal T}_{i_j}$:
\begin{myclaim}\label{claim:star-4-a}
The following properties are true for any $\labeledsubtree{i_j}{} \in {\cal T}_{i_j}$:
\begin{enumerate}
\item $diam(\labeledsubtree{i_j}{\ensuremath{K}_{i_j}}) = 4$;
\item and the unique center node $v_j \in \centre{\labeledsubtree{i_j}{\ensuremath{K}_{i_j}}}$ is either in $\ensuremath{S}_{i_j} \setminus {\cal C}_i$, or it is a Steiner node.
Moreover:
\begin{enumerate}
\item if $v_j \in \ensuremath{S}_{i_j}$ then, $v_j$ is a leaf of $\labeledsubtree{Y_i}{}$;
\item and for every $r \in \labeledsubtree{Y_i}{\ensuremath{S}_{i_j}}$, $d_{\labeledsubtree{i_j}{}}(r) = dist_{\labeledsubtree{i_j}{}}(r,v_j) + d_{\labeledsubtree{i_j}{}}(v_j)$.
\end{enumerate}
\end{enumerate}
\end{myclaim}
\begin{proofclaim}
We show that assuming any of these above properties does not hold, some distances' constraints would be violated w.r.t. our previous choices in the other Phases, and so, we should have discarded $\labeledsubtree{i_j}{}$ when we applied the filtering rule.
Suppose by contradiction $diam(\labeledsubtree{i_j}{\ensuremath{K}_{i_j}}) < 4$.
Then, the only possibility is $diam(\labeledsubtree{i_j}{\ensuremath{K}_{i_j}}) = 3$, and so, $c \in \centre{\labeledsubtree{i_j}{\ensuremath{K}_{i_j}}}$.
However, the latter would contradict Lemma~\ref{lem:no-center-intersect} as we already assume $c \in {\cal C}_i$.
Therefore, $diam(\labeledsubtree{i_j}{\ensuremath{K}_{i_j}}) = 4$, thereby implying $\centre{\labeledsubtree{i_j}{\ensuremath{K}_{i_j}}} = \{v_j\}$ for some $v_j$.
By Lemma~\ref{lem:center-in-star}, $Real(N_{\labeledsubtree{i_j}{}}[c]) = \ensuremath{S}_{i_j}$ and $c \in N_{\labeledsubtree{i_j}{}}[v_j]$.
Thus, either $v_j$ is Steiner, or $v_j \in \ensuremath{S}_{i_j}$.
Furthermore if $v_j \in \ensuremath{S}_{i_j}$ then, $v_j \in \ensuremath{S}_{i_j} \setminus {\cal C}_i$ (otherwise, this would contradict Lemma~\ref{lem:no-center-intersect}).
As every real node adjacent to $v_j$ in $\labeledsubtree{Y_i}{}$ should be in $\ensuremath{K}_{i_j}$, and we have $\ensuremath{K}_i \cap \ensuremath{K}_{i_j} = \ensuremath{S}_{i_j}$, we so obtain that $v_j \in \ensuremath{S}_{i_j} \Longrightarrow v_j \ \text{is a leaf-node of} \ \labeledsubtree{Y_i}{}$.
Finally, we prove that for every $r \in \labeledsubtree{Y_i}{\ensuremath{S}_{i_j}}$, $d_{\labeledsubtree{i_j}{}}(r) = dist_{\labeledsubtree{i_j}{}}(r,v_j) + d_{\labeledsubtree{i_j}{}}(v_j)$.
Suppose for the sake of contradiction that it is not the case.
We recall that by Lemma~\ref{lem:center-in-star} we have $Real(N_{\labeledsubtree{i_j}{}}[c]) = \ensuremath{S}_{i_j}$. This implies that $ \labeledsubtree{Y_i}{\ensuremath{S}_{i_j}} \setminus \{v_j\}$ is a connected component of $\labeledsubtree{i_j}{\ensuremath{K}_{i_j}} \setminus \{v_j\}$.
In particular, there must exist a minimal separator $\ensuremath{S}$ of $G_{i_j}$ that intersects $ \labeledsubtree{Y_i}{\ensuremath{S}_{i_j}} \setminus \{v_j\}$ (otherwise, the equality $d_{\labeledsubtree{i_j}{}}(r) = dist_{\labeledsubtree{i_j}{}}(r,v_j) + d_{\labeledsubtree{i_j}{}}(v_j)$ would hold for any node $r \in \labeledsubtree{Y_i}{\ensuremath{S}_{i_j}}$).
By Claim~\ref{claim:not-a-container}, $\ensuremath{S} \not\subset \ensuremath{S}_{i_j}$.
So, we are only left with two subcases:
\begin{itemize}
\item Subcase $\ensuremath{S}_{i_j} \subseteq \ensuremath{S}$. By Property~\ref{pty-fct:2} of Theorem~\ref{thm:final-clique-tree} we can assume w.l.o.g. $\ensuremath{S}$ strictly contains $\ensuremath{S}_{i_j}$.
However, this would imply $\labeledsubtree{i_j}{\ensuremath{S}}$ is a bistar, and so, by Lemma~\ref{lem:star-center}, $c$ would also be in $\centre{\labeledsubtree{i_j}{\ensuremath{K}}}$ for some maximal clique $\ensuremath{K}$ in $G_{i_j}$.
A contradiction.
\item Subcase $\ensuremath{S}_{i_j} \not\subseteq \ensuremath{S}$. Then, $\ensuremath{S}_{i_j} \cap \ensuremath{S} \subseteq \{c,v_j\}$.
Note that in particular, all vertices in $\ensuremath{S}_{i_j} \setminus \{c,v_j\}$ are simplicial in $G_{i_j}$.
For the remaining of this subcase we assume $c \in \ensuremath{S}$ (otherwise we are done).
Let $C$ be the connected component of $G_{i_j} \setminus \ensuremath{S}$ containing $\ensuremath{S}_{i_j} \setminus \ensuremath{S}$.
We upper bound the distances in $\labeledsubtree{i_j}{}$ as follows:
\begin{itemize}
\item We prove as a subclaim that all the paths between $C \setminus \ensuremath{S}_{i_j}$ and $\ensuremath{S}_{i_j} \setminus \ensuremath{S}$ of length at most four must go by $v_j$. Indeed, suppose by contradiction this is not the case.
In particular, there exist some vertex $u \in C \setminus \ensuremath{S}_{i_j}$ that is adjacent to a vertex of $\ensuremath{S}_{i_j} \setminus \ensuremath{S}$ in $G$ and a $u\ensuremath{S}_{i_j}$-path that does not go by $v_j$.
Then, as all vertices in $\ensuremath{S}_{i_j} \setminus \ensuremath{S}$ are simplicial in $G_{i_j}$, we must have $u \in \ensuremath{K}_{i_j}$, and the path between $u$ and $\ensuremath{S}_{i_j} \setminus \ensuremath{S}$ goes by $c$.
However, we have $u \in \ensuremath{K}_{i_j} \Longrightarrow dist_{\labeledsubtree{i_j}{}}(u,v_j) \leq 2$.
Since we suppose that the path between $u$ and $\ensuremath{S}_{i_j}$ does not go by $v_j$, we obtain $dist_{\labeledsubtree{i_j}{}}(u,c) = 1$, and so $u \in \ensuremath{S}_{i_j}$. A contradiction.
\item Finally, we must have $dist_{\labeledsubtree{i_j}{}}(c,V_{i_j} \setminus N_{G_{i_j}}[\ensuremath{S}_{i_j} \setminus \ensuremath{S}]) \geq 4$ (otherwise we would get $dist_{\labeledsubtree{i_j}{}}(\ensuremath{S}_{i_j} \setminus \ensuremath{S},V_{i_j} \setminus N_{G_{i_j}}[\ensuremath{S}_{i_j} \setminus \ensuremath{S}]) \leq 4$, a contradiction). We are done in this subcase as we always have $d_{\labeledsubtree{i_j}{}}(c) \leq 1 + d_{\labeledsubtree{i_j}{}}(v_j) \leq 4$.
\end{itemize}
\end{itemize}
Overall, since we reached a contradiction in both subcases, we proved as claimed that for every $r \in \labeledsubtree{Y_i}{\ensuremath{S}_{i_j}}$, $d_{\labeledsubtree{i_j}{}}(r) = dist_{\labeledsubtree{i_j}{}}(r,v_j) + d_{\labeledsubtree{i_j}{}}(v_j)$.
\end{proofclaim}
For any $\labeledsubtree{i_j}{} \in {\cal T}_{i_j}$, let $v_j$ be as defined in Claim~\ref{claim:star-4-a}.
Let $\ensuremath{S}_{i_k} \neq \ensuremath{S}_{i_j}$ be unprocessed (in particular, $\labeledsubtree{Y_i}{\ensuremath{S}_{i_k}}$ is a non-edge star).
Since either $v_j$ is Steiner or $v_j$ is a leaf of $\labeledsubtree{Y_i}{}$, we have $v_j \notin \labeledsubtree{Y_i}{\ensuremath{S}_{i_k}}$.
Furthermore for every $r \in \labeledsubtree{Y_i}{\ensuremath{S}_{i_j}}$, $d_{\labeledsubtree{i_j}{}}(r) = dist_{\labeledsubtree{i_j}{}}(r,v_j) + d_{\labeledsubtree{i_j}{}}(v_j)$.
This implies that w.r.t. $\ensuremath{S}_{i_k}$, any solution $\labeledsubtree{i_j}{}$ that maximizes $d_{\labeledsubtree{i_j}{}}(\centre{\labeledsubtree{i_j}{\ensuremath{K}_{i_j}}})$ would be a best possible choice -- {\it i.e.}, regardless of our exact choice for $v_j$.
However, we also need to account for the other indices $k$ such that $\ensuremath{S}_{i_k} = \ensuremath{S}_{i_j}$.
\begin{figure}[h!]
\centering
\includegraphics[width=.3\textwidth]{Fig/star-matching}
\caption{An illustration of Phase 4.}
\label{fig:star-matching}
\end{figure}
\smallskip
Let $J = \{ j' \mid \ensuremath{S}_{i_{j'}} = \ensuremath{S}_{i_j} \}$.
One should ensure that in the solutions $\labeledsubtree{i_{j'}}{}, j' \in J$ that we will choose, the center nodes $v_{j'}$ in $\labeledsubtree{i_{j'}}{\ensuremath{K}_{i_{j'}}}$ will be pairwise different.
Furthermore, since all the $v_{j'}$'s are pairwise at distance two, there can be at most one $j_{\min} \in J$ such that $d_{\labeledsubtree{i_{j_{\min}}}{}}(v_{j_{\min}}) = 1$.
See Fig.~\ref{fig:star-matching} for an illustration.
In order to satisfy all these constraints, while ensuring that such a $j_{\min}$ does not exist if it is possible, we make a reduction to {\sc Maximum-Weight Matching}~\cite{DPS18}.
\begin{enumerate}
\item Specifically, let $Steiner[J] := \{ \alpha_{j'} \mid j' \in J \}$ be a set of Steiner nodes.
We construct a bipartite graph $Bip(\ensuremath{S}_{i_j})$ with respective sides $J$ and $(\ensuremath{S}_{i_j} \setminus {\cal C}_i) \cup Steiner[J]$.
\item For every $j' \in J$ and $v \in \ensuremath{S}_{i_j} \setminus {\cal C}_i$, there is an edge $j'v$ if there exists a $\labeledsubtree{i_{j'}}{} \in {\cal T}_{i_{j'}}$ such that $\centre{\labeledsubtree{i_{j'}}{\ensuremath{K}_{i_{j'}}}} = \{v\}$. Furthermore if such a $\labeledsubtree{i_{j'}}{}$ exists then, we choose one maximizing $d_{\labeledsubtree{i_{j'}}{}}(v)$ and we assign the weight $d_{\labeledsubtree{i_{j'}}{}}(v)$ to the edge $j'v$ (this can either be $1$ or $2$).
\smallskip
In the same way, there is an edge $j' \alpha_{j'}$ if there exists a $\labeledsubtree{i_{j'}}{} \in {\cal T}_{i_{j'}}$ such that the unique node in $\centre{\labeledsubtree{i_{j'}}{\ensuremath{K}_{i_{j'}}}}$ is Steiner. Furthermore if such a $\labeledsubtree{i_{j'}}{}$ exists then, we choose one maximizing $d_{\labeledsubtree{i_{j'}}{}}(\centre{\labeledsubtree{i_{j'}}{\ensuremath{K}_{i_{j'}}}})$ and we assign the weight $d_{\labeledsubtree{i_{j'}}{}}(\centre{\labeledsubtree{i_{j'}}{\ensuremath{K}_{i_{j'}}}})$ to the edge $j'\alpha_{j'}$.
\item We compute a matching in $Bip(\ensuremath{S}_{i_j})$ of maximum total weight.
This takes ${\cal O}(n^{5/2})$-time~\cite{DPS18}.
By construction, such a matching should contain an edge incident to every $j' \in J$, and its total weight should be either $2|J|-1$ (if $j_{\min}$ exists) or $2|J|$.
\end{enumerate}
For every $j' \in J$, we pick a solution $\labeledsubtree{i_{j'}}{}$ corresponding to the edge incident to $j'$ in the matching.
Then, as in all previous phases, we end up applying our filtering rule above. \\
\item {\it Subphase 4.b: Processing a star when $c \notin {\cal C}_i$.}
This situation can happen only if $diam(\labeledsubtree{Y_i}{}) = 4$.
Then, the unique node $c_i \in {\cal C}_i$ is a neighbour of $c$ in $\labeledsubtree{i}{}$ (by Lemma~\ref{lem:center-in-star}).
We may further assume that, if $Real(N_{\labeledsubtree{i}{}}[c_i])$ is a minimal separator $\ensuremath{S}$ then, we already handled with $\ensuremath{S}$ during the previous subphase.
Similarly, we already handled with any minimal separator strictly contained into $\ensuremath{S}_{i_j}$, strictly containing $\ensuremath{S}_{i_j}$ resp., during the previous phases.
Hence, the unique path in $\labeledsubtree{i}{}$ between $\labeledsubtree{Y_i}{\ensuremath{S}_{i_j}}$ and any other $\labeledsubtree{Y_i}{\ensuremath{S}_{i_k}}$ that we did not process yet goes by $c_i$.
We are left with finding a solution $\labeledsubtree{i_j}{} \in {\cal T}_{i_j}$ maximizing $d_{\labeledsubtree{i_j}{}}(c_i)$.
However, as in the previous subphase we also need to account for the other indices $k$ such that $\ensuremath{S}_{i_k} = \ensuremath{S}_{i_j}$.
\smallskip
Let $J = \{ j' \mid \ensuremath{S}_{i_{j'}} = \ensuremath{S}_{i_j} \}$.
We may assume $|J| \geq 2$ since otherwise, we are done by taking any solution $\labeledsubtree{i_j}{} \in {\cal T}_{i_j}$ that maximizes $d_{\labeledsubtree{i_j}{}}(c_i)$ ({\it i.e.}, as explained above).
If furthermore $|\ensuremath{S}_{i_j}| = 2$ then, we can select the partial solutions $\labeledsubtree{i_{j'}}{}, \ j' \in J$ by using a similar merging process as the one discussed in Phase 2 for the edges.
Thus, let us assume from now on $|\ensuremath{S}_{i_j}| \geq 3$.
Since $\ensuremath{S}_{i_j}$ must be weakly $\cliquetree{G}$-convergent (Lemma~\ref{lem:star-center}), and so, $\cliquetree{G}$-convergent (Property~\ref{pty-fct:1} of Theorem~\ref{thm:final-clique-tree}), it implies that, for any $j' \in J$, there can be no minimal separator of $G_{i_{j'}}$ that contains $\ensuremath{S}_{i_j}$.
However, an additional difficulty compared to the previous subphase is that now the center $c$ of the star can also be in $\centre{\labeledsubtree{i_{j'}}{\ensuremath{K}_{i_{j'}}}}$.
So, we need to modify our approach in the previous subphase as follows:
\begin{enumerate}
\item We first choose the unique $j_0 \in J$ such that $c \in \centre{\labeledsubtree{i_{j_0}}{\ensuremath{K}_{i_{j_0}}}}$ (if any).
Then, we choose a corresponding solution in ${\cal T}_{i_{j_0}}$ among ${\cal O}(|\ensuremath{S}_{i_{j_0}}|^5) = {\cal O}(|\ensuremath{K}_i|^5)$ possibilities.
Overall, there are ${\cal O}(n|\ensuremath{K}_{i}|^5)$ possibilities.
We test each such a possibility sequentially (including the case where no such a $j_0$ exists).
\item Assume for this step that we fixed a value for $j_0$ (if we test for the case where no such a $j_0$ exists then, we can go directly to the next step). By Claim~\ref{claim:star-1}, the following property holds for any $v \in \ensuremath{S}_{i_j} \setminus \{c\}$: either $v$ is simplicial in $G_{i_{j_0}}$ (and so, $d_{\labeledsubtree{i_{j_0}}{}}(v) = 3$), or $d_{\labeledsubtree{i_{j_0}}{}}(v) = 1$.
In the former case we discard all solutions $\labeledsubtree{i_{j'}}{} \in {\cal T}_{i_{j'}}, \ j' \in J \setminus \{j_0\}$ such that $d_{\labeledsubtree{i_{j'}}{}}(v) < 2$ whereas in the latter case, we discard all solutions $\labeledsubtree{i_{j'}}{} \in {\cal T}_{i_{j'}}, \ j' \in J \setminus \{j_0\}$ such that $d_{\labeledsubtree{i_{j'}}{}}(v) < 4$.
\item Finally, we apply our reduction to {\sc Maximum-Weight Matching} (from the previous subphase) in order to pick the solutions $\labeledsubtree{i_{j'}}{} \in {\cal T}_{i_{j'}}$ for every $j' \in J \setminus \{j_0\}$.
Indeed, we observe that for every $j' \in J \setminus \{j_0\}$, we will always obtain $d_{\labeledsubtree{i_{j'}}{}}(c_i) = 2 + d_{\labeledsubtree{i_{j'}}{}}(\centre{\labeledsubtree{i_{j'}}{\ensuremath{K}_{i_{j'}}}}) \in \{3,4\}$.
Therefore, our choice for the partial solutions $\labeledsubtree{i_{j'}}{}$ will ensure that $d_{\labeledsubtree{i_{j'}}{}}(c_i)$ is maximized (w.r.t. our choice for $j_0$ and $\labeledsubtree{i_{j_0}}{}$).
\item Overall, among all the valid solutions computed (for any possible choice of $j_0$ and $\labeledsubtree{i_{j_0}}{}$), we keep the one maximizing $\min_{j' \in J} d_{\labeledsubtree{i_{j'}}{}}(c_i)$.
\end{enumerate}
\end{itemize}
\end{itemize}
This last phase concludes the algorithm.
\medskip
In order to complete the proof, \underline{let us finally assume $Y_i \neq \ensuremath{K}_i$ (there are thin branches).}
Then, ${\cal C}_i = \{c_i\}$.
We consider all the minimal separators $\ensuremath{S}_{j_1}, \ensuremath{S}_{j_2}, \ldots, \ensuremath{S}_{j_q} \subseteq (\ensuremath{K}_i \setminus Y_i) \cup \{c_i\}$ sequentially.
For every $\ell \in \{1,2,\ldots,q\}$ we must have $\unlabeledsubtree{\ensuremath{S}_{j_{\ell}}}$ is a thin branch, and so, a star.
We so have ${\cal O}(|\ensuremath{S}_{j_{\ell}}|) = {\cal O}(|\ensuremath{K}_i|)$ possibilities.
Furthermore, since according to Definition~\ref{def:thin-leg} there can be no minimal separator $\ensuremath{S}_{i_k}$ which intersects both $\ensuremath{S}_{j_{\ell}}$ and $\ensuremath{K}_i \setminus \ensuremath{S}_{j_{\ell}}$, any solution $\labeledsubtree{j_{\ell}}{} \in {\cal T}_{j_{\ell}}$ that maximizes $d_{\labeledsubtree{j_{\ell}}{}}(c_i)$ would be a best possible choice.
This latter case ressembles to the situation we met in Subphase 4.b.
We can solve it by using the same tools as for this subphase.
Specifically:
\begin{enumerate}
\item We consider each possibility for the star $\unlabeledsubtree{\ensuremath{S}_{j_{\ell}}}$ sequentially;
\item Given a fixed $\unlabeledsubtree{\ensuremath{S}_{j_{\ell}}}$, every minimal separator $\ensuremath{S}_{i_k} \subset \ensuremath{S}_{j_{\ell}}$ must be either a cut-vertex or induce an edge (otherwise, we can discard this possibility for $\unlabeledsubtree{\ensuremath{S}_{j_{\ell}}}$). Then, we can process such minimal separators $\ensuremath{S}_{i_k}$ as in Phases 1 and 2 above.
\item We end up applying the same procedure as for Subphase 4.b. in order to select the partial solutions $\labeledsubtree{i_{j'}}{}$ such that $\ensuremath{S}_{i_{j'}} = \ensuremath{S}_{i_j}$. Namely, this procedure combines a brute-force enumeration with our reduction to {\sc Maximum-weight Matching}.
\item Overall, among all the valid solutions computed, we keep the one maximizing $d(c_i)$. Then, we can apply our filtering rule above.
\end{enumerate}
Once we applied this above procedure to all the thin branches, we can reuse our previous four-phase algorithm in order to process all the other minimal separators.
\end{proofof}
\subsection{Highlights of the algorithm}\label{sec:algo-highlight}
The remaining of the paper is devoted to the proof of Theorem~\ref{thm:main-steiner-power}.
By Theorem~\ref{thm:reduction}, this will also imply Theorem~\ref{thm:main-leaf-power}.
We start sketching our algorithm below in order to guide the readers throughout the next sections.
Its analysis is based on the structure theorems in Sections~\ref{sec:representation} and~\ref{sec:restricted-root}.
Perhaps surprisingly, we need several tricks in order to keep the running time of this algorithm polynomial.
\begin{enumerate}[label=\textbf{S.\theenumi},ref=S.\theenumi]
\addtocounter{enumi}{-1}
\item\label{step-0}({\it Initialization.})
Given $G=(V,E)$, we check whether $G$ is strongly chordal.
If this is not the case then, by Theorem~\ref{thm:partial-characterization}, $G$ cannot be a $k$-Steiner power for any $k \geq 1$, and we stop.
Otherwise by Theorem~\ref{thm:clique-arrangement} we can compute the clique-arrangement of $G$ in polynomial time.
Throughout all the remaining sections, we implicitly use the fact that we can access in polynomial time to the clique-arrangement of $G$.
We will also assume in what follows that $G$ is not a complete graph (otherwise, $G$ is trivially a $k$-Steiner power for any $k$, and so we also stop in this case).
\item\label{step-1}({\it Construction of the rooted clique-tree.})
We construct a clique-tree $\cliquetree{G}$ of $G$ that we root in some $\ensuremath{K}_0 \in \MAXK{G}$.
This clique tree must satisfy very specific properties of which we postpone the precise statement until Section~\ref{sec:clique-tree}.
In order to give the main intuition behind this construction, let us consider an arbitrary maximal clique $\ensuremath{K}_i$ that is not the root ({\it i.e.}, $i > 0$).
Roughly, we would like to minimize the number of minimal separators in $G_i$ to which the vertices in $\ensuremath{S}_i := \ensuremath{K}_i \cap \ensuremath{K}_{p(i)}$ belong to.
Indeed, doing so will help in bounding the number of possible partial solutions that we will need to consider for processing the father node $\ensuremath{K}_{p(i)}$ of $\ensuremath{K}_i$.
More specifically, for every descendant $\ensuremath{K}_j$ of $\ensuremath{K}_i$ in $\cliquetree{G}$ we would like to impose $\ensuremath{S}_j \not\subseteq \ensuremath{S}_i$ and $\ensuremath{S}_i \not\subseteq \ensuremath{S}_j$.
However, both objectives are conflicting and so, we need to find a trade-off.
The technical motivations behind our choices will be further explained in Sections~\ref{sec:encoding} and~\ref{sec:greedy}.
\item\label{step-2}({\it Candidate set generation.})
This step exploits a result of Section~\ref{sec:representation} which states that, for any $4$-Steiner root \tree~of $G$ and for any clique-intersection \ensuremath{X}, we have $Real(\unlabeledsubtree{\ensuremath{X}}) = \ensuremath{X}$. Equivalently, this result says that in the smallest subtree containing \ensuremath{X}~there can be no other real nodes than those in \ensuremath{X}.
Then, our goal is, for every $\ensuremath{X} \in \CI{G}$, to compute a polynomial-size family ${\cal T}_{\ensuremath{X}}$ of ``candidate subtrees'' whose real nodes are exactly \ensuremath{X}.
Intuitively, ${\cal T}_{\ensuremath{X}}$ should contain all possibilities for \unlabeledsubtree{\ensuremath{X}}~in a ``well-structured'' $4$-Steiner root \tree~(such a root must satisfy additional properties given in Sec.~\ref{sec:restricted-root}).
Note that in practice, we only need to compute this above family for {\em minimal separators} and {\em maximal cliques}.
\begin{itemize}
\item In Section~\ref{sec:minsep} we present an algorithm for computing the collection $({\cal T}_{\ensuremath{S}})_{\ensuremath{S} \in \SEP{G}}$ for the minimal separators. This algorithm serves as a brick-basis construction for computing all the other families.
\item Then, we consider in Section~\ref{sec:leaf-case} the maximal cliques $\ensuremath{K}_i$ that are leaf-nodes of \cliquetree{G}. We use the well-known property that all vertices in $\ensuremath{K}_i \setminus \ensuremath{S}_i$ are simplicial in order to generalize the algorithm of the previous section to this new case.
\item Finally, we consider the maximal cliques $\ensuremath{K}_i$ that are internal nodes of \cliquetree{G}~(Section~\ref{sec:super-selection}). Unsurprisingly, several new difficulties arise in the construction of ${\cal T}_{\ensuremath{K}_i}$. Our bottleneck is solving the following subproblem: compute (up to Steiner equivalence) all possible central nodes and their neighbourhood in any subtree $\unlabeledsubtree{\ensuremath{K}_i}$ of diameter four.
We solved this subproblem in most situations, {\it e.g.}, when there is a minimal separator $\ensuremath{S} \subseteq \ensuremath{K}_i$ such that $\unlabeledsubtree{\ensuremath{S}}$ must be a bistar (diameter-three subtree). However in some other situations we failed to do so. That left us with some ``problematic subsets'' called {\em thin branches}: with exponentially many possible ways to include them in candidate subtrees. As a way to circumvent this combinatorial explosion, we also include in ${\cal T}_{\ensuremath{K}_i}$ some partially constructed subtrees where the thin branches are omitted. We will greedily decide how to include the thin branches in these subtrees ({\it i.e.}, how to complete the construction) at Step~\ref{step-4}.
\end{itemize}
Correctness of this part mostly follows from our structure theorem of Section~\ref{sec:restricted-root}.
\item\label{step-3}({\it Selection of the encodings.})
For the remaining of the algorithm, let $(\ensuremath{K}_q,\ensuremath{K}_{q-1},\ldots,\ensuremath{K}_0)$ be a post-ordering of the maximal cliques ({\it i.e.}, obtained by depth-first-search traversal of \cliquetree{G}).
We consider the maximal cliques $\ensuremath{K}_i \in \MAXK{G}$ sequentially, from $i = q$ downto $i=0$.
Indeed if $G$ is a $4$-Steiner power then (by hereditarity), so is the subgraph $G_{i} = (V_{i},E_{i})$ that is induced by all the maximal cliques in the subtree $\cliquetree{G}^{i}$ rooted at $\ensuremath{K}_{i}$.
Steps~\ref{step-3} and~\ref{step-4} are devoted to the computation of a subset ${\cal T}_{i}$ of $4$-Steiner roots for $G_{i}$.
Specifically, for any $4$-Steiner root $\partialsolution{i}$ of $G_i$ we define the following encoding:
$$\texttt{encode}(\partialsolution{i}) := \left[ \ \labeledsubtree[1]{i}{\ensuremath{S}_i} \ \mid \ \left( dist_{\partialsolution{i}}(r,W_i) \right)_{r \in V(\labeledsubtree[1]{i}{\ensuremath{S}_i})} \ \right].$$
During Step~\ref{step-3} we compute a polynomial-size subset of {\em allowed} encodings for the partial solutions in ${\cal T}_{i}$.
That is, we only want to add in ${\cal T}_{i}$ some partial solutions for which the encoding is in the list.
Formally, we define an auxiliary problem called \textsc{Distance-Constrained Root}, where given an encoding as input, we ask whether there exists a corresponding $4$-Steiner root of $G_i$.
Our set of allowed encodings for ${\cal T}_{i}$ can be seen as a set of inputs for which we need to solve \textsc{Distance-Constrained Root}.
We stress that in order to compute these encodings, we use: the families computed at Step~\ref{step-2}, some properties of the rooted clique-tree \cliquetree{G}, {\em and} some pre-computed subsets ${\cal T}_j$ of partial solutions for the siblings $\ensuremath{K}_j$ of $\ensuremath{K}_i$.
Specifically, if $\ensuremath{K}_{p(i)} \in \MAXK{G}$ has children nodes $\ensuremath{K}_{i_1}, \ensuremath{K}_{i_2}, \ldots, \ensuremath{K}_{i_p}$, where $p(i) < i_1 < i_2 < \ldots < i_p$ then, we impose that $\ensuremath{S}_{i_1}, \ensuremath{S}_{i_2}, \ldots, \ensuremath{S}_{i_p}$ are ordered by decreasing size.
Step~\ref{step-3} can start for $\ensuremath{K}_{i_j}$ only after that Steps~\ref{step-3} and~\ref{step-4} are completed for all of $\ensuremath{K}_{i_{j+1}}, \ensuremath{K}_{i_{j+2}},\ldots,\ensuremath{K}_{i_p}$.
This means in particular that executions of Steps~\ref{step-3} and~\ref{step-4} (for different maximal cliques) are intertwined.
\item\label{step-4}({\it Greedy strategy.})
After Step~\ref{step-3} is completed, $\ensuremath{K}_i$ received a polynomial-size subset of constraints -- {\it a.k.a.}, encodings -- for the $4$-Steiner roots of $G_i$ we want to compute.
For every such constraints, we are left to decide whether there exists a $4$-Steiner root of $G_i$ which satisfies all of them ({\it i.e.}, we must solve \textsc{Distance-Constrained Root}).
\begin{itemize}
\item {\bf Case $\ensuremath{K}_i$ is a leaf-node.}
In this situation, $V_i = \ensuremath{K}_i$.
After Step~\ref{step-2} is completed, we are given a family of all possible subtrees $\unlabeledsubtree{\ensuremath{K}_i}$.
We are left verifying whether there exists a solution in this family which satisfies all of the constraints.
\item {\bf Case $\ensuremath{K}_i$ is an internal node.}
Let $\ensuremath{K}_{i_1}, \ensuremath{K}_{i_2},\ldots, \ensuremath{K}_{i_p}$ be the children nodes of $\ensuremath{K}_i$ in $\cliquetree{G}$.
We will construct ${\cal T}_i$ from the partial solutions in ${\cal T}_{i_1}, {\cal T}_{i_2},\ldots, {\cal T}_{i_p}$.
For that, we try to combine all the possible subtrees $\unlabeledsubtree{\ensuremath{K}_i}$ (computed during Step~\ref{step-2}) with the partial solutions stored in the sets ${\cal T}_{i_j}$ by using a series of tests based on a maximum-weight matching algorithm (Section~\ref{sec:greedy}).
-- We use the same strategy in order to incorporate first the so called thin branches, so as to complete the construction of the subtrees $\unlabeledsubtree{\ensuremath{K}_i}$.--
We stress the intriguing relationship between our approach and the implementation of the {\tt alldifferent} constraint in constraint programming~\cite{Reg94}.
\end{itemize}
\item\label{step-5}({\it Output.}) Overall since $G_0 = G$, we have $G$ is a $4$-Steiner power if and only if ${\cal T}_0 \neq \emptyset$.
Furthermore, any tree $T \in {\cal T}_0$ is a $4$-Steiner root of $G$.
\end{enumerate}
\section{Step 3: Case of an internal node}\label{sec:internal}
\input{encoding}
\input{greedy}
\section{Introduction}\label{sec:intro}
A basic problem in computational biology is, given some set of species and a dissimilarity measure in order to compare them, find a {\em phylogenetic tree} that explains their respective evolution.
Namely, such a rooted tree starts from a common ancestor and branches every time there is a separation between at least two of the species we consider.
In the end, the leaves of the phylogenetic tree should exactly represent our given set of species.
Standard formulations of this problem are NP-hard to solve~\cite{BFW92,Ste92}.
We here study a related problem whose complexity status remains open.
Specifically, a common assumption in the literature is that our dissimilarity measure can only tell us whether the separation between two given species has occurred quite recently.
Let $G=(V,E)$ be a graph whose vertices are the species we consider and such that an edge represents two species with a quite ``close'' common ancestor according to the dissimilarity measure.
Formally, given some fixed $k \geq 1$, we ask whether there exists some tree \tree~whose leaf-nodes are exactly $V$ and such that there is an edge $uv$ in $E$ if and only if the two corresponding nodes in \tree~are at a distance $\leq k$.
This is called the \KLP~problem~\cite{NRT02}.
The structural properties of {\em $k$-leaf powers} ({\it i.e.}, graphs for which a tree as above exists) have been intensively studied~\cite{BPP10,BrH08,BHMW10,BaBV06,BLS08,BLR09,BrW09,CFM11,DGFN06,DGHN08,DGN05,KLY06,KKLY10,Laf17,NeR16,Rau06}.
From the algorithmic point of view, $k$-leaf powers are a subclass of bounded {\em clique-width} graphs, and many NP-hard problems can be solved efficiently for these graphs~\cite{FMRS+08,GuW07}.
However, the computational complexity of recognizing $k$-leaf powers is a longstanding open problem.
Very recently, parameterized (FPT) algorithms were proposed for every fixed $k$ on the graphs with degeneracy at most $d$, where the parameter is $k+d$~\cite{EpH18}.
Without this additional restriction on the degeneracy of the graphs, polynomial-time recognition algorithms are known only for $k \leq 5$~\cite{BaBV06,BLS08,ChK07}.
It is noteworthy that every algorithmic improvement for this problem, while bringing several new important insights on the structure of leaf powers, has been incredibly hard to generalize to larger values of $k$.
We contribute to this frustrating chain of improvements by providing the first known polynomial-time recognition algorithm for $6$-leaf powers.
\begin{restatable}{theorem}{leafPower}
\label{thm:main-leaf-power}
There is a polynomial-time algorithm that given a graph $G=(V,E)$, correctly decides whether $G$ is a $6$-leaf power (and if so, outputs a corresponding tree \tree).
\end{restatable}
Proving this above Theorem~\ref{thm:main-leaf-power}, while it may look like a modest improvement in our understanding of the \KLP~problem, was technically challenging.
We will further sketch in Section~\ref{sec:dyn-prog-gal} why the previous approach for \KLP, $k \leq 5$, was already showing its limitations with \KLP[6].
Apart from pushing further the tractable cases for an important open problem in the graph literature, we believe that one of the main merits of our paper is to bring several new ideas in order to tackle with these aforementioned limitations.
As such, we expect further uses of our new framework in the study of $k$-leaf powers and their relatives.
Several variations of $k$-leaf powers were introduced in the literature~\cite{BLR10,BrW10,ChK07,HaT10,JKL00}.
In this work, we consider {\em $k$-Steiner} powers: a natural relaxation of $k$-leaf powers where the vertices in the graph may also be internal nodes in the tree \tree.
Interestingly, for every $k \geq 3$, the notions of $k$-leaf powers and $(k-2)$-Steiner powers are equivalent for a {\em twin-free} graph.
The latter implies a linear-time reduction from \KLP~to \KSP[(k-2)]~\cite{BLS08}.
Furthermore, there exist polynomial-time recognition algorithms for $k$-Steiner powers, for every $k \leq 3$~\cite{ChK07,JKL00}.
As our main contribution in the paper we obtain the first improvement on the recognition of $k$-Steiner powers in a decade.
Specifically we prove that there is a polynomial-time recognition algorithm for the $4$-Steiner powers.
\begin{restatable}{theorem}{SteinerPower}
\label{thm:main-steiner-power}
There is a polynomial-time algorithm that given a graph $G=(V,E)$, correctly decides whether $G$ is a $4$-Steiner power (and if so, outputs a corresponding tree \tree).
\end{restatable}
Note that Theorem~\ref{thm:main-leaf-power} follows from the combination of Theorem~\ref{thm:main-steiner-power} with the aforementioned reduction from \KLP~to \KSP[(k-2)]~\cite{BLS08}.
{\em Hence, the remaining of this paper is devoted to a polynomial-time solution for \KSP[4].}
We think that our general approach (presented next) could be generalized to larger values of $k$.
However, this would first require to strenghten the structure theorems we use in this paper and probably to find less intricate proofs for some of our intermediate statements.
\medskip
Before we can introduce our technical contributions in this paper, we must explain in Sec.~\ref{sec:dyn-prog-gal} the dynamic programming approach behind the $k$-Steiner power recognition algorithms, for $k \leq 3$, and why it is so hard to apply this approach to \KSP[4].
Doing so, we identify Obstacles~\ref{issue-1} and~\ref{issue-2} as the two main issues to fix in order to prove Theorem~\ref{thm:main-steiner-power}.
Then in Sec.~\ref{sec:org}, we briefly summarize our proposed solutions for Obstacles~\ref{issue-1} and~\ref{issue-2} while presenting the organization of the technical sections of this paper.
\subsection{The difficulties of a dynamic programming approach}\label{sec:dyn-prog-gal}
We refer to Sec.~\ref{sec:prelim} for any undefined graph-theoretic terminology in this introduction.
In what follows we give a high-level overview of our approach, that we compare to prior work on \KSP~and \KLP.
As our starting point we restrict our study to {\em chordal graphs} and {\em strongly chordal graphs}, that are two well-known classes in algorithmic graph theory of which $k$-Steiner powers form a particular subclass~\cite{ABNT16}.
Doing so, we can use various properties of these classes of graphs such as: the existence of a tree-like representation of chordal graphs, that is called a {\em clique-tree}~\cite{BlP93} and is commonly used in the design of dynamic programming algorithms on this class of graphs; and an auxiliary data structure which is called ``{\em clique arrangement}'' and is polynomial-time computable on strongly chordal graphs~\cite{NeR16}.
Roughly, this clique arrangement encodes all possible intersections of a subset of maximal cliques in a graph.
It is worth noticing that clique arrangements were introduced in the same paper as leaf powers, under the different name of ``clique graph''~\cite{NRT02}.
Our first result is that every maximal clique, minimal separator and, more generally, any intersection $\ensuremath{X}$ of maximal cliques in a $k$-Steiner power must be contained in an ${\cal O}(k \cdot |\ensuremath{X}|)$-node subtree with very specific properties -- detailed next in Sec.~\ref{sec:org} -- of the tree \tree~we aim at computing.
This result extends to any $k$ the structural results that were presented in~\cite{ChK07} for $k \leq 3$, and it is a prerequisite for the design of a dynamic programming algorithm on a clique-tree.
Unfortunately, as the value of $k$ increases it becomes more and more difficult to derive from such structural results a polynomial-time recognition algorithm for $k$-Steiner powers.
Our proposed solutions for $k=4$ are quite different from those used in the previous works on $k$-Steiner powers~\cite{ChK07,JKL00} which results in an embarrassingly long and intricate proof.
\medskip
To give a flavour of the difficulties we met, we consider the following common situation in a dynamic programming algorithm on chordal graphs.
Given a graph $G=(V,E)$, let \ensuremath{S}~be a minimal separator of $G$ and $C$ be a full component of $G \setminus \ensuremath{S}$ ({\it i.e.}, such that every vertex in \ensuremath{S}~has a neighbour in $C$).
If $G$ is a $k$-Steiner power then, so must be the induced subgraph $G[C \cup \ensuremath{S}]$.
We want to store the partial solutions obtained for $G[C \cup \ensuremath{S}]$, as at least one of them should be extendible to all of $G$ (otherwise, $G$ is not a $k$-Steiner power).
However, for doing so efficiently we must overcome the following two obstacles:
\begin{itemize}[label=-]
\item There may be exponentially many partial solutions already when $G[C \cup \ensuremath{S}]$ is a complete subgraph and $k \geq 3$.
Therefore, we cannot afford to store all possible solutions explicitly.
Nevertheless it seems at the minimum we need to keep the part of these solutions which contains \ensuremath{S}: in order to be able to check later whether the solutions found for $G[C \cup \ensuremath{S}]$ can be extended to all of $G$.
We will prove in this paper that such a part \unlabeledsubtree{\ensuremath{S}} of the partial solutions is a subtree of diameter at most $k-1$, and so, there may be exponentially many possibilities to store whenever $k \geq 4$.
\begin{issue}\label{issue-1}
Decrease the number of possibilities to store for \unlabeledsubtree{\ensuremath{S}} to a polynomial.
\end{issue}
\item Furthermore, since there can be no edge between $C$ and $V \setminus \left( C \cup \ensuremath{S}\right)$, the tree $T$ that we want to compute for $G$ must satisfy that all vertices in $C$ stay at a distance $\geq k+1$ from all vertices in $V \setminus (\ensuremath{S} \cup C)$.
In order to ensure this will be the case, we wish to store a ``distance profile'' $(dist_{\tree}(r,C))_{r \in V(\unlabeledsubtree{S})}$ in the encoding of all the partial solutions found for $G[C \cup \ensuremath{S}]$.
Storing this information would result in a combinatorial explosion of the number of possible encodings, even if there are only a few possibilities for the subtree \unlabeledsubtree{\ensuremath{S}}.
Chang and Ko proposed two nice ``heuristic rules'' in order to overcome this distance issue for $k=3$~\cite{ChK07}.
Unfortunately, these rules do not easily generalize to larger values of $k$.
\begin{issue}\label{issue-2}
For any fixed \unlabeledsubtree{S}, decrease the number of possibilities to store for the ``distance profiles'' to a polynomial.
\end{issue}
\end{itemize}
In order to derive a polynomial-time algorithm for the case $k=4$, we further restrict the structural properties of the ``useful'' partial solutions we need to store.
This is done by carefully analysing the relationships between the structure of these solutions and the intersections between maximal cliques in the graph.
Perhaps surprisingly, we need to combine these stronger properties on the partial solutions with several other tricks so as to bound the number of partial solutions that we need to store by a polynomial ({\it e.g.}, we also impose local properties on the clique-tree we use, and we introduce a new greedy selection procedure based on graph matchings).
\subsection{Organization of the paper}\label{sec:org}
We give the required graph-theoretic terminology for this paper in Section~\ref{sec:prelim}.
We emphasize on Section~\ref{sec:algo-highlight}: where we also provide a more detailed presentation of our algorithm, as a guideline for all the other sections.
\medskip
Given a $k$-Steiner power $G$, let us call {\em $k$-Steiner root} a corresponding tree \tree.
In Sections~\ref{sec:representation} and~\ref{sec:restricted-root} we present new results on the structure of $k$-Steiner roots that we use in the analysis of our algorithm.
Specifically, we show in Section~\ref{sec:representation} that any intersection of maximal cliques in a graph $G$ must induce a particular subtree in any of its $k$-Steiner roots \tree~where no other vertex of $G$ can be present.
Furthermore, the inclusion relationships between these ``clique-intersections'' in $G$ are somewhat reflected by the diameter of their corresponding subtrees in \tree.
An intriguing consequence of our results is that, in any $k$-Steiner power, there can be no chain of more than $k$ minimal separators ordered by inclusion.
This slightly generalizes a similar result obtained in~\cite{NRT02} for $k$-leaf powers.
Then, we partly complete this above picture in Section~\ref{sec:restricted-root} for the case $k=4$.
For every clique-intersection \ensuremath{X}~in a chordal graph $G$, we classify the vertices in \ensuremath{X}~into two main categories: ``free'' and ''constrained'', that depend on the other clique-intersections these vertices are contained into.
Our study shows that ``free'' vertices cause a combinatorial explosion of the number of partial solutions we should store in a naive dynamic programming algorithm.
However, on the positive side we prove that there always exists a ``well-structured'' $4$-Steiner root where such free vertices are leaves with very special properties.
This result will be instrumental in ruling out Obstacle~\ref{issue-1}.
\medskip
Sections~\ref{sec:clique-tree},~\ref{sec:ci-subtrees},~\ref{sec:encoding} and~\ref{sec:greedy} are devoted to the main steps of the algorithm.
We start presenting a constructive proof of a rooted clique-tree with quite constrained properties in Section~\ref{sec:clique-tree}.
Roughly we carefully control the ancestor/descendant relationships between the edges that are labelled by different minimal separators of the graph.
These technicalities are the cornerstone of our approach in Section~\ref{sec:representation} in order to bound the number of ``distance profiles'' which we need to account in our dynamic programming (cf. Obstacle~\ref{issue-2}).
Then in Section~\ref{sec:ci-subtrees}, we completely rule out Obstacle~\ref{issue-1} --- in fact, we solve a more general subproblem.
For that, let \cliquetree{G}~be the rooted clique-tree of Section~\ref{sec:clique-tree}.
Recall that the maximal cliques and the minimal separators of $G$ can be mapped to the nodes and edges of \cliquetree{G}, respectively.
We precompute by dynamic programming, for every node and edge in \cliquetree{G}, a family of all the potential subtrees to which the corresponding clique-intersection of $G$ could be mapped in some well-structured $4$-Steiner root of $G$.
Of particular importance is Section~\ref{sec:minsep} where for any minimal separator $\ensuremath{S}$, we give a polynomial-time algorithm in order to generate all the candidate smallest subtrees into which $\ensuremath{S}$ can be contained in a $4$-Steiner root of $G$.
The result is then easily extended to the maximal cliques that appear as leaves in our clique-tree (Section~\ref{sec:leaf-case}).
Correctness of these two first parts follows from Sec.~\ref{sec:restricted-root}.
Finally, in Section~\ref{sec:super-selection} we give a more complicated representation of a family of candidate subtrees $\unlabeledsubtree{\ensuremath{K}_i}$ for all the other maximal cliques $\ensuremath{K}_i$.
This part is based on a careful analysis of clique-intersections in $\ensuremath{K}_i$ and several additional tricks.
Roughly, our representation in Sec.~\ref{sec:minsep} is composed of partially constructed subtrees and of ``problematic'' subsets that need to be inserted to these subtrees in order to complete the construction.
The exact way these insertions must be done is postponed until the very end of the algorithm (Sec.~\ref{sec:greedy}).
Section~\ref{sec:encoding} is devoted to the ``distance profiles'' of partial solutions and how to overcome Obstacle~\ref{issue-2}.
Specifically, instead of computing partial solutions at each node of the clique-tree and storing their encodings, we rather pre-compute a polynomial-size subset of {\em imposed} encodings for each node.
Then, the problem becomes to decide whether given such an imposed encoding, there exists a corresponding partial solution.
We formalize our approach by introducing an intermediate problem where the goal is to compute a $4$-Steiner root with additional constraints on its structure and the distances between some sets of nodes.
Finally, we detail in Section~\ref{sec:greedy} the resolution of our intermediate problem, thereby completing the presentation of our algorithm.
An all new contribution in this part is a greedy procedure, based on {\sc Maximum-Weight Matching}, in order to ensure some distances' constraints are satisfied by the solutions we generate during the algorithm.
Interestingly, this procedure is very close in spirit to the implementation of the {\tt alldifferent} constraint in constraint programming~\cite{Reg94}.
Due to the intricacy of our proofs we gave up optimizing the runtime of our algorithm.
We will only provide enough arguments in order to show it is polynomial.
\medskip
We end up this paper in Section~\ref{sec:ccl} with some ideas for future work.
\renewcommand{\thetheorem}{\arabic{section}.\arabic{theorem}}
\section{Step~\ref{step-2}: A family of subtrees for the Clique-Intersections}\label{sec:ci-subtrees}
For every clique-intersection $\ensuremath{X} \in \MAXK{G} \cup \SEP{G}$, we aim at computing a polynomial-size representation of the family of all possible subtrees $\unlabeledsubtree{\ensuremath{X}}$ that we could encounter in a well-structured $4$-Steiner root of $G$. -- Our approach also works for weak minimal separators, however this is not needed for our algorithm. -- Correctness of this part mostly follows from Theorem~\ref{thm:x-free}.
In what follows, let $\cliquetree{G}$ be an arbitrary rooted clique-tree of $G$ ({\it i.e.}, not necessarily the one computed in Sec.~\ref{sec:clique-tree}).
We first focus on the case of minimal separators in Section~\ref{sec:minsep}, before extending our results to the maximal cliques that are either leaf-nodes or internal nodes of $\cliquetree{G}$ (Sections~\ref{sec:leaf-case} and~\ref{sec:super-selection}, respectively).
\subsection{Case of Minimal Separators}\label{sec:minsep}
We first prove that for any minimal separator $\ensuremath{S}$, the family ${\cal T}_{\ensuremath{S}}$ of all the potential subtrees $\unlabeledsubtree{\ensuremath{S}}$ has polynomial size.
Moreover, we can enumerate all possible subtrees $\unlabeledsubtree{\ensuremath{S}}$ in polynomial time.
This result will be the cornerstone of all our other constructions in this part.
\begin{theorem}\label{thm:minsep}
Let $\SEP{G}$ be the set of all minimal separators in $G=(V,E)$.
In ${\cal O}(n^5m)$-time we can construct a collection $({\cal T}_{\ensuremath{S}})_{\ensuremath{S} \in \SEP{G}}$ such that, for any well-structured $4$-Steiner root $\tree$ of $G$, and for any $\ensuremath{S} \in \SEP{G}$, $\unlabeledsubtree{\ensuremath{S}}$ is Steiner-equivalent to some subtree in ${\cal T}_{\ensuremath{S}}$.
\end{theorem}
Before proving this above theorem, let us describe the main difficulty we had to face on.
Roughly, given $\ensuremath{S} \in \SEP{G}$ the difficulty in generating ${\cal T}_{\ensuremath{S}}$ comes from the bistars, as a brute-force generation of all possibilities would take time exponential in $|\ensuremath{S}|$.
In order to remedy to that issue we use the fact that in a well-structured $4$-Steiner root of $G$, $\ensuremath{S}$-free vertices are leaves of such a bistar with all of them, except maybe one, adjacent to the same central node.
For a fixed placement of the $\ensuremath{S}$-constrained vertices, this only gives us ${\cal O}(|\ensuremath{S}|)$ possibilities in order to place the $\ensuremath{S}$-free vertices.
Overall, we reduce the number of possible bistars to an ${\cal O}(|\ensuremath{S}|^5)$.
\begin{proof}
Let $\ensuremath{S} \in \SEP{G}$ be fixed.
Up to some pre-processing we will construct ${\cal T}_{\ensuremath{S}}$ in ${\cal O}(|\ensuremath{S}|^6)$-time.
Since $\max\{ \ |\ensuremath{S}| \mid \ensuremath{S} \in \SEP{G} \} = {\cal O}(n)$ and $\sum_{\ensuremath{S} \in \SEP{G}}|\ensuremath{S}| = {\cal O}(m)$~\cite{BlP93}, the latter will prove the result.
\medskip
\noindent
{\bf Case $diam(\unlabeledsubtree{\ensuremath{S}}) \leq 2$.}
Let us start with some easy cases.
If $|\ensuremath{S}| = 1$ then, it suffices to add a single-node tree to ${\cal T}_{\ensuremath{S}}$.
Similarly, if $|\ensuremath{S}|=2$ then, by Theorem~\ref{thm:clique-intersection}, $\ensuremath{S}$ must induce a path of length at most $k-1=3$ in any $4$-Steiner root of $G$ with its two ends being the vertices of $\ensuremath{S}$.
This gives only ${\cal O}(1)$ possibilities to put into ${\cal T}_{\ensuremath{S}}$.
Thus, from now on assume $|\ensuremath{S}| \geq 3$.
Given any $4$-Steiner root $\tree$ of $G$, by Theorem~\ref{thm:clique-intersection} the subtree $\unlabeledsubtree{\ensuremath{S}}$ can only be a star or a bistar (but the latter only if $\ensuremath{S}$ is inclusion wise maximal in $\SEP{G}$).
Furthermore in the former case, all leaves in the star $\unlabeledsubtree{\ensuremath{S}}$ must be in $\ensuremath{S}$, and the center node can either be in $\ensuremath{S}$ or Steiner.
Overall, this gives ${\cal O}(|\ensuremath{S}|)$ possibilities of stars to put into ${\cal T}_{\ensuremath{S}}$, and so, this takes ${\cal O}(|\ensuremath{S}|^2)$-time.
\medskip
\noindent
{\bf Case $diam(\unlabeledsubtree{\ensuremath{S}}) = 3$.}
We end up focusing on the case where $|\ensuremath{S}| \geq 3$ and $\unlabeledsubtree{\ensuremath{S}}$ may be a bistar.
In what follows, the two central nodes of such a bistar will be always denoted by $\centre{\unlabeledsubtree{\ensuremath{S}}} = \{ c_0, c_1 \}$.
We will introduce the following additional terminology.
A {\em heavy part} of $\ensuremath{S}$ is any clique-intersection $\ensuremath{X} \subset \ensuremath{S}$ such that $|\ensuremath{X}| \geq 3$.
A {\em light part} of $\ensuremath{S}$ is any clique-intersection $\ensuremath{X} \subset S$ such that $|\ensuremath{X}| = 2$.
We prove the following intermediate claim (also used in other parts of the paper):
\begin{myclaim}\label{claim:no-middle-edge}
If $\unlabeledsubtree{\ensuremath{S}}$ is a bistar and $\centre{\unlabeledsubtree{\ensuremath{S}}}$ is a light part then, there is a heavy part that strictly contains $\centre{\unlabeledsubtree{\ensuremath{S}}}$.
\end{myclaim}
\begin{proofclaim}
Suppose by contradiction $\ensuremath{X} = \{c_0,c_1\}$ is a light part and no heavy part contains it.
Let $\ensuremath{K}_i$ be any maximal clique such that $\ensuremath{X} \subseteq \ensuremath{K}_i$ but $\ensuremath{S} \not\subseteq \ensuremath{K}_i$.
Such a $\ensuremath{K}_i$ always exists since otherwise, taking the intersection of $\ensuremath{S}$ with all the maximal cliques that contains $\ensuremath{X}$, one would obtain $\ensuremath{S} = \ensuremath{X}$, a contradiction.
In this situation, $\ensuremath{X} \subseteq \ensuremath{K}_i \cap \ensuremath{S}$, and so $\ensuremath{X} = \ensuremath{K}_i \cap \ensuremath{S}$ since there is no heavy part containing $\ensuremath{X}$.
Furthermore we have $\ensuremath{K}_i \not\subseteq \ensuremath{S}$.
Hence, there exists $j \in \{0,1\}$ such that $c_j$ has a neighbour in $\unlabeledsubtree{\ensuremath{K}_i} \setminus \ensuremath{S}$ (possibly, a Steiner node).
By applying Lemma~\ref{lem:tree-intersection} to $N_{\tree}[c_j]$ and $\unlabeledsubtree{\ensuremath{K}_i}$, we obtain:$$diam(N_{\tree}[c_j] \cup \unlabeledsubtree{\ensuremath{K}_i}) = diam(\unlabeledsubtree{\ensuremath{K}_i}) \leq 4.$$
In particular, $\ensuremath{K}_i \cup Real(N_{\tree}[c_j])$ is a clique of $G$.
By maximality of $\ensuremath{K}_i$, $Real(N_{\tree}[c_j]) \subseteq \ensuremath{K}_i$.
However, there is at least one leaf in $Real(N_{\tree}[c_j]) \setminus \ensuremath{X}$, that implies $\ensuremath{X} \subset \ensuremath{K}_i \cap \ensuremath{S}$, a contradiction.
\end{proofclaim}
Then, we divide the proof in two subcases.
We stress that both subcases only depend on the clique-arrangement of $G$, and are independent of any $4$-Steiner root $\tree$ --- we use the existence of such a root only for proving correctness of our construction.
\begin{itemize}
\item
We first consider the particular subcase when there exists a heavy part $\ensuremath{X} \subset \ensuremath{S}$.
In this situation, $\ensuremath{X} \subseteq N_{\tree}[c_0]$ or $\ensuremath{X} \subseteq N_{\tree}[c_1]$ for any well-structured $4$-Steiner root $\tree$ of $G$ where $\unlabeledsubtree{\ensuremath{S}}$ is a bistar.
Moreover, by Property~\ref{pty-ci:2} of Theorem~\ref{thm:clique-intersection} either $Real(N_{\tree}[c_0]) = \ensuremath{X}$ or $Real(N_{\tree}[c_1]) = \ensuremath{X}$.
Therefore, we can start choosing among ${\cal O}(|\ensuremath{X}|)$ possibilities the star induced by $\ensuremath{X}$ in $\tree$.
W.l.o.g., $c_0$ is the center of this star.
The other center $c_1$ must be either a Steiner node adjacent to $c_0$ (in $\tree$) or any vertex in $\ensuremath{X} \setminus \{c_0\}$.
Hence, there are also ${\cal O}(|\ensuremath{X}|)$ possibilities for $c_1$.
Finally, since we have $Real(N_{\tree}[c_0]) = \ensuremath{X}$ all the nodes in $\ensuremath{S} \setminus \ensuremath{X}$ must be leaves adjacent to $c_1$.
Overall, this gives ${\cal O}(|\ensuremath{S}|^2)$ possibilities of bistars to put into ${\cal T}_{\ensuremath{S}}$, and so, this takes ${\cal O}(|\ensuremath{S}|^3)$-time\footnote{
We will actually show in Lemma~\ref{lem:real-center-bistar} this number of potential bistars can be reduced. However, we choose not to include this improvement in this part of the proof in order to keep it as simple as possible.}.
\item
From now on we assume that there is no heavy part.
Following Definition~\ref{def:x-free} we process the vertices in $\ensuremath{S}$ according to the other clique-intersections in which they are contained.
\smallskip
\noindent
{\bf Processing the internally $\ensuremath{S}$-constrained vertices.}
For any well-structured $4$-Steiner root $\tree$ where $\unlabeledsubtree{\ensuremath{S}}$ is a bistar, by Claim~\ref{claim:no-middle-edge}, $\centre{\unlabeledsubtree{\ensuremath{S}}} = \{c_0,c_1\}$ is not a light part.
Furthermore, given any light part $\ensuremath{X} \subset \ensuremath{S}$, we can prove that either $\ensuremath{X}$ induces an edge of $\unlabeledsubtree{\ensuremath{S}}$, or $\unlabeledsubtree{\ensuremath{X}}$ is a non-edge star and $\ensuremath{X} = Real(N_{\tree}[c_j])$ for some $j$ (this also follows from Property~\ref{pty-ci:2} of Theorem~\ref{thm:clique-intersection}).
In this situation, we construct the subgraph $I_2$: of which the vertices are the internally $\ensuremath{S}$-constrained vertices, and the edges are the light parts.
\begin{myclaim}\label{claim:igraph-light}
If $G$ has a $4$-Steiner root $\tree$ where $\unlabeledsubtree{\ensuremath{S}}$ is a bistar then, $I_2$ has at most two connected components.
Specifically:
\begin{enumerate}
\item Either $I_2$ is connected, there is a unique light part $\ensuremath{X}$ such that $\unlabeledsubtree{\ensuremath{X}}$ is a non-edge star, and all other light parts must be edges incident to the unique central node in $\centre{\unlabeledsubtree{\ensuremath{S}}} \setminus \centre{\unlabeledsubtree{\ensuremath{X}}}$.
\item Or the connected components of $I_2$ induce node-disjoint stars in $\unlabeledsubtree{\ensuremath{S}}$.
\end{enumerate}
\end{myclaim}
\begin{proofclaim}
The result is a consequence of the following case analysis:
\begin{itemize}
\item Assume there is a light part $\ensuremath{X} \subset \ensuremath{S}$ such that $\unlabeledsubtree{\ensuremath{X}}$ is a non edge star and $Real(N_{\tree}[c_j]) = \ensuremath{X}$.
Two different situations might occur:
\begin{enumerate}
\item \underline{Situation \# 1} (see Fig.~\ref{fig:bistar-situation-1}): There is a light part $\ensuremath{X}' \neq \ensuremath{X}$ intersecting $\ensuremath{X}$. Since the vertex in $\ensuremath{X}' \cap \ensuremath{X}$ cannot be a leaf adjacent to $c_j$ (otherwise, we should have $\ensuremath{X}' \subseteq Real(N_{\tree}[c_j]) = \ensuremath{X}$, a contradiction), this must be $c_{1-j}$. In particular, for {\em any} light part $\ensuremath{X}' \neq \ensuremath{X}$, $\unlabeledsubtree{\ensuremath{X}'}$ must be an edge between $c_{1-j}$ and a leaf (thereby implying $\ensuremath{X}' \cap \ensuremath{X} \neq \emptyset$).
\begin{figure}[h!]
\centering
\includegraphics[width=.3\textwidth]{Fig/bistar-situation-1}
\caption{Situation 1: the subtree $\unlabeledsubtree{\ensuremath{X}}$ is drawn in bold. There are 3 other light parts represented by dashed ellipses.}
\label{fig:bistar-situation-1}
\end{figure}
\item \underline{Situation \# 2} (see Fig.~\ref{fig:bistar-situation-2}): There is no other light part $\ensuremath{X}' \neq \ensuremath{X}$ intersecting $\ensuremath{X}$.
Since $\unlabeledsubtree{\ensuremath{S}} \setminus N_{\tree}[c_j]$ is an independent set, any light part $\ensuremath{X}' \subset \ensuremath{S}$ that does not intersect $\ensuremath{X}$ cannot be an edge.
We so deduce that if such a $\ensuremath{X}'$ exists then, $Real(N_{\tree}[c_{1-j}]) = \ensuremath{X}'$, and so, there are no other light part in $\ensuremath{S}$ than $\ensuremath{X}$ and $\ensuremath{X}'$.
\begin{figure}[h!]
\centering
\includegraphics[width=.25\textwidth]{Fig/bistar-situation-2}
\caption{Situation 2: the subtrees $\unlabeledsubtree{\ensuremath{X}}$ and $\unlabeledsubtree{\ensuremath{X}'}$ are drawn in bold.}
\label{fig:bistar-situation-2}
\end{figure}
\end{enumerate}
\item Otherwise, each light part is an edge of $\unlabeledsubtree{\ensuremath{S}}$ that contains either $c_0$ or $c_1$, but not both.
Therefore, there is a one-to-one mapping between the connected components of $I_2$ and the nonempty sets among $Real(N_{\tree}[c_0]) \setminus \{c_1\}, Real(N_{\tree}[c_1]) \setminus \{c_0\}$.
See Fig.~\ref{fig:bistar-only-edge} for an illustration.
\begin{figure}[h!]
\centering
\includegraphics[width=.4\textwidth]{Fig/bistar-only-edge}
\caption{A case where all light parts must be edges.}
\label{fig:bistar-only-edge}
\end{figure}
\end{itemize}
\end{proofclaim}
Overall, Claim~\ref{claim:igraph-light} reduces the placement of internally $\ensuremath{S}$-constrained vertices to the construction of two stars in parallel, thereby giving ${\cal O}(|\ensuremath{S}|^2)$ different possibilities.
\smallskip
\noindent
{\bf Processing the $(\ensuremath{S},\ensuremath{X}_1,\ensuremath{X}_2)$-sandwiched vertices.}
Then, we consider all the other $\ensuremath{S}$-constrained vertices.
By Lemma~\ref{lem:bistar-center} in the previous Section, $\ensuremath{S}$ is strictly contained into exactly two maximal cliques, that we denote $\ensuremath{K}$ and $\ensuremath{K}'$.
In particular, if $v \in \ensuremath{S}$ is $(\ensuremath{S},\ensuremath{X}_1,\ensuremath{X}_2)$-sandwiched then, either $\ensuremath{X}_1 = \ensuremath{K}$ or $\ensuremath{X}_1 = \ensuremath{K}'$.
In the former case we call $v$ {\em $\ensuremath{K}$-dependent}, and in the latter case we call it {\em $\ensuremath{K}'$-dependent}.
The following Claim~\ref{claim:exclusive-dependency} shows that it defines two equivalence classes:
\begin{myclaim}\label{claim:exclusive-dependency}
Assume that $G$ has a $4$-Steiner root $\tree$ where $\unlabeledsubtree{\ensuremath{S}}$ is a bistar, and let $v \in \ensuremath{S}$ be {\em not} internally $\ensuremath{S}$-constrained.
If $v$ is $\ensuremath{K}$-dependent then, either $v \in \centre{\unlabeledsubtree{\ensuremath{S}}} \cap \centre{\unlabeledsubtree{\ensuremath{K}}}$, or $v$ is a leaf of $\unlabeledsubtree{\ensuremath{S}}$ that is adjacent in $\tree$ to the unique node in $\centre{\unlabeledsubtree{\ensuremath{K}}}$.
In particular, a vertex $v \in \ensuremath{S}$ cannot be both $\ensuremath{K}$-dependent and $\ensuremath{K}'$-dependent (unless it is also internally $\ensuremath{S}$-constrained).
\end{myclaim}
\begin{proofclaim}
By the proof of Lemma~\ref{lem:bistar-center}, $\centre{\unlabeledsubtree{\ensuremath{S}}} = \{c_0,c_1\}$ where $\centre{\unlabeledsubtree{\ensuremath{K}}} = \{c_0\}$ and $\centre{\unlabeledsubtree{\ensuremath{K}'}} = \{c_1\}$.
Now, suppose by contradiction $v$ is either $c_1$ or a leaf adjacent to $c_1$.
Let $\ensuremath{X}_2 \in \CI{G}$ be such that $v$ is $(\ensuremath{S},\ensuremath{K},\ensuremath{X}_2)$-sandwiched.
As we have $\ensuremath{X}_2 \cap \ensuremath{S} = \{v\}$, $\ensuremath{X}_2$ is contained into at least one maximal clique $\ensuremath{K}''$ that does not contain $\ensuremath{S}$.
Furthermore, we can assume w.l.o.g. $\ensuremath{K}'' \cap \ensuremath{S} = \{v\}$ since otherwise $v$ is internally $\ensuremath{S}$-constrained, a contradiction.
Thus from now on we will assume $\ensuremath{X}_2 = \ensuremath{K}''$ is a maximal clique that does not contain $\ensuremath{S}$.
Let $x \in (\ensuremath{K} \cap \ensuremath{X}_2) \setminus \{v\}$.
On one hand, $x \notin \ensuremath{K}'$ (because $x \notin \ensuremath{S}$) and so, $dist_{\tree}(x,c_1) \geq 3$.
On the other hand, $dist_{\tree}(x,c_0) \leq 2$ because $x \in \ensuremath{K}$.
Altogether combined, $dist_{\tree}(x,c_0) = 2$ and the unique $xc_1$-path in $\tree$ goes by $c_0$.
Note that it also implies that the unique $xv$-path in $\tree$ goes by the edge $c_0c_1$, hence $dist_{\tree}(x,v) \in \{3,4\}$.
Furthermore, let $y \in \ensuremath{X}_2 \setminus \ensuremath{K}$, that exists since we assume $\ensuremath{X}_2$ to be a maximal clique.
We prove as a subclaim $y \notin \ensuremath{K}'$.
Indeed, by Theorem~\ref{thm:clique-tree-pties} there is an edge labeled by $\ensuremath{S}$ in any clique-tree of $G$.
This edge must be $\ensuremath{K}\maxk'$, that implies there can be no edge in $G$ between $\ensuremath{K} \setminus \ensuremath{K}'$ and $\ensuremath{K}' \setminus \ensuremath{K}$.
Since we have $xy \in E(G)$, this proves our subclaim that $y \notin \ensuremath{K}'$.
In particular, we also have $dist_{\tree}(y,c_1) \geq 3$.
But then, since we must also have $dist_{\tree}(x,y) \leq 4$, the $yv$-path in $\tree$ also goes by the edge $c_0c_1$ (otherwise, $dist_{\tree}(x,y) = dist_{\tree}(x,c_1) + dist_{\tree}(c_1,y) \geq 6$).
Since $dist_{\tree}(y,c_0) \geq 3$ (because $y \notin \ensuremath{K}$) we so obtain that $dist_{\tree}(y,c_0) = 3$ and $c_1 = v$.
However, there exists $z \in \ensuremath{S}$ a leaf adjacent to $c_0$.
In particular, there exists a clique-intersection $\ensuremath{X}$ that contains all of $x,y,z,v$.
As we assume $v$ is not internally $\ensuremath{S}$-constrained, $\ensuremath{S} \subset \ensuremath{X}$.
This is a contradiction because we cannot have $\ensuremath{X} = \ensuremath{K}$ nor $\ensuremath{X} = \ensuremath{K}'$.
\end{proofclaim}
Given a fixed placement of internally $\ensuremath{S}$-constrained vertices, by Claim~\ref{claim:exclusive-dependency} we can generate all possible placements of the ``sandwiched'' vertices, as follows.
We choose the central node in $\centre{\unlabeledsubtree{\ensuremath{K}}}$ and the central node in $\centre{\unlabeledsubtree{\ensuremath{K}'}}$ (there are ${\cal O}(|\ensuremath{S}|^2)$ possibilities).
Then, all remaining $\ensuremath{K}$-dependent vertices, resp. $\ensuremath{K}'$-dependent, must be added as leaves adjacent to the unique node in $\centre{\unlabeledsubtree{\ensuremath{K}}}$, resp. to the unique central node in $\centre{\unlabeledsubtree{\ensuremath{K}'}}$.
Overall, we have ${\cal O}(|\ensuremath{S}|^2) \times {\cal O}(|\ensuremath{S}|^2) = {\cal O}(|\ensuremath{S}|^4)$ possibilities for positioning the $\ensuremath{S}$-constrained vertices.
\smallskip
\noindent
{\bf Processing the $\ensuremath{S}$-free vertices.}
However, each such a possibility does not quite define a potential bistar for $\ensuremath{S}$ as we also need to position the $\ensuremath{S}$-free vertices.
By Theorem~\ref{thm:x-free}, we can always assume the $\ensuremath{S}$-free vertices to be leaf-nodes with all of them except maybe one adjacent to the same central node of $\unlabeledsubtree{\ensuremath{S}}$.
In particular, given a fixed placement of the $\ensuremath{S}$-constrained vertices, there are ${\cal O}(|\ensuremath{S}|)$ possibilities in order to place the $\ensuremath{S}$-free vertices (specifically, we choose among ${\cal O}(|\ensuremath{S}|)$ possibilities the unique $\ensuremath{S}$-free vertex that is not adjacent to the same central node as the others, if any, as well as the central node to which all other $\ensuremath{S}$-free vertices must be adjacent).
\end{itemize}
Summarizing, we only need to add ${\cal O}(|\ensuremath{S}|^5)$ different trees in ${\cal T}_{\ensuremath{S}}$, that takes ${\cal O}(|\ensuremath{S}|^6)$-time.
\smallskip
{\bf Final comments.}
A careful reader maybe observed that in our above analysis we ignored the complexity of several operations such as: computing the heavy parts and the light parts of $\ensuremath{S}$, and in the same way computing the $\ensuremath{K}$-dependent vertices (resp. computing the $\ensuremath{K}'$-dependent vertices).
By Theorem~\ref{thm:clique-arrangement} we can first compute the clique-arrangement of $G$ in polynomial time, and then all these above operations can be easily done in polynomial time as well.
However, in order to prove that our algorithm truly runs in ${\cal O}(n^5m)$-time, one needs to show that performing these above operations does not dominate the total running-time.
\begin{myclaim}\label{claim:compute-parts}
Assume that $G$ has a $4$-Steiner root $\tree$ where $diam(\unlabeledsubtree{\ensuremath{S}}) \leq 3$.
Then, we have that: $$\sum_{\ensuremath{X} \in \CI{G}: \ensuremath{X} \subseteq \ensuremath{S}} |\ensuremath{X}| = {\cal O}(|\ensuremath{S}|).$$
\end{myclaim}
\begin{proofclaim}
Since $\unlabeledsubtree{\ensuremath{S}}$ has ${\cal O}(|\ensuremath{S}|)$ nodes and ${\cal O}(|\ensuremath{S}|)$ edges, we only need to consider the clique-intersections $\ensuremath{X} \subset \ensuremath{S}$ such that $\unlabeledsubtree{\ensuremath{X}}$ is a non-edge star. We are done as there can only be at most two such clique-intersections.
\end{proofclaim}
This first result above tells us how to compute the light parts and heavy parts of $\ensuremath{S}$.
Specifically, we can simply enumerate all the clique-intersections $\ensuremath{X}$ such that $\ensuremath{X} \subset \ensuremath{S}$, by using the clique-arrangement of $G$.
Furthermore if this enumeration takes more than ${\cal O}(|\ensuremath{S}|)$-time then we can stop as by Claim~\ref{claim:compute-parts}, $\ensuremath{S}$ cannot be mapped to a bistar in any $4$-Steiner root of $G$.
Overall, all the light parts and heavy parts of $\ensuremath{S}$ can be enumerated in total time ${\cal O}(|\ensuremath{S}|)$ if the clique-arrangement of $G$ is given, that is in ${\cal O}(n)$.
\begin{myclaim}\label{claim:compute-k-dependent}
All the $\ensuremath{K}$-dependent vertices in $\ensuremath{S}$ can be computed in total ${\cal O}(nm\log{n})$-time.
\end{myclaim}
\begin{proofclaim}
For every clique-intersection $\ensuremath{X} \in \CI{G}$, we compute $\ensuremath{X} \cap \ensuremath{S}$ and $\ensuremath{X} \cap \ensuremath{K}$.
This can be done in ${\cal O}(|\ensuremath{X}|)$-time assuming a trivial pre-processing in ${\cal O}(|\ensuremath{S}|+|\ensuremath{K}|)$-time for marking all the vertices in $\ensuremath{S}$ and in $\ensuremath{K}$, respectively.
Then, if $ 1 = |\ensuremath{X} \cap \ensuremath{S}| < |\ensuremath{X} \cap \ensuremath{K}|$ the unique vertex of $\ensuremath{X} \cap \ensuremath{S}$ is $\ensuremath{K}$-dependent.
Conversely, it follows from the definition that any $\ensuremath{K}$-dependent vertex in $\ensuremath{S}$ can be computed this way.
The total running time is in ${\cal O}(\sum_{\ensuremath{X} \in \CI{G}}|\ensuremath{X}|) = {\cal O}(n |\CI{G}|)$.
Since $\CI{G}$ is exactly the vertex-set of the clique-arrangement of $G$, by Theorem~\ref{thm:clique-arrangement} we get ${\cal O}(n |\CI{G}|) = {\cal O}(nm\log{n})$.
\end{proofclaim}
We recall that there are ${\cal O}(n)$ minimal separators in $G$.
Therefore our above approach only requires a pre-processing in total ${\cal O}(n^2m\log{n})$-time, that is in $o(n^5m)$.
\end{proof}
\begin{remark}\label{rk:extension-minsep}
We only use the fact that $\ensuremath{S}$ is a minimal separator when we process the so-called ``sandwiched vertices''.
All other arguments in our proof stay valid for clique-intersections.
Furthermore, as already observed for Lemma~\ref{lem:almost-simplicial-characterization}, such ``sandwiched vertices'' do not exist in maximal cliques.
Therefore, we can also use the algorithm of Theorem~\ref{thm:minsep} in order to generate, for any maximal clique $\ensuremath{K}_i$ without a $\ensuremath{K}_i$-free vertex, all possible subtrees $\unlabeledsubtree{\ensuremath{K}_i}$ of diameter at most $3$ in any well-structured $4$-Steiner root of $G$.
\end{remark}
\subsection{Case of a Leaf Node}\label{sec:leaf-case}
In this section, we generalize the construction of Theorem~\ref{thm:minsep} to the maximal cliques that can be leaves in a rooted clique-tree.
For that, we use a well-known decomposition of these maximal cliques into a unique minimal separator and a set of simplicial vertices.
\begin{theorem}\label{thm:leaf}
Given $G=(V,E)$ and a rooted clique-tree $\cliquetree{G}$ of $G$, let $\ensuremath{K}_i \in \MAXK{G}$ be a leaf.
We can construct, in time polynomial in $|\ensuremath{K}_i|$, a set ${\cal T}_i$ of $4$-Steiner roots for $G_i := G[\ensuremath{K}_i]$ with the following additional property: In any {\em well-structured} $4$-Steiner root $\tree$ of $G$, there exists $\labeledsubtree[2]{i}{} \in {\cal T}_i$ Steiner-equivalent to $\unlabeledsubtree{\ensuremath{K}_i}$.
\end{theorem}
\begin{proof}
Let $\ensuremath{K}_{p(i)}$ be the father node of $\ensuremath{K}_i$.
By Theorem~\ref{thm:clique-tree-pties}, $\ensuremath{S}_i := \ensuremath{K}_i \cap \ensuremath{K}_{p(i)}$ is a minimal separator.
We compute the family ${\cal T}_{\ensuremath{S}_i}$ given by Theorem~\ref{thm:minsep}.
Then, in order to compute a candidate subtree $\labeledsubtree{i}{}$, to be added into ${\cal T}_i$, we consider all the subtrees $\labeledsubtree{\ensuremath{S}_i}{} \in {\cal T}_{\ensuremath{S}_i}$ and we proceed as follows.
We select a node in $\labeledsubtree{\ensuremath{S}_i}{}$ that we assume to be closest to $\centre{\labeledsubtree{i}{}}$ (hence, ${\cal O}(|V(\labeledsubtree{\ensuremath{S}_i}{})|) = {\cal O}(|\ensuremath{S}_i|)$ possibilities), and we set its distance to the center (this can only be $0,1$ or $2$).
In doing so, we can assume $\centre{\labeledsubtree{i}{}}$ to be added into $\labeledsubtree{\ensuremath{S}_i}{}$.
Finally, the vertices in $\ensuremath{K}_i \setminus \ensuremath{S}_i$ are all simplicial, and so, we can connect them to $\centre{\labeledsubtree{i}{}}$ as explained in Lemma~\ref{lem:almost-simplicial-placement} (one possibility up to Steiner equivalence).
Note that in doing so, we may also obtain solutions $\labeledsubtree{i}{}$ such that $diam(\labeledsubtree{i}{}) \neq 4$, that we will need to discard. See Fig.~\ref{fig:keaf-construction} for an illustration.
Overall, $|{\cal T}_i| = {\cal O}(|\ensuremath{S}_i||{\cal T}_{\ensuremath{S}_i}|) = {\cal O}(|\ensuremath{S}_i|^6)$.
\end{proof}
\begin{figure}
\centering
\includegraphics[width=.4\textwidth]{Fig/leaf-construction}
\caption{An execution of the algorithm of Theorem~\ref{thm:leaf}. The minimal separator has size two and induces a star. There is one simplicial vertex to add.}
\label{fig:keaf-construction}
\end{figure}
\input{superset}
\section{Preliminaries}\label{sec:prelim}
We refer to~\cite{BoM08} for any undefined graph terminology.
All graphs in this study are finite, simple (hence, with neither loops nor multiple edges), unweighted and connected -- unless stated otherwise.
Given a graph $G=(V,E)$, let $n := |V|$ and $m := |E|$.
The neighbourhood of a vertex $v \in V$ is defined as $N_G(v) := \{ u \in V \mid uv \in E \}$.
By extension, we define the neighbourhood of a set $S \subseteq V$ as $N_G(S) := \left( \bigcup_{v \in S} N_G(v) \right) \setminus S$.
The subgraph induced by any subset $U \subseteq V$ is denoted by $G[U]$.
For every $u,v \in V$, we denote by $dist_G(u,v)$ the minimum length (number of edges) of a $uv$-path.
The eccentricity of vertex $v$ is defined as $ecc_G(v) := \max_{u \in V} dist_G(u,v)$.
The radius and the diameter of $G$ are defined, respectively, as $rad(G) := \min_{v \in V} ecc_G(v)$ and $diam(G) := \max_{v \in V} ecc_G(v)$.
We denote by $\centre{G}$ the center of $G$, {\it a.k.a.} the vertices with minimum eccentricity.
\subsection{Problems considered}
The {\em $k^{\text{th}}$-power} of $G$, denoted $G^k$ has same vertex-set $V$ as $G$ and edge-set $\{ uv \mid 0 < dist_G(u,v) \leq k \}$.
We call $G$ a {\em $k$-Steiner power} if there is some tree \tree~such that $G$ is an induced subgraph of $\tree^k$.
Conversely, \tree~is called a {\em $k$-Steiner root} of $G$.
If in addition, $G$ has a $k$-Steiner root where all vertices in $V$ are leaves (degree-one nodes) then, we call $G$ a {\em $k$-leaf power}.
\begin{center}
\fbox{
\begin{minipage}{.95\linewidth}
\begin{problem}[\KSP]\
\label{prob:steiner-root}
\begin{description}
\item[Input:] A graph $G=(V,E)$.
\item[Output:] Is $G$ a $k$-Steiner power?
\end{description}
\end{problem}
\end{minipage}
}
\end{center}
\begin{center}
\fbox{
\begin{minipage}{.95\linewidth}
\begin{problem}[\KLP]\
\label{prob:leaf-power}
\begin{description}
\item[Input:] A graph $G=(V,E)$.
\item[Question:] Is $G$ a $k$-leaf power?
\end{description}
\end{problem}
\end{minipage}
}
\end{center}
\begin{theorem}[~\cite{BLS08}]\label{thm:reduction}
There is a linear-time reduction from \KLP~to \KSP[(k-2)]~for every $k \geq 3$.
\end{theorem}
If \tree~is any $k$-Steiner root of $G$ then, nodes in $V(G)$ are called {\em real}, whereas nodes in $V(\tree) \setminus V(G)$ are called {\em Steiner}.
We so define, for any $S \subseteq V(\tree)$ (for any subtree $\tree[2] \subseteq \tree$, resp.):
$$Real(S) := S \cap V(G) \ \text{and} \ Steiner(S) := S \setminus V(G)$$
(we define $Real(\tree[2]) := Real(V(\tree[2]))$ and $Steiner(\tree[2]) = Steiner(V(\tree[2]))$, resp.).
Note that throughout all this paper we consider two (sub)trees being equivalent if they are equal up to an appropriate identification of their Steiner nodes, namely (see also Fig.~\ref{fig:steiner-equiv}):
\begin{definition}\label{def:steiner-equiv}
Given $G=(V,E)$, we call any two trees $\tree,\tree[2]$ {\em Steiner-equivalent}, denoted $\tree \equiv_G \tree[2]$, if and only if $Real(\tree) = Real(\tree[2]) = S$ and there exists an isomorphism $\iota : V(\tree) \to V(\tree[2])$ such that $\iota(v) = v$ for any $v \in S$.
\end{definition}
\begin{figure}
\centering
\includegraphics[width=.5\textwidth]{Fig/steiner-equiv}
\caption{Two Steiner-equivalent trees. Cycles and rectangles represent real and Steiner nodes, respectively.}
\label{fig:steiner-equiv}
\end{figure}
\medskip
Finally, given a node-subset $X \subseteq V(\tree)$, \unlabeledsubtree{X} is the smallest subtree of \tree~such that $X \subseteq V(\unlabeledsubtree{X})$.
Note that for a vertex-subset $X \subseteq V$, this is the smallest subtree of \tree~such that $X \subseteq Real(\unlabeledsubtree{X})$.
Furthermore we observe $\induced{\tree}{X} \subseteq \unlabeledsubtree{X}$, with equality if and only if $\induced{\tree}{X}$ is connected.
\subsection{Algorithmic tool-kit: (Strongly) Chordal graphs}
Given $G=(V,E)$, we call it a {\em chordal} graph if every induced cycle in $G$ is a triangle.
If in addition, for every cycle of even length in $G$, there exists a chord between two vertices at an odd distance ($>1$) apart from each other in the cycle then, $G$ is termed {\em strongly chordal}.
Chordal graphs and strongly chordal graphs can be recognized in ${\cal O}(m)$-time and ${\cal O}(m\log{n})$-time, respectively~\cite{PaT87,RTL76}.
\smallskip
The following property is well-known:
\begin{theorem}[~\cite{ABNT16}]\label{thm:partial-characterization}
For every $k \geq 1$, every $k$-Steiner power is a strongly chordal graph.
\end{theorem}
\paragraph{Minimal separators and Clique-tree.}
Our main algorithmic tool in this paper is a {\em clique-tree} of $G$, defined as a tree $\cliquetree{G}$ whose nodes are the maximal cliques of $G$ and such that for every $v \in V$, the maximal cliques containing $v$ induce a subtree of $\cliquetree{G}$.
\begin{theorem}[~\cite{BlP93}]\label{thm:clique-tree-construction}
A graph $G=(V,E)$ is chordal if and only if it has a clique-tree.
Moreover if $G$ is chordal then, we can construct a clique-tree for $G$ in ${\cal O}(m)$-time.
\end{theorem}
An $uv$-separator is a subset $\ensuremath{S} \subseteq V \setminus \{u,v\}$ such that $u$ and $v$ are disconnected in $G \setminus \ensuremath{S}$.
If in addition, no strict subset of $\ensuremath{S}$ is an $uv$-separator then, $\ensuremath{S}$ is a {\em minimal} $uv$-separator.
A {\em minimal separator} of $G$ is a minimal $uv$-separator for some $u,v \in V$.
It is known that any minimal separator in a chordal graph $G$ is the intersection of two distinct maximal cliques of $G$.
Specifically, the following stronger relationship holds between minimal separators and clique-trees:
\begin{theorem}[~\cite{BlP93}]\label{thm:clique-tree-pties}
Given $G=(V,E)$ chordal, any of its clique-trees $\cliquetree{G}$ satisfies the following properties:
\begin{itemize}
\item For every edge $\ensuremath{K}_i\ensuremath{K}_j \in E(\cliquetree{G})$, $\ensuremath{K}_i \cap \ensuremath{K}_j$ is a minimal separator;
\item Conversely, for every minimal separator $\ensuremath{S}$ of $G$, there exist two maximal cliques $\ensuremath{K}_i,\ensuremath{K}_j$ such that $\ensuremath{K}_i\ensuremath{K}_j \in E(\cliquetree{G})$ and $\ensuremath{K}_i \cap \ensuremath{K}_j = \ensuremath{S}$.
\end{itemize}
\end{theorem}
Based on the above theorem, we can define $\edgeset{G}{\ensuremath{S}} := \{ \ensuremath{K}_i\ensuremath{K}_j \in E(\cliquetree{G}) \mid \ensuremath{K}_i \cap \ensuremath{K}_j = \ensuremath{S} \}$.
The cardinality $|\edgeset{G}{\ensuremath{S}}|$ of this subset does not depend on $\cliquetree{G}$~\cite{BlP93}.
We sometimes say that edges in $\edgeset{G}{\ensuremath{S}}$ are {\em labeled} by $\ensuremath{S}$.
\medskip
A {\em rooted} clique-tree of $G$ is obtained from any clique-tree $\cliquetree{G}$ by identifying an arbitrary maximal clique $\ensuremath{K}_0$ as its root.
Let $(\ensuremath{K}_q,\ensuremath{K}_{q-1},\ldots,\ensuremath{K}_1,\ensuremath{K}_0)$ be a postordering of $\cliquetree{G}$ (obtained by depth-first search).
For any $i > 0$, we define $\ensuremath{K}_{p(i)}$ as the father node of $\ensuremath{K}_i$.
The common intersection of $\ensuremath{K}_i$ with its father node is the minimal separator $\ensuremath{S}_i := \ensuremath{K}_i \cap \ensuremath{K}_{p(i)}$.
By convention, we set $\ensuremath{S}_0 := \emptyset$.
We refer to Fig.~\ref{fig:rooted-clique-tree} for an illustration.
We define $\cliquetree{G}^i$ as the subtree rooted at $\ensuremath{K}_i$, and let $G_i$ be the subgraph induced by all the maximal cliques in $V(\cliquetree{G}^i)$.
In particular, we have $\cliquetree{G}^0 = \cliquetree{G}$ and $G_0 = G$.
We also define $V_i := V(G_i)$ and $W_i := V_i \setminus \ensuremath{S}_i$ as shorthands.
We will use these above notations for rooted clique-trees throughout the remaining of our paper.
\begin{figure}
\centering
\includegraphics[width=.75\textwidth]{Fig/rooted-clique-tree}
\caption{A chordal graph $G$ (left) and a rooted clique-tree $\cliquetree{G}$ (right).}
\label{fig:rooted-clique-tree}
\end{figure}
\paragraph{Clique arrangement.}
We introduce a common generalization of both maximal cliques and minimal separators, that will play a key role in our analysis. Specifically, a {\em clique-intersection} in $G$ is the intersection of a subset of maximal cliques in $G$.
The family of all clique-intersections in $G$ is denoted by $\CI{G}$.
For strongly chordal graphs, it is known~\cite{NeR15} that every clique-intersection is the intersection of at most two maximal cliques.
In particular, a (nonempty) clique-intersection of a given strongly chordal $G$ is either: a maximal clique; or a minimal separator; or a {\em weak} minimal separator -- {\it i.e.}, whose removal strictly increases the distance between two vertices that remain in the graph (see~\cite{McK11}).
We denote by $\MAXK{G}, \SEP{G}$ and $\WSEP{G}$ the subfamilies of all the maximal cliques, minimal separators and weak minimal separators of $G$, respectively.
The {\em clique arrangement} of $G$ is the inclusion (directed) graph of the clique-intersections of $G$.
That is, there is a node for every clique-intersection, and there is an arc from $\ensuremath{X}$ to $\ensuremath{X}'$ if and only if we have $\ensuremath{X} \subseteq \ensuremath{X}'$.
\begin{theorem}[~\cite{NeR15}]\label{thm:clique-arrangement}
Given $G=(V,E)$ strongly chordal, the clique arrangement of $G$ can be constructed in ${\cal O}(m\log{n})$-time.
\end{theorem}
\input{highlights}
\section{Playing with the root}\label{sec:representation}
Some general relationships between $k$-Steiner roots and clique-intersections are proved in Section~\ref{sec:structure}, for any $k$.
These structural results will be the cornerstone of our algorithm and its analysis.
Before presenting all these properties, we establish several useful facts on trees in Section~\ref{sec:tree} (most of them being likely to be known).
\subsection{General results on trees}\label{sec:tree}
We first recall the {\em unimodality} property for the eccentricity function on trees (\ref{pty-lem:tree:1} below), as well as some other related properties.
They mostly follow from a seminal paper of Jordan~\cite{Jor69}.
-- See also~\cite{CDHVA18+} for a recent example of their applications to other graph problems. --
\begin{lemma}[folklore]\label{lem:tree}
The following hold for any tree $T$:
\begin{enumerate}[label=\textbullet,ref=P-\ref{lem:tree}.\theenumi]
\item\label{pty-lem:tree:1}({\small\ref{pty-lem:tree:1}.}) For every node $v \in V(T)$ we have $ecc_T(v) = dist_T(v, {\cal C}(T)) + rad(T)$;
\item\label{pty-lem:tree:2}({\small\ref{pty-lem:tree:2}.}) Every diametral path in $T$ contains all the nodes in ${\cal C}(T)$ (as its middle nodes);
\item\label{pty-lem:tree:3}({\small\ref{pty-lem:tree:3}.}) ${\cal C}(T)$ is reduced to a node if $diam(T)$ is even, and to an edge if $diam(T)$ is odd;
\item\label{pty-lem:tree:4}({\small\ref{pty-lem:tree:4}.}) $rad(T) = \left\lceil diam(T)/2 \right\rceil$.
\end{enumerate}
\end{lemma}
Based on the above, the following properties on subtree intersections can be derived:
\begin{lemma}\label{lem:tree-intersection}
Given a tree $T$ let $T_1,T_2$ be two subtrees such that $diam(T_1 \cap T_2) = diam(T_1)$.
Then, we have $diam(T_1 \cup T_2) = diam(T_2)$.
\end{lemma}
\begin{proof}
First we claim that ${\cal C}(T_1 \cap T_2) = {\cal C}(T_1)$.
Indeed, since $T_1 \cap T_2$ and $T_1$ are trees with equal diameter, and we have $T_1 \cap T_2 \subseteq T_1$, every diametral path for $T_1 \cap T_2$ is also a diametral path for $T_1$.
Furthermore, since on every diametral path in a tree, the middle nodes are exactly the center nodes (Prop.~\ref{pty-lem:tree:2}), we obtain as claimed that ${\cal C}(T_1 \cap T_2) = {\cal C}(T_1)$.
\begin{figure}[h!]
\centering
\includegraphics[width=.35\textwidth]{Fig/tree-intersections.pdf}
\caption{To the proof of Lemma~\ref{lem:tree-intersection}.}
\label{fig:tree-intersections}
\end{figure}
Then, let $x,y \in V(T_1 \cap T_2)$ be the two ends of a diametral path in the subtree $T_1 \cap T_2$.
We set $z \in \{x,y\}$ maximizing $dist_T(z,{\cal C}(T_2))$ and we claim that, for every $v_1 \in V(T_1)$, $dist_T(v_1,{\cal C}(T_2)) \leq dist_T(z,{\cal C}(T_2))$.
Before we prove this claim, let us explain why this proves the lemma.
Every node of $V(T_1)$ is at a distance $\leq dist_T(z,{\cal C}(T_2)) + rad(T_2)$ from any node in $V(T_2)$.
By unimodality (Prop.~\ref{pty-lem:tree:1}), $ecc_{T_2}(z) = dist_T(z,{\cal C}(T_2)) + rad(T_2) \leq diam(T_2)$, and so, $diam(T_1 \cup T_2) = diam(T_2)$.
Finally, in order to prove this above claim there are two cases.
\begin{itemize}
\item
First assume ${\cal C}(T_1) \subseteq {\cal C}(T_2)$.
We recall that since the unique $xy$-path in $T$ must contain all of ${\cal C}(T_1)$ (Prop.~\ref{pty-lem:tree:2}), there can be no component of $T \setminus {\cal C}(T_1)$ that contains both $x,y$.
In particular, there exists $z \in \{x,y\}$ such that no component of $T \setminus {\cal C}(T_1)$ can both contain $z$ and intersect ${\cal C}(T_2)\setminus {\cal C}(T_1)$.
Then, $dist_T(z,{\cal C}(T_2)) = dist_T(z,{\cal C}(T_1))$.
Furthermore by unimodality (Prop.~\ref{pty-lem:tree:1}) every node $v_1 \in V(T_1)$ has eccentricity $dist_T(v_1,{\cal C}(T_1)) + rad(T_1)$.
Since $z$ is an end in a diametral path of $T_1$ it maximizes $dist_T(z,{\cal C}(T_1))$, and so, for every $v_1 \in V(T_1)$ we have $dist_T(v_1,{\cal C}(T_2)) \leq dist_T(v_1,{\cal C}(T_1)) \leq dist_T(z,{\cal C}(T_1)) = dist_T(z,{\cal C}(T_2))$.
\item Otherwise, let $c \in {\cal C}(T_1)$ minimize $dist_T(c,{\cal C}(T_2))$.
Note that since we have ${\cal C}(T_1) \not\subseteq {\cal C}(T_2)$, there is a unique possible choice for $c$.
Furthermore, every $v_1 \in V(T_1)$ satisfies $dist_T(v_1,{\cal C}(T_2)) \leq dist_T(v_1,c) + dist_T(c,{\cal C}(T_2)) \leq rad(T_1) + dist_T(c,{\cal C}(T_2))$, and we will show this upper-bound is reached for at least one of $x$ or $y$.
Specifically, we can refine one observation from the previous case as follows: there exists $z \in \{x,y\}$ such that no component of $T \setminus {\cal C}(T_1)$ can both contain $z$ and intersect ${\cal C}(T_2)\setminus {\cal C}(T_1)$; and in the special case where ${\cal C}(T_1)$ is an edge, $c$ is not the closest central node to $z$.
In this situation, $dist_T(z,c) = rad(T_1)$ and the path between $z$ and ${\cal C}(T_2)$ goes by $c$.
See Fig.~\ref{fig:tree-intersections} for an illustration.
\end{itemize}
In both cases we obtain, as claimed, $dist_T(v_1,{\cal C}(T_2)) \leq dist_T(z,{\cal C}(T_2))$ for every $v_1 \in V(T_1)$.
\end{proof}
\begin{lemma}\label{lem:center-inclusion}
Given a tree $T$ let $T_1,T_2$ be two subtrees such that ${\cal C}(T_1) \subseteq {\cal C}(T_2)$.
Then, we have that $diam(T_1 \cup T_2) = \max\{diam(T_1),diam(T_2)\}$.
\end{lemma}
\begin{proof}
Since ${\cal C}(T_1) \subseteq {\cal C}(T_2)$ we have for every $v_1 \in V(T_1)$:
$$ecc_{T_1 \cup T_2}(v_1) \leq dist_{T}(v_1,{\cal C}(T_1)) + \max\{rad(T_1),rad(T_2)\}.$$
By the unimodality property (Property~\ref{pty-lem:tree:1}) we have that $dist_T(v_1,{\cal C}(T_1)) = ecc_{T_1}(v_1) - rad(T_1) \leq diam(T_1) - rad(T_1)$, and so by Property~\ref{pty-lem:tree:4}:
$$dist_T(v_1,{\cal C}(T_1)) \leq \left\lfloor diam(T_1)/2 \right\rfloor \leq \max\{ \left\lfloor diam(T_1)/2 \right\rfloor, \left\lfloor diam(T_2)/2 \right\rfloor \}.$$
In the same way, Property~\ref{pty-lem:tree:4} implies that:
$$\max\{rad(T_1),rad(T_2)\} = \max\{ \left\lceil diam(T_1)/2 \right\rceil, \left\lceil diam(T_2)/2 \right\rceil \}.$$
We so obtain that $ecc_{T_1 \cup T_2}(v_1) \leq \max\{ diam(T_1), diam(T_2) \}$.
\medskip
Then, for every $v_2 \in V(T_2)$:
\begin{align*}
ecc_{T_1 \cup T_2}(v_2) &\leq dist_T(v_2,{\cal C}(T_2)) + \max\{ rad(T_2), diam({\cal C}(T_2)) + rad(T_1) \} \\
&\leq dist_T(v_2,{\cal C}(T_2)) + \max\{ rad(T_2), 1 + rad(T_1) \}.
\end{align*}
We may assume $rad(T_1) \geq rad(T_2)$ since otherwise, $ecc_{T_1 \cup T_2}(v_2) \leq dist_T(v_2,{\cal C}(T_2)) + rad(T_2) = ecc_{T_2}(v_2) \leq diam(T_2)$ by unimodality (Property~\ref{pty-lem:tree:1}).
In particular we claim that it implies $diam(T_1) \geq diam(T_2)$.
Indeed, by Property~\ref{pty-lem:tree:4} we must have $\left\lceil diam(T_1)/2\right\rceil \geq \left\lceil diam(T_2)/2 \right\rceil$, and so $diam(T_1) \geq diam(T_2) - 1$.
Suppose for the sake of contradiction $diam(T_1) = diam(T_2) - 1$.
By the hypothesis we also have ${\cal C}(T_1) \subseteq {\cal C}(T_2)$.
Therefore, by Property~\ref{pty-lem:tree:3} we obtain that $diam(T_1)$ and $diam(T_2)$ must be even and odd, respectively.
But then, we cannot have $\left\lceil diam(T_1)/2\right\rceil \geq \left\lceil diam(T_2)/2 \right\rceil$, a contradiction.
So, we proved as claimed $diam(T_1) \geq diam(T_2)$.
There are now two cases to consider:
\begin{itemize}
\item Case $diam(T_1) = diam(T_2)$. Then, ${\cal C}(T_1) = {\cal C}(T_2)$ and we can strengthen our previous inequality as follows: $ecc_{T_1 \cup T_2}(v_2) \leq dist_T(v_2,{\cal C}(T_2)) + \max\{ rad(T_2), rad(T_1) \} \leq diam(T_2)$.
\item Case $diam(T_1) > diam(T_2)$. Recall that $dist_T(v_2,{\cal C}(T_2)) \leq \left\lfloor diam(T_2)/2 \right\rfloor$. In particular, either $diam(T_1) \geq diam(T_2) + 2$, and so, $dist_T(v_2,{\cal C}(T_2)) \leq \left\lfloor diam(T_1)/2 \right\rfloor - 1$; or $diam(T_1) = diam(T_2) + 1$ but then, since by the hypothesis we have ${\cal C}(T_1) \subseteq {\cal C}(T_2)$, by Property~\ref{pty-lem:tree:3} $diam(T_1)$ must be even, and so, $dist_T(v_2,{\cal C}(T_2)) \leq \left\lfloor diam(T_1)/2 \right\rfloor - 1$ also in this case.
Overall:
\begin{align*}
ecc_{T_1 \cup T_2}(v_2) &\leq dist_T(v_2,{\cal C}(T_2)) + \max\{ rad(T_2), diam({\cal C}(T_2)) + rad(T_1) \} \\
&\leq \left\lfloor diam(T_1)/2 \right\rfloor - 1 + rad(T_1) + 1 = diam(T_1).
\end{align*}
\end{itemize}
Therefore, in both cases we obtain $diam(T_1 \cup T_2) \leq \max\{diam(T_1),diam(T_2)\}$.
\end{proof}
\subsection{A structure theorem}\label{sec:structure}
We are now ready to state the main result in this section:
\begin{theorem}\label{thm:clique-intersection}
Given $G=(V,E)$ and $\tree$ any $k$-Steiner root of $G$, the following properties hold for any clique-intersection $\ensuremath{X} \in \CI{G}$:
\begin{enumerate}[label=\textbullet,ref=P-\ref{thm:clique-intersection}.\theenumi]
\item\label{pty-ci:1}({\small\ref{pty-ci:1}.}) We have $Real(\unlabeledsubtree{\ensuremath{X}}) = \ensuremath{X}$ and $diam(\unlabeledsubtree{\ensuremath{X}}) \leq k$;
\item\label{pty-ci:2}({\small\ref{pty-ci:2}.}) If $\labeledsubtree[2]{\ensuremath{X}}{} \supset \unlabeledsubtree{\ensuremath{X}}$ then, either $\ensuremath{X} = Real(\labeledsubtree[2]{\ensuremath{X}}{})$ or $diam(\labeledsubtree[2]{\ensuremath{X}}{}) > diam(\unlabeledsubtree{\ensuremath{X}})$;
\item\label{pty-ci:3}({\small\ref{pty-ci:3}.}) If $\centre{\unlabeledsubtree{\ensuremath{X}}} \subseteq \centre{\unlabeledsubtree{\ensuremath{X}'}}$ then, $\ensuremath{X} \cup \ensuremath{X}'$ is a clique of $G$.
\end{enumerate}
\end{theorem}
\begin{proof}
We prove each property separately.
({\it Proof of Property~\ref{pty-ci:1}.}) First assume $\ensuremath{X} \in \MAXK{G}$ to be a maximal clique.
Since all leaves of $\unlabeledsubtree{\ensuremath{X}}$ are in $\ensuremath{X}$, $diam(\unlabeledsubtree{\ensuremath{X}}) = \max_{u,v \in \ensuremath{X}} dist_{\tree}(u,v)$.
By the hypothesis $\tree$ is a $k$-Steiner root of $G$, and so, since $\ensuremath{X}$ is a clique of $G$, $\max_{u,v \in \ensuremath{X}} dist_{\tree}(u,v) \leq k$.
In particular, $diam(\unlabeledsubtree{\ensuremath{X}}) \leq k$, that implies in turn the vertices of $Real(\unlabeledsubtree{\ensuremath{X}})$ must induce a clique of $G$.
We can conclude that $Real(\unlabeledsubtree{\ensuremath{X}}) = \ensuremath{X}$ by maximality of $\ensuremath{X}$.
More generally, let $\ensuremath{X} = \bigcap_{i=1}^{\ell} \ensuremath{K}_i$, for some family $\ensuremath{K}_1,\ensuremath{K}_2,\ldots,\ensuremath{K}_{\ell} \in \MAXK{G}$.
Clearly, $\unlabeledsubtree{\ensuremath{X}} \subseteq \bigcap_{i=1}^{\ell} \unlabeledsubtree{\ensuremath{K}_i}$, and so, $\ensuremath{X} \subseteq Real(\unlabeledsubtree{\ensuremath{X}}) \subseteq \bigcap_{i=1}^{\ell} Real(\unlabeledsubtree{\ensuremath{K}_i})$.
As we proved before, $Real(\unlabeledsubtree{\ensuremath{K}_i}) = \ensuremath{K}_i$ for every $1 \leq i \leq \ell$, and so, $Real(\unlabeledsubtree{\ensuremath{X}}) \subseteq \bigcap_{i=1}^{\ell} \ensuremath{K}_i = \ensuremath{X}$.
Altogether combined, we obtain that $Real(\unlabeledsubtree{\ensuremath{X}}) = \ensuremath{X}$.
({\it Proof of Property~\ref{pty-ci:2}.}) Let $\labeledsubtree[2]{\ensuremath{X}}{} \supset \unlabeledsubtree{\ensuremath{X}}$ be such that $diam(\labeledsubtree[2]{\ensuremath{X}}{}) = diam(\unlabeledsubtree{\ensuremath{X}})$.
We claim $Real(\labeledsubtree[2]{\ensuremath{X}}{}) = \ensuremath{X}$, that will prove the second part of the theorem.
Indeed, for any maximal clique $\ensuremath{K}_j$ that contains $\ensuremath{X}$, we have $diam(\unlabeledsubtree{\ensuremath{K}_j} \cap \labeledsubtree[2]{\ensuremath{X}}{}) \geq diam(\unlabeledsubtree{\ensuremath{X}}) = diam(\labeledsubtree[2]{\ensuremath{X}}{})$, and so, $diam(\unlabeledsubtree{\ensuremath{K}_j} \cup \labeledsubtree[2]{\ensuremath{X}}{}) = diam(\unlabeledsubtree{\ensuremath{K}_j}) \leq k$ by Lemma~\ref{lem:tree-intersection}.
It implies $Real(\labeledsubtree[2]{\ensuremath{X}}{}) \subseteq \ensuremath{K}_j$.
Furthermore, since $\ensuremath{X} \in \CI{G}$, \ensuremath{X}~is exactly the intersection of all the maximal cliques $\ensuremath{K}_j$ that contains it, thereby proving the claim.
({\it Proof of Property~\ref{pty-ci:3}.}) Finally, assume $\centre{\unlabeledsubtree{\ensuremath{X}}} \subseteq \centre{\unlabeledsubtree{\ensuremath{X}'}}$.
By Lemma~\ref{lem:center-inclusion} we obtain that $diam(\unlabeledsubtree{\ensuremath{X}} \cup \unlabeledsubtree{\ensuremath{X}'}) = \max\{diam(\unlabeledsubtree{\ensuremath{X}}),diam(\unlabeledsubtree{\ensuremath{X}'})\} \leq k$.
In particular, $\ensuremath{X} \cup \ensuremath{X}'$ must be a clique of $G$.
\end{proof}
\begin{remark}\label{rk:min-sep-chain}
Property~\ref{pty-ci:2} implies that in any $k$-Steiner power $G$, there can be no chain of more than $k$ minimal separators ordered by inclusion.
Indeed, let $\ensuremath{S}_1 \subset \ensuremath{S}_2 \subset \ldots \subset \ensuremath{S}_{\ell}$ be such a chain.
Then, in any $k$-Steiner root $\tree$ of $G$, $0 \leq diam(\unlabeledsubtree{\ensuremath{S}_1}) < diam(\unlabeledsubtree{\ensuremath{S}_2}) < \ldots < diam(\unlabeledsubtree{\ensuremath{S}_{\ell}}) < k$.
\end{remark}
\begin{remark}\label{rk:size-subtrees}
Given $G = (V,E)$ and a $k$-Steiner root $\tree$ of $G$, we can also easily derive from Property~\ref{pty-ci:1} that we have $|V(\unlabeledsubtree{\ensuremath{X}})| = {\cal O}(k \cdot |\ensuremath{X}|)$ for every clique-intersection $\ensuremath{X} \in \CI{G}$.
To see that, fix any $r \in V(\unlabeledsubtree{\ensuremath{X}})$.
For every $x \in \ensuremath{X}$ that is a leaf of $\unlabeledsubtree{\ensuremath{X}}$, the unique $xr$-path has length $\leq k$.
Overall, these above paths cover all of $\unlabeledsubtree{\ensuremath{X}}$, thereby proving as desired $|V(\unlabeledsubtree{\ensuremath{X}})| = {\cal O}(k \cdot |\ensuremath{X}|)$.
This fact is often used implicitly in our analysis.
\end{remark}
Before ending this section, we slightly strenghten Property~\ref{pty-ci:3} of Theorem~\ref{thm:clique-intersection}, as follows:
\begin{lemma}\label{lem:no-center-intersect}
Given $G=(V,E)$ and \tree~any $2k$-Steiner root of $G$, we have $\centre{\unlabeledsubtree{\ensuremath{K}_i}} \cap \centre{\unlabeledsubtree{\ensuremath{K}_j}} = \emptyset$ for any two different maximal cliques $\ensuremath{K}_i,\ensuremath{K}_j \in \MAXK{G}$.
\end{lemma}
\begin{proof}
Suppose for the sake of contradiction $\centre{\unlabeledsubtree{\ensuremath{K}_i}} \cap \centre{\unlabeledsubtree{\ensuremath{K}_j}} \neq \emptyset$, and let $r \in \centre{\unlabeledsubtree{\ensuremath{K}_i}} \cap \centre{\unlabeledsubtree{\ensuremath{K}_j}}$.
By Theorem~\ref{thm:clique-intersection} (Prop.~\ref{pty-ci:1}), $\max\{diam(\unlabeledsubtree{\ensuremath{K}_i}),diam(\unlabeledsubtree{\ensuremath{K}_j}) \leq 2k$. Then, it follows from Prop.~\ref{pty-lem:tree:4} of Lemma~\ref{lem:tree} that any vertex of $\unlabeledsubtree{\ensuremath{K}_i} \cup \unlabeledsubtree{\ensuremath{K}_j}$ is at a distance $\leq k$ from $r$ in $\tree$.
In particular, $diam(\unlabeledsubtree{\ensuremath{K}_i}\cup\unlabeledsubtree{\ensuremath{K}_j}) \leq 2k$, and so, $\ensuremath{K}_i \cup \ensuremath{K}_j$ is a clique of $G$.
The latter contradicts the fact that $\ensuremath{K}_i,\ensuremath{K}_j$ are maximal cliques.
\end{proof}
\section{Well-structured $4$-Steiner roots}\label{sec:restricted-root}
We refine our results in the previous Section when $k=4$.
Let us start motivating our approach.
Given $G=(V,E)$ we recall that one of our intermediate goals is to compute, by dynamic programming on a clique-tree, subsets ${\cal T}_i$ of $4$-Steiner roots for some collection of subgraphs $G_i$, with the following additional property: assuming $G$ is a $4$-Steiner power, there must be a partial solution in ${\cal T}_i$ which can be extended to a $4$-Steiner root for $G$ (cf. Sec.~\ref{sec:algo-highlight}, Step~\ref{step-3}).
Ideally, one should store {\em all} the possible $4$-Steiner roots for $G_i$, however this leads to a combinatorial explosion.
In order to (partly) overcome this issue, we introduce the following important notion:
\begin{definition}\label{def:x-free}
Given $G=(V,E)$ and $\ensuremath{X} \in \CI{G}$, a vertex $v \in \ensuremath{X}$ is called {\em \ensuremath{X}-constrained}
if it satisfies one of the following two conditions:
\begin{enumerate}
\item either there is another clique-intersection $\ensuremath{X}' \subset \ensuremath{X}$ such that $v \in \ensuremath{X}'$ and $|\ensuremath{X}'| \geq 2$ (we call $v$ {\em internally $\ensuremath{X}$-constrained});
\item or there exist $\ensuremath{X}_1,\ensuremath{X}_2 \in \CI{G}$ such that $\ensuremath{X} \subset \ensuremath{X}_1$ and $\ensuremath{X} \cap \ensuremath{X}_2 = \{v\} \subset \ensuremath{X}_1 \cap \ensuremath{X}_2$ (we call $v$ {\em $(\ensuremath{X},\ensuremath{X}_1,\ensuremath{X}_2)$-sandwiched}).
\end{enumerate}
A vertex $v \in \ensuremath{X}$ that is not $\ensuremath{X}$-constrained is called {\em $\ensuremath{X}$-free}.
\end{definition}
\begin{figure}[h!]
\centering
\includegraphics[width=.25\textwidth]{Fig/all-categories-x.pdf}
\caption{Five maximal cliques $\ensuremath{K}_1 = \{x_1,x_2,x_3\}, \ \ensuremath{K}_2 = \{u_1,u_2,u_3\}, \ \ensuremath{K}_3 = \{v_1,v_2,v_3\}, \ \ensuremath{K}_4 = \{y,x_1,x_2,u_1,v_1,u_3\} \ \text{and} \ \ensuremath{K}_5 = \{y,x_1,x_2,u_1,v_1,v_3\}$. In the clique-intersection $\ensuremath{X} = \{y,x_1,x_2,u_1,v_1\}$ both vertices $x_1,x_2$ are internally $\ensuremath{X}$-constrained (for $\ensuremath{X}' = \ensuremath{X} \cap \ensuremath{K}_1$), vertex $u_1$ is $(\ensuremath{X},\ensuremath{K}_4,\ensuremath{K}_2)$-sandwiched, vertex $v_1$ is $(\ensuremath{X},\ensuremath{K}_5,\ensuremath{K}_3)$-sandwiched and vertex $y$ is $\ensuremath{X}$-free.}
\label{fig:all-categories}
\end{figure}
We refer to Fig.~\ref{fig:all-categories} for an illustration of all possibilities.
Our study reveals on the one hand that \ensuremath{X}-constrained vertices have a very rigid structure.
It seems on the other hand that \ensuremath{X}-free vertices are completely unstructured and mostly responsible for the combinatorial explosion of possibilities for $\unlabeledsubtree{\ensuremath{X}}$.
As our main contribution in this section we prove that we can always force the \ensuremath{X}-free vertices to be {\em leaves} of this subtree $\unlabeledsubtree{\ensuremath{X}}$, thereby considerably reducing the number of possibilities for the latter.
Specifically:
\begin{theorem}\label{thm:x-free}
Let $G=(V,E)$ be a $4$-Steiner power.
There always exists a $4$-Steiner root \tree~of $G$ where, for any clique-intersection $\ensuremath{X} \in \CI{G}$:
\begin{enumerate}[label=\textbullet,ref=P-\ref{thm:x-free}.\theenumi]
\item\label{pty-x-free:1}({\small\ref{pty-x-free:1}.}) all the \ensuremath{X}-free vertices are leaves of $\unlabeledsubtree{\ensuremath{X}}$ with maximum eccentricity $diam(\unlabeledsubtree{\ensuremath{X}})$;
\item\label{pty-x-free:2}({\small\ref{pty-x-free:2}.}) there is a node $c \in \centre{\unlabeledsubtree{\ensuremath{X}}}$ such that for every \ensuremath{X}-free vertex $v$, except maybe one, $dist_{\tree}(v,c) = dist_{\tree}(v,\centre{\unlabeledsubtree{\ensuremath{X}}}) $;
\item\label{pty-x-free:3}({\small\ref{pty-x-free:3}.}) all the internal nodes on a path between $\centre{\unlabeledsubtree{\ensuremath{X}}}$ and a \ensuremath{X}-free vertex are Steiner nodes of degree two;
\item\label{pty-x-free:4}({\small\ref{pty-x-free:4}.}) and if $\ensuremath{X} \in \MAXK{G}$ and it has a \ensuremath{X}-free vertex then, $diam(\unlabeledsubtree{\ensuremath{X}}) = 4$.
\end{enumerate}
\end{theorem}
Theorem~\ref{thm:x-free} is proved by carefully applying a set of operations on an arbitrary $4$-Steiner root until it satisfies all of the desired properties.
We give two examples of such operations in Fig.~\ref{fig:s-free} and~\ref{fig:s-free-bis} (see the proof of Theorem~\ref{thm:x-free} in order to better understand these two examples).
It is crucial for the proof that in any $4$-Steiner root of $G$ all the minimal separators yield subtrees of diameter at most three.
In the remaining of the paper, we call a $4$-Steiner root with the above properties {\em well-structured}.
It will appear in Sec.~\ref{sec:ci-subtrees},~\ref{sec:encoding}, and~\ref{sec:greedy} that we only add partial solutions in the subsets ${\cal T}_i$ which are in some sense ``close'' to the subset of well-structured partial solutions.
We first prove Theorem~\ref{thm:x-free} for maximal cliques (Section~\ref{sec:simplicial}).
This first part of the proof looks easier to generalize to larger values of $k$.
Then, we prove the result in its full generality in Section~\ref{sec:x-free}.
\subsection{The case of (Almost) Simplicial vertices}\label{sec:simplicial}
Let $\ensuremath{K}_i \in \MAXK{G}$ be fixed.
We start giving a simple characterization of $\ensuremath{K}_i$-free vertices in terms of simplicial vertices and cut-vertices.
Then, we prove Theorem~\ref{thm:x-free} in the special case when $\ensuremath{X}$ is a maximal clique.
\begin{lemma}\label{lem:almost-simplicial-characterization}
Given $G=(V,E)$ and $\ensuremath{K}_i \in \MAXK{G}$, a vertex $v \in \ensuremath{K}_i$ is $\ensuremath{K}_i$-free if and only if:
\begin{itemize}
\item either it is simplicial;
\item or it is a cut-vertex, and there is no other minimal separator of $G$ contained into $\ensuremath{K}_i$ that can also contain $v$.
\end{itemize}
\end{lemma}
\begin{proof}
By maximality of $\ensuremath{K}_i$, a vertex $v \in \ensuremath{K}_i$ can only be either $\ensuremath{K}_i$-free or {\em internally} $\ensuremath{K}_i$-constrained.
In particular, $v$ is $\ensuremath{K}_i$-free if and only if for any other $\ensuremath{K}_j \in \MAXK{G}$ we have either $v \notin\ensuremath{K}_j$ or $\ensuremath{K}_i \cap \ensuremath{K}_j = \{v\}$.
As an extremal case, a vertex $v \in \ensuremath{K}_i$ is $\ensuremath{K}_i$-free if is not contained into any other maximal clique, and that is the case if and only if $v$ is simplicial.
Thus, from now on assume $v$ is not simplicial.
If $v \in \ensuremath{K}_i \cap \ensuremath{K}_j$ then, in any clique-tree $\cliquetree{G}$ of $G$, the vertex $v$ and more generally, all of $\ensuremath{K}_i \cap \ensuremath{K}_j$, is contained into all the minimal separators that label an edge of the $\ensuremath{K}_i\ensuremath{K}_j$-path in $\cliquetree{G}$.
This implies that there is always a largest clique-intersection $\ensuremath{X} \subset \ensuremath{K}_i$ containing $v$ that is a minimal separator.
Hence a non simplicial $v \in \ensuremath{K}_i$ is $\ensuremath{K}_i$-free if and only if it is a cut-vertex and there is no other minimal separator in $\ensuremath{K}_i$ that contains this vertex.
\end{proof}
\begin{lemma}\label{lem:almost-simplicial-placement}
Let $G=(V,E)$ be a $4$-Steiner power.
There exists a $4$-Steiner root $\tree$ of $G$ such that the following hold for any maximal clique $\ensuremath{K}_i$:
\begin{itemize}
\item If there is at least one $\ensuremath{K}_i$-free vertex then, $diam(\unlabeledsubtree{\ensuremath{K}_i}) = 4$;
\item every $\ensuremath{K}_i$-free vertex $v$ is a leaf of $\unlabeledsubtree{\ensuremath{K}_i}$. Moreover $dist_{\tree}(v,\centre{\unlabeledsubtree{\ensuremath{K}_i}}) = 2$ and the internal node onto the unique $v\centre{\unlabeledsubtree{\ensuremath{K}_i}}$-path is a degree-two Steiner node.
\end{itemize}
\end{lemma}
\begin{figure}
\centering
\includegraphics[width=\textwidth]{Fig/almost-simplicial}
\caption{The transformation of Lemma~\ref{lem:almost-simplicial-placement} applied to an arbitrary $4$-Steiner root.}
\label{fig:almost-simplicial}
\end{figure}
\begin{proof}
We give an illustration of the proof in Fig.~\ref{fig:almost-simplicial}.
First we pick an arbitrary $4$-Steiner root $\tree$ of $G$, that exists by the hypothesis.
Define ${\cal F}ree_1$ to be the set of all the cut-vertices in $G$ that are $\ensuremath{K}_i$-free for some $\ensuremath{K}_i \in \MAXK{G}$.
We now proceed by induction on $|{\cal F}ree_1|$.
Assume ${\cal F}ree_1 = \emptyset$ for the base case.
For every maximal clique $\ensuremath{K}_i$, by Lemma~\ref{lem:almost-simplicial-characterization}, the $\ensuremath{K}_i$-free vertices are exactly the simplicial vertices in $\ensuremath{K}_i$.
We consider all the simplicial vertices $v \in \ensuremath{K}_i$ sequentially, and we proceed as follows.
Let $c_i \in \centre{\unlabeledsubtree{\ensuremath{K}_i}}$ minimize $dist_{\tree}(v,c_i)$ (possibly, $v = c_i$).
We first replace $v$ by a Steiner node $\alpha$.
In doing so, we get a $4$-Steiner root $\tree[2]$ for $G \setminus v$.
Then, let $c_i'$ be either $c_i$ (if $c_i \neq v$) or $\alpha$ (if $c_i = v$).
We connect $v$ to $c_i'$ via a path of length exactly $4 - \max_{u \in \ensuremath{K}_i \setminus \{v\}}dist_{\tree[2]}(c_i',u)$ of which all internal nodes are Steiner.
In doing so, we obtain a tree $\tree[3]$ such that $Real(\tree[3]) = V$.
By construction, $\max_{u \in \ensuremath{K}_i \setminus \{v\}}dist_{\tree[2]}(c_i',u) \leq ecc_{\unlabeledsubtree{\ensuremath{K}_i}}(c_i)$.
Since in addition $diam(\unlabeledsubtree{\ensuremath{K}_i}) \leq 4$, we have from Prop.~\ref{pty-lem:tree:4} of Lemma~\ref{lem:tree} $ecc_{\unlabeledsubtree{\ensuremath{K}_i}}(c_i) \leq 2$.
It implies: $$dist_{\tree}(v,c_i) \leq ecc_{\unlabeledsubtree{\ensuremath{K}_i}}(c_i) \leq 4 - \max_{u \in \ensuremath{K}_i \setminus \{v\}}dist_{\tree[2]}(c_i',u) = dist_{\tree[3]}(v,c_i').$$
As a result, the distances between real nodes can only increase compared to $\tree$, and this new tree $\tree[3]$ we get keeps the property of being a $4$-Steiner root of $G$.
Furthermore, $diam(\labeledsubtree[3]{}{\ensuremath{K}_i}) = 4$ and the unique central node in $\centre{\labeledsubtree[3]{}{\ensuremath{K}_i}}$ is onto the $vc_i'$-path by construction.
We observe that $\ensuremath{K}_i$ and $v$ cannot falsify the properties of the lemma at any further loop.
Overall, after this first phase is done we may assume that all the simplicial vertices $v$ are contained into some maximal clique $\ensuremath{K}_i$ such that: $diam(\unlabeledsubtree{\ensuremath{K}_i}) = 4$, $v$ is a leaf of $\unlabeledsubtree{\ensuremath{K}_i}$ such that $dist_{\tree}(v,\centre{\unlabeledsubtree{\ensuremath{K}_i}}) = 2$, and the internal node onto the $v\centre{\unlabeledsubtree{\ensuremath{K}_i}}$-path is Steiner and has degree two.
From now on we assume ${\cal F}ree_1 \neq \emptyset$.
Let $v \in {\cal F}ree_1$ and let $C_1,C_2,\ldots,C_{\ell}$ be the connected components of $G \setminus v$.
For every $i \in \{1,2,\ldots,\ell\}$, the graph $G_i := G[C_i \cup \{v\}]$ is a $4$-Steiner power as this is a hereditary property.
Specifically, given a fixed $4$-Steiner root $\tree$ for $G$, we obtain a $4$-Steiner root $\tree[i]$ for $G_i$ by replacing every vertex in $V(G) \setminus V(G_i)$ by a Steiner node.
By induction, we can modify all the subtrees $\tree[i]$ into some new subtrees $\tree[i,2]$ that satisfy the properties of the lemma w.r.t. $G_i$.
Overall, by identifying all the $\tree[i,2]$'s at $v$, one obtains a tree $\tree[2]$.
We claim that $\tree[2]$ satisfies the two properties of the lemma.
Indeed, it follows from the characterization of Lemma~\ref{lem:almost-simplicial-characterization} that, for any maximal clique $\ensuremath{K}_j \subseteq C_i \cup \{v\}$, the $\ensuremath{K}_j$-free vertices in $G$ are still $\ensuremath{K}_j$-free vertices in $G_i$.
-- Note that in particular, if $v$ is $\ensuremath{K}_j$-free in $G$ then, $v$ is simplicial in $G_i$. --
Therefore, the claim is proved.
It remains now to show that $\tree[2]$ is indeed a $4$-Steiner root of $G$.
This is not the case only if there exist $x \in C_p, \ y \in C_q$ such that $p \neq q$ and $dist_{\tree[2]}(x,v) + dist_{\tree[2]}(v,y) \leq 4$.
Our construction implies $dist_{\tree[2]}(x,v) \geq dist_{\tree}(x,v)$ and $dist_{\tree[2]}(y,v) \geq dist_{\tree}(y,v)$.
But then, we should already have $dist_{\tree}(x,y) \leq 4$ in the original root $\tree$.
Thus, since $\tree$ is a $4$-Steiner root of $G$, this case cannot happen and $\tree[2]$ is also a $4$-Steiner root of the graph $G$.
\end{proof}
\subsection{The general case}\label{sec:x-free}
We are now ready to prove Theorem~\ref{thm:x-free} in its full generality:
\begin{proofof}{Theorem~\ref{thm:x-free}}
Let $\tree$ be such that the result holds for maximal cliques (such a $\tree$ exists by Lemma~\ref{lem:almost-simplicial-placement}).
For any $\ensuremath{X} \in \CI{G} \setminus \MAXK{G}$ with at most two elements, the properties of the theorem always hold (for any $\tree$).
We so only consider the clique-intersections $\ensuremath{X} \in \CI{G} \setminus \MAXK{G}$ with at least three elements.
Then, $diam(\unlabeledsubtree{\ensuremath{X}}) \leq 3$ by Theorem~\ref{thm:clique-intersection} -- Prop~\ref{pty-ci:2} ({\it i.e.}, because $\ensuremath{X}$ is strictly contained into some maximal clique $\ensuremath{K}$ and so, $diam(\unlabeledsubtree{\ensuremath{X}}) < diam(\unlabeledsubtree{\ensuremath{K}})$).
In what follows, we will often use properties of the subtree $\unlabeledsubtree{\ensuremath{X}}$ that only hold if $diam(\unlabeledsubtree{\ensuremath{X}}) \leq 3$; namely:
\begin{itemize}
\item $\unlabeledsubtree{\ensuremath{X}} \setminus \centre{\unlabeledsubtree{\ensuremath{X}}}$ is a collection of leaf-nodes;
\item there are at least two leaf-nodes ({\it i.e.}, because $|\ensuremath{X}| \geq 3$), and there is at least one leaf-node adjacent to every central node in \centre{\unlabeledsubtree{\ensuremath{X}}};
\item (as a direct consequence of the previous property) every central node in \centre{\unlabeledsubtree{\ensuremath{X}}} has at least two neighbours in \unlabeledsubtree{\ensuremath{X}}.
\end{itemize}
In particular, Property~\ref{pty-x-free:3} is now implied by Property~\ref{pty-x-free:1} as there can be no internal node on the path between a leaf and the closest central node.
In the same way, Property~\ref{pty-x-free:1} can be slightly simplified as {\em every} leaf has maximum eccentricity; hence, we only need to ensure that \ensuremath{X}-free vertices are leaves.
Finally, this also implies that $Steiner(\unlabeledsubtree{\ensuremath{X}}) \subseteq \centre{\unlabeledsubtree{\ensuremath{X}}}$, as all leaves of \unlabeledsubtree{\ensuremath{X}}~must be in \ensuremath{X} ({\it i.e.}, by the very definition of \unlabeledsubtree{\ensuremath{X}}).
The proof follows from different uses of a special operation on the tree $\tree$ that we now introduce:
\begin{operation}\label{op:move}
Let $\ensuremath{X} \in \CI{G} \setminus \MAXK{G}$ have size at least three and let $v \in \ensuremath{X}$.
We define $R_v$ to be the forest of all the subtrees in $\tree \setminus \unlabeledsubtree{\ensuremath{X}}$ that contain one node adjacent to $v$ and have {\em no} real node at a distance $\leq 4$ from $\ensuremath{X} \setminus \{v\}$ in $\tree$.
Let $Q_v$ be the subtree of $\tree$ that is induced by $R_v \cup \{v\}$.
We construct a new tree $\tree[2]$ from $\tree$ in two steps:
\begin{enumerate}
\item We remove $R_v$ and we replace $v$ by a Steiner node $\alpha_v$. In doing so, we obtain an intermediate tree denoted by $\labeledsubtree{v}{}$. Note that $\labeledsubtree{v}{}$ contains the subtree $\labeledsubtree{v}{}^{\ensuremath{X}}$: that is obtained from $\unlabeledsubtree{\ensuremath{X}}$ by replacing $v$ with $\alpha_v$ (and so, is isomorphic to $\unlabeledsubtree{\ensuremath{X}}$);
\item In order to obtain $\tree[2]$ from $\labeledsubtree{v}{}$, we add a copy of $Q_v$ and an edge $vc$ between $v$ and a center node of $\labeledsubtree{v}{}^{\ensuremath{X}}$
(possibly, $c = \alpha_v$).
\end{enumerate}
\end{operation}
We refer to Fig.~\ref{fig:s-free} and~\ref{fig:s-free-bis} for some particular applications of Operation~\ref{op:move}.
Furthermore in what follows we prove that under some conditions of use, this above Operation~\ref{op:move} always outputs a $4$-Steiner root $\tree[2]$ that is closer to satisfy all the properties of the theorem than $\tree$.
Specifically:
\begin{myclaim}\label{claim:pties-op}
Assume that $v$ is \ensuremath{X}-free and that every center node of $\unlabeledsubtree{\ensuremath{X}}$ is adjacent to a real node in $\ensuremath{X} \setminus \{v\}$.
Then, $\tree[2]$ keeps the property of being a $4$-Steiner root of $G$ if and only if the following conditions hold:
\begin{enumerate}[label=\textbullet,ref=\ref{claim:pties-op}.\alph{enumi}]
\item\label{cond-a}(Condition~\ref{cond-a}) either $dist_{\tree}(Real(R_v),v) \geq 4$ or $c$ is Steiner;
\item\label{cond-b}(Condition~\ref{cond-b}) if $c \neq \alpha_v$ then, $dist_{\labeledsubtree{v}{}}(c,V \setminus N_G[v]) > 3$.
\end{enumerate}
Moreover, for any $\ensuremath{X}' \in \CI{G} \setminus \{\ensuremath{X}\}$, if any of Properties~\ref{pty-x-free:1},~\ref{pty-x-free:2},~\ref{pty-x-free:3} or~\ref{pty-x-free:4} is satisfied for $\ensuremath{X}'$ in $\tree$ then, this stays so in $\tree'$.
\end{myclaim}
\begin{proofclaim}
First we prove that all the real vertices in $R_v$ are at a distance $> 4$ from $V(G) \setminus V(Q_v)$ in the original tree $\tree$ (Subclaim~\ref{subclaim:pties-op-a}).
This will help us in better understanding the structure of \tree~in the remaining of the proof.
\begin{subclaim}\label{subclaim:pties-op-a}
$dist_{\tree}(Real(R_v), V(G) \setminus V(Q_v)) > 4$.
\end{subclaim}
\begin{proofsubclaim}
Suppose for the sake of contradiction that there exist $x \in Real(R_v), y \notin V(Q_v)$ such that $dist_{\tree}(x,y) \leq 4$.
Then, $v$ is onto the unique $xy$-path in $\tree$.
Furthermore, recall that by definition of $R_v$, $dist_{\tree}(x,\ensuremath{X} \setminus \{v\}) > 4$.
By the hypothesis every central node of $\centre{\unlabeledsubtree{\ensuremath{X}}}$ is adjacent to a vertex of $\ensuremath{X} \setminus v$, and so we have $dist_{\tree}(v,\ensuremath{X} \setminus \{v\}) \leq 2$.
As a result, we obtain $dist_{\tree}(v,x) = 3$ and $dist_{\tree}(v,y) = 1$.
But then, $y$ is at a distance $\leq diam(\unlabeledsubtree{\ensuremath{X}})+1 \leq 4$ from any vertex in $\ensuremath{X}$, that implies the existence of a clique-intersection $\ensuremath{X}_1 \supseteq \ensuremath{X} \cup \{y\}$.
Let $\ensuremath{X}_2$ be any clique-intersection that contains all of $x,y,v$.
Since we assume $dist_{\tree}(x,\ensuremath{X} \setminus \{v\}) > 4$, $\ensuremath{X} \cap \ensuremath{X}_2 = \{v\}$ and in particular, $\ensuremath{X}_1 \neq \ensuremath{X}_2$.
It implies that $v$ is $(\ensuremath{X},\ensuremath{X}_1,\ensuremath{X}_2)$-sandwiched, a contradiction.
\end{proofsubclaim}
It follows from Subclaim~\ref{subclaim:pties-op-a} that in order for $\tree[2]$ to be a $4$-Steiner root for $G$, one must ensure $dist_{\tree[2]}(Real(R_v), V \setminus V(Q_v)) > 4$.
We then prove that this above condition is equivalent to Condition~\ref{cond-a}.
Indeed, note that we always have $dist_{\tree[2]}(Real(R_v), V \setminus V(Q_v)) > 4$ if $dist_{\tree}(v,Real(R_v)) \geq 4$.
Otherwise, by the hypothesis every center node of $\centre{\unlabeledsubtree{\ensuremath{X}}}$ is adjacent to a real node in $\ensuremath{X} \setminus \{v\}$, thereby implying $dist_{\tree}(v, V \setminus V(Q_v)) \leq dist_{\tree}(v, \ensuremath{X} \setminus \{v\}) \leq 2$, and so, $dist_{\tree}(v,Real(R_v)) = 3$.
Then, a necessary and sufficient condition for having that \\ $dist_{\tree[2]}(Real(R_v), V \setminus V(Q_v)) > 4$ is that $c$ is Steiner.
In the same way, Condition~\ref{cond-b} implies the necessary condition $dist_{\tree[2]}(u,v) > 4$ for every $u \notin N_G(v)$.
However, the above does not prove that $\tree[2]$ is a $4$-Steiner root of $G$ yet, as we also need to ensure $dist_{\tree[2]}(u,v) \leq 4$ for every $u \in N_G(v)$.
In order to prove this is the case, and to also prove the second part of the claim, we now consider the clique-intersections $\ensuremath{X}' \in \CI{G} \setminus \{\ensuremath{X}\}$ such that $v \in \ensuremath{X}'$.
(Note that if $v \notin \ensuremath{X}'$ then, $\unlabeledsubtree{\ensuremath{X}'} = \labeledsubtree[2]{}{\ensuremath{X}'}$ and so, the result of our claim trivially holds for such a $\ensuremath{X}'$).
Since we have $dist_{\tree}(Real(R_v), V \setminus V(Q_v)) > 4$ (Subclaim~\ref{subclaim:pties-op-a}), there are only two possibilities: either $\unlabeledsubtree{\ensuremath{X}'}$ is fully contained into $Q_v$ -- in which case it is not modified --; or it does not intersect $R_v$.
We then consider two different cases:
\begin{itemize}
\item Assume $\ensuremath{X} \subset \ensuremath{X}'$.
In particular, $\unlabeledsubtree{\ensuremath{X}'} \cap R_v = \emptyset$.
It implies that $\labeledsubtree[2]{}{\ensuremath{X}'}$ is obtained from $\unlabeledsubtree{\ensuremath{X}'}$ by replacing $v$ by a Steiner node (only if it were an internal node of $\unlabeledsubtree{\ensuremath{X}'}$) then, making of $v$ a leaf.
\begin{subclaim}\label{subclaim:pties-op-b}
$diam(\labeledsubtree[2]{}{\ensuremath{X}'}) = diam(\unlabeledsubtree{\ensuremath{X}'})$.
\end{subclaim}
\begin{proofsubclaim}
We divide the proof into two parts:
\begin{itemize}
\item In order to prove $diam(\labeledsubtree[2]{}{\ensuremath{X}'}) \leq diam(\unlabeledsubtree{\ensuremath{X}'})$, we consider an auxiliary subtree $\labeledsubtree[3]{}{\ensuremath{X}'}$: obtained from the original \unlabeledsubtree{\ensuremath{X}'}~by adding a leaf $v'$ to some arbitrary central node $c'$ in \centre{\unlabeledsubtree{\ensuremath{X}}}.
Note that \labeledsubtree[2]{}{\ensuremath{X}'}~is isomorphic to a subtree of $\labeledsubtree[3]{}{\ensuremath{X}'}$ for the choice of $c' = c$.
Furthermore since $c'$ has at least two neighbours in $\unlabeledsubtree{\ensuremath{X}} \subseteq \unlabeledsubtree{\ensuremath{X}'}$ we have:
$$diam\left(\unlabeledsubtree{\ensuremath{X}'} \cap N_{\labeledsubtree[3]{}{\ensuremath{X}'}}[c'] \right) = diam(N_{\unlabeledsubtree{\ensuremath{X}'}}[c']) = 2 = diam(N_{\labeledsubtree[3]{}{\ensuremath{X}'}}[c']).$$
We so deduce from Lemma~\ref{lem:tree-intersection} that: $$diam(\labeledsubtree[3]{}{\ensuremath{X}'}) = diam(\unlabeledsubtree{\ensuremath{X}'} \cup N_{\labeledsubtree[3]{}{\ensuremath{X}'}}[c']) = diam(\unlabeledsubtree{\ensuremath{X}'}).$$
In particular, $diam(\labeledsubtree[2]{}{\ensuremath{X}'}) \leq diam(\labeledsubtree[3]{}{\ensuremath{X}'}) = diam(\unlabeledsubtree{\ensuremath{X}'})$.
\item For the converse direction, it suffices to prove, if $\unlabeledsubtree{\ensuremath{X}'} \neq \labeledsubtree[2]{}{\ensuremath{X}'}$, the existence of a diametral path in $\unlabeledsubtree{\ensuremath{X}'}$ of which $v$ is not an end.
Since the ends of a diametral path must be leaves, we can restrict our study to the case where: $v$ is a leaf of $\unlabeledsubtree{\ensuremath{X}}$, and there is no subtree of $\unlabeledsubtree{\ensuremath{X}'} \setminus \unlabeledsubtree{\ensuremath{X}}$ that contains a neighbour of $v$ in $\tree$.
In particular, $\unlabeledsubtree{\ensuremath{X}} \neq \labeledsubtree[2]{}{\ensuremath{X}}$ (otherwise $\unlabeledsubtree{\ensuremath{X}'} = \labeledsubtree[2]{}{\ensuremath{X}'}$, and so we are done).
We deduce from the above that $v$ is adjacent to a central node $c' \in \centre{\unlabeledsubtree{\ensuremath{X}}}$, and $c' \neq c$ (otherwise $\unlabeledsubtree{\ensuremath{X}} = \labeledsubtree[2]{}{\ensuremath{X}}$, a contradiction).
Then, $\centre{\unlabeledsubtree{\ensuremath{X}}} = \{c,c'\}$ and so, $\unlabeledsubtree{\ensuremath{X}}$ is a bistar (diameter-three subtree).
Recall that both $c,c'$ have a neighbour in $\ensuremath{X} \setminus \{v\}$ by the hypothesis.
This implies that node $c'$ must have at least two neighbours in $\labeledsubtree{v}{}^{\ensuremath{X}} \setminus \{\alpha_v\}$; moreover each such neighbour must be on the path between $c'$ and a real node in $\ensuremath{X} \setminus \{v\}$.
But then, since there are at least three branches in $\unlabeledsubtree{\ensuremath{X}'} \setminus \{c'\}$, we can obtain as follows the existence of a diametral path in $\unlabeledsubtree{\ensuremath{X}'}$ of which $v$ is not an end: let us fix a longest path in $\unlabeledsubtree{\ensuremath{X}'}$ of which $v$ is an end; then, such a path goes by $c'$ and we can simply replace $v$ by the path between $c'$ and any real node in one of the two other branches of $\unlabeledsubtree{\ensuremath{X}'} \setminus \{c'\}$ by which this path does not go.
As a result, $diam(\labeledsubtree[2]{}{\ensuremath{X}'}) \geq diam(\unlabeledsubtree{\ensuremath{X}'})$.
\end{itemize}
Altogether combined, the above proves the subclaim that $diam(\labeledsubtree[2]{}{\ensuremath{X}'}) = diam(\unlabeledsubtree{\ensuremath{X}'})$.
\end{proofsubclaim}
By Subclaim~\ref{subclaim:pties-op-b}, we cannot change $diam(\unlabeledsubtree{\ensuremath{X}'})$ and so, it immediately implies that we cannot break Property~\ref{pty-x-free:4}.
The proof of this subclaim is actually more precise as it also shows that if $\labeledsubtree[2]{}{\ensuremath{X}'} \neq \unlabeledsubtree{\ensuremath{X}'}$ then, these two subtrees have a common diametral pair $(x,y)$, for some $x,y \neq v$.
In particular by considering the middle nodes on the unique $xy$-path in $T$ and $T'$, respectively, it follows from Prop.~\ref{pty-lem:tree:2} of Lemma~\ref{lem:tree} that we also have: $$\centre{\labeledsubtree[2]{}{\ensuremath{X}'}} = \begin{cases}
\centre{T\langle \ensuremath{X}'\rangle} \ \text{if} \ v \notin \centre{T\langle \ensuremath{X}'\rangle} \\
\left( \centre{T\langle \ensuremath{X}'\rangle} \setminus \{v\} \right) \cup \{\alpha_v\} \ \text{otherwise.} \end{cases}$$
Furthermore, for any $u \in \ensuremath{X}' \setminus \{v\}$, if $P_u$ denotes the $u\centre{\unlabeledsubtree{\ensuremath{X}'}}$-path in $\tree$ then, the $u\centre{\labeledsubtree[2]{}{\ensuremath{X}'}}$-path in $\tree[2]$ can be obtained from $P_u$ by replacing $v$ with $\alpha_v$.
-- This above analysis excludes $v$; however, $v$ cannot be $\ensuremath{X}'$-free because $v \in \ensuremath{X} \subset \ensuremath{X}'$ and $|\ensuremath{X}| \geq 3$. -- Hence, this above mapping implies that we cannot break Properties~\ref{pty-x-free:2} and~\ref{pty-x-free:3}.
It also implies $dist_{\tree[2]}(u,\centre{\labeledsubtree[2]{}{\ensuremath{X}'}}) = dist_{\tree}(u,\centre{\unlabeledsubtree{\ensuremath{X}'}})$ and so, by unimodality (Prop.~\ref{pty-lem:tree:1} of Lemma~\ref{lem:tree}) we did not change the eccentricity of any vertex $u \in \ensuremath{X}' \setminus \{v\}$.
Altogether combined, every $\ensuremath{X}'$-free vertex that was a leaf of $\unlabeledsubtree{\ensuremath{X}'}$ is also a leaf of \labeledsubtree[2]{}{\ensuremath{X}'} with same eccentricity (Property~\ref{pty-x-free:1} cannot be broken).
Finally, we also obtain $dist_{\tree[2]}(u,v) \leq 4$ for every $u \in \ensuremath{X}'$ ({\it i.e.}, $\tree[2]$ is a $4$-Steiner root of $G$).
\item Otherwise, $\ensuremath{X} \not\subseteq \ensuremath{X}'$ and we prove $\unlabeledsubtree{\ensuremath{X}'} = \labeledsubtree[2]{}{\ensuremath{X}'}$.
To see that, suppose for the sake of contradiction $\unlabeledsubtree{\ensuremath{X}'} \neq \labeledsubtree[2]{}{\ensuremath{X}'}$.
We first note this may be the case only if $\unlabeledsubtree{\ensuremath{X}'}$ is not fully contained into $Q_v$.
\begin{subclaim}\label{subclaim:deux-ex-machina}
$\unlabeledsubtree{\ensuremath{X}'}$ must intersect $\unlabeledsubtree{\ensuremath{X}} \setminus \{v\}$.
\end{subclaim}
\begin{proofclaim}
Suppose by contradiction that $\unlabeledsubtree{\ensuremath{X}'} \cap \unlabeledsubtree{\ensuremath{X}} = \{v\}$.
As we also assume $\unlabeledsubtree{\ensuremath{X}'}$ is not fully contained into $Q_v$, we have $\unlabeledsubtree{\ensuremath{X}'} \cap R_v = \emptyset$.
Then, $\unlabeledsubtree{\ensuremath{X}'}$ must intersect some subtree $\tree[sub]$ of $\tree \setminus \unlabeledsubtree{\ensuremath{X}}$ that is adjacent to $v$ but {\em not} in $R_v$.
Let $x \in \ensuremath{X}' \cap \tree[sub]$.
By the definition of $R_v$, there must exist $x' \in Real(\tree[sub])$ such that: $dist_{\tree}(x', \ensuremath{X} \setminus \{v\}) \leq 4$ (possibly, $x=x'$).
On one hand as we assume $v$ to be $\ensuremath{X}$-free, there must exist a clique-intersection $\ensuremath{X}_1 \supseteq \ensuremath{X} \cup \{x'\}$.
It implies $dist_{\tree}(x',v) \leq 2$ because $ecc_{\unlabeledsubtree{\ensuremath{X}}}(v) \geq 2$.
On the other hand, we also know that $dist_{\tree}(x,v) \leq 4$.
Furthermore note that there exists a $xx'$-path that does not go by $v$ in $\tree$ (otherwise, $x,x'$ would be in different subtrees of $\tree \setminus \unlabeledsubtree{\ensuremath{X}}$).
By considering the median node $r$ of the triple $x,x',v$ we so obtain: $dist_{\tree}(x',r) \leq 1$, $dist_{\tree}(x,r) \leq 3$, and so $dist_{\tree}(x,x') \leq 4$.
Let $\ensuremath{X}_2$ be a clique-intersection that contains all of $x,x',v$ (possibly, $\ensuremath{X}_2 = \ensuremath{X}'$).
There are two cases:
\begin{itemize}
\item If $\ensuremath{X} \not\subseteq \ensuremath{X}_2$ then, $\ensuremath{X} \cap \ensuremath{X}_2 = \{v\}$ (otherwise, $v$ would be internally $\ensuremath{X}$-constrained). But in this case, $v$ is $(\ensuremath{X},\ensuremath{X}_1,\ensuremath{X}_2)$-sandwiched, a contradiction.
\item Otherwise, $\ensuremath{X} \subseteq \ensuremath{X}_2$. However by the hypothesis $\ensuremath{X} \not\subseteq \ensuremath{X}'$, and so $\ensuremath{X} \cap \ensuremath{X}' = \{v\}$ (otherwise, $v$ would be internally $\ensuremath{X}$-constrained). It implies $v$ is $(\ensuremath{X},\ensuremath{X}_2,\ensuremath{X}')$-sandwiched, a contradiction.
\end{itemize}
As a result, $\unlabeledsubtree{\ensuremath{X}'}$ must intersect $\unlabeledsubtree{\ensuremath{X}} \setminus \{v\}$.
\end{proofclaim}
Finally, since $v$ is $\ensuremath{X}$-free any node $\beta \in V(\unlabeledsubtree{\ensuremath{X}'}) \cap \left( V(\unlabeledsubtree{\ensuremath{X}}) \setminus \{v\}\right)$ must be Steiner.
This leaves $\beta \in \centre{\unlabeledsubtree{\ensuremath{X}'}} \setminus \{v\}$ as the only possibility.
Furthermore, since $\beta$ is Steiner there must exist $y \in \ensuremath{X}'$ such that the unique $vy$-path in $\tree$ goes by $\beta$.
However, this implies by Lemma~\ref{lem:tree-intersection} $diam(\unlabeledsubtree{\ensuremath{X}' \cup N_{\tree}[\beta]}) = diam(\unlabeledsubtree{\ensuremath{X}'})$.
We recall that there exists at least one leaf node $u \in Real(N_{\tree}(\beta)) \setminus \{v\}$ by the hypothesis.
Thus, by Property~\ref{pty-ci:2} of Theorem~\ref{thm:clique-intersection} we have $u,v \in \ensuremath{X} \cap \ensuremath{X}'$, thereby contradicting that $v$ is $\ensuremath{X}$-free.
\end{itemize}
The claim directly follows from this above case analysis.
\end{proofclaim}
The proof is now divided into two main phases.
\begin{figure}[h!]
\centering
\includegraphics[width=.55\textwidth]{Fig/s-free.pdf}
\caption{Forcing the $\ensuremath{X}$-free vertices as leaves.}
\label{fig:s-free}
\end{figure}
\paragraph{Phase 1: Transformation into leaves} (see Fig.~\ref{fig:s-free} for an illustration).
Let $\ensuremath{X} \in \CI{G} \setminus \MAXK{G}, \ |\ensuremath{X}| \geq 3$ be fixed.
We first transform $\tree$ so that all the $\ensuremath{X}$-free vertices are leaves in $\unlabeledsubtree{\ensuremath{X}}$.
Assume the existence of a $\ensuremath{X}$-free vertex $v \in \ensuremath{X}$ that is not a leaf.
Note that we have $v \in \centre{\unlabeledsubtree{\ensuremath{X}}}$ because $diam(\unlabeledsubtree{\ensuremath{X}}) \leq 3$.
In particular, every node in $\centre{\unlabeledsubtree{\ensuremath{X}}}$ is adjacent to a leaf in $\ensuremath{X} \setminus \{v\}$.
We apply Operation~\ref{op:move} with $c=\alpha_v$ ({\it i.e.}, the Steiner node substituting $v$ in the intermediate tree $\labeledsubtree{v}{}$).
Since $c=\alpha_v$ and so, in particular $c$ is Steiner, both Conditions~\ref{cond-a} and~\ref{cond-b} of Claim~\ref{claim:pties-op} must hold.
Overall, by Claim~\ref{claim:pties-op} we can repeat the above transformation until all the $\ensuremath{X}$-free vertices are leaves of $\unlabeledsubtree{\ensuremath{X}}$.
\begin{figure}[h!]
\centering
\includegraphics[width=.55\textwidth]{Fig/s-free-bis.pdf}
\caption{Grouping the $\ensuremath{X}$-free vertices on a same side.}
\label{fig:s-free-bis}
\end{figure}
\paragraph{Phase 2: Grouping the $\ensuremath{X}$-free vertices} (see Fig.~\ref{fig:s-free-bis} for an illustration).
After Phase 1 is completed, the properties of the theorem are true for any $\ensuremath{X} \in \CI{G}$ such that $\unlabeledsubtree{\ensuremath{X}}$ is a star.
Thus, from now on assume $\unlabeledsubtree{\ensuremath{X}}$ is a bistar (diameter-three subtree).
Write $\centre{\unlabeledsubtree{\ensuremath{X}}} = \{c_0,c_1\}$ and assume that each $c_j$ is adjacent to two $\ensuremath{X}$-free vertices, denoted $v_j^1,v_j^2$.
\begin{itemize}
\item
For any $i \in \{1,2\}$, there is no vertex $x_i \in Real(R_{v_j^i})$ such that $dist_{\tree}(x_i,v_j^i) \leq 2$
(otherwise, $dist_{\tree}(x_i, \ensuremath{X} \setminus \{v_j^i\}) \leq dist_{\tree}(x_i,v_j^{3-i}) \leq 4$, a contradiction).
More specifically, either $dist_{\tree}(v_j^i, Real(R_{v_j^i})) \geq 4$, or $dist_{\tree}(v_j^i, Real(R_{v_j^i})) = 3$ but then $c_j$ must be Steiner (otherwise, $dist_{\tree}(x_i, \ensuremath{X} \setminus \{v_j^i\}) \leq dist_{\tree}(x_i,c_j) \leq 4$, a contradiction).
\item
Furthermore, we claim that we can have $dist_{\tree}(u,c_j) \leq 3$ only if $\ensuremath{X} \subseteq N_G[u]$.
Indeed, suppose for the sake of contradiction $dist_{\tree}(u,c_j) \leq 3$ and $\ensuremath{X} \not\subseteq N_G[u]$.
Let $\ensuremath{K}_j$ be a maximal clique which contains $\{u\} \cup (\ensuremath{X} \cap N_G(u))$.
Then, $\ensuremath{X}' = \ensuremath{K}_j \cap \ensuremath{X} = \ensuremath{X} \cap N_G(u)$.
Moreover, $\ensuremath{X}'$ contains $v_j^1,v_j^2$, thereby contradicting our assumption that these two vertices are $\ensuremath{X}$-free.
\end{itemize}
W.l.o.g., assume either $dist_{\tree}(v_j^i, Real(R_{v_j^i})) \geq 4$ for any $i,j$ or $c_0$ is Steiner.
If in addition both $c_0,c_1$ are Steiner nodes (real nodes, resp.) then, we further assume w.l.o.g. $c_0$ is adjacent to more $\ensuremath{X}$-free vertices than $c_1$.
We apply Operation~\ref{op:move} for $v = v_1^1$ and $c = c_0$.
Note that by construction, $c_0$ always satisfies Condition~\ref{cond-a} of Claim~\ref{claim:pties-op}.
Since we also have $dist_{\tree}(u,c_0) \leq 3 \Longrightarrow \ensuremath{X} \subseteq N_G[u]$, Condition~\ref{cond-b} of Claim~\ref{claim:pties-op} is satisfied.
Overall, we can repeat this transformation until $\ensuremath{X}$ satisfies all the properties stated in the theorem, that does not impact the properties of the other clique-intersections $\ensuremath{X}'$ by Claim~\ref{claim:pties-op}.
\end{proofof}
\section*{Acknowledgements}
The author would like to thank the Research Institute of the University of Bucharest (ICUB) that founded the postdoctoral project of which this paper is the outcome.
\bibliographystyle{alpha}
\subsection{Case of an internal node}\label{sec:super-selection}
Given $G=(V,E)$ chordal, let $\cliquetree{G}$ be an arbitrary rooted clique-tree of $G$ and let $\ensuremath{K}_i \in \MAXK{G}$ be an internal node of $\cliquetree{G}$.
We want to compute a polynomial-size representation for the family ${\cal F}_i$ of all possible subtrees $\unlabeledsubtree{\ensuremath{K}_i}$ in a well-structured $4$-Steiner root of $G$.
\smallskip
\noindent
{\bf Some preliminary observations.}
By Lemma~\ref{lem:almost-simplicial-placement} there always exists a root $\tree$ where all $\ensuremath{K}_i$-free vertices are leaves of $\unlabeledsubtree{\ensuremath{K}_i}$ and connected to $\centre{\unlabeledsubtree{\ensuremath{K}_i}}$ by a path of length two whose internal node is Steiner.
Thus, we can first assume for simplicity $\ensuremath{K}_i$ does not contain any $\ensuremath{K}_i$-free vertex --- such vertices, if they exist, will be added at the end of the construction.
Furthermore, as noticed earlier (Remark~\ref{rk:extension-minsep}) we can use the algorithmic proof of Theorem~\ref{thm:minsep} in order to generate all the subtrees $\unlabeledsubtree{\ensuremath{K}_i}$ of diameter at most three to be added in ${\cal F}_i$.
Summarizing, as a consequence of other results in this paper we are only interested in maximal cliques $\ensuremath{K}_i$ with no $\ensuremath{K}_i$-free vertex and in generating subtrees of diameter {\em exactly} four.
\smallskip
\noindent
{\bf Organization of this part.}
Our main tool for this task is a careful analysis of the intersections between the minimal separators in $\ensuremath{K}_i$ (Section~\ref{sec:minsep-intersections}).
Unfortunately, sometimes we cannot derive from this information a polynomial bound on the number of possible subtrees.
We identify the only degenerate case when this cannot be done, and show how to handle with it, in Section~\ref{sec:degenerate}.
Proposition~\ref{prop:internal} in Section~\ref{sec:compute-fi} will summarize our results for this part.
\subsubsection{Getting more from clique-intersections}\label{sec:minsep-intersections}
We will use the following lemma in order to prove our first result in this section:
\begin{lemma}\label{lem:real-center-bistar}
Let $G = (V,E)$ be strongly chordal, let $\ensuremath{S} \in \SEP{G}$, let $\ensuremath{K}$ be a maximal clique containing $\ensuremath{S}$ and let $R,c$ be such that $R \subset S$ and either $c \in R$ or $c$ is Steiner.
We can compute in ${\cal O}(nm\log{n})$-time a node $c'$ with the following properties:
\begin{itemize}
\item For any well-structured $4$-Steiner root $\tree$ of $G$ such that: $\unlabeledsubtree{\ensuremath{S}}$ is a bistar, $c \in \centre{\unlabeledsubtree{\ensuremath{S}}} \setminus \centre{\unlabeledsubtree{\ensuremath{K}}}$, and $Real(N_{\tree}[c]) = R$, there exists a well-structured root $\tree[2]$ with the same properties such that: $\centre{\unlabeledsubtree[2]{\ensuremath{K}}} = \{c'\}$, and $dist_{\tree[2]}(u,v) \geq dist_{\tree}(u,v)$ for every $u,v \in V$. Moreover, either $\tree \equiv_G \tree[2]$, or $\sum_{u,v \in V} dist_{\tree[2]}(u,v) > \sum_{u,v \in V} dist_{\tree}(u,v)$.
\end{itemize}
\end{lemma}
In order to better understand the significance of Lemma~\ref{lem:real-center-bistar}, assume that $\unlabeledsubtree{\ensuremath{S}}$ should be a bistar in the final solution we want to compute, and that we already identified one of its center node $c$ and the set of real nodes $R$ to which this node must be adjacent.
What this above property says is that there is essentially one canonical way to compute the bistar given $R$ and $c$.
The more technical condition $dist_{\tree[2]}(u,v) \geq dist_{\tree}(u,v)$ is simply there in order to ensure that by doing so, we cannot miss a solution of an intermediate problem we call {\sc Distance-Constrained Root} ({\it i.e.}, see Section~\ref{sec:encoding}).
Finally, our condition on the potential function $\sum_{u,v \in V} dist_{\tree[2]}(u,v)$ increasing ensures that we can repeatedly apply our ``canonical completion'' method for arbitrarily many minimal separators $\ensuremath{S}$.
\begin{proof}
We define a node $c' \notin V \setminus R$ (either in $R$ or Steiner), as follows:
\begin{itemize}
\item If there exists a clique-intersection $\ensuremath{X} \subset \ensuremath{S}$ such that $\ensuremath{X} \not\subseteq R$ and $\ensuremath{X} \cap (R \setminus \{c\}) \neq \emptyset$ then, we pick $c' \in (\ensuremath{X} \cap R) \setminus \{c\}$;
\item Else, if there exists $c' \in R \setminus c$ that is $\ensuremath{K}$-dependent ({\it i.e.}, $c'$ is $(\ensuremath{S},\ensuremath{K},\ensuremath{X}_2)$-sandwiched for some $\ensuremath{X}_2 \in \CI{G}$) then, we output $c'$.
\item Otherwise, $c'$ is Steiner.
\end{itemize}
By using our previous Claims~\ref{claim:compute-parts} and~\ref{claim:compute-k-dependent}, we can compute the above $c'$ in ${\cal O}(nm\log{n})$-time.
\medskip
\noindent
{\bf Correctness.}
In what follows, let $\tree$ be any well-structured $4$-Steiner root of $G$ such that $\unlabeledsubtree{\ensuremath{S}}$ is a bistar, $c \in \centre{\unlabeledsubtree{\ensuremath{S}}} \setminus \centre{\unlabeledsubtree{\ensuremath{K}}}$, and $Real(N_{\tree}[c]) = R$.
Furthermore, let $\centre{\unlabeledsubtree{\ensuremath{S}}} = \{c,c_2\}$.
We divide the proof into the following claims:
\begin{myclaim}\label{claim:op2-before}
If there exists a clique-intersection $\ensuremath{X} \subset \ensuremath{S}$ such that $\ensuremath{X} \not\subseteq R$ and $\ensuremath{X} \cap (R \setminus \{c\}) \neq \emptyset$ then, $c' = c_2$.
\end{myclaim}
\begin{proofclaim}
As we have $\ensuremath{X} \not\subseteq R$ and $Real(N_T[c]) = R$, $\ensuremath{X}$ cannot contain any leaf node of $\unlabeledsubtree{\ensuremath{S}}$ adjacent to $c$.
Thus, the only possible node in $(\ensuremath{X} \cap R) \setminus \{c\}$ must be $c_2$.
\end{proofclaim}
\begin{myclaim}\label{claim:op2-before-b}
If there exists $c' \in R \setminus c$ that is $\ensuremath{K}$-dependent then, $c' = c_2$.
\end{myclaim}
\begin{proofclaim}
Suppose for the sake of contradiction $c' \neq c_2$.
In particular, since $Real(N_{\tree}[c]) = R$, $c'$ is a leaf of $\unlabeledsubtree{\ensuremath{S}}$ that is adjacent to $c$.
Let $\ensuremath{X}_2 \in \CI{G}$ be such that $c'$ is $(\ensuremath{S},\ensuremath{K},\ensuremath{X}_2)$-sandwiched and let $x \in (\ensuremath{K} \cap \ensuremath{X}_2) \setminus \{c'\}$.
As already proved for Claim~\ref{claim:exclusive-dependency}, $dist_{\tree}(x,c_2) = 2$ and $dist_{\tree}(x,c) = 3$.
In particular we have $dist_{\tree}(c',x) = 4$.
Since we have $c',x \in \ensuremath{X}_2$, we must have $diam(\unlabeledsubtree{\ensuremath{X}_2}) = 4$ and the central node of $\unlabeledsubtree{\ensuremath{X}_2}$ must be the central node onto the $c'x$-path in $\tree$, that is $c_2$.
However, since $\ensuremath{K} \neq \ensuremath{X}_2$ (because $\ensuremath{S} \not\subseteq \ensuremath{X}_2$) the latter contradicts Lemma~\ref{lem:no-center-intersect}.
\end{proofclaim}
By Claims~\ref{claim:op2-before} and~\ref{claim:op2-before-b} we may assume from now on $c'$ to be Steiner.
Assume $c_2 \in R$, {\it i.e.}, $c_2$ is not Steiner (otherwise, we are done).
We now reuse a transformation that we introduced in the proof of Theorem~\ref{thm:x-free} ({\it i.e.}, Operation~\ref{op:move} for $v = c_2$ and $c$).
Specifically, we define $Q_{c_2}$ as the subtree of $\tree$ induced by the union of $c_2$ with all the components of $\tree \setminus V(\unlabeledsubtree{\ensuremath{S}})$ that are adjacent to $c_2$ {\em and} do not contain any real node at a distance $\leq 4$ from $\ensuremath{S} \setminus \{c_2\}$ in $\tree$.
We create a new tree $\tree[2]$ by first removing $V(Q_{c_2}) \setminus \{c_2\}$, then replacing $c_2$ by the Steiner node $c'$, and finally adding a copy of $Q_{c_2}$ and the edge $cc_2$.
In doing so, we can only increase the distances in $\tree[2]$ compared to $\tree$, and these distances strictly increase at least between $c_2$ and all the leaves of $\unlabeledsubtree{\ensuremath{S}}$ to which it was previously adjacent.
\begin{figure}[h!]
\centering
\includegraphics[width=.5\textwidth]{Fig/canonical-bistar}
\caption{To the proof of Lemma~\ref{lem:real-center-bistar}.}
\label{fig:canonical-bistar}
\end{figure}
\begin{myclaim}\label{claim:op-2}
$\tree[2]$ keeps the property of being a well-structured $4$-Steiner root of $G$
\end{myclaim}
Note that proving Claim~\ref{claim:op-2} will prove the lemma.
\begin{proofclaim}
This part of the proof closely follows Claim~\ref{claim:pties-op}.
First as our construction can only increase distances in the Steiner root, we can easily deduce that:
$$\forall uv \notin E, \ dist_{\tree[2]}(u,v) \geq dist_{\tree}(u,v) > 4.$$
However, we also need to check that conversely, $dist_{\tree[2]}(u,v) \leq 4$ for all $uv \in E$.
For that, we prove as an intermediate subclaim that:
$$dist_{\tree}(Real(Q_{c_2} \setminus \{c_2\}), V \setminus Q_{c_2}) > 4.$$
Indeed, suppose by contradiction there exist $x \in Real(Q_{c_2}) \setminus \{c_2\}, y \in V \setminus V(Q_{c_2})$ such that $dist_{\tree}(x,y) \leq 4$.
The unique $xy$-path in $\tree$ goes by $c_{2}$ (see Fig.~\ref{fig:canonical-bistar} for an illustration).
Furthermore by the definition of $Q_{c_2}$ we have $dist_{\tree}(x, \ensuremath{S} \setminus \{c_2\}) > 4$.
But then since $c_2 \in \centre{\unlabeledsubtree{\ensuremath{S}}}$ we have $dist_{\tree}(c_2,\ensuremath{S} \setminus \{c_2\}) = 1$, and so $dist_{\tree}(x,c_2) \geq 4$.
It implies $dist_{\tree}(x,y) > 4$, a contradiction.
This above subclaim implies that if $dist_{\tree[2]}(u,v) > 4$ for some $uv \in E$ then, $c_2 \in \{u,v\}$.
In order to prove that no such a pair $uv$ can exist, and that $\tree[2]$ is well-structured, we consider all the clique-intersections $\ensuremath{X}'$ that contain $c_2$.
There are three cases:
\begin{itemize}
\item Case $\ensuremath{X}' \subset \ensuremath{S}$. Then, either $\ensuremath{X}' = \{c_2\}$ and we are done, or $|\ensuremath{X}'| \geq 2$. Furthermore in the latter subcase we have $\ensuremath{X}' \subseteq R$ (otherwise, this would imply the existence of a $\ensuremath{X}$ as earlier defined, that would contradict Claim~\ref{claim:op2-before}). As a result we have $\unlabeledsubtree{\ensuremath{X}'} = \labeledsubtree[2]{}{\ensuremath{X}'}$.
\item Case $\ensuremath{X}' \supseteq \ensuremath{S}$. We can observe that $\unlabeledsubtree{\ensuremath{X}'} \cap Q_{c_2} = \{c_2\}$ since we proved above that we have $dist_{\tree}(Real(Q_{c_2} \setminus \{c_2\}), V \setminus Q_{c_2}) > 4$.
In particular, $\labeledsubtree[2]{}{\ensuremath{X}'}$ is obtained from $\unlabeledsubtree{\ensuremath{X}'}$ by replacing $c_2$ by a Steiner node (only if it were an internal node of $\unlabeledsubtree{\ensuremath{X}'}$) then, making of $c_2$ a leaf.
Furthermore, since there is at least one leaf adjacent to each center node in $\unlabeledsubtree{S}$, we can prove as for Subclaim~\ref{subclaim:pties-op-b} that $diam(\labeledsubtree[2]{}{\ensuremath{X}'}) = diam(\unlabeledsubtree{\ensuremath{X}'})$.
As already observed in Claim~\ref{claim:pties-op}, it implies that all properties of Theorem~\ref{thm:x-free} are preserved provided that $c_2$ is not $\ensuremath{X}'$-free.
So we only need to prove this is always the case. On one hand, $c_2$ is not $\ensuremath{S}$-free because $c_2$ is not a leaf of $\unlabeledsubtree{\ensuremath{S}}$ and we assume $\tree$ is well-structured.
On the other hand, $c_2$ is not $\ensuremath{X}'$-free for any $\ensuremath{X}' \supset \ensuremath{S}$, because $c_2 \in \ensuremath{S} $ and $|\ensuremath{S}| \geq 3$.
\item Otherwise, in all other cases we prove $\labeledsubtree[2]{}{\ensuremath{X}'} = \unlabeledsubtree{\ensuremath{X}'}$.
To see that, first note that it may not be the case only if $\unlabeledsubtree{\ensuremath{X}'}$ is not fully contained into $Q_{c_2}$ (and so, $\unlabeledsubtree{\ensuremath{X}'} \cap Q_{c_2} = \{c_2\}$).
We prove as a subclaim that if $\labeledsubtree[2]{}{\ensuremath{X}'} \neq \unlabeledsubtree{\ensuremath{X}'}$ then, $\unlabeledsubtree{\ensuremath{X}'}$ must intersect $\unlabeledsubtree{\ensuremath{S}} \setminus \{c_2\}$.
Indeed, otherwise $\unlabeledsubtree{\ensuremath{X}'}$ must intersect some subtree $\tree[sub]$ of $\tree \setminus \unlabeledsubtree{\ensuremath{S}}$ that is not in $Q_{c_2}$.
Let $x \in \ensuremath{X}' \cap \tree[sub]$.
By the definition of $Q_{c_2}$, there exists $x' \in Real(\tree[sub])$ such that $dist_{\tree}(x', \ensuremath{S} \setminus \{c_2\}) \leq 4$ and there exists a $xx'$-path in $\tree$ that does not go by $c_2$.
In particular, $x'$ must be adjacent in $G$ to all the vertices in $\ensuremath{S}$ (otherwise, we could derive the existence of a clique-intersection $\ensuremath{X}$ as defined above, thereby contradicting Claim~\ref{claim:op2-before}).
Note that it implies $dist_{\tree}(x',c_2) \leq 2$ because the unique path in $\tree$ between $x'$ and any leaf adjacent to $c$ must go by $c_2$.
Then, $x' \in \ensuremath{K}$.
Furthermore since $dist_{\tree}(x,c_2) \leq 4$ we obtain (by considering the median node of the triple $x,x',c_2$) $dist_{\tree}(x,x') \leq 4$.
Let $\ensuremath{K}''$ be a maximal clique containing all of $x,x',c_2$.
There are two cases.
\begin{itemize}
\item Assume first $dist_{\tree}(x,\ensuremath{S} \setminus \{c_2\}) > 4$.
Then, $\ensuremath{S} \not\subseteq \ensuremath{K}''$, and more specifically $\ensuremath{K}'' \cap \ensuremath{S} = \{c_2\}$.
It implies $\ensuremath{K}'' \neq \ensuremath{K}$, and so $c_2$ is $(\ensuremath{S},\ensuremath{K},\ensuremath{K}'')$-sandwiched, that contradicts Claim~\ref{claim:op2-before-b}.
\item Otherwise, $dist_{\tree}(x,\ensuremath{S} \setminus \{c_2\}) \leq 4$ and we may further assume $x=x'$.
However, by the hypothesis $\ensuremath{S} \not\subseteq \ensuremath{X}'$, $\ensuremath{X}' \not\subseteq \ensuremath{S}$ resp., and so $\ensuremath{S} \cap \ensuremath{X}' = \{c_2\}$ (otherwise, $\ensuremath{X} = \ensuremath{S} \cap \ensuremath{X}'$ would falsify Claim~\ref{claim:op2-before}).
It implies $v$ is $(\ensuremath{S},\ensuremath{K},\ensuremath{X}')$-sandwiched, that contradicts Claim~\ref{claim:op2-before-b}.
\end{itemize}
Therefore, we proved our subclaim that $\unlabeledsubtree{\ensuremath{X}'}$ must intersect $\unlabeledsubtree{\ensuremath{S}} \setminus \{c_2\}$.
In fact, our proof shows more generally that $\unlabeledsubtree{\ensuremath{X}'}$ cannot intersect any subtree of $\tree \setminus \unlabeledsubtree{\ensuremath{S}}$ with a node adjacent to $c_2$.
Then, $\unlabeledsubtree{\ensuremath{X}'}$ must intersect a real node in $N_{\tree}(c_2) \setminus \{c\} = \ensuremath{S} \setminus R$ since otherwise, $\unlabeledsubtree{R} = \labeledsubtree[2]{}{R}$ would imply $\unlabeledsubtree{\ensuremath{X}'} = \labeledsubtree[2]{}{\ensuremath{X}'}$, a contradiction.
However in this situation, $\ensuremath{X} := \ensuremath{S} \cap \ensuremath{X}'$ satisfies $|\ensuremath{X}| \geq 2, c_2 \in \ensuremath{X} \ \text{and} \ \ensuremath{X} \not\subseteq R$, that contradicts Claim~\ref{claim:op2-before}.
\end{itemize}
\end{proofclaim}
The above case analysis ends up proving the claim, and so, the lemma.
\end{proof}
We will also need the following useful result which we keep using throughout most of the remaining proofs in this paper:
\begin{lemma}\label{lem:center-in-star}
Given $G=(V,E)$ and $\tree$ any $4$-Steiner root of $G$, let $\ensuremath{X} \in \CI{G}$ and let $\ensuremath{S} \subset \ensuremath{X}$ be a minimal separator.
If $\unlabeledsubtree{\ensuremath{S}}$ is a non-edge-star then, there exists $c \in N_{\tree}[\centre{\unlabeledsubtree{\ensuremath{X}}}]$ such that $Real(N_{\tree}[c]) = \ensuremath{S}$.
\end{lemma}
\begin{proof}
Write $\centre{\unlabeledsubtree{\ensuremath{S}}} = \{c\}$.
By Theorem~\ref{thm:clique-intersection}, $Real(N_{\tree}[c]) = \ensuremath{S}$.
Furthermore since by the hypothesis $\unlabeledsubtree{\ensuremath{S}}$ has at least two leaves then, the unique path between at least one such a leaf and $\centre{\unlabeledsubtree{\ensuremath{X}}}$ must pass by $c$.
Since $rad(\unlabeledsubtree{\ensuremath{X}}) \leq 2$, this implies $dist_{\tree}(c, \centre{\unlabeledsubtree{\ensuremath{X}}}) \leq 1$.
\end{proof}
We now explain how to construct an important subfamily of ${\cal F}_i$:
\begin{lemma}\label{lem:with-bistar-sep}
Let $\ensuremath{K}_i$ be a maximal clique of $G=(V,E)$ with no $\ensuremath{K}_i$-free vertex.
In ${\cal O}(|\ensuremath{K}_i|^6 \cdot n^3m\log{n})$-time, we can compute a family ${\cal B}_i$ with the following special property:
For any well-structured $4$-Steiner root $\tree$ of $G$ where for at least one minimal separator $\ensuremath{S} \subset \ensuremath{K}_i$, $\unlabeledsubtree{\ensuremath{S}}$ is a bistar, there is a $\tree[2]$ such that $\unlabeledsubtree[2]{\ensuremath{S}_i} \equiv_G \unlabeledsubtree{\ensuremath{S}_i}$, $\unlabeledsubtree[2]{\ensuremath{K}_i} \in {\cal B}_i$ and $dist_{\tree[2]}(r,V_i \setminus \ensuremath{S}_i) \geq dist_{\tree}(r,V_i \setminus \ensuremath{S}_i)$ for every $r \in V(\unlabeledsubtree{\ensuremath{S}_i})$.
\end{lemma}
Note that we do not capture {\em all} well-structured roots with this above lemma, but only those maximizing certain distances' conditions.
\begin{proof}
Let $\border{\ensuremath{K}_i} \subseteq \SEP{G}$ contain all the minimal separators in $\ensuremath{K}_i$.
By Theorem~\ref{thm:minsep}, for any $\ensuremath{S} \in \border{\ensuremath{K}_i}$ we can construct a family ${\cal T}_{\ensuremath{S}}$ such that, in any $\labeledsubtree{\ensuremath{K}_i}{} \in {\cal F}_i$, we should have $\labeledsubtree{\ensuremath{K}_i}{\ensuremath{S}}$ is Steiner-equivalent to some tree in ${\cal T}_{\ensuremath{S}}$.
This takes total time ${\cal O}(|\ensuremath{K}_i|^6|\border{\ensuremath{K}_i}|) = {\cal O}(n|\ensuremath{K}_i|^6)$.
Fix $\ensuremath{S} \in \border{\ensuremath{K}_i}$ (there are ${\cal O}(n)$ possibilities) and a bistar $\unlabeledsubtree{\ensuremath{S}} \in {\cal T}_{\ensuremath{S}}$ (by Theorem~\ref{thm:minsep}, there are ${\cal O}(|\ensuremath{S}|^5)$ possibilities, that is in ${\cal O}(|\ensuremath{K}_i|^5)$).
Note that in particular for $\ensuremath{S}_i \subseteq \ensuremath{S}$, this will also generate all possibilities for $\unlabeledsubtree{\ensuremath{S}_i}$.
Roughly we show that except in a few particular cases easy to solve, for every $\ensuremath{S}' \in \border{\ensuremath{K}_i}$ there is only {\em one} canonical solution in ${\cal T}_{\ensuremath{S}'}$ that is compatible with $\unlabeledsubtree{\ensuremath{S}}$; moreover, this canonical solution can be computed in ${\cal O}(nm\log{n})$-time.
For proving that, let us assume the existence of a $4$-Steiner root $\tree$ of $G$ that contains $\unlabeledsubtree{\ensuremath{S}}$ as a subtree.
We may only consider those $\ensuremath{S}' \in \border{\ensuremath{K}_i}$ that are {\em not} contained into any other $\ensuremath{S}'' \in \border{\ensuremath{K}_i}$.
Indeed if $\ensuremath{S}' \subseteq \ensuremath{S}''$ then, trivially $\unlabeledsubtree{\ensuremath{S}'}$ is forced by $\unlabeledsubtree{\ensuremath{S}''}$.
Thus from now on, we assume $\ensuremath{S}'$ is inclusion wise maximal in $\border{\ensuremath{K}_i}$.
In what follows is a simple observation for the case $\ensuremath{S} \cap \ensuremath{S}' = \emptyset$ (see also Fig.~\ref{fig:bistar-not-intersect} for an illustration).
\begin{myclaim}\label{claim:no-empty-intersection}
If $\ensuremath{S} \cap \ensuremath{S}' = \emptyset$ then, $\unlabeledsubtree{\ensuremath{S}'}$ is a star with a Steiner central node.
Moreover, the central node of $\unlabeledsubtree{\ensuremath{K}_i}$ must be Steiner.
\end{myclaim}
\begin{figure}[h!]
\centering
\includegraphics[width=.3\textwidth]{Fig/bistar-not-intersect}
\caption{An example where $\ensuremath{S} \cap \ensuremath{S}' = \emptyset$.}
\label{fig:bistar-not-intersect}
\end{figure}
\begin{proofclaim}
By Lemma~\ref{lem:bistar-center}, $\centre{\unlabeledsubtree{\ensuremath{K}_i}} \subset \centre{\unlabeledsubtree{\ensuremath{S}}}$, and so by Theorem~\ref{thm:clique-intersection}, $Real(N_{\tree}[\centre{\unlabeledsubtree{\ensuremath{K}_i}}]) \subset \ensuremath{S}$.
But then, $\unlabeledsubtree{\ensuremath{K}_i} \setminus N_{\tree}[\centre{\unlabeledsubtree{\ensuremath{K}_i}}]$ is a collection of isolated leaves.
The latter proves either $\ensuremath{S}' = \{v\}$ is a cut-vertex or $\unlabeledsubtree{\ensuremath{S}'}$ is a star with a Steiner central node in $N_{\tree}[\centre{\unlabeledsubtree{\ensuremath{K}_i}}]$.
In the former case we so conclude that $v$ is $\ensuremath{K}_i$-free by inclusion wise maximality of $\ensuremath{S}'$ and by Lemma~\ref{lem:almost-simplicial-characterization}.
Since we assume there is no $\ensuremath{K}_i$-free vertex, this case cannot happen.
Therefore, $\unlabeledsubtree{\ensuremath{S}'}$ is a star with a Steiner central node in $N_{\tree}[\centre{\unlabeledsubtree{\ensuremath{K}_i}}]$.
Finally, the center of $\unlabeledsubtree{\ensuremath{K}_i}$ must be also Steiner (otherwise by Lemma~\ref{lem:center-in-star}, this vertex should be in $\ensuremath{S}'$).
\end{proofclaim}
If $\ensuremath{S} \cap \ensuremath{S}' = \emptyset$ then, by combining Claim~\ref{claim:no-empty-intersection} and Lemma~\ref{lem:center-in-star} there is essentially one way to insert $\ensuremath{S}'$ in $\unlabeledsubtree{\ensuremath{K}_i}$ ({\it i.e.}, we construct a star $\unlabeledsubtree{\ensuremath{S}'}$ with one Steiner central node, then we make this central node adjacent to the Steiner central node of $\unlabeledsubtree{\ensuremath{K}_i}$).
For the remaining cases, we assume $\ensuremath{S}' \cap \ensuremath{S} \neq \emptyset$ for any inclusion wise maximal $\ensuremath{S}' \in \border{\ensuremath{K}_i}$.
Several cases may arise:
\begin{itemize}
\item \underline{Case there exist $u,v \in \ensuremath{S} \cap \ensuremath{S}'$ nonadjacent in $\unlabeledsubtree{\ensuremath{S}}$} (see Fig.~\ref{fig:bistar-not-adjacent} for an illustration).
We prove $\unlabeledsubtree{\ensuremath{S}'}$ is a bistar.
Indeed, suppose by contradiction $\unlabeledsubtree{\ensuremath{S}'}$ is a star.
Then, since $u,v \in \ensuremath{S} \cap \ensuremath{S}'$ are non adjacent, the center of $\unlabeledsubtree{\ensuremath{S}'}$ must be in $\centre{\unlabeledsubtree{\ensuremath{S}}}$. This implies $\ensuremath{S}' \subset \ensuremath{S}$, a contradiction.
Therefore, we proved as claimed $\unlabeledsubtree{\ensuremath{S}'}$ must be a bistar.
In this situation we must have $\ensuremath{S} \cap \ensuremath{S}' = Real(N_{\tree}[\centre{\unlabeledsubtree{\ensuremath{K}_i}}])$ ({\it e.g.}, see the proof of Lemma~\ref{lem:bistar-center}).
Since there exist $u,v \in \ensuremath{S} \cap \ensuremath{S}'$ nonadjacent in $\unlabeledsubtree{\ensuremath{S}}$, the central node of $\unlabeledsubtree{\ensuremath{K}_i}$ can be uniquely defined as the central node $c_i \in \centre{\unlabeledsubtree{\ensuremath{S}}}$ such that $u,v \in N_{\tree}[c_i]$.
Finally, since $Real(N_{\tree}[c_i])$ is fixed by $\unlabeledsubtree{\ensuremath{S}}$, by Lemma~\ref{lem:real-center-bistar} this leaves at most {\em one} canonical possibility for the second central node in $\centre{\unlabeledsubtree{\ensuremath{S}'}}$, and so, at most one possibility for $\unlabeledsubtree{\ensuremath{S}'}$.
\begin{figure}[h!]
\centering
\includegraphics[width=.3\textwidth]{Fig/bistar-not-adjacent}
\caption{Two bistars intersecting.}
\label{fig:bistar-not-adjacent}
\end{figure}
\smallskip
Note that we always fall in this case provided $|\ensuremath{S} \cap \ensuremath{S}'| \geq 3$.
So, we are left to study when $|\ensuremath{S} \cap \ensuremath{S}'| \in \{1,2\}$.
\item \underline{Case $\ensuremath{S} \cap \ensuremath{S}' = \{u,v\}$.}
We further assume $uv \in E(\unlabeledsubtree{\ensuremath{S}})$ (otherwise, we fall in the previous subcase).
Recall that we assume $\ensuremath{S}' \not\subseteq \ensuremath{S}$.
In particular, we must have $\ensuremath{S} \cap \ensuremath{S}' \subseteq N_{\tree}[\centre{\unlabeledsubtree{\ensuremath{K}_i}}]$.
W.l.o.g., $u \in \centre{\unlabeledsubtree{\ensuremath{S}}}$ (or equivalently, $u$ must be the central node of $\unlabeledsubtree{\ensuremath{K}_i}$).
Since $\ensuremath{S}' \not\subseteq \ensuremath{S}$ and there is at least one leaf-node of $\unlabeledsubtree{\ensuremath{S}}$ that is a real node adjacent to $u$, we so deduce that $v$ is a leaf of $\unlabeledsubtree{\ensuremath{S}}$ (otherwise, we would have $\ensuremath{S} \cap \ensuremath{S}' \neq \{u,v\}$).
Several situations force $\unlabeledsubtree{\ensuremath{S}'}$ to be a star, for instance if:
\begin{itemize}
\item $\ensuremath{S}'$ is strictly contained into another minimal separator of $G$;
\item $G \setminus \ensuremath{S}'$ has at least three full components\footnote{Equivalently, given any clique-tree $\cliquetree{G}$ of $G$ we have $|\edgeset{G}{\ensuremath{S}'}| \geq 2$.};
\item or $Real(N_{\tree}[u]) \neq \{u,v\}$.
\end{itemize}
If such a situation occurs then, by Lemma~\ref{lem:center-in-star}, $v$ must be the center of the star $\unlabeledsubtree{\ensuremath{S}'}$, thereby leaving only one possibility for $\unlabeledsubtree{\ensuremath{S}'}$ ({\it i.e.}, see Fig.~\ref{fig:bistar-star}).
\begin{figure}[h!]
\centering
\includegraphics[width=.3\textwidth]{Fig/bistar-star}
\caption{Star intersecting a bistar.}
\label{fig:bistar-star}
\end{figure}
\smallskip
From now on assume that no minimal separator strictly contains $\ensuremath{S}'$, $G \setminus \ensuremath{S}'$ has exactly two full components and $Real(N_{\tree}[u]) = \{u,v\}$.
The subtree $\unlabeledsubtree{\ensuremath{S}'}$ is forced to be a bistar if there exists at least one $\ensuremath{S}'' \in \border{\ensuremath{K}_i}$ inclusion wise maximal such that: $\ensuremath{S} \cap \ensuremath{S}'' = \{v\}$ (otherwise, $\unlabeledsubtree{\ensuremath{S}''}$ should be an edge and, since we assume $|\ensuremath{S}'| \geq 3$ this would imply $\ensuremath{S}'' \subseteq \ensuremath{S}'$ by Lemma~\ref{lem:center-in-star}, a contradiction).
Furthermore as explained in the previous case there is at most one canonical possibility for the bistar $\unlabeledsubtree{\ensuremath{S}'}$.
\smallskip
If no $\ensuremath{S}''$ as above exists then, $\unlabeledsubtree{\ensuremath{S}'}$ may be either a star or a bistar.
We can bipartition all the remaining minimal separators $\ensuremath{S}'' \in \border{\ensuremath{K}_i}$ that are inclusion wise maximal (including $\ensuremath{S}'$) as follows: those containing $v$, and those that do not.
Note that in the former subcase (which includes $\ensuremath{S}'$) we have $\ensuremath{S} \cap \ensuremath{S}'' = \{u,v\}$, whereas in the latter subcase $\ensuremath{S} \cap \ensuremath{S}'' = \{u\}$.
Furthermore if $\ensuremath{S} \cap \ensuremath{S}'' = \{u\}$ then, $\unlabeledsubtree{\ensuremath{S}''}$ must always be a star with a Steiner central node that is adjacent to $u$ (to see that, recall that $Real(N_{\tree}[u]) = \{u,v\}$, and so, $\unlabeledsubtree{\ensuremath{S}''}$ cannot be a bistar).
In particular, there is only {\em one} possibility for such a $\ensuremath{S}''$.
However, the same as $\ensuremath{S}'$, for all other $\ensuremath{S}''$ such that $\ensuremath{S} \cap \ensuremath{S}'' = \{u,v\}$, $\unlabeledsubtree{\ensuremath{S}''}$ may be either a star or a bistar.
The key observation here is that $\unlabeledsubtree{\ensuremath{S}''}$ can be a star for at most {\em one} such a $\ensuremath{S}''$ (otherwise, by Lemma~\ref{lem:center-in-star} there would be two non-edge stars with the same center node $v$, that contradicts Property~\ref{pty-ci:2} of Theorem~\ref{thm:clique-intersection}).
Summarizing, since all these sets $\ensuremath{S}'' \setminus \ensuremath{S}$ are pairwise disjoint, we are left with ${\cal O}(|\ensuremath{K}_i|)$ possibilities for the unique such $\ensuremath{S}''$ for which $\unlabeledsubtree{\ensuremath{S}''}$ is a star (if any); this choice fixes the corresponding subtree for all the remaining minimal separators.
See Fig.~\ref{fig:bistar-two-choices-1}.
\begin{figure}[h!]
\centering
\includegraphics[width=.3\textwidth]{Fig/bistar-two-choices-1}
\caption{A case where there are two possibilities for $\unlabeledsubtree{\ensuremath{S}'}$.}
\label{fig:bistar-two-choices-1}
\end{figure}
\item \underline{Case $\ensuremath{S} \cap \ensuremath{S}' = \{v\}$.}
If $v \in \centre{\unlabeledsubtree{\ensuremath{S}}}$ then, $v \in \centre{\unlabeledsubtree{\ensuremath{K}_i}}$ because we assume $\ensuremath{S}' \not\subseteq \ensuremath{S}$. In particular, the only possibility for $\unlabeledsubtree{\ensuremath{S}'}$ is a star with a Steiner central node that is adjacent to $v$ (recall that $v$ is adjacent to at least one leaf in $\unlabeledsubtree{\ensuremath{S}}$, and so, $\unlabeledsubtree{\ensuremath{S}'}$ cannot be a bistar).
Assume for the remaining of the case $v$ is a leaf of $\unlabeledsubtree{\ensuremath{S}}$.
As in the previous case, several situations force $\unlabeledsubtree{\ensuremath{S}'}$ to be a star, like if:
\begin{itemize}
\item $\ensuremath{S}'$ is strictly contained into another minimal separator of $G$;
\item $G \setminus \ensuremath{S}'$ has at least three full components;
\item or $Real(N_{\tree}[\centre{\unlabeledsubtree{\ensuremath{K}_i}}]) \neq \{v\}$.
\end{itemize}
Furthermore if such a situation occurs then, $v$ must be a center node of the star $\unlabeledsubtree{\ensuremath{S}'}$ (possibly, $\unlabeledsubtree{\ensuremath{S}'}$ is an edge), and so, there is only one possibility for $\unlabeledsubtree{\ensuremath{S}'}$.
\smallskip
From now on assume no minimal separator strictly contains $\ensuremath{S}'$, $G \setminus \ensuremath{S}'$ has exactly two full components and $Real(N_{\tree}[\centre{\unlabeledsubtree{\ensuremath{K}_i}}]) = \{v\}$.
In particular, the unique central node of $\unlabeledsubtree{\ensuremath{K}_i}$ is some Steiner node $\alpha_i$.
We also consider all the other minimal separators $\ensuremath{S}'' \in \border{\ensuremath{K}_i}$ in the same situation as $\ensuremath{S}'$.
As we only consider inclusion wise maximal elements $\ensuremath{S}'' \in \border{\ensuremath{K}_i}$ intersecting $\ensuremath{S}$, we must have $\ensuremath{S} \cap \ensuremath{S}'' = \{v\}$.
However, unlike the previous subcase, in an {\em arbitrary} well-structured $\tree$ there may be several such $\ensuremath{S}''$ for which $\unlabeledsubtree{\ensuremath{S}''}$ is a star.
We now prove that up to local modifications of $\tree$, we can always assume there is at most {\em one} such $\ensuremath{S}''$ for which $\unlabeledsubtree{\ensuremath{S}''}$ is a star.
Note that by doing so, we can conclude as for the previous subcase about the number of possibilities for $\unlabeledsubtree{\ensuremath{K}_i}$.
\begin{figure}[h!]
\centering
\includegraphics[width=.6\textwidth]{Fig/bistar-two-choices-2}
\caption{The transformation of an edge into a bistar.}
\label{fig:bistar-two-choices-2}
\end{figure}
Assume there exist $\ensuremath{S}_{i_j},\ensuremath{S}_{i_k}$ such that $\unlabeledsubtree{\ensuremath{S}_{i_j}},\unlabeledsubtree{\ensuremath{S}_{i_k}}$ are stars.
Then, $\unlabeledsubtree{\ensuremath{S}_{i_j}},\unlabeledsubtree{\ensuremath{S}_{i_k}}$ must be edges with a common end $v$ (otherwise, one should be a non-edge star and so by Lemma~\ref{lem:center-in-star}, either $\ensuremath{S}_{i_j} \subset \ensuremath{S}_{i_k}$ or $\ensuremath{S}_{i_k} \subset \ensuremath{S}_{i_j}$, a contradiction).
By inclusion wise maximality of $\ensuremath{S}_{i_j}$ and $\ensuremath{S}_{i_k}$, there is at least one of these two separators whose intersection with $\ensuremath{S}_i$ is either empty or reduced to $\{v\}$.
Assume w.l.o.g. this is the case for $\ensuremath{S}_{i_j}$ and write $\ensuremath{S}_{i_j} = \{u,v\}$.
We first gain more insights on the structure of $\unlabeledsubtree{\ensuremath{K}_{i_j}}$.
For that, let $W_{i_j} := V_{i_j} \setminus \ensuremath{S}_{i_j}$.
Since $v$ has a neighbour in $V_i \setminus V_{i_j}$ we must have $dist_{\tree}(v,W_{i_j}) = 4$.
This implies $diam(\unlabeledsubtree{\ensuremath{K}_{i_j}}) = 4$, $dist_{\tree}(u,W_{i_j}) = 3$, and all other real vertices of $\unlabeledsubtree{\ensuremath{K}_{i_j}}$ must be leaves at distance two from $\centre{\unlabeledsubtree{\ensuremath{K}_{i_j}}}$.
See Fig.~\ref{fig:bistar-two-choices-2} for an illustration.
We connect the unique node $\alpha_{i_j} \in \centre{\unlabeledsubtree{\ensuremath{K}_{i_j}}}$ (which is Steiner) to $\alpha_i$ and then, we remove the edge $uv$.
In doing so, we obtain a tree $\tree[2]$ such that $Real(\tree[2]) = V$ and $\unlabeledsubtree[2]{\ensuremath{S}_{i_j}}$ is a bistar.
Note that in particular, $\unlabeledsubtree{\ensuremath{S}_i} = \unlabeledsubtree[2]{\ensuremath{S}_i}$, that follows from $\ensuremath{S}_i \cap \ensuremath{S}_{i_j} \subseteq \{v\}$.
Furthermore we claim that $\tree[2]$ keeps the property of being a $4$-Steiner root of $G$.
There are two cases:
\begin{itemize}
\item Suppose by contradiction $dist_{\tree[2]}(x,y) \leq 4$ for some $xy \notin E$. In particular, the unique $xy$-path in $\tree[2]$ must go by the edge $\alpha_{i_j}\alpha_i$. However since all neighbours of $\alpha_i$ except $v$ and all neighbours of $\alpha_{i_j}$ except $u$ are Steiner nodes, we obtain that $\{u,v\} \cap \{x,y\} \neq \emptyset$.
In particular if $x \in \{u,v\}$ then, $y \in \ensuremath{K}_i \cup \ensuremath{K}_{i_j}$, and so $xy \in E(G)$.
A contradiction.
\item Conversely, suppose by contradiction $dist_{\tree[2]}(x,y) > 4$ for some $xy \in E$. In particular, the unique $xy$-path in $\tree$ must go by the edge $uv$. Therefore, there must be a maximal clique $\ensuremath{K}$ containing all of $x,y,u,v$. We have $\ensuremath{K} \notin \{\ensuremath{K}_i,\ensuremath{K}_{i_j}\}$ since $dist_{\tree[2]}(x,y) > 4$. But then by maximality of $\ensuremath{S}_{i_j}$, $\ensuremath{K} \cap \ensuremath{K}_i = \ensuremath{K} \cap \ensuremath{K}_{i_j} = \ensuremath{K}_i \cap \ensuremath{K}_{i_j} = \ensuremath{S}_{i_j}$ and there are at least three full components in $G \setminus \ensuremath{S}_{i_j}$. A contradiction.
\end{itemize}
So, we proved as claimed that $\tree[2]$ keeps the property of being a $4$-Steiner root of $G$.
We can prove in the same way that we have $\unlabeledsubtree{\ensuremath{X}} = \unlabeledsubtree[2]{\ensuremath{X}}$ for every clique-intersection $\ensuremath{X} \notin \{\ensuremath{S}_{i_j},\ensuremath{K}_i,\ensuremath{K}_{i_j}\}$, that implies $\tree[2]$ is well-structured.
We end up observing $dist_{\tree[2]}(r,W_i) \geq dist_{\tree}(r,W_i)$ for every $r \in \unlabeledsubtree{\ensuremath{S}_i}$ by construction, where $W_i := V_i \setminus \ensuremath{S}_i$.
Then, we obtain the desired property by repeating this above transformation until there is at most one $\ensuremath{S}''$ such that $\unlabeledsubtree{\ensuremath{S}''}$ is a star.
\end{itemize}
Overall, given a fixed $\unlabeledsubtree{\ensuremath{S}}$ we have at most ${\cal O}(|\ensuremath{K}_i|)$ possibilities for $\unlabeledsubtree{\ensuremath{K}_i}$.
By Lemma~\ref{lem:real-center-bistar}, every such a possibility can be computed in time ${\cal O}(|\border{\ensuremath{K}_i}|) \times {\cal O}(nm\log{n})$, that is in ${\cal O}(n^2m\log{n})$.
Overall, the total running-time is in ${\cal O}(n|\ensuremath{K}_i|^5) \times {\cal O}(|\ensuremath{K}_i|) \times {\cal O}(n^2m\log{n}) = {\cal O}(|\ensuremath{K}_i|^6 \cdot n^3m\log{n})$.
\end{proof}
\subsubsection{A degenerate case}\label{sec:degenerate}
If there is no minimal separator $\ensuremath{S} \subset \ensuremath{K}_i$ such that $\unlabeledsubtree{\ensuremath{S}}$ is a bistar then, we get much less information on the structure of $\unlabeledsubtree{\ensuremath{K}_i}$.
We identify the following as our main obstruction for bounding the number of possible subtrees:
\begin{definition}\label{def:thin-leg}
Given $G=(V,E)$ and $\tree$ a $4$-Steiner root of $G$, let $\ensuremath{K}_i \in \MAXK{G}$ and let $\ensuremath{S} \subset \ensuremath{K}_i$ be a minimal separator of size $|\ensuremath{S}| \geq 2$.
We call $\unlabeledsubtree{\ensuremath{S}}$ a {\em thin branch} of $\unlabeledsubtree{\ensuremath{K}_i}$ if we have:
\begin{itemize}
\item $\unlabeledsubtree{\ensuremath{S}} \setminus \centre{\unlabeledsubtree{\ensuremath{K}_i}}$ is a connected component of $\unlabeledsubtree{\ensuremath{K}_i} \setminus \centre{\unlabeledsubtree{\ensuremath{K}_i}}$;
\item and there is no other $\unlabeledsubtree{\ensuremath{S}'}, \ensuremath{S}' \subset \ensuremath{K}_i$ which both intersects $\centre{\unlabeledsubtree{\ensuremath{K}_i}}$ and $\unlabeledsubtree{\ensuremath{S}} \setminus \centre{\unlabeledsubtree{\ensuremath{K}_i}}$.
\end{itemize}
The {\em head} of a thin branch is the node of $\unlabeledsubtree{\ensuremath{S}}$ that is the closest to $\centre{\unlabeledsubtree{\ensuremath{K}_i}}$.
\end{definition}
\begin{figure}[h!]
\centering
\includegraphics[width=.4\textwidth]{Fig/thin-branches}
\caption{Examples of thin branches (represented by a dashed ellipse).}
\label{fig:thin-branches}
\end{figure}
In order to understand the difficulties we met, assume on the way to construct $\unlabeledsubtree{\ensuremath{K}_i}$ we correctly identified $\centre{\unlabeledsubtree{\ensuremath{K}_i}}$ and a minimal separator $\ensuremath{S}$ for which $\unlabeledsubtree{\ensuremath{S}}$ must be a thin branch.
We can prove that $\unlabeledsubtree{\ensuremath{S}}$ must be a star (possibly, an edge).
However, without any additional information, there would be at least $|\ensuremath{S}| \geq 2$ possibilities for $\centre{\unlabeledsubtree{\ensuremath{S}}}$ ({\it e.g.}, see Figure~\ref{fig:thin-branches}).
If there are $p$ such minimal separators $\ensuremath{S}^1,\ensuremath{S}^2,\ldots,\ensuremath{S}^p$ for which $\unlabeledsubtree{\ensuremath{S}^j}$ must be a thin branch then, the number of possibilities for $\unlabeledsubtree{\ensuremath{K}_i}$ goes up to $2^p$ at least.
\medskip
Intuitively, our choice for $\unlabeledsubtree{\ensuremath{S}^j}$ does not really matter as long as this does not violate any distance's constraints in the final solution we get.
Guided by this intuition, we will sketch in Section~\ref{sec:greedy} a way to process all these $\ensuremath{S}^j$'s -- except maybe one -- independently from each other.
In particular, for now we do not really need to ``guess' what will be exactly $\unlabeledsubtree{\ensuremath{S}^j}$ in our final solution but just to correctly certify it has to be a thin branch.
Specifically, we prove the following result:
\begin{lemma}\label{lem:thin:branch}
Let $\ensuremath{K}_i$ be a maximal clique of $G=(V,E)$ with no $\ensuremath{K}_i$-free vertex.
There exists a family ${\cal D}_i$ that can be computed in ${\cal O}(n|\ensuremath{K}_i|^4)$-time, and such that the following hold for any well-structured $4$-Steiner root $\tree$ of $G$:
\begin{enumerate}
\item
If $diam(\unlabeledsubtree{\ensuremath{K}_i}) = 4$, and there is no minimal separator $\ensuremath{S} \subset \ensuremath{K}_i$ such that $\unlabeledsubtree{\ensuremath{S}}$ is a bistar then, we have: $(\unlabeledsubtree[2]{Y_i \cup \centre{\unlabeledsubtree[2]{\ensuremath{K}_i}}}, \ \centre{\unlabeledsubtree[2]{\ensuremath{K}_i}}) \in {\cal D}_i$ for some $\tree[2] \equiv_G \tree$ and $Y_i \subseteq X_i$;
\item
Moreover, $\ensuremath{S}_i \subseteq Y_i$, and for any $v \in \ensuremath{K}_i \setminus Y_i$ there is a minimal separator $\ensuremath{S} \subseteq (\ensuremath{K}_i \setminus Y_i) \cup \centre{\unlabeledsubtree{\ensuremath{K}_i}}$ such that: $v \in \ensuremath{S}$, and $\unlabeledsubtree{\ensuremath{S}}$ is a thin branch.
\end{enumerate}
\end{lemma}
\begin{proof}
By the hypothesis we are left to compute the diameter-four subtrees where, for every minimal separator $\ensuremath{S} \subset \ensuremath{K}_i$, $\unlabeledsubtree{\ensuremath{S}}$ has diameter at most two.
For that, we only need to consider the subset ${\cal S}_i$ of all minimal separators $\ensuremath{S} \subset \ensuremath{K}_i$ that are not strictly contained into any other minimal separator in $\ensuremath{K}_i$.
Furthermore, we recall that by the hypothesis there is no $\ensuremath{K}_i$-free vertex.
In particular, every $\ensuremath{S} \in {\cal S}_i$ has size at least two.
This implies $\unlabeledsubtree{\ensuremath{S}}$ must be either an edge or a star.
We now divide the proof into several cases:
\begin{itemize}
\item \underline{Case there is a $\ensuremath{S} \in {\cal S}_i$ such that $\centre{\unlabeledsubtree{\ensuremath{K}_i}} = \centre{\unlabeledsubtree{\ensuremath{S}}}$.}
Note that in this case, $\unlabeledsubtree{\ensuremath{S}}$ must be a non-edge star.
Fix $\ensuremath{S} \in {\cal S}_i$ (there are ${\cal O}(n)$ possibilities) and one non-edge star $\unlabeledsubtree{\ensuremath{S}}$ such that $Real(\unlabeledsubtree{\ensuremath{S}}) = \ensuremath{S}$ (there are ${\cal O}(|\ensuremath{S}|) = {\cal O}(|\ensuremath{K}_i|)$ possibilities).
By Lemma~\ref{lem:center-in-star}, $Real(N_{\tree}[\centre{\unlabeledsubtree{\ensuremath{S}}}]) = \ensuremath{S}$.
Therefore, there is at most one compatible solution for any other $\ensuremath{S}' \in {\cal S}_i$, namely: if $v \in \ensuremath{S} \cap \ensuremath{S}'$ is a leaf of $\unlabeledsubtree{\ensuremath{S}}$ then, $\unlabeledsubtree{\ensuremath{S}'}$ must be a star with $v$ as a central node (possibly, an edge); otherwise, $\unlabeledsubtree{\ensuremath{S}'}$ must be a non-edge star with a Steiner central node $\alpha \in N_{\tree}(\centre{\unlabeledsubtree{\ensuremath{S}}})$.
See Fig.~\ref{fig:ugly-case-2} for an illustration of that case.
\begin{figure}[h!]
\centering
\includegraphics[width=.3\textwidth]{Fig/ugky-case-2}
\caption{Case 1 of Lemma~\ref{lem:thin:branch}.}
\label{fig:ugly-case-2}
\end{figure}
\item \underline{Case there is no $\ensuremath{S} \in {\cal S}_i$ such that $\centre{\unlabeledsubtree{\ensuremath{K}_i}} = \centre{\unlabeledsubtree{\ensuremath{S}}}$.}
Fix $c_i \in \centre{\unlabeledsubtree{\ensuremath{K}_i}}$ as being any vertex of $\ensuremath{K}_i$ or Steiner (this gives ${\cal O}(|\ensuremath{K}_i|)$ possibilities).
There are several subcases:
\begin{itemize}
\item
For $\ensuremath{S} \in {\cal S}_i$ of size $|\ensuremath{S}| \geq 3$, the only possibility for $\unlabeledsubtree{\ensuremath{S}}$ is to be a non-edge star such that (by Lemma~\ref{lem:center-in-star}) $Real(N_{\tree}[\centre{\unlabeledsubtree{\ensuremath{S}}}]) = \ensuremath{S}$, and the center of $\unlabeledsubtree{\ensuremath{S}}$ must be adjacent to $c_i$.
If in addition, there is a clique-intersection $\ensuremath{X} \subset \ensuremath{S}, |\ensuremath{X}| = 2$ and $c_i \in \ensuremath{X}$ then, the center of $\unlabeledsubtree{\ensuremath{S}}$ must be the unique vertex in $\ensuremath{X} \setminus \{c_i\}$.
Otherwise, we claim that $\unlabeledsubtree{\ensuremath{S}}$ must be a thin branch.
Indeed, suppose by contradiction the existence of a $\ensuremath{S}' \subset \ensuremath{K}_i$ such that $\unlabeledsubtree{\ensuremath{S}'}$ intersects both $\centre{\unlabeledsubtree{\ensuremath{K}_i}}$ and $\unlabeledsubtree{\ensuremath{S}} \setminus \centre{\unlabeledsubtree{\ensuremath{K}_i}}$.
As we assume $\ensuremath{S} \not\subseteq \ensuremath{S}'$, we should have $\unlabeledsubtree{\ensuremath{S}} \cap \unlabeledsubtree{\ensuremath{S}'}$ that is contained into the edge between $c_i$ and the central node of $\unlabeledsubtree{\ensuremath{S}}$.
In particular, $\ensuremath{S}' \not\subseteq \ensuremath{S}$ (otherwise, this would contradict the non-existence of a clique-intersection $\ensuremath{X}$ as defined above).
This implies $\unlabeledsubtree{\ensuremath{S}'}$ should be either a bistar or a non-edge star such that $\centre{\unlabeledsubtree{\ensuremath{K}_i}} = \centre{\unlabeledsubtree{\ensuremath{S}'}}$.
However, in both cases this would contradict our hypothesis that no such $\ensuremath{S}'$ exist.
Therefore, we proved as claimed that $\unlabeledsubtree{\ensuremath{S}}$ must be a thin branch.
\item
Let $\ensuremath{S}^1,\ensuremath{S}^2,\ldots,\ensuremath{S}^q$ be minimal separators of size exactly two that are pairwise intersecting into some vertex $u \neq c_i$.
Then, their union must be a star: where the center is the unique vertex $u$ in $\bigcap \ensuremath{S}^j$, and $Real(N_{\unlabeledsubtree{\ensuremath{K}_i}}[u]) = \{c_i\} \cup \left( \bigcup_j \ensuremath{S}^j \right)$.
In particular, $\unlabeledsubtree{\ensuremath{S}^j}$ must be an edge for every $j$.
\item
So, the only remaining subcase is a minimal separator $\ensuremath{S} \in {\cal S}_i$ such that: $|\ensuremath{S}| = 2$, and the intersection of $\ensuremath{S}$ with any other minimal separator of ${\cal S}_i$ is either empty or reduced to $c_i$.
Then, $\unlabeledsubtree{\ensuremath{S}}$ must be a thin branch.
\end{itemize}
See Fig.~\ref{fig:ugly-case-1} for an illustration of these subcases.
\begin{figure}[h!]
\centering
\includegraphics[width=.3\textwidth]{Fig/ugky-case-1}
\caption{Case 2 of Lemma~\ref{lem:thin:branch}. Thin branches are identified by dotted rectangles.}
\label{fig:ugly-case-1}
\end{figure}
\smallskip
Finally, according to Definition~\ref{def:thin-leg}, there may be at most one $\ensuremath{S}$ such that $\ensuremath{S}_i \cap (\ensuremath{S} \setminus \{c_i\}) \neq \emptyset$ and $\unlabeledsubtree{\ensuremath{S}}$ must be a thin branch.
Only for this $\ensuremath{S}$ we generate all possibilities for $\unlabeledsubtree{\ensuremath{S}}$, thereby generating ${\cal O}(|\ensuremath{S}|)$ different pairs $(\labeledsubtree{Y_i}{},c_i)$ to add in the family.
\end{itemize}
\end{proof}
\subsubsection{The polynomial-time computation}\label{sec:compute-fi}
Summarizing this section we get:
\begin{proposition}\label{prop:internal}
Let $\ensuremath{K}_i$ be a maximal clique of $G=(V,E)$.
In ${\cal O}(|\ensuremath{K}_i|^7 \cdot n^3m\log{n})$-time, we can compute a family ${\cal F}_i$ with the following special property.
For any well-structured $4$-Steiner root $\tree$ of $G$, there exists a $\tree[2]$ and a (not necessarily maximal) clique $Y_i \subseteq \ensuremath{K}_i$ such that $(\unlabeledsubtree[2]{Y_i \cup \centre{\unlabeledsubtree[2]{\ensuremath{K}_i}}}, \ \centre{\unlabeledsubtree[2]{\ensuremath{K}_i}}) \in {\cal F}_i$, and we have:
\begin{itemize}
\item $\ensuremath{S}_i \subseteq Y_i$ and $\unlabeledsubtree[2]{\ensuremath{S}_i} \equiv_G \unlabeledsubtree{\ensuremath{S}_i}$;
\item $dist_{\tree[2]}(r,V_i \setminus \ensuremath{S}_i) \geq dist_{\tree}(r,V_i \setminus \ensuremath{S}_i)$ for any $r \in V(\unlabeledsubtree{\ensuremath{S}_i})$;
\item For any $v \in \ensuremath{K}_i \setminus Y_i$ there is a minimal separator $\ensuremath{S} \subseteq (\ensuremath{K}_i \setminus Y_i) \cup \centre{\unlabeledsubtree{\ensuremath{K}_i}}$ such that: $v \in \ensuremath{S}$ and $\unlabeledsubtree{\ensuremath{S}}$ is a thin branch.
\end{itemize}
Moreover, $Y_i = \ensuremath{K}_i$ if either $diam(\unlabeledsubtree[2]{\ensuremath{K}_i}) < 4$ or there exists a minimal separator $\ensuremath{S} \subset \ensuremath{K}_i$ such that $\unlabeledsubtree[2]{\ensuremath{S}}$ is a bistar.
\end{proposition}
\begin{proof}
If there are $\ensuremath{K}_i$-free vertices then, by using Lemma~\ref{lem:almost-simplicial-placement}, there is essentially one canonical way to add these vertices at the end of the construction.
For that, it suffices to fix the center of $\unlabeledsubtree{\ensuremath{K}_i}$ which, as explained in the proof of Theorem~\ref{thm:leaf}, can only increase the total runtime by a multiplicative factor in ${\cal O}(|\ensuremath{K}_i|)$.
Thus from now on we may assume that $\ensuremath{K}_i$ has no $\ensuremath{K}_i$-free vertex.
Furthermore, we may also assume we already computed all the diameter-three subtrees to add in ${\cal F}_i$ ({\it i.e.}, see Remark~\ref{rk:extension-minsep}).
We explain in Lemma~\ref{lem:with-bistar-sep} how to compute the subfamily ${\cal B}_i$ of all diameter-four subtrees where at least one minimal separator $\ensuremath{S} \subset \ensuremath{K}_i$ has $\unlabeledsubtree{\ensuremath{S}}$ being a bistar.
Finally, Lemma~\ref{lem:thin:branch} completes the construction of the family ${\cal F}_i$.
\end{proof}
| {'timestamp': '2019-02-05T02:18:51', 'yymm': '1810', 'arxiv_id': '1810.02304', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02304'} | arxiv |
\section{Introduction}
Recent years have seen a surge of interest in structured representations for deep learning, motivated by achieving compression and acceleration while maintaining generalization properties.
A popular approach for learning compact models
involves constraining the weight matrices to exhibit
some form of dense but compressible structure and learning directly over the parameterization of
this structure.
Examples of structures explored for the weight matrices of deep learning pipelines include low-rank matrices~\cite{denil2013predicting,sainath2013low},
low-distortion projections~\cite{yang2015deep},
(block-)circulant matrices~\cite{cheng2015exploration,ding2017circnn},
Toeplitz-like matrices~\cite{lu2016learning,sindhwani2015structured},
and constructions derived from Fourier-related transforms~\cite{moczulski2015acdc}.
Though they confer significant storage and computation benefits, these constructions tend to underperform general fully-connected layers in deep learning.
This raises the question of whether broader classes of structured matrices can achieve superior downstream performance while retaining compression guarantees.
Our approach leverages the \textbf{low displacement rank} (LDR) framework (Section~\ref{sec:DR-background}), which encodes structure through two sparse \emph{displacement operators} and a low-rank residual term~\cite{kailath1979displacement}.
Previous work studying neural networks with LDR weight matrices assumes fixed displacement operators and learns only over the residual~\cite{sindhwani2015structured,zhao2017theoretical}.
The only case attempted in practice that explicitly employs the LDR framework uses fixed operators encoding shift invariance,
producing weight matrices which were found to achieve superior downstream quality than several other compression approaches~\cite{sindhwani2015structured}.
Unlike previous work, we consider learning the displacement operators \emph{jointly} with the low-rank residual.
Building upon recent progress on structured dense matrix-vector multiplication~\cite{desa2018two}, we introduce a more general class of LDR matrices and develop practical algorithms for using these matrices in deep learning architectures.
We show that the resulting class of matrices subsumes many previously used structured layers, including constructions that did not explicitly use the LDR framework~\cite{moczulski2015acdc,ding2017circnn}.
When compressing weight matrices in fully-connected, convolutional, and recurrent neural networks, we empirically demonstrate improved accuracy over existing approaches.
Furthermore, on several tasks our constructions achieve higher accuracy than general unstructured layers while using an order of magnitude fewer parameters.
To shed light on the empirical success of LDR matrices in machine learning, we draw connections to recent work on learning equivariant representations, and hope to motivate further investigations of this link.
Notably, many successful previous methods for compression apply classes of structured matrices related to convolutions~\cite{cheng2015exploration,ding2017circnn,sindhwani2015structured};
while their explicit aim is to accelerate training and reduce memory costs,
this constraint implicitly encodes a shift-invariant structure that is well-suited for image and audio data.
We observe that the LDR construction enforces a natural notion of approximate equivariance to transformations governed by the displacement operators, suggesting that, in contrast, our approach of learning the operators allows for modeling and learning more general latent structures in data that may not be precisely known in advance.
Despite their increased expressiveness, our new classes retain the storage and computational benefits of conventional structured representations.
Our construction provides guaranteed compression (from quadratic to linear parameters) and matrix-vector multiplication algorithms that are quasi-linear in the number of parameters.
We additionally provide the first analysis of the sample complexity of learning neural networks with LDR weight matrices, which extends to low-rank, Toeplitz-like and other previously explored fixed classes of LDR matrices. More generally, our analysis applies to structured matrices whose parameters can interact multiplicatively with high degree.
We prove that the class of neural networks constructed from these matrices retains VC dimension almost linear in the number of parameters, which implies that LDR matrices with learned displacement operators are still efficiently recoverable from data.
This is consistent with our empirical results, which suggest that constraining weight layers to our broad class of LDR matrices can reduce the sample complexity of learning compared to unstructured weights.
We provide a detailed review of previous work and connections to our approach in Appendix~\ref{sec:related-work}.
\paragraph{Summary of contributions:}
\begin{itemize}
\item We introduce a rich class of LDR matrices where the displacement operators are explicitly learned from data, and provide multiplication algorithms implemented in PyTorch (Section~\ref{sec:our-approach}).\footnote{Our code is available at \url{https://github.com/HazyResearch/structured-nets}.}
\item We prove that the VC dimension of multi-layer neural networks with LDR weight matrices, which encompasses a broad class of previously explored approaches including the low-rank and Toeplitz-like classes, is quasi-linear in the number of parameters~(Section~\ref{sec:theory}).
\item We empirically demonstrate that our construction improves downstream quality when compressing weight layers in fully-connected, convolutional, and recurrent neural networks compared to previous compression approaches, and on some tasks can even outperform general unstructured layers (Section~\ref{sec:eval}).
\end{itemize}
\section{Background: displacement rank}
\label{sec:DR-background}
The generic term \emph{structured matrix} refers to an \(m \times n\) matrix that can be represented in much fewer than \(mn\) parameters, and admits fast operations such as matrix-vector multiplication.
The displacement rank approach represents a structured matrix \(\mathbf{M} \in \mathbb{R}^{m \times n}\) through \textbf{displacement operators} \((\mathbf{A}\in\mathbb{R}^{m \times m},\mathbf{B}\in\mathbb{R}^{n \times n})\) defining a linear map \(\nabla_{\mathbf{A},\mathbf{B}} : \mathbf{M} \mapsto \mathbf{A}\mathbf{M}-\mathbf{M}\mathbf{B}\) on matrices, and a \textbf{residual} \(\mathbf{R}\), so that if
\begin{equation}
\label{eq:DR}
\mathbf{A}\mathbf{M}-\mathbf{M}\mathbf{B}=\mathbf{R}
\end{equation}
then \(\mathbf{M}\) can be manipulated solely through the compressed representation \((\mathbf{A},\mathbf{B},\mathbf{R})\). We assume that $\mathbf{A}$ and $\mathbf{B}$ have disjoint eigenvalues, which guarantees that $\mathbf{M}$ can be recovered from $\mathbf{A},\mathbf{B},\mathbf{R}$ (c.f.\ Theorem 4.3.2, \citet{pan2012structured}).
The rank of $\mathbf{R}$ (also denoted $\nabla_{\mathbf{A},\mathbf{B}}[\mathbf{M}]$) is called the \textbf{displacement rank} of $\mathbf{M}$ w.r.t. $(\mathbf{A},\mathbf{B})$.\footnote{Throughout this paper, we use square matrices for simplicity, but LDR is well-defined for rectangular.}
The displacement approach was originally introduced to describe the \emph{Toeplitz-like} matrices, which are not perfectly Toeplitz but still have shift-invariant structure~\cite{kailath1979displacement}.
These matrices have LDR with respect to \emph{shift/cycle} operators.
A standard formulation uses $\mathbf{A} = \mathbf{Z}_1, \mathbf{B} = \mathbf{Z}_{-1}$, where $\mathbf{Z}_f = \begin{bmatrix} 0_{1 \times (n-1)} & f\\ \mathbf{I}_{n-1} & 0_{(n-1) \times 1} \end{bmatrix}$ denotes the matrix with $1$ on the subdiagonal and $f$ in the top-right corner. The Toeplitz-like matrices have previously been applied in deep learning and kernel approximation, and in several cases have performed significantly better than competing compressed approaches~\cite{sindhwani2015structured,lu2016learning,choromanski2016recycling}. Figure~\ref{fig:toeplitz} illustrates the displacement~\eqref{eq:DR} for a Toeplitz matrix, showing how the shift invariant structure of the matrix leads to a residual of rank at most 2.
\begin{figure}[th]
\centering
\includegraphics[width=\linewidth]{figs/toeplitz.pdf}
\caption{Displacement equation for a Toeplitz matrix with respect to shift operators $\mathbf{Z}_1, \mathbf{Z}_{-1}$.}
\label{fig:toeplitz}
\end{figure}
A few distinct classes of useful matrices are known to satisfy a displacement property: the classic types are the Toeplitz-, Hankel-, Vandermonde-, and Cauchy-like matrices (Appendix~\ref{sec:DR-proofs}, Table~\ref{table:displacements}), which are ubiquitous in other disciplines~\cite{pan2012structured}.
These classes have fixed operators consisting of diagonal or shift matrices, and LDR properties have traditionally been analyzed in detail only for these special cases.
Nonetheless, a few elegant properties hold for generic operators, stating that certain combinations of (and operations on) LDR matrices preserve low displacement rank.
We call these \emph{closure properties}, and introduce an additional block closure property that is related to convolutional filter channels (Section~\ref{sec:conv}).
We use the notation $\mathcal{D}_{\mathbf{A},\mathbf{B}}^r$ to refer to the matrices of displacement rank $\le r$ with respect to $(\mathbf{A},\mathbf{B})$.
\begin{proposition}
\label{prop:closure}
LDR matrices are closed under the following operations:
\begin{enumerate}[label=(\alph*)]
\item\label{prop:closure:transpose-inverse} \textbf{Transpose/Inverse} If $\mathbf{M} \in \mathcal{D}_{\mathbf{A},\mathbf{B}}^r$, then $\mathbf{M}^T \in \mathcal{D}_{\mathbf{B}^T,\mathbf{A}^T}^r$ and $\mathbf{M}^{-1} \in \mathcal{D}_{\mathbf{B},\mathbf{A}}^r$.
\item\label{prop:closure:sum} \textbf{Sum} If $\mathbf{M} \in \mathcal{D}_{\mathbf{A},\mathbf{B}}^r$ and $\mathbf{N} \in \mathcal{D}_{\mathbf{A},\mathbf{B}}^s$, then $\mathbf{M}+\mathbf{N} \in \mathcal{D}_{\mathbf{A},\mathbf{B}}^{r+s}$.
\item\label{prop:closure:product} \textbf{Product} If $\mathbf{M} \in \mathcal{D}_{\mathbf{A},\mathbf{B}}^r$ and $\mathbf{N} \in \mathcal{D}_{\mathbf{B},\mathbf{C}}^s$, then $\mathbf{M}\mathbf{N} \in \mathcal{D}_{\mathbf{A},\mathbf{C}}^{r+s}$.
\item\label{prop:closure:block} \textbf{Block}
Let $\mathbf{M}_{ij}$ satisfy $\mathbf{M}_{ij} \in \mathcal{D}_{\mathbf{A}_i,\mathbf{B}_j}^r$ for $i = 1\dots k, j = 1 \dots \ell$.
Then the $k \times \ell$ block matrix $(\mathbf{M}_{ij})_{ij}$ has displacement rank $rk\ell$.
\end{enumerate}
\end{proposition}
Proposition~\ref{prop:closure} is proved in Appendix~\ref{sec:DR-proofs}.
\section{Learning displacement operators}
\label{sec:our-approach}
We consider two classes of new displacement operators.
These operators are fixed to be matrices with particular sparsity patterns, where the entries are treated as learnable parameters.
The first operator class consists of \textbf{subdiagonal} (plus corner) matrices: $\mathbf{A}_{i+1,i}$, along with the corner $\mathbf{A}_{0,n-1}$, are the only possible non-zero entries. As $\mathbf{Z}_f$ is a special case matching this sparsity pattern, this class is the most direct generalization of Toeplitz-like matrices with learnable operators.
The second class of operators are \textbf{tridiagonal} (plus corner) matrices: with the exception of the outer corners $\mathbf{A}_{0,n-1}$ and $\mathbf{A}_{n-1,0}$, $\mathbf{A}_{i,j}$ can only be non-zero if $|i-j| \le 1$. Figure~\ref{fig:operator_matrices} shows the displacement operators for the Toeplitz-like class and our more general operators.
We henceforth let LDR-SD{} and LDR-TD{} denote the classes of matrices with low displacement rank with respect to subdiagonal and tridiagonal operators, respectively. Note that LDR-TD{} contains LDR-SD{}.
\begin{figure}[th]
\centering
\begin{alignat*}{3}
\begin{bmatrix}
0 & & \cdots & 0 & f \\
1 & 0 & & \ddots & 0 \\
\vdots & 1 & \ddots & & \vdots \\
0 & \ddots & \ddots & \ddots & \\
0 & 0 & \dots & 1 & 0
\end{bmatrix}
\quad
&
\quad
\begin{bmatrix}
0 & & \cdots & 0 & x_0 \\
x_1 & 0 & & \ddots & 0 \\
\vdots & x_2 & \ddots & & \vdots \\
0 & \ddots & \ddots & \ddots & \\
0 & 0 & \dots & x_{n-1} & 0
\end{bmatrix}
\quad
&
\quad
\begin{bmatrix}
b_0 & a_0 & \cdots & 0 & s \\
c_0 & b_1 & a_1 & & 0 \\
\vdots & c_1 & \ddots & \ddots & \vdots \\
0 & & \ddots & b_{n-1} & a_{n-2} \\
t & 0 & \dots & c_{n-2} & b_{n-1}
\end{bmatrix}
\end{alignat*}
\caption{The $\mathbf{Z}_f$ operator (left), and our learnable subdiagonal (center) and tridiagonal (right) operators, corresponding to our proposed LDR-SD and LDR-TD classes.}
\label{fig:operator_matrices}
\end{figure}
\paragraph{Expressiveness}
The matrices we introduce can model rich structure and subsume many types of linear transformations used in machine learning.
We list some of the structured matrices that have LDR with respect to tridiagonal displacement operators:
\begin{proposition}
\label{prop:richness}
The LDR-TD matrices contain:
\begin{enumerate}[label=(\alph*)]
\item Toeplitz-like matrices, which themselves include many Toeplitz and circulant variants (including standard convolutional filters - see Section~\ref{sec:conv} and Appendix~\ref{sec:DR-proofs}, Corollary~\ref{cor:toeplitz})~\cite{sindhwani2015structured,cheng2015exploration,ding2017circnn}.
\item low-rank matrices.
\item the other classic displacement structures: Hankel-like, Vandermonde-like, and Cauchy-like matrices.
\item orthogonal polynomial transforms, including the Discrete Fourier and Cosine Transforms.
\item combinations and derivatives of these classes via the closure properties (Proposition~\ref{prop:closure}), including structured classes previously used in machine learning such as ACDC~\cite{moczulski2015acdc} and block circulant layers~\cite{ding2017circnn}.
\end{enumerate}
\end{proposition}
These reductions are stated more formally and proved in Appendix~\ref{sec:expressiveness-proof}. We also include a diagram of the structured matrix classes included by the proposed LDR-TD class in Figure~\ref{fig:expressivity} in Appendix~\ref{sec:expressiveness-proof}.
\paragraph{Our parameterization}
Given the parameters $\mathbf{A},\mathbf{B},\mathbf{R}$, the operation that must ultimately be performed is matrix-vector multiplication by $\mathbf{M} = \nabla_{\mathbf{A},\mathbf{B}}^{-1}[\mathbf{R}]$.
Several schemes for explicitly reconstructing $\mathbf{M}$ from its displacement parameters are known for specific cases~\cite{pan2003inversion,simoncini2016computational}, but do not always apply to our general operators.
Instead, we use $\mathbf{A},\mathbf{B},\mathbf{R}$ to implicitly construct a slightly different matrix with at most double the displacement rank, which is simpler to work with.
\begin{proposition}
\label{prop:reconstruction}
Let $\mathcal{K}(\mathbf{A},\mathbf{v})$ denote the $n \times n$ \emph{Krylov matrix}, defined to have $i$-th column $\mathbf{A}^i\mathbf{v}$.
For any vectors $\mathbf{g}_1, \dots, \mathbf{g}_r, \mathbf{h}_1, \dots, \mathbf{h}_r \in \mathbb{R}^n$, then the matrix
\begin{equation}
\label{eq:reconstruction}
\sum_{i=1}^r \mathcal{K}(\mathbf{A},\mathbf{g}_i)\mathcal{K}(\mathbf{B}^T,\mathbf{h}_i)^T
\end{equation}
has displacement rank at most $2r$ with respect to $\mathbf{A}^{-1},\mathbf{B}$.
\end{proposition}
Thus our representation stores the parameters $\mathbf{A},\mathbf{B},\mathbf{G},\mathbf{H}$, where $\mathbf{A},\mathbf{B}$ are either subdiagonal or tridiagonal operators (containing $n$ or $3n$ parameters), and $\mathbf{G},\mathbf{H} \in \mathbb{R}^{n \times r}$.
These parameters implicitly define the matrix~\eqref{eq:reconstruction}, which is the LDR weight layer we use.
\paragraph{Algorithms for LDR-SD}
Generic and near-linear time algorithms for matrix-vector multiplication by LDR matrices with even more general operators, including both the LDR-TD and LDR-SD classes, were recently shown to exist~\cite{desa2018two}.
However, complete algorithms were not provided, as they relied on theoretical results such as the transposition principle~\cite{transposition} that only imply the existence of algorithms.
Additionally, the recursive polynomial-based algorithms are difficult to implement efficiently.
For LDR-SD, we provide explicit and complete near-linear time algorithms for multiplication by~\eqref{eq:reconstruction}, as well as substantially simplify them to be useful in practical settings and implementable with standard library operations.
We empirically compare the efficiency of our implementation and unstructured matrix-vector multiplication in Figure~\ref{fig:speed} and Table~\ref{table:speed} in Appendix~\ref{sec:additional-results}, showing that LDR-SD accelerates inference by 3.34-46.06x for $n \geq 4096$.
We also show results for the low-rank and Toeplitz-like classes, which have a lower computational cost.
For LDR-TD, we explicitly construct the $\mathcal{K}(\mathbf{A},\mathbf{g}_i)$ and $\mathcal{K}(\mathbf{B}^T,\mathbf{h}_i)$ matrices for $i=1,...,r$ from Proposition~\ref{prop:reconstruction} and then apply the standard $O(n^2)$ matrix-vector multiplication algorithm.
Efficient implementations of near-linear time algorithms for LDR-TD are an interesting area of future work.
\begin{theorem}
\label{thm:algo}
Define the simultaneous computation of $k$ Fast Fourier Transforms (FFT), each with size $m$, to be a \emph{batched FFT} with total size $km$.
Consider any subdiagonal matrix $\mathbf{A} \in \mathbb{R}^{n \times n}$ and vectors $\mathbf{g}, \mathbf{h} \in \mathbb{R}^n$.
Then $\mathcal{K}(\mathbf{A},\mathbf{g})^T$ or $\mathcal{K}(\mathbf{A},\mathbf{g})$ can be multiplied by any vector $\mathbf{x}$ by computing $8\log_2(n)$ batched FFTs, each of total size $2n$.
The total number of computations is $O(n \log^2 n)$.
\end{theorem}
These algorithms are also automatically differentiable, which we use to compute the gradients when learning.
More complete descriptions of these algorithms are presented in Appendix~\ref{sec:DR-proofs}.
\section{Theoretical properties of structured matrices}
\label{sec:theory}
\paragraph{Complexity of LDR neural networks}
The matrices we use~\eqref{eq:reconstruction} are unusual in that the parameters interact multiplicatively (namely in $\mathbf{A}^i,\mathbf{B}^i$) to implicitly define the actual layer.
In contrast, fully-connected layers are linear and other structured layers, such as Fastfood and ACDC~\cite{pmlr-v28-le13,yang2015deep,moczulski2015acdc}, are constant degree in their parameters.
However, we can prove that this does not significantly change the learnability of our classes:
\begin{theorem}
\label{thm:vc}
Let $\mathcal{F}$ denote the class of neural networks with $L$ LDR layers, $W$ total parameters, and piecewise linear activations.
Let $\sign \mathcal{F}$ denote the corresponding classification functions, i.e. $\{x \mapsto \sign f(x) : f \in \mathcal{F}\}$.
The VC dimension of this class is
\begin{equation*}
\VCdim(\sign \mathcal{F}) = O(L W \log W).
\end{equation*}
\end{theorem}
Theorem~\ref{thm:vc} matches the standard bound for unconstrained weight matrices~\cite{bartlett1999almost,bartlett2017nearly}.
This immediately implies a standard PAC-learnable guarantee~\cite{vapnik1998statistical}.
Theorem~\ref{thm:vc} holds for even more general activations and matrices that for example include the broad classes of~\cite{desa2018two}.
The proof is in Appendix~\ref{sec:vc_dim},
and we empirically validate the generalization and sample complexity properties of our class in Section~\ref{sec:generalization}.
\paragraph{Displacement rank and equivariance}
\label{sec:equivariance}
We observe that displacement rank is related to a line of work outside the resource-constrained learning community, specifically on building \textbf{equivariant} (also called covariant in some contexts~\cite{bronstein2017geometric,marcos2017rotation}) feature representations that transform in predictable ways when the input is transformed.
An equivariant feature map $\Phi$ satisfies
\begin{equation}
\label{eq:equivariance-simple}
\Phi(B(x)) = A(\Phi(x))
\end{equation}
for transformations $A,B$ (invariance is the special case when $A$ is the identity)~\cite{lenc2015understanding,dieleman2016exploiting,schmidt2012learning}.
This means that perturbing the input by a transformation $B$ before passing through the map $\Phi$ is equivalent to first finding the features $\Phi$ then transforming by $A$.
Intuitively, LDR matrices are a suitable choice for modeling \emph{approximately equivariant} linear maps, since the residual $\mathbf{A}\mathbf{\Phi}-\mathbf{\Phi}\mathbf{B}$ of~\eqref{eq:equivariance-simple} has low complexity.
Furthermore, approximately equivariant maps should retain the compositional properties of equivariance, which LDR satisfies via Proposition~\ref{prop:closure}.
For example, Proposition~\ref{prop:closure}\ref{prop:closure:product} formalizes the notion that the composition of two approximately equivariant maps is still approximately equivariant. Using this intuition, the displacement representation~\eqref{eq:DR} of a matrix decomposes into two parts: the operators \({\mathbf{A},\mathbf{B}}\) define transformations to which the model is approximately equivariant, and the low complexity residual \(\mathbf{R}\) controls standard model capacity.
Equivariance has been used in several ways in the context of machine learning.
One formulation, used for example to model ego-motions, supposes that~\eqref{eq:equivariance-simple} holds only approximately, and uses a fixed transformation $B$ along with data for~\eqref{eq:equivariance-simple} to learn an appropriate $A$~\cite{agrawal2015learning,lenc2015understanding}.
Another line of work uses the representation theory formalization of equivariant maps~\cite{cohen2016group,DBLP:conf/icml/KondorT18}.
We describe this formulation in more detail and show how LDR satisfies this definition as well in Appendix~\ref{sec:group_rep}, Proposition~\ref{prop:equivariance}.
In contrast to previous settings, which fix one or both of $A,B$, our formulation stipulates that $\Phi$ can be uniquely determined from $A$, $B$, and learns the latter as part of an end-to-end model.
In Section~\ref{sec:visualization} we include a visual example of latent structure that our displacement operators learn, where they recover centering information about objects from a 2D image dataset.
\section{Empirical evaluation}
\label{sec:eval}
\paragraph{Overview}
In Section~\ref{sec:FC} we consider a standard setting of compressing
a single hidden layer (SHL) neural network and the fully-connected (FC) layer of a
CNN for image classification tasks. Following previous
work~\cite{chen2015compressing,sindhwani2015structured}, we test on
two challenging MNIST variants~\cite{larochelle2007empirical}, and include two
additional datasets with more realistic objects (CIFAR-10~\cite{krizhevsky2009learning} and NORB~\cite{lecun2004learning}).
Since SHL models take a single channel as input, we converted CIFAR-10 to grayscale for this task.
Our classes and the structured baselines are tested across different parameter budgets in order to show tradeoffs between compression and accuracy.
As shown in Table~\ref{table:images}, in the SHL model, our methods consistently have higher test accuracy than baselines for compressed training and inference, by 3.14, 2.70, 3.55, and
3.37 accuracy points on MNIST-bg-rot, MNIST-noise, CIFAR-10, and NORB respectively. In the CNN model, as shown in Table~\ref{table:images} in Appendix~\ref{sec:additional-results}, we found improvements of 5.56, 0.95, and 1.98 accuracy points over baselines on MNIST-bg-rot, MNIST-noise, and NORB respectively.
Additionally, to explore whether learning the displacement operators can facilitate adaptation to other domains, we replace the input-hidden weights in an LSTM for a language modeling task,
and show improvements of 0.81-30.47 perplexity points compared to baselines at several parameter budgets.
In addition to experiments on replacing fully-connected layers, in Section~\ref{sec:conv} we also replace the convolutional layer of a
simple CNN while preserving performance within 1.05 accuracy points on CIFAR-10.
In Section~\ref{sec:generalization}, we consider the effect of a higher parameter budget. By increasing the rank to just $16$, the LDR-SD{} class meets or exceeds the accuracy of the unstructured FC layer in all datasets we tested on, for both SHL and CNN.\footnote{In addition to the results reported in Table~\ref{table:images}, Figure~\ref{fig:rank-vs-accuracy} and Table~\ref{table:images-extended-cnn} in Appendix~\ref{sec:additional-results}, we also found that at rank 16 the LDR-SD{} class on the CNN architecture achieved test accuracies of 68.48\% and 75.45\% on CIFAR-10 and NORB respectively.}
Appendix~\ref{sec:exp-details} includes more experimental details and protocols.
Our PyTorch code is publicly available at \url{github.com/HazyResearch/structured-nets}.
\subsection{Compressing fully-connected layers}
\label{sec:FC}
\paragraph{Image classification}
\citet{sindhwani2015structured} showed that for a fixed parameter budget, the Toeplitz-like class significantly outperforms several other compression approaches, including Random Edge Removal~\cite{cirecsan2011high}, Low Rank Decomposition~\cite{denil2013predicting}, Dark Knowledge~\cite{hinton2015distilling}, HashedNets~\cite{chen2015compressing}, and HashedNets with Dark Knowledge.
Following previous experimental settings~\cite{chen2015compressing,sindhwani2015structured}, Table~\ref{table:images} compares our proposed classes to several baselines using dense structured matrices to compress the hidden layer of a single hidden layer neural network. In addition to Toeplitz-like, we implement and compare to other classic LDR types, Hankel-like and Vandermonde-like, which were previously indicated as an unexplored possibility~\citep{sindhwani2015structured,zhao2017theoretical}.
We also show results when compressing the FC layer of a 7-layer CNN based on LeNet in Appendix~\ref{sec:additional-results}, Table~\ref{table:images-extended-cnn}.
In Appendix~\ref{sec:additional-results}, we show comparisons to additional baselines at multiple budgets, including network pruning~\cite{han2015learning} and a baseline used in~\cite{chen2015compressing}, in which the number of hidden units is adjusted to meet the parameter budget.
\begin{table}[ht!]
\centering
\caption{Test accuracy when replacing the hidden layer with structured classes. Where applicable, rank ($r$) is in parentheses, and the number of parameters in the architecture is in italics below each method. Comparisons to previously unexplored classic LDR types as well as additional structured baselines are included, with the ranks adjusted to match the parameter count of LDR-TD where possible. The Fastfood~\cite{yang2015deep} and Circulant~\cite{cheng2015exploration} methods do not have rank parameters, and the parameter count for these methods cannot be exactly controlled. Additional results when replacing the FC layer of a CNN are in Appendix~\ref{sec:additional-results}. Details for all experiments are in Appendix~\ref{sec:exp-details}.}
\begin{tabular}{@{}lllll@{}}
\toprule
\textbf{Method} & \textbf{MNIST-bg-rot} & \textbf{MNIST-noise} & \textbf{CIFAR-10} & \textbf{NORB}\\ \midrule
Unstructured & 44.08 & 65.15 & 46.03 & 59.83 \\
& \textit{\textcolor{gray}{622506}} & \textit{\textcolor{gray}{622506}} & \textit{\textcolor{gray}{1058826}} & \textit{\textcolor{gray}{1054726}} \\
\hhline{=====}
LDR-TD ($r=1$) & \textbf{45.81} & \textbf{78.45} & \textbf{45.33} & \textbf{62.75} \\
& \textit{\textcolor{gray}{14122}} & \textit{\textcolor{gray}{14122}} & \textit{\textcolor{gray}{18442}} & \textit{\textcolor{gray}{14342}} \\
\midrule
Toeplitz-like ~\cite{sindhwani2015structured} ($r=4$) & 42.67 & 75.75 & 41.78 & 59.38 \\
& \textit{\textcolor{gray}{14122}} & \textit{\textcolor{gray}{14122}} & \textit{\textcolor{gray}{18442}} & \textit{\textcolor{gray}{14342}} \\
\midrule
Hankel-like ($r=4$) & 42.23 & 73.65 & 41.40 & 60.09 \\
& \textit{\textcolor{gray}{14122}} & \textit{\textcolor{gray}{14122}} & \textit{\textcolor{gray}{18442}} & \textit{\textcolor{gray}{14342}} \\
\midrule
Vandermonde-like ($r=4$) & 37.14 & 59.80 & 33.93 & 48.98 \\
& \textit{\textcolor{gray}{14122}} & \textit{\textcolor{gray}{14122}} & \textit{\textcolor{gray}{18442}} & \textit{\textcolor{gray}{14342}} \\
\midrule
Low-rank ~\cite{denil2013predicting} ($r=4$) & 35.67 & 52.25 & 32.28 & 43.66 \\
& \textit{\textcolor{gray}{14122}} & \textit{\textcolor{gray}{14122}} & \textit{\textcolor{gray}{18442}} & \textit{\textcolor{gray}{14342}} \\
\midrule
Fastfood ~\cite{yang2015deep} & 38.13 & 63.55 & 39.64 & 59.02 \\
& \textit{\textcolor{gray}{10202}} & \textit{\textcolor{gray}{10202}} & \textit{\textcolor{gray}{13322}} & \textit{\textcolor{gray}{9222}} \\
\midrule
Circulant ~\cite{cheng2015exploration} & 34.46 & 65.35 & 34.28 & 46.45 \\
& \textit{\textcolor{gray}{8634}} & \textit{\textcolor{gray}{8634}} & \textit{\textcolor{gray}{11274}} & \textit{\textcolor{gray}{7174}} \\
\bottomrule
\end{tabular}
\label{table:images}
\end{table}
At rank one (the most compressed setting), our classes with learned operators achieve higher accuracy than the fixed operator classes, and on the MNIST-bg-rot, MNIST-noise, and NORB datasets even improve on FC layers of the same dimensions, by 1.73, 13.30, and 2.92 accuracy points respectively on the SHL task, as shown in Table~\ref{table:images}. On the CNN task, our classes improve upon unstructured fully-connected layers by 0.85 and 2.25 accuracy points on the MNIST-bg-rot and MNIST-noise datasets (shown in Table~\ref{table:images-extended-cnn} in Appendix~\ref{sec:additional-results}). As noted above, at higher ranks our classes meet or improve upon the accuracy of FC layers on all datasets in both the SHL and CNN architectures.
Additionally, in Figure~\ref{fig:rank-vs-accuracy} we evaluate the performance of LDR-SD at higher ranks. Note that the ratio of parameters between LDR-SD and the Toeplitz-like or low-rank is $\frac{r+1}{r}$, which becomes negligible at higher ranks.
Figure~\ref{fig:rank-vs-accuracy} shows that at just rank $16$, the LDR-SD class meets or exceeds the performance of the FC layer on all four datasets, by 5.87, 15.05, 0.74, and 6.86 accuracy points on MNIST-bg-rot, MNIST-noise, CIFAR-10, and NORB respectively, while still maintaining at least 20x fewer parameters.
Of particular note is the poor performance of low-rank matrices.
As mentioned in Section~\ref{sec:DR-background},
every fixed-operator class has the same parameterization (a low-rank matrix).
We hypothesize that the main contribution to their marked performance difference is the effect of the learned displacement operator modeling latent invariances in the data, and that the improvement in the displacement rank classes---from low-rank to Toeplitz-like to our learned operators---comes from more accurate representations of these invariances.
As shown in Figure~\ref{fig:rank-vs-accuracy}, broadening the operator class (from Toeplitz-like at $r=1$ to LDR-SD at $r=1$) is consistently a more effective use of parameters than increasing the displacement rank (from Toeplitz-like at $r=1$ to $r=2$). Note that LDR-SD ($r=1$) and Toeplitz-like ($r=2$) have the same parameter count.
\begin{figure}[!t]
\centering
\includegraphics[width=\textwidth]{figs/rank_vs_accuracy.pdf}
\caption{Test accuracy vs. rank for unstructured, LDR-SD{}, Toeplitz-like, low-rank classes. On each dataset, LDR-SD{} meets or exceeds the accuracy of the unstructured FC baseline at higher ranks. At rank 16, the compression ratio of an LDR-SD layer compared to the unstructured layer ranges from $23$ to $30$. Shaded regions represent two standard deviations from the mean, computed over five trials with randomly initialized weights.\vspace*{-0.0em}}
\label{fig:rank-vs-accuracy}
\end{figure}
For the rest of our experiments outside Section~\ref{sec:FC} we use the algorithms in Appendix~\ref{sec:DR-proofs} specifically for LDR-SD{} matrices, and focus on further evaluation of this class on more expensive models.
\paragraph{Language modeling}
Here, we replace the input-hidden weights in a single layer long short-term memory network (LSTM) for a language modeling task. We evaluate on the WikiText-2 dataset, consisting of 2M training tokens and a vocabulary size of 33K~\cite{merity2016pointer}.
We compare to Toeplitz-like and low-rank baselines, both previously investigated for compressing recurrent nets~\cite{lu2016learning}.
As shown in Table~\ref{table:lstm}, LDR-SD improves upon the baselines for each budget tested.
Though our class does not outperform the unstructured model, we did find that it achieves a significantly lower perplexity than the fixed Toeplitz-like class (by 19.94-42.92 perplexity points), suggesting that learning the displacement operator can help adapt to different domains.
\begin{table}[ht!]
\centering
\caption{Test perplexity when replacing input-hidden matrices of an LSTM with structured classes on WikiText-2. An unconstrained layer, with 65536 parameters, has perplexity 117.74. Parameter budgets correspond to ranks 1,2,4,8,16,24 for LDR-SD. Lower is better.}
\begin{tabular}{@{}lllll@{}}
\toprule
\textbf{Num. Parameters} & \textbf{LDR-SD} & \textbf{Toeplitz-like} & \textbf{Low-rank} \\ \midrule
2048 & \textbf{166.97} & 186.91 & 205.72 \\
3072 & \textbf{154.51} & 177.60 & 179.46 \\
5120 & \textbf{141.91} & 178.07 & 172.38 \\
9216 & \textbf{143.60} & 186.52 & 144.41 \\
17408 & \textbf{132.43} & 162.58 & 135.65 \\
25600 & \textbf{129.46} & 155.73 & 133.37 \\
\bottomrule
\end{tabular}
\label{table:lstm}
\end{table}
\subsection{Replacing convolutional layers}
\label{sec:conv}
Convolutional layers of CNNs are a prominent example of equivariant feature maps.\footnote{Convolutions are designed to be shift equivariant, i.e. shifting the input is equivalent to shifting the output.}
It has been noted that convolutions are a subcase of Toeplitz-like matrices with a particular sparsity pattern\footnote{E.g.\ a $3 \times 3$ convolutional filter on an $n \times n$ matrix has a Toeplitz weight matrix supported on diagonals $-1, 0, 1, n-1, n, n+1, 2n-1, \dots$.}~\cite{cheng2015exploration,sindhwani2015structured}.
As channels are simply block matrices\footnote{A layer consisting of $k$ in-channels and $\ell$ out-channels, each of which is connected by a weight matrix of class $\mathcal{C}$, is the same as a $k \times \ell$ block matrix.}, the block closure property implies that multi-channel convolutional filters are simply a Toeplitz-like matrix of higher rank (see Appendix~\ref{sec:DR-proofs}, Corollary~\ref{cor:toeplitz}).
In light of the interpretation of LDR of an approximately equivariant linear map (as discussed in Section~\ref{sec:equivariance}), we investigate whether replacing convolutional layers with more general representations can recover similar performance, without needing the hand-crafted sparsity pattern.
Briefly, we test the simplest multi-channel CNN model on the CIFAR-10 dataset, consisting of one layer of convolutional channels ($3$ in/out channels), followed by a FC layer, followed by the softmax layer.
The final accuracies are listed in Table~\ref{table:conv-filter}.
The most striking result is for the simple architecture consisting of two layers of a single structured matrix.
This comes within 1.05 accuracy points of the highly specialized architecture consisting of convolutional channels + pooling + FC layer, while using fewer layers, hidden units, and parameters.
The full details are in Appendix~\ref{sec:exp-details}.
\begin{table}[ht]
\setlength\tabcolsep{4.0pt}
\centering
\caption{Replacing a five-layer CNN consisting of convolutional channels, max pooling, and FC layers with two generic LDR matrices results in only slight test accuracy decrease while containing fewer layers, hidden units, and parameters. Rank ($r$) is in parentheses.}
\begin{tabular}{@{}lllll@{}}
\toprule
\textbf{First hidden layer(s)} & \textbf{Last hidden layer} & \textbf{Hidden units} & \textbf{Parameters} & \textbf{Test Acc.} \\ \midrule
3 Convolutional Channels (CC) & FC & 3072, 512 & 1573089 & 54.59 \\
3CC + Max Pool & FC & 3072, 768, 512 & 393441 & 55.14 \\
4CC + Max Pool & FC & 4096, 1024, 512 & 524588 & \textbf{60.05} \\ \midrule
Toeplitz-like $(r=16)$ channels & Toeplitz-like $(r=16)$ & 3072, 512 & 393216 & 57.29 \\
LDR-SD{} $(r=16)$ channels & LDR-SD{} $(r=16)$ & 3072, 512 & 417792 & 59.36 \\
Toeplitz-like $(r=48)$ matrix & Toeplitz-like $(r=16)$ & 3072, 512 & 393216 & 55.29 \\
LDR-SD{} $(r=48)$ matrix & LDR-SD{} $(r=16)$ & 3072, 512 & 405504 & \textbf{59.00} \\ \bottomrule
\end{tabular}
\label{table:conv-filter}
\end{table}
\subsection{Generalization and sample complexity}
\label{sec:generalization}
Theorem~\ref{thm:vc} states that the theoretical sample complexity of neural
networks with structured weight matrices scales almost linearly in the total
number of parameters, matching the results for networks with fully-connected layers~\cite{bartlett1999almost,bartlett2017nearly}.
As LDR matrices have far fewer parameters, the VC dimension bound for LDR
networks are correspondingly lower than that of general unstructured networks.
Though the VC dimension bounds are sufficient but not necessary for learnability,
one might still expect to be able to learn over compressed networks with fewer
samples than over unstructured networks.
We empirically investigate this result using the same experimental setting as Table~\ref{table:images} and Figure~\ref{fig:rank-vs-accuracy}. As shown in Table~\ref{table:gen-error} (Appendix~\ref{sec:additional-results}), the structured classes consistently have lower generalization error (measured by the difference between training and test error) than the unstructured baseline.
\paragraph{Reducing sample complexity}
We investigate whether LDR models with learned displacement operators require fewer samples to achieve the same test error, compared to unstructured weights, in both the single hidden layer and CNN architectures. Tables~\ref{table:sample-complexity-shl} and~\ref{table:sample-complexity-cnn} in Appendix~\ref{sec:additional-results} show our results.
In the single hidden layer architecture, when using only 25\% of the training data the LDR-TD class exceeds the performance of an unstructured model trained on the full MNIST-noise dataset. On the CNN model, only 50\% of the training data is sufficient for the LDR-TD to exceed the performance of an unstructured layer trained on the full dataset.
\subsection{Visualizing learned weights}
\label{sec:visualization}
Finally, we examine the actual structures that our models learn.
Figure~\ref{fig:visualization}(a,b)
shows the heat map of the weight matrix $\mathbf{W} \in \mathbb{R}^{ 784 \times 784 }$ for the Toeplitz-like and LDR-SD{} classes, trained on MNIST-bg-rot with a single hidden layer model.
As is convention, the input is flattened to a vector in $\mathbb{R}^{784}$.
The Toeplitz-like class is unable to determine that the input is actually a $28 \times 28$ image instead of a vector.
In contrast, LDR-SD class is able to pick up regularity in the
input, as the weight matrix displays grid-like periodicity of size 28.
Figure~\ref{fig:visualization}(c) reveals why the weight matrix displays this pattern.
The equivariance interpretation (Section~\ref{sec:equivariance}) predicts that $\mathbf{B}$ should encode a meaningful transformation of the inputs.
The entries of the learned subdiagonal are in fact recovering a latent invariant of the 2D domain: when visualized as an image, the pixel intensities correspond to how the inputs are centered in the dataset (Figure~\ref{fig:visualization}(d)).
Figure~\ref{fig:visualization-NORB} in Appendix~\ref{sec:additional-results} shows a similar figure for the NORB dataset, which has smaller objects, and we found that the subdiagonal learns a correspondingly smaller circle.
\begin{figure}[!t]
\centering
\begin{subfigure}{0.25\linewidth}
\centering
\includegraphics[width=\linewidth]{figs/heatmap_weight_t_bgrot.pdf}
\caption{Toeplitz-like}
\label{fig:heatmap_weight_toeplitz}
\end{subfigure}\hfill
\begin{subfigure}{0.25\linewidth}
\centering
\includegraphics[width=\linewidth]{figs/heatmap_weight_sdc_bgrot.pdf}
\caption{LDR-SD}
\label{fig:heatmap_weight_subdiag}
\end{subfigure}\hfill
\begin{subfigure}{0.25\linewidth}
\centering
\includegraphics[width=\linewidth]{figs/bgrot_sd_B.pdf}
\caption{Subdiagonal of $\mathbf{B}$}
\label{fig:subdiag_bgrot}
\end{subfigure}\hfill
\begin{subfigure}{0.25\linewidth}
\centering
\includegraphics[width=\linewidth]{figs/mnist_bg_rot_digits.png}
\caption{Input examples}
\label{fig:digits_bgrot}
\end{subfigure}\hfill
\caption{The learned weight matrices (a,b) of models trained on MNIST-bg-rot. Unlike the Toeplitz-like matrix, the LDR-SD matrix displays grid-like periodicity corresponding to the 2D input. Figure (c) shows the values of the subdiagonal of $\mathbf{B}$, reshaped as an image. The size and location of the circle roughly corresponds to the location of objects of interest in the 2D inputs. A similar centering phenomenon was found on the NORB dataset, shown in Figure~\ref{fig:visualization-NORB} in Appendix~\ref{sec:additional-results}.}
\label{fig:visualization}
\end{figure}
\section{Conclusion}
We generalize the class of low displacement rank matrices explored in machine learning by considering classes of LDR matrices with displacement operators that can be learned from data.
We show these matrices can improve performance on downstream tasks compared to compression baselines and, on some tasks, general unstructured weight layers.
We hope this work inspires additional ways of using structure to achieve both more compact and higher quality representations, especially for deep learning models, which are commonly acknowledged to be overparameterized.
\subsubsection*{Acknowledgments}
We thank Taco Cohen, Jared Dunnmon, Braden Hancock, Tatsunori Hashimoto, Fred Sala, Virginia Smith, James Thomas, Mary Wootters, Paroma Varma, and Jian Zhang for helpful discussions and feedback.
We gratefully acknowledge the support of DARPA under Nos.\ FA87501720095 (D3M) and FA86501827865 (SDH), NIH under No.\ N000141712266 (Mobilize), NSF under Nos.\ CCF1763315 (Beyond Sparsity) and CCF1563078 (Volume to Velocity), ONR under No.\ N000141712266 (Unifying Weak Supervision), the Moore Foundation, NXP, Xilinx, LETI-CEA, Intel, Google, NEC, Toshiba, TSMC, ARM, Hitachi, BASF, Accenture, Ericsson, Qualcomm, Analog Devices, the Okawa Foundation, and American Family Insurance, and members of the Stanford DAWN project: Intel, Microsoft, Teradata, Facebook, Google, Ant Financial, NEC, SAP, and VMWare. The U.S.\ Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views, policies, or endorsements, either expressed or implied, of DARPA, NIH, ONR, or the U.S.\ Government.
| {'timestamp': '2019-01-03T02:06:30', 'yymm': '1810', 'arxiv_id': '1810.02309', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02309'} | arxiv |
\section{Introduction}
\label{sec:intro}
\input{intro}
\section{Pomsets and message-sequence charts}
\label{sec:msc}
\input{msc}
\section{Realisability and termination soundness
of pomsets}
\label{sec:realisability}
\input{realisability}
\section{Pomset based verification conditions}
\label{sec:pomsets}
\input{pomsets}
\section{Discussion on the pomset based conditions}
\label{sec:implementation}
\input{implementation}
\section{Related work}
\label{sec:related}
\input{related}
\section{Concluding remarks}
\label{sec:conc}
\input{conc}
\bibliographystyle{eptcs}
| {'timestamp': '2018-10-08T02:04:23', 'yymm': '1810', 'arxiv_id': '1810.02469', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02469'} | arxiv |
\section{Introduction}
Recommender system is one of the most important tools for solving the information overload problem on the Internet. In various websites, a wide variety of stuff have been recommended to users by their recommendation engines, e.g. movies, songs, books, products, advertisements, etc. All these are objects that cannot be split further. There are scenarios where users are interested in objects that consist of multiple, interacted parts. For example, women are always obsessed about the outfits to wear tomorrow, which consist of several fashion items that should be compatible. When moving, people are puzzled by what furniture and decorations they should buy for each room of their new house. These trigger a new recommendation problem in which the stuff being recommended are object sets. In this work, we will study this set recommendation problem. Specifically, we focus on personalized outfit recommendation, which is representative and in much demand in practice.
\begin{figure}[h]
\centering
\begin{center}
\subfigure[User 1]{
\includegraphics[width=0.3\linewidth,height=1.7in]{images/fashiontaste1.png}}
\subfigure[User 2]{
\includegraphics[width=0.34\linewidth,height=1.7in]{images/fashiontaste2.png}}
\subfigure[User 3]{
\includegraphics[width=0.3\linewidth,height=1.7in]{images/fashiontaste3.png}}
\end{center}
\caption{Examples of fashion sets created by three Polyvore users. Different users have different fashion tastes. Our goal is to recommend outfits to users that fit their style preferences.}
\label{fig-personal}
\end{figure}
Fashion-focused online communities such as Polyvore\footnote{http://www.polyvore.com/}, Chictopia\footnote{http://www.chictopia.com/}, Lookbook\footnote{http://lookbook.nu/} have developed rapidly in recent years. People are fond of making and sharing outfits on these platforms (Figure~\ref{fig-personal} illustrates exemplar outfits created by three users on Polyvore). They also extensively browse through these websites for great outfit ideas. With the huge number of outfits shared, it is of great value to build a system that automatically recommend outfits to users that fit their personal preferences.
Due to the traditional difficulties in effectively representing the content of the items, existing recommender systems are heavily dependent on the collaborative filtering (CF) technique. CF uses the historical ratings given to items by users as the sole source of information for learning. Its performance is very sensitive to the sparsity level of the user-item matrix. In set recommendation, the ratings correspond to entries of a high-order user-item tensor. The sparsity problem is even worse than in item recommendation, which makes the CF method inapplicable directly. On the other hand, the recent progress of deep neural networks provides promising solution to the representation problem of image content~\cite{lecun1998gradient,krizhevsky2012imagenet,Chatfield14,szegedy2015going}. We therefore explore the use of deep networks for outfit recommendation. Deep representation learning for the content information and collaborative filtering for the rating information are jointly performed in this work.
There are two key problems need to be tackled in personalized outfit recommendation. The first is the modeling of the compatibility among multiple fashion items. And the second is capturing users' personal interests. Inspired by recent works on deep network based metric learning, we solve the former one by first mapping the item images to a latent semantic space with a convolutional neural network (CNN). The compatibility of the features are then measured through a multi-layer fully-connected network. We study three alternative architectures that combine feature learning and compatibility modeling in different ways. For the second problem, we encode user-specific information in the parameters of the networks. Although each user may has his unique fashion taste, he still follows some general rules for making outfits. Besides, the usually small number of training samples for a single user makes it necessary to borrow training data from other users that share similar taste. With these observations, we adopt a two-stage strategy for training the network. The first stage learns a general compatibility model from outfits of all users. In the second stage, we fine-tune the general model with user-specific data. Fine-tuning is an important technique for training deep neural networks for applications with limited number of training samples. In this work, we explore the use of fine-tuning for personalized modeling, which is a new usage of this technique. We conduct experiments with a large scale data set collected from Polyvore. Detailed comparisons between different network structures and training strategies are provided.
\section{Related work}
Driven by the huge profit potential in the fashion industry, intelligent fashion analysis, e.g. clothing recognition, parsing, retrieval, and recommendation, has received a great deal of attention recently~\cite{Liu2014Fashion}. For recommendation, existing work mainly studied it under the retrieval framework~\cite{Liu2012Hi,Jagadeesh2014Large,Iwata2011Fashion,McAuley2015Image,veit2015learning}, i.e. recommending fashion items that go well with a given query. In the latest work, McAuley et al.~\cite{McAuley2015Image} learned a parametric distance transformation such that clothing pairs that fit well are assigned with a lower distance than those that are not. Veit et al.~\cite{veit2015learning} used a Siamese CNN architecture to learn feature transformation for compatibility measure between pairs of items. All these works only studied compatibility between two objects. Besides, they only modeled general matching rules and did not consider the personalization issue. Hu et al.~\cite{hu2015collaborative} made an initial exploration of personalized outfit recommendation. A functional tensor factorization method was proposed to model the user-item and item-item interactions. However, they used hand-crafted features and did not jointly optimize feature representation and compatibility modeling.
Several recent works have explored the use of deep networks for metric learning. Some learned feature representations using CNN such that traditional metrics, e.g. the Euclidean distance, between the learned features would be consistent with the semantic distance~\cite{bell2015learning,veit2015learning,wang2014learning}. Some other works not only considered representation learning but also concatenated the features of the two objects and further learned a multi-layer network to measure the distance~\cite{Kiapour2015Where,han2015matchnet,Zbontar2015Computering}. We followed the ideas of the second kind of works. But instead of similarity, we learn compatibility of items from different categories. Researchers have also begun to apply deep learning to recommender systems. Wang et al.~\cite{Wang2015Collaborative} proposed a hierarchical Bayesian model that jointly performed deep representation learning and collaborative filtering. In~\cite{Geng2015Learning}, a deep model which learned a unified feature representation for both users and images was presented. However, these works only considered recommendation of individual items.
\section{Our approach}
\label{ourApproach}
Assume that the heterogeneous fashion items can be grouped into $N$ categories. For example, the three most essential categories for fashion are tops, bottoms and shoes. An outfit is a collection of fashion items with each coming from a different category. Given some historical data, we would like to learn a model so that for any user/outfit pair, we can assign it a rating score $s$. The score reflects the level of affection the user has for the outfit. The higher the score, the more appealing the outfit is to the user. The outfits with the highest scores are then recommended to the users.
Basically, the rating $s$ for a user/outfit pair is determined by how well the items in the outfit go with each other. It also depends on how much the user likes the items as well as the act of putting them together. We design appropriate deep network structures to model the interactions among the items. To achieve personalization, we develop a two-stage training strategy and embed the user-specific preferences in the parameters of the network. In the following, we discuss these two components in more details.
\subsection{Network architecture}
\label{models}
Our problem is closely related to metric learning, an extensively studied problem in machine learning. The metric learning task learns a distance function over objects so that the distances between pairs of objects can be effectively evaluated. In our application, we need to model relationship among multiple objects and instead of similarity, we are interested in the compatibility of objects. Nevertheless, the basic framework developed for metric learning is still applicable for solving our problem. There are mainly two steps for learning a distance metric, i.e. mapping the objects to a low dimensional latent space and measuring the distance in that space. We design components functionally similar in our networks.
We explore three different network architectures as shown in Figure~\ref{fig:structure} and Table~\ref{tab-models}. Without loss of generality, here we assume an outfit consists of three items, i.e. a top, a bottom and a pair of shoes. It is straight forward to extend the networks for handling outfits with more items.
1) In FashionNet A, the images of the items are first concatenated to create a new image with 9 color channels. Then the compounded image is fed to a widely used CNN model, e.g. the VGGNet. The output layer is a fully-connected layer with the Softmax function as its activation function. It converts the feature representation obtained by the CNN model to some scores. There are two outputs from this final layer. They can be interpreted as estimates of the probability that the outfit is liked and disliked by the user, respectively. In this architecture, the components of representation learning and compatibility measure are fully integrated. The two steps are carried out simultaneously right from the first convolution layer.
2) In FashionNet B, we apply representation learning and compatibility measure sequentially. The images are first mapped to a feature representation via a feature network. The same CNN model is used for items from different categories, i.e. item images are projected to a common latent space. To model the compatibility, we concatenate the features of all items and feed them to three fully-connected layers. Some recent works have used this type of fully-connected network for distance metric learning, with applications in patch-based matching~\cite{han2015matchnet}, cross-domain retrieval~\cite{Kiapour2015Where} and stereo matching~\cite{Zbontar2015Computering}. In this work, we show that this network structure also has the capacity for approximating the underlying compatibility among multiple features.
3) Both FashionNet A and B try to directly model the compatibility among multiple items. They may come across some difficulties when trying to capture the high-order relationships. The data space is significantly expanded when we concatenate all the items, either in original image space as FashionNet A or in feature space as FashionNet B. Due to the curse of dimensionality, a huge number of training samples may be required for a good model to be learned. Although users on the Internet have contributed so many outfit ideas, it is still minor compared to the number of all possible outfits.
To alleviate this problem, we impose a prior restraint in FashionNet C. We assume that the compatibility of a set of items is mainly determined by how well pairs of these items go with each other. Therefore, after representation learning, we only concatenate features of any two items and load them into a matching network. We again use a three-layer fully-connected network with Softmax activation at the third layer to model the pairwise compatibility. Different matching networks are used for different types of pairs, e.g. the matching between tops and bottoms is modeled differently from the matching between tops and shoes. Then the outputs from the final layers regarding the probabilities that the item pairs are matched well are added together to get a final score $s$ for the whole outfit.
We formulate this learning task as a learning-to-rank problem. Unlike binary classification, which only models whether an outfit is liked or disliked by a user, the rank learning formulation can handle multiple levels of ratings. We use pairs of outfits as the training samples. A training sample contains two outfits, e.g. $\{I_t^+,I_b^+,I_s^+\}$ and $\{I_t^-,I_b^-,I_s^-\}$, where the former is preferable to the latter. We use a two-tower structure illustrated in Figure~\ref{fig-rankloss} to train the networks. Specifically, we minimize the rank loss
\begin{equation}
L = \frac{1}{M}\sum_{i=1}^M\log(1+\exp(-(s_i^+-s_i^-)))
\end{equation}
over a training set. $s_i^+$ and $s_i^-$ are the predicted scores for the outfits in the $i$-th pair.
\begin{figure}[t]
\begin{center}
\subfigure[\small{FashionNet A}]{
\includegraphics[height=1.05in,width=0.85in]{images/FashionNetA.png}}
\subfigure[FashionNet B]{
\includegraphics[height=1.05in]{images/FashionNetB.png}}
\subfigure[FashionNet C]{
\includegraphics[height=1.25in]{images/FashionNetC.png}}
\subfigure[Training structure]{
\includegraphics[height=1.05in]{images/RankLoss.png}
\label{fig-rankloss}}
\end{center}
\caption{Network architectures. (1), (2) and (3) are three alternative architectures. For VGGNet, we use the VGG-Medium structure in~\cite{Chatfield14}. FC stands for fully-connected layer. For both VGGNet and the FC layers, we use Local Response Normalization and ReLU activation. $I_t$, $I_b$ and $I_s$ are images of the top, bottom and shoes respectively. Images are preprocessed before fed into the network. The preprocessing includes two steps, i.e. spatially resizing to $224\times224$ and subtracting the mean images. $s$ is the predicted preference score of the input. (4) illustrates the two-tower structure for training. The two towers share the same set of parameters.}
\label{fig:structure}
\end{figure}
\begin{table}
\caption{Layer parameters of FashionNets.}
\label{tab-models}
\centering
\begin{tabular}{lllll}
\toprule
Architecture & Layers & Shared parameters & Input size & Output size \\
\midrule
FashionNet A & VGGNet & No & 9x224x224 & 2048 \\
~ & FC + Softmax & No & 2048 & 2 \\
\midrule
~ & VGGNet$_1$ & \textbackslash & 3x224x224 & 2048 \\
FashionNet B & VGGNet$_2$ & \ | Yes & 3x224x224 & 2048 \\
~ & VGGNet$_3$ & / & 3x224x224 & 2048 \\
~ & 3FC + Softmax & No & 6144 & 2 \\
\midrule
~ & VGGNet$_1$ & \textbackslash & 3x224x224 & 2048 \\
~ & VGGNet$_2$ & \ | Yes & 3x224x224 & 2048 \\
FashionNet C & VGGNet$_3$ & / & 3x224x224 & 2048 \\
~ & 3FC + Softmax$_1$ & No & 4096 & 2 \\
~ & 3FC + Softmax$_2$ & No & 4096 & 2 \\
~ & 3FC + Softmax$_3$ & No & 4096 & 2 \\
\bottomrule
\end{tabular}
\end{table}
\subsection{Training}
For a single user, we usually only have a small number of training outfits. It is difficult to directly train a network from scratch with such limited training data. On the other hand, there are a large number of outfits shared by other users who have similar fashion taste. It would be helpful to take advantage of this data. Furthermore, although each user may have his own preference, there are some customary rules followed by most people for making outfits, e.g. T-shirt and jeans are usually paired up. With these observations, we design a two-stage procedure to train the deep network for personalized outfit recommendation.
In the first stage, we learn a general model for compatibility measure. We discard the user information and mix outfits created by different users together. Following~\cite{hu2015collaborative}, we create neutral outfits by mixing randomly selected fashion items. It is reasonable to assume that the items in a user created outfit is more compatible than those in a neutral outfit. Therefore a training sample can be made by pairing a user generated outfit with a neutral one. We initialize the VGGNet with parameters pretrained on ImageNet~\cite{deng2009imagenet} and initialize the other layers with random numbers drawn from Gaussian distribution. Then we optimize the parameters of the whole networks using the mixed dataset.
In the second stage, we train user-specific model for personalized recommendation. For each user, we first initialize the network with parameters obtained by the previous general training. Then we use each user's own data to fine-tune the parameters. Fine-tuning is a very import technique for training deep networks. It helps ease the data insufficiency problem in many applications. Here we use fine-tuning to adapt a general compatibility model to a user-specific model that addresses user's unique preference.
For FashionNet A, we fine-tune the whole network in this stage. For FashionNet B and C, there are two strategies. The first is to fine-tune the whole network so that both the feature network and the matching network will have personalized parameters. This results in different feature representations of the items for different users. The second method is to freeze the feature network and only fine-tune the matching network. In this case, the features will keep the same and the user-specific information will be carried only by the matching network. This will save a lot of computation during testing which is favorable in practice. We will compare the performance of these two strategies in Section~\ref{comparisons}.
\section{Experimental results}
\begin{table}
\caption{Results comparison of different architectures. \emph{Initial} is the result of using initial parameters. \emph{Stage one} is the result of the general model, i.e. the result after the first stage training. \emph{Stage two (partial) and stage two (whole)} are the results after the second stage of fine-tuning. \emph{Stage two (partial)} corresponds to the strategy of freezing the feature network and only updating the matching network. \emph{Stage two (whole)} fine-tunes the whole network. \emph{Stage two (direct)} is the result of directly fine-tune the initial parameters without the first stage of general training.}
\label{tab-ndcg}
\centering
\begin{tabular}{clcc}
\toprule
Architecture & Training strategy & Mean NDCG & Positive outfits in top 10 results \\
\midrule
~ & Initial & 0.35356 & 1.51375 \\
FashionNet A & Stage one & 0.59291 & 4.68125 \\
~ & Stage two (direct) & 0.61545 & 5.30125 \\
~ & Stage two (whole) & 0.70696 & 6.60375 \\
\midrule
~ & Initial & 0.35552 & 1.56250 \\
FashionNet B & Stage one & 0.65694 & 5.31625 \\
~ & Stage two (partial) & 0.75818 & 7.12250 \\
~ & Stage two (whole) & 0.79644 & 7.83000 \\
\midrule
~ & Initial & 0.32152 & 1.22250 \\
FashionNet C & Stage one & 0.66534 & 5.60625 \\
~ & Stage two (partial) & 0.78378 & 7.60500 \\
~ & Stage two (whole) & 0.81208 & 8.18250 \\
\bottomrule
\end{tabular}
\end{table}
\subsection{Data set and evaluation criteria}
To train the deep networks, we collect data from the popular fashion website Polyvore. Our data set contains outfits created by 800 users. This is significantly larger than the data set used by previous work~\cite{hu2015collaborative}, which only contains outfits of 150 users. We refer to user created outfit as positive outfit. We also created a set of neutral outfits for each user by randomly mixing the tops, bottoms and shoes. For each user, we split the user created outfits and neutral outfits into three groups, i.e. the training, validation, and testing sets. The numbers of positive outfits per user for each group are 202, 46, and 62 respectively. The numbers for the neutral outfit are 6 times larger than the corresponding positive ones, i.e. 1212, 276, and 372.
During evaluation, for each user, the positive and neutral outfits in the testing set are ranked in descending order of their scores $s$. We use NDCG, a widely used criteria for comparing ranked lists, to evaluate the performance. The NDCG at the $m$-th position of an ordering $\pi^{'}$ is
\begin{equation}
NDCG@m = (N_{m})^{-1}\sum_{i=1}^{m}\frac{(2^{y_{\pi^{'}(i)}}-1)}{log_{2}(max(2,i))},
\label{equ-ndcg}
\end{equation}
where $N_{m}$ is the score of an ideal ranking, $y_{\pi^{'}(i)}$ is 1 for positive outfits and 0 for neutral ones. The optimal value of NDCG is 1. Mean NDCG is the mean of NDCG@m for $m = 1, \ldots, M$ with $M$ being the length of the ordering. We report the average of mean NDCG and the average of NDCG@m for some $m$ over all users. We also count the number of positive outfits in the top-k results for some $k$ and report the average number over all users.
\subsection{Results}
\label{comparisons}
We use Caffe~\cite{jia2014caffe} to build the networks. For all training strategies, we set the batch size as 30 and the epoch number as 18. Learning rates for different layers during fine-tuning are determined as suggested in~\cite{Chatfield14}. For each architecture, we report the results after different training steps in Table~\ref{tab-ndcg}. The first is the result using the initial parameters, i.e. the parameters pretrained on ImageNet for the VGGNet and random values for the fully-connected layers. Then the results after the first and the second stage of training are showed. For the second stage, we compare the results of only fine-tuning the matching network and fine-tuning the entire network for FashionNet B and C. For FashionNet A, since representation learning and matching modeling are inseparable, we are not able to report the result of only fine-tuning the matching network. Instead, we check the result of passing over the first stage of general training and directly fine-tuning the network with user-specific data. In Figure~\ref{fig-ndcgat} and Figure~\ref{fig-topkaccuracy}, we show the average of NDCG@m and the number of user created outfits in top-k results respectively. Also, the top 10 outfits after each step for four users are showed in Figure~\ref{fig-outfits} for qualitative comparison.
\begin{figure}[h]
\centering
\begin{center}
\subfigure[FashionNet A]{
\includegraphics[width=0.32\linewidth, height=1.6in]{images/ndcgat1.png}}
\subfigure[FashionNet B]{
\includegraphics[width=0.32\linewidth, height=1.6in]{images/ndcgat2.png}}
\subfigure[FashionNet C]{
\includegraphics[width=0.32\linewidth, height=1.6in]{images/ndcgat3.png}}
\end{center}
\caption{The average of NDCG@m over all users.}
\label{fig-ndcgat}
\end{figure}
\begin{figure}[h]
\centering
\begin{center}
\subfigure[FashionNet A]{
\includegraphics[width=0.32\linewidth, height=1.6in]{images/topk1.png}}
\subfigure[FashionNet B]{
\includegraphics[width=0.32\linewidth, height=1.6in]{images/topk2.png}}
\subfigure[FashionNet C]{
\includegraphics[width=0.32\linewidth, height=1.6in]{images/topk3.png}}
\end{center}
\caption{The positive outfit numbers in top-k results.}
\label{fig-topkaccuracy}
\end{figure}
\begin{figure}[h]
\begin{center}
\subfigure[User 1]{
\includegraphics[width=0.45\linewidth, height = 2.8in]{images/results1.png}}
\subfigure[User 2]{
\includegraphics[width=0.45\linewidth, height = 2.8in]{images/results2.png}}
\subfigure[User 3]{
\includegraphics[width=0.45\linewidth, height = 2.8in]{images/results3.png}}
\subfigure[User 4]{
\includegraphics[width=0.45\linewidth, height = 2.8in]{images/results4.png}}
\end{center}
\caption{For each user, the top 10 outfits obtained after different training steps for FashionNet C are shown respectively. Outfits in red box are user created ones. For each user, the four results from top to bottom are: Stage two (whole), Stage two (partial), Stage one, and Initial respectively.}
\label{fig-outfits}
\end{figure}
From the experimental results, we have the following observations.
\paragraph{\textbf{FashionNet A vs. FashionNet B and C}} The performance of FashionNet A is inferior to the other two architectures. The ''stage two (whole)'' performance of FashionNet B surpasses A by about $12.7\%$ in mean NDCG and $18.6\%$ in top-10 positive outfit number. As for FashionNet C, the two margins are $14.9\%$ and $23.9\%$ respectively. The possible reason for FashionNet B and C to obtain the advantage is, representation learning and compatibility modeling are performed separately in them, so that we are able to use different network structures to achieve different functionalities. The networks are more easier to design and optimize in this case.
\paragraph{\textbf{FashionNet B vs. FashionNet C}} FashionNet C works slightly better than FashionNet B. This verified our analysis in Section~\ref{models}. By concatenating features of all the items in FashionNet B, the data space is significantly expanded, which brings in difficulties for learning. It is challenging to directly model the joint compatibility among multiple fashion items. Decomposing the high-order relationship into a set of pairwise interactions is an effective solution.
\paragraph{\textbf{Stage one vs. Stage two}} For all three architectures, there are obvious performance promotions when moving from stage one to stage two. This demonstrates the successfulness of using the fine-tuning technique for personalized modeling. The performance gaps between the two also verify the importance of personalized modeling, which has been left out by some previous works. For FashionNet A, the result of directly fine-tuning the network without general training is much worse than the two-stage training method. Therefore, it is indeed valuable to exploiting the information shared by other people when performing personalized recommendation.
\paragraph{\textbf{Stage two (partial) vs. Stage two (whole)}} For both FashionNet B and FashionNet C, fine-tuning the entire network achieves better results than only fine-tuning the matching network in the second stage of training. It indicates that learning a user-specific feature representation is helpful for the recommendation task. However, in this case we need to re-compute the features of the items for each user, which is computationally expensive. By only fine-tuning the matching network, we use the same feature representation for all users. For different users, we only need to feed the pre-computed features into the corresponding matching network. This is efficient both for training and testing. In practice, people may prefer the partial strategy although its performance is slightly worse.
\section{Conclusion}
\label{conclusions}
In this work, we have studied the problem of personalized outfit recommendation. This is a representative application of object set recommendation, a relatively new setting for recommender systems. We explored the use of deep neural networks, which jointly perform representation learning and compatibility modeling, for this task. Three alternative network architectures that combine the two functional components in different ways are designed and compared. To achieve personalized recommendation, we developed a two-stage training strategy. Fine-tuning is used to adapt a general matching model to a model that embeds user's unique fashion taste. We conducted extensive experiments on a large scale real world data set. The effectiveness of our networks has been verified by the results.
{\small
\bibliographystyle{ieeetr}
| {'timestamp': '2018-10-08T02:03:38', 'yymm': '1810', 'arxiv_id': '1810.02443', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02443'} | arxiv |
\section{Introduction}
Procedural content generation (PCG) in games is now a flourishing research field as well as a well-received game design practice~\cite{shaker2016procedural,short2017procedural}. Among the more ambitious visions in PCG is the automatic or semiautomatic design of complete games~\cite{cook2014rogue,togelius2008experiment}. Many ideas for how to create games are purely algorithmic, imagining that games can be created through computational procedures with no particular input, \emph{ex nihilo} if you wish. But human game designers do not create games out of nothing; such games are embedded in a cultural context and constantly inspired by their experiences, including other games, high-flying ideas and mundane goings-on.
Luckily, much of the real world now exists digitally represented in easily accessible form. It makes sense that freely available data could be used to inform content generation and game generation algorithms, in effect helping them transform the real world into games. Such data-driven game content generation has been attempted under the moniker ``data games'' \cite{friberger2012generating}. In particular, the \emph{Data Adventures} series
has explored ways of automatically creating adventure games in the style of \emph{Where in the world is Carmen Sandiego?} (Br{\o}derbund Software, 1985) from data sources such as Wikipedia and OpenStreetMap (OSM)~\cite{haklay2008openstreetmap}.
Previous iterations of the Data Adventures series produced games that successfully integrated data from various sources, but were somewhat lacking in playability. This was deemed to be partly due to the user interface, but also due to the core game design patterns that the generator used. In order to convincingly demonstrate the potential for data-driven adventure game generation, the generated games need to be enjoyable and intuitive, necessitating a redesign of both the game interface and the game generator.
This paper presents the outcome of that process, DATA Agent, the third generation installment from the Data Adventures series. DATA Agent has a redesigned backstory, trying to create coherent scenarios while acknowledging the frequently absurd results of building on Wikipedia data; a new story generation mechanism to work with the new story pattern; and a redesigned user interface. The games produced by the DATA Agent generator, while having in common with previous Data Adventures games that they are adventure games generated from open data, play very differently. Below, we detail the game design and generator design of DATA Agent, and also the results of a user study where 30 individuals played two games generated by DATA Agent and answered a questionnaire. Key findings from the user study include the fact that players were curious to play more mysteries with different people, the interface and general interactions were intuitive, and that it was straightoforward to find the solution to each mystery.
\section{Background}\label{sec:related}
The DATA Agent system generates playable adventure games based on open data, building on prior work in open data techniques and procedural content generation as well as the design conventions of adventure games. Below, we describe existing work on \emph{data games} in Section \ref{sec:related_datagames}, survey the definition and game design of adventures games in Section \ref{sec:related_adventure}, and review various projects involving story, quest, and dialog generation (as core components of adventure games) in Section \ref{sec:related_story}.
\subsection{Data Games}\label{sec:related_datagames}
\emph{Data games} use freely available information to automatically generate game content \cite{friberger2012generating}. This term was first proposed by \citeauthor{friberger2012generating}, describing a generator that transforms open data into \emph{Monopoly} (Hasbro, 1935) boards ~\cite{friberger2012monopoly}. Data games promote the visualization and interaction of information in creative and/or interesting ways. Bar Chart Ball, for example, uses demographic data selected by the player and represented as a bar chart~\cite{togelius2013bar}; the game is played by choosing what is visualized.
Similarly, Open Trumps generates decks of \emph{Top Trumps}\footnote{\url{https://en.wikipedia.org/wiki/Top_Trumps}} cards using governmental information~\cite{cardona2014open}; and geographical data from OpenStreetMap (OSM)~\cite{haklay2008openstreetmap} have been used to generate maps and players' initial positions for FreeCiv\footnote{FreeCiv is an open source version of Civilization. (\url{http://www.freeciv.org/})}~\cite{barros2015balanced}.
A different type of data game is proposed in \emph{A Rogue Dream} ~\cite{cook2014rogue}, which uses the auto-complete results of Google queries (using templates) to generate names for player abilities, enemies and healing items of a rogue-like game. The resulting game entities are not stemming from structured data in open-access repositories, but rather from the crowd-sourced data machine-learned by Google algorithms. Notably, sprites for A Rogue Dream entities are found via Google image searches using the word describing each entity. In MuseumVILLE\footnote{MuseumVILLE: (\url{https://github.com/bogusjourney/museumville/})}, content is selected from Europeana\footnote{Europeana is a portal for accessing digitised cultural heritage material, such as paintings and books, from more than 2,000 institutions across Europe.}. The player of MuseumVILLE takes the role of a museum curator who must theme their museum based on their interests. \emph{911 Operator} (Jutsu Games, 2016) is a commercial game about operating emergency telephone lines. The city maps used in the game are real-world maps, detailed up to exact street names and intersections.
Generating games from data allows for new play experiences to be shaped, for a multitude of purposes such as learning, contemporaneous or personalized games. Data-driven design opens the possibility for maximalist games that draw inspiration and combine content from dissimilar sources and points of view \cite{barros2018maximalist}.
\subsection{Adventure Games}\label{sec:related_adventure}
According to Fern\'andez-Vara's definition, an \emph{adventure game} is a simulation in which the player interacts with the rule system of a fictional world, populated with a series of concatenated puzzles which structure the performance of the player~\cite{vara2009tribulations}. Adventure games as a genre include a variety of game types, including \emph{interactive fiction}, \emph{graphical text adventures}, and \emph{point-and-click games}.
Mystery adventure games, a subtype of adventure games, cast the player into the role of a detective and gameplay revolves around solving a crime or mystery. In these games, players often visit exotic locations around the world and speak to a variety of interesting characters to gather clues and evidence. Games within this genre include \emph{Where in the World is Carmen Sandiego?} which tasks the player with finding a fugitive criminal, and the \emph{Sherlock Holmes} series (Frogwares 2002). Other games, such as \emph{Indiana Jones and the Fate of Atlantis} (LucasArts 1992), the \emph{Tomb Raider} series (Eidos 1996), and \emph{Uncharted} (Naughty Dog 2007), see the player embark on an adventure to solve mysteries and puzzles, often facing down criminal organizations and adversaries along the way.
\subsection{Story, Quest, and Dialog Generation}\label{sec:related_story}
Research into story, quest, and dialog generation has mostly dealt with the creation and organization of text. Veale explored the value of using characters familiar to most audiences and auto-generating written stories with them~\cite{vealedeja}. \emph{M\'{E}XICA} is a system capable of generating creative writing~\cite{perez2001mexica}; it was further enhanced by combining an nn Narrator~\cite{montfort2007generating} to create \emph{M\'{E}XICA}-nn, a story generator capable of creating high-level plot lines~\cite{montfort2008integrating}. \emph{MABLE} is a generative ballad machine, combining the creation of stories and lyrics~\cite{singh2017ballad}, which is built on top of \emph{M\'{E}XICA}. \emph{Chronicle} is a system that generates unpredictable stories that are still coherent~\cite{pickering2017applying}. \emph{BRUTUS} creates dark stories of betrayal using characters with complex backgrounds and narratives~\cite{bringsjord2000artificial}. \emph{MINSTREL} uses author-level problem solving to generate stories about King Arthur and his knights~\cite{Turner:1993:MCM:166478}.
In adventure games, quests and dialog are an essential part of the narrative. \emph{Mystery of Solaris} uses a two-tiered generator that constructs maps and missions together~\cite{lavenderadventures}. \emph{Charbitat} uses a lock-and-key mechanism to create a sense of progression in the game~\cite{alderman2006charbitat,ashmore2007quest}. \emph{Symon}, a point-and-click adventure game that uses PCG to create puzzles, was expanded into the ``Puzzle Dice System'' as a generalized way to generate puzzles in adventure games~\cite{fernandez2012procedural,fernandez2014creating}.
Work on dialog generation can trace its roots back at least to \emph{ELIZA}, an early natural language processing computer which could simulate conversation~\cite{weizenbaum1966eliza}. \emph{Text2dialog} transforms monological text into dialog, and agents then act it out~\cite{hernault2008generating}. Interactive fiction uses dialog generation and delivery extensively, e.g. combining narrative goals, implicit forms of character expression, and emotional relationships between characters to generate realistic dialog \cite{cavazza2005dialogue}.
Creating dialog, quests, and narrative for games is part of a larger subject of transforming an input from one medium to another. Probably the most fully realized game with interactive drama is Fa\c{c}ade \cite{mateas2003faccade}. The core interaction mode in Fa\c{c}ade is dialog, taking natural language inputs from the user and transforming it into Non-Playable Characters' (NPCs) reactions. In another example, Scheherazade~\cite{li2015scheherazade} uses crowd-sourcing to create generalized models of domains, such as bank robberies, for interactive storytelling.
\begin{figure*}[t]
\centering
\subfloat[Snapshot of the intro video]{\includegraphics[width=0.32\textwidth]{screens/video1.jpg}\label{fig:backstory_cutscene1}}\quad
\subfloat[Start Menu]{\includegraphics[width=0.32\textwidth]{screens/intro2.jpg}\label{fig:backstory_intro}}\quad
\subfloat[Game Lost Screen]{\includegraphics[width=0.32\textwidth]{screens/outro.jpg}\label{fig:backstory_outro}}
\caption{An extensive introductory cutscene (Fig.~\ref{fig:backstory_cutscene1}) frames the time anomaly backstory and DATA agency. The dialog on the start menu screen (Fig.~\ref{fig:backstory_intro}) provides a short reminder on the context and winning conditions of the game. The winning or losing screens (Fig.~\ref{fig:backstory_outro}), at the end of the game, also tie in with the time anomaly backstory.}
\label{fig:backstory}
\end{figure*}
\section{The Data Adventure series}\label{sec:series}
DATA Agent is the third installment in the Data Adventures series. The goal of this series is to explore how semantically linked open data can be used to generate structured point-and-click adventure games \cite{barros2018maximalism}. Open data is exploited to not only generate individual game elements, such as NPCs and locations, but also to link them together as causal links that can be revealed through player agency. While different game generators within the series use different narratives and technologies, the underlying design principle is for a player to explore and unlock parts of the story as they visit and interact with game elements; the core technological principle is using DBPedia (a structured database derived from Wikipedia) for finding associations between people, using OpenStreetMap (OSM) for finding the maps for in-game locations and Wikimedia Commons for images of NPCs and items.
The first instance in the Data Adventures series is the generator of the same name \cite{barros2015data}. Data Adventures builds linear experiences, where players must find a target NPC starting from the house of another NPC. Both the initial and goal NPCs are created from real-world people with Wikipedia articles. A path between these NPCs is discovered through links from their semantically linked DBPedia entries. The linear path between them serves as input for the automatic creation of the game, from places to NPCs and dialog.
WikiMystery~\cite{barros2016murder,barros2018killed} is the successor to Data Adventures which can generate entire point-and-click murder mysteries using minimal human assistance. After being given a single name as input, the system can build a mystery game where a virtual representation of the given person was killed. The player has to travel to places, finding clues and talking to NPCs in order to find suspects and discover the culprit. Like Data Adventures, a core concept in WikiMystery is its link to real-world data accessed via open data repositories. Everything in WikiMystery corresponds to some snippet of open data, be it the physical locations of cities on the world map or the background of the building the player was currently located.
\section{DATA Agent}\label{sec:game}
DATA Agent is a system that combines a murder mystery game generator (as it generates games from open data) and a game: in the game, the player must identify a time-traveling doppelganger who has committed a murder and is now masquerading as a historical person. In the game, the player must travel between places and interact with historical people (NPCs), in order to collect information which will allow them to identify the culprit in a lineup of suspects based on historical people. The premise of a murder mystery is intended to prompt the curiosity of the player; having more than one possible suspects which the player must learn facts about also increases the game's learning potential.
The architecture of the DATA Agent system is divided into client-side and generator-side. The client side (i.e. the actual game) was built using the \emph{Unity 3D} game engine (Unity Technologies, 2005), while the generator-side (i.e. the generator of adventures) was built in Java. The generator creates adventures using an evolved version of past Data Adventures generators. The client-side game design is detailed in Section \ref{sec:design}; the server-side generator is summarized in Section \ref{sec:generator}.
\subsection{Game Design}\label{sec:design}
The following sections describe the narrative and visual design of DATA Agent, as well as a writeup of how the game is played.
\subsubsection{Backstory}\label{sec:design_backstory}
DATA Agent introduces a crafted narrative to explain the context and links between entities in the game. This serves both to explain certain expected inconsistencies (e.g. people from different time periods existing in the same game) and to clarify that both the murderer and the culprit do not refer to real events or people, respectively. The inconsistencies arise from the messiness of open data, and this will be discussed further in Section \ref{sec:discussion}. The player takes the role of a detective working for the Detective Agency of Time Anomalies (DATA). In the game's universe, criminals can go back in time and murder famous people, altering the time line and creating inconsistencies. To prevent this, DATA sends agents to the past to catch the killer and prevent the murder. Since the very act of going back in time messes up time lines, DATA has incomplete information about the past, and can only tell the player who the suspects are. It is the job of the player to learn facts about the suspects from other NPCs and objects, then catch the culprit, who is attempting to impersonate one of the suspects. Thankfully, the culprit has incomplete information about the person they are impersonating, and therefore will lie to the player about who they are. If the player has all the correct information about that individual, they can catch the culprit red-handed and save the day. All of this is clarified in the introductory cut-scene (which can be skipped), during the introductory dialog before the player starts the game, and at the end of the game: see Fig.~\ref{fig:backstory} for clarifications on how this narrative is communicated.
\begin{figure*}[t]
\centering
\subfloat[NPC Dialog]{\includegraphics[width=0.32\textwidth]{screens/d1.jpg}\label{fig:d1}}\quad
\subfloat[City screen, where buildings can be selected.]{\includegraphics[width=0.32\textwidth]{screens/d2.jpg}\label{fig:d2}}\quad
\subfloat[Item interaction]{\includegraphics[width=0.32\textwidth]{screens/d3a.jpg}\label{fig:d3}}\quad
\\
\subfloat[Collectible key]{\includegraphics[width=0.32\textwidth]{screens/d4.jpg}\label{fig:d4}}\quad
\subfloat[Building that can be unlocked with the key]{\includegraphics[width=0.32\textwidth]{screens/d5.jpg}\label{fig:d5}}\quad
\subfloat[Interrogation screen]{\includegraphics[width=0.32\textwidth]{screens/d6.jpg}\label{fig:d6}}
\caption{Different screenshots of the DATA Agent User Interface, from the playtsted Albert Einstein game.}
\label{fig:interface}
\end{figure*}
\subsubsection{User Interface}\label{sec:design_interface}
The Unity client, which allows players to interact with the game, was designed to allow for ease-of-use. The goal is for players to be able to access at any point all information they have gained throughout the game. Fig. \ref{fig:interface} shows several screenshots of the game. The game interface is split into three different displays: the game display (top right) for most game interactions, the description panel (bottom right) for showing information relevant to the current interaction, and the side-panel (left) which has several tabs displaying all information gathered so far.
\begin{itemize}
\item The \emph{Game Display} shows the player's current location and represents the current activity, e.g. talking to a person (see Fig.~\ref{fig:d1}), looking at a city map (see Fig.~\ref{fig:d2}), or reading a book (see Fig.~\ref{fig:d3}).
\item The \emph{Description Panel} contains a description of the last person, place, or object the player clicked on, either accessed from the Game Display or from a tab of the side-panel. If the player clicked on a place, they can travel to this place by clicking the ``Travel To'' button (see Fig.~\ref{fig:d2}). Places also display a list of known individuals the player found at this location. If the player clicked on a suspect from the Overview Panel, a list of known facts is displayed instead (see Fig.~\ref{fig:d6}).
\item The \emph{Journal Tab} marks all people (see Fig.~\ref{fig:d1}), places (see Fig.~\ref{fig:d2}), and objects (see Fig.~\ref{fig:d3}) that the player has uncovered, distinguishing those that have not been fully explored.
\item The \emph{Activity Tab} displays in-game actions the player has taken, including traveling to locations, talking to people, and inspecting items for clues. This allows the player to remember if they have already performed some actions and/or exhausted the possible actions in a location. The side-panel of Fig.~\ref{fig:d4} shows the activity tab.
\item The \emph{Overview Tab} displays a list of suspects and current items in the player's inventory (top and bottom of the side-panel in Fig.~\ref{fig:d3} respectively). If the player clicks on a suspect, the Description Panel displays all known information about this suspect as well as their known whereabouts (see Fig.~\ref{fig:d6}).
\end{itemize}
As noted above, DATA Agent provides the player with a journal containing notes about people, places and objects that they encounter in the game, as shown in Fig. ~\ref{fig:d1}. When a player encounters something for the first time, the journal provides a glowing notification and an exclamation mark near the newly added journal entry for the player's convenience. Clicking on an entry will display information in the Description Panel. This was designed to act as an easily-referenced encyclopedia in case the user wants more information about a specific game item. Any fact discovered about a suspect is also written to the journal for the player to easily access during an \textit{interrogation}, described in the Section \ref{sec:design_gameloop}. The addition of the journal and the activity log helps a user keep track of their past actions and discoveries, as well as the tasks that they still have to do (i.e. new journal entries); this addresses usability concerns in past games in the Data Adventures series.
\subsubsection{Game Loop}\label{sec:design_gameloop}
Players must talk to people and inspect items to learn clues and facts about suspects in order to win the game. In this version of DATA Agent, dialog reveals \emph{facts} about suspects, and both dialog and items reveal \emph{clues} for new cities and buildings to explore. Along the way, the player may encounter buildings they are unable to enter unless they spend a consumable item to unlock it. For instance, the player may come across a locked building (see Fig.~\ref{fig:d5}) that needs a key. Only after finding a key (see Fig.~\ref{fig:d4}) and using it at the locked location will the player be able to enter and inspect the items and people within.
After finding a suspect (initially their locations are hidden from the player), they may talk to him/her to start an \emph{interrogation}. During an interrogation, the suspects list facts about themselves, to which the player can respond ``Okay'' or ``You are Wrong!'' (see Fig.~\ref{fig:d6} and \ref{fig:s3}). Facts mentioned by the suspect are the same ones that the player should have acquired from other NPCs in the game. If a player presses ``Okay'', the suspect continues to list another fact; if the player presses ``You are Wrong!'' then a pop-up message allows the player to ``Arrest This Person.'' The culprit of the murder always lists one incorrect fact, i.e. a fact that differs from what other NPCs have provided to the player as facts for this suspect. Specifically, during interrogation the culprit lists a fact that is true for another suspect rather than a true fact about themselves. For example, if the culprit is Lise Meitner, when interrogated she will state that she does not have a notable student (which is true for the other suspect Walther Bothe); if the player has collected the true fact about Lise Meitner ``notableStudent: Max Delbr\"{u}ck'', they can identify that she is the time-traveling doppelganger. If the player chooses to arrest the suspect, the game ends. If this suspect was the culprit, a message appears congratulating the player, otherwise another message mentions the collapsing time line (and the end of the world) caused by arresting the wrong suspect (see Fig.~\ref{fig:backstory_outro}). We decided to use a suspect/culprit mechanic because of the interface it creates for the player to interact with the raw data: players must fact-check each suspect, therefore they have to collect and verify each fact to complete the game.
\begin{figure}
\begin{center}
\includegraphics[width=0.95\columnwidth,clip,trim={2cm 1.5cm 2cm 3cm}]{graphics/chart.pdf}
\end{center}
\caption{Example for suspect selection and its fitness calculation, in the Britney Spears testbed game. The fitness attempts to maximize the common predicates and objects between the victim and the suspects (bold arrows) and between the suspects themselves (dotted arrows, italics). Links are shown in the format ``${\langle}$predicate${\rangle}$: ${\langle}$object${\rangle}$''.}
\label{fig:fitness-illustration}
\end{figure}
\subsection{Generating Adventures}\label{sec:generator}
The system generates an adventure seeded by a person's name. A character representing this person's Wikipedia article becomes the victim of the murder, around which the plot is built. Initially, the system finds a large pool of possible suspects, and narrows it down to a select group of suspects that will appear in the game. Then, it finds paths linking each suspect and the victim, which eventually will shape the game's plot. The next sections explain this process.
\subsubsection{Suspect Selection}\label{sec:generator_suspects}
\input{dialog_table}
At the beginning of the suspect selection process, the system performs a series of queries to find people related to the victim. These queries use DBPedia, a system that structures information from Wikipedia in the form of tuples~\cite{auer2007dbpedia}, and the people it finds become a pool of possible suspects. Suspects must have a direct link to the victim, sharing at least one characteristic value (object) with the them. Specifically, two DBPedia entries are linked if they have the same characteristic value assigned to the same predicate: for example, both Britney Spears and Diana Ross have a ``hypernym'' (predicate) with value of ``singer''. See Fig.~\ref{fig:fitness-illustration} for a sample of shared predicates and objects. The query for suspect pooling returns only DBPedia entities of type ``person''. Depending on the number of predicates and their values in the DBPedia entry of the victim, the pool of possible suspects can be very large. Indicatively, with Albert Einstein as the victim the suspect pool is 5,092 people; with Britney Spears as the victim it is 17,415.
The system uses an $\mu+\lambda$ evolution strategy with cascading elitism~\cite{togelius2007towards} over the suspect pool to select an optimal group of suspects. Each genome consists of a set of $N$ suspects (based on previous feedback on the game, this paper uses $N=3$ suspects per case). The system uses two fitness functions on a population of 50 individuals. The first fitness function is the number of direct links between the victim and all suspects in the genome; the population is sorted based on this fitness and the worst half (lowest values) is removed. The remaining individuals are sorted based on the second fitness function, i.e. the number of direct links between suspects, and the worst half is again removed. This leaves only 25\% of the original population, and gives clear priority to the first objective (i.e. suspects connected to the victim) compared to the second objective (i.e. suspects connected to each other). The best 25\% of the original population is then copied and mutated to return the population to its original size. Mutation chooses one suspect in the genotype, and replaces it with a random entry from the suspect pool. The process ends after 500 generations, and the trio of suspects with the highest fitness is chosen as suspects for the game. Out of these, one is marked at random as the culprit.
Fig. \ref{fig:fitness-illustration} illustrates how each fitness is calculated: the score of the first fitness is 6 (2 common values between Britney Spears and each of the 3 suspects) and the score for the second fitness is 23 (14, 4 and 5 common values between the different suspects). Our assumption is that these fitnesses will result in a mystery where suspects have more common traits with the victim and between them. We experimented with a different function for the second sorting process, rewarding suspects with different characteristics, but the resulting sets were deemed too random and unintuitive.
\subsubsection{Path Generation}\label{sec:generator_path}
The generator creates each game element, be it an NPC, item or location, from articles linking the victim to each suspect. For each suspect, a series of search queries is made to DBpedia in order to find paths of articles that link the victim to each suspect. Due to computational limitations in querying the DBpedia endpoint, we limited the maximum path length to 4 edges (i.e.~5 articles) per path. Each suspect can have multiple paths linking it to the victim: these paths are assessed based on the types of articles in one path compared to types found in all paths for the same victim-suspect pair. All paths are sorted based on their diversity and length, favoring those that are longer \textit{and} contain articles of different types (e.g. places, people, etc). For example, a path with 4 articles is preferred to one with 2; and a path with an article about a person and one about a place is preferred to one about two places. After sorting, the best path is selected for that victim and suspect. This approach presents small but important deviations from the previous versions of Data Adventures. The old systems repeat the path generation process once, essentially finding minor paths between articles along the main (major) path that links victim and suspect. This results in paths that are far longer, increasing gameplay time.
Indicatively, for 3 suspects and a maximum path length of 4, DATA Agent would have $15$ objects if the system always selects a path of maximum length, while the WikiMystery generator \cite{barros2018killed} which precedes it would have $60$. While one may argue that longer games may be more interesting, playtesting showed us that when the player's interaction options are not varied enough, the game becomes repetitive and boring.
Once a best path is found for every suspect, the system generates in-game objects for each node in the paths: articles about locations are transformed into in-game cities and buildings; those about people become NPCs, and anything else is made into a game item, such as a book or a letter. Items and NPCs are placed in buildings within a city and are given descriptions, images, names, dialog lines as applicable. Items' descriptions and NPCs' dialog give clues that can reveal new buildings in the current city or a previously seen (or unseen) city, until finally the player can reach a suspect. When necessary, new NPCs or items are generated to fill gaps in the path (e.g. when an article is about a city, an NPC is created with a random name and minimal dialog and placed in a building within that city). Finally, lock and key puzzles are added to the game's paths using a variation of a breadth first algorithm that guarantees that each building can be unlocked with keys found before it.
\subsubsection{Dialog Generation}\label{sec:generator_dialog}
DATA Agent uses the Tracery grammar system~\cite{compton2014tracery} to create dialog. There are three types of dialog, each requiring its own grammar: \emph{essential} dialog, \emph{fact-giving} dialog or \emph{flair} dialog. Essential dialog gives clues about game objects, progressing the story and making the locations containing them accessible. Fact-giving dialog reveals information about suspects which is important when the player is interrogating a suspect to fact-check their responses. Flair dialog gives information about the current NPC that the player is talking to, such as their birth date or what they are known for, and it is not essential to progress in the game. Not every NPC has fact-giving or flair dialog, and suspects do not have dialog at all: their conversation triggers an interrogation, following a different mechanic than previous character interactions. Table \ref{table:grammar} defines several sentences used in the game, possible example lines that could be generated for this sentence, the sentence's dialog type, and the speaker of the sentence.
\begin{figure*}[t]
\centering
\subfloat[Singers at the house of the deceased, in McComb, Mississippi (the birthplace of Britney Spears)]{\includegraphics[width=0.32\textwidth]{screens/s2.jpg}\label{fig:s1}}\quad
\subfloat[A suspect makes a claim which can be falsified]{\includegraphics[width=0.32\textwidth]{screens/s4.jpg}\label{fig:s2}}\quad
\subfloat[An item consisting of a very sparse list]{\includegraphics[width=0.32\textwidth]{screens/s5.jpg}\label{fig:s3}}
\caption{Screenshots of the playtested Britney Spears game.}
\label{fig:britney-spears-game}
\end{figure*}
\section{User Study}\label{sec:study}
In order to test the games generated by the DATA Agent system, a user study was conducted with 30 participants playing two DATA Agent games. The study was largely exploratory, and its goals were to assess whether the design choices in both the user interface and the generator made the game easier to use (in terms of usability) and intuitive to solve (in terms of the difficulty in solving the mystery and the extent of interactions with the generated game content). The protocol followed, the games tested, the participants' demographics, and an analysis of their gameplay and feedback is provided in the following sections. Any statistical significance analysis reported is made with $\alpha=0.05$ threshold.
\begin{table}[tb]
\centering
\caption{Average interaction ratios for all playthroughs, along with their 95\% confidence intervals. The normalized (nrm.) values are divided by the number of respective game objects in each game.}
\label{table:gameplay-metrics}
\small
\begin{tabular}{l|ccccc}
\textbf{Values} & \textbf{City} & \textbf{Building} & \textbf{Item} & \textbf{People} & \textbf{Dialog} \\
\hline \hline
\multicolumn{6}{l}{Albert Einstein game}\\
\hline
Raw & 8.4$\pm$2.4& 15.5$\pm$2.8& 9.7$\pm$0.8& 5.8$\pm$0.9& 43$\pm$5.7 \\
Nrm. & 2.8$\pm$0.8& 1.6$\pm$0.3& 1.1$\pm$0.1& 0.8$\pm$0.1& 1$\pm$0.1 \\
\hline \hline
\multicolumn{6}{l}{Britney Spears game}\\
\hline
Raw &10.6$\pm$2& 16.1$\pm$2.6& 7.3$\pm$0.4& 9$\pm$1.1& 66.7$\pm$8.8 \\
Nrm. & 2.1$\pm$0.4& 1.6$\pm$0.3& 1$\pm$0.1& 0.9$\pm$0.1& 1.3$\pm$0.2 \\
\end{tabular}
\end{table}
\subsection{Experiment Design}\label{sec:study_protocol}
Subjects were asked to individually playtest two games generated by DATA Agent and give their opinions about their experience. Participants were found through use of New York University e-mail lists and social media, through which we asked for volunteers. All participants were brought to a quiet classroom setting. Before the test, participants were informed about open data, data games, and the motivations behind the research. It was stressed that everything in the DATA Agent games had been generated from open data using artificial intelligence and had not been hand-authored.
Subjects first filled out a pre-game questionnaire to obtain demographic information (gender, age), play habits (frequency and preference for games) and experience with adventure games (preference and three example adventure games).
The subjects were then asked to play two DATA Agent mysteries: \textbf{The Case of Albert Einstein}, and \textbf{The Case of Britney Spears}. These two cases were selected for their difference in terms of gender, type of celebrity, and contemporaneity. The order of games was randomly selected for each participant.
During play, participants were asked to freely voice their opinions about the game and the data, as all playthroughs were audio recorded. Researchers were available in case the player needed help or had questions about gameplay. All in-game player actions were logged, and specifically game events (e.g. cities visited) were logged and analyzed in Section \ref{sec:analysis}.
After the participants completed both mysteries (regardless of whether they won or not), participants were asked to fill out a post-game survey. The survey contained 11 questions regarding the gameplay and the broader appeal: answers were on a 5-scale Likert scale from ``strongly disagree'' to ``strongly agree''. Additionally, the survey included 4 questions regarding broader suggestions and reflections: answers to the latter were as free-form text.
After the experiment was over, participants were compensated with a \$10 Amazon Gift Card.
\subsection{Tested Games}\label{sec:study_games}
In \textbf{The Case of Albert Einstein} (see Fig.~\ref{fig:interface}), players set out to solve the murder of Albert Einstein, for which the suspects are Walther Bothe, Lise Meitner, and Max von Laue; Lise Meitner is the (doppelganger) culprit.
This game involves regular NPCs such as Langston Hughes, Franklin D. Roosevelt, and Harry Emerson Fosdick. The player can travel between three cities: Switzerland, The German Empire, and Germany. In total, there are 10~buildings (e.g. ``House of Lise Meitner'' in Fig.~\ref{fig:d5}, ``Library'' in Fig.~\ref{fig:d2}), 9~items (e.g. ``a photograph about The Evolution of Physics: The Growth of Ideas From Early Concepts to Relativity and Quanta'' in Fig.~\ref{fig:d3}), 7~people, and 41~dialog nodes to explore.
In \textbf{The Case of Britney Spears} (see Fig.~\ref{fig:britney-spears-game}), players set out to solve the murder of Britney Spears, for which the suspects are Aretha Franklin, Diana Ross, and Taylor Hicks; Diana Ross is the (doppelganger) culprit.
This game involves regular NPCs such as Whitney Houston, Jamie Lynn Spears, and Katy Perry. The player can travel between five cities: ``McComb, Mississippi''; ``New York City''; ``Birmingham, Alabama''; ``City of Bloomfield Hills''; and ``Detroit, Michigan''. In total, there are 10~buildings, 7~items (e.g. ``a book about List of awards and nominations received by Britney Spears'' in Fig.~\ref{fig:s3}), 10~people, and 52~dialog nodes to explore.
\subsection{User Data}\label{sec:study_users}
\begin{table}[tb]
\centering
\caption{Weighted average (1 for strongest disagreement, 5 for strongest agreement) of user's responses to specific post-game questions and its 95\% confidence interval. Also shown are the number of positive (agree and strongly agree) versus negative (disagree and strongly disagree) responses.}
\label{table:usability-metrics}
\small
\begin{tabular}{p{5.2cm}|c|c@{}c}
\textbf{Question} & \textbf{Average} & \textbf{Pos}./& \textbf{Neg}.\\
\hline \hline
DATA Agent is an adventure game. & 3.77$\pm$0.35 & 21 & 3 \\ \hline DATA Agent is fun, relative to other adventure/role-playing games I have played. & 3.4$\pm$0.26 & 15 & 2 \\ \hline
DATA Agent is challenging, relative to other adventure/role-playing games I have played. & 2.37$\pm$0.35 & 4 & 17 \\ \hline
It is easy to understand how to play DATA Agent. & 3.87$\pm$0.35 & 22 & 4 \\ \hline
I learned something new playing DATA Agent. & 3.53$\pm$0.34 & 20 & 5 \\ \hline
I would get DATA Agent if it were a fully developed as a mobile or computer game. & 3.4$\pm$0.39 & 16 & 6 \\ \hline
I would recommend DATA Agent to a friend if it were fully developed as a mobile or computer game. & 3.6$\pm$0.32 & 19 & 3 \\ \hline
I would like to play DATA Agent again with the same mystery. & 2.3$\pm$0.39 & 5 & 20 \\ \hline
I would like to play DATA Agent again with a different mystery. & 3.83$\pm$0.38 & 24 & 5 \\ \hline
Finding the culprit in DATA Agent was straightforward and made sense to me. & 3.9$\pm$0.37 & 21 & 4 \\ \hline
Finding the culprit in DATA Agent requires mental effort. & 2.6$\pm$0.36 & 7 & 15 \\
\end{tabular}
\end{table}
In total, 30 adults (22 identifying as male, 7 as female, 1 as other) participated in the user study. The median participant age was 27.5, but most participants (53\%) were between 19-25 years old. An overwhelming majority (93\%) of playtesters reported that they enjoyed playing games, and a slightly smaller majority (83\%) reported enjoying playing adventure games specifically. Two thirds of playtesters claimed to play video games at least as often as 2-3 times a week, while only 13\% of players played less often than once a week.
\subsection{Gameplay Data}\label{sec:analysis
Overall, 23 participants managed to find the culprit in both games while 28 participants found the culprit in at least one game. There was no clear difference between the number of people who solved the Albert Einstein case (25 players) over the Britney Spears case (26 players). How users interacted with different game entities in each game is shown in Table~\ref{table:gameplay-metrics}.
Obviously, players interacted more with people and cities in the Britney Spears game where there were more people and cities. Normalizing interactions based on the number of game objects of that type shows that the differences between the two games were not as pronounced. However, it is obvious that the Britney Spears game required more player attention in general; based on general feedback, that game required a longer playtime as well.
In general, it was surprising to us that the average interactions with NPCs is smaller than the number of NPCs of each game, meaning that some NPCs were not interacted with at all. Indeed, the NPC interactions were fewer than the NPCs in 73\% of Einstein games and in 63\% of Spears games. It is not surprising that players visited cities more than once, however, as each new clue often revealed a new building in existing cities (or a new NPC in an existing building) and required players to travel back to previously visited cities.
It should be noted that players had very different interaction patterns: for instance, in the Albert Einstein game players interacted between 3 and 15 times with NPCs. It should also be noted that the two players who had only 3 NPC interactions managed to win the game. In general a correlation analysis between the raw or normalized gameplay values of Table~\ref{table:gameplay-metrics} and whether the game was won showed no significant correlations.
\subsection{Usability Data}\label{sec:study_usability}
For the sake of brevity, we discuss only the responses of users which were provided in a Likert scale. The results of these responses are summarized in Table~\ref{table:usability-metrics}. For the sake of analysis, we consider the average rating on the Likert scale to be misleading, and instead we use the number of positive responses (``agree'' or ``strongly agree'') versus the number of negative responses (``disagree'' or ``strongly disagree'') as a more granular measure which shows the inter-rater agreement. Overall, the number of ``neutral'' answers were low, with a notable exception regarding whether ``DATA Agent is fun\ldots'' (with 43\% of answers being ``neutral''). Similarly, participants tended to agree in terms of either positive or negative responses. Considering positive responses as successes (or negative responses, for the reverse), the one-tailed binomial test (with $\alpha=5\%$) is passed for the following assertions:
\begin{enumerate}
\item DATA Agent \textbf{is} an adventure game.
\item DATA Agent \textbf{is not} challenging, relative to other adventure/role-playing games I have played.
\item It \textbf{is} easy to understand how to play DATA Agent.
\item I \textbf{did} learn something new playing DATA Agent.
\item I \textbf{would} recommend DATA Agent to a friend if it were fully developed as a mobile or computer game.
\item I \textbf{would not} like to play DATA Agent again with the same mystery.
\item I \textbf{would} like to play DATA Agent again with a different mystery.
\item Finding the culprit in DATA Agent \textbf{was} straightforward and made sense to me.
\end{enumerate}
Similarly to gameplay data, we investigated whether the user's responses correlate with their winning streak. The assertions ``I learned something new\ldots'' and ``finding the culprit [\ldots] was straightforward\ldots'' had a significant positive correlation with the number of games won by that player ($r=0.36$ and $r=0.46$ respectively). Moreover, significant positive correlations were found between the usability assertion ``It is easy to understand how to play DATA Agent.'' and agreement regarding ``In general, I like to play games.'' ($r=0.44$) and ``I like to play adventure games'' ($r=0.53$). These correlations should not be surprising, as the interface design of DATA Agent was inspired by classic point-and-click adventure games; users familiar with games and especially with adventure games would be more likely to find this game easier to play.
\section{Discussion}\label{sec:discussion}
The conclusions drawn from a user study with 30 participants are generally positive. Most participants agree that DATA Agent is easy to understand, and solving the mystery was straightforward. The major overhaul of the user interface (compared to previous titles in the Data Adventures series) seems to now be intuitive to use, especially by users more familiar with games in general and adventure games in particular. While the majority of players would not try the game again with the same mystery, they would like to try the game with another mystery. This is hardly surprising, as adventure games in general are rarely replayable. With the small set of interactions (few suspects, people, and cities), participants in this version of DATA Agent likely had explored all possible aspects of each mystery on their first try. It can be assumed, on the other hand, that a generator such as the one in DATA Agent, which can create infinite mysteries, can keep players engaged for a long period of time. We can assume that a large part of this appeal is not the fun gameplay itself (which we discuss later), but the players' natural curiosity regarding which associations the generator will make and how those will be presented in terms of visuals and dialog.
On the other hand, the participants' responses highlighted that the game now is perhaps too easy. Most participants agree that the game is not challenging. We could also interpret the large number of neutral responses in terms of how fun the game is, or the agreement that finding the culprit is straightforward as further proof that the straightforward solutions offered by the game make it feel ``bland''. To a degree, many of the design decisions taken when generating the two testbed games were explicitly to reduce the length and complexity of gameplay. The smaller number of suspects (three versus five in earlier efforts \cite{barros2018killed}) and the shorter paths (without minor paths as found in \cite{barros2015data,barros2018killed}) all contribute to a shorter playtime and a more direct way to reach each suspect. This reduces the time investment of interested participants and allows us to receive more feedback from more users faster. Additionally, it highlights important information, that would otherwise be lost amidst a large amount of content: WikiMystery generates 135 game objects on average per adventure \cite{barros2018killed} (NPCs, locations and items) while DATA Agent cuts that down to 30 game objects. However, it is not easy to estimate how to increase the challenge of the game without making it unplayable or banal. Re-introducing more suspects would increase the number of people, buildings, cities and items that the player has to interact with (prolonging playtime) and may increase the challenge as players will need to interrogate and find facts for more suspects. On the other hand, this could result in more ``trivial'' interactions that feel inconsequential, and could clutter the interface (e.g. by having 30 or more people in the Journal Tab with little ability for the player to understand which one has been recently added (or may hide more information). Towards increasing the ``mystery'' aspect of the game, the vital facts for interrogating suspects could be hidden away in more locations (possibly locked ones) instead of being offered by NPCs at the house of the deceased. Moreover, having multiple ways to reach the same fact or suspect could make the choices of the players more meaningful; for instance, the game could have one key that can open two locks (i.e.~the player will only have access to one but not both of those buildings) so the game can be solved with the clues hidden in either but not both of those locations. Other additions, such as a broader set of dialog options for flair, are likely to enhance the curiosity and learning potential that motivates and benefits the player respectively.
In terms of broader directions for taking DATA Agent forward, the game design and algorithmic implementation should capitalize on the strengths noted by participants in the user study and minimize the negative factors such as the perceived lack of challenge. As noted, more extensive dialog could lead to more interesting interactions: such dialog generation could take further advantage of open data (allowing users to ask more from each NPC beyond their name and the subject they are known for), or follow authored templates to introduce more murder mystery tropes such as other NPCs offering potential motives or alibis for the suspects based on their relationship with the suspect (which can be calculated from open data, or not). Facts about the suspects could be chosen more wisely, since certain facts are nonsensical (e.g. in Fig.~\ref{fig:s2} one of the facts for Diana Ross is ``Diana Ross is a soundrecording of dianaross~1'') or trivial to ascertain the veracity of (e.g. ``I was a singer'' in Fig.~\ref{fig:s2}). This finding is corroborated by the user survey, as players managed to solve each game despite talking to a small subset of all NPCs. Finally, the cities used in the game could be improved, both in terms of name (e.g. players can travel to ``The German Empire'' in the Einstein game, which is hardly a city) and in terms of the city map used to display them (e.g. in Fig.~\ref{fig:d2}). Information from OSM could be used directly to place actual buildings in their correct location on the map, rather than at random as it is currently. The buildings from OSM could show a generic background (e.g. a generic ``Supermarket'' background if the OSM location says that this location is a shop of any type) or could be specific to the location based on an image search with that specific location keyword (e.g. an image of the ``Coliseum'' at its exact location in Rome).
Since the previous generation of the Data Adventure series \cite{barros2018killed} there have been substantial improvements with how the data is presented to the player. However, generating games from open data is still heavily dependent on the uncontrollable nature of said data. Games often include facts that are nonsensical, as pointed out above (``Diana Ross is a soundrecording of dianaross~1''). Sometimes the image for a character is not correct, and several times throughout the user study, players commented on this fact. However, we find it nearly impossible to ever fully control or constrain these occurrences, since doing so would involve handpicking data, defeating the purpose of open data games. In the long run, an important question is to what extent this type of data-driven game generators can ever be trusted to be fully autonomous, given the bizarre and sometimes even offensive situations and characters that can occasionally emerge even from correct underlying data.
\section{Conclusion}\label{sec:conclusion}
This paper presented the DATA Agent system, which generates adventures based on Wikipedia. These adventures task the player with solving the fictional murder of a real-world person. The system utilizes linked data to discover appropriate suspects for the murder within Wikipedia, and places these real-world people, locations, and encyclopedic subjects in a fictional setting where time and space are relative. DATA Agent is the latest installment in the Data Adventures series, and comes with an extensive overhaul of the user interface and the exposition of the game's backstory. Coupled with refinements in the dialog and interrogation system and a simplification of the generative algorithms for creating a mystery from open data, the resulting games are shown to be easy to grasp, straightforward to solve, and generally fun to play. Based on a user study with 30 participants, two games generated for DATA Agent were deemed fairly easy to solve, based on a high completion ratio as well as user feedback in the end of the experiment. Future work should aim to introduce more challenges in the gameplay, either by making the volume of interlinked content (and suspects) larger or by obfuscating the existing solutions in more complex dialog trees or puzzles (spatial or combinatorial).
The system improves on several facets of previous Data Adventures installments, but still comes short on some aspects. The new backstory helps flesh out a narrative and give the player a more engaging and consistent scenario, but much work could be done to improve the experience. On a narrative level, the system could integrate subplots into the main story, such as love affairs or intrigues among NPCs. Allowing NPCs to have personal goals, personalities, feelings or even freedom of movement would provide a deeper sense of immersion for players. Additionally, there is room for puzzle generation that takes into account not only the raw source data, but also the general narrative choices made by the generator. For example, if a generated subplot leans towards the rivalry between two NPCs based on real musicians (e.g. Mozart and Saliery), the system could generate a puzzle involving stealing a composition from one and giving it to the other. Finally, there is the issue of the absurdity present in open data-driven game generation, and the dilemma of further limiting absurdity without constraining the expressivity of the system.
\section*{Acknowledgments}
Gabriella Barros acknowledges financial support from CAPES and Science Without Borders program, BEX 1372713-3, as well as an NYU Tandon School of Engineering Fellowship. Antonios Liapis has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No 693150. Michael Green acknowledges financial support from the GAANN program.
\bibliographystyle{acm}
| {'timestamp': '2018-10-05T02:12:41', 'yymm': '1810', 'arxiv_id': '1810.02251', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02251'} | arxiv |
\section{Conclusion}
\label{sec:conclusions}
We presented Gauth\xspace, a system that incorporates glass wearable devices in
authentication. Our design enables the hands-free authentication of users
with terminals, which we argue can have a great impact on how persons with
disabilities currently access public terminals and shared devices in the
workplace. We believe our system has the potential to empower people to
overcome some of the physical barriers they face with regards to accessing
online services. Equally important, Gauth\xspace can help organizations safe
guard their terminals from unauthorized access, incurred by the fact that
users forget or avoid to log out from terminals they use. Gauth\xspace allows
services and terminals to determine in seconds whether the correct user is
operating them. We evaluated our approach by performing a short user study
involving students. While the study does not include persons with
disabilities, nor we evaluate continuous authentication in a real
workplace, it is an important first step that has provided us with
encouraging results. We plan to use these to pursue trials of Gauth\xspace with
users with disabilities and larger groups.
\section{Discussion}
\label{sec:discussion}
As already mentioned, continuous authentication with wearable devices is a relatively new discipline. Combining modern devices with security systems will not only improve the security of the system, but at the same time increase the usability and productivity of some end-user categories.
\subsection{Device Theft}
\label{ssec:security}
Overall, with the increasing risk of the theft or loss of mobile devices over the last few years, authentication solutions like Gauth\xspace may face extra issues. The person that holds the device, is also the one that can authenticate.
We can argue that the security of the glass device is similar to locking your password
vault. A PIN, voice recognition, or other techniques could be used to unlock
the device. The device could perform a challenge-response protocol with the user
\cite{voicepass:way14, dontlisten:assets09}. For example, the device could
display one character on the screen and the user would respond (by voice) by
adding his secret number to the displayed one. Furthermore, blending Gauth\xspace with physiological biometric schemes that rely on unique voice patterns, such as voice-based authentication systems, will allow only the legit user to control the device~\cite{Adibi2014137}.
\subsection{Privacy Benefits}
Gauth\xspace preserves end-user privacy by shielding the user from keystroke profiling. For example, the service will not be able to infer what is the disability of the person authenticating, using methods like timing errors on a keyboard or other sensor data. Furthermore, pseudonymity can be provided on a per session basis for user that share the same device under their duty, like nurses or police officer. That is, each time the device creates a new unique OTP without requiring from the user extra credentials.
\section{Evaluation}
\label{sec:eval}
\begin{figure}
\centering
\includegraphics[width=\linewidth]{figs/testbed.eps}
\caption{Testbed used during the evaluation.}
\label{fig:testbed}
\end{figure}
This section presents the results derived from the evaluation of our Gauth\xspace
prototype implementation. During our evaluation, we used the testbed
topology drawn in Fig.~\ref{fig:testbed}. First, we deployed the terminal,
service, and client in our own institutional network in the US. Then, we
experimented by deploying the service to two cloud infrastructures. An
academic cloud located in Europe and Amazon's AWS cloud in the US.
Specifically, the testbed was comprised by the following elements:
\begin{itemize}
\item A second generation Google Glass, equipped with an OMAP 4430 SoC
dual-core CPU, 2GB RAM, 5 MP Camera and a Wi--Fi 802.11b/g as the network
interface, which runs Gauth\xspace
\item One high--end laptop machine with Intel Core 2 Duo P8700 at 2.53 GHz,
8 GB of 1,066 MHz DDR3 RAM and a 6 Mbps AirPort wireless network card, serving
as the terminal
\item One server with an Intel Xeon CPU at 3.2 GHz and 4 GB of RAM located in
the cloud service in Europe, acting as a remote service
\item One server with two Intel Xeon Processors operating at 2.5GHz with Turbo
up to 3.3GHz and 2 GB located in Amazon's EC2 cloud infrastructure, acting as
a remote service
\end{itemize}
We conduct a thorough evaluation of Gauth\xspace in terms of performance,
effectiveness, and efficiency using human subjects. Our aim is to
demonstrate that Gauth\xspace is faster than password-based authentication
without compromising security. More precisely, we evaluated Gauth\xspace's
performance, QR-code readability, which affects the usability of our
scheme, and battery consumption when doing continuous authentication.
Finally, we performed a user study involving 20 students using Gauth\xspace in
different scenarios.
\subsection{Authentication Time}
\begin{table}
\centering
\caption{Authentication time in milliseconds. The results are from
performing 20 authentication runs for each service location.}
\label{table:network_measurements}
\begin{tabular}{l*{5}{c}r}
\hline
Remote service location & Mean & Min & Max & Standard deviation \\
\hline
Local & 329 & 265 & 421 & 70 \\
AWS (Oregon) & 523 & 451 & 609 & 134 \\
Cloud (Europe) & 703 & 584 & 2115 & 476 \\
\end{tabular}
\end{table}
Authentication time refers to the overall time required for a Gauth\xspace user
to be authenticated by the remote server. We calculate the mean time from
the moment the user activates Gauth\xspace via voice, until a complete
authentication is performed. Authentication time includes all the
necessary actions Gauth\xspace requires for authentication as already described
in Fig.~\ref{fig:auth_protocol}. Furthermore, to correctly evaluate
Gauth\xspace's authentication time, we collect measurements from 20 authentication
runs performed for the three locations of our testbed, and we calculate the
average.
Overall, the mean authentication time with Gauth\xspace is 3.8~sec. This number
includes 1.8~sec required to capture a picture using the auto-focus feature
of the camera, followed by the QR-code decoding process 0.2~sec. Over and
above that, it requires 0.4~sec to generate a new OTP, while the network
communication part over HTTPS takes an average of 0.6~sec. To activate
Gauth\xspace via voice command requires an average of 1.7~sec.
This means that when doing continuous authentication with a period of
5~sec, Gauth\xspace is able to perform almost 12 incessant authentications within a
minute. Of course, authentication time is affected by the network's quality
and potentially geographical distance between the user and the remote
service. Table~\ref{table:network_measurements} summarizes our results,
including the mean, minimum, maximum, and standard deviation of our
measurements. Note that our measurements incorporate the time required to
establish an HTTPS connection with the remote service and end when Gauth\xspace
receives the authentication ACK, as described in
Fig.~\ref{fig:auth_protocol} ({that is,}\xspace messages 3 to 5).
\subsection{Overhead}
\begin{figure}
\centering
\includegraphics[width=\linewidth]{figs/cpu_mem.eps}
\caption{CPU and memory load while performing continuous authentication
with a period of $T = 5$ seconds. CPU load is higher than expected due to
an open issue with the Glass' camera framework~\cite{CPUload}.}
\label{fig:cpu_mem}
\end{figure}
By overhead, we refer to the computational and memory resources Gauth\xspace
consumes. Wearable devices do not afford considerable CPU and memory
resources, at least when compared to smartphone and tablets, so overhead
can be decisive. Some pilot results on CPU and memory utilization for Gauth\xspace
are presented in Fig.\ref{fig:cpu_mem}. These results correspond to Gauth\xspace
performing continuous authentication with a period of $T = 5$ seconds. As
observed from the figure, we monitored the application for about 70 minutes
before the Glass' battery discharged completely. The maximum and minimum
CPU consumption during this time period is 98\% and 80\% respectively,
while the memory consumption was about 18\% -- 20\%. Overall, what we
observe is that there is a significant increase in CPU usage during the
authentication process. However, this happens due to an open issue with the
Glass' camera framework~\cite{CPUload}. Additionally, we need to mention
that the temperature of the device was notably higher during this
experiment, and we even encountered overheating issues, receiving the error
message \textit{``Glass must cool down to run smoothly''}, when we tested
Gauth\xspace with a smaller authentication period (T\textless 5).
\subsection{Battery consumption}
By default continuous authentication can be a power hungry operation, which
can greatly affect battery-powered devices. In contrast to the official
estimation from Google of ``one day battery life'', our experiments
indicate that the Glass' battery usually drains faster.
In an effort to balance the continuous authentication period against
battery consumption, we measure the battery level every minute, while Gauth\xspace
performs continuous authentication. Figure~\ref{fig:battery} illustrates
the battery consumption during this experiment, when using a period of 5
and 15 seconds.
With an authentication period of T=5 (sec), Gauth\xspace is taking 2\% off the
battery every minute, while with period of T=15 (sec) we gained 2/3 of more
energy. Practically, this means that within an hour, Gauth\xspace is able to perform
720 authentications with the remote service for T=5 (sec).
In terms of completeness, we also measure 4 fundamental Glass operations for a 10 minute period. Basic operations, like stand-by, playing video or receiving and displaying GPS directions, can drain 2.5\%, and 6.2\% of the battery respectively, while video recording is in position to consume 31\% of the battery within just 10 minutes.
\begin{figure}
\centering
\includegraphics[width=\linewidth]{figs/battery.eps}
\caption{Battery consumption during continuous authentication. Gauth\xspace is
configured to wake and take a picture every $T$ seconds.}
\label{fig:battery}
\end{figure}
\subsection{QR-code Readability}
\label{ssec:qrcodes}
The key element of our scheme depends on the high readability level of the QR-code itself. A QR-code consists of black square dots --modules-- placed in a square grid on a white background, which can be read by a camera and processed using Reed--Solomon error correction until the image can be appropriately interpreted~\cite{QRCode_standart}.
Failing to correctly identify and decode a QR code means that the user will not be able to authenticate and would have retry. The code's physical size, the amount of information stored in it, the distance between the code and the scanning device, the position or the viewport of the camera, lightning, and, last but not least, the camera lens are some of the reasons that affect the readability of a QR-code. Thus, stressing both Gauth\xspace and the QR-code to identify their limits was a primary task. However, in this evaluation, we do not evaluate factors like the lighting or the quality of the camera lens
The QR-code evaluation was performed using the native 5 MP Google Glass camera using the auto--focus function, under natural light. For the experiments, a 13.3--inch display with 1280 x 800 resolution and 50\% screen brightness was used.
To examine the readability of the QR-code, we used three scanning distances, corresponding to the proper ergonomic position that a user views a smartphone (``Intimate distance''), a computer (``Personal distance'') and an ATM (``Social distance'') screen. Table~\ref{table-notations} provides specific information on these distances. For these three scenarios, we define three different units of data (208, 816, 1920 bits), based on the traditional Version 2 QR-code capacity that consists of 25 modules (26 characters), the Version 6 QR-code capacity used for long URL's (like Google Maps address URL's) (102 characters), and the Version 10 QR-code capacity that contain vCard contact information (240 characters).
To create the QR-code image, it was highly important to correctly specify its physical size, so we relied on a mathematical formula~\cite{qr_size} to calculate the recommended minimum size based on the chosen information data and the distance for this experiment.
\textit{Minimum QR--code Size = (Scanning Distance / Distance Factor) * Data Density Factor}
\begin{itemize}
\item Distance Factor - Start off with a factor of 10 then reduce it by 1 for each of poor lighting in the scan environment. In our case we use 10 as the distance factor.
\item Data Density Factor: Counts the number of columns of dots in the QR--code image and then divides that by 25 to normalize it back to the equivalent of a Version 2 QR--code.
\end{itemize}
Table~\ref{table-results} summarizes the QR--code readability tests' results for the three different scanning distances, the three different information data units and the taken images under two different scanning angles ( 0$^{\circ}$ and 45$^{\circ}$). During the experiments, the display and the Google Glass were stable in the aforementioned distances. Thus we decided to perform the experiments under two different angles, replicating in this way two more realistic scenarios; i) the user is looking straight the display, or ii) she is looking under a small horizontal angle. We calculated the (``\textit{Accuracy}'') of the system, based on the successful QR--code decodes, after having performed for each case study 11 scans of the same QR--code.
Taking into consideration the evaluation results, we can argue that the Gauth\xspace was able to recognize the QR--code and decode it with high accuracy most of the times. Still, in some cases, and in contrary to the results from the ``minimum QR--code size'' formula, Gauth\xspace failed to detect or decode the QR--code. Failing to do so with the first try, it means that the user needs to activate again Gauth\xspace in the one-time authentication mode or to wait T seconds (say, 5 (sec)) of an automated try in the continuous authentication mode. This failure happens due to either the small physical QR--code size or the low data density stored on it. Definitely, the accuracy of the system could be higher if the camera lens were better or the decode library was in position to decode the QR--code with a higher error correction level.
\begin{table}
\caption{Notations used in QR--code experiments}
\begin{center}
\scalebox{0.90}{
\begin{tabular}{ p{4cm} p{4cm} }
\hline
Intimate distance: & 20 / 7.87 (cm / inch) \\
Personal distance & 50 / 19.68 (cm / inch) \\
Social distance & 120 / 47.2 (cm / inch) \\
Encoded bits & 208 (28 characters) \\
& 816 (102 characters) \\
& 1920 (240 characters) \\
\hline
\end{tabular}
}
\end{center}\label{table-notations}
\end{table}
\begin{table}
\caption{Stressing QR--codes}
\begin{center}
\scalebox{0.90}{
\begin{minipage}{2 in}
\begin{tabular}{ |l|l|l| }
\hline
\multicolumn{3}{ |c| }{Scanning angle 0$^{\circ}$} \\
\hline
Encoded bits & Distance & Accuracy \\ \hline
\hline
\multirow{3}{*}{208}
& Intimate & 72.7\% \\
& Personal & 72.7\% \\
& Social & 100\% \\ \hline
\multirow{3}{*}{816}
& Intimate & 100\% \\
& Personal & 90.9\% \\
& Social & 100\% \\ \hline
\multirow{3}{*}{1920}
& Intimate & 54.5\% \\
& Personal & 100\% \\
& Social & 100\% \\
\hline
\end{tabular}
\end{minipage}
\begin{minipage}{2in}
\begin{tabular}{ |l|l|l| }
\hline
\multicolumn{3}{ |c| }{Scanning angle 45$^{\circ}$} \\
\hline
Encoded bits & Distance & Accuracy \\ \hline
\hline
\multirow{3}{*}{208}
& Intimate & 18.2\% \\
& Personal & 63.6\% \\
& Social & 100\% \\ \hline
\multirow{3}{*}{816}
& Intimate & 72.7\% \\
& Personal & 81.8\% \\
& Public & 100\% \\ \hline
\multirow{3}{*}{1920}
& Intimate & 27.3\% \\
& Personal & 81.8\% \\
& Social & 100\% \\
\hline
\end{tabular}
\end{minipage}
}
\end{center}\label{table-results}
\end{table}
\begin{figure*}[tb]
\centering
\subfigure[75x75 pixels.]{
\includegraphics[width=0.62\columnwidth]{figs/qr75.eps}
\label{fig:subfig1}
}
\subfigure[124x124 pixels.]{
\includegraphics[width=0.62\columnwidth]{figs/qr124.eps}
\label{fig:subfig2}
}
\subfigure[170x170 pixels.]{
\includegraphics[width=0.62\columnwidth]{figs/qr170.eps}
\label{fig:subfig3}
}
\subfigure[188x188 pixels.]{
\includegraphics[width=0.62\columnwidth]{figs/qr188.eps}
\label{fig:subfig4}
}
\subfigure[309x309 pixels.]{
\includegraphics[width=0.62\columnwidth]{figs/qr309.eps}
\label{fig:subfig5}
}
\subfigure[430x430 pixels.]{
\includegraphics[width=0.62\columnwidth]{figs/qr430.eps}
\label{fig:subfig6}
}
\subfigure[453x453 pixels.]{
\includegraphics[width=0.62\columnwidth]{figs/qr453.eps}
\label{fig:subfig7}
}
\subfigure[744x744 pixels.]{
\includegraphics[width=0.62\columnwidth]{figs/qr744.eps}
\label{fig:subfig8}
}
\subfigure[1031x1031 pixels.]{
\includegraphics[width=0.62\columnwidth]{figs/qr1031.eps}
\label{fig:subfig9}
}
\caption{Scanning different QR--code sizes from different
distances and no angle. Each sub--figure draws the percentage of correctly
scanned QR
codes (\emph{y--axis}), when taking 11 pictures with Google Glass, as the
number of bits encoded in a QR--code increases (\emph{x--axis}).
The different colors correspond to three distances
between the glass and screen:
\crule[qr20]{6pt}{6pt} 20~cm,
\crule[qr50]{6pt}{6pt} 50~cm, and
\crule[qr120]{6pt}{6pt} 120~cm. From sub--figure \ref{fig:subfig1}
to \ref{fig:subfig9}, we increase the physical size of the QR--code.
}
\label{fig:QRlimits}
\end{figure*}
Before closing the QR--code readability chapter, we scan different QR--code sizes from different distances and no angle (refer to Fig.~\ref{fig:QRlimits}). Each sub--figure draws the percentage of correctly scanned QR--codes (y–axis) when taking 11 pictures with Google Glass. As the number of bits encoded in a QR--code increases (x–axissub–figure 7(a) to 7(i), we increase the physical size of the QR--code. The different colors correspond to three distances between the glass and screen:  20 cm, 50 cm, and  120 cm. From sub--figure 7(a) to 7(i), we increase the physical size of the QR--code.
In Fig.\ref{fig:subfig1}, it is evident that we are able to correctly scan a QR--code only from a short distance of the screen. As the size of the code increases, we are in charge of scanning from longer distances. In Fig.~\ref{fig:subfig5}, the results for 20~cm overlap with the ones for 50~cm, thus they are not visible. For QR--codes larger than 453 pixels, we are always in power to correctly process them (Figures~\ref{fig:subfig8}--\ref{fig:subfig9}), even from a distance of 120~cm.
\subsection{User Study}
Designing a new human centric authentication scheme, like Gauth\xspace, that can also be applicable by users with disabilities or user with the need to operate on multiple terminals, like the nurses, requires evaluation and feedback from real users through a pilot study.
A pilot study is a trial, which is conducted before the main study, and not only allows the researcher to define any problems and provide the required adjustments to the system, but also ensures whether or not the study is appropriate in terms of validity.
For the pilot study, we recruited 20 volunteers to use a custom e--mail client, running on a laptop terminal, authenticating themselves, via the 5 authentication scenarios, to an email service.
The duration of the total experiment was an hour per participant, and the precondition was that users should be computer, smartphone and e--mail users. All users had previous interaction with a smartphone, but none of them with a Google Glass. It is important to mention that none of these 20 volunteers was a multiple terminal operator or had a disability. For the experiments, proper IRB approval was granted, while users' privacy and sensitive information were never exposed. Table~\ref{table_demographics} contains a summary of our participants' demographic characteristics.
\begin{table}
\caption{Participant demographics}
\begin{center}
\begin{tabular}{ p{4cm} r }
\hline
Characteristics & Total \\
\hline\hline
Gender & \\
Male & 14 \\
Female & 6 \\
\hline
Field & \\
\hline\hline
Computer Science (CS) & 12\\
Non-CS & 8\\
\hline
Age & \\
\hline\hline
18-26 & 11\\
26-32 & 6\\
32-62 & 3\\
\hline
\end{tabular}
\end{center}
\label{table_demographics}
\end{table}
\subsubsection{Methodology}
During the experimentation phase, the participants had to use a custom e--mail client, running on a laptop terminal, authenticating themselves, via the 5 authentication scenarios, to an email Gauth--enabled service.
We should note that all users shared the same credentials during their single--factor authentication phase, while they had each time to activate the devices (smartphone and Glass) in order to perform the second factor authentication.
Due to the fact that none of the volunteers had previous experience with the Google Glass or our custom e-mail client, a pre--study tuition during the first 15 minutes of the experiment was mandatory. During that specific time, the instructor introduced the main functions of every hardware device that will be used during the experiment, including the Google Glass, and passed through them several times for every step of the experiment.
All five authentication scenarios share a common ruse in which participants were not told which authentication scheme was to be primary investigated. Each scenarios needed to be performed 3 times by all users, allowing us to micro--benchmark the authentication tasks and collect real data used during the evaluation phase.
At the end of the session, users had to complete an anonymized questionnaire survey related to their experience with the authentication scenarios. Additionally to the experimental phase and the questionnaire survey, a 5 minute conversation allowed the investigator to extract valuable information regarding the participants' thoughts.
\subsubsection{Scenarios}
During the experimentation phase, the participants had to utilize the five authentication methods in order to access an e-mail account through a laptop terminal. First, we tested single--factor authentication. Users employed Gauth\xspace and conventional username/password credentials to authenticate with the mock service. Second, we asked them to use a username/password as well as a second factor of authentication. We evaluated three scenarios: using Gauth\xspace (2FA Gauth\xspace), google--authenticator on a smartphone (2FA Smartphone), and google--authenticator on Google Glass (\mbox{2FA Glass}). In more details these scenarios include:
\begin{description}
\item[Username/Password]\hfill \\ the traditional single--factor authentication scheme based on username and password credentials.
\item[2FA -- Smartphone] \hfill \\a second factor authentication scheme, where a OTP was displayed by a mobile.
\item[2FA--Glass]\hfill \\a second factor authentication scheme, where a OTP was displayed by the Google Glass.
\item[Gauth]\hfill \\ a password--less, hands--free, one--time authentication scheme
\item[2FA--Gauth]\hfill \\the traditional singlest factor authentication scheme based on username and password credentials, working in synergy with Gauth\xspace as the second authentication factor.
\end{description}
We should note that all users shared the same credentials during their single--factor authentication phase, while each time they had to activate the devices (smartphone and Glass) to perform the second--factor authentication.
\subsubsection{Results}
The Fig.~\ref{fig:user_study} illustrates the average over three repetitions of the task for all the five scenarios. The bottom two lines in the figure correspond to the single--factor authentication, while the rest three to the second factor authentication schemes. It is obvious that Gauth\xspace, due to the hand-free nature, is not only the faster method in all cases, but grants novice users with tremendous authentication issues, like 17tn and 18tn user, to successfully authenticate in less than 5 seconds.
\begin{figure}
\centering
\includegraphics[width=\linewidth]{figs/study.eps}
\caption{Time required to complete entry--point authentication for all 20 users in our user study. The figure draws the average over three repetitions of the task. First, we tested single--factor authentication. Users employed Gauth\xspace and conventional username/password credentials to authenticate with a mock service (bottom two lines in the figure). Second, we asked them to use a username/password as well as a second factor of authentication. We evaluated three scenarios: using Gauth\xspace (2FA Gauth\xspace), google--authenticator on a smartphone (2FA Smartphone), and google--authenticator on Google Glass (\mbox{2FA Glass}). }
\label{fig:user_study}
\end{figure}
Most of the users agreed that traditional authentication schemes need to be improved. As they comment during the oral discussion, password-less schemes like the Gauth\xspace or the very recently iPhone's fingerprint solution permits them to remember less passwords. The 95\% argued that the combination of username/password with Gauth\xspace, is the most secure authentication scheme across all the scenarios, but in their everyday life, users would choose Gauth\xspace for its password-less nature. On the contrary, only 20\% feels that Gauth\xspace is secure. This can be explained due to the limited or non cyber-security knowledge of our scheme. Most users, 65\%, complain that they had problem reading the OTP directly from the Glass, but claim that it is more secure than displaying the OTP on a smartphone. Last but not least, 75\% of the users allege that they are interested in using Gauth\xspace on their everyday basis only if the cost of the wearable is affordable and more elegant, while a 65\% assert that they will use it only under specific circumstances, such as at their office, a bank terminal or to access a room.
\subsection{Security}
\begin{figure}
\centering
\includegraphics[width=\linewidth]{figs/window_of_vuln.eps}
\caption{Window of exposure to malicious users when using Gauth\xspace for
continuous authentication. $T$ is the re-authentication period used
({that is,}\xspace how frequently it is requested), $L$ is the timeout (since the last
expected re--authentication) after which the user is logged out, and $W$
the window of exposure.}
\label{fig:window}
\end{figure}
When performing continuous authentication with period $T$, if a user steps
away from the terminal without logging out, there exists a window of
vulnerability $W$ that the terminal is left exposed, until the service
detects that the user is no longer there and locks the terminal and logs
the user out. This is illustrated in Fig.~\ref{fig:window}, where a user
steps away, missing the next re-authentication request. Since the terminal
probably does not immediately lock the terminal, an amount of time $L$
lapses till the user is logged out and the terminal is safe. The figure
makes it easy to deduce that $W \leq T + L$. Since even
with our current prototype, we are able to use a period of $T=5sec$. Also,
since the authentication time on the local network never exceeds 0.5~sec,
continuous authentication could be deployed with an $L\approx1sec$.
Consequently, $W$ will be considerable small in most cases. However, future
work is required to establish the usability effects of using such a small
$L$.
\section{Implementation}
\label{sec:implementation}
Gauth\xspace consists of primarily three components: an app residing on the glass
device, an authentication layer running at the service back end, and
potentially software running at the terminal. This section provides
technical details about the implementation of these components and their
interactions. For our prototype, we used a Google Glass device and built a
Gauth\xspace-enabled e-mail server and client in Java, representing the scenario
that the UI is driven by the terminal, and the service cannot directly
manipulate it. To implement the protocol we used a four-digit number for
service IDs, and a six-digit nonce, which is generated by the terminal as an
HOTP and also serves as its ID. In the options of the protocol, we add an
11-digit timestamp to execute Lamport's algorithm~\cite{Lamport:1978}.
\subsection{Gauth\xspace Google Glass App}
\label{ssec:gauth_app}
The Gauth\xspace app is Glassware software that runs on a second generation
Google Glass XE (Explorer Edition) device, equipped with the Android v4.4.2
kernel and the XE 21.0 update. Gauth\xspace was developed with the Glass
Development Kit (GDK), an add-on to the Android SDK. It consists of four
modules, implementing the following functionality.
\subsubsection{Voice Activation}
\label{sec:voice_commands}
The GDK's \textit{VoiceTrigger} framework allows the creation of a
voice-driven interface via three types of speech recognition: application
shortcut-type voice commands that enable the user to start an application,
contextual voice commands that enable users to perform particular actions
within the context of a running app, and free-form speech-to-text
transformation for receiving textual input from users ({for example,}\xspace reciting an
e-mail). To enable starting our app using a voice command, we register an
intent filter using the
\textit{com.google.android.glass.action.VOICE\_TRIGGER} action in the app's
Android manifest. In our prototype we use the
phrase ``OK Glass, Authenticate''. Additionally, we need to declare what
resources need to be used by our app in file
\textit{res/xml/Gauth\_voice\_trigger.xml}. In our case, we require
to use the camera, network, and microphone.
\subsubsection{QR Code Scanning}
To detect and decode QR codes we use the \emph{ZXing engine}. ZXing is an
open source library able to scan and decode one and two-dimension barcodes
using a smart device's camera. Unfortunately, the library available for
Android depends on a remote service to decode QR codes, so we modified it
to create a library that also includes ZXing's core image decoding
library in order to quickly decode QR codes on Google Glass. This way we
increase authentication speed and we avoid sharing QR codes with a
third-party.
\subsubsection{One-time Password Generation}
Gauth\xspace implements time-based OTPs by integrating
google-authenticator~\cite{google-authenticator}. After initially setting up
the key shared with the server ($K_{U}$), requesting a new OTP is
straightforward.
\subsubsection{TLS Support}
\label{sec:public_key}
Gauth\xspace creates, store, and manages digital keys and certificates using the
Java \textit{KeyStore} framework and the \textit{OpenSSL} library. By
default, it stores and uses a list of trusted CA certificates, similarly to
a browser or smartphone. In our case, we also include a base-64 encoded
X.509 certificate for the e-mail service, which is part of our prototype.
The communication with the remote service is implemented via the Java
\textit{HttpsConnection} framework, which connects the device to the
service back end over TLS.
\subsection{Gauth\xspace Support for Service Back Ends}
\label{sec:remote_service}
\gp{Is the implementation small? aprox 600 lines}
Services need to support Gauth\xspace either by design or through a middleware
that enables third-party services to interface with Gauth\xspace devices. In our
prototype, we built such a middleware to add Gauth\xspace support for an SMTP/POP3
e-mail service. We implemented it in Java and support two different
network interfaces; the first one is capable of handling multiple Gauth\xspace
client connections from users that authenticate using the protocol
described in Sec.~\ref{sec:protocol}, while, the second one, allows
terminals, in this case e-mail clients, to be updated in real time with a
user's authentication status. Note that this interface is required for UIs
that are terminal driven, while UIs that can be directly modified by the
service may not need it at all.
In our prototype, communications are secured using HTTPS and implemented
using the Java \textit{HttpsConnection} framework, however, other designs
that rely on IPSec, or controlled environments like an Intranet or cloud
infrastructure, can also be supported in a similar way with relatively
little effort.
\subsection{Terminal}
\label{sec:terminal}
When a terminal UI cannot be directly modified by the service, but requires
support from the software running on the terminal, some modifications are
also required on its software. To test this scenario, we built a Java-based
e-mail client to act as a thick terminal, which will generate the QR codes
itself instead of the service.
Encoding the protocol information in a QR code and and displaying it on the
terminal is done using the \textit{ZXing} library. For creating an e-mail
interface, we used the \textit{JavaMail} API~\cite{Javamail} which provides
support for SMTP/POP3 server. Communication with the service is performed
over TLS both for communicating with the Gauth\xspace middleware, as well as for
delivering the content/service users, in this case providing access to
their e-mail accounts. To generate a nonce for the protocol, we use HOTPs
created (again) by the google-authenticator
library~\cite{google-authenticator}.
\section{Introduction}
Google recently introduced a glass wearable device, named Google Glass,
that received warm welcome from certain groups of users for various
reasons. People suffering from disabilities that diminish their ability to use
their hands welcomed it because it allowed them to perform tasks by issuing
verbal commands alone~\cite{boon2disabled}. It also found use from medical
doctors, who used it
to access critical information during an operation without having to shift
their attention away from the task at hand~\cite{glassOR}. This paper
investigates whether glass wearable devices, like Google Glass, can be also
used to improve the authentication process, both in
terms of usability and security. We are focusing on two aspects: initially
authenticating a user with a system (one-time authentication), and
accurately determining when a legitimate user has stopped using a system by
continuously authenticating him.
We focus on two groups of users to guide us in our research
(discussed in detail in Sec.~\ref{sec:examples}). Briefly, we first examine the
challenges faced by people with disabilities in authenticating with
existing systems, and in particular, with public terminals and
devices shared by multiple users, where
solutions like password managers and never logging out are \emph{impractical}.
As expected, these users suffer both from usability and security issues, which
is also confirmed by a recent study~\cite{disabilitiesauth:ares12} that showed
that they usually select
simpler passwords and they are more prone to snooping~\cite{glass_snoopers}
when entering their passwords. Second, we consider the authentication
challenges in environments like hospitals, where users need to frequently
switch between terminals. Users try to avoid having to repeatedly enter their
passwords, or are absentminded, resulting in them leaving terminals without
logging out with whatever that entails for security.
Some of the above issues can be overcome by using access tokens,
like smartcards, instead of passwords. Tokens are more secure and potentially
more usable, than passwords, however, the user still needs to be able to
physically handle one with his hands, and they do not provide a solution to
terminals being abandoned by users without logging out.
They also require that custom reading sensors are installed on terminals,
which can be costly and hard to maintain for services with large numbers of
terminals.
The usual solution for preventing unauthorized access to abandoned
terminals is to use timeouts, {that is,}\xspace logging out a user from a terminal or
locking it after a period of inactivity. However, timeouts frequently lead to
users being accidentally logged out. For example, consider a physician
studying a patient's file without interacting with terminal, which cannot
distinguish if the user is still there. Proximity sensors have been used to
address this uncertainty, however, they also frequently make errors, like
logging out active users and authenticating passing-by
users~\cite{proximity_problems}.
We attempt to provide a solution to the above problems by proposing a new
design that incorporates glass wearable devices to offer hands-free
one-time and continuous authentication. Our approach, called Gauth\xspace [goth],
transforms glass devices to authentication tokens that can authenticate the
user with supporting terminals just by facing them and issuing a voice
command. We exploit the front-facing camera of glass devices to form an
optical communication channel between a terminal and a device.
Specifically, we use a visual code, such as a QR code, to transfer
information regarding the terminal being viewed to the device, and use it
to authenticate directly with the service behind the terminal.
To provide continuous authentication, we exploit the observation that users
operating a terminal will be most likely facing its screen. This allows us
to use the same optical channel between device and terminal to continuously
authenticate the user in front of it. The terminal periodically issues
re-authentication challenges, by displaying a QR code, which is captured by
the glass, which, in turn, re-authenticates with the service. Our approach,
enables us
to quickly identify when a user moves away from a terminal to lock it and
eventually log him out. For example, during the evaluation of our prototype
we used a period as short as five seconds. Intrinsically, Gauth\xspace will
\emph{not} accidentally lock a terminal when a user is \emph{just studying}
something on a terminal without interacting with it. Even if a user's
terminal is erroneously locked, because he has to focus his attention on
something or someone else, displaying a re-authentication QR code on the
locked screen ensures that he will be transparently re-admitted when he
returns to the terminal.
We implemented a prototype of Gauth\xspace on Google Glass, which we evaluated by
using it to authenticate with an e-mail service, which we also developed.
We also performed a small user study, after obtaining IRB approval from our
institution, to obtain real data from users operating our system. The study was
accompanied by a short exit survey to gauge user attitude toward wearable
devices and Gauth\xspace in particular.
Employing QR codes in authentication systems is not a new idea.
The last four years alone various works have proposed authentication
systems combining QR codes and one-time passwords. They include systems for
online banking~\cite{YoungSil2010, Young2010}, health
systems~\cite{Mungyu2013}, access control~\cite{Kao2011},
web applications~\cite{Dodson2012},
personal smartphones~\cite{Starnberger2009, Kyeongwon2011, Roalter2013,
Kwiecien2014}, and voting systems~\cite{Falkner2014}.
None of these proposals offers hands-free or continuous authentication to
users. We have also seen applications using Google Glass for two-factor
authentication~\cite{glass2fa} (2FA), where one-time passwords (OTP) are
displayed on its small screen for the user to type in a terminal after
supplying his username/password. During our user study, we evaluated this
scenario and our
results indicate that users find it harder to use, than using a smartphone
for the same purpose. We also recently became aware of a company that is
advertising 2FA for desktops and laptops that utilizes Google Glass to
authenticate a user with his PC~\cite{saaspass}. We do not have sufficient
information to compare Gauth\xspace with this approach, however, it seems to
differ in many aspects from our work. The most obvious being no continuous
authentication support and a lack of a general protocol.
To summarize the contributions of this paper are:
\begin{itemize}
\item We propose a new method that incorporates glass wearable devices to
provide hands-free authentication that:
\begin{itemize}
\item can authenticate users faster and more securely than passwords
\item continuously authenticates users, promptly securing
unattended terminals from unauthorized access
\end{itemize}
\item We design a protocol for performing hands-free one-time and
continuous authentication between glass wearable devices and services
\item We implement Gauth\xspace, a prototype of our proposal
\item We perform a thorough evaluation of our proposal through a set of
benchmarks and a small user study that demonstrates the feasibility of
the approach and its benefits. Our results show that Gauth\xspace authentication
is faster than passwords and operates consistently even when using small
QR codes
\item We evaluate the potential of using Gauth\xspace for two-factor authentication\gp{and?}
\end{itemize}
The rest of this paper is organized as follows. Section~\ref{sec:examples}
discusses in detail two examples that motivate and put our work in context.
In Sec.~\ref{sec:model} we present the model of our system, including
assumptions and our threat model. An overview of the system's operation is
given in Sec.~\ref{sec:overview}, while the protocol used for
authentication protocol is presented in Sec.~\ref{sec:protocol}.
Implementation details are in Sec.~\ref{sec:implementation}. We evaluate
Gauth\xspace and present the results of our user stude in Sec.~\ref{sec:eval}.
Related work is discussed in Sec.~\ref{sec:related}. We discuss potential
issues, limitations, and future work in Sec.~\ref{sec:discussion}, and
conclude in Sec.~\ref{sec:conclusions}.
%
%
%
%
%
%
%
%
\section{System Model}
\label{sec:model}
\subsection{Assumptions and Requirements}
\subsubsection{Device Requirements}
Our approach requires a head-mounted device featuring a front facing camera
that can take static pictures from the point-of-view of the user. While a
high-definition camera is not necessary higher resolution cameras will allow
us to use smaller visual codes on displays. A screen is not required, however,
if present, it can be used to provide feedback to the user ({for example,}\xspace the name
of the service he is authenticating with) and for locking the device (see
Sec.~\ref{ssec:security}). Sensors such as a microphone and a gyroscope are
also necessary for receiving voice commands and turning on the device,
respectively. The device should have a CPU capable of decoding QR codes,
performing simple cryptographic operations, and running simple algorithms
for identifying simple voice commands. Finally, it should also include a
network adapter ({for example,}\xspace WiFi) that would allow it to connect to the
authentication service being used and sufficient storage to store a user's
credentials for all his Gauth\xspace-enabled services.
\subsubsection{Device-User Association}
A device can be associated with a single or multiple users. In the first
case, the device is considered personal and identifies the user itself,
while in the latter the device is associated with a particular role or set
of permissions. For example, this can be the case in hospitals or military
compounds where the device essentially authorizes the user to access a set
of terminals and services. Alternatively, shared devices may be assigned to
particular users when checked out for use ({for example,}\xspace when a nurse's shift starts).
Users may also be required to supply a PIN before using a device, while
biometrics can be used for the same purpose~\cite{whowearsit:mobisys14}.
\subsubsection{Device-Service Association}\label{ssec:ds_assoc}
A Gauth\xspace device can authenticate a user with multiple services. We assume
that before it is used, it has been properly set up to identify him with a
service, after authenticating using alternate means, like with a username
and password. Necessary information to complete the association can be
shared by scanning a QR code with the glass device, similarly to how
Google's one-time password generator (OTP) is
initialized~\cite{google-authenticator}, or by using another available pairing
method~\cite{pairing:jpmc09}. A user could also physically present the device
along with identification to a service ({for example,}\xspace the branch of a bank) to perform
the association.
\subsubsection{Deployment Requirements for Services and Terminals}
Supporting Gauth\xspace-based authentication does not require any new sensors or
hardware to be installed at terminals, assuming that they include a screen
that can display graphics, like a QR code. If the user interface (UI) presented
on a terminal is \emph{service driven}, then no software changes are
required on terminals either. For example, in the case of terminals receiving
HTML content from a service and thin clients~\cite{hospital_thin_clients}. In
the opposite case, if the UI is \emph{terminal driven}, software modifications
on the terminal are required to generate and display visual codes.
\subsection{Threat Model}
\subsubsection{Adversaries}
The most significant threat faced by Gauth\xspace users is theft of their
wearable device. An attacker obtaining the device and knowing the services and
terminals it has been associated with, can use it to gain access to services,
obtain personal information, perform financial transactions, {etc.}\xspace This
is akin to a thief stealing someone's home key. The device can be
protected using a PIN or biometrics and the information on the device can
be encrypted. In this case, the attacker would have to brute force the PIN
or mimic the biometric used to unlock the device, before being able to use
it. In the case of continuous authentication, an adversary could attempt to
use a terminal, left by a user without logging out, before Gauth\xspace detects
that the correct user is no longer behind the terminal. Increasing the
frequency that a service requests re-authentication can reduce this window
of vulnerability. In Sec.~\ref{sec:eval}, we evaluate the effects of using
different re-authentication frequencies and how it affects the window of
opportunity for an attacker.
Finally, an adversary could launch an online brute-force attack against a
Gauth\xspace service, because the authentication service needs to be accessible
to glass devices, which in certain contexts implies that it needs to be
accessible over the Internet. However, the probability of such an attack
succeeding is extremely low, as the attacker cannot observe the user's ID or
his authentication credentials, and such an attack would be easily detected by
the service. An attacker can, though, obtain the information contained in the
visual codes displayed on the terminal, which are considered public, and
identify the terminal and service to the device.
\subsubsection{Device Integrity}
Our approach has similar security characteristics to software security tokens
on smartphones ({for example,}\xspace Google authenticator~\cite{google-authenticator}).
As such, we assume that Gauth\xspace software running on the wearable device, the
operating system kernel, and hardware, have not been compromised. Since
devices like Google Glass permit users to download apps from stores, we
assume that the user may have installed one or more malicious apps,
however, these apps cannot compromise Gauth\xspace by reading or altering its
functionality and data.
\subsubsection{Users}
We consider the users of the system benevolent, however, they may expend
small effort to bypass the system, if it interferes with their work. For
instance, they may attempt to trick the glass device, so that they remain
continuously logged in, and a terminal never locks or logs them out.
\subsubsection{Man-in-The-Middle Attacks (MitM)}
MitM attacks between the terminal and the service cannot be prevented by
Gauth\xspace. Thus, we assume that terminals and services can mutually
authenticate ({for example,}\xspace using TLS, certificates, and certificate authorities). A
MitM can relay information between the terminal and service to enable the
user to authenticate using Gauth\xspace. However, our approach submit the user's
credentials directly to the service, so they are not exposed to the attacker.
We assume that MitM attacks between the device and the service are
not possible, because the device has been properly set up with the service's
certificate, certificate authorities are used properly, {etc.}\xspace
\section{Motivating Examples}
\label{sec:examples}
While Gauth\xspace can be beneficial for many types of users and organizations, we
present two scenarios that we believe clearly illustrate the problems our
solutions aims to address.
\gp{Mention that the device is a general purpose one and in both these
scenarios users have also other uses of the device.}
\subsection{Authentication for Users with Disabilities}
\label{ssec:disabilities}
Accessing a computer terminal is a routine process for most computer-literate
users today. Many of us operate a variety of different devices during a
single day, ranging from personal smartphones, tablets, and laptops to
specialized computer terminals used for banking, buying transportation
tickets, and so on. Users with disabilities frequently face various
challenges when operating such terminals. For instance, people with limited
use of their hands, such as people suffering from DASH and Parkinson's, may
require bigger buttons (on screen or physical), while visually-impaired users
may require high-contrast displays. Fortunately, modern terminals are
frequently equipped to assist such users. Concurrently, entities like the
European Union and the United States government have introduced legislature
pushing for further improvements in universal accessibility~\cite{section508,
eu_disability_strategy}.
However, performing authentication remains challenging for many groups of
users~\cite{disabilitiesauth:ares12}. Authentication is required to
identify the user and to perform access control.
It is prominently performed using a password or PIN number that needs to be
memorized by the user. Alternatively, machine-generated codes can be
generated by specialized hardware ({for example,}\xspace one-time-password generators) or
sent to the user from the authenticating service via a message to his
personal mobile device.
A past study~\cite{disabilitiesauth:ares12} has shown that users with
disabilities take longer to authenticate when using passwords. Besides
degrading their experience, slower typing may also allow third parties to
observe the password being typed, specially in public
terminals~\cite{glass_snoopers}. At the same time, users tend to choose
simpler, easier to guess passwords to facilitate their entry. For example,
they do not choose characters that require using multiple keys in a
conventional keyboard, like symbols, or they simply choose shorter passwords.
Easy to guess passwords are vulnerable to offline attacks~\cite{cloudcracker,
gpu-cracking, ieee-leak, twitter-leak, sony-leak}, while not constraining
failed authentication attempts may also enable online attacks~\cite{hydra}.
The problem is only exacerbated when using space-restricted keyboards, such as
the ones on smartphones and tablets, as another recent study with typical
users found~\cite{password_entry_method:arxiv14}.
When using personal devices to access information, password managers can
alleviate such issues, as the password needs to be only typed once. On
tablets and smartphones, it is also common that a password is only entered
the first time an application is started and a session cookie is
established and used thereafter to authenticate the user. These solutions
are much harder, or even impossible, to apply when considering public
terminals or terminals and devices shared between users ({for example,}\xspace in a workplace).
Another approach is to distribute authentication tokens to users, such as
smartcards and USB keys. These tokens can be presented to terminals for
authentication. While using tokens can be safer and faster than passwords,
it has the following disadvantages. First, custom readers may need to be
installed on many terminals. For example, RFID readers for contactless
smartcards. Second, the user still needs to be able to handle the
particular token with their hands, which could be problematic for some
groups of users.
Our approach aims to allow users with disabilities to authenticate without
the need to use their hands. We are targeting users that can still operate
a terminal, so they do have some use of their upper extremities, and their
vision is sufficient. Our goal is to transform glass wearable devices to a
virtual key chain that can hold keys for different services, can be
easily utilized by users with disabilities, and has a low adoption threshold
by services.
\subsection{Continuous Authentication for Physicians and Nurses in Hospitals}
Physicians and nurses use both portable devices and fixed terminals located
within hospitals. The fixed terminals can be in public spaces ({for example,}\xspace spaces
accessible to patients and visitors) and are usually shared by many
different users ({that is,}\xspace the hospital staff). Consequently, authentication is
required for two reasons: first, to prevent unauthorized use of the
terminals and, second, to present each user with their own personal
environment and data that allows them to be more efficient when moving
between terminals.
When users leave their terminal, it is important that they
log out. However, they frequently neglect to do so, because they are forgetful
or in a hurry. Some times, users request to log out and immediately move away
from the terminal, but their request requires confirmation to complete because
they have left unsaved work, which would be otherwise lost. In other cases,
the decision to leave a terminal without logging out is intentional and aims
to save time, as physicians frequently perceive authentication as being
slow~\cite{healthcareIT_problems}, and a physician returning to a logged out
terminal would have to authenticate again. It is obvious that this behavior
can leave terminals exposed to unauthorized users, but this is not the only
problem. Past studies reported that physician accessing terminals with
another user already logged in has resulted in medication
errors~\cite{medication_errors}, because physicians entered data in the wrong
patient's sheet.
The most common solution to the issue is to use timeouts, {that is,}\xspace logging out a
user from a terminal or locking it after a period of inactivity. Picking
the right value is not an easy task though. Using a short timeout may lead
to erroneously logging out users that are still using a terminal but do not
interact with it. For instance, a physician studying a patient's file or
momentarily discussing with a patient cannot be distinguished from him
walking away from the terminal entirely~\cite{healthcareIT_problems}. On the
other hand, picking a long timeout means that the same problems discussed
above are still possible. An alternative to timeouts is using proximity
sensors. However, they frequently erroneously log out active users or
authenticate passing-by users, leading to frustration and hacks like
disabling them by putting a Styrofoam cup over the
sensor~\cite{proximity_problems}.
Our approach aims to enable systems to continuously authenticate the user
operating a terminal and avoiding erroneously logging him out or locking
the terminal. Our system allows for checks that determine whether a user is
still looking at the terminal before taking action, while even in the case
where a terminal is locked, because the user has briefly moved away, it will
transparently unlock it when he returns and faces the terminal to resume
his task.
\section{Authentication Protocol}
\label{sec:protocol}
\begin{table}
\centering
\caption{Keys and identifiers shared between protocol parties.}
\label{tab:shared}
\begin{tabular}{lccc}
& {\bf Device} & {\bf Terminal} & {\bf Service} \\
\hline
Used ID ($UID$) & \mycircle{black}{0.5ex} & & \mycircle{black}{0.5ex}\\
User OTP Key ($K_{U}$) & \mycircle{black}{0.5ex} & & \mycircle{black}{0.5ex}\\
Service authentication URI & \mycircle{black}{0.5ex} & & \mycircle{black}{0.5ex}\\
Service ID ($SID$) & \mycircle{black}{0.5ex} & \mycircle{black}{0.5ex} & \mycircle{black}{0.5ex}\\
Service certificate ($CERT_{S}$)& \mycircle{black}{0.5ex} & \mycircle{black}{0.5ex} & \mycircle{black}{0.5ex}\\
Nonce OTP Key ($K_{N}$) & & \mycircle{black}{0.5ex} & \mycircle{black}{0.5ex}\\
Terminal ID ($TID$) & & \mycircle{black}{0.5ex} & \mycircle{black}{0.5ex}\\
\hline
\end{tabular}
\end{table}
\subsection{Preliminaries}
\label{ssec:proto_prelim}
The protocol used by Gauth\xspace relies on the transport layer security (TLS)
protocol~\cite{tls} and one-time passwords (OTP). TLS is used to ensure the
confidentiality of communications and enables the user to authenticate the
service. To securely employ TLS between the user and the service, the user
has already obtained the certificate of the service $CERT_{S}$ during
device-service association (Sec.~\ref{ssec:ds_assoc}), which also includes
the service identifier ($SID$) the Internet location of the service in the
form of a uniform resource identifier (URI).
To authenticate the user
to the service, we utilize time-based OTPs~\cite{totp} (TOTP) because they
allow us to authenticate by sending a single message to the service. To
utilize them, a shared key $K_{U}$ is initially exchanged between the
service and the user. Using $K_{U}$ and the current time, the device can
generate an $OTP$ that can be verified by the service. This is similar to
OTP passwords generated by google-authenticator~\cite{google-authenticator}.
Using the $CERT_{S}$ and an $OTP$, we achieve mutual authentication of
user and service.
The protocol also utilizes a $Nonce$, which is used to ensure that older,
stale QR codes cannot be used to abuse the system. We generate it in two
ways, depending on the party that drives the UI. If the terminal UI is
service driven, then a random number is generated by the service. On the
other hand, if the UI is terminal driven, then we use a \emph{HMAC-based
OTP}~\cite{hotp} (HOTP) generator. This is done to enable the terminal to
generate a nonce that can be checked by the authenticating service without
the need to interact with it. This requires a shared key $K_{N}$ to also be
shared between the terminal and the service.
The service certificate (including service ID and URI), along with the user
ID and the shared key for generating user OTPs compose a 3-tuple $(CERT_{S},
UID, K_{U})$ that uniquely identifies an account the user possesses with
a service. A summary of the keys and other information share between the
three parties of this protocol is shown in Tab.~\ref{tab:shared}.
While the communication channel between the terminal and the service is not
the focus of this work, we assume that it is also secure and, for
simplicity, that it is over TLS.
\subsection{Protocol Steps}
\begin{figure}
\centering
\includegraphics[width=\linewidth]{figs/proto.eps}
\caption{Gauth\xspace authentication protocol.}
\label{fig:auth_protocol}
\end{figure}
The protocol consists of five different steps illustrated in
Fig.~\ref{fig:auth_protocol}. However, only \emph{four} steps are actually
utilized during authentication. This is because step~\squared{1} is only
performed when the UI is service driven and step~\diamonded{5} when it is
terminal driven. In the first case, the service can manipulate the UI shown
on the terminal to display a QR code ({for example,}\xspace by adding an image in an HTML page),
so the first step involves encoding the information into a QR code and
displaying it on the terminal. In the second case, the software running on
the terminal is the one generating the QR code.
Step~\circled{2} is performed over an optical channel formed between a
terminal's screen displaying the visual code and the camera on the wearable
device. The information sent to the device through the QR code includes the
$SID$, $TID$, $Nonce$, and a configurable number of options.
The wearable device reads the QR code and decodes it to retrieve the
information encoded. We rely on the intrinsic error correction in QR codes
to ensure that the information is not corrupted.
Once the device decodes the QR code, it creates a secure TLS connection
with the remote service using the stored URI (step~\circled{3}). Since the
device holds the service's certificate, it can verify that it is
communicating with the correct party. To authenticate the user, the device
generates a new OTP using $K_{U}$ and the current time, and sends it to the
service along with the information shown in Fig.~\ref{fig:auth_protocol}.
The remote service can use the information to verify the identify of the
user in step~\circled{4}. In particular, it uses $UID$ to locate the user's
$K_{U}$ and verify the received OTP. The service also verifies that the
received $Nonce$ matches what is expected for $TID$. As discussed in
Sec.~\ref{ssec:proto_prelim}, the nonce can be a randomly generated number or
an HOTP. After, the service then responds to the device with a
positive or negative acknowledgment (step~\circled{4}), which may also
include additional options. For example, it can flag the glass that the
terminal requires continuous authentication over Gauth\xspace and send the
re-authentication period $T_{reauth}$.
If the UI is terminal driven, the service notifies the terminal of the
outcome of the authentication process in step~\circled{5}. If it was
successful, the $UID$ of the user is also sent to the terminal.
During continuous authentication the protocol is repeated, as shown in
Fig.~\ref{fig:auth_protocol}, until the user logs out or his session is
terminated by the service or terminal. Additionally, the options in
steps~\circled{1}~and~\circled{3}, which are highlighted in
Fig.~\ref{fig:auth_protocol}, are used synchronize the clocks of the
device and the service (or terminal) to ensure that re-authentication can proceed
successfully. Our approach is based on Lamport's timestamps
algorithm~\cite{Lamport:1978}, which is used to determine the order of events
in a distributed computer system.
\section{Related Work}
\label{sec:related}
Over the last few years, various authentication methods and schemes have been introduced aiming to improving the security of computers and smartphone systems. Still passwords remain the most popular authentication scheme, although their weaknesses and limitations have been wildly explored. Users are often advised or required to choose passwords that comply with certain policies in order to strength their passwords, but in most cases they end-up with passwords easier to guess than they had previously assumed\cite{telepathwords:sec14}.
As weak-password prevention and password managers schemes try to harden the traditional password, many promising schemes have been introduced over the last few year aiming to provide secure, cheap, and efficient authentication methods based on QR-codes, NFC tags or biometric features. So, the rest of this section will be categorize into three groups, presenting the most resent authentication schemes in the literature.
\subsection{Password Evaluation Studies}
Despite the fact that passwords suffer from various attacks, solutions like Telepathwords \cite{telepathwords:sec14} try to measures the password strength by simulating password-cracking algorithms and providing to the users strong passwords ~\cite{guessagain:oakland12}. Moreover, with the increasing hardware availability and the equipped devices with touchscreens and touch-surfaces, modern password allow user to draw a shape connecting some software points on a touch sensor as their password. These authentication schemes are referred as graphical passwords and aim to combine the usability of drawing a password with high guessability and entropy. Still graphical passwords suffer from smudge and shoulder surfing attacks~\cite{Aviv:2010,Tzong2014}.
Measuring password strength by simulating password-cracking
algorithms~\cite{guessagain:oakland12}.
\subsection{Password Managers}
The increasing number of password users have to memorize, made passwords managers very popular over the last few years. Although the concept of managing password is not something new~\cite{Halderman:2005}, password managers have evolved from traditional software running in the browser, to cloud-based and mobile device based managers~\cite{Lackey2014,Silver2014}. While the the usability of password managers has been proven~\cite{Karole:2010}, various attacks have expose their vulnerabilities~\cite{Silver2014,Zhiwei2014}. In spite of the fact that, the concept of password managers is very promising, it cannot work on in many cases like on public terminals or embedded devices were password managers are not offered.
\subsection{NFC-based authentication schemes}
NFC gains in popularity after smartphones got powered with NFC readers, allowing them to establish two-way contactless radio communication between endpoints by touching them together. NFC as authentication token has been widely utilized by various studies throughout the literature. Recent studies have proposed mobile credit card payments \cite{Choi2014}, health systems \cite{Dehling2014}, password-less authentication and identity management architectures used for securing web services \cite{poplett2014user, Mora2014, Memmi2014} .
\subsection{Authentication based on biometric}
While biometric is gaining in popularity the last few years, interesting solutions have been proposed in the resend literature trying to improve both two-factor and continuous authentication systems. The work in \cite{Frank2013} investigates the possible to continuous authenticate users while they perform basic navigation steps on a touchscreen device. Same year, a new way to perform continuous authentication using mouse dynamics as the behavioural biometric modality was demostrated in \cite{Mondal2013}. Very recently in \cite{Menshawy2014}, a general approach for continuous authentication based on keystroke dynamics was introduced. The authors prove, that it is feasible to authenticate users based on keystroke dynamics for continuous authentication systems. Also in \cite{Kambourakis2014}, a touchstroke dynamic system was introduced as a second verification factor when authenticating the user of a smartphone.
A pulse-response biometric~\cite{pulse-response:ndss14} sends an electric
pulse through the user's body and measures is resistance. The expectation is
that each user has a unique resistance which can be used to uniquely identify
them to perform continuous authentication. However, a user's electric
resistance can change based on various factors, measurements can be affected
by weather conditions, while significant investments may be required to
deploy such sensors on terminals. Also, is it not applicable to generic
online services, similarly to the previous system.
\subsection{Recurring authentication}
Recurring authentication using wearable devices like bracelets that keep track
of a user's hand movements and correlates the movement with the keys pressed to
continuously authenticate users \cite{zebra:oakland14}. They show 85\%
accuracy and 11~sec adversary detection time, or 90\% and 50~sec. The error
is too high and this approach only works on terminals, while it is harder to
easily deploy as an additional authentication measure on generic online
services offered through apps or the browser. Also, Google Glass is potentially
a multipurpose tool, like the smartphone, and is more likely to be adopted by
a larger number of users, while a device can be actually shared by multiple
users.
Transparent re-authentication for mobile devices using behavioral
biometrics and in particular how a user interacts with the smartphone through
its touchscreen~\cite{reauthentication:ndss13}. False positives are disruptive.
Transparently authenticating users based on how they place
calls~\cite{howyouanswerme:asiaccs11}.
\subsection{Authentication for People with Disabilities}
Despite the majority of authentication schemes provided in the literature, people with disabilities have to come across once again with the limited authentication solutions provided in the literature.
Authentication schemes based on multi-touch surfaces with with one or more fingers~\cite{passchords:assets12}, signal-based methods used to delineate the ECG features and determine the dominant fiducials from each heartbeat~\cite{ECGauthentication:icreate08}, eye-gaze gestures~\cite{eyegaze:ozchi07} are some interesting approaches thay may help and improve peoples every day authentication.
\subsection{Exit Survey}
The following questionnaire was given to the participants of the user study
after the experiments. The number on the right of each response indicates
how many participants chose it.
\begin{enumerate}
\item Personal information
\begin{enumerate}
\item Are you a Male (M) or a Female (F)?\\
\textcircled{ } Male \surveyres{14}\\
\textcircled{ } Female \surveyres{16}
\item How old are you?\\
\textcircled{ } 18 - 26 \surveyres{11}\\
\textcircled{ } 26 - 32 \surveyres{6}\\
\textcircled{ } 32 + \surveyres{3}\\
\item Field of study\\
\textcircled{ } Computer Science \surveyres{12}\\
\textcircled{ } Other \surveyres{8}
\end{enumerate}
\item General questions related to authentication methods
\begin{enumerate}
\item Which type of authentication method are you using in
your everyday life?\\
\textcircled{ } Username/Password \surveyres{20}\\
\textcircled{ } Biometric \surveyres{3}\\
\textcircled{ } Username/One-time password \surveyres{4}\\
\textcircled{ } Public/shared key cryptography \surveyres{6}\\
\item How secure are the following authentication methods?
(4 = very secure, 3 = secure, 2 = basic security, 1 = not secure)\\
\textcircled{ } Username/Password \surveyres{2}\\
\textcircled{ } Biometric \surveyres{2}\\
\textcircled{ } Username/One-time password \surveyres{3}\\
\textcircled{ } Public/shared key cryptography \surveyres{4}\\
\item Do you feel that authentication methods should be improved
in the future?\\
\textcircled{ } Yes \surveyres{17}\\
\textcircled{ } No \surveyres{3}\\
\end{enumerate}
\item Authentication through wearable devices
\begin{enumerate}
\item Is this the first time you are using a wearable device like
Google Glass?\\
\textcircled{ } Yes \surveyres{20}\\
\textcircled{ } No, but not mine \surveyres{0}\\
\textcircled{ } No, I already have one \surveyres{0}\\
\item Are you going to use wearable devices in your everyday life in
the near future?\\
\textcircled{ } Yes \surveyres{0}\\
\textcircled{ } No \surveyres{20}\\
\textcircled{ } Only some \surveyres{0}\\
\item Do wearable devices improve the authentication process?\\
\textcircled{ } Yes, both security and usability \surveyres{13}\\
\textcircled{ } No \surveyres{2}\\
\textcircled{ } Yes, but only usability, not security \surveyres{5}\\
\end{enumerate}
\item Improving authentication via Gauth\xspace
\begin{enumerate}
\item Which of the following scenarios do you feel is more secure?
(Select only 1)\\
\textcircled{ } Username/password \surveyres{0}\\
\textcircled{ } Gauth\xspace \surveyres{0}\\
\textcircled{ } Two-factor authentication with Smartphone \surveyres{1}\\
\textcircled{ } Two-factor authentication with Glass \surveyres{0}\\
\textcircled{ } Two-factor authentication with Gauth\xspace \surveyres{19}\\
\item Do you think that Gauth\xspace can improve the authentication process?
\gp{Switched Google Glass for Gauth\xspace here, because i have the feeling
this was what was conveyed to the subjects}\\
\textcircled{ } Yes, both security and usability \surveyres{4}\\
\textcircled{ } No \surveyres{7}\\
\textcircled{ } Yes, but only usability, not security \surveyres{9}\\
\item Which authentication method do you prefer?
(Select only 1)\\
\textcircled{ } Username/password \surveyres{0}\\
\textcircled{ } Gauth\xspace \surveyres{0}\\
\textcircled{ } Two-factor authentication with Smartphone \surveyres{1}\\
\textcircled{ } Two-factor authentication with Glass \surveyres{0}\\
\textcircled{ } Two-factor authentication with Gauth\xspace \surveyres{19}\\
\item How secure are the following authentication methods?
(4 = very secure, 3 = secure, 2 = basic security, 1 = not secure)\\
\textcircled{ } Username/password \surveyres{2}\\
\textcircled{ } Gauth\xspace \surveyres{2}\\
\textcircled{ } Two-factor authentication with Smartphone \surveyres{3}\\
\textcircled{ } Two-factor authentication with Glass \surveyres{3}\\
\textcircled{ } Two-factor authentication with Gauth\xspace \surveyres{4}\\
\item Would you use Gauth\xspace in your everyday life?\\
\textcircled{ } Yes \surveyres{17}\\
\textcircled{ } No \surveyres{3}\\
\end{enumerate}
\end{enumerate}
\section{System Overview}
\label{sec:overview}
Gauth\xspace transforms glass devices to authentication tokens that
can be used to authenticate the user with different services. This section
describes our approach for performing hands-free \emph{one-time} and
\emph{continuous} authentication.
\subsection{One-time Authentication}
\begin{figure}
\centering
\includegraphics[width=\linewidth]{figs/one-time_overview.eps}
\caption{One-time, hands-free authentication with \textbf{Gauth\xspace}.}
\label{fig:one-time_overview}
\end{figure}
Initially authenticating with a system using Gauth\xspace comprises of the steps
depicted in Fig.~\ref{fig:one-time_overview}. Gauth\xspace-enabled services display
a visual code, such as a QR code, on unused terminals, which can either
replace the previously used authentication interface or coexist with
it. This visual code encodes identifiers for the service and terminal, but
it can also include a random number (nonce), which is refreshed every time
a new log-in dialog is presented, to produce QR codes that are different
every time. Introducing randomness is necessary to ensure that a stored
picture of an old QR code cannot be used to authenticate with a terminal.
Authentication is explicitly triggered by the user using a voice command,
such as ``OK glass, authenticate'' (step \circled{1}). Google Glass is
equipped with a voice
command system allowing developers to enable any application through voice.
It can be programmed to accept new commands, and it does not need specific
training to ``understand'' new voices. Its accuracy can drop, though, when
the Glass is not connected to the Internet, as cloud resources are used to
enhance the speech-to-text analysis. Hence, we can program specific
keywords that will trigger authentication. As the device enters power-save
mode when not used, the user may need to also perform a small 10\textdegree{}
head tilt to wake up. This is enabled by the gyroscope sensor on the device.
The device, which has been previously set up to authenticate the user with the
service, takes a picture of what the user is looking at, scanning for a QR
code (step~\circled{2}). If the device fails for some reason to find a
code, it will retry, until a configurable threshold is reached, in which
case it can provide visual or auditory feedback to the user. The
information extracted from the QR code is used to identify whether the device
has been associated with the corresponding service. Once
such a service is found, the device communicates with it ({for example,}\xspace over WiFi,
3G, {etc.}\xspace), presenting the user's credentials and the corresponding terminal
identifier to authenticate the user (step~\circled{3}). Finally, the service
verifies the credentials received and admits the user in the requested
terminal (step~\circled{4}).
We see that while the user needs to initiate the process in step~\circled{1},
the rest of the process is automatic and transparent to the user.
Also, the user does not need to use his hands to type a password or PIN,
search for his smartcard, {etc.}\xspace
\subsection{Continuous Authentication}
\begin{figure}
\centering
\includegraphics[width=\linewidth]{figs/continuous_overview.eps}
\caption{Continuous authentication with \textbf{Gauth\xspace}.}
\label{fig:continuous_overview}
\end{figure}
Devices enter continuous-authentication mode automatically after being
signaled, as part of the acknowledgment returned to the device, when a user
successfully authenticates initially. The process is based on the same
principle as with one-time authentication, but uses timeouts to trigger, in
this case, re-authentication. It begins with the device receiving
acknowledgment that an authentication request has succeeded. At that point,
the service signals that it requires continuous authentication with a minimum
period of $T_{reauth}$ and synchronizes clocks with the device. This means
that while the terminal is being used, the service expects a re-authentication
request from the device every $T_{reauth}$ seconds.
The body of the continuous-authentication loop that follows is shown in
Fig.~\ref{fig:continuous_overview}. When $T_{reauth}$ seconds elapse
(step~\circled{1}), a new re-authentication challenge, encoded as a QR code,
is displayed on the terminal (step~\circled{2}). The QR-code encodes similar
information as before and can be superimposed on the content in a manner
that is non-disruptive. For instance, a QR code can be placed near the edge
of the terminal. Obviously, a user interface that takes into account Gauth\xspace
could reserve some space for this purpose. As a rule of thumb, we try to
use the smallest QR code possible to reduce interference with the user (in
Sec.~\ref{ssec:qrcodes} we evaluate different QR-code sizes).
The device periodically takes snapshots scanning for re-authentication codes.
Since, essentially, the device has synced with the service, it will
also automatically activate after $T_{reauth}$ seconds and start scanning for
a QR code (step~\circled{1}). As long as the user is operating the terminal
and utilizing the
screen, the device will eventually identify such a code. It will process it
and re-authenticate the user by re-supplying his credentials, as well as
the nonce extracted from the code, to the service (step~\circled{3}).
Finally, the service verifies the user's credentials and nonce, and the code
is removed from the display.
If an authentication token is not sent in a certain amount of time, after
the challenge was initiated by the service, it can choose to lock the
terminal or completely log out the user. Note that if the user has recently
interacted with the terminal, the service could decide to be more
permissive and offer more time for re-authentication. If the terminal is
locked, the lock screen should display the last QR-code challenge made by
the service to ensure that the user can quickly resume. This way, when the
user returns his gaze to the terminal, he will be transparently
re-authenticated and the terminal unlocked. \emph{Note that while the device
is in continuous-authentication mode, it will only issue authentication
requests for the terminal it originally authenticated the user with.} So a
user will \emph{not} accidentally authenticate with other locked terminals.
It may be desirable that a terminal remains unlocked without the user
actively interacting with it. For example, a physician may be using a
terminal to show information to a patient without at the same time looking
at the terminal. In this case, the user would face a similar problem as to
when only employing a timeout for determining inactivity, however, the QR
code challenge could serve as queue for him to face the screen or interact
with the terminal to prevent locking.
Finally, while a device is in continuous-authentication mode a visual
marker can be shown on its display to provide feedback. The mode can be
exited directly through a user request, which will also terminate the
user's session with the associated terminal, or indirectly by the service
signaling the device when the user logs out using the terminal's user
interface.
| {'timestamp': '2018-10-08T02:05:13', 'yymm': '1810', 'arxiv_id': '1810.02496', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02496'} | arxiv |
\section{Introduction}
The past few decades have witnessed an increasing role that machine learning techniques play in both academic and industry communities.
These techniques can be widely used to extract useful information from datasets in various fields \cite{kotsiantis2007supervised}. At the same time, the advent of the big data era provides a better platform for its further development. For example, some advertisement companies collect massive data from social media, such as search history from Google and individuals' interactions from Facebook, and analyze the data to lock in targeted customers and improve accuracy of posting advertisements. Machine learning algorithms also have applications in the medical area. Taking cancer scan for instance, some types of cancers are really difficult for even experienced doctors to accurately determine cancer staging, but it has been reported that intelligent computers can help do this with higher accuracy. The combination of data analytics and efforts by doctors can give better medical treatment plans. Machine learning also exerts its effect in the field of finance. Financial companies accumulate a large amount of data records of their customers including purchase history, credit level, and loans and mortgage repayment activities. Then these companies could develop automatic, intelligent fraud detection systems to actively learn the behaviors of customers and distinguish potential threats and bankrupt cases, which can significantly reduce asset loss and bad debts.
A typical machine learning paradigm is to make targeted predictions based on a single dataset \cite{witten2016data}. However, the data resources are increasingly distributed and stored by different owners. For example, medical data can be distributed in several hospitals and healthcare institutes; personal credit history, asset status, and accounting information can be distributed across multiple financial companies. Combining data from multiple sources for learning can usually derive better prediction performance. As a result, the traditional paradigm of learning from a single dataset is experiencing transitions towards collaborative learning, i.e., data from multiple parties are used to collaboratively train a learning model. A conventional collaborative learning approach is to have a central party, i.e., a virtual server and let multiple data owners directly upload their data to the server for training \cite{bouwen2004multi,pathak2010multiparty,rajkumar2012differentially,ohrimenko2016oblivious}.
Although collaborative learning achieves better performance than singe dataset based learning, concerns on privacy are arising. It is possible that during the process, the private information of each party, e.g. health data records, can be disclosed, which will cause privacy leakage. Furthermore, the privacy leakage issue will cause mistrust between participating parties, preventing them from sharing their data to the central server. Therefore, it becomes increasingly important to design a protocol to train a learning model from the datasets from multiple parties, while at the same time preserving their privacy.
Some work has been done for privacy-preserving machine learning in the past few years, and those protection techniques can be mainly divided into three groups. The first group perturbs the original data with randomized algorithms \cite{kabir2007data,liu2006random,shobana2012deriving}. Although the perturbation techniques can protect confidential information, perturbed data may differ from the original data to a large extent, and thus decrease the accuracy of the resulted training model. Secondly, anonymization is also a popular method to protect users’ sensitive information \cite{inan2009using}. For example, we can remove the name and identification number from individual history records. Then the accuracy of the training model will not be affected and the privacy of data owners can also be preserved. However, such anonymization techniques are vulnerable to attacks involving auxiliary information. Thirdly, some cryptographic techniques have also been reported in previous studies \cite{bos2014private,graepel2012ml}. In \cite{graepel2012ml}, Thore \textit{et al} reported a homomorphic encryption scheme to retain both the privacy of training and testing examples. However, homomorphic encryption techniques will incur intensive computations, making it impractical for large-scale applications.
Recently, differential privacy \cite{dwork2008differential} as an arising notation has attracted much attention in the field of privacy. Theoretically, it could offer formal privacy guarantees no matter what auxiliary information the attackers have. There has been a lot of work on the realization of machine learning models under differential privacy. A typical approach is first generating noise via Laplace mechanism or exponential mechanism and then building a noisy model for their dataset using these generated noises \cite{dwork2008differential}. Some other approaches modify the objective function of the training model \cite{dwork2014algorithmic}. These mechanisms can perturb the objective function by adding noise, and output predictions of the perturbed noisy model. However, most of them are focusing on the single-party setting, and have not applied to multiparty learning.
In this paper, we propose a framework for privacy-preserving multiparty learning among multiple data owners. The proposed framework achieves differential privacy, providing theoretical guarantees for each party’s privacy. The framework focuses on the application of logistic regression for model building, but can be easily applied or extended to other machine learning models. In this framework, each data owner first trains its model locally, and each of them will obtain an output objective function for their local model. We design two approaches of noise generation in this process to meet differential privacy. Then these data owners will upload their learned local parameters to a central server for sharing. The central server will average the uploaded local parameters and send the averaged parameters back to those data owners. Local data owners will then incorporate the averaged parameters to retrain their local model. The above process will be repeated iteratively until the parameters converge. The proposed framework is based on the weighted parameter averaging mechanism since the number of data records for different data owners might be different. Experimental results show that the proposed framework is computationally efficient. The main contributions of this paper are summarized as follows:
\begin{itemize}
\item We propose a differentially private framework for multiple parties to collaboratively build learning models using logistic regression, which provides theoretical privacy guarantees for those parties.
\item Two efficient mechanisms are designed for generating noise during local learning to achieve differential privacy for multiparty learning.
\item We propose a weighted parameter sharing mechanism for multiple data owners with different sizes of data records.
\item We run extensive experiments to evaluate the performance of the proposed framework using real datasets, and the results show high efficiency and accuracy of the proposed solution.
\end{itemize}
The rest of the paper is organized as follows. Section II introduces preliminary background knowledge. Section III elaborates the two different approaches for realizing differentially private learning in a multiparty setting. In addition, theoretical privacy analysis for the proposed mechanism is also provided. Section IV presents evaluation results. Section V discusses related work and their difference from our work, and Section VI concludes the paper.
\section{Preliminaries}
\subsection{Differential Privacy}
Differential privacy is an important concept in the area of privacy. It formally guarantees that no matter what change has been made to any particular element in a database an attacker cannot tell the difference in the output of a randomized algorithm [13].
\indent \textit{Definition 1.} A randomized algorithm $ \mathcal{M} $ that takes the elements in $ \mathcal{D} $ and outputs a function $ \mathcal{M(D)} $ achieves $ \epsilon$-differential privacy if
\begin{equation}
\dfrac{P(\mathcal{M(D)} \in S)}{P(\mathcal{M(D')} \in S)} \leq e^{\epsilon}
\end{equation}
where $ S $ is the output range of $ \mathcal{M(D)} $. $ \mathcal{D} $ and $ \mathcal{D'} $ are a pair of neighborhood databases differing in a single item. $ \epsilon $ is a privacy budget that controls the strength of the privacy of the algorithm $ \mathcal{M} $ for any pair of neighborhood databases. For smaller $\epsilon$, the output $ \mathcal{M(D)} $ is almost the same for any pair $ \mathcal{D} $ and $ \mathcal{D'} $, making it hard for the adversarial party to identify the difference between these two neighborhood databases. To make it more clear, we have:
\begin{equation}
e^{-\epsilon}\leq \dfrac{P(\mathcal{M(D)} \in S)}{P(\mathcal{M(D')} \in S)} \leq e^{\epsilon}
\end{equation}
The derivation of Eq. (2) is based on the interchangeability of the \textit{Definition 1}. For smaller $\epsilon$, we have the approximation formula:
\begin{equation}
e^{\epsilon} = 1 - \epsilon
\end{equation}
The combination of Eq. (2) and Eq. (3) will give:
\begin{equation}
1 - \epsilon \leq \dfrac{P(\mathcal{M(D)} \in S)}{P(\mathcal{M(D')} \in S)} \leq 1 + \epsilon
\end{equation}
Since $ 0 < P(\mathcal{M(D)} \in S), P(\mathcal{M(D')} \in S) < 1$, the expansion of Eq. (4) can be rewritten as:
\begin{equation}
|P(\mathcal{M(D)} \in S) - P(\mathcal{M(D')} \in S)| < \epsilon
\end{equation}
It can be clearly seen from Eq. (5), if $ \epsilon $ is a negligible variable, any malicious party inquiring $ \mathcal{M(D)} $ cannot distinguish $ \mathcal{D} $ and $ \mathcal{D'} $. Then strong privacy of the data owner will be achieved.
\indent Several methods have been used to satisfy $ \epsilon $-differential privacy and Laplace mechanism is a commonly used one \cite{dwork2008differential}. In particular, the Laplace mechanism adds a random noise to the output of an algorithm, where the random noise is drawn from Laplace distribution depending on the global sensitivity of the algorithm \cite{dwork2014algorithmic}.
\indent \textit{Definition 2.} Given a real-valued vector mapping function: $ \mathcal{D} \to \mathcal{M(D)}$, the sensitivity of $ \mathcal{M(D)}$ is denoted as:
\begin{equation}
\Delta S_{\mathcal{M}} = \text{max} \Arrowvert \mathcal{M(D)} - \mathcal{M(D')} \Arrowvert_1
\end{equation}
where $ \mathcal{D} $ and $ \mathcal{D'} $ are any pair of neighborhood databases, and $ \Arrowvert \mathcal{M(D)} - \mathcal{M(D')} \Arrowvert_1 $ is the $ l_1 $ distance between $ \mathcal{M(D)} $ and $ \mathcal{M(D')} $. The sensitivity $ \Delta S_{\mathcal{M}} $ describes the maximum variation of the output $ \mathcal{M(D)}$ under single-item changes.
\indent \textit{Definition 3.} The Laplace distribution centered at $ \mu $, and scaled with $ b $ has the following probability density function:
\begin{equation}
Lap(x|\mu, b) = \dfrac{1}{2b}exp(-\dfrac{|x - \mu|}{b})
\end{equation}
Then to compute the noisy output on database $ \mathcal{D} $, we will have:
\begin{equation}
\mathcal{M'(D)} = \mathcal{M(D)} + Lap(x|0, \dfrac{\Delta S_{\mathcal{M}}}{\epsilon})
\end{equation}
where $ Lap(x|0, \dfrac{\Delta S_{\mathcal{M}}}{\epsilon}) $ indicates that the Laplace distribution follows zero mean and $ \dfrac{\Delta S_{\mathcal{M}}}{\epsilon} $ scale. The noise generation mechanism in Eq. (8) can provide $\epsilon$-differential privacy for any randomized algorithm $ \mathcal{M} $.
\subsection{Linear Regression and Logistic Regression}
Consider a basic machine learning task for binary classification, where a database $ \mathcal{D} $ is given. Suppose $ \mathcal{D} $ consists of $ N $ samples $ X_1, X_2, X_3, \cdots, X_n $. Each sample $ X_i $ is denoted as ($ x_{i1} $, $ x_{i2} $, $ x_{i3} $,$ \cdots $, $ x_{im} $, $ y_i$) , where $ x_{i1}, x_{i2}, x_{i3}, \cdots, x_{im}$ are the $ m $ attributes of sample $ X_i $, and $ y_i \in \{0, 1\}$ is the corresponding binary label. For example, when we record cancer history of patients, we need to write down some basic information, such as age, weight, height, and so on. In addition, we also need some high-level information, including blood pressure, heart rate, and medical related indexes. All these information corresponds to the $ m $ attributes of a data record. The label $ y_i \in \{0, 1\}$ indicates existence of a disease. A patient will be labeled as $ 1 $ if diagnosed with a particular cancer, and otherwise will be labeled as $ 0 $.
\indent From the perspective of machine learning scientists, it is assumed that there exists a hidden relationship between the $ m $ attributes $ x_{i1}, x_{i2}, x_{i3}, \cdots, x_{im} $ and the recorded label $ y_i \in \{0, 1\}$. The objective of a machine learning algorithm is to learn this particular relationship which empowers us to predict the label of a data record as accurate as possible given the corresponding attributes logged. Suppose the prediction function $ f $ taking the input of $i$th element $ (\textbf{x}_i:x_{i1}, x_{i2}, x_{i3}, \cdots, x_{im} )$, and outputting the predicted label $ \hat y_i $ is expressed as the following:
\begin{equation}
\hat y_i = f(\textbf{x}_i)
\end{equation}
The above function $ f $ is usually formulated as an optimization problem that one would like to maximize the prediction accuracy. The number of errors made by the prediction function $ f $ over the entire dataset is shown as:
\begin{equation}
\sum_{n = 1}^{N}\Pi_{\hat y_i \neq y_i}
\end{equation}
where $ \Pi $ is a loss function that evaluates the difference between the predicted label and the real label. Our goal is to minimize the number of prediction errors, and the optimization problem is stated as \cite{kutner2004applied}:
\begin{equation}
\textbf{w}^* = \text{arg min}_{\textbf{w}}\sum_{n = 1}^{N}\Pi_{\hat f(\textbf{x}_i) \neq y_i}
\end{equation}
where $ \textbf{w} $ is the parameter of the function $ f $, and $ \textbf{w}^* $ is the optimal result of Eq. (11).
\\ \indent The types of objective function and loss evaluation could vary. In this paper, we focus on the application of logistic regression, which is a commonly used classification technique. In the following part, we will first introduce linear regression and then extend to logistic regression.
\indent Linear regression is the basic regression model, and the prediction function $ f $ is assumed to be linearly dependent on the $ m $ attributes. The predicted label $ \hat y_i $ can be stated as:
\begin{equation}
\hat y_i = \textbf{w}^{T}\textbf{x}_i + \alpha
\end{equation}
where $ (\textbf{x}_i:x_{i1}, x_{i2}, x_{i3}, \cdots, x_{im} )$ are the $ m $ attributes of the $ i $th data record, $ (\textbf{w}: w_{i1}, w_{i2}, w_{i3}, \cdots, w_{im} )$ are the corresponding parameters related to $ m $ attributes, and $\alpha$ is the bias factor of the linear function that helps increase the prediction accuracy.
To measure the error between predicted label and real label, the Euclid distance of a particular data record $ \textbf{x}_i $ is expressed as:
\begin{equation}
d = (\textbf{w}^{T}\textbf{x}_i + \alpha - y_i)^2
\end{equation}
From Eq. (13), we can easily reach the sum of errors over the entire database:
\begin{equation}
(\textbf{w}^*, \alpha^*) = \text{arg min}_{(\textbf{w}, \alpha)} \sum_{i = 1}^{m}(\textbf{w}^{T}\textbf{x}_i + \alpha - y_i)^2
\end{equation}
Eq. (14) is an optimization problem with respect to the parameters $ (\textbf{w}, \alpha) $. In general, the goal of linear regression is to construct a linear function to learn the real label according to attributes of the data sample.
In real world applications, sometimes people are more interested in the probability prediction for particular tasks. Taking the bankrupt prediction as an example, finance companies would like to learn the bankrupt probability of their customers based on payment history and salary level. Logistic regression is developed to learn the probability for some tasks, and is widely used in various areas to predict the occurrence of particular events, such as incidence of a disease, repurchase probability of a product, and failure rates of facilities. In fact, logistic regression is an extended version of linear regression, but the difference is that we have to map the linear function to a probability prediction. The most commonly used mapping function is sigmoid function written as:
\begin{equation}
y = \dfrac{1}{1 + e^{-x}}
\end{equation}
Substituting Eq. (12) into Eq. (15), we have:
\begin{equation}
y_i = \dfrac{1}{1 + e^{-(\textbf{w}^{T}\textbf{x}_i + \alpha)}}
\end{equation}
Also, Eq.(16) can be rewritten as:
\begin{equation}
ln\dfrac{y_i}{1-y_i} = {\textbf{w}^{T}\textbf{x}_i + \alpha}
\end{equation}
If we treat $ y_i $ as the probability of positive case and $ 1 - y_i $ as the probability of negative case, and then $ \dfrac{y_i}{1- y_i} $ represents the relative possibility of data sample $ \textbf{x}_i $ to be a positive case. It can be seen in Eq. (16) that logistic regression is to use linear regression results to predict the logarithm probability for occurrence of the real label.
If we treat $ y_i $ as the poster probability estimation $ p(y_i = 1 | \textbf{x}_i) $, then we can rewrite Eq. (17) as:
\begin{equation}
ln\dfrac{p(y_i = 1 | \textbf{x}_i)}{p(y_i = 0 | \textbf{x}_i)} = \textbf{w}^{T}\textbf{x}_i + \alpha
\end{equation}
It can be derived from Eq. (18) that:
\begin{equation}
{p(y_i = 1 | \textbf{x}_i)} = \dfrac{e^{\textbf{w}^{T}\textbf{x}_i + \alpha}}{1 + e^{\textbf{w}^{T}\textbf{x}_i + \alpha}}
\end{equation}
\begin{equation}
{p(y_i = 0 | \textbf{x}_i)} = \dfrac{1}{1 + e^{\textbf{w}^{T}\textbf{x}_i + \alpha}}
\end{equation}
As a consequence, we can use the maximum likelihood method to estimate $ \textbf{w} $ and $ \alpha $ over the entire dataset \cite{kutner2004applied}:
\begin{equation}
l(\textbf{w}, \alpha) = \sum_{i = 1}^{N}\text{ln} \hspace{0.1cm}p(y_i|\textbf{x}_i; \textbf{w}, \alpha)
\end{equation}
Let $ p_1(\textbf{x};\textbf{w}, \alpha) = p(y = 1 | \textbf{x}; \textbf{w}, \alpha)$, $ p_0(\textbf{x};\textbf{w}, \alpha) = p(y = 0 | \textbf{x}; \textbf{w}, \alpha) = 1 - p_1(\textbf{x};\textbf{w}, \alpha)$. Then the likelihood term in Eq. (21) can be rewritten as:
\begin{equation}
p(y_i | \textbf{x}_i; \textbf{w}, \alpha) = y_ip_1(\textbf{x}_i; \textbf{w}, \alpha) + (1 - y_i)p_0(\textbf{x}_i; \textbf{w}, \alpha)
\end{equation}
Substituting Eq. (22) in to Eq. (21), and according to Eq. (19), Eq. (20), the maximization of Eq. (22) is equivalent to minimizing the following problem:
\begin{equation}
l(\textbf{w}, \alpha) = \sum_{i = 1}^{m}(-y_i(\textbf{w}^T\textbf{x}_i + \alpha) + \text{ln}(1 + e^{\textbf{w}^T\textbf{x}_i + \alpha}))
\end{equation}
The above optimization problem is a differentiable convex function, and can be easily solved by the gradient decent method, or the Newton method.
\subsection{System Architecture and Threat Model}
The system architecture of the collaborative multiparty learning is illustrated in Fig. 1. It is assumed that $ N $ parities are included in this system, and each party has its own local dataset for training. All of the parties agree to train the same model, and logistic regression is applied. The central sever is to maintain the parameters of all these participating parties, including storing, updating, offloading, downloading, and so forth. As we discussed before, each participant constructs a local logistic regression model based on its own dataset. In the initialization step, every participant will obtain a set of parameters $ (\textbf{w}_i, \alpha_i) $, where $ i \in [1, N] $. After obtaining the first round parameters, all these participants will upload their parameters to the central server for sharing. Now the central sever can act as a restoring and exchanging system that allows each participant to download the parameters of others. The advantage is that each participant can use other datasets in learning without knowing the original data of other parties. In addition, each party will not interfere with each other during the training process since the only interaction is the parameter exchanging. It should be noted that weighted parameter sharing is used such that the central server averages the parameters in proportional to the size of each party's data.
\begin{figure}[h]
\centering{
\includegraphics[scale=0.44]{Fig1}
\label{fig:Fig1}}
\caption{System framework for multiparty learning.}\label{fig:issues}
\end{figure}
However, the above multiparty learning system also induces privacy challenges. Since every participant maintains its own dataset which may contain sensitive information, directly uploading the parameters to the central sever might cause release of private information. As a result, the parameters of each participant should be protected before being sent to the central sever for sharing. In this paper, we will employ two methods to protect the parameters that will ensure differential privacy. The experimental results in section IV will show that both methods can achieve good performance.
\section{Privacy-Preserving Logistic Regression}
\subsection{Output Function Perturbation Approach (OFPA)}\label{sec:ofpa}
As mentioned in the previous section, the parameters $ (\textbf{w}, \alpha) $ may contain sensitive information which cannot be uploaded to the central server directly. Every run of the logistic regression model by the local participant will produce a new set of parameters $ (\textbf{w}, \alpha) $. As we will discuss in Algorithm 1, it is very challenging to directly apply the Laplace mechanism due to the difficulty of calculating the global sensitivity of the objective function. As a result, we choose to develop ways to perturb the objective function and then we can easily apply the Laplace mechanism to preserve differential privacy. Let us first start with a simple approach which directly adds Laplace noise to the parameters $ (\textbf{w}, \alpha) $ [13], as described in \textit{Algorithm 1}.
\begin{algorithm}[]
\caption{ Laplace noise addition to parameters}
\label{alg:Framwork1}
\begin{algorithmic}[1]
\REQUIRE ~~\\
Input a local database $ \mathcal{D}$; \\
\ENSURE ~~\\
Encrypted parameter $ (\textbf{w}, \alpha) $;
\STATE Construct a local logistic regression model $ \mathcal{M} $ over the database $ \mathcal{D} $;
\STATE Compute the optimal parameter $ (\textbf{w}^*, \alpha^*) $ for $ \mathcal{M} $;
\STATE Compute $ \Delta S_{\mathcal{M}} $ from Eq. (6);
\STATE Generate a random noise vector \textbf{v} with elements from the Laplace distribution $ Lap(x|0, \dfrac{\Delta S_{\mathcal{M}}}{\epsilon}) = \dfrac{\epsilon}{2\Delta S_{\mathcal{M}}}exp(-\dfrac{|x|\epsilon}{\Delta S_{\mathcal{M}}}) $;
\STATE Compute $ (\textbf{w}, \alpha) = (\textbf{w}^*, \alpha^*) + \textbf{v}$;
\RETURN $ (\textbf{w}, \alpha) $;
\end{algorithmic}
\end{algorithm}
\textbf{Theorem 1.} The output $ (\textbf{w}, \alpha) = (\textbf{w}^*, \alpha^*) + \textbf{v}$ from \textit{Algorithm 1} satisfies $\epsilon$-differential privacy.
\\
\\ \textit{Proof}: The proof is omitted due to space limit.
\\
\\
\indent From \textbf{Theorem 1}, we know that \textit{Algorithm 1} provides a way to realize $ \epsilon $-differential privacy with respect to parameters $ (\textbf{w}, \alpha) $ of each local participant. However, the disadvantage of \textit{Algorithm 1} is the complexity of computing global sensitivity $ \Delta S_{\mathcal{M}} $, which may not be preferable for model training.
\\ \indent Next we will develop a more brief and stable method to realize $ \epsilon $-differential privacy for the parameters $ (\textbf{w}, \alpha) $. Instead of adding noise to the parameters directly, we decide to generate a noise vector $ \textbf{v} $ via the Laplace mechanism, and adding this generated noisy vector into objective function which will give:
\begin{equation}
\begin{split}
l'(\textbf{w},\alpha) &= l(\textbf{w}, \alpha) + \textbf{v}^T\textbf{w}
\\ & = \sum_{i = 1}^{m}(-y_i(\textbf{w}^T\textbf{x}_i + \alpha) + ln(1 + e^{\textbf{w}^T\textbf{x}_i + \alpha})) + \textbf{v}^T\textbf{w}
\end{split}
\end{equation}
It can be proved that the output of Eq. (24) meets $ \epsilon $-differential privacy as stated in \textbf{Theorem 2}. The detailed computational procedures for collaborative learning of OFPA is shown in \textit{Algorithm 2}.
The $ 3 $rd line of \textit{Algorithm 2} points out the stop criteria for collaborative learning. If the variation at the central server is below the preset threshold, we assume the result is optimal and the parameters obtained are global optimal for all participants. In the $ 7 $th line, it can be seen that for every participant's objective function, we will add a Laplace noise vector to protect the privacy. The $ 8 $th line is the core part of collaborative learning that every participant will download the weighted averaging parameters for the next-round training. The main function of the central server is stated in line $ 12 $; i.e., it will calculate the weighted average of the uploaded parameters from all participants. From the whole process, participants can enjoy the benefits of multiple data sources without worrying about information leakage.
\\
\textbf{Theorem 2.} The output of $ l'(\textbf{w}, \alpha) = l(\textbf{w}, \alpha) + \textbf{v}_{ik}^T\textbf{w}$ for each participant in \textit{Algorithm 2} satisfies $\epsilon$-differential privacy.
\\
\\\textit{Proof}: To prove the $\epsilon$-differential privacy for any pair of neighbor databases $ \mathcal{D} $ and $ \mathcal{D'} $, we need to show that \textit{Definition 1} holds for any randomized algorithms.
\\ \indent Without loss of generality, suppose the last element of $ \mathcal{D} $ and $ \mathcal{D'} $ is different, such that $ \mathcal{D} $ is composed of $ (\textbf{x}_1, y_1), (\textbf{x}_2, y_2), \cdots , (\textbf{x}_{n-1}, y_{n-1}), (\textbf{x}_n, y_n) $, and $ \mathcal{D'} $ is composed of $ (\textbf{x}_1, y_1), (\textbf{x}_2, y_2), \cdots $, $(\textbf{x}_{n-1}, y_{n-1}), (\textbf{x}'_n, y'_n) $. In addition, we also assume that $ \parallel\textbf{x}_i\parallel \leq 1$, which can be normalized to $ 1 $ if not. We know that the minimization of Eq. (24) will lead to the zero derivative. In addition, let $ (\textbf{w}, \alpha) $ and $ (\textbf{w}', \alpha') $ be what are obtained for $ \mathcal{D} $ and $ \mathcal{D'} $ after every round of training.
\\ \indent To prove $\epsilon$-differential privacy between $ \mathcal{D} $ and $ \mathcal{D'} $, we only need to show $\epsilon$-differential privacy of the output from $ \l'(\textbf{w}, \alpha)$. The zero derivative of Eq. (24) for the last element of $ \mathcal{D} $ and $ \mathcal{D'} $ will give:
\begin{equation}
\begin{split}
&\textbf{v} - y_n\textbf{x}_n - \dfrac{\textbf{x}_n}{1 + exp(\textbf{w}_n^T\textbf{x}_n + \alpha)} \\&= \textbf{v}' - y_n\textbf{x}_n' - \dfrac{\textbf{x}_n'}{1 + exp(\textbf{w}_n^{T'}\textbf{x}'_n + \alpha')}
\end{split}
\end{equation}
Since $ \parallel \textbf{x}_n \parallel_1 \leq 1$, $ \parallel \textbf{x}'_n \parallel_1 \leq 1$, $exp(\textbf{w}_n^{T}\textbf{x}_n + \alpha) > 0$, and $ exp(\textbf{w}_n^{T'}\textbf{x}'_n + \alpha') > 0$. Thus for any pair of $ \textbf{v} $ and $ \textbf{v}' $, we will get $ \parallel \textbf{v} - \textbf{v}' \parallel_1 \leq 4$ from Eq. (25). Then for any $ (\textbf{w}, \alpha) $ we have the following:
\begin{equation}
\begin{split}
&\dfrac{P((\textbf{w},\alpha)|(\textbf{x}_1, y_1), (\textbf{x}_2, y_2), (\textbf{x}_3, y_3), \cdots , (\textbf{x}_n, y_n))}{P((\textbf{w}, \alpha)|(\textbf{x}_1, y_1), (\textbf{x}_2, y_2), (\textbf{x}_3, y_3), \cdots , (\textbf{x}'_n, y'_n))}\\ &= \dfrac{\Pi_{i=1}^{m}e^{\frac{-4}{\epsilon} v_i}}{\Pi_{i=1}^{m}e^{\frac{-4}{\epsilon} v_i'}}
\\ &= e^{\dfrac{-4}{\epsilon}\parallel \textbf{v} \parallel_1- \parallel \textbf{v}' \parallel_1} \leq e^{\epsilon}
\end{split}
\end{equation}
\begin{algorithm}[h]
\caption{ Privacy-Preserving Collaborative Logistic Regression of OFPA}
\label{alg:Framwork2}
\begin{algorithmic}[1]
\REQUIRE ~~\\
Input $ N $ databases $ \mathcal{D}_1, \mathcal{D}_2, \mathcal{D}_3, \cdots, \mathcal{D}_N$; \\
\ENSURE ~~\\ Output global optimal parameter $ (\textbf{w}, \alpha) $;
\STATE Initialize \textit{k = 0};
\STATE Initialize $(\textbf{w}_k, \alpha_k) = \textbf{0}$;
\STATE \textbf{while} $ \mid \Delta(\textbf{w}_k, \alpha_k) \mid > \eta$
\STATE \hspace{0.5cm}\textbf{for} i = 1 : $ N $
\STATE \hspace{1.0cm}Local data owner $ i $ constructs its own logistic re-\\ \hspace{1.0cm}gression model $ l(\textbf{w},\alpha) $ from Eq. (23);
\STATE \hspace{0.9cm} Generate a random vector $ \textbf{v}_{ik} $ with elements from \\ \hspace{1.0cm}Laplace distribution $ Lap(x|0, 4/{\epsilon})$;
\STATE \hspace{1.0cm}Compute perturbed objective function $ l'(\textbf{w}, \alpha) = $ \\$ \hspace{1.0cm}l(\textbf{w}, \alpha) + \textbf{v}_{ik}^T\textbf{w}$;
\STATE \hspace{0.9cm} Download weighted parameters from central
\\ \hspace{1.0cm}server, and update $ (\textbf{w}_{ik}, \alpha_{ik}) = (\textbf{w}_{k}, \alpha_{k}) $;
\STATE \hspace{0.9cm} Compute $ (\textbf{w}^{*}_{ik}, \alpha^{*}_{ik}) = \text{arg min}\hspace{0.1cm} l'(\textbf{w}, \alpha)$;
\STATE \hspace{0.9cm} Upload $ (\textbf{w}^*_{ik}, \alpha^*_{ik}) $ to the central server;
\STATE \hspace{0.4cm} \textbf{end for};
\STATE \hspace{0.4cm} Central server computes weighted averaging param- \\ \hspace{0.42cm} eter $ (\textbf{w}_{k}, \alpha_{k}) $;
\STATE \hspace{0.4cm} $ k = k + 1 $;
\RETURN $ (\textbf{w}, \alpha) = (\textbf{w}_{k}, \alpha_{k})$;
\end{algorithmic}
\end{algorithm}
\subsection{Output Function Approximation Approach (OFAA)}\label{sec:ofaa}
For OFPA, we add a noise vector into the objective function according to Laplace mechanism. However, one can see that the generated noise is from a constant scale Laplace distribution, and we cannot adjust the noise level. As a result, a preferable mechanism should be able to adjust the noise level according to particular forms of the objective function. In the following, we will develop an approach by injecting noise to coefficients of the objective function's approximation form.
Before delving into details of the function approximation approach, we first discuss the structure of the objective function of logistic regression. It can be verified that $ l(\textbf{w}, \alpha) $ in Eq. (23) is a continuous and differentiable function. According to Stone–Weierstrass Theorem \cite{rudin1964principles}, we can approximate $ l(\textbf{w}, \alpha) $ with a polynomial function with respect to $ (\textbf{w}, \alpha) $. Parameter $ (\textbf{w}, \alpha) $ is a $ m + 1 $ dimensional vector variable $ (w_1, w_2, w_3, \cdots, w_m, \alpha) $. Let $ \Phi_j $ be the set of products of $ (w_1, w_2, w_3, \cdots, w_m, \alpha) $ at the $ j $th degree expressed as:
\begin{equation}
\Phi_j = \{ w_1^{d_1}\cdot w_2^{d_2} \cdot w_3^{d_3} \cdots w_m^{d_m}\cdot \alpha^{d_{ m + 1}} | \sum_{i = 1}^{m+ 1} d_i = j \}
\end{equation}
where $ d_1, d_2, d_3, \cdots, d_{m + 1} \in \mathcal{N} $, and let $ \phi(\textbf{w}) = w_1^{d_1}\cdot w_2^{d_2} \cdot w_3^{d_3} \cdots w_m^{d_m}\cdot \alpha^{d_{ m + 1}}$. Then we can get the approximation expression of $ l(\textbf{w}, \alpha) $ according to Stone–Weierstrass Theorem as follows:
\begin{equation}
l(\textbf{w}, \alpha) = \sum_{j = 0}^{J} \sum_{\phi \in \Phi_j} \sum_{s_i \in \mathcal{D}} \lambda_{\phi s_i} \phi(\textbf{w})
\end{equation}
where $s_i$ is the $i$th element in database $ \mathcal{D} $, and $ \lambda_{\phi s_i} $ is the coefficient of polynomial for data record $ s_i $. It can be seen from Eq. (28) that the objective function $ l(\textbf{w}, \alpha) $ can be approximated with a formula consisting of polynomial function only. As a result, it occurs to us that we can add noise to the coefficients of each degree in the polynomial form. The following \textit{Algorithm} 3 will give detailed steps about adding noise to the coefficients of the polynomial expression.
From \textit{Algorithm 3}, we can see that the central server plays the same role of the previous algorithm, but the difference lies in the noise generation mechanism. The determination of the noise level is from the $7$th and $8$th steps of \textit{Algorithm 3}. For the $j$th degree of the approximate polynomial expression, we choose the maximum coefficient $ \parallel \lambda_{\Phi_j}\parallel_{max} $, and set $ \Delta S = 2(J + 1)\parallel \lambda_{\Phi_j}\parallel_{max} $ as the scale for Laplace distribution. Then in the $10$th step, we will obtain a new perturbed approximate objective function $ \hat l(\textbf{w}, \alpha) $. The parameter $(\textbf{w}, \alpha)$ from $ \hat l(\textbf{w}, \alpha) $ satisfies $ \epsilon$-differential privacy, and the proofs will be given in \textbf{Theorem 3}.
\\
\\ \textbf{Theorem 3}. In \textit{Algorithm 3}, the perturbed approximate objective function $ \hat l(\textbf{w}, \alpha) $ satisfies $ \epsilon$-differential privacy for Laplace distribution with scale $ \Delta S $.
\\
\\\textit{Proof:} Firstly, without loss of generality, we suppose $ \mathcal{D} $ and $\mathcal{D'}$ differ with the last data record, and let $ s_n $ and $s_n'$ be the corresponding last data records. We have that:
\begin{equation}
\begin{split}
&\dfrac{P((\textbf{w},\alpha)|(s_1, s_2, s_3, \cdots , s_n) }{P((\textbf{w},\alpha)|(s_1, s_2, s_3, \cdots , s_n') }
\\ &= \dfrac{\Pi_{j = 0}^{J} \hspace{0.1cm}\Pi_{\phi \in \Phi_j}\hspace{0.1cm}\Pi_{s_i \in \mathcal{D}}\hspace{0.1cm}e^{(\dfrac{\epsilon\parallel \lambda_{\phi s_i}' - \lambda_{\phi s_i} \parallel_1}{\Delta S})}}{\Pi_{j = 0}^{J} \hspace{0.1cm}\Pi_{\phi \in \Phi_j}\hspace{0.1cm}\Pi_{s_i \in \mathcal{D'}}\hspace{0.1cm}e^{(\dfrac{\epsilon\parallel \lambda_{\phi s_i}' - \lambda_{\phi s_i} \parallel_1}{\Delta S})}}
\\ &\leq \Pi_{j = 0}^{J} \hspace{0.1cm}\Pi_{\phi \in \Phi_j}\hspace{0.1cm}e^{(\dfrac{\epsilon(\parallel\sum_{s_i \in \mathcal{D}} \lambda_{\phi s_i}' - \sum_{s_i \in \mathcal{D'}} \lambda_{\phi s_i}' \parallel_1)}{\Delta S}})
\\ & =\Pi_{j = 0}^{J} \hspace{0.1cm}\Pi_{\phi \in \Phi_j}\hspace{0.1cm}e^{(\dfrac{\epsilon(\parallel \lambda_{\phi s_n}' - \lambda_{\phi s_n'}' \parallel_1)}{\Delta S}})
\\ & = \Pi_{j = 0}^{J} \hspace{0.1cm} e^{(\dfrac{\epsilon(\parallel \lambda_{\Phi_j s_n}' - \lambda_{\Phi_j s_n'}' \parallel_1)}{\Delta S}}
\\ & \leq \Pi_{j = 0}^{J} \hspace{0.1cm} e^{(\dfrac{\epsilon(2 \hspace{0.1cm}\text{max}(\parallel \lambda_{\Phi_j}' \parallel_{1}, \parallel \lambda_{\Phi_j }' \parallel_{1}))}{\Delta S}}
\\ & = e^{\sum_{j = 0}^{J}\epsilon/ (J + 1)} = e^{\epsilon}
\end{split}
\end{equation}
The first inequity is derived from the triangle formula $ \parallel a \parallel_1 - \parallel b \parallel_1 \hspace{0.1cm}\leq \hspace{0.1cm}\parallel a \pm b \parallel_1$, where $ a $ and $b$ are real numbers. The second inequality is derived as follows:
\begin{equation}
\begin{split}
\parallel \lambda_{\Phi_j s_n}' - \lambda_{\Phi_j s_n'}' \parallel_1 &\leq \parallel \lambda_{\Phi_j s_n}'\parallel + \parallel \lambda_{\Phi_j s_n'}' \parallel_1 \nonumber
\\& \leq 2 \hspace{0.1cm}\text{max}(\parallel \lambda_{\Phi_j}' \parallel_{1}, \parallel \lambda_{\Phi_j}' \parallel_{1})
\end{split}
\end{equation}
Then Eq.(29) holds, and the proof is complete.
\begin{algorithm}[h]
\caption{ Privacy-Preserving Collaborative Logistic Regression of OFAA}
\label{alg:Framwork}
\begin{algorithmic}[1]
\REQUIRE ~~\\
Input $ N $ databases $ \mathcal{D}_1, \mathcal{D}_2, \mathcal{D}_3, \cdots, \mathcal{D}_N$; \\
\ENSURE ~~\\ Output global optimal parameter $ (\textbf{w}, \alpha) $;
\STATE Initialize \textit{k = 0};
\STATE Initialize $(\textbf{w}_k, \alpha_k) = \textbf{0}$;
\STATE \textbf{while} $ \mid \Delta(\textbf{w}_k, \alpha_k) \mid > \eta$
\STATE \hspace{0.3cm} \textbf{for} i = 1 : $ N $
\STATE \hspace{0.6cm} Let $ l(\textbf{w}, \alpha)_i = \sum_{j = 0}^{J} \sum_{\phi \in \Phi_j} \sum_{s_k \in \mathcal{D}_i} \lambda_{\phi s_k} \phi(\textbf{w},\alpha) $;
\STATE \hspace{0.6cm} \textbf{for} j = 0 : $ J $
\STATE \hspace{1.1cm} Let $\Delta S = 2(J + 1)\hspace{0.05cm} \hspace{0.05cm}\parallel \lambda_{\Phi_j}\parallel_{max}$;
\STATE \hspace{1.1cm} Let $ \lambda_{\Phi_j}' = \lambda_{\Phi_j} + Lap(x|0, \dfrac{\Delta S}{\epsilon})$;
\STATE \hspace{0.6cm} \textbf{end for};
\STATE \hspace{0.6cm} Let $ \hat l(\textbf{w}, \alpha)_i = \sum_{j = 0}^{J} \sum_{\phi \in \Phi_j} \sum_{s_k \in \mathcal{D}_i} \lambda_{\phi' s_k} \phi(\textbf{w}, \alpha) $;
\STATE \hspace{0.6cm} Download weighted parameters from central server, \\ \hspace{0.75cm}and update $ (\textbf{w}_{ik}, \alpha_{ik}) = (\textbf{w}_{k}, \alpha_{k}) $;
\STATE \hspace{0.6cm} Compute $ (\textbf{w}^*_{ik}, \alpha^*_{ik}) = \text{arg min} \hspace{0.1cm} \hat l(\textbf{w}, \alpha)_i$;
\STATE \hspace{0.6cm} Upload $ (\textbf{w}^*_{ik}, \alpha^*_{ik})$ to central server;
\STATE \hspace{0.3cm} \textbf{end for};
\STATE \hspace{0.3cm} Central server computes weighted averaging param- \\ \hspace{0.32cm} eter $ (\textbf{w}_{k}, \alpha_{k}) $;
\STATE \hspace{0.3cm} $ k = k + 1 $;
\RETURN $ (\textbf{w}, \alpha) = (\textbf{w}_k, \alpha_k)$;
\end{algorithmic}
\end{algorithm}
\\
It can be seen that the noise addition mechanism of \textit{Algorithm 3} guarantees $\epsilon$-differential privacy. As a result, releasing the parameter of $ \hat l(\textbf{w}, \alpha)$ will not cause information leakage. In addition, the noise addition mechanism in \textit{Algorithm 3} is designed for objective function with polynomial expression, but $ l(\textbf{w}, \alpha) $ is not of polynomial form yet. We have stated that $ l(\textbf{w}, \alpha) $ can be approximated with a polynomial form by the Stone–Weierstrass Theorem and next we will find a way to derive the approximation polynomial form of $ l(\textbf{w}, \alpha) $.
It is well known that Taylor expansion is commonly used in approximating a continuous and differentiable function with arbitrary precision. In this paper, we decide to use Taylor expansion to derive the approximation polynomial expression for our objective function $ l(\textbf{w}, \alpha) $. For convenience, we can rewrite $ l(\textbf{w}, \alpha) $ as the following:
\begin{equation}
l(\textbf{w}, \alpha) = \sum_{i = 1}^{m}[l_1(\theta_1)- l_2(\theta_2)]
\end{equation}
where $ l_1(t) = \text{ln}(1 + \text{exp}(t)) $, $ l_2(t) = t $, $ \theta_1 = \textbf{w}^T\textbf{x}_i + \alpha$, and $ \theta_2 =y_i( \textbf{w}^T\textbf{x}_i + \alpha)$. In addition, the Taylor expansion of a differentiable and continuous function $ f(x) $ at point $ a $ is expressed as:
\begin{equation}
\sum_{n = 0}^{\infty}\dfrac{f^{(n)}(a)}{n!}(x - a)^n
\end{equation}
where $ f^{(n)}(a) $ is the $ n $th derivative of function $ f $ evaluated at point $ a $. If we apply Taylor expansion to $ l(\textbf{w}, \alpha) $, we will have the following:
\begin{equation}
l(\textbf{w}, \alpha) = \sum_{i = 1}^{m}\sum_{n = 0}^{\infty} [\dfrac{l_1^{(n)}(\theta_1')}{n!}(\theta_1 - \theta_1')^n - \dfrac{l_2^{(n)}(\theta_2')}{n!}(\theta_2 - \theta_2')^n]
\end{equation}
where $ l_1^{(n)}(\theta_1') $ is the $ n $th derivative of function $ \theta_1 $ evaluated at point $ \theta_1' $, and $ l_2^{(n)}(\theta_2') $ is the $ n $th derivative of function $ \theta_2 $ evaluated at point $ \theta_2' $. Note that $ l_2^{(n)} = 0 $ for $ n > 1 $. As a result, we can simplify Eq.(32) by setting $ \theta_1' = \theta_2' = 0 $, and we will have the following:
\begin{equation}
l(\textbf{w}, \alpha) = \sum_{i = 1}^{m}\sum_{n = 0}^{\infty} \dfrac{l_1^{(n)}(0)}{n!}(\textbf{w}^T\textbf{x}_i + \alpha)^n - \sum_{i = 1}^{m}(y_i\textbf{w}^T\textbf{x}_i + \alpha)
\end{equation}
Up to now, we have derived the polynomial expression of the objective function $l(\textbf{w}, \alpha)$. However, we cannot apply Eq. (33) directly due to the infinite summation. We can remove higher order polynomial terms of the Taylor expansion and only keep terms with orders $ n \leq 2 $. Then the approximate polynomial form of Eq. (33) is expressed as:
\begin{equation}
l(\textbf{w}, \alpha) = \sum_{i = 1}^{m}\sum_{n = 0}^{2} \dfrac{l_1^{(n)}(0)}{n!}(\textbf{w}^T\textbf{x}_i + \alpha)^n - \sum_{i = 1}^{m}(y_i\textbf{w}^T\textbf{x}_i + \alpha)
\end{equation}
and calculation of the derivative shows that $ l_1^{(0)}(0) = \text{ln}2 $, $ l_1^{(1)}(0) = 1/2 $, and $ l_2^{(0)}(0) = 1/4 $. With these derivative results, we can calculate the scale in \textit{Algorithm 3}. As described in \textit{Algorithm 3}, for the polynomial expression with different order $ j $, we will choose the according $ \Delta S = 2(J + 1)\parallel \lambda_{\Phi_j}\parallel_{max} $ as the scale of the Laplace distribution. Taking $ j = 1 $ as an example, $ \Delta S $ is expressed as:
\begin{equation}
\begin{split}
\Delta S &= 2 \hspace{0.1cm}\text{max} (\dfrac{f_1^{0}(0)}{1!}\sum_{i = 1}^{d}x_i + \alpha + y_i\sum_{i = 1}^{d}x_i + \alpha)*3
\\ & \leq \dfrac{9}{2}d
\end{split}
\end{equation}
where $ d $ is the number of attributes of data records. As a result, we can inject the noise into the coefficients of the first order polynomial term with Laplace distribution $ Lap(x|0, \dfrac{9d}{2\epsilon}) $ according to \textit{Algorithm 3}, and inject noise to the polynomial form of other orders with the same approach.
\section{Experiments}
In this section, we evaluate the performance of the two proposed approaches OFPA and OFAA, and compare them with regular logistic regression without privacy protection denoted as \textit{LR\_NoPrivacy} which is trained as a single party who holds the entire dataset. All experiments are conducted using Python 2.7 on a Macbook with a 2.2 GHz Intel Core i7 CPU and 16GB RAM.
We choose two real datasets for experiments, \textit{Bank Marketing} \cite{moro2014data} used to predict whether the client will subscribe a term deposit and \textit{Default of Credit Card Clients} \cite{yeh2009comparisons} for predicting whether a credit owner will default or not. The \textit{Bank Marketing} dataset contains 45211 records and 17 attributes, including bank client attributes (e.g., age), current campaign attributes (e.g., contact communication type), and social and economic context attributes (e.g., employment variation rate). For the \textit{Default of Credit Card Clients} dataset, it contains 30000 records and 24 attributes, including credit card owner attributes (e.g., gender), history of past payment, amount of bill statement attributes, and amount of previous payment attributes. Since several attributes in both datasets are categorical variables, we encode such categorical values into integers for our model training using \textit{LabelEncoder} \cite{labelencoder}. Without loss of generality, we assume three parties are included intending to collaboratively learn the logistic regression model, which hold 40\%, 30\% and 10\% of each dataset separately, while the remained 20\% of each dataset is treated as test set.
We conduct logistic regression on each dataset by varying three different parameters, namely the privacy budget $\epsilon$, dataset cardinality, and dataset dimensionality. According to Eq. (19), if ${p(y_i = 1 | \textbf{x}_i)} = \dfrac{e^{\textbf{w}^{T}\textbf{x}_i + \alpha}}{1 + e^{\textbf{w}^{T}\textbf{x}_i + \alpha}} > 0.5$, we make prediction to be 1, and otherwise to be 0. The accuracy of logistic regression models is measured by \textit{misclassification rate}, which is defined as the fraction of data records that are incorrectly classified. Additionally, in each experiment, the logistic regression model is trained 40 epochs 10 times, and the average results are reported.
\subsection{Classification Accuracy vs. Privacy Budget}
To explore how privacy budget $\epsilon$ affects the performance of the proposed algorithms, experiments are performed by varying $\epsilon$ from 0.1 to 3.2. Fig. 2 shows the misclassification rate of each algorithm against the privacy budget $\epsilon$. The accuracy of LR\_NoPrivacy almost stays stable on both datasets. Both OFPA and OFAA produce less misclassifications with increasing $\epsilon$, since a larger $\epsilon$ means that a smaller amount of noise is added to the objective function. Furthermore, it shows that the performance of OFPA is slightly better than OFAA, but both of them are robust against the varied $\epsilon$ and close to regular logistic regression.
\begin{figure}[h]
\centering{
\includegraphics[scale=0.4]{budget}
\label{fig:budget}}
\caption{Classification Accuracy vs. Privacy Budget.}\label{fig:issues}
\end{figure}
\subsection{Classification Accuracy vs. Dataset Cardinality}
To evaluate the classification accuracy against the variation of dataset cardinality, we generate random subsets of the two original datasets with sampling rate from 0.2 to 1, while keeping $\epsilon$ as 0.8. As shown in Fig. 3, the accuracy of LR\_NoPrivacy slightly outperforms that of OFPA and OFAA, but the performance of OFPA and OFAA improves rapidly with the increase of dataset cardinality. More importantly, the misclassification rate of OFPA and OFAA is comparable with LR\_NoPrivacy when we use the full dataset, indicating that our proposed algorithms can make accurate predictions while protecting data privacy.
\begin{figure}[h]
\centering{
\includegraphics[scale=0.4]{sample}
\label{fig:sample}}
\caption{Classification Accuracy vs. Dataset Cardinality.}\label{fig:issues}
\end{figure}
\subsection{Classification Accuracy vs. Dataset Dimensionality}
To demonstrate the effectiveness of the proposed algorithms against the change of dataset dimensionality, we vary the dimensions of \textit{Bank Marketing} dataset from 5 to 17, and change the dimensionality of \textit{Default of Credit Card Clients} from 8 to 24, while setting $\epsilon$ as 0.8. Fig. 4 shows that although the performance of LR\_NoPrivacy still performs slightly better than that of OFPA and OFAA, the accuracy of our proposed approaches improves with the increasing of dataset dimensionality.
\begin{figure}[h]
\centering{
\includegraphics[scale=0.4]{dimension}
\label{fig:dimensionality}}
\caption{Classification Accuracy vs. Dataset Dimensionality.}\label{fig:issues}
\end{figure}
\subsection{Training Time vs. Privacy Budget}
In order to evaluate how noise injection affects the training time, we train each logistic regression model with 40 epochs 10 times. The average training time is reported in Fig. 5. It shows that time cost of training LR\_NoPrivacy is less than that of OFPA and OFAA, which is reasonable since the latter needs more time to stabilize the noisy model. Note that the training of logistic model using OFAA is slower than that of OFPA, since the injected noise in OFPA is constant, but we have to generate more noise to perform OFAA.
\begin{figure}[h]
\centering{
\includegraphics[scale=0.4]{train}
\label{fig:train}}
\caption{Training Time vs. Privacy Budget.}\label{fig:issues}
\end{figure}
\section{Related Work}
Dwork et al. first proposed the notion of $ \epsilon $-differential privacy \cite{dwork2008differential}, and provided Laplace mechanism to achieve it. Later, differential privacy has been developed as a platform to deal with privacy analysis and extensive work employed it to address different types of tasks. For example, Friedman et al. \cite{friedman2010data} achieved $\epsilon $-differential privacy decision tree to predict adult incomes. Raghav et al. \cite{bhaskar2010discovering} reported a differential privacy solution for frequent pattern mining. Other types of work preserving differential privacy have also been done, including support vector machines \cite{li2014privacy}, recommendation system \cite{mcsherry2009differentially}, and neural networks \cite{abadi2016deep}. Differential privacy related to logistic regression has also been demonstrated. For instance, Chaudhuri et al. \cite{chaudhuri2009privacy} enforced $ \epsilon $-differential privacy for logistic regression analysis, but the cost function considered is not of standard regression form. Zhang et al. \cite{zhang2012functional} proposed to approximate the objective function while adding noise to it; however, the addition noise level is high because noise is determined by the global approximation form. In general, all of the above work focus on single party training without considering the multiparty setting.
Some research work has been done on privacy-preserving learning from multiparty data. Pathak et al. \cite{pathak2010multiparty} proposed a differentially private algorithm based on parameter averaging through secure multiparty computation. Rajkumar et al. \cite{rajkumar2012differentially} designed a privacy-preserving multiparty learning scheme, which is enforced by private exchange of gradient information to minimize empirical risks incrementally. In addition, other works using different forms of noise scaling to achieve differential privacy over distributed data have also been reported \cite{shokri2015privacy,heikkila2017differentially}. Different from previous work, we propose a weighted sharing scheme which will help increase the accuracy of model. In addition, we propose to approximate the objection and then inject noise to each degree separately, providing a more efficient, more concise and faster method to complete data training. Furthermore, the schemes designed here feature easy extension to other machine learning tasks.
\section{Conclusion}
In this paper, we proposed two differentially private approaches for collaboratively training logistic regression classifiers among multiple parties. The proposed approaches enable users to enjoy well-trained logistic regression classifiers based on distributed datasets without disclosing their raw data to each other. Experimental results show that the effectiveness, robustness, and training cost of the proposed algorithms are close to that of regular logistic regression on the aggregate dataset without privacy protection. Although this work mainly focuses on logistic regression, the proposed schemes can also be extended to other classification problems in the context of collaborative learning.\vspace{-0.1in}
\bibliographystyle{splncs03}
| {'timestamp': '2018-10-08T02:01:35', 'yymm': '1810', 'arxiv_id': '1810.02400', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02400'} | arxiv |
\section{Introduction}
\section{Introduction}\label{intro.BMSE}
Following the highly influential text \cite{burnham2002model} on model selection, ecologists and conservation biologists have drastically shifted their inferential practice from the `hypothesis testing' approach to the more appropriate `hypothesis discrimination' approach \citep{ellison2004bayesian, diaz2005statistical}. Till date, \cite{burnham2002model} has been cited 43047 times (as on September 22, 2018 - Google Scholar), demonstrating the impact of this text. One may argue, that this contribution has helped increase the pace of growth in ecological knowledge because it has paved the way for researchers to draw inferences, more authentically, because of the ability to now assess the influence of various competing a priori hypotheses (models) without altering the study question to suit the restrictive hypothesis testing paradigm \citep{bolker2008ecological}.
Since a large amount of ecological data are based on observations it permitted for ecologists to take the approach of `detectives' rather than `hypothetico-deductive' scientists by formulating models using likelihood functions to confront various a priori hypotheses using observational data \citep{hilborn1997ecological}. And by maximizing the likelihood and using a model selection tool, such as the Akaike's Information Criterion \citep{burnham2002model}, researchers found a way to place increased faith on models favoured by such criteria. Thus, a vast amount of ecological knowledge generated, has relied on the robustness of such model selection tools in accurately discriminating hypotheses.
Recently, there has been an increased use of hierarchical models in ecology since they appear to address two important issues: (1) ecological scales are naturally hierarchical in structure and (2) hierarchical models form a natural way of incorporating the observation process \citep{royledorazio2008hierarchical}. And with powerful tools such as MCMC, it is now possible to confront complex ecological models with data in a Bayesian inferential framework \citep{bolker2008ecological}. However, it remains unclear as to how to discriminate among competing hypotheses (models) because popular model selection criteria (such as AIC, BIC or DIC) \citep{burnham2002model} aren't easy to apply or work poorly for complex hierarchical models \citep{millar2009comparison}.
It is well known that, asymptotically, Bayes factor is the preferred model selection tool due to its consistency property \citep{GDS2006Bayesian, MR2723361, bernardo2009bayesian}. However, this property holds only under certain regularity conditions that are often difficult to verify for complex models \citep{berger2003approximations, dass2004note, ghosh2001model}. But more prominently, there is vast literature expressing the difficulties in computing the marginal likelihood in applied problems \citep{weinberg2012computing, chan2015marginal, wang2018new}. Hence, it becomes necessary to also consider alternatives to Bayes factor or to find novel ways of applying them in practice.
Recently, \cite{hooten2015guide} summarised a wide array of Bayesian model selection methods that are available to ecologists. However, the generality of these recommendations remain unknown.
Given such innate difficulties involved in discovering the `ideal' model selection tool both from the standpoint of theory \emph{and} its application to a broad class of models, it appears to be prudent to explore the model selection issue by conditioning, at least, on a particular \emph{class} of models.
Here, we evaluate various Bayesian model selection tools on a class of Bayesian spatially explicit capture recapture (SECR) models that are now used frequently for animal density estimation \citep{royle2013spatial}. Although, previously, \cite{goldberg2015examining} has attempted to apply Bayes Factor (Gelfand-Dey estimator) in an abundance estimation problem for leopards (\textit Panthera pardus) for model selection, their approach of computing the ratio term in the estimator seems inaccurate in the context of how the denominator has to be computed according to \cite{gelfand1994bayesian}.
Thus, we evaluate various Bayesian model selection tools by:
\begin{enumerate}
\item Defining a class of competing models (in our case these include the model developed in \cite{dey2017spatial} along with simplified alternatives) that vary both in terms of structural and model complexity.
\item Simulating data sets from a `true' model.
\item Practically implementing a variety of Bayesian model selection tools, and in specific cases, also proposing alternatives.
\item Assessing the efficacy of these implementations from the standpoint of model selection and parameter estimation.
\item Providing recommendations to practitioners based on our results.
\end{enumerate}
\section{Methods}\label{methods.BMSE}
We describe here the true (data-generating) model which will be used for simulation of the data sets. We then fit candidate models to these data sets and apply and assess efficiencies of various model selection tools.
\subsection{The candidate model set}\label{candmodelset.BMSE}
\cite{dey2017spatial} develops a Bayesian SECR model for partially identified individuals as a Bayesian hierarchical model \citep{royledorazio2008hierarchical}. We summarise the description of the model here below.
\subsubsection{Sampling situation}{\ }\\
The notations used in this article are described in Tables~\ref{par.definitons1} and \ref{par.definitons2}. However, we describe a few variables and parameters for ease in the model description below.
Consider a capture-recapture survey of a species with naturally marked individuals in which two detectors are collocated at $J$ trap stations (within a bounded geographic region $\mathcal{V} \, \subset \mathbb{R}^2$) and kept active for $K$ sampling occasions. An individual can be completely identified if both the detectors record the individual simultaneously at least once during the course of study \citep{royle2015spatial}. We assume that each detector captures some mutually exclusive attributes of an individual. These capture outcomes are recorded as binary observations $y_{ijk}^{(1)}$ and $y_{ijk}^{(2)}$ for an individual $i$ at trap station $\mathbf{x}_j$ on sampling occasion $k$ corresponding to detectors 1 and 2 respectively. The paired Bernoulli outcomes $y_{ijk} = (y_{ijk}^{(1)}, y_{ijk}^{(2)})$ give rise to bilateral spatial capture-recapture data for each individual $i$ at location $\mathbf{x}_j$ on occasion $k$. The array of a bilateral capture history for an individual $i$ is denoted by $\mathbf{Y_{\emph{i}, obs}} = (\mathbf{Y^{(1)}_{\emph{i}, obs}}, \mathbf{Y^{(2)}_{\emph{i}, obs}}) = ((y_{ijk}^{(1)}, y_{ijk}^{(2)}))_ {j,k}$, which is of dimension $2\times J \times K$.
Below we provide an example of a sample data set coming out of a spatial capture-recapture survey with two detectors deployed at each station.
\begin{example} \label{example:sampledata}
Suppose a capture-recapture survey is conducted where a pair of detectors (1 and 2) are deployed at each of the 3 ($ = J$) trap stations and kept active for 4 ($ = K$) sampling occasions. Two individuals get fully identified based on their obtained capture histories (captured in both cameras at least once during the survey). The capture history for each of these two fully-identified individuals is of dimension $2 \times 3 \times 4$. The detection histories are tabulated in Table~\ref{sampledata}. Here, individual 1 is fully-identified owing to the capture event at trap 2 on occasion 4. Individual 1 is also fully-identified as it is captured at trap 2 on occasion 4. Due to absence of simultaneous capture events in the detection histories of the partially-identified individuals, we are uncertain about whether these histories correspond to two different individuals or to the same individual.
\end{example}
\subsubsection{Model likelihoods}{\ }\\
When detection rates in recorded samples are low due to failure or malfunction of detectors, capture-recapture data may comprise of individuals with uncertain identities or `partially identified individuals'. \cite{dey2017spatial} separately accounts for the process of animal arrival within detection region of a detector and detection process by conditioning on animal arrival - thus modelling the underlying mechanism by which we obtain different events leading to partial identification.
The probability of animal arrival $\eta_{j}(\mathbf{s}_i)$ (termed as `trap entry probability') is modelled as a decreasing function of Euclidean distance $d(\mathbf{s}_i, \mathbf{x}_j) = \Arrowvert \mathbf{s}_i - \mathbf{x}_j \Arrowvert$ between individual activity centre $\mathbf{s}_i$ and trap station $\mathbf{x}_j$ : $\eta_{j}(\mathbf{s}_i) = \omega_0\, \exp(-d(\mathbf{s}_i, \mathbf{x}_j)^2/(2\sigma^2))$. Here, $\omega_0$ is regarded as the ``baseline trap entry probability'' and $\sigma$ quantifies the rate of decline in trap entry probability as $d(\mathbf{s}_i, \mathbf{x}_j)$ increases. The observation process is parameterised in terms of detection probability $\phi$ which denotes the probability that any arbitrary individual $i$ is detected by a detector on some occasion $k$ given its arrival at that trap.
The obtained capture history observations $\mathbf{Y_{obs}^{(1)}}=((y_{ijk}^{(1)}))_{i,j,k}$ and $\mathbf{Y_{obs}^{(2)}}=((y_{ijk}^{(2)}))_{i,j,k}$ from the two detectors 1 and 2 during a spatial capture-recapture survey may not be synchronised as detectors often perform imperfectly. These two data arrays are then augmented with zero capture histories so that each of them is of dimension $M \times J \times K$, $M$ being an upper bound of the population size. This also makes the dimension of the likelihood fixed in each iteration of Markov chain Monte Carlo algorithm which in turn eases computation. A vector of $M$ latent binary variables $z = (z_1, . . . , z_M)'$ is introduced where $z_i = 1$ implies that individual $i$ is a member of the population. We assume that each $z_i$ is a Bernoulli random variable with parameter $\psi$ and is independent of other $z_j$'s. Here $\psi$ is the proportion of individuals that are real and present within $\ensuremath{\mathcal{V}}$. Thus, the true population size $N$ follows the Binomial distribution with parameters $M$ and $\psi$. The individuals from the two lists obtained from detector 1 and detector 2 are linked probabilistically, by introducing a latent identity variable $\mathbf{L}=(\text{L}_1, \text{L}_2, \dots, \text{L}_M)'$ which is a one-to-one mapping from an index set of individuals capture by detector 2 to $\{1, 2, \dots,M\}$ giving the true index of each of detector 2 individuals. Without loss of generality, the true identity of each individual in the population is defined to be in the row-order of capture histories of detector 1. Then the rows of detector 2 data set $\mathbf{Y^{(2)}}$ are reordered as indicated by $\mathbf{L}$ to synchronise with the individuals of the detector 1 data set $\mathbf{Y^{(1)}}$. We denote this newly ordered detector 2 data set as $\mathbf{Y^{(2*)}}$. The joint density of $\mathbf{Y^*} := ( \mathbf{Y^{(1)}}, \mathbf{Y^{(2*)}} ) = ((y_{ijk}^{(1)}, y_{ijk}^{(2*)}))$ is as given below:
{\small \begin{align} \label{intlik.lr.dey1}
& f(\mathbf{Y^*} \, | \, \phi, \omega_0, \sigma, \mathbf{z}, \mathbf{S}, \mathbf{L})
=\prod_{i=1}^{M}\, \Big{\{}
\phi^{y_{i\cdot \cdot}} (1-\phi)^{2n_{i\cdot}-y_{i\cdot \cdot}} \,
\prod_{j=1}^{J} \, \eta_j(\mathbf{s}_i)^{n_{ij}} \{(1-\eta_j(\mathbf{s}_i)) + \eta_j(\mathbf{s}_i) (1-\phi)^2 \}^{K-n_{ij}}\Big{\}}^{z_i},
\end{align}}where $y_{i\cdot \cdot} = y_{i\cdot \cdot}^{(1)} + y_{i \cdot \cdot}^{(2*)}$, $n_{ij}=\sum_{k=1}^K I(y_{ijk}^{(1)} + y_{ijk}^{(2*)} >0)$ is the number of times individual $i$ got detected on at least one the detectors over $K$ occasions and $n_{i\cdot} = \sum_{j=1}^J n_{ij}$.
Prior to \cite{dey2017spatial}, \cite{royle2015spatial} proposed an SECR model for partially identified individuals coming from spatial capture-recapture surveys. The joint density of $\mathbf{Y^*}$ under \cite{royle2015spatial} is the following:
{\small \begin{align} \label{intlik.lr.royle1}
& f_\text{R}(\mathbf{Y^*} \, | \, p_0, \sigma, \mathbf{z}, \mathbf{S}, \mathbf{L})
=\prod_{i=1}^{M}\, \prod_{j=1}^{J} \, \big{\{} p_{j}(\mathbf{s}_i) ^{y_{ij \cdot}} (1-p_{j}(\mathbf{s}_i))^{2K - y_{ij \cdot}} \big{\}}^{z_i},
\end{align}}where $y_{ij \cdot} = y_{ij \cdot}^{(1)} + y_{ij \cdot}^{(2*)}$ and $p_{j}(\mathbf{s}_i) = p_0\, \exp(-d(\mathbf{s}_i, \mathbf{x}_j)^2/(2\sigma^2))$ denotes the probability that an individual $i$ is detected at a trap station $\mathbf{x}_j$ on some occasion $k$.
Note that, unlike model (\ref{intlik.lr.dey1}), here movement through detection region is considered inherently as a part of the observation process and $p_0$ is regarded as ``baseline detection probability'' and $\sigma$, although related to animal movement, is regarded as the \emph{rate of decline in detection probability}. Qualitatively, the absence of $\phi$ in (\ref{intlik.lr.royle1}), distinguishes this model from (\ref{intlik.lr.dey1}), and can be regarded as a less general model.
Both the models, (\ref{intlik.lr.dey1}) and (\ref{intlik.lr.royle1}), can be extended by introducing a binary covariate on sex category $u$ on spatial animal movement, $\sigma$, as in \cite{sollmann2011improving}.
We define $\sigma$ as a function of the latent structural vector $\mathbf{u} = (u_1, u_2, \dots, u_M)'$:
$\sigma (u_i) = \sigma_m$, if $u_i=1$, i.e., individual $i$ is a male; $\sigma (u_i) = \sigma_f$, if $u_i=0$, i.e., individual $i$ is a female. $u_i$'s are independently and identically distributed Bernoulli random variables with parameter $\theta$, $\theta$ being the probability that an arbitrary individual in the population is male.
Let $\mathbf{u_{obs}}\, (\subset \mathbf{u})$ be a vector of binary observations on sex category of the captured individuals. The vector of latent missing observations in $\mathbf{u}$ is denoted by
$\mathbf{u_0}$. Assuming that covariate information on individual sex category is available,
the joint density of $\mathbf{Y^*}$ and $\mathbf{u}$ under \cite{dey2017spatial} and \cite{royle2015spatial} are, respectively, the following:
{\small \begin{align}
& f(\mathbf{Y^*}, \mathbf{u_{obs}}\, | \, \theta, \phi, \omega_0, \sigma_m, \sigma_f, \mathbf{u_0}, \mathbf{z}, \mathbf{S}, \mathbf{L}) \nonumber \\
& =\prod_{i=1}^{M}\, \Big{[} \Big{\{} \theta^{u_i} (1-\theta)^{1-u_i} \phi^{y_{i\cdot \cdot}} (1-\phi)^{2n_{i\cdot}-y_{i\cdot \cdot}} \, \prod_{j=1}^{J} \, \eta_j(\mathbf{s}_i, u_i)^{n_{ij}} \{(1-\eta_j(\mathbf{s}_i, u_i)) + \eta_j(\mathbf{s}_i, u_i) (1-\phi)^2 \}^{K-n_{ij}}\Big{\}}^{z_i} \Big{]},
\label{intlik.lr.dey2} \\
& f_\text{R}(\mathbf{Y^*}, \mathbf{u_{obs}} \, | \, \theta, p_0, \sigma_m, \sigma_f, \mathbf{u_0}, \mathbf{z}, \mathbf{S}, \mathbf{L})
=\prod_{i=1}^{M}\, \Big{[} \big{\{} \theta^{u_i} (1-\theta)^{1-u_i} \, \prod_{j=1}^{J} \, p_{j}(\mathbf{s}_i, u_i) ^{y_{ij \cdot}} (1-p_{j}(\mathbf{s}_i, u_i))^{2K - y_{ij \cdot}} \big{\}}^{z_i} \Big{]},
\label{intlik.lr.royle2}
\end{align}where $\eta_j(\mathbf{s}_i, u_i) = \omega_0\, \exp(-d(\mathbf{s}_i, \mathbf{x}_j)^2/(2\sigma(u_i)^2))$ denotes the probability that an individual $i$ passes through a trap station $\mathbf{x}_j$ on some occasion $k$, $p_{j}(\mathbf{s}_i, u_i) = p_0\, \exp(-d(\mathbf{s}_i, \mathbf{x}_j)^2/(2\sigma(u_i)^2))$ denotes the probability that an individual $i$ is detected at $\mathbf{x}_j$ on occasion $k$.
The prior distributions for the model parameters $\phi$, $\omega_0$, $p_0$, $\psi$, $\theta$, $\sigma$, $\sigma_m$ are assumed to be independent and are provided in Table~\ref{table.prior}.
To ensure that the marginal distribution of the data is well defined, we have assumed proper priors for each of these parameters \citep{gopalaswamy2016examining}. We assume a uniform prior over the entire state space $\ensuremath{\mathcal{V}}$ for each location of activity centre $\mathbf{s}_i$ and that these $\mathbf{s}_i$'s are independently distributed. $\mathbf{L}$ is assumed to have a uniform prior distribution over the permutation space of $\{1,\dots,M\}$.
The prior specifications remain the same for all the model fits. The MCMC algorithm used to sample from the respective posterior density under each model is detailed in Appendix~D.
Thus, we have the four models, \\
$M_1$ : Model with density (\ref{intlik.lr.dey2}),
$M_2$ : Model with density (\ref{intlik.lr.royle2}),
$M_3$ : Model with density (\ref{intlik.lr.dey1}) and
$M_4$ : Model with density (\ref{intlik.lr.royle1}).
Among these models, $M_1$ can be regarded as the most complex, general, model and $M_4$ can be regarded as the simplest. Therefore, in our study, we simulate data from $M_1$ as the \emph{true model}.
\subsection{Candidate model selection tools}\label{msm.BMSE}
We have considered four different Bayesian model selection methods for application and evaluation: \textit{Bayes factors}, \textit{Deviance Information Criterion} (DIC), \textit{Watanabe-Akaike information criterion} (WAIC) and \textit{posterior predictive loss}.
Two popular model selection tools (AIC and BIC; \cite{burnham2002model}) are not used here because because they impose restrictive assumptions on the parameter space as the sample size increases - situations often encountered in many hierarchical models \citep{royledorazio2008hierarchical}.
For example, in the SECR models we study here, the concept of `number of parameters' is unclear and we therefore cannot apply criteria such as AIC and BIC directly.
\subsubsection{Bayes factors}\label{bfapp}
Model comparison using Bayes factors requires the computation of the marginal likelihood, which involves the integration $m(\mathbf{Y}\, | \, M_i) = \int f(\mathbf{Y} \, | \, \boldsymbol{\mu}, M_i) \, \pi(\boldsymbol{\mu}) \, d\boldsymbol{\mu}$ where $f(\mathbf{Y} \, | \, \boldsymbol{\mu}, M_i)$ denotes the model density and $\pi(\boldsymbol{\mu})$ denotes the prior density of the parameters $\boldsymbol{\mu}$ under $M_i$.
This integration is difficult to compute in practice unless the models are very simple in structure, which is often not the case in ecology. Therefore, computation of the marginal likelihood of data using MCMC methods remains to be a holy grail and is an active area of research \citep{wang2016warp, wang2018new}.
\subsubsection*{Estimation of marginal likelihood of data}\label{computemarglik}
Under our model settings, $\mathbf{Y} = (\mathbf{Y^*}, \mathbf{u_{obs}})$ for models $M_1$, $M_2$ and $\mathbf{Y} = \mathbf{Y^*}$ for the other models $M_3$, $M_4$. $\boldsymbol{\mu}$ denotes the collection of all parameters and latent variables for each model as a generic notation. Specifically, let $\boldsymbol{\mu} = (\boldsymbol{\mu_p}, \boldsymbol{\mu_s})$, where $\boldsymbol{\mu_p}$ is the collection of scalar parameters and $\boldsymbol{\mu_s}$ is the collection of all latent variables.
The Gelfand-Dey estimator of marginal likelihood of data $m(\mathbf{Y})$ is expressed as:
\begin{align}\label{GDest1}
\hat{m}_{\text{GD}}(\mathbf{Y}) = \bigg{[}\, \frac{1}{N_{iter}} \sum_{d=1}^{N_{iter}} \frac{g(\boldsymbol{\mu}^{(d)})}{f(\mathbf{Y} \, | \, \boldsymbol{\mu}^{(d)})\, \pi(\boldsymbol{\mu}^{(d)})} \, \bigg{]}^{-1},
\end{align}
where $\{\boldsymbol{\mu}^{(d)} : d = 1,\dots,N_{iter}\}$ is a set of MCMC draws from the posterior $\pi(\boldsymbol{\mu} \, | \, \mathbf{Y})$ and $g(\boldsymbol{\mu})$ is a tuning density.
It is to be noted that by specifying $g(\boldsymbol{\mu}) = \pi(\boldsymbol{\mu})$ in (\ref{GDest1}), we obtain the harmonic mean estimator of the marginal likelihood
\begin{align}\label{HMest1}
\hat{m}_{\text{HM}}(\mathbf{Y}) = \bigg{[}\, \frac{1}{N_{iter}} \sum_{d=1}^{N_{iter}} \frac{1}{f(\mathbf{Y} \, | \, \boldsymbol{\mu}^{(d)})} \, \bigg{]}^{-1}.
\end{align}
Details on these estimators and their properties can be found in \cite{gelfand1994bayesian}, \cite{kass1995bayes}.
For our problem at hand, the computation of (\ref{GDest1}) requires us to obtain the integrated likelihoods (marginals) under the different models that we consider. This becomes particularly tricky in the presence of high-dimensional latent variables such as $\mathbf{u_0}$, $\mathbf{z}$, $\mathbf{S}$, $\mathbf{L}$ which are elements of $\boldsymbol{\mu_s}$.
We have developed two \textit{approximate} approaches to compute the Gelfand-Dey estimator: the maximum a posteriori (MAP) approximation approach and the integrated likelihood (IL) approach.
\noindent\textbf{Approach 1: MAP approximation}
\noindent In this approach, we fix the high-dimensional variables at their MAP estimates $\boldsymbol{\hat{\mu}_s}$, assuming that their posterior distributions are well summarised by these estimates which are derived from the MCMC draws.
The Gelfand-Dey estimator is then computed using the formula,
\begin{align}\label{GDest2}
\hat{m}_{\text{GD}}(\mathbf{Y}) = \bigg{[}\, \frac{1}{N_{iter}} \sum_{d=1}^{N_{iter}} \frac{g(\boldsymbol{\mu_p}^{(d)})}{f(\mathbf{Y} \, | \, \boldsymbol{\mu_p}^{(d)}, \boldsymbol{\hat{\mu}_s})\, \pi(\boldsymbol{\mu_p}^{(d)})} \, \bigg{]}^{-1}.
\end{align}
where $\{(\boldsymbol{\mu_p}^{(d)},\boldsymbol{\mu_s}^{(d)}) \, : \, d = 1,\dots,N_{iter}\}$ is a set of MCMC draws from the posterior $\pi(\boldsymbol{\mu_p},\boldsymbol{\mu_s} \, | \, \mathbf{Y} )$.
We begin with $(\boldsymbol{\mu_p}^{(d_0)},\boldsymbol{\mu_s}^{(d_0)})$ as an initial estimate of $(\boldsymbol{\mu_p}, \boldsymbol{\mu_s})$ where
$$f(\mathbf{Y}\, | \, \boldsymbol{\mu_p}^{(d_0)},\boldsymbol{\mu_s}^{(d_0)}) \, \pi(\boldsymbol{\mu_p}^{(d_0)},\boldsymbol{\mu_s}^{(d_0)}) =\displaystyle{\max_d} \{f(\mathbf{Y}\, | \, \boldsymbol{\mu_p}^{(d)},\boldsymbol{\mu_s}^{(d)}) \, \pi(\boldsymbol{\mu_p}^{(d)},\boldsymbol{\mu_s}^{(d)})\}.$$
This estimate of posterior mode of $(\boldsymbol{\mu_p}, \boldsymbol{\mu_s})$ may not be optimal since in our high dimensional parameter setting, an MCMC sample of a practical size may not be enough to extensively explore the posterior surface. We, therefore, fix one of the parameters $\boldsymbol{\mu_s} = \boldsymbol{\mu_s}^{(d_0)}$ and explore the posterior surface to find $d_1$ such that
$f( \mathbf{Y} \, | \, \boldsymbol{\mu_p}^{(d_1)},\boldsymbol{\mu_s}^{(d_0)}) \, \pi(\boldsymbol{\mu_p}^{(d_1)},\boldsymbol{\mu_s}^{(d_0)}) =$ $\displaystyle{\max_d} \{f( \mathbf{Y} \, | \, \boldsymbol{\mu_p}^{(d)},\boldsymbol{\mu_s}^{(d_0)}) \, \pi(\boldsymbol{\mu_p}^{(d)},\boldsymbol{\mu_s}^{(d_0)})\}.$
In this way we obtain an improved MAP estimate of $(\boldsymbol{\mu_p}, \boldsymbol{\mu_s})$, $(\boldsymbol{\mu_p}^{(d_1)},\boldsymbol{\mu_s}^{(d_0)})$, if
$$f( \mathbf{Y} \, | \, \boldsymbol{\mu_p}^{(d_1)},\boldsymbol{\mu_s}^{(d_0)}) \, \pi(\boldsymbol{\mu_p}^{(d_1)},\boldsymbol{\mu_s}^{(d_0)}) > f( \mathbf{Y} \, | \, \boldsymbol{\mu_p}^{(d_0)},\boldsymbol{\mu_s}^{(d_0)}) \, \pi(\boldsymbol{\mu_p}^{(d_0)},\boldsymbol{\mu_s}^{(d_0)}).$$
Similarly, we then fix $\boldsymbol{\mu_p} = \boldsymbol{\mu_p}^{(d_1)}$ and find $\boldsymbol{\mu_s}^{(d_2)}$. This procedure is continued iteratively to eventually give us the best MAP estimate of the posterior mode ($\boldsymbol{\hat{\mu}_p},\boldsymbol{\hat{\mu}_s}$).
Suitable transformations of the parameters ensure that all the points in $\{(\boldsymbol{\mu_p}^{(a)}$, $\boldsymbol{\mu_s}^{(b)}) \, : \, a,b = 1,\dots, N_{iter}; a \neq b\}$ belong to the posterior support. The above mentioned resampling procedure is detailed in Appendix~A.
\noindent\textbf{Approach 2: Integrated likelihood (IL) approximation}
\noindent Ideally, we would like to compute the marginal likelihood $m(\mathbf{Y})$ by integrating out all the latent variables with respect to their corresponding prior distributions from the model likelihoods. However, in the case of model likelihoods (\ref{intlik.lr.dey1}-\ref{intlik.lr.royle2}) this integration is not possible for the permutation vector $\mathbf{L}$.
The integration over the variables $\mathbf{u_0}$ and $\mathbf{z}$ can be performed analytically. The integration over $\mathbf{S}$ is evaluated numerically by partitioning the region $\ensuremath{\mathcal{V}}$ into a sufficiently fine grid and then evaluating a Riemann sum (as direct integration can not be expressed in a closed form). This integrated likelihood can then be used in (\ref{GDest1}) for estimating the marginal likelihood
\begin{align}\label{GDIL1}
\hat{m}_{\text{GD}}(\mathbf{Y}) = \bigg{[}\, \frac{1}{N_{iter}} \sum_{d=1}^{N_{iter}} \frac{g(\boldsymbol{\mu_p}^{(d)}, \mathbf{L}^{(d)})}{f(\mathbf{Y} \, | \, \boldsymbol{\mu_p}^{(d)}, \mathbf{L}^{(d)})\, \pi(\boldsymbol{\mu_p}^{(d)}, \mathbf{L}^{(d)})} \, \bigg{]}^{-1}.
\end{align}
One downside of IL approximation approach is the lack of clarity about the interdependencies between the latent variables $\mathbf{u_0}$, $\mathbf{z}$, $\mathbf{S}$ and $\mathbf{L}$ after carrying out the integrations. The derivations of the integrated likelihoods for each of the four models $M_1 - M_4$ are given in Appendix~B by ignoring any possible interdependencies.
We have also assessed the robustness of the Gelfand-Dey estimator by computing the marginal likelihood estimates using different tuning densities, e.g., multivariate normal density, multivariate-t density with varying degrees of freedom and the truncated normal density following the suggestion of \cite{geweke1999using}. These technical details are described in Appendix~C.
\subsubsection{Deviance information criterion (DIC)} \label{dicapp}
Deviance is defined as $D(\boldsymbol{\mu}) = -2\log f(\mathbf{Y} \, | \, \boldsymbol{\mu})$.
Deviance information criterion (DIC) is then defined as $\text{DIC} = D(\hat{\boldsymbol{\mu}}) + 2 \, p_{\scriptstyle \text{DIC}}$
where $\hat{\boldsymbol{\mu}}$ is an estimate of $\boldsymbol{\mu}$. A model with smaller DIC value is preferred.
Model comparison using DIC is not invariant to parameterisation and depends on the components of the model density to be considered as the likelihood. \cite{spiegelhalter2002DIC} suggests practitioners to carefully decide on the parameters of interest so that they can avoid this potential pitfall. This piece of advice is often not straightforward to implement in practice, especially when there exists inherent ambiguity in the interpretation of latent parameters. However \cite{celeux2006deviance} suggests several forms for DIC that can be used for different hierarchical models but does not recommend any particular form as the best.
For the computation of deviance, we have used the MAP estimate of $\boldsymbol{\mu}$ to obtain $\hat{\boldsymbol{\mu}}$ instead of the posterior mean, due to the presence of binary latent variables and unknown permutation vectors in the likelihood. We have then computed two versions of $p_{\scriptstyle \text{DIC}}$ \citep{hooten2015guide, gelman2014bayesian} using MCMC draws $\{\boldsymbol{\mu}^{(d)} : d = 1,\dots,N_{iter}\}$ from $\pi(\mu \, | \,\mathbf{Y})$ as follows:
\begin{align}\label{diceq}
&\hat{p}_{\dic1} = 2\log f(\mathbf{Y} \, | \, \hat{\boldsymbol{\mu}}) - \frac{2}{N_{iter}} \sum_{d=1}^{N_{iter}} \log f(\mathbf{Y} \, | \, \boldsymbol{\mu}^{(d)}),\nonumber \\
&\hat{p}_{\dic2} = 2 \Big{[}\, \frac{1}{N_{iter}} \sum_{d=1}^{N_{iter}} \Big{(}\log f(\mathbf{Y} \, | \, \boldsymbol{\mu}^{(d)}) - \frac{1}{N_{iter}} \sum_{d=1}^{N_{iter}} \log f(\mathbf{Y} \, | \, \boldsymbol{\mu}^{(d)})\Big{)}^2\Big{]}.
\end{align}
\subsubsection{Watanabe-Akaike information criterion (WAIC)} \label{waicapp}
The Watanabe-Akaike information criterion (WAIC) is a Bayesian version of AIC as it uses the posterior predictive distribution of the data to estimate the out-of-sample predictive accuracy of the model. \cite{watanabe2010asymptotic} introduced the WAIC criterion based on the assumption of independence between data points and has shown its asymptotic equivalence with cross-validation. In our model formulations, we have assumed that the different data points correspond to capture-recapture data set for each of the $M$ individuals. WAIC is then defined as $\text{WAIC} = -2\sum_{i=1}^{M} \log \ensuremath{\mathbb{E}}_{\boldsymbol{\mu}\, | \,\mathbf{Y} } \big{(}f(\mathbf{Y}_i \, | \, \boldsymbol{\mu})\big{)} + 2 \, p_{\scriptstyle \text{WAIC}}.$ A model with smaller WAIC value is preferred. In computing WAIC we partition data $Y$ in terms of individuals $(Y_1,Y_2,\dots,Y_M )$. We compute the two commonly used versions of $p_{\scriptstyle \text{WAIC}}$ \citep{hooten2015guide} using MCMC draws $\{\boldsymbol{\mu}^{(d)} : d = 1,\dots,N_{iter}\}$ from $\pi(\mu \, | \,\mathbf{Y})$ as follows:
{\small \begin{align}\label{waiceq}
&\hat{p}_{\waic1} = 2\sum_{i=1}^{M} \Big{\{}\log \Big{(}\frac{1}{N_{iter}} \sum_{d=1}^{N_{iter}} f (\mathbf{Y}_i \, | \, \boldsymbol{\mu}^{(d)})\Big{)} - \frac{1}{N_{iter}} \sum_{d=1}^{N_{iter}} \log f(\mathbf{Y}_i \, | \, \boldsymbol{\mu}^{(d)})\Big{\}},\nonumber\\
&\hat{p}_{\waic2} = \sum_{i=1}^{M} \Big{\{}\frac{1}{N_{iter}} \sum_{d=1}^{N_{iter}}\Big{(}\log f(\mathbf{Y}_i \, | \, \boldsymbol{\mu}^{(d)}) - \frac{1}{N_{iter}} \sum_{d=1}^{N_{iter}} \log f(\mathbf{Y}_i \, | \, \boldsymbol{\mu}^{(d)}) \Big{)}^2\Big{\}}.
\end{align}}
We propose another version for $p_{\scriptstyle \text{WAIC}}$ based on absolute error loss:
{\small \begin{align}\label{waiceq2}
\hat{p}_{\waic3} = 2\sum_{i=1}^{M}\Big{\{}\frac{1}{N_{iter}} \sum_{d=1}^{N_{iter}}\Big{|}\log f(\mathbf{Y}_i \, | \, \boldsymbol{\mu}^{(d)}) - \frac{1}{N_{iter}} \sum_{d=1}^{N_{iter}} \log f(\mathbf{Y}_i \, | \, \boldsymbol{\mu}^{(d)}) \Big{|}\Big{\}}.
\end{align}}
\subsubsection{Posterior predictive loss} \label{pplapp}
\cite{gelfand1998model} derived a model selection criterion, popularly known as the posterior predictive loss criterion, by adopting a decision theoretic approach for measuring predictive accuracy of a model. The posterior predictive loss $D_\infty$ criterion (based on a square error loss function) under our model setting is defined as follows:
\begin{align}\label{pplinf}
D_{\infty} = \sum_{i=1}^{2MJK} (y_{i, \text{vec}} - \ensuremath{\mathbb{E}}(y_{i,\text{rep}}\, | \, \mathbf{Y_{vec}}))^2 + \sum_{i=1}^{2MJK} \ensuremath{\mathbb{V}}\mbox{ar}(y_{i,\text{rep}}\, | \, \mathbf{Y_{vec}}),
\end{align}
where $\mathbf{Y_{vec}} = (y_{1, \text{vec}}, y_{2, \text{vec}}, \dots, y_{2MJK, \text{vec}})'$ is a vector of length $2MJK$ obtained by vectorizing observed data array $\mathbf{Y}$ and $\mathbf{Y_{rep}} = (y_{1, \text{rep}}, y_{2, \text{rep}}, \dots, y_{2MJK, \text{rep}})'$ denotes replicate of the observed data. The first term in the $D_\infty$ criterion (see (\ref{pplinf})) is the goodness-of-fit term while the second term can be interpreted as a penalty term for model complexity. The model with the smallest $D_\infty$ is to be preferred. In our analysis, the data set is obtained by vectorising the two binary data arrays and placing one after the other.
We compute the above expectation $\ensuremath{\mathbb{E}}(y_{i,\text{rep}}\, | \, \mathbf{Y_{\text{vec}}})$ and variance $\ensuremath{\mathbb{V}}\mbox{ar}(y_{i,\text{rep}}\, | \, \mathbf{Y_{\text{vec}}})$ using MCMC draws. Given an MCMC sample $\{\boldsymbol{\mu}^{(d)} : d = 1,\dots,N_{iter}\}$ from $\pi(\mu \, | \,\mathbf{Y})$, we simulate $\mathbf{Y}_{\mathbf{rep}}^{(d)}$ from $f(\mathbf{Y} \, | \, \boldsymbol{\mu}^{(d)})$ for each $d = 1,\dots,N_{iter}$.
For instance, in model $M_1$, $\mu$ denotes the collection of the parameters $\psi$, $\theta$, $\phi$, $\omega_0$, $\sigma_m$, $\sigma_f$, $\mathbf{u_0}$, $\mathbf{z}$, $\mathbf{S}$, $\mathbf{L}$.
Then $\ensuremath{\mathbb{E}}(y_{i,\text{rep}}\, | \, \mathbf{Y_{\text{vec}}}) \approx N_{iter}^{-1} \sum_{d=1}^{N_{iter}} y^{(d)}_{i,\text{rep}}$ and
$\ensuremath{\mathbb{V}}\mbox{ar}(y_{i,\text{rep}}\, | \, \mathbf{Y_{\text{vec}}}) \approx N_{iter}^{-1} \sum_{i=1}^{N_{iter}} \Big{(}y^{(d)}_{i,\text{rep}} - N_{iter}^{-1} \sum_{d=1}^{N_{iter}} y^{(d)}_{i,\text{rep}} \Big{)}^2$.
We summarise the various model selection methods and their variants in Table~\ref{msc}. Considering all these model selection tools and their variants (from approximation approaches to setting tuning densities), our evaluation is carried out on 25 unique tools.
\section{Evaluation of the Performance of Model Selection Methods}\label{mstperformance}
\subsection{Simulation design and simulation scenarios}\label{simdesign.BMSE}
We have conducted simulations for 12 scenarios (provided in Table~ \ref{t.simscenarios.BMSE}) grouped into 2 equal sized sets, to assess the performance of the models proposed here. We set $\sigma_m$ = 0.3 and $\sigma_f$ = 0.15 for the first set of 6 scenarios, $\sigma_m$ = 0.4 and $\sigma_f$ = 0.2 for the second set of 6 scenarios. We set $(\omega_0, \phi)$ = \{(0.01, 0.3), (0.05, 0.3), (0.05, 0.5), (0.03, 0.8), (0.01, 0.9), (0.05, 0.9)\}, which gives us 6 different scenarios for each of the two sets corresponding to the values taken by $\omega_0$ and $\phi$. We assume that a total of 100 individuals are residing inside the state space of which 40 are male. Each of the simulation experiments is conducted within a rectangular state space of dimension 5 unit $\times$ 7 unit (Figure~\ref{statespace.BMSE}), after setting a buffer of 1 unit in both horizontal and vertical directions, a $10 \times 16$ trapping array of total $J=160$ trap stations has been set (trap spacing is 0.3 unit on $X$ axis and 0.3125 unit on $Y$ axis). This meets the requirement suggested in \cite{karanth2017methods}. Each of the traps remains active for $K=50$ sampling occasions simultaneously. For parameter estimation, we set the maximum possible number of individuals present in the population ($M$) at 400 for all the scenarios. The experiment is repeated $n_{sim} = 10$ times. The MCMC samples for each of the parameters are obtained (each of length 30000) and the estimates are computed using those chains with a burn-in of 10000.
Capture-recapture data sets are simulated independently under each of the 12 simulation scenarios (Table~\ref{t.simscenarios.BMSE}) under model $M_1$.
Recall that, model $M_1$ corresponds to the statistical model in (\ref{intlik.lr.dey2}) with $\sigma$ parameter modelled in terms of individual covariate on sex category $\mathbf{u}$ (see Section~\ref{candmodelset.BMSE}). Then each simulated data set is fitted with all the four competing model $M_1$, $M_2$, $M_3$ and $M_4$.
\subsection{Defining performance measures}
\paragraph{Probability of selecting the true model}
In our study, since all the data sets are simulated from model $M_1$, it is considered as the true model. We have computed the proportion of times a model selection method chooses $M_1$ as the best. This proportion will serve as an estimate for the probability of selecting the true model. Additionally we have also computed the proportion of times a model selection method chooses $M_2$, $M_3$ and $M_4$ respectively.
The computed proportions of selecting these models from the simulation study will indicate the efficacy of the model selection methods.
\paragraph{Assessing the quality of parameter estimation.}
The abundance parameter $N$ carries a lot of significance in ecology and conservation. Due to its importance, ecologists place their interests in the robustness and accuracy of its estimate, and will therefore rely on a model selection method that will achieve this. The precision and accuracy of the parameter estimates indicates the quality of the model fit and we assess this by computing the \textit{average root mean square error} (average RMSE).
Suppose $\{\mu^{(td)} \, : \, d = 1, \dots, N_{iter}\}$ denotes a set of MCMC draws from the posterior distribution of an arbitrary parameter $\mu$ for the $t$-th simulated data set, $t = 1,\dots,n_{sim}$. \textit{Mean square error} (MSE) of $\mu$ for $t$-th simulated data set is estimated as $MSE(\mu,\, t) = N_{iter}^{-1} \sum_{d=1}^{N_{iter}} (\mu^{(td)} - \mu)^2.$
Average RMSE is calculated by first averaging the estimated MSEs of different simulations and then taking the square root of the average: $Average \, RMSE(\mu) = \sqrt{n_{sim}^{-1} \sum_{t=1}^{n_{sim}} MSE(\mu,\, t)}.$
The quantities related to the various Bayesian model selection methods (Section~\ref{msm.BMSE}) are computed for each of the four models for the simulated data and analysis sets. First, we analyse the quality of fit of the competing models to the simulated data sets. We compute the proportion of times they favour any of these four models out of the $n_{sim}$ simulations and study the consistency of these different model selection methods. These proportions are then compared with the computed average RMSEs of the parameters to study the behaviour of the model selection methods with respect to varying information content. We also generate pairwise correlation plots from the MCMC draws to study the extent of identifiability issues between various pairs of parameters as a consequence of lack of information content in the data.
\section{Results of the Simulation Study}\label{simresults.BMSE}
Our results suggest that the choice of the tuning density had no impact on model selection (Figures~\ref{fig.modelsel1.BMSE} and \ref{fig.modelsel2.BMSE}). Thus, we focus only on plot (a) in Figure~\ref{fig.modelsel1.BMSE} for our inferences on model selection by Bayes factor (GD-MAP approximation). Here, we observe that Bayes factor GD-MAP approximation favours $M_4$ in $70\%$ of the times under scenario 1 and favours $M_3$ in at least $70\%$ of the times under scenarios 2, 3, 4 and 7. Bayes factor is in favour of $M_1$ more than $80\%$ of the times under all the remaining scenarios 5-6 and 8-12.
The plots corresponding to the Bayes factors (GD-IL approximation) are shown in Figures~\ref{fig.modelsel3.BMSE} and \ref{fig.modelsel4.BMSE}. As seen here, GD-IL approximation performs slightly worse than the GD-MAP approximation. However, we observe that the model choices by the harmonic mean estimator of Bayes Factor performs well and favours the true model $M_1$ in majority of the scenarios (Figure~\ref{fig.modelsel_hm.BMSE}).
We have considered three forms of WAIC and two forms of DIC. The corresponding plots are shown in Figure~\ref{fig.modelsel5.BMSE} (a)-(e). WAIC1, WAIC3, DIC1 and DIC2 exhibit very similar tendencies in their model choices by favouring $M_3$ under all the scenarios except scenario 1 and 3. These four methods favour $M_4$ under scenario 1. Under scenario 3, WAIC1 and DIC1 favour $M_3$ in majority of the times whereas WAIC3 and DIC2 favour $M_4$. Like Bayes factor, these model selection methods (DICs and WAICs) also tend to favour simpler models under scenarios 1 and 3. WAIC2 largely agrees with the other WAICs (and DICs) but more often selects the true model when data sets are more informative (Figure~\ref{fig.modelsel5.BMSE} (a)-(c)). In general, DICs and WAICs seem to discourage the presence of high dimensional latent variables.
The plot showing the proportion of different model choices by posterior predictive loss is given in Figure~\ref{fig.modelsel5.BMSE}(f). The posterior predictive loss criterion $D_\infty$ favours models with individual sex-covariates ($M_1$ and $M_2$). Posterior predictive loss also appears to select the true model some of the times, even when there isn't sufficient information in the data (scenarios 1 and 3).
Figures~\ref{fig.rmse1.BMSE} and \ref{fig.rmse2.BMSE} show the plots for the average root mean square error (average RMSE) for the parameters $N$, $\psi$, $N_{Male}$, $\theta$, $\phi$, $\omega_0$, $p_0$, $\sigma_m$, $\sigma_f$ and $\sigma$. We focus our discussion based on the efficiency and accuracy in estimating $N$. In Figure~\ref{fig.rmse1.BMSE}(a) we see that the average RMSE of $N$ is substantially higher in scenarios 1 - 3 relative to scenarios 4 - 12. Figures~\ref{fig.scatplotsc1m1.BMSE} - \ref{fig.scatplotsc12m1.BMSE} are a representative set of scatter plots (scenarios 1, 2, 3, 7, 9, 12) meant to highlight the range of the correlation coefficient as the information content in the data sets increases.
We observe that, the scatter plots of ($N$, $\theta$) and ($N$, $\sigma_f$) show substantial correlation under scenarios 1 - 3 (see Figures~~\ref{fig.scatplotsc1m1.BMSE} - \ref{fig.scatplotsc3m1.BMSE}). This high correlation may indicate that these parameter estimates are of poor accuracy due to inadequate sample size. However these correlations decrease for the other scenarios (e.g., 9 and 12, see Figures~\ref{fig.scatplotsc9m1.BMSE}, \ref{fig.scatplotsc12m1.BMSE}), likely due to increased information content in the data.
%
\section{Conclusions and Discussion}\label{conclusions.BMSE}
Contemporary practice of ecology and conservation biology relies largely on the use of model selection for hypotheses discrimination \citep{ellison2004bayesian, diaz2005statistical}. Simultaneously, there has been major growth in the use of hierarchical models in ecology, especially within the realm of Bayesian inference \citep{royledorazio2008hierarchical, kery2010introduction}. These models have now enabled statistical ecologists to fairly easily formulate complex ecological models and elegantly deal with the sampling process and also fit these complex models using powerful tools such as MCMC \citep[e.g.,][]{kery2010introduction}. However, the lack of availability of readymade model selection tools when practicing Bayesian inference has sometimes motivated ecologists to continue using likelihood-based inferences, merely because one can use well known model selection tools such as the AIC \citep{burnham2002model} for inference.
To provide a context for this argument, in the spatial capture-recapture literature, we have essentially seen the development of three important likelihood functions: (1) \cite{borchers2008spatially}, (2) \cite{royle2009bayesian} and (3) \cite{royle2015likelihood}. Inferences, for the models (1) and (3) are by maximizing the likelihood, while the inference for (2) is Bayesian. We note with interest, that one of the reasons for the development of (3), was motivated on the pretext that model selection is much easier (using known tools such as the AIC) for practitioners using the likelihood approach, in spite of the problem having been already solved in the Bayesian context \citep{royle2013spatial}. It is specially of concern in the context of the models we study here in that investigators may be forced to integrate out $\mathbf{s}_i$'s (activity centres of individuals) in order to construct tractable likelihoods and thus oversimplifying ecological reality.
In this study, we have tried to implement some selected Bayesian model selection methods on a specific class of advanced Bayesian SECR models (\citealp{royle2015spatial} - with and without sex covariates; \citealp{dey2017spatial} - with and without sex covariates) dealing with partially identified individuals. We have found our Bayes factor implementation using the Gelfand-Dey estimator (using the MAP approximation approach) to be the preferred choice as a model selection method over a wide range of simulation scenarios. This approach appears to work particularly well when information content in the data is moderate to high. The IL approximation approach also worked well, but not as well as the MAP approximation approach perhaps because, there exists interdependency between some of the latent variables.
However, implementing Bayes factors for model selection using the Gelfand-Dey estimator (with MAP approximation) can be computationally intensive and complicated while setting up. Interestingly, our study demonstrates that obtaining Bayes factors using harmonic mean approach for marginal likelihood computation is less demanding but yet serves as a very good model selection method. This finding deviates from the popular view among applied scientists that it is futile to estimate the marginal likelihood using the harmomic mean approach \citep{lartillot2006computing, xie2011marginal}. We surmise that this finding may be attributed to the fact that when we bind the priors (as we have done, but for other reasons) and not permit extremely low probabilities to occur at the tails, many of the criticisms \citep{lartillot2006computing, xie2011marginal} may become irrelevant in practice, but this would require further enquiry.
As our simulation study shows, the two goals of model selection and parameter estimation cannot be simultaneously achieved under certain circumstances (scenarios 1 - 3), especially when information content is low (indicated by high RMSE values and correlation coefficients).
Hence, researchers have to clearly prioritize their objectives prior to data analysis. If the goal, for example, is to find a model that best estimates population size $N$, then we recommend the use of Bayes factor (Gelfand-Dey with MAP approximation) or the Bayes factor (harmonic mean, due to its simplicity) because these appear to provide the most reliable estimates of $N$ over all the simulation scenarios. However, if researchers are only interested to select the true model, especially when data are less informative (scenarios 1 - 3), we recommend the posterior predictive loss approach since they favour the true model nearly a 1/3rd of the times in situations with such low information content. Of course, the dual objectives of model selection and parameter estimation are met when information content is moderate or high (scenarios 4 - 12) and as stated previously, we recommend either Bayes factor (Gelfand-Dey with MAP approximation) or Bayes factor (harmonic mean) in such cases. However, the posterior predictive loss (with the squared error loss function) as used here, does not select the true model when information content is moderate to high.
We also do not recommend the use of DICs or WAICs, since they do not appear to outcompete other model selection tools (either from the standpoint of model selection or parameter estimation) in any of the simulation scenarios. This is an interesting finding, because tools such as WAIC are much newer tools developed by applied Bayesians to provide answers to a wide range of contemporary model selection problems involving hierarchical models \citep{hooten2015guide, gelman2014bayesian}. Thus, our study brings back focus on the need to assess the strength of inference from a model selection method by \textit{conditioning} on a true model and consequently evaluating a \textit{competing} set of model selection methods prior to selecting the most appropriate one for the problem on hand.
Our approach does not, strictly speaking, permit us to draw conclusions and make inferences on the most suitable model selection tools beyond the restrictive set of competing models and the settings we have used in this study. However, at the risk of making a claim beyond our case study, we would recommend the use of the Bayes Factor (Gelfand-Dey with MAP approximation or the harmonic mean estimator) for most Bayesian SECR models and perhaps to much larger class of hierarchical models in ecology \citep{royle2013spatial}. We note with interest that it is also unclear whether the routinely used AIC works as an appropriate model selection tool for MLE-based SECR models as discussed in \cite{efford2014compensatory}.
\section{Acknowledgements}
We thank the Indian Statistical Institute for financial and administrative support. AMG thanks the Wildlife Conservation Society, New York for partial funding support.
\section{Authors contribution}
SD, MD and AMG conceived the ideas and designed methodology; SD, MD and AMG analysed the simulated data; SD, MD and AMG did the writing of the manuscript. All
authors contributed critically to the drafts and gave final approval for publication.
\pagebreak
\begin{table}[!htb]
\centering
\caption{An example of detection histories for two fully identified individuals and partially identified individuals is presented. The circled 1's indicate the simultaneous captures of an individual by the detectors 1 and 2.}
{\footnotesize \begin{tabular}{l @{\extracolsep{15pt}} c @{\extracolsep{15pt}} c @{\extracolsep{15pt}} c @{\extracolsep{15pt}} c @{\extracolsep{15pt}} c @{\extracolsep{30pt}} c @{\extracolsep{15pt}} c @{\extracolsep{15pt}} c @{\extracolsep{15pt}} c @{\extracolsep{15pt}} c}
\\[-1.8ex]\hline
\hline \\[-1.8ex]
& & \multicolumn{4}{c}{Detector 1} & & \multicolumn{4}{c}{Detector 2}\\
& Occasion & 1 & 2 & 3 & 4 & Occasion & 1 & 2 & 3 & 4 \\
& Trap & & & & & Trap & & & & \\
\hline \\[-1.8ex]
\multirow{3}{*}{Fully-identified individual 1}
& 1 & 0 & 1 & 0 & 1 & 1 & 0 & 0 & 1 & 0 \\
& 2 & 1 & 0 & 0 & \raisebox{0.5pt}{\textcircled{\raisebox{-0.9pt} {1}}} & 2 & 0 & 0 & 0 & \raisebox{0.5pt}{\textcircled{\raisebox{-0.9pt} {1}}} \\
& 3 & 0 & 0 & 1 & 1 & 3 & 1 & 0 & 0 & 0 \\
\hline \\[-1.8ex]
\multirow{3}{*}{Fully-identified individual 2}
& 1 & \raisebox{0.5pt}{\textcircled{\raisebox{-0.9pt} {1}}} & 0 & 0 & 0 & 1 & \raisebox{0.5pt}{\textcircled{\raisebox{-0.9pt} {1}}} & 1 & 0 & 0 \\
& 2 & 0 & 0 & 0 & 1 & 2 & 0 & 0 & 0 & 0 \\
& 3 & 1 & 1 & 0 & 0 & 3 & 0 & 0 & 1 & 0 \\
\hline \\[-1.8ex]
\multirow{3}{*}{Partially-identified individual}
& 1 & 1 & 0 & 0 & 1 & 1 & - & - & - & - \\
& 2 & 0 & 0 & 1 & 0 & 2 & - & - & - & - \\
& 3 & 0 & 0 & 0 & 0 & 3 & - & - & - & - \\
\hline \\[-1.8ex]
\multirow{3}{*}{Partially-identified individual}
& 1 &- & - & - & - & 1 & 0 & 0 & 1 & 0 \\
& 2 & - & - & - & - & 2 & 1 & 0 & 0 & 0 \\
& 3 & - & - & - & - & 3 & 0 & 0 & 1 & 0 \\
\hline \\[-1.8ex]
\end{tabular}}
\label{sampledata}
\end{table}
\pagebreak
\begin{table}[H]
\centering
\caption{Notations of variables and parameters used in this article. Bold symbols represent collections (vectors).}
\footnotesize{
\begin{tabular}{ l @{\extracolsep{30pt}} l }
\\[-1.8ex]\hline
\hline \\[-1.8ex]
\textbf{Variables and parameters} & \textbf{Definition}\\
\hline \\[-1.8ex]
$\mathcal{V}$ & A bounded geographic region of scientific or operational relevance\\
& where a population of individuals of certain species reside. \\ [+1.5ex]
$N \sim \mathrm{Binomial}(M,\psi)$ & Population size of the superpopulation, i.e., the number of\\ & individuals within $\mathcal{V}$. \\ [+1.5ex]
$M$ & Maximum number of individuals within the state space $\mathcal{V}$. \\ & This is a fixed quantity defined by the investigator. \\ [+1.5ex]
$\psi$ & Proportion of individuals that are real and present within $\mathcal{V}$.\\ [+1.5ex]
$\theta$ & Probability that an individual is male.\\ [+1.5ex]
$J$ & Number of trap stations in $\mathcal{V}$.\\ [+1.5ex]
$K$ & Number of sampling occasions.\\ [+1.5ex]
$R$ & Maximum permissible value of movement range for each\\
& individual during the survey.\\[+1.5ex]
$\omega_0$ & Baseline trap entry probability in the models $M_1$ and $M_2$, \\
& i.e., probability that an individual passes through a trap station \\
& assuming its centre of activity is also located at that trap station.\\ [+1.5ex]
$p_0$ & Baseline detection probability in the models $M_2$ and $M_4$, \\
&i.e., probability that an individual is detected by a detector \\
&assuming its centre of activity is also located at that trap station.\\ [+1.5ex]
$\sigma$ & $\sigma$ measures the spatial extent of movement around individual \\
& activity centre. $\sigma = \sigma_m$ for male individuals, $\sigma = \sigma_f$ for\\
& female individuals.\\ [+1.5ex]
$d_{ij} = d(\mathbf{s}_i, \mathbf{x}_j) = \Arrowvert \mathbf{s}_i - \mathbf{x}_j \Arrowvert$ & Euclidean distance between points $\mathbf{s}_i$ and $\mathbf{x}_j$.\\ [+1.5ex]
$\eta_j(\mathbf{s}_i, u_i) = \omega_0\, \exp(-\frac{d(\mathbf{s}_i, \mathbf{x}_j)^2}{2\sigma(u_i)^2})$ & Probability that an individual $i$ passes through a trap station \\
& $\mathbf{x}_j$ on some occasion $k$ and $\sigma$ is modelled as a function \\
& of individual covariate on sex category $u_i$. \\ [+1.5ex]
$\eta_j(\mathbf{s}_i) = \omega_0\, \exp(-\frac{d(\mathbf{s}_i, \mathbf{x}_j)^2}{2\sigma^2})$ & Probability that an individual $i$ passes through a trap station \\
&$\mathbf{x}_j$ on some occasion $k$. \\ [+1.5ex]
$\phi$ & Probability that an individual $i$ is detected by a detector on \\
& some occasion $k$ given that it is present at that trap.\\ [+1.5ex]
\\[-1.8ex]\hline
\hline \\[-1.8ex]
\textbf{Notations pertaining to} & \textbf{Definition}\\
\textbf{model selection tools} & \\
\hline \\[-1.8ex]
$\hat{m}_{\text{GD}}(\mathbf{Y})$ & Gelfand-Dey estimator of the marginal likelihood of data $m(\mathbf{Y})$.\\ [+1.5ex]
$\hat{m}_{\text{HM}}(\mathbf{Y})$ & Harmonic mean estimator of the marginal likelihood of data $m(\mathbf{Y})$.\\ [+1.5ex]
$p_{\scriptstyle \text{DIC}}$ & Correction term for bias due to overfitting in DIC criterion. \\ [+1.5ex]
$p_{\scriptstyle \text{WAIC}}$ & Correction term for bias due to overfitting in WAIC criterion. \\ [+1.5ex]
$D_\infty$ & Posterior predictive loss criterion. \\[+1.5ex]
\hline \\[-1.8ex]
\end{tabular}}
\label{par.definitons1}
\end{table}
\pagebreak
\begin{table}[H]
\centering
\caption{Notations of latent variables and data used in this article. Bold symbols represent collections (vectors).}
\resizebox{\textwidth}{0.47\textheight}{
\begin{tabular}{ l @{\extracolsep{100pt}} l }
\\[-1.8ex]\hline
\hline \\[-1.8ex]
\textbf{Latent variables} & \textbf{Definition}\\
\hline \\[-1.8ex]
$\mathbf{S}$ & Locations of the activity centres of $N$ animals within $\mathcal{V}$.\\ [+1.5ex]
$\mathbf{s}_i = (s_{i1}, s_{i2})^\prime$ & Location of individual $i$'s activity centre. \\ [+1.5ex]
$\mathbf{z}=(z_1, z_2, \dots, z_M)^\prime$ & A vector of Bernoulli variables, $z_i=1$ if individual $i$ is present. \\ [+1.5ex]
$\mathbf{u}=(u_1, \dots, u_M)^\prime$ & A vector of Bernoulli variables, $u_i=1$ if individual $i$ is male \\
& in the population and $u_i=0$ if it is a female.\\ [+1.5ex]
$\mathbf{u_0}\ (\subset \mathbf{u})$ & Vector of ``missing'' binary observations on sexes of the\\
& list of $M$ individuals.\\ [+1.5ex]
$\mathbf{L}=(\text{L}_1, \text{L}_2, \dots, \text{L}_M)^\prime$ & A one to one mapping from index set of individuals captured \\
& by detector 2 to $\{1,2,\dots,M\}$ providing the true index of each\\
& detector 2 individuals.\\ [+1.5ex]
\\[-1.8ex]\hline
\hline \\[-1.8ex]
\textbf{Data } & \textbf{Definition}\\
\hline \\[-1.8ex]
$\mathbf{x}_j= (x_{j1}, x_{j2})^\prime$ & Location of $j^{\,\text{th}}$ trap station for detectors.\\ [+1.5ex]
$\mathbf{u_{obs}} \ (\subset \mathbf{u})$ & Vector of ``recorded'' binary observations on sexes of the\\
& captured individuals.\\ [+1.5ex]
$y_{ijk}^{(1)}$ & $y_{ijk}^{(1)}=1$ if individual $i$ is detected in detector 1 at trap station \\
& $\mathbf{x}_j$ on occasion $k$, $y_{ijk}^{(1)}=0$ if not detected in detector 1.\\
$y_{i\cdot \cdot}^{(1)}=\displaystyle{\sum_{j=1}^J \sum_{k=1}^K y_{ijk}^{(1)}} $ & Number of times individual $i$ got detected\\ [-1.8ex]
& in detector 1 over $J$ trap stations and $K$ occasions.\\ [+1.5ex]
$y_{ijk}^{(2)}$ & $y_{ijk}^{(2)}=1$ if individual $i$ is detected in detector 2 at trap station \\
& $\mathbf{x}_j$ on occasion $k$, $y_{ijk}^{(2)}=0$ if not detected in detector 2.\\
$y_{i\cdot \cdot}^{(2)}=\displaystyle{\sum_{j=1}^J \sum_{k=1}^K y_{ijk}^{(2)}} $ & Number of times individual $i$ got detected\\ [-1.8ex]
& in detector 2 over $J$ trap stations and $K$ occasions.\\ [+1.5ex]
$n$ & Number of fully identified individuals, each of them is captured\\
& by both the detectors on at least one occasion.\\ [+1.5ex]
$\mathbf{Y_{obs}^{(1)}} = ((y_{ijk}^{(1)}))$ & Array of individual specific capture histories obtained by\\
& detector 1 (dimension $n \times J \times K$).\\ [+1.5ex]
$\mathbf{Y_{obs}^{(2)}} = ((y_{ijk}^{(2)}))$ & Array of individual specific capture histories obtained by\\
& detector 2 (dimension $n \times J \times K$).\\ [+1.5ex]
$\mathbf{Y^{(1)}}$ & Zero augmented array of individual specific capture histories \\
& corresponding to detector 1 (dimension $M \times J \times K$).\\ [+1.5ex]
$\mathbf{Y^{(2)}}$ & Zero augmented array of individual specific capture histories \\
& corresponding to detector 2 (dimension $M \times J \times K$).\\ [+1.5ex]
$\mathbf{Y^{(2*)}}$ & Reordered $\mathbf{Y^{(2)}}$ according to $\mathbf{L}$ (dimension $M \times J \times K$).\\ [+1.5ex]
$n_{ij}=\displaystyle{\sum_{k=1}^K} \,I(y_{ijk}^{(1)} + y_{ijk}^{(2)} >0)$ & Number of times individual $i$ got detected at trap $j$ \\[-1.8ex]
& on at least one of its sides over $K$ occasions. \\
$n_{i\cdot}=\displaystyle{\sum_{j=1}^J} n_{ij}$ & Number of times individual $i$ got detected on at least\\[-1.8ex]
& one of its sides over $J$ traps and $K$ occasions. \\ [+1.5ex]
\hline \\[-1.8ex]
\end{tabular}}
\label{par.definitons2}
\end{table}
\pagebreak
\begin{table}[!htbp]
\centering
\caption{Prior distributions of model parameters. $R$ is high enough to expect that it would be impossible for animals to exhibit movement as widely as this scale during sampling.}
\footnotesize{\begin{tabular}{ l @{\extracolsep{15pt}} l @{\extracolsep{50pt}} l @{\extracolsep{15pt}} l }
\\[-1.8ex]\hline
\hline \\[-1.8ex]
\textbf{Parameters} & \textbf{Prior} & \textbf{Parameters} & \textbf{Prior}\\
\hline \\[-1.8ex]
$\phi$ & Uniform$(0,\, 1)$ & $\sigma_m$ & Uniform$(0,\, R)$ \\[1.5ex]
$\omega_0$ & Uniform$(0,\, 1)$ & $\sigma_f$ & Uniform$(0,\, R)$ \\ [+1.5ex]
$p_0$ & Uniform$(0,\, 1)$ & $\theta$ & Uniform$(0,\, 1)$ \\ [+1.5ex]
$\sigma$ & Uniform$(0,\, R)$ & $\psi$ & Uniform$(0,\, 1)$ \\ [+0.5ex]
\hline \\[-1.8ex]
\end{tabular}}
\label{table.prior}
\end{table}
\pagebreak
\begin{table}[!htb]
\centering
\caption{Bayesian model selection methods used in this study.}
\resizebox{\textwidth}{0.17\textheight}{
\begin{tabular}{c @{\extracolsep{5pt}} c @{\extracolsep{5pt}} c @{\extracolsep{5pt}} c @{\extracolsep{5pt}} c @{\extracolsep{5pt}} c}
\\[-1.8ex]\hline
\hline \\[-1.8ex]
Sl. no. & Model selection & Variant & Approximation & Choices of & Eq. No. \\
& method && method & tuning density & \\
\hline \\[-1.8ex]
1. & Bayes factor & Gelfand-Dey & MAP & Multivariate normal density, multivar- & (\ref{GDest2})\\
& & estimator & & iate-$t$ density with degrees of freedom& \\
& & & & 10, 100, 500, 1000, 10000 and truncated& \\
& & & & multivariate normal density with confid-& \\
& & & & ence coefficients 0.90, 0,95, 0.99. & \\
2 & Bayes factor & Gelfand-Dey & IL & -Do- & (\ref{GDIL1})\\
& & estimator & & & \\
3. & Bayes factor & Harmonic mean & - & - & (\ref{HMest1}) \\
& & estimator & & & \\
4. & DIC & $p_{DIC1}$ & MAP & - & (\ref{diceq}) \\
5. & DIC & $p_{DIC2}$ & MAP & - & (\ref{diceq}) \\
6. & WAIC & $p_{WAIC1}$ & - & - & (\ref{waiceq}) \\
7. & WAIC& $p_{WAIC2}$ & - & - & (\ref{waiceq}) \\
8. & WAIC & $p_{WAIC3}$ & - & - & (\ref{waiceq2}) \\
9. & Posterior & - & - & - & (\ref{pplinf}) \\
& predictive loss & & & & \\
\hline \\[-1.8ex]
\end{tabular}}
\label{msc}
\end{table}
\pagebreak
\begin{table}[!htb]
\centering
\caption{Parameter specifications corresponding to different simulation scenarios.}
\label{simsetting.bmse}
\footnotesize{\begin{tabular}{@{\extracolsep{5pt}} cccccccc}
\\[-1.8ex]\hline
\hline \\[-1.8ex]
Scenario & $M$ & $N$ & $N_{Male}$ & $\omega_0$ & $\phi$ & $\sigma_m$ & $\sigma_f$\\
\hline \\[-1.8ex]
1 & 400 & 100 & 40 & 0.01 & 0.3 & 0.3 & 0.15 \\
2 & 400 & 100 & 40 & 0.01 & 0.9 & 0.3 & 0.15 \\
3 & 400 & 100 & 40 & 0.01 & 0.3 & 0.4 & 0.20 \\
4 & 400 & 100 & 40 & 0.01 & 0.9 & 0.4 & 0.20 \\
5 & 400 & 100 & 40 & 0.03 & 0.8 & 0.3 & 0.15 \\
6 & 400 & 100 & 40 & 0.03 & 0.8 & 0.4 & 0.20 \\
7 & 400 & 100 & 40 & 0.05 & 0.3 & 0.3 & 0.15 \\
8 & 400 & 100 & 40 & 0.05 & 0.5 & 0.3 & 0.15 \\
9 & 400 & 100 & 40 & 0.05 & 0.9 & 0.3 & 0.15 \\
10 & 400 & 100 & 40 & 0.05 & 0.3 & 0.4 & 0.20 \\
11 & 400 & 100 & 40 & 0.05 & 0.5 & 0.4 & 0.20 \\
12 & 400 & 100 & 40 & 0.05 & 0.9 & 0.4 & 0.20 \\
\hline \\[-1.8ex]
\end{tabular} }
\label{t.simscenarios.BMSE}
\end{table}
\pagebreak
\begin{figure}[!htb]
\centering
\includegraphics[width=270pt,height=270pt]{Grid_of_traps_160traps_buffer1_5by7_V2.eps}
\caption{Array of trap locations (denoted by `+') within the state space $(0,5) \times (0,7)$.}
\label{statespace.BMSE}
\end{figure}
\begin{figure}[H]
\centering
\begin{tabular}{l @{\extracolsep{0pt}} l }
{\hspace{100pt} (a)} & {\hspace{100pt} (b)} \\ [-0.5em]
\includegraphics[width=220pt,height=180pt]{bf_model_choice_plot.eps} & \includegraphics[width=220pt,height=180pt]{bf_t10_model_choice_plot.eps} \\ [0.6em]
{\hspace{100pt} (c)} & {\hspace{100pt} (d)} \\ [-0.5em]
\includegraphics[width=220pt,height=180pt]{bf_t100_model_choice_plot.eps} & \includegraphics[width=220pt,height=180pt]{bf_t500_model_choice_plot.eps} \\ [0.6em]
{\hspace{100pt} (e)} & {\hspace{100pt} (f)} \\ [-0.5em]
\includegraphics[width=220pt,height=180pt]{bf_t1000_model_choice_plot.eps} & \includegraphics[width=220pt,height=180pt]{bf_t10000_model_choice_plot.eps} \\ [0.6em]
\end{tabular}
\caption{\small{The proportion of times Bayes factor favours any particular model using the MAP approximation approach. Plot (a): Gelfand-Dey estimator with a multivariate normal density for $g$. Plots (b)-(f) : Gelfand-Dey estimator with five different choices for $g$, viz., densities of multivariate-$t$ distribution with degrees of freedom 10, 100, 500, 1000, 10000 respectively.}}
\label{fig.modelsel1.BMSE}
\end{figure}
\newpage
\begin{figure}[H]
\centering
\begin{tabular}{l @{\extracolsep{0pt}} l }
{\hspace{100pt} (a)} & {\hspace{100pt} (b)} \\ [-0.5em]
\includegraphics[width=220pt,height=200pt]{bf_truncnorm9_model_choice_plot.eps} &
\includegraphics[width=220pt,height=200pt]{bf_truncnorm95_model_choice_plot.eps}\\ [0.6em]
{\hspace{100pt} (c)} & \\ [-0.5em]
\includegraphics[width=220pt,height=200pt]{bf_truncnorm99_model_choice_plot.eps} & \\ [-0.2em]
\end{tabular}
\caption{\small{The proportion of times Bayes factor favours any particular model using the MAP approximation approach. Plots (a) - (c) are obtained by computing Gelfand-Dey estimator with three different choices for $g$, viz., truncated normal density with $\alpha = 0.9, 0.95, 0.99$. }}
\label{fig.modelsel2.BMSE}
\end{figure}
\begin{figure}[H]
\centering
\begin{tabular}{l @{\extracolsep{20pt}} l }
{\hspace{100pt} (a)} & {\hspace{100pt} (b)} \\ [-0.5em]
\includegraphics[width=220pt,height=180pt]{bf_model_choice_zx0s_plot.eps} & \includegraphics[width=220pt,height=180pt]{bf_t10_model_choice_zx0s_plot.eps} \\ [0.6em]
{\hspace{100pt} (c)} & {\hspace{100pt} (d)} \\ [-0.5em]
\includegraphics[width=220pt,height=180pt]{bf_t100_model_choice_zx0s_plot.eps} & \includegraphics[width=220pt,height=180pt]{bf_t500_model_choice_zx0s_plot.eps} \\ [0.6em]
{\hspace{100pt} (e)} & {\hspace{100pt} (f)} \\ [-0.5em]
\includegraphics[width=220pt,height=180pt]{bf_t1000_model_choice_zx0s_plot.eps} & \includegraphics[width=220pt,height=180pt]{bf_t10000_model_choice_zx0s_plot.eps} \\ [0.6em]
\end{tabular}
\caption{\small{The proportion of times Bayes factor favours any particular model using the integrated likelihood approximation approach. Plot (a): Gelfand-Dey estimator with a multivariate normal density for $g$. Plots (b)-(f) : Gelfand-Dey estimator with five different choices for $g$, viz., densities of multivariate-$t$ distribution with degrees of freedom 10, 100, 500, 1000, 10000 respectively.}}
\label{fig.modelsel3.BMSE}
\end{figure}
\begin{figure}[H]
\centering
\begin{tabular}{l @{\extracolsep{0pt}} l }
{\hspace{100pt} (a)} & {\hspace{100pt} (b)} \\ [-0.5em]
\includegraphics[width=220pt,height=172pt]{bf_truncnorm9_model_choice_zx0s_plot.eps} &
\includegraphics[width=220pt,height=172pt]{bf_truncnorm95_model_choice_zx0s_plot.eps} \\ [0.6em]
{\hspace{100pt} (c)} & \\ [-0.5em]
\includegraphics[width=220pt,height=172pt]{bf_truncnorm99_model_choice_zx0s_plot.eps} & \\ [-0.2em]
\end{tabular}
\caption{\small{The proportion of times Bayes factor favours any particular model using the integrated likelihood approximation approach. Plots (a) - (c) : Gelfand-Dey estimator with three different choices for $g$, viz., truncated normal density with $\alpha = 0.9, 0.95, 0.99$.}}
\label{fig.modelsel4.BMSE}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=220pt,height=172pt]{bf_hm_model_choice_plot.eps}\\ [-0.2em]
\caption{\small{The proportion of times Bayes factor (using the harmonic mean estimator) favours any particular model.}}
\label{fig.modelsel_hm.BMSE}
\end{figure}
\begin{figure}[H]
\centering
\begin{tabular}{l @{\extracolsep{0pt}} l }
{\hspace{100pt} (a)} & {\hspace{100pt} (b)} \\ [-0.5em]
\includegraphics[width=220pt,height=180pt]{waic1_model_choice_plot.eps} & \includegraphics[width=220pt,height=180pt]{waic2_model_choice_plot.eps} \\ [0.6em]
{\hspace{100pt} (c)} & {\hspace{100pt} (d)} \\ [-0.5em]
\includegraphics[width=220pt,height=180pt]{waic3_model_choice_plot.eps} & \includegraphics[width=220pt,height=180pt]{dic1_model_choice_plot.eps} \\ [0.6em]
{\hspace{100pt} (e)} & {\hspace{100pt} (f)} \\ [-0.5em]
\includegraphics[width=220pt,height=180pt]{dic2_model_choice_plot.eps} & \includegraphics[width=220pt,height=180pt]{ppl_model_choice_plot.eps}
\end{tabular}
\caption{\small{The proportion of time a model selection method favours any particular model. Plots (a)-(f) correspond to WAIC1, WAIC2, WAIC3, DIC1, DIC2 and posterior predictive loss respectively.}}
\label{fig.modelsel5.BMSE}
\end{figure}
\begin{figure}[H]
\centering
\begin{tabular}{l @{\extracolsep{20pt}} l }
{\hspace{110pt}$N$} & {\hspace{110pt} $\psi$} \\ [-0.75em]
\includegraphics[width=210pt,height=210pt]{N_rmse_plot.eps} & \includegraphics[width=210pt,height=210pt]{psi_rmse_plot.eps}\\
{\hspace{95pt} $N_{Male}$} & {\hspace{110pt} $\theta$} \\ [-0.75em]
\includegraphics[width=210pt,height=210pt]{N_Male_rmse_plot.eps} & \includegraphics[width=210pt,height=210pt]{theta_rmse_plot.eps}\\
{\hspace{110pt} $\phi$} & \\ [-0.75em]
\includegraphics[width=210pt,height=210pt]{phi_rmse_plot.eps} &
\end{tabular}
\caption{Plot of average RMSE estimates of $N$, $\psi$, $N_{Male}$, $\theta$ and $\phi$ over different simulation scenarios.}
\label{fig.rmse1.BMSE}
\end{figure}
\begin{figure}[H]
\centering
\begin{tabular}{l @{\extracolsep{20pt}} l }
{\hspace{110pt} $\omega_0$} & {\hspace{95pt} $p_0$}\\ [-0.75em]
\includegraphics[width=210pt,height=210pt]{p0_rmse_plot.eps} & \includegraphics[width=210pt,height=210pt]{lambda0_rmse_plot.eps}\\
{\hspace{110pt} $\sigma_m$} & {\hspace{95pt} $\sigma_f$} \\ [-0.75em]
\includegraphics[width=210pt,height=210pt]{sigmam_rmse_plot.eps} & \includegraphics[width=210pt,height=210pt]{sigmaf_rmse_plot.eps}\\
{\hspace{110pt} $\sigma$} & \\ [-0.75em]
\includegraphics[width=210pt,height=210pt]{sigma_rmse_plot.eps} &
\end{tabular}
\caption{Plot of average RMSE estimates of $\omega_0$, $p_0$, $\sigma_m$, $\sigma_f$ and $\sigma$ over different simulation scenarios.}
\label{fig.rmse2.BMSE}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=470pt,height=470pt]{Scatter_Plots_scenario2_M1.eps} \caption{Scatter plot of the parameters obtained from MCMC chains of a simulated data analysis of $M_1$ corresponding to scenario 1. Here $r$ denotes the correlation coefficient and is computed by using the MCMC chains of the respective parameters.}
\label{fig.scatplotsc1m1.BMSE}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=470pt,height=470pt]{Scatter_Plots_scenario32_M1.eps} \caption{Scatter plot of the parameters obtained from MCMC chains of a simulated data analysis of $M_1$ corresponding to scenario 2. Here $r$ denotes the correlation coefficient and is computed by using the MCMC chains of the respective parameters.}
\label{fig.scatplotsc2m1.BMSE}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=470pt,height=470pt]{Scatter_Plots_scenario37_M1.eps} \caption{Scatter plot of the parameters obtained from MCMC chains of a simulated data analysis of $M_1$ corresponding to scenario 3. Here $r$ denotes the correlation coefficient and is computed by using the MCMC chains of the respective parameters.}
\label{fig.scatplotsc3m1.BMSE}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=470pt,height=470pt]{Scatter_Plots_scenario4_M1.eps} \caption{Scatter plot of the parameters obtained from MCMC chains of a simulated data analysis of $M_1$ corresponding to scenario 7. Here $r$ denotes the correlation coefficient and is computed by using the MCMC chains of the respective parameters.}
\label{fig.scatplotsc7m1.BMSE}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=470pt,height=470pt]{Scatter_Plots_scenario34_M1.eps} \caption{Scatter plot of the parameters obtained from MCMC chains of a simulated data analysis of $M_1$ corresponding to scenario 9. Here $r$ denotes the correlation coefficient and is computed by using the MCMC chains of the respective parameters.}
\label{fig.scatplotsc9m1.BMSE}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=470pt,height=470pt]{Scatter_Plots_scenario69_M1.eps} \caption{Scatter plot of the parameters obtained from MCMC chains of a simulated data analysis of $M_1$ corresponding to scenario 12. Here $r$ denotes the correlation coefficient and is computed by using the MCMC chains of the respective parameters.}
\label{fig.scatplotsc12m1.BMSE}
\end{figure}
\pagebreak
\bibliographystyle{apalike}
| {'timestamp': '2018-10-08T02:01:32', 'yymm': '1810', 'arxiv_id': '1810.02397', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02397'} | arxiv |
\section{Proofs for Section~\ref{sec:scaling}}
\label{sec:scaling_proofs}
\begin{lemma} \label{lemma:init_scaling}
Let $\mm$ be an M-matrix, and consider $\mm_\alpha = \mm + \alpha \eye$ with $\alpha = 2\max\{\|\mm\|_\infty, \|\mm\|_1 \}$. If $\vl = \vr = \frac{1}{\alpha} \vones$, we have for every $i$
\[
(\mm_\alpha \vr)_i \in \left[\frac{1}{2}, \frac{3}{2}\right] \quad \text{and} \quad (\mm_\alpha^\top \vl)_i \in \left[\frac{1}{2}, \frac{3}{2}\right].
\]
\end{lemma}
\begin{proof}
We see that $\mm \vr = \vones + \frac{1}{\alpha} \mm \vones$. Now, since $\|\mm \vones\|_\infty \leq \frac{\alpha}{2}$, we have for any $i$ that $(\mm \vones)_i \in [-\frac{\alpha}{2}, \frac{\alpha}{2}]$ and thus $(\mm \vr)_i = \vones_i + \frac{1}{\alpha} (\mm \vones)_i \in [1 - \frac{1}{2}, 1 + \frac{1}{2}] = [\frac{1}{2}, \frac{3}{2}]$. The proof for $\vl$ is similar.
\end{proof}
\begin{lemma} \label{lemma:smallest_scaling}
Let $\mm = \eye - \ma$ be an M-matrix. Let $\alpha \geq 0$ be a parameter, and let $\vw$ be a vector where $\vw_i \in [\frac{1}{2}, \frac{3}{2}]$ for every $i$. Consider the vectors $\vr = (\mm + \alpha \eye)^{-1} \vw$ and $\vl = (\mm + \alpha \eye)^{-\top} \vw$. Then for every $i$ we have $\vr_i \geq \frac{1}{2(1+\alpha)}$ and $\vl_i \geq \frac{1}{2(1+\alpha)}$
\end{lemma}
\begin{proof}
By the definition of $\vr$, we have $\frac{1}{2} \leq \vw_i = ((\mm + \alpha \eye) \vr)_i = \sum_j ((1+\alpha)\eye + \ma)_{ij} \vr_j = (1+\alpha) \vr_i - \sum_j \ma_{ij} \vr_j$. Note that by Lemma \ref{lemma:MMatrix_monotone} $\vr$ is a positive vector and that $\ma$ is a nonnegative matrix. Thus $\sum_j \ma_{ij} \vr_j \geq 0$, and we conclude that $\frac{1}{2} \leq (1+\alpha) \vr_i$: this implies the result. An identical proof gives the result for $\vl$ as well.
\end{proof}
\begin{lemma} \label{lemma:scaling_infnorms}
Let $\mm = \eye - \ma$ be an M-matrix. Let $\alpha \geq 0$, and let $\mm_\alpha = \mm + \alpha \eye$. Let $\vl_\alpha$ and $\vr_\alpha$ be vectors where $(\mm_\alpha^\top \vl_\alpha)_j \in [\frac{1}{2}, \frac{3}{2}]$ and $(\mm_\alpha \vr_\alpha)_j \in [\frac{1}{2}, \frac{3}{2}]$ for all $j$. Then
\begin{enumerate}[label=\textbf{\roman*})]
\item $\|\mr_\alpha\|_\infty \leq \frac{3}{2 (1+ \alpha)} \|\mm^{-1}\|_\infty$
\item $\|\ml_\alpha\|_\infty \leq \frac{3}{2 (1+ \alpha)} \|\mm^{-1}\|_1$
\end{enumerate}
\end{lemma}
\begin{proof}
Define $w = \mm_\alpha \vr_\alpha$. Note that by definition $w(i) \in [\frac{1}{2}, \frac{3}{2}]$ for every $i$. Since $\frac{3}{2} \vones - w \geq \vzero$, we conclude that $\mm_\alpha^{-1} (\frac{3}{2} \vones - w) = \frac{3}{2}\mm_\alpha^{-1} \vones - \vr_\alpha \geq \vzero$ and hence $\|\vr_\alpha\|_\infty \leq \frac{3}{2} \|\mm_\alpha^{-1} \vones\|_\infty$. As $\mm_\alpha = (1 + \alpha) \eye - \ma$ and $\rho(\ma) < 1$, we see
\[
\|\mm_\alpha^{-1} \vones\|_\infty = \frac{1}{1+\alpha} \|\sum_{i=0}^\infty \Big(\frac{\ma}{1+\alpha}\Big)^i \vones\|_\infty \leq \frac{1}{1+\alpha} \|\sum_{i=0}^\infty \Big(\frac{\ma}{1+\alpha}\Big)^i\|_\infty.
\]
Now, observe that snce $\ma$ is a nonnegative matrix, $\ma^i$ is nonnegative for every nonnegative integer $i$. Thus, $\sum_{i=0}^\infty \Big(\frac{\ma}{1+\alpha}\Big)^i$ is a nonnegative matrix. By Lemma \ref{lemma:pos_infnorm}, we see that
\[
\|\mm_\alpha^{-1} \vones\|_\infty \leq \frac{1}{1+\alpha} \|\sum_{i=0}^\infty \Big(\frac{\ma}{1+\alpha}\Big)^i\|_\infty = \frac{1}{1+\alpha} \max_j (\sum_{i=0}^\infty \Big(\frac{\ma}{1+\alpha}\Big)^i \vones)_j.
\]
Now as $\frac{1}{1+\alpha} \leq 1$ and $\ma^i$ is nonnegative, replacing the $\alpha$ in the above with $\epsilon$ can only increase every entry of the sum and therefore can only increase our bound. Thus
\[
\|\mm_\alpha^{-1} \vones\|_\infty \leq \frac{1}{1+\alpha} \max_j (\sum_{i=0}^\infty \Big(\frac{\ma}{1+\epsilon}\Big)^i \vones)_j = \frac{1}{1+\alpha} \|\sum_{i=0}^\infty \ma^i \|_\infty = \frac{1}{1+\alpha} \|\mm^{-1}\|_\infty
\]
where we again used Lemma \ref{lemma:pos_infnorm}. Combining the pieces we obtain
\[
\|\mr_\alpha\|_\infty = \|\vr_\alpha\|_\infty \leq \frac{3}{2} \|\mm_\alpha^{-1} \vones\|_\infty \leq \frac{3}{2 (1+\alpha)} \|\mm^{-1}\|_\infty.
\]
Essentially the same argument gives $\textbf{ii)}$ as well.
\end{proof}
\begin{lemma} \label{lemma:scaling_condition}
Let $\mm = \eye - \ma$ be an M-matrix. Let $\alpha \geq 0$ and $\mm_\alpha = \mm + \alpha \eye$. Let $\vl_\alpha$ and $\vr_\alpha$ be vectors where $(\mm_\alpha^\top \vl_\alpha)_j \in [\frac{1}{2}, \frac{3}{2}]$ and $(\mm_\alpha \vr_\alpha)_j \in [\frac{1}{2}, \frac{3}{2}]$ for all $j$. Define $\ms_\alpha = \ml_\alpha \mm_\alpha \mr_\alpha$. Then
\begin{enumerate}[label=\textbf{\roman*})]
\item $\kappa(\mr_\alpha) \leq 3 \|\mm^{-1}\|_\infty$
\item $\kappa(\ml_\alpha) \leq 3 \|\mm^{-1}\|_1$
\item $\kappa(\ms_\alpha) \leq 18 \|\mm^{-1}\|_\infty \|\mm^{-1}\|_1$
\item $\kappa(\ml_0 \mr_0^{-1}) \leq 9 \|\mm^{-1}\|_\infty \|\mm^{-1}\|_1$
\end{enumerate}
\end{lemma}
\begin{proof}
We again prove the claims in order. We start with \textbf{i)}. We observe that $\|\mr_\alpha\|_\infty \leq \frac{3}{2(1+\alpha)} \|\mm^{-1}\|_\infty$ by Lemma \ref{lemma:scaling_infnorms} and that $\|\mr_\alpha^{-1}\|_\infty \leq 2(1+\alpha)$ by Lemma \ref{lemma:smallest_scaling}. Combining these two implies the result. A similar proof gives \textbf{ii)} as well.
We now move to \textbf{iii)}. Note that $\kappa(\ms_\alpha) = \|\ms_\alpha\|_2 \|\ms_\alpha^{-1}\|_2.$. We will bound these two norms separately. Starting with $\|\ms_\alpha\|_2$, we observe by Lemma \ref{lemma:MMatrix_RCDD} that $\ms_\alpha$ is an RCDD matrix. Thus, for any $i$ we observe
\[
\sum_j |(\ms_\alpha)_{ij}| = (\ms_\alpha)_{ii} + \sum_{j\neq i} |(\ms_\alpha)_{ij}| \leq 2 (\ms_\alpha)_{ii} = 2 (1 + \alpha) (\vr_\alpha)_i (\vl_\alpha)_i \leq 2 (1+\alpha) \|\mr_\alpha\|_\infty \|\ml_\alpha\|_\infty.
\]
and
\[
\sum_j |(\ms_\alpha)_{ji}| = (\ms_\alpha)_{ii} + \sum_{j\neq i} |(\ms_\alpha)_{ji}| \leq 2 (\ms_\alpha)_{ii} = 2 (1 + \alpha) (\vr_\alpha)_i (\vl_\alpha)_i \leq 2 (1+\alpha) \|\mr_\alpha\|_\infty \|\ml_\alpha\|_\infty.
\]
Thus both $\|\ms_\alpha\|_\infty$ and $\|\ms_\alpha\|_1$ are at most $2 (1+\alpha) \|\mr_\alpha\|_\infty \|\ml_\alpha\|_\infty$. As $\|\mb\|_2^2 \leq \|\mb\|_1 \|\mb\|_\infty$ for any matrix $\mb$, we see that $\|\ms_\alpha\|_2 \leq 2 (1+\alpha) \|\mr_\alpha\|_\infty \|\ml_\alpha\|_\infty$ as well. By applying Lemma \ref{lemma:scaling_infnorms} to this, we obtain
\[
\|\ms_\alpha\|_2 \leq \frac{9(1+\alpha) \|\mm^{-1}\|_\infty \|\mm^{-1}\|_1}{2(1+\alpha)^2}.
\]
For $\|\ms_\alpha^{-1}\|_2$, we use a result of \cite{Varah}: if $\beta = \min_k (\ms_\alpha)_{kk} - \sum_{j \neq k} |(\ms_\alpha)_{jk}|$ and $\gamma = \min_k (\ms_\alpha)_{kk} - \sum_{j \neq k} |(\ms_\alpha)_{kj}|$, then $\|\ms_\alpha^{-1}\|_2 \leq \frac{1}{\sqrt{\beta \gamma}}$. As $\ms_\alpha$ has a nonnegative off-diagonal, we see that
\[
\beta = \min_k (\ms_\alpha)_{kk} - \sum_{j \neq k} |(\ms_\alpha)_{jk}| = \min_k (\ms_\alpha \vones)_k \geq \min_i (\vl_\alpha)_i \min_k (\mm_\alpha \vr_\alpha)_k
\]
and likewise
\[
\gamma = \min_k (\ms_\alpha^\top \vones)_k \geq \min_i (\vr_\alpha)_i \min_k (\mm_\alpha^\top \vl_\alpha)_k.
\]
As $(\mm_\alpha^\top \vl_\alpha)_j \in [\frac{1}{2}, \frac{3}{2}]$ and $(\mm_\alpha \vr_\alpha)_j \in [\frac{1}{2}, \frac{3}{2}]$ for all $j$, we obtain $\beta \geq \frac{1}{2} \min_i (\vl_\alpha)_i$ and $\gamma \geq \frac{1}{2} \min_i (\vr_\alpha)_i$. We have by Lemma \ref{lemma:smallest_scaling} that both $\min_i (\vr_\alpha)_i$ and $\min_i (\vl_\alpha)_i$ are at least $\frac{1}{2(1 + \alpha)}$. Thus combining these we see that $\|\ms_\alpha^{-1}\|_2 \leq 4 (1+\alpha)$. Putting this together with the previous bound on $\|\ms_\alpha\|_2$ we obtain
\[
\kappa(\ms_\alpha) \leq \frac{36(1+\alpha)^2 \|\mm^{-1}\|_\infty \|\mm^{-1}\|_1}{2 (1+\alpha)^2} = 18 \|\mm^{-1}\|_\infty \|\mm^{-1}\|_1.
\]
Finally, $\textbf{iv)}$ follows from $\kappa(\ml_0 \mr_0^{-1}) \leq \kappa(\ml_0) \kappa(\mr_0)$ and $\textbf{i)}$ and $\textbf{ii)}$.
\end{proof}
\begin{lemma} \label{lemma:mmatrix_to_eigenvector}
Let $\ma$ be a nonnegative matrix with $\rho(\ma) < 1$, and let $\mm = \eye - \ma$. Let $\epsilon > 0$ be a parameter and define $\mm_\epsilon = \mm + \epsilon \eye$. Let $\eigl$ and $\eigr$ represent the top left and right eigenvectors of $\ma$ respectively. Then $\|\mm_\epsilon^{-1}\|_\infty \leq \frac{1}{\epsilon} \kappa(\eigr)$ and $\|\mm_\epsilon^{-1}\|_1 \leq \frac{1}{\epsilon} \kappa(\eigl)$.
\end{lemma}
\begin{proof}
By Lemma \ref{lemma:eigvec_scaling}, we know that $\|\mv_r^{-1} \ma \mv_r\|_\infty = \rho(\ma) < 1.$ With this in mind, we define $\mb = \mv_r^{-1} \ma \mv_r$ and write
\begin{align*}
\|\mm_\epsilon^{-1}\|_\infty &= \|((1+\epsilon) \eye - \ma)^{-1}\|_\infty = \frac{1}{1+\epsilon} \| \sum_{i=0}^\infty \Big(\frac{\ma}{1+\epsilon}\Big)^i \|_\infty \\
&= \frac{1}{1+\epsilon} \| \sum_{i=0}^\infty \Big(\frac{\mv_r \mb \mv_r^{-1}}{1+\epsilon}\Big)^i \|_\infty = \frac{1}{1+\epsilon} \| \sum_{i=0}^\infty \mv_r \Big(\frac{\mb}{1+\epsilon}\Big)^i \mv_r^{-1} \|_\infty\\
&\leq \frac{1}{1+\epsilon} \|\mv_r\|_\infty \|\mv_r^{-1}\|_\infty \| \sum_{i=0}^\infty \Big(\frac{\mb}{1+\epsilon}\Big)^i \|_\infty.
\end{align*}
Now, $\|\mv_r\|_\infty \|\mv_r^{-1}\|_\infty = \kappa(\eigr)$. Further, we have $\|\mb^i\|_\infty \leq \|\mb\|_\infty^i < 1.$ Thus, by triangle inequality we obtain
\[
\|\mm_\epsilon^{-1}\|_\infty \leq \frac{\kappa(\eigr)}{1+\epsilon} \| \sum_{i=0}^\infty \Big(\frac{\mb}{1+\epsilon}\Big)^i \|_\infty \leq \frac{\kappa(\eigr)}{1+\epsilon} \sum_{i=0}^\infty \frac{\|\mb^i\|}{(1+\epsilon)^i} < \frac{1}{1+\epsilon} \kappa(\eigr) \sum_{i=0}^\infty \frac{1}{(1+\epsilon)^i} = \frac{\kappa(\eigr)}{\epsilon}
\]
as desired. An equivalent proof gives the result with $\eigl$.
\end{proof}
\input{symm-solver}
\input{factor-width2-appendix}
\section{Applications}
\label{sec:applications}
In this section, we present a variety of problems in which M-matrices appear and show how our methods can be applied to them.
Matrices with non-positive off diagonals and non-negative diagonals (known as $Z$-matrices) appear in many applications like finite difference methods for partial differential equations, input-output productions and growth models in economics, linear complementarity problems in operations research, Markov processes in probability and statistics, and social networks analysis \cite{cottle2008linear,berman1994nonnegative,murty1988linear,ten2010input}.
In many of these problems, if the underlying $Z$-matrix is actually an M-matrix, we will have additional interesting and meaningful structural properties. For example, in the Katz centrality problem (covered in Section~\ref{sec:katz}) the centrality measure is only valid if the corresponding matrix is an M-matrix.
In the following subsections, we provide faster algorithms for some well-known applications which involve M-matrices. We start with examples like
computing Katz Centrality, and solving Leontief Equations in which our results can be applied directly. Then, in Section~\ref{sec:singular} we show how to compute the top singular value and its corresponding singular vectors of a non-negative matrix in nearly linear time. In Section~\ref{sec:graph-kernels}, we show another application of our method in computing random-walk based graph kernels. These kernels are used in a variety of fields like biology, social networks, and natural language processing to compare the structure of two graphs \cite{kash2003, kash2004, vish2010}.
\subsection{Leontief Equations}
\input{leontief}
\subsection{Katz Centrality}\label{sec:katz}
\input{katz-centrality}
\subsection{Left and Right Top Singular Vectors}\label{sec:singular}
\input{singular-value}
\subsection{Graph Kernels}\label{sec:graph-kernels}
\input{graph-kernel}
\section{M-matrix Facts}
\label{sec:mmatrix_facts}
Here we provide several facts about M-matrices that we use extensively throughout the paper. For a good survey on M-matrices refer to \cite{berman1994nonnegative}.
\begin{lemma} \label{lemma:MMatrix_monotone} For non-negative $\ma \in \R^\nn_{\geq 0}$ the matrix $\mm = \mI - \ma$ is an M-matrix if and only if
\begin{enumerate}[label=\textbf{\roman*})]
\item for any vector $x$ satisfying $\mm x > 0$ entrywise we have $x > 0$.
\item for any vector $y$ satisfying $\mm^\top y > 0$ entrywise we have $y > 0$.
\end{enumerate}
\end{lemma}
\MMatrixRCDD*
\begin{proof}
We begin with the first statement. Recall by definitions that $\ms$ is RCDD if for every $i$,
\[
\ms_{ii} \geq \sum_{j \neq i} |\ms_{ij}| \hspace{3mm} \text{and} \hspace{3mm} \ms_{ii} \geq \sum_{j \neq i} |\ms_{ji}|.
\]
Note that by Lemma \ref{lemma:MMatrix_monotone}, we have $y > \vzero$ and $x > \vzero$. Thus, since $\ms_{ij} = x_i \mm_{ij} y_j$ $\ms_{ij}$ has the same sign as $\mm_{ij}$ for all $i, j$. As $\mm_{ii} > 0$ for all $i$ and $\mm_{ij} \leq 0$ for $i \neq j$, we see that $\ms$ is RCDD if
\[
\ms_{ii} + \sum_{j \neq i} \ms_{ij} \geq 0 \hspace{3mm} \text{and} \hspace{3mm} \ms_{ii} + \sum_{j \neq i} \ms_{ji} \geq 0,
\]
or in other words if $\ms \vones \geq \vzero$ and $\ms^\top \vones \geq \vzero$. Now, observe for every $i$, $(\ms \vones)_i = (\mx\mm\my \vones)_i = (\mx\mm y)_i = x_i (\mm y)_i > \vzero$ and $(\ms^\top \vones)_i = (\my \mm^\top \mx \vones)_i = (\my \mm^\top x)_i = y_i (\mm^\top x)_i > \vzero$ by definition of $x$ and $y$. Thus $\ms$ is RCDD.
We now analyze the second statement. As $x$ and $y$ are positive vectors, we again observe that $\ms_{ij}$ is has the same sign that $\mm_{ij}$ does by the same argument as in the previous claim. Now, observe that since $\ms$ is RCDD and has nonpositive off diagonal,$\ms$ being RCDD is equivalent to the claims that $\ms \vones = \mx \mm y> \vzero$ and $\ms^\top \vones = \my \mm^\top x > \vzero$. As $x$ and $y$ are positive, these in turn are equivalent to $\mm y > \vzero$ and $\mm^\top x > \vzero$.. By the Perron-Frobenius theorem, we know that there exists a positive vector $\vv$ where $\ma \vv = \rho(\ma) \vv$. As $\vv > 0$, we have for any vector $\va > 0$ that $\va^\top \vv > 0$ and so
\[
0 = \vzero^\top \vv < \vv^\top \mm^\top x = s \vv^\top \vx - (\ma \vv)^\top \vx = (s -\rho(\ma)) \vv^\top \vx.
\]
Thus $s - \rho(\ma) > 0$: this implies $\rho(\ma) < s$ and $\mm$ is an M-matrix.
\end{proof}
\pdscaling*
\begin{proof}
We note that by construction
\begin{align*}
\md^{-1/2} \mm^\top \md^{1/2} + \md^{1/2} \mm \md^{-1/2} &= \md^{-1/2} (\mm^\top \md + \md \mm )\md^{-1/2} \\
&= \md^{-1/2} (\mm^\top \ml \mr^{-1} + \mr^{-1} \ml \mm )\md^{-1/2} \\
&= \md^{-1/2} \mr^{-1} (\mr \mm^\top \ml + \ml \mm \mr) \mr^{-1} \md^{-1/2}.
\end{align*}
Now note that $\ms = \ml \mm \mr$ is RCDD by assumption. By the previous calculation, we see that our goal is equivalent to proving that $\ms + \ms^\top$ is positive definite. But now $\ms + \ms^\top$ is a symmetric diagonally dominant matrix: it clearly has nonpositive off diagonal, and $\ms + \ms^\top \geq \vzero$ since $\ms$ is RCDD. The fact that $\ms + \ms^\top$ is positive definite follows by the Gershgorin disk theorem.
\end{proof}
\begin{lemma} \label{lemma:pos_infnorm}
Let $\mb$ be a nonnegative-entried matrix. Then $\|\mb\|_\infty = \max_i (\mb \vones)_i$.
\end{lemma}
\begin{proof}
Observe that $\|\mb\|_\infty = \max_i \sum_{j} |\mb_{ij}| = \max_i \sum_{j} \mb_{ij}$ since $\mb$ is nonnegative. Now $\sum_{j} \mb_{ij} = (\mb \vones)_i$, and the result follows.
\end{proof}
\begin{lemma} \label{lemma:eigvec_scaling}
Let $\ma$ be an irreducible nonnegative matrix. Let $\eigr$ and $\eigl$ be the top right and left eigenvectors of $\ma$ respectively. Then $\|\mv_r^{-1} \ma \mv_r\|_\infty = \rho(\ma)$ and $\|\mv_l^{-1} \ma^\top \mv_l\|_\infty = \rho(\ma)$.
\end{lemma}
\begin{proof}
We prove the result for $\eigr$: the proof for $\eigl$ is essentially identical. Note that by the Perron-Frobenius theorem $\eigr$ is a positive vector. Thus, we can see that $\mb = \mv_r^{-1} \ma \mv_r$ is itself a nonnegative matrix. By Lemma \ref{lemma:pos_infnorm}, we have
\[
\|\mb\|_\infty = \max_i \, (\mb \vones)_i = \max_i \, (\mv_r^{-1} \ma \eigr)_i = \rho(\ma) \max_i \, (\mv_r^{-1} \eigr)_i = \rho(\ma) \max_i \, \vones_i = \rho(\ma).
\]
\end{proof}
\section{Factor Width 2 Matrices}
\label{sec:factor2}
Here we discuss how to use an algorithm for solving linear systems in symmetric M-matrices to solve linear systems in factor width 2 matrices. The idea behind this reduction is simple. We will show that if $\mm$ is a factor width 2 matrix and $\mm'$ is a matrix where the sign of every off-diagonal entry is made negative, i.e. $\mm'_{ij} = - |\mm_{ij}|$ for all $i \neq j$ and $\mm'_{ii} = \mm_{ii}$, then $\mm'$ is an M-matrix. Consequently, as we saw in Section~\ref{sec:symmscaling}, this implies that there is a diagonal matrix, $\mv$, with positive diagonal entries such that $\mv \mm' \mv$ is symmetric diagonally dominant. This immediately implies that $\mv \mm \mv$ is symmetric diagonally dominant as well. Consequently, we can solve linear systems in $\mm$ simply by computing $\mv$ as in Section~\ref{sec:symmscaling} and then solving $\mv \mm' \mv$ using a SDD solver (note that we can apply the same trick for asymmetric matrices and RCDD solvers).
In the remainder of this section we formally show that $\mm'$ is an M-matrix. We break this into two lemmas about M-matrices and factor width two matrices. This result and the lemma we use to prove it are fairly well known and we encourage the reader to view \cite{DaitchS09} for further context. Here we provide a short self-contained proof for completeness.
\begin{lemma}[Characterization of M-Matrices]
\label{lem:m-char} All symmetric PSD Z-matrices are M-matrices.
\end{lemma}
\begin{proof}
Let $\mm$ be an arbitrary symmetric PSD Z-matrix. Since $\mm$ is a symmetric Z-matrix we can write it as $\mm = \md - \mm'$ where $\md$ is a diagonal matrix with $\md_{ii} = \mm_{ii}$ and $\mm'$ is a non-negative diagonal matrix. Since $\mm$ is PSD we know that $\md$ is non-negative.
Let $s = \max_{i} \md_{ii}$ and $\ma = s \mI - \md + \mm'$. Clearly, $\mm = s \mI - \ma$ and $\ma$ is symmetric and entry-wise non-negative by our choice of $s$. Thus to show that $\mm$ is an M-matrix it simply remains to show that $\rho(\ma) \leq s$. However, for any vector $\vx$ if $\vy$ is a vector with $y_i = |x_i|$ non-negativity of $\mm$ implies
\[
\frac{| \vx^\top \ma \vx |}{\vx^\top \vx}
\leq \frac{\vy ^\top \ma \vy}{\vx^\top \vx}
= \frac{\vy^\top \ma \vy}{\vy^\top \vy}
\]
and consequently,
\begin{align*}
\rho(\ma) &= \max_{\vx \neq 0} \frac{| \vx^\top \ma \vx|}{\vx^\top \vx}
\leq \max_{\vx \neq 0} \frac{\vx^\top \ma \vx}{\vx^\top \vx}
= \max_{\vx \neq 0} \frac{\vx^\top (s \mI - \md + \mm') \vx}{\vx^\top \vx}
= \max_{\vx \neq 0} \left[ s -
\frac{\vx^\top \mm \vx}{\vx^\top \vx}
\right]
\leq s
\end{align*}
where in the last step we used that $\mm$ is PSD by assumption.
\end{proof}
\begin{lemma}[Factor Width 2 Matrices Induce M-Matrices]
If $\mm$ is a factor width 2 matrix and $\mm'$ satisfies $\mm'_{ij} = - |\mm_{ij}|$ for all $i \neq j$ and $\mm'_{ii} = \mm_{ii}$ for all $i$ then $\mm'$ is an M-matrix.
\end{lemma}
\begin{proof}
Since $\mm$ is factor width 2 we have that $\mm = \mb^\top \mb$ where each row of $\mb$ has at most 2 nonzero entries. Now, suppose we let $\mb'$ be the same matrix as $\mb$ except with the signs of the entries changed so that no row contains 2 positive or 2 negative entries. Note that $\mm'' = (\mb')^\top (\mb')$ has the same diagonal entries as $\mm$ however we have that for all $i \neq j$ it is the case that $[\mm'']_{ij} \leq - |\mm_{ij}|$. Consequently, $\mm''$ is a symmetric Z-matrix and clearly PSD (since we explicitly have its factorization). By Lemma~\ref{lem:m-char} this implies that $\mm''$ is an M-matrix. Furthermore, since its off-diagonal entries are larger in magnitude then those of $\mm'$ and its diagonal entries are the same from the definition of an M-matrix this implies that $\mm'$ is an M-matrix as desired. This follows from the fact that if $\mn \geq \ma \geq 0$ entrywise then $\rho(\mn) \geq \rho(\ma)$.
\end{proof}
\section{Introduction}
\input{meta_intro}
\subsection{M-Matrices, Positive Matrix Sums, and Perron Vectors}
\label{sub:intro_tech_motiv}
Our results leverage a tight connection between invertible M-matrices, matrix series, random walks, Perron vectors, and RCDD matrices. Here we elaborate on this connection to motivate previous work on these problems and our approach to solving them.
To demonstrate this connection, first observe that a matrix $\mm \in \R^{n \times n}$ is an invertible M-matrix if and only if it is of the form $\mm = s \mI - \mb$ where $\rho(\mb) < s$. In this case it is easy to see that
\[
(s \mI - \mb)^{-1} = \frac{1}{s} \left(\mI - \frac{1}{s} \mb\right)^{-1}
= \frac{1}{s} \sum_{i = 0}^{\infty} \left(\frac{1}{s} \mb\right)^{i} ~.
\]
Consequently, the question of testing whether a matrix is an M-matrix and solving linear systems in it is closely related to the following problems:
\begin{definition}[M-Matrix Problem]
Given matrix $\mm$ and a vector $\vb$ either solve the linear system $\mm \vx = \vb$ or prove that $\mm$ is not an M-matrix.
\end{definition}
\begin{definition}[Geometric Non-negative Matrix Series Problem]
Given a non-negative matrix $\mb \in \R^{n \times n}_{\geq 0}$ and a vector $b$ compute $\sum_{i = 0}^{\infty} \mb^i b$ or prove it diverges.
\end{definition}
\begin{definition}[Perron Vector Problem] \label{def:perron}
Given a non-negative matrix $\mb \in \R^{n \times n}_{\geq 0}$ computes $\rho(\mb)$, its largest eigenvector, and a Perron vector, $\vv_r \in \R^{n}_{\geq 0}$ such that $\mb \vv_r = \rho(\mb) \vv_r$.
\end{definition}
We provide the first nearly linear time algorithms for the above three problems. This is done by leveraging a somewhat classic fact that Perron vector problem is also intimately connected to the M-matrix problem. If $\mb \in \R^{n \times n}$ is a non-negative matrix then,
\[
\lim_{s \rightarrow \rho(\mb)^+} (s \mI- \mb)^{-1} \vones
=
\lim_{s \rightarrow \rho(\mb)^+} \frac{1}{s} \sum_{i = 0}^{\infty} \left(\frac{1}{s} \mb \right)^{i} \vones
= \vv_r
\]
where $\lim_{s \rightarrow \rho(\mb)^+}$ is the limit of $s$ approach $\rho(\mb)$ from above and $\vv_r$ is a non-negative Perron vector of $\mb$. Consequently, given a solution of the M-matrix problem we can obtain arbitrary good approximations to the Perron vector problem.
Second, (and perhaps more surprising), recent work on solving RCDD systems \cite{coh16, coh17} implies that solutions to the Perron vector problem lead to nearly linear time algorithms for the M-Matrix Problem. Suppose we have an invertible M-matrix with $\mm = \mI - \mb$ and we have computed positive left and right Perron vectors $\vl \in \R^{n}_{> 0}$ and $\vr \in \R^{n}_{> 0}$ respectively, then it is easy to see (See Section~\ref{sec:overview}) that $\mv_l \mm \mv_r$ is RCDD, where $\mv_l$ and $\mv_r$ are the diagonal matrices associated with $\vv_l$ and $\vv_r$ respectively. Consequently, given Perron vectors and RCDD solvers we can solve M-matrices.
These two results together provide chicken and egg problem for solving M-matrices. We can solve M-matrices with Perron vectors and compute Perron vectors with M-matrix solvers, however it is unclear how to achieve either individually. While there have been previous results for escaping this conundrum to provide solvers for special cases of M-matrices, they are only applicable in settings where we were able to certify that the input matrix was an M-matrix in nearly linear time. A key result of this paper is that a variant of shift-and-invert preconditioning carefully analyzed leveraging properties of M-matrices lets us efficiently escape this problem and obtain nearly linear time algorithms.
\subsection{Previous Work}
\label{sub:previous_work}
Here we briefly review previous work on solving M-matrices and computing Perron vectors. These problems have been studied extensively and there are too many results to list. Here we briefly survey various areas of research relevant to our theoretical improvements. For a more comprehensive treatment of these problems see \cite{golub2001eigenvalue}. Previous work on the additional applications of these results are deferred to Section~\ref{sec:applications}.
Each of the problems described in Section~\ref{sub:intro_tech_motiv} can easily be solved using an algorithm for solving square linear systems. Moreover, given a matrix $\ma \in \R^{n \times n}$ and a vector $\vb \in \R^n$, it is well-known that a linear system $\ma \vx = \vb$ can be solved in $O(n^\omega)$, where $\omega < 2.373$ \cite{Williams12}, or can be solved in $O(m n)$ where $m = \nnz(\ma)$ is the number of nonzero entries of $\ma$.\footnote{Note that conjugate gradient achieves $O(m n)$ time only using exact arithmetic. It is open how to achieve a comparable running time where arithmetic operations can only be performed on numbers with a polylogarithmic number of bits. See \cite{muscoms17} for further discussion.} However, in both theory and practice $\ma$ is often sparse, e.g. $\nnz(\ma) = O(n)$, in which case these algorithms run in quadratic, i.e. $\Omega(n^2)$ time, which may be prohibitively expensive for many purposes.
To improve upon the performance of these generic linear system solvers a wide array of iterative methods and practical heuristics have been proposed. However, even in the special case of computing the stationary distribution of Markov chains, until the work of \cite{coh16, coh17}, the previously best known running times either only applied in special cases or depended polynomially on the desired accuracy or conditioning of the problem.
Recently, in an important special case of the problems considered in Section~\ref{sub:intro_tech_motiv}, namely computing the \emph{stationary distribution}, and solving \emph{directed Laplacians} (i.e. $\mm = \mI - \mb$ for these $\mb$) it was shown how to solve these problems in nearly linear time \cite{coh17}. This result was achieved by a result in \cite{coh17} showing that RCDD matrices can be solved in nearly linear time and a result in \cite{coh16}, reducing each problem to solving RCDD systems with only polylogarithmic overhead.
These works created hope for achieving the results of this paper, e.g. by extending the reduction in \cite{coh16}, however there are significant issues to this approach. First, the analysis in \cite{coh16} leveraged that it is easy to certify that a matrix is a directed Laplacian. The method incrementally computed the associated stationary distribution for this matrix using that a directed Laplacian has a kernel. However, as discussed even certifying that a matrix is an M-matrix involves computing the spectral radius of a non-negative matrix, for which there were no previously known nearly linear time algorithm. Second, the reduction in \cite{coh16} was not known to be an instance of any previously studied iterative framework and therefore it is difficult to adapt it to new cases.
The only other work directly relevant to the problems we consider was the exciting work of \cite{DaitchS09} showing that symmetric M-matrices and more broadly factor-width 2 matrices could be solved in nearly linear time, provided an explicit factorization is given, i.e. for the input matrix $\mm$ there was a known $\mc$ with at most $2$ non-zero entries per row such that $\mc^\top \mc = \mm$. Note that all symmetric M-matrices are factor-width $2$, and though \cite{DaitchS09} provided a nearly linear time algorithm which given $\mc$ could reduce solving M to solving symmetric diagonally dominant (SDD) matrices, i.e. symmetric RCDD matrices, our result is the first to actual compute this factorization in nearly linear time when it is not given.
\subsection{Overview of Approach}
\label{sub:approach}
We achieve the results of our paper by leveraging the RCDD solvers of \cite{coh17}. As discussed in Section~\ref{sub:intro_tech_motiv} this would suffice to solve M-matrices in nearly linear time provided we could computed Perron vectors in nearly linear time. However, as discussed in Section~\ref{sub:previous_work} there are barriers to applying the previous methods of \cite{coh16, DaitchS09} for computing Perron vectors in our more general setting.
To overcome this difficulty, we provide a new reduction from solving M-matrices to solving RCDD systems, that can serve as an alternative for the reductions in both \cite{coh16} and \cite{DaitchS09}.
Our method is loosely related to a method known as \emph{shift-and-invert preconditioning} for computing eigenvectors of matrices \cite{saad1992numerical, GarberHJKMNS16}. The crux of this method is that if a matrix $\ma$ has top eigenvalue $\lambda > 0$ with top eigenvector $\vv$, then the matrix $(c \mI - \ma)^{-1}$ for $c > \lambda$ also has top eigenvector $\vv$ with eigenvalue $1/(c - \lambda)$. Consequently, by performing power method on $(c \mI - \ma)^{-1}$, i.e. solving linear systems in $c \mI- \ma$ we can compute a top eigenvector of $\ma$. Shift-and-invert precondition does precisely this, leveraging that power method may converge faster for this matrix as bringing $c$ towards $\lambda$ may accentuate the gap between $\lambda$ and the next smallest eigenvector.
Now, as we have discussed computing the left and right Perron vectors for $\mb$ suffices to solve linear systems in the M-matrix $s \mI - \mb$. Furthermore, similar to shift-and-invert we know that if $s \rightarrow \rho(\mb)^+$ solving linear systems in this matrix would suffice to compute the left and right Perron vectors.
Our method works by considering the matrices $\mm_\alpha \defeq \mm + \alpha \mI = (s + \alpha) \mI - \mb$ for $\alpha > 0$. By an very minor strengthening of a not as well known fact about M-matrices, it can be shown that actually just solving two linear system in $\mm_\alpha$ suffice to get left and right scalings to make it RCDD. Consequently, if we have a solver for any $\mm_\alpha$ we can get the scalings for $\mm_\alpha$ and have a new solver for that matrix.
Now, we can always pick $\alpha$ so large that $\mm_{\alpha}$ is RCDD and therefore we can compute its scalings. However, this argument does not yet suffice to get a scaling for any other $\mm_{\alpha}$. To circumvent this we show that in fact for any $\alpha$ and $\alpha'$ that are multiplicatively close, the matrix $\mm_{\alpha'}^{-1} \mm_{\alpha}$ is close to the identity in an appropriate norm and therefore a solver for one can be used through preconditioning to yield a solver for the other.
Combining these insights yields a natural algorithm: compute a scaling for $\mm_{ \alpha}$ for large $\alpha$, use this to solve linear systems in $\mm_{ \alpha}$ and thereby $\mm_{ \alpha / 2}$. Use this solver to get scaling for $\mm_{ \alpha / 2}$ and repeat. We provide the basic mathematical analysis for this assuming exact solvers in Section~\ref{sec:overview} and then show how to build upon this to solve our problem in the inexact case in Section~\ref{sec:scaling_proofs}. In Section~\ref{sec:perron-alg} we then show how to carefully binary search to solve the Perron problem and certify if $\mm$ matrices are M-matrices.
\subsection{Overview of Results}
In this paper we give the first nearly linear time algorithms for Perron Vector computation and solving linear systems in M-matrices. Our main results are the following:
\perron*
\msolve*
As discussed, we achieve these results by providing reductions from solving these problems to solving linear systems in RCDD matrices. Our reduction is the first alternative to the reduction in \cite{coh16} for reducing stationary distribution computation and solving directed Laplacians to solving RCDD matrices and the first alternative to the reduction in \cite{DaitchS09} from solving symmetric M-matrices given a factorization to solving symmetric Laplacians. Our main theorem corresponding to this reduction is the following:
\begin{restatable}[M-Matrix Scaling in Nearly Linear Time]{theorem}{mscaler}
\label{thm:mscale}
Let $\ma \in \R^{\nn}_{\geq 0}$ with $m$ nonzero entries. Let $s > 0$ and $\rho(\ma) < s$, and let $\mm = s\eye - \ma$. For all $\epsilon > 0$ and $K \geq \max (s \|\mm^{-1}\|_\infty, s \|\mm^{-1}\|_1)$ there is an algorithm (See Algorithm~\ref{alg:MMatrix}) which runs in $\otilde(m)$ time and with high probability computes a pair of diagonal matrices $(\ml, \mr)$ where $\ml((1+\epsilon)s\eye - \ma)\mr$ is RCDD with high probability.
\end{restatable}
Leveraging these results we obtain faster algorithms for a host of problems (See Section~\ref{sec:applications} for a more detailed discussion). Key results from this section include
\begin{itemize}
\item {\bf Leontief economies:} these are models capturing interdependencies between different sectors within a national economy and how the output of one sector can be used as input to another sector changes in the production of one will affect the others. We give a near linear time for checking the Hawkin-Simons condition~\cite{hawkins1949note} that guarantees the existence of a non-negative output vector that solves the equilibrium relation in which demand equals supply.
\item {\bf Katz centrality:} we give a nearly linear time algorithm for computing the Katz centrality which defines the relative influence of a node within a network as a linear function of the influence of its neighbors.
\item {\bf Left and right top singular vectors:} we can also compute the top left-right singular values and associated top lef-right singular vectors of a non-negative matrix in nearly linear time. For this application we need additional ingredients solve linear systems in $\mm$ when $\mm$ is RCDD (see Oracle~\ref{oracle:RCDDSolve}).
\item{\bf Graph kernels:} graph kernels capture the similarity between two graphs with applications in social networks, studying chemical compounds, comparison and function prediction of protein structures, and analysis of semantic structures in natural language processing \cite{kash2003, kash2004, vish2010}.
One key obstacle in applying the existing algorithms for computing the kernel function between two graphs is their large running time~\cite{vish2010}. Using our methodology, we obtain improved running times for computing canonical kernel functions known as random walk kernels.
\end{itemize}
\subsection{Paper Organization}
The rest of the paper is organized as follows. In Section~\ref{sec:prelim} we cover preliminaries including notation and facts about M-matrices and Perron vectors that we use throughout the paper. Then, in Section~\ref{sec:overview} we provide a semi-rigorous technical overview of our approach ignoring errors from approximate numerical computations to make the insights of our results clear.
In Section~\ref{sec:scaling} we provide the algorithm for computing RCDD scalings of M-matrices and in Section~\ref{sec:perron-alg} we show how to use this method to compute Perron vectors and achieve efficient running times for solving and certifying M-matrices with unknown condition number. In Section~\ref{sec:applications} we provide our applications.
Finally, in Appendix~\ref{sec:mmatrix_facts} we provide proofs of facts about M-matrices and Perron vectors that we use throughout the paper and in Section~\ref{sec:scaling_proofs} we provide proofs missing from Section~\ref{sec:scaling_proofs}.
\section{Acknowledgments}
We thank Michael B. Cohen for helpful conversations which identified key technical challenges in solving M-matrices that motivated this work.
\bibliographystyle{abbrv}
\subsection{Notation}
\label{sub:prelim_notation}
\textbf{Variables}: We use bold to denote matrices and arrows to denote vectors. We use $\mI, \mzero \in \R^{n \times n}$ to denote the identity matrix and the all-zero matrix respectively. We use $\vzero, \vones \in \R^n$ to denote the all-zeros and all-ones vectors respectively. We use $\ve_i \in \R^n$ to denote the $i^{th}$ standard basis vector, i.e. the vector where $\ve_i(j) = 0$ for $j \neq i$ and $\ve_i(i) = 1$.\\
\\
\textbf{Matrix Operations}: For square matrix $\ma$ we use $\ma^\trans$ to denote its transpose, $\ma^{- 1}$ to denote its inverse, and $\ma^\pseudo$ to denote its Moore-Penrose pseuduinverse. For notational convenience we use $\ma^\invtrans$ to denote the inverse of the transpose of a matrix, i.e. $\ma^{\invtrans} \defeq (\ma^{-1})^\trans = (\ma^\trans)^{-1}$. Given a vector $\vx \in \R^n$, we use
$\mdiag(\vx) \in \R^{n \times n}$ to denote the diagonal matrix where $\mdiag(\vx)_{ii} = \vx(i)$ and whenever it is unambiguous, we will refer to $\mdiag(\vx)$ as $\mx$.\\
\\
\textbf{Matrix Ordering}: For symmetric matrices $\ma, \mb \in \R^{n \times n}$ we use $A \preceq B$ to denote the condition that $\vx^\top \ma \vx \leq \vx^\top \mb \vx$ for all $\vx \in \R^n$ and define $\succeq, \succ,$ and $\prec$ analogously. We say symmetric matrix $\ma \in \R^{n \times n}$ is positive semidefinite (PSD) if $\ma \succeq \textbf{0}$ and positive definite (PD) if $\ma \succ \textbf{0}$. For any PSD $\ma$, we define $\ma^{1/2}$ as the unique symmetric PSD matrix where $\ma^{1/2} \ma^{1/2} = \ma$ and $\ma^{1/2}$ as the unique PSD matrix where $\ma^{-1/2} \ma^{-1/2} = \ma^\pseudo$. \\
\\
\textbf{Matrix Norms}: Given a positive semidefinite matrix (PSD) $\ma$, we define the \emph{$\ma$-norm} (or seminorm) $\|\vx\|_\ma \defeq \sqrt{\vx^\top \ma \vx}$. We define the $\ell_2$ norm $\|\vx\|_2 = \|\vx\|_\mI = \sqrt{\vx^\top \vx}$. We define the $\ell_2$ norm of a matrix $\ma$ to be the matrix norm \textit{induced} by the $\ell_2$ norm on vectors: for a matrix $\ma$, $\|\ma\|_2 = \max_{\|\vx\|_2 = 1} \|\ma \vx\|_2$. Similarly, for any PSD $\mm$ we define $\|\ma\|_\mm \defeq \max_{\|\vx\|_\mm = 1} \|\ma \vx\|_\mm = \|\mm^{1/2} A \mm^{-1/2}\|_2$. We observe that $\|\ma\|_\mm = \|\ma^\top\|_{\mm^{-1}}$.
We further define the induced $\ell_1$ and $\ell_\infty$ matrix norms as $\|\ma\|_1 = \max_{\|\vx\|_1 = 1} \|\ma \vx\|_1$ and $\|\ma\|_\infty = \max_{\|\vx\|_\infty = 1} \|\ma \vx\|_\infty$. We observe that $\|\ma\|_1 = \max_j \sum_i |A_{i,j}|$ and $\|\ma\|_\infty = \max_j \sum_i |A_{j,i}| = \|\ma^\top\|_1$.\\
\\
\textbf{Spectral Quantities}: For a square matrix $\ma$, we let $\lmax(\ma)$ and $\lmin(\ma)$ denote its largest and smallest eigenvalues of $\ma$ respectively, we let $\kappa(\ma) \defeq \|\ma\|_2 \|\ma^{-1}\|_2$ denote its condition number,
and we let $\rho(\ma) \defeq \max\{|\lmax(\ma)|, |\lmin(\ma)| \} = \lim_{k \rightarrow \infty} \norm{\ma^{k}}_2^{1/k}$ denote its spectral radius.
\section{A Technical Overview of Approach}
\label{sec:overview}
In this section we give a technical overview of the key results in our paper. We provide several of the core proofs and algorithms we use in the rest of the paper. Our focus in this section is to provide a semi-rigorous demonstration of our results. While the complete analysis of our results is rather technical due to the careful account for the numerical precision of various algorithmic subroutines that can only be carried out approximately, e.g. solving various linear systems, here we provide a vastly simplified analysis that ignores these issues, but conveys the core of our arguments.
Formally, we make the following assumption through this section (and only this section) to simplify our analysis. In the remainder of the paper we carry on our analysis without it.
\begin{assumption} [Exact Numerical Operations Assumption Made Only in Section~\ref{sec:overview}] \label{asmp:exact-solver}
For any routine that can compute a vector $v$ with $\epsilon$-approximate error in some norm $\|\cdot\|$, i.e. compute $\tilde{v}$ with $\|v - \tilde{v}\| < \epsilon $, in time $O(\mathcal{T} \log^{O(1)}(1/\epsilon))$ we say there is a routine that can compute $v$ exactly in $\otilde(\mathcal{T})$ time, where here $\otilde$ hides factors polylogarithmic in $T$ as well as natural parameters of the problem, e.g. $n$.
\end{assumption}
Note that this assumption is obviously not met in various settings and can easily be abused by performing arithmetic operations on overly large numbers for free. However, it certainly simplifies analysis greatly, as for instance, under this assumption, Theorem~\ref{thm:rcdd_solver}. implies that a $n \times n$ RCDD matrix with $m$ non-zero entries can be solved exactly in $\otilde(m + n)$ time. However, in many cases (and is formally the case in this paper), analysis under the assumption loses only polylogarithmic factors in the overall running time.
Again, we make this assumption purely to simplify exposition in this section. In the remainder of the paper we carry on our analysis without it.
\subsection{From M-Matrices to RCDD Matrices}\label{sec:mmatrix-rcdd}
We begin our technical overview by formally stating the connections between M-matrices and diagonal scaling that make such matrices RCDD.
Given a non-negative irreducible matrix $\ma \in \R^{n \times n}$, suppose $\mm = s\mI - \ma$ is an invertible M-matrix for some $s > 0$. As we discussed in Section~\ref{sub:intro_tech_motiv} we know that if $\vv_l \in \R^n_{> 0}$ and $\vv_r \in \R^{n}_{> 0}$ are the left and right Perron vectors of $\ma$ respectively then
\[
\vv_l^\top \mm = (s - \rho(\ma)) \vv_l^\top > 0
\text{ and }
\mm \vv_r = (s - \rho(\ma)) \vv_r > 0
\]
Consequently, for $\mv_l = \mdiag(\vv_l)$ and $\mv_r = \mdiag(\vv_r)$ this property implies that $\mv_l \mm \mv_r$ is RCDD since its off-diagonal entries are non-positive and
$$
\mv_l \mm \mv_r \vones = \mv_l \mm \vv_r > 0 \text{ and }
\vones^\top \mv_l \mm \mv_r =
\vv_l^\top \mm \mv_r > 0.
$$
Thus any invertible M-matrix can be scaled with positive diagonal matrices to become RCDD. Furthermore, since systems of linear equations with RCDD coefficient matrices can be solved in nearly linear time this implies that given these scaling M-matrices can be solved in nearly linear time, as to solve $\mm z = b$, one can use an RCDD solver to find $z = \mv_r^{-1} (\mv_l \mm \mv_r)^{-1} \mv_l^{-1} b$ in nearly linear time.
More interestingly, the reduction also works in the other direction. This means if one can solve a linear system described with an M-matrix efficiently, then it is possible to find $\vell, \vr \in \R^{n}_{> 0}$ such that $\ml \mm \mr$ is RCDD where $\ml = \mdiag(\vell)$ and $\mr = \mdiag(\vr)$. Again from M-matrix theory we know that if $\mm$ is an invertible M-matrix then $\mm^{-1}$ is entrywise non-negative. Consequently, if we apply $\mm^{-1}$ to any positive vector, the resulting vector remains positive. Given this observation, let $\vl = \mm^{\invtrans} \vones$, and $\vr = \mm^{-1} \vones$. Now $\mm \vr = \mm \mm^{-1} \vones > \vzero$ and similarly $\vl^\top \mm > \vzero$. Thus, $\ml \mm \mr$ is RCDD and we see that one can look at either of $\vl$ or $\vr$ as a certificate for the matrix $\mm$ to be an M-matrix.
We use both of these directions in our algorithm to either find the desired scalings or solve linear systems fast. We further use the following lemma which is a formal statement of what we discussed above. The proof is deferred to Appendix (Section~\ref{sec:mmatrix_facts}).
\begin{restatable}{lemma}{MMatrixRCDD}
\label{lemma:MMatrix_RCDD}
Let $\ma$ be a nonnegative matrix, and consider $\mm = s \mI - \ma$ for some $s > 0$. Then if $\mm$ is an M-matrix then for every pair of vectors $\vx$ and $\vy$ where $\mm \vy > 0$ and $\mm^\top \vx > 0$ we have $\ms = \mx \mm \my$ is RCDD. Further, if there exist positive vectors $\vx$, $\vy$ where $\ms = \mx \mm \my$ is RCDD, then $\mm$ is an M-matrix.
\end{restatable}
Also, the following observation about M-matrices and these scaling is important in our analysis (see Section~\ref{sec:mmatrix_facts} for the proof).
\begin{restatable}{lemma}{pdscaling}
\label{lem:pdscaling}
Given a non-negative matrix $\ma \in \R_{\geq 0}^{n\times n}$, where $\mm= s \mI-\ma$ is an invertible M-matrix, l et $\ml, \mr \in \R_{>0}^{n\times n}$ be the left and right scalings that make $\ml \mm \mr$ RCDD and let $\md = \ml \mr^{-1}$. Then $\md^{1/2} \mm \md^{-1/2} + \md^{-1/2} \mm \md^{1/2}$ is PD.
\end{restatable}
\subsection{Algorithm for Solving Linear Systems in M-matrices}
Relying on the connection between M-matrices and RCDD matrices discussed in Section~\ref{sec:mmatrix-rcdd} and the fact that linear systems described by RCDD matrices can be solved in nearly linear time Section~\ref{sub:prelim_rcdd}, in this section we present one of our central results which is a simple iterative algorithm that can be used to solve systems of linear equations described by M-matrices.
Particularly, we give a nearly linear time algorithm for solving the following problem.
\begin{definition}[M-matrix Scaling Problem]
Given non-negative $\ma \in \R_{\geq 0}^{n\times n}$ and value $s$ where $\mm = s \mI - \ma$ is an invertible M-matrix, i.e. $\rho(\ma)< s $, compute scaling vectors $\vell, \vr \in \R^{n}$, such that $\ml \mm \mr$ is strictly RCDD, where $\ml = \diag(l)$ and $\mr = \diag(r)$.
\end{definition}
The main statement we will prove in this section is Theorem~\ref{thm:mmatrix-scale-overview} given below. The fully rigorous version of this Theorem~\ref{thm:mscale} is one of the main results of the paper and provides a tool for solving linear systems in M-matrices in nearly linear time. We also use this result later to give our nearly linear time algorithm for finding the top eigenvalue and eigenvectors of non-negative matrices as described by Perron-Frobenius theorem. We remark that the following statement is written assuming Assumption~\ref{asmp:exact-solver} and the full version of this theorem is stated in Theorem~\ref{thm:mscale}.
\begin{theorem}[M-matrix Scaling, Informal]\label{thm:mmatrix-scale-overview}
Given a value $s > 0$, a non-negative matrix $\ma \in \R_{\geq 0}^{n\times n}$ with $m$-nonzero entries where $\rho(\ma) < s$, and $\epsilon>0$ let $\mm_\alpha \eqdef (1+\alpha) s \mI - \ma$. Algorithm~\ref{alg:MMatrix-overview}, finds positive diagonal matrices $\ml, \mr \in \R_{>0}^{n\times n}$ such that $\ml \mm_\epsilon \mr$ is RCDD in time $\tilde{O}(m \log(\frac{\|\ma\|_1+ \|\ma\|_\infty}{s \epsilon}))$.
\end{theorem}
Note that in solving the above problem we can assume without loss of generality that $s = 1$: observe that $\mm' = \frac{1}{s} \mm = \eye - \frac{1}{s} \ma$ is an M-matrix and additionally note that $\mm_\alpha' = \frac{1}{s} \mm_\alpha$. Thus any scaling of $\mm_\epsilon'$ is a scaling of $\mm_\epsilon$. Note that the running time is unaffected by such scalings since $\| \frac{1}{s}\ma \| = \frac{1}{s} \| \ma \|$. Thus from now on whenever we discuss Theorem \ref{thm:mmatrix-scale-overview} we assume $s=1$ for simplicity. To solve the M-matrix scaling problem with $s=1$ we take a simple iterative approach of solving and computing scalings for $\mm_\alpha$ defined for all $\alpha \geq 0$ by
$
\mm_{\alpha} \eqdef \mm + \alpha \mI
$.
In particular, we consider the scaling vectors
$
\vell_\alpha \eqdef \mm_{\alpha}^{-\top} \bone \text{ and } \vr_\alpha \eqdef \mm_{\alpha}^{-1} \bone
$
and let $\ml_{\alpha}\eqdef \diag(\vell_\alpha)$ and $\mr_{\alpha}\eqdef \diag(\vr_\alpha)$ (see Algorithm~\ref{alg:MMatrix-overview}). As discussed in Section~\ref{sec:mmatrix-rcdd}, $\ml_{\alpha} \mm_{\alpha} \mr_{\alpha}$ is RCDD. Note that to solve $\mm_{\alpha} \vx = \vb$, we can instead solve $\ml_{\alpha}^{-1}(\ml_{\alpha} \mm_{\alpha} \mr_{\alpha})\mr_{\alpha}^{-1} \vx = \vb$, which is equivalent to computing $\vx = \mr_{\alpha} (\ml_{\alpha} \mm_{\alpha} \mr_{\alpha})^{-1} \ml_{\alpha} \vb$. This means solving an equation in $\mm_{\alpha}$ reduces to inverting a RCDD matrix.
The above discussion shows computing $\ml_{\alpha}$ and $\mr_{\alpha}$ gives us access to $\mm_{\alpha}^{-1}$ in nearly linear time. We show computing $\ml_{\alpha}$ and $\mr_{\alpha}$ for one value of $\alpha$, suffices to compute it for another nearby. To do this, we show ${\mm_{\alpha'}}^{-1}$ for $\alpha'$ constantly close to $\alpha$ is a good preconditioner of $\mm_{\alpha}$, i.e. $\mm_{\alpha'}^{-1} \mm_{\alpha} \approx \mI$ in a specific norm. It is known that when this happens a simple procedure known as preconditioned Richardson (Algorithm~\ref{alg:prichardson}) can solve a linear system in $\mm_{\alpha}$ using just $\otilde(1)$ applications of $\mm_{\alpha}$ and $\mm_{ \alpha'}^{-1}$, i.e. nearly linear time.
\newcommand{$\code{Prec-Richardson}$}{$\code{Prec-Richardson}$}
\begin{algorithm} [h!]\caption{Exact Preconditioned Richardson}\label{alg:prichardson}
\begin{algorithmic}[1]
\Function{$\code{Prec-Richardson}$}{$\mm$, $\mP$, $\vb$, $\epsilon$, $\vx_0$, $n_{iter}$}
\State \textbf{Input:} $\mm \in \R^{n\times n}$, $\mP \in \R^{n\times n}$ is a preconditioner for $\mm$, $\vb \in \R^n$, $\vx_0\in \R^n$
\State \textbf{Input:} $n_{iter}$ is an upper-bound on the number of iterations to run the algorithm.
\State \textbf{Output:} Either $\vx \in \R^n$ with $\|\mm \vx - \vec{b}\|_2 < \epsilon \|\vx_0\|_2$ or failure after $n_{iter}$ iterations
\State $\vx \eq \vx_0$
\Repeat
\State $\vx \eq \vx - {\mP} [\mm \vx - \vb]$
\Until{$\|\mm \vx - \vec{b}\|_2 < \epsilon \|\mm \vx_0-\vb\|_2$ or number of iterations exceeds $n_{iter}$}
\State \Return $\vx$
\EndFunction
\end{algorithmic}
\end{algorithm}
The following lemmas provides the formal bound on $\mm_{\alpha'}^{-1}\mm_{\alpha}$ that allows this procedure to work.
\begin{lemma}\label{lem:preconditioner}
Let $\md$ be a symmetric PSD matrix such that $\md^{1/2} \mm \md^{-1/2} + \md^{-1/2} \mm^\top \md^{1/2}$ is PSD. Then for all $\alpha, \alpha' > 0$ the following holds
$$
\|\mm_{\alpha'}^{-1} \mm_\alpha - \mI \|_{\md \rightarrow \md}
= \left|\alpha-\alpha'\right|\cdot\norm{\md^{1/2}\mm_{\alpha}^{-1}\md^{-1/2}}_{2}
\leq \frac{|\alpha'-\alpha|}{\alpha'} ~.
$$
\end{lemma}
\begin{proof}
Note that $\mm_{\alpha}=\mm_{\alpha'}+(\alpha-\alpha')\mI$. Consequently,
$
\mm_{\alpha'}^{-1}\mm_{\alpha}-\mI=(\alpha-\alpha')\mm_{\alpha'}
$
and therefore
\[
\norm{\mm_{\alpha'}^{-1}\mm_{\alpha}-\mI}_{\md\rightarrow\md}=\left|\alpha-\alpha'\right|\cdot\norm{\md^{1/2}\mm_{\alpha}^{-1}\md^{-1/2}}_{2}
\]
yielding the first equality of the claim. For the inequality, note that
\[
\norm{\md^{1/2}\mm_{\alpha}^{-1}\md^{-1/2}}_{2}
= \sqrt{\lambda_{\max}\left(\md^{-1/2} \mm_{\alpha}^{\invtrans}
\md\mm_{\alpha}^{-1}\md^{-1/2}\right)}=\frac{1}{\sqrt{\lambda_{\min}\left(\md^{1/2}\mm_{\alpha}\md^{-1}\mm_{\alpha}^{\top}\md^{1/2}\right)}}\,.
\]
Furthermore, we see that
\begin{align*}
\md^{1/2}\mm_{\alpha}\md^{-1}\mm_{\alpha}^{\top}\md^{1/2} & =\md^{1/2}\mm\md^{-1}\mm\md^{1/2}+\alpha^{2}\mI+\alpha\left[\md^{-1/2}\mm^{\top}\md^{1/2}+\md^{1/2}\mm\md^{-1/2}\right]\,.
\end{align*}
Since $\md^{1/2}\mm\md^{-1}\mm\md^{1/2}\succeq\mzero$ and $\md^{-1/2}\mm^{\top}\md^{1/2}+\md^{1/2}\mm\md^{-1/2}\succeq\mzero$
by assumption, we have
\[
\md^{1/2}\mm_{\alpha}\md^{-1}\mm_{\alpha}^{\top}\md^{1/2}\succeq\alpha^{2}\mI\text{ and }\lambda_{\min}(\md^{1/2}\mm_{\alpha}\md^{-1}\mm_{\alpha}^{\top}\md^{1/2})\geq\alpha^{2}
\]
yielding the result.
\end{proof}
By Lemma~\ref{lem:preconditioner}, any $\md$ which makes $\md^{1/2} \mm \md^{-1/2}$ PSD lets us bound $\|\mm_{\alpha'}^{-1} \mm_{\alpha} - \mI \|_{\md}$. Furthermore, in Lemma~\ref{lem:pdscaling} we showed that for $\md = \ml_{0} \mr^{-1}_{0}$ $\md^{1/2} \mm \md^{-1/2}$ is PSD. Therefore, we already know an appropriate scaling $\md$.
Having all these observations we are ready to give an efficient algorithm for solving M-matrix scaling problem.
Our algorithm (Algorithm~\ref{alg:MMatrix-overview}) starts with a large $\alpha$ (e.g. $\alpha =\max\{\|\ma\|_\infty, \|\ma\|_1\}$) such that $\mm_{\alpha}$ trivially becomes RCDD, then halves $\alpha$ in each iteration and find $\ml_{\alpha}, \mr_{\alpha}$ for the new $\alpha$.
Using Lemmas~\ref{lem:pdscaling} and \ref{lem:preconditioner}, we just showed there exists a norm where $\|\mm_{\alpha}^{-1} \mm_{\alpha/2} - \mI \|_{\md} \leq 1/2$.
Provided we can solve linear systems in $\mm_{\alpha}$, we compute $\ml_{\alpha/2}$ and $\mr_{\alpha/2}$ using preconditioned Richardson (see Algorithm~\ref{alg:prichardson}). By Assumption~\ref{asmp:exact-solver}, this requires solving $\tilde{O}(1)$ linear systems in $\mm_{\alpha}$.
Since we already have access to $\ml_{\alpha}$ and $\mr_{\alpha}$ we can solve systems in $\mm_{\alpha}$ exactly in $\otilde(m)$ (again by Assumption~\ref{asmp:exact-solver}). Therefore $\ml_{\alpha/2}$ and $\mr_{\alpha/2}$ can be computed in $\otilde(m)$. Now to find scalings for $\mm_\epsilon$, we iterate $\otilde(\log(\frac{\|\ma\|_1+\|\ma\|_\infty}{\epsilon}))$ times, giving the overall running time of $\otilde(m \log(\frac{\|\ma\|_1+\|\ma\|_\infty}{\epsilon})$. This proves the statement in Theorem~\ref{thm:mmatrix-scale-overview}.
\newcommand{$\code{MMatrix-Scale-Overview}$}{$\code{MMatrix-Scale-Overview}$}
\begin{algorithm} [h]
\caption {Compute left and right scalings of an M-matrix to make it RCDD.} \label{alg:MMatrix-overview}
\begin{algorithmic}[1]
\Function{ $\code{MMatrix-Scale-Overview}$}{$A$, $\epsilon$}
\State \textbf{Input:} $\ma \in \R_{\geq 0}^{n\times n}$ is an irreducible matrix with $\rho(\ma)<1$, and $\epsilon >0$ is a real number.
\State \textbf{output:} Positive diagonal scalings $\ml$ and $\mr$ such that $\ml [(1+\epsilon) \mI - \ma] \mr$ is RCDD
\State $\alpha \eq \max\{\|\ma\|_1, \|\ma\|_\infty\}$
\State $\ml_{\alpha}, \mr_{\alpha} \eq I$
\While{$\alpha > \epsilon$}
\State \textit{{\footnotesize //$\mm_\alpha = (1+\alpha) I - A$.}}
\State \textit{\footnotesize //In the following lines, we assume access to an efficient solver for $\mm_{\alpha}^{-1}$ as $L_{\alpha}$, $R_{\alpha}$ are already computed.}
\State $\vec{\ell}_{\alpha/2} \eq$ {\sc $\code{Prec-Richardson}$}($M^\top_{\alpha/2}$, ${\mm_{\alpha}^{-1}}^\top$, $\vec{\bone}$, $\vec{0}$, 0, $\infty$)
\State $\vec{r}_{\alpha/2} \eq$ {\sc $\code{Prec-Richardson}$}($M_{\alpha/2}$, $\mm_{\alpha}^{-1}$, $\vec{\bone}$, $\vec{0}$, 0, $\infty$)
\State $\alpha \eq \alpha/2$
\EndWhile
\State \Return $\ml_{\alpha},\mr_{\alpha}$ with $\ml_{\alpha} M_{\epsilon} \mr_{\alpha}$ being RCDD
\EndFunction
\end{algorithmic}
\end{algorithm}
We used Assumption~\ref{asmp:exact-solver} twice in the above argument. In Section~\ref{sec:scaling} through a careful analysis, we show how to adjust each of these assumptions to the approximate world while avoiding to increase the running time by more than a polylogarithmic factor in $n$, $\frac{1}{\epsilon}$, and $\kappa(\ml_0)+\kappa(\mr_0)$.
\input{perron-overview}
\subsection{Finding the top eigenvalue and eigenvectors of positive matrices}\label{sec:perron-alg-overview}
In this section, we present an overview of our result on computing the largest eigenvalue and corresponding eigenvectors of a non-negative matrix as characterized by Perron-Frobenius theorem. In the last section we showed how to find the left and right scalings for an M-matrix to make it RCDD. Here we discuss how to use this idea to come up with a nearly linear time algorithm for the Perron vector problem (see Definition~\ref{def:perron}) or equivalently M-matrix decision problem, defined below.
\begin{definition}[M-matrix decision problem]
Given a non-negative irreducible matrix $\ma \in \R_{\geq0}^{n\times n}$, and real number $s > 0$, decide whether $s\mI- \ma$ is an M-matrix, or equivalently $\rho(\ma) < s$.
\end{definition}
If we know the top eigenvalue of $\ma$, then to solve the M-matrix decision problem we only need to check $\rho(A) < s$. Thus a solver for the Perron problem, gives an immediate solution for the M-matrix decision problem. On the other hand, if we have a solver for the M-matrix decision problem, to get a solver for the Perron problem, we need to use a search strategy to find the smallest $s$ such that $\rho(A) < s$. We use the latter approach combined with the ideas from Algorithm~\ref{alg:MMatrix-overview} to come up with a nearly linear time algorithm for the Perron problem. Theorem~\ref{thm:perron} demonstrates this result. A full detailed analysis of this theorem is given in Section~\ref{sec:perron-alg}. Below we discuss the main ideas and steps that are taken to prove Theorem~\ref{thm:perron}, and point to the corresponding subsections in Section~\ref{sec:perron-alg}.
\subsubsection{The M-matrix Decision Problem}\label{sec:mmatrix-decision-overview}
Here we show how a slightly modified version of Algorithm~\ref{alg:MMatrix-overview} can be used to solve the M-matrix decision problem. Note that if Algorithm~\ref{alg:MMatrix-overview} succeeds to find a scaling for $\mm_\epsilon$, it is also a proof that $\rho(\ma) < 1+\epsilon$.
However, Algorithm~\ref{alg:MMatrix-overview} only works on the premise that $\rho(\ma) < 1$.
If we remove this assumption, we are no longer able to apply Lemmas~\ref{lem:pdscaling} and~\ref{lem:preconditioner}. In other words, it might no longer be the case that $\mm_{\alpha}^{-1}$ is a good preconditioner for $\mm_{\alpha/2}$ (i.e. satisfies $\mm_{\alpha}^{-1} \mm_{\alpha/2} \approx \mI$ in some norm) or that $\mm_{\alpha/2}$ is an M-matrix. Therefore, preconditioned Richardson might fail to terminate within a reasonable time, or find an appropriate scaling. To give an example on what might go wrong, note that in our analysis we rely on the fact $\vr_{\alpha/2} = \mm_{\alpha/2}^{-1} \vones > \vzero$, but this is not necessarily true when $\mm_{\alpha/2}$ is not an M-matrix.
Remember we used Assumption~\ref{asmp:exact-solver}, and Lemmas~\ref{lem:pdscaling},~\ref{lem:preconditioner}, to show each invocation of preconditioned Richardson in Algorithm~\ref{alg:MMatrix-overview} generates an exact solution after $\otilde(1)$ iterations. Interestingly, we can use this to test whether $\mm$ is an M-matrix or not. Given that we have access to an exact solver for $\mm_\alpha$, if preconditioned Richardson fails to find an appropriate scaling after $\otilde(1)$ iterations, it is a proof that $\mm$ is not an M-matrix. On the other hand, if we limit the number of iterations for preconditioned Richardson to $\otilde(1)$ and our algorithm still succeeds to find appropriate scalings for $\mm_\epsilon$, this is a proof that $\mm_\epsilon$ is actually an M-matrix. This way we can come up with a nearly linear time algorithm which either reports that $\mm$ is not an M-matrix, or provides a proof that $\mm_\epsilon$ is an M-matrix.
For a full discussion on the M-matrix decision problem and the bounds we get for solving this problem refer to Section~\ref{sec:mmatrix-decision}. In this section there are further complications that we address to deal with the fact that the condition number of the top eigenvectors of $\ma$ is not known. The main issue comes up with choosing the number of iterations to run the preconditioned richardson. We discuss this issue briefly here, since it impacts the running time of the algorithm in a way other than tunning the internal solvers precisions. For a detailed discussion we refer the reader to Section~\ref{sec:kfix}.
In the aforementioned scheme, given that $\mm_\alpha^{-1}$ is a preconditioner for $\mm_{\alpha/2}$, we assumed (by Assumption~\ref{asmp:exact-solver}) there exists a function $f = \otilde(1)$ such that the preconditioned Richardson (see Algorithm~\ref{alg:MMatrix-overview}) should terminate with an exact solution after $f(\cdot)$ iterations. To get the above strategy actually work, we need to know an upper-bound on $f$, which turns out to have a polylogarithmic dependence on $\kappa(\vv_l)$ and $\kappa(\vv_r)$, where $\vv_l$ and $\vv_r$ are the left and right eigenvectors of $\ma$. Unfortunately, we do not know $\kappa(\vv_l)$ and $\kappa(\vv_r)$ in advance.
One potential fix to this problem is to guess an upper-bound $K$ on the condition numbers of left and right eigenvectors and double it until $K \geq \kappa(\vv_l) + \kappa(\vv_r)$. This simple doubling scheme does not quite work as it is not clear when we should stop doubling $K$. Instead we provide a more complex doubling scheme which can solve the problem. For this we refer reader to Section~\ref{sec:kfix}.
\subsubsection{Perron problem}
We use our algorithm for the M-matrix decision problem to provide an algorithm for the Perron problem. Our approach for solving the Perron problem consists of two stages. First, we compute the largest eigenvalue, namely $\rho(\ma)$, within an $\epsilon$ multiplicative error. Second, we use this computed value to find approximate eigenvectors corresponding to $\rho(\ma)$. Our method for finding the largest eigenvalue of $\ma$ is depicted in Algorithm~\ref{alg:perronvalue}, function {\sc \findperronvalue} (Section~\ref{sec:perron-sub}). By using the algorithm for the M-matrix decision problem, for a given $s \in \R_{>0}$, we can either determine $\rho(\ma) > s$ (i.e. $\mI - \ma/s$ is not an M-matrix), or $\rho(\ma) \leq (1+\epsilon) s$ (i.e. $(1+\epsilon)\mI - \ma/s$ is an M-matrix). We use this fact in {\sc \findperronvalue}, to apply a binary search which finds $\rho(A)$ within an $\epsilon$ multiplicative error. For a detailed discussion and analysis of this algorithm refer to Section~\ref{sec:perron-sub}.
Next, in Section~\ref{sec:approx-pvector} we show how to find an approximate eigenvector of $A$ corresponding to its largest eigenvalue. We define an approximate eigenvector as follows.
\begin{definition}[Approximate Eigenvector] \label{def:approx-ev}
Given a matrix $\ma \in \R^{n \times n}$ and a vector norm $\|.\|$, let $\lambda$ be a non-zero eigenvalue of $\ma$, then a non-zero vector $\vr \in \R^n$ is an $\epsilon$-approximate eigenvector of $\ma$ corresponding to $\lambda$ if $\|(\mI-\frac{\ma}{\lambda})\vr\| < \epsilon \|\vr\|$.
\end{definition}
In Lemma~\ref{lem:perron-approx}, we show that $[(1+\epsilon)\mI - \ma / \rho(\ma)]^{-1} \vones$ is a $2\epsilon$-approximate eigenvector corresponding to $\rho(\ma)$ (in infinity norm). Note that we are able to compute $[(1+\epsilon)\mI - \ma / \rho(\ma)]^{-1} \vones$ in nearly linear time with our machinery for the matrix scaling problem (refer to $\mm_\epsilon$ and $\vr_\alpha$ definitions in Section~\ref{sec:mmatrix-decision-overview}). Therefore if we have $\rho(\ma)$ we can compute its corresponding approximate eigenvectors efficiently. We then show similar bounds hold if instead of $\rho(\ma)$ we use an $1+\epsilon$ approximation of it. This completes our two step approach for finding both the top eigenvalue and eigenvectors of a non-negative irreducible matrix. This simple approach could work under Assumption~\ref{asmp:exact-solver}, if the terms we are hiding in $\otilde(1)$ notation in {\sc $\code{MMatrix-Scale-Overview}$} algorithm did not depend on $\kappa(\vv_l)$ and $\kappa(\vv_r)$, or either we knew a tight upper-bound for them. However, as discussed in the previous subsection our algorithm for the M-matrix decision problem depends on knowing this bound. We show a fix for this in Section~\ref{sec:kfix}.
\section{Finding Top Eigenvalue and Eigenvector of Positive Matrices}\label{sec:perron-alg}
In this section we present one of the fundamental results of our paper which is the first nearly linear time algorithm for computing the top eigenvalue and eigenvectors of non-negative matrices characterized by Perron-Frobenius theorem.
Here we discuss how to use our M-matrix scaling algorithm to come up with nearly linear time algorithms for the Perron problem and M-matrix decision problem.
As we argued previously, these two problems are essentially equivalent. We use the M-matrix scaling algorithm from the previous section to solve the Perron problem, and then we use our reduction combined with some ideas from Algorithm~\ref{alg:MMatrix-overview} to come up with a nearly linear time algorithm for the Perron problem. The following theorem gives the statement that we will prove in this section.
\begin{theorem}[Nearly Linear Time Perron Computation] \label{thm:perron-overview}
Given a non-negative irreducible matrix $\ma\in \R_{\geq 0}^{n\times n}$, and $\delta>0$, Algorithm~\ref{alg:perron} finds real number $s>0$, and positive vectors $\vl,\vr,\in \R_{>0}^{n}$ such that $(1-\delta)\rho(\ma) < s \leq \rho(\ma)$, $\|(s \eye - \mm) \vr\|_\infty \leq \frac{\delta}{K^2}\norm{\vr}_\infty$, and $\|\vl^\top (s \eye - \mm)\|_\infty \leq \frac{\delta}{K^2}\norm{\vl}_\infty$ in time
\[
O\Big(\mathcal{T}_{solve}\Big(m, n, O(\frac{K^6}{\delta^2}), O(\frac{\delta^3}{K^9}) \Big) \log(n \frac{K}{\delta}) \log\Big(\frac{\|\ma\|_1 + \|\ma\|_\infty}{\epsilon} \Big) \log(\frac{|s_1-s_2|}{\epsilon\rho(\ma)}) \Big)~,
\]
where $K = \Theta(\kappa(\eigl)+\kappa(\eigr))$ and $\eigl$, $\eigr$ are the left and right eigenvectors of $\ma$, of eigenvalue $\rho(\ma)$.
\end{theorem}
\subsection{The M-matrix Decision Problem}\label{sec:mmatrix-decision}
Here we show how a slightly modified version of Algorithm~\ref{alg:decision} can be used to solve the M-matrix decision problem. Note that if Algorithm~\ref{alg:decision} succeeds in finding a scaling for $\mm_\epsilon$, we have a proof that $\rho(\ma)< 1+\epsilon$. However, Algorithm~\ref{alg:decision} only works on the premise that $\rho(\ma) < 1$. If this was false, we are no longer able to guarantee that i) our scalings of $\mm_\alpha$ are always positive, ii) the iteration used to compute scalings of $\mm_\alpha$ converges in the claimed number of iterations and iii) we can actually solve the intermediate RCDD systems in the claimed running time. To be more precise, Algorithm \ref{alg:decision} uses some previously obtained RCDD scaling of $\mm_{2 \alpha}$ to find a scaling of $\mm_\alpha$. If $\mm$ was not an M-matrix however (or equivalently if $\rho(A) \geq 1$) we would be unable to use Lemma \ref{lemma:scaling_innerloop} and thus we would have no upper bound on the number of iterations the inner loop of Algorithm \ref{alg:decision} takes to converge. Even worse, we also have no guarantee that $\mm_\alpha$ even admits an RCDD scaling, and thus even if our inner loop did converge we cannot say that it gives a valid scaling. In addition, without the guarantee that $\mm$ is an M-matrix we do not have any bounds on $\|\mm_\alpha^{-1}\|_\infty$ or $\|\mm_\alpha^{-1}\|_1$: thus we are unable to ensure that each RCDD solve runs in the time we need it to to.
Fortunately, we observe that both of these failure modes for our algorithm can be efficiently checked for. If we want to verify failure mode i), we can simply check if our scaling vectors $\vr_\alpha$ and $\vl_\alpha$ are not entrywise positive. If we want to check failure mode ii), we can simply count the number of iterations in the inner loop of Algorithm \ref{alg:decision} and ensure that it does not exceed Lemma \ref{lemma:scaling_innerloop}'s guarantee. Finally, to check failure mode iii) we can simply ensure that each RCDD solve does not take too long. This way we can come up with a nearly linear time algorithm which either reports that $\mm$ is not an M-matrix, or provides a proof that $\mm_\epsilon$ is an M-matrix.
\paragraph{A note on not knowing the condition number of top eigenvectors of $\ma$.} The last paragraph gives the outline of our strategy to solve M-matrix decision problem. However, there is one more slight complication that arises when using the M-matrix scaling algorithm from the previous section. In order to guarantee the correctness of the output of our algorithm, we require knowledge of some parameter $K$ which upper bounds the condition numbers of the left and right eigenvectors of $\ma$. This too can be circumvented, but we will demonstrate our fix for this problem at the end: in the meanwhile, we assume access to some $K \geq \kappa(\eigl) + \kappa(\eigr)$.
Given the above discussion, we are now ready to present our algorithm for the M-matrix decision problem. Algorithm~\ref{alg:decision} gets as input an irreducible non-negative matrix $\ma\in R_{\geq 0}^{n\times n}$, real number $\epsilon > 0$, and $K \in \R_{>0}$ which upper bounds the condition numbers of the left and right eigenvectors of $\ma$. It either reports that $\mm = \eye -\ma$ is not an M-matrix or finds scalings $\vl, \vr \in \R_{\geq 0}^{n}$ such that $\diag(\vl) \mm_\epsilon \diag(\vr)$ is RCDD. Algorithm~\ref{alg:decision} is essentially identical to Algorithm~\ref{alg:MMatrix-overview} with the modifications that we return that $\mm$ is not an M-matrix whenever our inner loop iteration takes too long to converge or the scaling vectors we compute are not positive. The following lemma provides a formal specification of Algorithm~\ref{alg:decision}.
\begin{algorithm} [t]
\caption {\sc \mdecide$(\ma, \epsilon, \gamma)$} \label{alg:decision}
\begin{algorithmic}[1]
\State \textbf{Input:} $A\in \R_{\geq 0}^{n\times n}$ is an irreducible matrix with $\rho(A)<1$, and $\epsilon, \gamma >0$ are real numbers.
\State \textbf{Output:} If $\mm =\eye-\ma$ is an M-matrix then returns $\vl, \vr \in \R_{>0}^n$ such that $\mm_\epsilon \vr >0$ and $\vl^\top \mm_\epsilon > 0$, otherwise returns $\vl,\vr =-\vones, -\vones$.
\State $\alpha \eq 2 \max\{\|A\|_1, \|A\|_\infty\}$
\State $\vl_\alpha \gets \frac{1}{\alpha} \vones, \quad \vr_\alpha \gets \frac{1}{\alpha} \vones$
\While{$\alpha > \epsilon$}
\State $\alpha \eq \alpha/2, \quad k \gets 0$
\State $\vl_{\alpha}^{\, \, (0)} \gets \vzero, \quad \vr_{\alpha}^{\, \, (0)} \gets \vzero$
\State $\mm_\alpha = (1+\alpha) \eye - A$.
\State $\mathcal{T}_{RCDD} = O\Big(\mathcal{T}_{solve}\Big(m, n, 18 \gamma^2, \frac{1}{216 \gamma^3}\Big)\Big)$
\For{$k = 1, 2, ... O(n\gamma) $}
\State $\Prightk_{2 \alpha}, \Pleftk_{2 \alpha} \gets \code{SolvefromScale}(\mm_{2\alpha}, \ml_{2 \alpha}, \mr_{2\alpha}, \delta)$
\State $\vl_{\alpha}^{\, \,(k+1)} \eq \vl_{\alpha}^{\, \, (k)} - \Pleftk_{2 \alpha} (\mm^{\top}_{\alpha} \vl_{\alpha}^{\, \, (k)} - \vones)$
\State $\vr_{\alpha}^{\, \, (k+1)} \eq \vr_{\alpha}^{\, \, (k)} - \Prightk_{2 \alpha} (\mm_\alpha \vr_{\alpha}^{\, \, (k)} - \vones)$
\If {applying $\Pleftk_{2 \alpha}$ or $\Prightk_{2 \alpha}$ takes longer than $\mathcal{T}_{RCDD}$ time}
\State \Return $-\vones,-\vones$ as a sign that $ \mm = \eye - \ma$ is not an M-matrix.
\EndIf
\EndFor
\State $\vl_\alpha, \vr_\alpha \eq \vl_\alpha^{\, \, (k)}, \vr_\alpha^{\, \, (k)}$
\If{$\frac{3}{2} \vones > \mm_\alpha \vr_\alpha > \frac{1}{2} \vones, \frac{3}{2} \vones > \mm_\alpha^\top \vl_\alpha > \frac{1}{2} \vones, \vr_\alpha > \vzero,$ and $\vl_\alpha > \vzero$}
\State continue;
\Else
\State \Return $-\vones,-\vones$ as a sign that $\mm = \eye - \ma$ is not an M-matrix.
\EndIf
\EndWhile
\State \Return $\ml_\alpha,\mr_\alpha$ with $\ml_\alpha \mm_{\epsilon} \mr_\alpha$ being RCDD
\end{algorithmic}
\end{algorithm}
\begin{lemma}\label{lem:decision}
Given a non-negative irreducible matrix $\ma\in \R_{\geq 0}^{n\times n}$, and $\epsilon,K \in \R_{>0}$, let $\eigl, \eigr\in \R_{>0}^{n}$ be the left and right Perron vectors of $\ma$, respectively. Given that $K\geq \kappa(\eigl)+\kappa(\eigr)$ the algorithm {\sc \mdecide($\frac{\ma}{1+\epsilon/2}$, $\epsilon/3$, $\frac{2K}{\epsilon}$)} either comes up with a proof that $\mm = \eye-\ma$ is not an M-matrix, or proves $\mm_\epsilon = \mm + \epsilon \eye$ is an M-matrix by finding $\vl, \vr >0$ such that $\ml \mm_\epsilon \mr$ is RCDD. This procedure runs in time
\[
O\Big(\mathcal{T}_{solve}\Big(m, n, \frac{72 K^2}{\epsilon^2}, \frac{\epsilon^3}{1728 K^3}\Big) \log(n \frac{K}{\epsilon}) \log\Big(\frac{\|\ma\|_1 + \|\ma\|_\infty}{\epsilon} \Big) \Big).
\]
\end{lemma}
\begin{proof}
This algorithm is just Algorithm \ref{alg:MMatrix} with some added tests to ensure we are not in one of the three failure modes of our algorithm. We note that the choice of constants here matches that of Corollary \ref{corollary:scale_eigenvec}. If our algorithm passes all of the checks on lines 14 and 19, we are able to guarantee that we have a valid scaling for every $\mm_\alpha$ seen during the course of our algorithm. Further, we can guarantee that computing a scaling for a given $\alpha$ value takes only $O(\mathcal{T}_{RCDD} \log(n \frac{K}{\epsilon}))$ time since we upper bound the number of RCDD solves and the time that each solve takes. Thus, since there are $\log\Big(\frac{\|\ma\|_1 + \|\ma\|_\infty}{\epsilon} \Big) \Big)$ values of $\alpha$ considered, we obtain a scaling of $(1 + \epsilon/3) \eye - \frac{\ma}{1+\epsilon/2}$ (and consequently a scaling of $(1+\epsilon)\eye - \ma$) in time
\[
O\Big(\mathcal{T}_{solve}\Big(m, n, \frac{72 K^2}{\epsilon^2}, \frac{\epsilon^3}{1728 K^3}\Big) \log(n \frac{K}{\epsilon}) \log\Big(\frac{\|\ma\|_1 + \|\ma\|_\infty}{\epsilon} \Big) \Big).
\]
Now to complete the proof we need to argue that if our algorithm fails one of its internal checks then $\eye - \ma$ is not an M-matrix. If we fail the check on line 19, there are two cases. If we fail either $\frac{3}{2} \vones > \mm_\alpha \vr_\alpha > \frac{1}{2} \vones$ or $\frac{3}{2} \vones > \mm_\alpha^\top \vl_\alpha > \frac{1}{2} \vones$, then we contradict Lemma \ref{lemma:scaling_innerloop}'s bound on the number of iterations needed to get this level of precision assuming $\eye - \ma$ was an M-matrix. If instead we fail $\vr_\alpha > \vzero,$ or $\vl_\alpha > \vzero$ then we have a vector which demonstrates that $\mm_\alpha$ is not monotone: thus $\mm_\alpha$ and consequently $\eye - \ma$ is not an M-matrix. If we fail the check on line 14, then we contradict the running time guarantee of $\code{SolvefromScale}$ with the condition number guarantees provided by Lemmas \ref{lemma:scaling_condition} and \ref{lemma:mmatrix_to_eigenvector}. Thus again we have a disproof that $\eye - \ma$ is an M-matrix, and thus the result is proved.
\end{proof}
\subsection{Perron problem}\label{sec:perron-sub}
Given that we have an algorithm for the M-matrix decision problem we are ready to present our algorithm for the Perron problem. We first present an algorithm that computes an $\epsilon$ approximation of the largest eigenvalue of an irreducible matrix $\ma\in \R_{\geq 0}^{\nn}$, assuming that we know some $K \geq \kappa(\eigl) + \kappa(\eigr)$ where $\eigl$ and $\eigr$ are the left and right top eigenvectors of $\ma$. We then use this as a subroutine to give a general algorithm which finds approximate top eigenvalue and eigenvectors simultaneously without using any assumption about $K$.
\begin{algorithm} [t]
\caption{This algorithm finds the top eigenvalue of a non-negative irreducible matrix.} \label{alg:perronvalue}
\begin{algorithmic}[1]
\Function{\findperronvalue}{$\ma$, $s_1$, $s_2$, $\epsilon$, $K$}
\State \textbf{Input:} $\ma\in \R_{\geq 0}^{n\times n}$ is an irreducible matrix, $s_1,s_2, K, \epsilon \in \R_{>0}$.
\State \textbf{Requirements:} $\epsilon < 1$, $s_1 < \rho(\ma) \leq s_2$, $K \geq \kappa(\eigl)+\kappa(\eigr)$
\If{$(1+\epsilon/2)s_1 \geq s_2$ }
\State \Return $s_2$
\EndIf
\State $s_m \eq \frac{s_1+s_2}{2}$
\State $\delta = \frac{1}{2} \frac{s_2 - s_1}{s_2 + s_1}$
\State $\vl, \vr \eq$ {\sc \mdecide}($\frac{\ma}{s_m(1+\delta/2)}$, $\delta/3$, $\frac{2K}{\delta}$)
\If{$\vl,\vr < \vzero$}
\State \Return {\sc \findperronvalue}($\ma$, $s_m$, $s_2$, $\epsilon$, $K$)
\Else
\State \Return {\sc \findperronvalue}($\ma$, $s_1$, $(1+\epsilon/2)s_m$, $\epsilon$, $K$)
\EndIf
\EndFunction
\end{algorithmic}
\end{algorithm}
\begin{lemma}\label{lem:perrron-find}
Given a non-negative irreducible matrix $\ma\in \R_{\geq 0}^{\nn}$, and $s_1,s_2,\epsilon,K \in \R_{\geq 0}$, let $\eigl, \eigr \in \R_{>0}^n$ be the left and right eigenvectors of $\ma$. Given $K \geq \kappa(\eigl)+\kappa(\eigr)$, $\rho(\ma) \in (s_1,s_2]$, and $\epsilon < 1/2$, {\sc \findperronvalue($\ma$, $s_1$, $s_2$, $\epsilon$, $K$)} returns $s\in \R_{>0}$, such that $\rho(\ma) \leq s < (1+\epsilon)\rho(\ma)$ in time
\[
O\Big(\mathcal{T}_{solve}\Big(m, n, \frac{7200 K^2}{\epsilon^2}, \frac{\epsilon^3}{1728000 K^3}\Big) \log(n \frac{K}{\epsilon}) \log\Big(\frac{\|\ma\|_1 + \|\ma\|_\infty}{\epsilon} \Big) \log(\frac{|s_1-s_2|}{\epsilon\rho(\ma)}) \Big)
\]
\end{lemma}
\begin{proof}
{\sc \findperronvalue} is a recursive function. We show in each recursive step $|s_1-s_2|$ is decreased by a multiplicative factor, while the requirement that $\rho(\ma) \in (s_1,s_2]$ is preserved. By invoking {\sc \mdecide}($\frac{\ma}{s_m(1+\delta/2)}$, $\delta/3$, $\frac{2K}{\delta}$) we get one of the following outcomes by Lemma \ref{lem:decision}:
\begin{itemize}
\item $\eye - \frac{\ma}{s_m}$ is not an M-matrix: This means $\rho(\ma) \in (s_m, s_2]$.
\item $(1+\delta) \eye - \frac{\ma}{s_m}$ is an M-matrix: This means $\rho(\ma) \in (s_1, (1+\delta)s_m]$.
\end{itemize}
Note that
$$
\max\{|s_m-s_2| , |s_1-(1+\delta)s_m|\} = \max\{\frac{|s_2 - s_1|}{2}, \frac{|s_2 - s_1|}{2} + \delta \frac{s_1 + s_2}{2} \} \leq \frac{3}{4} |s_2 - s_1|
$$
since $\delta$ was chosen to be $\frac{1}{2} \frac{s_2 - s_1}{s_2 + s_1}$. Thus in every iteration we cut the size of our interval by a constant factor. To finish, we will need an upper bound on the number of iterations needed before terminating as well as a lower bound on $\delta$ since it is the precision used inside of the {\sc \mdecide} calls. To do this, we make two simple observations. First, if we ever make a call where $s_2 \leq (1+\epsilon) s_1$, then we have $\rho(\ma) \leq s_2 \leq (1+\epsilon) s_1 \leq (1+\epsilon) \rho(\ma)$: we can (and do) return $s_2$ as our approximate spectral radius. Second, if we call the algorithm with $s_2 - s_1 \leq \frac{\epsilon}{2} \rho(\ma)$, we observe that $\rho(\ma) \leq s_2 = s_1 + |s2 - s1| \leq s_1 + \frac{\epsilon}{2} \rho(\ma)$ and thus $\frac{s_1}{1-\epsilon/2} \geq \rho(\ma)$. But now
\[
s_2 \leq s_1 + \frac{\epsilon}{2} \rho(\ma) \leq s_1 + \frac{\epsilon s_1}{2 - \epsilon} \leq (1 + \epsilon) s_1
\]
and by the previous observation $s_2$ is an $\epsilon$-approximate largest eigenvalue for $\ma$. With this insight as well as the previous guarantee on the interval size we can immediately bound the number of iterations before terminating by $O(\log(\frac{|s_1-s_2|}{\epsilon\rho(\ma)}))$: after this many steps we can guarantee the intervals we are considering have size at most $\frac{\epsilon}{2} \rho(\ma)$ and we consequently return our upper bound as a valid estimator.
To bound $\delta$, we note that we can freely assume that $s_2 - s_1 > \frac{\epsilon}{2} \rho(\ma)$: if otherwise we wouldn't even attempt to run {\sc \mdecide}. With this observation, we split our analysis into cases. If $s_2 - s_1 > \frac{1}{5} (s_2 + s_1)$, then we immediately see that
\[
\delta = \frac{1}{2} \frac{s_2 - s_1}{s_2 + s_1} > \frac{1}{10} \frac{s_2 + s_1}{s_2 + s_1} = \frac{1}{10}.
\]
If instead $s_2 - s_1 \leq \frac{1}{5} (s_2 + s_1)$, then we observe by rearrangement that $\frac{4}{5} s_2 \leq \frac{6}{5} s_1$ and therefore $s_1 + s_2 \leq \frac{5}{2} s_1 \leq \frac{5}{2} \rho(\ma)$. With this, we get
\[
\delta = \frac{1}{2} \frac{s_2 - s_1}{s_2 + s_1} > \frac{\epsilon}{4} \frac{\rho(\ma)}{s_2 + s_1} > \frac{\epsilon}{10} \frac{\rho(\ma)}{\rho(\ma)}. = \frac{\epsilon}{10}.
\]
Thus $\delta \geq \frac{\epsilon}{10}$. Since each call to {\sc \mdecide} requires
\[
O\Big(\mathcal{T}_{solve}\Big(m, n, \frac{72 K^2}{\delta^2}, \frac{\delta^3}{1728 K^3}\Big) \log(n \frac{K}{\epsilon}) \log\Big(\frac{\|\ma\|_1 + \|\ma\|_\infty}{\epsilon} \Big) \Big)
\]
time by Lemma \ref{lem:decision}, substituting in our bound for $\delta$ as well as our iteration cost yields the claimed running time.
\end{proof}
\subsubsection{Approximate top eigenvectors}\label{sec:approx-pvector}
So far we have shown how to compute the largest eigenvalue of a non-negative irreducible matrix $\ma$ within a multiplicative error of $\epsilon$. Next, we show how to use our developed machinery to get an approximate eigenvector of $\ma$ corresponding to this largest eigenvalue (See Definition~\ref{def:approx-ev} for approximate eigenvector).
The following lemma shows that if we are able to approximately solve linear systems in M-matrices, we can generate approximate top eigenvectors.
\begin{lemma}\label{lem:perron-approx}
Given a non-negative irreducible matrix $\ma\in \R_{\geq 0}^{n\times n}$ and $\epsilon \in \R_{>0}$, let $\vw \in \R^n$ be a vector where $\vw_i \in [\frac{1}{4}, \frac{7}{4}]$ for all $i$ and define $\vr = [(1+\epsilon)\eye - \frac{\ma}{\rho(\ma)}]^{-1} \vw$. We have $\|(\eye-\frac{\ma}{\rho(\ma)})\vr \|_\infty \leq 8 \epsilon \|\vr\|_\infty$.
\end{lemma}
\begin{proof}
By the triangle inequality, we have
\begin{align*}
\left\lVert(\eye-\frac{\ma}{\rho(\ma)})\vr \right\rVert_\infty &= \left\lVert \left[\left((1+\epsilon)\eye-\frac{\ma}{\rho(\ma)}\right) - \epsilon \eye\right] \vr \right\rVert_\infty \\
&\leq \left\lVert((1+\epsilon)\eye-\frac{\ma}{\rho(\ma)})\vr \right\rVert_\infty \! + \! \left\lVert\epsilon \vr \right\rVert_\infty \leq \left\lVert \vw \right\rVert_{\infty} + \epsilon\left\lVert\vr \right\rVert_\infty \leq \frac{7}{4} + \epsilon \left\lVert \vr \right\rVert_\infty.
\end{align*}
Now, we note that
\[
\|\vr\|_\infty = \|[(1+\epsilon)\eye - \frac{\ma}{\rho(\ma)}]^{-1} \vw \|_\infty = \|\frac{1}{1+\epsilon} \sum_{i=0}^{\infty} \left(\frac{\ma}{(1+\epsilon) \rho(\ma)}\right)^i \vw\|_\infty.
\]
Let $\vv$ be the top right eigenvector for $\ma$: note that this is a positive vector by Perron-Frobenius. As $\ma^i$ is nonnegative for any integer $i \geq 0$ and since $\vw_i \geq \frac{1}{4} \geq \frac{1}{4} \frac{\vv_i}{\|\vv\|_\infty}$ for any $i$, we obtain
\begin{align*}
\|\vr\|_\infty &= \|\frac{1}{1+\epsilon} \sum_{i=0}^{\infty} \left(\frac{\ma}{(1+\epsilon) \rho(\ma)}\right)^i \vw\|_\infty \\
&\geq \frac{1}{4} \|\frac{1}{1+\epsilon} \sum_{i=0}^{\infty} \left(\frac{\ma}{(1+\epsilon) \rho(\ma)}\right)^i \frac{\vv}{\|\vv\|_\infty}\|_\infty \\
&= \frac{1}{4 \| \vv \|_\infty} \|\frac{1}{1+\epsilon} \sum_{i=0}^{\infty} \left(\frac{\rho(\ma)}{(1+\epsilon) \rho(\ma)}\right)^i \vv \|_\infty \\
&= \frac{1}{4 \| \vv \|_\infty} \frac{1}{1+\epsilon} \sum_{i=0}^{\infty} \left(\frac{1}{1+\epsilon}\right)^i \| \vv \|_\infty = \frac{1}{4 \epsilon}.
\end{align*}
Combining these two facts yields
$$
\left\lVert(\eye-\frac{\ma}{\rho(\ma)})\vr \right\rVert_\infty \leq \frac{7}{4}+ \epsilon\left\lVert\vr \right\rVert_\infty \leq 8 \epsilon \norm{\vr}_\infty.
$$
\end{proof}
This fact inspires an algorithm for computing approximate Perron vectors. We first find $s \in (\rho(\ma), (1+\epsilon)\rho(\ma)]$ by using {\sc \findperronvalue} and next use {\sc $\code{MMatrix-Scale-Overview}$} to compute $\vl \approx {[(1+\epsilon)\eye-\frac{\ma}{s}]^{-1}}^\top \vones$ and $\vr \approx [(1+\epsilon)\eye-\frac{\ma}{s}]^{-1} \vones$. Note that by Lemma~\ref{lem:perron-approx}, $\vl$ and $\vr$ are approximate eigenvectors corresponding to $\rho(\ma)$. We formally state this in the following algorithm and thoerem.
\newcommand{$\code{Simple-Perron}$}{$\code{Simple-Perron}$}
\begin{algorithm}[h]
\caption{Simple Algorithm for computing the approximate largest eigenvalue and eigenvectors of a non-negative irreducible matrix $\ma$ when a bound on the condition number of the left and right eigenvectors are given.} \label{alg:perron-simple}
\begin{algorithmic}[1]
\Function{$\code{Simple-Perron}$}{$\ma$, $\epsilon$, $K$}
\State \textbf{Input:} $\ma\in \R_{\geq 0}^{n\times n}$ is an irreducible matrix, and $\epsilon,K >0$ is a real number.
\State \textbf{Output:} $\langle s, \vl, \vr \rangle$
such that $1< \frac{s}{\rho(\ma)} \leq 1+\epsilon$, $\norm{\vl^\top(\eye-\frac{\ma}{s})}_\infty <4\epsilon$, and $\norm{(\eye-\frac{\ma}{s})\vr}_\infty <4\epsilon$
\State $s \eq $ {\sc \findperronvalue}($\ma$, 0, $||A||_\infty$, $\epsilon$, $K$)
\State $\vl, \vr \eq$ {\sc $\code{MMatrix-Scale-Overview}$($\frac{\ma}{(1+\epsilon/2)s}$, $\epsilon/3$, $\frac{2K}{\epsilon}$)}
\State \Return $\langle s, \vl, \vr \rangle$
\EndFunction
\end{algorithmic}
\end{algorithm}
\begin{lemma}
Let $\ma$ be an irreducible nonnegative matrix. Let $1/4 > \epsilon > 0$ be a parameter, and let $K \geq \kappa(\eigl) + \kappa(\eigr)$. Then with high probability the procedure {\sc $\code{Simple-Perron}$}($\ma, \epsilon, K$) vectors $\vl, \vr$ satisfying $\norm{\vl^\top(\eye-\frac{\ma}{s})}_\infty < O(\epsilon) \norm{\vl}$ and $\norm{(\eye-\frac{\ma}{s})\vr}_\infty < O(\epsilon) \norm{\vr}$. This procedure runs in time
\[
O\Big(\mathcal{T}_{solve}\Big(m, n, O(\frac{K^2}{\epsilon^2}), O(\frac{\epsilon^3}{K^3}) \Big) \log(n \frac{K}{\\epsilon}) \log\Big(\frac{\|\ma\|_1 + \|\ma\|_\infty}{\epsilon} \Big) \log(\frac{|s_1-s_2|}{\epsilon\rho(\ma)}) \Big)
\]
\end{lemma}
\begin{proof}
By Lemma \ref{lem:perrron-find}, we have that $s \in (\rho(\ma), (1+\epsilon) \rho(\ma))$. Thus $\eye-\frac{\ma}{s}$ is an M-matrix. Thus, {\sc $\code{MMatrix-Scale-Overview}$} will succeed in finding scaling vectors $\vl_\epsilon$ and $\vr_\epsilon$ which satisfy $||((1+\epsilon/3)\eye-\frac{\ma}{(1+\epsilon/2)s}) \vr_\epsilon - \vones||_\infty \leq 1/2$ and $||((1+\epsilon/3)\eye-\frac{\ma}{(1+\epsilon/2)s})^\top \vl_\epsilon - \vones||_\infty \leq 1/2$. Define $\alpha = \frac{s}{\rho(\ma)}$. By rearranging these two equations we get
\[
||((1 + \epsilon) \alpha \eye - \frac{\ma}{\rho(\ma)}) \vr_\epsilon - \vones||_\infty \leq \frac{1+\epsilon/3}{2} \alpha
\]
and
\[
||((1+\epsilon) \alpha \eye-\frac{\ma}{\rho(\ma)})^\top \vl_\epsilon - \vones||_\infty \leq \frac{1+\epsilon/3}{2} \alpha.
\]
Since $(1+\epsilon)\alpha) \leq 1+ 2\epsilon$ and $\frac{1+\epsilon/3}{2} \leq \frac{3}{4}$, applying Lemma \ref{lem:perron-approx} implies the result. The running time follows from Lemma \ref{lem:decision}.
\end{proof}
\subsection{Fix for not knowing $K$}\label{sec:kfix}
All the algorithms we have presented for the M-matrix decision problem and the Perron problem depend on knowing an upper bound on the condition number of the left and right eigenvectors of $\ma$, namely $K$. Unfortunately we do not know this value in advance. To fix this we use a doubling technique and start with an initial guess $K=1$ and double it until we get the appropriate results. However, we run into a problem when naively implementing this strategy. For example, consider the M-matrix decision problem and function {\sc \mdecide} (Algorithm~\ref{alg:decision}). If {\sc \mdecide($\ma$, $\epsilon$, $K$)} fails (i.e. reports $\eye-\ma$ is not an M-matrix) it might be caused either by the fact that $\rho(\ma)>1$ or our guess for $K$ is wrong. Therefore, doubling does not give a fix in that case. But we are able to show that doubling gives us a fix for the Perron problem which in turn can be used to solve the M-matrix decision problem (without dependence on knowing $K$ in advance).
The main trick we use in our fix is represented in Lemma~\ref{lem:perron-approx-inverse} below. If we use doubling combined with {\sc \findperronvalue}, we are guaranteed that after $\log(\kappa(\eigr)+\kappa(\eigl))$ guesses for $K$, for any positive $\epsilon$ we get $\epsilon$ approximation to $\rho(\ma)$, but we cannot verify that as we do not know $\rho(A)$. Lemma~\ref{lem:perron-approx-inverse} gives us a tool to do that.
Let $\delta >0$ be any positive number less than one. Lemma~\ref{lem:perron-approx-inverse} suggests that if we had $s$ where
\begin{equation}\label{eq:fixk}
\rho(\ma) \leq s\leq (1+\frac{\delta}{8k(\eigr)^2})\rho(\ma),
\end{equation}
then we can construct a proof that $\rho(\ma) \geq (1-\delta) s$.
This gives us a convenient way to verify whether the approximation to the eigenvalue generated by {\sc \findperronvalue} is correct, and hence a way to determine if our choice of $K$ was large enough. Note that no matter the choice of $K$ our algorithm returns some $s > \rho(\ma)$.
.
\begin{lemma}\label{lem:perron-approx-inverse}
Given a non-negative irreducible matrix $\ma\in \R_{\geq 0}^{n\times n}$ and a real number $0<\epsilon <\frac{1}{8\kappa(\eigr)^2}$ where $\eigr\in \R_{>0}^n$ is the right eigenvector of $\ma$; Let $s$ be any real number such that $\rho(\ma) \leq s < (1+\epsilon)\rho(\ma)$, $\vr = [(1+\epsilon)\eye - \frac{\ma}{s}]^{-1}\vones$, and $\vv = \frac{\vr}{\|\vr\|_\infty}$, then $\mv^{-1} \frac{\ma}{s} \vv \geq (1-8\epsilon \kappa(\eigr)^2) \vones$.
\end{lemma}
\begin{proof}
We note that since $\eye - \frac{\ma}{s}$ is an M-matrix. By Lemma \ref{lemma:eigvec_scaling}, we obtain $\|\mr\|_\infty \leq \| [(1+\epsilon)\eye - \frac{\ma}{s}]^{-1}\|_\infty \leq \frac{\kappa(\eigr)}{\epsilon}$. Next we show an element-wise lower-bound on $\vr$. Let $\alpha = \rho(\ma)/s$. Since $\vones \geq \frac{\eigr}{\|\eigr\|_\infty}$, we observe
\begin{align}
\vr
&\geq \frac{1}{1+\epsilon}\sum_{i=0}^\infty \left(\frac{\alpha}{1+\epsilon}\right)^i \left(\frac{\ma}{\rho(\ma)}\right)^i \frac{\eigr}{\|\eigr\|_\infty}\nonumber\\
&= \frac{1}{1+\epsilon}\sum_{i=0}^\infty \left(\frac{\alpha}{1+\epsilon}\right)^i \frac{\eigr}{\|\eigr\|_\infty} \nonumber \\
&\geq \frac{1}{1+\epsilon-\alpha} \cdot \frac{\eigr}{\|\eigr\|_\infty} \label{eq:perron-approx-inverse-eq3}
\end{align}
Note that $ \frac{\eigr}{\|\eigr\|_\infty} \geq \frac{1}{\kappa(\eigr)}\vones$, and therefore by \eqref{eq:perron-approx-inverse-eq3}
\begin{equation}\label{eq:perron-approx-inverse-eq4}
\vr \geq \frac{1}{1+\epsilon-\alpha} \cdot \frac{\eigr}{\|\eigr\|_\infty} \geq \frac{1}{1+\epsilon-\alpha} \cdot \frac{1}{\kappa(\eigr)}\vones
\end{equation}
Now combining the above yields
\begin{equation}\label{eq:perron-approx-inverse-eq5}
\vv = \frac{\vr}{\|\vr\|_\infty} \geq \frac{\epsilon}{(1+\epsilon-\alpha)\kappa(\eigr)^2}\vones \quad
\Rightarrow \quad \diag(\mv)^{-1} \vones \leq \frac{(1+\epsilon-\alpha)\kappa(\eigr)^2}{\epsilon}\vones
\end{equation}
By Lemma~\ref{lem:perron-approx}, we have $\|(\eye - \frac{\ma}{s}) \vv \|_\infty < 4\epsilon$ and therefore
\begin{equation}\label{eq:perron-approx-inverse-eq6}
(\eye- \frac{\ma}{s}) \vv \leq \epsilon \vones \quad \Rightarrow \quad \frac{\ma}{s} \vv \geq \vv - 4\epsilon \vones.
\end{equation}
Now combining~\eqref{eq:perron-approx-inverse-eq5} and \eqref{eq:perron-approx-inverse-eq6}, we have,
\[
\diag(\mv)^{-1} \frac{\ma}{s} \vv \geq \vones - 4 \epsilon \cdot \diag(\mv)^{-1} \vones \geq \vones - 4(1+\epsilon-\alpha)\kappa(\eigr)^2\vones
\]
But $\alpha \geq \frac{1}{1+\epsilon}$ and hence $1+\epsilon - \alpha \leq 1+\epsilon - \frac{1}{1+\epsilon} \leq 2 \epsilon$. Therefore,
\[
\diag(\mv)^{-1} \frac{\ma}{s} \vv \geq \vones - 4(1+\epsilon-\alpha)\kappa(\eigr)^2\vones \geq (1-8\epsilon\kappa(\eigr)^2) \vones.
\]
\end{proof}
\newcommand{$\code{Compute-Perron}$}{$\code{Compute-Perron}$}
\begin{algorithm}[t]
\caption {The nearly linear time algorithm for computing the largest eigenvalue and its corresponding approximate eigenvectors} \label{alg:perron}
\begin{algorithmic}[1]
\Function{$\code{Compute-Perron}$}{$\ma$, $\delta$}
\State \textbf{Input:} $\ma\in \R_{\geq 0}^{n\times n}$ is an irreducible matrix, and $\delta \in \R_{>0}$ less than one.
\State \textbf{Output:} Real number $s>0$, and vectors $\vl, \vr\in \R_{>0}^{n}$ such that $(1-\delta) \rho(\ma) < s \leq \rho(\ma)$, $\norm{\vl^\top(\eye-\ma/s)}_\infty <\frac{\delta}{2K^2} \norm{\vl}_\infty$, and $\norm{(\eye-\ma/s)\vr}_\infty <\frac{\delta}{2K^2} \norm{\vr}_\infty$
\State $K \eq 1$
\While{true}
\State $\langle s, \vl, \vr \rangle \eq $ {\sc $\code{Simple-Perron}$}($\ma$, $\frac{\delta}{8K^2}$, $K$)
\If{$\vl$, $\vr$ are $\frac{\delta}{2K^2}$-approximate eigenvectors of $s$, \\and either $\mr^{-1}\ma\vr \geq (1-\delta)s\vones$ or $\ml^{-1}\ma^\top\vl \geq (1-\delta)s\vones$}
\State \Return $\langle s, \vl, \vr \rangle$
\EndIf
\State $K \eq 2K$
\EndWhile
\EndFunction
\end{algorithmic}
\end{algorithm}
Note that if $K \geq \kappa(\eigr)+\kappa(\eigl)$, then {\sc $\code{Simple-Perron}$($\ma$, $\frac{\delta}{8K^2}$,$K$)} returns $s$ and $\vr$ that satisfy the terms of Lemma~\ref{lem:perron-approx-inverse}. Therefore, they can be used to verify whether we are close enough to $\rho(\ma)$ or not. Knowing this we are ready to give our final algorithm which does not depend on knowing the right $K$ in advance. We start with $K=1$, and double $K$ in each iteration. In each iteration {\sc $\code{Simple-Perron}$($\ma$, $\frac{\delta}{8K^2}$,$K$)} is called. We do this until we get either $\diag(\vr)^{-1} \ma \vr \geq (1-\delta) s$, or $\diag(\vl)^{-1} \ma^\top \vl \geq (1-\delta) s$. A pseudo-code for this algorithm is provided in Algorithm~\ref{alg:perron}. Below is a short proof of Theorem~\ref{thm:perron-overview}.
\begin{proof}[Proof of Theorem~\ref{thm:perron-overview}]
Note that after $O\left(\log(\kappa(\eigl)+\kappa(\eigr))\right)$, $K$ becomes greater than or equal to $\kappa(\eigl)+\kappa(\eigr)$. At this point by Lemma~\ref{lem:perrron-find} and \ref{lem:perron-approx-inverse} , {\sc $\code{Simple-Perron}$} returns $\langle s, \vl, \vr \rangle$ such that $(1-\delta)\rho(\ma) < s \leq \rho(\ma)$, $\|(s \eye - \mm) \vr\|_\infty \leq \frac{\delta}{K^2}\norm{\vr}_\infty$, and $\|\vl^\top (s \eye - \mm)\|_\infty \leq \frac{\delta}{K^2}\norm{\vl}_\infty$. Thus giving the conditions in the problem statement. For the running time, note that each call to {\sc $\code{Simple-Perron}$} consists of a call to {\sc \findperronvalue} and a call to {\sc $\code{MMatrix-Scale-Overview}$}. By Lemma~\ref{lem:perrron-find}, each call to {\sc $\code{Simple-Perron}$} takes at most
\[
O\Big(\mathcal{T}_{solve}\Big(m, n, O(\frac{K^6}{\delta^2}), O(\frac{\delta^3}{K^9}) \Big) \log(n \frac{K}{\delta}) \log\Big(\frac{\|\ma\|_1 + \|\ma\|_\infty}{\delta} \Big) \log \left(\frac{|s_1-s_2|}{\delta\rho(\ma)}\right) \Big)
\]
time. As we run {\sc $\code{Simple-Perron}$} $O(\log K)$ times, the total running follows.
\end{proof}
As an immediate corollary to this result, our main theorem follows. We restate it for clarity.
\perron*
\begin{proof}
By using Theorem \ref{thm:rcdd_solver} inside of Theorem \ref{thm:perron-overview}, the result follows immediately.
\end{proof}
\section{Preliminaries}
\label{sec:prelim}
In this section we provide our notation (Section~\ref{sub:prelim_notation}) as well as facts about M-matrices (Section~\ref{sub:prelim_mmatrices}), the Perron-Frobenius theorem (Section~\ref{sub:perron-frobenius}), and RCDD matrices (Section~\ref{sub:prelim_rcdd}) that we use throughout the paper.
\input{notation}
\subsection{M-Matrices}
\label{sub:prelim_mmatrices}
This paper deals extensively with a broad prevalent class of matrices known as M-matrices. We will present some basic definitions and prove some basic facts about M-matrices here. We start by giving the formal definition of an M-matrix:
\begin{definition}[M-Matrix]
A matrix $\mm \in \R^{n \times n}$ is an M-matrix if it can be expressed as $\mm = s \mI - \mb$ where $s > 0$ and $\mb$ is an entrywise nonnegative matrix with $\rho(\mb) \leq s$.
\end{definition}
M-matrices have many useful properties, some of which can be found in \cite{berman1994nonnegative}. We state and prove the properties that are needed in our analysis, in Appendix (see Section~\ref{sec:mmatrix_facts}).
\subsection{Perron-Frobenius Theorem}
\label{sub:perron-frobenius}
Here we give several definitions and lemmas related to Perron-Frobenius theorem.
\begin{definition} A matrix $\ma\in \R^{n\times n}$ is called an irreducible matrix, if for every pair of row/column indices $i$ and $j$ there exists a natural number $m$ such that $\ma^m_{i,j}$ is non-zero.
\end{definition}
\begin{theorem}[Perron-Frobenius Theorem]
Let $\ma \in \R_{\geq 0}^{n \times n}$ be an irreducible matrix with spectral radius $s \eqdef \rho(\ma)$. Then the following facts hold:
\begin{itemize}
\item $s$ is a positive real number and it is an eigenvalue of $\ma$.
\item The eigenvalue corresponding to $s$ is simple, which means the left and right eigenspaces associated with $s$ are one-dimensional.
\item $\ma$ has a right eigenvector $\vv_R$ and a left eigenvector $\vv_L$ with eigenvalue $s$, which are component-wise positive. i.e. $\vv_L, \vv_R >0$.
\item The only eigenvectors whose components are all positive, are the ones associated with $s$.
\end{itemize}
\end{theorem}
\begin{lemma}[Collatz - Wielandt formula]\label{lem:collatz}
Given a non-negative irreducible matrix $\ma \in \R_{\geq 0}^{n\times n}$, for all non-negative non-zero vectors $x \in \R_{\geq 0}^n$, let $f(x)$ be the minimum value of $[\ma x]_i / x_i$ taken over all those $i$'s such that $x_i \neq 0$. Then $f$ is a real valued function whose maximum over all non-negative non-zero vectors $x$ is the Perron-Frobenius eigenvalue.
\end{lemma}
\subsection{Row Column Diagonally Dominant Matrices}
\label{sub:prelim_rcdd}
A key result in our paper is to reduce the problem of solving M-matrices to solving a sequence of row column diagonally dominant (RCDD) matrices and then leverage previous work on solving such systems. Here we provide the results and notation that we use in the remainder of the paper. We begin by defining RCDD matrices.
\begin{definition}[Row Column Diagonally Dominant (RCDD) Matrices] A matrix $\ma \in \R^{n \times n}$ is \emph{RCDD} if $\ma_{ii} \geq \sum_{j \neq i} |\ma_{ij}|$ and $\ma_{ii} \geq \sum_{j \neq i} |\ma_{ji}|$ for all $i \in [n]$. It is \emph{strictly RCDD} if each of these inequalities holds strictly.
\end{definition}
Our algorithms make extensive use of recent exciting results that show linear system in RCDD systems can be solved efficiently. Since our algorithms only use RCDD solvers as black box, through this paper we simply assume that we have oracle access to a RCDD solver defined as follows.
\begin{oracle}[RCDD Solver] \label{oracle:RCDDSolve}
Let $S \in \R^{n \times n}$ be an RCDD matrix, and let $x \in \R^n$ be a vector. Then there is a procedure, called $\code{RCDDSolve}(\ms, \epsilon)$ which can generate an operator $\opZ: \R^n \to \R^n$ where
\[
\Exp \left[ \|\vx - \ms \opZ (\vx)\|_2 \right] \leq \epsilon \| \vx \|_2
\]
Further, we can compute and apply $\opZ$ to vectors in $\mathcal{T}_{solve}(m, n,\kappa(\ms), \epsilon)$ time.
\end{oracle}
Designing faster RCDD solvers is an active area of research and therefore we parameterize our running times in terms of $\mathcal{T}_{solve}$ so that should faster RCDD solvers be developed our running times immediately improve. We achieve our claims about nearly linear time algorithms by leveraging the following results of \cite{coh16, coh17} that RCDD systems can be solved in nearly linear time.
\begin{theorem}[Nearly Linear Time RCDD Solvers \cite{coh16, coh17}]\label{thm:rcdd_solver}
It is possible to implement Oracle~\ref{oracle:RCDDSolve} with
$$
\mathcal{T}_{solve}(m, n,\kappa(\ms), \epsilon) = O((m + n)^{1 +o(1)} \log^{O(1)}(\kappa(\ms) / \epsilon))\,.
$$
\end{theorem}
\section{Numerically Stable M-Matrix Scaling}
\label{sec:scaling}
\newcommand{$\code{MMatrix-Scale}$}{$\code{MMatrix-Scale}$}
In this section, we analyze algorithm $\code{MMatrix-Scale}$$(\ma, \epsilon, K)$ in full detail. The algorithm can be viewed as a cousin to shift-and-invert preconditioning methods for the recovery of the top eigenvector of a matrix. Given an input M-matrix $\mm = s \eye - \ma$, our algorithm maintains a left-right scaling\footnote{As a reminder, a pair of diagonal matrices $(\ml,\mr)$ is a left-right scaling of an matrix $\mm$ if $\ml\mm \mr$ is RCDD.} $(\ml_\alpha , \mr_\alpha)$ of the matrix $\mm_\alpha \eqdef \mm + \alpha s \eye$ for progressively smaller values of $\alpha$. These scalings will be obtained by approximately solving the linear systems
\[
\mm_\alpha \vr_\alpha \approx \vones \hspace{3mm} \text{and} \hspace{3mm} \mm_\alpha^\top \vl_\alpha \approx \vones.
\]
As discussed in the previous section, we observe that we can assume $s=1$, as for any $\alpha \geq 0$ the matrix $\mm_\alpha' = \frac{1}{s}\mm_\alpha = (1+\alpha)\eye - \frac{1}{s}\ma$: solving the scaling problem for $\mm' = \eye - \frac{1}{s}\ma$ is identical to solving the scaling problem for $\mm$. We asume this throughout the rest of the section. We will choose our initial choice of $\alpha$ to be such that $\mm_\alpha$ is itself RCDD: thus our initial scalings can simply be $\vl = \vr = \frac{1}{\alpha} \vones$. In every step of our procedure, we will use our computed left-right scaling $(\ml_{2\alpha}, \mr_{2\alpha})$ of $\mm_{2 \alpha}$ to obtain a scaling of $\mm_{\alpha}$. We do this in three parts. We first use the recent result on solving RCDD linear systems to compute a good preconditioner $\mP_{2 \alpha}$ for the matrix $\mm_{2 \alpha}$ given the left-right scaling $(\ml_{2\alpha}, \mr_{2\alpha})$. We then show that under a certain measure of error this preconditioner for $\mm_{2 \alpha}$ also acts as a preconditioner for $\mm_\alpha$. Finally, we argue that by applying a standard iterative procedure preconditioned with $\mP_{2 \alpha}$ to solve $\mm_\alpha \vr_\alpha = \vones$ and $\mm_\alpha^\top \vl_\alpha = \vones$ we can solve these linear systems in a small number of iterations precisely enough to recover a scaling of $\mm_{\alpha}$. Once we have obtained our scaling of $\mm_\alpha$ we repeatedly halve $\alpha$ until our additive identity factor becomes small enough.
As discussed we begin by showing that solving M-matrices reduces to solving RCDD linear systems if we are given the left-right scaling of our desired M-matrix.
\begin{algorithm} [t]
\caption {\sc $\code{SolvefromScale}(\mm, \ml, \mr, \delta)$} \label{alg:SolveMFromScale}
\begin{algorithmic}[1]
\State \textbf{Input:} $\mm\in \R^{n\times n}$ is an M-matrix, $\ml , \mr \in \R^{\nn}$ are diagonal matrices where $\ml \mm \mr$ is RCDD, $\delta >0$ is a real number.
\State \textbf{output:} Operators $\Pleft, \Pright$ satisfying Theorem~\ref{lemma:MSolve}.
\State $\ms \gets \ml \mm \mr$;
\State $\opZ^{(r)} \gets \code{RCDDSolve}(\ms, \frac{\delta}{\kappa(\ml)})$ generated by Oracle~\ref{oracle:RCDDSolve};
\State $\opZ^{(l)} \gets \code{RCDDSolve}(\ms^\top, \frac{\delta}{\kappa(\mr)})$ generated by Oracle~\ref{oracle:RCDDSolve};
\State \Return operators $\Pright(\vx) = \mr \opZ^{(r)}(\ml \vx)$ and $\Pleft(\vx) = \ml \opZ^{(l)}(\mr \vx)$;
\end{algorithmic}
\end{algorithm}
\begin{lemma}\label{lemma:MSolve}
Let $\mm$ be an M-matrix. Let $\ml$ and $\mr$ be diagonal matrices where $\ms = \ml \mm \mr$ is RCDD. Let $\md$ be a (potentially unknown) positive definite matrix with condition number at most $\gamma$. Assume we have access to Oracle~\ref{oracle:RCDDSolve}. Then Algorithm~\ref{alg:SolveMFromScale} with $\delta = \frac{\epsilon}{\gamma}$ generates operators $\Pright$ and $\Pleft$
\[
\Exp \left[ \|\vb - \mm \Pright (\vb) \|_\md \right] \leq \epsilon \|\vb\|_\md
~ \text{ and } ~
\Exp \left[ \|\vb - \mm^\top \Pleft (\vb) \|_{\md^{-1}} \right] \leq \epsilon \|\vb\|_{\md^{-1}}
~.
\]
for any given $\vb$. We can compute and apply both $\Pright$ and $\Pleft$ to $\vb$ in time
\[O(\mathcal{T}_{solve}(m, n, \kappa(\ml \mm \mr), \frac{\epsilon}{\gamma \kappa(\mr)}) + \mathcal{T}_{solve}(m, n, \kappa(\ml \mm \mr), \frac{\epsilon}{\gamma \kappa(\ml)})) ~.
\]
\end{lemma}
\begin{proof}
Consider the output of Algorithm~\ref{alg:SolveMFromScale}. We observe that
\begin{align*}
\|\vb - \mm \Pright (\vb) \|_2 &=\|\vb - \mm \mr \opZ^{(r)}(\ml \vb) \|_2 \\
&= \|\vb - \ml^{-1} \ms \mr^{-1} \mr \opZ^{(r)}(\ml \vb) \|_2 \\
&= \|\ml^{-1} \ml \vb - \ml^{-1} \ms \opZ^{(r)}(\ml \vb) \|_2 \\
&\leq \|\ml^{-1}\|_2 \, \|\ml \vb - \ms \opZ^{(r)}(\ml \vb) \|_2 .
\end{align*}
However by the guarantee of Oracle~\ref{oracle:RCDDSolve} and the construction of $\opZ^{(r)}$ we have that
\[
\Exp \left[ \|\ml \vb - \ms \opZ^{(r)}(\ml \vb) \|_2 \right] \leq \frac{\epsilon}{\gamma \kappa(\ml)} \|\ml \vb\|_2 \leq \frac{\epsilon}{\gamma \kappa(\ml)} \, \|\ml\|_2 \, \|\vb\|_2.
\]
Taking expectation over $\opZ^{(r)}$ and combining these two facts gives
\[
\Exp \left[ \|\vb - \mm \Pright (\vb) \|_2 \right] \leq \frac{\epsilon}{\gamma \kappa(\ml)} \, \|\ml^{-1}\|_2 \, \|\ml\|_2 \, \|\vb\|_2 = \frac{\epsilon}{\gamma} \|\vb\|_2.
\]
Now, we note that $\|\vy\|_2 \leq \|\vz\|_2$ implies $\|\vy\|_\md \leq \kappa(\md) \|\vz\|_\md$ for any $\vy, \vz \in \R^n$, and so we have
\[
\Exp \left[ \|\vb - \mm \Pright (\vb) \|_\md \right] \leq \frac{\kappa(\md) \epsilon}{\gamma} \|\vb\|_\md \leq \epsilon \|\vb\|_\md.
\]
Repeating this analysis with $\Pleft$ in the $\md^{-1}$ norm gives the analogous
\[
\Exp \left[ \|\vb - \mm^\top \Pleft (\vb) \|_{\md^{-1}} \right] \leq \epsilon \|\vb\|_{\md^{-1}}
\]
as desired. To bound the running time, we observe that computing and applying $\Pright$ and $\Pleft$ to vectors requires only computing and applying $\opZ^{(r)}$ and $\opZ^{(l)}$ and $O(n)$ additional work to apply $\mr$ and $\ml$. By the running time assumption of Oracle~\ref{oracle:RCDDSolve} and the error parameters chosen, we obtain that $\code{SolvefromScale(\mm,\ml,\mr,\frac{\epsilon}{\gamma})}$ runs in time
\[
O\left(\mathcal{T}_{solve}\left(m, n, \kappa(\ml \mm \mr), \frac{\epsilon}{\gamma \kappa(\mr)}\right) + \mathcal{T}_{solve}\left(m, n,\kappa(\ml \mm \mr), \frac{\epsilon}{\gamma \kappa(\ml)}\right)\right).
\]
\end{proof}
\begin{algorithm} [t]
\caption {\sc $\code{MMatrix-Scale}$$(A, \epsilon, K)$} \label{alg:MMatrix}
\begin{algorithmic}[1]
\State \textbf{Input:} $\ma \in \R_{\geq 0}^{n\times n}$ is an irreducible matrix with $\rho(\ma)<1$, and $\epsilon, K >0$ are real numbers.
\State \textbf{Output:} Positive diagonal scalings $\ml$ and $\mr$ such that $\ml [(1+\epsilon) \eye - A] \mr$ is RCDD
\State $\alpha \eq 2 \max\{\|A\|_1, \|A\|_\infty\}$
\State $\vl_\alpha \gets \frac{1}{\alpha} \vones, \quad \vr_\alpha \gets \frac{1}{\alpha} \vones$
\While{$\alpha > \epsilon$}
\State $\alpha \eq \alpha/2, \quad k \gets 0$
\State $\vl_{\alpha}^{\, \, (0)} \gets \vzero, \quad \vr_{\alpha}^{\, \, (0)} \gets \vzero$
\State $\mm_\alpha = (1+\alpha) \eye - A$.
\While{$\|\mm_{\alpha} \vr_{\alpha}^{\, \, (k)} - \vones\|_\infty > \frac{1}{2}$ or $\|\mm_{\alpha}^\top \vl_{\alpha}^{\, \, (k)} - \vones\|_\infty > \frac{1}{2}$}
\State $\Prightk_{2 \alpha}, \Pleftk_{2 \alpha} \gets \code{SolvefromScale}(\mm_{2\alpha}, \ml_{2 \alpha}, \mr_{2\alpha}, \frac{1}{8 K})$
\State $\vl_{\alpha}^{\, \,(k+1)} \eq \vl_{\alpha}^{\, \, (k)} - \Pleftk_{2 \alpha} (\mm^{\top}_{\alpha} \vl_{\alpha}^{\, \, (k)} - \vones)$
\State $\vr_{\alpha}^{\, \, (k+1)} \eq \vr_{\alpha}^{\, \, (k)} - \Prightk_{2 \alpha} (\mm_\alpha \vr_{\alpha}^{\, \, (k)} - \vones)$
\State $k \gets k + 1$
\EndWhile
\State $\vl_\alpha, \vr_\alpha \eq \vl_\alpha^{\, \, (k)}, \vr_\alpha^{\, \, (k)}$
\EndWhile
\State \Return $\ml_\alpha,\mr_\alpha$ with $\ml_\alpha \mm_{\epsilon} \mr_\alpha$ being RCDD
\end{algorithmic}
\end{algorithm}
With this fact, we move to the second part of our proof. Lemma~\ref{lemma:MSolve} tells us that we can compute operators $\Pright_{2 \alpha}$ and $\Pleft_{2 \alpha}$ given $\mm_{2 \alpha}$ and $(\ml_{2 \alpha}, \mr_{2 \alpha})$ which approximately act as $\mm_{2\alpha}$ and $\mm_{2\alpha}^\top$ respectively. Further, we can ensure the error of our operators is small in any positive definite $\md$-norm. We will use this result to show that $\Pright_{2 \alpha}$ and $\Pleft_{2 \alpha}$ function are adequate preconditioners for solving $\mm_\alpha \vr_\alpha = \vones$ and $\mm_\alpha^\top \vl_\alpha = \vones$ respectively.
\begin{lemma} \label{lemma:MProg}
Let $\mm$ be an M-matrix. Let $\md$ be any positive definite matrix where $\md^{-1/2} \mm^\top \md^{1/2} + \md^{1/2} \mm \md^{-1/2}$ is positive semidefinite. Let $\gamma \geq \kappa(\md)$. Let $\alpha > 0$ be some parameter. Then if $(\Pright_{2 \alpha}, \Pleft_{2\alpha}) = \code{SolvefromScale}(\mm_{2\alpha}, \ml_{2 \alpha}, \mr_{2\alpha}, \frac{1}{8 \gamma})$, for any vector $\vx$ we have
\[
\Exp \left[ \| \vx - \mm_\alpha \Pright_{2 \alpha} (\vx) \|_\md \right] \leq \frac{3}{4} \|\vx\|_\md \quad \text{and} \quad \Exp \left[ \|\vx - \mm_\alpha^\top \Pleft_{2 \alpha} (\vx) \|_{\md^{-1}} \right] \leq \frac{3}{4} \|\vx\|_{\md^{-1}}.
\]
\end{lemma}
\begin{proof}
Observe that by the triangle inequality
\begin{align*}
\left\lVert\vx - \mm_\alpha \Pright_{2 \alpha} (\vx)\right\rVert_\md &= \left\lVert \vx - \mm_{2\alpha} \Pright_{2 \alpha} (\vx) + \mm_{2\alpha} \Pright_{2 \alpha} (\vx) - \alpha \mm_{2\alpha}^{-1} \vx + \alpha \mm_{2\alpha}^{-1} \vx - \mm_\alpha \Pright_{2 \alpha} (\vx) \right\rVert_\md \\
&\leq \left\lVert\vx - \mm_{2\alpha} \Pright_{2 \alpha}(\vx) \right\rVert_\md + \alpha \left\lVert\mm_{2\alpha}^{-1} \vx \right\rVert_\md\\ &\phantom{{}={}} +\left\lVert(\mm_{2\alpha} \Pright_{2 \alpha}(\vx) - \alpha \mm_{2\alpha}^{-1}\vx - \mm_\alpha \Pright_{2 \alpha}(\vx)\right\rVert_\md ~.
\end{align*}
We bound the expected value over $\Pright_{2\alpha}$ of each of these three terms in order. We see first that
\[
\Exp \left[ \left\lVert\vx - \mm_{2\alpha} \Pright_{2 \alpha}(\vx) \right\rVert_\md \right] \leq \frac{1}{8} \left\lVert\vx\right\rVert_\md.
\]
by the definition of $\Pright_{2\alpha}$ and Lemma~\ref{lemma:MSolve}. Further,
\[
\Exp \left[ \left\lVert\mm_{2\alpha}^{-1} x \right\rVert_\md \right] = \left\lVert\mm_{2\alpha}^{-1} x \right\rVert_\md \leq \left\lVert\mm_{2\alpha}^{-1}\right\rVert_\md \left\lVert \vx \right\rVert_\md
\]
by the definition of the induced $\md$-norm. Finally, we have
\begin{align*}
\Exp \left[ \left\lVert \mm_{2\alpha} \Pright_{2 \alpha}(\vx) - \alpha \mm_{2\alpha}^{-1} \vx - \mm_\alpha \Pright_{2 \alpha}(\vx)\right\rVert_\md \right] &= \Exp \left[ \left\lVert\alpha \Pright_{2 \alpha}(\vx) - \alpha \mm_{2\alpha}^{-1} \vx \right\rVert_\md \right] \\
&= \alpha \Exp \left[ \left\lVert\mm_{2 \alpha}^{-1} (\vx - \mm_{2 \alpha} \Pright_{2 \alpha}(\vx))\right\rVert_\md \right] \\
&\leq \alpha \left\lVert\mm_{2 \alpha}^{-1}\right\rVert_\md \Exp \left[ \left\lVert\vx - \mm_{2 \alpha} \Pright_{2 \alpha}(\vx)\right\rVert_\md \right] \\
&\leq \frac{\alpha}{8} \left\lVert\mm_{2 \alpha}^{-1}\right\rVert_\md \left\lVert\vx\right\rVert_\md,
\end{align*}
where we again use Lemma~\ref{lemma:MSolve} in the last step. Taking expectation over $\Pright_{2\alpha}$ in our original fact and applying these three inequalities yields
\[
\Exp \left[ \left\lVert \vx - \mm_\alpha \Pright_{2 \alpha}(\vx)\right\rVert_\md \right] \leq \Big( \frac{1}{8} + \frac{9 \alpha}{8} \left\lVert\mm_{2\alpha}^{-1}\right\rVert_\md \Big) \left\lVert \vx\right\rVert_\md.
\]
By repeating this analysis for the left scaling, we can further obtain
\[
\Exp \left[ \left\lVert \vx- \mm_\alpha^\top \Pleft_{2 \alpha}(\vx)\right\rVert_{\md^{-1}} \right] \leq \Big( \frac{1}{8} + \frac{9 \alpha}{8} \left\lVert\mm_{2\alpha}^{-\top}\right\rVert_{\md^{-1}} \Big) \left\lVert \vx \right\rVert_{\md^{-1}} = \Big( \frac{1}{8} + \frac{9 \alpha}{8} \left\lVert \mm_{2\alpha}^{-1}\right\rVert_\md \Big) \left\lVert \vx \right\rVert_{\md^{-1}}
\]
as $\left\lVert\mm_{2\alpha}^{-1}\right\rVert_\md = \left\lVert\mm_{2\alpha}^{-\top}\right\rVert_{\md^{-1}}$. Now, note that by Lemma \ref{lem:preconditioner} we have $ \left\lVert\mm_{2\alpha}^{-1}\right\rVert_{\md} \leq \frac{1}{2\alpha}$. Substituting this into the above expressions gives us
\[
\Exp \left[ \left\lVert \vx - \mm_\alpha \Pright_{2 \alpha}(\vx)\right\rVert_\md \right] \leq \Big( \frac{1}{8} + \frac{9 \alpha}{8} \left\lVert \mm_{2\alpha}^{-1}\right\rVert_\md \Big) \left\lVert x\right\rVert_\md \leq \Big( \frac{1}{8} + \frac{9 \alpha}{16 \alpha} \Big) \left\lVert x\right\rVert_\md < \frac{3}{4} \left\lVert x\right\rVert_\md.
\]
and
\[
\Exp \left[ \left\lVert \vx- \mm_\alpha^\top \Pleft_{2 \alpha}(\vx)\right\rVert_{\md^{-1}} \right] \leq \Big( \frac{1}{8} + \frac{9 \alpha}{8} \left\lVert\mm_{2\alpha}^{-1}\right\rVert_\md \Big) \left\lVert x\right\rVert_{\md^{-1}} \leq \Big( \frac{1}{8} + \frac{9 \alpha}{16 \alpha} \Big) \left\lVert x\right\rVert_{\md^{-1}} < \frac{3}{4} \left\lVert x\right\rVert_{\md^{-1}}
\]
as claimed.
\end{proof}
This lemma gives us a useful handle on how much we can expect our error to decay in each iteration of the inner loop of our algorithm. To formalize this, we show the following lemma:
\begin{lemma} \label{lemma:scaling_innerloop}
Let $\md$ be a (potentially unknown) matrix where $\md^{-1/2} \mm^\top \md^{1/2} + \md^{1/2} \mm \md^{-1/2}$ is PD, and let $\gamma \geq \kappa(\md)$. If we choose $K = \frac{1}{8 \gamma}$ in Algorithm~\ref{alg:MMatrix}, we have for some $k = O(\log (n \kappa(\md)))$ that $\|\mm_{\alpha} \vr_{\alpha}^{\, \, (k)} - \vones\|_\infty \leq \frac{1}{2}$ and $\|\mm_{\alpha}^\top \vl_{\alpha}^{\, \, (k)} - \vones\|_\infty \leq \frac{1}{2}$ with high probability with respect to $n$ for any $\alpha > 0$. Each iteration of the while loop to compute each $\vr_{\alpha}^{\, \, (i)}$ and $\vl_{\alpha}^{\, \, (i)}$ can be implemented in time
\[
O\Big(\mathcal{T}_{solve}\big(m, n, \kappa(\ml_{2 \alpha} \mm_{2 \alpha} \mr_{2 \alpha}), \frac{1}{8 \gamma \kappa(\mr_{2 \alpha})}\big) \! +\! \mathcal{T}_{solve}\big(m, n, \kappa(\ml_{2 \alpha} \mm_{2 \alpha} \mr_{2 \alpha}), \frac{1}{8 \gamma \kappa(\ml_{2 \alpha})}\big)\Big).
\]
\end{lemma}
\begin{proof}
Let us first consider the algorithm's update to $\vr_\alpha$. Observe that
\[
\mm_\alpha \vr_\alpha^{\, \, (k+1)} - \vones = \mm_\alpha \vr_{\alpha}^{\, \, (k)} - \vones - \mm_\alpha \Prightk_{2 \alpha}(\mm_\alpha \vr_{\alpha}^{\, \, (k)} - \vones).
\]
With this, let us define $\ve^{\, \, (k)}_r = \mm_\alpha \vr_{\alpha}^{\, \, (k)} - \vones$ and consider $\mathbb{E} [ \| \ve^{\, \, (k+1)}_r \|_\md ]$ where the expectation is taken over $\Prightk_{2 \alpha}$. By Lemma~\ref{lemma:MProg} it follows that
\[
\Exp \left[ \left\lVert \ve^{\, \, (k+1)}_r \right\rVert_\md \right] = \Exp \left[ \left\lVert \ve^{\, \, (k)}_r - \mm_\alpha \Pright_{2 \alpha}(\ve^{\, \, (k)}_r) \right\rVert_\md \right] \leq \frac{3}{4} \left\lVert \ve^{\, \, (k)}_r \right\rVert_\md ~.
\]
Thus by inducting on $k$ we obtain
\[
\Exp \left[ \|\ve^{\, \, (k)}_r\|_\md \right] \leq \Big(\frac{3}{4}\Big)^k \|\ve^{\, \, (0)}_r \|_\md =\Big(\frac{3}{4}\Big)^k \|\vones\|_\md
\]
for any $k$, where the expectation is taken over all the $\mP_{2\alpha}^{(r,i)}$ chosen. Now note that if for vectors $\vy, \vz$ we have $\| \vy \|_\md \leq \| \vz \|_\md$ then $\| \vy \|_2 \leq \kappa(\md) \| \vz \|_2$. Applying this to the above yields
\[
\Exp \left[ \|\ve^{\, \, (k)}_r\|_\infty \right] \leq \Exp \left[ \|\ve^{\, \, (k)}_r\|_2 \right] \leq \kappa(\md) \Big(\frac{3}{4}\Big)^k \|\vones \|_2 = \sqrt{n} \kappa(\md) \Big(\frac{3}{4}\Big)^k.
\]
Applying the same chain of reasoning to $\vl_\alpha$ with $\mP^{(l, i)}_{2 \alpha}$ in the $\md^{-1}$ norm allows us to similarly conclude
\[
\Exp \left[ \|\ve^{\, \,(k)}_l\|_\infty \right] \leq \Exp \left[ \|\ve^{\, \,(k)}_l\|_2 \right] \leq \kappa(\md) \Big(\frac{3}{4}\Big)^k \|\vones\|_2 = \sqrt{n} \kappa(\md) \Big(\frac{3}{4}\Big)^k
\]
by Lemma~\ref{lemma:MProg}. With the choice of $k$ given above, both of these quantities are at most $\frac{1}{\poly(n)}$. With this, we have
\[
\Pr( \|\ve^{\, \,(k)}_r \|_\infty > 1/2 ) \leq 2 \Exp \left[ \|\ve^{\, \, (k)}_r \|_\infty \right]\leq \frac{1}{\poly(n)}
\]
\[
\Pr( \|\ve^{\, \, (k)}_l \|_\infty > 1/2 ) \leq 2 \Exp \left[ \|\ve^{\, \, (k)}_l \|_\infty \right]\leq \frac{1}{\poly(n)}
\]
by Markov's inequality-- by the union bound we thus have both $\|\ve^{\, \, (k)}_r \|_\infty \leq 1/2$ and $\|\ve^{\, \, (k)}_l \|_\infty \leq 1/2$ with probability at least $1 - \frac{1}{\poly(n)}$. The running time per iteration follows trivially from Lemma~\ref{lemma:MSolve}: to compute $\vr_{\alpha}^{\, \, (i+1)}, \vl_{\alpha}^{\, \, (i+1)}$ from $\vr_{\alpha}^{\, \, (i)}, \vl_{\alpha}^{\, \, (i)}$ we need to compute $\Prightk_{2\alpha}$ and $\Pleftk_{2\alpha}$, apply each of these operators to a single vector, and do $O(m)$ additional work in matrix-vector products. This can clearly be implemented in the desired running time.
\end{proof}
Now, we are ready to prove the main theorem of this section.
\begin{theorem}
\label{thm:scaling}
Let $\ma \in \R^{\nn}$ be a nonnegative matrix with $m$ nonzero entries and $\rho(\ma) < 1$, and let $\mm = \eye - \ma$. Pick $\epsilon > 0$, and let $K \geq \max (\|\mm^{-1}\|_\infty, \|\mm^{-1}\|_1)$ be some known parameter. Then, the algorithm $\code{MMatrix-Scale}$$(\ma, \epsilon, K)$ computes a pair of diagonal matrices $(\ml, \mr)$ where $\ml((1+\epsilon)\eye - \ma)\mr$ is RCDD with high probability. This algorithm runs in time
\[
O\Big(\mathcal{T}_{solve}\Big(m, n, 18 K^2, \frac{1}{216 K^3}\Big) \log(n K) \log\Big(\frac{\|\ma\|_1 + \|\ma\|_\infty}{\epsilon} \Big) \Big).
\]
\end{theorem}
\begin{proof}
We begin by proving the algorithm's correctness. We observe that at the start of the algorithm, we consider $\mm_\alpha$ with a large value of $\alpha$ to make it RCDD with a trivial scaling by Lemmas \ref{lemma:init_scaling} and \ref{lemma:MMatrix_RCDD}. In addition, at every level of $\alpha$ we hit in the algorithm we use a valid scaling of $\mm_{2\alpha}$ to end up with a pair of vectors $\vl_\alpha, \vr_\alpha$ where $\|\mm_\alpha \vr_\alpha - \vones \|_\infty \leq \frac{1}{2}$ and $\|\mm_\alpha^\top \vl_\alpha - \vones \|_\infty \leq \frac{1}{2}$. Thus, we are able to find $\vl_\alpha, \vr_\alpha$ where for any $i \in [n]$ we have $(\mm_\alpha \vr_\alpha)_i \in [\frac{1}{2}, \frac{3}{2}]$ and $(\mm_\alpha^\top \vl_\alpha)_i \in [\frac{1}{2}, \frac{3}{2}]$. By Lemma~\ref{lemma:MMatrix_RCDD} we therefore see $\ml_\alpha \mm_\alpha \mr_\alpha$ is an RCDD matrix. Therefore when the algorithm terminates, we return a pair of vectors $\vl_{\alpha^*}, \vr_{\alpha^*}$ where $\ml_{\alpha^*} \mm_{\alpha^*} \mr_{\alpha^*}$ is RCDD. But since $\alpha^* \leq \epsilon$ we see $\ml_{\alpha^*} \mm_{\epsilon} \mr_{\alpha^*} = \ml_{\alpha^*} (\mm_{\alpha^*}+ (\epsilon-\alpha^*)\eye) \mr_{\alpha^*}= \ml_{\alpha^*} \mm_{\alpha^*} \mr_{\alpha^*} + (\epsilon- \alpha^*)\ml_{\alpha^*} \mr_{\alpha^*}$: this is RCDD since $\epsilon - \alpha^* \geq 0$, $\ml_{\alpha^*}$ and $\mr_{\alpha^*}$ are both positive by Lemma~\ref{lemma:MMatrix_monotone}, and the fact that the sum of two RCDD matrices is RCDD.
We now bound the running time. To do this, we first bound the cost of a single phase of going from scalings of $\mm_{2\alpha}$ to $\mm_{\alpha}$. As alluded to above, by Lemma~\ref{lemma:init_scaling} and the invariant that our algorithm maintains we can assume inductively that $(\mm_{2 \alpha} \vr_{2 \alpha})_i \in [\frac{1}{2}, \frac{3}{2}]$ and $(\mm_{2 \alpha}^\top \vl_{2 \alpha})_i \in [\frac{1}{2}, \frac{3}{2}]$ for any $i$. Define $\vr_0 = \mm_0^{-1} \vones$, $\vl_0 = \mm_0^{-\top} \vones$, and $\md = \ml_0 \mr_0^{-1}$. We observe that $\mm$ is an M-matrix and that $\ml \mm \mr$ is RCDD by Lemma~\ref{lemma:MMatrix_RCDD}: thus by Lemma~\ref{lem:pdscaling} we conclude that $\md^{-1/2} \mm_0^\top \md^{1/2} + \md^{1/2} \mm_0 \md^{-1/2} \succeq \mzero$. By Lemma~\ref{lemma:scaling_condition}, we see that
\begin{itemize}
\item $\kappa(\ml_{2\alpha} \mm_{2\alpha} \mr_{2\alpha}) \leq 18 ||\mm^{-1}||_\infty ||\mm^{-1}||_1 \leq 18 K^2$
\item $\kappa(\ml_{2\alpha}) \leq 3 ||\mm^{-1}||_1 \leq 3 K $
\item $\kappa(\mr_{2\alpha}) \leq 3 ||\mm^{-1}||_\infty \leq 3 K$
\item $\kappa(\md) \leq 9 ||\mm^{-1}||_\infty ||\mm^{-1}||_1 \leq 9 K^2$.
\end{itemize}
We note that $9 K^2 \geq \kappa(\md)$, and by Lemma~\ref{lemma:scaling_innerloop} we can compute $\vl_\alpha, \vr_\alpha$ satisfying $(\mm_\alpha \vr_\alpha)_i \in [\frac{1}{2}, \frac{3}{2}]$ and $(\mm_\alpha^\top \vl_\alpha)_i \in [\frac{1}{2}, \frac{3}{2}]$ in $O(\log(n \kappa(\md)))$ iterations each costing
\[
O\Big(\mathcal{T}_{solve}\big(m, n, \kappa(\ml_{2 \alpha} \mm_{2 \alpha} \mr_{2 \alpha}), \frac{1}{72 K^2 \kappa(\mr_{2 \alpha})}\big) \! +\! \mathcal{T}_{solve}\big(m, n, \kappa(\ml_{2 \alpha} \mm_{2 \alpha} \mr_{2 \alpha}), \frac{1}{72 K^2 \kappa(\ml_{2 \alpha})}\big)\Big).
\]
time. Plugging in our condition number bounds and simplifying yields that in time
\[
O\Big(\mathcal{T}_{solve}\big(m, n, 18 K^2, \frac{1}{216 K^3}\big) \log(n K) \big)
\]
we can go from our scalings of $\mm_{2\alpha}$ to scalings of $\mm_\alpha$. Since $\alpha$ is halved only $O(\log(\frac{\|\ma\|_1 + \|\ma\|_{\infty}}{\epsilon}))$ times, the result follows.
\end{proof}
\begin{algorithm} [t]
\caption {\sc $\code{SolveM}(\ma, \epsilon, K)$} \label{alg:SolveM}
\begin{algorithmic}[1]
\State \textbf{Input:} $\ma\in \R^{n\times n}$ is an M-matrix, $K$ some parameter satisfying $K \geq \max \{ \|(\eye - \ma)^{-1}\|_\infty, \|(\eye - \ma)^{-1}\|_1 \}$, $\epsilon >0$ is a real number.
\State \textbf{output:} Operators P satisfying Theorem~\ref{lemma:MSolve}.
\State $\ml, mr \gets $ $\code{MMatrix-Scale}$$(\ma, \epsilon, K)$;
\State $\ms \gets \ml ((1+\epsilon) \eye - \ma) \mr$;
\State $\opZ^{(r)} \gets \code{RCDDSolve}(\ms, \frac{\delta}{\kappa(\ml)})$ generated by Oracle~\ref{oracle:RCDDSolve};
\State \Return operators $\Pright(\vx) = \mr \opZ^{(r)}(\ml \vx)$
\end{algorithmic}
\end{algorithm}
Our main result for scaling M-matrices follows as a corollary. We restate it for convenience:
\mscaler*
\begin{proof}
Observe that we can assume $s=1$ without loss of generality. By using Theorem \ref{thm:rcdd_solver} inside of Theorem \ref{thm:scaling}, we can replace the $\mathcal{T}_{solve}$ with $\otilde(m)$: the claim follows immediately.
\end{proof}
We also demonstrate that this scaling procedure also gives an efficient algorithm for solving M-matrices and thereby proves Theorem \ref{thm:msolve}. We restate it as well.
\msolve*
\begin{proof}
Consider Algorithm \ref{alg:SolveM} above. By Theorems \ref{thm:mscale} and \ref{thm:rcdd_solver}, we see that $(\ml, \mr)$ is a valid scaling of $((1+\epsilon) s \eye - \ma)$ and thus $\code{RCDDSolve}$ generates a solver for $\ms$. The theorem follows by relatively straightforward algebra analogous to Theorem \ref{lemma:MSolve}.
\end{proof}
This concludes the proof of our algorithm for computing RCDD scalings of M-matrices. In many settings the norm of $\mm^{-1}$ is fairly small and can be reasoned about in a relatively straightforward fashion. However, in the next section on computing Perron vectors, we will be computing scalings for M-matrices which are nearly singular. Thus, we will want a bound on our algorithm's running time which is hopefully independent on how ill-conditioned the matrix $\mm$ is. Fortunately, we can obtain such a bound as a straightforward corollary of our main result:
\begin{corollary} \label{corollary:scale_eigenvec}
Let $\ma \in \R^{\nn}$ be a nonnegative matrix with $m$ nonzero entries and $\rho(\ma) < 1$. Pick $\epsilon \in [0,1]$, and let $\mm_{\epsilon/2} = (1+ \frac{\epsilon}{2})\eye - \ma$. Let $\eigl$ and $\eigr$ denote the left and right top eigenvectors of $\ma$, respectively. Let $\gamma \geq \kappa(\eigl) + \kappa(\eigr)$. Then the algorithm $\code{MMatrix-Scale}$$(\frac{\ma}{1+\epsilon/2}, \epsilon/3, \frac{2 \gamma}{\epsilon})$ generates a pair of diagonal matrices $(\ml, \mr)$ where $\ml((1+\epsilon)\eye - \ma)\mr$ is RCDD with high probability. This procedure runs in time
\[
O\left(\mathcal{T}_{solve}\left(m, n, \frac{72 \gamma^2}{\epsilon^2}, \frac{\epsilon^3}{1728 \gamma^3}\right) \log\left(n \frac{\gamma}{\epsilon}\right) \log\left(\frac{\|\ma\|_1 + \|\ma\|_\infty}{\epsilon} \right) \right).
\]
\end{corollary}
\begin{proof}
By the previous theorem, $\code{MMatrix-Scale}$$(\frac{\ma}{1+\epsilon/2}, \epsilon/3, K)$ generates a pair of diagonal matrices $(\ml, \mr)$ where $\ml((1+\frac{\epsilon}{3})\eye - \frac{\ma}{1+\epsilon/2})\mr$ is RCDD. Now, multiplying by a constant will not change tha RCDDness of the resulting matrix, and since $(1+\frac{\epsilon}{3})(1+\frac{\epsilon}{2}) \leq 1 + \epsilon$ for $\epsilon \in [0,1]$ we can conclude that $(\ml, \mr)$ is also a valid scaling for $\ml((1+\epsilon)\eye - \ma)\mr$ with high probability. We must now bound the running time. We observe by Lemma \ref{lemma:eigvec_scaling} that
\[
\|\mm_{\epsilon/2}^{-1}\|_\infty \leq \frac{2\gamma}{\epsilon} \quad \text{and} \quad \|\mm_{\epsilon/2}^{-1}\|_1 \leq \frac{2\gamma}{\epsilon}.
\]
Thus, $\frac{2\gamma}{\epsilon}$ functions as a valid choice of $K$ in our previous theorem-- plugging this into our previous running time and simplifying gives the result.
\end{proof}
A simpler algorithm and analysis can be derived in the case of symmetric M-matrices. We assume access to the following oracle for solving SDD linear systems:
\begin{restatable}[SDD Solver]{oracle}{SDDSolve}
\label{oracle:SDDSolve}
Let $\ms \in \R^{n \times n}$ be an SDD matrix, and let $x \in \R^n$ be a vector. Then there is a procedure called $\code{SDDSolve}(\ms, \epsilon)$ which can generate a linear operator $\opZ: \R^n \to \R^n$ where with high probability
\[
\| \ms^{-1} \vx - \opZ (\vx)\|_\ms \leq \epsilon \| \ms^{-1} \vx \|_\ms
\]
Further, we can compute and apply $\opZ$ to vectors in $\mathcal{T}_{SDDsolve}(m, n, \epsilon)$ time.
\end{restatable}
With this, we prove the following result.
\begin{restatable}[Symmetric M-matrix Scaling]{theorem}{symmscaling}
\label{thm:symmscaling}
Let $\ma \in \R^{\nn}$ be a symmetric nonnegative matrix with $m$ nonzero entries and let $s > 0$ be such that $\rho(\ma) < s$. Let $\mm = s \eye - \ma$. Pick $\epsilon > 0$. Then \fullsymmscale$(\ma, \epsilon, K)$ computes a diagonal matrix $\mv$ where $\mv((1+\epsilon)s\eye - \ma)\mv$ is SDD with high probability. This algorithm runs in time
\[
O\Big(\mathcal{T}_{SDDsolve}\Big(m, n, \frac{1}{4} \Big) \log(n \kappa(\mm)) \log\Big(\frac{1}{\epsilon} \Big) \Big).
\]
\end{restatable}
In the interest of brevity, we defer our analysis of this procedure to Section \ref{sec:symmscaling}.
\section{Scaling Symmetric M-matrices}
\label{sec:symmscaling}
Here, we show how the M-matrix scaling algorithm and analysis from Section \ref{sec:scaling} can be simplified in the case where our input M-matrix is symmetric. Additionally, we give our algorithm's exact running time assuming access to the best SDD linear system solvers currently available. We first define our oracle for solving symmetric SDD linear systems:
$\code{SDDSolve}$*
We prove the following result:
\symmscaling*
\begin{algorithm} [t]
\caption {\sc \fullsymmscale$(A, \epsilon, K)$} \label{alg:symMMatrix}
\begin{algorithmic}[1]
\State \textbf{Input:} $\ma \in \R_{\geq 0}^{n\times n}$ a symmetric matrix with $\rho(\ma)<1$, $\epsilon$ real numbers.
\State \textbf{Output:} Positive diagonal matrix $\mv$ such that $\mv [(1+\epsilon) \eye - \ma] \mv$ is SDD
\State $\alpha \eq 1, k \eq 0, \vv_\alpha^{\, \, (0)} \gets \vzero$
\While{$\|\mm_\alpha \vv_\alpha^{\, \, (k)} - \vones \|_\infty > \frac{1}{2}$}
\State $\vv_{\alpha}^{\, \,(k+1)} \eq \vv_{\alpha}^{\, \, (k)} - \frac{1}{4} [\mm_{\alpha} \vv_{\alpha}^{\, \, (k)} - \vones]$
\State $k \gets k + 1$
\EndWhile
\State $\vv_\alpha \gets \vv_\alpha^{\, \, (k)}$
\While{$\alpha > \epsilon$}
\State $\alpha \eq \alpha/2, \quad k \gets 0$
\State $\vv_{\alpha}^{\, \, (0)} \gets \vzero$
\State $\mm_\alpha = (1+\alpha) \eye - \ma$.
\While{$\|\mm_{\alpha} \vv_{\alpha}^{\, \, (k)} - \vones\|_\infty > \frac{1}{2}$}
\State $\opZ_{2 \alpha} \gets \code{SDDSolve}(\mv_{2\alpha}\mm_{2\alpha}\mv_{2\alpha}, \frac{1}{4})$
\State $\vv_{\alpha}^{\, \,(k+1)} \eq \vv_{\alpha}^{\, \, (k)} - \mv_{2\alpha} \opZ_{2 \alpha} (\mv_{2\alpha} [\mm_{\alpha} \vv_{\alpha}^{\, \, (k)} - \vones])$
\State $k \gets k + 1$
\EndWhile
\State $\vv_\alpha \eq \vv_\alpha^{\, \, (k)}$
\EndWhile
\State \Return $\mv_\alpha$ with $\mv_\alpha \mm_{\epsilon} \mv_\alpha$ being SDD
\end{algorithmic}
\end{algorithm}
Our proof of correctness follows much the same blueprint as the proof of the asymmetric scaling algorithm in Section \ref{sec:scaling}. As before, we begin by making the simplifying assumption that $s=1$ for our M-matrix $\mm$: this proceeds without loss of generality as before. We first show that our iteration to compute the initial scaling $\vv_1$ converges quickly, and then show that under our assumption on $\code{SDDSolve}$'s properties the iteration to compute $\vv_\alpha$ from $\vv_{2\alpha}$ also converges quickly. We then combine these facts into our claim.
\begin{lemma}
\label{symm:initscale}
Let $\ma$ be a symmetric nonnegative matrix with $\rho(\ma) < 1$, and let $\mm_1 = 2 \eye - \ma$. Let $\vx$ be any vector, and define $\vy = \vx - \frac{1}{4} [\mm_1 \vx - \vones]$. Then
\[
\| \mm_1 \vy - \vones \|_2 \leq \frac{3}{4} \| \mm_1 \vx - \vones \|_2.
\]
\end{lemma}
\begin{proof}
We observe that
\begin{align*}
\|\mm_1 \vy - \vones\|_2 &= \|\mm_1 \vx - \frac{1}{4} \mm_1[\mm_1 \vx - \vones] - \vones \|_2 \\
&=\|[\eye - \frac{1}{4} \mm_1][\mm_1 \vx - \vones] \|_2 \\
&\leq \|\eye - \frac{1}{4} \mm_1\|_2 \|\mm_1 \vx - \vones \|_2
\end{align*}
Note that since $\ma$ is symmetric and satisfies $\rho(\ma) < 1$, we have $-\eye \preceq \ma \preceq \eye$. Thus $\eye \preceq \mm_1 \preceq 3 \eye$ and so $\frac{1}{4} \eye \preceq \eye - \frac{1}{4} \mm_1 \preceq \frac{3}{4} \eye$. Therefore as $\ma$ is symmetric we can conclude $\| \eye - \frac{1}{4} \mm_1 \|_2 \leq \frac{3}{4}$. Substituting this into the above implies the claim.
\end{proof}
The above fact shows that the iteration to compute the initial $\vv_1$ reduces a residual term by a constant factor in each step. We will now show that the iteration to compute $\vv_\alpha$ converges quickly. Before we do this, we will need to establish that $\mv_{2\alpha}\mm_{2\alpha}\mv_{2\alpha}$ is SDD:
\begin{lemma}
\label{symm:SDD}
Let $\mm$ be a symmetric M-matrix, and let $\vv$ be any vector where $||\mm \vv - \vones ||_\infty \leq \frac{1}{2}$. Then $\mv \mm \mv$ is SDD.
\end{lemma}
\begin{proof}
We observe first that for any index $i$ $(\mm \vv)_i \in [\frac{1}{2}, \frac{3}{2}]$. Thus by Lemmas \ref{lemma:MMatrix_monotone} and \ref{lemma:MMatrix_RCDD} and the fact that $\mm$ is symmetric we conclude that $\mv \mm \mv$ is SDD.
\end{proof}
We now show our iteration for computing $\vv_\alpha$ from $\vv_{2\alpha}$ converges quickly.
\begin{lemma}
\label{symm:inductivescale}
Let $\ma$ be a symmetric nonnegative matrix with $\rho(\ma) < 1$. Let $\alpha > 0$ be some constant, and let $\mm_{\alpha} = (1+\alpha) \eye - \ma$. Let $\vv_{2\alpha}$ be a positive vector such that $\ms = \mv_{2\alpha} \mm_{2\alpha}\mv_{2\alpha}$ is SDD. Define $\vw = \mm_{\alpha}^{-1} \vones$. Let $\vx$ be a vector, and let $\vy = \mv_{2\alpha} \mm_{\alpha} [\vx - \vw]$. Let $\opZ$ be some linear operator satisfying
\[
\| \ms^{-1} \vy - \opZ_{2\alpha} (\vy)\|_\ms \leq \frac{1}{4} \| \ms^{-1} \vy \|_\ms.
\]
Then if $\vz = \vx - \mv_{2\alpha} \opZ_{2 \alpha}(\vy)$ then
\[
\|\vz - \vw \|_{\mm_{2\alpha}} \leq \frac{3}{4} \|\vx - \vw\|_{\mm_{2\alpha}}.
\]
\end{lemma}
\begin{proof}
We observe
\begin{align*}
\vz - \vw &= \vx - \mv_{2\alpha} \opZ_{2 \alpha}(\vy) - \vw \\
&= \vx - \mm_{2\alpha}^{-1} \mm_{\alpha} [\vx - \vw] - \vw + \mm_{2\alpha}^{-1} \mm_{\alpha} [\vx - \vw] -\mv_{2\alpha} \opZ_{2 \alpha}(\vy) \\
&= \alpha \mm_{2\alpha}^{-1} [\vx - \vw] + \mv_{2\alpha} \ms^{-1} \vy - \mv_{2\alpha} \opZ_{2 \alpha}(\vy)
\end{align*}
where we used the fact that $\mm_\alpha = \mm_{2\alpha} - \alpha \eye$. Taking norms of both sides and applying the triangle inequality yields
\begin{align*}
\|\vz - \vw \|_{\mm_{2\alpha}} &\leq \alpha \|\mm_{2\alpha}^{-1} [\vx - \vw] \|_{\mm_{2\alpha}} + \| \mv_{2\alpha} \ms^{-1} \vy - \mv_{2\alpha} \opZ_{2 \alpha}(\vy) \|_{\mm_{2\alpha}}.
\end{align*}
We split the analysis of this expression in two parts. First, we observe that
\[
\alpha \|\mm_{2\alpha}^{-1} [\vx - \vw] \|_{\mm_{2\alpha}} \leq \alpha \| \mm_{2\alpha}^{-1} \|_{\mm_{2\alpha}} \| \vx - \vw\|_{\mm_{2\alpha}} = \alpha \| \mm_{2\alpha}^{-1} \|_2 \| \vx - \vw\|_{\mm_{2\alpha}}.
\]
Now, $\mm_{2\alpha}^{-1} \preceq \frac{1}{2\alpha} \eye$: since $\mm_{2\alpha}$ is symmetric this implies
\[
\alpha \|\mm_{2\alpha}^{-1} [\vx - \vw]\|_{\mm_{2\alpha}} \leq \frac{1}{2} \| \vx - \vw\|_{\mm_{2\alpha}}.
\]
For the second part, we have by our assumption on $\opZ_{2\alpha}$
\[
\| \mv_{2\alpha} \ms^{-1} \vy - \mv_{2\alpha} \opZ_{2 \alpha}(\vy) \|_{\mm_{2\alpha}} = \|\ms^{-1} \vy - \opZ_{2 \alpha}(\vy) \|_{\ms} \leq \frac{1}{4} \|\ms^{-1} \vy\|_\ms = \frac{1}{4} \|\mv_{2\alpha} \ms^{-1} \mv_{2\alpha} \mm_{\alpha} [\vx - \vw] \|_{\mm_{2\alpha}}.
\]
Simplifying this expression yields
\[
\| \mv_{2\alpha} \ms^{-1} \vy - \mv_{2\alpha} \opZ_{2 \alpha}(\vy) \|_{\mm_{2\alpha}} \leq \frac{1}{4} \|\mm_{2\alpha}^{-1} \mm_{\alpha} [\vx - \vw] \|_{\mm_{2\alpha}} \leq \frac{1}{4} \|\mm_{2\alpha}^{-1} \mm_{\alpha} \|_{\mm_{2\alpha}} \| \vx - \vw \|_{\mm_{2\alpha}}.
\]
Observe that $\|\mm_{2\alpha}^{-1} \mm_{\alpha} \|_{\mm_{2\alpha}} = \|\mm_{2\alpha}^{-1/2} \mm_{\alpha} \mm_{2\alpha}^{-1/2}\|_2.$ As $\mm_{\alpha}$ and $\mm_{2\alpha}$ are symmetric and $\mm_\alpha \preceq \mm_{2\alpha}$, we note that $\|\mm_{2\alpha}^{-1/2} \mm_{\alpha} \mm_{2\alpha}^{-1/2}\|_2 \leq \|\mm_{2\alpha}^{-1/2} \mm_{2\alpha} \mm_{2\alpha}^{-1/2}\|_2 = 1$. Substituting into the above expression and combining yields
\[
\| \mv_{2\alpha} \ms^{-1} \vy - \mv_{2\alpha} \opZ_{2 \alpha}(\vy) \|_{\mm_{2\alpha}} \leq \frac{1}{4} \| \vx - \vw \|_{\mm_{2\alpha}}.
\]
Combining this with the previous bound gives the claim.
\end{proof}
We now prove our theorem:
\begin{proof}
To begin, we show the correctness of our procedure. If we assume that at every value of $\alpha$ encountered we obtain a $\vv_\alpha$ satisfying $\|\mm_\alpha \vv_\alpha - \vones \|_\infty \leq \frac{1}{2}$, then by Lemma \ref{symm:SDD} we must conclude that $\vv_\alpha$ can be used to construct an SDD scaling for $\mm_\alpha$. Thus our output is clearly a valid scaling for $\mm_\epsilon$.
We now prove that our algorithm runs in the claimed time. We begin by analyzing the time required to compute the initial scaling $\vv_1$. By Lemma \ref{symm:initscale} and line 5 of the algorithm we observe that for any $k$ we have
\[
\| \mm_1 \vv_1^{\, \, (k+1)} - \vones \|_2 \leq \frac{3}{4} \| \mm_1 \vv_1^{\, \, (k)} - \vones \|_2.
\]
This implies
\[
\| \mm_1 \vv_1^{\, \, (k)} - \vones \|_\infty \leq \| \mm_1 \vv_1^{\, \, (k)} - \vones \|_2 \leq \Big(\frac{3}{4}\Big)^k \|\vones \|_2 = (\frac{3}{4})^k \sqrt{n}.
\]
Thus after $O(\log n)$ iterations of line 5 we will find some $\vv_1$ which is a valid scaling. Each iteration can be implemented in $O(m)$ time for $O(m \log n)$ total work.
We now analyze the time required to compute $\vv_\alpha$ from $\vv_{2\alpha}$. Assume that all of our calls to $\code{SDDSolve}$ on lines 14 and 15 of the algorithm return a valid approximate solution. We will show that under this assumption we will perform only $\otilde(1)$ calls to $\code{SDDSolve}$: since each individual call returns a valid estimator with high probability our algorithm itself succeeds with high probability. We note by Lemma \ref{symm:inductivescale} and lines 14 and 15 of the algorithm that for any $k$
\[
\|\vv_\alpha^{\, \, (k+1)} - \mm_\alpha^{-1} \vones \|_{\mm_{2\alpha}} \leq \frac{3}{4} \|\vv_\alpha^{\, \, (k)} - \mm_\alpha^{-1} \vones \|_{\mm_{2\alpha}}.
\]
Like before this implies
\[
\|\mm_\alpha \vv_\alpha^{\, \, (k)} - \vones \|_{\mm_\alpha^{-1} \mm_{2\alpha} \mm_\alpha^{-1}} = \|\vv_\alpha^{\, \, (k)} - \mm_\alpha^{-1} \vones \|_{\mm_{2\alpha}} \leq \Big(\frac{3}{4}\Big)^k \|\mm_\alpha^{-1} \vones \|_{\mm_{2\alpha}} = \Big(\frac{3}{4}\Big)^k \| \vones \|_{\mm_\alpha^{-1} \mm_{2\alpha} \mm_\alpha^{-1}}.
\]
Now note that $\mm_\alpha^{-1} \preceq \mm_\alpha^{-1} \mm_{2\alpha} \mm_\alpha^{-1} \preceq 2 \mm_\alpha^{-1}$. With this, it is clear that $||\mm_\alpha^{-1} \mm_{2\alpha} \mm_\alpha^{-1}||_2 \leq 2 ||\mm_\alpha^{-1}||_2$ and $||\mm_\alpha \mm_{2\alpha}^{-1} \mm_\alpha||_2 \leq ||\mm_\alpha||_2.$ Therefore $\kappa(\mm_\alpha^{-1} \mm_{2\alpha} \mm_\alpha^{-1}) \leq 2\kappa(\mm_\alpha) \leq 2 \kappa(\mm)$. Applying this fact in the above yields
\[
\|\mm_\alpha \vv_\alpha^{\, \, (k)} - \vones \|_\infty \leq \|\mm_\alpha \vv_\alpha^{\, \, (k)} - \vones \|_2 \leq 2 \Big(\frac{3}{4}\Big)^k \kappa(\mm) \| \vones \|_2 = 2\sqrt{n} \Big(\frac{3}{4}\Big)^k \kappa(\mm).
\]
Thus after $k = O(\log(n \kappa(\mm)))$ iterations we will have some $\vv_\alpha$ which gives a valid scaling for $\mm_\alpha$. Each iteration in this process to compute $\vv_\alpha$ requires one matrix-vector product with $\mm_\alpha$ (requiring $O(m)$ time), one query to $\opZ$ which takes $\mathcal{T}_{solve}\Big(m, n, \frac{1}{4} \Big)$ time, and $O(n)$ additional work. Thus the iteration to compute $\vv_\alpha$ from $\vv_{2\alpha}$ requires only $\mathcal{T}_{solve}\Big(m, n, \frac{1}{4} \Big) \log(n \kappa(\mm))$ time. To conclude, we observe that in only $\log(1/\epsilon)$ iterations $\alpha$ falls from $1$ to $\epsilon$: thus we need only construct $\vv_\alpha$ from $\vv_{2\alpha}$ that many times before we obtain a scaling for $\mm_\epsilon$. The claimed running time follows.
\end{proof}
If we equip this algorithm with the current fastest SDD system solvers (from \cite{coh14}), we obtain the following corollary:
\begin{corollary}
\label{symm:fastsolve}
Let $\ma \in \R^{\nn}$ be a symmetric nonnegative matrix with $m$ nonzero entries and $\rho(\ma) < 1$, and let $\mm = \eye - \ma$. Pick $\epsilon > 0$. Then we can compute a diagonal matrix $\mv$ where $\mv((1+\epsilon)\eye - \ma)\mv$ is SDD with high probability in time
\[
O\Big(m \log(n \kappa(\mm)) \log^{1/2}(n) \mathrm{poly}(\log \log n) \log\Big(\frac{1}{\epsilon} \Big) \Big).
\]
\end{corollary}
Finally, we obtain the following corollary for solving linear systems in symmetric M-matrices:
\begin{corollary}
Let $\ma \in \R^{\nn}$ be a symmetric nonnegative matrix with $m$ nonzero entries and $\rho(\ma) < 1$, and let $\mm = \eye - \ma$. Then for any vector $\vb$ we can find $\vx$ such that $||\mm \vx - \vb||_2 \leq \epsilon ||\vb||_2$ in time
\[
O\Big(m \log(n \kappa(\mm)) \log(\kappa(\mm)) \log^{1/2}(n) \mathrm{poly}(\log \log n) \log\Big(\frac{1}{\delta} \Big) \Big).
\]
\end{corollary}
\begin{proof}
Note that if $\epsilon = \lambda_{min}(\mm)$ $\mm \preceq \mm_\epsilon \preceq 2\mm$. Thus, by the standard analysis of preconditioned Richardson iteration $O(\log{1}{\delta})$ applications of a linear system solver for $\mm_\epsilon$ yields a linear system solver for $\mm$. By simply running this procedure for each $\mm_\alpha$ encountered in \fullsymmscale and checking if the resulting vector $\vx_\alpha$ satsifes $||\mm \vx_\alpha - \vb||_2 \leq \delta ||\vb||_2$, we will eventually find a vector satisfying this and we will do so within $\log(1/\epsilon) = \log(\kappa(\mm))$ iterations. The running time follows.
\end{proof} | {'timestamp': '2018-10-05T02:15:24', 'yymm': '1810', 'arxiv_id': '1810.02348', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02348'} | arxiv |
\section{PURPOSE}
\label{sec:intro}
Besides lung cancer, cardiovascular disease is a leading cause of death in the lung cancer screening population\cite{national2011reduced}\spacefactor\sfcode`\.{}. Moreover, it has been shown that chest CT scans used for lung cancer screening are suitable for identification of participants at risk of cardiovascular disease (CVD)\cite{jacobs2012coronary,chiles2015association,mets2013lung,de2015automatic}\spacefactor\sfcode`\.{}. Previous methods that investigated prediction of CVD events and all-cause mortality used known quantitative CVD image markers and combined them with subject data. Using weighted Cox proportional hazards regression, Chiles et al.\cite{chiles2015association} showed that quantitative as well as visually assed coronary artery calcium (CAC) scores extracted from screening low-dose chest CT are predictive for CVD and all-cause mortality in the National Lung Screening Trial (NLST). Similarly, Mets et al.\cite{mets2013lung} used Cox regression based on semi-automatically detected CAC scores and thoracic aorta calcium (TAC) volume as well as subject data, to perform prediction of CVD events and all-cause mortality in the Dutch-Belgian lung cancer screening trial (NELSON). De Vos et al. \cite{de2015automatic} performed prediction of CVD events in the same population using a support vector machine (SVM) classifier that employed automatically extracted CAC and TAC scores as features.
These approaches relied on hand-crafted features that are already established as CVD biomarkers. However, besides these known biomarkers, chest CT scans may contain yet unknown features predictive of CVD mortality. Hence, we propose a method based on unsupervised feature learning which is able to automatically predict CVD mortality directly from chest CT scans and is therefore not limited to known quantitative image markers related to CVD.
\section{DATA}
\label{sec:data}
This study included 1,583 participants of the National Lung Screening Trial. NLST included current and former heavy smokers between the age of 50 and 74\cite{national2011reduced}\spacefactor\sfcode`\.{}. All 395 participants who died of CVD within 5 years from acquisition of the baseline CT scan (non-survivors) were included. In addition, 1,188 participants who were still alive after this period (survivors) were randomly selected.
For each subject a CT scan acquired at baseline was analyzed. Low-dose chest CT scans were made with breath-hold, without contrast enhancement and without ECG synchronization. Scans were acquired using helical scanning mode and a tube voltage of 120 kVp or 140 kVp, depending on the subject's weight. In-plane resolution ranged from 0.49 mm to 0.98 mm with a slice thickness between 1.0 mm and 2.5 mm. The scans were acquired at 32 different medical centers with 13 different scanner models.
\section{METHODS}
\label{sec:methods}
To investigate whether analysis of the heart visualized in chest CT enables prediction of CVD mortality, the method first extracts a bounding box around the heart. This is done with our previously designed and trained algorithm\cite{de2017convnet} that employs a CNN to determine the presence of the heart in axial, coronal and sagittal slices of the chest CT image and subsequently combines these to define a 3D bounding box around the heart. Thereafter, to ensure equal image resolution in our data set, we resample all extracted heart volumes to isotropic resolution of 1.0 mm. Moreover, to enhance differentiation among soft tissues in the heart (e.g. fat, muscle) and to preserve influence of high density structures (e.g. CAC, TAC), extracted volumes are clipped between [-160, 840] HU.
Because of the relatively low number of the available samples, prediction using e.g. a CNN that would extract features and perform classification of subjects into survivors and non-survivors was not feasible. Therefore, similar to the work of Zreik et al.\cite{zreik2018deep}\spacefactor\sfcode`\.{}, a convolutional autoencoder (CAE) is used to encode the volumes containing the heart in an unsupervised fashion. Thereafter, a conventional machine learning classifier exploiting the extracted encondings is employed to classify subjects into survivors and non-survivors.
The CAE used in this work (Figure \ref{fig:arch}) consists of an encoder that compresses the images into representative encodings and a decoder that reconstructs the images during training. The encoder analyzes images, cropped to the heart volume, zero-padded to $128\times128\times128$ voxels and consists of 5 convolutional layers with $4\times4\times4$ kernels. A stride of 2 was applied to achieve spatial downsampling without the need for deterministic spatial functions such as max-pooling. The encoder ends in a dense layer with 100 units, which represents the encodings vector. The decoder consists of 5 upsampling layers and 5 convolutional layers with $3\times3\times3$ kernels and a stride of 1. All convolutional layers are followed by batch normalization and LeakyReLu activation ($\alpha = 0.3$).
Typically, in training the CAE, the mean squared error (MSE) between the reconstructed image and the original image is used as a loss function. However, to capture the contrast among soft tissues in low-dose CT without intravenous contrast enhancement, in this work the loss function of the CAE is defined employing the feature perceptual loss (FPL), which captures perceptual differences and spatial correlations better\cite{hou2017deep}\spacefactor\sfcode`\.{}. To compute the FPL, both the input image and reconstructed image are separately fed into a fixed VGG16\cite{simonyan2014very} network pretrained on ImageNet (Figure \ref{fig:arch}). The FPL is then defined as the MSE between the feature maps in this network derived from the input image and the reconstructed image. Because VGG16 is a network designed for 2D images, the loss was calculated over 2D axial slices of the 3D image volumes.
Thereafter, three different classifiers are trained using the encodings obtained with the CAE: a neural network (NN), a random forest classifier (RFC) and a support vector machine (SVM) classifier. For the RFC and SVM a grid search on the validation set is performed to find the optimal parameter settings.
\begin{figure}[t]
\begin{center}
\begin{tabular}{c}
\includegraphics[height=3.3cm]{architecture_AE_new_cropped.pdf}
\end{tabular}
\end{center}
\caption[example]
{\small{ \label{fig:arch}
CAE with feature perceptual loss (FPL): Input images are encoded into 100 encodings and reconstructed by the decoder. Both the input and reconstructed images are fed into a fixed VGG16 network, where the FPL is determined by the MSE over the feature maps derived from the input image and the reconstructed image.}}
\end{figure}
\section{EXPERIMENTS AND RESULTS}
To assess the performance, eight cross-validation experiments were performed. In each experiment, 100 images were selected as test set, 50 images were selected as validation set and the remaining 1,433 images were used as training set. Test and validation sets were balanced with respect to classes. In the test sets, images of the non-survivors were sampled such that each non-survivor was included once in the test sets. Images of the survivors were randomly selected from the available set.
To augment the training set for the CAE, random rotations around all three image axes were used. The angle of rotation was randomly chosen from a normal distribution with a mean of 0 and a standard deviation of 10 degrees. The CAE was trained in 100,000 iterations, with a batch size of 2 images zero-padded to the required input size. The Adam optimization algorithm was used with a learning rate of 0.001.
To classify subjects into survivors and non-survivors, the classifiers were trained using the encodings obtained with the CAE. The NN (6 units dense layer and 2 units output, dropout p=0.5, categorical crossentropy loss, lr=0.0001) was trained in 25,000 iterations with balanced batches of 100 examples, using the Adam optimization algorithm. The RFC consisted of 75 trees and for the SVM the $\gamma$ and $c$ were set to 0.0001 and 100, respectively.
To determine the influence of FPL on the reconstructions, we trained an additional CAE with standard MSE as loss function. Using MSE as a loss function resulted in a mean absolute error of 19 ($\pm$ 5) HU and training with FPL resulted in mean absolute error of 20 ($\pm$ 6). While the mean absolute reconstruction errors are similar, the CAE trained with FPL learned sharper contrast between structures, as shown in Figure \ref{fig:num_enc}A.
In each cross-validation experiment a CAE was trained and the classifiers were evaluated. The performance of the method was assessed with a receiver operating characteristic (ROC) curve. The SVM achieved the best performance with an area under the curve (AUC) of 0.72 ($\pm$ 0.07 standard deviation, Figure \ref{fig:num_enc}B). The ROC of the neural network and the RFC had an AUC of 0.71 ($\pm$ 0.06) and 0.70 ($\pm$ 0.06), respectively.
\section{DISCUSSION AND CONCLUSION}
In this work, a method for prediction of cardiovascular mortality from lung screening chest CT scans has been proposed. Unlike previous predictive models, the proposed method does not use hand-crafted image features, but performs prediction directly from the images containing the heart.
The experiments show that the CAE using FPL preserves structures likely containing important information for prediction of CVD mortality, such as the coronary arteries, aorta, and fat around the heart (Figure \ref{fig:num_enc}A). The CAE was trained to reconstruct heart images and was agnostic to the subsequent classification task. It would be interesting to investigate end-to-end training where the CAE is trained while optimizing for a subsequent classification task. Besides likely improvement in the performance by end-to-end training, such an approach might allow identification of image areas important for prediction and thereby allow the confirmation of known and possibly the discovery of novel image markers of CVD mortality. Alternatively, a CNN could be employed to perform classification directly. However, our preliminary experiments showed that end-to-end training and direct classification require a larger data set, which is often not available.
\begin{figure}[t]
\begin{center}
\begin{tabular}{c}
\includegraphics[height=4.38cm, trim={0 6mm 0 2mm},clip]{ROC_combined_recons_cropped2.pdf}
\end{tabular}
\end{center}
\caption[example]
{\small{ \label{fig:num_enc}
A) Input and reconstructed images generated by CAEs trained with MSE loss and FPL (top), with corresponding reconstruction error maps (bottom). B) ROC curves for prediction with SVM, NN and RFC, with standard deviation over 8 cross-validation experiments.}}
\end{figure}
The three evaluated classifiers show a similar performance for prediction of CVD mortality based on the extracted encodings. Furthermore, the presented method shows a similar performance to previous methods proposed by Mets et al. and De Vos et al. (AUC = 0.71)\cite{mets2013lung,de2015automatic}, that describe prediction of CVD events. This is remarkable since the CAE is unsupervised and does not incorporate prior knowledge about the image, the subsequent classification task or relevant biomarkers. Moreover, the proposed method achieved similar performance to work by Mets et al. and De Vos et al.\cite{mets2013lung,de2015automatic}\spacefactor\sfcode`\.{}, without adding subject data like age, smoking history or sex, as they proposed. However, comparison with these methods is somewhat limited by different outcome definitions and populations. Although image analysis without additional subject data may be simpler in application, future work could investigate whether incorporating subject data in the proposed method would improve the performance.
In conclusion, this work demonstrates that the prediction of cardiovascular mortality directly from low-dose screening chest CT scans is feasible. This might allow identification of subjects undergoing lung screening with CT who are at risk of fatal CVD events and who might benefit from preventive treatment.
\section{NEW OR BREAKTROUGH WORK}
A machine learning system is presented that is able to predict cardiovascular death within five years from a low-dose chest CT scan, without prior information about the image or subjects.
\small{\acknowledgments{The authors thank the National Cancer Institute for access to NCI's data collected by the National Lung Screening Trial. The statements contained herein are solely those of the authors and do not represent or imply concurrence or endorsement by NCI. The authors hereby state that this work is not submitted elsewhere.}}
{\footnotesize
| {'timestamp': '2018-10-05T02:13:20', 'yymm': '1810', 'arxiv_id': '1810.02277', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02277'} | arxiv |
\section{Introduction}
There are two major factors limiting growth of wireless communication services. The first relates to acute spectrum scarcity. Cognitive radio networks (CRNs), because of their ability to increase spectrum utilization efficiency, can alleviate this problem. Of particular interest in this context are underlay CRNs where secondary (unlicensed) users transmit concurrently with those of the (licensed) primary network (PN), while ensuring that performance of the latter is maintained at an acceptable level despite the interference caused. The second major factor limiting growth of wireless services relates to small battery life-times. Use of energy harvesting (EH) is well motivated to increase longevity of nodes. Characterizing the performance of CRNs with EH nodes is therefore of great practical interest.
\par In \cite{Bhowmick2016,Miridakis2016}, an interweave framework is considered for EH CRN. Specifically, \cite{Miridakis2016} proposes a cooperative CRN framework in which one or multiple secondary relays harvest energy and forward source data to secondary destination when the primary source is sensed to be absent. Performance of the secondary network (SN) is analyzed in terms of energy consumption and outage probability. In \cite{He2016} and \cite{Wang2016}, an overlay approach is used wherein the secondary nodes assist the primary transmission, thereby boosting the signal-to-noise ratio (SNR) at the primary receiver, and enabling secondary transmission.
In \cite{Janghel2017}, a joint energy and spectrum sharing framework {is} suggested wherein the secondary (cognitive) underlay transmitter harvests energy from the primary source using the time-switching (TS) EH protocol before commencing transmission, and its performance is analyzed. In \cite{Mousavifar2014} and \cite{Liu2015}, multiple secondary source and relay nodes harvest energy from the primary RF signal using the TS-EH protocol before transmission.In \cite{Yuanwei}, performance of a two-hop secondary network is analyzed assuming that the secondary nodes drawn energy from the primary signal. In \cite{Jia}, a set of relays harvest energy from the primary signal, and from amongst these is picked to relay the secondary information. In both \cite{Yuanwei} and \cite{Jia}, the direct channel from source to destination is assumed to be shadowed, and not used by the destination. In \cite{LuGe}, a power beacon provides energy to secondary nodes to facilitate multihop relaying. \cite{Janghel2018} analyzes performance of a two-hop with relay powered by secondary source transmission. In \cite{Janghel2018}, a protocol is suggested that allows energy to be transmitted in packets until the relay has sufficient energy. It is shown to yield good performance with little to no channel knowledge. In all these works, the direct link between the source and destination is ignored.
\par Performance of networks with energy harvesting nodes is limited by the small amount of energy that is harvested. In \cite{Huang2014,Tran2015,Nguyen2016}, there has been some focus on use of multiple antennas at the relay to harvest energy, though not in the underlay cognitive radio context. Use of multiple antennas increases the amount of harvested energy, and results in larger throughput since it allows for maximal-ratio combining/ transmission (MRC/MRT) or antenna selection. To date however, the advantages of using multiple antennas at the relay have not been quantified in the underlay EH context. Another approach to boost performance could be to optimally combine the signals from the direct and the relayed paths. Cognitive dual hop networks that include the source (S) to destination (D) link have been studied in the past \cite{Tourki2013,Huang2013,Chu2014,Tourki2014}, but mostly in the case when the nodes are self-powered and do not use EH. As noted already, most literature on EH-cooperative CRN (EH-CCRN) has also not considered the direct S-D link in the analysis, which may not always be reasonable since the secondary nodes are located close to each other due to power constraints on the nodes (this is even more so when EH is used). In the non-cognitive context, \cite{Lee2017,Van2016} have studied the influence of the direct path in cooperative communication and analyzed the outage performance. Recently\footnote{\cite{Xie2018} appeared after presentation of the conference version of this paper \cite{Janghel2017WPMC}.}, \cite{Xie2018} have considered a multiuser network with an energy harvesting relay assisting communication to a destination, assuming the direct path between secondary source and secondary destination. However, they do not use optimal combining, and rely solely on selection combining at D. Neither they do assume multiple antennas at the relay or study performance with incremental relaying. To the best of our knowledge, there has been no work on EH-CCRN based on the conventional cooperative protocol (suggested in \cite{Laneman2004}) based on optimal combining at the secondary destination. In summary, the contributions of this paper are as follows\footnote{A part of the analysis limited to incremental relaying with a single antenna relay, and PS-EH was presented in WPMC 2017 \cite{Janghel2017WPMC}.}:
\begin{enumerate}
\item We present closed-form expression for outage and throughput of an EH-CCRN with multiple antennas at the EH relay assuming optimal combining at the destination, and bring out importance of the direct path in such networks.
\item We analyze the performance of incremental relaying (IR) in EH-CCRNs, and demonstrate throughput gains.
\item We show that use of an EH relay makes sense only when there are multiple antennas at R. For small number of antennas at R (assuming MRC at D), throughput of EH-CCRN is actually inferior to the case when only the direct channel (S-D) is used without a relay. Use of IR on the other hand always results in better performance, irrespective of the number of antennas.
\item We anlayze PS-EH and TS-EH protocols, and demonstrate that in this context, performance of PS-EH is vastly superior to that of TS-EH.
\item We quantify the gain in throughput with the optimal scheme due to IR, and also with respect to the case when the direct path is ignored.
\item We derive expressions for the optimum value of EH parameters in EH-CCRNs, including the case when IR is used for the number of antennas at the relay is one.
\end{enumerate}
The proposed framework and transmission protocols are discussed in Section~\ref{sec:system_model} and Section~\ref{sec:transmission_protocol} respectively. SN performance analysis in terms outage and throughput are discussed in Section~\ref{sec:Outage} and \ref{sec:Throughput} respectively. Analytical expressions derived in the paper are validated through simulation results in Section~\ref{sec:simulations}, and conclusions are presented in Section~\ref{sec:conclusion}.
\par {\em Notations}: $\E_{\C}(\cdot)$ denotes expectation over the condition/conditions $\C$. $X\sim\exp(\lambda)$ implies that $X$ is exponentially distributed with rate parameter $\lambda$, and ${\cal CN}(0,a)$ denotes the circular normal distribution with mean $0$ and variance $a$. $E_n(\cdot)$, represents the generalized exponential integral defined in \cite[5.1.4]{Abramowitz1964}. $F_{X}(x)$ and $f_{X}(x)$ denote the cumulative distributive function (CDF) and probability density function (PDF) of $X$, and $F_{X|Y}(x)$ denotes the CDF of $X$ given $Y$. ${\bf x}^{H}$ denotes the Hermitian of the vector ${\bf x}$, and $\parallel {\bf x}\parallel$ its second norm.
\section{System Model}\label{sec:system_model}
S and D possess a single antenna. The EH relay R is equipped with $L$ antennas. The PN consists of the primary transmitter (not depicted in the figure), and the primary receiver P. Denote the channel between S and the $i^{th}$ antenna of R by $h^i_{sr}\sim {\cal CN}(0,\lambda_{sr}^{-1})$, and that between the $j^{th}$ antenna of R and D by $h^j_{rd}\sim {\cal CN}(0,\lambda_{rd}^{-1})$, where $i,j=1,2,3,\ldots,L$. Denote the vector channel between S and R by $\bm{h}_{sr}=[h^1_{sr},h^2_{sr},\ldots h^{L}_{sr}]^T$. Similarly, denote the channel between S and P by $g_{sp}\sim {\cal CN}(0,\lambda_{sp}^{-1})$, and that between the $j^{th}$ antenna of R and P by $g^j_{rp}\sim {\cal CN}(0,\lambda_{rp}^{-1})$. We assume a path-loss model, so that the variance $\lambda_{x}$ of a channel between two nodes is proportional to $d_{x}^{\epsilon}$ where $d_{x}$ is the distance between the nodes, and $\epsilon$ is the path-loss exponent.
\par In this paper, we make the following assumptions:
\begin{enumerate}
\item As in any other work related to underlay CRNs with peak interference type of power control, we assume that both S and R estimate the channel gains ($|g_{sp}|^2$ and $|g^j_{rp}|^2$) to P by observing the reverse channel of
the primary, or by using pilots transmitted by P\cite{Jovicic2009}.
\item R does not use its own energy to relay information. It is equipped with a super-capacitor, and acts as an EH node with EH factor $\eta$. It cannot store charge over long intervals, and uses all the energy harvested in the first phase to relay the signal
to D.
\item As in most work related to dynamic spectrum access \cite{Tourki2014,Lee2011,Rezki2012,Kashyap2013}, we assume that that the primary signal can be neglected at the secondary receiving nodes (R in the first phase and D in the second). This is reasonable, since the primary nodes are distant from the secondary nodes. Further, the secondary nodes need to be close to each other {\em as compared to their distance to the primary nodes} in order to maintain a reasonable quality of service (QoS). There are two reasons for this. Firstly, the transmit powers in underlay cognitive radio are random, and the degradation in performance due to SNR variation limits the distance between secondary nodes (relaying is still required due to variations in transmit powers and their low average values). Secondly, EH is practical only over short distances. This means that the secondary nodes are close to each other. This assumption on primary interference at the secondary nodes has also been justified on information theoretical grounds \cite{Jovicic2009}.
\item All the channels are reversible, and quasi-static by nature. We assume that S does not possess knowledge of $|h_{sd}|^2$ and $\bm h_{sr}$.
\item The multi-antenna relay R employs MRC for EH and reception of signal from S, and transmit antenna selection for relaying the signal to D. In the second hop (R-D), employing MRT is not practical since imposing the interference temperature constraints requires knowledge of both magnitude and phase of the channels from each antenna to the primary receiver. Antenna selection is therefore used instead in the second hop.
\end{enumerate}
\vspace{-0.15cm}
\section{Transmission Protocol}\label{sec:transmission_protocol}
In this paper, we present analysis of performance that is applicable to both TS-EH and PS-EH protocols\cite{Nasir2013}. We briefly review each of these in what follows.
\subsection{EH-CCRN with Power-Splitting Protocol}
\par PS-EH is accomplished in two time-slots of duration $T/2$ as depicted in Fig.\ref{fig:trans_scheme}a).
In the first time-slot, S transmits symbols $x$ at rate $R_s$ with power $P_s$ in underlay mode to R and D. Denote the received signal at the $i^{th}$ antenna of the relay R by $y_{r,i-ps}$. Let ${\bf y}_{r-ps}= [y_{r,1-ps},y_{r,2-ps},\ldots,y_{r,L-ps}]^{T}$. In PS-EH case, a component of the received signal at R with fraction $\rho_{ps}$ of the received signal power is utilized for EH, while the remaining component ${\bf y}_{r-ps}$ is used to decode the signal. Clearly, ${\bf y}_{r-ps}$ at R and $y_{d_1}$ at D in the first phase are given by:
\begin{IEEEeqnarray}{rcl}
{\bf y}_{r-ps} &=& \sqrt{(1-\rho_{ps}) P_{s}}\,\bm h_{sr}\,x+ {\bf n}_{r}\;\quad\text{and}\label{eq:yr_PS}
\end{IEEEeqnarray}
\begin{IEEEeqnarray}{rcl}
y_{d_1} &= &\sqrt{P_{s}}\, h_{sd}\,x+n_{d_{1}}\, \label{eq:yd1_PS}
\end{IEEEeqnarray}
respectively, where ${\bf n}_{r}$ is a vector of noise samples with elements $n_{r,i}$, {and} $n_{d_1}$ and $n_{r,i}\sim {\cal CN}\left(0,N_o\right)$. Clearly, the SNR $\Gamma_{d_1}$ at D in the first phase is $P_s|h_{sd}|^2/N_o$. We assume that R uses a beamformer with weights ${\bf h}_{sr}^{H}/\parallel {\bf h}_{sr}\parallel$. With $\eta$ denoting the EH efficiency, the energy harvested at R is $\eta \rho_{ps}\,P_s \|\bm h_{sr}\|^2 T/2$ (ignoring noise) so that the power $^hP_{r-ps}$ available for the second phase of duration $T/2$ is given by:
\begin{equation*}
^hP_{r-ps}=\rho_{ps}\,\eta P_s \|{\bm h}_{sr}\|^2=\beta_{ps} P_s \|{\bm h}_{sr}\|^2\,,\label{eq:Prh-PS}
\end{equation*}
\vspace{-0.1cm}
where $\beta_{ps}= \eta\, \rho_{ps}$, and $\|{\bm h}_{sr}\|^2=\displaystyle\sum_{i=1}^{L}|h^i_{sr}|^2$.
\begin{figure}[h]
\vspace{0cm}
\centering
\includegraphics[width=\textwidth]{transmission_scheme.eps}
\caption{Transmission Scheme}
\label{fig:trans_scheme}
\vspace{-0.1cm}
\end{figure}
Let $I$ denote the interference temperature limit. In order to ensure that the interference caused to P is limited to $I$, the power $P_s$ at S is chosen to be:
\begin{equation}
P_s= {I}/{|g_{sp}|^2}\,.\label{eq:PsOnlyInterference}
\end{equation}
We consider only the peak interference constraint at S, and ignore the peak power constraint for the following reasons:
\begin{enumerate}
\item It is well known that performance of CRNs exhibits an outage floor, and does not improve with increase in peak power (it is in this low outage and high throughput region that CRNs are typically operated) \cite{Tourki2013,Duong2012,Lee2011}. Since the outage with finite peak power is the same as that with infinite peak power, we can simplify the analysis to obtain an estimate of performance of the system in this low outage and high throughput regime, as well as to perform optimizations.
\item Since performance of CRNs is typically limited by interference, and sufficient peak power is typically available, this assumption is quite reasonable.
\end{enumerate}
Clearly the SNR $\Gamma_{r-ps}$ at the relay for information processing is given by $\Gamma_{r-ps} = (1-\rho_{ps})P_s\parallel {\bf h}_{sr}\parallel^{2/}N_o$.
\par In the second time-slot, let the $j$th antenna at R be used to forward the decoded symbol $\hat{x}$ to D (we discuss antenna selection procedures in Section~\ref{sub:AntennaSelection}). In order to ensure that the interference at P is constrained to $I$, the total transmit power $ P^{j}_{r-ps} $ at R is chosen to be:
\begin{equation*}
P^{j}_{r-ps} = \min\left(^hP_{r-ps}, {I}/{|g^j_{rp}|^2} \right). \label{eq:Pr_PS}
\end{equation*}
The received signal $y^j_{d_2-ps}$ at D can be expressed as:
\begin{equation}
y^j_{d_2-ps} = \sqrt{P^{j}_{r-ps}}\,h^j_{rd}\, \hat{x}+n_{d_2}\;, \label{eq:yd2_PS}
\end{equation}
where $n_{d_2}\sim{\cal CN}(0,N_o)$ is the additive noise. Clearly, the SNR $\Gamma_{d_{2}-ps}^{j}$ at D in this phase is $\Gamma_{d_{2}-ps}^{j}= P_{r}^{j}|h_{rd}^{j}|^{2}/N_o$. We assume that D uses MRC to combine the signals (\ref{eq:yd1_PS}) and (\ref{eq:yd2_PS}) obtained (respectively) in the first and second phases. SNRs at R and D can be expressed as:
\begin{subequations}\label{eq:SNR_ps}
\begin{eqnarray}
\Gamma_{r-ps} &=&\dfrac{(1-\rho_{ps})P_s\|{\bm h}_{sr}\|^2}{N_o}\qquad \text{and} \\
\Gamma^j_{d-ps} &=& \underbrace{\frac{P^{j}_{r-ps}|h^j_{rd}|^2}{N_o}}_{\Gamma^j_{d_2-ps}}+\underbrace{\frac{P_s|h_{sd}|^2}{N_o}}_{\Gamma_{d_1}}.\label{eq:SNR_dps}
\end{eqnarray}
\end{subequations}
\subsection{EH-CCRN with Time-Switching Protocol} \label{sub:EHCCRNwithTSEH}
\par In this case signalling takes place in three time slots as depicted in Fig.\ref{fig:trans_scheme}b). The first slot of duration $\rho_{ts} T$ is used to harvest the energy from the source signal, and remaining $(1-\rho_{ts})T$ interval is divided into two equal slots to perform S-R and S-D transmissions respectively \cite{Nasir2013}. Once again, we assume that R uses beamformer weights ${\bf h}_{sr}^{H}/\| {\bf h}_{sr}\|$. Assuming MRC for combining signals at D, SNRs at R and D can be shown to be:
\begin{subequations}\label{eq:SNR_ts}
\begin{eqnarray}
\Gamma_{r-ts} &=&\dfrac{P_s\|{\bm h}_{sr}\|^2}{N_o}\qquad\text{and} \label{eq:SNR_rts} \\
\Gamma^j_{d-ts} &=& \underbrace{\frac{P^{j}_{r-ts}|h^j_{rd}|^2}{N_o}}_{\Gamma^j_{d_2-ts}}+\underbrace{\frac{P_s|h_{sd}|^2}{N_o}}_{\Gamma_{d_1}}.\label{eq:SNR_dts}
\end{eqnarray}
\end{subequations}
The SNRs of PS-EH and TS-EH from \eqref{eq:SNR_ps} and \eqref{eq:SNR_ts} respectively can be written in a unified form as:
\begin{subequations}
\begin{IEEEeqnarray}{rcl}
\Gamma_r &=&\dfrac{\xi\,P_s\|{\bm h}_{sr}\|^2}{N_o}\quad\text{and} \ ^hP_r=\beta P_s \parallel {\bf h}_{sr}\parallel^{2} \label{SNR_R} \\
\Gamma^{j}_d &=& \underbrace{\dfrac{1}{N_o}\overbrace{\min\left(^hP_r, \dfrac{I}{|g^j_{rp}|^2} \right)}^{P_r^j}\,|h^j_{rd}|^2}_{\Gamma_{d_2}^{j}}+ \underbrace{\dfrac{P_s\,|h_{sd}|^2}{N_o}}_{\Gamma_{d_1}}\, , \label{SNR_D}
\end{IEEEeqnarray}
\end{subequations}
where $\xi$ and $\beta$ take values as listed in Table-\ref{tab:commparms} for PS-EH and TS-EH protocols.
\begin{table}[!htb]
\centering
\renewcommand{\arraystretch}{1.2}
\begin{tabular}{ |c|c|c|c| }
\hline
S.N. & Parameter & PS-EH& TS-EH \\ \hline
1. &$\rho$ &$\rho_{ps}$ &$\rho_{ts}$\\\hline
2. & $\xi$ & $(1-\rho_{ps})$& 1 \\ \hline
3. & $\beta$ & $\beta_{ps}=\eta \rho_{\rho_{ps}}$& $\beta_{ts}=\frac{2\eta\,\rho_{ts}}{(1-\rho_{ts})}$ \\ \hline
\end{tabular}
\caption{Parameters for PS-EH and TS-EH.\label{tab:commparms}}
\end{table}
\subsection{EH-CCRN with Incremental Relaying} \label{sub:EHCCRNwithIR}
The transmission scheme for the PS EH-CCRN with IR protocol is depicted in Fig.~\ref{fig:transmission_schemeIncPS}. In the first transmission time-slot, S transmits information symbols to D and R. R harvests energy from this signal using power splitting, and attempts to decode the information symbols. Meanwhile, D which has SNR $P_s|h_{sd}|^2/N_o$ attempts to decode the symbols. If successful, it sends a one bit feedback to S and R\footnote{We assume that feedback time is extremely small and can be neglected in the analysis without loss of generality.}. R then discards the decoded symbols, and S transmits a {\em new} block of symbols to D as depicted in Fig.\ref{fig:transmission_schemeIncPS}a. Else, R relays the symbols using the energy harvested, and D combines the signals in the first and the second time-slots as depicted in Fig.\ref{fig:transmission_schemeIncPS}b.
\begin{figure}[h]
\centering
\includegraphics[width=0.88\textwidth]{transmission_schemeIncPS.eps}
\caption{Transmission scheme for IR with PS-EH protocol}
\label{fig:transmission_schemeIncPS}
\vspace{-0.5cm}
\end{figure}
\begin{figure}[h]
\centering
\includegraphics[width=0.88\textwidth]{transmission_schemeIncTS.eps}
\par\caption{Transmission scheme for IR with TS-EH protocol}
\label{fig:transmission_schemeIncTS}
\end{figure}
\par In the TS-EH-CCRN with IR, the first time-slot of duration $\rho_{ts} T$ is reserved for EH. D attempts to decode these energy symbols, and send a one bit feedback to S and R. If D send '1' as feedback, rest of the signalling duration is used for S-D transmission as shown in Fig.\ref{fig:transmission_schemeIncTS}a. If D send a feedback of '0', then a two-hop signalling is used as shown in Fig.\ref{fig:transmission_schemeIncTS}b.
\subsection{Antenna Selection at Relay (R)} \label{sub:AntennaSelection}
As noted already, R performs MRC to maximize SNR in the S-R link. For the second hop, it uses transmit antenna selection (TAS) to to maximize the SNR at D from (\ref{SNR_D}) as follows:
\begin{eqnarray}
\hat{j}&=& \arg\underset{j}{\max}\left(\Gamma^j_{d}\right)=\arg\underset{j}{\max}\left(\Gamma^j_{d_2}\right)=\arg\underset{j}{\max}\left(\min\left(^hP_r, {I}/{|g^j_{rp}|^2}\right)|h^j_{rd}|^2\right)\nonumber.
\end{eqnarray}
\par In subsequent sections, performance analysis is presented in terms of outage probability and throughput assuming fixed-rate signalling at rate $R_s$.
\section{Outage Analysis}\label{sec:Outage}
In this section, we analyze performance of the SN in terms of outage probability assuming MRC is used at D. We also analyze the outage probability when IR protocol is used.
\subsection{Outage Probability of EH-CCRN with S-D link}
From the SNRs (\ref{SNR_R}) and (\ref{SNR_D}), the outage probability with the DF relay is given by \cite[eq.17]{Laneman2004}:
\begin{IEEEeqnarray}{rcl}
p &=&\Pr\left[\min\left(\Gamma_r,\Gamma^{\hat{j}}_d \right)<\gamma_{th}\right]=\underbrace{\Pr\left[\Gamma_r< \gamma_{th}\right]}_{p_1} + \underbrace{\Pr\left[\Gamma^{\hat{j}}_d< \gamma_{th},\;\Gamma_r \geq \gamma_{th}\right]}_{p_2},\label{eq:pout}
\end{IEEEeqnarray}
where $\gamma_{th}=2^{2 R_s}-1$, and $R_s$ is the target rate of the SN. We first evaluate $p_1$ as follows:
\begin{eqnarray}
p_1=\Pr\left[\Gamma_r< \gamma_{th}\right] = \Pr\left[\frac{\xi P_s\|{\bm h}_{sr}\|^2}{N_o}< \gamma_{th}\right]. \label{eq:p1}
\end{eqnarray}
We know that the $\|{\bm h}_{sr}\|^2$ is Gamma distributed and its PDF is given by:
\begin{eqnarray}
f_{\|{\bm h}_{sr}\|^2}(x)= \frac{x^{L-1} \lambda_{sr}^L}{(L-1)!}e^{-\lambda_{sr} \,x}. \label{eq:pdf_bhsr}
\end{eqnarray}
Using $P_s$ from (\ref{eq:PsOnlyInterference}), $p_1$ can be easily shown to be:
{\begin{equation}
p_1=\Pr\left[\frac{\|{\bm h}_{sr}\|^2}{|g_{sp}|^2}< \frac{\psi}{\xi}\right]=\left(\frac{\lambda_{sp} \xi}{\lambda_{sr} \psi}+1\right)^{-L}\,,\label{eq:p1Final}
\end{equation}}
where $\psi =\frac{\gamma_{th}}{I/N_o}$.
Using (\ref{SNR_R}) and (\ref{SNR_D}), $p_2$ can be expressed as:
\begin{IEEEeqnarray}{rcl}
p_2&=&\Pr\Bigg[\frac{P_s |h_{sd}|^2}{N_o}+\frac{1}{N_o}{\displaystyle\max_{j}}\left(\min\left(^hP_r, \frac{I}{|g^j_{rp}|^2}\right)|h^j_{rd}|^2\right) < \gamma_{th},\frac{\xi P_s \|{\bm h}_{sr}\|^2}{N_o} \geq \gamma_{th}\Bigg].\label{eq:p2_def}
\end{IEEEeqnarray}
Unfortunately, it is not possible to derive an exact expression for $p_2$. Instead, we show in Appendix-A that $p_2$ can be approximated as follows:
\begin{IEEEeqnarray}{rcl}
p_2&\approx&\sum _{i=0}^L \binom{L}{i} \sum _{j=0}^i (-1)^{i+j} t^j \binom{i}{j} \Bigg(\frac{\lambda_{sr}^L \lambda_{rd}^2 \lambda_{sp} i^2}{(L-1)!\beta^2 \lambda_{sd}^2 \left(\frac{\lambda_{rd} \lambda_{sp} i}{\beta \lambda_{sd}}+\frac{\lambda_{rd} i \psi}{\beta}+\frac{\lambda_{rp} j}{\beta}\right)}\Bigg(\sum _{k=0}^{L-2} \Gamma (-k+L-1) \left(\frac{\lambda_{rd} i}{\beta \lambda_{sd}}\right)^k \nonumber\\
&&\times\bigg(e^{-\frac{\lambda_{rp} j \xi}{\beta \psi}} \left(\frac{\xi (\lambda_{sd} \psi+\lambda_{sp})}{\psi}+\lambda_{sr}\right)^{k-L+1}-\left(\frac{\lambda_{sp} \xi}{\psi}+\lambda_{sr}\right)^{k-L+1} e^{-\frac{\xi \left(\frac{\lambda_{rd} i \psi}{\beta}+\frac{\lambda_{rp} j}{\beta}\right)}{\psi}}\bigg)+\left(\frac{\lambda_{rd} i}{\beta \lambda_{sd}}\right)^{L-1} \nonumber\\
&&\times\left\{\text{Ei}\left(\frac{\lambda_{rd} i}{\beta \lambda_{sd}} \left(\lambda_{sr}+\frac{\lambda_{sp} \xi}{\psi}\right)\right)-\text{Ei}\left(\frac{\lambda_{rd} i }{\beta \lambda_{sd}}\left(\lambda_{sr}+\lambda_{sd} \xi+\frac{\lambda_{sp} \xi}{\psi}\right)\right)\right\}\exp \left(-\frac{\xi}{\psi} \left(\frac{\lambda_{rd} i \psi}{\beta}+\frac{\lambda_{rp} j}{\beta}\right)\right)\nonumber\\
&&\times \exp \left(-\frac{\lambda_{rd} i}{\beta \lambda_{sd}} \left(\frac{\lambda_{sp} \xi}{\psi}+\lambda_{sr}\right)\right)\Bigg)+\frac{\lambda_{rp}^2 \lambda_{sp} \lambda_{sr} j^2 e^{\frac{\lambda_{rp} \lambda_{sr} j}{\beta (\lambda_{sd} \psi+\lambda_{sp})}} }{\beta (\lambda_{sd} \psi+\lambda_{sp})^2 \left(\frac{\lambda_{rd} \lambda_{sp} i}{\lambda_{sd}}+{\lambda_{rd} i \psi}+{\lambda_{rp} j}\right)}\nonumber\\
&&\times \Bigg\{E_L\left(\frac{\lambda_{rp} \lambda_{sr} j}{\beta (\lambda_{sp}+\lambda_{sd} \psi)}\right)-\left(\frac{1}{\frac{\xi (\lambda_{sd} \psi+\lambda_{sp})}{\psi\lambda_{sr}}+1}\right)^{L-1} E_L\left(\frac{{\lambda_{rd} i \psi}+{\lambda_{rp} j}}{\beta\lambda_{sp}} \left(\lambda_{sr}+\frac{(\lambda_{sp}+\lambda_{sd} \psi) \xi}{\psi}\right)\right)\Bigg\}\nonumber\\
&& -\frac{\lambda_{sr} \left({\lambda_{rd} i \psi}+{\lambda_{rp} j}\right)^2 e^{\frac{\lambda_{sr}}{\lambda_{sp}} \left(\frac{\lambda_{rd} i \psi}{\beta}+\frac{\lambda_{rp} j}{\beta}\right)}}{\beta\lambda_{sp} \left(\frac{\lambda_{rd} \lambda_{sp} i}{ \lambda_{sd}}+{\lambda_{rd} i \psi}+{\lambda_{rp} j}\right)}\Bigg\{E_L\left(\frac{\lambda_{sr}}{\lambda_{sp}} \left(\frac{\lambda_{rd} i \psi}{\beta}+\frac{\lambda_{rp} j}{\beta}\right)\right)-\left(\frac{\lambda_{sp} \xi}{\psi\lambda_{sr}}+1\right)^{1-L} \nonumber\\
&&\times E_L\left(\frac{\left({\lambda_{rd} i \psi}+{\lambda_{rp} j}\right)}{\beta\lambda_{sp}} \left(\lambda_{sr}+\frac{\lambda_{sp} \xi}{\psi}\right)\right)\Bigg\}-\left(\frac{\lambda_{sr}}{\frac{\lambda_{sp} \xi}{\psi}+\lambda_{sr}}\right)^L e^{-\frac{1-\rho}{\psi} \left(\frac{\lambda_{rd} i \psi}{\beta}+\frac{\lambda_{rp} j}{\beta}\right)}\nonumber\\
&&+\frac{\lambda_{sp}}{\lambda_{sd} \psi+\lambda_{sp}} e^{-\frac{\lambda_{rp} j \xi}{\beta \psi}} \left(\frac{1}{\frac{\xi (\lambda_{sd} \psi+\lambda_{sp})}{\lambda_{sr} \psi}+1}\right)^L+\frac{\lambda_{sd} \psi}{\lambda_{sd} \psi+\lambda_{sp}}\Bigg).\label{eq:p2_FinalMRC}
\end{IEEEeqnarray}
where $t$ is given by:
\begin{eqnarray}
t&=&1-\bigg(1+\frac{\lambda_{rd}}{\lambda_{rp}}\bigg(\gamma_{th} -\frac{ \lambda_{sp}}{\lambda_{sd}} \bigg(\log \bigg(\frac{\gamma_{th} \lambda_{sd} }{ \lambda_{sp}}+1\bigg)+\frac{{\gamma_{th} \lambda_{sd} }}{{\gamma_{th} \lambda_{sd} }+{ \lambda_{sp}}}\bigg)\bigg)\bigg)^{-1}.\label{eq:t}
\end{eqnarray}
As noted already, in underlay CRNs with EH relays, the secondary nodes are close to each other, and distant from P ($g_{rp}^{j}$ has low variance or $\lambda_{rp}$ is very large) for acceptable secondary QoS. Further, the energy harvested is small (so that $^hP_r$ is small) in practice. For this reason, $ P^{j}_{r} = \min\left(^hP_{r}, {I}/{|g^j_{rp}|^2} \right)$ equals $^hP_{r}$ with a very high probability. In Section~\ref{sec:simulations}, we demonstrate through simulations that the outage and throughput (defined in the Section~\ref{sec:Throughput}) with $P^{j}_{r}$ is indistinguishable from that obtained by replacing it by $^hP_{r}$. It is emphasized that in practical implementations R will continue to impose the peak interference constraint, and the approximation is only used to obtain a simpler expression. We can achieve this approximation simply by using $\lambda_{rp}\rightarrow\infty$ in \eqref{eq:p1Final},\eqref{eq:p2_FinalMRC} and \eqref{eq:t}. It is clear from \eqref{eq:t} that for $\lambda_{rp}\rightarrow\infty$, $t\rightarrow0$ so that only one summation term corresponding to $j=0$ is retained in the {second} summation of \eqref{eq:p2_FinalMRC}. Also, $\sum_{i=0}^{L}\binom{L}{i}(-1)^{i}=0\,\, \text{for } L\neq0$ \cite[eq. 4.2.1.3]{Prudnikov1992}.
Using these facts, the approximated expression $\tilde{p}_2$ of $p_2$ is given as follows:
{\small\begin{IEEEeqnarray}{rcl}
\tilde{p}_2&\approx&\sum _{i=1}^L (-1)^i \binom{L}{i} \Bigg(\frac{\lambda_{rd}^2 \lambda_{sp} \lambda_{sr}^L }{\beta \lambda_{sd}^2 (L-1)! \left(\frac{\lambda_{rd} \lambda_{sp}}{ \lambda_{sd}}+{\lambda_{rd} \psi}\right)}\bigg(\sum _{k=0}^{L-2} i\, \Gamma (L-k-1) \left(\frac{\lambda_{rd} i}{\beta \lambda_{sd}}\right)^k \bigg(\left(\frac{\xi (\lambda_{sd} \psi+\lambda_{sp})}{\psi}+\lambda_{sr}\right)^{k-L+1}\nonumber\\
&& -e^{-\frac{\lambda_{rd} i \xi}{\beta}}\left(\frac{\lambda_{sp} \xi}{\psi}+\lambda_{sr}\right)^{k-L+1}\bigg)+\left(\frac{\lambda_{rd} i}{\beta \lambda_{sd}}\right)^L \exp \left(-\frac{\lambda_{rd}\,i}{\beta \lambda_{sd}} \left(\frac{\lambda_{sp} \xi}{\psi}+\lambda_{sr}\right)-\frac{\lambda_{rd} i \xi}{\beta}\right)\bigg\{\text{Ei}\left(\frac{\lambda_{rd} i}{\beta \lambda_{sd}} \left(\lambda_{sr}+\frac{\lambda_{sp} \xi}{\psi}\right)\right) \nonumber\\
&&-\text{Ei}\left(\frac{\lambda_{rd} i}{\beta \lambda_{sd}} \left(\lambda_{sr}+\lambda_{sd} \xi+\frac{\lambda_{sp} \xi}{\psi}\right)\right)\bigg\}\bigg)-\frac{\left(\lambda_{rd}^2 \lambda_{sr} i \psi^2 \right)}{\beta \lambda_{sp} \left(\frac{\lambda_{rd} \lambda_{sp}}{ \lambda_{sd}}+{\lambda_{rd} \psi}\right)}e^{\frac{\lambda_{rd} \lambda_{sr} i \psi}{\beta \lambda_{sp}}} \bigg\{E_L\left(\frac{\lambda_{rd} \lambda_{sr} i \psi}{\beta \lambda_{sp}}\right)-\left({\frac{\lambda_{sp} \xi}{\psi \lambda_{sr}}+\lambda_{sr}}\right)^{1-L}\nonumber\\
&&\times E_L\left(\frac{\lambda_{rd} i \psi}{\beta \lambda_{sp}} \left(\lambda_{sr}+\frac{\lambda_{sp} \xi}{\psi}\right)\right)\bigg\}-e^{-\frac{\lambda_{rd} i \xi}{\beta}} \left(\frac{1}{\frac{\lambda_{sp} \xi}{\psi\lambda_{sr}}+1}\right)^L\Bigg)-\left(\frac{1}{\frac{\lambda_{sp} (1-\rho)}{\lambda_{sr} \psi}+1}\right)^L.\label{eq:p2_WtRP}
\end{IEEEeqnarray}}
With this, the approximate outage $\tilde{p}=p_1 + \tilde{p}_2$. While the approximate expression $\tilde{p}$ so obtained is accurate, it is still too complicated to derive useful insights.
\subsubsection{{Further} approximation of overall outage $p$}
{In typical operating conditions, the following relation holds ${\lambda_{sp} I/N_o}\gg \gamma_{th}$.
We use this to obtain expressions for throughput optimal $\rho$ in some special cases.}
\begin{lemma}
When $\left(\frac{\lambda_{sp}}{\psi} = \frac{\lambda_{sp} I/N_o}{\gamma_{th}}\gg1\right)$, the overall outage $p$ can be approximated as $\tilde{p}$ where:
\begin{IEEEeqnarray}{rcl}
\tilde{p}&\approx&\sum _{i=1}^L (-1)^{i+1} \binom{L}{i} \Bigg(\frac{1 }{ \frac{\lambda_{sp}}{ \psi \lambda_{sd}}+1}\frac{i \lambda_{rd} \lambda_{sr} \psi}{\beta \lambda_{sp}}e^{\frac{i \lambda_{rd} \lambda_{sr} \psi}{\beta \lambda_{sp}}} E_L\left(\frac{\lambda_{rd} \lambda_{sr} i \psi}{\beta \lambda_{sp}}\right)+{\left(\frac{\lambda_{sp} \xi}{\lambda_{sr} \psi}+1\right)^{-L}}e^{-\frac{i \lambda_{rd} \xi}{\beta}}\Bigg).\nonumber
\end{IEEEeqnarray}
\end{lemma}
\begin{IEEEproof}
Proof is presented in Appendix-B.
\end{IEEEproof}
$\tilde{p}$ above can also be represented in an alternative form by using $n e^z E_{n+1}(z)+z e^z E_{n}(z)=1$ \cite[5.1.14]{Abramowitz1964} as follows:
{\begin{IEEEeqnarray}{rcl}
\tilde{p} &\approx&\underbrace{\overbrace{\left(1+\frac{\lambda_{sp}}{\lambda_{sd} \psi}\right)^{-1}}^{T_{11}}\overbrace{\Big(1- \sum _{i=1}^L (-1)^{i+1}\binom{L}{i} L e^{\frac{\psi i \lambda_{rd} \lambda_{sr}}{\beta \lambda_{sp}}} E_{L+1}\Big(\frac{\psi i \lambda_{rd} \lambda_{sr}}{\beta \lambda_{sp}}\Big)\Big)}^{T_{12}}}_{T_1}+\underbrace{ \frac{1-\big(1-e^{-\frac{\lambda_{rd} \xi}{\beta}}\big)^L}{\left({\lambda_{sp} \xi}/({\lambda_{sr} \psi})+1\right)^L}}_{T_2}. \label{eq:pHSNR}
\end{IEEEeqnarray}}
\par The above approximations will be used to derive expressions for the throughput-optimum EH parameters ($\rho^*_{ps}$ and $\rho^*_{ts}$) in Section-\ref{sub:TauMRC}.
\subsection{Outage Analysis of EH-CCRN without S-D link}
\par In some situations, the direct channel (S-D) is shadowed or in deep fade. In this case, the destination is dependent only on the relayed signal. It is this special case that has been studied in EH CRNs \cite{Janghel2018}. Even in non-cognitive cooperative two-hop EH networks, the importance of the direct channel has not been brought out in literature so far. We show in this paper that utilizing the direct channel results in large improvement in throughput in both underlay cognitive and cooperative two-hop networks, especially when IR is used. The outage is once again given by (\ref{eq:pout}), with $\Gamma_r$ given by (\ref{SNR_R}), and $\Gamma_{d}^{\hat{j}}$ modified to:
\begin{eqnarray}
\Gamma^{\hat{j}}_d &=& \dfrac{1}{N_o}\min\left(^hP_r, {I}/{|g^{\hat{j}}_{rp}|^2} \right)\,|h^{\hat{j}}_{rd}|^2. \label{SNR_D_nodirect}
\end{eqnarray}
The outage probability $p_{nd}$ can be obtained from that derived earlier simply by using $\lambda_{sd}\rightarrow \infty$. Clearly, $p_{nd} = p_1 + p_{2-nd}$, where $p_{2-nd} = \lim\limits_{\lambda_{sd}\rightarrow\infty} p_2$.
Some straightforward manipulations on \eqref{eq:p2_FinalMRC} yields:
{\small\begin{IEEEeqnarray}{rcl}
p_{2-nd}&\approx&\sum _{i=0}^L \binom{L}{i} \sum _{j=0}^i (-1)^{i+j} t_{nd}^j \binom{i}{j} \Bigg(1-\frac{\lambda_{sr} \left({\lambda_{rd} i \psi}+{\lambda_{rp} j}\right)^2 e^{\frac{\lambda_{sr}}{\lambda_{sp}} \left(\frac{\lambda_{rd} i \psi}{\beta}+\frac{\lambda_{rp} j}{\beta}\right)}}{\beta\lambda_{sp} \left({\lambda_{rd} i \psi}+{\lambda_{rp} j}\right)} \Bigg\{E_L\left(\frac{\lambda_{sr}}{\lambda_{sp}} \left(\frac{\lambda_{rd} i \psi}{\beta}+\frac{\lambda_{rp} j}{\beta}\right)\right)\nonumber\\
&&-\left(\frac{\lambda_{sp} \xi}{\psi\lambda_{sr}}+1\right)^{1-L} E_L\left(\frac{\left({\lambda_{rd} i \psi}+{\lambda_{rp} j}\right)}{\beta\lambda_{sp}} \left(\lambda_{sr}+\frac{\lambda_{sp} \xi}{\psi}\right)\right)\Bigg\}-\left(\frac{\lambda_{sr}}{{\lambda_{sp} \xi}/{\psi}+\lambda_{sr}}\right)^L e^{-\frac{1-\rho}{\psi} \left(\frac{\lambda_{rd} i \psi}{\beta}+\frac{\lambda_{rp} j}{\beta}\right)}\Bigg).\label{eq:p2_NoSD}
\end{IEEEeqnarray}}
where $t_{nd} = 1-\left(1+{\lambda_{rd} \gamma_{th} N_o}/{\lambda_{rp}}\right)^{-1}$.
In Section~\ref{sec:simulations}, we use the above to demonstrate importance of taking the direct link into consideration.
\section{Throughput Analysis} \label{sec:Throughput}
In this section, we analyze the throughput performance of a cooperative cognitive EH relaying network. We show how the EH parameter can be chosen optimally. We demonstrate that incremental relaying results in large throughput gains, and also analyze the throughput performance without the direct {link} to bring out this fact.
\vspace{-0.4cm}
\subsection{Throughput Analysis of EH-CCRN with S-D link} \label{sub:TauMRC}
We define the throughput $\tau$ as:
\begin{eqnarray}
\tau&=& 0.5{R_s}\zeta({1-p})\label{eq:tau_mrc},
\end{eqnarray}
where $\zeta$ is $1$ for PS-EH and $(1-\rho)$ for TS-EH.
$\frac{\zeta}{2}$ represents the effective time available for information transmission between nodes S and D. We use $\tau$ without any subscript to refer to throughput of the EH-CCRN with S-D link, and use $\tau_{in}$ and $\tau_{nd}$ to refer to throughputs with incremental relaying and relayed networks without the direct link respectively. When we need to refer to quantities specific to PS-EH and TS-EH, we use $\tau_{ps}$ and $\tau_{ts}$ respectively.
\subsubsection{ Value of $\rho$ for optimum throughput}
As noted already, optimizing $\rho$ is crucial for attaining good throughput performance. To determine this optimum $\rho$ value, we use the approximate expression for outage $\tilde{p}$ in (\ref{eq:pHSNR}). In this case, $\tau$ can be approximated as $\tilde{\tau}$, and written as:
$\tilde{\tau}= \frac{R_s}{2}\zeta({1-\tilde{p}})$.
Using \eqref{eq:pHSNR}, we can represent $\tilde{\tau}$ as follows:
{\begin{equation}
\tilde{\tau}\approx \frac{R_s\zeta}{2}\Bigg(\hspace{-0.1cm}1+\left(1+\frac{\lambda_{sp}}{\lambda_{sd} \psi}\right)^{-1}\hspace{-0.15cm}\underbrace{\Big(\hspace{-0.1cm}\sum _{i=1}^L (-1)^{i+1}\binom{L}{i} L e^{\frac{\psi i \lambda_{rd} \lambda_{sr} }{\beta \lambda_{sp}}} E_{L+1}\Big(\hspace{-0.1cm}\frac{\psi i \lambda_{rd} \lambda_{sr} }{\beta \lambda_{sp}}\hspace{-0.1cm}\Big)-1\hspace{-0.1cm}\Big)}_{F_1(\rho)}+\underbrace{ \frac{\big(1-e^{-\frac{\lambda_{rd} \xi}{\beta}}\big)^L-1}{\left(1+{\lambda_{sp} \xi}/({\lambda_{sr} \psi})\right)^L}}_{F_2(\rho)}\hspace{-0.05cm}\Bigg)\,. \label{eq:tauMRCLRPtendInfty}
\end{equation}}
\begin{lemma}\label{lemma:TauConcaveWRTRho}
Throughput of the EH-CCRN is a concave function of $\rho$.
\end{lemma}
\begin{IEEEproof}
Proof is based on the fact that individually $F_1(\rho)$ and $F_2(\rho)$ are concave functions of $\rho$, and the fact that the summation of two concave functions is always concave \cite{Boyd2004}. Please refer to Appendix-C for proof of concavity of functions $F_1(\rho)$ and $F_2(\rho)$ with respect to (w.r.t.) $\rho$.
\end{IEEEproof}
\par The optimum value of $\rho$ that maximizes throughput can be derived by solving $\frac{d\tilde{\tau}}{d\rho}=0$.
Unfortunately, it is difficult to obtain a closed-form expression for optimum $\rho$ due to the complex expressions involved. Numerical techniques need to be used.
However, for the special case when $L=1$, a closed-form expression is possible. Denote by $\rho^*_{ps}$ and $\rho^*_{ts}$, the optimum $\rho$ for the cooperative cognitive networks employing the PS-EH and TS-EH protocols respectively.
\begin{lemma}
When $L=1$, the value of $\rho$ that maximizes throughput in PS-EH and TS-EH cases can be expressed as:
\begin{subequations}\label{eq:rho_opt}
\begin{IEEEeqnarray}{rcl}
&&\hspace{-0.5cm}\rho^*_{ps} \approx \dfrac{1-\sqrt{\left(1+{\lambda_{sp}}/({\lambda_{sd}\psi})\right)}\,{ \psi \lambda_{sr}}/{ \lambda_{sp}}}{1+\sqrt{\left(1+{\lambda_{sp}}/({\lambda_{sd}\psi})\right)}\,{ \eta}/{\lambda_{rd}}}\label{eq:rhoPS}\quad \text{and}\\
&&\hspace{-0.5cm}\rho^*_{ts}\approx\dfrac{\frac{2 \eta}{\lambda_{rd} \lambda_{sr} \psi} \sqrt{\dfrac{\lambda_{sd} \lambda_{sp} \psi}{(\lambda_{sd}+\lambda_{sp}/\psi)2\eta/(\lambda_{sr}\lambda_{rd})-1}}-1}{{2 \eta \lambda_{sp}}/({\lambda_{rd} \lambda_{sr} \psi})-1}.\label{eq:rhoTS}
\end{IEEEeqnarray}
\end{subequations}
\end{lemma}
\begin{IEEEproof}
Derivation is presented in Appendix-D.
\end{IEEEproof}
In Section~\ref{sec:simulations}, we demonstrate that the $\rho_{ps}^{*}$ and $\rho_{ts}^{*}$ estimates of (\ref{eq:rhoPS}) and (\ref{eq:rhoTS}) are accurate.
\subsection{Throughput of EH-CCRN Without S-D Link}
For comparison purpose, throughput in the special case when the direct S-D channel is ignored (or too weak to be used) is of interest, since this is the case that has been considered in most literature so far. In this section, we derive an expression for this throughput and use it for benchmarking the schemes presented in this paper that utilize the direct S-D channel.
Throughput $\tau_{nd}$ in this case becomes:
\begin{IEEEeqnarray}{rcl}
\tau_{nd} = 0.5 R_s \zeta (1-p_{nd})\,,\label{eq:tauWithdSDTendToInfty}
\end{IEEEeqnarray}
where $p_{nd} \triangleq p_1+p_{2-nd}$. From \eqref{eq:p1} and \eqref{eq:p2_NoSD}, $\tau_{nd}$ can be evaluated from \eqref{eq:tauWithdSDTendToInfty}.
\par The throughput $\tilde{\tau}_{nd}$ at {in typical operating conditions (i.e.$\lambda_{sp}\gg \psi$)} can be derived directly from \eqref{eq:tauMRCLRPtendInfty} with $\lambda_{sd}\rightarrow\infty$ and can represented below:
{\begin{equation}
\tilde{\tau}_{nd}\approx \frac{R_s\zeta}{2}\Bigg(1-\underbrace{\Big(1- \sum _{i=1}^L (-1)^{i+1}\binom{L}{i} L e^{\frac{\psi i \lambda_{rd} \lambda_{sr} m }{\beta \lambda_{sp}}} E_{L+1}\Big(\frac{\psi i \lambda_{rd} \lambda_{sr} m }{\beta \lambda_{sp}}\Big)\Big)}_{F_1(\rho)}-\underbrace{ \frac{1-\big(1-e^{-\frac{\lambda_{rd} \xi}{\beta}}\big)^L}{\left(1+{\lambda_{sp} \xi}/({\lambda_{sr} \psi})\right)^L}}_{F_2(\rho)}\Bigg)\,. \label{eq:tauMRCLRPtendInftyWtLSD}
\end{equation}}
As in Section~\ref{sub:TauMRC}, it can be shown that $\tilde{\tau}_{nd}$ \eqref{eq:tauMRCLRPtendInftyWtLSD} is a concave function $\rho$. Again, there is an optimum value of $\rho$ as with EH-CCRN with S-D link. We denote by $\rho_{nd-ps}^{*}$ and $\rho_{nd-ts}^{*}$ the optimum $\rho$ with PS-EH and TS-EH protocols when the direct S-D channel is too weak and cannot be used.
\begin{remark}
In this case for $L=1$ and in the absence of the direct channel, \eqref{eq:rhoPS} and \eqref{eq:rhoTS} can be expressed as:
\begin{subequations}\label{eq:rho_opt_withoutDSD}
\begin{eqnarray}
\rho^*_{nd-ps} &\approx& \dfrac{1-{ \psi \lambda_{sr}}/{ \lambda_{sp}}}{1+{ \eta}/{\lambda_{rd}}}\label{eq:rhoPSdSDInfty}\qquad\quad\text{and}\\
\rho^*_{nd-ts} &\approx&\dfrac{\sqrt{{2 \eta \lambda_{sp}}/({\psi \lambda_{rd} \lambda_{sr} })}-1}{{2 \eta \lambda_{sp}}/({\psi \lambda_{rd} \lambda_{sr} })-1}. \label{eq:rhoTSdSDInfty}
\end{eqnarray}
\end{subequations}
\end{remark}
\begin{lemma}
The gain in throughput due to use of the direct S-D channel quantified by $\tau-\tau_{nd}$ is finite and positive, and is given by:
\begin{equation}
\tau-\tau_{nd}\approx \frac{R_s\zeta}{2}\bigg(\underbrace{1-\sum _{i=1}^L (-1)^{i+1} \binom{L}{i}L \,e^{\frac{\psi i \lambda_{rd} \lambda_{sr} }{\beta \lambda_{sp}}} E_{L+1}\Big(\frac{\psi i \lambda_{rd} \lambda_{sr}}{\beta \lambda_{sp}}\Big)}_{F_1(\rho)}\bigg) \left(\frac{\lambda_{sp}/(\lambda_{sd} \psi )}{1+\lambda_{sp}/(\lambda_{sd} \psi )}\right).\label{eq:TauDiff}
\end{equation}
Further, when the number of antennas at R becomes large ($L\rightarrow\infty$), $\tau-\tau_{nd}\rightarrow0$.
\end{lemma}
\begin{IEEEproof} We present an outline of the proof here.
\eqref{eq:TauDiff} follows from \eqref{eq:tauMRCLRPtendInfty} and \eqref{eq:tauMRCLRPtendInftyWtLSD}, and some simple manipulations. {It can be shown that} $F_1(\rho)=\Pr\left[\frac{\beta I\|{\bm h}_{sr}\|^2|h^{\hat{j}}_{rd}|^2}{N_o|g_{sp}|^2}<\gamma_{th}\right]$. {Since it is a} probability term, its value is less than or equal to $1$, which ensures that $\tau-\tau_{nd}$ is a positive quantity. When $L\rightarrow\infty$, it is shown in Appendix-E that the following relation holds:
\begin{equation}
\sum _{i=1}^L (-1)^{i+1} \binom{L}{i}L \,e^{\frac{\psi i \lambda_{rd} \lambda_{sr} }{\beta \lambda_{sp}}} E_{L+1}\Big(\frac{\psi i \lambda_{rd} \lambda_{sr}}{\beta \lambda_{sp}}\Big)\approx 1.\label{eq:SumSum_ijxExpijxE1ijx}
\end{equation}
Using the above, it can be shown that $\tau-\tau_{nd}\rightarrow0$ when $L\rightarrow \infty$.
\end{IEEEproof}
\par When $L$ is large, the contribution from the direct path becomes negligible i.e. the relayed path is almost always available for end-to-end transmission. However, for practical small values of $L$, the direct channel contributes significantly to the throughput. Intuitively, the reason is as follows. In CRNs, especially in network with EH relays, the nodes need to close to each other for acceptable QoS. This is primarily because of random nature of the power at S and R due to the peak interference constraint, and the random nature of the energy harvested. Clearly, SNR of the direct channel is not always insignificant, and it should therefore not to be ignored for practical $L$ values.
\subsection{Throughput of EH-CCRN with IR Protocol}
In the previous subsection, performance of two-hop EH relaying with conventional CCRN was analyzed. However, as is well known, it is not necessarily throughput efficient since it requires two hops for signaling. IR protocol discussed in Section~\ref{sub:EHCCRNwithIR} exploits the fact that when the direct S-D link is strong so that $\log_{2}\left(1+\Gamma_{d_{1}}\right)=\log_2\left(1+\frac{P_s|h_{sd}|^{2}}{N_o}\right)\geq R_s$, signaling can be accomplished in just one hop, thereby increasing throughput.
In this case, throughput (denoted by $\tau_{in}$ with subscript $in$ denoting incremental) can be expressed as:
\begin{IEEEeqnarray}{rcl}
\tau_{in}&=& \zeta\bigg(0.5\,R_s\underbrace{\Pr\left[\Gamma_{d_1}<\gamma_{th},\, \Gamma_{r}\geq\gamma_{th},\, \Gamma^{\hat{j}}_{d}\geq\gamma_{th}\right]}_{q_1}+ R_s\underbrace{\Pr[\Gamma_{d_1}\geq\gamma_{th}]}_{q_2}\bigg)=\zeta (0.5 R_s q_1 + R_s q_2).\label{eq:tauIn}
\end{IEEEeqnarray}
\par To facilitate quantification of the gains due to incremental relaying explicitly, we write down an expression for throughput of the incremental scheme in terms of that of the EH-CCRN scheme. To facilitate this, we rewrite $q_1$ in the above equation. Since $\Pr\big[\Gamma_{d_1}<\gamma_{th},\, \Gamma_{r}\geq\gamma_{th},\, \Gamma^{\hat{j}}_{d}\geq\gamma_{th}\big]$$+ \Pr\big[\Gamma_{d_1}\geq\gamma_{th},\, \Gamma_{r}\geq\gamma_{th},\, \Gamma^{\hat{j}}_{d}\geq\gamma_{th}\big]$ $=\Pr\big[\Gamma_{r}\geq\gamma_{th},\, \Gamma^{\hat{j}}_{d}\geq\gamma_{th}\big]$ and $\Gamma_{d_{1}}\geq\gamma_{th}$ implies that $\Gamma_{d}\geq\gamma_{th}$, $q_1$ can be written as:
{\begin{eqnarray*}
q_1=\Pr\left[\Gamma^{\hat{j}}_{d}\geq\gamma_{th}, \Gamma_{r}\geq\gamma_{th}\right]-\underbrace{\Pr\left[\Gamma_{d_1}\geq\gamma_{th}, \Gamma_{r}\geq\gamma_{th}\right]}_{p_3}.
\end{eqnarray*}}
$q_1$ can be alternatively represented in terms of $p_1$ and $p_2$ (and therefore $p$ - see (\ref{eq:pout})) by using the $\Pr\big[\Gamma^{\hat{j}}_{d}\geq\gamma_{th}, \Gamma_{r}\geq\gamma_{th}\big]=1-\Pr\big[\Gamma_r < \gamma_{th}\big]-\Pr\big[\Gamma^{\hat{j}}_d< \gamma_{th},\;\Gamma_r \geq \gamma_{th}\big]$ as:
\begin{IEEEeqnarray}{rcl}
q_1&=&1-\bigg(\underbrace{\Pr\left[\Gamma_r< \gamma_{th}\right]}_{p_1}+\underbrace{\Pr\left[\Gamma^{\hat{j}}_d< \gamma_{th},\;\Gamma_r \geq \gamma_{th}\right]}_{p_2}+\underbrace{\Pr\left[\frac{P_s |h_{sd}|^2}{N_o}\geq\gamma_{th}, \frac{\xi P_s\|{\bm h}_{sr}\|^2}{N_o} \geq\gamma_{th} \right]}_{p_3}\bigg).\nonumber
\end{IEEEeqnarray}
From \eqref{eq:pout}, the above equation can be rewritten as:
$q_1=1-p-p_3$.
We evaluate $p_3$ in the above expression, by integrating it first w.r.t $\|{\bm h}_{sr}\|^2
$ and $|h_{sd}|^{2}$ while conditioning it on $|g_{sp}|^{2}$ to get:
\begin{equation}
p_3\Big|_{|g_{sp}|^2}\hspace{-0.15cm}= \sum_{k=0}^{L-1}\frac{1}{k!}\left(\frac{\lambda_{sr}\psi |g_{sp}|^2}{\xi}\right)^k e^{-\left(\frac{\lambda_{sr} \psi}{\xi}+\lambda_{sd} \psi\right) |g_{sp}|^2}\nonumber
\end{equation}
Now after averaging over $|g_{sp}|^2$, we get:
\begin{eqnarray}
p_3&=&\sum_{k=0}^{L-1}\frac{\lambda_{sp}}{k!} \left(\frac{\lambda_{sr} \psi}{\xi}\right)^k\int_{0}^{\infty}{(|g_{sp}|^2)}^k \exp\left(-\left(\frac{\lambda_{sr} \psi}{\xi}+\lambda_{sd} \psi +\lambda_{sp}\right)|g_{sp}|^2\right)d|g_{sp}|^2\nonumber\\
&=&\frac{\xi\lambda_{sp}}{\lambda_{sr} \psi}\sum_{k=0}^{L-1} \left(\frac{{\lambda_{sr} \psi}/{\xi}}{\left(\lambda_{sp}+\lambda_{sd}\psi+{\lambda_{sr}\psi}/{\xi}\right)}\right)^{k+1}=\frac{1}{\frac{\lambda_{sd}\psi}{\lambda_{sp}}+1}\left(1-\left(\frac{\lambda_{sd} \xi}{\lambda_{sr}}+\frac{\lambda_{sp} \xi}{\lambda_{sr} \psi}+1\right)^{-L}\right).\label{eq:p3}
\end{eqnarray}
\begin{lemma}\label{lem:V4}
The throughput $\tau_{in}$ of the incremental scheme is related to throughput of the cooperative cognitive scheme as follows:
\begin{IEEEeqnarray}{rcl}
\tau_{in}&=& \tau-0.5 \zeta R_s p_3+\frac{\zeta R_s}{1+\frac{\lambda_{sd} \psi }{\lambda_{sp} }}=\tau+\frac{0.5\zeta R_s}{1+\frac{\lambda_{sd} \psi }{\lambda_{sp} }}\bigg(1+\left(1+\frac{\lambda_{sd}\xi}{\lambda_{sr}}+\frac{\lambda_{sp}\xi}{\lambda_{sr}\psi}\right)^{-L}\bigg).\label{eq:tauIn_2}
\end{IEEEeqnarray}
\end{lemma}
\begin{IEEEproof}
Using $q_1=1-p-p_3$ in (\ref{eq:tauIn}), and using (\ref{eq:tau_mrc}), we have: $\tau_{in}=\zeta(\tau-0.5R_s p_3 + R_s q_2)$. Since $\Gamma_{d_1}=\frac{P_s|h_{sd}|^2}{N_o}=I \frac{|h_{sd}|^2}{|g_{sp}|^2}$, using the CDF of ratio of exponentials, it can be readily established that $q_2=\Pr[\Gamma_{d_1}\geq\gamma_{th}]
=\frac{1}{1+\frac{\lambda_{sd} \psi }{\lambda_{sp} }}$. Using this, along with the expression for $p_3$ in (\ref{eq:p3}), we have \eqref{eq:tauIn_2}.
\end{IEEEproof}
Denote by $\tau_{dir}$ the throughput of the link when the relay is absent (direct communication). Clearly, $\tau_{dir} = R_s\Pr\left[\frac{P_s|h_{sd}|^2}{N_o}\geq\gamma_{th}\right]=\frac{R_s}{1+{\lambda_{sd} \psi }/{\lambda_{sp} }}$.
\begin{lemma}\label{tauin_tau}
When the number of antennas at R is large, the asymptotic throughput difference ($\tau_{in}-\tau$) saturates to a fixed value equal to $0.5 \zeta\tau_{dir}$.
\end{lemma}
\begin{IEEEproof}
Using the fact that $\frac{\psi }{\lambda_{sp}}\ll1$ and $\lambda_{sp}\gg\lambda_{sd}$ typically, which makes $\left(1+\frac{\lambda_{sd}\xi}{\lambda_{sr}}+\frac{\lambda_{sp}\xi}{\lambda_{sr}\psi}\right)^{-1}\ll1$, the above can be approximated as:
\begin{equation}
\tau_{in}-\tau \hspace{0.1cm}\overset{L\rightarrow\infty}{=} \hspace{0.1cm}\frac{0.5 \zeta R_s}{1+\frac{\lambda_{sd} \psi }{\lambda_{sp} }}=0.5\zeta\,\tau_{dir}.\label{eq:DiffTauInAndTauMRCAsymptotic}
\end{equation}
\end{IEEEproof}
On the other hand, for smaller number of antennas, the direct path contributes significantly to the throughput, and hence $\tau_{in}$ is much larger than $\tau$.
\subsubsection{Optimum EH parameter}
For both PS-EH and TS-EH, choice of optimal EH parameter $\rho$ for IR is of interest. We first show that $\tau_{in}$ is a concave function of $\rho$ in the following lemma.
\vspace{-0.3cm}
\begin{lemma}\label{Lem:TauINC_Concave}
Throughput $\tau_{in}$ of the IR scheme is a concave function of $\rho$.
\end{lemma}
\vspace{-0.1cm}
\begin{IEEEproof}
Proof is presented in Appendix-F.
\end{IEEEproof}
\begin{lemma}\label{Lem:rho_ts_in}
For incremental relay case with $L=1$, optimum value $\rho_{in-ps}^{*}$ of $\rho$ equals $\rho_{ps}^{*}$. For TS-EH, optimum value of $\rho$, denoted by $ \rho^*_{in-ts}$, is given by:
\begin{subequations}\label{eq:rho_opt_in}
\begin{IEEEeqnarray}{rcl}
\rho^*_{in-ps}&\approx& \rho^*_{ps}\label{eq:rho_ps_in}\\
\rho^*_{in-ts}&\approx&\dfrac{1}{{2 \eta \lambda_{sp}}/({\lambda_{rd} \lambda_{sr} \psi})-1}\bigg(-1+\dfrac{\eta }{\lambda_{rd} \lambda_{sr}}\sqrt{\dfrac{2 \lambda_{sd} \lambda_{sp}/\psi}{ {\eta \lambda_{sd}}/({\lambda_{rd} \lambda_{sr}})+{2 \eta \lambda_{sp}}/(\lambda_{rd} \lambda_{sr} \psi)-1}}\bigg)\,.\label{eq:rho_ts_in}
\end{IEEEeqnarray}
\end{subequations}
\end{lemma}
\begin{IEEEproof}
Proof is presented in Appendix-G.
\end{IEEEproof}
\section{Simulation Results}\label{sec:simulations}
We validate the derived expressions using computer simulations. The normalized S-R, R-D, S-P and R-P distances are chosen to be $1.2$, $1.8$, $3$ and $3$ units respectively. We assume $\epsilon=4$ (path loss exponent), $\eta = 0.7$ and $I/N_o=6$ dB.
\par In Fig.~\ref{fig:PoutVsIdB}, outage performance of the EH-CCRN scheme (with and without the S-D channel) is depicted versus $I/N_o$ for $\rho=0.4$ and $R_s=1$ bits per channel use (bpcu). It can be observed that outage probability decreases with increase in number of antennas $L$. This is because the harvested energy as well as SNR at R increase significantly as $L$ increases. Also, increase in degrees of freedom in choice of best channel from R to D boosts the second hop SNR further. Fig.~\ref{fig:PoutVsIdB} also verifies accuracy of the approximated outage probability expression in \eqref{eq:p2_WtRP}, and the approximation of \eqref{eq:pHSNR}
\begin{figure*}[t]
\vspace{-0.5cm}
\begin{multicols}{2}
\includegraphics[height=6.5cm,width=0.46\textwidth]{PoutVsIdB.eps}
\par\caption{Outage probability vs. $\frac{I}{N_o}$ for different $L$}
\label{fig:PoutVsIdB}
\includegraphics[height=6.5cm,width=0.46\textwidth]{TauVsRhoForLEq1.eps}
\par \caption{Throughput vs. $\rho$ for $L=1$, $R_s=3$ and $d_{sr}=1.5$}
\label{fig:TauVsRhoForLEq1}
\end{multicols}
\vspace{-0.8cm}
\end{figure*}
\par Concavity of throughput with respect to $\rho$ (Lemma-\ref{lemma:TauConcaveWRTRho}), as well as the importance of choosing $\rho$ carefully are clearly brought out in Fig.~\ref{fig:TauVsRhoForLEq1} { with} $R_s=3$ bpcu. If $\rho$ is very small, the amount of harvested energy at R is not sufficient to support R-D transmission with both TS-EH and PS-EH protocols. On the other hand if it is too large ($\rho\rightarrow 1$), decoding of message signal at R becomes extremely difficult {with} PS-EH, and there is insufficient time for information transmission {with} TS-EH. Similar arguments hold for throughput without the S-D path. It can be readily observed from the plot that the value of $\rho$ for IR protocol in the PS-EH case is almost the same as in EH-CCRN (Lemma ~\ref{Lem:rho_ts_in}), and $\tau_{in}-\tau$ is approximately a constant (Lemma ~\ref{tauin_tau}). Optimum values obtained from the simulation are seen to closely matched the corresponding derived analytical optimum values. Also, the optimum value of $\rho$ for TS-EH case is smaller than the optimum $\rho$ for the PS-EH case, and use of the S-D link results in smaller optimum $\rho$ values. Further, we verify the expression for optimum EH parameters derived in the paper for PS-EH and TS-EH { for} EH-CCRN (with and without S-D link from \eqref{eq:rho_opt} and \eqref{eq:rho_opt_withoutDSD} respectively) and IR from \eqref{eq:rho_opt_in}.
\par In Fig. \ref{fig:TauVsRsForLEq2}, SN throughput is plotted versus fixed source rate ($R_s$) assuming $L=2$ {for optimum $\rho$ (which is determined by simulation).} For lower rate $R_s$, outage probability of the end-to-end communication is small and the number of bits received is also small. On the other hand, if $R_s$ is too high, end-to-end outage is also high and this again lowers the number of bits received by D. Hence, $R_s$ needs to be optimally chosen for maximum throughput in all the cases (TS-PH or PS-EH, EH-CCRN and IR).
\par In Fig. \ref{fig:TauVsLForFixedRhoRs}, we plot the throughput versus number of antennas $L$ at R for $\rho=0.4$ and $R_s=4.5$. It is evident that increase in $L$ improves throughput. Also, IR always results in better throughput even when $L=1$ (Lemma \ref{lem:V4}).
\begin{figure*}[t]
\begin{multicols}{2}
\includegraphics[height=6.5cm,width=0.46\textwidth]{TauVsRsforOptimumRho.eps}
\par\caption{Throughput vs. $R_s$ for $L=2$ and optimum $\rho$}
\label{fig:TauVsRsForLEq2}
\includegraphics[height=6.5cm,width=0.46\textwidth]{TauVsLforFixedRhoAndRs.eps}
\par\caption{Throughput vs. different number of antenna at R}
\label{fig:TauVsLForFixedRhoRs}
\end{multicols}
\vspace{-0.8cm}
\end{figure*}
The difference between $\tau_{in}-\tau$ is a constant quantity as evident from \eqref{eq:DiffTauInAndTauMRCAsymptotic}. { It is also evident that performance is inferior to the case when only the direct (relay-less link) is used when $L=1$. This clearly demonstrates that use of more than one antenna is important.}
\begin{figure}[h]
\vspace{-0.3cm}
\centering
\includegraphics[height=6.5cm,width=0.5\textwidth]{TauVsdSR_Leq2.eps}
\caption{Far-user throughput (in bpcu) vs. normalized distance between S to R for $L=2$, and TS-EH and PS-EH cases }
\label{fig:TauVsdSR_Leq2}
\vspace{-0.3cm}
\end{figure}
\par In Fig. \ref{fig:TauVsdSR_Leq2}, throughput is plotted vs. distance between nodes S and R for the following parameters: $L=2, R_s = 4, I/N_o= 9$ dB. Here the normalized S-D, S-P, and R-P distances are 4. R-D distance is equal to the difference between S-D and S-R distances. Recently \cite{Xie2018} investigated the performance of EH-relayed underlay-CRN with the selection combining (SC). Clearly, unlike the MRC scheme considered in this paper, is not an optimal transmission scheme. We can observe a throughput gain of more than 0.1 bpcu when MRC is used.
\vspace{-0.3cm}
\section{Conclusion} \label{sec:conclusion}
In this paper, we analyzed throughput performance of a cooperative cognitive two-hop network with a multi-antenna energy harvesting relay for both time-switching and power-splitting protocols. Unlike other works to date, we {optimally combine the direct and relayed signals}. We demonstrated that the direct channel contributes significantly to throughput when the number of antennas at the energy harvesting relay is small. Incremental relaying was shown to result in large throughput gains. We presented closed form expressions for optimum values of charging parameters in several important cases, and derived insights into performance of such systems.
\section*{Appendix-A:Derivation of approximation of $p_2$}
\setcounter{equation}{0}
\renewcommand{\theequation}{A.\arabic{equation}}
From \eqref{eq:p2_def}, $p_2$ can be rewritten as follows:
{\begin{equation}
p_2=\Pr\bigg[\frac{P_s |h_{sd}|^2}{N_o}+\frac{X\big|_{P_s\|{\bm h}_{sr}\|^2}}{N_o}< \gamma_{th},\frac{\xi P_s \|{\bm h}_{sr}\|^2}{N_o} \geq \gamma_{th}\bigg].\label{eq:p2Appendix}
\end{equation}}
where $X={\displaystyle\max_{j}}\left(\min\left(^hP_r, {I}/{|g^j_{rp}|^2}\right)|h^j_{rd}|^2\right)$. To find a CDF of X we first write the CDF of $X_j = \min\left(^hP_r, {I}/{|g^j_{rp}|^2}\right)|h^j_{rd}|^2$, and then use order statistics to write CDF of $X$ conditioned on $^hP_r$ as \cite{Papoulis2002}:
{ \begin{IEEEeqnarray}{rcl}
F_{X\big|_{^hP_r}}(x) &=& \left(F_{X_j}\left(x_j\Big|\,^hP_r\right)\right)^L\,, \label{eq:CDF_X1}
\end{IEEEeqnarray}}
where $F_{X_j}\left(x_j\Big|\,^hP_r\right)$ is the CDF of $X_j$ conditioned on $\,^hP_r$, which can be evaluated as follows:
\begin{IEEEeqnarray*}{rcl}
F_{X_j}\left(x_j\Big|\,^hP_r\right)&=& \Pr[X_j<x_j\Big|\,^hP_r]\nonumber\\
&=& \Pr\left[^hP_r|h^j_{rd}|^2< x_j,\, ^hP_r\leq {I}/{|g^j_{rp}|^2}\right]+ \Pr\left[{I|h^j_{rd}|^2}/{|g^j_{rp}|^2}< x_j,\, ^hP_r> {I}/{|g^j_{rp}|^2}\right]\,.
\end{IEEEeqnarray*}
By utilizing the independence between $|h^j_{rd}|^2$ and $|g^j_{rp}|^2$, we have:
{\begin{IEEEeqnarray}{rcl}
F_{X_j}\left(x_j\Big|\,^hP_r\right)=1-e^{\frac{\lambda_{rd}x}{\beta\,P_s\,\|{\bm h}_{sr}\|^2}}\Big(1-\frac{\frac{\lambda_{rd} x}{I\lambda_{rp}} e^{-\frac{\lambda_{rp}I}{\beta\,P_s\,\|{\bm h}_{sr}\|^2}}}{1+\frac{\lambda_{rd}x}{I\lambda_{rp}}}\Big).\nonumber
\end{IEEEeqnarray}}
where $^hP_r=\beta P_s \parallel {\bf h}_{sr} \parallel^{2}$. From \eqref{eq:CDF_X1} using the binomial theorem, CDF of $X$ conditioned on $^hP_r$ can be expressed as:
\vspace{-0.6cm}
\begin{IEEEeqnarray}{rcl}
F_{X}(x\big|{^hP_r})&=&\sum_{i=0}^{L} \sum_{j=0}^i\binom{L}{i}\binom{i}{j}(-1)^{i+j}\left(1-\frac{1}{1+\frac{\lambda_{rd}x}{I\lambda_{rp}}}\right)^{j} \exp\left(-\frac{j\lambda_{rp}I}{\beta\,P_s\,\|{\bm h}_{sr}\|^2}-\frac{i\lambda_{rd}x}{\beta\,P_s\,\|{\bm h}_{sr}\|^2}\right). \label{eq:CDF_X}
\end{IEEEeqnarray}
After averaging \eqref{eq:p2Appendix} over $X$, $p_2$ becomes:
\begin{IEEEeqnarray}{rcl}
p_2&=&\E_{\C_1 }\left[ F_{X\big|{^hP_r}}\left(\gamma_{th}-\frac{P_s |h_{sd}|^2}{N_o}\right)\right],\nonumber
\end{IEEEeqnarray}
where the condition $\C_1=\big\{{\xi P_s \|{\bm h}_{sr}\|^2}\geq\psi,\, \frac{P_s |h_{sd}|^2}{N_o}<\gamma_{th}\big\}$. Using the CDF of $X$ from \eqref{eq:CDF_X}, the above equation is expanded as follows:
\begin{IEEEeqnarray}{rcl}
p_2&=&\sum_{i=0}^{L} \sum_{j=0}^i\binom{L}{i}\binom{i}{j}(-1)^{i+j}\E_{\C_1 }\Big[e^{-\frac{i\lambda_{rd}\left(\gamma_{th}N_o-P_s |h_{sd}|^2\right)}{\beta\,P_s\,\|{\bm h}_{sr}\|^2}}e^{-\frac{j\lambda_{rp}I}{\beta\,P_s\,\|{\bm h}_{sr}\|^2}}\Big(1-\frac{1}{1+\frac{\lambda_{rd}}{I\lambda_{rp}}(\gamma_{th}N_o-P_s |h_{sd}|^2)}\Big)^{j}\Big],\nonumber
\end{IEEEeqnarray}
Here, $\frac{\lambda_{rd}}{I\lambda_{rp}}(\gamma_{th}N_o-P_s |h_{sd}|^2)$ that appears in the denominator is such that it is much less than one. For this reason, to make the analysis tractable, $\frac{\lambda_{rd}}{I\lambda_{rp}}\left(\gamma_{th}N_o-P_s |h_{sd}|^2\right)$ {is} replaced by its mean conditioned on $\C_1$ i.e. $\frac{\lambda_{rd}}{I\lambda_{rp}}\left(\gamma_{th}N_o-\E_{\C_1}[P_s |h_{sd}|^2]\right)$. $\E_{\C_1}[P_s |h_{sd}|^2]$ can be derived as:
\begin{IEEEeqnarray}{rcl}
\E_{\C_1}[P_s |h_{sd}|^2]&=&\frac{I \lambda_{sp}}{\lambda_{sd}} \Big(\log \Big(\frac{\psi \lambda_{sd}}{\lambda_{sp}}+1\Big)+\frac{\psi \lambda_{sd}}{\lambda_{sp}}\frac{1}{1+\frac{\psi \lambda_{sd} }{\lambda_{sp}}}\Big).\nonumber
\end{IEEEeqnarray}
With this, $p_2$ can be represented in approximated form as:
\begin{IEEEeqnarray}{rcl}
p_2&\approx&\sum_{i=0}^{L} \sum_{j=0}^i\binom{L}{i}\binom{i}{j}(-1)^{i+j}t^j\E_{\C_1}\Big[{e^{-\frac{i\lambda_{rd}\left(\gamma_{th}N_o-P_s |h_{sd}|^2\right)}{\beta\,P_s\,\|{\bm h}_{sr}\|^2}}}e^{-\frac{j\lambda_{rp}I}{\beta\,P_s\,\|{\bm h}_{sr}\|^2}}\Big],
\end{IEEEeqnarray}
where $t=1-1/({1+\frac{\lambda_{rd}}{I\lambda_{rp}}\left(\gamma_{th} N_o-\E_{\C_1}\left[P_s|h_{sd}|^2\right]\right)})$. The above approximation is tight for $\lambda_{rd}\ll \lambda_{rp}$. This is true for general system settings in underlay-CRN. Now averaging the above equation w.r.t. $|h_{sd}|^2$, $p_2$ becomes:
\begin{IEEEeqnarray}{rcl}
p_2&\approx&\sum_{i=0}^{L} \sum_{j=0}^i\binom{L}{i}\binom{i}{j}(-1)^{i+j}t^j\E_{\C_3}\Big[e^{-\frac{j\lambda_{rp}I}{\beta\,P_s\,\|{\bm h}_{sr}\|^2}}\int_{0}^{\frac{\psi}{P_s}}\hspace{-0.1cm}{e^{-\frac{i\lambda_{rd}\left(\gamma_{th}-P_s |h_{sd}|^2\right)}{\beta\,P_s\,\|{\bm h}_{sr}\|^2}}}\lambda_{sd} e^{-\lambda_{sd} |h_{sd}|^2}\Big],\nonumber
\end{IEEEeqnarray}
where condition $\C_3=\left\{{\xi P_s \|{\bm h}_{sr}\|^2}/{N_o}>\gamma_{th}\right\}$. Performing the integrations, we can write $p_2$ as:
\begin{equation}
p_2=\sum_{i=0}^{L} \sum_{j=0}^i\binom{L}{i}\binom{i}{j}(-1)^{i+j}t^j\E_{\C_3}\bigg[\frac{\beta \|{\bm h}_{sr}\|^2 \lambda_{sd} }{\beta \|{\bm h}_{sr}\|^2 \lambda_{sd}-i \lambda_{rd}} e^{-\frac{I j \lambda_{rp}}{\beta \|{\bm h}_{sr}\|^2 P_s}} \Big(e^{-\frac{i \lambda_{rd}\gamma_{th} N_o}{\beta \|{\bm h}_{sr}\|^2 P_s}}-e^{-\frac{\lambda_{sd}\gamma_{th} N_o}{P_s}}\Big)\bigg],\label{eq:p_2_hsrgsp}
\end{equation}
Substituting the value of $P_s=I/|g_{sp}|^2$ from \eqref{eq:PsOnlyInterference}, \eqref{eq:p_2_hsrgsp} becomes:
{\begin{equation}
p_2\approx\sum_{i=0}^{L} \sum_{j=0}^i\binom{L}{i}\binom{i}{j}(-1)^{i+j}t^j\E_{\C_3}\Big[\frac{\beta \|{\bm h}_{sr}\|^2 \lambda_{sd}}{\beta \|{\bm h}_{sr}\|^2 \lambda_{sd}-i \lambda_{rd}} e^{-\frac{j \lambda_{rp}|g_{sp}|^2}{\beta \|{\bm h}_{sr}\|^2}} \Big(e^{-\frac{i \lambda_{rd}\psi|g_{sp}|^2}{\beta \|{\bm h}_{sr}\|^2 }}-e^{-{\lambda_{sd}\psi|g_{sp}|^2}}\Big)\Big].\label{eq:p_2_hsrgsp1}
\end{equation}}
To make the expression compact, we use: $a=\frac{\lambda_{rp}}{\beta}$, $b=\frac{\psi \lambda_{rd} }{\beta}$, $c={\psi\lambda_{sd}}$, $d=\frac{\lambda_{rd}}{\beta \lambda_{sd}}$, and $g=\frac{\xi}{\psi}$. After averaging over $|g_{sp}|^2$, the above equation becomes:
{\begin{IEEEeqnarray}{rcl}
&&p_2\approx\sum_{i=0}^{L} \sum_{j=0}^i\binom{L}{i}\binom{i}{j}(-1)^{i+j}t^j\E_{\|{\bm h}_{sr}\|^2}\Big[\frac{\|{\bm h}_{sr}\|^2}{\|{\bm h}_{sr}\|^2-i d}\nonumber\\
&&\mathlarger{\int}_0^{g \|{\bm h}_{sr}\|^2}\hspace{-0.7cm} \lambda_{sp} e^{-\frac{j a |g_{sp}|^2}{\|{\bm h}_{sr}\|^2}} e^{ -\lambda_{sp}|g_{sp}|^2} \Big(e^{-\frac{i b |g_{sp}|^2}{\|{\bm h}_{sr}\|^2}}-e^{-c |g_{sp}|^2}\Big) \, d|g_{sp}|^2\Big]. \nonumber
\end{IEEEeqnarray}}
After integration, $p_2$ conditioned on $\|{\bm h}_{sr}\|^2$ can now be expressed as:
{{\small\begin{IEEEeqnarray}{rcl}
&&p_2\big|_{\|{\bm h}_{sr}\|^2}=\sum_{i=0}^{L} \sum_{j=0}^i\binom{L}{i}\binom{i}{j}(-1)^{i+j}t^j \frac{(\|{\bm h}_{sr}\|^2)^2 \lambda_{sp}}{\|{\bm h}_{sr}\|^2-i d}\Bigg(\frac{1-e^{-g (j a+i b+\|{\bm h}_{sr}\|^2 \lambda_{sp})}}{j a+i b+\|{\bm h}_{sr}\|^2 \lambda_{sp}}+\frac{e^{-g (j a+\|{\bm h}_{sr}\|^2 (c+\lambda_{sp}))}-1}{j a+\|{\bm h}_{sr}\|^2 (c+\lambda_{sp})}\Bigg).\nonumber
\end{IEEEeqnarray}}
After some manipulations, the above equation can be represented as in {\eqref{eq:p2_2} using $b=cd$.}
{\begin{IEEEeqnarray}{rcl}
p_2|_{\|{\bm h}_{sr}\|^2}&=&\sum_{i=0}^{L} \sum_{j=0}^i\binom{L}{i}\binom{i}{j}(-1)^{i+j}t^j\Bigg\{\frac{1}{j a+i b+i d \lambda_{sp}}\Bigg(\frac{j a \lambda_{sp} \left(1-e^{-g (j a+\|{\bm h}_{sr}\|^2 (c+\lambda_{sp}))}\right)}{(c+\lambda_{sp})(1+ \frac{(c+\lambda_{sp})}{j\,a}\|{\bm h}_{sr}\|^2)}\nonumber\\
&&+i \,d \lambda_{sp}e^{-g j a}e^{-g \lambda_{sp}\|{\bm h}_{sr}\|^2}\bigg(\frac{e^{-g\,c\|{\bm h}_{sr}\|^2}}{\frac{\|{\bm h}_{sr}\|^2}{i d}-1}-\frac{e^{-g i b}}{\frac{\|{\bm h}_{sr}\|^2}{id}-1}\bigg)-\frac{(j a+i b) \left(1-e^{-g (j a+i b+\|{\bm h}_{sr}\|^2 \lambda_{sp})}\right)}{(1+\frac{\lambda_{sp}}{j a+i b}\|{\bm h}_{sr}\|^2)}\Bigg)\nonumber\\
&&-e^{-g (j a+i b+\|{\bm h}_{sr}\|^2 \lambda_{sp})}+\frac{\lambda_{sp} e^{-g (j a+\|{\bm h}_{sr}\|^2 (c+\lambda_{sp}))}}{c+\lambda_{sp}}+\frac{c}{c+\lambda_{sp}}\Bigg\}. \label{eq:p2_2}
\end{IEEEeqnarray}}
{ Finally, averaging \eqref{eq:p2_2} over $\|{\bm h}_{sr}\|^2$, $p_2$ is given by:
{\small \begin{IEEEeqnarray}{rcl}
p_2&=&\sum _{i=0}^L \binom{L}{i} \sum _{j=0}^i (-1)^{i+j} t_1^j \binom{i}{j} \int_0^{\infty } \frac{(\|{\bm h}_{sr}\|^2)^{L-1} \lambda_{sr}^L}{(L-1)!}e^{-\lambda_{sr}\|{\bm h}_{sr}\|^2} \Bigg(\frac{a^2 \lambda_{sp} j^2 \left(1-e^{-g (a j+\|{\bm h}_{sr}\|^2 (c+\lambda_{sp}))}\right)}{(c+\lambda_{sp}) (a j+\|{\bm h}_{sr}\|^2 (c+\lambda_{sp})) (a j+b i+d \lambda_{sp} i)}\nonumber\\
&&\frac{\lambda_{sp} (d i)^2 }{a j+b i+d \lambda_{sp} i}\left(\frac{e^{-g (a j+\|{\bm h}_{sr}\|^2 (c+\lambda_{sp}))}}{\|{\bm h}_{sr}\|^2-d i}-\frac{e^{-g (a j+b i+\|{\bm h}_{sr}\|^2 \lambda_{sp})}}{\|{\bm h}_{sr}\|^2-d i}\right)-\frac{(a j+b i)^2 \left(1-e^{-g (a j+b i+\|{\bm h}_{sr}\|^2 \lambda_{sp})}\right)}{(a j+b i+d \lambda_{sp} i) (a j+b i+\|{\bm h}_{sr}\|^2 \lambda_{sp})}\nonumber\\
&&-e^{-g (a j+b i+\|{\bm h}_{sr}\|^2 \lambda_{sp})}+\frac{\lambda_{sp} e^{-g (a j+\|{\bm h}_{sr}\|^2 (c+\lambda_{sp}))}}{c+\lambda_{sp}}+\frac{c}{c+\lambda_{sp}}\Bigg) \, d\|{\bm h}_{sr}\|^2 .\label{eq:p2_3}
\end{IEEEeqnarray}}
Using the relation $\frac{x^L}{x - a} =
\sum_{k=0}^{L-1}a^k x^{L - 1 - k} + \frac{a^L}{x - a}$, $p_2$ can be rewritten as follows:
{\small \begin{IEEEeqnarray}{rcl}
p_2&=&\sum _{i=0}^L \binom{L}{i} \sum _{j=0}^i (-1)^{i+j} t_1^j \binom{i}{j} \Bigg(\frac{\lambda_{sr}^L \left(\lambda_{sp} (d i)^2\right) }{(L-1)! (a j+b i+d \lambda_{sp} i)}\bigg(\int_0^{\infty } \frac{\lambda_{sr}^L (d i)^{L-1} e^{-\lambda_{sr}\|{\bm h}_{sr}\|^2}}{(L-1)! (\|{\bm h}_{sr}\|^2-d i)} \big(e^{-g (a j+\|{\bm h}_{sr}\|^2 (c+\lambda_{sp}))}\nonumber\\
&&-e^{-g (a j+b i+\|{\bm h}_{sr}\|^2 \lambda_{sp})}\big) \, d\|{\bm h}_{sr}\|^2+\sum _{k=0}^{L-2} (d i)^k \Gamma (-k+L-1) \Big(e^{-a g j} (g (c+\lambda_{sp})+\lambda_{sr})^{k-L+1}-e^{-g (a j+b i)}\nonumber\\
&& \times(g \lambda_{sp}+\lambda_{sr})^{k-L+1}\Big)\bigg)+\frac{(a j)^2}{(c+\lambda_{sp})^2 (a j+b i+d \lambda_{sp} i)}\int_0^{\infty } \frac{\lambda_{sp} e^{-\lambda_{sr}\|{\bm h}_{sr}\|^2} (\|{\bm h}_{sr}\|^2)^{L-1} \lambda_{sr}^L}{(L-1)! \left(\frac{a j}{c+\lambda_{sp}}+\|{\bm h}_{sr}\|^2\right)} \nonumber\\
&&\times\left( \left(1-e^{-g (a j+\|{\bm h}_{sr}\|^2 (c+\lambda_{sp}))}\right)\right) \, d\|{\bm h}_{sr}\|^2-\frac{(a j+b i)^2\lambda_{sr}^L}{(a j+b i+d \lambda_{sp} i)(\lambda_{sp} (L-1)!)}\int_0^{\infty } \frac{e^{-\lambda_{sr}\|{\bm h}_{sr}\|^2} (\|{\bm h}_{sr}\|^2)^{L-1}}{ \left(\frac{a j+b i}{\lambda_{sp}}+\|{\bm h}_{sr}\|^2\right)} \nonumber\\
&&\left(1-e^{-g (a j+b i+\|{\bm h}_{sr}\|^2 \lambda_{sp})}\right)\ d\|{\bm h}_{sr}\|^2-\int_0^{\infty } \frac{e^{-\lambda_{sr}\|{\bm h}_{sr}\|^2}(\|{\bm h}_{sr}\|^2)^{L-1} \lambda_{sr}^Le^{-g (a j+b i+\|{\bm h}_{sr}\|^2 \lambda_{sp})}}{(L-1)!} \, d\|{\bm h}_{sr}\|^2\nonumber\\
&&+\int_0^{\infty } \frac{e^{-\lambda_{sr}\|{\bm h}_{sr}\|^2} (\|{\bm h}_{sr}\|^2)^{L-1} \lambda_{sr}^L \left(\lambda_{sp} e^{-g (a j+\|{\bm h}_{sr}\|^2 (c+\lambda_{sp}))}\right)}{(L-1)! (c+\lambda_{sp})} \, d\|{\bm h}_{sr}\|^2+\frac{c}{c+\lambda_{sp}}\Bigg).\label{eq:p2_5}
\end{IEEEeqnarray}}
To solve the integrals in \eqref{eq:p2_5}, we use the following relations:
\begin{IEEEeqnarray}{rcl}
\int_0^{\infty } \frac{x^{L-1} \exp (-b x)}{a+x} \, dx&=&e^{a b} b^{1-L} \Gamma (L) E_L(a b)\qquad\text{and}\nonumber\\
\int_0^{\infty } e^{-\lambda_{sr}\|{\bm h}_{sr}\|^2} \left(\frac{e^{-g (\|{\bm h}_{sr}\|^2 (c+\lambda_{sp}))}}{\|{\bm h}_{sr}\|^2-d i}-\frac{e^{-g (b i+\|{\bm h}_{sr}\|^2 \lambda_{sp})}}{\|{\bm h}_{sr}\|^2-d i}\right) d\|{\bm h}_{sr}\|^2
&=&e^{-i(b g+d (g \lambda_{sp}+\lambda_{sr}))} (\text{Ei}(i d (g \lambda_{sp}+\lambda_{sr}) )\nonumber\\
&&\hspace{1cm}-\text{Ei}(i d (c g+\lambda_{sp} g+\lambda_{sr}))).\nonumber
\end{IEEEeqnarray}
The $p_2$ can finally be rewritten as follows:
{\small \begin{IEEEeqnarray}{rcl}
p_2&=&\sum _{i=0}^L \sum _{j=0}^i (-1)^{i+j} t_1^j \binom{L}{i} \binom{i}{j} \bigg(\frac{\lambda_{sr}^L \lambda_{sp} (d i)^2}{(L-1)! (a j+b i+d \lambda_{sp} i)} \Big(\sum _{k=0}^{L-2} (d i)^k \Gamma (-k+L-1) \Big(e^{-a g j} (g (c+\lambda_{sp})+\lambda_{sr})^{k-L+1}\nonumber\\
&&-e^{-g (a j+b i)} (g \lambda_{sp}+\lambda_{sr})^{k-L+1}\Big)+(d i)^{L-1} e^{-g (a j+b i)} e^{-d i (g \lambda_{sp}+\lambda_{sr})} (\text{Ei}(d (g \lambda_{sp}+\lambda_{sr}) i)-\text{Ei}(d (c g+\lambda_{sp} g+\lambda_{sr}) i))\Big)\nonumber\\
&&+\frac{\lambda_{sp} \lambda_{sr} e^{a_2 \lambda_{sr}}}{a j+b i+d \lambda_{sp} i} \left(\frac{a j}{c+\lambda_{sp}}\right)^2\left(E_L(a_2 \lambda_{sr})-\left(\frac{\lambda_{sr}}{g (c+\lambda_{sp})+\lambda_{sr}}\right)^{L-1} E_L(a_1 (g (c+\lambda_{sp})+\lambda_{sr}))\right)\nonumber\\
&&-\frac{\lambda_{sr}}{\lambda_{sp} (a j+b i+d \lambda_{sp} i)} e^{a_1 \lambda_{sr}} (a j+b i)^2 \left(E_L(a_1 \lambda_{sr})-\left(\frac{\lambda_{sr}}{g \lambda_{sp}+\lambda_{sr}}\right)^{L-1} E_L(a_1 (g \lambda_{sp}+\lambda_{sr}))\right)-\left(\frac{\lambda_{sr}}{g \lambda_{sp}+\lambda_{sr}}\right)^L \nonumber\\
&&\times e^{-g (a j+b i)}+\frac{\lambda_{sp}}{c+\lambda_{sp}} e^{-a g j}\left(\frac{\lambda_{sr}}{g (c+\lambda_{sp})+\lambda_{sr}}\right)^L+\frac{c}{c+\lambda_{sp}}\bigg)\,,\label{eq:p2_4}
\end{IEEEeqnarray}}
where $b_1=e^{-g (a j+b i)}$, $a_1=\frac{a j+b i}{\lambda_{sp}}$, $b_2=e^{-a \,g\,j}$ and $a_2=\frac{a j}{c+\lambda_{sp}}$.}
\section*{Appendix-B: {Approximation of $\tilde{p}$}}
\setcounter{equation}{0}
\renewcommand{\theequation}{B.\arabic{equation}}
\subsubsection*{Approximation of $\tilde{p}_2$}
{For the typical value of parameters ( i.e. $\lambda_{sp} \gg \psi$)}, arguments inside $e^{-x}\text{Ei}(x)$ and $e^{x} \E_k(x), k>0$ increase and decrease respectively with increase in $x$. From the fact that $e^{-x}\text{Ei}(x)\rightarrow 0$ for $x\rightarrow\infty$, the term associated with $\text{Ei}(x)$ vanishes from the expression, and it can be expressed as follows:
{\small\begin{IEEEeqnarray}{rcl}
\tilde{p}_2&\approx&\sum _{i=1}^L (-1)^i \binom{L}{i} \Bigg(\frac{\lambda_{rd}^2 \lambda_{sp} \lambda_{sr}^L }{\beta \lambda_{sd}^2 (L-1)! \left(\frac{\lambda_{rd} \lambda_{sp}}{ \lambda_{sd}}+{\lambda_{rd} \psi}\right)}\bigg(\sum _{k=0}^{L-2} i\, \Gamma (L-k-1) \left(\frac{\lambda_{rd} i}{\beta \lambda_{sd}}\right)^k \bigg(\left(\frac{\xi (\lambda_{sd} \psi+\lambda_{sp})}{\psi}+\lambda_{sr}\right)^{k-L+1}\nonumber\\
&&-e^{-\frac{\lambda_{rd} i \xi}{\beta}}\left(\frac{\lambda_{sp} \xi}{\psi}+\lambda_{sr}\right)^{k-L+1}\bigg)\bigg) -\frac{\left(\lambda_{rd}^2 \lambda_{sr} i \psi^2 \right)}{\beta \lambda_{sp} \left(\frac{\lambda_{rd} \lambda_{sp}}{ \lambda_{sd}}+{\lambda_{rd} \psi}\right)}e^{\frac{\lambda_{rd} \lambda_{sr} i \psi}{\beta \lambda_{sp}}}\bigg\{E_L\left(\frac{\lambda_{rd} \lambda_{sr} i \psi}{\beta \lambda_{sp}}\right)-\left({\frac{\lambda_{sp} \xi}{\psi \lambda_{sr}}+\lambda_{sr}}\right)^{1-L} \nonumber\\
&& \times E_L\left(\frac{\lambda_{rd} i \psi}{\beta \lambda_{sp}} \left(\lambda_{sr}+\frac{\lambda_{sp} \xi}{\psi}\right)\right)\bigg\}-e^{-\frac{\lambda_{rd} i \xi}{\beta}} \left({\frac{\lambda_{sp} \xi}{\psi\lambda_{sr}}+1}\right)^{-L}\Bigg)-\left({\frac{\lambda_{sp} \xi}{\lambda_{sr} \psi}+1}\right)^{-L}.
\label{eq:p2_WtRPWithoutEix}
\end{IEEEeqnarray}}
To further simplify \eqref{eq:p2_WtRPWithoutEix}, we use the fact that $e^x E_L(x)>e^x E_L(x+A)$ for $A>0$. If $A$ is very large (as it is in this case since $A=\xi \lambda_{sp}/\psi\gg0$ for $\rho>0$), the term with $e^x Ei(-(x+A))$ can be neglected. \eqref{eq:p2_WtRPWithoutEix} now becomes as follows:
{\begin{IEEEeqnarray}{rcl}
\tilde{p}_2&\approx&\sum _{i=1}^L (-1)^{i+1} \binom{L}{i} \Bigg(\underbrace{\frac{\lambda_{rd} \lambda_{sr}^L }{\beta \lambda_{sd} (L-1)! \left(1+{\psi\lambda_{sd}}/\lambda_{sp}\right) \left(\frac{\lambda_{sp} \xi}{\psi}+\lambda_{sr}\right)^{L-1}}\bigg(\sum _{k=0}^{L-2} i\, \Gamma (L-k-1) \left(\frac{\lambda_{rd} i}{\beta \lambda_{sd}}\right)^k}_{T_1\ldots}\nonumber\\
&&\underbrace{\times \bigg(e^{-\frac{\lambda_{rd} i \xi}{\beta}}\left(\frac{\lambda_{sp} \xi}{\psi}+\lambda_{sr}\right)^{k}-\left(1+\frac{\xi \lambda_{sd}}{\frac{\lambda_{sp} \xi}{\psi}+\lambda_{sr}}\right)^{1-L}\left(\frac{\xi (\lambda_{sd} \psi+\lambda_{sp})}{\psi}+\lambda_{sr}\right)^{k}\bigg)\bigg)}_{\ldots T_1}\nonumber\\
&& +\frac{1}{\frac{ \lambda_{sp}}{ \psi \lambda_{sd}}+1}\frac{\lambda_{rd} \lambda_{sr} i \psi}{\beta \lambda_{sp}}e^{\frac{\lambda_{rd} \lambda_{sr} i \psi}{\beta \lambda_{sp}}}E_L\left(\frac{\lambda_{rd} \lambda_{sr} i \psi}{\beta \lambda_{sp}}\right)+e^{-\frac{\lambda_{rd} i \xi}{\beta}} \left(\frac{1}{\frac{\lambda_{sp} \xi}{\psi\lambda_{sr}}+1}\right)^L\Bigg)-\left(\frac{1}{\frac{\lambda_{sp} \xi}{\lambda_{sr} \psi}+1}\right)^L.\label{eq:tilde_p2_1}
\end{IEEEeqnarray}}
{For $L=1$, the value of the term $T_1$ vanishes (as this term does not exist for $L=1$). For $L\geq2$, it can be shown that $T_1$ is very small compared to other terms as it is depend on $({\lambda_{sr}+\xi\lambda_{sp}/\psi})^{1-L}/(L-1)!$. After neglecting $T_1$ in the above equation, $\tilde{p}_2$ can further approximated as:}
\begin{equation}
\tilde{p}_2\approx\sum _{i=1}^L (-1)^{i+1} \binom{L}{i} \Bigg(\frac{\frac{\lambda_{rd} \lambda_{sr} i \psi}{\beta \lambda_{sp}}}{\frac{ \lambda_{sp}}{ \psi \lambda_{sd}}+1}e^{\frac{\lambda_{rd} \lambda_{sr} i \psi}{\beta \lambda_{sp}}}E_L\left(\frac{\lambda_{rd} \lambda_{sr} i \psi}{\beta \lambda_{sp}}\right)+e^{-\frac{\lambda_{rd} i \xi}{\beta}} \left({\frac{\lambda_{sp} \xi}{\psi\lambda_{sr}}+1}\right)^{-L}\Bigg)
-\left({\frac{\lambda_{sp} \xi}{\lambda_{sr} \psi}+1}\right)^{-L}.\label{eq:p2_WtRP_APP2}
\end{equation}
We note that above approximation may not {hold} for {very high} operating rate as assumption {$\psi\ll\lambda_{sp}$} violates in this case. However, high source rate transmission increase the outage probability between S to D which ultimately lower the throughput. Due to this reason we generally operate with moderate source rate (for which { the} approximation work {well}) which maximizes the throughput.
\section*{Appendix-C:Proof of concavity of function $F_1\left(\rho_{ps}\right)$ and $F_2\left(\rho_{ps}\right)$ for PS-EH case}
\setcounter{equation}{0}
\renewcommand{\theequation}{C.\arabic{equation}}
\subsubsection*{Proof of concavity of function $F_1\left(\rho_{ps}\right)$}
From \eqref{eq:tauMRCLRPtendInfty}, and for PS-EH case $\beta=\eta\rho_{ps}$. Function $F_1\left(\rho_{ps}\right)$ is expressed as:
\begin{IEEEeqnarray}{rcl}
F_1(\rho_{ps})=\sum _{i=1}^L (-1)^{i+1}\binom{L}{i} L e^{\frac{\psi i \lambda_{rd} \lambda_{sr} }{\rho_{ps} \eta \lambda_{sp}}} E_{L+1}\Big(\frac{\psi i \lambda_{rd} \lambda_{sr} }{\rho_{ps} \eta \lambda_{sp}}\Big)-1.\nonumber
\end{IEEEeqnarray}
To prove concavity of the expression we have to show that $\frac{d^2 F_1(\rho_{ps})}{d\rho_{ps}^2}\leq0$ \cite{Boyd2004}. {For convenience}, we use the approximation of $F_1(\rho_{ps})$ (say $F'_1(\rho_{ps})$) to prove the concavity. For general system parameters i.e. ${\psi \lambda_{rd} \lambda_{sr} }/({\eta \lambda_{sp}})\ll1$, {the following approximation} hold (from \cite[5.1.19]{Abramowitz1964}}.
\renewcommand{\theequation}{C.\arabic{equation}}
\begin{eqnarray}
e^{\frac{\psi i \lambda_{rd} \lambda_{sr} }{\rho_{ps} \eta \lambda_{sp}}} E_{L+1}\Big(\frac{\psi i \lambda_{rd} \lambda_{sr} }{\rho_{ps} \eta \lambda_{sp}}\Big)\approx \frac{1}{L+\frac{\psi i \lambda_{rd} \lambda_{sr} }{\rho_{ps} \eta \lambda_{sp}}}.\nonumber
\end{eqnarray}
Approximation of $F_1(\rho_{ps})$ is {then} given by:
\begin{IEEEeqnarray}{rcl}
F'_1(\rho_{ps})&=&\sum _{i=1}^L (-1)^{i+1}\binom{L}{i} \frac{L}{L+\frac{\psi i \lambda_{rd} \lambda_{sr} }{\rho_{ps} \eta \lambda_{sp}}}-1 \,.\nonumber
\end{IEEEeqnarray}
From the relation (\cite[eq. 4.2.2.45]{Prudnikov1992}), {we have: }
\begin{eqnarray}
\sum_{i=1}^{L}(-1)^{i+1}\binom{L}{i}\frac{ix}{i x+1}= \frac{\Gamma(L+1)\Gamma(1+1/x)}{\Gamma(L+1+1/x)}.\label{eq:SumRel}
\end{eqnarray}
$F'_1(\rho_{ps})$ can be expressed as:
\begin{equation}
F'_1(\rho_{ps})=-\frac{\Gamma (L+1) \Gamma \left(\frac{\eta\rho_{ps} L \lambda_{sp}}{\lambda_{rd} \lambda_{sr} \psi}+1\right)}{\Gamma \left(\frac{\eta\rho_{ps} L \lambda_{sp}}{\lambda_{rd} \lambda_{sr} \psi}+L+1\right)}.\label{eq:FDash1}
\end{equation}
From the approximation of ratio of Gamma function
\cite[1]{Tricomi1951} i.e.:
\begin{eqnarray}
\vspace{-0.4cm}
\frac{\Gamma[z+r]}{\Gamma[z+s]} \leq z^{r-s}\,. \label{eq:RatoOfGamma}
\vspace{-0.4cm}
\end{eqnarray}
\eqref{eq:FDash1} can be approximated as follows:
\begin{eqnarray}
F'_1(\rho_{ps})&\approx&-\Gamma (L+1) \left(\frac{\eta\rho_{ps} L \lambda_{sp}}{\lambda_{rd} \lambda_{sr} \psi}+1\right)^{-L}.
\end{eqnarray}
After performing the double derivative with respect to $\rho_{ps}$ and it is given by:
\vspace{-0.15cm}
\begin{eqnarray}
\frac{d^2F'_1(\rho_{ps})}{d\rho_{ps}^2}\approx - \left(\frac{\eta \lambda_{sp}}{\lambda_{rd} \lambda_{sr} \psi}\right)^2 \frac{L^3 \Gamma (L+2)}{\left(\frac{\eta L \lambda_{sp} \rho_{ps}}{\lambda_{rd} \lambda_{sr} \psi}+1\right)^{L+2}}\,.
\end{eqnarray}
It can be {seen} that $\frac{d^2F'_1(\rho_{ps})}{d\rho_{ps}^2}$ is always negative for all system values.
\subsubsection*{Proof of concavity of function $F_2\left(\rho_{ps}\right)$}
$F_2(\rho_{ps})$ is given by:
\begin{IEEEeqnarray}{rcl}
F_2(\rho_{ps})&=&{\left(\frac{\lambda_{sp} \xi}{\lambda_{sr} \psi}+1\right)^{-L}} \sum_{i=1}^L (-1)^i \binom{L}{i} e^{-\frac{i \lambda_{rd} \xi}{\rho_{ps}}}.\label{eq:DoubleDerivativeofF1}
\end{IEEEeqnarray}
After applying double derivative w.r.t. $\rho_{ps}$, {we get:}
{\small\begin{IEEEeqnarray}{rcl}
&&\frac{d^2 F_2(\rho_{ps})}{d \rho_{ps}^2}=\sum_{i=1}^L (-1)^i \binom{L}{i}\frac{e^{-\frac{i \lambda_{rd} (1-\rho_{ps})}{\rho_{ps}}}}{\left(\frac{\lambda_{sp} (1-\rho_{ps})}{\lambda_{sr} \psi}+1\right)^L} \bigg(\frac{i^2 \lambda_{rd}^2}{\rho_{ps}^4}-\frac{2 i \lambda_{rd}}{\rho_{ps}^3}+\frac{L \lambda_{sp} (2 i \lambda_{rd})}{\rho_{ps}^2 (\lambda_{sp} (1-\rho_{ps})+\lambda_{sr} \psi)}+\frac{L (L+1) \lambda_{sp}^2}{(\lambda_{sp} (1-\rho_{ps})+\lambda_{sr} \psi)^2}\bigg)\nonumber.
\end{IEEEeqnarray}}
For smaller values of $\rho_{ps}\rightarrow 0$, terms inside the summation are extremely small because of the term $e^{-\frac{i \lambda_{rd} (1-\rho_{ps})}{\rho_{ps}}}$. However, for larger values of $\rho_{ps}$ ($\rho_{ps}\rightarrow 1$), terms which contains highest power of $(1-\rho_{ps})$ in the denominator dominate. After retaining only the significant term (i.e. $\frac{L (L+1) \lambda_{sp}^2}{(\lambda_{sp} (1-\rho_{ps})+\lambda_{sr} \psi)^2}$), and after some manipulations the above equation can be expressed as:
\begin{IEEEeqnarray}{rcl}
&&\frac{d^2F_2(\rho_{ps})}{d \rho_{ps}^2}\approx \sum_{i=1}^L (-1)^i \binom{L}{i}\frac{e^{-\frac{i \lambda_{rd} (1-\rho_{ps})}{\rho_{ps}}}}{\left(\frac{\lambda_{sp} (1-\rho_{ps})}{\lambda_{sr} \psi}+1\right)^L} \left(\frac{L (L+1) \lambda_{sp}^2}{(\lambda_{sp} (1-\rho_{ps})+\lambda_{sr} \psi)^2}\right)\nonumber\\
&=& \frac{\left(1-e^{-\frac{\lambda_{rd} (1-\rho_{ps})}{\rho_{ps}}}\right)^L-1}{\left(\frac{\lambda_{sp} (1-\rho_{ps})}{\lambda_{sr} \psi}+1\right)^{L+2} \frac{\lambda_{sr}\psi}{\lambda_{sp}}} \left({L (L+1)}\right).\label{eq:DoubleDerivativeofF2}
\end{IEEEeqnarray}
Right hand side of the above equation can be shown to be always less than $0$, since $\left(1-e^{-{\lambda_{rd} (1-\rho_{ps})}/{\rho_{ps}}}\right)^L\leq1$. Proof for the TS-EH case follows in a similar fashion, since $\frac{d^2\tau_{ts}}{d\rho_{ts}^2}$ consists of two function, and both have negative values for $0\leq\rho_{ts}\leq1$.
\section*{Appendix-D:Optimum $\rho$ for L=1}
\setcounter{equation}{0}
\renewcommand{\theequation}{D.\arabic{equation}}
\subsubsection*{For PS-EH}
From \eqref{eq:tauMRCLRPtendInfty}, $\tilde{\tau}$ for PS-EH ($\xi = 1 - \rho_{ps}$,
$\zeta = 1$ and $\beta = \eta \rho_{ps}$) with $L=1$ can be written as:
\begin{IEEEeqnarray}{rcl}
\tilde{\tau}_{ps}&\overset{L=1}{=}&\frac{R_s}{2}\bigg(1-\bigg(\frac{\lambda_{sr} e^{-\frac{\lambda_{rd} (1-\rho_{ps})}{\rho_{ps}}}}{\frac{ \lambda_{sp} (1-\rho_{ps})}{\psi }+\lambda_{sr}}+\frac{1}{\left(1+\frac{\lambda_{sp}}{\lambda_{sd}\psi }\right)} \frac{\psi \lambda_{rd} \lambda_{sr} }{ \lambda_{sp} \rho_{ps}} e^{\frac{\psi \lambda_{rd} \lambda_{sr} }{ \lambda_{sp} \rho_{ps}}} E_1\left(\frac{\psi \lambda_{rd} \lambda_{sr} }{ \lambda_{sp} \rho_{ps}}\right)\bigg)\bigg).\nonumber\nonumber
\end{IEEEeqnarray}
In the current form, optimum $\rho_{ps}$ cannot be evaluated analytically. $\tilde{\tau}_{ps}$ can be approximated using the relations
$e^{x}E_1(x)\approx \frac{1}{1+x}$ (for small $x$) \cite[5.1.19]{Abramowitz1964} and $e^{-\frac{\lambda_{rd} (1-\rho_{ps})}{\rho_{ps}}}\approx \frac{1}{1+\frac{\lambda_{rd} (1-\rho_{ps})}{\rho_{ps}}}$
to get:
\begin{IEEEeqnarray}{rcl}
\tilde{\tau}_{ps}&\approx& \frac{R_s}{2}\Bigg(1-\frac{1}{\left(1+\frac{\lambda_{sp}}{\lambda_{sd}\psi }\right)\left(1+\frac{ \lambda_{sp} \rho_{ps}}{\psi \lambda_{rd} \lambda_{sr} }\right)}-\frac{1}{\left(1+\frac{ \lambda_{sp} (1-\rho_{ps})}{\psi \lambda_{sr}}\right)\left(1+\frac{\lambda_{rd}(1-\rho_{ps})}{\eta\rho_{ps}}\right)}\Bigg).
\end{IEEEeqnarray}
It is worth noting that the above approximation is valid when ${\lambda_{sp}} \gg \psi$.
Finding the optimum $\rho_{ps}$ is still a difficult task since the equation $\frac{d\tilde{\tau}_{ps} }{d\rho_{ps}}=0$ contains $4^{th}$ {power} of $\rho_{ps}$. However, it can be calculated using standard packages like Mathematica or Matlab. To get a closed form expression, we further approximate the above by utilizing the fact $\frac{\lambda_{rd}}{\eta\rho_{ps}} \gg 1-\frac{\lambda_{rd}}{\eta}$ (since $\eta, \rho_{ps}\leq 1$) and $\frac{ \lambda_{sp} (1-\rho_{ps})}{\psi \lambda_{sr}}\gg 1$ {(for typical values of system parameters)} to get:
\begin{IEEEeqnarray}{rcl}
\tilde{\tau}_{ps}&\approx&\frac{R_s}{2}\Bigg( 1-\frac{1}{\left(1+\frac{\lambda_{sp}}{\lambda_{sd}\psi }\right)\left(1+\frac{ \lambda_{sp} \rho_{ps}}{\psi \lambda_{rd} \lambda_{sr} }\right)}-\frac{1}{\frac{ \lambda_{sp} (1-\rho_{ps})}{\psi \lambda_{sr}}\frac{\lambda_{rd}}{\eta\rho_{ps}}}\Bigg).\label{eq:TauMRCApprox}
\end{IEEEeqnarray}
Now, we can obtained $\rho^*_{ps}$ by solving $\frac{d \tilde{\tau}_{ps}}{d\rho_{ps}}=0$ to get \eqref{eq:rhoPS}.
\subsubsection*{For TS-EH}
Using the relation $e^{x}E_1(x)\approx \frac{1}{1+x}$, $\tilde{\tau}$ for TS-EH ($\xi = 1$,
$\zeta = 1-\rho_{ts}$ and $\beta = 2\eta \rho_{ts}/(1-\rho_{ts})$) with $L=1$, \eqref{eq:tauMRCLRPtendInfty} can be approximated as:
\begin{IEEEeqnarray}{rcl}
\tilde{\tau}_{ts}&\approx &\frac{(1-\rho_{ts}) \text{Rs}}{2} \bigg(\hspace{-0.2cm}-\frac{\psi \lambda_{sr} e^{-\frac{\lambda_{rd} (1-\rho_{ts})}{2 \eta \rho_{ts}}}}{ \lambda_{sp}}-\frac{1}{\left(\frac{ \lambda_{sp}}{\psi \lambda_{sd} }+1\right) \left(\frac{2 \eta \lambda_{sp} \rho_{ts}}{\psi \lambda_{rd} \lambda_{sr} (1-\rho_{ts})}+1\right)}+1\bigg).
\end{IEEEeqnarray}
It can be further approximated since $\left({\left(\frac{ \lambda_{sp}}{\psi \lambda_{sd} }+1\right) \left(\frac{2 \eta \lambda_{sp} \rho_{ts}}{\psi \lambda_{rd} \lambda_{sr} (1-\rho_{ts})}+1\right)}\right)^{-1}$ $\gg$ $ \frac{\psi \lambda_{sr} }{ \lambda_{sp}}e^{-\frac{\lambda_{rd} (1-\rho_{ts})}{2 \eta \rho_{ts}}}$ to get:
\begin{equation}
\tilde{\tau}_{ts}\approx \frac{(1-\rho_{ts})R_s}{2}\left(\hspace{-0.1cm}1-\frac{1/\left(1+{ \lambda_{sp}}/({\psi \lambda_{sd} })\right)}{ \left(\frac{2 \eta \lambda_{sp} \rho_{ts}}{\psi \lambda_{rd} \lambda_{sr} (1-\rho_{ts})}+1\right)}\hspace{-0.1cm}\right).\label{eq:tau_tsApprox}
\end{equation}
Solving $\frac{d\tilde{\tau}_{ts}}{d\rho_{ts}}=0$ results in \eqref{eq:rhoTS}.
\section*{Appendix-E: Proof of \eqref{eq:SumSum_ijxExpijxE1ijx}}
\setcounter{equation}{0}
\renewcommand{\theequation}{E.\arabic{equation}}
In \eqref{eq:SumSum_ijxExpijxE1ijx}, let
$\sum _{i=1}^L (-1)^{i+1} \binom{L}{i}L \,e^{\frac{\psi i \lambda_{rd} \lambda_{sr} }{\beta \lambda_{sp}}} E_{L+1}\left(\frac{\psi i \lambda_{rd} \lambda_{sr}}{\beta \lambda_{sp}}\right)$, and for higher $L$ and small argument (i.e. $x$) $e^x E_L(x) \approx 1/(x+L-1)$ \cite[5.1.4]{Abramowitz1964}, the above equation can be rewritten as:
\begin{IEEEeqnarray}{rcl}
\sum _{i=1}^L (-1)^{i+1} \binom{L}{i}L \,e^{\frac{\psi i \lambda_{rd} \lambda_{sr} }{\beta \lambda_{sp}}} E_{L+1}\left(\frac{\psi i \lambda_{rd} \lambda_{sr}}{\beta \lambda_{sp}}\right)&\approx& \sum _{i=1}^L (-1)^{i+1} \binom{L}{i}\frac{L}{\frac{\psi i \lambda_{rd} \lambda_{sr} }{\beta \lambda_{sp}}+L}\label{eq:Temp1}\\
&&=1-\frac{\Gamma (L+1) \Gamma \left(\frac{\beta L \lambda_{sp}}{\lambda_{rd} \lambda_{sr} \psi}+1\right)}{\Gamma \left(\frac{\beta \lambda_{sp} L}{\lambda_{rd} \lambda_{sr} \psi}+L+1\right)}. \label{eq:Temp2}
\end{IEEEeqnarray}
We get \eqref{eq:Temp2} from \eqref{eq:Temp1} by applying the relation \eqref{eq:SumRel}. By using relation \eqref{eq:RatoOfGamma}, right hand side (R.H.S) of the above equation can be approximated as $ 1-\Gamma(L)\left(\frac{\lambda_{rd} \lambda_{sr} \psi}{\beta L \lambda_{sp}}\right)^L$.
For the general parameter values $\Gamma(L)\left(\frac{\lambda_{rd} \lambda_{sr} \psi}{\beta \lambda_{sp}}\right)^L\ll L^L$. $\Gamma(L)\left(\frac{\lambda_{rd} \lambda_{sr} \psi}{\beta L \lambda_{sp}}\right)^L\rightarrow 0$. The value of $\sum _{i=1}^L (-1)^{i+1}$ $ \binom{L}{i}L \,e^{\frac{\psi i \lambda_{rd} \lambda_{sr} }{\beta \lambda_{sp}}} E_{L+1}\left(\frac{\psi i \lambda_{rd} \lambda_{sr}}{\beta \lambda_{sp}}\right)\rightarrow 1$.
\section*{Appendix-F:Proof of Lemma \ref{Lem:TauINC_Concave}}
\setcounter{equation}{0}
\renewcommand{\theequation}{F.\arabic{equation}}
For PS-EH case (i.e. $\zeta=1$ and $\xi=1-\rho_{ps}$) (from \eqref{eq:tauIn_2}) it is clear that $\tau_{in}$ is given approximately by:
{\begin{IEEEeqnarray}{rcl}
\tau_{in-ps}&\approx&\tau+\frac{0.5 R_s}{1+\frac{\lambda_{sd} \psi }{\lambda_{sp} }}\bigg(1+\left(1+\frac{\lambda_{sd}(1-\rho_{ps})}{\lambda_{sr}}+\frac{\lambda_{sp}(1-\rho_{ps})}{\lambda_{sr}\psi}\right)^{-L}\bigg).\nonumber
\end{IEEEeqnarray} }
{Substituting} the value of $\tau$ (i.e. $\tilde{\tau}$ for PS-EH case) from \eqref{eq:tauMRCLRPtendInfty}, $\tau_{in-ps} $ is rewritten as follows:
\begin{IEEEeqnarray}{rcl}
\tau_{in}&\approx&\frac{R_s\zeta}{2}\Bigg(1+\left(1+\frac{\lambda_{sp}}{\lambda_{sd} \psi}\right)^{-1}\underbrace{\Big(\sum _{i=1}^L (-1)^{i+1}\binom{L}{i} L e^{\frac{\psi i \lambda_{rd} \lambda_{sr} }{\beta \lambda_{sp}}} E_{L+1}\Big(\frac{\psi i \lambda_{rd} \lambda_{sr} }{\beta \lambda_{sp}}\Big)-1\Big)}_{F_1(\rho_{ps})} \vspace{-0.35cm}\nonumber\\
&&+\underbrace{\overbrace{\frac{\big(1-e^{-\frac{\lambda_{rd} \xi}{\beta}}\big)^L-1}{\left(\frac{\lambda_{sp} \xi}{\lambda_{sr} \psi}+1\right)^L}}^{F_2(\rho_{ps})}+\frac{1}{1+\frac{\lambda_{sd} \psi }{\lambda_{sp} }}\left(1+\left(1+\frac{\lambda_{sd}\xi}{\lambda_{sr}}+\frac{\lambda_{sp}\xi}{\lambda_{sr}\psi}\right)^{-L}\right)}_{F_3(\rho_{ps})}\Bigg).\label{eq:tauIn_3}
\end{IEEEeqnarray}
For concavity, we need to show that $\frac{d^2\tau_{in-ps}}{d\rho_{ps}^2}\leq 0$. $\frac{d^2\tau_{in-ps}}{d\rho_{ps}^2}$ is given by:
\begin{eqnarray}
\frac{d^2\tau_{in-ps}}{d\rho_{ps}^2} = \frac{R_s}{2}\left(\frac{d^2F_1(\rho_{ps})}{d\rho_{ps}^2} +\frac{d^2F_3(\rho_{ps})}{d\rho_{ps}^2}\right).\label{eq:DoubleDerivativeofTauIn}
\end{eqnarray}
Using the derived expressions for $\frac{d^2F_2(\rho_{ps})}{d\rho_{ps}^2}$ in Appendix-C from \eqref{eq:DoubleDerivativeofF2}, we can write $\frac{d^2 F_3(\rho_{ps})}{d\rho_{ps}^2}$ as follows:
\begin{equation}
\frac{d^2F_3(\rho_{ps})}{d\rho_{ps}^2}\approx\frac{(L+1) L \left(\left(1-e^{-{\lambda_{rd} (1-\rho_{ps})}/{\rho_{ps}}}\right)^L-1\right)}{\left({\lambda_{sr} \psi}/{\lambda_{sp}}\right)^2\left({\lambda_{sp} (1-\rho_{ps})}/({\lambda_{sr} \psi})+1\right)^{L+2}}+\frac{L (L+1) \left(\frac{\lambda_{sd}}{\lambda_{sr}}+\frac{\lambda_{sp}}{\lambda_{sr} \psi}\right)^2 }{\left(\frac{\lambda_{sd} \psi}{\lambda_{sp}}+1\right)\left(\frac{\lambda_{sd} (1-\rho_{ps})}{\lambda_{sr}}+\frac{\lambda_{sp} (1-\rho_{ps})}{\lambda_{sr} \psi}+1\right)^{L+2}}.\label{eq:ddF3}
\end{equation}
{For} (${\lambda_{sp}}\gg{\psi}$) and for ($0<\rho_{ps}<1$), above expression can be approximated as:
\begin{IEEEeqnarray}{rcl}
\frac{d^2F_3(\rho_{ps})}{d\rho_{ps}^2}&\approx&\frac{(L+1) L \left(\left(1-e^{-{\lambda_{rd} (1-\rho_{ps})}/{\rho_{ps}}}\right)^L-1\right)}{(1-\rho_{ps})^{L+2}\left({\lambda_{sp} }/({\lambda_{sr} \psi})\right)^{L}}+\frac{L (L+1) }{(1-\rho)^{L+2}\left(\frac{\lambda_{sd} \psi}{\lambda_{sp}}+1\right)\left(\frac{\lambda_{sd} }{\lambda_{sr}}+\frac{\lambda_{sp} }{\lambda_{sr} \psi}\right)^{L}}.\nonumber
\end{IEEEeqnarray}
Approximation of the above equation from \eqref{eq:ddF3}, holds unless $\rho_{ps}=1$ or close to 1. However, {the} network never operates {in this region} as in this case R will not be able to decode signals from S.
It can be observed that, the above equation has negative values for $\rho_{ps}$ {so} that:
\begin{eqnarray}
\frac{d^2F_3(\rho_{ps})}{d\rho_{ps}^2}\leq 0.\label{eq:ZeroCrossing}
\end{eqnarray}
By solving the above equation, range of $\rho_{ps}$ is given as:
{\begin{eqnarray}
\rho_{ps} \geq \rho_{zc}=\Bigg(\hspace{-0.1cm}{1-\frac{1}{\lambda_{rd}}\log \Bigg(\hspace{-0.1cm}1-\Bigg(\hspace{-0.1cm}1-\bigg(\frac{\lambda_{sd}\psi}{\lambda_{sp}}+1\bigg)^{-L-1}\Bigg)^{1/L}\Bigg)}\hspace{-0.1cm}\Bigg)^{-1}\hspace{-0.2cm}, \nonumbe
\end{eqnarray}}
where $\rho_{zc}$ is the solution of \eqref{eq:ZeroCrossing} with equality. The subscript $zc$ highlights the zero crossing point of \eqref{eq:ZeroCrossing}. We note that for $\rho$<$\rho_{zc}$, $\frac{d^2F_3(\rho_{ps})}{d\rho_{ps}^2}$ have finite positive values. However, they are extremely small (in the order of $10^{-2}$) for the general system parameters which is $\psi$$\ll$$\lambda_{sp}$ and $\lambda_{sp}$$\gg$$\lambda_{sd}$, $\frac{d^2F_3(\rho_{ps})}{d\rho_{ps}^2}$.
From \eqref{eq:DoubleDerivativeofF1}, we recall that $\frac{dF_1(\rho_{ps})}{d\rho_{ps}^2}\rightarrow -\infty$ for $\rho_{ps}\rightarrow 0$ $\implies \frac{d^2\tau_{in-ps}}{d\rho_{ps}^2}<0$. Since $\frac{d^2\tau_{in-ps}}{d\rho_{ps}^2}$ is the summation of the $\frac{d^2F_1(\rho_{ps})}{d\rho_{ps}^2}$ and $\frac{d^2F_3(\rho_{ps})}{d\rho_{ps}^2}$, and since $\frac{d^2F_1(\rho_{ps})}{d\rho_{ps}^2}\leq \frac{d^2F_3(\rho_{ps})}{d\rho_{ps}^2}$ for the range $0\leq\rho_{ps}\leq\rho_{zc}$ (from the observation), it can be inferred that $\frac{d^2\tau_{in-ps}}{d\rho_{ps}^2}<0$ \, $\forall\, \rho_{ps}$.
\vspace{-0.1cm}
\section*{Appendix-G: Proof of Lemma \ref{Lem:rho_ts_in}}
For the PS-EH case, using \eqref{eq:tauIn_2} and \eqref{eq:TauMRCApprox}, the approximated $\tau_{in} $ is given by:
\begin{equation}
\tau_{in-ps}\approx \frac{R_s}{2}\Bigg(1-\Bigg(\hspace{-0.1cm}\frac{1}{\left(1+\frac{\lambda_{sp}}{\lambda_{sd}\psi}\right)\left(1+\frac{\eta \lambda_{sp} \rho_{ps}}{\psi \lambda_{rd} \lambda_{sr} }\right)}+\frac{1}{\frac{\lambda_{rd}}{\eta \rho_{ps}}\frac{ \lambda_{sp} (1-\rho_{ps})}{\psi \lambda_{sr} }}+\frac{1}{\frac{\psi}{ \lambda_{sp}} \left(\lambda_{sd}+\frac{\lambda_{sr}}{1-\rho_{ps}}\right)+1}\Bigg)\Bigg)+R_s q_2,\label{eq:TauInPSApproxApp1}
\end{equation}
where $q_2$ is as defined in \eqref{eq:tauIn}. An optimum value of $\rho_{ps}$ can be determined numerically. However, an approximated closed-form expression can be derived {for the condition $\psi \ll \lambda_{sp}$} since $\frac{\psi}{ \lambda_{sp}} \left(\lambda_{sd}+\frac{\lambda_{sr}}{1-\rho_{ps}}\right)\ll1$ (for $\rho_{ps}<1$). \eqref{eq:TauInPSApproxApp1} is now expressed as:
{\begin{IEEEeqnarray}{rcl}
\tau_{in-ps} \approx R_s q_2+\underbrace{\frac{R_s}{2}\Bigg(1-\Bigg(\frac{1}{\left(1+\frac{\lambda_{sp}}{\lambda_{sd}\psi}\right)\left(1+\frac{\eta \lambda_{sp} \rho_{ps}}{\psi \lambda_{rd} \lambda_{sr} }\right)}+\frac{1}{\frac{\lambda_{rd}}{\eta \rho_{ps}}\frac{ \lambda_{sp} (1-\rho_{ps})}{\psi \lambda_{sr} }}\Bigg)\Bigg)}_{\tau_{ps}}.\nonumber
\end{IEEEeqnarray}}
We verify later through simulations that this approximate value is very close to the optimum $\rho_{in-ps}^{*}$. Again from \eqref{eq:TauMRCApprox}, $\tau_{in-ps}$ can be rewritten as: $\tau_{in-ps}=\tau_{ps}+R_s q_2$, since $q_2$ is not a function of $\rho_{ps}$. Clearly, $\rho_{in-ps} = \rho_{ps}$ since:
\begin{equation}
\frac{d\tau_{in-ps}}{d\rho_{ps}} \approx \frac{d\tau_{ps}}{d\rho_{ps}}=0.
\end{equation}
For TS-EH case with $\lambda_{sr} \gg \lambda_{sd}$, $\tau_{in}$ is approximated as:
\begin{IEEEeqnarray}{rcl}
\tau_{in-ts} &\approx& \frac{(1-\rho_{ps})R_s}{2}\Bigg(1-\frac{1}{\left(\frac{ \lambda_{sp}}{\psi \lambda_{sd} }+1\right) \left(\frac{2 \eta \lambda_{sp} \rho_{ps}}{\psi \lambda_{rd} \lambda_{sr} (1-\rho_{ps})}+1\right)}-\frac{1}{\frac{\psi\lambda_{sd}}{ \lambda_{sp}}+1}\Bigg)+R_s q_2\,.\label{eq:TauInTSApproxApp1}
\end{IEEEeqnarray}
From \eqref{eq:tau_tsApprox}, the above expression is written as: $\tau_{in-ts}=\tau_{ts}+\frac{1-\rho_{ps}}{2}R_s\,q_2$. We first note that $q_2$ is not a function of $\rho_{ps}$. Now the optimum value of $\rho_{ps}$ in \eqref{eq:rho_ts_in} is the solution to the following equation:
\begin{equation}
\frac{d\tau_{in-ts}}{d\rho_{ps}} \approx \frac{d\tau_{cc-ts}}{d\rho_{ps}}-\frac{0.5 R_s}{1+\frac{\psi\lambda_{sd} }{\lambda_{sp} }}=0.
\end{equation}
\vspace{-0.4cm}
\bibliographystyle{ieeetr}
| {'timestamp': '2020-09-22T02:23:57', 'yymm': '1810', 'arxiv_id': '1810.02535', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02535'} | arxiv |
\section{Introduction}
Fixed point combinators (fpcs) are a fascinating class of lambda terms. Arising in the proof of the Fixed Point Theorem, their dynamical character affects the global structure of the Lambda Calculus in a fundamental way. Being a mechanism of unrestricted recursion,
they are directly responsible for the Turing-completeness of the lambda calculus as a programming language.\footnote{
In fact, the very notion of Turing-completeness
traces back to Church's bold suggestion that lambda calculus can encode arbitrary computational processes. Yet the idea was only accepted after Kleene and Turing, using fixed
point constructions, showed equivalence between Church's formalism
and their own ones.}
And when lambda terms are used as the computational basis of a logical system\\
\phantom{.}{\!}--- whether based on the Curry--Howard isomorphism or illative combinatory logic ---
fixed point combinators appear unexpectedly as the untyped skeletons of paradoxes, heralding inconsistency of the logic lying over the computational calculus.
\cite{B1993}
\cite{Howe1987}
\cite{CoquandHerbelin1994}
\cite{Geuvers07}
\cite{Curry1942}
\cite{MeyerReinhold1986}
It is an elementary fact that a term $Y$ is a fixed point combinator if and only if $Y$ is itself a fixed point of the combinator $\delta = \lambda y x. x (y x)$.
\cite[6.5.3]{B84}
This can even be taken as the definition of fpcs: $Y \in \Lambda$ is fpc iff $Y = \delta Y$. Corrado B\"ohm noticed that also $Y \delta$ is fpc whenever $Y$ is. \cite[6.5.4]{B84}
For example, if $Y = \mathtt{Y}$ is Curry's fpc, then $Y \delta = \Theta$ is Turing's fpc. A major open problem in the Lambda Calculus asks whether there exists a ``double fpc'' $Y$ satisfying $\delta Y= Y = Y \delta$.
Statman \cite{Statman1993} conjectures that no such $Y$ exists.
An early attack on this problem was undertaken by Intrigila \cite{Intrigila97}. Unfortunately, Endrullis discovered a gap in the argument which seems difficult to overcome. As of this writing, the conjecture remains open.
For recent developments, see \cite{EHKP}, \cite{MPSS}.
We will also discuss the conjecture in Section \ref{s:4}.
B\"ohm's observations revealed that fpcs themselves have a compositional structure, where one constructs new fpcs from old by applying them to $\delta$. Since then, other ``fpc generating schemes'' have been discovered and investigated by several authors. \cite{Scott75} \cite{EHKP} These contributions have confirmed that fpcs have a rich mathematical structure indeed.
In this paper, we will explore such fpc generators ``in the abstract'', studying their general properties and providing a basic taxonomy. We formulate several new problems, including a significant strengthening of Statman's conjecture.
\section{Notations and definitions}
\begin{nota}
We assume the reader is familiar with the basic notions of lambda calculus:
$\lambda$-terms, free variables, substitution, and beta-conversion.
We refer to \cite{B84} for background on these matters.
Here we shall employ the following symbols and notions.
\begin{itemize}
\item $\Lambda$ is the set of $\lambda$-terms.
$\Lambda^0 = \setof{M \in \Lambda \mid \mathsf{FV}(M)=\emptyset}$ is the set
of \emph{closed} $\lambda$-terms.
\item $\mathsf{FV}(M)$ is the set of free variables of $M \in \Lambda$.
\item $M[x:=N]$ is the result of capture-avoiding substitution of $N$ for $x$ in $M$.
\item If $\vec N = (N_1,\dots,N_k)$ is a sequence of $\lambda$-terms, then $M \vec N = MN_1\cdots{}N_k$.
\item $F^k(z) := F(F(\cdots F(z)\cdots))$, with $k$ $F$s.
\item $\mathtt{I} = \lambda x.x$, $\mathtt{K}=\lambda xy.x$, $\cnc_k = \lambda x y. x^k(y)$,
$\delta = \lambda y x. x (y x)$.
\item $M=N$ denotes beta conversion between $M$ and $N$.
\item $M \twoheadrightarrow N$ denotes beta reduction from $M$ to $N$.
\item $M$ is \emph{solvable}, if $M \vec N = \mathtt{I}$ for some $\vec N$. Otherwise, $M$ is \emph{unsolvable}.
\item $M \mathbin{=^\infty} N$ if $M$ and $N$ have the same B\"ohm tree.\\ We note without proof that this relation can be defined using one axiom and one inference rule, the latter to be understood \emph{coinductively}
(see \cite{KKSV97},\cite{EP11}, and especially \cite[Def.\,5.6]{Czajka2020}):
\[
\AXC{$M, N \! \phantom{\vec M} \! \text{unsolvable}$}
\UIC{$M \mathbin{=^\infty} N$}
\DisplayProof
\qquad \! \!
\AXC{$M = \lambda \vec x. y \vec M \quad N = \lambda \vec x. y \vec N$}
\AXC{$M_1 \mathbin{=^\infty} N_1\quad \cdots \quad M_k \mathbin{=^\infty} N_k$}
\doubleLine
\BIC{$M \mathbin{=^\infty} N$}
\DisplayProof
\]
\item $z\# M$ means $z \notin \mathsf{FV}(M)$. For $S \subseteq \Lambda$,
$z\#S$ means $z\#M$ for each $M \in S$.
\item $z \notin M$ if there exists $N = M$ such that $z\#N$.
$z \in M$ if $z \in \mathsf{FV}(N)$ for all $N = M$.
\item $z \notin^\infty M$ if there exists $N =^\infty M$ such that $z\#N$.
Otherwise, $z \in^\infty M$.
\end{itemize}
\end{nota}
\begin{defi}
$Y \in \Lambda$ is a \emph{fixed point combinator (fpc)} if $Yx = x(Yx)$ for $x \# Y$.
\end{defi}
\begin{defi}
$Y \in \Lambda$ is a \emph{weak fixed point combinator (wfpc)} if $Yx \mathbin{=^\infty} x(Yx)$ for $x \# Y$.
\end{defi}
Notice that every fpc is a wfpc. See Examples \ref{ex1} for both types of terms.
All (w)fpcs have the same B\"ohm tree, so
$Y \in \Lambda$ is wfpc iff $Y \mathbin{=^\infty} Y_0$ for some fpc $Y_0$.
A wfpc $Y$ can equivalently be given by a sequence of terms $(Y_n)$ with $Y=Y_0$ and $Y_n x = x (Y_{n+1} x)$, with $x \# \{Y_n, Y_{n+1}\}$.
\cite[Prop.\,3.9]{MPSS}
If $Y$ is fpc, then $Y_n=Y_0$ for all $n$.
\newcommand{\mathsf{FPC}}{\mathsf{FPC}}
\newcommand{\mathsf{FPC}^0}{\mathsf{FPC}^0}
\newcommand{\mathsf{WFPC}}{\mathsf{WFPC}}
\newcommand{\mathsf{WFPC}^0}{\mathsf{WFPC}^0}
\newcommand{\quad \text{ fpc }}{\quad \text{ fpc }}
\newcommand{\quad \text{wfpc }}{\quad \text{wfpc }}
\begin{nota}
We write $\mathsf{FPC}$ ($\mathsf{WFPC}$) for the set of fpcs (weak fpcs).
\end{nota}
\begin{nota}
Henceforth, we shall often write $\mathsf{(W)FPC}$ in a sentence that is meant to apply to both $\mathsf{FPC}$ and $\mathsf{WFPC}$. Such a statement should always be read as a conjunction of two statements: one, in which parentheses are ignored together with their contents, and another, where parentheses are removed but their contents remain.
\end{nota}
\begin{defi}
A \emph{(weak) fpc generating vector}, or \emph{(w)fgv}, is a sequence of terms $\vec G$ satisfying
\[ Y \in \mathsf{(W)FPC} \;\Longrightarrow\; Y \vec G \in \mathsf{(W)FPC}. \]
\end{defi}
\begin{prop} TFAE: \label{tfae} \\
$(i)\quad\ \ \vec G$ is wfgv.\\
$(ii)\quad \ Y \in \mathsf{FPC} \;\Longrightarrow\; Y \vec G \in \mathsf{WFPC}$.\\
$(iii)\quad Y \vec G \in \mathsf{WFPC}$ for some $Y \in \mathsf{FPC}$.
\end{prop}
\begin{proof}
$(i) \Rightarrow (ii)$. Let $\vec G$ be wfgv, $Y$ be fpc.
Then $Y$ is wfpc, and $Y \vec G$ is wfpc.
$(ii) \Rightarrow (iii)$. Trivial.
$(iii) \Rightarrow (i)$. Let $Z$ be wfpc. Then $Z =^\infty Y$.
Also $Z \vec G =^\infty Y\vec G$ is wfpc.
\end{proof}
\begin{cor} Every fpc generator is wfpc generator.
\label{fpwpgen}
\end{cor}
\begin{proof}
Let $\vec G$ be fpc generator. Pick $Y \in \mathsf{FPC}$.
Then $Y \vec G$ is fpc, hence $\vec G$ is wfgv.
\end{proof}
\begin{prop}
\label{conds}
Consider the following conditions on $\vec G$.
\newcommand{\hspace{-0.3cm}}{\hspace{-0.3cm}}
\begin{align*}
\begin{array}{l r l}
(i)\hspace{2cm} &Y\phantom{j} \quad \text{ fpc } \hspace{-0.3cm}&\;\Longrightarrow\; Y \vec G \quad \text{ fpc } \\%\label{i1}\\
(ii) \hspace{2cm}&Y\, \quad \text{wfpc } \hspace{-0.3cm}&\;\Longrightarrow\; Y \vec G \quad \text{wfpc } \\%\label{i2}\\
(iii) \hspace{2cm} &Y\phantom{j} \quad \text{ fpc } \hspace{-0.3cm}&\;\Longrightarrow\; Y \vec G \quad \text{wfpc } \\%\label{i3}\\
(iv) \hspace{2cm} &Y\, \quad \text{wfpc } \hspace{-0.3cm}&\;\Longrightarrow\; Y \vec G \quad \text{ fpc } \\%\label{i4}
\end{array}
\end{align*}
The following relations are valid:
\[ (iv) \;\Longrightarrow\; (i) \;\Longrightarrow\; (ii) \iff (iii) \]
\end{prop}
\begin{proof}
These relations simply summarize the facts noted above.
\end{proof}
\section{Examples and first observations}
\begin{exas}\leavevmode \label{ex1}
\begin{itemize}
\item
\emph{Turing's fpc.} Let $\Theta x = V V x$, where $V = \lambda v x. x (v v x)$. Then $\Theta \in \mathsf{FPC}$.
\item
\emph{Parametrized Turing's fpc.}
For $M \in \Lambda$, let $\Theta_M x = V V M x$, where $V = \lambda v m x. x (v v m x)$.
Then $\Theta_M \in \mathsf{FPC}$.
(This example can be generalized to have multiple parameters.)
\item Let $z$ be a variable. Put $\Psi_z = W_z W_z \mathtt{I}$,
where $W_z = \lambda w p x. x (w w (z p) x)$.
Then $\Psi_z \in \mathsf{WFPC}\setminus\mathsf{FPC}$.
\item A slight variant of the above will play a central role in the proof of our main result.
Let $c$ be a variable. Put $\Upsilon = \lambda x. V_x \mathtt{I} V_x$, where
$V_x = \lambda p v. x (v (c p) v)$. Then $\Upsilon \in \mathsf{WFPC}\setminus\mathsf{FPC}$.
A nice feature of this wfpc is
that it has a very simple reduction graph.
\end{itemize}
\end{exas}
\begin{prop}
$\Theta_{M} = \Theta_{N} \;\Longrightarrow\; M = N$.
\label{thetaz}
\end{prop}
\begin{proof}
This is manifest upon inspecting the reduction graph of $\Theta_z$ --- the set of reducts of $\Theta_z$. For a precise proof, see \cite[Lemma 4.1]{MPSS}.
\end{proof}
\pagebreak
\begin{exas}\label{exs}\leavevmode
\begin{itemize}
\item Let $\vec G = ()$, the empty vector. Obviously,
$Y \in \mathsf{(W)FPC} \;\Longrightarrow\; Y \vec G = Y \in \mathsf{(W)FPC}$.\\
We call this generator \emph{trivial}.
In subsequent sections, we will tacitly assume all generators to be non-trivial.
\item Fix a (w)fpc $Y$, and let $\vec G = (\mathtt{K} Y)$. Then
$(\mathtt{K} Y)$ yields the same (w)fpc on every input:
\[ Z=(Z_0,Z_1,\dots) \in \mathsf{WFPC} \;\Longrightarrow\; Z_0 (\mathtt{K} Y) = \mathtt{K} Y (Z_1 (\mathtt{K} Y)) = Y \in \mathsf{(W)FPC}.\]
We call such generators \emph{constant}.
Their only interesting feature is the fixed point $Y=Y\vec G$.
\item Recall that $\delta y x = x (y x)$. It is easy to verify the following: \label{e:delta}
\begin{itemize}
\item
$\delta^k(z)x = x^k(z x)$.
\item
If $Y$ is fpc, then $Y=\delta Y = \delta^k(Y)$.
\item
If $Y=(Y_n)$ is wfpc, then $Y_0 = \delta^k(Y_k)$.
\end{itemize}
Let $\vec G = (\delta)$. Then
$Y \in \mathsf{FPC} \;\Longrightarrow\; Y \delta x = \delta (Y \delta) x = x (Y \delta x) \;\Longrightarrow\; Y \delta \in \mathsf{FPC}$.\\
As noted in the introduction, it is open whether there exists $Y {\in}\, \mathsf{(W)FPC}$ such that $Y {=}\, Y \delta$.
\item Let $\vec G = (\lambda y. \Theta_y)$. Then
\label{theta}
\[ Y \in \mathsf{FPC} \;\Longrightarrow\; Y \vec G = Y (\lambda y. \Theta_y)
= (\lambda y. \Theta_y) (Y (\lambda y. \Theta_y))
= \Theta_{Y \vec G} \in \mathsf{FPC}.\]
Furthermore, there exists fpc $Y$ such that $Y = Y \vec G $.\\
Indeed, take $Y = \Theta (\lambda x. \Theta_{x (\lambda y. \Theta_y)})
= \Theta_{Y (\lambda y. \Theta_y)}$. Then $Y \in \mathsf{FPC}$, and
\[ Y (\lambda y. \Theta_y)
= (\lambda y. \Theta_y) (Y (\lambda y. \Theta_y))
= \Theta_{Y (\lambda y. \Theta_y)} = Y. \]
\item Yet another single-term fgv is given by
$\vec G = (\lambda y x. x (y (\mathtt{K} [y,x]) \mathtt{I}))$, where $[P,Q]=\lambda z. zPQ$:
\begin{align*}
Y \in \mathsf{FPC} \;\Longrightarrow\; Y G_0 x = G_0 (Y G_0) x
&= x (Y G_0 (\mathtt{K} [Y G_0,x]) \mathtt{I})\\
&= x (G_0 (Y G_0) (\mathtt{K} [Y G_0,x]) \mathtt{I})\\
&= x (\mathtt{K} [Y G_0, x] (\cdots) \mathtt{I})\\
&= x ([Y G_0, x] \mathtt{I}) = x (\mathtt{I} (Y G_0) x) = x (Y G_0 x)
\end{align*}
\item
The set of (w)fgvs is closed under composition:
if $\vec G$ and $\vec G'$ are fgvs, then
\[ Y \in \mathsf{FPC} \;\Longrightarrow\; Y \vec G \in \mathsf{FPC} \;\Longrightarrow\; Y \vec G \vec G' \in \mathsf{FPC}. \]
Thus, $(\delta,\lambda y. \Theta_y)$ and $(\lambda y. \Theta_y,\delta)$ are both fgvs.
\item
Many other examples of fpcs and fgvs can be found in \cite{EHKP} and \cite{MPSS}.
\end{itemize}
\end{exas}
\begin{defi}
A (w)fgv $\vec G$ is \emph{injective} if for all (w)fpcs $Y,Y'$, $Y \vec G = Y' \vec G$ implies $Y = Y'$.
\end{defi}
\begin{prop} \label{noninj}
No non-trivial (w)fgv is injective.
\end{prop}
\begin{proof}
Suppose $\vec G = (G_0,\dots,G_n)$, for $n \ge 0$, is injective. Since $\Theta \vec G = G_0(\Theta G_0) G_1 \cdots G_n$ is (w)fpc, $G_0$ must be solvable. That is, $G_0 \vec P = \mathtt{I}$ for some closed $\vec P$.
Put $Y = \Theta_{x \vec P}$, $Y' = \Theta_{x \vec P \mathtt{I}}$.
By Proposition \ref{thetaz}, $Y \neq Y'$. Yet
\begin{align*}
Y \vec G = \Theta_{G_0 \vec P} \vec G
= \Theta_{\mathtt{I}} \vec G
= \Theta_{G_0 \vec P \mathtt{I}} \vec G
= Y' \vec G.
\end{align*}
It follows that $\vec G$ is not injective.
\end{proof}
(Notice that in the above proof both $Y$ and $Y'$ are closed, so even restricting injectivity hypothesis to closed terms, no non-trivial wfpc generator is injective.)
\begin{cor}
\label{triv}
Suppose wfgv $\vec G$ fixes every fpc: $Y \vec G = Y$ for all fpc $Y$.
Then $\vec G$ is trivial.
\end{cor}
An interesting consequence of these observations is that there is no uniform way to ``B\"ohm out'' an inner level of a wfpc.
\begin{prop} For $m > 0$, it is not possible to find terms $(M_0,\dots,M_n)$ such that
\begin{equation}
\label{Zm}
Z = (Z_n)\text{ wfpc} \quad \;\Longrightarrow\; \quad Z_0 \vec M = Z_{m}.
\end{equation}
\end{prop}
\begin{proof}
Suppose such $\vec M = (M_0,\dots,M_n)$ exists.
Then $\vec M$ is a wfgv.
For every fpc $Y$, we have $Y \vec M = Y$, so every fpc is fixed
by $\vec M$.
(In particular, $\vec M$ is a fgv.)
By Corollary \ref{triv}, $\vec M$ is trivial: $\vec M = ()$.
But then $\vec M$ fixes every wfpc as well, and thus cannot satisfy the hypothesis in \eqref{Zm}.
\end{proof}
\section{The four main classes of generators} \label{s:4}
Let us consider again Statman's conjecture on the non-existence of fixed points of the generator $\vec G = (\delta)$. This conjecture is intuitively compelling, because applying any fpc $Y$ to $\delta$ leads to a slowdown of head reductions that seems impossible to remove:
\begin{alignat*}{3}
Y x &\twoheadrightarrow_w x (Y') &&=_\beta x (Yx) \\
Y \delta x &\twoheadrightarrow_w \delta (Y'[x:=\delta]) x
\twoheadrightarrow_w x(Y'[x:=\delta] x) &&=_\beta x (Y \delta x)
\end{alignat*}
Upon closer inspection, the central property of the generator $(\delta)$ that this reasoning depends on is that $\delta(Y\delta)x$ \emph{adds to} the reduction length needed for the B\"ohm tree to develop, while still using the given fpc $Y$ in constructing this B\"ohm tree infinitely often.
Since any conversion between the two will synchronize their B\"ohm reductions, no such conversion can be possible.
If this reasoning proves to be correct for $\delta$, it should remain valid for any generator possessing the same property. This leads us to the following definition and conjecture.
Recall, for any wfpc $(Y_n)$, $Y_0 = \lambda x. x^k(Y_k x) = \delta^k(Y_k) = \delta^k(z)[z:=Y_k]$.
\begin{defi}
A generator $\vec G$ is \emph{accretive} if, for each $k$, $z \in^\infty \delta^k(z)\vec G$.
\end{defi}
That is, $\vec G$ is accretive if it actually uses every level of the input fpc
in constructing the output fpc, so that replacing $Y$ with any approximant will
also cut the B\"ohm tree of $Y \vec G$.
\begin{conj}
\label{conj}
If $\vec G$ is accretive, then there exists no $Y\in\mathsf{WFPC}$ such that $Y = Y \vec G$.
\end{conj}
\begin{rem}
Conjecture \ref{conj} generalizes Statman's conjecture.
Indeed,
\[ \delta^k(z) \delta
= (\lambda x. x^k(zx))\delta
= \delta^k(z\delta) = \lambda x. x^k (z \delta x) \]
Thus, $z \in^\infty \delta^k(z) \delta$ for all $k$, and the fgv $\vec G = (\delta)$ is accretive.
\end{rem}
Conjecture \ref{conj} is as sharp as possible: later in this section, we will show that every $\vec G$ which is \emph{not} accretive possesses a fixed point among the wfpcs.
The non-accretive generators can be naturally divided into several classes given below. (We eschew the (W)FPC notation in the next definition to emphasize that there are actually four properties of generators that are being defined.)
From the earlier equality $Y_0 = \delta^k(Y_k)$, note that
for each (w)fpc $Y$, $k \ge 0$, we can write
\[Y \vec G = \delta^k(Y')\vec G= G_0^k(Y' G_0) G_1 \cdots G_n.
\]
\newpage
\begin{defi} Let $\vec G$ be a wfgv. Fix $z \# \vec G$.
\begin{itemize}
\item $\vec G$ is \emph{constant} if there is a $k$ such that $\,z \notin G_0^k(z) G_1 \cdots G_n$.
\item $\vec G$ is \emph{weakly constant} if there is a $k$ s.t.\ $z \notin^\infty G_0^k(z) G_1 \cdots G_n$.
\item $\vec G$ is \emph{compact} if there is a $k$ such that $\;G_0^k(z) G_1 \cdots G_n \in \mathsf{FPC}$.
\item $\vec G$ is \emph{weakly compact} if there is a $k$ s.t.\ $G_0^k(z) G_1 \cdots G_n \in \mathsf{WFPC}$.
\end{itemize}
The least $k$ satisfying one of these conditions is then called the \emph{modulus of constancy}, or \emph{modulus of compactness}, accordingly. Note that $\vec G$ is accretive iff $\vec G$
is not weakly compact.
\end{defi}
From now on, let $\vec G$ be a possibly weak fgv. We will omit freshness conditions $x \# Y$, $z \# \vec G$ etc., as they will always be obvious from the context.
\begin{prop}
Let $\vec G$ be a constant (w)fgv. There is a term $Z$ such that
\[ Y \vec G = Z\]
for all wfpc $Y$.
Hence $Z$ is (w)fpc.
\end{prop}
\begin{proof}
Let $\vec G$ be constant, and let $k$ be such that
$z \notin G_0^k(z) G_1 \cdots G_n$.
That is, $z \notin \mathsf{FV}(Z)$ for some $Z \in \Lambda$
convertible to $G_0^k(z) G_1 \cdots G_n$.
Then for any wfpc $Y = (Y_0,Y_1,\dots)$, we have
\begin{align*}
Y \vec G = Y_0 \vec G &= Y_0 G_0 \cdots G_n\\
&= G_0 (Y_1 G_0) G_1 \cdots G_n\\
&= \qquad \vdots\\
&= G_0^k(Y_k G_0) G_1 \cdots G_n\\
&= G_0^k(z) G_1 \cdots G_n[z:=Y_k G_0]\\
&= Z [z:=Y_k G_0]\\
&= Z \hspace{3.5cm} \qedhere
\end{align*}
\end{proof}
\begin{prop}
The following observations are immediate.
\begin{enumerate}
\item Every constant fgv is compact.
\item Every constant (w)fgv is weakly constant.
\item Every compact (w)fgv is weakly compact.
\end{enumerate}
\end{prop}
\begin{prop}
$\vec G$ is weakly constant iff $\vec G$ is weakly compact.
\end{prop}
\begin{proof} Let $\vec G$ be a wfgv. Then
\begin{align*}
z \notin^\infty G_0^k(z) G_1 \cdots G_n
&\;\Longrightarrow\; G_0^k(z) G_1 \cdots G_n =^\infty
G_0^k(\Theta G_0) G_1 \cdots G_n =
\Theta \vec G \in \mathsf{WFPC},\\
G_0^k(z) G_1 \cdots G_n \in \mathsf{WFPC}
&\;\Longrightarrow\; G_0^k(z) G_1 \cdots G_n =^\infty \Theta
\;\Longrightarrow\; z \notin^\infty G_0^k(z) G_1 \cdots G_n. \qedhere
\end{align*}
\end{proof}
\begin{prop} Every (weakly) compact generator has a fixed point:
\label{fix}
\begin{enumerate}
\item If $\vec G$ is compact fgv, there exists fpc $Y$ with $Y \vec G = Y$. \label{fix1}
\item If $\vec G$ is weakly compact wfgv, there exists wfpc $Y$ with $Y \vec G = Y$. \label{fix2}
\end{enumerate}
\end{prop}
\begin{proof}
The construction is the same for both claims. We will first treat the weak case, and then specialize the proof to the first claim as well.
Let $\vec G$ be a weakly compact wfgv.
Let $k$ be the modulus of weak compactness,
so that $G^k_0(z)G_1 \cdots G_n \in \mathsf{WFPC}$.
Put $F_0[z] := G^k_0(z) G_1 \cdots G_n$. Since $F_0[z]$ is wfpc, write
\begin{equation}
F_0[z] x = x(F_1[z] x) =x^2(F_2[z]x) = \cdots = x^k(F_k[z]x) = \cdots
\label{e:fk}
\end{equation}
Define $Y:=\Theta (\lambda y. F_k[y G_0]) = F_k [Y G_0]$, and $X:=F_0[Y G_0]$.
Now compute
\begin{align*}
X \vec G
&= XG_0 \cdots G_n\\
&= F_0[Y G_0] G_0 \cdots G_n
& \text{by definition of $X$}\\
&= G_0^k(F_k[Y G_0] G_0) G_1 \cdots G_n
& \text{by \eqref{e:fk} with\ \ } [x := G_0, z:= Y G_0]\\
&= G_0^k(Y G_0) G_1 \cdots G_n
& \text{by definition of $Y$}\\
&= F_0[Y G_0]
& \text{by definition of $F_0$}\!\\
&= X
& \text{by definition of $X$}
\end{align*}
Since $F_0[z]$ is wfpc, so is $X = F_0[Y G_0]$, proving the second claim.
Now suppose that $\vec G$ was actually compact fgv. Then $F_0[z]$ would be fpc, while all of the steps above would remain valid, with $F_0[z] = F_k[z]$ for each $k$.
Then $X = F_0[Y G_0]$ would be fpc as well, proving the first claim.
\end{proof}
\begin{rem}
The reader will recognize the converse to Proposition \ref{fix}(\ref{fix2}) as the contrapositive of Conjecture \ref{conj}.
The converse to Proposition \ref{fix}(\ref{fix1}) seems plausible, but we do
not have sufficient evidence to assert it as a formal conjecture.
\end{rem}
\section{Rectifying generators}
\begin{defi}
A vector $\vec G$ is \emph{rectifying} if it satisfies condition $(iv)$ of Proposition \ref{conds}:
\[ Y \in \mathsf{WFPC} \;\Longrightarrow\; Y \vec G \in \mathsf{FPC} \]
\end{defi}
\begin{exa}
$\vec G = (\lambda y. \Theta_y)$ is rectifying:
\[ (Y_n) \in \mathsf{WFPC} \;\Longrightarrow\; Y_0 (\lambda y. \Theta_y)
= (\lambda y. \Theta_y) (Y_1 (\lambda y. \Theta_y))
= \Theta_{Y_1 (\lambda y. \Theta_y)} \in \mathsf{FPC} \]
\end{exa}
In Example \ref{exs}, we saw that $(\lambda y. \Theta_y)$ has a fpc fixed point. We shall presently see that so does every rectifying fgv.
Our original proof of this fact first showed that if $\vec G$ is rectifying, then $\vec G$ is weakly constant, and thus has a wfpc fixed point $Y$. But then $Y = Y \vec G \in \mathsf{FPC}$ because $\vec G$ is rectifying, hence $Y$ is fpc.
Considering that compactness provides another sufficient condition for existence of fpc fixed points, it was natural to wonder whether rectifying and compact fgvs are related. This led us to the following result.
\renewcommand{\;\Longrightarrow\;}{\quad \Longrightarrow \quad}
\begin{thm} \label{thm}
A fgv $\vec G$ is compact iff it is rectifying.
\end{thm}
\begin{proof}
\begin{description}
\item[$(\Rightarrow)$]
Suppose $G^k_0(z)G_1 \cdots G_n \in \mathsf{FPC}$.
Then \begin{align*}
&Y = (Y_0,Y_1,\dots) \in \mathsf{WFPC} \\
\;\Longrightarrow\; &Y \vec G = Y_0 G_0 \cdots G_n
= G_0^k(Y_k G_0) G_1 \cdots G_n
= G_0^k(z) G_1 \cdots G_n [z:=Y_k G_0] \in \mathsf{FPC}.
\end{align*}
\item[$(\Leftarrow)$]
The intuition for this direction is that, although the B\"ohm tree of a wfpc $Y$ is infinite, only a finite part of it can be used in any conversion $\rho : Y \vec G x = x (Y \vec G x)$. Thus, writing $Y x = x^k (Y_k x) = \delta^k(Y_k)x$ for large enough $k$ will ensure that $Y_k$ is not touched by any redex contractions. Then the whole conversion $\rho$ could be lifted
to $\rho = \sigma[z := Y_k]$, where \[\sigma : \delta^k(z) \vec G x = x (\delta^k(z) \vec G x).\]
To formalize this intuition, suppose $\vec G$ is rectifying.
Fix $c \# \vec G$. Recall the wfpc $\Upsilon$ from Examples \ref{exs}:
\begin{align*}
W_{x,p} &=\lambda v. x (v (c p) v)\\
V_x &= \lambda p. W_{x,p}\\
\Upsilon &= \lambda x. V_x \mathtt{I} V_x
\end{align*}
That is, $V_x = \lambda p v. x (v (c p) v)$. Note that $W_{x,p}$ and $V_x$ are normal forms.
Let $\Upsilon^k_x = V_x c^k(\mathtt{I}) V_x$. The term $\Upsilon x$ reduces as follows:
\begin{align*}
\Upsilon x \to \Upsilon^0_x \equiv V_x \mathtt{I} V_x
&\to W_{x,\mathtt{I}} V_x
\to x (V_x (c \mathtt{I}) V_x)
\equiv x (\Upsilon^1_x)\\
&\to x(W_{x,c\mathtt{I}} V_x)
\to x (x (V_x c^2(\mathtt{I}) V_x))
\equiv x^2 (\Upsilon^2_x)\\
&\to \cdots\\
&\to x^k (\Upsilon^k_x)\\
&\to \cdots
\end{align*}
Since each term appearing in the above reduction sequence has a unique redex, the reduction is completely deterministic.
That is --- the above sequence actually comprises the entire reduction graph of $\Upsilon^0_x$.
The sequence also shows that $\Upsilon$ is a wfpc.
It is not a fpc however, since $\Upsilon^0_x$ obviously has no reducts in common with $\Upsilon^1_x$.
But $\vec G$ is rectifying, so $\Upsilon \vec G$ is fpc.
By the Church--Rosser theorem, let $X$ be a common reduct
\begin{equation}
\Upsilon \vec G x \twoheadrightarrow X \twoheadleftarrow x (\Upsilon \vec G x).
\label{CR}
\end{equation}
We will use these reductions to show that $\delta^k(z) \vec G \in \mathsf{FPC}$ for large enough $k$.
The main idea behind the construction is as follows.
Any finite reduction $\Upsilon M \twoheadrightarrow X$ can be continued until all the descendants of $\Upsilon$ project the same number of steps from $\Upsilon^0_M$ in the sequence above. Afterwards, all descendants of $M$ can be further synchronized by confluence.
For example, if $M = \lambda y. [y \mathtt{K} , y]$, then
\begin{align*}
\Upsilon (\mathtt{I} M) \twoheadrightarrow (\mathtt{I} M) (\Upsilon^1_{\mathtt{I} M})
&\twoheadrightarrow (\lambda y. [y \mathtt{K}, y]) (V_{\mathtt{I} M} c^1(\mathtt{I}) V_{\mathtt{I} M})\\
&\twoheadrightarrow [V_{\mathtt{I} M} c^1(\mathtt{I}) V_{\mathtt{I} M} \mathtt{K} ,
V_{\mathtt{I} M} c^1(\mathtt{I}) V_{\mathtt{I} M} ]\\
&\twoheadrightarrow [W_{\mathtt{I} M, c^1(\mathtt{I})} V_{\mathtt{I} M} \mathtt{K},
\mathtt{I} M (V_{\mathtt{I} M} c^2(\mathtt{I}) V_M)]
\end{align*}
and this reduction can be further continued to
\begin{align*} [W_{\mathtt{I} M, c^1(\mathtt{I})} V_{\mathtt{I} M} \mathtt{K},
\mathtt{I} M (V_{\mathtt{I} M} c^2(\mathtt{I}) V_M)]
&\twoheadrightarrow [M(V_{M} c^2(\mathtt{I}) V_M) \mathtt{K} , M(V_{M} c^2(\mathtt{I}) V_M )]\\
&\; \equiv\; [M(\Upsilon^2_M),M(\Upsilon^2_M)].
\end{align*}
We proceed with the following sequence of claims, which are hopefully sufficiently clear not to warrant additional elaboration.
\begin{enumerate}
\item
If $\Upsilon M \twoheadrightarrow X$, then $X \twoheadrightarrow X' \equiv C[V_{M_1}c^{k_1}(\mathtt{I})V_{M'_1},\cdots,V_{M_k}c^{k_m}(\mathtt{I})V_{M'_m}]$, with $M \twoheadrightarrow M_i$, $M \twoheadrightarrow M'_i$, and every occurrence of $c$ in $X'$ being displayed in the subterm $c^{k_i}(\mathtt{I})$ in one of the holes in $C[]$.
\item If $\Upsilon M \twoheadrightarrow X$, then $X \twoheadrightarrow X' \equiv C[\Upsilon^{k_1}_{M_1},\dots,\Upsilon^{k_m}_{M_m}]$, with $M \twoheadrightarrow M_i$ and every occurrence of $c$ being uniquely determined by its occurrence in some $\Upsilon^{k_i}_{M_i}$.
This is obtained from above by finding a common reduct for each $M_i$,$M_i'$.
\label{p2}
\item If $C[\Upsilon M] \twoheadrightarrow X$, then $X \twoheadrightarrow C'[\Upsilon^{k_1}_{M_1},\cdots,\Upsilon^{k_m}_{M_m}]$, with the same conditions on $M_i$ and occurrences of $c$ as before.
This is obtained from the previous point by factoring the reduction into a part that does not depend on $\Upsilon M$,
$C[x] \twoheadrightarrow D[x \vec P_1,\dots, x \vec P_k]$, followed by reductions inside $D[\cdots]$ which are treated separately via \ref{p2}. (See ``Barendregt's Lemma'' in \cite[Exercise 15.4.8]{B84})
\item If $C[\Upsilon M] \twoheadrightarrow X$, then $X \twoheadrightarrow C'[\Upsilon^k_{N}, \cdots, \Upsilon^k_N]$, where $M \twoheadrightarrow N$ and each occurrence of $c$ being uniquely determined by its occurrence in some $\Upsilon^k_N$.
This is obtained from the previous claim by ``bumping all $\Upsilon^{k_i}$s along'' to stage $k \ge \max \setof{k_i}$, and letting $N$ be a common reduct of all the $M_i$s.
\item If the reduction $\rho : C[\Upsilon M] \twoheadrightarrow C'[\Upsilon^k_N,\cdots,\Upsilon^k_N]$ is obtained by the algorithm given in the previous steps, then $\rho$ lifts to the instance
$\rho = \sigma[ux:=\Upsilon^k_x]$, where
\[ \sigma : C[\delta^k(u) M] \twoheadrightarrow C'[u N,\cdots,u N]. \]
\end{enumerate}
And now we are done! The common reductions in \eqref{CR} can be both continued to
\[ \Upsilon \vec G x \twoheadrightarrow C'[\Upsilon^k_N,\cdots,\Upsilon^k_N]
\twoheadleftarrow x (\Upsilon \vec G x)\]
so that all of the descendants of $\Upsilon$ (under \emph{both} reductions) are displayed in the context. (This follows from the fact that every occurrence of $c$ is witnessed in some $\Upsilon^k_N$, and $c$ was chosen to be fresh. The variable $c$ acts as a ``label'' for the unfolding depth of $\Upsilon$.)
The conclusion of the last step therefore holds for both of these reductions, and so
\[ C[\delta^k(u)M] := [\delta^k(u)G_0]G_1\cdots G_n
\twoheadrightarrow C'[uN,\dots,uN] \twoheadleftarrow x(\delta^k(u)G_0\cdots G_n).
\]
That is, $G_0^k(uG_0)G_1\cdots G_n \in \mathsf{FPC}$.
Applying the substitution $[u:=\mathtt{K} u]$, we find that
$G_0^k(u)G_1\cdots G_n \in \mathsf{FPC}$ as well.\qedhere
\end{description}
\end{proof}
\begin{cor}
Every rectifying fgv has a fixed point in $\mathsf{FPC}$.
\end{cor}
\begin{rem}
The proof of the nontrivial direction of Theorem \ref{thm} suggests a deeper connection between uniform properties (finite conversions) and terms obeying a coinductive pattern (such as wfpcs). In the next section, we will see a different application of the same type of argument. There seems to be a more general ``continuity principle'' at work here that could be worthwhile to isolate.
\end{rem}
We finish this section with an example of a weakly constant fgv which is not rectifying. It follows that, even restricting to fgvs, compactness is indeed stronger than weak compactness.
This gives the full picture of the relationships between various classes of wfgvs we defined here. These relationships are summarized in Figure \ref{fig}.
\begin{prop}
There exist weakly constant
fpc generators which are not rectifying.
\end{prop}
\begin{proof}
Consider the following combinators:
\begin{align*}
P x y &=y x\\
Q y z &=z (y Q z)\\
W w p z &=z (w w (z p) z) \\
R y z &=W W (y Q z) z
\end{align*}
First we observe that $(P,Q)$ is an fgv:
for $Y$ fpc, we have
\begin{equation}
\label{ypqx}
Y P Q x
=P (Y P) Q x
= Q (Y P) x
= x(Y P Q x).
\end{equation}
We claim that $(P,Q)$ is not rectifying.
If it was, then by the previous theorem, it would be compact, hence weakly compact.
To the contrary, \eqref{ypqx} shows that $(P,Q)$ is accretive. So it cannot be rectifying.
Next, we verify that $(P,R)$ is again fgv:
\begin{align*}
Y P R x
= P (Y P) R x
= R (Y P) x
&= W W (Y P\, Q\, x)\, x\\
&= x (W W (x (Y P\, Q\, x))\, x)\\
&=_{\eqref{ypqx}} x (W W (Y P\, Q\, x)\, x)
= x (Y P R\ \! x)
\end{align*}
At the same time, we claim $(P,R)$ is weakly constant with modulus $1$:
\begin{align*}
P^1(z) R x = P z R x
= R z x
&= W W (z Q x) x\\
&= x (W W (\cdots) x)\\
&= x^2 (W W (\cdots) x)\\
&= \cdots\\
&= x^n (\cdots)
\end{align*}
The variable $z$ is being pushed to infinity, and does not appear
in the B\"ohm tree of $P z R x$---nor
in the B\"ohm tree of $P z R = \lambda x. P z R x$.
That is, $z \notin^\infty P^1(z)R$.
Indeed, $\vec G = (P,R)$ is weakly constant. We claim it is not rectifying.
For a wfpc $Z$, the term $Z P R$ reduces as follows:
\begin{align*}
Z P R x
\twoheadrightarrow P (Z P) R x
\to^2 R (Z P) x
&\to^2 W W (Z P Q x) x\\
&\to^3 x (W W (x (Z P Q x)) x)\\
&\to^3 x^2 (W W (x^2 (Z P Q x)) x)\\
&\to \qquad \vdots\\
Z P R x \quad
\twoheadrightarrow^{z_0 + 2 + 2 + 3n}\hspace{-0.5cm} &\quad \ \ x^n(W W (x^n (Z P Q x)) x)
\end{align*}
From this analysis, it is manifest that any common reduction
\[Z P R x\ \ \twoheadrightarrow\ \ \cdot \ \ \twoheadleftarrow\ \ x(Z P R x) \]
must contain a common reduction between
\[x^n(Z P Q x)\ \ \twoheadrightarrow\ \ \cdot \ \ \twoheadleftarrow\ \ x^{n+1}(Z P Q x). \]
As we observed earlier, $(P,Q)$ is not rectifying, so there
exist wfpcs $Z$ for which such conversion is not possible.
Thus $(P,R)$ is not rectifying either. This completes the proof.
(Note that the modulus of constancy can be adjusted to any $k > 0$ by passing the argument of the generator into the head position $k$ times before pushing it to infinity.)
\end{proof}
\begin{figure}
\centering
\includegraphics[scale=0.5]{FGVs}
\caption{The hierarchy of (weak) fpc generators}
\label{fig}
\end{figure}
\section{The monoid of wfgvs}
\newcommand{\mathcal G}{\mathcal G}
\newcommand{\mathcal F}{\mathcal F}
\newcommand{\odot}{\odot}
The wfpc and fpc generators have an obvious monoid structure:
\[(G_0,\dots,G_n) \odot (G_0',\dots,G_m')
\quad:=\quad (G_0,\dots,G_n,G_0',\dots,G_m') \]
The identity is the trivial generator $()$.
The concatenation operation is associative, and satisfies
the identity laws.
We thus have a monoid $(\mathcal G,\odot,())$ of wfgvs,
containing a submonoid $(\mathcal F,\odot,())$ of fgvs.
Neither of these monoids is finitely generated, as there are infinitely many constant fgvs of the form $\mathtt{K} \Theta_M$ that cannot be obtained by composition of more elementary ones.
\subsection*{Extensional equality}
Since the primary interest in (w)fgvs is in their ability to generate new (w)fpcs from old, it is natural to identify generators having the same functional behavior.
\begin{defi}
We say a fgv or wfgv $\vec G$ is \emph{extensionally equal} to $\vec G'$, written $G \simeq G'$, if for every \emph{fpc} $Y$, $Y\vec G = Y \vec G'$.
(Note that this is an equivalence relation on $\mathcal G$, preserved by $\odot$.)
\end{defi}
\newcommand{\mathtt{C}}{\mathtt{C}}
\begin{exas}
\begin{itemize}
\item If $\vec G$ is a constant generator, say, $Y \vec G = Z$ for all $Y$, then $\vec G \simeq (\mathtt{K} Z)$:
\[ Y (\mathtt{K} Z) = \mathtt{K} Z (Y' (\mathtt{K} Z)) = Z = Y \vec G \]
\item
Recall the combinator $\mathtt{C} = \lambda f x y. f y x$.
Note that $\mathtt{C} \mathtt{K} = \mathtt{K} \mathtt{I}$, and $\mathtt{C} (\mathtt{C} \mathtt{K}) = \mathtt{C} (\mathtt{K} \mathtt{I}) = \mathtt{K}$.
Let $G y z = z (y (\mathtt{C} z)) (\delta (y (\mathtt{C} z)))$.
Then $(G,\mathtt{K})$, and $(G, \mathtt{C} \mathtt{K})$ are fgvs, and $(G,\mathtt{K}) \simeq (G,\mathtt{C} \mathtt{K})$:
\begin{align*}
Y \in \mathsf{FPC} \;\Longrightarrow\;
Y G \mathtt{K} &= G (Y G) \mathtt{K}
= \mathtt{K} (Y G (\mathtt{C} \mathtt{K})) (\delta (Y G (\mathtt{C} \mathtt{K})))
= Y G (\mathtt{C} \mathtt{K}) \\
&= G (Y G) (\mathtt{C} \mathtt{K})
= (\mathtt{C} \mathtt{K}) (Y G (\mathtt{C} (\mathtt{C} \mathtt{K}))) (\delta (Y G (\mathtt{C} (\mathtt{C} \mathtt{K}))))\\
& \hspace{2.415cm} = (\mathtt{K} \mathtt{I}) (Y G \mathtt{K}) (\delta (Y G \mathtt{K})) = \delta (Y G \mathtt{K}) \in \mathsf{FPC}
\end{align*}
\end{itemize}
\end{exas}
The reason that in the definition of $\simeq$ the quantifier ranges over fpcs both in the case of fgvs as well as wfgvs is that, when the quantifier is taken over all wfpcs, it makes the resulting notion of equality much more restrictive, as we shall now demonstrate.
Because we obviously want equal fgvs to remain equal as wfgvs, the definition of extensional equality is expressed in terms of behavior on fpcs in both contexts.
\begin{prop}
\label{ee}
If $Y \vec G = Y \vec G'$ for every wfpc $Y$,
then for some $k$, $\delta^k(z)\vec G = \delta^k(z)\vec G'$.
\end{prop}
\begin{proof}
This statement follows by the same reasoning as used in Theorem \ref{thm}.
Take $z \# \vec G, \vec G'$, and let $\Upsilon=\Upsilon_z$ be the canonical wfpc defined there with a deterministic reduction graph that uses the variable $z$ to track its unfolding history.
The argument subsequently showed how every conversion
$C[\Upsilon M] \twoheadrightarrow X \twoheadleftarrow C'[\Upsilon M]$ can be extended through $X \twoheadrightarrow X'$, such that
$X' = D[\Upsilon^k_N,\cdots,\Upsilon^k_N]$, with $M \twoheadrightarrow N$ and every occurrence of $z$ in $X'$ to be found among the displayed $\Upsilon^k_N$. We could then conclude that the common reduction may be lifted to a finite truncation of $\Upsilon$.
In the present case, our starting conversion has the form
\begin{equation}
\label{Ups}
C[\Upsilon G_0] := [\Upsilon G_0] G_1 \cdots G_n = [\Upsilon G_0'] G_1' \cdots G_{n'}' =: C'[\Upsilon G_0']
\end{equation}
To justify application of the same argument, we should thus argue why $G_0 = G_0'$.
Let $X$ be a reduct of $C[\Upsilon G_0]$. By recalling the reduction graph of $\Upsilon$, it is evident that every innermost occurrence of $z$ in $X$ is applied to a reduct of $G_0$.
If $X$ is also a reduct of $C'[\Upsilon G_0']$, then the same conclusion will hold, with $G_0'$ in place of $G_0$. Thus, the very fact of occurrence of $z$ in $X$ forces $G_0$ and $G_0'$ to be convertible.
Of course, if $z$ does not occur in $X$ at all, that only means that all descendants of $\Upsilon$ have already been erased, in which case there is nothing left to prove.
So $G_0 = G_0'$. We can thus adjust conversion in \eqref{Ups} to
\[ C[\Upsilon G_0] \equiv [\Upsilon G_0] G_1 \cdots G_n
= [\Upsilon G_0] G_1' \cdots G_{n'}' \equiv C'[\Upsilon G_0] = C'[\Upsilon G_0'] \]
where the conversion on the right takes place inside the subterm that $\Upsilon$ is applied to.
Now we extend the other conversion to a common reduct
\[ [\Upsilon G_0] G_1 \cdots G_n \twoheadrightarrow D[\Upsilon^k_N,\cdots,\Upsilon^k_N]
\twoheadleftarrow [\Upsilon G_0] G_1' \cdots G_{n'}' \]
and proceed, as in the proof of Theorem \ref{thm}, to lift these reductions to
\[ [\delta^k(u)G_0] G_1 \cdots G_n \twoheadrightarrow D[uN,\dots,uN] \twoheadleftarrow [\delta^k(u)G_0]G_1' \cdots G_{n'}'. \]
Converting $G_0$ in the right term to $G_0'$, we obtain the desired result.
\end{proof}
From now on, we will consider the monoid $\mathcal G$ up to extensional equality.
We will also write concatenation of vectors by juxtaposition: $\vec F \vec G = \vec F \odot \vec G$.
\subsection*{Ideals}
\begin{defi}
A \emph{two-sided ideal} in a monoid $(M,\cdot)$ is a set $I \subseteq M$ such that
\[ i \in I,\, m \in M \;\Longrightarrow\; i\cdot m,\, m \cdot i\, \in\, I. \]
\end{defi}
\begin{prop}\leavevmode
\label{ideal}
\begin{enumerate}
\item
The constant generators form the minimal ideal in both monoids.
\item
The weakly constant/weakly compact wfgvs form a two-sided ideal in $\mathcal G$.
\item
The compact fgvs form a two-sided ideal in $\mathcal F$
(and a right ideal in $\mathcal G$).
\end{enumerate}
\end{prop}
\begin{proof}
\begin{enumerate}
\item Let $\vec G$ be constant, so that $Y \vec G = Z$ for all (w)fpc $Y$.
Let $\vec G'$ be arbitrary.
Then $Y \vec G \vec G' = Z \vec G'$ for all $Y$, and $Y \vec G' \vec G = Z$
for all $Y$.
Thus $\vec G \vec G'$ and $\vec G' \vec G$ are constant.
Moreover, since any ideal includes the constant generators by composition on the right, these generators together constitute the minimal ideal.
\item
Let $\vec G \in \mathcal G$ be weakly constant, so that $z \notin^\infty G_0^k(z)G_1 \cdots
G_n$.
Let $\vec G' \in \mathcal G$ be arbitrary. Clearly,
$z \notin^\infty G_0^k(z) G_1 \cdots G_n G_0' \cdots G_m'$.
That is, $\vec G \vec G'$ is weakly constant.
On the other hand, we know that $\vec G'$ maps wfpcs to themselves:
\[ (\lambda y. y\vec G') : \mathsf{WFPC} \to \mathsf{WFPC}\]
All wfpcs have the same B\"ohm tree, and in the tree topology, its neighborhood basis consists of the set $\setof{\lambda x. x^n(\Omega) \mid n \ge 0}$.
By Continuity Theorem \cite[14.3.22]{B84}, there exists
$l \ge 0$ such that
\begin{align*}
(\lambda x. x^l(z))\vec G' = (\lambda y.y \vec G') (\lambda x.x^{l}(z))
&= \lambda x.x^k(X)
\end{align*}
for some $X$, possibly containing $z$.
And yet,
\begin{align*}
z \notin^\infty G_0^k(X)G_1 \cdots G_n
= (\lambda x.x^k(X))\vec G
= (\lambda x. x^l(z)) \vec G' \vec G
= (G'_0)^l(z)G'_1\cdots{}G'_m\vec G.
\end{align*}
Indeed, $\vec G' \vec G$ is weakly constant.
\item
It is immediate that the rectifying fgvs form a two-sided ideal
in $\mathcal F$. By Theorem \ref{thm}, so do the compact ones.
Also, for $\vec G, \vec G' \in \mathcal G$, $\vec G'$ rectifying
clealry implies $\vec G \vec G'$ rectifying. \qedhere
\end{enumerate}
\end{proof}
\subsection*{Green's relations}
\newcommand{\mathpzc{L}}{\mathpzc{L}}
\newcommand{\mathpzc{R}}{\mathpzc{R}}
\newcommand{\preccurlyeq}{\preccurlyeq}
The structure of many monoids can be characterized in terms of Green's relations. Here we record several observations about these relations in $\mathcal G$, which could be useful for future study of this monoid.
\begin{defi}
For $\vec G, \vec G' \in \mathcal G$, put
\begin{align*}
\mathpzc{L}(\vec G) &\!\quad =\quad \setof{\vec H \vec G \mid \vec H \in \mathcal G}\\
\mathpzc{R}(\vec G) &\!\quad =\quad \setof{\vec G \vec H \mid \vec H \in \mathcal G}\\
\vec G \preccurlyeq_{\mathpzc{L}} \vec G' &\iff \,\mathpzc{L}(\vec G) \subseteq \mathpzc{L}(\vec G') \, \iff \vec G \in \mathpzc{L}(\vec G')\\
\vec G \preccurlyeq_{\mathpzc{R}} \vec G' &\iff \mathpzc{R}(\vec G) \subseteq \mathpzc{R}(\vec G')\iff \vec G \in \mathpzc{R}(\vec G')\\
\vec G \sim_{\mathpzc{L}} \vec G' &\iff \,\mathpzc{L}(\vec G) = \mathpzc{L}(\vec G')\\
\vec G \sim_{\mathpzc{R}} \vec G' &\iff \mathpzc{R}(\vec G) = \mathpzc{R}(\vec G').
\end{align*}
\end{defi}
\newcommand{\vec G}{\vec G}
\newcommand{\vec F}{\vec F}
\begin{enumerate}
\item If $\vec G \simeq (\mathtt{K} Z)$ is a constant generator, then
$\mathpzc{L}(\vec G) = \setof{\mathtt{K} Z}$, so all constant generators are each in their own left class.
That is, $\vec G \in \mathpzc{L} (\mathtt{K} Z)$ implies $\vec G \simeq (\mathtt{K} Z)$.
\item On the other hand, $(\mathtt{K} Z,\mathtt{K} Z') \simeq (\mathtt{K} Z')$,
thus $\mathtt{K} Z' \in \mathpzc{R} (\mathtt{K} Z)$. Since the choice of $Z,Z'$ was arbitrary,
$\mathtt{K} Z \sim_{\mathpzc{R}} \mathtt{K} Z'$ for all $Z$ and $Z'$.
That is, constant generators are all in the same right class.
Since constant generators form an ideal, $\vec G {\sim_\mathpzc{R}} (\mathtt{K} Z)$ or $\vec G \preccurlyeq_\mathpzc{R} (\mathtt{K} Z)$ imply $\vec G \simeq (\mathtt{K} Z')$ for some $Z'$.
So $\mathpzc{R}(\mathtt{K} Z) = \setof{(\mathtt{K} Z') \mid Z' \in \mathsf{WFPC}}$
is the ideal of all constant generators.
\item Similarly, if $\vec G$ is weakly constant, then so is every element of $\mathpzc{L}(\vec G)$ and $\mathpzc{R}(\vec G)$.
That is, the only (w)fgvs that can be congruent to $\vec G$ modulo $\sim_\mathpzc{L}$ or $\sim_\mathpzc{R}$ are again weakly constant.
\item If $\vec G$ is compact, then so is every element of $\mathpzc{L}(\vec G)$.
When restricted to $\mathcal F$, both $\mathpzc{L}(\vec G)$ and $\mathpzc{R}(\vec G)$ consist of compact generators.
\item Suppose $\vec G \sim_\mathpzc{R} \vec G'$. Then we can find $\vec F, \vec F' \in \mathcal G$ such that $\vec G \simeq \vec G' \vec F$, and $\vec G' \simeq \vec G \vec F'$.
But then $\vec G \simeq \vec G \vec F' \vec F$,
and $\vec G' \simeq \vec G' \vec F \vec F'$.
If $\vec G \simeq \vec G \vec F' \vec F$, then for every $Y$, $Y \vec G = Y \vec G \vec F' \vec F$ is a fixed point of $\vec F' \vec F$.
By Conjecture \ref{conj}, $\vec F' \vec F$ is weakly constant.
By Proposition \ref{ideal}, so is
$\vec G \vec F' \vec F$.
But $\vec G \vec F' \vec F \simeq \vec G$. So $\vec G$ is weakly constant.
Of course, everything we just said applies to $\vec G'$ as well.
We conclude that, modulo Conjecture \ref{conj}, nontrivial
$\sim_\mathpzc{R}$-relations can only exist between weakly constant wfgvs.
\end{enumerate}
In fact, we believe that for accretive $\vec G, \vec G'$, either $\vec G \sim_\mathpzc{R} \vec G'$ or $\vec G \sim_\mathpzc{L} \vec G'$ implies $\vec G \simeq \vec G'$.
Indeed, this is a consequence of the ``freeness'' conjecture we formulate next.
\subsection*{Unique factorization of accretive generators}
\begin{defi}
An accretive generator $\vec G$ is \emph{prime} if
$\vec G = \vec G_1 \vec G_2$ implies $\setof{\vec G_1,\vec G_2} = \setof{\vec G,()}$.
\end{defi}
The following ``unique factorization conjecture'' states that the accretive generators are freely generated by the prime ones.
\begin{conj} \label{free}
If $\vec G \in \mathcal G$ is accretive, then $\vec G = \vec G_1 \cdots \vec G_k$, where each $\vec G_i$ is prime.
Furthermore, this decomposition is unique up to extensional equality. That is, for all prime $\vec G'_1, \dots, \vec G'_{k'}$,
if $\vec G = \vec G'_1 \cdots \vec G'_{k'}$, then $k = k'$
and $\vec G_i \simeq \vec G'_i$ for all $i \in \setof{1,\dots,k}$.
\end{conj}
The conjecture implies that any relations in the monoid of wfpc generators under composition can only arise between non-accretive i.e., weakly compact generators. In particular, the equations
\begin{align} \label{eq1}
\vec F \vec G &= \vec F \\ \vec F \vec G &= \vec G \label{eq2}
\end{align}
admit no (non-trivial) solutions among the accretive generators.
As a result, the left and right classes of accretive generators would indeed all be distinct if Conjecture \ref{free} was to be validated.
And what about the solutions to \eqref{eq1} or \eqref{eq2} among the rest of $\mathcal G$? The following examples show that there indeed exist solutions to these equations under certain conditions. In all cases, (weak) compactness plays an essential role.
\begin{prop}
For $\vec G$ weakly constant, there exists non-constant $\vec F$ with $\vec F \vec G \simeq \vec F$.
(In particular, $\vec F \preccurlyeq_\mathpzc{L} \vec G$.)
\end{prop}
\begin{proof}
The idea is to make $\vec F$ generate the fixed points of $\vec G$ according to the scheme in Proposition \ref{fix}.
Let $k$, $F_0$, $F_k$ be chosen as in the proof of that proposition.
Put $A = \lambda y b. b (y \delta)$, $B = \lambda y. F_0[y (\lambda u.F_k[uG_0]) G_0]$, and $\vec F = (A,B)$.
Observe that
\begin{align*}
Y \in \mathsf{FPC} \;\Longrightarrow\; Y\! A \delta &= A (Y\! A) \delta = \delta (Y\! A \delta)\\
Y\! A B &= A (Y\! A) B = B (Y\! A \delta) = F_0[ (Y\! A \delta)
(\lambda u. F_k[uG_0]) G_0].
\end{align*}
Since $Y\! A \delta$ is thereby forced to be fpc, it follows that $Y\! A B = F_0[U G_0]$, where $U = F_k[U G_0]$. This allows us to calculate as in the proof of Proposition \ref{fix} that $Y\! A B$ is a fixed point of $\vec G$:
\[ Y \vec F \vec G = Y\! A B \vec G = Y\! A B\]
Note however, that $\vec F$ will not be constant in general, because it uses its fpc argument to define $U$.
\end{proof}
\begin{prop}
Let $\vec F=(F_0,\cdots,F_n)$ be wfgv with $n \ge 1$.
There exists a compact fgv $\vec G$ such that $\vec F \vec G \simeq \vec G$.
(In particular, $\vec G \preccurlyeq_\mathpzc{R} \vec F$.)
\end{prop}
\begin{proof}
First, recall that $F_0 = \lambda v_0..v_l. v_m \vec P$ is solvable. Since $Y \vec F = F_0 (Y' F_0) F_1 \cdots F_n$, we also know that the head variable $v_m$ cannot be $v_0$, for otherwise the result would be unsolvable, while it must be a wfpc.
We let $\vec G = (F_0,G_1,\cdots,G_{n+1})$. We will only need to specify a couple of $G_i$s.
Set $G_m = \lambda \vec p. \lambda g_{l+1},...,g_{n+1}. \Theta_{g_{n+1} (F_0 v_0 F_1 \cdots F_n)}$, $G_{n+1} y = \Theta(\lambda gy.g(y \vec F)) = G_{n+1} (y \vec F)$
\begin{align*}
Y \vec G &= G_0 (Y' G_0) G_1 \cdots G_{n+1}\\
&= F_0 (Y' F_0) G_1 \cdots G_{n+1}\\
&= G_m \vec P [v_0:=Y' F_0] [v_i := G_i]_{1 \le i \le l} G_{l+1}
\cdots G_{n+1}\\
&= \Theta_{G_{n+1} (F_0 (Y' F_0) F_1 \cdots F_n)}\\
&= \Theta_{G_{n+1} (Y F_0 \cdots F_n)} \\
&= \Theta_{G_{n+1} (Y \vec F)} \tag{$\star$}\\
&= \Theta_{G_{n+1} (Y \vec F \vec F)} \\
&= \Theta_{G_{n+1} ((Y \vec F) \vec F)}\\
&= (Y \vec F) \vec G \quad \textrm{by ($\star$), with $Y:=Y\vec F$} \qedhere
\end{align*}
\end{proof}
Our final observation is a corollary to one of the first ones.
\begin{prop}
The monoid $\mathcal G$ is \emph{zerosum-free}: If $\vec F\vec G \simeq ()$, then $\vec F\simeq()\simeq\vec G$.
\end{prop}
\begin{proof}
Suppose $\vec F\vec G \simeq ()$. Then, considered as endofunctions on $\mathsf{WFPC}/{=_\beta}$, $\vec G$ acts as a left inverse of $\vec F$, making $\vec F$ a split mono (modulo beta).
But we have seen in Proposition \ref{noninj} that no wfgv is injective, so no wfgv can be monic.
Specifically, take $Y \neq Y'$ such that $Y \vec F = Y' \vec F$.
Since $() \simeq \vec F \vec G$, we have $Y = Y \vec F \vec G = Y' \vec F \vec G = Y'$, a contradiction.
\end{proof}
\section{Concluding remarks}
In this paper,we have broached the topic of abstract fpc generators. Our first investigations revealed that these operators naturally fall into a few robust classes. We established elementary relationships between these classes.
What becomes clear from our investigations is that there is yet much to be uncovered about the structure of fixed point combinators. Some of the possible future research directions include the following.
\begin{enumerate}
\item The most pressing issue is the status of Conjecture \ref{conj}. All the evidence available points to this conjecture being true, yet current techniques in untyped lambda calculus decidedly come up short in settling the question. However it will be decided, the insights to be gathered from the new approaches will greatly deepen our understanding of lambda terms.
\item Of course, one could take the next step and ask whether the converse to the first claim in Proposition \ref{fix} is also valid. Considering how difficult the former question is, this one will likely remain out of reach for the foreseeable future.
\item What else can be said about the structure of the monoid $\mathcal G$? Is the submonoid of accretive generators freely generated by the prime generators, as Conjecture \ref{free} asserts? What about the (weakly) compact generators? How can their compositional structure be characterized?
\item Since the monoid of (w)fgvs naturally acts on the set of (w)fpcs, how much of the structure of fpcs is captured by this monoidal action? Does every fpc have a representation in terms of the prime elements of the monoid --- again, modulo extensional equality, and the ideal of compact generators?
\item Finally, while not directly relevant to the earier discussion, an answer to the following question could also shed light on recursion-theoretic properties of FPCs:
Let $\mathtt{Y}$ be Curry's simplest fpc. Is $\setof{\#M \mid M = \mathtt{Y}}$ a decidable subset of $\mathsf{FPC}$?
Specifically, does there exist a term $\Delta_{\mathtt{Y}}$ satisfying, for all \emph{closed
$Y \in \mathsf{FPC}$}, the following:
\begin{align*}
\Delta_{\mathtt{Y}} \ulcorner Y \urcorner x y = \begin{cases}
x & \mathtt{Y} =_\beta Y\\
y & \mathtt{Y} \neq_\beta Y
\end{cases}
\end{align*}
Notice that Scott's theorem does not apply here because $\mathsf{FPC}$ is not all of $\Lambda$, but is only a computably enumerable subset of it. $\Delta_{\mathtt{Y}}$ is allowed to diverge outside of this set.
\end{enumerate}
The recent paper \cite{MPSS} proposes another approach to Statman's conjecture based on simple types. We note that the generalization of the conjecture stated there is consistent with ours, since every simply-typed generator is accretive thanks to strong normalization of ($\mathtt{Y}$-free) typed terms.
I would like to thank Jan Willem Klop, Joerg Endrullis, Dimitri Hendriks, Giulio Manzonetto, and Stefano Guerrini for wonderful discussions about fpc generators.
I would also like to extend my gratitude to the anonymous referees whose many
suggestions have significantly improved this paper.
\newpage
| {'timestamp': '2020-07-23T02:18:03', 'yymm': '1810', 'arxiv_id': '1810.02239', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02239'} | arxiv |
\section{Introduction}
Cyber-Physical Systems (CPS) tightly conjoin cyber
elements and physical resources for sensing, control, communication, and computation. CPS, regarded as the next generation engineered systems, are common in a large scope of infrastructures, such as transportation systems, autonomous vehicles, smart buildings and mine monitoring, in many of which safety is crucial \cite{Johansson2014,Poovendran2012}. Nevertheless, in light of the nature of the high openness, CPS are vulnerable to the malicious threats from the external. This has triggered a great deal of attention to the issues of \emph{cyber-security} \cite{Fawzi2014,Sundaram2011,Pajic2014,Mo2015, Vamvoudakis2014,Brown2017,Amini2018,Jiang2018}.
Researchers investigated \emph{cyber-security} under some specific attack patterns. Different attack patterns include deception attacks \cite{Amin2013a,Amin2013b}, replay attacks \cite{Mo2009,Zhu2014}, false data injection attacks \cite{Mo2014}, and Denial-of-Service (DoS) attacks \cite{Befekadu2015,Peris2015,Foroush2012}.
In the current paper, we focus on DoS attacks. The adversary launches DoS attacks to jam a wireless channel through which useful information is transmitted. In wireless communications, several reasons, including channel fading, scattering, signal degradation, etc, lead to the random dropout of data packets. Due to the interference from the attacker, the packet drops with a larger probability. Specifically, higher jamming power leads to a smaller signal-to-interference-plus-noise ratio (SINR), which implies a higher probability of the packet dropout \cite{Poisel2011}.
It has been pointed out that a DoS attacker may be subject to a limited energy/power budget, i.e., the attacker cannot block the communication network ceaselessly \cite{Li2015b,Zhang2015,Zhang2016}. Zhang et al. \cite{Zhang2015} investigated how an attacker with limited ability schedules the DoS attacks to maximize the estimation error at the remote estimator. They also proposed the optimal DoS attack policies to maximize the Linear Quadratic Gaussian control cost function when the attacker cannot deteriorate the channel quality all the time \cite{Zhang2016}. Li et al. proposed a zero-sum game in which the sensor and the DoS attacker, both with energy constraint, find their optimal mixed strategies to maximize their payoff functions, and demonstrated that the optimal strategies for these two players constitute a mixed strategy Nash Equilibrium in\cite{Li2015b}.
All these works assumed that the attacker can only obstruct the channel $m$ times over a finite time horizon $T$ ($m<T$), and focused on when the attacker should jam the channel. However, they did not consider which power level the DoS attacker should employ.
When taking into account the power level of the DoS attack, the issue of finding the optimal power level that most severely degrades the system performance follows.
The recent work in \cite{Zhang2018} considered DoS attack energy management under the constraints of restricted attack power over a finite time horizon. The local estimate of a sensor is sent to a remote estimator through a wireless link under DoS attacks. It is assumed that the same attack energy is used each time. They proved that, under the same attack times, the higher attack power, the larger the trace of expected terminal estimation error covariance. Due to the fact that higher attack energy leads to the smaller attack times, the attacker has to decide how much energy to employ when launching a DoS attack. For a special system case (the system matrix is normal), the authors provided some sufficient conditions under which the analytical solution to the optimal static attack energy management problem is obtained, but failed to derive the closed-form solution for a general system case. Zhang et al. \cite{Zhang2017} also studied the other system performance index, the average expected estimation error, in the setup of \cite{Zhang2018} and obtained the corresponding sufficient conditions. In both \cite{Zhang2018} and \cite{Zhang2017}, the model of packet dropout probability is based on the signal-to-interference-plus-noise ratio at the receiver, in which different attack power levels correspond to different probabilities of packet dropout, including the level at which the attack power is zero, i.e., there is no attack. However, like most existing works that discard the intermittent packet dropout in the absence of attack \cite{Befekadu2015,Peris2015,Zhang2016,Zhang2015,
Foroush2012}, Ref. \cite{Zhang2018} and \cite{Zhang2017} also assumed that data packets will reach the remote estimator if DoS attack does not appear, which is against the SINR-based model and strongly restrict the application in the real scenario. In contrast, our previous work \cite{Qin2018} considered the scenario of remote state estimation under DoS attacks in which the random losses may occur even if there is no attack. Therein, the problem of when the attacker should jam the channel is solved, but the effect of the attack power on remote estimation performance is neglected.
In the current work, to capture the packet dropout in wireless channels and have an insight of how different attack power levels would impact on the system performance, we investigate the optimal DoS attack energy management problem over an SINR-based network which embeds the works in \cite{Zhang2015,Zhang2018,Zhang2017,Qin2018} as special cases.
The main contributions of our work consist of the following.
\begin{enumerate}
\item For a general system case (not confined to the system with a normal system matrix which the result in \cite{Zhang2018} requires), we propose new sufficient conditions under which the closed-form solution to the optimal static attack energy management problem for the expected terminal estimation error is acquired. We further prove that the obtained sufficient conditions are more relaxed than the ones in \cite{Zhang2018}, i.e., the new conditions hold if the ones in \cite{Zhang2018} are met.
\item Based on the network model of \cite{Zhang2017}, the proposed problem can be easily tackled. However, their proof technique does not apply to the analysis in our setup due to the introduction of the SINR-based network. In this paper, by inducing a virtual random variable from the definition of the average expected estimation error, we are capable of using an usual stochastic order inequality argument to proceed to the analysis. Then the associated sufficient conditions are derived for the average expected estimation error. When the conditions are not satisfied, we show that the algorithm proposed in \cite{Zhang2018} and \cite{Zhang2017} is feasible for both indexes in our setup.
\item Optimal dynamic attack energy management problems for both indexes of system performance are solved by a Markov decision process (MDP) based algorithm. We further consider the optimal tradeoff problem between attack energy and system degradation, the solution of which can be acquired by the other MDP-based algorithm. And the corresponding solution is found to have a monotone structure, which significantly reduce the computational complexity of the proposed algorithm.
\end{enumerate}
The remainder of the paper is organized as follows: Section II formulates the problem of interest. In section III, we focus on the expected terminal estimation error. We present some sufficient conditions under which the optimal attack power level can be obtained explicitly. Then we prove that our proposed conditions are more relaxed than the existing work. Methods are presented to solve the optimal static attack energy management problem when the sufficient conditions fail to hold. Section IV derives the results for the average expected estimation error. The corresponding sufficient conditions and closed-form attack power level are derived. Corresponding methods are also provided when the sufficient conditions are not met. In section V, we formulate the optimal dynamic attack energy management problem for both indexes and design a MDP-based algorithm to solve it. Section VI considers the tradeoff between attack energy and system degradation. The optimal solution which offers best tradeoff can be obtained by the other MDP-based algorithm and is shown to have a monotone structure. Numerical simulations are provided in section VII to demonstrate the theoretical results. Finally, some concluding remarks appear in section VIII.
\emph{Notations:} $S_+^n$ is the set of $n$ by $n$ positive semi-definite matrices. $X_1\leq X_2$ means $(X_2-X_1)\in S_+^n$, and $X_1>0$ denotes that $X_1$ is positive definite. Denote by $\mathbb{Z}^+$ the set of positive integers. $Pr(\mathcal{A})$ stands for the probability of an event $\mathcal{A}$ and $Pr(\mathcal{A}|\mathcal{B})$ for the conditional probability given an event $\mathcal{B}$. The mean of random variable $X$ is denoted as $\mathbb{E}[X]$, and $\mathbb{E}[X|\mathcal{A}]$ is the conditional expectation of $X$ given an event $\mathcal{A}$. $\textrm{Tr}(\cdot)$ denotes the trace of matrix. The superscript ${'}$ stands for transposition. For function $h$, $h^{k}(X)\triangleq h(h^{k-1}(X))$, with $h^0(X)\triangleq X$.
\section{Problem Setup}\label{sec:system}
The system in Fig. 1 is considered. A linear time-invariant (LTI) process is run by the plant, and the sensor takes the measurement of the state in the plant, as follows.
\begin{align*}
x_{k+1}&=Ax_{k}+w_{k},\\
y_{k}&=Cx_{k}+v_{k},
\end{align*}
where $k\in \mathbb{Z}^+$, $x_{k}, w_{k}\in \mathbb{R}^{n}$ and $y_{k}, v_{k}\in \mathbb{R}^{m}$ are the process state, the process noise that is zero-mean Gaussian noise with covariance $Q\geqslant0$, the measurement taken by the sensor, and the measurement noise that is zero-mean Gaussian noise with covariance $R>0$, respectively, at time $k$. Furthermore, $w_{k}$ and $v_{k}$ are uncorrelated. Assume that the pair $(A,C)$ is detectable and $(A,\sqrt{Q})$ is controllable.
At time $k$, after obtaining the measurement data $y_k$, the sensor with sufficient computation ability runs a Kalman filter which generates the minimum mean squared error (MMSE) estimate $\hat{x}_k^s=\mathbb{E}[x_k|y_1,\ldots,y_k]$, with the corresponding error covariance $P_k^s=\mathbb{E}[(x_k-\hat x_k^s)(x_k-\hat x_k^s)^{'}|y_1,\ldots,y_k]$.
Then the data packet, $\hat{x}_k^s$, is transmitted from the sensor with the power $\delta^s$ to a remote estimator over a wireless network. Consider the state estimation at the remote
estimator within a finite time horizon $T$, with the wireless channel under DoS attacks $\delta\buildrel{\Delta}\over{=}\{\delta_{1},
\delta_{2},\ldots,\delta_{T}\}$, where $\delta_{k}$ is the attack power at time $k$. Let $\lambda_k=1$ if $\delta_{k}>0$, and $\lambda_k=0$ if $\delta_{k}=0$. Assume the same power is employed when jamming the channel, i.e., $\delta_{k}=\delta^a$ if $\lambda_k=1$. Then from \cite{Zhang2015}, the following equality describes the estimation procedure of the state estimate $\hat{x}_{k}$ at the remote estimator:
\begin{align*}
\hat{x}_{k} = \theta_k(\delta)\hat{x}_{k}^s+ (1-\theta_k(\delta))A\hat{x}_{k-1},\,\,\, k=1, 2, \ldots, T,
\end{align*}
where $\theta_k =1$ if the packet arrives at the estimator at time $k$ and $\theta_k =0$, otherwise. The DoS attacker has a limited energy resource, which is formulated as $\sum_{k=1}^{T}\delta_{k}\leq \Delta$.When $\delta$ is given, $\theta_k$'s are assumed to be i.i.d. Bernoulli random variables, and the corresponding probability distribution follows
\begin{align}\label{pk}
\tilde{p}_k(\delta)=Pr(\theta_k =1)= 1-\beta_k,
\end{align}
where $\beta_k$ is the packet dropout probability under the DoS attack with the power $\delta_k$. The packet dropout probability at time $k$ is decided by the SINR of the remote estimator at time $k$ which is defined by \cite{Poisel2011}
\begin{align}\label{sinr}
\rho_k=\frac{\delta^sG^s}{\delta_kG^a+\sigma^2},
\end{align}
where $G^s$ and $G^a$ are the channel gains for the sensor and the attacker respectively and $\sigma^2$ is the noise power.
Assume that the packet is composed with $L$ bits, and the bit error rate for each bit is identical. The packet dropout takes place if there exists one bit that is received mistakenly. Then from \cite{Poisel2011}, there holds
\begin{align}\label{pksinr}
\tilde{p}_k=[1-\mathcal{Q}(\sqrt{2\rho_k})]^L,
\end{align}
where $\mathcal{Q}(x)=1/\sqrt{2\pi}\int_x^{+\infty}
e^{-t^2/2}dt$. And $\beta_k=1-\tilde{p}_k$.
In the Kalman filter, $P_k^s$ will converge exponentially to the steady-state value, $\overline{P}$. Similar to \cite{Li2015b}, assume the Kalman filter is in steady-state, which implies $P_k^s=\overline{P}, k\geq 0$.
Then according to \cite{Zhang2015}, the error covariance $P_{k}$ of $\hat{x}_{k}$ follows:
\begin{align}\label{Pk}
P_{k} = \theta_k\overline{P}+ (1-\theta_k)h(P_{k-1}),\,\,\, k=1, 2, \ldots, T,
\end{align}
where $h(X)\triangleq{AXA^{'}+Q}$. And similar to \cite{Qin2018}, it is assumed throughout the paper that the data packet which contains the information of $\hat{x}_{0}^{s}$ successfully arrives at the remote estimator at time $k=0$, i.e., $P_0=\overline{P}$.
Two types of indexes are adopted to measure the performance of remote estimation in existing works \cite{Li2015b,Zhang2015,Zhang2018,Savage2009,Shi2012}. They are respectively the expected terminal estimation error covariance called \emph{Terminal Error} $J^T=\mathbb{E}[P_T(\delta)]$, and the average expected estimation error covariance called \emph{Average Error} $J^A=\frac1T\sum_{k=1}^T\mathbb{E}[P_k(\delta)].$ The attacker subject to the limited energy budget expects to deteriorate the remote estimation performance as much as possible:
\begin{figure}
\centering
\includegraphics[width=0.47\textwidth]{System2}\\
\caption{System architecture.}
\end{figure}
\emph{Problem 1:}
\begin{eqnarray*}
& & \max_{\delta\in\Theta} \quad \textrm{Tr}[J^e(\delta)] \\
& & s.t. \quad\sum_{k=1}^{T}\delta_{k}\leq \Delta,\\
& & \qquad \,\,\,\,\underline{\delta}\leq \delta^a \leq \overline{\delta},
\end{eqnarray*}
where, $J^e=J^T$ or $J^e=J^A$, $\Theta=\{0,\delta^a\}^T$ is the set of all possible attack power allocations, and $\delta=\{\delta_{1},
\delta_{2},\ldots,\delta_{T}\}$, $\underline{\delta}$ and $\overline{\delta}$ are the
lower bound and upper bound of attack power, respectively.
\section{Optimal Static Attack Energy Management For Terminal Error}
We first work on the terminal error. In this section, the optimal attack energy management for maximizing the trace of the terminal error is presented. The analysis of \emph{Problem 1} for the terminal error in detail is provided.
\subsection{Optimal Attack Schedule For Terminal Error}
When the constant attack power $\delta^a$ is given, the attack times can be computed by $n=\lfloor\Delta/\delta^a\rfloor$. We denote the probability of packet dropout by $\beta$ when $\delta_k=\delta^a$, and $\alpha$ when $\delta_k=0$. Then, for a given $\delta^a$, we need first solve the problem of when to jam the channel:
\emph{Problem 2:}
\begin{eqnarray*}
& & \max_{\lambda\in\Lambda} \quad \textrm{Tr}[J^T(\lambda)] \\
& & s.t. \quad\sum_{k=1}^{T}\lambda_{k}= n,
\end{eqnarray*}
where, $\Lambda=\{0,1\}^T$ is the set of all possible attack schedules, and $\lambda=\{\lambda_{1},
\lambda_{2},\ldots,\lambda_{T}\}$.
From \cite{Qin2018}, the optimal attack schedule for \emph{Problem 2} is given by the following lemma.
\emph{Lemma 1 (\cite{Qin2018}):}
The optimal solution to \emph{Problem 2} is
$$\lambda^*=(0,0,\cdots,0,\underbrace{1,1,\cdots,1}
_{n\,\, {\rm times}}),$$
and the trace of corresponding expected terminal estimation
error is
\begin{align}\label{Jmax}
\textrm{Tr}(J_{max}^T)= &\,\textrm{Tr}\Big[\sum_{i=0}^{n-1}(1-\beta)\beta^{i}h^{i}
(\overline{P})+\alpha^{T-n}\beta^{n}h^{T}
(\overline{P})\nonumber\\
&+\sum_{i=n}^{T-1}(1-\alpha)
\alpha^{i-n}\beta^{n} h^{i}(\overline{P})\Big]
\end{align}
\subsection{Sufficient Conditions}
It is difficult to give a closed-form solution to \emph{Problem 1} for the terminal error if no restriction is imposed on the system parameters. This subsection presents some sufficient conditions under which the closed-form solution can be derived.
When the probability of packet dropout $x$ is given, we can obtain the corresponding attack power $\delta^a(x)$ based on \eqref{pk}--\eqref{pksinr}. Denote $\mathcal{S}_n=\{x|\lfloor\Delta/\delta^a(x)
\rfloor=n\}$ as the set of the
packet dropout probability with the capability of launching $n$ times attacks for the adversary. Before proceeding further, the following two lemmas are needed.
\emph{Lemma 2} (\cite{Zhang2015} ): For function $h$ defined in Section II, the following holds
$$\overline{P}\leq h(\overline{P})\leq h^{2}(\overline{P})\leq\cdots\leq h^{k}(\overline{P})\leq\cdots,\forall k\in {\mathbb{Z}}^{+}.$$
\emph{Lemma 3:} If $\beta_1, \beta_2\in \mathcal{S}_n$, and
$\beta_1>\beta_2$, then the attack strategy in \emph{Lemma 1} is optimal for $\beta_1$ and $\beta_2$. And there holds
\begin{align*}
\textrm{Tr}(J_{max}^T)(\beta_1)>\textrm{Tr}(J_{max}^T)(\beta_2).
\end{align*}
\begin{IEEEproof}
According to \eqref{Jmax}, it follows that
\begin{align}\label{Jmaxn}
J_{max}^T=\overline{P}+\sum_{i=1}^{n}\beta^iH^i+\sum_{i=n+1}^{T}\beta^n\alpha^{i-n}H^i,
\end{align}
where $H^i=h^{i}(\overline{P})-h^{i-1}(\overline{P})$.
From \eqref{Jmaxn} and \emph{Lemma 2}, it is easy to see that
\begin{align*}
\textrm{Tr}(J_{max}^T)(\beta_1)>\textrm{Tr}(J_{max}^T)(\beta_2),
\end{align*}
which completes the proof.
\end{IEEEproof}
Then the following proposition shows the effect of attack times on the system performance measured by the terminal error. Specifically, more attack times lead to larger trace of the terminal error if some conditions are satisfied.
\emph{Proposition 1:} Let $\overline{n}=\lfloor\Delta/\underline{\delta}
\rfloor$ and $\underline{n}=\lfloor\Delta/\overline{\delta}\rfloor$.
Suppose $\theta\in\mathcal{S}_n$ and $\beta\in\mathcal{S}_{n+1}$, where $\underline{n}\leq n\leq \overline{n}-1$.
If the following conditions are met:
\begin{enumerate}
\item $\forall t_1, t_2\in {\mathbb{Z}}^{+}$, and $t_1\leq t_2$, there holds
$\textrm{Tr}(H^{t_1})\leq \textrm{Tr}(H^{t_2}).$
\item the probabilities satisfy
\begin{align*}
\sum_{i=1}^{\overline{n}-1}(\overline{\beta}^i-\underline{\beta}
^i)+(\alpha\overline{\beta}^{\overline{n}-1}-\underline{\beta}
^{\overline{n}})\sum_{i=0}^{T-\overline{n}}\alpha^{i}\leq 0,
\end{align*}
where $\underline{\beta}$ and $\overline{\beta}$ are the lower bound
and upper bound of packet
dropout probability, which are corresponding to the upper bound
and lower bound of the attack power, respectively,
\end{enumerate}
then we have
\begin{align*}
\textrm{Tr}(J_{max}^T)(\theta)\leq \textrm{Tr}(J_{max}^T)(\beta).
\end{align*}
\begin{IEEEproof}
See the Appendix.
\end{IEEEproof}
\subsection{Closed-form Solution}
Now the main conclusion is provided as follows.
\emph{Theorem 1:} Let $\overline{n}=\lfloor\Delta/\underline{\delta}\rfloor$ and $\underline{n}=\lfloor\Delta/\overline{\delta}\rfloor$. If conditions 1) and 2) in \emph{Proposition 1} are satisfied, then the optimal attack power level for the terminal error is
\begin{align}\label{the}
\delta^{a}_*= \left\{ \begin{array}{ll}
\textrm{arg max $\{\delta^{a}|\lfloor\Delta/\delta^{a}\rfloor=\overline{n}\}$} ,& \textrm{for $\underline{n}<\overline{n}$}, \\
\overline{\delta} ,& \textrm{for $\underline{n}=\overline{n}$},
\end{array} \right.
\end{align}
the solution to \emph{Problem 1} for the terminal error is
$$\delta{\ast}=(0,0,\cdots,0,\underbrace{\delta^{a}_*,
\delta^{a}_*,\cdots,\delta^{a}_*}_{\overline{n}\,\, {\rm times}}),$$
and the trace of the corresponding expected terminal error covariance is
\begin{align*}
\textrm{Tr}(J_{max}^T)= &\,Tr\Big[\sum_{i=0}^{\overline{n}-1}(1-\beta_*)\beta^{i}
_*h^{i}(\overline{P})+\alpha^{T-\overline{n}}\beta
^{\overline{n}}_*h^{T}(\overline{P})\nonumber\\
&+\sum_{i=\overline{n}}^{T-1}(1-\alpha)
\alpha^{i-\overline{n}}\beta^{\overline{n}}_* h^{i}(\overline{P})\Big],
\end{align*}
where $\beta_*=1-\tilde{p}_k(\delta^{a}_*)$ is the packet dropout probability corresponding to the optimal DoS attack power.
\begin{IEEEproof}
To maximize the terminal error, due to \emph{Lemma 1} and \emph{Proposition 1}, the attacker will block the channel $\overline{n}$ times. From \emph{Lemma 3}, the attacker will employ the larger power level. Hence, the conclusion in \emph{Theorem 1} holds.
\end{IEEEproof}
From \emph{Theorem 1}, the attacker should adopt the largest power level among the power level set in which any power level leads to most attack times, and then consecutively jam the channel in the end of the considered time horizon to maximize the terminal error when the proposed sufficient conditions are satisfied.
For any given plant, satisfaction of the condition
1) in \emph{Proposition 1} can be checked. However, it is not easy to check for large dimension of the system matrix, which motivates the sufficient condition in the following corollary.
\emph{Corollary 1:} For function $h$ defined in Section II, the condition 1) of \emph{Proposition 1} holds if $\lambda_{min}(A'A)\geq 1$, where $\lambda_{min}(A'A)$ is the minimum eigenvalue of $A'A$.
\begin{IEEEproof}
It suffices to prove the case that $t_2=t_1+1$.
Since
\begin{align}\label{recu}
&h^{t_1+1}(\overline{P})-h^{t_1}(\overline{P})=
Ah^{t_1}(\overline{P})A'-Ah^{t_1-1}(\overline{P})A'\nonumber\\
=&A[h^{t_1}(\overline{P})-h^{t_1-1}(\overline{P})]A',
\end{align}
based on the facts that $\textrm{Tr}(ABC)=\textrm{Tr}(CAB)$ and $\textrm{Tr}(A+B)=\textrm{Tr}(A)+\textrm{Tr}(B)$, there holds
\begin{align}\label{dif}
&\textrm{Tr}\{h^{t_1+1}(\overline{P})-h^{t_1}(\overline{P})\}-
\textrm{Tr}\{h^{t_1}(\overline{P})-h^{t_1-1}(\overline{P})\}\nonumber\\
=&\textrm{Tr}\{A'A[h^{t_1}(\overline{P})-h^{t_1-1}(\overline{P})]\}-
\textrm{Tr}\{h^{t_1}(\overline{P})-h^{t_1-1}(\overline{P})\}\nonumber\\
=&\textrm{Tr}\{(A'A-I)[h^{t_1}(\overline{P})-h^{t_1-1}(\overline{P})]\}.
\end{align}
Since $\lambda_{min}(A'A)\geq 1$, we have $A'A-I \in S_+^n$, which causes, from \emph{Lemma 1}, that
\begin{align*}
&\textrm{Tr}\{h^{t_1+1}(\overline{P})-h^{t_1}(\overline{P})\}-
\textrm{Tr}\{h^{t_1}(\overline{P})-h^{t_1-1}(\overline{P})\}\geq 0.
\end{align*}
The proof is completed.
\end{IEEEproof}
Note that \emph{Corollary 1} provides a sufficient condition under which the condition 1) of \emph{Proposition 1} holds, i.e., the condition 1) of \emph{Proposition 1} may hold even if $\lambda_{min}(A'A)<1$. This is illustrated by the following example.
\emph{Example 1:} $A=\begin{bmatrix} 1.2 & 0.1 \\ 0 & 1 \end{bmatrix}$, $C=\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}$, $Q=\begin{bmatrix} 1 & 0 \\ 0 & 2 \end{bmatrix}$, $R=0.5C$. The eigenvalues of $A'A$ are $0.9788$ and $1.4712$. Hence we have $\lambda_{min}(A'A)<1$. We can run a Kalman filter to obtain the steady-state error covariance $\overline{P}$, and compute the difference
\begin{align}\label{dif2}
h(\overline{P})-\overline{P}=\begin{bmatrix} 1.1709 & 0.0418\\
0.0418 & 2.0000 \end{bmatrix}.
\end{align}
Similar to \eqref{recu}, there holds
\begin{align}\label{recu2}
h^{t_1}(\overline{P})-h^{t_1-1}(\overline{P})
=A^{t_1-1}[h(\overline{P})-\overline{P}](A^{t_1-1})'.
\end{align}
It is easy to verify that each element of the matrix $A'A-I$ is greater than $0$, which leads to, from \eqref{dif}--\eqref{recu2},
\begin{align*}
&\textrm{Tr}\{h^{t_1+1}(\overline{P})-h^{t_1}(\overline{P})\}-
\textrm{Tr}\{h^{t_1}(\overline{P})-h^{t_1-1}(\overline{P})\}\nonumber\\
=&\,\textrm{Tr}\{(A^{t_1-1})'(A'A-I)A^{t_1-1}[h(\overline{P})-\overline{P}]\}
\geq 0.
\end{align*}
\subsection{Comparison with Existing Results}
In this subsection, \emph{Theorem 1} is compared with the existing results in \cite{Zhang2018}.
\emph{Definition 1 (Normal matrix \cite{Horn2012}):} A square matrix $A$ is normal if $A^*A=AA^*$, where $A^*$ is the conjugate transpose of $A$.
\emph{Lemma 4 (\cite{Zhang2018}):} When $\alpha=0$, the optimal attack power level for the terminal error is \eqref{the} if the following conditions are satisfied:
\begin{enumerate}
\item matrix $A$ is normal,
\item all the eigenvalues of the matrix $A'A$, $\lambda(A'A)$, satisfy\footnote{There is a typo in \cite{Zhang2018}.}
\begin{align}\label{cond}
1<\lambda(A'A)<\frac1{\overline{\beta}}[1-(\frac{\overline{\beta}
-\underline{\beta}}{\underline{\beta}^{\overline{n}+1}})^{1/2}]
.
\end{align}
\end{enumerate}
Next we show that the conditions in \emph{Proposition 1} are more relaxed than the ones in \emph{Lemma 4}.
We have $\lambda(A'A)>1$, if \eqref{cond} holds. Then from \emph{Corollary 1}, it is easy to see that, the condition 1) of \emph{Proposition 1} is true if the condition 2) of \emph{Lemma 4} holds.
When $\alpha=0$, the condition 2) in \emph{Proposition 1} turns into
\begin{align}\label{condus}
\sum_{i=1}^{\overline{n}-1}(\overline{\beta}^i-\underline{\beta}
^i)-\underline{\beta}^{\overline{n}}\leq 0.
\end{align}
Since
\begin{align*}
\overline{\beta}^i-\underline{\beta}^i=(\overline{\beta}
-\underline{\beta})\sum_{k=0}^{i-1}\overline{\beta}^{i-k-1}
\underline{\beta}^k
\leq(\overline{\beta}-\underline{\beta})i\overline{\beta}^{i-1},
\end{align*}
there holds
\begin{align}\label{ine}
&\sum_{i=1}^{\overline{n}-1}(\overline{\beta}^i-\underline{\beta}
^i)-\underline{\beta}^{\overline{n}}\leq(\overline{\beta}
-\underline{\beta})\sum_{i=1}^{\overline{n}-1}i\overline{\beta}
^{i-1}\nonumber\\
=&(\overline{\beta}-\underline{\beta})
[\frac{1-\overline{\beta}^{\overline{n}-1}}{(1-\overline{\beta})
^2}-\frac{(\overline{n}-1)\overline{\beta}^{\overline{n}-1}}
{1-\overline{\beta}}]-\underline{\beta}^{\overline{n}},
\end{align}
If \eqref{cond} is met, it follows that
\begin{align*}
1<\frac1{\overline{\beta}}[1-(\frac{\overline{\beta}
-\underline{\beta}}{\underline{\beta}^{\overline{n}+1}})^{1/2}],
\end{align*}
which amounts to
\begin{align*}
\frac{1}{(1-\overline{\beta})^2}<\frac{\underline{\beta}
^{\overline{n}+1}}{\overline{\beta}-\underline{\beta}}.
\end{align*}
Then in light of the above inequality, the last term in \eqref{ine} is smaller than
\begin{align*}
\underline{\beta}^{\overline{n}+1}-\underline{\beta}^{\overline{n}
}-\underline{\beta}^{\overline{n}+1}\overline{\beta}^{\overline{n}
-1}-\frac{(\overline{n}-1)\overline{\beta}^{\overline{n}-1}
(\overline{\beta}-\underline{\beta})}{1-\overline{\beta}}\leq 0,
\end{align*}
which leads to, due to \eqref{ine}, the inequality \eqref{condus}.
Therefore, the condition 2) in \emph{Proposition 1} is satisfied if the condition 2) in \emph{Lemma 4} holds.
\emph{Remark 1:} To summarize, the conditions in \emph{Proposition 1} hold if the conditions in \emph{Lemma 4} are satisfied, which means that the conditions in \emph{Proposition 1} are more relaxed. Besides, from the derivation above, just two inequalities, $\lambda(A'A)>1$ and $\frac1{\overline{\beta}}[1-(\frac{\overline{\beta}
-\underline{\beta}}{\underline{\beta}^{\overline{n}+1}})^{1/2}]>1$, are employed. Hence, compared with \cite{Zhang2018}, to obtain the closed-form solution, it is no longer required that the system matrix $A$ is normal, and no upper bound is imposed on $\lambda(A'A)$, which largely improves the applicability.
\subsection{Exhaustion Search Method}
When the conditions in \emph{Proposition 1} are not met, \eqref{the} may not be the optimal one. But from \emph{Lemma 3}, we can transform \emph{Problem 1} for the terminal error into an equivalent problem:
\emph{Problem 3:}
\begin{eqnarray*}
& & \max \quad\textrm{Tr}[J_{max}^T(\delta)] \\
& & s.t. \quad (\delta^a,M)\in \Omega,
\end{eqnarray*}
where, $\delta=(0,0,\cdots,0,\underbrace{\delta^{a},
\delta^{a},\cdots,\delta^{a}}_{M\,\, {\rm times}})$, $\Omega=\Big\{(f(n),n), n=\underline{n},\underline{n}+1,\cdots,\overline{n}\Big\}$, and $f(n)=\textrm{arg max}\{x|\lfloor\Delta/x\rfloor=n,\underline{\delta}\leq x\leq \overline{\delta}\}$.
It is easy to see that the solution space of \emph{Problem 3} is discrete. For a given $(\delta^a,M)\in \Omega$, we can compute the corresponding $\alpha$ and $\beta$ based on \eqref{pk}--\eqref{pksinr}. Then $\textrm{Tr}[J_{max}^T(\delta)]$ can be acquired from \eqref{Jmax}. Finally, an exhaustion search method can be adopted to solve \emph{Problem 3}. Note that, from the constraint set $\Omega$, no more than $T$ steps are required to obtain the solution, which implies that this method is feasible.
\section{Optimal Static Attack Energy Management For Average Error}
In this section, we focus on the other important system index, the average error. The optimal attack energy management for maximizing the trace of the average error is presented. We also provide the detailed analysis of \emph{Problem 1} for the average error.
\subsection{Optimal Attack Schedule For Average Error}
The scenario for the average error is far more complicated than the one for the terminal error. To facilitate the subsequent analysis, we first introduce the representation of the attack schedule. An attack schedule, in which $n$ attacks are launched over a finite horizon $T$, can be denoted by
\begin{align*}
(\gamma^{d},\lambda^{k_1},\gamma^{d_1},\lambda^{k_2},\ldots,
\lambda^{k_{s}},\gamma^{d_s}),
\end{align*}
where $s\geq 1$, $\lambda^{k_i}$ is the $i$th consecutive jamming sequence with the length $k_i\geq1$, $i=1,\ldots,s$, $\gamma^{d}$ and $\gamma^{d_j}$, respectively, denote the first and the $(j+1)$th consecutive sequence during which no attack is launched with the length $d_j\geq1$, $j=1,\ldots,s-1$, $d\geq0$ and $d_s\geq0$, i.e.,
$$(\underbrace{0, \ldots, 0}_{d \,{\rm times}}, \underbrace{1,\ldots,1}_{k_{1}\,{\rm times}},0, \ldots, 0, \underbrace{1,\ldots,1}_{k_{s}\,{\rm times}},\underbrace{0, \ldots,0}_{d_{s}\,{\rm times}}),$$
where $\sum_{i=1}^{s}k_i= n$, and $d+\sum_{j=1}^{s}d_j= T-n$.
Similar to Section III, we first solve the following problem:
\emph{Problem 4:}
\begin{eqnarray*}
& & \max_{\lambda\in\Lambda} \quad \textrm{Tr}[J^A(\lambda)] \\
& & s.t. \quad\sum_{k=1}^{T}\lambda_{k}= n,
\end{eqnarray*}
where, $\Lambda=\{0,1\}^T$ is the set of all possible attack schedules, and $\lambda=\{\lambda_{1},
\lambda_{2},\ldots,\lambda_{T}\}$.
From \cite{Qin2018}, the optimal attack schedule for \emph{Problem 4} is given by the following lemma.
\emph{Lemma 5 (\cite{Qin2018}):}
The solution to \emph{Problem 4} is $\lambda_{\ast}=(\gamma^{m},\lambda^{n},\gamma^{s})$, i.e.,
$$\lambda_{\ast}=(\underbrace{0,0,\ldots,0}_{m\, {\rm times}},\underbrace{1,1,\ldots,1}_{n\, {\rm times}},\underbrace{0,0,\ldots,0}_{s\, {\rm times}}),$$
where $m+s=T-n$, and $\vert{m-s}\vert\leq1$, i.e., $m=s$ or $\vert{m-s}\vert=1$. And $J^A[(\gamma^{m},\lambda^{n},\gamma^{s})]
=J^A[(\gamma^{s},\lambda^{n},\gamma^{m})]$. Denote by $p_{i,k}$ the probability that $P_k=h^{i}(\overline{P})$, $i=0,1,\ldots,T$. Then the corresponding average expected estimation error can be calculated based on the expression $$J_{max}^A=\frac1T\sum_{k=1}^T\sum_{i=0}^{T}p_{i,k}(\lambda_{\ast})h^{i}(\overline{P}).$$
To obtain $p_{i,k}$, from \eqref{Pk} and the assumption that $\hat{x}_{0}^{s}$ arrives, it follows that $p_{i,k}=0$ when $k<i$. When $k\geq i$, $P_k=h^{i}(\overline{P})$ if and only if $\hat{x}_{k-i}^{s}$ arrives, and meanwhile $\hat{x}_{k-i+1}^{s}, \hat{x}_{k-i+2}^{s}, \ldots, \hat{x}_{k}^{s}$ drop. Note that $\theta_k$'s are independent.
Hence, $p_{i,k}=\tilde{p}_{k-i}
\tilde{q}_{k-i+1}\tilde{q}_{k-i+2}\cdots\tilde{q}_k$ when $k\geq i$, where $\tilde{q}_k=1-\tilde{p}_k$ is the corresponding dropout probability of packets. And there holds $\tilde{p}_0= 1$ due to the assumption that $\hat{x}_{0}^{s}$ arrives.
In \cite{Zhang2017}, $J_A(\lambda)$ has a simple and tractable expression because of the assumption that the packet dropout probability without attack is $\alpha=0$. In our setup, however, the corresponding analysis is more difficult since $\alpha >0$. Hence, we need a different analysis approach from the one in \cite{Zhang2017} to tackle \emph{Problem 1} for the average error, as will be presented in the next subsection.
\subsection{Sufficient Conditions}
For ease of illustration, we rewrite the optimal attack schedule in \emph{Lemma 5} as $\phi^1=(\gamma^{m},\lambda^{n},\gamma^{s})$, and let $\phi^2=(\gamma^{m},\lambda^{n+1},\gamma^{s-1})$. To guarantee that $\phi^2$ is the optimal attack schedule for the average error under $n+1$ attacks, let $m=s$ or $m=s-1$.
We aim to compare the effects of two kinds of attack schedules $\phi^1$ and $\phi^2$ on the system performance, which help us have an insight of the effect of attack times. To do this, we have, from \emph{Lemma 5},
\begin{align}\label{JAD}
J_{max}^A(\phi^1)-J^A_{max}(\phi^2)=\frac1T\sum_{i=0}^{T}h^{i}(\overline{P})F_i,
\end{align}
where $F_i=\sum_{k=1}^T[p_{i,k}(\phi^1)-p_{i,k}(\phi^2)]$.
Observing the above equation, two random variables can be induced from \eqref{JAD}. First, note that $\{\frac1T\sum_{k=1}^Tp_{i,k}, i=0,1,\ldots,T\}$ is a probability distribution associated with some random variable since $0\leq \frac1T\sum_{k=1}^Tp_{i,k}\leq 1, i=0,1,\ldots,T$ and $\sum_{i=0}^{T}\frac1T\sum_{k=1}^Tp_{i,k}=1$. Then we can obtain two induced random variables $X$ with probability distribution $Pr(X=\textrm{Tr}[h^{i}(\overline{P})])=\frac1T\sum_{k=1}^Tp_{i,k}(\phi^1), i=0,1,\ldots,T$ and $Y$ with probability distribution $Pr(Y=\textrm{Tr}[h^{i}(\overline{P})])=\frac1T\sum_{k=1}^Tp_{i,k}(\phi^2), i=0,1,\ldots,T$. And we readily have $\mathbb{E}[X]=\textrm{Tr}(J_{max}^A)(\phi^1)$ and $\mathbb{E}[Y]=\textrm{Tr}(J_{max}^A)(\phi^2)$.
Before proceeding further, we present the following definition and lemma.
\emph{Definition 2 (\cite{Shaked2007} ):} Let $X^1$ and $X^2$ be two random variables. $X^1$ is said to be smaller than $X^2$ in the usual stochastic order (denoted by $X^1\leq_{\textrm{st}} X^2$) if $Pr(X^1\leq x)\geq Pr(X^2\leq x)$ for all $x\in(-\infty, \infty)$.
\emph{Lemma 6 (Usual Stochastic Order Inequality \cite{Shaked2007} ):} If $X^1\leq_{\textrm{st}} X^2$, then $\mathbb{E}[X^1]\leq\mathbb{E}[X^2]$.
Combining \emph{Lemma 2}, we can see that $Pr(X\leq x)=0$ for $x<\textrm{Tr}[\overline{P}]$, $Pr(X\leq x)=\sum_{j=0}^i\frac1T\sum_{k=1}^Tp_{j,k}(\phi^1)$ for $\textrm{Tr}[h^{i}(\overline{P})]\leq x<\textrm{Tr}[h^{i+1}(\overline{P})], i=0,1,\ldots,T-1$, and $Pr(X\leq x)=1$ for $x\geq \textrm{Tr}[h^{T}(\overline{P})]$, to which $Pr(Y\leq x)$ has the similar structure. From \emph{Lemma 6}, the sign judgement of equation \eqref{JAD} can be recast as the check of whether there exists the relationship in \emph{Definition 2} between the induced random variables $X$ and $Y$. Based on the above analysis, we focus on the term $V_i=\sum_{j=0}^iF_j$, for $i=0,\ldots,T-1$ in the sequel, where $F_j=\sum_{k=1}^T[p_{j,k}(\phi^1)-p_{j,k}(\phi^2)]$.
Suppose $\theta\in\mathcal{S}_n$ and $\beta\in\mathcal{S}_{n+1}$. Note that there are $n$ times attacks in $\phi^1$ and $n+1$ times attacks in $\phi^2$. Hence, the packet dropout probability in the presence of attack is $\theta$ under $\phi^1$ and $\beta$ under $\phi^2$. And thereby, $V_i$ refers to $V_i(m,n,s,\theta,\beta)$. How to calculate $V_i$ is shown in the following lemma.
\emph{Lemma 7:} For simplicity, we write $V_i(m,n,s,\theta,\beta)$ as $V_i$ in this lemma. Let $N=n+s$ and $s< n$. There holds
\begin{align}\label{HI1}
V_i=&\,\,(n-i+1)\beta^{i+1}-(n-i)\theta^{i+1}-\alpha^{i+1}\nonumber\\
&+2\sum_{j=1}^i\alpha^j(\beta^{i-j+1}-\theta^{i-j+1}),
\end{align}
for $i= 0, \ldots, s-1$, and
\begin{align}\label{HI2}
V_i=(T-i)(\alpha^{i-n}\beta^{n+1}-\alpha^{i-n+1}\theta^n),
\end{align}
for $i= N, \ldots, T-1$.
When $m=s$, $V_i$ is given by
\begin{align}\label{HI3}
V_i=&\,\,(n-i+1)\beta^{i+1}-(n-i)\theta^{i+1}+\alpha^s\beta^{i-s+1}\nonumber\\
&-2\alpha^s\theta^{i-s+1}+2\sum_{j=1}^{s-1}\alpha^j(\beta^{i-j+1}-\theta^{i-j+1}),
\end{align}
for $i= s, \ldots, n$, and
\begin{align}\label{HI4}
V_i=&\,\,\alpha^s\beta^{i-s+1}-2\alpha^s\theta^{i-s+1}\nonumber\\
&+2\sum_{j=i-n+1}^{s-1}\alpha^j
(\beta^{i-j+1}-\theta^{i-j+1})\nonumber\\
&+(i-n+1)\alpha^{i-n}\beta^{n+1}-(i-n)\alpha^{i-n+1}\theta^n,
\end{align}
for $i= n+1, \ldots, N-1$.
When $m=s-1$, $V_i$ takes the form of
\begin{align}\label{HI5}
V_i=&\,\,(n-i+1)\beta^{i+1}-(n-i)\theta^{i+1}-\alpha^s\theta^{i+1-s}\nonumber\\
&+2\sum_{j=1}^{s-1}\alpha^j(\beta^{i-j+1}-\theta^{i-j+1}),
\end{align}
for $i= s, \ldots, n$, and
\begin{align}\label{HI6}
V_i=&\,\,-\alpha^s\theta^{i-s+1}+2\sum_{j=i-n+1}^{s-1}\alpha^j
(\beta^{i-j+1}-\theta^{i-j+1})\nonumber\\
&+(i-n+1)\alpha^{i-n}\beta^{n+1}-(i-n)\alpha^{i-n+1}\theta^n,
\end{align}
for $i= n+1, \ldots, N-1$.
\begin{IEEEproof}
See the Appendix.
\end{IEEEproof}
Next we present some results on the sign of $V_i$.
\emph{Lemma 8:} Let $\overline{n}=\lfloor\Delta/\underline{\delta}\rfloor$ and $\underline{n}=\lfloor\Delta/\overline{\delta}\rfloor$.
For any attack times $n$ with $\underline{n}\leq n\leq\overline{n}-1$, we have $V_i\geq 0$, for $i=0,\ldots,T-1$, if the following conditions are satisfied:
\begin{enumerate}
\item $2\alpha\overline{\beta}^{\overline{n}-1}-\underline{\beta}^{\overline{n}}\leq 0$,
\item $V_i(m,n,s,\overline{\beta},\underline{\beta})\geq0$, for $i=0,\ldots,T-1$, $n=\overline{n}-1$, and $n=\underline{n}$, where $\alpha$, $\overline{\beta}$ and $\underline{\beta}$ are the same with \emph{Proposition 1}, $m+s=T-n$, and $m=s$ or $m=s-1$.
\end{enumerate}
\begin{IEEEproof}
See the Appendix.
\end{IEEEproof}
\emph{Remark 2:} \emph{Lemma 7} presents the expression of $V_i$ for $s<n$ which matters in the proof of \emph{Lemma 8}. As shown in the end of the proof of \emph{Lemma 8}, the case when $s\geq n$ is totally similar and is omitted for brevity. And note that it is beneficial for the proof of \emph{Lemma 8} but inconvenient for the verification of the conditions of \emph{Lemma 8} to employ the expression of $V_i$. It is easier to adopt numerical methods to compute $V_i$ based on its definition $V_i=\sum_{j=0}^iF_j$ when verifying the proposed sufficient conditions.
Then similar to \emph{Proposition 1}, we present the following proposition to show the effect of attack times on the remote estimation performance measured by the average error.
\emph{Proposition 2:} Let $\overline{n}=\lfloor\Delta/\underline{\delta}
\rfloor$.
Suppose $\theta\in\mathcal{S}_n$ and $\beta\in\mathcal{S}_{n+1}$, where $\underline{n}\leq n\leq\overline{n}-1$.
If the conditions in \emph{Lemma 8} are met, then we have
\begin{align*}
\textrm{Tr}(J_{max}^A)(\theta)\leq \textrm{Tr}(J_{max}^A)(\beta).
\end{align*}
\begin{IEEEproof}
We have $Pr(X\leq x)\geq Pr(Y\leq x)$ for all $x\in(-\infty, \infty)$ since $V_i\geq 0$, for $i=0,\ldots,T-1$. And thereby there holds $X\leq_{\textrm{st}} Y$, which leads to, due to \eqref{JAD} and \emph{Lemma 6}, $\textrm{Tr}(J_{max}^A)(\theta)\leq \textrm{Tr}(J_{max}^A)(\beta)$. The proof is completed.
\end{IEEEproof}
\subsection{Closed-form Solution}
The following lemma is needed before presenting the main result.
\emph{Lemma 9:} If $\beta_1, \beta_2\in \mathcal{S}_n$, and
$\beta_1>\beta_2$, then the attack strategy in \emph{Lemma 5} is optimal for $\beta_1$ and $\beta_2$. And there holds
\begin{align*}
\textrm{Tr}(J_{max}^A)(\beta_1)>\textrm{Tr}(J_{max}^A)(\beta_2).
\end{align*}
\begin{IEEEproof}
A direct result from \emph{Lemma 5}.
\end{IEEEproof}
Now the main conclusion is provided as follows.
\emph{Theorem 2:} Let $\overline{n}=\lfloor\Delta/\underline{\delta}\rfloor$ and $\underline{n}=\lfloor\Delta/\overline{\delta}\rfloor$. If conditions 1) and 2) in \emph{Lemma 8} are satisfied, then the optimal attack power level for the average error is
\begin{align}\label{the2}
\delta^{a}_*= \left\{ \begin{array}{ll}
\textrm{arg max $\{\delta^{a}|\lfloor\Delta/\delta^{a}\rfloor=\overline{n}\}$} ,& \textrm{for $\underline{n}<\overline{n}$}, \\
\overline{\delta} ,& \textrm{for $\underline{n}=\overline{n}$},
\end{array} \right.
\end{align}
the solution to \emph{Problem 1} for the average error is
$$\delta_{\ast}=(\underbrace{0,0,\ldots,0}_{m\, {\rm times}},\underbrace{\delta^{a}_*,\delta^{a}_*,\ldots,\delta^{a}_*}_{\overline{n}\, {\rm times}},\underbrace{0,0,\ldots,0}_{s\, {\rm times}}),$$
where $m+s=T-\overline{n}$, and $\vert{m-s}\vert\leq1$, i.e., $m=s$ or $\vert{m-s}\vert=1$, and the corresponding average expected estimation error can be calculated based on \emph{Lemma 5}.
\begin{IEEEproof}
To maximize the average error, in light of \emph{Lemma 5} and \emph{Proposition 2}, the attacker will block the channel $\overline{n}$ times. From \emph{Lemma 9}, the attacker will employ the larger power level. Hence, the conclusion in \emph{Theorem 2} holds.
\end{IEEEproof}
To maximize the average error, from \emph{Theorem 2}, the attacker should adopt the same action with the one for the terminal error except that the attacker should consecutively jam the channel in the middle of the considered time horizon when the proposed sufficient conditions hold.
\subsection{Exhaustion Search Method}
When the conditions in \emph{Lemma 8} are not met, \eqref{the2} may not be the optimal one. Similar to the scenario for the terminal error, from \emph{Lemma 9}, we can transform \emph{Problem 1} for the average error into an equivalent problem:
\emph{Problem 5:}
\begin{eqnarray*}
& & \max \quad \textrm{Tr}[J_{max}^A(\delta)] \\
& & s.t. \quad (\delta^a,M)\in \Omega,
\end{eqnarray*}
where, $\delta=(\underbrace{0,0,\ldots,0}_{m\, {\rm times}},\underbrace{\delta^{a},\delta^{a},\ldots,\delta^{a}}_{\overline{n}\, {\rm times}},\underbrace{0,0,\ldots,0}_{s\, {\rm times}})$, $m+s=T-\overline{n}$, $\vert{m-s}\vert\leq1$, i.e., $m=s$ or $\vert{m-s}\vert=1$, $\Omega=\Big\{(f(n),n), n=\underline{n},\underline{n}+1,\cdots,\overline{n}\Big\}$, and $f(n)=\textrm{arg max}\{x|\lfloor\Delta/x\rfloor=n,\underline{\delta}\leq x\leq \overline{\delta}\}$.
Similarly, an exhaustion search method can be adopted to solve \emph{Problem 5}, with no more than $T$ steps required to obtain the solution.
\section{Optimal Dynamic Attack Energy Management}
The case when the attacker jams the channel with the constant energy is discussed in the previous sections. In this section we assume that the adversary has the capabilities of intercepting the real-time ACK information which indicates the arrival of packets or not, and dynamically adjusting the jamming energy based on the ACK signal. Then the optimal dynamic attack energy management problem arises.
More specifically, different from the static case where the attack strategy is limited to the set $\Theta=\{0,\delta^a\}^T$, here the attack power $\delta_k$ is dependent on the error $P_{k-1}$ and the available power $E_k$, i.e., the adversary has the attack policy $\delta=\{\delta_{1}, \delta_{2},\ldots,\delta_{T}\}$ with $\delta_k=\delta_k(P_{k-1},E_k)$. And similar to \cite{Shi2012,Peng2017,Zhang2018}, assume that the attacker has the discrete set of available power level $\Phi=\{0,\underline{\delta},e_1,e_2,\ldots,e_n,\overline{\delta}\}$ with $n$ finite and $0<\underline{\delta}<e_1<\cdots<e_n<\overline{\delta}$. Then the optimal dynamic attack energy management problem is formulated as follows.
\emph{Problem 6:}
\begin{eqnarray*}
& & \max_{\delta} \quad \textrm{Tr}[J^e(\delta)] \\
& & s.t. \quad\sum_{k=1}^{T}\delta_{k}\leq \Delta,\\
& & \qquad \,\,\,\delta_k\in\Phi.
\end{eqnarray*}
To solve \emph{Problem 6}, we formulate it as a finite Markov decision problem based on the Markov decision process (MDP) $\{T+1,\mathbb{S}, \mathbb{A}, Pr(\cdot|\cdot,\cdot),r_k(\cdot,\cdot)\}$ with the initial state $s_1=(\overline{P},\Delta)$. More specifically, $T+1$ is the considered time horizon.\footnote{We consider $T+1$ instead of $T$ since the error $P_T$ and the available power level $E_{T+1}$ at time $T+1$, i.e., the state $s_{T+1}$, is obtained after the decision is made at time $T$. But no decision is made at time $T+1$ and the process ceases.} The state space is defined as $\mathbb{S}=S_P\times S_E$, where $S_P=\{\overline{P},h(\overline{P}),h^{2}(\overline{P}),\ldots\}$ is a countable set associated with the estimation error covariance and $S_E=\{E^1,E^2,\ldots,E^r\}$ is the set of all the possible available power level at each time instant. And the state at time $k$ is defined as $s_k=(P_{k-1},E_k)\in \mathbb{S}$. The iteration processes of $P_k$ and $E_k$ are \eqref{Pk} and $E_k=E_{k-1}-\delta_{k-1}$, respectively.
Then we define the action space as $\mathbb{A}=\Phi$. For a given state $s=(h^{i}(\overline{P}),E^j)$, the set of allowable actions in state $s$ is $\mathbb{A}_s=\Phi\bigcap [0,E^j]$, and thereby, at time $k$, the attacker can choose an action $a_k$ from $\mathbb{A}_{s_k}$ for $k=1,\ldots,T$.
We further present the probability $Pr(s_{k+1}|s_k,a_k)$ that the state changes from $s_k=(h^{i}(\overline{P}),E^j)$ to $s_{k+1}$ with action $a_k$ taken at time $k$ for $k=1,\ldots,T$. From the iteration process of $s_k$, we have
\begin{align}\label{Prt}
&Pr(s_{k+1}|s_k,a_k)\nonumber\\
&= \left\{ \begin{array}{ll}
\beta_k,& \textrm{if}\, s_{k+1}=(h^{i+1}(\overline{P}),E^j-a_k),\\
1-\beta_k,& \textrm{if}\, s_{k+1}=(\overline{P},E^j-a_k),\\
0 ,& \textrm{otherwise},
\end{array} \right.
\end{align}
where $i=0,1,2,\ldots$, $j=1,\ldots,r$ and the dropout probability $\beta_k$ can be obtained from \eqref{pk}--\eqref{pksinr}.
The one-stage reward function at time $k$ is defined as $r_k(s_k,a_k)$ for $k=1,\ldots,T+1$. Note that $r_{T+1}=r_{T+1}(s_{T+1})=0$ since no decision is made at time $T+1$ and thereby no reward is provided. And except the first time instant $k=1$, $r_k$ is random due to the randomness of $s_k$. The explicit expression of $r_k$ will be presented in the sequel.
\begin{algorithm}
\caption{Backward Induction Algorithm}
\label{algorithm1}
\KwIn{$T;\mathbb{S}^k;\mathbb{A}_s;Pr;r_k;s_1=(\overline{P},\Delta)$}
\KwOut{Maximum total reward $R_{T+1}^{\delta^*}(s_1)=u_{1}^*(s_1)$;
Optimal deterministic Markovian policy $\delta^*=\{\delta_{1}^*, \delta_{2}^*,\ldots,\delta_{T}^*\}$}
Set $k=T+1$ and $u_{T+1}^*(s)=r_{T+1}(s)$ for all $s\in\mathbb{S}^k$.\\
\While {$k>1$}
{
Let $k=k-1$ and compute $u_{k}^*(s)$ for each $s\in\mathbb{S}^k$ by
$$u_{k}^*(s)=\max_{a\in\mathbb{A}_s}\Big\{r_k(s,a)+\sum_{j\in\mathbb{S}^k}Pr(j|s,a)u_{k+1}^*(j)\Big\}.$$
Set for each $s\in\mathbb{S}^k$
$$\mathbb{A}_{s,k}^*=\mathop{\argmax}_{a\in\mathbb{A}_s}\Big\{r_k(s,a)+\sum_{j\in\mathbb{S}^k}Pr(j|s,a)u_{k+1}^*(j)
\Big\}.$$
Let $\delta_k^*(s)\in \mathbb{A}_{s,k}^*$ for each $s\in\mathbb{S}^k$.
}
\end{algorithm}
The attack policy $\delta=\{\delta_{1}, \delta_{2},\ldots,\delta_{T}\}$ with $\delta_k=\delta_k(P_{k-1},E_k)$ is a deterministic Markovian policy for the above MDP\cite{Puterman2005}. The usual optimality criteria\cite{Puterman2005} for the above finite MDP with the initial state $s_1$ and the adopted policy $\delta$ is the expected total reward over the time horizon $T+1$ which is defined by
$$R_{T+1}^\delta(s_1)=\mathbb{E}_{s_1}^\delta\Big[\sum_{k=1}^Tr_k(s_k,a_k)+r_{T+1}(s_{T+1})\Big].$$
Based on $R_{T+1}^\delta(s_1)$, we can obtain the terminal error $J^T$ by defining $r_k(\cdot,\cdot)$ as $r_k(s,a)=0$ for $k=1,\ldots,T-1$ and $r_k(s,a)=\textrm{Tr}(\mathbb{E}[P_T])$ for $k=T$, and $T\cdot J^A$ by defining $r_k(s,a)=\textrm{Tr}(\mathbb{E}[P_k])$ for $k=1,\ldots,T$ when the sample of $s_k$ is $s$ and the sample of $a_k$ is $a$, where $\mathbb{E}[P_k]=(1-\beta_k(a))\overline{P}+\beta_k(a)h(P_{k-1}(s))$.
For a given sample of $s_t$, $s$, define $u_t^\delta$ for $t<T+1$ by
$$u_t^\delta(s)=\mathbb{E}_{s}^\delta\Big[\sum_{k=t}^Tr_k(s_k,a_k)+r_{T+1}(s_{T+1})\Big],$$
from which it is easy to see that $R_{T+1}^\delta(s)=u_1^\delta(s)$, and let $u_{T+1}^\delta(s)=r_{T+1}(s)$. Further let $\mathbb{S}^k=S_P^k\times S_E$, where $S_P^k=\{\overline{P},h(\overline{P}),\ldots,h^{k}(\overline{P})\}$.
Then according to \cite{Puterman2005}, \emph{Problem 6} for both indexes can be solved by the backward induction algorithm (Algorithm 1) respectively through inputting the corresponding $r_k$.
Note that in Algorithm 1, $\mathbb{S}^k$ is used instead of $\mathbb{S}$. This is from the fact that $S_P^k$ includes all the possible value of $P_k$ due to \eqref{Pk} and the given initial state $s_1=(\overline{P},\Delta)$, and thereby there is no need to compute all $s\in \mathbb{S}$.
And we can see from Algorithm 1 that $\delta^*$ may be not unique which occurs if $\mathbb{A}_{s,k}^*$ contains more than one action for some $s$ and $k$. We just need to retain a single action from $\mathbb{A}_{s,k}^*$ at this time to acquire a particular optimal policy.
\section{Optimal Tradeoff Between Attack Energy Consumption and System Degradation}
The case when the attacker has the fixed total energy constraint $\Delta$ is discussed in the previous sections. It is well-known that more attack energy used leads to more system degradation but more energy consumption. The attacker may desire a tradeoff between energy expense and system degradation by decreasing the employed attack energy at the cost of weakening the attack effect. Then one question arises that how much energy the attacker should decrease to achieve the optimal tradeoff? To answer this question, here we propose the modified Markov decision problem based on Section V. The modified parts are presented as follows.
With no total energy restriction imposed, the state space in this section is defined as $\mathbb{\tilde{S}}=S_P$ and the state at time $k$ as $\tilde{s}_k=P_{k-1}\in \mathbb{\tilde{S}}$. The action space is still $\mathbb{\tilde{A}}=\Phi$ but for any given state $s$, the attacker can choose an action $a$ from $\mathbb{\tilde{A}}_s=\mathbb{\tilde{A}}$. And the one-stage reward function at time $k$ is $R(\tilde{s}_k,a_k)$. Corresponding to the terminal error $J^T$ and the average error $J^A$, we can respectively design that $R_k(s,a)=-\omega a$ for $k=1,\ldots,T-1$ and $r_k(s,a)=\textrm{Tr}(\mathbb{E}[P_T])-\omega a$ for $k=T$, and $R_k(s,a)=\textrm{Tr}(\mathbb{E}[P_k])-\omega a$ for $k=1,\ldots,T$ when the sample of $\tilde{s}_k$ is $s$ and the sample of $a_k$ is $a$, where $\mathbb{E}[P_k]=(1-\beta_k(a))\overline{P}+\beta_k(a)h(s)$ and $\omega>0$ is the weighting parameter. From the design of $R_k$, the modified objective is to maximize the attack effect and minimize the energy expense simultaneously. Similar objective function appears in \cite{Li2017,Adibi2007}. We call the modified Markov decision problem the optimal tradeoff problem between
attack energy and system degradation, which is based on the modified MDP $\{T+1,\mathbb{\tilde{S}}, \mathbb{\tilde{A}}, Pr(\cdot|\cdot,\cdot),R_k(\cdot,\cdot)\}$ with the initial state $\tilde{s}_1=\overline{P}$. And the corresponding $\tilde{R}_{T+1}^\delta(\tilde{s}_1)$ and $\tilde{u}_t^\delta(s)$ can be obtained by replacing $r_k$ and $s_1$ in $R_{T+1}^\delta(s_1)$ and $u_t^\delta(s)$ with $R_k$ and $\tilde{s}_1$, respectively.
Before presenting the algorithm that solves the proposed optimal tradeoff problem, we derive some structural results for the corresponding optimal policy. To do this, first the following definition is introduced.
\emph{Definition 3 (\cite{Puterman2005}):} Let $\hat{X}$ and $\hat{Y}$ be partially ordered sets and $g(x,y)$ a real-valued function on $\hat{X}\times \hat{Y}$. We say that $g$ is superadditive if for $x^+\geq x^-$ in $\hat{X}$ and $y^+\geq y^-$ in $\hat{Y}$, there holds
\begin{align*}
g(x^+,y^+)+g(x^-,y^-)\geq g(x^+,y^-)+g(x^-,y^+).
\end{align*}
Then the following theorem provides some structural results for the optimal policy $\delta_k^*$.
\emph{Theorem 3:} There exist optimal decision rules $\delta_k^*(s)$ which are nondecreasing in $s$ for $k=1,\ldots,T$.
\begin{IEEEproof}
See the Appendix.
\end{IEEEproof}
\emph{Theorem 3} is desirable since it helps reduce the search range when seeking the optimal policy. Specifically, the monotone backward induction algorithm (Algorithm 2) in which $\mathbb{\tilde{S}}^k=S_P^k$ is presented to solve the optimal tradeoff problem.
\begin{algorithm}
\caption{Monotone Backward Induction Algorithm}
\label{algorithm1}
\KwIn{$T;\mathbb{\tilde{S}}^k;\mathbb{\tilde{A}};Pr;R_k;\tilde{s}_1=\overline{P})$}
\KwOut{Maximum total reward $\tilde{R}_{T+1}^{\delta^*}(\tilde{s}_1)=\tilde{u}_{1}^*(\tilde{s}_1)$;
Optimal deterministic Markovian policy $\delta^*=\{\delta_{1}^*, \delta_{2}^*,\ldots,\delta_{T}^*\}$}
Set $k=T+1$ and $\tilde{u}_{T+1}^*(s)=R_{T+1}(s)$ for all $s\in\mathbb{\tilde{S}}^k$.\\
\While {$k>1$}
{
Let $k=k-1$. Set $s=\overline{P}$ and $\mathbb{\tilde{A}}_{\overline{P}}=\mathbb{\tilde{A}}$.\\
\While {$s<h^k(\overline{P})$}
{
Compute $\tilde{u}_{k}^*(s)$ by
$$\tilde{u}_{k}^*(s)=\max_{a\in\mathbb{\tilde{A}}_s}\Big\{R_k(s,a)+\sum_{j\in\mathbb{\tilde{S}}^k}Pr(j|s,a)
\tilde{u}_{k+1}^*(j)\Big\}.$$
Set
$$\mathbb{\tilde{A}}_{s,k}^*=\mathop{\argmax}_{a\in\mathbb{\tilde{A}}_s}\Big\{R_k(s,a)+\sum_{j\in
\mathbb{\tilde{S}}^k}Pr(j|s,a)\tilde{u}_{k+1}^*(j)\Big\}.$$
Let $\delta_k^*(s)\in \mathbb{\tilde{A}}_{s,k}^*$.
Set
$$\mathbb{\tilde{A}}_{h(s)}=\{a\in \mathbb{\tilde{A}}: a\geq \textrm{max}[a'\in \mathbb{\tilde{A}}_{s,k}^*]\}.$$
Let $s=h(s)$.
}
}
\end{algorithm}
\section{Simulations And Examples}
In this section we show the system performance under the proposed DoS attack with the optimal attack power level for the terminal error and the average error, respectively. First, we evaluate the effects of attacks with different power levels when the conditions in \emph{Proposition 1} are satisfied for $\alpha=0$ to verify that ours are more relaxed than the sufficient conditions in \cite{Zhang2018}. Then the optimal static attack energy management for the terminal error is obtained based on the exhaustion search method when the conditions in \emph{Proposition 1} do not hold for $\alpha$ which is obtained based on \eqref{pk}--\eqref{pksinr}. Similarly, simulation examples for the average error are provided in the sequel. We also solve the optimal dynamic energy management problem and the optimal tradeoff problem, respectively, based on Algorithm 1 and Algorithm 2, which implies that the optimal dynamic policy has better performance than the optimal static policy, and verifies that the optimal policy for the optimal tradeoff problem has the monotone structure. The system parameters $A$, $C$, $Q$ and $R$, are given in \emph{Example 1}.
\subsection{Closed-form Solution for Terminal Error}
In this subsection, we will adopt the same parameters with Fig. 6 in \cite{Zhang2018} to verify the relaxation of our proposed sufficient conditions. Let the packet dropout probability without attack be $\alpha=0$. And the packet dropout probability without attack $\alpha$ is obtained based on \eqref{pk}--\eqref{pksinr} in all the subsequent subsections. The sensor sends the data packet with the packet length $L=20$ to the remote estimator with the power $\delta^s=10$ through a wireless link with the channel gain $G_s=1$ and the noise power $\sigma^2=2$.
The channel gain for the attacker is $G_a=1$. The maximal available power is $\Delta=200$. The
lower bound and upper bound of $\delta^a$, respectively, are $\underline{\delta}=20$ and $\overline{\delta}=50$. Note that the value of $T$ is not needed due to the expression of the terminal error in \eqref{Jmax} and the fact that $\alpha=0$.
In \cite{Zhang2018}, the authors employ the exhaustion search method to find the optimal attack level, since the system matrix $A$ is not normal. However, according to \emph{Example 1}, the condition 1) in \emph{Proposition 1} is satisfied. And it is easy to verify the satisfaction of the condition 2) in \emph{Proposition 1}. Therefore, the optimal attack level is $\underline{\delta}=20$ from \emph{Theorem 1}, which is also illustrated in Fig. 2.
\subsection{Solution for Terminal Error from Exhaustion Search Method}
All parameters are the same with \emph{Section VII. A} except that $\Delta=50$, $\underline{\delta}=2$, $\overline{\delta}=20$, and the considered time horizon is $T=30$. Then the condition 2) in \emph{Proposition 1} does not hold. Hence, $f(\overline{n})=\textrm{arg max}\{x|\lfloor\Delta/x\rfloor=\overline{n},\underline{\delta}
\leq x\leq \overline{\delta}\}$ may not be the optimal attack level, with $\overline{n}=\lfloor\Delta/\underline{\delta}\rfloor=25$. As shown in Fig. 3, the optimal attack level is $\delta^{a}_*=50/6$, with the optimal attack times 6 and the maximal trace of expected terminal error covariance 17.5865. And note that the conditions in \emph{Proposition 1} hold if $\underline{\delta}=10$ and $\overline{\delta}=20$, i.e., $10$ is the optimal attack level if $\underline{\delta}=10$ and $\overline{\delta}=20$, which can be also seen from Fig. 3.
\begin{figure}
\centering
\includegraphics[width=1\linewidth]{tspec}\\
\caption{$Tr[J^T]$ under different attack power levels when the sufficient conditions in \emph{Proposition 1} hold.}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=1\linewidth]{tgene}\\
\caption{$Tr[J^T]$ under different attack power levels when the sufficient conditions in \emph{Proposition 1} are not satisfied.}
\end{figure}
\subsection{Closed-form Solution for Average Error}
In this subsection, we will adopt the same parameters with \emph{Section VII. A} except that the considered time horizon is $T=15$. It is easy to verify the satisfaction of the condition 1) and 2) in \emph{Lemma 8}. Therefore, the optimal attack level is $\underline{\delta}=20$ from \emph{Theorem 2}, which is also illustrated in Fig. 4.
\subsection{Solution for Average Error from Exhaustion Search Method}
All parameters are the same with \emph{Section VII. B}. Then the conditions in \emph{Lemma 8} do not hold. Hence, $f(\overline{n})=\textrm{arg max}\{x|\lfloor\Delta/x\rfloor=\overline{n},\underline{\delta}
\leq x\leq \overline{\delta}\}$ may not be the optimal attack level, with $\overline{n}=\lfloor\Delta/\underline{\delta}\rfloor=25$. As shown in Fig. 5, the optimal attack level is $\delta^{a}_*=50/8$, with the optimal attack times 8 and the maximal trace of expected average error covariance 3.2435.
\begin{figure}
\centering
\includegraphics[width=1\linewidth]{aspec}\\
\caption{$Tr[J^A]$ under different attack power levels when the sufficient conditions in \emph{Lemma 8} hold.}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=1\linewidth]{agene}\\
\caption{$Tr[J^A]$ under different attack power levels when the sufficient conditions in \emph{Lemma 8} are not satisfied.}
\end{figure}
\subsection{Optimal Dynamic Attack Power Allocation with Given Energy Constraint}
In this subsection, we examine the proposed Algorithm 1. Take the average error for example. Let the available power level set be $\Phi=\{0,5,10,15\}$. Here for ease of simulation, set the corresponding probability set as $\{0.1,0.3,0.7,0.9\}$. The total energy constraint is $\Delta=60$ and the considered time horizon is $T=5$. Then based on Algorithm 1, we can utilize the value iteration algorithm in \cite{Puterman2005} to find the optimal dynamic attack power policy which is described by Fig. 6. The arrow goes to the possible state at the next time step. Here $h^k$ refers to $h^k(\overline{P})$. And under the optimal policy, the maximum trace of average error, $R_{T+1}^{\delta^*}(s_1)=8.0256$, is achieved.
\begin{figure}
\centering
\includegraphics[width=0.95\linewidth]{MDPC}\\
\caption{Optimal decision tree for the optimal dynamic attack management problem with the initial state $s_1=(\overline{P},60)$.}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=1\linewidth]{SDCOMP2}\\
\caption{Maximum $Tr[J^A]$ with varying maximum attack power $\Delta$.}
\end{figure}
Then we compare the optimal static attack power policy and the optimal dynamic attack power policy proposed in Section IV and Section V, respectively, by changing the maximum available power $\Delta=15,16,\ldots,20$. For ease of illustration, we reset the system matrix as $A=\begin{bmatrix} 1.01 & 3 \\ 0 & 1 \end{bmatrix}$. Fix the available power level set as $\Phi=\{0,2,2.25,2.5,\ldots,9.75,10\}$ with $\underline{\delta}=2$ and $\overline{\delta}=10$. Set $T=7$, $L=20$, $\delta^s=2$, $G_s=1$, $G_a=1$ and $\sigma^2=0.5$. The corresponding packet dropout probability is calculated from \eqref{pk}--\eqref{pksinr}. The result of the above comparison is illustrated in Fig. 7, from which we can see that the optimal dynamic policy has better performance than the optimal static policy, i.e., the attacker can degenerate the remote estimation quality more severely if it has the ability of acquiring the real-time ACK information. And note that $\Phi$ is not the interval $[2,10]$. The attack effect can be further improved if the available power set includes more elements such as $\Phi=\{0,2,2.01,2.02,\ldots,9.99,10\}$.
\subsection{Dynamic Attack Power Allocation for Optimal Tradeoff Problem}
All parameters are the same with Fig. 6. Let the weighting coefficient be $\omega=0.35$. Similar to the above subsection, the optimal policy for the optimal tradeoff problem between system degradation and energy consumption is obtained by running the value iteration algorithm in \cite{Puterman2005}. Note that, Algorithm 2 is not employed and the search space of action is $\mathbb{\tilde{A}}$ instead of $\mathbb{\tilde{A}}_{h(s)}=\{a\in \mathbb{\tilde{A}}: a\geq \textrm{max}[a'\in \mathbb{\tilde{A}}_{s,k}^*]\}.$ This is to verify the monotonicity of the optimal policy in \emph{Theorem 3}. Then the optimal policy is shown in Fig. 8 from which we can see that for a given time step $k$, $\delta_k^*(s)$ is nondecreasing in $s$. This is consistent with the theoretical result in \emph{Theorem 3}. The maximum total reward corresponding to the average error is $\tilde{R}_{T+1}^{\delta^*}(\tilde{s}_1)=5.3325$.
\begin{figure}
\centering
\includegraphics[width=0.95\linewidth]{MDPNC2}\\
\caption{Optimal decision tree for the optimal tradeoff problem with the initial state $s_1=\overline{P}$.}
\end{figure}
\section{Conclusions}\label{sec:conclusion}
In this paper, a system in which remote state estimation is carried out was considered. We investigated how to allocate the constant attack power to maximize two kinds of indexes of system performance, \emph{Terminal error} and \emph{Average error}, respectively, at the remote estimator when an energy-constrained attacker launches a DoS attack against the SINR-based wireless channel. We proposed novel analysis approaches to derive some sufficient conditions for two kinds of indexes, respectively. An explicit solution to the issue of how much power should be adopted was attained for both two kinds of indexes if the system parameters meet the corresponding conditions. Further we demonstrated that our proposed conditions for \emph{Terminal error} are more relaxed than the one in the existing work. When the sufficient conditions fail to be satisfied, a feasible method was provided to find the optimal attack level for both two kinds of indexes. Then the case when the attacker could acquire the real-time ACK information and desires the time-varying attack power is studied and a MDP-based algorithm is designed to find the optimal dynamic attack power allocation. To optimize the tradeoff between system degradation and attack energy, the other MDP-based algorithm was further proposed based on which the optimal tradeoff can be found. And a monotone structure of the optimal policy was exploited such that the efficiency of the proposed algorithm can be improved dramatically. Finally, the effectiveness of the theory was verified by the numerical examples.
\begin{appendix}
In this section, we prove \emph{Proposition 1}, \emph{Lemma 7}, \emph{Lemma 8} and \emph{Theorem 3}. First the proof of \emph{Proposition 1} in detail is provided.
\begin{IEEEproof}[Proof of Proposition 1]
From the condition 2) in $\emph{Proposition 1}$, we can readily obtain that
\begin{align*}
\overline{\beta}^{\overline{n}-n-1}(\alpha\overline{\beta}^{n}
-\underline{\beta}^{n+1})\leq \alpha\overline{\beta}
^{\overline{n}-1}-\underline{\beta}^{\overline{n}}\leq 0.
\end{align*}
Since $0<\alpha<\underline{\beta}\leq\beta\leq\theta\leq
\overline{\beta}<1$, there holds
\begin{align}\label{cof}
\alpha\theta^n-\beta^{n+1}\leq\alpha\overline{\beta}^{n}
-\underline{\beta}^{n+1}\leq 0.
\end{align}
Let $\textrm{Tr}(J_{\theta,\beta}^T)=\textrm{Tr}(J^T)_{max}(\theta)- \textrm{Tr}(J^T)_{max}(\beta)$.
Then in light of \eqref{Jmaxn}, we have
\begin{align*}
\textrm{Tr}(J_{\theta,\beta}^T)
=&\,\textrm{Tr}\Big\{(\alpha\theta^n-\beta^{n+1})\sum_{i=n+1}^{T}\alpha^{i-n-1}H^i\\
&+\sum_{i=1}^{n}(\theta^i-\beta^i)H^i\Big\}.
\end{align*}
From \eqref{cof} and the condition 1) in $\emph{Proposition 1}$, the following inequality is true:
\begin{align}\label{Jine}
\textrm{Tr}(J_{\theta,\beta}^T)\leq&\,\textrm{Tr}\Big\{\big[\sum_{i=1}^{n}(\overline
{\beta}^i-\underline{\beta}^i)+(\alpha\overline{\beta}^{n}-
\underline{\beta}^{n+1})\sum_{i=0}^{T-n-1}\alpha^{i}\big]
\nonumber\\
&\times H^n\Big\}.
\end{align}
Due to \eqref{cof}, there holds
\begin{align*}
&[\alpha\overline{\beta}^{n}(1-\overline{\beta}^{\overline{n}
-n-1})+\underline{\beta}^{n+1}(\underline{\beta}^{\overline{n}
-n-1}-1)]\\
\leq&\,\underline{\beta}^{n+1}(\underline{\beta}^{\overline{n}
-n-1}-\overline{\beta}^{\overline{n}
-n-1})\leq 0,
\end{align*}
which causes
\begin{align*}
&(\alpha\overline{\beta}^{n}-\underline{\beta}^{n+1})\sum_{i=0}
^{T-n-1}\alpha^{i}-(\alpha\overline{\beta}^{\overline{n}-1}-
\underline{\beta}^{\overline{n}})\sum_{i=0}^{T-\overline{n}}
\alpha^{i}\\
=&\,[\alpha\overline{\beta}^{n}(1-\overline{\beta}^{\overline{n}
-n-1})+\underline{\beta}^{n+1}(\underline{\beta}^{\overline{n}
-n-1}-1)]\sum_{i=0}^{T-\overline{n}}\alpha^{i}\\
&+(\alpha\overline{\beta}^{n}-\underline{\beta}^{n+1})
\sum_{i=T-\overline{n}+1}
^{T-n-1}\alpha^{i}\leq 0.
\end{align*}
Hence, it is obtained that
\begin{align*}
&\sum_{i=1}^{n}(\overline
{\beta}^i-\underline{\beta}^i)+(\alpha\overline{\beta}^{n}-
\underline{\beta}^{n+1})\sum_{i=0}^{T-n-1}\alpha^{i}\\
\leq&\sum_{i=1}^{\overline{n}-1}(\overline{\beta}^i-\underline{\beta}
^i)+(\alpha\overline{\beta}^{\overline{n}-1}-\underline{\beta}
^{\overline{n}})\sum_{i=0}^{T-\overline{n}}\alpha^{i},
\end{align*}
which leads to, according to \eqref{Jine}, $\emph{Lemma 2}$, and the condition 2) in $\emph{Proposition 1}$,
\begin{align*}
\textrm{Tr}(J_{\theta,\beta}^T)\leq 0.
\end{align*}
The proof is completed.
\end{IEEEproof}
Then we present the proof of \emph{Lemma 7}.
\begin{IEEEproof}[Proof of Lemma 7]
Let $H(i,\lambda)=\sum_{k=1}^T\mathbb{E}[P_k(\lambda)]$ with $P_0=h^i(\overline{P})$, where $T$ is the length of the time horizon for an attack schedule $\lambda$. Let $N=n+s$, $\psi^1=(\lambda^{n},\gamma^{s})$ and $\psi^2=(\lambda^{n+1},\gamma^{s-1})$.
From the structure of $\phi^1=(\gamma^{m},\lambda^{n},\gamma^{s})$, $\phi^2=(\gamma^{m},\lambda^{n+1},\gamma^{s-1})$ and $V_i=\sum_{j=0}^iF_j$, where $F_i=\sum_{k=1}^T[p_{i,k}(\phi^1)-p_{i,k}(\phi^2)]$, we can obtain
\begin{align*}
V_i(m,n,s,\theta,\beta)=&\sum_{j=0}^i\sum_{k=1}^T(p_{j,k}(\phi^1)-p_{j,k}(\phi^2))\nonumber\\
=&\sum_{j=0}^i\sum_{k=m+1}^T(p_{j,k}(\phi^1)-p_{j,k}(\phi^2)),
\end{align*}
and
\begin{align*}
&J_{max}^A(\phi^1)-J^A_{max}(\phi^2)\nonumber\\
=&\frac1T\sum_{k=1}^T\{\mathbb{E}[P_k(\phi^1)]-\mathbb{E}[P_k(\phi^2)]\}\nonumber\\
=&\frac1T\sum_{k=m+1}^T\{\mathbb{E}[P_k(\phi^1)]-\mathbb{E}[P_k(\phi^2)]\}
\nonumber\\
=&\frac1T\sum_{i=0}^{T}h^{i}(\overline{P})\sum_{k=m+1}^T
(p_{i,k}(\phi^1)-p_{i,k}(\phi^2)),
\end{align*}
where,
\begin{align*}
\sum_{k=m+1}^T\mathbb{E}[P_k(\phi^1)]=&\sum_{i=0}^{T}h^{i}(\overline{P})
\sum_{k=m+1}^Tp_{i,k}(\phi^1)\nonumber\\
=&\sum_{j=0}^{m-1}(1-\alpha)\alpha^jH(j,\psi^1)+\alpha^mH(m,\psi^1).
\end{align*}
According to the equation
\begin{align*}
H(j,\psi^1)=H(0,\psi^1)+\sum_{i=1}^Np_{i,i}[h^{i+j}(\overline{P})-h^i(\overline{P})],
\end{align*}
we can further obtain
\begin{align}\label{Vm}
&\sum_{k=m+1}^T\mathbb{E}[P_k(\phi^1)]\nonumber\\
=&H(0,\psi^1)+\sum_{j=0}^{m-1}(1-\alpha)\alpha^j\sum_{i=1}^Np_{i,i}[h^{i+j}(\overline{P})-
h^i(\overline{P})]\nonumber\\
&+\alpha^m\sum_{i=1}^Np_{i,i}[h^{i+m}(\overline{P})-h^i(\overline{P})]\nonumber\\
=&\, H(0,\psi^1)+\sum_{i=2}^m h^i(\overline{P})[\sum_{j=1}^{i-1}\alpha^{i-j}p_{j,j}-\sum_{j=1}^i\alpha^{i-j+1}p_{j,j}]
\nonumber\\
&+\sum_{i=m+1}^N h^i(\overline{P})[\sum_{j=i-m}^{i-1}\alpha^{i-j}p_{j,j}-\sum_{j=i-m+1}^i\alpha^{i-j+1}p_{j,j}]
\nonumber\\
&+\sum_{i=N+1}^{T-1} h^i(\overline{P})[\sum_{j=i-m}^N\alpha^{i-j}p_{j,j}-\sum_{j=i-m+1}^N\alpha^{i-j+1}p_{j,j}]
\nonumber\\
&+h^T(\overline{P})\alpha^mp_{N,N}-h(\overline{P})\alpha p_{1,1},
\end{align}
where, $p_{i,i}=p_{i,i}(\psi^1)$ and
\begin{align}\label{V0}
&\,\,H(0,\psi^1)\nonumber\\
=&\,\,\overline{P}[n(1-\theta)+s(1-\alpha)]+h^N(\overline{P})\theta^n\alpha^s
\nonumber\\
&+\sum_{i=1}^s h^i(\overline{P})\big[\theta^i+(n-i)(1-\theta)\theta^i\nonumber\\
&+\sum_{j=1}^i(1-\theta)\theta^{i-j}\alpha^{j}+(s-i)(1-\alpha)\alpha^i\big]\nonumber\\
&+\sum_{i=n+1}^{N-1}h^i(\overline{P})\big[\theta^n\alpha^{i-n}
+\sum_{j=1}^{N-i}(1-\theta)\theta^{n-j}\alpha^{i-n+j}\big]\nonumber\\
&+\sum_{i=s+1}^nh^i(\overline{P})\big[\theta^i+(n-i)(1-\theta)\theta^i\nonumber\\
&+\sum_{j=1}^s(1-\theta)\theta^{i-j}\alpha^{j}\big].
\end{align}
Before proceeding further, one equation is presented to facilitate the analysis:
\begin{align}\label{EQ1}
&\sum_{i=t_1}^{t_2}\sum_{j=t_3}^{i+t_3-t_1}(1-\theta)\theta^{i-j}
\alpha^j\nonumber\\
=&\sum_{j=t_3}^{t_2+t_3-t_1}\sum_{i=j+t_1-t_3}^{t_2}
(1-\theta)\theta^{i-j}\alpha^j\nonumber\\
=&\sum_{j=t_3}^{t_2+t_3-t_1}\theta^{t_1-t_3}
(1-\theta^{t_2-t_1+t_3+1-j})\alpha^j.
\end{align}
Based on \eqref{Vm} and \eqref{V0}, for $i= 0, \ldots, s-1$, there holds
\begin{align}
&\sum_{j=0}^i\sum_{k=m+1}^Tp_{j,k}(\phi^1)\nonumber\\
=&\,\,\sum_{j=0}^i[(n-j)(1-\theta)\theta^j+(s-j)(1-\alpha)\alpha^j]+\sum_{j=1}^i
\theta^j\nonumber\\
&+2\sum_{j=2}^i\sum_{t=1}^j(1-\theta)\theta^{j-t}\alpha^{t}-\sum_{j=2}^i\alpha^j
+\alpha(1-2\theta),\nonumber
\end{align}
which, combining \eqref{EQ1} and the equation
\begin{align}
\sum_{j=0}^i(n-j)(1-\theta)\theta^j=n-(n-i)\theta^{i+1}-\sum_{j=1}^i\theta^j,\nonumber
\end{align}
leads to
\begin{align*}
V_i=&\,\,(n-i+1)\beta^{i+1}-(n-i)\theta^{i+1}-\alpha^{i+1}\nonumber\\
&+2\sum_{j=1}^i\alpha^j(\beta^{i-j+1}-\theta^{i-j+1}),
\end{align*}
i.e., equation \eqref{HI1}.
Similarly, equations \eqref{HI2}--\eqref{HI6} can be derived from \eqref{Vm} and \eqref{V0}.
The proof is completed.
\end{IEEEproof}
Next, the proof of \emph{Lemma 8} is given as follows.
\begin{IEEEproof}[Proof of Lemma 8]
It is hard to compare $V_i's$ with different attack times since different attack times $n$ bring different packet dropout probabilities under attack. To proceed to the next analytic step, we find the lower bound of $V_i(m,n,s,\theta,\beta)$. From \eqref{HI1}--\eqref{HI6}, there holds $V_i(m,n,s,\theta,\beta)\geq V_i(m,n,s,\overline{\beta},\underline{\beta})$, since each term with $\theta$ is less than 0 and each term with $\beta$ is positive. Next we focus on the comparison between the obtained lower bounds of $V_i(m,n,s,\theta,\beta)$, i.e., $V_i(m,n,s,\overline{\beta},\underline{\beta})$. More specifically, we investigate how $V_i(m,n,s,\overline{\beta},\underline{\beta})$ varies with $n$. And for simplicity of description, we write $V_i(m,n,s,\overline{\beta},\underline{\beta})$ as $V_i(m,n,s)$ throughout the following derivation.
For ease of understanding, here we rewrite $\phi^1=(\gamma^{m},\lambda^{n},\gamma^{s})$, and $\phi^2=(\gamma^{m},\lambda^{n+1},\gamma^{s-1})$. It is easy to see from \emph{Lemma 7} that $\phi^1$ has two kinds of structures, $(\gamma^{s},\lambda^{n},\gamma^{s})$ and $(\gamma^{s-1},\lambda^{n},\gamma^{s})$. According to \emph{Lemma 7}, the expression of $V_i$ is dependent on the structure of $\phi^1$. Let $m=d$, $n=k$ and $s=d$. And we fix the length of the time horizon as $T=d+k+d$. Then $\phi^1$ has the first structure $(\gamma^{s},\lambda^{n},\gamma^{s})$, and the corresponding $\phi^2$ is $(\gamma^{d},\lambda^{k+1},\gamma^{d-1})$ which, from \emph{Lemma 5}, leads to the same average error with $(\gamma^{d-1},\lambda^{k+1},\gamma^{d})$. When $n=k+1$, $\phi^1=(\gamma^{d-1},\lambda^{k+1},\gamma^{d})$ has the second structure $(\gamma^{s-1},\lambda^{n},\gamma^{s})$ since $T=d+k+d$, and the corresponding $\phi^2$ is $(\gamma^{d-1},\lambda^{k+2},\gamma^{d-1})$. Similarly, when $n=k+2$, $\phi^1=(\gamma^{d-1},\lambda^{k+2},\gamma^{d-1})$, again, has the first structure $(\gamma^{s},\lambda^{n},\gamma^{s})$, and the corresponding $\phi^2$ is $(\gamma^{d-1},\lambda^{k+3},\gamma^{d-2})$. Hence, different expressions of $V_i$ should be adopted as the attack times $n$ increases. In the following derivation, we first focus on the comparison between $V_i(d, k, d)$ which corresponds to the first structure $(\gamma^{s},\lambda^{n},\gamma^{s})$ and $V_i(d-1, k+1, d)$ that corresponds to the second structure $(\gamma^{s-1},\lambda^{n},\gamma^{s})$.
We can set, in \emph{Lemma 7}, $m=d$, $n=k$ and $s=d$ to calculate $V_i(d, k, d)$, and $m=d-1$, $n=k+1$ and $s=d$ to calculate $V_i(d-1, k+1, d)$. Then we can derive the difference between $V_i(d, k, d)$ and $V_i(d-1, k+1, d)$ as follows.
For $i= 0, \ldots, d-1$, it follows from \eqref{HI1} that
\begin{align}\label{HID1}
V_i(d, k, d)-V_i(d-1, k+1, d)=\overline{\beta}^{i+1}-\underline{\beta}^{i+1}.
\end{align}
For $i= d, \ldots, k$, we have from \eqref{HI3} and \eqref{HI5} that
\begin{align}\label{HID2}
&V_i(d, k, d)-V_i(d-1, k+1, d)\nonumber\\
=&\,\,\overline{\beta}^{i-d+1}(\overline{\beta}^d-\alpha^d)-\underline{\beta}^{i-d+1}
(\underline{\beta}^d-\alpha^d).
\end{align}
For $i= k+1$, due to \eqref{HI4} and \eqref{HI5}, there holds
\begin{align}\label{HID3}
&V_i(d, k, d)-V_i(d-1, k+1, d)\nonumber\\
=&\,\,\alpha\overline{\beta}^k(\overline{\beta}-\alpha)+\alpha\overline{\beta}^{k+1}
-\underline{\beta}^{k+2}\nonumber\\
&+\alpha^d(\underline{\beta}^{k+2-d}-\overline{\beta}^{k+2-d}).
\end{align}
For $i= k+2, \ldots, N-1$, due to \eqref{HI4} and \eqref{HI6}, there holds
\begin{align}\label{HID4}
&V_i(d, k, d)-V_i(d-1, k+1, d)\nonumber\\
=&\,\,(i-k)\alpha^{i-k-1}[\alpha\overline{\beta}^k(\overline{\beta}-\alpha)
-\underline{\beta}^{k+1}(\underline{\beta}-\alpha)]
\nonumber\\
&+\alpha^{i-k}(\overline{\beta}^{k+1}-\underline{\beta}^{k+1})
+\alpha^d(\underline{\beta}^{i-d+1}-\overline{\beta}^{i-d+1}).
\end{align}
For $i= N, \ldots, T-1$, due to \eqref{HI2}, there holds
\begin{align}\label{HID5}
&V_i(d, k, d)-V_i(d-1, k+1, d)\nonumber\\
=&\,\,(T-i)\alpha^{i-k-1}[\alpha\overline{\beta}^k(\overline{\beta}-\alpha)
-\underline{\beta}^{k+1}(\underline{\beta}-\alpha)].
\end{align}
Next we focus on the comparison between $V_i(d-1, k, d)$ which corresponds to the second structure $(\gamma^{s-1},\lambda^{n},\gamma^{s})$ and $V_i(d-1, k+1, d-1)$ that corresponds to the first structure $(\gamma^{s},\lambda^{n},\gamma^{s})$. We can set, in \emph{Lemma 7}, $m=d-1$, $n=k$ and $s=d$ to calculate $V_i(d-1, k, d)$, and $m=d-1$, $n=k+1$ and $s=d-1$ to calculate $V_i(d-1, k+1, d-1)$. Then the difference between $V_i(d-1, k, d)$ and $V_i(d-1, k+1, d-1)$ can be given as follows.\footnote{Here, $k$ should be replaced with $k+1$ since $T=d+k+d$. But in fact, the derivation can proceed if we employ $k$ instead of $k+1$. Hence, for simplicity, $k$ is adopted here.}
For $i= 0, \ldots, d-2$, it follows from \eqref{HI1} that
\begin{align}\label{HID6}
&V_i(d-1, k, d)-V_i(d-1, k+1, d-1)\nonumber\\
=&\overline{\beta}^{i+1}-\underline{\beta}^{i+1}.
\end{align}
For $i= d-1$, due to \eqref{HI1} and \eqref{HI5}, there holds
\begin{align}\label{HID7}
&V_i(d-1, k, d)-V_i(d-1, k+1, d-1)\nonumber\\
=&\,\,\overline{\beta}^d-\underline{\beta}^d+\alpha^{d-1}\overline{\beta}-\alpha^d.
\end{align}
For $i= d, \ldots, k$, we have from \eqref{HI5} that
\begin{align}\label{HID8}
&V_i(d-1, k, d)-V_i(d-1, k+1, d-1)\nonumber\\
=&\,\,\overline{\beta}^{i-d+1}(\overline{\beta}^d-\alpha^d)
-\underline{\beta}^{i-d+2}(\underline{\beta}^{d-1}-\alpha^{d-1}).
\end{align}
For $i= k+1$, due to \eqref{HI5} and \eqref{HI6}, there holds
\begin{align}\label{HID9}
&V_i(d-1, k, d)-V_i(d-1, k+1, d-1)\nonumber\\
=&\,\,\alpha\overline{\beta}^k(\overline{\beta}-\alpha)+\alpha\overline{\beta}^{k+1}
-\underline{\beta}^{k+2}\nonumber\\
&+\alpha^{d-1}\underline{\beta}^{k+3-d}-\alpha^d\overline{\beta}^{k+2-d}.
\end{align}
For $i= k+2, \ldots, N-1$, due to \eqref{HI6}, there holds
\begin{align}\label{HID10}
&V_i(d-1, k, d)-V_i(d-1, k+1, d-1)\nonumber\\
=&\,\,(i-k)\alpha^{i-k-1}[\alpha\overline{\beta}^k(\overline{\beta}-\alpha)
-\underline{\beta}^{k+1}(\underline{\beta}-\alpha)]
\nonumber\\
&+\alpha^{i-k}(\overline{\beta}^{k+1}-\underline{\beta}^{k+1})
+\alpha^{d-1}\underline{\beta}^{i-d+2}-\alpha^d\overline{\beta}^{i-d+1}.
\end{align}
For $i= N, \ldots, T-1$, due to \eqref{HI2}, there holds
\begin{align}\label{HID11}
&V_i(d-1, k, d)-V_i(d-1, k+1, d-1)\nonumber\\
=&\,\,(T-i)\alpha^{i-k-1}[\alpha\overline{\beta}^k(\overline{\beta}-\alpha)
-\underline{\beta}^{k+1}(\underline{\beta}-\alpha)].
\end{align}
Next we focus on the sign of equations \eqref{HID1}--\eqref{HID11} under the condition 1) in \emph{Lemma 8} that the inequality, $2\alpha\overline{\beta}^{\overline{n}-1}-\underline{\beta}^{\overline{n}}\leq 0$, holds.
In the beginning, it is easy to see that
\begin{align*}
\overline{\beta}^{\overline{n}-n-1}(2\alpha\overline{\beta}^n-\underline{\beta}^{n+1})\leq 2\alpha\overline{\beta}^{\overline{n}-1}-\underline{\beta}^{\overline{n}}\leq 0.
\end{align*}
And we readily have equations \eqref{HID1} and \eqref{HID2} are positive.
According to the condition 1) in \emph{Lemma 8}, there holds
\begin{align*}
&\alpha\overline{\beta}^k(\overline{\beta}-\alpha)+\alpha\overline{\beta}^{k+1}
-\underline{\beta}^{k+2}\\
\leq&\alpha\overline{\beta}^k(\overline{\beta}-\alpha)
-\alpha\overline{\beta}^{k+1}=-\alpha^2\overline{\beta}^k<0,
\end{align*}
which causes that equation \eqref{HID3} is less than 0.
Then we focus on equations \eqref{HID4} and \eqref{HID5}. Due to the condition, it follows that
\begin{align*}
&\alpha\overline{\beta}^k(\overline{\beta}-\alpha)
-\underline{\beta}^{k+1}(\underline{\beta}-\alpha)\nonumber\\
\leq&\alpha\overline{\beta}^k(\overline{\beta}-\alpha)-\underline{\beta}^{k+2}
+\alpha\overline{\beta}^{k+1}\nonumber\\
\leq&-\alpha^2\overline{\beta}^k<0.
\end{align*}
The above result leads to
\begin{align*}
&(i-k)\alpha^{i-k-1}[\alpha\overline{\beta}^k(\overline{\beta}-\alpha)
-\underline{\beta}^{k+1}(\underline{\beta}-\alpha)]\nonumber\\
&+\alpha^{i-k}(\overline{\beta}^{k+1}-\underline{\beta}^{k+1})\nonumber\\
\leq&\alpha^{i-k-1}[\alpha\overline{\beta}^k(\overline{\beta}-\alpha)
-\underline{\beta}^{k+1}(\underline{\beta}-\alpha)]\nonumber\\
&+\alpha^{i-k}(\overline{\beta}^{k+1}-\underline{\beta}^{k+1})\nonumber\\
=&\alpha^{i-k-1}[2\alpha\overline{\beta}^{k+1}
-\alpha^2\overline{\beta}^k-\underline{\beta}^{k+2}]\leq0,
\end{align*}
from which we readily obtain that equations \eqref{HID4} and \eqref{HID5} are negative.
It is easy to see that equations \eqref{HID6} and \eqref{HID7} are postive.
And from the sign of equation \eqref{HID2}, equation \eqref{HID8} is also greater than 0 since
\begin{align*}
&\overline{\beta}^{i-d+1}(\overline{\beta}^d-\alpha^d)
-\underline{\beta}^{i-d+2}(\underline{\beta}^{d-1}-\alpha^{d-1})\\
>&\underline{\beta}^{i-d+1}(\underline{\beta}^d-\alpha^d)
-\underline{\beta}^{i-d+2}(\underline{\beta}^{d-1}-\alpha^{d-1})\\
=&\underline{\beta}^{i-d+1}\alpha^{d-1}(\underline{\beta}-\alpha)>0.
\end{align*}
And similar to the derivation for equations \eqref{HID3}--\eqref{HID5}, we can prove that equations \eqref{HID9}--\eqref{HID11} are negative.
According to the sign of equations \eqref{HID1}--\eqref{HID11}, we can obtain that $V_i(m,n,s,\overline{\beta},\underline{\beta})$ is a upper concave curve with $n$ for $n>s$. When $n\leq s$, we can similarly derive the expression of $V_i$ and imitate the above proof process to obtain the same result. Therefore, for any attack times $n$ with $\underline{n}\leq n\leq\overline{n}-1$, it follows that $V_i(m,n,s,\theta,\beta)\geq V_i(m,n,s,\overline{\beta},\underline{\beta})\geq \textrm{min} \{V_i(\overline{m},\overline{n}-1,\overline{s},\overline{\beta},\underline{\beta}), V_i(\underline{m},\underline{n},\underline{s},\overline{\beta},\underline{\beta})\}\geq 0$, for $i=0,\ldots,T-1$, where $\overline{m}+\overline{s}=T-\overline{n}+1$, $\overline{m}=\overline{s}$ or $\overline{m}=\overline{s}-1$, $\underline{m}+\underline{s}=T-\underline{n}$, and $\underline{m}=\underline{s}$ or $\underline{m}=\underline{s}-1$. The proof is completed.
\end{IEEEproof}
Finally, \emph{Theorem 3} is proved as follows.
\begin{IEEEproof}[Proof of Theorem 3]
Let $\mathbb{N}=\{0,1,2,\ldots\}$ and $q(j|s,a)=\sum_{i=j}^\infty Pr(h^i(\overline{P})|s,a)$. According to Theorem 4.7.4 in \cite{Puterman2005}, it suffices to prove that the following items are true for $k=1,\ldots,T$.
\begin{enumerate}
\item $R_k(s,a)$ is nondecreasing in $s$ for all $a\in \mathbb{\tilde{A}}$;
\item $q(j|s,a)$ is nondecreasing in $s$ for all $j\in \mathbb{N}$ and $a\in \mathbb{\tilde{A}}$;
\item $R_k(s,a)$ is a superadditive function on $\mathbb{\tilde{S}}\times \mathbb{\tilde{A}}$;
\item $q(j|s,a)$ is a superadditive function on $\mathbb{\tilde{S}}\times \mathbb{\tilde{A}}$ for all $j\in \mathbb{N}$;
\item $R_{T+1}(s)$ is nondecreasing in $s$.
\end{enumerate}
Take $R_k$ which corresponds to the average error for example. For a given $a$, $R_k(s,a)=\textrm{Tr}((1-\beta_k(a))\overline{P}+\beta_k(a)h(s))-\omega a$ is nondecreasing in $s$ due to \emph{Lemma 2}, from which the proof of 1) is completed.
Then for $s^+\geq s^-$ in $\mathbb{\tilde{S}}$ and $a^+\geq a^-$ in $\mathbb{\tilde{A}}$, there hold
$
R_k(s^+,a^+)-R_k(s^-,a^+)=\textrm{Tr}(\beta_k(a^+)[h(s^+)-h(s^-)])
$
and
$
R_k(s^+,a^-)-R_k(s^-,a^-)=\textrm{Tr}(\beta_k(a^-)[h(s^+)-h(s^-)]),
$
which, in light of \eqref{pk}--\eqref{pksinr} and \emph{Lemma 2}, lead to
\begin{align*}
R_k(s^+,a^+)-R_k(s^-,a^+)\geq R_k(s^+,a^-)-R_k(s^-,a^-).
\end{align*}
And thereby, from \emph{Definition 3}, the proof of 3) is completed.
To prove 2) and 4), the expression of $q(j|s,a)$ is presented based on \eqref{Prt} as follows.
For $j=0$, $q$ is given by $q(0|s,a)=1$, and for $j=1,2,\ldots$ and a given $a$, it follows that
\begin{align*}
q(j|s,a)= \left\{ \begin{array}{ll}
0,& \textrm{if}\, s<h^{j-1}(\overline{P}),\\
\beta(a),& \textrm{if}\, s\geq h^{j-1}(\overline{P}),
\end{array} \right.
\end{align*}
from which 2) is obtained.
For $j=0$, 4) holds obviously. For $j=1,2,\ldots$, there are three cases. First, suppose that $s^+,s^-<h^{j-1}(\overline{P})$. Apparently 4) holds. Second, suppose that $s^-<h^{j-1}(\overline{P})$ and $s^+\geq h^{j-1}(\overline{P})$. This generates $q(j|s^-,\cdot)=0$ and $q(j|s^+,a)=\beta(a)$. Then we obtain 4) since $\beta(a^+)\geq \beta(a-)$. Third, suppose that $s^+,s^-\geq h^{j-1}(\overline{P})$. Then we have $q(j|s^+,a)=q(j|s^-,a)$ which implies that 4) is true.
5) is a direct result from the fact that $R_{T+1}=0$. Then the proof is completed.
\end{IEEEproof}
\end{appendix}
\bibliographystyle{IEEE}
| {'timestamp': '2018-10-08T02:07:28', 'yymm': '1810', 'arxiv_id': '1810.02558', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02558'} | arxiv |
\section{Algorithm}
\label{sec:Algorithm}
The new algorithm is called {\tt RecurRank}\xspace (`recursive ranker').
The algorithm maintains a partition of the $K$ positions into intervals. Associated with each interval is an integer-valued `phase number'
and an ordered set of items, which has the same size as the interval for all but the last interval (containing position $K$).
Initially the partition only contains one interval that is associated with all the items and phase number $\ell = 1$.
At any point in time, {\tt RecurRank}\xspace works in parallel on all intervals.
Within an interval associated with phase number $\ell$, the algorithm balances exploration and exploitation while determining the relative attractiveness of the items to accuracy $\Delta_\ell = 2^{-\ell}$.
To do this, items are placed in the first position of the interval in proportion to an experimental design. The remaining
items are placed in order in the remaining positions. Once sufficient data is collected, the interval is divided into a collection of subintervals
and the algorithm is restarted on each subinterval with the phase number increased.
The natural implementation of the algorithm maintains a list of partitions and associated items. In each round it iterates over the partitions and makes assignments of the items within
each partition. The assignments are based on round-robin idea using an experimental design, which means the algorithm needs to keep track of how often each item has been placed in
the first position. This is not a problem
from an implementation perspective, but stateful code is hard to interpret in pseudocode. We provide a recursive implementation that describes the assignments made within each
interval and the rules for creating a new partition.
A flow chart depicting the operation of the algorithm is given in \cref{fig:flow chart for algo}. The code is provided in the supplementary material.
\begin{algorithm}[thb!]
\begin{algorithmic}[1]
\STATE \label{alg:main:input} \textbf{Input: } Phase number $\ell$ and \\ $\mathcal{A} = (a_1,a_2,\ldots)$ and $\mathcal K = (k,k+1,\ldots,k+m-1)$
\STATE \label{alg:main:g-optimal design}
Find a $G$-optimal design $\pi = \operatorname{\textsc{Gopt}}(\mathcal{A})$
\STATE \label{alg:main:define T(a)}
Let $\Delta_\ell = 2^{-\ell}$ and
\begin{align}
T(a) = \ceil{\frac{d\,\pi(a)}{2\Delta_\ell^2}\log\left(\frac{|\mathcal{A}|}{\delta_\ell}\right)}
\label{eq:allocchoice}
\end{align}
This instance will run $\sum_{a \in \mathcal{A}} T(a)$ times
\STATE
\label{alg:main:select}
Select each item $a\in \mathcal{A}$ exactly $T(a)$ times at position $k$
and put available items in $\{a_1,\ldots,a_m\}$ sequentially in positions $\{k+1,\ldots,k+m-1\}$ and receive feedbacks (synchronized by a global clock).
\STATE
\label{alg:main:compute theta hat}
Let $\mathcal D = \{(\beta_1, \zeta_1), \ldots\}$ be the multiset of item/clicks from position $k$
and compute
\begin{align}
\hat \theta &= V^\dagger S \quad \text{ with } \label{eq:lse} \\
& \qquad V = \sum_{(\beta, \zeta) \in \mathcal D} \beta \beta^{\top} \text{ and } S = \sum_{(\beta, \zeta) \in \mathcal D} \beta \zeta \nonumber
\end{align}
\STATE Let $a^{(1)},a^{(2)},\ldots,a^{(|\mathcal{A}|)}$ be an ordering $\mathcal{A}$ such that
\begin{align*}
\epsilon_i = \ip{\hat \theta, a^{(i)} - a^{(i+1)}} \geq 0 \text{ for all } 1 \leq i < |\mathcal{A}|
\end{align*}
and set $\epsilon_{|\mathcal{A}|}=2\Delta_\ell$
\STATE Let $(u_1,\ldots,u_p) = (i \in [|\mathcal{A}|] : \epsilon_i \geq 2\Delta_\ell)$ and $u_0 = 0$
\begin{align*}
\mathcal{A}_i &= (a^{(u_{i-1}+1)},\ldots,a^{(u_{i})}) \\
\mathcal K_i &= (k+u_{i-1},\ldots,k+\min(m,u_i)-1)
\end{align*}
\STATE \label{alg:main:elim}
For each $i \in [p]$ such that $k+u_{i-1}\le k+m-1$ call {\tt RecurRank}\xspace$(\ell+1, \mathcal{A}_i, \mathcal K_i)$ on separate threads
\end{algorithmic}
\caption{{\tt RecurRank}\xspace}\label{alg:main}
\end{algorithm}
The pseudocode of the core subroutine on each interval is given in \cref{alg:main}. The subroutine accepts as input (1) the phase number $\ell$, (2) the positions of the interval $\mathcal K \subseteq [K]$
and (3) an ordered list
of items, $\mathcal{A}$. The phase number determines the length of the experiment and the target precision.
The ordering of the items in $\mathcal{A}$ is arbitrary in the initial partition (when $\ell = 1$). When $\ell > 1$ the ordering is determined by the empirical estimate of attractiveness in
the previous experiment, which is crucial for the analysis.
The whole algorithm is started by calling ${\tt RecurRank}\xspace(1,\mathcal L,(1,2,\dots,K))$ where the order of $\mathcal L$ is random.
The algorithm is always instantiated with parameters that satisfy $|\mathcal{A}| \geq |\mathcal K|=m$. Furthermore, $|\mathcal{A}| > |\mathcal K|$ is only possible when $K \in \mathcal K$.
\begin{figure*}[thb!]
\centering
\begin{tikzpicture}[scale=0.7,font=\small]
\draw (0,0) rectangle (1,-4);
\draw[dashed] (0,-0.5) -- (1,-0.5);
\node at (-0.2, -0.25) {$1$};
\node at (-0.2, -3.75) {$8$};
\node at (0.5, 0.25) {$\ell=1$};
\node at (1.5, 0.75) {$\mathcal{A}$};
\node at (1.5, 0.25) {$||$};
\node at (1.5, -0.25) {$\overbrace{a_1}$};
\node at (1.5, -1.5) {$\cdot$};
\node at (1.5, -2) {$\cdot$};
\node at (1.5, -2.5) {$\cdot$};
\node at (1.5, -3.75) {$a_8$};
\node at (1.5, -4.25) {$\cdot$};
\node at (1.5, -4.5) {$\cdot$};
\node at (1.5, -4.75) {$\cdot$};
\node at (1.5, -5.25) {$\underbrace{a_{50}}$};
\node[rounded rectangle,draw,minimum width=5.7cm,minimum height=2.2cm,dotted,rotate=90] (r1) at (0.9,-2.3) {};
\draw[-latex] (2.3,-2.3) -- (4.55,1.1);
\draw (5,1.5) rectangle (6,0);
\draw[dashed] (5,1) -- (6,1);
\node at (4.8, 1.25) {$1$};
\node at (4.8, 0.25) {$3$};
\node at (5.5, 1.75) {$\ell=2$};
\node at (6.5, 2.25) {$\mathcal{A}$};
\node at (6.5, 1.75) {$||$};
\node at (6.5, 1.25) {$\overbrace{a_1}$};
\node at (6.5, 0.75) {$\vdots$};
\node at (6.5, 0.25) {$\underbrace{a_3}$};
\node[rounded rectangle,draw,minimum width=2.8cm,minimum height=2.1cm,dotted,rotate=90] (r1) at (5.9,1.1) {};
\draw[-latex] (2.3,-2.3) -- (4.5,-4.5);
\draw (5,-3) rectangle (6,-5.5);
\draw[dashed] (5,-3.5) -- (6,-3.5);
\node at (5.5, -2.75) {$\ell=2$};
\node at (6.5, -2.25) {$\mathcal{A}$};
\node at (6.5, -2.75) {$||$};
\node at (4.8, -3.25) {$4$};
\node at (4.8, -5.25) {$8$};
\node at (6.5, -3.25) {$\overbrace{a_4}$};
\node at (6.5, -3.75) {$\cdot$};
\node at (6.5, -4.25) {$\cdot$};
\node at (6.5, -4.75) {$\cdot$};
\node at (6.5, -5.25) {$a_8$};
\node at (6.5, -5.75) {$\cdot$};
\node at (6.5, -6) {$\cdot$};
\node at (6.5, -6.25) {$\cdot$};
\node at (6.5, -6.75) {$\underbrace{a_{25}}$};
\node[rounded rectangle,draw,minimum width=4.5cm,minimum height=2.25cm,dotted,rotate=90] (r1) at (5.9,-4.5) {};
\draw[-latex] (7.2,1.1) -- (8.55,1.1);
\draw (9,1.5) rectangle (10,0);
\draw[dashed] (9,1) -- (10,1);
\node at (8.8, 1.25) {$1$};
\node at (8.8, 0.25) {$3$};
\node at (9.5, 1.75) {$\ell=3$};
\node at (10.5, 2.25) {$\mathcal{A}$};
\node at (10.5, 1.75) {$||$};
\node at (10.5, 1.25) {$\overbrace{a_1}$};
\node at (10.5, 0.75) {$\vdots$};
\node at (10.5, 0.25) {$\underbrace{a_3}$};
\node[rounded rectangle,draw,minimum width=2.8cm,minimum height=2.1cm,dotted,rotate=90] (r1) at (9.9,1.1) {};
\draw[-latex] (11.2,1.1) -- (15.5,1.1);
\node at (15.75, 1.1) {$\cdot$};
\node at (16, 1.1) {$\cdot$};
\node at (16.25, 1.1) {$\cdot$};
\draw[-latex] (7.25,-4.5) -- (11.55,-1.6);
\draw (12,-1.5) rectangle (13,-2.5);
\draw[dashed] (12,-2) -- (13,-2);
\node at (12.5, -1.25) {$\ell=3$};
\node at (13.5, -0.75) {$\mathcal{A}$};
\node at (13.5, -1.25) {$||$};
\node at (11.8, -1.75) {$4$};
\node at (11.8, -2.25) {$5$};
\node at (13.5, -1.75) {$\overbrace{a_4}$};
\node at (13.5, -2.25) {$\underbrace{a_5}$};
\node[rounded rectangle,draw,minimum width=2cm,minimum height=2.1cm,dotted,rotate=90] (r1) at (12.9,-1.6) {};
\draw[-latex] (14.2,-1.6) -- (15.5,-1.6);
\node at (15.75, -1.6) {$\cdot$};
\node at (16, -1.6) {$\cdot$};
\node at (16.25, -1.6) {$\cdot$};
\draw[-latex] (7.25,-4.5) -- (11.55,-5.5);
\draw (12,-4.5) rectangle (13,-6);
\draw[dashed] (12,-5) -- (13,-5);
\node at (12.5, -4.25) {$\ell=3$};
\node at (13.5, -3.75) {$\mathcal{A}$};
\node at (13.5, -4.25) {$||$};
\node at (11.8, -4.75) {$6$};
\node at (11.8, -5.75) {$8$};
\node at (13.5, -4.75) {$\overbrace{a_6}$};
\node at (13.5, -5.25) {$\vdots$};
\node at (13.5, -5.75) {$a_8$};
\node at (13.5, -6.25) {$\cdot$};
\node at (13.5, -6.5) {$\cdot$};
\node at (13.5, -6.75) {$\cdot$};
\node at (13.5, -7.25) {$\underbrace{a_{12}}$};
\node[rounded rectangle,draw,minimum width=3.7cm,minimum height=2.1cm,dotted,rotate=90] (r1) at (12.9,-5.5) {};
\draw[-latex] (14.2,-5.5) -- (15.5,-5.5);
\node at (15.75, -5.5) {$\cdot$};
\node at (16, -5.5) {$\cdot$};
\node at (16.25, -5.5) {$\cdot$};
\draw[-latex] (-1,-8.5) -- (17,-8.5);
\node at (16.75, -8.75) {$t$};
\draw[dashed] (1,-5.75) -- (1,-8.5);
\node at (1,-6) {\color{red} Instance 1};
\node at (1, -8.75) {$1$};
\draw[dashed] (5.9,-0.5) -- (5.9,-1.9);
\node at (5.9,-0.75) {\color{red} Instance 2};
\draw[dashed] (5.9,-7.25) -- (5.9,-8.5);
\node at (5.9,-7.5) {\color{red} Instance 3};
\node at (5.9, -8.75) {$t_1$};
\draw[dashed] (9.9,-0.5) -- (9.9,-8.5);
\node at (9.9,-0.75) {\color{red} Instance 4};
\node at (9.9, -8.75) {$t_2$};
\draw[dashed] (12.9,-2.85) -- (12.9,-3.4);
\node at (12.9,0) {\color{red} Instance 5};
\draw[dashed] (12.9,-7.75) -- (12.9,-8.5);
\node at (12.9,-8) {\color{red} Instance 6};
\node at (12.9, -8.75) {$t_3$};
\end{tikzpicture}
\caption{A flow chart demonstration for the algorithm. Each dotted circle represents a subinterval and runs an instance of \cref{alg:main}. The dashed line denotes the first position for each interval.}
\vspace{-0.3cm}
\label{fig:flow chart for algo}
\end{figure*}
The subroutine learns about the common unknown parameter vector by placing items in the first position of the interval
in proportion to a $G$-optimal design for the available items. The remaining items in $\mathcal{A}$ are placed in order into the remaining positions (Line 4).
This means that each item $a \in \mathcal{A}$ is placed exactly $T(a)$ times in the first position $k$ of the interval. The choice of $T(a)$ is based on the
phase number $\ell$ and the $G$-optimal design $\pi$ over $\mathcal{A}$ (Line 2). Note $T(a) = 0$ if $\pi(a)=0$. For example, if $\mathcal{A}=(a_1,\ldots,a_m)$ and $a_3$
is placed at the first position, then the rest positions are filled in as $a_1,a_2,a_4,a_5,\ldots,a_m$.
The subroutine runs for $\sum_{a\in \mathcal{A}} T(a)$ rounds.
The $G$-optimal design means that the number of rounds required to estimate the value of each item to a fixed precision depends only logarithmically on the number of items.
Higher phase number means longer experiment and also higher target precision.
Once all arms $a \in \mathcal{A}$ have been placed in the first position of the interval $T(a)$ times, {\tt RecurRank}\xspace estimates the attractiveness of the items in $\mathcal{A}$
using a least-squares estimator based on the data collected from the first position (Line 5).
The items are then ordered based on their estimated attractiveness. The subroutine then partitions the ordered items
when the difference between estimated attractiveness of consecutive items is sufficiently large (Line 7).
Finally the subroutine recursively calls {\tt RecurRank}\xspace on each partition for which there are positions available with an increased phase number with items sorted according to their empirical attractiveness (Line 8).
\begin{remark}
Items are eliminated entirely if at the end of a subroutine a partition is formed for which there are no available positions.
For example, consider the first instantiation of {\tt RecurRank}\xspace with $\ell = 1$ and $\mathcal K = [K]$ and $\mathcal{A} = \mathcal L$.
Suppose the observed data is such that $p = 2$ and $u_1 \geq K$, then items $a^{(u_1+1)},a^{(u_1+2)},\ldots,a^{(u_2)}$ will be discarded because the starting position
of the second partition would be larger than $K$.
\end{remark}
\begin{remark}
The least-squares estimator $\hat \theta$ defined in \cref{eq:lse} actually
does not have expectation $\theta$, which means the algorithm is not really estimating attractiveness. Our assumptions ensure that the expectation of $\hat \theta$ is proportional to $\theta$, however,
which is sufficient for our analysis. This is the reason for only using the first position within an interval for estimation.
\end{remark}
\begin{remark}
The subroutine only uses data collected during its own run. Not doing this would introduce bias that may be hard to control.
\end{remark}
\vspace{-0.3cm}
In \cref{fig:flow chart for algo}, the algorithm starts with Instance 1 of phase number $\ell=1$, all items and all positions. At time $t_1$, Instance 1 splits
into two, each with an increased phase number $\ell=2$. Instance 2 contains $3$ items and $3$ positions and Instance 3 contains $5$ positions but $22$ items.
The remaining items have been eliminated.
At time $t_2$, Instance 2 finishes running but has no split, so it calls Instance 4 with the same items, same positions but increased phase
number $\ell=3$. During time $t_1$ to $t_2$, Instance 2 and Instance 3 run in parallel and recommend lists together; during time $t_2$ to $t_3$, Instances 3 and 4
run in parallel and recommend lists together. At time $t_3$, Instance 3 finishes and splits into another two threads, both with increased phase number $\ell=3$.
Instance 5 contains exactly $2$ items and $2$ positions and Instance $6$ contains $3$ positions but $7$ items. Note that the involved items become even less. Right after time $t_3$, Instance $4,5,6$ run in parallel and recommend lists together.
{\tt RecurRank}\xspace has two aspects that one may think can lead to an unjustifiable increase of regret:
\emph{(i)} each subroutine only uses data from the first position to estimate attractiveness,
and \emph{(ii)} data collected by one subroutine is not re-used subsequently.
The second of these is relatively minor. Like many elimination algorithms, the halving of the precision means
that at most a constant factor is lost by discarding the data.
The first issue is more delicate. On the one hand, it seems distasteful not to use all available data. But the assumptions do not make it easy
to use data collected in later positions. And actually the harm may not be so great. Intuitively the cost of only using data from the
first position is greatest when the interval is large and the attractiveness varies greatly within the interval.
In this case, however, a split will happen relatively fast.
\paragraph{Running time}
The most expensive component is computing the $G$-optimal design.
This is a convex optimisation problem and has been studied extensively (see, \citealt[\S7.5]{BV04} and \citealt{Tod16}).
\todoc{So what is the running time for solving it??}
It is not necessary to solve the optimisation problem exactly.
Suppose instead we find a distribution $\pi$ on $\mathcal{A}$ with support at most $D(D+1)/2$ and for which
$\max_{a \in \mathcal{A}} \norm{a}_{Q(\pi)^{\dagger}}^2 \leq D$.
Then our bounds continue to hold with $d$ replaced by $D$.
Such approximations are generally easy to find.
For example, $\pi$ may be chosen to be a uniform distribution
on a volumetric spanner of $\mathcal{A}$ of size $D$.
\ifsup See Appendix~\ref{app:vspan} for a summary on volumetric spanners. \else
See the supplementary material for a summary of volumetric spanners. \fi
\citet{H16volumetric}
provide a randomized algorithm that returns a volumetric spanner of size at most $O(d \log(d) \log(\abs{\mathcal{A}}))$
with an expected running time of $O(\abs{\mathcal{A}} d^2)$.
For the remaining parts of the algorithm, the least-squares estimation is at most $O(d^3)$.
The elimination and partitioning run in $O(\abs{\mathcal{A}}d)$.
Note these computations happen only once for each instantiation.
The update for each partition in each round is $O(d^2)$.
The total running time is $O(Ld^2\log(T)+Kd^2T)$.
\section{Regret Analysis}
\label{sec:regret analysis}
Our main theorem bounds the regret of \cref{alg:main}.
\begin{theorem}\label{thm:upper}
There exists a universal constant $C > 0$ such that
the regret bound for Algorithm \ref{alg:main} with $\delta = 1/\sqrt{T}$ satisfies
\begin{align*}
R_T \le C K \sqrt{dT\log(LT)}\,.
\end{align*}
\end{theorem}
Let $I_\ell$ be the number of calls to {\tt RecurRank}\xspace{} with phase number $\ell$.
Hence each $i \in [I_\ell]$ corresponds to a call of {\tt RecurRank}\xspace{} with phase number $\ell$ and the arguments are denoted by
$\mathcal{A}_{\ell i}$ and $\mathcal K_{\ell i}$.
Abbreviate $K_{\ell i} = \min \mathcal K_{\ell i}$ for the first position of $\mathcal K_{\ell i}$, $M_{\ell i} = |\mathcal K_{\ell i}|$
for the number of positions and $\mathcal K_{\ell i}^+ = \mathcal K_{\ell i} \setminus \{K_{\ell i}\}$.
We also let $K_{\ell, I_\ell+1}=K+1$ and
assume that the calls $i \in [I_\ell]$ are ordered so that
\begin{align*}
1 = K_{\ell 1} < K_{\ell 2} < \cdots < K_{\ell I_\ell} \leq K < K+1 = K_{\ell, I_\ell+1}\,.
\end{align*}
The reader is reminded that $\chi^\ast_k = \chi(A^\ast, k)$ is the examination probability of the $k$th position under the optimal list.
Let $\chi_{\ell i} = \chi_{K_{\ell i}}^\ast$ be the shorthand for the optimal examination probability of the first position in call $(\ell, i)$.
We let $\hat \theta_{\ell i}$ be the least-squares estimator computed in \cref{eq:lse} in \cref{alg:main}.
The maximum phase number during the entire operation of the algorithm is $\ell_{\max}$.
\begin{definition}
Let $F$ be the failure event that there exists an $\ell \in [\ell_{\max}]$, $i \in [I_\ell]$ and $a \in \mathcal{A}_{\ell i}$ such that
\begin{align*}
\abs{\ip{\hat{\theta}_{\ell i}, a} - \chi_{\ell i} \ip{\theta_\ast, a}} \geq \Delta_\ell
\end{align*}
or there exists an $\ell \in [\ell_{\max}]$, $i \in [I_\ell]$ and $k \in \mathcal K_{\ell i}$ such that
$a_k^\ast \notin \mathcal{A}_{\ell i}$.
\end{definition}
The first lemma shows that the failure event occurs with low probability.
The proof follows the analysis in \citep[Chap. 22]{LS18book} and is summarised in
\ifsup
\cref{app:lem:failure}.
\else
the supplementary material.
\fi
\begin{lemma}\label{lem:failure}
$\Prob{F} \leq \delta$.
\end{lemma}
The proofs of the following lemmas are
\ifsup
provided in \cref{app:sec:proofs of technical lemmas}.
\else
also provided in the supplementary material.
\fi
\begin{lemma}
\label{lem:adjacent gap}
On the event $F^c$ it holds for any $\ell \in [\ell_{\max}]$, $i \in [I_\ell]$ and positions $k, k+1 \in \mathcal K_{\ell i}$ that
$\chi_{\ell i}
(\alpha(a_k^\ast) - \alpha(a_{k+1}^\ast)) \le 8\Delta_\ell$.
\end{lemma}
\begin{lemma}
\label{lem:suboptimal gap}
On the event $F^c$ it holds for any $\ell \in [\ell_{\max}]$ and $a \in \mathcal{A}_{\ell I_\ell}$ that
$\chi_{\ell I_\ell} (\alpha(a_K^\ast) - \alpha(a)) \le 8\Delta_\ell$.
\end{lemma}
\begin{lemma}\label{lem:first-subopt}
Suppose that in its $(\ell, i)$th call {\tt RecurRank}\xspace places item $a$
in position $k = K_{\ell i}$. Then, provided $F^c$ holds,
$\chi_{\ell i} \left(\alpha(a_k^*) - \alpha(a)\right) \leq 8 M_{\ell i}$.
\end{lemma}
\begin{lemma}
\label{lem:regret on lower positions}
Suppose that in its $(\ell, i)$th call {\tt RecurRank}\xspace places item $a$
in position $k \in \mathcal K_{\ell i}^+$. Then provided $F^c$ holds,
$\chi_{\ell i} \left(\alpha(a_k^\ast) - \alpha(a)\right) \leq 4\Delta_\ell$.
\end{lemma}
\begin{proof}[Proof of Theorem~\ref{thm:upper}]
The first step is to decompose the regret using the failure event:
\begin{align*}
R_T \leq \Prob{F} T K + \mathbb{E}\left[\sind{F^c}\! \sum_{t=1}^T \sum_{k=1}^K (v(A^*, k) - v(A_t, k))\right]\,.
\end{align*}
From now on we assume that $F^c$ holds and bound the term inside the expectation.
Given $\ell$ and $i \in [I_\ell]$ let $\mathcal T_{\ell i}$ be the set of rounds when algorithm $(\ell, i)$ is active.
Then
\begin{align}
\sum_{t=1}^T \sum_{k=1}^K (v(A^*, k) - v(A_t, k))
&= \sum_{\ell=1}^{\ell_{\max}} \sum_{i=1}^{I_\ell} R_{\ell i}\,,
\label{eq:decomp}
\end{align}
where $R_{\ell i}$ is the regret incurred during call $(\ell, i)$:
\begin{align*}
R_{\ell i} = \sum_{t \in \mathcal T_{\ell i}} \sum_{k \in \mathcal K_{\ell i}} (v(A^*, k) - v(A_t, k))\,.
\end{align*}
This quantity is further decomposed into the first position in $\mathcal K_{\ell i}$, which is used for exploration, and the
remaining positions:
\begin{align*}
R_{\ell i}^{(1)} &= \sum_{t \in \mathcal T_{\ell i}} (v(A^*, K_{\ell i}) - v(A_t, K_{\ell i}))\,. \\
R_{\ell i}^{(2)} &= \sum_{t \in \mathcal T_{\ell i}} \sum_{k \in \mathcal K_{\ell i}^+} (v(A^*, k) - v(A_t, k))\,.
\end{align*}
Each of these terms is bounded separately.
For the first term we have
\begin{align}
R_{\ell i}^{(1)}
&= \sum_{t \in \mathcal T_{\ell i}} (v(A^*, K_{\ell i}) - v(A_t, K_{\ell i})) \nonumber \\
&= \sum_{t \in \mathcal T_{\ell i}} \chi(A^*, K_{\ell i}) \alpha(a^*_{K_{\ell i}}) - \chi(A_t, K_{\ell i}) \alpha(A_t(K_{\ell i}))\nonumber \\
&= \sum_{t \in \mathcal T_{\ell i}} \chi_{\ell i} \left\{\alpha(a^*_{K_{\ell i}}) - \alpha(A_t(K_{\ell i}))\right\} \nonumber \\
&\leq 8 \sum_{t \in \mathcal T_{\ell i}} M_{\ell i} \Delta_\ell\,, \label{eq:relli1}
\end{align}
where the first equality is the definition of $R_{\ell i}^{(1)}$, the second is the definition of $v$.
The third inequality is true because event $F^c$ ensures that
\begin{align*}
\{A_t(k) : k < K_{\ell i}\} = \{a^*_k : k < K_{\ell i}\}\,,
\end{align*}
which combined with \cref{ass:perm} shows that $\chi(A^*, K_{\ell i}) = \chi(A_t, K_{\ell i}) = \chi_{\ell i}$.
The inequality in \cref{eq:relli1} follows from \cref{lem:first-subopt}.
Moving on to the second term,
\begin{align}
R_{\ell i}^{(2)}
&= \sum_{t \in \mathcal T_{\ell i}} \sum_{k \in \mathcal K_{\ell i}^+} (v(A^*, k) - v(A_t, k)) \nonumber \\
&\le \sum_{t \in \mathcal T_{\ell i}} \sum_{k \in \mathcal K_{\ell i}^+} \chi_k^\ast (\alpha(a^*_k) - \alpha(A_t(k))) \nonumber \\
&\leq \sum_{t \in \mathcal T_{\ell i}} \sum_{k \in \mathcal K_{\ell i}^+} \chi_{\ell i} (\alpha(a^*_k) - \alpha(A_t(k))) \nonumber \\
&\leq 4\sum_{t \in \mathcal T_{\ell i}} \sum_{k \in \mathcal K_{\ell i}^+} \Delta_\ell \label{eq:relli2} \\
&\leq 4\sum_{t \in \mathcal T_{\ell i}} M_{\ell i} \Delta_\ell\,, \nonumber
\end{align}
where the second inequality follows from \cref{ass:min} and the third inequality follows from \cref{ass:decrease} on ranking $A^\ast$.
The inequality in \cref{eq:relli2} follows from \cref{lem:regret on lower positions}
and the one after it from the definition of $M_{\ell i} = |\mathcal K_{\ell i}|$.
Putting things together,
\begin{align*}
(\ref{eq:decomp})
&= 12 \sum_{\ell=1}^{\ell_{\max}} \sum_{i\in I_\ell} |\mathcal T_{\ell i}| M_{\ell i} \Delta_\ell
\le 12 K \sum_{\ell=1}^{\ell_{\max}} \max_{i\in I_\ell} |\mathcal T_{\ell i}| \Delta_\ell\,, \numberthis
\label{eq:sumtosplit}
\end{align*}
where we used that $ \sum_{i\in I_\ell} M_{\ell i} = K$.
To bound $|\mathcal T_{\ell i}|$ note that, on the one hand,
$|\mathcal T_{\ell i}|\le T$ (this will be useful when $\ell$ is large),
while on the other hand,
by the definition of the algorithm and the fact that the $G$-optimal design is supported
on at most $d(d+1)/2$ points we have
\begin{align*}
\MoveEqLeft
|\mathcal T_{\ell i}|
\leq \sum_{a \in \mathcal{A}_{\ell i}} \ceil{\frac{2 d \pi(a) \log(1/\delta_{\ell})}{\Delta_\ell^2}} \\
&\leq \frac{d(d+1)}{2} + \frac{2 d \log(1/\delta_{\ell})}{\Delta_{\ell}^2}\,.
\end{align*}
We now split to sum in \eqref{eq:sumtosplit} into two.
For $1\le \ell_0 \le \ell_{\max}$ to be chosen later,
\begin{align*}
\MoveEqLeft
\sum_{\ell=1}^{\ell_0} \max_{i\in I_\ell} |\mathcal T_{\ell i}| \Delta_\ell
\le
\frac{d(d+1)}{2}
+
4 d \log(1/\delta_{\ell_0}) 2^{\ell_0}\,,
\end{align*}
while
\begin{align*}
\sum_{\ell=\ell_0+1}^{\ell_{\max}} \max_{i\in I_\ell} |\mathcal T_{\ell i}| \Delta_\ell
\le
T \sum_{\ell=\ell_0+1}^{\ell_{\max}} \Delta_\ell \le T 2^{-\ell_0}\,,
\end{align*}
hence,
\begin{align*}
(\ref{eq:decomp})
\le 12 K \left\{ \frac{d(d+1)}{2} + 4 d \log(1/\delta_{\ell_0}) 2^{\ell_0} +T 2^{-\ell_0} \right\}\,.
\end{align*}
The result is completed by optimising $\ell_0$.
\end{proof}
\iffalse
\begin{proof}[Proof of Theorem~\ref{thm:upper}]
For each position $k$, let its starting time for phase $\ell$ be $T_{k \ell}$. Then $T_{\cdot \ell}$ is the same on set $[K_{\ell i}, K_{\ell, i+1})$ for any $i \le I_\ell, \ell \ge 1$. Since there exists a $G$-optimal design $\pi^\ast$ with $\abs{\mathrm{Supp}(\pi^\ast)} \le d(d+1)/2$, the algorithm runs
\begin{align*}
T_{K_{\ell i}, \ell+1} - T_{K_{\ell i} \ell} \le \frac{2d \log(1/\delta_{\ell i})}{\Delta_\ell^2} + \frac{d(d+1)}{2}
\end{align*}
rounds on partition $(\ell, i)$.
The regret can be composed into partition level
\begin{align*}
R_T &= T \sum_{k=1}^K v(A^*, k) - \E{\sum_{t=1}^T \sum_{k=1}^K v(A_t, k)} \notag\\
&\le \sum_{\ell}^{\ell_{\max}} \sum_{i=1}^{I_\ell} R_{\ell i}
\end{align*}
where
\begin{align}
R_{\ell i} &= \sum_{t = T_{K_{\ell i} \ell}}^{T_{K_{\ell i} \ell+1}-1} \ \sum_{k=K_{\ell i}}^{K_{\ell, i+1}-1} \chi^\ast(k)\alpha(a_k^\ast) - \chi(A_t,k)\alpha(A_t(k)) \notag\\
&\le \sum_{t = T_{K_{\ell i} \ell}}^{T_{K_{\ell i} \ell+1}-1} \ \sum_{k=K_{\ell i}}^{K_{\ell, i+1}-1} \chi^\ast(k) (\alpha(a_k^\ast) - \alpha(A_t(k))) \notag\\
&\le \sum_{t = T_{K_{\ell i} \ell}}^{T_{K_{\ell i} \ell+1}-1} \Big( \chi^\ast(K_{\ell i})(\alpha(K_{\ell i})-\alpha(A_t(K_{\ell i}))) \notag\\
&\quad + \sum_{k=K_{\ell i}+1}^{K_{\ell, i+1}-1} \chi^\ast(k)\left(\alpha(a_k^\ast)-\alpha(A_t(k))\right) \Big)\notag\\
&\le \sum_{t = T_{K_{\ell i} \ell}}^{T_{K_{\ell i} \ell+1}-1} \Big( 16(K_{\ell, i+1} - K_{\ell i})\Delta_\ell \notag\\
&\quad +\sum_{k=K_{\ell i}+1}^{K_{\ell, i+1}-1}\chi^\ast(K_{\ell i})(\alpha(a_k^\ast)-\alpha(A_t(k)) \Big) \label{eq:by lemma 1 and 2}\\
&\le \sum_{t = T_{K_{\ell i} \ell}}^{T_{K_{\ell i} \ell+1}-1} \Big( 16(K_{\ell, i+1} - K_{\ell i})\Delta_\ell + \sum_{k=K_{\ell i}+1}^{K_{\ell, i+1}-1} 4\Delta_\ell\Big) \label{eq:by lemma 3}\\
&\le 20 \sum_{t = T_{K_{\ell i} \ell}}^{T_{K_{\ell i} \ell+1}-1} (K_{\ell, i+1} - K_{\ell i})\Delta_\ell \notag
\end{align}
and the first term in \eqref{eq:by lemma 1 and 2} states the gap between items in each partition can be bounded by adjacent gaps of first $K$ items (Lemma \ref{lem:adjacent gap}) and the gap between $K$-th best item and the suboptimal items (Lemma \ref{lem:suboptimal gap}), and the second term in \eqref{eq:by lemma 3} is by Lemma \ref{lem:regret on lower positions}.
Take $\ell_0 = \log\left(\frac{T}{8d\log(L\log(T)/\delta)}\right)$, then
\begin{align*}
R(T) &\le \sum_{\ell=1}^{\ell_0} \sum_{i=1}^{I_\ell} R_{\ell i} + \sum_{\ell > \ell_0} \sum_{i=1}^{I_\ell} R_{\ell i}\\
&\le \sum_{\ell=1}^{\ell_0} \sum_{i=1}^{I_\ell} \left(\frac{2d}{\Delta_\ell^2}\log\left(\frac{|\mathcal{A}_{\ell i}|\ell(\ell+1)}{\delta}\right) + \frac{d(d+1)}{2}\right) \\
&\qquad \cdot 20(K_{\ell, i+1} - K_{\ell i})\Delta_\ell\\
&\qquad + \sum_{\ell > \ell_0} \sum_{i=1}^{I_\ell} 20 \left(T_{K_{\ell i} \ell+1} - T_{K_{\ell i} \ell}\right) (K_{\ell, i+1} - K_{\ell i})\Delta_\ell\\
&\le \sum_{\ell=1}^{\ell_0} \sum_{i=1}^{I_\ell} \Bigg(40(K_{\ell, i+1} - K_{\ell i}) \frac{d}{\Delta_\ell}\log\left(\frac{L\ell(\ell+1)}{\delta}\right) \\
&\qquad + 10 (K_{\ell, i+1} - K_{\ell i}) d(d+1)\Delta_\ell \Bigg) \\
&\qquad + \sum_{\ell > \ell_0} \sum_{i=1}^{I_\ell} \sum_{k=K_{\ell i}}^{K_{\ell, i+1}-1} 20 \left(T_{k,\ell+1} - T_{k \ell}\right) \Delta_\ell\\
&\le \sum_{\ell=1}^{\ell_0} \Bigg(80 K \frac{d}{\Delta_\ell}\log\left(\frac{L\log(T)}{\delta}\right) + 10 K d(d+1)\Delta_\ell \Bigg) \\
&\qquad + \sum_{k=1}^K 20\Delta_{\ell_0} \sum_{\ell > \ell_0} \left(T_{k,\ell+1} - T_{k \ell}\right) \\
&\le 160 K \frac{d}{\Delta_{\ell_0}}\log\left(\frac{L\log(T)}{\delta}\right) + 20 K d(d+1) \\
&\qquad + 20 K\Delta_{\ell_0}T\\
&\le 60 K\sqrt{dT\log\left(\frac{L\log(T)}{\delta}\right)} + 20 K d(d+1)
\end{align*}
Take $\delta = \frac{1}{T}$ to get the result.
\end{proof}
\fi
\section{Proof of Lemma~\ref{lem:failure}}\label{app:lem:failure}
In what follows, we add the index $(\ell,i)$ to any symbol used in the algorithm to indicate the value that it takes in the $(\ell,i)$ call. For example, $\mathcal D_{\ell i}$ denotes the data multiset collected in the $(\ell,i)$ call, $T_{\ell i}(a)$ be the value computed in \cref{eq:allocchoice}, etc.
Fix $\ell\ge 1$
and let $F_\ell$ be the failure event that there exists an $i \in [I_\ell]$ and $a \in \mathcal{A}_{\ell i}$ such that
\begin{align*}
\abs{\ip{\hat{\theta}_{\ell i}, a} - \chi_{\ell i} \ip{\theta_\ast, a}} \geq \Delta_\ell\,.
\end{align*}
Let $E_\ell$ be the event that for any $i \in [I_\ell]$,
the examination probability on the first position of the call $(\ell, i)$ is $\chi_{\ell i}$.
For the argument that follows, let us assume that $E_\ell$ holds.
By our modelling assumptions (\cref{eq:click,eq:clickfactor,eq:clicklinear}),
for any $(\beta, \zeta) \in \mathcal D_{\ell i}$,
\begin{align*}
\zeta = \ip{\chi_{\ell i}\theta_\ast, \beta} + \eta_{(\beta, \zeta)}\,,
\end{align*}
where $\{\eta_{(\beta, \zeta)}\}_{(\beta, \zeta)}$ is a conditionally $1/2$-subgaussian sequence.
Define the Gram matrix $Q$ for any probability mass function $\pi:\mathcal{A} \to [0,1]$, $\sum_{a \in \mathcal{A}} \pi(a) = 1$, as $Q(\pi) = \sum_{a \in \mathcal{A}} \pi(a) aa^\top$.
By the Kiefer-Wolfowitz theorem \cite{KW60},
\begin{align*}
\max_{a \in \mathcal{A}_{\ell i}} \norm{a}_{Q(\pi_{\ell i})^{\dagger}}^2 = \mathrm{rank}(\mathcal{A}) \le d\,,
\end{align*}
where $Q^\dagger$ denotes the Moore-Penrose inverse of $Q$. Then, by \cref{eq:allocchoice},
\begin{align*}
V_{\ell i} &=\sum_{a \in \mathcal{A}_{\ell i}} T_{\ell i}(a) aa^\top
\succeq \frac{d}{2\Delta_\ell^2}\log\left(\frac{\abs{\mathcal{A}_{\ell i}} }{\delta_\ell}\right)Q(\pi_{\ell i})\,,
\end{align*}
where $P\succeq Q$ denotes that $P$ precedes $Q$ in the Loewner partial ordering of positive semi-definite (symmetric) matrices.
This implies that
\begin{align*}
\norm{a}_{V_{\ell i}^{\dagger}}^2
&\le \frac{2\Delta_\ell^2}{d} \frac{1}{\log\left(\frac{\abs{\mathcal{A}_{\ell i}} }{\delta_\ell}\right)} \norm{a}_{Q(\pi_{\ell i})^{\dagger}}^2 \\
&\le 2\Delta_\ell^2 \frac{1}{\log\left(\frac{\abs{\mathcal{A}_{\ell i}} }{\delta_\ell}\right)} \,.
\end{align*}
Rearranging shows that
\begin{align}
\Delta_\ell &\ge \sqrt{\frac{1}{2} \norm{a}_{V_{\ell i}^{\dagger}}^2 \log\left(\frac{\abs{\mathcal{A}_{\ell i}} }{\delta_\ell}\right)}\,. \label{eq:Delta ell}
\end{align}
Now note that
\begin{align*}
&\ip{\hat{\theta}_{\ell i} - \chi_{\ell i} \theta_\ast, a}\\
=& \ip{V_{\ell i}^{\dagger}\sum_{(\beta, \zeta) \in \mathcal D_{\ell i}} \beta \zeta - \chi_{\ell i} \theta_\ast, a}\\
=& \ip{V_{\ell i}^{\dagger}\sum_{(\beta, \zeta) \in \mathcal D_{\ell i}} \beta (\beta^{\top} \theta_\ast \chi_{\ell i} + \eta_{(\beta, \zeta)}) - \chi_{\ell i} \theta_\ast, a}\\
=&\chi_{\ell i} \ip{(V_{\ell i}^{\dagger} V_{\ell i}-I) \theta_\ast, a} + \ip{V_{\ell i}^{\dagger}\sum_{(\beta, \zeta) \in \mathcal D_{\ell i}}\beta \eta_{(\beta, \zeta)}, a}\\
=&\sum_{(\beta, \zeta) \in \mathcal D_{\ell i}} \ip{V_{\ell i}^{\dagger} \beta, a} \ \eta_{(\beta, \zeta)}\,. \numberthis
\label{eq:noise}
\end{align*}
The last equality follows from $I - V_{\ell i}^{\dagger} V_{\ell i}$ is the orthogonal projection on the kernel of $V_{\ell i}$, which is the
orthogonal complement of $\mathcal{A}_{\ell i}$, and thus will map each $a \in \mathcal{A}_{\ell i}$ to the zero vector.
Then, for any $a \in \mathcal{A}_{\ell i}$,
\begin{align*}
&\mathbb{P}\left(\abs{\ip{\hat{\theta}_{\ell i} - \chi_{\ell i} \theta_\ast, a}} \ge \Delta_\ell \right) \\
&\le \mathbb{P}\left(\abs{\ip{\hat{\theta}_{\ell i} - \chi_{\ell i} \theta_\ast, a}} \ge \sqrt{\frac{1}{2} \norm{a}_{V_{\ell i}^{\dagger}}^2 \log\left(\frac{\abs{\mathcal{A}_{\ell i}} }{\delta_\ell}\right)} \right)\\
&\le \frac{2\delta_\ell}{\abs{\mathcal{A}_{\ell i}}}\,.
\end{align*}
The first inequality is by \cref{eq:Delta ell}.
The second inequality is by \cref{eq:noise},
the concentration bound on conditional subgaussian sequences \citep[Lemma 5.2 and Theorem 5.1]{LS18book},
and $\sum_{(\beta, \zeta) \in \mathcal D_{\ell i}}\ip{V_{\ell i}^{\dagger}\beta, a}^2 = \norm{a}_{V_{\ell i}^{\dagger}}^2$.
Thus with probability at least $1 - 2\delta_\ell$,
\begin{align*}
\abs{\ip{\hat{\theta}_{\ell i} - \chi_{\ell i} \theta_\ast, a}} \le \Delta_\ell
\end{align*}
holds for any $a \in \mathcal{A}_{\ell i}$ and thus from $I_\ell\le K$, we get that
\begin{align}
\Prob{F_\ell \cap E_\ell} \le 2K\delta_\ell\,.
\label{eq:fllell}
\end{align}
Now we prove by induction on $\ell$ that on the complementer of $F_{1:\ell-1}=F_1\cup \dots \cup F_{\ell-1}$ (with $F_{1:0}=\emptyset$)
the following hold true:
{\em (i)}
the examination probability on the first position of the call $(\ell, i)$ is $\chi_{\ell i}$ for any $i \in [I_\ell]$;
{\em (ii)}
$a_{K_{\ell I_\ell}}^\ast, \ldots, a_K^\ast$ are the $M_{\ell I_{\ell}}$ best items in $\mathcal{A}_{\ell I_{\ell}}$ and
that
{\em (iii)} for any $i,j\in [I_{\ell}]$, $i<j$, and $a\in \mathcal{A}_{\ell i}$, $a'\in \mathcal{A}_{\ell j}$, it holds that $\alpha(a)<\alpha(a')$
(note that {\em (ii)} and {\em (iii)} just mean that the algorithm does not make a mistake when it eliminates items or splits blocks).
The claim is obviously true for $\ell=1$.
In particular,
the examination probability on the first position of the call $(\ell=1, i=1)$ is $\chi_{1,1}$ by \cref{ass:perm}.
Now, let $\ell\ge 1$ and
suppose $F_{1:\ell}$ does not hold.
If $\ip{\hat{\theta}_{\ell i}, a} - \ip{\hat{\theta}_{\ell i}, a'} \ge 2\Delta_{\ell}$
for some $a, a' \in \mathcal{A}_{\ell i}$ and $i\in [I_\ell]$, then by {\em (i)} of the induction hypothesis,
\begin{align*}
\chi_{\ell i} \ip{\theta_\ast, a} &> \ip{\hat{\theta}_{\ell i}, a} - \Delta_{\ell} \\
&\ge \ip{\hat{\theta}_{\ell i}, a'} + \Delta_{\ell} > \chi_{\ell i} \ip{\theta_\ast, a'}\,,
\end{align*}
thus $\alpha(a) > \alpha(a')$.
If $a \in \mathcal{A}_{\ell I_{\ell}}$ is eliminated at the end of call $(\ell, I_\ell)$, there exists $m = M_{\ell I_{\ell}}$ different items $b_1, \ldots, b_m \in \mathcal{A}_{\ell I_{\ell}}$ such that $\ip{\hat{\theta}_{\ell i}, b_j} - \ip{\hat{\theta}_{\ell i}, a} \ge 2\Delta_{\ell}$ for all $j \in [m]$. Thus $\alpha(b_j) > \alpha(a)$ for all $j \in [m]$. Since, by induction, $a_{K_{\ell I_\ell}}^\ast, \ldots, a_K^\ast$ are $m$ best items in $\mathcal{A}_{\ell I_{\ell}}$,
then $\alpha(a) < \alpha(a_K^\ast)$. This shows that {\em (ii)} will still hold for $\mathcal{A}_{\ell+1, I_{\ell+1}}$.
If there is a split $\mathcal{A}_1, \ldots, \mathcal{A}_p$ and $\mathcal K_1, \ldots, \mathcal K_p$ on $\mathcal{A}_{\ell i}$ and $\mathcal K_{\ell i}$
by the algorithm, $\ip{\hat{\theta}_{\ell i}, a} - \ip{\hat{\theta}_{\ell i}, a'} \ge 2\Delta_{\ell}$ for any $a \in \mathcal{A}_j, a'\in \mathcal{A}_{j+1}, j \in [p-1]$.
Then $\alpha(a) > \alpha(a')$.
So the better arms are put at higher positions,
which combined with that {\em (iii)} holds at stage $\ell$ shows that
{\em (iii)} will still continue to hold for $\ell+1$.
Finally, it also follows that
$\chi_{\ell+1, i} = \chi_{K_{\ell+1,i}}^\ast$ is the examination probability of the first position for any call $(\ell+1, i)$ of phase $\ell+1$, showing that {\em (i)} also continues to hold for phase $\ell+1$.
From this argument it follows that $F_{1:\ell-1}^c \subset E_\ell$ holds for all $\ell\ge 1$.
Then,
\begin{align*}
F
& = (F_{1:1}\cap F_{1:0}^c) \cup (F_{1:2} \cap F_{1:1}^c) \cup (F_{1:3} \cap F_{1:2}^c) \cup \dots\\
& \subset (F_{1:1} \cap E_1) \cup (F_{1:2} \cap E_2) \cup (F_{1:3} \cap E_{3}) \cup \dots\,.
\end{align*}
Taking probabilities and using \eqref{eq:fllell}, we get
\begin{align*}
\Prob{F} = \sum_{\ell\ge 1} \Prob{ F_{1:\ell} \cap E_\ell } \le \delta\,,
\end{align*}
finishing the proof.
\section{Volumetric Spanners}\label{app:vspan}
A volumetric spanner of compact set $\mathcal K \subset \mathbb{R}^d$ is a finite set $S = \{x_1,\ldots,x_n\} \subseteq \mathcal K$ such that
\begin{align*}
\mathcal K \subseteq \mathcal{E}(S) = \set{\sum_{i=1}^n \alpha_i x_i : \norm{\alpha}_2 \leq 1}\,.
\end{align*}
Let $\pi$ be a uniform distribution on $S$ and
\begin{align*}
Q = \sum_{i=1}^n \pi(x_i) x_i x_i^\top\,.
\end{align*}
If $S$ is a volumetric spanner of $\mathcal K$,
for any $x \in \mathcal K$ it holds that $\norm{x}_{Q^{\dagger}}^2 \leq n$.
To see this let $U \in \mathbb{R}^{d \times n}$ be the matrix with columns equal to the elements in $S$, which means that $Q = U U^\top/n$.
Since $x \in \mathcal K$ there exists an $\alpha \in \mathbb{R}^n$ with $\norm{\alpha}_2 \leq 1$ such that $x = U\alpha$.
Then
\begin{align*}
x^\top Q^{\dagger} x
&= n\alpha^\top U^\top (U U^\top)^{\dagger} U \alpha \\
&= n\alpha^\top U^{\dagger} U \alpha \\
&\leq n \norm{\alpha}_2^2 \\
&\leq n\,.
\end{align*}
Any compact set admits a volumetric spanner of size $n \leq 12d$, hence by \cref{eq:gopt}, a volumetric spanner is a ``$12$-approximation'' to the $G$-optimal design problem.
For finite $\mathcal K$ with $n$ points in it, the and for $\epsilon>0$ fixed, a spanner of size $12(1+\epsilon)d$ can be computed in $O(n^{3.5} + d n^3 + n d^3)$ time \citep[Theorem 3]{H16volumetric}.
\todoc{There is a $\log(1/\epsilon)$, which is suppressed.}
\section{Proofs of Technical Lemmas}
\label{app:sec:proofs of technical lemmas}
\begin{proof}[Proof of \cref{lem:adjacent gap}]
Let $F^c$ hold.
Since $\Delta_1 = 1/2$, the result is trivial for $\ell = 1$.
Suppose $\ell > 1$, the lemma holds for all $\ell' < \ell$ and that there exists a pair $k, k+1 \in \mathcal K_{\ell i}$ satisfying
$\chi_{\ell i}
(\alpha(a_k^\ast) - \alpha(a_{k+1}^\ast)) > 8\Delta_\ell$.
Let $(\ell-1,j)$ be the parent of $(\ell, i)$, which satisfies $a_k^\ast, a_{k+1}^\ast \in \mathcal{A}_{\ell i} \subseteq \mathcal{A}_{\ell-1,j}$.
Since $K_{\ell - 1,j} \leq K_{\ell i}$ it follows from \cref{ass:decrease} and the definition of $F$ that $\chi_{\ell-1,j} \ge \chi_{\ell i}$ and hence
\begin{align*}
\chi_{\ell-1,j} \left(\alpha(a_k^\ast) - \alpha(a_{k+1}^\ast)\right) > 8\Delta_\ell = 4 \Delta_{\ell - 1}\,,
\end{align*}
where we used the definition of $\Delta_\ell = 2^{-\ell}$.
Given any $m, n \in \mathcal K_{\ell-1,j}$ with $m \le k < k+1 \le n$ we have
\begin{align*}
\ip{\hat{\theta}_{\ell-1, j}, a_m^\ast}
&\ge \chi_{\ell-1,j} \alpha(a_m^\ast) - \Delta_{\ell-1} \\
&\ge \chi_{\ell-1,j} \alpha(a_k^\ast) - \Delta_{\ell-1} \\
&> \chi_{\ell-1,j} \alpha(a_{k+1}^\ast) + 3\Delta_{\ell-1} \\
&\ge \chi_{\ell-1,j} \alpha(a_n^\ast) + 3\Delta_{\ell-1} \\
&\ge \ip{\hat{\theta}_{\ell-1, j}, a_n^\ast} + 2\Delta_{\ell-1}\,.
\end{align*}
The first and fifth inequalities are because $F$ does not hold. The third inequality is due to induction assumption on phase $\ell-1$.
Hence by the definition of the algorithm the items $a_k^\ast$ and $a_{k+1}^\ast$ will be split into different partitions by
the end of call $(\ell-1,j)$, which is a contradiction.
\end{proof}
\begin{proof}[Proof of \cref{lem:suboptimal gap}]
We use the same idea as the previous lemma.
Let $F^c$ hold.
The result is trivial for $\ell = 1$. Suppose $\ell > 1$, the lemma holds for $\ell' < \ell$ and there exists an $a \in \mathcal{A}_{\ell I_\ell}$ satisfying
$\chi_{\ell I_\ell} (\alpha(a_K^\ast) - \alpha(a)) > 8\Delta_\ell$.
By the definition of the algorithm and $F$ does not hold, $a, a_K^\ast \in \mathcal{A}_{\ell-1,I_{\ell-1}}$ and hence
\begin{align*}
\chi_{\ell-1,I_{\ell-1}} \left(\alpha(a_K^\ast) - \alpha(a)\right) > 4\Delta_{\ell-1} \,.
\end{align*}
For any $m \in \mathcal K_{\ell-1,I_{\ell-1}}$ with $m \leq K$ it holds that
\begin{align*}
\ip{\hat{\theta}_{\ell-1,I_{\ell-1}}, a_m^\ast}
&\ge \chi_{\ell-1,I_{\ell-1}} \alpha(a_m^\ast) - \Delta_{\ell-1} \\
&\ge \chi_{\ell-1,I_{\ell-1}} \alpha(a_K^\ast) - \Delta_{\ell-1} \\
&> \chi_{\ell-1,I_{\ell-1}} \alpha(a) + 3\Delta_{\ell-1} \\
&\ge \ip{\hat{\theta}_{\ell-1,I_{\ell-1}}, a} + 2\Delta_{\ell-1} \,.
\end{align*}
Hence there exist at least $M_{\ell-1,I_{\ell-1}}$ items $b \in \mathcal{A}_{\ell-1,I_{\ell-1}}$ for which $\ip{\hat \theta_{\ell-1,I_{\ell-1}}, b - a} \geq 2\Delta_{\ell - 1}$.
But if this was true then by the definition of the algorithm
(cf. line~7)
item $a$ would have been eliminated by the end of call $(\ell-1,I_{\ell-1})$, which is a contradiction.
\end{proof}
\begin{proof}[Proof of \cref{lem:first-subopt}]
Let $F^c$ hold.
Suppose that $i < I_\ell$ and abbreviate $m = M_{\ell i}$. Since $F$ does not hold it follows that $a \in \{a^*_k, \ldots,a^*_{k+m-1}\}$.
By \cref{lem:adjacent gap},
\begin{align*}
\chi_{\ell i} \left(\alpha(a_k^*) - \alpha(a)\right)
&\leq \chi_{\ell i} \left(\alpha(a_k^\ast) - \alpha(a_{k+m-1}^\ast)\right) \\
&= \sum_{j=0}^{m-2} \chi_{\ell i} \left(\alpha(a^\ast_{k+j}) - \alpha(a^\ast_{k+j+1})\right) \\
&\leq 8(m-1) \Delta_\ell\,.
\end{align*}
Now suppose that $i = I_\ell$. Then by \cref{lem:suboptimal gap} and the same argument as above,
\begin{align*}
&\chi_{\ell i} \left(\alpha(a_k^*) - \alpha(a)\right) \\
&\qquad = \chi_{\ell i} \left(\alpha(a_K^*) - \alpha(a)\right) + \chi_{\ell i} \left(\alpha(a_k^*) - \alpha(a_K^*)\right) \\
&\qquad \leq 8m\Delta_\ell\,.
\end{align*}
The claim follows by the definition of $m$.
\end{proof}
\begin{proof}[Proof of \cref{lem:regret on lower positions}]
The result is immediate for $\ell = 1$. From now on assume that $\ell > 1$ and let $(\ell-1,j)$ be the parent of $(\ell, i)$.
Since $F$ does not hold, $\{a^*_m : m \in \mathcal K_{\ell i}\} \subseteq \mathcal{A}_{\ell i}$.
It cannot be that $\ip{\hat \theta_{\ell-1,j}, a^*_m - a} > 0$ for all $m \in \mathcal K_{\ell i}$ with $m \leq k$, since this would
mean that there are $k-K_{\ell i}+2$ items that precede item $a$ and hence item $a$ would not be put in position $k$ by the algorithm.
Hence there exists an $m \in \mathcal K_{\ell i}$ with $m \leq k$ such that $\ip{\hat \theta_{\ell-1,j}, a^*_m - a} \leq 0$ and
\begin{align*}
\chi_{\ell i} (\alpha(a_k^\ast) - \alpha(a))
&\leq \chi_{\ell i} (\alpha(a_m^\ast) - \alpha(a)) \\
&\le \chi_{\ell-1, j} (\alpha(a_m^\ast) - \alpha(a)) \\
&\leq \ip{\hat \theta_{\ell - 1,j}, a_m^\ast - a} + 2\Delta_{\ell - 1} \\
&\leq 2\Delta_{\ell - 1} = 4\Delta_\ell\,,
\end{align*}
which completes the proof.
\end{proof}
\begin{table}[thb!]
\centering
\begin{tabular}{l|r|r|r}
& {\tt RecurRank}\xspace{} & {\tt CascadeLinUCB}\xspace{} &{\tt TopRank}\xspace{}\\
\hline
CM &$0.53$ &$0.17$ &$106.10$\\
\hline
PBM &$68,943$ &$227,736$ &$745,177$\\
\hline
ML &$42,157$ &$180,256$ &$114,288$\\
\hline
\end{tabular}
\caption{The total regret under (a) CM (b) PBM and (c) ML.
The number shown are computed by taking the average over the $10$ random runs.}
\label{tab:reg}
\end{table}
\begin{table}[thb!]
\centering
\begin{tabular}{l|r|r|r}
Time (s) & \footnotesize {\tt RecurRank}\xspace & \footnotesize {\tt CascadeLinUCB}\xspace & \footnotesize {\tt TopRank}\xspace \\
\hline
CM &$51$ &$411$ &$176,772$\\
\hline
PBM &$310$ &$4,147$ &$367,509$\\
\hline
ML &$234$ &$916$ &$4,868$\\
\hline
\end{tabular}
\caption{The total running time of the compared algorithms in seconds (s). The results are averaged over $10$ random runs.}
\label{tab:time}
\end{table}
\section{Quantity Results for Experiments}
\label{app:sec:quantity results for experiments}
The regrets of \cref{fig:results} at the end are given in the \cref{tab:reg}, while total running times (wall-clock time) are shown in \cref{tab:time}. The experiments are run on Dell PowerEdge R920 with CPU of Quad Intel Xeon CPU E7-4830 v2 (Ten-core 2.20GHz) and memory of 512GB.
\section{Discussion}\label{sec:discussion}
\paragraph{Assumptions}
Our assumptions are most closely related to the work by \citet{LKLS18ranking} and \citet{ZTG17}.
The latter work also assumes a factored model where the probability of clicking on an item factors into an examination probability and an attractiveness function.
None of these works make use of features to model the attractiveness of items:
They are a special case of our model when we set the features of items to be orthogonal to each other (in particular, $d=L$).
Our assumptions on the examination probability function are weaker than those by \citet{ZTG17}.
Despite this, our regret upper bound is better by a factor of $K$ (when setting $d=L$) and the analysis is also simpler.
The paper by \citet{LKLS18ranking}
does not assume a factored model, but instead places assumptions directly on $v$.
They also assume a specific behaviour of the $v$ function under pairwise exchanges that is not required here.
Their assumptions are weaker in the sense that they do not assume the probability of clicking on position $k$ only depends on the identities of the items in positions $[k-1]$ and the attractiveness of the item in position $k$.
On the other hand, they do assume a specific behaviour of the $v$ function under pairwise exchanges that is not required by our analysis.
It is unclear which set of these assumptions is preferable.
\vspace{-0.3cm}
\paragraph{Lower bounds}
In the orthogonal case where $d = L$ the lower bound in \cite{LKLS18ranking} provides an example where the regret is
at least $\Omega(\sqrt{T K L})$. For $d \leq L$, the standard techniques for proving lower bounds for linear bandits can be used
to prove the regret is at least $\Omega(\sqrt{d TK})$, which except for logarithmic terms means our upper bound is suboptimal by a factor of
at most $\sqrt{K}$. We are not sure whether either the lower bound or the upper bound is tight.
\vspace{-0.3cm}
\paragraph{Open questions}
Only using data from the first position seems suboptimal, but is hard to avoid without making additional assumptions.
Nevertheless, we believe a small improvement should be possible here.
Another natural question is how to deal with the situation when the set of available items is changing. In practice this happens in many applications, either
because the features are changing or because new items are being added or removed.
Other interesting directions are to use weighted least-squares estimators to exploit the low variance when the examination probability and attractiveness are small.
Additionally one can use a generalised linear model instead of the linear model to model the attractiveness function, which may be analysed
using techniques developed by \citet{FCGS10} and \citet{JBNW17}.
Finally, it could be interesting to generalise to the setting where item vectors are sparse (see \citealt{APS12} and \citealt[Chap. 23]{LS18book}).
\section{Experiments}
\begin{figure*}[thb!]
\centering
\includegraphics[width=0.32\textwidth,height=3.5cm]{figs/CM.pdf}
\includegraphics[width=0.32\textwidth,height=3.5cm]{figs/PBM.pdf}
\includegraphics[width=0.32\textwidth,height=3.5cm]{figs/ML.pdf}
\caption{
The figures compare {\tt RecurRank}\xspace{} (red) with {\tt CascadeLinUCB}\xspace{} (black) and {\tt TopRank}\xspace{} (blue).
Subfigure (a) shows results for an environment that follows
the cascade click model (CM), while subfigure (b) does the same for the position-based click model (PBM).
On these figures, regret over time is shown (smaller is better).
In both models there are $L=10^4$ items and $K=10$ positions, and the feature space dimension is $d=5$.
Note the logarithmic scale of the $y$ axis on subfigure (a).
Subfigure (c) shows the regret over time on the MovieLens dataset with $L=10^3$, $d=5$, $K=10$.
All results are averaged over $10$ random runs. The error bars are standard errors.
}
\vspace{-0.1cm}
\label{fig:results}
\end{figure*}
We run experiments to compare {\tt RecurRank}\xspace{} with {\tt CascadeLinUCB}\xspace{} \cite{LWZC16,ZNK16} and {\tt TopRank}\xspace{} \cite{LKLS18ranking}.
\paragraph{Synthetic experiments}
We construct environments using the cascade click model (CM) and the position-based click model (PBM) with $L=10^4$
items in $d=5$ dimension to be displayed in $K=10$ positions.
We first randomly draw item vectors $\mathcal L$ and weight vector $\theta_\ast$ in $d-1$ dimension with each entry a standard Gaussian variable, then normalise, add one more dimension with constant $1$, and divide by $\sqrt{2}$.
The transformation is as follows:
\begin{align}
x\mapsto \left(\frac{x}{\sqrt{2}\norm{x}},\ \frac{1}{\sqrt{2}}\right)\,. \label{eq:transform x}
\end{align}
This transformation on both the item vector $x \in \mathcal L \subset \mathbb{R}^d$ and weight vector $\theta_\ast$ is to guarantee the attractiveness $\ip{\theta_\ast, x}$ of each item $x$ lies in $[0,1]$.
The position bias for PBM is set as $\left(1,\frac{1}{2},\frac{1}{3},\ldots,\frac{1}{K}\right)$ which is often adopted in applications \cite{wang2018position}.
The evolution of the regret as a function of time is shown in \cref{fig:results}(a)(b). The regrets at the end and total running times are given in
\ifsup
\cref{app:sec:quantity results for experiments}.
\else
the supplementary material.
\fi
{\tt CascadeLinUCB}\xspace{} is best in CM but worst in PBM because of its modelling bias.
{\tt TopRank}\xspace{} takes much longer time to converge than either
{\tt CascadeLinUCB}\xspace{} or {\tt RecurRank}\xspace since it neither exploits the specifics of the click model, nor does it use the linear structure.
\paragraph{MovieLens dataset} We use the
$20m$ MovieLens dataset \cite{harper2016movielens}
which contains $20$ million ratings for $2.7\times 10^4$ movies by $1.38 \times 10^5$ users. We extract $L=10^3$ movies with most ratings and $1.1 \times 10^3$ users who rate most and randomly split the user set to two parts, $U_1$ and $U_2$ with $\abs{U_1}=100$ and $\abs{U_2}=10^3$. We then use the rating matrix of users in $U_1$ to derive feature vectors with $d=5$ for all movies by singular-value decomposition (SVD). The resulting feature vectors $\mathcal L$ are also processed as \eqref{eq:transform x}. The true weight vector $\theta_\ast$ is computed by solving the linear system of $\mathcal L$ w.r.t. the rating matrix of $U_2$. The environment is the document-based click model (DBM) with $\mathcal L$ and $\theta_\ast$ and we set $K=10$. The performances are measured in regret, as shown in \cref{fig:results}(c). As can be seen, {\tt RecurRank}\xspace learns faster than the other two algorithms. Of these two algorithms, the performance of {\tt CascadeLinUCB}\xspace saturates: this is due to its incorrect bias.
\section{Introduction}
Let $\mathcal L$ be a large set of items to be ranked. For example, a database of movies, news articles or search results.
We consider a sequential version of the ranking problem where in each round
the learner chooses an ordered list of $K$ distinct items from $\mathcal L$ to show the user.
We assume the feedback comes in the form of clicks and the learner's objective is
to maximise the expected number of clicks over $T$ rounds.
Our focus is on the case where $\mathcal L$ is large (perhaps millions) and $K$ is relatively small (fifty or so).
There are two main challenges that arise in online ranking problems:
(a) The number of rankings grows exponentially in $K$, which makes learning one parameter for each ranking a fruitless endeavour.
Click models may be used to reduce the dimensionality of the learning problem, but balancing generality of the model with learnability is a serious challenge. The majority of previous
works on online learning to rank have used unstructured models, which are not well suited to our setting where $\mathcal L$ is large.
(b) Most click models depend on an unknown attractiveness function that endows the item set with an order. This yields a model with at least $|\mathcal L|$ parameters,
which is prohibitively large in the applications we have in mind.
The first challenge is tackled by adapting the flexible click models introduced in \cite{ZTG17,LKLS18ranking} to our setting.
For the second we follow previous works on bandits with large action sets by assuming the attractiveness function can be
written as a linear function of a relatively small number of features.
\paragraph{Contribution}
We make several contributions:
\begin{itemize}
\item A new model for
ranking problems with features is proposed that generalises previous work \cite{LWZC16,ZNK16,LLZ18} by relaxing the relatively restrictive assumptions
on the probability that a user clicks on an item. The new model is strictly more robust than previous works focusing on regret analysis for large item sets.
\item We introduce a novel polynomial-time algorithm called {\tt RecurRank}\xspace{}. The algorithm operates recursively over an increasingly fine set of partitions of $[K]$. Within each
partition the algorithm balances exploration and exploitation, subdividing the partition once it becomes sufficiently certain about the suboptimality
of a subset of items.
\item A regret analysis shows that the cumulative regret of {\tt RecurRank}\xspace{} is at most
$R_T = O(K \sqrt{d T \log(LT})$, where $K$ is the number of positions, $L$ is the number of items
and $d$ is the dimension of the feature space. Even in the
non-feature case where $L = d$ this improves on the state-of-the-art by a factor of $\sqrt{K}$.
\end{itemize}
A comparison with most related work is shown in Table \ref{table:full comparisons with related work}.
\begin{table*}
\label{table:full comparisons with related work}
\caption{This table compares settings and regret bounds of most related works on online learning to rank. $T$ is the number of total rounds, $K$ is the number of positions, $L$ is the number of items and $d$ is the feature space dimension. $\Delta$ is the minimal gap between the expected click rate of the best items and the expected click rate of the suboptimal items. }
\centering
\small
\renewcommand{\arraystretch}{1}
\begin{tabularx}{\textwidth}{@{}XlXp{3cm}}
\toprule
&Context &Click Model & Regret \\
\midrule
\citet{KSWA15}&- &Cascade Model (CM) &$\displaystyle \Theta\left(\frac{L}{\Delta}\log(T)\right)$\\
\midrule
\citet{LWZC16} \newline \citet{ZNK16} \newline \citet{li18clustering} & (Generalised) Linear Form &CM &$\displaystyle O\left(d\sqrt{TK}\log(T)\right)$ \\
\midrule
\citet{KKS16} &- &Dependent Click Model (DCM) &$\displaystyle \Theta\left(\frac{L}{\Delta}\log(T)\right)$\\
\midrule
\citet{LLZ18} & Generalised Linear Form &DCM &$\displaystyle O\left(dK\sqrt{TK}\log(T)\right)$\\
\midrule
\citet{LVC16} &- & Position-Based Model (PBM) with known position bias & $\displaystyle O\left(\frac{L}{\Delta}\log(T)\right)$\\
\midrule
\citet{ZTG17} &- &General Click Model &$\displaystyle O\left(\frac{K^3L}{\Delta}\log(T)\right)$\\
\midrule
\citet{LKLS18ranking} &- &General Click Model & $\displaystyle O\left(\frac{KL}{\Delta}\log(T)\right)$ \newline $\displaystyle O\left(\sqrt{K^3 L T \log(T)}\right)$ \newline $\displaystyle \Omega\left(\sqrt{KLT}\right)$ \\
\midrule
Ours &Linear Form &General Click Model &$\displaystyle O\left(K \sqrt{dT\log(LT)}\right)$\\
\bottomrule
\end{tabularx}
\vspace{-0.3cm}
\end{table*}
\paragraph{Related work}
Online learning to rank has seen an explosion of research in the last decade and there are multiple ways
of measuring the performance of an algorithm. One view is that the clicks themselves should be maximised, which we take in this article.
An alternative is to assume an underlying relevance of all items in a ranking that is never directly observed, but can be inferred
in some way from the observed clicks. In all generality this latter setting falls into the partial monitoring framework \cite{Rus99}, but has
been studied in specific ranking settings \citep[and references therein]{Cha16}. See the article by \citet{HW11} for more discussion on
various objectives.
Maximising clicks directly is a more straightforward objective because clicks are an observed quantity.
Early work was empirically focused. For example, \citet{LC10} propose a modification of
LinUCB for contextual ranking and \citet{CH15} modify the optimistic algorithms
for linear bandits.
These algorithms do not come with theoretical guarantees, however. There has recently been significant effort towards
designing theoretically justified algorithms in settings of increasing complexity \cite{KSWA15,CMP15,ZNK16,KKS16,LVC16}.
These works assume the user's clicks follow a click model that connects properties of the shown ranking to the probability that a user clicks
on an item placed in a given position. For example, in the document-based model it is assumed that the probability that the user clicks on a shown
item only depends on the unknown attractiveness of that item and not its position in the ranking or the other items.
Other simple models include the position-based, cascade and dependent click models. For a survey of click models see \cite{CMR15}.
As usual, however, algorithms designed for specific models are brittle when the modelling assumptions are not met.
Recent work has started to relax the strong assumptions by making the observation that in all of the above click models the
probability of a user clicking on an item can be written as the product of the item's inherent attractiveness and the probability that the user
examines its position in the list. \citet{ZTG17}
use a click model where this decomposition is kept, but the assumption on how the examination probability of a position depends on the
list is significantly relaxed. This is relaxed still further by \citet{LKLS18ranking} who avoid the factorisation assumption by making assumptions directly
on the click probabilities, but the existence of an attractiveness function remains.
The models mentioned in the last paragraph do not make assumptions on the attractiveness function, which means the regret depends badly on the size of $\mathcal L$.
Certain simple click models have assumed the attractiveness function is a linear function of an item's features and the resulting algorithms are suitable for large action sets.
This has been done for the cascade model \cite{LWZC16} and the dependent-click model \cite{LLZ18}.
While these works are welcomed, the strong assumptions leave a lingering doubt that perhaps the models may not be a good fit for practical problems.
Of course, our work is closely related to stochastic linear bandits, first studied by \citet{AL99}
and refined by \citet{Aue02,AST11,VMKK14} and many others.
Ranking has also been examined in an adversarial framework by \citet{RKJ08}.
These settings are most similar to the stochastic position-based and document-based models, but with the additional robustness bought by the adversarial framework.
Another related setup is the rank-$1$ bandit problem in which the learner should choose just one of $L$ items to place in one of $K$ positions.
For example, the location of a billboard with the budget to place only one. These setups have a lot in common with the present one, but cannot be directly applied to ranking problems.
For more details see \cite{KKS17,KKS17b}.
Finally, we note that some authors do not assume an ordering of the item set provided by an attractiveness function.
The reader is referred to the work by \citet{SRG13} (which is a follow-up work to \citet{RKJ08}) where the learner's objective is to maximise the probability that a user clicks on
\emph{any} item, rather than rewarding multiple clicks. This model encourages diversity and provides an interesting alternative approach.
\section{Preliminaries}
\paragraph{Notation}
Let $[n] = \{1,2,\ldots,n\}$ denote the first $n$ natural numbers.
Given a set $X$ the indicator function is $\sind{X}$.
For vector $x \in \mathbb{R}^d$ and positive definite matrix $V \in \mathbb{R}^{d\times d}$ we let $\norm{x}_V^2 = x^\top V x$.
The Moore-Penrose pseudoinverse of a matrix $V$ is $V^\dagger$.
\vspace{-0.1cm}
\paragraph{Problem setup}
Let $\mathcal L \subset \mathbb{R}^d$ be a finite set of items, $L = |\mathcal L|$ and $K>0$ a natural number, denoting the number of positions.
A ranking is an injective function from $[K]$, the set of positions, to $\mathcal L$
and the set of all rankings is denoted by $\Sigma$.
We use uppercase letters like $A$ to denote rankings in $\Sigma$ and lowercase letters $a,b$ to denote items in $\mathcal L$.
The game proceeds over $T$ rounds. In each round $t\in [T]$ the learner chooses a ranking $A_t \in \Sigma$ and subsequently receives feedback in
the form of a vector $C_t \in \{0,1\}^K$ where $C_{tk} = 1$ if the user clicked on the $k$th position.
We assume that the conditional distribution of $C_t$ only depends on $A_t$, which means there exists an unknown function $v : \Sigma \times [K] \to [0,1]$ such that for all $A \in \Sigma$ and $k \in [K]$,
\begin{align}
\Prob{C_{tk} = 1 \mid A_t = A} = v(A, k)\,.
\label{eq:click}
\end{align}
\begin{remark}
We do not assume conditional independence of $(C_{tk})_{k=1}^K$.
\end{remark}
In all generality the function $v$ has $K|\Sigma|$ parameters, which is usually impractically large to learn in any reasonable time-frame.
A click model corresponds to making assumptions on $v$ that reduces the statistical complexity of the learning problem.
We assume a factored model:
\begin{align}
v(A, k) = \chi(A, k) \alpha(A(k))\,,
\label{eq:clickfactor}
\end{align}
where $\chi : \Sigma \times [K] \to [0,1]$ is called the examination probability and $\alpha : \mathcal L \to [0,1]$ is the attractiveness function.
We assume that attractiveness is linear in the action, which means there exists an unknown $\theta_\ast \in \mathbb{R}^d$ such that
\begin{align}
\alpha(a) = \ip{a, \theta_{\ast}} \quad \text{for all } a \in \mathcal L\,.
\label{eq:clicklinear}
\end{align}
Let $a_k^\ast$ be the $k$-th best item sorted in order of decreasing attractiveness. Then let $A^\ast = \left(a_1^\ast, \ldots, a_K^\ast\right)$.
In case of ties the choice of $A^\ast$ may not be unique. All of the results that follow hold for any choice.
The examination function satisfies three additional assumptions.
The first says the examination probability of position $k$ only depends on the identity of the first $k-1$ items and not their order:
\begin{assumption}\label{ass:perm}
$\chi(A, k) = \chi(A', k)$ for any $A, A' \in \Sigma$ with $A([k-1]) = A'([k-1])$.
\end{assumption}
The second assumption is that the examination probability on any ranking is monotone decreasing in $k$:
\begin{assumption}\label{ass:decrease}
$\chi(A, k+1) \leq \chi(A, k)$ for all $A \in \Sigma$ and $k \in [K-1]$.
\end{assumption}
The third assumption is that the examination probability on ranking $A^\ast$ is minimal:
\begin{assumption}\label{ass:min}
$\chi(A, k) \ge \chi(A^\ast, k) =: \chi_k^\ast$ for all $A \in \Sigma$ and $k \in [K]$.
\end{assumption}
All of these assumptions are satisfied by many standard click models, including the document-based, position-based and cascade models.
These assumptions are strictly weaker than those made by \citet{ZTG17}
and orthogonal to those by \citet{LKLS18ranking} as we discuss it in \cref{sec:discussion}.
\paragraph{The learning objective}
We measure the performance of our algorithm in terms of the cumulative regret,
which is
\begin{align*}
R_T = T \sum_{k=1}^K v(A^\ast, k) - \E{\sum_{t=1}^T \sum_{k=1}^K v(A_t, k)} \,.
\end{align*}
\begin{remark}
The regret is defined relative to $A^\ast$, but our
assumptions do not imply that
\begin{align}
A^\ast \in \argmax_{A \in \Sigma} \sum_{k=1}^K v(A, k)\,. \label{eq:maximizer}
\end{align}
The assumptions in all prior work in Table~\ref{table:full comparisons with related work} either directly or indirectly
ensure that (\ref{eq:maximizer}) holds. Our regret analysis does not rely on this, so we do not assume it. Note, however,
that the definition of regret is most meaningful when (\cref{eq:maximizer}) approximately holds.
\end{remark}
\paragraph{Experimental design}
Our algorithm makes use of an exploration `spanner'
that approximately minimises the covariance of the least-squares estimator.
Given an arbitrary finite set of vectors $X = \{x_1,\ldots,x_n\} \subset \mathbb{R}^d$ and distribution $\pi : X \to [0,1]$ let $Q(\pi) = \sum_{x \in X} \pi(x) xx^\top$.
By the Kiefer--Wolfowitz theorem \cite{KW60} there exists a $\pi$ called the $G$-optimal design such that
\begin{align}
\max_{x \in X} \norm{x}_{Q(\pi)^{\dagger}}^2 \leq d\,.
\label{eq:gopt}
\end{align}
As explained in Chap. 21 of \citep{LS18book}, $\pi$ may be chosen so that $|\{x : \pi(x) > 0\}| \leq d(d+1)/2$.
A $G$-optimal design $\pi$ for $X$ has the property that if each element $x\in X$ is observed
$n \pi(x)$ times for some $n$ large enough,
the value estimate obtained via least-squares
will have its maximum uncertainty over the items minimised.
\todoc{We could be a bit more specific. In fact, we could start with the goal of optimal design.}
Given a finite (multi-)set of vectors $X \subset \mathbb{R}^d$ we let $\operatorname{\textsc{Gopt}}(X)$ denote a $G$-optimal design distribution.
Methods from experimental design have been used for pure exploration in linear bandits \cite{SLM14,XHS17} and also finite-armed linear bandits \citep[Chap. 22]{LS18book} as
well as adversarial linear bandits \cite{BCK12}.
| {'timestamp': '2019-05-28T02:07:33', 'yymm': '1810', 'arxiv_id': '1810.02567', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02567'} | arxiv |
\section{Introduction}
A set of interior-disjoint discs is called a {\em packing}.
Packings are of special interest to model the structure of materials, {\em e.g.}, crystals or granular materials, and the goal in this context is to understand which typical or extremal properties have the packings (see, {\em e.g.}, \cite{LH93,OH11,HST12}).
In 1964, T\'oth coined the notion of {\em compact packing} \cite{FT64}: this is a packing whose {\em contact graph} (the graph which connects the center of mutually tangent discs) is triangulated.
Equivalently, all its holes are curvilinear triangles.
There is only one compact packing with with all the discs of the same size, called the {\em hexagonal compact packing}: the disc centers are located on the triangular grid.
In \cite{Ken06}, it is proven that there are exactly $9$ values of $r$ which allow a compact packing with discs of size (radius) $1$ and $r$.
Fig.~\ref{fig:2packings} depicts an example of compact packing for each case.
All these packings already appeared in \cite{FT64}, except $c_5$ which later appeared in \cite{LH93} and $c_2$ which was new at that time.
\begin{figure}[hbtp]
\centering
\begin{tabular}{lll}
c1 (L)\hfill 1111r & c2 (S)\hfill 111rr & c3 (L)\hfill 11r1r\\
\includegraphics[width=0.3\textwidth]{packing_1111r.pdf} &
\includegraphics[width=0.3\textwidth]{packing_111rr.pdf} &
\includegraphics[width=0.3\textwidth]{packing_11r1r.pdf}\\
c4 (E)\hfill 1111 & c5 (H)\hfill 11rrr & c6 (H)\hfill 1r1rr\\
\includegraphics[width=0.3\textwidth]{packing_1111.pdf} &
\includegraphics[width=0.3\textwidth]{packing_11rrr.pdf} &
\includegraphics[width=0.3\textwidth]{packing_1r1rr.pdf}\\
c7 (E)\hfill 111r & c8 (H)\hfill 111 & c9 (H)\hfill 11rr\\
\includegraphics[width=0.3\textwidth]{packing_111r.pdf} &
\includegraphics[width=0.3\textwidth]{packing_111.pdf} &
\includegraphics[width=0.3\textwidth]{packing_11rr.pdf}
\end{tabular}
\caption{
An example of compact packing for each of the $9$ possible values of $r<1$ which allow a compact packings by discs of sizes $1$ and $r$.
They are all periodic, with the parallelogram showing a fundamental domain.
The top-right word over $\{\textrm{1},\textrm{r}\}$ codes the {\em corona} of a small disc (see Sec.~\ref{sec:notations}).
A label in c1--c9 is assigned to each case (top-left), followed by a letter in brackets which refers to its {\em type} (see Appendix~\ref{sec:classification}).
}
\label{fig:2packings}
\end{figure}
Recently, it was proven in \cite{Mes20} that there are at most $11462$ pairs $(r,s)$ which allow a compact packing by discs of sizes $1$, $r$ and $s$.
The author provided several examples and suggested that a complete characterization could be beyond the actual capacity of computers.
We here overcome this limitation and we prove:
\begin{theorem}
\label{th:main}
There are exactly $164$ pairs $(r,s)$ which allow a compact packing by discs of sizes $1$, $r$ and $s$, with $0<s<r<1$.
\end{theorem}
All the values $r$ and $s$ are algebraic and their minimal polynomials (which can be quite complicated) are given in the supplementary materials (as well as numerical approximations).
Fig.~\ref{fig:3packings} depicts an example of compact packing for $9$ of these $164$ cases.
The full list is in Appendix~\ref{sec:examples}.
In each case we found a {\em periodic} compact packing, so that it suffices to give its fundamental domain (as done in Fig.~\ref{fig:2packings} and \ref{fig:3packings}).
It is of course difficult to convince oneself with the naked eye that the depicted packings are {\em really} compact.
However, we shall see that their {\em combinatorics} is sufficient to ensure that they are indeed compact.
Note also that, in many cases, more compact packings than the only one depicted are possible (sometimes much more - as for the surprising number $83$ in Fig.~\ref{fig:3packings}).
This is discussed in Appendix~\ref{sec:classification}.
\begin{figure}[hbtp]
\centering
\begin{tabular}{lll}
3 (E)\hfill 1111 / 11r1r & 27 (E)\hfill 11r / 1s1s1s1s & 33 (L)\hfill 1rr / 11srs1srs\\
\includegraphics[width=0.3\textwidth]{packing_1111_11r1r.pdf} &
\includegraphics[width=0.3\textwidth]{packing_11r_1s1s1s1s.pdf} &
\includegraphics[width=0.3\textwidth]{packing_1rr_11srs1srs.pdf}\\
51 (L)\hfill 111rr / 1rrrrs & 53 (H)\hfill 11r1r / 1r1s1s & 83 (E)\hfill 1r1r / 11r1s\\
\includegraphics[width=0.3\textwidth]{packing_111rr_1rrrrs.pdf} &
\includegraphics[width=0.3\textwidth]{packing_11r1r_1r1s1s.pdf} &
\includegraphics[width=0.3\textwidth]{packing_1r1r_11r1s.pdf}\\
93 (H)\hfill 1r1rr / 1s1srs & 107 (H)\hfill 1r1s / 1s1s1s & 152 (S)\hfill 1rssr / 1s1sss \\
\includegraphics[width=0.3\textwidth]{packing_1r1rr_1s1srs.pdf} &
\includegraphics[width=0.3\textwidth]{packing_1r1s_1s1s1s.pdf} &
\includegraphics[width=0.3\textwidth]{packing_1rssr_1s1sss.pdf}\\
\end{tabular}
\caption{
Some compact packings with three sizes of discs.
They are all periodic, with the parallelogram showing a fundamental domain.
The top-left number refers to numbers in App.~\ref{sec:examples} and the two top-right words over $\{\textrm{1},\textrm{r},\textrm{s}\}$ codes the {\em coronas} of both a small and a medium disc (see Sec.~\ref{sec:notations}).
The letter in brackets refers to the {\em type} of the compact packing (see App.~\ref{sec:classification}).
}
\label{fig:3packings}
\end{figure}
Many compact packings with three sizes of discs can be found by hand.
Those on the first line in Fig.~\ref{fig:3packings}, for example, are easily derived from compact packings with two sizes of discs.
Some others were already known.
Number $107$ appears in \cite{FT64} (p.~187).
Numbers $99$, $104$ and $143$--$146$ appear in \cite{Mes20}.
Number $51$ can be found on a street pavement in Weggis, Switzerland (Rigiblickstrasse~$1$).
The challenge is to find them all.
As we shall see, this is mathematically rather simple, but the profusion of cases and the complexity of the calculations make it a computational challenge.
Before we continue, let us give a motivation to study compact packings.
A central problem in packing theory is to find the maximal density over a set $\mathcal{P}$ of packings, defined by
$$
\delta(\mathcal{P}):=\sup_{P\in\mathcal{P}}\limsup_{k\to\infty}\frac{\textrm{area of the $k\times k$ square covered by $P$}}{k^2}.
$$
The maximal density over packings with only one size of disc has been proven to be $\pi/\sqrt{12}\simeq 0.9069$, attained for the unique possible compact packing (the hexagonal one) \cite{FT43}.
With two sizes of discs, the maximal density turns out to be known only for sizes which allow a compact packing.
Namely, all the compact packings in Fig.~\ref{fig:2packings} have been proven to maximize the density among the packings with the same sizes of discs \cite{Hep00,Hep03,Ken04}, except $c_5$ and $c_9$ which are still in the running.
Compact packings thus seem to be good candidates to provably maximize the density.
So, what about the $164$ new cases with three discs?
Some can be easily ruled out.
Number $33$, for example (depicted top-right in Fig.~\ref{fig:3packings}), has small discs which can be inserted in the holes between two large and a medium discs: this increases the density but yields a non-compact packing.
We shall therefore consider only so-called {\em saturated} packings, {\em i.e.}, such that no further discs can be added.
Does it suffice?
\begin{open}
Assume that a finite set of different discs allow a saturated compact packing.
Consider all the packings by these discs: is the maximal density achieved for a compact packing?
\end{open}
The densest compact packings in cases $1$--$18$ turn out to have only two sizes of discs, so that we do not get anything new.
Cases $24$, $29$--$34$ and $37$--$44$ are ruled out because the densest compact packings are not saturated.
There are still $130$ candidates left\ldots
The compact packings depicted in Appendix~\ref{sec:examples} are actually the densest among the possible compact packings, except in cases $1$--$18$ where the densest compact packings have only two discs (this can be checked with the help of App.~\ref{sec:classification}).
As already mentioned, they are all periodic.
On the one hand, it is a chance because it makes it easy to describe them.
On the other hand, it is a bit disappointing because one of our main goals to extend \cite{Ken06} from two to three sizes of discs was to find a densest aperiodic packing.
This could indeed have been put forward as a rather simple explanation of aperiodic structure of materials known as {\em quasicrystals}.
Maybe a few extra disk sizes would be enough?
\begin{open}
Is there a finite set of different discs which allow compact packings and such that the densest one is aperiodic?
\end{open}
To finish with density of compact packings, let us say a word about higher dimensional packings, namely sphere packings.
The notion of density is easily generalized in $\mathbb{R}^n$.
Then, a sphere packing in $\mathbb{R}^n$ is said to be compact if its contact graph is a homogeneous simplicial complex of dimension $n$.
This coincides with the previous notion for $n=2$.
For $n=3$, it means that it can be seen as a tiling by tetrahedra which can intersect only on a full face, a full edge or a point.
The case of packings with only one size of sphere has been extensively studied (see, {\em e.g.}, \cite{CS99}).
The maximal density is known in dimension $3$ \cite{Hal05}, $8$ \cite{Via17} and $24$ \cite{CKM17}.
In dimension $8$ and $24$, the maximal density turns out to be achieved by a compact packing!
This is not the case in dimension $3$, but there is no compact packing in this case (regular tetrahedra do not tile the space).
Compact packings are thus still good candidates to provably maximize the density in higher dimensions.
In particular, what about the compact packings with two sizes of spheres studied in \cite{Fer18}?
The paper is organized as follows.
Section~\ref{sec:notations} sets out some notations and introduces the important notion of {\em corona}.
In Section~\ref{sec:strategy}, the overall strategy is presented.
As we shall see, the proof heavily relies on computer, and we shall explain it in details how in order to make it reproducible.
All the computations were made with the open-source software SageMath \cite{sage} on our modest laptop, an Intel Core i5-7300U with $4$ cores at $2.60$GHz and $15,6$ Go RAM.
Sections~\ref{sec:small} through \ref{sec:one_small} are dedicated to the proof itself (more details are given in Section~\ref{sec:strategy}).
An example of compact packing for each possible sizes is given in Appendix~\ref{sec:examples}, while the variety of compact packings which is possible for each of these sizes is discussed in Appendix~\ref{sec:classification}.
Last, Appendix~\ref{sec:code} provides indications on the code used on computer to find possible sizes, which can be found in supplementary materials.
\section{Notations}
\label{sec:notations}
The large disc is assumed to have size, $1$.
The sizes of the medium and small discs are denoted by $r$ and $s$, $0<s<r<1$.
We also call {\em x-disc} a disc of size $x$.
In a compact packing, the {\em corona} of a disc is the set of discs it is tangent to.
We shall consider coronas up to isometries.
A corona is said to be {\em small}, {\em medium} or {\em large} depending whether the surrounded disc is small, medium or large.
We shall also call them s-, r- and 1-coronas.
The {\em coding} of a corona is a word over the alphabet $\{\textrm{1},\textrm{r},\textrm{s}\}$: each letter corresponds to a disc and gives its size, with two letter being neighbor if and only if the corresponding discs are tangent.
We may use an exponent when there are many consecutive letters in the coding, for example 11rr$\textrm{s}^{12}$ denotes the corona 11rrssssssssssss ($12$ consecutive s-discs).
Any circular permutation or reversal of this word corresponds to the same corona: we shall usually use the lexicographically smallest coding.
Given pairwise tangent discs of size $x$, $y$ and $z$, $\widehat{xyz}$ denotes the non-oriented angle between the segments which connect the center of the disc of size $y$ to the two other centers.
Figure~\ref{fig:notations} illustrates this.
\begin{figure}
\centering
\includegraphics[width=0.4\textwidth]{angle.pdf}
\caption{The s-corona 1rsrs and the angle $\widehat{rs1}$.}
\label{fig:notations}
\end{figure}
\section{Overall strategy}
\label{sec:strategy}
We here sketch the overall strategy to prove Theorem~\ref{th:main}
\paragraph{Coronas (Sections~\ref{sec:small} and \ref{sec:medium}).}
First, independently of the values of $r$ and $s$, we find a finite set of {\em candidates coronas} containing at least all the s- and r-coronas which can appear in a compact packing by three sizes of discs.
This is easy for s-coronas because an s-disc is surrounded by at most $6$ discs (with equality only if the $6$ discs are small).
But since an r-disc can be surrounded by arbitrarily many s-discs for $s$ small enough, there are infinitely many r-coronas.
However, we are interested not in any r-corona but in those which do appear in a compact packing by three sizes of discs.
Such a packing also has an s-corona which shall yield a lower bound on the ratio $\tfrac{s}{r}$ (Lemma~\ref{lem:ratio_minimal}), hence on the maximal number of s-discs in an r-corona and therefore on the possible r-coronas.
\paragraph{Equations (Sections~\ref{sec:polynomial} and \ref{sec:medium}).}
Then, we associate with each candidate corona an algebraic equation satisfied by any values of $r$ and $s$ which allow a compact packing containing this corona (if any).
The basic idea is that the sum of the angles between the center of consecutive discs in the corona and the center of the surrounded disc is $2\pi$.
For example, the s-corona 1rsrs (Fig.~\ref{fig:notations}) yields the equation $\widehat{1sr}+\widehat{rss}+\widehat{ssr}+\widehat{rss}+\widehat{ss1}=2\pi$.
This equation can then be transformed into an algebraic equation by taking the cosine of both sides and using some trigonometry and algebra (at the cost of some parasitic solutions that must be eliminated afterward).
\paragraph{Computations (Sections~\ref{sec:two_phases}, \ref{sec:two_smalls} and \ref{sec:one_small}).}
We can now solve the systems of algebraic equations associated with each pair of candidate s- and r-coronas.
We need to perform exact solving because we want to be sure that discs are really tangent when they should be.
Exact solving of systems of algebraic equations is not a trivial task, but it is a classic of computer algebra and various ingenious algorithms do exist.
Once $r$ and $s$ are known, we can compute all the coronas they indeed allow, {\em i.e.}, the "local structure" of packings.
\paragraph{Packings (Sections~\ref{sec:two_phases}, \ref{sec:two_smalls}, \ref{sec:one_small} and Appendix~\ref{sec:examples}).}
Last, we have to determine which sets of coronas indeed allow a compact packing of the whole plane.
Determining whether three discs allow a compact packing of the plane amounts to determine whether the $10$ different triangles which connect the centers of three mutually tangent discs can {\em tile} the plane, {\em i.e.}, whether isometric copies of theses triangles can cover the whole plane such that the intersection of any two triangles is either empty, or a vertex, or a complete edge.
This could be hard since the general issue of whether a given finite set of polygons can tile the plane is undecidable \cite{Rob71}.
This has to do with the existence of finite sets of tiles which can tile the plane but only aperiodically (as few as two tiles suffice \cite{Pen78}).
However, all the cases of Theorem~\ref{th:main} actually allow a {\em periodic} compact packing with the three sizes of discs that we managed to find by hand (it is a purely combinatorial issue once the set of possible coronas is known).
\paragraph{Computational issues.}
The polynomial systems associated with pairs of candidates s- and r-coronas can be quite hard to solve.
For example, the pair 11rrs / 11rr$\textrm{s}^{12}$ yields two bivariate polynomials of degree $28$ and $416$, with the latter being $1.4$Mo when written to a plain text file.
Of course, since it depends on the computer and algorithm used to solve them, it is a subjective issue.
The approach in \cite{Mes20} yields similar polynomial systems, but the attempt to solve them by computing Gröbner basis with the open-source software Singular \cite{singular} succeeded only on a few systems.
In a private communication, Bruno Salvy showed us that Gröbner basis could be computed more efficiently with the algorithm \cite{Fau10}.
Still, some polynomial systems seem out of reach (moreover, the source code of this latter algorithm is non available).
With SageMath \cite{sage}, all the computations we eventually perform take less than one hour on our laptop.
For each pair $P$ and $Q$ of integer polynomials in $r$ and $s$ associated with two coronas, we proceed as follows.
\begin{enumerate}
\item
We use the {\em hidden variable} method (see, {\em e.g.}, Sec. 3.5 of \cite{CLO05} or Sec. 9.2.4 of \cite{sage2}) to compute a set which contains the roots of $P$ and $Q$.
Recall that the {\em resultant} of two univariate polynomials is a scalar which is equal to zero iff the two polynomials have a common root.
If we see $P$ and $Q$ as polynomials in $s$ with coefficients in $\mathbb{Z}[r]$ ($r$ is the "hidden variable"), then their resultant is a polynomial in $r$ which has a root $r_0$ iff $P(r_0,s)$ and $Q(r_0,s)$ have a common root $s$.
Computing the roots of this resultant thus yields the first entries of all the solution $(r,s)$ of $P=Q=0$.
We similarly get the second entries by exchanging the roles of $r$ and $s$.
The cartesian product of these two sets, with the condition $0<s<r<1$, yields the wanted set.
Wrong pairs must then be {\em filtered}.
\item
We first filter using {\em interval arithmetic}, that is, numerical computations with exact error bounds.
This allows to be sure to never reject a true solution.
Namely, we check the equation on the s- and r-coronas (the original non-algebraic equation on angles) and the existence of at least one 1-corona (similar equation on angles).
We also search for all the coronas compatible with the values of $r$ and $s$.
\item
We then filter {\em exactly}.
This is the more time-consuming part.
Actually, with the default $53$-bits precision of SageMath, all the pairs which successfuly passed the interval arithmetic filtering also passed this one.
We check all the coronas found by the previous filtering.
This time, we have to check the equations associated with coronas because no exact computation can be performed on the non-algebraic angles.
The way we proceed shall be detailed after we formalize how an algebraic equation is associated with a corona (Section~\ref{sec:polynomial}).
\end{enumerate}
\paragraph{Combinatorial issues.}
The computational tactic discussed above does not suffice to solve all the polynomial systems.
For example, computing the resultant for the polynomials associated with the pair 11rrs / 11rr$\textrm{s}^{12}$ exhausted the memory of our laptop.
Moreover, the number of candidates pairs of coronas (hence of polynomial systems) to check is huge.
Indeed, in Sections~\ref{sec:small} and \ref{sec:medium}, trying to bound this number as sharply as possible (with no more algebra than in \cite{Ken06}), we get $16805$ pairs.
Actually, a key factor to prove Theorem~\ref{th:main} is to split the compact packings in three combinatorial classes:
\begin{enumerate}
\item
The packings where no small and medium disc are adjacent (Section~\ref{sec:two_phases}).
These packings are said to be {\em large separated} (the large discs form the phase interface).
The problem primarily reduces to the already solved problem of finding compact packings with two sizes of discs.
This class yields $18$ cases of Theorem~\ref{th:main} (numbers 1--18 in Appendix~\ref{sec:examples}).
\item
The packings with two different s-coronas other than ssssss (Section~\ref{sec:two_smalls}).
This allows to use two s-coronas instead of an s- and an r-coronas with minor changes in the strategy.
The point is that there are much less s-coronas than r-coronas, and the associated equations are much simpler (mainly because there are fewer discs in an s-corona).
This class yields only one case of Theorem~\ref{th:main} (number 19 in Appendix~\ref{sec:examples}).
\item
The packings with only one s-corona other than ssssss (Section~\ref{sec:one_small}).
Here we have to consider the $16805$ pairs of s- and r-coronas and their complicated associated equations.
However, the hypothesis that there is only one s-corona (besides ssssss, which is always possible) greatly helps.
Indeed, it yields a strong (but simple) constraint on the two neighboring discs of each s-disc in a r-corona (namely, if the sequence xsy appears in the r-corona, then xry must appear in the s-corona).
Moreover, as a rule of thumb, r-coronas associated with complicated equations contain many s-discs, thus many such constraints to satisfy: this often (more than nine time out of ten) rules out a pair without any computation!
This class yields $145$ cases of Theorem~\ref{th:main} (numbers 20--164 in Appendix~\ref{sec:examples}).
\end{enumerate}
\paragraph{Other optimizations.}
Many other optimizations could be designed.
We actually introduced many ones that we later removed, because there is a trade-off between the time required to check the computations and the details required to explain the optimizations.
The above strategy, with its computational and combinatorial optimizations, allows to check all the cases in less than one hour of computation on our laptop.
The code is in Python, using powerful SageMath functions: it has only slightly more than 700 lines, comments included (see Appendix~\ref{sec:code}).
\section{Small coronas}
\label{sec:small}
An s-corona contains at most $6$ discs, with equality only if there are only s-discs.
There are thus finitely many different s-coronas.
We want here to be as precise as possible in order to reduce the number of cases to be considered afterward.
Let us define for $\vec{k}=(k_1,\ldots,k_6)\in\mathbb{N}^6$ the function
$$
S_{\vec{k}}(r,s):=k_1\widehat{1s1}+k_2\widehat{1sr}+k_3\widehat{1ss}+k_4\widehat{rsr}+k_5\widehat{rss}+k_6\widehat{sss}.
$$
This function counts the angles to pass from disc to disc in an $s$-corona.
To each s-corona corresponds a vector $\vec{k}$, called its {\em angle vector}, which satisfies
\begin{equation}\label{eq:s_corona}
S_{\vec{k}}(r,s)=2\pi.
\end{equation}
We have to find the possible values $\vec{k}$ for which the equation $S_{\vec{k}}(r,s)=2\pi$ admits a solution $0<s<r<1$.
The angles which occur in $S_{\vec{k}}(r,s)$ decrease with $s$, except $\widehat{sss}$, and increase with $r$.
This yields the following inequalities, strict except for the s-corona ssssss:
$$
S_{\vec{k}}(r,s)\leq \lim_{r\to 1\atop s\to 0}S_{\vec{k}}(r,s)=k_1\pi+k_2\pi+k_3\frac{\pi}{2}+k_4\pi+k_5\frac{\pi}{2}+k_6\frac{\pi}{3},
$$
$$
S_{\vec{k}}(r,s)\geq \inf_r\lim_{s\to r}S_{\vec{k}}(r,s)=\lim_{r\to 1\atop s\to 1}S_{\vec{k}}(r,s)=k_1\frac{\pi}{3}+k_2\frac{\pi}{3}+k_3\frac{\pi}{3}+k_4\frac{\pi}{3}+k_5\frac{\pi}{3}+k_6\frac{\pi}{3}.
$$
The existence of $(r,s)$ such that $S_{\vec{k}}(r,s)=2\pi$ thus yields the inequalities
$$
k_1+k_2+k_3+k_4+k_5+k_6< 6<3k_1+3k_2+\frac{3}{2}k_3+3k_4+\frac{3}{2}k_5+k_6,
$$
except for the s-corona ssssss ($k_1=\ldots=k_5=0$ and $k_6=6$).
An exhaustive search on computer yields $383$ possible values for $\vec{k}$.
\begin{figure}
\centering
\includegraphics[width=0.3\textwidth]{couronnable.pdf}
\caption{The cycles of this graph encode coronas associated with $\vec{k}$.}
\label{fig:couronnable}
\end{figure}
For each of them, one shall check that there indeed exists a coding over $\{\textrm{1},\textrm{r},\textrm{s}\}$ with this angle vector\footnote{For example, $\vec{k}=(0,3,0,0,0,0)$ corresponds to three angles $\widehat{1sr}$ around an $s$-disc: this is combinatorially impossible.}.
This is the case if the graph depicted in Fig.~\ref{fig:couronnable} contains a cycle such that $\vec{k}$ counts the number of times each edge appear in this cycle.
If this cycle contains a loop, then either it contains only this loop or this loop must be accessible from another vertex.
This yields the conditions:
\begin{eqnarray}
(k_1=0) \lor (k_2\neq 0 \lor k_3\neq 0) \lor (k_2=k_3=k_4=k_5=k_6=0)\\
(k_4=0) \lor (k_2\neq 0 \lor k_5\neq 0) \lor (k_1=k_2=k_3=k_5=k_6=0)\\
(k_6=0) \lor (k_3\neq 0 \lor k_5\neq 0) \lor (k_1=k_2=k_3=k_4=k_5=0)
\end{eqnarray}
The cycle must do $k_0:=\min(k_2,k_3,k_5)$ round trips around the three vertices, and possibly some round trips between two vertices which use an even number of times the edge which connects these vertices.
This yields the conditions:
\begin{equation}
k_2-k_0\in2\mathbb{N},\qquad
k_3-k_0\in2\mathbb{N},\qquad
k_5-k_0\in2\mathbb{N}.
\end{equation}
All the previous conditions eventually lead to $56$ possible angle vectors.
Tab.~\ref{tab:s_coronas} gives, for each, a coding of the corresponding corona\footnote{An angle vector could correspond to several coronas. For example, $(0,2,2,0,2,0)$ corresponds to 1rsr1s, 1r1srs, 1rs1sr and 1rs1rs. But this does not happen here.}.
\begin{table}[hbtp]
\centering
\begin{tabular}{cccccccccc}
rrrrr & rrrrs & rrrss & rrsrs & rrrr & rrsss & rsrss & rrrs & rrr & rrss\\
11111 & 1111s & 111ss & 11s1s & 1111 & 11sss & 1s1ss & 111s & 111 & 11ss\\
1111r & 111rs & 11rss & 11srs & 111r & 1rsss & 1srss & 11rs & 11r & 1rss\\
111rr & 11r1s & 1r1ss & 1rs1s & 11rr & & & 1r1s & 1rr & \\
11r1r & 11rrs & 1rrss & 1rsrs & 1r1r & & & 1rrs & & \\
11rrr & 1r1rs & r1rss & rrs1s & 1rrr & & & r1rs & & \\
1r1rr & 1rr1s & & & & & & & & \\
1rrrr & 1rrrs & & & & & & & & \\
& r11rs & & & & & & & & \\
& r1rrs & & & & & & & & \\
\end{tabular}
\caption{
The $55$ possible s-coronas, besides ssssss.
Those on the first line have no $1$-disc and those on the second line no r-disc.
In each column, the codings are all equal if we replace each 1 by an r (this is used in Lemma~\ref{lem:ratio_minimal}).}
\label{tab:s_coronas}
\end{table}
\section{Polynomial associated with a small corona}
\label{sec:polynomial}
We here associate with an s-corona a polynomial equation in $r$ and $s$ such that any pair $(r,s)$ for which the corona can be geometrically represented corresponds to a solution of this equation.
First take the cosines of both sides of equation \ref{eq:s_corona} and fully expand the left-hand side.
Substract $\cos(2\pi)=1$ to both sides.
This yields a polynomial equation in cosines and sines of the angles occuring in $S_{\vec{k}}$.
The cosine law then allows to replace each cosine by a rational fraction in $r$ and $s$.
Namely, the cosines of $\widehat{1s1}$, $\widehat{1sr}$, $\widehat{1ss}$, $\widehat{rsr}$, $\widehat{rss}$ and $\widehat{sss}$ are respectively replaced by
$$
1-\frac{2}{(1+s)^2},\quad
1-\frac{2r}{(r+s)(1+s)},\quad
\frac{s}{1+s},\quad
1-\frac{2r^2}{(r+s)^2},\quad
\frac{s}{r+s},\quad
\frac{1}{2}.
$$
The squares of the sines follow (same order):
$$
\frac{4s(s+2)}{(s + 1)^4},\quad
\frac{4rs(r + s + 1)}{(s + 1)^2(r + s)^2},\quad
\frac{2s + 1}{(s + 1)^2},\quad
\frac{4s(2r + s)r^2}{(r + s)^4},\quad
\frac{r(r + 2s)}{(r + s)^2},\quad
\frac{3}{4}.
$$
We express sines (same order) using auxiliary variables $X_1$ through $X_6$:
$$
\frac{2X_1}{(s + 1)^2},\quad
\frac{2X_2}{(s + 1)(r + s)},\quad
\frac{X_3}{s + 1},\quad
\frac{2rX_4}{(r + s)^2},\quad
\frac{X_5}{r + s},\quad
\frac{X_6}{2},
$$
where the squares of the auxiliary variables $X_1,\ldots,X_6$ are (same order):
$$
s(s+2),\quad
rs(r+s+1),\quad
2s+1,\quad
s(2r+s),\quad
r(r + 2s),\quad
3.
$$
This yields a polynomial system in $r$, $s$ and the $X_i$'s.
One can use the above expression of $X_i^2$ as a polynomial in $r$ and $s$ to remove any power $k\geq 2$ of $X_i$.
We then successively eliminate each $X_i$ as follows.
We write the equation $AX_i+B=0$, where $A$ and $B$ do not contain any occurence of $X_i$.
We then multiply both sides by $AX_i-B$, so that no solution is lost.
This yields the new equation $A^2X_i^2-B^2=0$, where $X_i^2$ can be replaced by its expression as a polynomial in $r$ and $s$.
In short:
$$
AX_i+B=0~\rightarrow~ A^2X_i^2-B^2=0.
$$
Doing this successively for each $X_i$ eventually yields the wanted polynomial equation in $r$ and $s$.
We simplify it by removing multiplicities of factors as well as factors which have clearly no roots $0<s<r<1$.
\begin{table}[hbtp]
\centering
\begin{tabular}{lll}
11111 & $5s^4+20s^3+10s^2-20s+1$ & $0.701$ \\
1111s & $s^4 - 10s^2 - 8s + 9$ & $0.637$ \\
111ss & $s^8 - 8s^7 - 44s^6 - 232s^5 - 482s^4 - 24s^3 + 388s^2 - 120s + 9$ & $0.545$ \\
11s1s & $8s^3 + 3s^2 - 2s - 1$ & $0.533$ \\
1111 & $s^2 + 2s - 1$ & $0.414$ \\
11sss & $9s^4 - 12s^3 - 26s^2 - 12s + 9$ & $0.386$ \\
1s1ss & $s^4 - 28s^3 - 10s^2 + 4s + 1$ & $0.349$ \\
111s & $2s^2 + 3s - 1$ & $0.280$ \\
111 & $3s^2 + 6s - 1$ & $0.154$ \\
11ss & $s^2 - 10s + 1$ & $0.101$
\end{tabular}
\caption{s-coronas without r-discs, associated polynomials and root $s\in(0,1)$.}
\label{tab:petites_couronnes_deux_disques}
\end{table}
For the $10$ s-coronas without r-disc, we get a polynomial in $s$ (Tab.~\ref{tab:petites_couronnes_deux_disques}).
Each of the $10$ s-coronas without large disc yields the same polynomial as the corona where r has been replaced by 1, with the variable $\tfrac{s}{r}$ instead of $s$.
The $35$ reamining s-coronas yield an explicit polynomial which can be rather complex (Tab.~\ref{tab:degre_petites_couronnes} gives the degrees).
For example, the s-corona 11rs yields:
$$
r^2s^4 - 2r^2s^3 - 2rs^4 - 23r^2s^2 - 28rs^3 + s^4 - 24r^2s - 58rs^2 - 2s^3 + 16r^2 - 8rs + s^2.
$$
\begin{table}[hbtp]
\centering
\begin{tabular}{lr|lr|lr|lr|lr}
1r1r & $2$ & 11rr & $4$ & 1rrsr & $6$ & 1rsss & $8$ & 111rr & $12$ \\
1r1s & $2$ & 1rss & $4$ & 1111r & $7$ & 1srrs & $8$ & 11rrr & $12$ \\
1rsr & $2$ & 11r1s & $6$ & 11r1r & $7$ & 1srss & $8$ & 111rs & $18$ \\
111r & $3$ & 11rs & $6$ & 1rs1s & $7$ & 1r1rr & $10$ & 1rrrs & $18$ \\
11r & $3$ & 11rsr & $6$ & 11srs & $8$ & 1rrrr & $10$ & 11rss & $24$ \\
1rr & $3$ & 1rr1s & $6$ & 1r1ss & $8$ & 1rsrs & $10$ & 1rrss & $24$ \\
1rrr & $3$ & 1rrs & $6$ & 1rssr & $8$ & 1r1rs & $11$ & 11rrs & $28$ \\
\end{tabular}
\caption{Degree of the polynomial in $r$ and $s$ associated with each s-corona.}
\label{tab:degre_petites_couronnes}
\end{table}
If discs of sizes $s$, $r$ and $1$ are compatible with a corona, then $(r,s)$ is a solution of the equation associated with this corona.
But some solutions of this equation may not correspond to a corona: they are parasitic solutions.
The first reason is that taking the cosines of the equations on angles can lead to solutions which are true only modulo $2\pi$.
Such cases are however easily detected just by a numerical computation.
The second reason is that, to eliminate the $X_i$'s, we multiply by factors $AX_i-B$ which introduce new solutions.
To detect whether a given pair $(r,s)$ comes from these multiplying factors, we check by interval arithmetic whether $AX_i-B$ could be equal to zero, and only if it does (it is very rare), then we substitute the exact values of $r$ and $s$ in the initial equation in $r$, $s$ and the $X_i$'s (this is more time-consuming).
\section{Medium coronas and associated polynomials}
\label{sec:medium}
Since $s$ can be arbitrarily smaller than $r$, there can be infinitely many s-discs in an r-corona.
Let us however see that this cannot happen in a compact packing.
\begin{lemma}
\label{lem:ratio_minimal}
The ratio $\tfrac{s}{r}$ is uniformly bounded from below in compact packings with three sizes of discs.
\end{lemma}
\begin{proof}
Consider a compact packings with three sizes of discs.
It contains an s-disc and not only s-discs, thus an s-corona other than ssssss.
By replacing each 1 by an r in the coding of this s-corona, Table~\ref{tab:s_coronas} shows that we get the coding of a new s-corona.
In this new corona, the ratio $\tfrac{s}{r}$ is smaller.
Indeed, the 1-discs have been ''deflated'' into r-discs, so that the perimeter of the corona decreased, whence the size of the surrounded small disc too.
But there is at most $10$ possible ratios $\tfrac{s}{r}$ for an s-corona without large discs: they correspond to the values computed in Tab.~\ref{tab:petites_couronnes_deux_disques} for compact packing with two sizes of discs (the smallest is $5-2\sqrt{6}\simeq 0.101$).
\end{proof}
This lemma ensures that the number of s-discs in an r-corona is uniformly bounded in compact packings.
There is thus only finitely many different r-coronas in compact packings.
To find them all, we proceed similarly as for s-coronas.
We define for $0<s<r<1$ and $\vec{l}=(l_1,\ldots,l_6)\in\mathbb{N}^6$ the function
$$
M_{\vec{l}}(r,s):=l_1\widehat{1r1}+l_2\widehat{1rr}+l_3\widehat{1rs}+l_4\widehat{rrr}+l_5\widehat{rrs}+l_6\widehat{srs}.
$$
We have to find the possible values $\vec{l}$ for which the equation $M_{\vec{l}}(r,s)=2\pi$ admits a solution $0<s<r<1$.
Actually, since the solution should correspond to an r-corona which occur in a packing, we can assume that it satisfies $\tfrac{s}{r}\geq \alpha$, where $\alpha$ is the lower bound on $\tfrac{s}{r}$ given by the s-coronas which occur in this packing.
The angles which occur in $M_{\vec{l}}(r,s)$ decrease with $r$ (except $\widehat{rrr}$) and increase with $s$.
This yields the following inequalities, strict except for the r-corona rrrrrr:
$$
M_{\vec{l}}(r,s)\leq \sup_r\lim_{s\to r} M_{\vec{l}}(r,s)=l_1\pi+l_2\frac{\pi}{2}+l_3\frac{\pi}{2}+l_4\frac{\pi}{3}+l_5\frac{\pi}{3}+l_6\frac{\pi}{3},
$$
$$
M_{\vec{l}}(r,s)\geq \inf_r\lim_{\tfrac{s}{r}\to\alpha}M_{\vec{l}}(r,s)=l_1\frac{\pi}{3}+l_2\frac{\pi}{3}+l_3u_\alpha+l_4\frac{\pi}{3}+l_5u_\alpha+l_6v_\alpha,
$$
where $\widehat{1rs}$ has been bounded from below by $\widehat{rrs}$ for any $r$, and the limits $u_\alpha$ and $v_\alpha$ of $\widehat{rrs}$ and $\widehat{srs}$ when $\tfrac{s}{r}\to\alpha$ are obtained via the cosine law:
$$
u_\alpha:=\arccos\left(\frac{1}{1+\alpha}\right)
\quad\textrm{and}\quad
v_\alpha:=\arccos\left(1-\frac{2\alpha^2}{(1+\alpha)^2}\right).
$$
The existence of $(r,s)$ such that $M_{\vec{l}}(r,s)=2\pi$ thus yields the inequalities
$$
l_1+l_2+l_4+\frac{3}{\pi}(l_3u_\alpha+l_5u_\alpha+l_6v_\alpha)< 6< 3l_1+\frac{3}{2}l_2+\frac{3}{2}l_3+l_4+l_5+l_6,
$$
except for the r-corona rrrrrr ($l_1=\ldots=l_5=0$ and $l_6=6$).
We also impose
$$
l_1+l_2+l_4+\frac{1}{2}(l_3+l_5)<6,
$$
which says that an r-corona (other than rrrrrr) contains at most $5$ r- or 1-discs.
An exhaustive search on computer, which also checks whether there indeed exists a coding for each possible $\vec{l}$, eventualy yields the possible r-coronas for each value of $\alpha$.
Tab.~\ref{tab:r_coronas} gives the numbers of such coronas.
\begin{table}[hbtp]
\centering
\begin{tabular}{c|c|c|c|c|c|c|c|c|c}
rrrrr & rrrrs & rrrss & rrsrs & rrrr & rrsss & rsrss & rrrs & rrr & rrss\\
$0.701$ & $0.637$ & $0.545$ & $0.533$ & $0.414$ & $0.386$ & $0.349$ & $0.280$ & $0.154$ & $0.101$\\
$84$ & $94$ & $130$ & $143$ & $197$ & $241$ & $272$ & $386$ & $889$ & $1654$
\end{tabular}
\caption{
Each s-corona whose 1-discs have been deflated in r-discs (first line) yields a lower bound $\alpha$ on $\tfrac{s}{r}$ in any compact packing which contains it (second line), and thus an upper bound on the number of possible r-coronas in this packing (third line).
}
\label{tab:r_coronas}
\end{table}
Since any r-corona for some lower bound $\alpha$ also appears for a smaller $\alpha$, there are at most $1654$ different r-coronas.
Now, each s-corona in the $k$-th column of Table~\ref{tab:s_coronas} and each r-corona in the same $k$-th column of Table~\ref{tab:r_coronas} form a pair which could appear in the same compact packing.
The total number of pairs, namely $16805$, is thus the element-wise product of the vectors
$$
(8,10,6,6,6,3,3,6,4,3)
\quad\textrm{and}\quad
(84,94,130,143,197,241,272,386,889,1654).
$$
A polynomial in $r$ and $s$ is associated with each medium corona as done for the small coronas in Sec.~\ref{sec:polynomial}.
The cosine law yields the cosines of $\widehat{1r1}$, $\widehat{1rr}$, $\widehat{1rs}$, $\widehat{rrr}$, $\widehat{rrs}$ and $\widehat{srs}$ (in this order):
$$
1-\frac{2}{(1+r)^2},\quad
\frac{r}{1+r},\quad
1-\frac{2s}{(r+s)(1+r)},\quad
\frac{1}{2},\quad
\frac{r}{r+s},\quad
1-\frac{2s^2}{(r+s)^2}.
$$
The squares of the sines follow (same order):
$$
\frac{4r(r + 2)}{(r + 1)^4},\quad
\frac{2r + 1}{(r + 1)^2},\quad
\frac{4rs(r + s + 1)}{(r + 1)^2(r + s)^2},\quad
\frac{3}{4},\quad
\frac{s(2r + s)}{(r + s)^2},\quad
\frac{4r(r + 2s)s^2}{(r + s)^4}.
$$
We express sines (same order) using auxiliary variables:
$$
\frac{2X_7}{(r + 1)^2},\quad
\frac{X_8}{r + 1},\quad
\frac{2X_2}{(r + 1)(r + s)},\quad
\frac{X_6}{2},\quad
\frac{X_4}{r + s},\quad
\frac{2sX_5}{(r + s)^2},
$$
where $X_1,\ldots,X_6$ are defined in Sec.~\ref{sec:polynomial} and $X_7$ et $X_8$ have respective squares
$$
r(r+2),\quad
2r+1.
$$
The $X_i$'s elimination eventually yields a bivariate polynomial in $r$ and $s$.
These polynomials are usually larger than those associated with s-coronas (because there are generally more discs - up to $33$ - in a medium corona than in a small one).
The degree can be as high as $416$ (for the s-corona 11rr$\textrm{s}^{12}$) and the mean degree is $57.88$ (standard deviation $50.16$).
Computing them all for the $1654$ r-coronas takes 2h21min on our laptop and yields a $35$Mo file (this is actually not necessary, as we shall see).
\section{Large separated}
\label{sec:two_phases}
A compact packing by discs of sizes $1$, $r$ and $s$ is said to be {\em large separated} if it does not contain any adjacent s- and r-discs, {\em i.e.}, there is always a large disc between a small disc and a medium one.
Any s-corona has only s- and 1-discs: this yields one of the $10$ equations in $s$ given by Tab.~\ref{tab:petites_couronnes_deux_disques}.
Any r-corona has only r- and 1-discs: this also yields one of these $10$ equations, up to the replacement of each $s$ by an $r$.
With $s<r$, this yields $\binom{10}{2}=45$ possible pairs $(r,s)$.
For each of these $45$ pairs, we compute all the possible coronas, first by interval arithmetic and then exactly, as explained Section~\ref{sec:strategy}.
This takes around 4min on our laptop.
We find a periodic packing with all the sizes of discs for $18$ of these $45$ cases (numbered $1$ to $18$ in Appendix~\ref{sec:examples}).
They turn out to be exactly those with a 1-corona which contains both an s- and an r-disc and can act as a pivotal point to connect s- and r-discs of the packing.
What about the $27$ other cases?
One could imagine packings in which s- and r-discs are separated by more 1-discs.
The point of the following lemma is to show that this would need a very special 1-corona, namely one with an r-disc and three consecutive 1-discs:
\begin{lemma}
\label{lem:biphase}
Assume that disc sizes are such that none of the following is possible:
\begin{enumerate}
\item an s-corona with an r-disc or conversely;
\item a 1-corona with both an s-disc and an r-disc;
\item a 1-corona with an r-disc and three consecutive 1-discs.
\end{enumerate}
Then, no compact packing with all the sizes of discs is possible
\end{lemma}
\begin{proof}
Let us call {\em critical} a 1-disc which has a neighboring r-disc.
We claim that any neighboring 1-disc $D'$ of a critical disc $D$ is critical itself.
Indeed, consider the two discs which are neighbor of both $D$ and $D'$.
They cannot be both 1-discs, otherwise together with $D'$ they would form three consecutive 1-disc in the corona of $D$, which the third hypothesis rules out.
None of them can be an s-disc because $D$ would have an s-disc and an r-disc in its corona, which the second hypothesis rules out.
Thus, at least one is an r-disc: $D'$ is critical as claimed.
Now, assume that such a packing exists and get a contradiction.
Consider a pair of closest r- and s-discs (according the graph distance in the contact graph of the packing).
The first hypothesis ensures that they are not neighbor.
Consider a shortest path between them.
It has only 1-discs.
Walking from the r-disc to the s-disc along this path, the first disc is critical by definition, and all the following ones also according to the above claim.
But the last one has a neighboring s-disc: this contradicts the second hypothesis.
\end{proof}
\begin{figure}[hbtp]
\includegraphics[width=\textwidth]{biphase_impossible_1.pdf}
\caption{A case (given by all the possible coronas) ruled out by Lemma~\ref{lem:biphase}.}
\label{fig:biphase_impossible_1}
\end{figure}
Lemma~\ref{lem:biphase} rules out $20$ of the $27$ remaining cases.
Actually, Lemma~\ref{lem:biphase} is purely combinatorial and still holds under any permutation of the disc types.
In particular, exchanging types s and r rules out $13$ of these $27$ remaining cases: $9$ are also ruled out by the original lemma, while $4$ are newly ruled out.
On the whole it rules out $20+4$ of the $27$ cases, so that there are still three remaining cases, depicted in Fig.~\ref{fig:biphase_impossible_2}.
They satisfy the two first hypothesis of Lemma~\ref{lem:biphase} but not the third one.
The following lemma rules them out:
\begin{figure}[hbtp]
\includegraphics[width=\textwidth]{biphase_impossible_2.pdf}
\caption{Three cases (one per line, given by all the possible coronas) which do not allow any compact packing of the plane with all the three sizes of discs.}
\label{fig:biphase_impossible_2}
\end{figure}
\begin{lemma}
\label{lem:biphase2}
None of the case depicted in Figure~\ref{fig:biphase_impossible_2} allow a compact packing of the plane with all the three sizes of discs.
\end{lemma}
\begin{proof}
We keep the notion of critical disc introduced in the proof of Lemma~\ref{lem:biphase}.
Here, only the first and second hypothesis of Lemma~\ref{lem:biphase} is fulfilled because each case has the corona 111rr1r (fourth position on each line in Fig.~\ref{fig:biphase_impossible_2}).
A 1-disc to a critical disc is no more necessarily critical itself.
However, we claim that if a 1-disc has a critical neighbor, then all its neighbors are critical discs (see below).
The proof of Lemma~\ref{lem:biphase} then goes the same way.
On a path of 1-discs going from an r-disc to an s-disc, the first 1-disc is critical (the initial r-disc is a neighbor) and any non-critical one (if any) appears between two critical ones.
In particular, the last 1-disc is critical (the final s-disc is a neighbor), which contradicts the second hypothesis of Lemma~\ref{lem:biphase} and proves Lemma~\ref{lem:biphase2}.
Let us prove the above claim (disc labels refer to Fig.~\ref{fig:biphase_impossible_3}).
Consider a 1-disc {\bf a} which is not critical but has a critical neighbor {\bf b}.
The neighbors {\bf c} and {\bf d} of both {\bf a} and {\bf b} are neither s-disc because of the second hypothesis of Lemma~\ref{lem:biphase}, nor r-disc because {\bf a} is not critical.
They are thus 1-discs.
Only one of the coronas depicted in Fig.~\ref{fig:biphase_impossible_2} is possible for {\bf b}: 111rr1r.
This corona ensures that the neighbor of {\bf b} and {\bf c} is an r-disc, as well as the neighbor of {\bf b} and {\bf d}.
In particular, both {\bf c} and {\bf d} are critical, and the second hypothesis of Lemma~\ref{lem:biphase} ensures that they do not have a neighboring s-disc.
The neighbor {\bf e} of {\bf c} and {\bf a} is thus a 1-disc, as well as the neighbor {\bf f} of {\bf d} and {\bf a}.
The corona of {\bf a} now contains $5$ 1-discs: according to Fig.~\ref{fig:biphase_impossible_2}, a sixth 1-disc {\bf g} completes this corona.
The three consecutive neighbors {\bf e}, {\bf a} and {\bf b} of {\bf c} ensure that its corona is 111rr1r, so that the neighbor of {\bf c} and {\bf e} is an r-disc.
The same holds for each disc of the corona of {\bf a}: the neighbor (other than {\bf a}) of two consecutive discs of the corona is an r-disc.
This proves that all the discs of the corona of {\bf a} are critical.
\end{proof}
\begin{figure}[hbtp]
\centering
\includegraphics[width=\textwidth]{biphase_impossible_3.pdf}
\caption{In the three cases whose coronas are depicted in Fig.~\ref{fig:biphase_impossible_2}, any $1$-disc of a (hypothetical) packing is either critical or surrounded only by critical discs.}
\label{fig:biphase_impossible_3}
\end{figure}
\section{Two small coronas}
\label{sec:two_smalls}
We consider compact packings for pairs $(r,s)$ which allow at least two different s-coronas other than ssssss.
We want to find $(r,s)$ by solving the polynomial system associated with these two s-coronas.
Since there are only $55$ s-coronas, there are at most $\binom{55}{2}=1485$ such systems.
Moreover, the equations associated with s-coronas are much simpler.
If two different s-coronas contain only s- and 1-discs, then they characterize two different values of $s$.
Similarly, if they contain only s- and r-discs, then they characterize two different values of $\tfrac{s}{r}$.
We thus rule out these pairs.
We get $1395$ systems of two polynomial equations in $r$ and $s$.
We then follow the computational tactic explained Section~\ref{sec:strategy}.
The hidden variable method fails on the three pairs rrs / 11rss, rrss / 1111r and 1rrss / 1111r.
The computation of the algebraic roots of the resultants indeed raises (various) exceptions.
This could be overcome, but we just compute roots with interval arithmetic instead.
Indeed, this yields $179$ pairs $(r,s)$ of intervals which are all ruled out by the interval arithmetic filtering.
The hidden variable method works on the $1392$ other pairs and yields $13239$ pairs $(r,s)$, with $0<s<r<1$.
Arithmetic filtering rules out all but $37$ of them.
The exact filtering validate all these pairs and yields all the possible coronas in each case.
We find a periodic packing for only one of these $37$ cases, namely the pair of s-coronas 1srrs / 1s1ss (number $19$ in Appendix~\ref{sec:examples}).
Its coronas are depicted in Fig.~\ref{fig:2pc_possible_1}.
\begin{figure}[hbtp]
\centering
\includegraphics[width=\textwidth]{2pc_possible_1.pdf}
\caption{The only case which allows two small coronas and a valid packing.}
\label{fig:2pc_possible_1}
\end{figure}
Actually, the case 1srrs / 1s1ss is the only one with an s-corona which contains both an r-disc and a 1-disc and can act as a pivotal point to connect r- and 1-discs of the packing.
In the $36$ other cases, r- and 1-discs are never in contact: only s-separated packings are possible.
The situation is thus very similar to Section~\ref{sec:two_phases} and Lemma~\ref{lem:biphase} again helps.
Precisely, the permutation (s,r,1) on the disc types in Lemma~\ref{lem:biphase} rules out $32$ of these $36$ cases and the permutation (s,1,r) rules out the four last ones (as well as $28$ already ruled out).
Actually, even if the only remaining case allows the two small coronas 1srrs and 1s1ss, only the first one can appear in a valid packing:
\begin{proposition}
There is no compact packing with three sizes of discs which contains both the small coronas 1srrs and 1s1ss.
\end{proposition}
\begin{proof}
There is no other small corona (besides ssssss) compatible with the values of $r$ and $s$ characterized by these two coronas, and the only compatible large corona is $\textrm{s}^{12}$.
Assume that a small corona 1s1ss appears (Fig.~\ref{fig:2pc_possible_2}, left).
Each of the two large discs of this corona must be surrounded by small discs (Fig.~\ref{fig:2pc_possible_2}, center).
A small disc with a factor s1ss in its corona (one of them is pointed in Fig.~\ref{fig:2pc_possible_2}, left) must have a corona 1s1ss.
This yields a third large disc, also surrounded by small discs (Fig.~\ref{fig:2pc_possible_2}, right).
This argument can be repeated on each small disc with factor s1ss in its corona (pointed in Fig.~\ref{fig:2pc_possible_2}, right), forbidding any medium disc to ever appear.
\end{proof}
\begin{figure}[hbtp]
\centering
\includegraphics[width=\textwidth]{2pc_possible_2.pdf}
\caption{
The small coronas 1srrs and 1s1ss are possible, but if the latter appears then the packing is made of large discs surrounded by small ones and centered on a triangular grid: it does not contain any medium disc.}
\label{fig:2pc_possible_2}
\end{figure}
\section{One small corona}
\label{sec:one_small}
The remaining class is the main one.
The packings contain adjacent s- and r-discs (otherwise they are large separated) and allow only one s-corona (besides ssssss).
In particular, any such packing has an r-corona which contains an s-disc.
We shall here always assume that in the pair of s- and r-corona used to get the equations in $r$ and $s$, the r-corona contains an s-disc.
This indeed yields a strong combinatorial constraint.
Consider, for example, the pair 11rrs / 11rr$\textrm{s}^{12}$ (computing the resultants for the associated equations exhausted the memory of our laptop, as mentioned in Section~\ref{sec:strategy}).
Whenever, in the r-corona, there is an s-disc between an x-disc and an y-disc, the corona of this s-disc must contain an r-disc between an x-disc and an y-disc.
Here, this shows that the coding of the s-corona must contain the factors rrs, srs and sr1.
However, neither srs nor sr1 appear in 11rrs.
This pair can thus be ruled out without any further computation.
Recall that an angle vector can generally have different codings (not for s-coronas, however).
In the above example, 11rr$\textrm{s}^{12}$ is the unique coding of $(1,1,1,1,1,11)$.
But the angle vector $(0, 0, 4, 0, 6, 10)$, for example, admits $1022$ different codings.
To rule a case out, each of these codings must be checked.
Formally, a small angle vector $\vec{k}$ is said to {\em cover} a medium angle vector $\vec{l}$ if there exists a coding of $\vec{l}$ such that, for any factor xsy of this coding, the (unique) coding of $\vec{k}$ contains xry.
One also says that $\vec{k}$ {\em pre-covers} $\vec{l}$ if there exists a coding of $\vec{l}$ such that, for any factor xs of this coding, the coding of $\vec{k}$ contains xr.
This latter condition is weaker but it can be directly checked on the angle vector (which precisely counts the factors of length $2$), hence faster.
Consider the $16805$ candidates pairs small/medium angle vectors.
Keeping only those where the s-corona contains an r-disc and the r-corona an s-disc reduces to $12265$ pairs.
Checking the pre-covering condition reduces to $2889$ pairs.
Checking then the covering condition reduces to $803$ pairs.
These $803$ pairs correspond to $192$ different medium coronas out of $1654$ initially, and the associated equations are generally much simpler\footnote{
Computing the $192$ polynomials takes $2$min on our laptop and yields a $256$Ko file.
The mean degree is $14$, the maximum one $80$ for 11rrsrss.
This has to be compared with the statistics provided for all the $1654$ polynomials at the end of Section~\ref{sec:medium}.}.
The hidden variable method fails on $23$ of these $803$ pairs.
For $8$ of them, the computation of the algebraic roots of the resultants raises (various) exceptions.
Again, we compute the roots with interval arithmetic and filter them with interval arithmetic.
Only one pair remains: 1rr1s / 11rrs.
Lemma~\ref{lem:1pc_impossible_2} (page~\pageref{lem:1pc_impossible_2}) rules out this pair with a combinatorial argument.
The $15$ other pairs fail because the two resultants are zero, that is, there is a continuum of possibles pairs $(r,s)$.
We rule them out as follows.
In $13$ out of these $15$ cases, neither the s- nor the r-corona does contain a 1-disc.
In order to allow a packing with three sizes of discs, there must be an s-corona or an r-corona with a 1-disc.
If there is such a corona with an s-disc and an r-disc adjacent, then this case appears in the initial list of $16805$ candidates pairs and is handled elsewhere.
Otherwise, there is either an s-corona with only 1- and s-discs, or an r-corona with only 1- and r-discs.
In the former case, the corona appears in Tab.~\ref{tab:petites_couronnes_deux_disques} and characterizes $s$.
The same holds in the latter case, with $r$ instead of $s$.
In both cases, and for each of these $10$ new possible coronas, we consider the polynomial system formed by the equation associated to the new corona and the two ones associated with the initial pair of corona.
We find (using Gröbner basis) that none of these systems does have a solution.
These 13 cases are thus ruled out.
The two remaining cases are 1rr / 1r1srs and 11r / 111s1s.
The first case is not possible: the s-corona 1rr tells us that the s-discs must be in the interstices between one 1-disc and two r-discs, but then the r-corona 1r1srs should be an r-corona 1r1r with s-discs in the interstices, but the r-corona 1r1r is forbidden ($r$ should be arbitrarily small).
In the second case, the s-corona 11r tells us that the s-discs must be in the interstices between two 1-discs and one r-disc, but then the r-corona 111s1s is not completed because one could add s-discs between the central r-discs and two consecutives 1-discs, yielding the r-corona 1s1s1s1s.
This is thus a subcase of 11r/1s1s1s1s, which is handled elsewhere.
All the cases where the hidden variable method fails are thus ruled out.
The hidden variable method works on the $780$ other pairs and yields $56968$ algebraic pairs $(r,s)$, with $0<s<r<1$.
Arithmetic filtering rules out all but $202$ of them.
The exact filtering rules out $27$ of these pairs.
One is the pair 1srrs / rrsrsss which turns out to also allow the s-corona 1s1ss: this is actually the only one case which allows a packing Section~\ref{sec:two_smalls} (number $19$ in Appendix~\ref{sec:examples}).
The $26$ other ones are detected as ''duplicates'' once all the possible coronas are computed, that is, there is another pair which yields the same values of $(r,s)$ and the same set of possible coronas.
The $175$ other cases are validated and all the possible coronas computed.
Computing exactly all the large coronas is the most time-consuming part of all the paper ($30$min on our laptop, {\em i.e.}, half of the total computation time).
We find a periodic packing for $145$ of these $175$ cases (numbers $20-164$ in Appendix~\ref{sec:examples}).
We shall rule out the other cases by two combinatorial lemmas.
The first one rules out $24$ cases:
\begin{lemma}
\label{lem:1pc_impossible_1}
If a compact packing contains an s-corona 1rss, 11rss, 1rrss or 1srss, then it must contain another s-corona (other than ssssss).
\end{lemma}
\begin{proof}
The proof does not rely on the value of $r$ and $s$.
The four cases are similar and depicted in Fig.~\ref{fig:1pc_impossible_1}.
Polygons around letters link the text and the figure.
Consider an \fond{4}{s}-disc and an \fond{5}{s}-disc in its corona.
The \fond{5}{s}-corona is determined and yields in the corona of the \fond{6}{s}-disc a factor (1ss1 in the first case, rssr in the other ones) which appears neither in these four \fond{4}{s}-coronas nor in ssssss.
\end{proof}
\begin{figure}[hbtp]
\centering
\includegraphics[width=\textwidth]{1pc_impossible_1.pdf}
\caption{Four s-coronas which ensure that there must be another s-corona.}
\label{fig:1pc_impossible_1}
\end{figure}
The second lemma rules out the $6$ last pairs, as well as the pair 1rr1s/11rrs, for which no exact filtering was performed (because the hidden variable method yields only interval for $r$ and $s$):
\begin{lemma}
\label{lem:1pc_impossible_2}
The small/medium coronas 1rsrs/1rr1ss, 11rr/11rrs, 1rr1s/11rrs, rrrrr/1rsrsr, rrrrs/11rssr, rrrss/11rssr and rrrs/11rssr do not allow a packing with all the three sizes of discs (without any other small corona, except ssssss).
\end{lemma}
\begin{proof}
We check the $7$ cases one by one, using the values of $r$ and $s$ to determine (with a computer) all the possible coronas and then relying on a short combinatorial argument (illustrated next to it).
\noindent
\begin{minipage}{0.73\textwidth}
{\bf 1rsrs/1rr1ss.}
The values of $r$ and $s$ allow no other r-corona.
In the \fond{4}{s}-corona, the \fond{4}{r}-disc has three neighbor s-discs.
This is incompatible with the r-corona 1rr1ss.
\end{minipage}
\hfill
\begin{minipage}{0.17\textwidth}
\includegraphics[width=\textwidth]{1pc_impossible_4a.pdf}
\end{minipage}
\bigskip
\noindent
\begin{minipage}{0.24\textwidth}
\includegraphics[width=\textwidth]{1pc_impossible_4b.pdf}
\end{minipage}
\hfill
\begin{minipage}{0.66\textwidth}
{\bf 11rr/11rrs.}
The values of $r$ and $s$ allow no other r-corona.
In the corona of the \fond{4}{r}-disc, the corona of the \fond{5}{r}-disc enforces the factor 1rr1 in the corona of the \fond{6}{r}-disc.
This is incompatible with the r-coronna 11rrs.
\end{minipage}
\bigskip
\noindent
\begin{minipage}{0.68\textwidth}
{\bf 1rr1s/11rrs.}
The values of $r$ and $s$ allow no other r-corona.
In the corona of the \fond{4}{r}-disc, the corona of the \fond{5}{r}-disc enforces the factor srrs in the corona of the \fond{6}{r}-disc.
This is incompatible with the r-corona 11rrs.
\end{minipage}
\hfill
\begin{minipage}{0.22\textwidth}
\includegraphics[width=\textwidth]{1pc_impossible_4c.pdf}
\end{minipage}
\bigskip
\noindent
\begin{minipage}{0.45\textwidth}
\includegraphics[width=\textwidth]{1pc_impossible_4d.pdf}
\end{minipage}
\hfill
\begin{minipage}{0.45\textwidth}
{\bf rrrrr/1rsrsr.}
The values of $r$ and $s$ allow no other r-corona.
In the \fond{4}{s}-corona, there two symmetric ways to draw the corona of the \fond{4}{r}-disc.
Once it is done, the corona of the neighboring \fond{5}{r}-disc is determined.
The coronas of the two \fond{6}{r}-discs are also determined.
This enforces two 1-discs in the \fond{8}{r}-corona.
This is incompatible with the r-corona 1rsrsr.
\end{minipage}
\bigskip
\noindent
\begin{minipage}{0.7\textwidth}
{\bf rrrrs/11rssr.}
The values of $r$ and $s$ also allow the r-coronas rsrsrss and 1111r, as well as the 1-corona 1r1r1rr.
Exchanging types r and 1 in Lemma~\ref{lem:biphase} ensures that any packing with three sizes of discs must contain the r-corona 11rssr.
Consider an \fond{4}{r}-corona 11rssr.
The corona of the \fond{5}{r}-disc must be 11rssr and its position is determined.
This enforces a factor srrs in the \fond{4}{s}-corona.
This is incompatible with the s-corona rrrrs.
\end{minipage}
\hfill
\begin{minipage}{0.2\textwidth}
\includegraphics[width=\textwidth]{1pc_impossible_4e.pdf}
\end{minipage}
\bigskip
\noindent
\begin{minipage}{\textwidth}
{\bf rrrss/11rssr.}
The values of $r$ and $s$ also allow the r-coronas rrsrrss, rrrsrss and 111rr, as well as the 1-coronas 11r11rr and 111r1rr.
The argument works exactly as for the previous case and forces an impossible factor srrs in the s-corona.
\end{minipage}
\bigskip
\noindent
\begin{minipage}{0.3\textwidth}
\includegraphics[width=\textwidth]{1pc_impossible_4f.pdf}
\end{minipage}
\hfill
\begin{minipage}{0.6\textwidth}
{\bf rrrs/11rssr.}
The values of $r$ and $s$ also allow the r-coronas rsrsrsrsss, rsrsrssrss, rsrssrsrss, rrrrsrss, rrrsrrss, rrrsrss, 1rsrsssr, 1rssrssr and 111r.
The r-coronas 1rsrsssr and rsrsrsrsss are actually impossible because the s-corona rrrs forbid three consecutive s-discs in any r-corona.
Exchanging types r and 1 in Lemma~\ref{lem:biphase} ensures that any packing with three sizes of discs must contain an r-corona 1rssrssr or 11rssr.
In both \fond{4}{r}-coronas, the \fond{4}{s}-corona rrrs yields a factor 1rsr in the \fond{5}{r}-corona.
This is incompatible with the allowed r-coronas (1rsrsssr has been discarded).
\end{minipage}
\end{proof}
| {'timestamp': '2020-02-11T02:07:48', 'yymm': '1810', 'arxiv_id': '1810.02231', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02231'} | arxiv |
\section{Introduction}
Large games often require large animation graphs with a huge amount of unique animations in order to provide realistic and responsive movements. As the number of states grows in the graph, the number of required transitions may grow exponentially, while each of these transitions may require several variations to allow different conditions to be handled. In order to deal with continuous conditions or control signals, these variations of a single transition often need to respect additional constraints in order to allow interpolation, such as timing and phase constraints. All these elements make animation authoring an important but very tedious task.
We explore in this research paper a data-driven approach based on deep Recurrent Neural Networks (RNN) to automatically generate transition clips from any character motion in order to reach a desired target, defined as the future desired state of the character. Such an approach aims at leveraging high quality data from Motion Capture (MOCAP) based animations, without needing labels, in order to greatly simplify the task of transition generation for games. While recent deep learning approaches have been proposed to improve motion prediction, or \textit{unconstrained continuation}, the problem of transition generation for games seems much less studied while being an important one. Our method builds on recent advances in deep learning for motion prediction such as the Encoder-Recurrent-Decoder (ERD) networks \cite{fragkiadaki2015recurrent} and the ResNet RNNs \cite{martinez2017human}, in which a recurrent network takes as input a number of frames that we call here the \textit{past context} and generates the next frames of animation. In our case, the architecture is designed specifically for transition generation by conditioning at every step of the generation on a target-relative representation called \textit{future context} that is evolving through time. The future context conditioning is done in a modified Long-Short-Term-Memory (LSTM) layer, responsible for modeling the temporal dynamics of motion, by adding extra weights and inputs for the computation of each gate and the internal cell values. We call such a network a Recurrent Transition Network (RTN). During training, we pick such past and future contexts directly from the data, without any labeling of gait, phase or other information.
The hidden states' initialization of recurrent layers for a given sequence is often a subject absent from various work on motion prediction with RNNs. This is because default strategies, such as initializing these hidden states to zero-vectors or learning a common initial state as extra parameters, are used most of the time. It works in practice, especially when the RNN takes several frames as inputs to compute a good hidden state before starting the generation, but it unnecessarily complicates the task since the network has to learn to cope with this default initial hidden state by relying solely on the input for the first timesteps. We propose a simple way to initialize hidden states of recurrent layers with respect to any input sequence by having a small feed-forward network learning an inverse function that maps the first frame of the past context to the initial recurrent hidden state that minimize the generation error. This does not require any modification to the loss function, and improves the performance of the system.
We further explore additional constraint-conditioning by including local terrain information to the inputs of the network in the form of local height-maps based on current root (hips) location. In our experiments with longer transitions (2 seconds), we show that we have qualitative and quantitative gains over a terrain agnostic RTN.
The recent focus of character kinematics modeling with deep recurrent neural networks has been mostly on motion prediction \cite{li2017auto, martinez2017human, ghosh2017learning} and online control \cite{holden2016deep, holden2017phase, zhang2018mode}, while animating transitions is still a core task for animators and could be greatly accelerated if not automated. Statistical latent variable models \cite{wang2008gaussian, lehrmann2014efficient} based on classical machine learning techniques for motion modeling and transition generation for single action types have been proposed, but the generality and scalability of deep neural approaches has yet to be employed specifically on this important task.
Our core contribution for this paper can be summarized as novel, future-aware deep recurrent architecture specifically designed for transition generation, for which we motivate and quantify all the relevant design choices. It produces highly realistic and fluid character locomotion transitions while being generic, scalable and having a low memory footprint. This paves the way to greatly simplifying and accelerating transition authoring for games.
\section{Related Work}
\subsection{Motion Control}
Our approach makes use of future targets to be reached in a fixed time in order to generate motion. This is related to the task of online control, where next frames or fragments of motion are generated with respect to higher-level signals, such as the desired trajectory, \cite{holden2016deep} or a footsteps plan, \cite{agrawal2016taskBasedLocomotion}. In these scenarios, the control signals often represent an under-specified description of the task, for which many possible executions may lead to the character completing it correctly. From that view, many control methods for locomotion are related to our work and relevant to mention.
Important work was done with motion graphs \cite{arikan2002interactive, lee2002interactive, kovar2008motion, beaudoin2008motion} in which a motion dataset is converted into a graph specifying the valid transitions for realistic movements. Walks through the graph then correspond to valid motions made from the visited nodes or edges depending on the method. Combined with a search algorithm \cite{safonova2007construction}, one can produce a transition generator that finds paths in the motion graph that reach the desired state in the desired time. These approaches, however, are limited to outputting motions from the dataset and often don't offer generalization capabilities comparable to deep learning methods. The graph and animations used must also be loaded in memory in order to output the resulting animation making the memory requirements scale with the dataset.
\citet{chai2005performance} introduced a method that learns temporally-local low-dimensional linear models with PCA from nearest candidate poses to predict the next pose in the motion. Control signals here are low-dimensional vectors of marker positions or sparse accelerometer data in the case of \citet{tautges2011motion} and are mapped to full body animations. These require a preprocessed graph representation of the data available in memory and performing nearest neighbor search at runtime, and thus doesn't scale well with larger motion datasets.
Machine learning techniques and statistical models for motion control may offer advantages over graph-based methods, such as better generalization and lower memory requirements at runtime, at the cost of a computation-heavy learning phase. \textit{Maximum A Posteriori} (MAP) frameworks have been proposed to maximize the likelihood of generated motions with respect to environmental or user constraints, which can, similarly to our case, correspond to keyframes. \citet{chai2007constraint} propose a statistical dynamic model that can handle specific actions, with relatively close keyframes as constraints, while \citet{min2009interactive} build deformable motion models based on Principal Component Analysis (PCA) of the geometric variations and timing variations of a canonical motion cycle. These models are more compact than motion graphs, but specialized to certain motion cycles as they require run-time optimization of the MAP framework that doesn't scale well with a wide range of motions.
Gaussian Process Latent Variable Models (GPLVM), which are framed as probabilistic, non-linear variants of PCA by \citet{lawrence2004gaussian, lawrence2005probabilistic} were also successfully applied to motion modeling and control \cite{grochow2004style, wang2008gaussian, ye2010synthesis, levine2012continuous}. \citet{min2012motion} also use Gaussian Processes to model transitions between morphable motion primitives. These methods often offer better generalization and allow to model uncertainty. However, they also suffer from limited scalability due to costly runtime computations and are often applied on individual action types, making the combination of actions seem very scripted (e.g. walk a step, then throw a punch). Our method is more generic and has a constant runtime, independent from the number of training samples.
Methods based on neural networks have more recently shown impressive results for more generic kinematic control. Deep-learning based approaches allow to encode motion dynamics from large amounts of data into a small, fixed-sized network that is often fast to run. \citet{holden2016deep} present a deep-learning framework allowing animation synthesis from ground trajectories or desired end-effectors' positions, respecting a motion manifold learned by a convolutional auto-encoder \cite{holden2015learning}. Online control from user inputs was also tackled with deep learning work by \citet{holden2017phase} and Zhang, Starke et al. \shortcite{zhang2018mode} in which auto-regressive neural networks model the highly non-linear relations between a current character state, user inputs and the resulting next state. These methods rely on phase-dependent or mode-dependent weights to disambiguate the next possible pose. Our approach does not require similar explicit disambiguation techniques since our network can model high-level temporal dynamics through its recurrent layer and further uses future context information as a guiding signal.
The motion control problem has also been addressed through reinforcement learning (RL) methods. Some previous methods made use of animation clips \cite{lee2006precomputing, treuille2007near} or motion states \cite{lee2010motion} taken directly from the data as outputs of the RL algorithm, thus requiring large amounts of memory for large datasets. \citet{levine2012continuous} learn a control policy operating in the low-dimensional latent space learned from their GPLVM variant for which computations scale linearly with the number of samples in the data, thus limiting the system to model single action classes. In the domain of physically-based locomotion, RL techniques have also been applied, such as fitted value iteration \cite{coros2009robust}, for which actions correspond to pre-optimized proportional-derivative (PD) controllers for locomotion \cite{yin2007simbicon}. These techniques all rely on value functions that have discrete domains and rely on interpolation during runtime to handle continuous states, limiting to some extent the expressiveness of the systems.
The combination of deep learning with advances in reinforcement learning gave rise to deep reinforcement learning methods that addressed many limitations of these previous approaches. \citet{peng2017deeploco} apply a hierarchical actor-critic algorithm that outputs desired joint angles for PD-controllers. Their approach is applied on a simplified skeleton and does not express human-like quality of movement despite their style constraints. Imitation-learning based RL approaches \citep{ho2016generative, baram2016model} try to address this with adversarial learning, while \citet{peng2018deepmimic} tackle the problem by simply penalizing distance of a generated state from a reference state and proposing new training strategies, such a reference state initialization. Actions as animation clips, or control fragments \cite{liu2017learning} can also be used in an RL framework with Q-learning to drive physically-based characters. These methods show impressive results for characters having physical interactions with the world, while still being limited to specific skills or short cyclic motions. We operate in our case in the kinematics domain and train on significantly more diversified motions.
\subsection{Motion Prediction}
We limit here the definition of motion prediction to predicting the motion continuation given single or multiple frames of animation. This unrestricted formulation alone may have limited concrete applications for games, where movements are constrained by control or targets signals, but it is nonetheless very relevant to learn a powerful dynamics' model in such a way for transition generation.
Neural networks have shown over the years to excel in such representation learning. Early work from \citet{taylor2007modeling} using Conditional Restricted Boltzmann Machines showed promising results on motion generation by sampling at each timestep the next frame of motion conditioned on the current hidden state and $n$ previous frames. More recently, many RNN-based approaches have been proposed for motion prediction from a past-context of several frames, motivated by the representational power of RNNs for temporal dynamics. \citet{fragkiadaki2015recurrent} propose to separate spatial encoding and decoding from the temporal dependencies modeling with the Encoder-Recurrent-Decoder (ERD) networks, while \citet{jain2016structural} apply structural RNNs to model human motion sequences represented as spatio-temporal graphs. \citet{martinez2017human} propose to simplify these networks with a single-layer Residual Recurrent Network predicting offsets from the current pose in order to reduce jumps on the first predicted frame. In this work, we use an architecture closer to ERD networks and use different separate encoders for the different inputs, in order the allow for a smaller recurrent layer focused on conditioning the temporal dynamics on various signals. \citet{li2017auto} and \citet{ghosh2017learning} investigate ways to prevent divergence on collapsing to the average pose for long-term predictions with RNNs. In our case, these problems are naturally mitigated by the added constraints of the target state to obtain and the reduced length of the generation. We also use a fixed-probability teacher-forcing scheme that empirically showed improvements over other teacher-forcing strategies, as described in Section \ref{sec:teacher}.
\subsection{Transition generation}
Work applied directly to transition generation is sparser, especially in the deep learning literature. However, important work with probabilistic models of human motion have been used for transition generation, or gap-filling of animation. These include the MAP optimizers of \citet{chai2007constraint} and \citet{min2009interactive}, the Gaussian process dynamical models from \citet{wang2008gaussian} and Markov models with dynamic auto-regressive forests from \cite{lehrmann2014efficient}. All these present specific models for given action and actors, making combinations of actions hard or unnatural, while we leverage a large heterogeneous dataset along with the scalability of deep learning methods to train a single, generic model trained with unlabeled and unsegmented motion sequences.
\section{Data formatting}
\subsection{Dataset}
The data for this experiment was captured in a MOCAP studio using a Vicon system. It contains a lot of unstructured motion data summarized in Table \ref{table:dataset}, all re-targeted to a common skeleton from which we use $K=22$ bones, and downsampled at a rate of 30 frames per second.
\begin{table}[h]
\caption{Dataset motion categories}
\begin{sc}
\begin{center}
\begin{tabular}{lrr}
Motion &Frames (at 30 fps) &Minutes
\\ \hline
Flat Locomotion & 240 776 & 133\\
Terrain Locomotion & 113 020 & 63\\
Dance & 38 916 & 22\\
Others & 115 716 & 64\\
Total &508 428 & 282\\
\end{tabular}
\end{center}
\end{sc}
\label{table:dataset}
\end{table}
The \begin{sc}Others\end{sc} category contains fighting movements, falling down and recovery motions, as well as sports-like movements and other miscellaneous motions. No labeling was done on the sequences, and the 5 performers were not professional actors. The locomotion components of the dataset are similar to the publicly available terrain locomotion data from \citet{holden2017phase}. In all of our experiments except for those detailed in Section \ref{section:superres}, we used only the terrain locomotion data, corresponding to approximately one hour of MOCAP. The dataset contains long, uninterrupted sequences of motions that we split into $N$ overlapping sub-sequences $\mathrm{\textbf{Y}}_n$, $n \in \{0, ..., N-1\}$ that have a length $L$ determined by our desired transition length. As we use a past context of 10 frames in all of our experiments, and 2 frames are needed to produce our target state, we have a necessary $L \geq 10 + P + 2$, where $P$ is our desired transition length. In practice however, as we want to qualitatively assess the continuity of the movement after the transition, we keep 10 post-transition frames in our windows. Therefore, unless specified otherwise, we use $P=30$ in our experiments, as discussions with domain experts led us to believe that such a length covers a vast majority of transitions for many games.
\subsection{Input representations and processing}
\subsubsection*{Input sequences}
Similarly to \cite{holden2016deep}, we work with positional information. The raw data consists of sequences $\mathrm{\textbf{Y}}_n = \{\textbf{y}_0, ..., \textbf{y}_{L-1} \}_n$ of vectors $\textbf{y}_t$ of global 3D positions. The dimensionality of all positional or velocity vectors in this work is of $D = 3 \times K$ where $K=22$ is the number of bones used. Our preprocessing of the positional vectors $\textbf{y}_t$ consists of three steps.
First, we store in $\textbf{v}_t \in \mathbb{R}^3$ the 3D global velocity of the root joint (\textit{hips}) at each frame $t$, computed from the instant offset from the previous frame. Hence, $\textbf{v}_t = \textbf{r}_t - \textbf{r}_{t-1}$, where $\textbf{r}_t$ is the global root position extracted from $\textbf{y}_t$.
Secondly, we remove from every marker the global position of the root joint in order to get root-relative positions. We then replace the now null positional root information in the vector by its instant global velocity. This yields a new vector $\tilde{\textbf{x}}_t = [\textbf{v}_t, \, \textbf{j}^1_t, ...,\, \textbf{j}_t^{K-1}]^\mathrm{T}$ where $\textbf{j}^k_t$ is the 3D root-relative position of joint $k$, with indexes starting at $0$ for the root.
The third and last step is the normalization scheme commonly used in deep learning in order provide the network data samples following zero-centered Gaussian distribution with an identity covariance matrix. In the rest of the paper, we will use the term \textit{normalize} to represent this \textit{standardization} operation of subtracting from a data sample $\textbf{z}$ its mean $\bm{\mu}_z$ computed over the training set of the data, and dividing the result by the standard deviation $\bm{\sigma}_z$ over the training data. We therefore have our processed input vector $\textbf{x}_t = (\tilde{\textbf{x}}_t - \bm{\mu_x}) / \bm{\sigma_x}$.
Our preprocessing function is reversible, as long as $\bm{\mu_x}$ and $\bm{\sigma_x}$ are stored, as well as a global offset information for a given sequence $\mathrm{\textbf{Y}}_n$, such as the global position of the root on the first frame, in order to place it back correctly in the world frame. We purposely defined a separate notation for the un-processed positional frames $\textbf{y}_t$ as they will be used when handling local terrain information.
\subsubsection*{Future context}
In order to generate transitions, the system makes use of information relative to the desired target state. We call this the future context. It is used as conditioning information at every timestep and consists of the concatenation of two different vectors.
The first one is the target vector $\textbf{t} \in \mathbb{R}^{2*D}$ which is simply the processed target pose we want the character to end up in concatenated with the normalized velocity of all joints on that frame. The normalization step of the velocity is done with statistics computed over the preprocessed training set. The target vector is constant throughout the generation process.
The other vector included as future context is the global offset vector $\textbf{o}_t \in \mathbb{R}^D$ which is composed of the euclidean distances of each joints from the target pose in global space (unpreprocessed). As the transition is generated, these global offsets evolve with respect to the last generated frame and the global target positions. The vector $\textbf{o}_t$ is also normalized with the training set statistics.
\subsubsection*{Terrain}
In most of our experiments, we also make use of local terrain information as an additional guiding signal for better reconstructions. Similarly to \cite{peng2017deeploco, peng2018deepmimic}, we use a local heightmap relative to the $(x,z)$ root position. In our case, we sample at each timestep a 13 $\times$ 13 grid spanning 2.06 $\times$ 2.06 meters centered on the character. We then convert this heightmap into a grid of $y$-offsets from the root joint. This is to allow a local terrain representation that is invariant to the general elevation of the area. We then normalize this grid on statistics computed on the training set.
\begin{figure}[h]
\begin{center}
\centerline{\includegraphics[width=0.3\textwidth]{images/fig_patch.png}}
\caption{Visual depiction of a local terrain patch.}
\label{fig:local_patch}
\end{center}
\end{figure}
We use the 169-dimensional flattened vector $\textbf{p}_t$ of this grid as our representation for the local patch of terrain. A visual depiction of the unprocessed information contained in $\textbf{p}_t$ is shown in Figure \ref{fig:local_patch}.
\subsection{Data augmentation}
\subsubsection*{Terrain}
As the motion dataset does not contain any obstacle or terrain information from which to extract the local patches $\textbf{p}_t$, we first need to augment our data with coherent terrain information with respect to the motion. We follow the terrain fitting procedure proposed by \citet{holden2017phase}, which consists of fitting and editing several heightmaps $\textbf{H}_{l}, l\in \{0,...,4\}$ with respect to each sequence $\mathrm{\textbf{Y}}_n$ that are large enough to cover the range of the motion on the transverse plane. It is done by first evaluating a cost function that penalizes foot traversal and floating based on feet contacts and heights at each timestep. The contact information is extracted automatically from feet velocities. This fitting step is done for all sequences and heightmaps. A refinement steps then applies to the best scoring heightmaps a 2D radial basis function (RBF) on the feet $y$-offsets from the terrain on contact frames, which is evaluated and added to the terrain as corrections. We refer readers to \cite{holden2017phase} for more details, as we use the same cost function, and the same heightmap dataset.
Our method differs in that we use a logistic kernel for the RBF instead of a linear one, while also further smoothing the resulting heightmaps with a 2D Gaussian filter around the contact points on the condition that it doesn't decrease the overall terrain score for the sequence. Our filter $\textbf{F}$ is a 33 $\times$ 33 grid spanning 1.3 $\times$ 1.3 meters with values following an isotropic 2D Gaussian with a standard deviation of 5 (20 centimeters). It is re-scaled so that its maximum value is equal to one. We then correct the values of the heightmap $\textbf{H}$ over a sub-grid with the same shape as $\textbf{F}$ around the point of contact $(x, z)$ with the $\textbf{F}$-weighted $y$-offset $\Delta_y$ of the contact foot from the ground:
\begin{equation}
\textbf{H}_{x+i-16, z+j-16} = \textbf{H}_{x+i-16, z+j-16} + \Delta_y \textbf{F}_{i,j}
\end{equation}
This is done for every contact point. These modifications to the algorithm are made to provide the system with the most realistic-looking terrain during training, to reflect plausible locomotion conditions. We keep and refine the top-5 terrain heightmaps for every sub-sequence $\mathrm{\textbf{Y}}_n$ in the dataset, and pick one randomly at each training iteration as our data augmentation.
\subsubsection*{Random orientation}
Our data preprocessing of the global positions makes the motion modeling translation invariant since we work with root-relative positions for all joints, and global velocity for the root. We enforce horizontal orientation invariance as well by randomly rotating each motion sequence $\mathrm{\textbf{Y}}_n$ seen during training around a unit \textit{up}-vector emerging from the center of the terrain. The angle of rotation is drawn uniformly in $[-\pi, \pi]$. The rotation is performed on the global positions, before any pre-processing of the sequence. We apply the same rotation on the terrain heightmap around its center in order to extract local patches $\textbf{p}_t$ consistent with the new global $(x,y)$ coordinates of the positions.
\section{Recurrent Transition Network}\label{section:architecture}
\subsection{System overview}\label{section:overview}
An overview of our proposed system can be seen in Figure \ref{fig:overview}, depicted for a single timestep. It takes as inputs a preprocessed positional vector $\textbf{x}_t$ retrieved from the unprocessed corresponding global positional vector $\textbf{y}_t$ and a local terrain patch representation $\textbf{p}_t$ retrieved from a heightmap $\textbf{H}$ with respect to $\textbf{y}_t$. It uses as conditioning information a normalized target vector $\textbf{t}$ computed from the global positions on the target frame $\textbf{y}_T$ and the next one $\textbf{y}_{T+1}$, and a global-offset vector $\textbf{o}_t$ retrieved from $\textbf{y}_t$ and $\textbf{y}_T$.
\begin{figure}[h]
\begin{center}
\centerline{\includegraphics[width=0.36\textwidth]{images/RTN_3.png}}
\caption{Graphical overview of the proposed architecture for a single step of generation. Numbers in parenthesis correspond to the number of hidden units used in all of our experiments. Dashed lines represent operations happening outside the neural network. Green circles represent un-preprocessed, global positional data, while blue circle represent preprocessed data.}
\label{fig:overview}
\end{center}
\end{figure}
The RTN is composed of several, specialized sub-networks all trained jointly by gradient descent. Similarly to ERD networks, a frame encoder $\mathcal{E}()$ and frame decoder $\mathcal{D}()$ are used as spatial encoder/decoders, while the temporal dynamics are modeled in a modified LSTM layer $\mathcal{R}()$. Two smaller encoders are also used for encoding parts of the future context. The target encoder $\mathcal{F}()$ encodes the desired normalized target state to reach, once per sequence, while the global-offset encoder $\mathcal{O}()$ is used to encode at every step the current global positional offset from the target. An additional, optional hidden state initializer small sub-network $\mathcal{H}()$ is used in our case once per sequence in order to initialize the hidden state and cell of the LSTM layer appropriately for every sequence. All the operations of these sub-networks are detailed in the rest of this Section.
\subsection{Frame encoder}
At each timestep, the preprocessed current character configuration $\textbf{x}_t$ and local patch $\textbf{p}_t$, are first transformed into a new hidden representation $\textbf{h}^{\mathcal{E}}_t$ by the frame encoder $\mathcal{E}()$, which consists of a Multi-Layer Perceptron (MLP) with two hidden layers:
\begin{equation}
\textbf{h}^{\mathcal{E}}_t = \mathcal{E}(\textbf{x}_t, \textbf{p}_t) = \phi \big(\textbf{W}^{(2)}_{\mathcal{E}} \phi(\textbf{W}^{(1)}_{\mathcal{E}}
{\begin{bmatrix}
\textbf{x}_t \\
\textbf{p}_t\\
\end{bmatrix}}
+ \textbf{b}^{(1)}_{\mathcal{E}})+ \textbf{b}^{(2)}_{\mathcal{E}}\big)
\end{equation}
where $\textbf{W}^{(l)}_{\mathcal{E}}$ and $\textbf{b}^{(l)}_{\mathcal{E}}$ are the weight matrices and bias vectors of the $l^\mathrm{th}$ layer, and $\phi$ is the Leaky Rectified Linear Unit (LReLU) activation function \cite{maas2013rectifier}. The frame encoder has 512 units in both its layers. In experiments without terrain-awareness, the concatenation with $\textbf{p}_t$ is absent and $\textbf{x}_t$ only is received as a lower-dimensionality input.
\subsection{Future context encoders}
The future, normalized target $\textbf{t}$ encoder $\mathcal{F}()$ and the global offset $\textbf{o}_t$ encoder $\mathcal{O}()$ are both similar MLPs to the frame encoder, with two 128-dimensional hidden layers each.
\begin{align}
\textbf{h}^{\mathcal{F}} = \mathcal{F}(\textbf{t}) &= \phi \big(\textbf{W}^{(2)}_{\mathcal{F}} \phi(\textbf{W}^{(1)}_{\mathcal{F}} \textbf{t} + \textbf{b}^{(1)}_{\mathcal{F}})+ \textbf{b}^{(2)}_{\mathcal{F}}\big)\\
\textbf{h}^{\mathcal{O}}_t = \mathcal{O}(\textbf{o}_t) &= \phi \big(\textbf{W}^{(2)}_{\mathcal{O}} \phi(\textbf{W}^{(1)}_{\mathcal{O}} \textbf{o}_t + \textbf{b}^{(1)}_{\mathcal{O}})+ \textbf{b}^{(2)}_{\mathcal{O}}\big)
\end{align}
The future target $\textbf{t}$ is encoded once and is constant for every timestep of a given sequence.
\subsection{Recurrent generator}
The recurrent generator $\mathcal{R}$ is responsible for the temporal dynamics modeling and the conditioning on the future context. It is a single 512-dimensional LSTM layer that uses the concatenation $\textbf{h}_t^{\mathcal{F,O}}$ of $\textbf{h}^{\mathcal{F}}$ and $\textbf{h}^{\mathcal{O}}_t$ as future-conditioning information along with added corresponding parameters. The LSTM equations are as follow :
\begin{gather}
\textbf{i}_{t} = \alpha(\textbf{W}^{(i)} \textbf{h}^{\mathcal{E}}_t + \textbf{U}^{(i)} \textbf{h}^\mathcal{R}_{t-1} + \textbf{C}^{(i)} \textbf{h}_t^{\mathcal{F,O}} + \textbf{b}^{(i)})\\
\textbf{o}_{t} = \alpha(\textbf{W}^{(o)} \textbf{h}^{\mathcal{E}}_t + \textbf{U}^{(o)} \textbf{h}^\mathcal{R}_{t-1} + \textbf{C}^{(o)} \textbf{h}_t^{\mathcal{F,O}} + \textbf{b}^{(o)})\\
\textbf{f}_{t} = \alpha(\textbf{W}^{(f)} \textbf{h}^{\mathcal{E}}_t + \textbf{U}^{(f)} \textbf{h}^\mathcal{R}_{t-1} + \textbf{C}^{(f)} \textbf{h}_t^{\mathcal{F,O}} + \textbf{b}^{(f)})\\
\hat{\textbf{c}}_{t} = \textbf{W}^{(c)} \textbf{h}^{\mathcal{E}}_t + \textbf{W}^{(c)} \textbf{h}^\mathcal{R}_{t-1} + \textbf{C}^{(c)} \textbf{h}_t^{\mathcal{F,O}} + \textbf{b}^{(c)}\\
\textbf{c}_{t} = \textbf{f}_t \odot \textbf{c}_{t-1} + \textbf{i}_t \odot \tau(\hat{\textbf{c}}_{t})\\
\mathcal{R}(\textbf{h}^{\mathcal{E}}_t, \textbf{h}^\mathcal{R}_{t-1}, \textbf{c}_{t}, \textbf{h}^{\mathcal{O}}_t, \textbf{h}^{\mathcal{F}}) = \textbf{o}_{t+1} \odot \tau(\textbf{c}_{t})\\
\textbf{h}^\mathcal{R}_{t} = \mathcal{R}(\textbf{h}^{\mathcal{E}}_t, \textbf{h}^\mathcal{R}_{t-1}, \textbf{c}_{t}, \textbf{h}^{\mathcal{O}}_t, \textbf{h}^{\mathcal{F}})
\end{gather}
where $\textbf{W}^{(\{i,o,f,c\})}$, $\textbf{U}^{(\{i,o,f,c\})}$, $\textbf{C}^{(\{i,o,f,c\})}$ are feed-forward, recurrent, and conditioning weight matrices respectively, $\textbf{b}^{(\{i,o,f,c\})}$ are bias vectors, and $\odot$ is an element-wise multiplication. The $\alpha$ and $\tau$ functions are the commonly used \textit{sigmoid} and \textit{tanh} non-linearities of LSTM networks.
\subsection{Frame decoder}
Each of the generated output $\textbf{h}^\mathcal{R}_t$ of the LSTM generator is passed to the frame decoder $\mathcal{D}$, which is another fully-connected feed-forward neural network. It has two hidden layers of 256 and 128 LReLU-activated neurons, and a D-dimensional linear output layer.
\begin{equation}
\textbf{h}^{\mathcal{D}}_{t} =\mathcal{D}(\textbf{h}^\mathcal{R}_{t}) = \textbf{W}^{(3)}_{\mathcal{D}} \phi\big(\textbf{W}^{(2)}_{\mathcal{D}} \phi(\textbf{W}^{(1)}_{\mathcal{D}} \textbf{h}^\mathcal{R}_{t} + \textbf{b}^{(1)}_{\mathcal{D}}) + \textbf{b}^{(2)}_{\mathcal{D}}\big) + \textbf{b}^{(3)}_{\mathcal{D}}
\end{equation}
We use a Res-Net LSTM, which outputs an offset from the current frame $\textbf{x}_t$, as suggested by \citet{martinez2017human} in order to reduce the gap between the input seed frames and the beginning of the transition. The final prediction $\hat{\textbf{x}}_{t+1}$ is therefore obtained with:
\begin{equation}
\hat{\textbf{x}}_{t+1} = \textbf{x}_{t} + \textbf{h}^{\mathcal{D}}_{t}
\end{equation}
From $\hat{\textbf{x}}_{t+1}$, we can retrieve $\hat{\textbf{y}}_{t+1}$ by applying the inverse of our preprocessing function, which consists of de-normalizing the vector, retrieving the global root positions by cumulatively adding the velocities to the stored first global frame of the sequence, and then adding those root positions to the other joints.
\subsection{Hidden state initializer}
It is often the case that for continuous prediction, such as motion generation, initialization details for the hidden state\footnote{We include in $\textbf{h}_{-1}$ here both the \textit{output} and \textit{cell} states of an LSTM layer at $t=-1$.} $\textbf{h}_{-1}$ of any recurrent layer is left unspecified (e.g. \cite{ghosh2017learning, martinez2017human}). One can assume that in these cases, the initialization procedure can very well be the default initialization scheme defined by the chosen deep learning library. The most common strategy in this case is to initialize those states to zero vectors, as done by \citet{li2017auto}, or to treat this initial state as additional parameters for the network to learn. With such strategies however, the network must learn to handle this special initial vector common to all samples, and it may then become necessary to provide many input frames to reach a good recurrent internal state encoding properly the motion to complete. We instead propose a simple, yet principled way to initialize $\textbf{h}_{-1}$ with respect to a given sequence. Our method consists of learning an inverse function that predicts $\textbf{h}_{-1}$ given the first frame of the input sequence $\textbf{x}_0$. We learn this with an additional, single hidden layer MLP:
\begin{equation}
\textbf{h}_{-1} = \mathcal{H}(\textbf{x}_0) = \textbf{W}^{(2)}_{\mathcal{H}} \phi(\textbf{W}^{(1)}_{\mathcal{H}} \textbf{x}_0 + \textbf{b}^{(1)}_{\mathcal{H}})+ \textbf{b}^{(2)}_{\mathcal{H}}
\end{equation}
For which the output constitutes the initial hidden sate. Figure \ref{fig:hi} shows where this sub-network is used in practice.
\begin{figure}[h]
\begin{center}
\centerline{\includegraphics[width=0.32\textwidth]{images/HIddenInitializer.png}}
\caption{Graphical overview of the proposed hidden state initialization application. The function $\mathcal{H}()$ maps $\bx0$ to the initial hidden state $\textbf{h}_{-1}$ that will minimize the loss.}
\label{fig:hi}
\end{center}
\end{figure}
This method allows for the recurrent hidden states to be initialized differently for any given input into a good region of the hidden space. In other words, at time $t=0$ the recurrent layer can use a valid input ($\textbf{x}_0$) \textit{and} a valid previous hidden state ($\textbf{h}_{-1}$) that should reduce reconstruction error of the next frames. We train the additional parameters of this sub-network jointly with the rest of the system, without any modification to the loss function, as opposed to \citet{mohajerin2017state} who design a more complex hidden state initialization procedure that requires a separate loss function and a sub-sequence of timesteps as inputs for the state initializer. Our method could work with past contexts of a single frame, and improved the generalization capabilities of the system in all our experiments over commonly used techniques.
\section{Postprocessing}
Our network produces realistic transitions without the need for much postprocessing. In every sample showed, no IK pass is done on top of the generated sequence to prevent feet artifacts. The only postprocessing applied is a correction of the gap between the last generated frame and the target position. We refer to this naive postprocessing as \textit{target blend}.
\subsection{Target blend}
As our system generates a transition to desired a state, it uses this additional target information to shape its prediction as opposed to only predicting the next poses. We can also make use of this additional information to postprocess the generated animation sequences. The network always predicts an additional character-state on the target frame. This allows us to quantify with an offset vector $\textbf{e} = \textbf{y}_{T} - \hat{\textbf{y}}_{T}$ the distance of the true positional target $\textbf{y}_{T}$ from the estimated targeted positions $\hat{\textbf{y}}_{T}$. With that quantity we can then correct a generated transition frame $\hat{\textbf{y}}_t$ with
\begin{align}
\tilde{\textbf{y}}_t &= \hat{\textbf{y}}_t + \omega \textbf{e},\\
\omega &= 1 - \frac{(T-t)}{d}
\end{align}
where $\omega$ is an increasing weight that depends on the current frame index $t$, the target frame index T and the blend duration $d$. The target blend is computed only on frames inside the blend duration. The target blend can smoothly prevent a small jump from the last generated frame and the target position, but will result in artifacts such as foot-skate when a network such as a standard RNN fails to produce a last transition frame that is sufficiently close to the target.
\section{Training}
We will describe here the training procedure details for the RTN.
\subsection{Loss}Throughout the experiments, our loss is defined as the Mean Squared Error (MSE) on the reconstructed transition $\hat{\textbf{X}} = \{\hat{\textbf{x}}_{s}, ..., \hat{\textbf{x}}_{T}\}$ :
\begin{equation}
MSE(\textbf{X}, \hat{\textbf{X}}) = \frac{1}{T-s} \sum_{t=s}^{T} ||\hat{\textbf{x}}_{t} - \textbf{x}_{t}||^2
\end{equation}
where $s$ is the time index of the first transition frame and $T$ is the time index of the target position to reach. The RTN predicts this target in addition to the whole transition as this can allow to quantify the offset in prediction for that target and perform target-blending, as described above. Therefore, when aiming at generating transitions of $P$ frames, the RTN is actually trained to predict $P+1$ frames.
\subsection{Probabilistic Teacher Forcing}\label{sec:teacher}
One core design choice when training RNNs for prediction is on the amount of teacher forcing that is performed during training. Teacher forcing consists of providing to the RNN the ground-truth past frame during training instead of its own previous prediction \cite{williams1989learning}. This can accelerate learning as the generator stays in the realm of plausible motions during training and won't diverge into unlikely trajectories and try to correct for them with exaggerated gradient updates. However, this may also limit the capacity of the network to compensate for its accumulation of errors when deployed or at test time, making it diverge from plausible trajectories. Scheduled sampling \cite{bengio2015scheduled} was proposed in order to have a good balance between training time and test performance. It consists of choosing at each timestep whether to pick the previous true frame $\textbf{x}_{t-1}$ with a probability of $p$ or the previous prediction $\hat{\textbf{x}}_{t-1}$ with a probability of $1-p$ and decreasing $p$ during training. \citet{li2017auto} also investigated this aspect, applied on realistic motion prediction and propose to have a constant-length window during which $\textbf{x}_{t-1}$ is used and another fixed-length window in which $\hat{\textbf{x}}_{t-1}$ is used and alternating these windows during training. They show that this Auto-Conditioned LSTM (AcLSTM) for long-term predictions can produce remarkably stable and plausible trajectories at test-time, even though it may not get the lowest reconstruction error. In our case, we use a fixed-probability version scheduled sampling, which shows improved performance over the vanilla training scheme, teacher forcing, scheduled teacher forcing and AcLSTM both quantitatively and qualitatively.
\subsection{Hyperparameters}
We perform stochastic gradient descent training with minibatches of size 32, using the recently proposed AMSGrad optimization procedure \cite{reddi2018convergence}. We set the probability $p$ to $0.2$ for our fixed ground-truth sampling strategy. Our learning rate is set 0.0005, while we use the common default values of ADAM \cite{kingma2014adam} of $\beta_1$ and $\beta_2$ for the AMSGrad optimizer. We do not use regularization schemes, such as the L2 regularizer or dropout, as it showed no improvement, or decreased performance in our empirical study. For the case of one-second transitions, with the terrain locomotion dataset, the data is processed into 5619 overlapping windows of 50 frames, of which 10 are used as past context, 30 are used as transition ground truth and the remaining 10 are used to extract the target and visualize the quality of the continuation of the movement after the transition. We extract all windows of motion performed by a certain actor to create our validation set. We run the training for 200 epochs in all experiments and show results on the best performing network iteration on the validation set. Details of the data splitting for other setups such as 2-seconds transitions or when using all the data are found in Appendix \ref{app:A}.
\section{Results}
We discuss here the different experiments and results obtained with the RTN, and assess many of the design choices made for transition generation. All samples shown here present results from the validation set, with motions from an actor not seen during training. We refer the reader to the additional supplementary video for a better view of the samples, and many additional results.
\subsection{Transition Reconstruction}
We first train our network to generate transitions of 30 frames on the rough terrain locomotion dataset, consisting of approximately one hour of motion, from which we extract all sequences from one of the five subjects as validation data. This amounts to 20\% of the data, as all actors are similarly represented. Figure \ref{fig:teaser} shows a transition during a forward leap. In general, such locomotion is very well handled by the network, which does not suffer from diverging trajectories or collapsing to the average pose. In most cases, without any post-processing of the resulting animation, it is hard for external viewers to determine if a given transitions was generated or coming from the data. This phenomenon is amplified when correcting the generated transitions with the target blend procedure detailed above. The system successfully models walk and run cycles, turning motions, changes in velocities and stances, all with a wide range of gaits, without using any phase or contact information. The network uses under 15MB of memory. The future context representation and conditioning schemes allow the network to reach the desired targets in time, with a minimal offset easily removed by the target blend.
As our system has a core architecture similar to the Encoder-Recurrent-Decoder (ERD) proposed by \citet{fragkiadaki2015recurrent}, we compare our approach to a baseline consisting of an ERD network with the same number of units for the corresponding components. We augment this ERD network with our future-context conditioning LSTM layer (\begin{sc}F-ERD\end{sc}) as a better suited baseline for the given task, since future agnostic networks cannot infer targets from past context. We augment in a similar fashion a single-layer ResNet-LSTM (\begin{sc}F-ResLSTM\end{sc}) inspired by the architecture proposed by \citet{martinez2017human} as another baseline.
Finally, since we perform the task of transition generation, we have access to the target position so we can compare our method with a more naive interpolation strategy (\begin{sc}INT\end{sc}). In this case, we use the positional and angular information from the last frame of the past context and from the target frame. From those, we perform linear interpolation on the local positions and spherical interpolation on the local quaternions of the bone hierarchy, and retrieve the resulting interpolated global positions. Table \ref{table:res1} summarizes these results. The MSE is calculated in the preprocessed space, so we also provide a measure of Average Centimeter Offset, consisting of the absolute centimeter offset from the ground truth of the generated transition, averaged over all degrees of freedom and over time.
\begin{table}[h]
\caption{Comparison of methods on the MSE on the validation set.}
\begin{sc}
\begin{center}
\begin{tabular}{lcc}
Architecture &MSE &ACO
\\ \hline
INT &0.210 &6.726\\
F-ResLSTM&0.144 &7.709\\
F-ERD &0.092 &4.770\\
RTN &\textbf{0.087} &\textbf{4.751}\\
\end{tabular}
\end{center}
\end{sc}
\label{table:res1}
\end{table}
We also present in Figure \ref{fig:perf1} a refined comparison of these models on the average absolute centimeter offset per degree of freedom at fixed times. This gives summary profiles of performance over time for the methods.
\begin{figure}[h]
\begin{center}
\centerline{\includegraphics[width=0.49\textwidth]{images/prediction_errors.png}}
\caption{Comparison of absolute centimeter offsets at fixed times for different methods.}
\label{fig:perf1}
\end{center}
\end{figure}
Unsurprisingly, naive interpolation produces good results on the firsts and lasts generated frames, but diverges from the ground truth when far from the end and start points. The \begin{sc}F-ResLSTM\end{sc} struggles to stay close to the true transitions even though it shows good short-term motion continuation. This may be due to the fact that mixing future-context conditioning to the spatial and temporal encoding tasks of the LSTM becomes too complex in a single layer. The \begin{sc}F-ERD\end{sc} network, which is the most similar architecture to the complete RTN, shows an interesting trade-off. It produces a gap on the first frame of the generation, degrading the motion continuation, but this seems to facilitate the task of reaching the target, perhaps because the first-frame offset starts the generation closer to the target frame. These offsets from \begin{sc}F-ERD\end{sc} could be smoothed with target blending as well, but would require two passes of postprocessing for the start and end of generation.
\subsection{Impact of terrain awareness}
\begin{figure}[h]
\begin{center}
\centerline{\includegraphics[width=0.45\textwidth]{images/fig_terrain_2.png}}
\caption{Example of a generated 2-second transition with an obstacle. TOP: The terrain-unaware version of the RTN. BOTTOM: The terran-aware version of the RTN. Every eighth frame is shown.}
\label{fig:obstacle}
\end{center}
\end{figure}
The terrain information is used in our system to mitigate feet artifacts such as traversal, floating, or foot-skate. This information is added to the input representation to help the RTN learn relations between feet and terrain thus reducing the loss and producing better transitions. Such reduction of artifacts could reduce the need for an inverse-kinematics pass as post-process, or at least reduce the modifications it entails. However, as our experiments show, transitions of 30 frames seem too short for such added information to improve performance. Indeed, on clips with such lengths, it is hard to find samples where the character goes through an obstacle for which terrain information would be necessary to prevent. With transitions of 60 frames however, although the overall performance of the RTN decreases, the addition of terrain information to the inputs improves the performance of the system, as shown in Table \ref{table:res2}, and is easily noticeable on key samples where obstacles must be acknowledged for plausible transitions. An example of such a sample is shown in Figure \ref{fig:obstacle}.
\begin{table}
\begin{sc}
\caption{Impact of terrain awareness on the MSE for transitions of different lengths.}
\begin{tabular}{lrr}
&\multicolumn{2}{c}{Transition length}
\\\cmidrule(r){2-3}
&30 frames &60 frames\\\midrule
Terrain-unaware & \textbf{0.086} & 0.274\\
Terrain-aware & 0.087 & \textbf{0.268}\\
\end{tabular}
\label{table:res2}
\end{sc}
\end{table}
\subsection{Ablation study}
In order to assess the benefit of the different modifications we bring to the ERD network, an ablation study is done in which we remove or modify individual components or sub-methods to the RTN. Table \ref{table:ablation} shows the quantitative effects of such modifications.
\begin{table}[h]
\caption{Ablation study on the RTN network.}
\begin{sc}
\begin{center}
\begin{tabular}{lc}
Variant &MSE
\\ \hline
RTN\textbackslash future &0.298\\
RTN\textbackslash ptf=$\Delta$ &0.151\\
RTN\textbackslash ptf=1.0 &0.147\\
RTN\textbackslash ptf=0.0 &0.109\\
RTN\textbackslash resnet &0.114\\
RTN\textbackslash h0 &0.095\\
RTN\textbackslash hcommon &0.092\\
RTN &\textbf{0.087}\\
\end{tabular}
\end{center}
\end{sc}
\label{table:ablation}
\end{table}
The \begin{sc}hcommon\end{sc} and \begin{sc}h0\end{sc} modifications correspond to using a common, learned initial hidden state and null initial state for the LSTM layer respectively. The \begin{sc}resnet\end{sc} modification indicates that the RTN outputs the next positions instead of the offset from the previous ones. The \begin{sc}ptf\end{sc} modifications relate to the probability of the teacher forcing sampling, where the number corresponds to the probability of using the previous true frame, while the $\Delta$ symbol corresponds to the scheduled sampling strategy, where $p$ linearly decreases from $1$ to $0$ during training. The \begin{sc}future\end{sc} variant of the RTN corresponds to removing the future-context conditioning from the system. This is unsurprisingly the most necessary component for transition generation, and highlights the benefits of our LSTM modifications. Our proposed technique for the LSTM hidden initialization also improves generation and outperforms two commonly used techniques by allowing the hidden state to be initialized with respect to the treated sequence. In summary, Table 2 shows that our different design choices for the RTN all improve the general performance.
\subsection{Temporal Super-Resolution}\label{section:superres}
In these final experiments, we explore one of the possible application of the RTN beyond transition generation. We use our system to decompress animation saved with only 10 frames of context and a single target state (pose + velocity) per second. The RTN is then responsible for doing temporal super-resolution of the animation. For the exploration of such an application, we train here an RTN on our whole dataset, without terrain conditioning and we test this approach on random validation sequences. In this setup, the network runs with the first 10 frames of animation as past context and the first target as future context. Afterwards, we can run the network in series, using its own generated transition as past context for the next transition animation. We apply the target blend postprocess to each generated second of transition, resulting in smooth and realistic motions and high-quality lossy decompression. We show such a decompressed sequence in Figure \ref{fig:superres}. We further suggest the reader to see the supplementary video to visualize longer decompressed sequences.
\begin{figure}[h]
\begin{center}
\centerline{\includegraphics[width=0.49\textwidth]{images/fir_superres_5.png}}
\caption{An example of temporal super-resolution produced by the RTN. The saved animation only contains the initial context (blue) and a single target (magenta) per second. The network is able to generate realistic transitions, successfully performing temporal decompression, or super-resolution. Every fifth frame is shown. Full sequences are shown in the accompanying video.}
\label{fig:superres}
\end{center}
\end{figure}
Some high frequency motions may be absent from the reconstruction, such as punches or dance moves, but this is due to our naive fixed-interval sampling of the keyframes. One could always chose which targets to store with one-second-or-less intervals in order to ensure the reach of important action landmarks.
\section{Limitations}
Our system, like other machine learning methods, is limited by the data it is trained on and requires large amount of quality samples and a computationally expensive learning phase. Another limitation of our system, like most of the related deep-learning based approaches for motion generation, is that it is not a probabilistic model and thus doesn't allow sampling of multiple transitions given the same constraints and can't model uncertainty well, as opposed to the Gaussian Process based methods.
A limitation specific to our system emerges from the standardization of the global offset vector $\textbf{o}_t$. This standardization effectively limits the ability of the network to generate transitions of lengths significantly longer than those on which the statistics were computed. No architectural choice limits the length of the transitions to be generated, but the length on which the standardizing statistics are computed impose a soft upper bound on the duration of the producible transitions.
\section{Conclusion}
In conclusion, we propose a data-driven approach for animation transition generation, based on a custom recurrent architecture built on recent advances in deep learning for motion prediction and novel additions, such as a future-aware LSTM layer and an effective hidden state initialization procedure. Coupled with good input representations, such as future-context vectors and terrain local patches, we show robust results from a generic model for a wide range of motions. We hope that such a system will replace some naive interpolation strategies commonly used in animation authoring tools or lighten animation graphs by effectively replacing certain transitions nodes. We further explore applications by showing high-quality results on a temporal super-resolution task, where the network produces realistic motions from highly compressed animations.
Future work could include exploring bi-directional recurrent layers for replacing the target-blend postprocess, but such an approach would require nearly twice the computation time and memory requirements, as the recurrent layer is by far the biggest one, and would make other applications such as the super-resolution or other control-related tasks less appealing or impossible since it would require future contexts of several frames instead of single targets. Other directions could be to explore conditioning on other constraints than terrain, such as style or emotion for more refinement of the motions. Probabilistic deep-learning approaches such as variational auto-encoders or adversarial networks should also be explored for adding sampling capabilities to such networks.
\begin{acks}
We first thank Daniel Holden for his important inputs and suggestions. We also thank Simon Clavet, Mike Yurick, Julien Roy and David Kanaa for their help as well. Finally, we thank Ubisoft Montreal and the Mitacs Accelerate program (IT11395) for supporting this research.
\end{acks}
| {'timestamp': '2019-01-21T02:02:18', 'yymm': '1810', 'arxiv_id': '1810.02363', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02363'} | arxiv |
\section{Introduction}
\label{sec:introduction}
\subsection{Motivation}
The broadcast channel with message side information at the receivers has became a critical model to understand the full potential of wireless communication networks as it models, for example, the downlink of the two-way relay channel~\cite{two_wayrelay}. Not even the capacity of the general broadcast channel without receiver side information is known. Therefore, some practically motivated and reasonably simple models are of interest when message side information at the receivers is considered.
Index coding (IC) is one such model. First proposed in~\cite{index_coding_original} when considering satellite communication, the IC consists of one transmitter with $m$ independent messages to be delivered to $n$ users through an error-free broadcast link. Each user has some messages as side information available to it and needs to reliably decode some messages that are not in its side information set; the desired messages for each user are pre-determined. In IC, one asks what is the minimum number of transmissions (i.e., minimum code length) such that every user is able to decode its desired messages successfully~\cite{index_coding_with_sideinfo}.
Compared to the general broadcast channel with side information at the users, the IC appears simple because:
1) the channel is noiseless, and
2) the side information sets are proper subsets of the whole message set.
The IC focuses on the benefits / transmitter encoding opportunities brought by the different side information sets at the users.
However, the general IC is still open.
When one restricts attention to linear codes, the optimal code length is fully characterized by the so-called \emph{minrank} problem, which is NP-complete in general~\cite{index_coding_with_sideinfo}.
In~\cite{IC_NC_matroid} it is proved that the IC, which is a special network coding problem, is in fact equivalent to the general network coding problem.
Therefore, as for network coding, for IC linear schemes are not sufficient~\cite{linear_suboptimality_IC} and non-Shannon type of inequality are necessary~\cite{IC_nonshannon}.
The IC problem models scenarios where the transmitter can do encoding based on the side information sets and on fixed desired message sets for the users.
In practice, there may be flexibility in choosing the desired message sets.
For example, in a music streaming service, users do not know which song will be played next; they are usually only guaranteed that it will be one from a certain group and not repeated.
In online advertisement systems, the clients do not require a specific advertisement to see; it is the distributor who chooses what will be put on the clients' screens; the distributor might want to avoid repeating the same advertisement at the same client, as it might decrease the client's satisfaction.
These scenarios can be modeled as a variant of the IC where the users are satisfied by \emph{any} message that is not in its side information set, instead of a specific one as in the original IC setting. The transmitter thus has the freedom to choose the messages conveyed to the users so to minimize the transmission duration, or code length.
In this paper, we study this variant of IC known as Pliable Index CODing (PICOD), firstly proposed in~\cite{BrahmaFragouli-IT1115-7254174}.
The PICOD$(t)$ and the IC share many attributes.
In the PICOD$(t)$, one still has a single transmitter with $m$ message and $n$ users with message side information.
The transmitter and users are connected via a shared noiseless rate-limited broadcast channel.
The only major difference is that for the PICOD$(t)$ the desired message sets at the users are not pre-determined and each user is satisfied whenever it can decode \emph{any} $t$ messages not in its side information set.
This provides the transmitter more encoding opportunities, as it now encodes based on its own choice of desired message sets for the users, by knowing the message side information sets at each user.
The goal in the PICOD$(t)$ is to find the desired message set assignment that leads to the smallest possible code length.
\subsection{Past Work on PICOD}
As one would expect, the extra freedom of choosing the desired message sets in the PICOD$(t)$ significantly reduces the number of transmissions / code length compared to the classical IC with the same number of messages, number of users, and message side information sets.
In~\cite{BrahmaFragouli-IT1115-7254174}, when all side information sets are of size $s\leq m-t$, it showed that there exits a code of length $O(\min\{t\log (n), t+\log^2 (n)\})$ for the PICOD$(t)$.
When there is no constraint on the size of side information sets, and $m=O(n^\delta)$ for some constant positive $\delta$, a code length of $O(\min\{t\log^2 (n),t\log (n)+\log^3 (n)\})$ is achievable~\cite{BrahmaFragouli-IT1115-7254174}.
Recently in~\cite{polytime_alg_picod}, a deterministic polynomial time algorithm was proposed to achieve a code length of $O(\log^2 (n))$ for $t=1$ and of $O(t\log(n)+\log^2(n))$ otherwise.
Those results show an exponential code length reduction for the PICOD$(t)$ compared to the IC~\cite{BrahmaFragouli-IT1115-7254174}.
An interesting model proposed in~\cite{BrahmaFragouli-IT1115-7254174} is the so-called \emph{oblivious} PICOD$(t)$.
In the oblivious PICOD$(t)$ the transmitter does not know the specific side information sets at the users.
The transmitter only has knowledge of the sizes of the side information sets.
In~\cite{BrahmaFragouli-IT1115-7254174,constant_frac_satisfactory} the authors proved that for the oblivious PICOD$(t)$ at least a fraction $1/e$ of the remained unsatisfied users can be satisfied at each new transmission.
This shows that there exists an achievable scheme where the code length is the logarithm of the number of users in the system,
which is an exponential improvement in the number of transmissions compared to the IC.
Known achievable schemes for the PICOD$(t)$ are based on linear codes only, and very few converse results are available.
To the best of our knowledge, all converse proofs show
bounds under the constraint that the code used is linear.
For the oblivious PICOD$(t)$, the optimal code length under the restriction that the transmitter can only use linear schemes is shown in~\cite[Theorem~9]{BrahmaFragouli-IT1115-7254174}.
In~\cite{polytime_alg_picod}, the authors provide a worst case instance that needs $\Omega(\log (n))$ code length for linear codes. The objective of this paper is to prove information theoretic converse results for some classes of the PICOD$(t)$ without any restrictions of the class of codes used at the transmitter.
\subsection{Contributions}
In this paper we derive tight information theoretic converse bounds for some PICOD$(t)$ problems based on the structure of the side information sets, namely:
(i) the \emph{complete-$S$} PICOD$(t)$, and
(ii) the PICOD$(t)$ with a \emph{circular-arc network topology hypergraph}.
The complete--$S$ PICOD$(t)$, where $S$ is a subset of $[0:m-t]$ (where $m$ is the number of messages at the transmitter and $t$ the number of messages to be decoded), is a system where all side information sets / users with size indexed by $S$ are present.
We say that $S$ is \emph{consecutive} if $S=[s_{\rm min}: s_{\rm max}]$ for some $0\leq s_{\rm min}\leq s_{\rm max}\leq m-t$, which is also known as the oblivious PICOD$(t)$ in~\cite{BrahmaFragouli-IT1115-7254174}.
In~\cite{BrahmaFragouli-IT1115-7254174} the authors derived tight converse bounds for the oblivious PICOD$(t)$ when the coding scheme is restricted to be a linear code.
In this work, we aim to provide tight information theoretic converse bounds, i.e., without any restriction on the coding scheme being used, on the same model. Our complete--$S$ PICOD$(t)$ setting actually includes and expands on the oblivious PICOD$(t)$ setting studied in~\cite{BrahmaFragouli-IT1115-7254174}, and our results show the unrestricted optimality of linear codes.
Our converse is based on showing the existence of at least one \emph{special user} who can decode a certain number of messages outside its side information set; the stumbling block in previous approaches was how to find such a special user.
The problem of finding the special user can be approached in two ways:
1) constructively finding such a special user for each choices of desired messages, or
2) implicitly proving its existence.
In this work we use both methods.
\paragraph*{Constructive Method}
For the \emph{complement-consecutive} complete--$S$ PICOD$(t)$, which is the complete--$S$ PICOD$(t)$ with $S=[0:m-t]\setminus [s_{\rm min}}%{s_{1}:s_{\rm max}}%{s_{2}]$ where $0 < s_{\rm min}}%{s_{1} \leq s_{\rm max}}%{s_{2} < m-t$, we constructively find the special user that can decode $|S|+t-1$ messages, i.e., the one whose side information set is empty.
\paragraph*{Combinatorial Method}
The constructive method is not amenable for the consecutive complete--$S$ PICOD$(t)$, which is the complete--$S$ PICOD$(t)$ with $S=[s_{\rm min} : s_{\rm max}]$ where $0 \leq s_{\rm min}\leq s_{\rm max} \leq m-t$, due to the large number of sub-cases / different desired message set assignments that must be considered separately.
Therefore for this case we propose a novel combinatorial proof to show the existence of a special user.
By not only focusing on the desired messages, but on all the messages that a user is eventually able to decode, we consider the messages that a user can eventually know as a \emph{block cover} for this user's side information set;
the terminology is borrowed fom the combinatorial design structure known as Steiner system~\cite{generalized_steiner_system}.
We argue that the absence of a special user leads to a contradiction in this block cover, and that therefore a special user must exist.
This new technique greatly reduces the complexity of the proof compared to the constructive method and enables us to obtain a converse bound for a very general class of complete--$S$ PICOD$(t)$ problems. The keystone of the proof is to show that, for the \emph{critical} complete--$S$ PICOD$(t)$ case with $S=\{s\}$ and $m = 2s+t$, there must exist at least one user who can decode $s+t$ messages.
From this, the extension to the consecutive complete--$S$ PICOD$(t)$ follows by enhancing the system to a critical one.
By similar reasoning, all complete--$S$ PICOD$(t)$ where the number of messages is $m\leq 5$ can be solved.
The idea of showing the existence of a special user can also be used for the following PICOD$(t)$ problem--for a detailed definition please refers to Section~\ref{sub:graph_prelimiary}.
For the case $t=1$ we show a tight converse for those PICOD$(1)$ with circular-arc network topology hypergraph. For this setting, when a $1$-factor does not exist we show that the code length is at least two by finding a user that can decode two messages.
\subsection{Paper Organization}
The rest of the paper is organized as follows:
Section~\ref{sec:system_model} introduces the system model and related definitions;
Section~\ref{sec:main_results} presents the main results of this paper;
Sections~\ref{sec:layer_counting_converse}-\ref{sec:complete_nonconsecutive} present converse proofs for some complete--$S$ PICOD$(t)$ problems and their optimality;
Section~\ref{sec:picod_with_special_network_topology_hypergraph} shows the optimal information theoretic converse for the PICOD$(1)$ with circular-arc network topology hypergraph;
Section~\ref{sec:conclusion} concludes the paper and discusses future work;
some proofs can be found in Appendix.
\subsection{Notation}
\label{sub:notation}
Throughout the paper we use
capital letters to denote sets,
calligraphic letters for family of sets, and
lower case letters for elements in a set.
The cardinality of the set $A$ is denoted by $|A|$.
For integers $a_1, a_2$
we let $[a_1:a_2] := \{a_1,a_1+1,\ldots,a_2\}$ for $a_1\leq a_2$
and $[a_2]:=[1:a_2]$ for $a_2\geq 1$.
A capital letter as a subscript denotes set of elements whose indices are in the set, i.e., $W_A:=\{w_a : w\in W, a\in A\}$.
For two sets $A$ and $B$, $A\setminus B$ is the set that consists all the elements that are in $A$ but not in $B$.
Notations and nomenclature from graph theory will be introduced in Section~\ref{sec:picod_with_special_network_topology_hypergraph}.
\section{System Model}
\label{sec:system_model}
In a PICOD$(t)$ system there is one server / transmitter and $n\in\mathbb{N}$ clients / users;
the user set is denoted as $U := \left\{ u_{1},u_{2},\ldots,u_{n}\right\}$.
The server is connected to all users via a rate-limited noiseless broadcast channel.
There are $m\in\mathbb{N}$ independent and uniformly distributed binary messages of $\kappa}%{\tau \in \mathbb{N}$ bits each;
the message set is denoted as $W := \left\{ w_{1},w_{2},\ldots,w_{m} \right\}$.
User $u_i$ has a subset of the message set as its side information set $A_i\subset [m]$, $i\in[n]$.
The collection of all side information sets is denoted as $\mathcal{A} := \{A_{1},A_{2},\ldots,A_{n}\}$;
$\mathcal{A}$ is assumed globally known at the transmitter and all users.
The server broadcasts to the users a codeword of length $\ell \kappa}%{\tau$ bits, which is a function of the message set $W$ and the collection of all side information sets $\mathcal{A}$, i.e., for some function $\mathsf{ENC}$ we have
\begin{align}
x^{\ell \kappa}%{\tau} = \mathsf{ENC}(W,\mathcal{A}).
\end{align}
Each user decodes based on the received $x^{\ell \kappa}%{\tau}$ and its own side information set;
for user $u_j, j\in[n]$, the decoding function is
\begin{align}
\{\widehat{w}^{(j)}_{1},\dots,\widehat{w}^{(j)}_{t}\} = \mathsf{DEC}_j(W_{A_j},x^{\ell \kappa}%{\tau}).
\end{align}
A code is said to be \emph{valid} if and only if every user can successfully decode at least $t$ messages not in its side information set, i.e., the decoding functions $\{ \mathsf{DEC}_j, \forall j\in[n]\}$ are such that
\begin{align}
\Pr\left[ \exists \{d_{j,1},\dots,d_{j,t}\}\cap A_j=\emptyset : \{\widehat{w}^{(j)}_{1},\dots,\widehat{w}^{(j)}_{t}\}\neq \{{w}_{d_{j,1}},\dots,{w}_{d_{j,t}}\} \ \text{for some $j\in[n]$} \right] \leq \epsilon,
\end{align}
for some $\epsilon\in(0,1)$.
For a valid code,
$\{\widehat{w}^{(j)}_{1},\dots,\widehat{w}^{(j)}_{t}\} = \{{w}_{d_{j,1}},\dots,{w}_{d_{j,t}}\}$ is called the \emph{desired message set} for user $u_j, \ j\in[n],$ and the indices of the desired messages are denoted as $D_j:=\{d_{j,1},\dots,d_{j,t}\}$ where $D_j\cap A_j=\emptyset, \forall j\in [n]$.
The choice of desired messages for the users is denoted as $\mathcal{D}=\{D_1,D_2,\ldots\,D_n\}$.
The goal is to find a valid code with minimum length
\begin{align}
\ell^*:= \min\{\ell : \text{$\exists$ a valid code of length $\ell \kappa}%{\tau$, for some $\kappa}%{\tau$}\}.
\end{align}
In the following we shall mainly focus on the \emph{complete--$S$ PICOD$(t)$}, for a given set $S\subseteq[0:m-t]$.
In this system, there are $n := \sum_{s\in S}\binom{m}{s}$ users, where no two users have the same side information set.
In other words, all possible users with distinct side information sets that are subsets of size $s$ of the message set, for all $s\in S$, are present in the complete--$S$ PICOD$(t)$.
\section{Main Results and Discussion}
\label{sec:main_results}
This section summarizes our main results and comments on their proof techniques, their relationship with past work, and their implications.
We start with a simple achievable scheme based on linear codes, in Section~\ref{subsec:ach}.
The main contribution of the paper is converse bounds on the optimal code length for the two broad families of PICOD$(t)$:
(i) some complete-$S$ PICOD$(t)$, where $S$ is nonempty subset of $[0:m-t]$, in Section~\ref{subsec:converse-complete}, and
(ii) the PICOD$(1)$ with circular-arc network topology hypergraph\ in Section~\ref{subsec:converse-hyper}.
\subsection{Achievability}
\label{subsec:ach}
We give next an achievable scheme for the general complete--$S$ PICOD$(t)$ based on linear codes.
\begin{prop}[Achievable Scheme]
\label{prop:achievability_complete-s}
Let $\mathcal{S}$ by a partition of $S$, i.e., $S=\cup_{i\in [|\mathcal{S}|]}S_i$ and
$S_i\cap S_j =\emptyset$ for all $i,j\in [|\mathcal{S}|]$ such that $i\neq j$.
The optimal code length for the complete--$S$ PICOD$(t)$ with $m$ messages is upper bounded by
\begin{align}
\ell^*\leq \sum_{i\in [|\mathcal{S}|]}\min\left\{m-\min_{s\in S_i}\{s\}, \max_{s\in S_i}\{s\}+t\right\}.
\label{eq:prop:achievability_complete-s qaz}
\end{align}
By minimizing over all possible partitions $\mathcal{S}$,
we have
\begin{align}
\ell^*\leq \min_{\mathcal{S}} \sum_{i\in [|\mathcal{S}|]}\min\left\{m-\min_{s\in S_i}\{s\}, \max_{s\in S_i}\{s\}+t\right\}.
\label{eq:prop:achievability_complete-s}
\end{align}
\end{prop}
The proof is simple and can be deduced from Remark~\ref{rem:achievability}.
\begin{rem}
\label{rem:achievability}
Proposition~\ref{prop:achievability_complete-s} is a generalization of the
scheme proposed in~\cite{BrahmaFragouli-IT1115-7254174} whose main idea is as follows.
Let $s_{\rm min}$ and $s_{\rm max}$ denote the smallest and largest
size of the side information sets, respectively.
%
Transmitting $s_{\rm max}+t$ messages one by one can satisfy all users since each user has at most $s_{\rm max}$ messages in its side information set.
%
Transmitting $m-s_{\rm min}$ linearly independent linear combinations of the $m$ messages also satisfies all users, as each user has at least $s_{\rm min}$ messages in its side information set.
%
Therefore by choosing the best of these two linear codes,
we have $\ell^*\leq \min\{s_{\rm max}+t, m-s_{\rm min}\}$.
We generalize this idea for the complete--$S$ PICOD$(t)$ by partitioning $S$ into the collection $\mathcal{S}$ and by satisfying the users in each $S_i\in\mathcal{S}$ by using the above scheme.
The total code length is the sum of the length of the code used in each partition.
Finally, the shortest code length this scheme can achieve is given by searching the best possible partition of $S$.
\end{rem}
\subsection{Converse for some complete--$S$ PICOD$(t)$ problems}
\label{subsec:converse-complete}
We show that for two choices of $S$ the achievability in Proposition~\ref{prop:achievability_complete-s} is information theoretic optimal.
\begin{thm}[Converse for the \emph{complement-consecutive} complete--$S$ PICOD$(t)$]
\label{thm:layer_cont_opt}
For the complete--$S$ PICOD$(t)$ with $m$ messages and $S=[0:m-t]\backslash [s_{\rm min}:s_{\rm max}] = [0:s_{\rm min}}%{s_{1}-1]\cup[s_{\rm max}}%{s_{2}+1:m-t]$ for some $0 < s_{\rm min}}%{s_{1}\leq s_{\rm max}}%{s_{2} < m-t$ (note that the set $S$ includes elements $0$ and $m-t$), the optimal code length is
\begin{align}
\ell^*=\min\{m,m+t+s_{\rm min}}%{s_{1}-s_{\rm max}}%{s_{2}-2\}=\min\{m,|S|+2t-2\}.
\label{eq:thm:layer_cont_opt}
\end{align}
\end{thm}
The proof of Theorem~\ref{thm:layer_cont_opt} can be found in Section~\ref{sec:layer_counting_converse}.
\begin{thm}[Converse for the \emph{consecutive} complete--$S$ PICOD$(t)$]
\label{thm:complete_consecutive}
For the complete--$S$ PICOD$(t)$ with $m$ messages and $S=[s_{\rm min}:s_{\rm max}]$ for some $0\leq s_{\rm min} \leq s_{\rm max} \leq m-t$ (i.e., $S$ contains consecutive integers, from $s_{\rm min}$ to $s_{\rm max}$) the optimal code length is
\begin{align}
\ell^*=\min\{s_{\rm max}+t, m-s_{\rm min}\}.
\label{eq:thm:complete_consecutive}
\end{align}
\end{thm}
The proof of Theorem~\ref{thm:complete_consecutive} is broken down in several pieces. The proof for the \emph{critical case}, where $m=2s+t$ and $S=\{s\}$, can be found in Section~\ref{sec:complete_s_picod_m=2s+1}, while the general proof in Section~\ref{sec:complete_s_consecutive}.
\begin{rem}
\label{rem:converse}
Theorems~\ref{thm:layer_cont_opt} and~\ref{thm:complete_consecutive} show that the simple achievable scheme in Proposition~\ref{prop:achievability_complete-s} can be information theoretical optimal for a class of PICOD$(t)$. Specifically, the consecutive complete--$S$ PICOD$(t)$ is the oblivious PICOD$(t)$ studied in~\cite{BrahmaFragouli-IT1115-7254174}. Our Theorem~\ref{thm:complete_consecutive} provides a tight information theoretic converse for the achievability proposed in~\cite{BrahmaFragouli-IT1115-7254174}.
The basic idea in the proof of Theorem~\ref{thm:layer_cont_opt} is
to prove the existence of a user who can decode $|S|$ messages by
a method referred to as \emph{layer counting}.
We partition all users in the complete--$S$ PICOD$(t)$ into $|S|$ layers.
Each layer contains the users with the same size of the side information set.
A layer is said to be ``lower'' than another if the size of the side information set of the users is smaller.
The intuition is that a user in a lower layer, after having decoded its desired messages,
can mimic users in higher layers and thus decode also the desired messages of those higher layer users.
In the complement-consecutive complete--$S$ PICOD$(t)$, where $S=[0:s_{\rm min}}%{s_{1}-1]\cup[s_{\rm max}}%{s_{2}+1:m-t]$ for some $0< s_{\rm min}}%{s_{1}\leq s_{\rm max}}%{s_{2} < m-t$, we show the user in the lowest layer (with empty side information set) can mimic a user in each higher layers and eventually decodes $|S|+2t-2$ messages.
However, this layer counting converse is not tight in general, as explained in Remark~\ref{rem:layer counting not tight}
for the complete--$S$ PICOD$(1)$ with $S=[1:q]$ or $S=[q:m-2]$ for some $2\leq q \leq m-2$.
To improve on the layer counting converse, we propose a novel converse technique in Theorem~\ref{thm:complete_consecutive} for the \emph{consecutive} complete--$S$ PICOD$(t)$, where $S=[s_{\rm min}: s_{\rm max}]$ for some $0\leq s_{\rm min} \leq s_{\rm max} \leq m-t$.
The \emph{critical case} for this proof is the complete--$S$ PICOD$(t)$ for
\begin{align}
\text{$m=2s+t$ messages and $S=\{s\}$ \ \ (critical case)}.
\label{eq:critical}
\end{align}
In Section~\ref{sec:complete_s_picod_m=2s+1} Proposition~\ref{prop:power_user_exist}, we show that for this critical case, regardless of the choice of desired messages and valid code, there always exists at least one user who can decode $s+t$ messages.
While the proof of Theorem~\ref{thm:layer_cont_opt} is constructive, that is, we explicitly identify the user who can always decode $|S|+2t-2$ messages (the one with empty side information set), the proof of Proposition~\ref{prop:power_user_exist} is not.
The problem with a constructive argument for the critical case is that,
for any specific user, there exists an information theoretic optimal choice of desired messages and a corresponding valid code such that this user can decode only its desired $t$ messages and no more.
In other words, showing that a certain user can always decode more than $t$ messages is impossible.
Therefore, in the proof of Proposition~\ref{prop:power_user_exist}, we propose a combinatorial method to show the existence of at a least a user with some desired property, namely, the ability to decode a certain number of messages.
The new method involves the Maximum Acyclic Induced Subgraph (MAIS) converse idea for the classic IC~\cite{index_coding_with_sideinfo}, as well as a combinatorial design technique inspired by Steiner systems~\cite{generalized_steiner_system}, which we shall refer to as \emph{block cover}.
The existence proof does not indicate which user has the desired property, but only shows its existence regardless of the choice of desired messages at the users.
\end{rem}
Theorem~\ref{thm:complete_consecutive} can be further extended to cover other complete--$S$ PICOD$(t)$.
We have the following results.
\begin{prop}[Not a complete--$S$ system, but all users are below the critical case users in the layer representation]
\label{prop:max<m/2_nonconsecutive}
For the complete--$S$ PICOD$(t)$ with $m$ messages and $s_{\rm max} :=\max_{s\in S}\{s\} \leq \floor{\frac{m-t}{2}}$, the optimal code length is $\ell^*=s_{\rm max}+t$.
\end{prop}
The proof can be found in Section~\ref{sec:complete_nonconsecutive}.
\begin{prop}[Not a complete--$S$ system, but all users are above the critical case users in the layer representation]
\label{prop:min>m/2_nonconsecutive}
For the complete--$S$ PICOD$(t)$ with $m$ messages and $s_{\rm min} :=\min_{s\in S}\{s\}\geq \ceil{\frac{m-t}{2}}$, the optimal code length is $\ell^*=m-s_{\rm min}$.
\end{prop}
The proofs can be found in Section~\ref{sec:complete_nonconsecutive}.
\begin{prop}[Not a complete--$S$ system, but all users in a band around the critical case users are present in the layer representation]
\label{prop:min<m/2<max_nonconsecutive}
For the complete--$S$ PICOD$(t)$ with $m$ messages, let
\begin{align}
\delta :=\min\left\{s_{\rm max}-\ceil{\frac{m-t}{2}}, \floor{\frac{m-t}{2}}-s_{\rm min}\right\},
\label{eq:def delta band}
\end{align}
where $s_{\rm max}:=\max_{s\in S}\{s\}$ and $s_{\rm min}:=\min_{s\in S}\{s\}$.
If $\left[\floor{\frac{m-t}{2}}-\delta:\ceil{\frac{m-t}{2}}+\delta\right]\subseteq S$ then the optimal code length is $\ell^*=\min\{s_{\rm max}+t,m-s_{\rm min}\}$.
\end{prop}
The proof can be found in Section~\ref{sec:complete_nonconsecutive}.
\begin{rem}
Propositions~\ref{prop:max<m/2_nonconsecutive},~\ref{prop:min>m/2_nonconsecutive} and~\ref{prop:min<m/2<max_nonconsecutive} show an interesting fact: for these settings the only relevant layers in the layer representation are the ones closest to the ``critical'' middle layer $\frac{m-t}{2}$, or the layers in a band $\left[\floor{\frac{m-t}{2}}-\delta:\ceil{\frac{m-t}{2}}+\delta\right]$ around the ``critical'' middle layer. The optimal code for the users in these layers satisfies all the remaining users.
\end{rem}
Finally, for those PICOD$(t)$ problems with $m\leq 5$ messages that are not covered by Propositions~\ref{prop:max<m/2_nonconsecutive},~\ref{prop:min>m/2_nonconsecutive},~\ref{prop:min<m/2<max_nonconsecutive} and Theorem~\ref{thm:layer_cont_opt}, we have the following:
\begin{prop}
\label{prop:achi_opt_m<=5}
For all complete--$S$ PICOD$(t)$ with $m\leq 5$ and non-empty $S\subseteq[0:m-1]$,
the achievable scheme in Proposition~\ref{prop:achievability_complete-s} is information theoretic optimal.
\end{prop}
The proof can be found in Section~\ref{sec:complete_nonconsecutive}.
\begin{rem}
Proposition~\ref{prop:achi_opt_m<=5} is proved by checking one by one all complete--$S$ PICOD$(t)$ problems with $m\leq 5$ messages not covered by previous results. It may be possible to go beyond five messages, but unfortunately we have not been able to find a systematic way to prove the converse for general $m$.
\end{rem}
\subsection{Converse for the PICOD$(1)$ with circular-arc network topology hypergraph}
\label{subsec:converse-hyper}
The reader can find a refresher on graph theory terminology in Section~\ref{sub:graph_prelimiary}.
The critical complete--$\{s\}$ PICOD$(t)$
we solved
has a network topology hypergraph\ which is the dual hypergraph of the complete $(m-s)$--uniform hypergraph.
Here we solve the PICOD$(1)$ whose network topology hypergraph\ is a special hypergraph, namely, a circular-arc hypergraph.
\begin{thm}
\label{thm:circular-arc_optimality}
For a PICOD$(1)$ with $m$ messages and with circular-arc network topology hypergraph, the optimal code length satisfies $\ell^*\leq 2$.
In particular, the optimal number of transmissions is $\ell^* =2$ unless the network topology hypergraph\ is a $1$-factor hypergraph.
\end{thm}
The proof can be found in Section~\ref{sec:picod_with_special_network_topology_hypergraph}.
\begin{rem}
The achievability part of Theorem~\ref{thm:circular-arc_optimality} is based on the following property of a circular-arc hypergraph: if two vertices belong to an edge, then all vertices (cyclic) between these two vertices must belong to the same edge.
The converse part of Theorem~\ref{thm:circular-arc_optimality}, which is in Proposition~\ref{prop:l=1_condition}, is proved by showing that there exists a user that can decode one more message other than its desired message if a $1$-factor does not exist.
By showing the existence of such a user, regardless of the choices of desired messages and code sent by the transmitter, we obtain a tight lower bound on the optimal code length.
\end{rem}
The proofs of the converse results summarized in this section will be given in the following sections.
\section{Layer Counting Converse: Proof of Theorem~\ref{thm:layer_cont_opt}}
\label{sec:layer_counting_converse}
Recall that the complete--$S$ PICOD$(t)$, for a given set $S\subseteq[0:m-t]$, comprises $n=\sum_{s\in S}\binom{m}{s}$ users where the side information sets are all possible distinct subsets of size $s$ of $m$ messages, for all $s\in S$.
The proof of Theorem~\ref{thm:layer_cont_opt} relies on idea of \emph{decoding chain}, which gives a high level explanation of the proof of the following lemma (see discussion after the proof), namely, the number of messages decoded along this chain provides a converse on $\ell^*$.
\begin{lemma}
\label{lem:converse_on_decodable_msg}
In a PICOD$(t)$ with $m$ messages and $n$ users, for any ordering of the users (i.e., up to relabeling the users) we have
\begin{align}
\ell^*\geq \sum_{i=1}^{n}\left| D_i\setminus \cup_{j=1}^{i-1}(A_j\cup D_j)\right|.
\label{eq:converse_on_decodable_msg}
\end{align}
\end{lemma}
\begin{IEEEproof}[Proof of Lemma~\ref{lem:converse_on_decodable_msg}]
Since we have a working system, all users are satisfied by the transmission of $x^{\ell \kappa}%{\tau}$ of length $\ell$.
For user $u_1$ we have
\begin{align}
H\left(W_{D_1}|x^{\ell \kappa}%{\tau}, W_{A_{1}}\right) \leq \ell \epsilon_\ell,
\end{align}
where
$\lim_{\ell\to\infty}\epsilon_\ell =0$ by Fano's inequality.
Similarly, for user $u_2$ we have
\begin{align}
H\left(W_{D_2}|x^{\ell \kappa}%{\tau}, W_{A_{2}}\right) \leq \ell \epsilon_\ell.
\end{align}
Therefore we have
\begin{align*}
& H\left(W_{D_1}, W_{D_2}|x^{\ell \kappa}%{\tau}, W_{A_{1}}, W_{A_2\setminus D_1}\right)
\\&= H\left(W_{D_1}|x^{\ell \kappa}%{\tau}, W_{A_{1}}, W_{A_2\setminus D_1}\right)
+ H\left(W_{D_2}|x^{\ell \kappa}%{\tau}, W_{A_{1}}, W_{A_2\setminus D_1}, W_{D_1}\right)
\\&= H\left(W_{D_1}|x^{\ell \kappa}%{\tau}, W_{A_{1}}, W_{A_2\setminus D_1}\right)
+ H\left(W_{D_2}|x^{\ell \kappa}%{\tau}, W_{A_{2}}, W_{A_1\cup D_1}\right)
\\&\leq H\left(W_{D_1}|x^{\ell \kappa}%{\tau}, W_{A_{1}}\right)
+ H\left(W_{D_2\setminus (A_1\cup D_1)}|x^{\ell \kappa}%{\tau}, W_{A_{2}}\right)
\\&\leq 2 \ell \epsilon_\ell.
\end{align*}
By continuing with the same reasoning, we get
\begin{align}
H\left(W_{\cup_{i=1}^n D_i}|x^{\ell \kappa}%{\tau}, W_{\cup_{i=1}^n (A_{i}\setminus \cup_{j=1}^{i-1}D_j)}\right)
\leq n \ell \epsilon_\ell.
\end{align}
Since the messages are independent and uniformly distributed with entropy $\kappa}%{\tau$ bits,
and since the code is binary, we conclude
\begin{align*}
& \sum_{i=1}^{n}\left| D_i\setminus \cup_{j=1}^{i-1}(A_j\cup D_j)\right| \kappa}%{\tau
\\&= \left| \cup_{i=1}^n \left(D_i\setminus \cup_{j=1}^{i-1}(A_j\cup D_j)\right)\right|\kappa}%{\tau
\\&= H\left(W_{ \cup_{i=1}^n \left(D_i\setminus \cup_{j=1}^{i-1}(A_j\cup D_j)\right)}\right)
\\&= H\left(W_{ \cup_{i=1}^n \left(D_i\setminus \cup_{j=1}^{i-1}(A_j\cup D_j)\right)}|W_{\cup_{i=1}^n (A_{i}\setminus \cup_{j=1}^{i-1}D_j)}\right)
\\&\leq I\left(W_{ \cup_{i=1}^n \left(D_i\setminus \cup_{j=1}^{i-1}(A_j\cup D_j)\right)}; x^{\ell \kappa}%{\tau} \big| W_{\cup_{i=1}^n (A_{i}\setminus \cup_{j=1}^{i-1}D_j)}\right) + n \ell \epsilon_\ell
\\&\leq H\left(x^{\ell \kappa}%{\tau}|W_{\cup_{i=1}^n (A_{i}\setminus \cup_{j=1}^{i-1}D_j)}\right)+ n \ell \epsilon_\ell
\\&\leq H(x^{\ell \kappa}%{\tau}) + n\ell \epsilon_\ell
\\&\leq \ell \kappa}%{\tau + n\ell \epsilon_\ell,
\end{align*}
which implies that
\begin{align}
\ell \geq \sum_{i=1}^{n}\left| D_i\setminus \cup_{j=1}^{i-1}(A_j\cup D_j)\right|,
\label{eq:lemma1ends}
\end{align}
for constant $(n,\kappa}%{\tau)$, sufficiently large $\ell$, and any valid codes. Therefor the bound in~\eqref{eq:lemma1ends} must hold for the optimal code length as well, thus proving~\eqref{eq:converse_on_decodable_msg}.
\end{IEEEproof}
The sequence of users $u_1,u_2, \dots , u_n$ in Lemma~\ref{lem:converse_on_decodable_msg} is the \emph{decoding chain} mentioned at the beginning of this section.
In fact, the converse in Lemma~\ref{lem:converse_on_decodable_msg} can also be thought of as the \emph{acyclic induced subgraph} converse for the all unicast IC problem~\cite{index_coding_with_sideinfo}, where each user desires multiple messages, as opposed to a single message.
The users with $\left| D_i\setminus \cup_{j=1}^{i-1}(A_j\cup D_j)\right|\neq 0$ form an acyclic induced subgraph in the graph representation of the IC.
Therefore, in Lemma~\ref{lem:converse_on_decodable_msg} the value of $\left| \cup_{i=1}^n \left(D_i\setminus \cup_{j=1}^{i-1}(A_j\cup D_j)\right)\right|$ depends on the choice of the order for the users, that is, we can relabel the users in order to find the tighest bound provided by Lemma~\ref{lem:converse_on_decodable_msg}.
Finding such an order for Lemma~\ref{lem:converse_on_decodable_msg} illustrates the intuition for the converse proof of Theorem~\ref{thm:layer_cont_opt}: finding the user that can decode the largest number of messages.
\begin{figure}
\centering
\includegraphics[width=0.35\columnwidth]{layer_representation_complete_setting-v2DT.eps
\caption{Layer representation of the complete--$[0:m-1]$ PICOD$(1)$ problem.}
\label{fig:complete_setting}
\end{figure}
To illustrate the method of finding the user who can decode the largest number of messages, we introduce the \emph{layer representation} of the complete--$S$ PICOD$(t)$.
As an example, the layer representation for the complete--$[0:m-1]$ PICOD$(1)$ problem is given in Fig.~\ref{fig:complete_setting}.
In Fig.~\ref{fig:complete_setting},
all the users with the same size of the side information set are said to form a layer, and there are in total $m$ layers;
the $i$-th layer contains the users whose side information set has size $i\in[0:m-1]$, and
the number of users in the $i$-th layer is $\binom{m}{i}$.
The key observation is that, in a working system, a user $u_i$ in $i$-th layer can decode a message $w_{d_{i}}$ it does not have in its side information set $A_{i}$.
After that, user $u_i$ is equivalent to a user $u_{i+1}$ in the $(i+1)$-th layer whose side information is $A_{{i+1}} = A_{i} \cup \{d_i\}$.
User $u_i$ will thus be able to decode the message $w_{{d_{i+1}}}$ that is desired by user $u_{d_{i+1}}$, in addition to its own desired message $w_{d_{i}}$.
But now user $u_i$ will have $A_{{i+2}} = A_{i} \cup \{w_{d_{i}}, {w}_{d_{i+1}}\}$, which is the side information of a user $u_{i+2}$ in the $(i+2)$-th layer.
By continuing with the same reasoning, user $u_i$ will be able to mimic one user per layer until the last layer.
We apply this argument to the user in the $0$-th layer (there is only one such user).
We see that the user in the $0$-th layer is able to decode one message per layer without loss of optimality, that is, the user in the $0$-th layer decodes $m$ messages in total.
This provides a decoding chain of length $m$. In this decoding chain each user's side information set and the desired message set form the side information set of the next user.
By having such a decoding chain, we can use Lemma~\ref{lem:converse_on_decodable_msg} to show that $\ell^*\geq m$ for the complete--$[0:m-1]$ PICOD$(1)$ problem in Fig.~\ref{fig:complete_setting}.
We use this observation, and similar ones, in the following to provide a lower bound on $\ell^*$ in terms of number of messages a user can decode, which is the main idea in all our converse proofs.
The proof of Theorem~\ref{thm:layer_cont_opt} directly follows this idea of counting the layers in a layer representation of a decoding chain. The key for the proof is the fact that each layer in the layer representation for the complement-consecutive complete--$S$, where $S=[0:m-t]\setminus[s_{\rm min}}%{s_{1}: s_{\rm max}}%{s_{2}]$, contains all users with side information set of the same size. After the user has decoded its desired message(s), we can map this user to another user in a higher layer. Such a mapping forms a decoding chain, starting from the user in the $0$-th layer, provides a lower bound on $\ell^*$.
We are now ready to prove Theorem~\ref{thm:layer_cont_opt} for the complement complete--$S$ with $m$ messages and $S=[0:m-t]\setminus[s_{\rm min}}%{s_{1} : s_{\rm max}}%{s_{2}]$.
\begin{IEEEproof}[Proof of Theorem~\ref{thm:layer_cont_opt}]
Consider the PICOD$(t)$ where $S=[0:m-t]\backslash [s_{\rm min}:s_{\rm max}] = [0:s_{\rm min}}%{s_{1}-1]\cup[s_{\rm max}}%{s_{2}+1:m-t]$ for some $0< s_{\rm min}}%{s_{1}\leq s_{\rm max}}%{s_{2} < m-t$.
We aim to find the decoding chain that has the largest number of messages/users along the chain. In each layer of the layer representation we find a user for the decoding chain. Therefore the chain contains $|S|$ users, where
\begin{align}
|S| = s_{\rm min}}%{s_{1} + m-t-s_{\rm max}}%{s_{2}.
\end{align}
We first find $s_{\rm min}}%{s_{1}$ users, one user per layer for the layers indexed by $[0:s_{\rm min}}%{s_{1}-1]$, as done in the example in Fig.~\ref{fig:complete_setting}.
Then, the user $u_j|_{j=s_{\rm min}}%{s_{1}+1}$ is found in layer $s_{\rm max}}%{s_{2}+1$ such that $|A_j|_{j=s_{\rm min}}%{s_{1}+1}|=s_{\rm max}}%{s_{2}+1$;
we want $A_{s_{\rm min}}%{s_{1}+1}\supseteq A_{s_{\rm min}}%{s_{1}}$ so user $u_{s_{\rm min}}%{s_{1}+1}$ can be mimicked by user $u_{s_{\rm min}}%{s_{1}}$;
we want $|D_{s_{\rm min}}%{s_{1}}\cap A_{s_{\rm min}}%{s_{1}+1}|$ to be as large as possible so the number of messages decoded in the decoding chain can be maximized;
details on how this is done will be given next.
Finally, we find other $|S|-s_{\rm min}}%{s_{1}-1 = m-t-s_{\rm max}}%{s_{2}-1$ users to complete the decoding chain, one user per layer for the layers indexed by $[s_{\rm max}}%{s_{2}+2:m-t]$, as done in the example in Fig.~\ref{fig:complete_setting}.
Assume all users are satisfied by the transmission of $x^{\ell \kappa}%{\tau}$.
Let $u_1$ be the user with empty side information set, i.e., $A_1=\emptyset$.
Since all users are satisfied, $u_1$ can decode at least one message not in its side information set;
denote the index of such a message as $d_{1,1}$.
Layer~$1$ contains the users with side information set of size $1$.
There exists a user in layer~$1$, say $u_2$, with side information $A_2=A_1\cup\{d_{1,1}\} = \{d_{1,1}\}$ and desired message $d_{2,1}\notin A_2$.
By continuing with this reasoning we can find users up to user $u_{s_{\rm min}}%{s_{1}}$: user $u_{s_{\rm min}}%{s_{1}}$ has side information set $A_{s_{\rm min}}%{s_{1}} = A_{s_{\rm min}}%{s_{1}-1} \cup \{d_{s_{\rm min}}%{s_{1}-1,1}\}= \{d_{1,1}, \ldots, d_{s_{\rm min}}%{s_{1}-1,1}\}$ and desires message $d_{s_{\rm min}}%{s_{1},1}\not\in A_{s_{\rm min}}%{s_{1}}$.
We would be tempted to say that the next user in the decoding chain should be user $u_{s_{\rm min}}%{s_{1}+1}$ with side information set $A_{s_{\rm min}}%{s_{1}} \cup D_{s_{\rm min}}%{s_{1}}$; however $|A_{s_{\rm min}}%{s_{1}} \cup D_{s_{\rm min}}%{s_{1}}| = |A_{s_{\rm min}}%{s_{1}}|+|D_{s_{\rm min}}%{s_{1}}| = s_{\rm min}}%{s_{1}-1+t$ may be strictly less than the size of the side information of the next layer of users present in the systems, which is $s_{\rm max}}%{s_{2}+1$.
For this reason, user $u_{s_{\rm min}}%{s_{1}+1}$ is chosen in layer $s_{\rm max}}%{s_{2}+1$ as follows:
if $s_{\rm min}}%{s_{1}-1+t < s_{\rm max}}%{s_{2}+1$, choose any user in layer $s_{\rm max}}%{s_{2}+1$ as $u_{s_{\rm min}}%{s_{1}+1}$ such that $A_{s_{\rm min}}%{s_{1}+1} \supset A_{s_{\rm min}}%{s_{1}} \cup D_{s_{\rm min}}%{s_{1}}$, i.e., the user that $u_{s_{\rm min}}%{s_{1}}$ can mimic by providing a genie side information $A_{s_{\rm min}}%{s_{1}+1} \setminus (A_{s_{\rm min}}%{s_{1}} \cup D_{s_{\rm min}}%{s_{1}})$;
otherwise we choose $u_{s_{\rm min}}%{s_{1}+1}$ to be the user with $A_{s_{\rm min}}%{s_{1}+1} \subseteq A_{s_{\rm min}}%{s_{1}} \cup D_{s_{\rm min}}%{s_{1}}$, i.e., the user that $u_{s_{\rm min}}%{s_{1}}$ can mimic.
From this point onwards, the next users in the decoding chain can again be chosen such that $A_j=A_{j-1}\cup \{d_{j-1,1}\}, \ j\in[s_{\rm min}}%{s_{1}+2:|S|]$.
Note that in the decoding chain we have $A_j=A_{j-1}\cup \{d_{j-1,1}\}$ for $j\in[|S|]\setminus\{1,s_{\rm min}}%{s_{1}+1\}$,
$A_1=\emptyset$, and $A_{s_{\rm min}}%{s_{1}+1}\supset A_{s_{\rm min}}%{s_{1}}$.
These users satisfy $A_j\supset A_{j-1}$, for all $j\in[2:|S|]$.
Therefore we have $\left| D_i\setminus \cup_{j=1}^{i-1}(A_j\cup D_j)\right|\geq 1$ for all $i\in [|S|]\setminus \{1, s_{\rm min}}%{s_{1}+1\}$,
$\left| D_i \right|_{i=1}=t$, and
$\left| D_i\setminus \cup_{j=1}^{i-1}(A_j\cup D_j)\right|_{i=s_{\rm min}}%{s_{1}+1}=\min\{t, s_{\rm max}}%{s_{2}+1+t-(s_{\rm min}}%{s_{1}-1+t)\}=\min\{t, s_{\rm max}}%{s_{2}-s_{\rm min}}%{s_{1}+2\}$.
Therefore, by Lemma~\ref{lem:converse_on_decodable_msg} we have
\begin{align*}
\ell^*
&\geq \sum_{i\in[|S|]}\left| D_i\setminus \cup_{j=1}^{i-1}(A_j\cup D_j)\right|
\\&\geq t+(s_{\rm min}}%{s_{1}-1)+\min\{t,s_{\rm max}}%{s_{2}-s_{\rm min}}%{s_{1}+2\}+(m-t-s_{\rm max}}%{s_{2}-1)
\\&\geq m+s_{\rm min}}%{s_{1}-s_{\rm max}}%{s_{2}-2 + \min\{t,s_{\rm max}}%{s_{2}-s_{\rm min}}%{s_{1}+2\}
\\&=\min\{m+t+s_{\rm min}}%{s_{1}-s_{\rm max}}%{s_{2}-2, m\}.
\end{align*}
The value $\ell^* = \min\{m+t+s_{\rm min}}%{s_{1}-s_{\rm max}}%{s_{2}-2, m\}$ can be achieved as follows.
By the scheme in Proposition~\ref{prop:achievability_complete-s} with partition $S = S_1 \cup S_2$, with $S_1:=[0:s_{\rm min}}%{s_{1}-1]$ and $S_2:=[s_{\rm max}}%{s_{2}+1:m-t]$, all users in group $S_1$ are satisfied with $(s_{\rm min}}%{s_{1}-1)+t$ transmissions, and all users in group $S_2$ are satisfied with $m-(s_{\rm max}}%{s_{2}+1)$ transmissions; therefore, we have a code of length $m+s_{\rm min}}%{s_{1}+t-s_{\rm max}}%{s_{2}-2$.
Also, we can always transmit all $m$ messages one by one, resulting in a code of length $m$.
Therefore, we can achieve the lower bound by using the code among the above two with the shortest length.
This concludes the proof of Theorem~\ref{thm:layer_cont_opt}.
\end{IEEEproof}
\begin{rem}
\label{rem:layer counting not tight}
The proof of Theorem~\ref{thm:layer_cont_opt} constructively builds a decoding chain.
The decoding chain starts from the user in the lowest layer.
The next user in the chain is chosen in the next layer, based on the side information and desired message of the previous one.
The chain ends at the highest layer.
However, this construction, where each layer contributes at most one user to the decoding chain, is not always tight.
As shown in~\cite{itw_2017}, for the complete--$S$ PICOD$(1)$ where $S=[1:q]$ or $S=[q:m-2]$, $1\leq q\leq m-2$, the optimal code length is $\ell^*=|S|+1$. In other words, there exists a decoding chain which includes two users with the same size of side information, where one of the users can mimic the other one.
The proof in~\cite{itw_2017} is a case-by-case reasoning, where the different cases are for different choices of desired messages of the users. For the complete--$S$ PICOD$(1)$ for general $S=[s_{\rm min}}%{s_{1}: s_{\rm max}}%{s_{2}]$, the number of cases becomes too large to be tractable. Thus a method that does not relay on a case-by-case study becomes necessary. This is what we are going to do in the next section.
The two cases considered in~\cite{itw_2017} are special cases of Theorem~\ref{thm:complete_consecutive} proved next.
\end{rem}
\section{Critical Case: complete--$\{s\}$ PICOD$(t)$ with $m=2s+t$ messages}
\label{sec:complete_s_picod_m=2s+1}
To overcome the limitation of the case-by-case reasoning highlighted in Remark~\ref{rem:layer counting not tight},
we shall turn to an \emph{existence proof} technique for Theorem~\ref{thm:complete_consecutive}.
Loosely speaking, when dealing with general consecutive complete--$S$ PICOD$(t)$ with $S=[s_{\rm min}}%{s_{1} : s_{\rm max}}%{s_{2}]$, we treat all users and all the various desired message assignments at once.
Before we prove Theorem~\ref{thm:complete_consecutive} in full generality, we consider the critical case in~\eqref{eq:critical}.
We shall see that all other consecutive complete--$S$ cases can be deduced from the critical one.
Therefore, this section contains the proof for the following key result:
\begin{prop}
\label{prop:power_user_exist}(The critical case)
For the complete--$\{s\}$ PICOD$(t)$ with $m=2s+t$ messages, the optimal code length is $\ell^*= s+t$. Specifically, given a valid code, there always exists a user that can decode $\ell^*=s+t$ messages.
\end{prop}
As for the layer counting converse used in Theorem~\ref{thm:layer_cont_opt}, we shall show that under the assumption that all users can decode at least one message outside their side information set, there must exists a user that can mimic other users and decodes $\ell^*= s+t$ messages regardless of the desired messages of all the users.
Note that in the complete--$S$ PICOD$(t)$ where $|S|=1$, only one layer exists in the layer representation.
Thus by the constructive method in Theorem~\ref{thm:layer_cont_opt}, we only obtain the trivial bound $\ell^*\geq 1$.
However, we do need to find the specific user that can decode $\ell^*= s+t$ messages, but only show its existence.
So we turn to an existence proof, which is largely based on combinatorics ideas.
Specifically, for all possible desired message set assignments for the users, given a valid code that satisfies all users, we show that there exists a user that can decode $\ell^*= s+t$ messages.
We start by introducing next the two main ingredients needed in the proof of Proposition~\ref{prop:power_user_exist}.
\subsection{Proposition~\ref{prop:power_user_exist}: Converse Main Ingredient~1: Block Cover}
\label{ssub:block_cover_for_the_users}
So far we used the idea of decoding chain to show that a user can decode more than its set of desired messages.
The decoding chain depends on the choice of desired messages at the users.
Once the desired messages change, the decoding chain may change as well.
Here we are only interested in the existence of such a decoding chain of a given length.
In other words, we show the existence of a decoding chain of a certain length regardless of the choice of desired messages at the users. We start with a simple example to showcase a problem we faced when
considering different message assignments.
\begin{example}\label{ex:s=1,m=3}
Consider the complete--$\{1\}$ PICOD$(1)$, i.e., $s=t=1$,
with $m=2s+1=3$ messages for which $\ell^\star=s+1=2$ is the smallest number of transmissions needed to satisfy all the $n=\binom{m}{s}=3$ users.
Say that
$u_1$ knows $A_1=\{1\}$ and desires $d_1=2$;
$u_2$ knows $A_2=\{2\}$ and desires $d_2=1$; and
$u_3$ knows $A_3=\{3\}$ and desires $d_3=1$.
By sending $w_1$, users $u_2$ and $u_3$ are satisfied;
by sending $w_2$, user $u_1$ is satisfied.
By the decoding chain argument, user $u_3$ is able to mimic $u_1$ (because he decodes the message that is the side information set of user $u_1$)
and therefore can also decode $w_2$; on the contrary,
users $u_2$ and $u_3$ can not decode any more messages other than the desired one.
However, another choice of desired messages can be $d_1=3, d_2=1, d_3=1$; with this, users $u_1$ and user $u_3$ can only decode their desired messages while user $u_2$ can mimic user $u_1$ thus is able to decode two messages.
\end{example}
As Example~\ref{ex:s=1,m=3} shows for the case $t=1$,
for a specific user, there is always an optimal choice of desired messages such that this user cannot decode any message other the desired one.
However, we also note that for any choice of desired messages, there always exists a user that can decode two messages.
In the critical case setting, we shall prove that regardless of the choice of desired messages, there always exists a user who can decode $s+t$ messages.
Since there are $\binom{s+t}{t}^{\binom{2s+t}{s}}$ (doubly exponential in $s$) possible choices of desired messages, finding explicitly such a user for every case is intractable.
Therefore, our converse shows the existence of such a user.
The main idea of the existence proof is as follows.
Instead of checking all possible different choices of desired message sets at the users, we reason on the size of the decoding chain for that user.
By assumption, every user can decode $t$ messages outside its side information set.
Some users may be able to decode more messages because they can mimic other users.
After receiving a valid code, we aim to show that every user eventually knows at least $s+t$ messages, including the $s$ messages in its side information set and the (at least) $t$ decoded ones.
Say that user $u_j$, with side information $A_j$, eventually can decode the messages indexed by $B_j\supseteq D_j$.
One can think of the set $C_j:=A_j\cup B_j$ as a \emph{block} that \emph{covers} the side information set $A_j$, by which we mean that the set $C_j$ is a proper superset of $A_j$.
User $u_j$ can also mimic any users $u_k$ whose side information set satisfies $A_k\subset C_j$.
Therefore the desired message set for all the users $u_k$ whose side information $A_k\subset C_j$ is $D_k\subset C_j$.
For any subset of users we can find a collection $\mathcal{C}$ such that, for every side information set $A_j$, there is a cover $C_j\in \mathcal{C}$ such that $C_j= A_j\cup B_j$ where $B_j$ is the largest set of the messages that user $u_j$ can decode.
By this definition, this \emph{block cover} / collection $\mathcal{C}$ satisfies the following properties:
\begin{enumerate}
\item\label{item:BlockCover-P1} \ [BlockCover-P\ref{item:BlockCover-P1}]
For every $s$-element subset of $[m]$, there exists at least one $C\in \mathcal{C}$ that contains this subset.
\item\label{item:BlockCover-P2} \ [BlockCover-P\ref{item:BlockCover-P2}]
$s < |C| \leq m$ for all $C\in \mathcal{C}$.
\item\label{item:BlockCover-P3} \ [BlockCover-P\ref{item:BlockCover-P3}]
For all $P\subseteq [|\mathcal{C}|]$, we have $|\cap_{j\in P} C_j| \notin [s:s+t-1]$.
\end{enumerate}
\begin{IEEEproof}[Proof of BlockCover Properties]
Properties BlockCover-P\ref{item:BlockCover-P1} and BlockCover-P\ref{item:BlockCover-P2} follow by the definition of block cover, while property BlockCover-P\ref{item:BlockCover-P3} holds because if we have $|\cap_{j\in P} C_j| \in [s:s+t-1]$ for some $P\subseteq [|\mathcal{C}|]$, we can have a user with side information set $A^\prime \subseteq \cap_{j\in P} C_j$ with corresponding decoding set $D^\prime$ and this leads to the following contradiction.
By definition of intersection $A^\prime\subset C_j, \ \forall j\in P$;
but also by definition of block cover $D^\prime\subset C_j, \ \forall j\in P$;
thus $A^\prime \cup D^\prime\subseteq C_j, \ \forall j\in P$, which implies $|\cap_{j\in P} C_j| \geq |A^\prime \cup D^\prime| = |A^\prime| + |D^\prime| \geq s +t$ that contradicts the starting assumption $|\cap_{j\in P} C_j| \in [s: s+t-1]$.
\end{IEEEproof}
This block cover idea was inspired by the so-called \emph{generalized Steiner system} in combinatorial design~\cite{generalized_steiner_system}.
An $\mathcal{S}(s,*,m)$ generalized Steiner system consists of blocks / sets such that each subset of size $s$ from the ground set of size $m$ is covered exactly once.
In a critical PICOD$(t)$ setting, the collection of blocks $\mathcal{C}$ also covers all $s$-element subsets of $[m]$ (i.e., all users' side information sets).
But our problem is not exactly a generalized Steiner system because
an $s$-element subset may be contained in more than one block as long as it is not an exact intersection of the blocks--see Property BlockCover-P\ref{item:BlockCover-P3}.
Therefore, our block cover can be seen as a relaxed generalized Steiner system.
To the best of our knowledge no results are available for this specific relaxed generalized Steiner system.
For the critical case we aim to show that there is a user who can decode $s+t$ messages (as in Example~\ref{ex:s=1,m=3}).
We argue it by contradiction.
Assume no user can decode $s+t$ messages,
that is, every user can decode at least $t$ and at most $s+t-1$ messages by mimicking other users.
In terms of block cover, this indicates that we can have a block cover $\mathcal{C}$ with $\max_{C\in \mathcal{C}}\{|C|\}\leq (s+t-1)+s <m=2s+t$.
Our argument of showing that there always exists a user that can decode $t+s$ messages for the critical case is equivalent to showing that a block cover with size at most $2s+t-1$ cannot exist.
Our combinatorial proof shows that the existence of a choice of desired messages such that $t+s \leq |C_j|\leq 2s+t-1, \forall j\in[|\mathcal{C}|]$ leads to the existence of a user that can decode $t+s$ messages, thus $\max|C_j|=2s+t$, which is a contradiction.
Therefore must exists a user whose block cover has size $m=2s+t$.
\subsection{Proposition~\ref{prop:power_user_exist}: Converse Main Ingredient~2: Maximum Acyclic Induced Subgraph (MAIS) Bound}
\label{ssub:mais_bound}
Recall that for a PICOD$(t)$, each user chooses $t$ desired messages outside its side information set.
The collection of the desired message sets for all the users users is denoted as $\mathcal{D}=\{D_1,\dots,D_n\}$, where $n={2s+t\choose s}$.
Once $D$ is chosen, the PICOD$(t)$ reduces to a \emph{multi-cast IC} where each user requests $t$ messages;
we can make one user to be $t$ users with the same side information sets but each with a distinct single desired message;
the multi-cast IC with $n$ users becomes a multi-cast IC with $tn$ users, each requesting one message.
Similarly to the classic all-unicast IC, we can represent in a directed graph / digraph the side information sets and the desired messages of a multi-cast IC where each user desires a single message~\cite{index_coding_with_sideinfo}.
Pick a subset $U\subseteq[tn]$ of users who desire different messages and create a digraph $\mathsf{G}(U)$
as follows.
The vertices $V(\mathsf{G})\subseteq W$ represent the desired messages by the users in $U$.
A directed arc $(w_i,w_j)\in E(\mathsf{G})$ exists if and only if the user who desires $w_i$ has $w_j$ in its side information set.
$\mathsf{G}$ is called \emph{acyclic} if it does not contain a directed cycle.
The \emph{size} of $\mathsf{G}$ is the number of the vertices in, i.e. $|V(\mathsf{G})|=|U|$.
For the all-unicast IC, the maximum size of $U$ such that the corresponding digraph $\mathsf{G}(U)$ is acyclic serves as a converse bound on the optimal code length. This converse is known as \emph{maximum acyclic induced subgraph} (MAIS) bound~\cite{index_coding_with_sideinfo}.
For the PICOD$(t)$, a similar \text{MAIS} bound can be found, which is the maximum size of the acyclic digraph $\mathsf{G}(U)$ created by the choice of users $U\subseteq [tn]$ such that they all desire different messages.
Since \text{MAIS} depends on the desired message set $\mathcal{D}$, we denote its size as $|\text{MAIS}(\mathcal{D})|$.
Thus, for the PICOD$(t)$ as for multi-cast IC, the size of \text{MAIS} is a converse bound on $\ell$~\cite{index_coding_with_sideinfo}, namely, $\ell\geq |\text{MAIS}(\mathcal{D})|$.
Finding the \text{MAIS} for the all-unicast IC is known to be an NP-hard problem~\cite{21np-hard-problems} in general.
Finding the \text{MAIS} for the multi-cast IC appears to be more difficult since one needs to check every possible choice of users with distinct desired messages.
Finding the \text{MAIS} for the PICOD$(t)$ problem seems even more complicated since each choice of $\mathcal{D}$ in the PICOD$(t)$ corresponds to a multi-cast IC, and in addition one needs to find the best $\mathcal{D}$ in terms of code length.
Therefore, finding the \text{MAIS} for the PICOD$(t)$ by solving all possible all-unicast IC problems appears intractable.
Therefore, our existence proof does not find the exact \text{MAIS} for the PICOD$(t)$, but only bounds on its size, i.e., $\max_{\mathcal{D}}|\text{MAIS}(\mathcal{D})|$.
Towards this goal, we have the following properties:
\begin{enumerate}
\item\label{item:MAIS-P1} \ [MAIS-P\ref{item:MAIS-P1}]
for the critical complete--$\{s\}$ PICOD$(t)$ with $m=2s+t$ messages,
$|{\text{MAIS}}(\mathcal{D})|=s+t$ for certain $\mathcal{D}$ if and only if there exists a user who decodes $s+t$ messages.
\item\label{item:MAIS-P2} \ [MAIS-P\ref{item:MAIS-P2}]
for the critical complete--$\{s\}$ PICOD$(t)$ with $m=2s+t$ messages,
if there exists a $\mathcal{D}$ such that $|\text{MAIS}(\mathcal{D})|\leq s+t-1$, there exists a $\mathcal{D}^\prime$ where $|\text{MAIS}(\mathcal{D}^\prime)|=s+t-1$.
\end{enumerate}
\begin{IEEEproof}[Proof of Property \text{MAIS}-P\ref{item:MAIS-P1}
On the one hand, if $|\text{MAIS}(\mathcal{D})|=s+t$, there are $s+t$ users who desire different messages. These users form an acyclic induced subgraph.
We can obtain a decoding chain from the acyclic induced subgraph, in which the first user has side information of all $s$ messages that are not desired by these $s+t$ users.
The first user, by decoding its desired message, can mimic all the other users and
eventually decode $s+t$ messages.
On the other hand, if there is one user who can decode $s+t$ messages,
there are $s+t-1$ users that can be mimicked by it with different desired messages.
These $s+t$ users form an acyclic induced subgraph of size $s+t$.
Then $|\text{MAIS}(D)|=s+t$.
\end{IEEEproof}
\begin{IEEEproof}[Proof of Property \text{MAIS}-P\ref{item:MAIS-P2}
We prove the claim by showing that for a choice of desired messages $\mathcal{D}$ that has a $|\text{MAIS}(\mathcal{D})|=a$ for some integer $a<s+t$, we can always find another choice of desired messages $\mathcal{D}^\prime$ such that $|\text{MAIS}(\mathcal{D}^\prime)|=a+1$.
Assume there exists a $\mathcal{D}$ such that, for some integer $a<s+t$, satisfies $|\text{MAIS}(\mathcal{D})|=a$.
For this $\mathcal{D}$, the PICOD$(t)$ can be seem as a unicast IC with $[t n]$ users, whose graph representation has an induced acyclic subgraph of size $a$ and all induced subgraphs of size strictly larger than $a$ are cyclic.
Without loss of generality, let $\{u_1, \dots, u_a\}$ be the set of users that form this MAIS who have desired messages $\{w_{d_1}, \dots, w_{d_a}\}=[a]$.
By the definition of MAIS, any user with side information $A \subseteq [a+1: m]$ must have desired message $d\in [a]$; this is so because any user with $A \subseteq [a+1: m]$ and $d\in [a+1:m]$ can be added to the users $u_1, \dots, u_a$ to form an acyclic subgraph of size $a+1$, which would contradict to the assumption that $|\text{MAIS}|=a$.
Based on $\mathcal{D}$ we construct $\mathcal{D}^\prime$ such that $|\text{MAIS}(\mathcal{D}^\prime)|=a+1$ as follows.
Choose a user $u^\prime$ with side information $A^\prime \subseteq [a+1: m]$ and change its desired message to $d^\prime \in [a+1:m]\setminus A^\prime$ (it was $d^\prime\in [a]$ in $\mathcal{D}$).
Since $a<s+t$ we have $|[a+1:m]|\geq s+1$ and $|[a+1:m]\setminus A^\prime|\geq 1$, thus such a user $u^\prime$ and its desired message $d^\prime$ can be found. Moreover, by construction the users in $\{u_1,\dots, u_a, u^\prime\}$ form an acyclic subgraph of size $a+1$.
Next, we show that any induced subgraph of size strictly larger than $a+1$ in the IC represented by $\mathcal{D}^\prime$ is cyclic.
This can be seen as follows. Note that from $\mathcal{D}$ to $\mathcal{D}^\prime$ only the desired message of $u^\prime$ was changed, therefore any induced subgraph in the IC represented by $\mathcal{D}^\prime$ that does not have $u^\prime$ also exists in the IC represented by $\mathcal{D}$.
For any induced subgraph in the IC represented by $\mathcal{D}^\prime$ with size strictly larger than $a+1$, if it does not contain $u^\prime$, this induced subgraph exists in the IC represented by $\mathcal{D}$. By the condition $|\text{MAIS}(\mathcal{D})|=a$ we know that this subgraph is cyclic.
If the induced subgraph contains $u^\prime$, remove $u^\prime$ so as to obtain an induced subgraph of size strictly larger than $a$. This newly obtained subgraph exists in the IC represented by $\mathcal{D}$. Similarly the subgraph is cyclic by $|\text{MAIS}(\mathcal{D})|=a$ thus the original subgraph which contains $u^\prime$ is also cyclic.
This concludes that $|\text{MAIS}(\mathcal{D}^\prime)|=a+1$.
We show that we can always construct $|\text{MAIS}(\mathcal{D}^\prime)|=a+1$ based on $|\text{MAIS}(\mathcal{D})|=a<s+t$.
Therefore if there exists a $\mathcal{D}$ such that $|\text{MAIS}(\mathcal{D})|<s+t$, by the construction we have have a $\mathcal{D}^\prime$ such that $|\text{MAIS}(\mathcal{D}^\prime)|=s+t-1$.
\end{IEEEproof}
We are now ready to prove Proposition~\ref{prop:power_user_exist}.
\subsection{Proof of Proposition~\ref{prop:power_user_exist}}
\label{sec:power_user_exist}
Our proof for Proposition~\ref{prop:power_user_exist} is by contradiction. Specifically, we prove that, under the assumption that there exists $\mathcal{D}^\prime$ such that $|\text{MAIS}(\mathcal{D}^\prime)|=s+t-1$ (see Property \text{MAIS}-P\ref{item:MAIS-P2}) and given a valid code, there must exist a user that can decode $s+t$ messages. This however contradicts Property \text{MAIS}-P\ref{item:MAIS-P1}. Therefore $\mathcal{D}^\prime$ does not exist, which implies that there must exists a user that can decode $s+t$ messages and $|\text{MAIS}(\mathcal{D})|=s+t$ for all $\mathcal{D}$. This proves that for the critical case the optimal number of transmission is $\ell^*= s+t$.
Specifically, the assumption that $|\text{MAIS}(D^\prime)|=s+t-1$ implies that one can find a set of $s+t-1$ users, denoted by $V$, who desire different messages and with a strict partial order on $V$ given by: for distinct $i,j\in V$, if $i<j$ then $d_j\notin A_i$. Without loss of generality, let $[s+2:2s+t]$ be the set of the distinct $s+t-1$ desired messages by the users in $V$. By the definition of \text{MAIS}, there is a user in $V$ such that its side information set satisfies $A\subset [s+1]$. This is the user that has no incoming edges in the induced acyclic subgraph of the \text{MAIS}. Thus, a user with side information including the messages in $[s+1]$ (these messages are not desired by the users in $V$) is able to decode all the messages in $[s+2:2s+t]$.
\begin{figure}
\centering
\includegraphics[width=0.6\columnwidth]{block_cover_critical.pdf}
\caption{Side information sets and decoded messages for $s+1$ users for Proposition \ref{prop:power_user_exist}.Case2.}
\label{fig:block_cover_critical}
\end{figure}
Consider the following $s+1$ users: for $i\in [s+1]$ user $u_i$ has side information $A_i = [s+1]\setminus\{i\}$. The side information sets and decoded messages of these users are illustrated in Fig.~\ref{fig:block_cover_critical} where columns are for messages and rows for users; a $0$ (resp. $1$) entry indicates the absence (resp. presence) of the corresponding message in the side information set of the user. We have one of two cases:
\emph{Proposition~\ref{prop:power_user_exist}.Case1}:
\label{emph:case_a}
Assume that for some $k\in[s+1]$ we have $B_k\cap[s+1]=[s+1]\backslash A_k$. Recall $B_k$ is the set of messages that user $u_k$ can decode and $A_k$ its side information, this user will gain the knowledge of all messages $W_{[s+1]}$.
It therefore can decode all the remaining messages $W_{[s+2:2s+t]}$.
Eventually this user decodes $s+t$ messages, therefore $C_k=[2s+t]$.
\emph{Proposition~\ref{prop:power_user_exist}.Case2}:
\label{emph:case_b}
For every user $i\in[s+1]$, we have $B_i\subseteq [s+2:2s+t]$--as shown in Fig.~\ref{fig:block_cover_critical}, where the side information and decodable message sets are represented by the rows of the matrx.
The left part of the matrix indicates the side information of the users, where $0,1$ entries show the absence and existence of the corresponding messages in the side information.
By assumption $B_i\subseteq [s+2:2s+t]$ contains the indices of the messages decoded by user $u_i$ and
property BlockCover-P\ref{item:BlockCover-P3},
we have $|\cap_{i\in P}C_i|\notin [s:s+t-1]$ for any $P\subseteq [s+1]$.
Note that $|\cap_{i\in P}A_i|= s+1-|P|$ and $A_i\cap B_i = \emptyset$,
thus we have $|\cap_{i\in P}B_i|\notin [|P|-1: |P|+t-2], \forall P\subseteq [s+1]$.
In Proposition~\ref{prop:power_user_exist}.Case2, all $B_i, \ i\in[s+1]$ are non-empty subsets of a ground set $[s+2: 2s+t]$; by Lemma~\ref{lem:exist_intersection_s} in Appendix~\ref{app:lem:exist_intersection_s}, it is guaranteed that there is a $P$ such that $|[s+2: 2s+1]\cap(\cap_{i\in P}B_i)|=|P|-1$; therefore we have $\left|\cap_{i\in P}B_i\right|\in[|P|-1 : |P|+t-2]$ for some $P\subseteq [s+1]$, which contradicts what we just stated, thus this case in impossible.
Therefore only Proposition~\ref{prop:power_user_exist}.Case1 is possible.
This shows the existence of a user whose block cover is $[m]=[2s+t]$.
This user can decode $s+t$ messages.
But this contradicts the assumption that the \text{MAIS} bound is $|\text{MAIS}(\mathcal{D}^\prime)|=2s+t-1$.
Overall, this shows that for all possible choices of $\mathcal{D}$ one must have $|\text{MAIS}(\mathcal{D})|=2s+t$, which implies $\ell^*\geq s+t$.
This, with the achievability in Proposition~\ref{prop:achievability_complete-s}, concludes the proof of Proposition~\ref{prop:power_user_exist}.
\subsection{Complete--$S$ where $|S|=1$}
\label{sub:complete_s_cardinality_one}
With Proposition~\ref{prop:power_user_exist}, we can prove a more general case.
\begin{prop} (The case $|S|=1$.)
\label{prop:card=1_complete-s}
For the complete--$\{s\}$ PICOD$(t)$ with $m$ messages, the optimal code length is $\ell^*= \min\{s+t,m-s\}$.
\end{prop}
\begin{IEEEproof}[Proof of Proposition~\ref{prop:card=1_complete-s}]
Proposition~\ref{prop:power_user_exist} solves the case where $S=\{s\}$ and $m=2s+t$.
Therefore, in the following we study the remaining two cases: $m<2s+t$ and $m>2s+t$.
\paragraph*{Case $m<2s+t$}
\label{ssub:proof_of_case_small_m}
Consider
an integer $\alpha \leq s$ and split
the $n=\binom{m}{s}$ users in the system into two categories:
users $u_i$ with $[\alpha] \subset A_i$,
and the other users.
The users in the first category
do not decode any message in $[\alpha]$ (since they have all these messages in their side information set);
these users together form a complete--$\{s-\alpha\}$ PICOD$(t)$ with $m-\alpha$ messages.
Since this complete--$\{s-\alpha\}$ PICOD$(t)$ is a subset of the original complete--$\{s\}$ PICOD$(t)$, its optimal number of transmissions is a lower bound on the number of transmissions in the original system.
%
If we take $m-\alpha = 2(s-\alpha)+t \Longleftrightarrow \alpha = 2s+t-m > 0$ then, by Proposition~\ref{prop:power_user_exist}, the optimal number of transmissions for the complete--$\{s-\alpha\}$ PICOD$(t)$ with $m-\alpha= 2(s-\alpha)+t$ messages is $(s-\alpha)+t=m-s$.
Therefore the original complete--$\{s\}$ PICOD$(t)$
requires at least $m-s$ transmissions, i.e., $\ell^*\geq m-s = \min\{m-s,s+t\}.$
\paragraph*{Case $m>2s+t$}
\label{ssub:proof_fo_case_large_m}
The proof is by contradiction.
Assume there exists a $D^\prime$ such that $|\text{MAIS}(D^\prime)|=s+t-1$ and,
without loss of generality, that the maximum acyclic induced subgraph is formed by users with desired messages $[s+t-1]$.
Specifically, we have users $u_i,i\in[s+t-1]$ such that $d_i=i$ and $d_j\notin A_i$ for any $j,i\in [s], j>i$ (by the definition of \text{MAIS} and its induced partial order).
Let $U^\prime$ index the users whose side information is a subset of $[s+t:m]$, i.e., $i\in U^\prime$ if $A_i\subset [s+t:m]$.
Apparently $1\in U^\prime$. We distinguish the following two cases.
\\
\emph{Proposition~\ref{prop:card=1_complete-s}.($m>2s+t$).Case1}:
If there is a user $u_i \in U^\prime$ with desired message $d_i\in [s+t:m]$, we have $d_j\notin A_t$ for all $j\in[s]$. Thus users $u_i,u_1,u_2,\dots,u_{s+t-1}$ form an acyclic induced subgraph of length $s+t$.
This contradicts to the assumption that $|\text{MAIS}(D^\prime)|=s+t-1$.
\\
\emph{Proposition~\ref{prop:card=1_complete-s}.($m>2s+t$).Case2}:
For all $i\in U^\prime$ we have $d_i\in [s]$.
By a similar reasoning as in proof of Proposition~\ref{prop:power_user_exist}, we can show that there exists a user who can decode $s+t$ messages. This again contradicts the assumption that $|\text{MAIS}(D)|=s+t-1$.
By combining Proposition~\ref{prop:card=1_complete-s}.($m>2s+t$).Case1 and Proposition~\ref{prop:card=1_complete-s}.($m>2s+t$).Case2, we conclude that $|\text{MAIS}(D)| > s$.
By Properties~\text{MAIS}-P\ref{item:MAIS-P1}
and~\text{MAIS}-P\ref{item:MAIS-P2}
we thus have $\ell^*\geq s+t = \min\{m-s,s+t\}$.
The achievability follows directly the schemes in Proposition~\ref{prop:achievability_complete-s}.
Since $|S|=1$, no partition is needed.
\end{IEEEproof}
\section{Complete--$S$ PICOD$(t)$ where $S$ is consecutive: Proof of Theorem~\ref{thm:complete_consecutive}}
\label{sec:complete_s_consecutive}
With Proposition~\ref{prop:card=1_complete-s},
we are ready to prove Theorem~\ref{thm:complete_consecutive} in full generality.
We consider the following three cases.
\begin{figure}[h!]
\centering
\begin{subfigure}{0.3\columnwidth}
\includegraphics[width=\columnwidth]{layer_consecutive_smax_small.pdf}
\caption{$s_{\rm max} \leq \ceil{(m-t)/2}-1$.}
\label{fig:layer_representation_smax_small}
\end{subfigure}
\begin{subfigure}{0.3\columnwidth}
\includegraphics[width=\columnwidth]{layer_consecutive_smin_large.pdf}
\caption{$s_{\rm min} \geq \floor{(m-t)/2}$.}
\label{fig:layer_representation_smin_large}
\end{subfigure}
\begin{subfigure}{0.3\columnwidth}
\includegraphics[width=\columnwidth]{layer_consecutive_middle_consecutive.pdf}
\caption{$s_{\rm min} \leq \floor{(m-t)/2}-1 \leq \ceil{(m-t)/2} \leq s_{\rm max}$.}
\label{fig:layer_representation_middle}
\end{subfigure}
\caption{Various layer representations.}
\label{fig:LayerRepresentationForProps}
\end{figure}
\subsection{Case $s_{\rm max} \leq \ceil{(m-t)/2}$: $\ell^*=s_{\rm max}+t$}
\label{ssub:max<m/2}
Drop all the users except those with side information set of size $s_{\rm max}$, thereby obtaining a compete-$\{s_{\rm max}\}$ PICOD$(t)$ with $m$ messages. The layer representation of this case is shown in Fig.~\ref{fig:layer_representation_smax_small}, where the red layer is the one left after dropping users. For this system the optimal number of transmissions lower bound by $\min\{m-s_{\rm max},s_{\rm max}+t\} = s_{\rm max}+t$ (because $s_{\rm max} \leq \ceil{(m+t)/2}$ in this case), which is a lower bound on the number of transmissions in the original system. By Proposition~\ref{prop:achievability_complete-s}, we have $\ell^*=s_{\rm max}+t$.
\subsection{Case $s_{\rm min} \geq \floor{(m-t)/2}$: $\ell^*=m-s_{\rm min}$
\label{ssub:min>m/2}
As for the case in Section~\ref{ssub:max<m/2}, drop all the users except those with side information of size $s_{\rm min}$, thereby obtaining a compete-$\{s_{\rm min}\}$ PICOD$(t)$ with $m$ messages and optimal number of transmissions is $\min\{m-s_{\rm min},s_{\rm min}+t\} = m-s_{\rm min}$ (because $s_{\rm min} \geq \floor{(m-t)/2}$ in this case). By Proposition~\ref{prop:achievability_complete-s}, we have $\ell^*=m-s_{\rm min}$. The layer representation of this case is shown in Fig.~\ref{fig:layer_representation_smin_large}, where red layer is the one left after dropping users.
\subsection{Case $s_{\rm min} \leq \floor{(m-t)/2}-1 \leq \ceil{(m-t)/2} \leq s_{\rm max}$}
\label{prop:min<m/2<max}
Define
\begin{align}
\delta &:= \min\left\{s_{\rm max}-\ceil{\frac{m-t}{2}}, \floor{\frac{m-t}{2}}-s_{\rm min}\right\},
\label{eq:defdelta}
\\
m^\prime &:= m+2\delta+\ceil{\frac{m-t}{2}}-\floor{\frac{m-t}{2}},
\label{eq:defmprime}
\\
S^\prime &:= \left[\floor{\frac{m-t}{2}}-\delta: \ceil{\frac{m-t}{2}}+\delta\right].
\label{eq:defSprime}
\end{align}
Drop all users except those with side information of size $s\in S^\prime$ for $S^\prime$ in~\eqref{eq:defSprime}, thereby obtaining a complete--$S^\prime$ PICOD$(t)$ with $m$ messages. The layer representation of this case is shown in Fig.~\ref{fig:layer_representation_smin_large}, where red layers are the ones left after dropping users.
Create dummy messages $W_{[m+1: m^\prime]}$, where
dummy messages will not be desired by any user.
To every user who was not dropped, with side information of size $s\in S^\prime$, give every $(\ceil{\frac{m-t}{2}}+\delta-s)$-subset of $[m+1: m^\prime]$ as extra side information (where $\delta$ is defined in~\eqref{eq:defdelta} and $m^\prime$ in~\eqref{eq:defmprime});
each such user
generates $m^\prime-m \choose \ceil{\frac{m-t}{2}}+\delta-s$ new users.
All the users created by this procedure form a complete--$\{\ceil{\frac{m-t}{2}}+\delta\}$ PICOD$(t)$ with $m^\prime$ messages, whose optimal number of transmissions is
\begin{align*}
&\min\left\{\ceil{\frac{m-t}{2}}+\delta+t, m^\prime-(\ceil{\frac{m-t}{2}}+\delta)\right\}
\\&=\min\left\{ \ceil{\frac{m-t}{2}}+\delta+t, m+2\delta+\ceil{\frac{m-t}{2}}-\floor{\frac{m-t}{2}}-\ceil{\frac{m-t}{2}}-\delta \right\}
\\&=\delta+t+\min\left\{\ceil{\frac{m-t}{2}}, m-t-\floor{\frac{m-t}{2}} \right\}
\\&=\delta+t+\ceil{\frac{m-t}{2}}
\\&=\min\left\{s_{\rm max}-\ceil{\frac{m-t}{2}}, \floor{\frac{m-t}{2}}-s_{\rm min}\right\}+t+\ceil{\frac{m-t}{2}}
\\&=\min\left\{s_{\rm max}+t, m-s_{\rm min}\right\}
\\&= \ell^\prime.
\end{align*}
Although the new system contains more users, any valid code for the original system works for the new one.
Therefore the optimal code length $\ell^\prime$ is a lower bound on the optimal code length for the original system.
This lower bound can be attained by the scheme described in Proposition~\ref{prop:achievability_complete-s}.
This concludes Theorem~\ref{thm:complete_consecutive}.
\section{Some other complete--$S$ PICOD$(t)$}
\label{sec:complete_nonconsecutive}
The proofs in Section~\ref{sub:complete_s_cardinality_one} start by dropping some users in the system.
This shows that there exists \emph{non-critical users} that do not affect the optimal code length.
Therefore, by adding non-critical users, we can obtain a \emph{non-consecutive} complete--$S$ PICOD$(t)$ where the proof used for Theorem~\ref{thm:complete_consecutive} can still provide a tight converse.
\subsection{Proof of Proposition~\ref{prop:max<m/2_nonconsecutive}}
\label{par:max<m/2_nonconsecutive}
The converse depends only on the users with side information of size $s_{\rm max}$.
The code that satisfies the complete--$\{s_{\rm max}\}$ PICOD$(t)$, i.e., transmit $s_{\rm max}+t$ messages one at a time, also satisfies all the users with smaller size of side information.
\subsection{Proof of Proposition~\ref{prop:min>m/2_nonconsecutive}}
\label{par:min>m/2_nonconsecutive}
The converse depends only on the users with side information of size $s_{\rm min}$.
The code that satisfies the complete--$\{s_{\rm min}\}$ PICOD$(t)$, i.e., transmit $m-s_{\rm min}$ linearly independent linear combinations of all messages, also satisfies all the users with larger size of side information.
\subsection{Proof of Proposition~\ref{prop:min<m/2<max_nonconsecutive}}
\label{par:min<m/2<max_nonconsecutive}
The converse depends only on the users with side information of size in $[\floor{\frac{m-t}{2}}-\delta: \ceil{\frac{m-t}{2}}+\delta]$.
The code that satisfies the complete--$[\floor{\frac{m-t}{2}}-\delta: \ceil{\frac{m-t}{2}}+\delta]$ PICOD$(t)$ also satisfies all the users with larger size of side information set. That is, either transmit $s_{\rm max}+t$ messages one at a time, or $m-s_{\rm min}$ linearly independent linear combinations of all messages.
\subsection{Proof of Proposition~\ref{prop:achi_opt_m<=5}}
\label{sub:complete_m<=5}
Proposition~\ref{prop:achi_opt_m<=5} states that the achievable scheme in Proposition~\ref{prop:achievability_complete-s} is information theoretically optimal for the complete--$S$ PICOD$(t)$ with $m\leq 5$.
The main idea behind these proofs follows the one in converse proof of Theorem~\ref{thm:layer_cont_opt}: construct a decoding chain by providing proper messages to the user as genie, in a way that the user can mimic other users and decode the desired number of messages.
Table~\ref{table:complete_s_m<=5} lists the optimal code length $\ell^*$ of all complete--$S$ PICOD$(t)$ instances that are not covered by Theorem~\ref{thm:layer_cont_opt} or Propositions~\ref{prop:max<m/2_nonconsecutive},~\ref{prop:min>m/2_nonconsecutive},~\ref{prop:min<m/2<max_nonconsecutive}.
\begin{table
\centering
\caption{Complete--$S$ PICOD$(t)$ that are not covered by Theorem~\ref{thm:layer_cont_opt} or Propositions~\ref{prop:max<m/2_nonconsecutive},~\ref{prop:min>m/2_nonconsecutive},~\ref{prop:min<m/2<max_nonconsecutive}.}
\begin{tabular}{ |c|c|c|c| }
\hline
\multirow{2}{3em}{$m=4$} & $S=\{0,2\}$ & $t=1, 2$ & $\ell^*=t+2$ \\
& $S=\{1,3\}$ & $t=1$ & $\ell^*=3$ \\
\hline
\multirow{3}{3em}{$m=5$} & $S=\{0,3\}$ & $t=1, 2$ & $\ell^*=t+2$ \\
& $S=\{1,4\}$ & $t=1$ & $\ell^*=3$\\
& $S=\{1,3\}$ & $t=1, 2$ & $\ell^*=4$\\
& $S=\{0,1,3\}$ & $t=1, 2$ & $\ell^*=4$\\
& $S=\{1,3,4\}$ & $t=1$ & $\ell^*=4$\\
& $S=\{0,2,3\}$ & $t=1, 2$ & $\ell^*=4$\\
& $S=\{0,2,4\}$ & $t=1$ & $\ell^*=4$\\
& $S=\{1,2,4\}$ & $t=1$ & $\ell^*=4$\\
\hline
\end{tabular}
\label{table:complete_s_m<=5}
\end{table}
Unfortunately, the converse proofs are based on a case-by-case reasoning, i.e., constructively find a user that can decode a certain number of messages.
We could not straightforwardly extended these proof to the complete--$S$ PICOD$(t)$ for general $m$.
Here we show proofs of two cases. The other cases can be proved using the similar methods.
\paragraph{Proposition~\ref{prop:achi_opt_m<=5}.Case1}
We show that for the complete--$S$ PICOD$(1)$ where $S=\{1,3\}$ and $m=5$, the optimal code has length $\ell^*=4$.
We do so by proving the existence of a user with one message in its side information set who can decode the remaining $4$ messages.
By Proposition~\ref{prop:card=1_complete-s}, there exists a user, say $u_1$, with side information set of size $1$, say $A_1=\{1\}$, who can decode $2$ messages, say $B_1\supseteq\{2, 3\}$.
User $u_1$ thus can mimic user $u_2$ with side information $A_2=\{1,2,3\}$ and decode its desired message.
Therefore user $u_1$ can decode at least 3 messages, $|B_1|\geq 3$.
Denote the last message that has not been decoded by user $u_1$ as $w_5$.
Now, if $w_5$ is desired by some users, i.e., we have a user $u_3$ with $d_3=5$, user $u_1$ can mimic user $u_3$ and decode $w_5$ since $A_3\subset [4]$. Therefore user $u_1$ can decode $4$ messages and $\ell^*\geq 4$.
Otherwise, $w_5$ is not desired by any users in the system.
Since the message that is not desired by any users does not have any effect, by deleting it, the system becomes the complete--$[0:3]$ PICOD$(1)$ with $m=4$.
By Theorem~\ref{thm:layer_cont_opt} we have the user with $A=\{5\}$ can decode $4$ messages and
$\ell^*\geq 4$.
We apply the achievability for the complete--$\{1,2,3\}$ PICOD$(1)$.
This achievability works since $\{1,3\}\subset \{1,2,3\}$.
By Theorem~\ref{thm:complete_consecutive} we have $\ell^*\leq 4$.
This proves the optimality of $\ell^*= 4$ transmissions.
Note: the existence proof based on block cover, as used for Proposition~\ref{prop:power_user_exist}, is also workable for Proposition~\ref{prop:achi_opt_m<=5} as well.
\paragraph{Proposition~\ref{prop:achi_opt_m<=5}.Case2}
We show that for the complete--$S$ PICOD$(1)$ problem where $S=\{0,2,4\}$ and $m=5$, the optimal code has length $\ell^*=4$.
The following lemma, which is a refined version of Proposition~\ref{prop:card=1_complete-s}, is used in the proof.
\begin{lemma}
\label{lem:exist_power_user_in_group}
For a complete--$\{s\}$ PICOD$(t)$ with $m$ messages, let $A^\prime\subset [m], |A^\prime|\leq s$, $U_{A^\prime}$ be the group of users who have $A^\prime$ in their side information, i.e., $u_i\in U_{A^\prime}$ if and only if $A^\prime\subseteq A_i$.
For any $A^\prime$, there exists a user in $U_{A^\prime}$ that can decode at least $\min\{m-s, s+t-|A^\prime|\}$ messages.
Note: Proposition~\ref{prop:card=1_complete-s} is the case $A^\prime=\emptyset$.
\end{lemma}
\begin{IEEEproof}[Proof of Lemma~\ref{lem:exist_power_user_in_group}]
The users in $U_{A^\prime}$ alone can be seen as the users in a new complete--$S^\prime$ PICOD$(t)$, where $S^\prime=\{s-|A^\prime|\}$, $m^\prime=m-|A^\prime|$.
By Proposition~\ref{prop:card=1_complete-s} we have that there exists a user in this system that can decode $\min\{s^\prime+t, m^\prime-s^\prime\}=\min\{s+t-|A^\prime|, m-s\}$ messages.
The above argument holds for all $A^\prime\subset [m], |A^\prime|\leq s$.
\end{IEEEproof}
Back to the proof of Proposition~\ref{prop:achi_opt_m<=5}.Case2.
We show that by giving one message as a genie, the user with no side information can decode the other $4$ messages.
Since every user can decode one message, user $u_1$ with $A_1=\emptyset$ can decode message $w_{d_1}$.
By Lemma~\ref{lem:exist_power_user_in_group}, we see that there exists a user $u_2\in U_{\{d_1\}}$ that can decode $2$ messages, where $U_{\{d_1\}}$ is the group of users who have side information sets of size $2$ and $w_{d_1}$ in their side information sets.
Without loss of generality let $A_2=\{d_1, 2\}$ and the two messages that $u_2$ can decode be $w_3, w_4$, $d_1\notin \{2,3,4\}$.
Therefore, giving message $w_2$ to user $u_1$ allows it to decode $w_3,w_4$.
Also, there exists a user with side information $\{d_1,2,3,4\}$ and decodes $w_{d_5}\notin\{d_1,2,3,4\}$. So user $u_1$ can decode $w_{d_5}$ as well.
Overall, user $u_1$ can decode $4$ messages with the proper genie $w_2$.
The code length is therefore lower bounded by $\ell^*\geq 4$.
For the achievability, we split the users into two groups: $S_1=\{0,2\}$ where users have side information of size $0$ or $2$; $S_2 = \{4\}$ where users have side information of size $4$.
By Proposition~\ref{prop:max<m/2_nonconsecutive} we can satisfy all users in $S_1$ with $3$ transmission; by Proposition~\ref{prop:card=1_complete-s} we can satisfy all users in $S_2$ with one transmission.
In total we use $4$ transmissions to satisfy all users.
\section{Proof of Theorem~\ref{thm:circular-arc_optimality}}
\label{sec:picod_with_special_network_topology_hypergraph}
In this section, we prove a tight converse bound on the optimal code length for PICOD$(1)$ with circular-arc network topology hypergraph.
We start by introducing some graph theory terminology.
\subsection{Graph Preliminaries}
\label{sub:graph_prelimiary}
Let $H=(V,\mathcal{E})$ denote a \emph{hypergraph} with vertex set $V$ and edge set $\mathcal{E}$, where an edge $E\in\mathcal{E}$ is a subset of $V$, i.e., $E \subseteq V$.
The hypergraph is called \emph{$r$-uniform} if all edges have cardinality $r$, i.e., $|E|=r, \ \forall E\in \mathcal{E}$.
For $R\subseteq [|V|]$, the hypergraph is called \emph{$R$-uniform} if all edges have cardinality of some $r\in R$, i.e., $|E|\in R, \ \forall E\in \mathcal{E}$.
The hypergraph is called \emph{complete $r$-uniform} if all edges with cardinality $r$ exit, i.e., for all $E$ such that $|E|=r, E\subseteq V$, we have $E\in \mathcal{E}$.
The hypergraph is called complete \emph{$R$-uniform} if all edges with cardinality $r\in R$ exist.
The \emph{dual} hypergraph $H^*=(V^*, \mathcal{E}^*)$ of $H$ is a hypergraph where the vertices and edges are interchanged, i.e., $\mathcal{E}^*=V$, $V^*=\mathcal{E}$.
The degree of a vertex $v\in V$ is the number of its incident edges, i.e., $\delta(v)=|\{E: v\in E, E\in\mathcal{E}\}|$.
The hypergraph is called \emph{$k$-regular} if the degree of all vertices is $k$.
A \emph{factor} of $H$ is a spanning edge induced subgraph of $H$, i.e., an edge induced subgraph of $H$ with the same vertex set of $V$. A \emph{$k$-factor} is a factor which is $k$-regular.
A hypergraph $H$ is called an \emph{circular-arc hypergraph} if there exists an ordering of the vertices $v_1, v_2, \ldots, v_n$ such that if $v_i, v_j, i\leq j$, then the $v_q$ for either all $i\leq q\leq j$, or all $q\leq i$ and $q\geq j$, are incident to an edge $E$.
For a PICOD$(t)$, its network topology hypergraph\ is a hypergraph $H=(V,\mathcal{E})$ such that:
i) $V=\{u_1,\ldots,u_n\}$, i.e., vertices represent the users;
ii) $\mathcal{E}=\{E_1,\ldots,E_m\}$, i.e., edges represent the messages;
iii) $u_i\in E_j$ if $w_j\notin A_i$, i.e., a vertex is incident to an edge if the user does not have the message in the side information.
This definition of network topology hypergraph\ is a generalization of the network topology graph in~\cite{TDMA_optimal}.
Note that the network topology hypergraph\ is defined solely on user set $U$, message set $W$, and side information sets $\mathcal{A}$.
For the IC, the network topology hypergraph\ does not uniquely define an instance of the problem, since it does not contain the information about desired message sets of the users.
However, the network topology hypergraph\ uniquely defines a PICOD$(t)$ due to the property that the PICOD$(t)$ does not specify the desired messages for the users.
\subsection{On the Optimality of a Single Transmission}
\label{sub:condition_for_one_transmission_to_be_optimal}
We give the necessary and sufficient condition on the network topology hypergraph\ of a PICOD$(1)$ problem for which one transmission is optimal.
This result applies to all PICOD$(1)$ instances, thus serves as a general converse bound for the PICOD$(1)$.
\begin{prop}
\label{prop:l=1_condition}
A PICOD$(1)$ with $m$ messages has $\ell^*=1$ if and only if its network topology hypergraph\ has a $1$-factor. Otherwise $\ell^* \geq 2$.
\end{prop}
\begin{IEEEproof}[Proof of Proposition~\ref{prop:l=1_condition}]
\emph{Achievability}:
The network topology hypergraph\ $H$ has a $1$-factor if it has an edge induced sub-hypergraph whose vertices are the same as the vertices of $H$ and all have degree one.
In other words, in this induced sub-hypergraph all vertices are adjacent to one and only one edge.
Since $H$ is the network topology hypergraph, its vertices represent users and edges represent messages.
A vertex is adjacent to an edge if and only if the user does not have that message in its side information set.
For the PICOD$(1)$, that message can be a desired message by the incident users.
Therefore, among all the messages corresponding to the edges in the $1$-factor, every user has one and only one message that is not in its side information set.
Transmitting the sum of all these messages satisfies all users.
By this transmission scheme we achieve $\ell^*= 1$, which is clearly optimal.
\emph{Converse}:
We aim to show that if the network topology hypergraph\ does not have a $1$-factor hypergraph, then we can construct a user that can decode two messages, thus two transmissions are needed.
For any valid code, consider the sub-hypergraph induced by the edges corresponding to all the desired messages by all users, i.e., the edge induced sub-hypergraph of $H$ where the edges correspond to the messages that are decoded by at least one user.
This sub-hypergraph is always a factor, i.e., a spanning sub-hypergraph, since all users can decode at least one message in a PICOD$(1)$.
Assume no $1$-factor exists in $H$, that is, there exists a vertex whose degree is at least $2$ in the sub-hypergraph.
In other words, for all choices of desired messages at the users, there exists a pair of users $u_1$ and $u_2$ with desired messages $w_{d_1}$ and $w_{d_2}$ such that $d_2\notin A_1$.
We therefore have $A_1 \subseteq [m]\setminus \{d_1, d_2\}$.
Given any valid code, a user $u^\prime$ with $A^\prime=[m]\setminus \{d_1, d_2\}$ can mimic user $u_1$ then user $u_2$, thus can decode $w_{d_1}, w_{d_2}$.
By Lemma~\ref{lem:converse_on_decodable_msg}, we conclude that $\ell^*\geq 2$.
\end{IEEEproof}
\subsection{Proof of Theorem~\ref{thm:circular-arc_optimality}}
\label{sub:circular_arc_hypergraph}
We show a case where the converse proposed in Proposition~\ref{prop:l=1_condition} is tight by proposing an achievable scheme based on the properties of a circular-arc hypergraph. First, in Lemma~\ref{lemma:full_cover} we show the following fact: if two edges, say $E_i$ and $E_j$, are ``close'' in $\mathcal{E}$ with a nonzero gap between them, then there exists an edge in $\mathcal{E}$ that ``covers'' the whole gap between $E_i$ and $E_j$. This fact will be used in Theorem~\ref{thm:circular-arc_optimality} to design a two-transmission achievable scheme.
\begin{lemma}
\label{lemma:full_cover}
Assume a circular-arc hypergraph\ $H$ without isolated vertices and where the vertices are in a cyclic order $\{v_1,v_2,\dots,v_n\}$.
Assume there exist two edges $E_{i}=\{v_{i_1},\ldots,v_{i_p}\}$ and $E_{{j}}=\{v_{j_1},\ldots,v_{j_q}\}$ that satisfy the following two conditions: Condition1) $i_p+1<j_1$, and
Condition2) every edge that contains any vertices in $\{v_{i_p+1},\dots,v_{j_1-1}\}$ contains $v_{i_p}$.
Then, there exists an edge $E_k$ such that $\{v_{i_p+1},\dots,v_{j_1-1}\}\subseteq E_k$.
\end{lemma}
\begin{IEEEproof}[Proof of Lemma~\ref{lemma:full_cover}]
Since $H$ does not have any isolated vertices, there exists $E_k\in\mathcal{E}$ such that $v_{j_1-1}\in E_k$.
By the Condition2 we have $v_{i_p}\in E_k$.
By the property of circular-arc hypergraph\ (if $v_{i_p}$ and $v_{j_1-1}$ are contained in $E_k$, all the vertices between are contained in $E_k$ as well) we have $\{v_{i_p+1},\dots,v_{j_1-1}\}\subseteq E_k$.
\end{IEEEproof}
\begin{figure}
\centering
\includegraphics[width=0.35\columnwidth]{circular_arc_2trans.pdf}
\caption{Two transmissions scheme for circular-arc network topology hypergraph\ PICOD$(t)$.}
\label{fig:circular_arc_achievability}
\end{figure}
\begin{IEEEproof}[Proof of Theorem~\ref{thm:circular-arc_optimality}]
We propose an achievable scheme that uses two transmissions to satisfy all users for all PICOD$(1)$ instances with circular-arc network topology hypergraph. The scheme consists two steps.
\paragraph{Theorem~\ref{thm:circular-arc_optimality}.Step1}
Given a PICOD$(t)$ with network topology hypergraph as a circular-arc hypergraph, we notice that:
\begin{itemize}
\item No vertex is isolated.
\item There might exists an edge that is as a proper subset of another edge.
\end{itemize}
We drop those edges that are proper subsets of the union of other edges, obtaining the edge set $\mathcal{E}$.
In other words, $|E_i\setminus (\cup_{j\neq i} E_j)|>0, \forall E_i, E_j\in \mathcal{E}$.
The achievability scheme based on $\mathcal{E}$ will be valid for the original problem setting as well (since we are restricted to use less messages to satisfy all users).
The edge induced subgraph by $\mathcal{E}$ has no isolated vertex as well.
\begin{algorithm
\SetAlgoLined
\KwData{User set: $V=\{v_1,\dots, v_n\}$, message set: $\mathcal{E}$.}
\KwResult{Message set: $\mathcal{E}^{(1)}=\{E_{1^{(1)}}, \dots E_{e^{(1)}}\}$.}
Initialization: set $i=1$, $\mathcal{E}^{(1)}=\emptyset$.
\\
\While{$i\leq n$}{
Seek an edge that starts at $v_i$, i.e., an edge that is $\{v_i, \dots \}$\;
\eIf{Such an edge is found}{
Let $\mathcal{E}^{(1)}$ include be the edge found\;
$i$ becomes the index of the vertex right after the found edge, that is, the edge $\{\dots, v_{i-1}\}$ \;
}
{
$i=i+1$\;
}
}
\caption{Algorithm for finding $\mathcal{E}^{(1)}$ in Step1.}
\label{alg:step1}
\end{algorithm}
In Step1 we find a set of messages $\mathcal{E}^{(1)}\subseteq \mathcal{E}$ by using Algorithm~\ref{alg:step1}.
The blue solid arcs in Fig.~\ref{fig:circular_arc_achievability} show an example of $\mathcal{E}^{(1)}$ found by Algorithm~\ref{alg:step1}.
Denote the cardinality of $\mathcal{E}^{(1)}$ as $e:=|\mathcal{E}^{(1)}|$.
We claim that $\mathcal{E}^{(1)}$ has the following properties:
\begin{itemize}
\item $E_{i^{(1)}}\cap E_{j^{(1)}} = \emptyset,$ for all $i, j\in [e], (i, j) \neq (1, e)$ and $(i, j) \neq (e, 1)$.
\item For all $i, j \in [e-1]$, $E_{i^{(1)}}=\{v_{i_1^{(1)}}, \dots , v_{i_{e_i}^{(1)}}\}$, $E_{j^{(1)}}=\{v_{j_1^{(1)}}, \dots , v_{j_{e_j}^{(1)}}\}$, if $i_{e_i}^{(1)}+1 < j_1^{(1)}$, we have an edge $E_{i^{(2)}}\in \mathcal{E}$ such that $\{v_{i_{e_i}^{(1)}}, \dots ,v_{j_1^{(1)}}\}$.
\end{itemize}
The first property holds since the algorithm chooses adjacent edges in $\mathcal{E}^{(1)}$ that are disjoint and there is possibly nonempty intersection between $E_{1^{(1)}}$ and $E_{e}$. The second property holds by Lemma~\ref{lemma:full_cover}.
In the first transmission we send the sum of the messages in $\mathcal{E}^{(1)}$, i.e., $\sum_{i=1}^{e} w_i$.
The users who are satisfied are in $\cup_{E_i\in \mathcal{E}^{(1)}} E_i \setminus (E_{1^{(1)}} \cap E_{e})$.
In the network topology hypergraph, these are the users that are ``spanned'' by these edges, excluding the users whose vertices are in $E_{1^{(1)}}\cap E_{e}$ where $E_{1^{(1)}}\cap E_{e}\neq \emptyset$.
Therefore we are left with the users whose
corresponding vertices are contained in $\left(U\setminus(\cup_{\mathcal{E}^{(1)}} E_{i^{(1)}})\right) \cup \left(E_{1^{(1)}}\cap E_{e}\right)$.
\paragraph{Theorem~\ref{thm:circular-arc_optimality}.Step2}
The users who are not satisfied by the first transmission are the users whose side information sets contain either all the chosen messages in Theorem~\ref{thm:circular-arc_optimality}.Step1, or both $w_{1^{(1)}}$ and $w_{e}$.
In other words, in the network topology hypergraph, they are the users who lie ``in between'' the edges, or in the intersection of the first and last edges, in $\mathcal{E}^{(1)}$ chosen in the previous step.
As we have shown in the second property of $\mathcal{E}^{(1)}$ in Theorem~\ref{thm:circular-arc_optimality}.Step1,
for the unsatisfied users between ${E}_{i^{(1)}}\in{\mathcal{E}^{(1)}}$ and ${E}_{ (i+1)^{(1)}}\in{\mathcal{E}^{(1)}}$, there exists an edge ${E}_{i{(2)}}$ that includes all those users.
Therefore, we find a set of edges $\mathcal{E}^{(2)}=\{E_{1^{(2)}},\ldots,E_{{(e-1)}^{(2)}}\}$ such that $U\setminus(\cup_{\mathcal{E}^{(1)}} E_{i^{(1)}})\subseteq \cup_{E_i\in \mathcal{E}^{(2)}}E_i$.
In Fig. \ref{fig:circular_arc_achievability} they are the edges represented by the red dashed arcs.
Note that all edges in $\mathcal{E}^{(2)}$ are pairwise disjoint, since if $E_{i^{(2)}}\cap E_{{i+1}^{(2)}}\neq\emptyset$ then we have $E_{{i}^{(1)}}\subseteq E_{{i-1}^{(2)}}\cup E_{{i}^{(2)}}$, i.e., $|E_{{i}^{(1)}} \setminus (\cup_{j\neq {i}^{(1)}} E_j)|=0$. This is forbidden since we dropped the messages at the beginning of the Step1.
Moreover, $\left( E_{1^{(1)}}\cap E_{e^{1}} \right) \cap E_{1^{(2)}}=\emptyset$ and $\left( E_{1^{(1)}}\cap E_{e^{1}} \right) \cap E_{(e-1)^{(2)}}=\emptyset$ by the same reasoning.
In the second transmission, we send the sum $\left(\sum_{j=1}^{e-1} w_{j^{(2)}}\right)+w_{1^{(1)}}$.
The users that are not satisfied yet by the first transmission have all but one of the messages in $\{w_{1^{{(2)}}},\dots, w_{{k-1}^{(2)}}, w_{1^{(1)}}\}$ in their side information sets.
Therefore all the unsatisfied user after Theorem~\ref{thm:circular-arc_optimality}.Step1 can be satisfied by the second transmission.
All the users are satisfied with two transmissions.
This, together with the converse in Proposition~\ref{prop:l=1_condition}, concludes the proof of Theorem~\ref{thm:circular-arc_optimality}.
\end{IEEEproof}
\section{Conclusion and Future Works}
\label{sec:conclusion}
In this paper we provided tight information theoretic converse bounds for some classes of PICOD$(t)$ problems.
The key idea for our converse is to show that for the PICOD$(t)$ with a certain structure of the side information sets, regardless of the choice of desired message sets at the users, there exists a user that can decode a certain number of messages beside its $t$ desired ones.
We showed two methods to prove the existence of such a user: constructive proof and existence proof.
The constructive proof works for the PICOD$(t)$ with circular-arc network topology hypergraph, and for the complement-consecutive complete--$S$ PICOD$(t)$ with $m$ messages where $S=[0:m-t]\setminus[s_{\rm min}}%{s_{1} : s_{\rm max}}%{s_{2}], 0< s_{\rm min}}%{s_{1}\leq s_{\rm max}}%{s_{2}< m-1$.
The existence proof works for the consecutive complete--$S$ PICOD$(t)$ with $m$ messages where $S=[s_{\rm min} : s_{\rm max}], 0\leq s_{\rm min}}%{s_{1}\leq s_{\rm max}}%{s_{2}\leq m-1$.
The key idea for the existence proof was inspired by the similarity of the side information set structure of the consecutive complete--$\{s\}$ PICOD$(t)$ to Steiner systems in combinatorial design.
Combinatorial design studies the properties of a family of subsets, called blocks, that cover all $s$-element subsets of the same ground set; the results are usually established on the high symmetry of the structure of all $s$-element subsets.
We introduced the idea of block cover as a tool for the converse proof, together with the classical \text{MAIS} for the IC problem. We solved first the critical complete--$\{s\}$ PICOD$(t)$ with $m=2s+t$ messages, where we showed that a block cover with maximum block size strictly less than $m=2s+t$ does not exist.
For the other considered cases, we showed that we can enhance the system to a critical one.
Open problems and future directions include:
\begin{itemize}
\item The main contribution of this work are methods to prove the existence of a user that can decode a certain number of messages: constructive and existence proofs.
While the later shows an advantage over the former on the complexity of the proof, it is based on the strong symmetric structure of the side information set of the users.
Like combinatorial design, for the result to hold we need exactly all the $s$-element subsets of ground set $[m]$.
Therefore, this method suits the complete--$\{s\}$ PICOD$(t)$.
For the other cases, we need some extra tools.
We showed the proof for the consecutive complete--$S$ PICOD$(t)$ by a reduction to the critical case.
However, it appears that not all the PICOD$(t)$, even all complete--$S$ PICOD$(t)$, can be reduced in the same fashion without loss of optimality in terms of the code length.
Therefore we still lack an efficient method to obtain a general optimal converse bound for the general PICOD$(t)$.
In Section~\ref{sub:complete_m<=5} we showed the optimality of the proposed achievability up to $m=5$ for the complete--$S$ PICOD$(t)$.
The converse is obtained by checking all the cases that are not covered by the Theorem~\ref{thm:layer_cont_opt} or Propositions~\ref{prop:max<m/2_nonconsecutive},~\ref{prop:min>m/2_nonconsecutive},~\ref{prop:min<m/2<max_nonconsecutive}.
Therefore the method is not systematic and straightforwardly generalizable to general $m$.
The information theoretical optimal code length for the general complete--$S$ PICOD$(t)$ with $m$ messages is still open.
\item We notice that in the complete--$S$ PICOD$(t)$ considered in this work, removing/adding some users does not change the optimal code length.
In fact, in some cases (e.g., $S=[0:m/2]$) roughly half of the users can be removed without affecting $\ell^*$.
These users can be considered as ``non-critical'',
in contrast to other ``critical'' users who will change the optimal code length if removed/added.
The PICOD$(t)$ is called ``critical'' if all of its users are critical.
We see the ``critical'' consecutive complete--$S$ PICOD$(t)$ are those with $m\geq s_{\rm min}+s_{\rm max}+t$.
In other words, the ones with ``small'' size of side information/number of desired messages.
In this case the optimal code length $s_{\rm max}+t$.
For this setting, removing any single user reduces the optimal code length by 1.
If $m< s_{\rm min}+s_{\rm max}+1$, there are $\sum_{s=s_{\rm min}}^{s_{\rm max}} \binom{m}{s}- \binom{2m - 2{s_{\rm min}} -1}{m-{s_{\rm min}}-1}$ users are non-critical.
It is worth to mention that due to the symmetric structure of the complete--$S$ PICOD$(t)$ where $|S|=1$, all users are essentially the same, i.e., all users are critical if any user is critical.
The question about the critical users in the PICOD$(t)$ is interesting because it shows the redundancy embedded in the system structure.
The condition for a complete--$S$ PICOD$(t)$ to be critical, the number of its non-critical users, and in general, the condition to be critical for the general PICOD$(t)$, are the topics of future works for the PICOD$(t)$.
\item In the PICOD formulation adopted in this work, the server broadcasts information to all users based on the knowledge all messages in the database. Another practically motivated scenario includes peer-to-peer/distributed models where users broadcast information based on their side information set. The converse bounds developed in this work are also converse bounds for peer-to-peer/distributed model with the same parameters. The open question is whether this ``trivial'' converse bound can be achieved. Surprisingly, it appears that for the consecutive and complement-consecutive complete--$S$ PICOD$(t)$ that we have solved, as long as the problem is ``pliable,'' i.e., there are indeed multiple choices of desired messages that satisfy the users, than the tight results in this paper are tight for the peer-to-peer/distributed model.
One of the open questions is to quantify the optimal code length is the non-pliable cases for the complete--$S$ PICOD$(t)$, where the problem reduces to a distributed index coding problem~\cite{distributed_ic}.
\end{itemize}
| {'timestamp': '2018-10-10T02:13:47', 'yymm': '1810', 'arxiv_id': '1810.02451', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02451'} | arxiv |
\section{Approximate Balancedness and Deficiency Margin Under Customary Initialization} \label{app:balance_margin_init}
Two assumptions concerning initialization facilitate our main convergence result (Theorem~\ref{theorem:converge}):
\emph{(i)}~the initial weights $W_1(0),\ldots,W_N(0)$ are approximately balanced (see Definition~\ref{def:balance});
and \emph{(ii)}~the initial end-to-end matrix~$W_{1:N}(0)$ has positive deficiency margin with respect to the target~$\Phi$ (see Definition~\ref{def:margin}).
The current appendix studies the likelihood of these assumptions being met under customary initialization of random (layer-wise independent) Gaussian perturbations centered at zero.
For approximate balancedness we have the following claim, which shows that it becomes more and more likely the smaller the standard deviation of initialization is:
\vspace{1mm}
\begin{claim}
\label{claim:balance_init}
Assume all entries in the matrices $W_j\in\R^{d_j\times{d}_{j-1}}$, $j=1,\ldots,N$, are drawn independently at random from a Gaussian distribution with mean zero and standard deviation~$s>0$.
Then, for any~$\delta>0$, the probability of $W_1,\ldots,W_N$ being $\delta$-balanced is at least~$\max\{0,1-10\delta^{-2}Ns^4d_{max}^3\}$, where $d_{max}:=\max\{d_0,\ldots,d_N\}$.
\end{claim}
\vspace{-3mm}
\begin{proof}
See Appendix~\ref{app:proofs:balance_init}.
\end{proof}
In terms of deficiency margin, the claim below treats the case of a single output model (scalar regression), and shows that if the standard deviation of initialization is sufficiently small, with probability close to~$0.5$, a deficiency margin will be met.
However, for this deficiency margin to meet a chosen threshold~$c$, the standard deviation need be sufficiently large.
\vspace{1mm}
\begin{claim}
\label{claim:margin_init}
There is a constant $C_1 > 0$ such that the following holds. Consider the case where~$d_N=1$, $d_0\geq20$,\note{
The requirement $d_0\geq20$ is purely technical, designed to simplify expressions in the claim.
} and suppose all entries in the matrices $W_j\in\R^{d_j\times{d}_{j-1}}$, $j=1,\ldots,N$, are drawn independently at random from a Gaussian distribution with mean zero, whose standard deviation~$s>0$ is small with respect to the target, \ie~$s\leq \| \Phi\|_F^{1/N} \big/ (10^5 d_0^3d_1 \cdots d_{N-1} C_1)^{1/(2N)}$.
Then, for any~$c$ with $0<c\leq \norm{\Phi}_{F} \big/ \big(10^{5}d_0^{3}C_1(C_{1}N)^{2N}\big)$, the probability of the end-to-end matrix~$W_{1:N}$ having deficiency margin~$c$ with respect to~$\Phi$ is at least~$0.49$ if:\,\footnote{
The probability $0.49$ can be increased to any $p < 1/2$ by increasing the constant $10^5$ in the upper bounds for~$s$ and~$c$.
}
\footnote{
It is not difficult to see that the latter threshold is never greater than the upper bound for~$s$, thus sought-after standard deviations always exist.
}
$$s\geq{c}^{1/(2N)}\cdot\big(C_{1}N\norm{\Phi}_F^{1/(2N)}/(d_1\cdots{d}_{N-1})^{1/(2N)}\big)
\text{~.}$$
\end{claim}
\vspace{-3mm}
\begin{proof}
See Appendix~\ref{app:proofs:margin_init}.
\end{proof}
\section{Convergence Failures} \label{app:fail}
In this appendix we show that the assumptions on initialization facilitating our main convergence result (Theorem~\ref{theorem:converge})~---~approximate balancedness and deficiency margin~---~are both necessary, by demonstrating cases where violating each of them leads to convergence failure.
This accords with widely observed empirical phenomena, by which successful optimization in deep learning crucially depends on careful initialization (\cf~\citet{sutskever2013importance}).
Claim~\ref{claim:diverge_balance} below shows\note{
For simplicity of presentation, the claim treats the case of even depth and uniform dimension across all layers.
It can easily be extended to account for arbitrary depth and input/output/hidden dimensions.
}
that if one omits from Theorem~\ref{theorem:converge} the assumption of approximate balancedness at initialization, no choice of learning rate can guarantee convergence:
\vspace{1mm}
\begin{claim}
\label{claim:diverge_balance}
Assume gradient descent with some learning rate~$\eta>0$ is a applied to a network whose depth~$N$ is even, and whose input, output and hidden dimensions $d_0,\ldots,d_N$ are all equal to some $d\in\N$.
Then, there exist target matrices~$\Phi$ such that the following holds.
For any~$c$ with $0<c< \sigma_{min}(\Phi)$, there are initializations for which the end-to-end matrix~$W_{1:N}(0)$ has deficiency margin~$c$ with respect to~$\Phi$, and yet convergence will fail~---~objective will never go beneath a positive constant.
\end{claim}
\vspace{-3mm}
\begin{proof}
See Appendix~\ref{app:proofs:diverge_balance}.
\end{proof}
In terms of deficiency margin, we provide (by adapting Theorem~4 in~\citet{bartlett2018gradient}) a different, somewhat stronger result~---~there exist settings where initialization violates the assumption of deficiency margin, and despite being perfectly balanced, leads to convergence failure, for any choice of learning rate:\note{
This statement becomes trivial if one allows initialization at a suboptimal stationary point, \eg~$W_j(0)=0,~j=1,\ldots,N$.
Claim~\ref{claim:diverge_margin} rules out such trivialities by considering only non-stationary initializations.
}
\vspace{1mm}
\begin{claim}
\label{claim:diverge_margin}
Consider a network whose depth~$N$ is even, and whose input, output and hidden dimensions $d_0,\ldots,d_N$ are all equal to some $d\in\N$.
Then, there exist target matrices~$\Phi$ for which there are non-stationary initializations $W_1(0),\ldots,W_N(0)$ that are $0$-balanced, and yet lead gradient descent, under any learning rate, to fail~---~objective will never go beneath a positive constant.
\end{claim}
\vspace{-3mm}
\begin{proof}
See Appendix~\ref{app:proofs:diverge_margin}.
\end{proof}
\section{Implementation Details} \label{app:impl}
Below we provide implementation details omitted from our experimental report (Section~\ref{sec:exper}).
The platform used for running the experiments is PyTorch \citep{paszke2017automatic}.
For compliance with our analysis, we applied PCA whitening to the numeric regression dataset from UCI Machine Learning Repository.
That is, all instances in the dataset were preprocessed by an affine operator that ensured zero mean and identity covariance matrix.
Subsequently, we rescaled labels such that the uncentered cross-covariance matrix~$\Lambda_{yx}$ (see Section~\ref{sec:prelim}) has unit Frobenius norm (this has no effect on optimization other than calibrating learning rate and standard deviation of initialization to their conventional ranges).
With the training objective taking the form of Equation~\eqref{eq:loss_whitened}, we then computed~$c$~---~the global optimum~---~in accordance with the formula derived in Appendix~\ref{app:whitened}.
In our experiments with linear neural networks, balanced initialization was implemented with the assignment written in step~\emph{(iii)} of Procedure~\ref{proc:balance_init}.
In the non-linear network experiment, we added, for each $j\in\{1,\ldots,N-1\}$, a random orthogonal matrix to the right of~$W_j$, and its transpose to the left of~$W_{j+1}$~---~this assignment maintains the properties required from balanced initialization (see Footnote~\ref{note:balance_init_props}).
During all experiments, whenever we applied grid search over learning rate, values between $10^{-4}$ and~$1$ (in regular logarithmic intervals) were tried.
\section{Deferred Proofs} \label{app:proofs}
We introduce some additional notation here
in addition to the notation specified in Section~\ref{sec:prelim}. We use~$\norm{A}_\sigma$ to denote the spectral norm (largest singular value) of a matrix~$A$, and sometimes~$\norm{\vv}_2$ as an alternative to~$\norm{\vv}$~---~the Euclidean norm of a vector~$\vv$.
Recall that for a matrix $A$, $vec(A)$ is its vectorization in column-first order.
We let $F(\cdot)$ denote the cumulative distribution function of the standard normal distribution, \ie~$F(x) = \int_{-\infty}^x\frac{1}{\sqrt{2\pi}}e^{-\frac12u^2}du$ ($x\in\R$).
To simplify the presentation we will oftentimes use~$W$ as an alternative (shortened) notation for~$W_{1:N}$~---~the end-to-end matrix of a linear neural network.
We will also use~$L(\cdot)$ as shorthand for~$L^1(\cdot)$~---~the loss associated with a (directly parameterized) linear model, \ie~$L(W) := \frac12\norm{W-\Phi}_F^2$.
Therefore, in the context of gradient descent training a linear neural network, the following expressions all represent the loss at iteration $t$:
\[
\ell(t)=L^N(W_1(t),\ldots,W_N(t))=L^1(W_{1:N}(t)) = L^1(W(t)) = L(W(t)) = \frac12\norm{W(t)-\Phi}_F^2\,.
\]
Also, for weights $W_j\in\R^{d_j\times{d}_{j-1}}$, $j=1,\ldots,{N}$ of a linear neural network, we generalize the notation~$W_{1:N}$, and define $W_{j:j'}:=W_{j'}W_{j'-1}\cdots{W}_j$ for every $1\leq{j}\leq{j'}\leq{N}$.
Note that $W_{j:j'}^{\top}=W_{j}^{\top}W_{j+1}^{\top}\cdots{W}_{j'}^{\top}$.
Then, by a simple gradient calculation, the gradient descent updates (\ref{eq:gd}) can be written as
\begin{equation}
\label{eq:wjupdate}
W_j(t+1) = W_j(t) - \eta W_{j+1:N}^\top(t) \cdot \frac{dL}{dW}(W(t)) \cdot W_{1:j-1}^\top(t) \quad , 1\le j \le N\,,
\end{equation}
where we define $W_{1:0}(t) := I_{d_0}$ and $W_{N+1:N}(t) := I_{d_N}$ for completeness.
Finally, recall the standard definition of the tensor product of two matrices (also known as the Kronecker product):
for matrices $A \in \BR^{m_A \times n_A}, B \in \BR^{m_B \times n_B}$, their tensor product $A \otimes B \in \BR^{m_A m_B \times n_A n_B}$ is defined as
$$
A \otimes B = \left ( \begin{matrix}
a_{1,1} B& \cdots &a_{1,n_A} B \\
\vdots & \ddots & \vdots \\
a_{m_A,1} B & \cdots & a_{m_A,n_A} B
\end{matrix} \right),
$$
where $a_{i,j}$ is the element in the $i$-th row and $j$-th column of $A$.
\subsection{Proof of Claim~\ref{claim:margin_interp}} \label{app:proofs:margin_interp}
\begin{proof}
Recall that for any matrices $A$ and~$B$ of compatible sizes $\sigma_{min}(A+B)\geq\sigma_{min}(A)-\sigma_{max}(B)$, and that the Frobenius norm of a matrix is always lower bounded by its largest singular value (\citet{horn1990matrix}).
Using these facts, we have:
\beas
&&\sigma_{min}(W')=\sigma_{min}\big(\Phi+(W'-\Phi)\big)\geq\sigma_{min}(\Phi)-\sigma_{max}(W'-\Phi) \\[0.5mm]
&&~\qquad\qquad\geq\sigma_{min}(\Phi)-\norm{W'-\Phi}_F\geq\sigma_{min}(\Phi)-\norm{W-\Phi}_F \\[1mm]
&&~\qquad\qquad\geq\sigma_{min}(\Phi)-(\sigma_{min}(\Phi)-c)=c\,.
\eeas
\end{proof}
\subsection{Proof of Lemma~\ref{lemma:descent}} \label{app:proofs:descent}
To prove Lemma \ref{lemma:descent}, we will in fact prove a stronger result, Lemma \ref{lem:remainsmooth} below, which states that for each iteration $t$, in addition to (\ref{eq:descent}) being satisfied, certain other properties are also satisfied, namely:
\emph{(i)} the weight matrices $W_1(t), \ldots, W_N(t)$ are $2\delta$-balanced, and
\emph{(ii)} $W_1(t), \ldots, W_N(t)$ have bounded spectral norms.
\begin{lemma}
\label{lem:remainsmooth}
Suppose the conditions of Theorem \ref{theorem:converge} are satisfied. Then for all $t \in \BN \cup \{0\}$,
\begin{enumerate}
\item[($\MA(t)$)] For $1 \leq j \leq N-1$, $\| W_{j+1}^\top(t) W_{j+1}(t) - W_j(t) W_j^\top(t) \|_F \leq 2\delta$.
\item[($\MA'(t)$)] If $t \geq 1$, then for $1 \leq j \leq N-1$,
\begin{eqnarray}
\label{eq:sumbalancet}
&&\| W_{j+1}^\top(t) W_{j+1}(t) - W_j(t) W_j^\top(t) \|_F \nonumber\\
&\leq& \| W_{j+1}^\top(t-1) W_{j+1}(t-1) - W_j(t-1) W_j^\top(t-1) \|_F \nonumber \\
&& + \eta^2 \left\| \frac{dL^1}{dW} W(t-1)\right\|_F \cdot \left\| \frac{dL^1}{dW} W(t-1) \right\|_\sigma \cdot 4 \cdot (2 \| \Phi\|_F)^{2(N-1)/N}\nonumber.
\end{eqnarray}
\item[($\MB(t)$)] If $t = 0$, then $\ell(t) \leq \frac 12 \| \Phi\|_F^2$. If $t \geq 1$, then \begin{equation*}
\ell(t) \leq
\ell(t-1) -\frac \eta 2 \sigma_{min}(W(t-1))^{\frac{2(N-1)}{N}} \left\| \frac{dL^1}{dW} (W(t-1)) \right\|_F^2.\quad
\end{equation*}
\item[($\MC(t)$)] For $1 \leq j \leq N$, $\| W_j(t) \|_\sigma \leq (4 \| \Phi\|_F)^{1/N}$.
\end{enumerate}
\end{lemma}
First we observe that Lemma \ref{lemma:descent} is an immediate consequence of Lemma \ref{lem:remainsmooth}.
\begin{proof}[Proof of Lemma \ref{lemma:descent}]
Notice that condition $\MB(t)$ of Lemma \ref{lem:remainsmooth} for each $t \geq 1$ immediately establishes the conclusion of Lemma \ref{lemma:descent} at time step $t-1$.
\end{proof}
\subsubsection{Preliminary lemmas}
We next prove some preliminary lemmas which will aid us in the proof of Lemma \ref{lem:remainsmooth}. The first is a matrix inequality that follows from Lidskii's theorem. For a matrix $A$, let $\Sing(A)$ denote the rectangular diagonal matrix {of the same size,} whose diagonal elements are the singular values of $A$ arranged in non-increasing order (starting from the $(1,1)$ position).
\begin{lemma}[\cite{bhatia_matrix_1997}, Exercise IV.3.5]
\label{lemma:bhatiaexc}
For any two matrices $A,B$ of the same size, $\| \Sing(A) - \Sing(B) \|_\sigma \leq \| A-B \|_\sigma$ and $\| \Sing(A) - \Sing(B) \|_F \leq \| A-B\|_F$.
\end{lemma}
Using Lemma \ref{lemma:bhatiaexc}, we get:
\begin{lemma}
\label{lem:rearrange}
Suppose $D_1, D_2 \in \BR^{d \times d}$ are non-negative diagonal matrices with non-increasing values along the diagonal and $O \in \BR^{d \times d}$ is an orthogonal matrix. Suppose that $\| D_1 - OD_2O^\top\|_F \leq \ep$, for some $\ep > 0$. Then:
\begin{enumerate}
\item $\| D_1 - OD_1O^\top \|_F \leq 2\ep$.
\item $\| D_1 - D_2 \|_F \leq \ep$.
\end{enumerate}
\end{lemma}
\begin{proof}
Since $D_1$ and $OD_2O^T$ are both symmetric positive semi-definite matrices, their singular values are equal to their eigenvalues. Moreover, the singular values of $D_1$ are simply its diagonal elements and the singular values of $OD_2O^T$ are simply the diagonal elements of $D_2$. Thus by Lemma \ref{lemma:bhatiaexc} we get that $\|D_1 - D_2 \|_F \leq \| D_1 - OD_2O^T\|_F \leq \ep$. Since the Frobenius norm is unitarily invariant, $\| D_1 - D_2 \|_F = \| OD_1O^T - OD_2O^T \|_F$, and by the triangle inequality it follows that
\begin{align*}
\| D_1 - OD_1O^T\|_F \leq \| OD_1O^T - OD_2O^T\|_F + \| D_1 - OD_2O^T\|_F \leq 2\ep.
\end{align*}
\end{proof}
Lemma \ref{lem:boundcommute} below states that if $W_1, \ldots, W_N$ are approximately balanced matrices, \ie~$W_{j+1}^\top W_{j+1} - W_j W_j^\top$ has small Frobenius norm for $1 \leq j \leq N-1$, then we can bound the Frobenius distance between $W_{1:j}^\top W_{1:j}$ and $(W_1^\top W_1)^j$ (as well as between $W_{j:N}W_{j:N}^\top$ and $(W_NW_N^\top)^{N-j+1}$).
\begin{lemma}
\label{lem:boundcommute}
Suppose that $d_N \leq d_{N-1}, d_0 \leq d_1$, and that for some $\nu > 0,M>0$, the matrices $W_j \in \BR^{d_j \times d_{j-1}}$, $1 \leq j \leq N$ satisfy, for $1 \leq j \leq N-1$,
\begin{equation}
\label{eq:pcndiff}
\| W_{j+1}^\top W_{j+1} - W_j W_j^\top \|_F \leq \nu,
\end{equation}
and for $1 \leq j \leq N$, $\| W_j\|_\sigma \leq M$. Then, for $1 \leq j \leq N$,
\begin{equation}
\label{eq:wj1w}
\| W_{1:j}^\top W_{1:j} - (W_1^\top W_1)^{j} \|_F \leq \frac 32 \nu \cdot M^{2(j-1)} j^2,
\end{equation}
and
\begin{equation}
\label{eq:wjnw}
\| W_{j:N} W_{j:N}^\top - (W_NW_N^\top)^{N-j+1}\|_F \leq \frac 32 \nu \cdot M^{2(N-j)} (N-j+1)^2.
\end{equation}
Moreover, if $ \sigma_{min}$ denotes the minimum singular value of $W_{1:N}$, $\sigma_{1,min}$ denotes the minimum singular value of $W_1$ and $\sigma_{N,min}$ denotes the minimum singular value of $W_N$, then
\begin{equation}
\label{eq:singvallb}
\sigma_{min}^2 - \frac 32 \nu M^{2(N-1)} N^2 \leq
\begin{cases}
\sigma_{N,min}^{2N} \quad : \quad d_N \geq d_0.\\
\sigma_{1,min}^{2N} \quad : \quad d_N \leq d_0.
\end{cases}
\end{equation}
\end{lemma}
\begin{proof}
For $1 \leq j \leq N$, let us write the singular value decomposition of $W_j$ as $W_j = U_j \Sigma_j V_j^\top$, where $U_j\in \BR^{d_j\times d_j}$ and $V_j\in \BR^{d_{j-1}\times d_{j-1}}$ are orthogonal matrices and $\Sigma_j\in \BR^{d_j\times d_{j-1}}$ is diagonal. We may assume without loss of generality that the singular values of $W_j$ are non-increasing along the diagonal of $\Sigma_j$. Then we can write (\ref{eq:pcndiff}) as
$$
\| V_{j+1}\Sigma_{j+1}^\top \Sigma_{j+1} V_{j+1}^\top - U_j \Sigma_j \Sigma_j^\top U_j^\top \|_F \leq \nu.
$$
Since the Frobenius norm is invariant to orthogonal transformations, we get that
$$
\| \Sigma_{j+1}^\top\Sigma_{j+1} - V_{j+1}^\top U_j \Sigma_j \Sigma_j^\top U_j^\top V_{j+1} \|_F \leq \nu.
$$
By Lemma \ref{lem:rearrange}, we have that $\| \Sigma_{j+1}^\top \Sigma_{j+1} - \Sigma_j \Sigma_j^\top \|_F \leq \nu$ and $\| \Sigma_j \Sigma_j^\top - V_{j+1}^\top U_j \Sigma_j \Sigma_j^\top U_j^\top V_{j+1} \|_F \leq 2\nu$. We may rewrite the latter of these two inequalities as
$$
\| [\Sigma_j \Sigma_j^\top ,V_{j+1}^\top U_j] \|_F = \| [\Sigma_j \Sigma_j^\top, V_{j+1}^\top U_j]U_j^\top V_{j+1} \|_F =\| \Sigma_j \Sigma_j^\top- V_{j+1}^\top U_j \Sigma_j \Sigma_j^\top U_j^\top V_{j+1} \|_F \leq 2\nu.
$$
Note that
$$
W_{j:N} W_{j:N}^\top = W_{j+1:N} U_j\Sigma_j\Sigma_j^\top U_j^\top W_{j+1:N}^\top.
$$
For matrices $A,B$, we have that $\| AB\|_F \leq \| A \|_\sigma \cdot \| B \|_F$. Therefore, for $j+1 \leq i \leq N$, we have that
\begin{eqnarray}
&& \| W_{i:N} U_{i-1} (\Sigma_{i-1} \Sigma_{i-1}^\top)^{i-j} U_{i-1}^\top W_{i:N}^\top - W_{i+1:N} U_{i} (\Sigma_{i}\Sigma_{i}^\top)^{i-j+1} U_{i}^\top W_{i+1:N}^\top\|_F \nonumber\\
& =& \| W_{i+1:N}U_{i} \left(\Sigma_{i}V_{i}^\top U_{i-1} (\Sigma_{i-1} \Sigma_{i-1}^\top)^{i-j} U_{i-1}^\top V_{i}\Sigma_{i}^\top - (\Sigma_{i}\Sigma_{i}^\top)^{i-j+1} \right) U_{i}^\top W_{i+1:N}^\top \|_F \nonumber\\
&\leq& \| W_{i+1:N} U_{i}\Sigma_{i}\|_\sigma^2 \cdot \| (\Sigma_{i-1} \Sigma_{i-1}^\top)^{i-j} + [V_{i}^\top U_{i-1}, (\Sigma_{i-1}\Sigma_{i-1}^\top)^{i-j}]U_{i-1}^\top V_{i} - (\Sigma_{i}^\top\Sigma_{i})^{i-j}\|_F\nonumber\\
& \leq & \| W_{i:N}\|_\sigma^2 \left( \| [V_{i}^\top U_{i-1}, (\Sigma_{i-1} \Sigma_{i-1}^\top)^{i-j}]\|_F + \| (\Sigma_{i-1}\Sigma_{i-1}^\top)^{i-j} - (\Sigma_{i}^\top \Sigma_{i})^{i-j}\|_F\right)\nonumber.
\end{eqnarray}
Next, we have that
\begin{eqnarray}
\| [V_{i}^\top U_{i-1}, (\Sigma_{i-1} \Sigma_{i-1}^\top)^{i-j}]\|_F & \leq & \sum_{k=0}^{i-j-1} \| (\Sigma_{i-1} \Sigma_{i-1}^\top)^k [V_i^\top U_{i-1}, \Sigma_{i-1} \Sigma_{i-1}^\top]( \Sigma_{i-1} \Sigma_{i-1}^\top)^{i-j-1-k}\|_F \nonumber\\
& \leq & \sum_{k=0}^{i-j-1} \| (\Sigma_{i-1} \Sigma_{i-1}^\top)^{i-j-1}\|_\sigma \cdot \| [V_i^\top U_{i-1} ,\Sigma_{i-1} \Sigma_{i-1}^\top]\|_F\nonumber\\
& \leq & (i-j) \| W_{i-1} \|_\sigma^{2(i-j-1)} \cdot 2\nu\nonumber.
\end{eqnarray}
We now argue that $\| (\Sigma_{i-1}\Sigma_{i-1}^\top)^k - (\Sigma_i^\top \Sigma_i)^k\|_F \leq \nu \cdot kM^{2(k-1)}$. Note that $\| \Sigma_{i-1} \Sigma_{i-1}^\top - \Sigma_i^\top \Sigma_i\|_F \leq \nu$, verifying the case $k=1$. To see the general case, since square diagonal matrices commute, we have that
\begin{eqnarray}
\| (\Sigma_{i-1}\Sigma_{i-1}^\top)^k - (\Sigma_i^\top \Sigma_i)^k\|_F&=& \left\| (\Sigma_{i-1}\Sigma_{i-1}^\top - \Sigma_i^\top \Sigma_i)\cdot \left( \sum_{\ell=0}^{k-1} (\Sigma_{i-1}\Sigma_{i-1}^\top)^\ell (\Sigma_i^\top \Sigma_i)^{k-1-\ell}\right)\right\|_F\nonumber\\
& \leq & \nu \cdot \sum_{\ell=0}^{k-1} \| W_{i-1}\|_\sigma^{2\ell} \cdot \| W_i\|_\sigma^{2(k-\ell-1)}\nonumber\\
& \leq & \nu k M^{2(k-1)}\nonumber.
\end{eqnarray}
It then follows that
\begin{eqnarray}
&& \| W_{i:N} U_{i-1} (\Sigma_{i-1} \Sigma_{i-1}^\top)^{i-j} U_{i-1}^\top W_{i:N}^\top - W_{i+1:N} U_{i} (\Sigma_{i}\Sigma_{i}^\top)^{i-j+1} U_{i}^\top W_{i+1:N}^\top\|_F \nonumber\\
& \leq & \| W_{i:N}\|_\sigma^2 \cdot \left((i-j) M^{2(i-j-1)} \cdot 2\nu + \nu(i-j) M^{2(i-j-1)}\right)\nonumber\\
& = & \| W_{i:N}\|_\sigma^2 \cdot 3\nu (i-j) M^{2(i-j-1)}\nonumber.
\end{eqnarray}
By the triangle inequality, we then have that
\begin{eqnarray}
&& \| W_{j:N}W_{j:N}^\top - U_N (\Sigma_N \Sigma_N^\top)^{N-j+1} U_N^\top\|_F\nonumber\\
& \leq & \nu \sum_{i=j+1}^N \| W_{i:N}\|_\sigma^2 \cdot 3(i-j) M^{2(i-j-1)}\nonumber\\
& \leq & 3\nu \sum_{i=j+1}^N (i-j) M^{2(N-i+1)} M^{2(i-j-1)}\nonumber\\
\label{eq:diffN}
&=& 3\nu M^{2(N-j)} \sum_{i=j+1}^N (i-j) \leq \frac 32 \nu \cdot M^{2(N-j)} \cdot (N-j+1)^2.
\end{eqnarray}
By an identical argument (formally, by replacing $W_j$ with $W_{N-j+1}^\top$), we get that
\begin{equation}
\label{eq:diff1}
|| W_{1:j}^\top W_{1:j} - V_1 (\Sigma_1^\top \Sigma_1)^{j} V_1^\top\|_F \leq \frac 32\nu \cdot M^{2(j-1)} \cdot j^2.
\end{equation}
(\ref{eq:diffN}) and (\ref{eq:diff1}) verify (\ref{eq:wjnw}) and (\ref{eq:wj1w}), respectively, so it only remains to verify (\ref{eq:singvallb}).
Letting $j=1$ in (\ref{eq:diffN}), we get
\begin{equation}
\label{eq:w1nundiff}
\| W_{1:N}W_{1:N}^\top - U_N(\Sigma_N \Sigma_N^\top)^{N} U_N^\top\|_F \leq \frac 32\nu \cdot M^{2(N-1)} \cdot N^2.
\end{equation}
Let us write the eigendecomposition of $W_{1:N}W_{1:N}^\top$ with an orthogonal eigenbasis as $W_{1:N}W_{1:N}^\top = U \Sigma U^\top$, where $\Sigma$ is diagonal with its (non-negative) elements arranged in non-increasing order and $U$ is orthogonal. We can write the left hand side of (\ref{eq:w1nundiff}) as $\| U \Sigma U^\top - U_N(\Sigma_N \Sigma_N^\top)^N U_N^\top\|_F = \| \Sigma - U^\top U_N (\Sigma_N \Sigma_N^\top)^N U_N^\top U\|_F$.
By Lemma \ref{lem:rearrange}, we have that
\begin{equation}
\label{eq:ntildediff}
\| \Sigma - (\Sigma_N\Sigma_N^\top)^N \|_F \leq \frac 32 \nu M^{2(N-1)} N^2.
\end{equation}
Recall that $W \in \BR^{d_N \times d_0}$. Suppose first that $d_N \leq d_0$. Let $\sigma_{min}$ denote the minimum singular value of $W_{1:N}$ (so that $\sigma_{min}^2$ is the element in the $(d_N, d_N)$ position of $ \Sigma \in \BR^{d_N \times d_N}$), and $\sigma_{N,min}$ denote the minimum singular value (i.e. diagonal element) of $\Sigma_N$, which lies in the $(d_N, d_N)$ position of $\Sigma_N$. (Note that the $(d_N, d_N)$ position of $\Sigma_N \in \BR^{d_N \times d_{N-1}}$ exists since $d_{N-1} \geq d_N$ by assumption.) Then
$$
(\sigma_{N,min}^{2N} - \sigma_{min}^2)^2 \leq \left(\frac 32 \nu M^{2(N-1)} N^2\right)^2,
$$
so
$$
\sigma_{N,min}^{2N} \geq \sigma_{min}^2 - {\frac 32 \nu M^{2(N-1)} N^2}.
$$
By an identical argument using (\ref{eq:diff1}), we get that, in the case that $d_0 \leq d_N$, if $\sigma_{1,min}$ denotes the minimum singular value of $\Sigma_1$, then
$$
\sigma_{1,min}^{2N} \geq \sigma_{min}^2 - \frac{3}{2} \nu M^{2(N-1)} N^2.
$$
(Notice that we have used the fact that the nonzero eigenvalues of $W_{1:N}W_{1:N}^\top$ are the same as the nonzero eigenvalues of $W_{1:N}^\top W_{1:N}$.) This completes the proof of (\ref{eq:singvallb}).
\end{proof}
Using Lemma \ref{lem:boundcommute}, we next show in Lemma \ref{lem:boundindiv} that if {$W_1,\ldots,W_N$ are approximately balanced,}
then an upper bound on $\| W_N \cdots W_1\|_\sigma$ implies an upper bound on $\| W_j\|_\sigma$ for $1 \leq j \leq N$.
\begin{lemma}
\label{lem:boundindiv}
Suppose $\nu, C$ are real numbers satisfying $C > 0$ and $0 < \nu \leq \frac{ C^{2/N}}{30 N^2}$. Moreover suppose that the matrices $W_1, \ldots, W_N$ satisfy the following:
\begin{enumerate}
\item For $1 \leq j \leq N-1$, $\| W_{j+1}^\top W_{j+1} - W_j W_j^\top \|_F \leq \nu$.
\item $\| W_N \cdots W_1 \|_\sigma \leq C$.
\end{enumerate}
Then for $1 \leq j \leq N$, $\| W_j\|_\sigma \leq C^{1/N} \cdot 2^{1/(2N)}$.
\end{lemma}
\begin{proof}
For $1 \leq j \leq N$, let us write the singular value decomposition of $W_j$ as $W_j = U_j \Sigma_j V_j^\top$, where the singular values of $W_j$ are decreasing along the main diagonal of $\Sigma_j$. By Lemma \ref{lem:rearrange}, we have that for $1 \leq j \leq N-1$, $\| \Sigma_{j+1}^\top \Sigma_{j+1} - \Sigma_j \Sigma_j^\top \|_F \leq \nu$, which implies
that $\left|\| \Sigma_{j+1}^\top \Sigma_{j+1}\|_\sigma -\| \Sigma_j \Sigma_j^\top \|_\sigma \right| \leq \nu$.
Write $M = \max_{1 \leq j \leq N} \| W_j\|_\sigma = \max_{1 \leq j \leq N} \| \Sigma_j \|_\sigma$. By the above we have that $\| \Sigma_j \Sigma_j^\top\|_\sigma \geq M^2 - N\nu$ for $1 \leq j \leq N$.
Let the singular value decomposition of $W_{1:N}$ be denoted by $W_{1:N} = U\Sigma V^\top$, so that $\| \Sigma \|_\sigma \leq C$. Then by (\ref{eq:wjnw}) of Lemma \ref{lem:boundcommute} and Lemma \ref{lem:rearrange} (see also (\ref{eq:ntildediff}), where the same argument was used), we have that
$$
\| \Sigma\Sigma^\top - (\Sigma_N \Sigma_N^\top)^N \|_F\leq \frac 32 \nu M^{2(N-1)}N^2.
$$
Then
\begin{equation}
\label{eq:sigman1}
\| (\Sigma_N \Sigma_N^\top)^N\|_\sigma \leq \|\Sigma\Sigma^\top\|_\sigma + \frac 32 \nu M^{(2(N-1))}N^2 \leq \| \Sigma \Sigma^\top \|_\sigma + \frac 32 \nu \left( \| \Sigma_N \Sigma_N^\top\|_\sigma + \nu N\right)^{N-1} N^2.
\end{equation}
Now recall that $\nu$ is chosen so that $\nu \leq \frac{ C^{2/N}}{30 \cdot N^2}.$ Suppose for the purpose of contradiction that there is some $j$ such that $\| W_jW_j^\top \|_\sigma > 2^{1/N} C^{2/N}$. Then it must be the case that
\begin{equation}
\label{eq:2nabove}
\| \Sigma_N \Sigma_N^\top\|_\sigma > 2^{1/N} C^{2/N} - \nu \cdot N \geq (5/4)^{1/N} C^{2/N} > \nu \cdot 30N^2,
\end{equation}
where we have used that
$$
2^{1/N} - (5/4)^{1/N} \geq \frac{1}{30N}
$$
for all $N \geq 2$, which follows by considering the Laurent series $\exp(1/z) = \sum_{i=1}^\infty \frac{1}{i! z^i}$, which converges in $|z| > 0$ for $z \in \BC$.
We now rewrite inequality (\ref{eq:2nabove}) as
\begin{equation}
\label{eq:boundepcontr}
\nu \leq \frac{\| \Sigma_N \Sigma_N^\top\|_\sigma}{30N^2}.
\end{equation}
Next, using (\ref{eq:boundepcontr}) and $(1+1/x)^x \leq e$ for all $x > 0$,
\begin{equation}
\label{eq:sigman2}
\frac 32 \nu \left( \| \Sigma_N \Sigma_N^\top\|_\sigma + \nu N\right)^{N-1} N^2 \leq \frac{e^{1/30}}{20} \cdot \| \Sigma_N \Sigma_N^\top \|_\sigma^{N} < \frac{e}{20} \cdot \| \Sigma_N \Sigma_N^\top \|_\sigma^{N}.
\end{equation}
Since $\| (\Sigma_N \Sigma_N^\top)^N \|_\sigma = \| \Sigma_N \Sigma_N^\top\|_\sigma^N$, we get by combining (\ref{eq:sigman1}) and (\ref{eq:sigman2}) that
$$
\| \Sigma_N \Sigma_N^\top \|_\sigma < (1-e/20)^{-1/N} \cdot \| \Sigma \Sigma^\top\|_\sigma^{1/N} \leq (1-e/20)^{-1/N} \cdot C^{2/N},
$$
and since $1-e/20 > 1/(5/4)$, it follows that $\| \Sigma_N \Sigma_N^\top\|_\sigma < (5/4)^{1/N} C^{2/N}$, which contradicts (\ref{eq:2nabove}). It follows that for all $1 \leq j \leq N$, $\| W_j W_j^\top \|_\sigma \leq 2^{1/N} C^{2/N}$. The conclusion of the lemma then follows from the fact that $\| W_j W_j^\top\|_\sigma = \| W_j\|_\sigma^2$.
\end{proof}
\subsubsection{Single-Step Descent}
Lemma~\ref{lem:boundgdupdate} below states that if certain conditions on $W_1(t),\ldots,W_N(t)$ are met, the sought-after descent~---~Equation~\eqref{eq:descent}~---~will take place at iteration~$t$.
We will later show (by induction) that the required conditions indeed hold for every~$t$, thus the descent persists throughout optimization.
The proof of Lemma~\ref{lem:boundgdupdate} is essentially a discrete, single-step analogue of the continuous proof for Lemma~\ref{lemma:descent} (covering the case of gradient flow) given in Section~\ref{sec:converge}.
\begin{lemma}
\label{lem:boundgdupdate}
Assume the conditions of Theorem~\ref{theorem:converge}.
Moreover, suppose that for some $t$, the matrices $W_1(t), \ldots, W_N(t)$ and the end-to-end matrix $W(t) := W_{1:N}(t)$ satisfy the following properties:
\begin{enumerate}
\item $\| W_j(t)\|_\sigma \leq (4 \| \Phi\|_F)^{1/N}$ for $1 \leq j \leq N$.
\item $\| W(t) - \Phi\|_\sigma \leq \| \Phi\|_F$.
\item $\| W_{j+1}^\top(t) W_{j+1}(t) - W_j(t)W_j^\top(t)\|_F \leq 2\delta$ for $1 \leq j \leq N-1$.
\item ${\sigma}_{min}:={\sigma}_{min}(W(t)) \geq c$.
\end{enumerate}
Then, after applying a gradient descent update (\ref{eq:gd}) we have that
$$
L(W(t+1)) - L(W(t)) \leq - \frac \eta 2 \sigma_{min}^{2(N-1)/N} \left\| \frac{dL}{dW}(W(t)) \right\|_F^2.
$$
\end{lemma}
\begin{proof}
For simplicity write $M = (4 \| \Phi\|_F)^{1/N}$ and $B = \| \Phi\|_F$. We first claim that
{\small\begin{equation}
\label{eq:assumeeta}
\eta \leq \min \left\{ \frac{1}{2M^{N-2}BN}, \frac{\sigma_{min}^{2(N-1)/N}}{24 \cdot 2 M^{3N-4} N^2B}, \frac{\sigma_{min}^{2(N-1)/N}}{24N^2 M^{4(N-1)}}, \frac{\sigma_{min}^{2(N-1)/(3N)}}{ \left(24 \cdot 4M^{6N-8}N^4B^2 \right)^{1/3}}\right\}.
\end{equation}}
Since $c \leq \sigma_{min}$, for (\ref{eq:assumeeta}) to hold it suffices to have
\begin{eqnarray}
\eta &\leq& \min \left\{ \frac{1}{8 \| \Phi\|_F^{(2N-2)/N} N}, \frac{c^{2(N-1)/N}}{3 \cdot 2^{11} \| \Phi\|_F^{4(N-1)/N} N^2},\frac{c^{2(N-1)/(3N)}}{3 \cdot 2^6 \left(\| \Phi\|_F^{(8N-8)/N}\right)^{1/3} N^{4/3}}\right\}\nonumber.
\end{eqnarray}
As the minimum singular value of $\Phi$ must be at least $c$, we must have $c \leq \| \Phi\|_\sigma$. Since then $\frac{c}{\| \Phi\|_F} \leq \frac{c}{\| \Phi\|_\sigma} \leq 1$, it holds that
$$
\frac{c^{2(N-1)/N}}{\| \Phi\|_F^{4(N-1)/N}} \leq \min \left\{ \frac{1}{\| \Phi\|_F^{2(N-1)/N}}, \frac{c^{2(N-1)/(3N)}}{\| \Phi\|_F^{(8N-8)/(3N)}} \right\},
$$
meaning that it suffices to have
$$
\eta \leq \frac{ c^{2(N-1)/N}}{3 \cdot 2^{11} N^2 \| \Phi\|_F^{4(N-1)/N}},
$$
which is guaranteed by (\ref{eq:descent_eta}).
Next, we claim that
\begin{eqnarray}
\label{eq:assumeep}
2\delta &\leq &\min \left\{ \frac{ c^{2(N-1)/N}}{8 \cdot 2^4N^3 \| \Phi\|_F^{2(N-2)/N}}, \frac{c^{2}}{6 \cdot 2^4 N^2 \| \Phi\|_F^{2(N-1)/N}}\right\}\\
& \leq & \min \left\{ \frac{ \sigma_{min}^{2(N-1)/N}}{8N^3M^{2(N-2)}}, \frac{\sigma_{min}^{2}}{6N^2 M^{2(N-1)}}\right\} .\nonumber
\end{eqnarray}
The second inequality above is trivial, and for the first to hold, since $c \le \| \Phi\|_F$, it suffices to take
$$
2\delta \leq \frac{c^2}{128 \cdot N^3 \cdot \| \Phi\|_F^{2(N-1)/N}},
$$
which is guaranteed by the definition of $\delta$ in Theorem \ref{theorem:converge}.
Next we continue with the rest of the proof.
It follows from (\ref{eq:wjupdate}) that\footnote{Here, for matrices $A_1, \ldots, A_K$ such that $A_K A_{K-1} \cdots A_1$ is defined, we write $\prod_{1}^{j=K} A_j := A_K A_{K-1} \cdots A_1$.
}
\begin{eqnarray}
&& W(t+1) - W(t) \nonumber\\
&=& \prod_{1}^{j=N} \left( W_j(t) - \eta W_{j+1:N}^\top(t) \frac{dL}{dW}(W(t)) W_{1:j-1}^\top(t) \right) - W_{1:N}(t)\nonumber\\
\label{eq:wt1wt}
&=& -\eta \left(\sum_{j=1}^N W_{j+1:N}W_{j+1:N}^\top(t) \frac{dL}{dW}(W(t)) W_{1:j-1}^\top(t) W_{1:j-1}(t)\right) + (\star),
\end{eqnarray}
where $(\star)$ denotes higher order terms in $\eta$. We now bound the Frobenius norm of $(\star)$. To do this, note that since $L(W) = \frac 12 \| W - \Phi\|_F^2$, $\frac{dL}{dW}(W(t)) = W(t) - \Phi$. Then
\begin{eqnarray}
\| (\star) \|_F & \leq & \sum_{k=2}^N \eta^k \cdot M^{k(N-1) + N-k} \cdot \left\| \frac{dL}{dW}(W(t)) \right\|_F \cdot \left\| \frac{dL}{dW}(W(t)) \right\|_\sigma^{k-1} \cdot {N \choose k}\nonumber\\
& \leq & \eta M^{2N-2}N \left\| \frac{dL}{dW}(W(t)) \right\|_F \sum_{k=2}^N \left(\eta M^{N-2} BN\right)^{k-1}\nonumber\\
\label{eq:starnorm}
& \leq & \eta \cdot (2\eta M^{3N-4} N^2B) \cdot \left\| \frac{dL}{dW}(W(t)) \right\|_F,
\end{eqnarray}
where the last inequality uses $\eta M^{N-2} BN \leq 1/2$, which is a consequence of (\ref{eq:assumeeta}). Next, by Lemma \ref{lem:boundcommute} with $\nu = 2\delta$,
{\small\begin{eqnarray}
&& \left\|\sum_{j=1}^N W_{j+1:N}W_{j+1:N}^\top(t) \frac{dL}{dW}(W(t)) W_{1:j-1}^\top(t) W_{1:j-1}(t) \right.\nonumber\\
&&- \left. \sum_{j=1}^N (W_NW_N^\top)^{N-j} \frac{dL}{dW}(W(t)) (W_1^\top W_1)^{j-1} \right\|_F\nonumber\\
& \leq & \left\|\sum_{j=1}^N (W_{j+1:N}W_{j+1:N}^\top(t) - (W_NW_N^\top)^{N-j}) \frac{dL}{dW}(W(t)) W_{1:j-1}^\top(t) W_{1:j-1}(t) \right\|_F \nonumber\\
& + & \left\| \sum_{j=1}^N (W_NW_N^\top)^{N-j} \frac{dL}{dW}(W(t)) (W_{1:j-1}^\top W_{1:j-1} - (W_1^\top W_1)^{j-1})\right\|_F\nonumber\\
& \leq & \left\| \frac{dL}{dW}(W(t)) \right\|_F \cdot \left(\sum_{j=1}^{N-1} \frac 32 2\delta \cdot M^{2(N-j)}(N-j)^2 M^{2(j-1)} + \sum_{j=2}^N \frac 32 2\delta \cdot M^{2(j-2)}(j-1)^2 M^{2(N-j)}\right)\nonumber\\
& \leq & \left\| \frac{dL}{dW}(W(t)) \right\|_F \cdot 2\delta N^3 M^{2(N-2)}\nonumber.
\end{eqnarray}}
Next, by standard properties of tensor product, we have that
\begin{eqnarray}
&& vec\left(\sum_{j=1}^N (W_NW_N^\top)^{N-j} \frac{dL}{dW}(W(t)) (W_1^\top W_1)^{j-1} \right)\nonumber\\
&=& \sum_{j=1}^N \left( (W_1^\top W_1)^{j-1} \otimes (W_NW_N^\top)^{N-j} \right)vec \left( \frac{dL}{dW}(W(t))\right)\nonumber.
\end{eqnarray}
Let us write eigenvalue decompositions $W_1^\top W_1 = UDU^\top, W_NW_N^\top = VEV^\top$. Then
\begin{eqnarray}
&& \sum_{j=1}^N \left( (W_1^\top W_1)^{j-1} \otimes (W_NW_N^\top)^{N-j} \right)\nonumber\\
&=& \sum_{j=1}^N \left( UD^{j-1}U^\top \otimes VE^{N-j} V^\top \right)\nonumber\\
&=& (U \otimes V) \left(\sum_{j=1}^N D^{j-1} \otimes E^{N-j}\right) (U \otimes V)^\top\nonumber\\
&=& O\Lambda O^\top\nonumber,
\end{eqnarray}
with $O = U \otimes V$, and $\Lambda = \sum_{j=1}^N D^{j-1} \otimes E^{N-j}$. As $W_1 \in \BR^{d_1 \times d_0}$, and $W_N \in \BR^{d_N \times d_{N-1}}$, then $D \in \BR^{d_0 \times d_0}, E \in \BR^{d_N \times d_N}$, so $\Lambda \in \BR^{d_0d_N \times d_0d_N}$. Moreover note that $\Lambda \succeq D^0 \otimes E^{N-1} + D^{N-1} \otimes E^0 = I_{d_0} \otimes E^{N-1} + D^{N-1} \otimes I_{d_N}$. If $\lambda_D$ denotes the minimum diagonal element of $D$ and $\lambda_E$ denotes the minimum diagonal element of $E$, then the minimum diagonal element of $\Lambda$ is therefore at least $\lambda_D^{N-1} + \lambda_E^{N-1}$. But, it follows from Lemma \ref{lem:boundcommute} (with $\nu = 2\delta$) that
$$
\max\{ \lambda_D^{N}, \lambda_E^{N} \} \geq \sigma_{min}^2 - \frac 32 2\delta M^{2(N-1)} N^2 \geq 3\sigma_{min}^2/4,
$$
where the second inequality follows from (\ref{eq:assumeep}). Hence the minimum diagonal element of $\Lambda$ is at least $( \sigma_{min}^2/(4/3))^{(N-1)/N} \geq \sigma_{min}^{2(N-1)/N}/(4/3)$.
It follows as a result of the above inequalities that if we write $E(t) = vec(W(t+1)) - vec(W(t)) + \eta (O\Lambda O^\top) vec\left( \frac{dL}{dW}(W(t)) \right)$, then
\begin{eqnarray}
\| E(t) \|_2 & = &\left\| vec(W(t+1)) - vec(W(t)) + \eta (O\Lambda O^\top) vec\left( \frac{dL}{dW}(W(t)) \right) \right\|_2\nonumber\\
&\leq & \eta \left\| \frac{dL}{dW}(W(t)) \right\|_F \cdot (2\eta M^{3N-4} N^2B + 2\delta N^3 M^{2(N-2)}) \nonumber.
\end{eqnarray}
Then we have
{\small\begin{eqnarray}
&& L(W(t+1)) - L(W(t)) \nonumber\\
& \leq & vec\left( \frac{d}{dW} L(W(t)) \right)^\top vec \left( W(t+1) - W(t) \right) + \frac 12 \| W(t+1) - W(t) \|_F^2\nonumber\\
& = & \eta \left( - vec\left(\frac{d}{dW} L(W(t))\right)^\top (O\Lambda O^\top) vec \left(\frac{d}{dW} L(W(t)) \right) + \frac{1}{\eta}vec\left(\frac{d}{dW} L(W(t))\right)^\top E(t) \right) \nonumber\\
&& + \frac 12 \| W(t+1) - W(t) \|_F^2\nonumber\\
& \leq & \eta \left(-\left\| \frac{d}{dW} L(W(t)) \right\|_F^2 \cdot \frac{ \sigma_{min}^{2(N-1)/N}}{4/3} + \left\| \frac{d}{dW} L(W(t)) \right\|_F^2 \cdot \left(2\eta M^{3N-4} N^2B + 2\delta N^3 M^{2(N-2)}\right) \right) \nonumber\\
&& + \frac 12 \| W(t+1) - W(t) \|_F^2\nonumber,
\end{eqnarray}}
where the first inequality follows since $L(W) = \frac 12 \| W - \Phi\|_F^2$ is $1$-smooth as a function of $W$. Next, by (\ref{eq:wt1wt}) and (\ref{eq:starnorm}),
\begin{eqnarray}
&& \| W(t+1) - W(t) \|_F^2 \nonumber\\
& \leq & 2\eta^2 \cdot \left(N M^{2(N-1)} \cdot \left\| \frac{dL}{dW}(W(t)) \right\|_F\right)^2 + 2\eta^2 \cdot (2\eta M^{3N-4} N^2B)^2 \cdot \left\| \frac{dL}{dW}(W(t)) \right\|_F^2\nonumber\\
\label{eq:boundwtwt1}
& = &2 \eta^2 \left\| \frac{dL}{dW}(W(t)) \right\|_F^2 \cdot \left( N^2M^{4(N-1)} + (4\eta^2 M^{6N-8} N^4B^2)\right).
\end{eqnarray}
Thus
\begin{eqnarray}
&& L(W(t+1)) - L(W(t))\nonumber\\
& \leq & \eta \cdot \left\| \frac{dL}{dW}(W(t)) \right\|_F^2 \cdot \left( -\frac{\sigma_{min}^{2(N-1)/N}}{4/3} + 2\eta M^{3N-4} N^2B + 2\delta N^3 M^{2(N-2)} \right.\nonumber\\
&& \left. + \eta \cdot (N^2M^{4(N-1)} + 4\eta^2 M^{6N-8}N^4B^2) \right)\nonumber.
\end{eqnarray}
By (\ref{eq:assumeeta}, \ref{eq:assumeep}), which bound $\eta, 2\delta$, respectively, we have that
{\small\begin{eqnarray}
\label{eq:descentl}
&&L(W(t+1)) - L(W(t))\nonumber\\
& \leq& \eta \cdot \left\| \frac{dL}{dW}(W(t)) \right\|_F^2 \cdot \left( -\frac{\sigma_{min}^{2(N-1)/N}}{4/3} + \frac{\sigma_{min}^{2(N-1)/N}}{24} + \frac{\sigma_{min}^{2(N-1)/N}}{8} + \frac{\sigma_{min}^{2(N-1)/N}}{24} + \frac{\sigma_{min}^{2(N-1)/N}}{24} \right)\nonumber\\
&=& - \frac 12 \sigma_{min}^{2(N-1)/N} \eta \left\| \frac{dL}{dW}(W(t)) \right\|_F^2.
\end{eqnarray}}
\end{proof}
\subsubsection{Proof of Lemma \ref{lem:remainsmooth}}
\begin{proof}[Proof of Lemma \ref{lem:remainsmooth}]
We use induction on $t$, beginning with the base case $t=0$. Since the weights $W_1(0), \ldots, W_N(0)$ are $\delta$-balanced, we get that $\MA(0)$ holds automatically. To establish $\MB(0)$, note that since $W_{1:N}(0)$ has deficiency margin $c > 0$ with respect to $\Phi$, we must have $\| W_{1:N}(0) - \Phi \|_F \leq \sigma_{min}(\Phi) \leq \|\Phi\|_F$, meaning that $L^1(W_{1:N}(0)) \leq \frac 12 \| \Phi\|_F^2$.
Finally, by $\MB(0)$, which gives $\| W(0) - \Phi\|_F \leq \| \Phi\|_F$, we have that
\begin{equation}
\label{eq:boundprod0}
\| W(0) \|_\sigma \leq \| W(0) \|_F \leq \| W(0) - \Phi\|_F + \| \Phi\|_F \leq 2 \| \Phi\|_F.
\end{equation}
To show that the above implies $\MC(0)$, we use condition $\MA(0)$ and Lemma \ref{lem:boundindiv} with $C = 2 \| \Phi\|_F$ and $\nu = 2\delta$. By the definition of $\delta$ in Theorem \ref{theorem:converge} and since $c \leq \| \Phi\|_F$, we have that
\begin{equation}
\label{eq:epltc}
2\delta \leq \frac{c^2}{128 \cdot N^3 \cdot \| \Phi\|_F^{2(N-1)/N}} = \frac{\| \Phi\|_F^{2/N}}{128N^3} \cdot \frac{c^2}{\| \Phi\|_F^2}< \frac{\| \Phi\|_F^{2/N}}{30 N^2},
\end{equation}
as required by Lemma \ref{lem:boundindiv}.
As $\MA(0)$ and (\ref{eq:boundprod0}) verify the preconditions 1.~and 2., respectively, of Lemma \ref{lem:boundindiv}, it follows that for $1 \leq j \leq N$, $\| W_j(t) \|_\sigma \leq (2 \| \Phi\|_F)^{1/N} \cdot 2^{1/(2N)} < (4 \| \Phi\|_F)^{1/N}$, verifying $\MC(0)$ and completing the proof of the base case.
The proof of Lemma \ref{lem:remainsmooth} follows directly from the following inductive claims.
\begin{enumerate}
\item $\MA(t), \MB(t), \MC(t) \Rightarrow \MB(t+1)$. To prove this, we use Lemma \ref{lem:boundgdupdate}. We verify first that the preconditions hold.
First, $\MC(t)$ immediately gives condition 1.~of Lemma \ref{lem:boundgdupdate}. By $\MB(t)$, we have that $\| W(t) - \Phi\|_\sigma \leq \| W(t) - \Phi\|_F \leq \| \Phi\|_F$, giving condition 2.~of Lemma \ref{lem:boundgdupdate}. $\MA(t)$ immediately gives condition 3.~of Lemma \ref{lem:boundgdupdate}. Finally, by $\MB(t)$, we have that $L^N(W_1(t), \ldots, W_N(t)) \leq L^N(W_1(0), \ldots, W_N(0))$, so $\sigma_{min}(W_{1:N}(t)) \geq c$ by Claim \ref{claim:margin_interp}. This verifies condition 4.~of Lemma \ref{lem:boundgdupdate}. Then Lemma \ref{lem:boundgdupdate} gives that $L^N(W_{1}(t+1), \ldots, W_N(t+1)) \leq L^N(W_1(t), \ldots, W_N(t)) - \frac 12 \sigma_{min}(W(t))^{2(N-1)/N} \eta \left\| \frac{dL}{dW}(W(t)) \right\|_F^2$, establishing $\MB(t+1)$.
\item $\MA(0), \MA'(1), \ldots, \MA'(t), \MA(t), \MB(0), \ldots, \MB(t), \MC(t) \Rightarrow \MA(t+1), \MA'(t+1)$. To prove this, note that for $1 \leq j \leq N-1$,
\begin{eqnarray}
&& W_{j+1}^\top(t+1) W_{j+1}(t+1) - W_j(t+1) W_j^\top(t+1)\nonumber\\
&=& \left( W_{j+1}^\top(t) - \eta W_{1:j}(t) \frac{dL}{dW}(W(t))^\top W_{j+2:N}(t) \right) \nonumber\\
&& \cdot \left( W_{j+1}(t) - \eta W_{j+2:N}^\top(t) \frac{dL}{dW}(W(t)) W_{1:j}^\top(t) \right)\nonumber\\
&&- \left( W_j(t) - \eta W_{j+1:N}^\top(t) \frac{dL}{dW}(W(t)) W_{1:j-1}^\top(t) \right)\nonumber\\
&& \cdot \left( W_j^\top(t) - \eta W_{1:j-1}(t) \frac{dL}{dW}(W(t))^\top W_{j+1:N}(t) \right)\nonumber.
\end{eqnarray}
By $\MB(0), \ldots, \MB(t)$, $\| W_{1:N}(t) - \Phi \|_F \leq \| \Phi\|_F$. By the triangle inequality it then follows that $\| W_{1:N}(t)\|_\sigma \leq 2 \| \Phi\|_F$. Also $\MA(t)$ gives that for $1 \leq j \leq N-1$, $\| W_{j}(t) W_j^\top(t) - W_{j+1}^\top(t) W_{j+1}(t) \|_F \leq 2\delta$. By Lemma \ref{lem:boundindiv} with $C = 2 \| \Phi\|_F, \nu = 2\delta$ (so that (\ref{eq:epltc}) is satisfied),
\begin{eqnarray}
&& \left\| W_{j+1}^\top(t+1) W_{j+1}(t+1) - W_j(t+1) W_j^\top(t+1) \right\|_F\nonumber\\
& \leq & \| W_{j+1}^\top(t) W_{j+1}(t) - W_j(t) W_j^\top(t) \|_F + \eta^2 \left\| \frac{dL}{dW}(W(t)) \right\|_F \cdot \left\| \frac{dL}{dW}(W(t)) \right\|_\sigma \nonumber\\
&& \cdot \left( \| W_{j+2:N}(t)\|_\sigma^2 \| W_{1:j}(t) \|_\sigma^2 + \| W_{1:j-1}\|_\sigma^2 \|W_{j+1:N} \|_\sigma^2\right)\nonumber\\
\label{eq:wtwt1diverge}
& \leq & \| W_{j+1}^\top(t) W_{j+1}(t) - W_j(t) W_j^\top(t) \|_F \nonumber\\
&& + 4\eta^2 \left\| \frac{dL}{dW}(W(t)) \right\|_F \left\| \frac{dL}{dW}(W(t)) \right\|_\sigma (2 \| \Phi\|_F)^{2(N-1)/N}.
\end{eqnarray}
In the first inequality above, we have also used the fact that for matrices $A, B$ such that $AB$ is defined, $\| AB\|_F \leq \| A \|_\sigma \| B \|_F$. (\ref{eq:wtwt1diverge}) gives us $\MA'(t+1)$.
We next establish $\MA(t+1)$. By $\MB(i)$ for $0 \leq i \leq t$, we have that $\left\| \frac{dL}{dW}(W(i)) \right\|_F = \left\| W - \Phi \right\|_F \leq \| \Phi\|_F$. Using $\MA'(i)$ for $0 \leq i \leq t$ and summing over $i$ gives
\begin{eqnarray}
&& \| W_{j+1}^\top(t+1) W_{j+1}(t+1) - W_j(t+1) W_j^\top(t+1) \|_F\nonumber\\
\label{eq:hybridep}
& \leq & \| W_{j+1}^\top(0) W_{j+1}(0) - W_j(0) W_j^\top(0) \|_F \nonumber\\
&& + 4 (2 \| \Phi\|_F)^{2(N-1)/N} \cdot \eta^2 \sum_{i=0}^{t} \left\| \frac{dL}{dW}(W(i)) \right\|_F^2.
\end{eqnarray}
Next, by $\MB(0), \ldots, \MB(t)$, we have that $L(W(i)) \leq L(W(0))$ for $i \leq t$. Since $W(0)$ has deficiency margin of $c$ and by Claim \ref{claim:margin_interp}, it then follows that $\sigma_{min}(W(i)) \geq c$ for all $i \leq t$. Therefore, by summing $\MB(0), \ldots, \MB(t)$,
\begin{eqnarray}
&& \frac{1}{2} c^{2(N-1)/N} \eta\sum_{i=0}^t \left\| \frac{dL}{dW} W(i) \right\|_F^2\nonumber\\
& \leq & \frac 12 \eta \sum_{i=0}^t \sigma_{min}(W(i))^{2(N-1)/N} \left\| \frac{dL}{dW} (W(i)) \right\|_F^2\nonumber\\
& \leq & L(W(0)) - L(W(t))\nonumber\\
& \leq & L(W(0)) \leq \frac 12 \| \Phi\|_F^2\nonumber.
\end{eqnarray}
Therefore,
\begin{eqnarray}
&&4 \left( 2 \| \Phi\|_F\right)^{2(N-1)/N} \eta^2 \sum_{i=0}^t \left\| \frac{dL}{dW} W(i)\right\|_F^2 \nonumber\\
& \leq & 16 \| \Phi\|_F^{2(N-1)/N} \eta \frac{\| \Phi\|_F^2}{c^{2(N-1)/N}}\nonumber\\
\label{eq:sumetagrad}
& \leq & 16 \| \Phi\|_F^{2(N-1)/N} \cdot \frac{1}{3 \cdot 2^{11} \cdot N^3} \cdot \frac{c^{(4N-2)/N}}{\| \Phi\|_F^{(6N-4)/N}} \cdot \frac{\| \Phi\|_F^2}{c^{2(N-1)/N}}\\
& \leq & \frac{c^2}{256 N^3 \| \Phi\|_F^{2(N-1)/N}}\nonumber\\
& = & \delta\nonumber,
\end{eqnarray}
where \eqref{eq:sumetagrad} follows from the definition of $\eta$ in (\ref{eq:descent_eta}), and the last equality follows from definition of $\delta$ in Theorem \ref{theorem:converge}.
By (\ref{eq:hybridep}), it follows that
$$
\| W_{j+1}^\top(t+1) W_{j+1}(t+1) - W_j(t+1) W_j^\top(t+1) \|_F \leq 2\delta,
$$
verifying $\MA(t+1)$.
\item $ \MA(t), \MB(t) \Rightarrow \MC(t)$. We apply Lemma \ref{lem:boundindiv} with $\nu = 2\delta$ and $C = 2 \| \Phi\|_F$. First, the triangle inequality and $\MB(t)$ give
$$
\| W_{1:N}(t) \|_\sigma \leq \| \Phi\|_\sigma + \| \Phi - W_{1:N}(t) \|_\sigma \leq \| \Phi\|_F + \sqrt{2 \cdot L(W_{1:N}(t))} \leq 2 \| \Phi\|_F,
$$
verifying precondition 2.~of Lemma \ref{lem:boundindiv}. $\MA(t)$ verifies condition 1.~of Lemma \ref{lem:boundindiv}, so for $1 \leq j \leq N$, $\| W_j(t) \|_\sigma \leq (4 \| \Phi\|_F)^{1/N}$, giving $\MC(t)$.
\end{enumerate}
The proof of Lemma \ref{lem:remainsmooth} then follows by induction on $t$.
\end{proof}
\subsection{Proof of Theorem~\ref{theorem:converge_balance_init}} \label{app:proofs:converge_balance_init}
Theorem \ref{theorem:converge_balance_init} is proven by combining Lemma \ref{lem:integrate_rad} below, which implies that the balanced initialization is likely to lead to an end-to-end matrix $W_{1:N}(0)$ with sufficiently large deficiency margin, with Theorem~\ref{theorem:converge}, which establishes convergence.
\begin{lemma}
\label{lem:integrate_rad}
Let $d \in \BN, d \geq 20$; $b_2 > b_1 \geq 1$ be real numbers (possibly depending on $d$); and $\Phi \in \BR^d$ be a vector. Suppose that $\mu$ is a rotation-invariant distribution\footnote{Recall that a distribution on vectors $V \in \BR^d$ is {\it rotation-invariant} if the distribution of $V$ is the same as the distribution of $OV$, for any orthogonal $d \times d$ matrix $O$. If $V$ has a well-defined density, this is equivalent to the statement that for any $r > 0$, the distribution of $V$ conditioned on $\| V\|_2 = r$ is uniform over the sphere centered at the origin with radius $r$.} over $\BR^d$ with a well-defined density, such that, for some $0 < \ep < 1$,
$$
\pr_{V \sim \mu} \left[ \frac{\| \Phi\|_2}{\sqrt{b_2d}} \leq \| V \|_2 \leq \frac{\| \Phi\|_2}{\sqrt{b_1d}}\right] \geq 1-\ep.
$$
Then, with probability at least $(1-\ep) \cdot \frac{3 - 4F(2/\sqrt{b_1})}{2}$, $V$ will have deficiency margin $\| \Phi\|_2 / (b_2d)$ with respect to $\Phi$.
\end{lemma}
The proof of Lemma~\ref{lem:integrate_rad} is postponed to Appendix~\ref{app:proofs:margin_init}, where Lemma~\ref{lem:integrate_rad} will be restated as Lemma~\ref{lem:integrate_rad_restate}.
One additional technique is used in the proof of Theorem \ref{theorem:converge_balance_init}, which leads to an improvement in the guaranteed convergence rate. Because the deficiency margin of $W_{1:N}(0)$ is very small, namely $\OO(\| \Phi\|_2/d_0)$ (which is necessary for the theorem to maintain constant probability), at the beginning of optimization, $\ell(t)$ will decrease very slowly. However, after a certain amount of time, the deficiency margin of $W_{1:N}(t)$ will increase to a constant, at which point the decrease of $\ell(t)$ will be much faster. To capture this acceleration, we apply Theorem~\ref{theorem:converge} a second time, using the larger deficiency margin at the new ``initialization.'' From a geometric perspective, we note that the matrices $W_1(0), \ldots, W_N(0)$ are very close to 0, and the point at which $W_j(0) = 0$ for all $j$ is a saddle. Thus, the increase in $\ell(t) - \ell(t+1)$ over time captures the fact that the iterates $(W_1(t), \ldots, W_N(t))$ escape a saddle point.
\begin{proof}[Proof of Theorem \ref{theorem:converge_balance_init}]
Choose some $a \geq 2$, to be specified later.
By assumption, all entries of the end-to-end matrix at time 0, $W_{1:N}(0)$, are distributed as independent Gaussians of mean 0 and standard deviation $s \leq \|\Phi\|_2/\sqrt{ad_0^2}$. We will apply Lemma~\ref{lem:integrate_rad} to the vector $W_{1:N}(0) \in \BR^{d_0}$.
Since its distribution is obviously rotation-invariant, in remains to show that the distribution of the norm $\| W_{1:N}(0) \|_2$ is not too spread out. The following lemma~---~a direct consequence of the Chernoff bound applied to the $\chi^2$ distribution with $d_0$ degrees of freedom~---~will give us the desired result:
\begin{lemma}[\cite{laurent_adaptive_2000}, Lemma 1]
\label{lem:laurent}
Suppose that $d \in \BN$ and $V \in \BR^d$ is a vector whose entries are i.i.d.~Gaussians with mean 0 and standard deviation $s$. Then, for any $k > 0$,
\begin{eqnarray}
\pr\left[\| V \|_2^2 \geq s^2 \left(d + 2k + 2\sqrt{kd} \right) \right] &\leq& \exp(-k)\nonumber\\
\pr\left[\| V \|_2^2 \leq s^2 \left( d - 2\sqrt{kd} \right) \right] & \leq & \exp(-k)\nonumber.
\end{eqnarray}
\end{lemma}
By Lemma \ref{lem:laurent} with $k = d_0/16$, we have that
$$
\pr\left[ \frac{s^2 d_0}{2} \leq \| V \|_2^2 \leq 2s^2 d_0\right] \geq 1 - 2 \exp(-d_0/16).
$$
We next use Lemma \ref{lem:integrate_rad}, with $b_1 = \| \Phi\|_2^2/(2s^2d_0^2), b_2 = 2\| \Phi\|_2^2/(s^2d_0^2)$; note that since $a \geq 2$, $b_1 \geq 1$, as required by the lemma. Lemma \ref{lem:integrate_rad} then implies that with probability at least
\be
\label{eq:expF}
\left(1 - 2\exp(-d_0/16) \right) \frac{3-4F\left(2/\sqrt{a/2}\right)}{2},
\ee
$W_{1:N}(0)$ will have deficiency margin ${s^2d_0}/{2\| \Phi\|_2}$
with respect to $\Phi$. By the definition of balanced initialization (Procedure~\ref{proc:balance_init}) $W_1(0), \ldots, W_N(0)$ are $0$-balanced. Since $2^4 \cdot 6144 < 10^5$, our assumption on $\eta$ gives
\begin{equation}
\label{eq:eta_single_output}
\eta \leq \frac{(s^2d_0)^{4-2/N}}{2^4 \cdot 6144N^3 \| \Phi\|_2^{10-6/N}},
\end{equation}
so that Equation~(\ref{eq:descent_eta}) holds with $c = \frac{s^2d_0}{2\|\Phi\|_2}$.
The conditions of Theorem \ref{theorem:converge} thus hold with probability at least that given in Equation~(\ref{eq:expF}). In such a constant probability event, by Theorem \ref{theorem:converge} (and the fact that a positive deficiency margin implies $L^1(W_{1:N}(0))\leq\frac{1}{2}\| \Phi\|_2^2$), if we choose
\begin{equation}
\label{eq:t0lb}
t_0 \geq \eta^{-1} \left( \frac{ 2\| \Phi\|_2}{s^2d_0} \right)^{2-2/N} \ln(4),
\end{equation}
then $L^1(W_{1:N}(t_0)) \leq \frac 18 \| \Phi\|_2^2 $, meaning that $\| W_{1:N}(t_0) - \Phi\|_2 \leq \frac 12 \| \Phi\|_2 = \| \Phi\|_2 - \frac 12 \sigma_{min}(\Phi)$. Moreover, by condition $\MA(t_0)$ of Lemma \ref{lem:remainsmooth} and the definition of $\delta$ in Theorem \ref{theorem:converge}, we have, for $1 \leq j \leq N-1$,
\begin{equation}
\label{eq:balanced_single_output}
\| W_{j+1}^T(t_0) W_{j+1}(t_0) - W_j(t_0) W_j^T(t_0) \|_F \leq
\frac{2s^4d_0^2}{(2\| \Phi\|_2)^2 \cdot 256 N^3 \| \Phi\|_2^{2-2/N}} = \frac{s^4 d_0^2}{512 N^3 \| \Phi\|_2^{4-2/N}}.
\end{equation}
We now apply Theorem \ref{theorem:converge} again, verifying its conditions again, this time with the initialization $(W_1(t_0), \ldots, W_N(t_0))$. First note that the end-to-end matrix $W_{1:N}(t_0)$ has deficiency margin $c = \| \Phi\|_2/2$ as shown above. The learning rate $\eta$, by Equation~(\ref{eq:eta_single_output}), satisfies Equation~(\ref{eq:descent_eta}) with $c = \| \Phi\|_2/2$. Finally, since
$$
\frac{s^4 d_0^2}{512 N^3 \| \Phi\|_2^{4-2/N}} \leq \frac{\|\Phi\|^{2/N}}{(a^2d_0^2) \cdot 512 N^3} \leq \frac{\| \Phi\|^{2/N}(1/2)^2}{256 N^3}
$$
for $d_0 \geq 2$, by Equation~(\ref{eq:balanced_single_output}), the matrices $W_1(t_0), \ldots, W_N(t_0)$ are $\delta$-balanced with $\delta = \frac{\| \Phi\|^{2/N}(1/2)^{2}}{256 N^3}$.
Iteration~$t_0$ thus satisfies the conditions of Theorem~\ref{theorem:converge} with deficiency margin $\| \Phi\|_2/2$, meaning that for
\be
\label{eq:tmt0lb}
T - t_0 \geq \eta^{-1} \cdot 2^{2-2/N} \cdot \| \Phi\|^{2/N-2} \ln\left( \frac{\| \Phi\|_2^2}{8\ep} \right),
\ee
we will have $\ell(T) \leq \ep$. Therefore, by Equations~(\ref{eq:t0lb}) and~(\ref{eq:tmt0lb}), to ensure that $\ell(T) \leq \ep$, we may take
$$
T \geq 4\eta^{-1} \left( \ln(4) \left(\frac{\|\Phi\|_2}{s^2d_0}\right)^{2-2/N} + \| \Phi\|_2^{2/N-2}\ln(\| \Phi\|_2^2/(8\ep)) \right).
$$
Recall that this entire analysis holds only with the probability given in Equation~(\ref{eq:expF}). As $\lim_{d \ra \infty} (1-2\exp(-d/16)) = 1$ and $\lim_{a \ra \infty} (3 - 4F(2\sqrt{2/a}))/2 = 1/2$, for any $0 < p < 1/2$, there exist $a, d_0' > 0$ such that for $d_0 \geq d_0'$, the probability given in Equation~(\ref{eq:expF}) is at least $p$. This completes the proof.
\end{proof}
In the context of the above proof, we remark that the expressions $1- 2\exp(-d_0/16)$ and $(3 - 4F(2\sqrt{2/a}))/2$ converge to their limits of $1$ and $1/2$, respectively, as $d_0,a \ra \infty$ quite quickly. For instance, to obtain a probability of greater than $0.25$ of the initialization conditions being met, we may take $d_0 \geq 100, a \geq 100$.
\subsection{Proof of Claim~\ref{claim:balance_init}} \label{app:proofs:balance_init}
We first consider the probability of $\delta$-balancedness holding between any two layers:
\begin{lemma}
\label{lem:abvarbound}
Suppose $a,b,d \in \BN$ and $A \in \BR^{a \times d}, B \in \BR^{d \times b}$ are matrices whose entries are distributed as i.i.d.~Gaussians with mean 0 and standard deviation $s$. Then for $k \geq 1$,
\begin{equation}
\label{eq:abd}
\pr\left[ \left\|A^TA - BB^T\right\|_F \geq ks^2 \sqrt{2d(a+b)^2 + d^2(a+b)} \right] \leq 1/k^2.
\end{equation}
\end{lemma}
\begin{proof}
Note that for $1 \leq i,j \leq d$, let $X_{ij}$ be the random variable $(A^TA - BB^T)_{ij}$, so that $$X_{ij} = (A^TA - BB^T)_{ij} = \sum_{1 \leq \ell \leq a} A_{\ell i} A_{\ell j} - \sum_{1 \leq r \leq b} B_{ir} B_{jr}.$$
If $i \neq j$, then $$\ex[X^2] = \sum_{1 \leq \ell \leq a} \ex[A_{\ell i}^2 A_{\ell j}^2] + \sum_{1 \leq r \leq b} \ex[B_{ir}^2 B_{jr}^2]=(a+b)s^4.$$ We next note that for a normal random variable $Y$ of variance $s^2$ and mean 0, $\ex[Y^4] = 3s^4$. Then if $i = j$,
$$
\ex[X^2] = s^4 \cdot (3(a+b) + a(a-1) + b(b-1) {-} ab) \leq s^4((a+b)^2 + 2(a+b)).
$$
Thus
\begin{eqnarray}
\ex[\| A^TA - BB^T\|_F^2] &{\leq}& s^4(d((a+b)^2 + 2(a+b)) + d(d-1)(a+b)) \nonumber\\
&\leq & s^4(2d(a+b)^2 + d^2(a+b))\nonumber.
\end{eqnarray}
Then (\ref{eq:abd}) follows from Markov's inequality.
\end{proof}
Now the proof of Claim \ref{claim:balance_init} follows from a simple union bound:
\begin{proof}[Proof of Claim \ref{claim:balance_init}]
By (\ref{eq:abd}) of Lemma \ref{lem:abvarbound}, for each $1 \leq j \leq N-1$, $k \geq 1$,
$$
\pr\left[ \| W_{j+1}^T W_{j+1} - W_jW_j^T \|_F {\geq} ks^2 \sqrt{10d_{max}^3} \right] \leq 1/k^2.
$$
By the union bound,
$$
\pr \left[ \forall 1 \leq j \leq N-1, \ \ \| W_{j+1}^T W_{j+1} - W_jW_j^T \|_F \leq ks^2 \sqrt{10d_{max}^3} \right] \geq 1-N/k^2,
$$
and the claim follows with $\delta = ks^2 \sqrt{10d_{max}^3}$.
\end{proof}
\subsection{Proof of Claim~\ref{claim:margin_init}} \label{app:proofs:margin_init}
We begin by introducing some notation. Given $d \in \BN$ and $r > 0$, we let $B^d(r)$ denote the open ball of radius $r$ centered at the origin in $\BR^d$. For an open subset $U \subset \BR^d$, let $\partial U := \bar U \backslash U$ be its boundary, where $\bar U$ denotes the closure of $U$. For the special case of $U = B^d(r)$, we will denote by $S^d(r)$ the boundary of such a ball, i.e.~the sphere of radius $r$ centered at the origin in $\BR^d$. Let $S^d := S^d(1)$ and $B^d := B^d(1)$. There is a well-defined uniform (Haar) measure on $S^d(r)$ for all $d, r$, which we denote by $\sigma^{d,r}$; we assume $\sigma^{d,r}$ is normalized so that $\sigma^{d,r}(S^d(r)) = 1$.
Finally, since in the context of this claim we have~$d_N=1$, we allow ourselves to regard the end-to-end matrix $W_{1:N}\in\R^{1\times{d}_0}$ as both a matrix and a vector.
\medskip
To establish Claim \ref{claim:margin_init}, we will use the following low-degree anti-concentration result of \cite{carbery_distributional_2001} (see also \cite{lovett_elementary_2010,meka_anti-concentration_2016}):
\begin{lemma}[\cite{carbery_distributional_2001}]
\label{lem:carbery}
There is an absolute constant $C_{{0}}$ such that the following holds. Suppose that ${h}$ is a multilinear polynomial of $K$ variables $X_1, \ldots, X_K$ and of degree $N$. Suppose that $X_1, \ldots, X_K$ are i.i.d.~Gaussian. Then, for any $\epsilon>0$:
$$
\mathbb{P} \left[|{h}(X_1, \ldots, X_K)| \leq \ep \cdot \sqrt{\Var[{h}(X_1, \ldots, X_K)]}\right] \leq C_{{0}} N\ep^{1/N}.
$$
\end{lemma}
The below lemma characterizes the norm of the end-to-end matrix~$W_{1:N}$ following zero-centered Gaussian initialization:
\begin{lemma}
\label{lem:norm_concentrate}
For any constant $0 < C_2 < 1$, there is an absolute constant $C_1 > 0$ such that the following holds. Let $N, d_0, \ldots, d_{N-1} \in \BN$. Set $d_N = 1$. Suppose that for $1 \leq j \leq N$, $W_j \in \BR^{d_j \times d_{j-1}}$ are matrices whose entries are i.i.d.~Gaussians of standard deviation $s$ and mean 0. Then
$$
\pr\left[ s^{2N} d_1 \cdots d_{N-1} \left( \frac{1}{C_1N} \right)^{2N} \leq \| W_{1:N}\|_2^2 \leq C_1d_0^2 d_1 \cdots d_{N-1} s^{2N} \right] \geq C_2.
$$
\end{lemma}
\begin{proof}
Let $f(W_1, \ldots, W_N) = \| W_{1:N}\|_2^2$, so that $f$ is a polynomial of degree $2N$ in the entries of $W_1, \ldots, W_N$. Notice that
$$
f(W_1, \ldots, W_N) = \sum_{i_0 = 1}^{d_0} \left( \sum_{i_1=1}^{d_1} \cdots \sum_{i_{N-1} = 1}^{d_{N-1}} (W_N)_{1,i_{N-1}} (W_{N-1})_{i_{N-1}, i_{N-2}} \cdots (W_1)_{i_1, i_0} \right)^2.
$$
For $1 \leq i_0 \leq d_0$, set
$$
g_{i_0}(W_1, \ldots, W_N) = \sum_{i_1=1}^{d_1} \cdots \sum_{i_{N-1} = 1}^{d_{N-1}} (W_N)_{1,i_{N-1}} (W_{N-1})_{i_{N-1}, i_{N-2}} \cdots (W_1)_{i_1, i_0},
$$
so that $f = \sum_{i_0 = 1}^{d_0} g_{i_0}^2$. Since each $g_{i_0}$ is a multilinear polynomial in $W_1,\ldots,W_N$, we have that $\ex[g_{i_0}(W_1, \ldots, W_N)] = 0$ for all $1 \leq i_0 \leq d_0$. Also
\begin{eqnarray}
\Var[g_{i_0}(W_1, \ldots, W_N)] &=& \ex[g_{i_0}(W_1, \ldots, W_N)^2]\nonumber\\
&=& \sum_{i_1=1}^{d_1} \cdots \sum_{i_{N-1} = 1}^{d_{N-1}} \ex\left[ (W_N)_{1,i_{N-1}}^2 (W_{N-1})_{i_{N-1}, i_{N-2}}^2 \cdots (W_1)_{i_1, i_0}^2 \right]\nonumber\\
&=& d_1 d_2 \cdots d_{N-1} s^{2N} \nonumber.
\end{eqnarray}
It then follows by Markov's inequality that for any $k \geq 1$, $\pr[g_{i_0}^2 \geq k s^{2N} d_1 \cdots d_{N-1}] \leq 1/k$. For any constant $B_1$ (whose exact value will be specified below), it follows that
\begin{eqnarray}
&&\pr[f(W_1, \ldots, W_N) {\geq} B_1 d_0^2 d_1 d_2 \cdots d_{N-1} s^{2N}]\nonumber\\
&=& \pr\left[ \sum_{i_0=1}^{d_0} g_{i_0}(W_1, \ldots, W_N)^2 {\geq} B_1 d_0^2 d_1 d_2 \cdots d_{N-2} s^{2N} \right]\nonumber\\
& \leq & d_0 \cdot \pr[g_1(W_1, \ldots, W_N)^2 {\geq} B_1 d_0d_1 \cdots d_{N-1} s^{2N}]\nonumber\\
\label{eq:poly_ub}
& \leq & 1/B_1.
\end{eqnarray}
Next, by Lemma~\ref{lem:carbery}, there is an absolute constant $C_0 > 0$ such that for any $\ep > 0$, and any $1 \leq i_0 \leq d_0$,
$$
\pr\left[ |g_{i_0}(W_1, \ldots, W_N)| \leq \ep^N \sqrt{s^{2N} d_1 \cdots d_{N-1}} \right] \leq C_0 N \ep.
$$
Since $f^2 \geq g_{i_0}^2$ for each $i_0$, it follows that
\begin{equation}
\label{eq:poly_lb}
\pr[ f(W_1, \ldots, W_N) \geq \ep^{2N} s^{2N} d_1 \cdots d_{N-1} ] \geq 1 - C_0 N \ep.
\end{equation}
Next, given $0 < C_2 < 1$, choose $\ep = (1-C_2)/(2C_0N)$, and $B_1 = 2/(1-C_2)$. Then by (\ref{eq:poly_ub}) and (\ref{eq:poly_lb}) and a union bound, we have that
$$
\pr\left[\left( \frac{1-C_2}{2C_0N}\right)^{2N} s^{2N} d_1 \cdots d_{N-1} \leq f(W_1, \ldots, W_N) \leq \frac{2}{1-C_2} {s^{2N}}d_0^2 d_1 \cdots d_{N-1} \right] \geq C_2.
$$
The result of the lemma then follows by taking $C_1 = \max\left\{ \frac{2}{1-C_2}, \frac{2C_0}{1-C_2} \right\}$.
\end{proof}
\begin{lemma}
\label{lem:rotation_inv}
Let $N, d_0, \ldots, d_{N-1} \in \BN$, and set $d_N = 1$. Suppose $W_j \in \BR^{d_j \times d_{j-1}}$ for $1 \leq j \leq N$, are matrices whose entries are i.i.d.~Gaussians with mean~$0$ and standard deviation~$s$. Then, the distribution of $W_{1:N}$ is rotation-invariant.
\end{lemma}
\begin{proof}
First we remark that for any orthogonal matrix $O \in \BR^{d_0 \times d_0}$, the distribution of $W_1$ is the same as that of $W_1O$. To see this, let us denote the rows of $W_1$ by $(W_1)_1, \ldots, (W_1)_{d_1}$, and the columns of $O$ by $O^1, \ldots, O^{d_0}$. Then the $(i_1, i_0)$ entry of $W_1O$, for $1 \leq i_1 \leq d_1, 1 \leq i_0 \leq d_0$ is $\langle (W_1)_{i_1}, O^{i_0} \rangle$, which is a Gaussian with mean~$0$ and standard deviation~$s$, since $\| O^{i_0}\|_2 = 1$. Since $\langle O^{i_0}, O^{i_0'} \rangle = 0$ for $i_0 \neq i_0'$, the covariance between any two distinct entries of $W_1O$ is 0. Therefore, the entries of $W_1O$ are independent Gaussians with mean~$0$ and standard deviation~$s$, just as are the entries of $W_1$.
But now for any matrix $O \in \BR^{d_0 \times d_0}$, the distribution of $W_{1:N}O$ is the distribution of $W_N W_{N-1} \cdots W_2 (W_1O)$, which is the same as the distribution of $W_N W_{N-1} \cdots W_2 W_1 = W_{1:N}$, since $W_1, W_2, \ldots, W_N$ are all independent.
\end{proof}
For a dimension~$d\in\N$, radius~$r>0$, and $0 < h < r$, a {\it $(d,r)$-hyperspherical cap of height~$h$} is a subset $\MC \subset B^d(r)$ of the form $\{ x \in B^d(r) : \langle x, u \rangle \geq r-h\}$, where $u$ is any $d$-dimensional unit vector. We define the {\it area of a $(d,r)$-hyperspherical cap of height $h$}~---~$\MC$~---~to be $\sigma^{d,r}(\partial \MC \cap S^d(r))$.
\begin{lemma}
\label{lem:volcap}
For $d \geq 20$, choose any $0 \leq h \leq 1$. Then, the area of a $(d,1)$-hyperspherical cap of height $h$ is at least
$$
\frac{3 - 4 F((1-h) \sqrt{d-3})}{2}.
$$
\end{lemma}
\begin{proof}
In \cite{chudnov_minimax_1986}, it is shown that the area of a $(d,1)$-hyperspherical cap of height $h$ is given by $\frac{1 - C_{d-2}(h)/C_{d-2}(0)}{2}$, where
$$
C_d(h) := \int_0^{1-h} (1-t^2)^{(d-1)/2} dt.
$$
Next, by the inequality $1-t^2 \geq \exp(-2t^2)$ for $0 \leq t \leq 1/2$,
\begin{eqnarray}
\int_0^1 (1-t^2)^{(d-3)/2} dt & \geq & \int_0^{1/2} \exp\left(2 \cdot \frac{-t^2(d-3)}{2} \right) dt\nonumber\\
& = & \sqrt{\pi/(d-3)} \cdot \frac{2F(\sqrt{(d-3)/2}) - 1}{2}\nonumber\\
\label{eq:cd0}
& \geq & \sqrt{\pi/(d-3)} \cdot \frac{1 - 2 \exp(-(d-3)/4)}{2},
\end{eqnarray}
where the last inequality follows from the standard estimate $F(x) \geq 1 - \exp(-x^2/2)$ for $x \geq 1$.
Also, since $1-t^2 \leq \exp(-t^2)$ for all $t$,
\begin{eqnarray}
\int_0^{1-h} (1-t^2)^{(d-3)/2} dt & \leq & \int_0^{1-h} \exp\left( \frac{-t^2 (d-3)}{2} \right) dt \nonumber\\
\label{eq:cdh}
& = & \sqrt{2\pi/(d-3)} \cdot \frac{2F((1-h) \sqrt{d-3}) - 1}{2}.
\end{eqnarray}
Therefore, for $d \geq 20$, by (\ref{eq:cd0}) and (\ref{eq:cdh}),
\begin{eqnarray}
\frac{1-C_{d-2}(h)/C_{d-2}(0)}{2} & \geq &\frac{1 - \frac{\sqrt{2} \cdot (2F((1-h)\sqrt{d-3}) - 1)}{1 - 2 \exp(-(d-3)/4)}}{2} \nonumber\\
& \geq & \frac{1 - \sqrt{2} \cdot (2F((1-h)\sqrt{d-3}) - 1) \cdot (1 + 4 \exp(-(d-3)/4))}{2}\nonumber\\
& \geq & \frac{3 - 4 F((1-h)\sqrt{d-3})}{2},\nonumber
\end{eqnarray}
where the second inequality has used $1/(1-y) \leq 1 + 2y$ for all $0 < y < 1/2$ (and where $y = 2\exp((-(d-3)/4)) < 2 \exp(-17/4) < 1/2$), and the final inequality uses $1 + 4\exp(-(d-3)/4) \leq \sqrt{2}$ for $d \geq 20$. The above chain of inequalities gives us the desired result.
\end{proof}
\begin{lemma}
\label{lemma:haar_def}
Let $d \in \BN, d \geq 20$; $a \geq 1$ be a real number (possibly depending on $d$); and $\Phi \in \BR^d$ be some vector.
Set $r = \| \Phi\|_2 / \sqrt{ad}$, and suppose that $V \in S^d(r)$ is drawn according to the uniform measure.
Then, with probability at least $\frac{3 - 4F(2/\sqrt{a})}{2}$, $V$ will have deficiency margin $\| \Phi\|_2 / (ad)$ with respect to $\Phi$.
\end{lemma}
\begin{proof}
By rescaling, we may assume without loss of generality that $\| \Phi\|_2 = 1$, so that $r = 1/\sqrt{ad}$. Let $\MD$ denote the intersection of $B^{d}(r)$ with the open $d$-ball of radius $1-1/(ad)$ centered at $\Phi$. Let $\MC \subset B^{d}(r)$ denote the $(d,r)$-hyperspherical cap of height $r \cdot \big( 1 - 2/(\sqrt{ad})\big) = r - 2/(ad)$ whose base is orthogonal to the line between $\mathbf{0}$ and $\Phi$ (see Figure \ref{fig:initfig}). Note that ${\sigma}^{d,r}(\partial\MD \cap S^d(r))$, the Haar measure of the portion of $\partial\MD$ intersecting $S^d(r)$, gives the probability that $V$ belongs to the boundary of $\MD$. By Lemma \ref{lem:volcap} above (along with rescaling arguments), since $d \geq 20$, $\sigma^{d,r}(\partial \MC \cap S^d(r)) \geq \frac 12 \cdot (3 - 4F(2/\sqrt{a}))$, and therefore $V \in {\partial}\MC$ with at least this probability.
We next claim that $\MC \subseteq \MD$. To see this, first let $\MT \subset \BR^d$ denote the $(d-1)$-sphere of radius $1-1/(ad)$ centered at $\Phi$ (see Figure \ref{fig:initfig}). Let $P$ be the intersection of $\MT$ with the line from $\mathbf{0}$ to $\Phi$, and $Q$ denote the intersection of this line with the unique hyperplane of codimension 1 containing $\MT \cap \partial B^{d}(r)$~---~we denote this hyperplane by $\MH$. If we can show that $\norm{P-Q}_2 \leq 1/(ad)$, then it follows that $\MC$ lies entirely on the other side of $\MH$ as $\mathbf{0}$, which will complete the proof that $\MC \subseteq \MD$.
The calculation of $\norm{P-Q}_2$ is simply an application of the law of cosines: letting $\theta$ be the angle determining the intersection of $\partial B^{d}(r)$ and $\MT$ (see Figure~\ref{fig:initfig}), note that
$$
(1-1/(ad))^2 = r^2 + 1^2 - 2r\cos \theta = 1/(ad) + 1 - 2/\sqrt{ad} \cdot \cos(\theta),
$$
so
$$
d(P,Q) = r \cos \theta - 1/(ad) = \frac 12 (1/(ad) - 1/(a^2d^2)) < 1/(ad),
$$
as desired.
Using that $\MC \subseteq \MD$, we continue with the proof. Notice the fact that $\MC\subseteq \MD$ is equivalent to $\partial \MC \cap S^d(r) \subseteq \partial \MD \cap S^d(r)$, by the structure of $\MC$ and~$\MD$. {Since the probability that $V$ lands in $\partial\MC$ is at least $\frac{3-4F(2/\sqrt{a})}{2}$, this lower bound applies to $V$ landing in $\partial\MD$ as well}. Since all $V \in \partial\MD$ have distance at most $1-1/(ad)$ from $\Phi$, and since $\sigma_{min}(\Phi) = \| \Phi\|_2 = 1$, it follows that for any $V \in \partial\MD$, $\| V - \Phi\|_2 \leq \sigma_{min}(\Phi) - 1/(ad)$. Therefore, with probability of at least $\frac{3-4F(2/\sqrt a)}{2}$, $V$ has deficiency margin $\| \Phi\|_2/(ad)$ with respect to~$\Phi$.
\end{proof}
\begin{figure}
\begin{center}
\begin{tikzpicture}
\draw[very thin, pattern = north west lines, pattern color = gray, opacity=0.25] (2.73,-4.2) -- (2.73, 4.2) arc (56.65:-56.65:5cm) -- cycle;
\draw[very thin, pattern = north west lines, pattern color = gray, opacity=0.25] (2.73,-4.2) -- (2.73, 4.2) arc (148:212:8cm) -- cycle;
\draw (0,0) circle (5cm);
\draw (0,0) -- (10,0);
\draw (0,0) -- (2.7, 4.25);
\draw [thick, blue] (2.7,-5) -- (2.7,5);
\node [above] at (2.7,5) {\color{blue} $\MH$};
\node [above] at (10, 0) {$\Phi$};
\node [above] at (0,0) {$\mathbf{0}$};
\node [above left] at (1.5, 0) {$P$};
\node [above right] at (2.7, 0) {$Q$};
\node [above right] at (0.2, 0) {$\theta$};
\node [above] at (1.3, 2.1) {$r$};
\node [right] at (5.5, 6.92) {\color{red} $\MT$};
\draw [thick,red] (5.5,6.92) arc (120:240:8cm)
\filldraw[fill opacity=0.2,fill=green] (3.8,-3.25) -- (3.8,3.25) arc (40.39:-40.39:5cm) -- cycle;
\node [above] at (4.35,-0.9) {\color{darkspringgreen} $\MC$};
\draw[decoration={calligraphic brace,amplitude=5pt}, decorate, line width=1.25pt] (3.85,0.05) node {} -- (4.95,0.05);
\node [above,align=center] at (4.4, 0.1) {\small Height \\ \small of $\MC$};
\end{tikzpicture}
\end{center}
\caption{Figure for proof of Lemma \ref{lemma:haar_def}. The dashed region denotes $\MD$. Not to scale.}
\label{fig:initfig}
\end{figure}
\begin{lemma}[Lemma~\ref{lem:integrate_rad} restated]
\label{lem:integrate_rad_restate}
Let $d \in \BN, d \geq 20$; $b_2 > b_1 \geq 1$ be real numbers (possibly depending on $d$); and $\Phi \in \BR^d$ be a vector. Suppose that $\mu$ is a rotation-invariant distribution over $\BR^d$ with a well-defined density, such that, for some $0 < \ep < 1$,
$$
\pr_{V \sim \mu} \left[ \frac{\| \Phi\|_2}{\sqrt{b_2d}} \leq \| V \|_2 \leq \frac{\| \Phi\|_2}{\sqrt{b_1d}}\right] \geq 1-\ep.
$$
Then, with probability at least $(1-\ep) \cdot \frac{3 - 4F(2/\sqrt{b_1})}{2}$, $V$ will have deficiency margin $\| \Phi\|_2 / (b_2d)$ with respect to $\Phi$.
\end{lemma}
\begin{proof}
By rescaling we may assume that $\| \Phi\|_2 = 1$ without loss of generality. Then the deficiency margin of $V$ is equal to $1 - \| V- \Phi\|_2$. $\mu$~has a well-defined density, so we can set $\hat{\mu}$ to be the probability density function of $\| V\|_2$. Since $\mu$ is rotation-invariant, we can integrate over spherical coordinates, giving
\begin{eqnarray}
&& \pr[1 - \| V - \Phi\|_2 \geq {1} / (b_2d)] \nonumber\\
&=& \int_0^\infty \pr\big[1 - \| V - \Phi\|_2 \geq {1} / (b_2d) ~\big|~ \| V \|_2 = r \big]\hat \mu(r) dr\nonumber\\
& \geq & \int_{1/(\sqrt{b_2d})}^{1/(\sqrt{b_1d})} \frac{3 - 4F(2r\sqrt{d} )}{2} \hat \mu(r) dr \nonumber\\
& \geq & \frac{3 - 4F(2/\sqrt{b_1})}{2} \cdot \int_{1/(\sqrt{b_2d})}^{1/(\sqrt{b_1d})} \hat\mu(r) dr \nonumber\\
& \geq & \frac{3 - 4F(2/\sqrt{b_1})}{2} \cdot (1-\ep)\nonumber,
\end{eqnarray}
where the first inequlaity used Lemma \ref{lemma:haar_def} and the fact that the distribution of $V$ conditioned on $\| V\|_2 = r$ is uniform on $S^d(r)$.
\end{proof}
Now we are ready to prove Claim \ref{claim:margin_init}:
\begin{proof}[Proof of Claim \ref{claim:margin_init}]
We let $W \in \BR^{1 \times d_0} \simeq \BR^{d_0}$ denote the random vector $W_{1:N}$; also let $\mu$ denote the distribution of $W$, so that by Lemma \ref{lem:rotation_inv}, $\mu$ is rotation-invariant. Let $C_1$ be the constant from Lemma~\ref{lem:norm_concentrate} for $C_2 = 999/1000$. For some $a \geq 10^5$, the standard deviation of the entries of each $W_{j}$ is given by
\begin{equation}
\label{eq:define_s}
s = \left( \frac{\| \Phi\|_2^2}{ad_0^3d_1 \cdots d_{N-1} C_1} \right)^{1/(2N)}.
\end{equation}
Then by Lemma \ref{lem:norm_concentrate},
$$
\pr \left[ \frac{ \| \Phi\|_2^2}{ad_0^3 C_1} \cdot \left( \frac{1}{C_1N} \right)^{2N} \leq \| W\|_2^2 \leq \frac{\| \Phi\|_2^2}{ad_0} \right] \geq {\frac{999}{1000}}.
$$
Then Lemma~\ref{lem:integrate_rad_restate}, with $d = d_0$, $b_1 = a$ and $b_2 = ad_0^2 C_1 \cdot (C_1N)^{2N}$, implies that with probability at least $\frac{999}{1000} \cdot \frac{3 - 4F(2/\sqrt{a})}{2}$, $W$ has deficiency margin $\| \Phi\|_2 / (ad_0^3 C_1^{2N+1} N^{2N})$ with respect to $\Phi$. But $a \geq 10^5$ implies that this probability is at least $0.49$, and from (\ref{eq:define_s}),
\be
\label{eq:deficiency_margin_final}
\frac{\| \Phi\|_2}{ad_0^3 C_1^{2N+1} N^{2N}} = \frac{s^{2N} d_1 \cdots d_{N-1}}{\| \Phi\|_2 (C_1N)^{2N}}.
\ee
Next recall the assumption in the hypothesis that $s\geq{C}_{1}N(c\cdot\norm{\Phi}_2/(d_1\cdots{d}_{N-1}))^{1/2N}$. Then the deficiency margin in (\ref{eq:deficiency_margin_final}) is at least
$$
\frac{\left(C_1N(c \norm{\Phi}_2 / (d_1 \cdots d_{N-1}))^{1/(2N)}\right)^{2N} d_1 \cdots d_{N-1}}{\| \Phi\|_2 (C_1N)^{2N}} = c,
$$
completing the proof.
\end{proof}
\subsection{Proof of Claim~\ref{claim:diverge_balance}} \label{app:proofs:diverge_balance}
\begin{proof}
The target matrices~$\Phi$ that will be used to prove the claim satisfy $\sigma_{min}(\Phi)=1$.
We may assume without loss of generality that $c \geq 3/4$, the reason being that if a matrix has deficiency margin $c$ with respect to $\Phi$ and $c' < c$, it certainly has deficiency margin $c'$ with respect to $\Phi$.
We first consider the case $d=1$, so that the target and all matrices are simply real numbers; we will make a slight abuse of notation in identifying $1\times1$ matrices with their unique entries. We set $\Phi = 1$. For all choices of $\eta$, we will set the initializations $W_1(0), \ldots, W_N(0)$ so that $W_{1:N}(0) = c$. Then
$$
\| W_{1:N}(0) - \Phi\|_F = |W_{1:N}(0) - \Phi| = 1-c = \sigma_{min}(\Phi) - c,
$$
so the initial end-to-end matrix $W_{1:N}(0) \in \BR^{1 \times 1}$ has deficiency margin $c$. Now fix $\eta$. Choose $A \in \BR$ with
\begin{eqnarray}
\label{eq:define_A}
A &=& \max \left\{\sqrt{\eta N}, \frac{2}{\eta(1-c) c^{(N-1)/N}}, 2000,20/\eta,\left( \frac{20 \cdot 10^{2N-1}}{\eta^{2N}}\right)^{1/(2N-2)} \right\}.
\end{eqnarray}
We will set:
\begin{equation}
\label{eq:define_wj0}
W_j(0) = \begin{cases}
Ac^{1/N} \quad : \quad 1 \leq j \leq N/2 \\
c^{1/N}/A \quad : \quad N/2 < j \leq N,
\end{cases}
\end{equation}
so that $W_{1:N}(0) = c$. Then since $L^N(W_1, \ldots, W_N) = \frac 12 (1 - W_N \cdots W_1)^2$, the gradient descent updates are given by
$$
W_{j}(t+1) = W_j(t) - \eta (W_{1:N}(t) - 1) \cdot W_{1:j-1}(t) W_{j+1:N}(t),
$$
where we view $W_1(t), \ldots, W_N(t)$ as real numbers. This gives
\begin{equation}
W_j(1) = \begin{cases}
c^{1/N}A - \eta (c-1)c^{(N-1)/N}/A \quad : \quad 1 \leq j \leq N/2 \\
c^{1/N}/A - \eta (c-1) c^{(N-1)/N}A \quad : \quad N/2 < j \leq N.
\end{cases}\nonumber
\end{equation}
Since $3/4 \leq c < 1$ and $-\eta(c-1)c^{(N-1)/N}A \geq 0$, we have that $A/2 \leq 3A/4 \leq W_j(1)$ for $1 \leq j \leq N/2$. Next, since $\frac{1-c}{1-c^{1/N}} \leq N$ for $0 \leq c < 1$, we have that $A^2 \geq \eta N \geq \frac{\eta (1-c)}{1-c^{1/N}}$, which implies that $A^2 \geq c^{1/N}A^2 + \eta (1-c)$, or $c^{1/N} A + \frac{\eta(1-c)}{A} \leq A$. Thus $W_j(1) \leq A$ for $N/2 < j \leq N$.
Similarly, using the same bound $3/4 \leq c < 1$ and the fact that $\eta (1-c) c^{(N-1)/N} A \geq 2$ we get $\frac{3}{16} \eta A \leq W_j(1) \leq \eta A$ for $N/2 < j \leq N$. In particular, for all $1 \leq j \leq N$, we have that $\frac{\min\{\eta, 1\}}{10} A \leq W_j(1) \leq \max\{\eta, 1\} A$.
We prove the following lemma by induction:
\begin{lemma}
\label{lemma:weight_explode}
For each $t \geq 1$, the real numbers $W_1(t), \ldots, W_N(t)$ all have the same sign and this sign alternates for each integer $t$. Moreover, there are real numbers $2 \leq B(t) < C(t)$ for $t \geq 1$ such that for $1 \leq j \leq N$, $B(t) \leq |W_j(t)| \leq C(t)$ and $\eta B(t)^{2N-1} \geq 20 C(t)$.
\end{lemma}
\begin{proof}
First we claim that we may take $B(1) = \frac{\min\{\eta, 1\}}{10} A$ and $C(1) = \max\{ \eta, 1\} A$. We have shown above that $B(1) \leq W_j(1) \leq C(1)$ for all $j$. Next we establish that $\eta B(1)^{2N-1} \geq 20 C(1)$. If $\eta \leq 1$, then
$$
\eta B(1)^{2N-1} =\eta^{2N} \cdot (A/10)^{2N-1} \geq 20 A = 20 C(1),
$$
where the inequality follows from $A \geq \left(\frac{20 \cdot 10^{2N-1}}{\eta^{2N}}\right)^{1/(2N-2)}$ by definition of $A$. If $\eta \geq 1$, then
$$
\eta B(1)^{2N-1} = \eta (A/10)^{2N-1} \geq 20 \eta A = 20 C(1),
$$
where the inequality follows from $A \geq 2000 \geq \left(20 \cdot 10^{2N-1}\right)^{1/(2N-2)}$ by definition of $A$.
Now, suppose the statement of Lemma \ref{lemma:weight_explode} holds for some $t$. Suppose first that $W_j(t)$ are all positive for $1 \leq j \leq N$. Then for all $j$, as $B(t) \geq 2$, and $\eta B(t)^{2N-1} \geq 20 C(t)$,
\begin{eqnarray}
W_j(t+1) & \leq & C(t) - \eta \cdot (B(t)^N - 1) \cdot B(t)^{N-1} \nonumber\\
& \leq & C(t) - \frac{\eta}{2} B(t)^{2N-1}\nonumber\\
& \leq & -9 C(t)\nonumber,
\end{eqnarray}
which establishes that $W_j(t+1)$ is negative for all $j$.
Moreover,
\begin{eqnarray}
W_j(t+1) & \geq & -\eta (C(t)^N - 1) \cdot C(t)^{N-1} \nonumber\\
& \geq & -\eta C(t)^{2N-1}. \nonumber
\end{eqnarray}
Now set $B(t+1) = 9C(t)$ and $C(t+1) = \eta C(t)^{2N-1}$. Since $N \geq 2$, we have that
$$
\eta B(t+1)^{2N-1} = \eta (9C(t))^{2N-1} \geq \eta 9^3 C(t)^{2N-1} > 20 \eta C(t)^{2N-1} = 20 C(t+1).
$$
The case that all $W_j(t)$ are negative for $1 \leq j \leq N$ is nearly identical, with the same values for $B(t+1), C(t+1)$ in terms of $B(t), C(t)$, except all $W_{j}(t+1)$ will be positive.
This establishes the inductive step and completes the proof of Lemma \ref{lemma:weight_explode}.
\end{proof}
By Lemma \ref{lemma:weight_explode}, we have that for all $t \geq 1$, $L^N(W_1(t), \ldots, W_N(t)) = \frac 12 (W_{1:N}(t) - 1)^2 \geq \frac 12 (2^N - 1)^2 > 0$, thus completing the proof of Claim \ref{claim:diverge_balance} for the case where all dimensions are equal to 1.
For the general case where $d_0 = d_1 = \cdots = d_N = d$ for some $d \geq 1$, we set $\Phi = I_d$, and given $c, \eta$, we set $W_j(0)$ to be the $d \times d$ diagonal matrix where all diagonal entries except the first one are equal to 1, and where the first diagonal entry is given by Equation~\eqref{eq:define_wj0}, where $A$ is given by Equation~\eqref{eq:define_A}. It is easily verified that all entries of $W_j(t)$, $1 \leq j \leq N$, except for the first diagonal element of each matrix, will remain constant for all $t \geq 0$, and that the first diagonal elements evolve exactly as in the 1-dimensional case presented above. Therefore the loss in the $d$-dimensional case is equal to the loss in the 1-dimensional case, which is always greater than some positive constant.
\end{proof}
We remark that the proof of Claim \ref{claim:diverge_balance} establishes that the loss $\ell(t):=L^N(W_1(t), \ldots, W_N(t))$ grows at least exponentially in $t$ for the chosen initialization. Such behavior, in which gradients and weights explode, indeed takes place in deep learning practice if initialization is not chosen with care.
\subsection{Proof of Claim~\ref{claim:diverge_margin}} \label{app:proofs:diverge_margin}
\begin{proof}
We will show that a target matrix $\Phi\in\R^{d\times{d}}$ which is symmetric with at least one negative eigenvalue, along with identity initialization ($W_j(0) = I_d$, $\forall{j}\in\{1,\ldots,N\}$), satisfy the conditions of the claim.
First, note that non-stationarity of initialization is met, as for any $1 \leq j \leq N$,
$$
\frac{\partial L^N(W_1(0), \ldots, W_N(0))}{\partial W_j(0)} = W_{j+1:N}(0)^\top (W_{1:N}(0) - \Phi) W_{1:j-1}(0) = I_d - \Phi \neq \mathbf{0},
$$
where the last inequality follows since $\Phi$ has a negative eigenvalue.
To analyze gradient descent we use the following result, which was established in \cite{bartlett2018gradient}:
\begin{lemma}[\cite{bartlett2018gradient}, Lemma 6]
\label{lemma:failure_idinit}
If $W_1(0), \ldots, W_N(0)$ are all initialized to identity, $\Phi$ is symmetric, $\Phi = UDU^\top$ is a diagonalization of $\Phi$, and gradient descent is performed with any learning rate, then for each $t \geq 0$ there is a diagonal matrix $\hat D(t)$ such that $W_j(t) = U\hat D(t) U^\top$ for each $1 \leq j \leq N$.
\end{lemma}
By Lemma \ref{lemma:failure_idinit}, for any choice of learning rate $\eta$, the end-to-end matrix at time $t$ is given by $W_{1:N}(t) = U \hat D(t)^N U^\top$. As long as some diagonal element of $D$ is negative, say equal to $-\lambda < 0$, then
$$
\ell(t)=L^N(W_1(t), \ldots, W_N(t)) = \frac 12 \| W_{1:N}(t) - \Phi\|_F^2 = \frac 12 \| \hat D(t)^L - D \|_F^2 \geq \frac 12 \lambda^2 > 0.
$$
\end{proof}
\section{$\ell_2$ Loss over Whitened Data} \label{app:whitened}
Recall the $\ell_2$~loss of a linear predictor~$W\in\R^{d_y\times{d}_x}$ as defined in Section~\ref{sec:prelim}:
$$L(W)=\frac{1}{2m}\|WX-Y\|_F^2
\text{\,,}$$
where~$X\in\R^{d_x\times{m}}$ and~$Y\in\R^{d_y\times{m}}$.
Define $\Lambda_{xx}:=\tfrac{1}{m}XX^\top\in\R^{d_x\times{d}_x}$, $\Lambda_{yy}:=\tfrac{1}{m}YY^\top\in\R^{d_y\times{d}_y}$ and $\Lambda_{yx}:=\tfrac{1}{m}YX^\top\in\R^{d_y\times{d}_x}$.
Using the relation $\norm{A}_F^2=\Tr(AA^\top)$, we have:
\beas
L(W)&=&\tfrac{1}{2m}\Tr\big((WX-Y)(WX-Y)^\top\big) \\[1mm]
&=&\tfrac{1}{2m}\Tr(WXX^\top{W}^\top)-\tfrac{1}{m}\Tr(WXY^\top)+\tfrac{1}{2m}\Tr(YY^\top) \\[1mm]
&=&\tfrac{1}{2}\Tr(W\Lambda_{xx}{W}^\top)-\Tr(W\Lambda_{yx}^\top)+\tfrac{1}{2}\Tr(\Lambda_{yy})
\text{\,.}
\eeas
By definition, when data is whitened, $\Lambda_{xx}$~is equal to identity, yielding:
\beas
L(W)&=&\tfrac{1}{2}\Tr(W{W}^\top)-\Tr(W\Lambda_{yx}^\top)+\tfrac{1}{2}\Tr(\Lambda_{yy}) \\[1mm]
&=&\tfrac{1}{2}\Tr\big((W-\Lambda_{yx})(W-\Lambda_{yx})^\top\big)-\tfrac{1}{2}\Tr(\Lambda_{yx}\Lambda_{yx}^\top)+\tfrac{1}{2}\Tr(\Lambda_{yy}) \\[1mm]
&=&\tfrac{1}{2}\norm{W-\Lambda_{yx}}_F^2+c
\text{\,,}
\eeas
where~$c:=-\tfrac{1}{2}\Tr(\Lambda_{yx}\Lambda_{yx}^\top)+\tfrac{1}{2}\Tr(\Lambda_{yy})$ does not depend on~$W$.
Hence we arrive at Equation~\eqref{eq:loss_whitened}.
\subsubsection*{Acknowledgments}
\else
\section*{Acknowledgments}
\fi
\acknowledgments
\fi
\fi
\section*{References}
{\small
\ifdefined\ICML
\bibliographystyle{icml2018}
\else
\bibliographystyle{plainnat}
\fi
\section{Conclusion} \label{sec:conc}
For deep linear neural networks, we have rigorously proven convergence of gradient descent to global minima, at a linear rate, provided that the initial weight matrices are approximately balanced and the initial end-to-end matrix has positive deficiency margin.
The result applies to networks with arbitrary depth, and any configuration of input/output/hidden dimensions that supports full rank, \ie~in which no hidden layer has dimension smaller than both the input and output.
Our assumptions on initialization~---~approximate balancedness and deficiency margin~---~are both necessary, in the sense that violating any one of them may lead to convergence failure, as we demonstrated explicitly.
Moreover, for networks with output dimension~$1$ (scalar regression), we have shown that a balanced initialization, \ie~a random choice of the end-to-end matrix followed by a balanced partition across all layers, leads assumptions to be met, and thus convergence to take place, with constant probability.
Rigorously proving efficient convergence with significant probability under customary layer-wise independent initialization remains an open problem.
The recent work of~\citet{shamir2018exponential} suggests that this may not be possible, as at least in some settings, the number of iterations required for convergence is exponential in depth with overwhelming probability.
This negative result, a theoretical manifestation of the ``vanishing gradient problem'', is circumvented by balanced initialization.
Through simple experiments we have shown that the latter can lead to favorable convergence in deep learning practice, as it does in theory.
Further investigation of balanced initialization, including development of variants for convolutional layers, is regarded as a promising direction for future research.
The analysis in this paper uncovers special properties of the optimization landscape in the vicinity of gradient descent trajectories.
We expect similar ideas to prove useful in further study of gradient descent on non-convex objectives, including training losses of deep non-linear neural networks.
\section{Convergence Analysis} \label{sec:converge}
In this section we establish convergence of gradient descent for deep linear neural networks (Equations~\eqref{eq:gd} and~\eqref{eq:lnn_obj}) by directly analyzing the trajectories taken by the algorithm.
We begin in Subsection~\ref{sec:converge:balance_margin} with a presentation of two concepts central to our analysis: \emph{approximate balancedness} and \emph{deficiency margin}.
These facilitate our main convergence theorem, delivered in Subsection~\ref{sec:converge:theorem}.
We conclude in Subsection~\ref{sec:converge:balance_init} by deriving a convergence guarantee that holds with constant probability over a random initialization.
\subsection{Approximate Balancedness and Deficiency Margin} \label{sec:converge:balance_margin}
In our context, the notion of approximate balancedness is formally defined as follows:
\vspace{1mm}
\begin{definition}
\label{def:balance}
For~$\delta\geq0$, we say that the matrices $W_j\in\R^{d_j\times{d}_{j-1}}$, $j{=}1,\ldots,N$, are $\delta$-\emph{balanced} if:
$$\norm{W_{j+1}^{\top}W_{j+1}-W_{j}W_j^\top}_F\leq\delta\quad,\,\forall{j}\in\{1,\ldots,N-1\}
\text{\,.}$$
\end{definition}
Note that in the case of $0$-balancedness, \ie~$W_{j+1}^{\top}W_{j+1}=W_{j}W_j^\top$, $\forall{j}\in\{1,\ldots,N-1\}$, all matrices~$W_j$ share the same set of non-zero singular values.
Moreover, as shown in the proof of Theorem~1 in~\citet{arora2018optimization}, this set is obtained by taking the $N$-th root of each non-zero singular value in the end-to-end matrix~$W_{1:N}$.
We will establish approximate versions of these facts for $\delta$-balancedness with $\delta>0$, and admit their usage by showing that if the weights of a linear neural network are initialized to be approximately balanced, they will remain that way throughout the iterations of gradient descent.
The condition of approximate balancedness at initialization is trivially met in the special case of linear residual networks ($d_0=\cdots=d_N=d$ and $W_1(0)=\cdots=W_N(0)=I_d$).
Moreover, as Claim~\ref{claim:balance_init} in Appendix~\ref{app:balance_margin_init} shows, for a given~$\delta>0$, the customary initialization via random Gaussian distribution with mean zero leads to approximate balancedness with high probability if the standard deviation is sufficiently small.
\medskip
The second concept we introduce~---~deficiency margin~---~refers to how far a ball around the target is from containing rank-deficient (\ie~low rank) matrices.
\vspace{1mm}
\begin{definition}
\label{def:margin}
Given a target matrix~$\Phi\in\R^{d_N\times{d}_0}$ and a constant $c>0$, we say that a matrix~$W\in\R^{d_N\times{d}_0}$ has \emph{deficiency margin~$c$ with respect to~$\Phi$} if:\note{
Note that deficiency margin~$c>0$ with respect to~$\Phi$ implies~$\sigma_{min}(\Phi)>0$, \ie~$\Phi$ has full rank.
Our analysis can be extended to account for rank-deficient~$\Phi$ by replacing~$\sigma_{min}(\Phi)$ in Equation~\eqref{eq:margin} with the smallest positive singular value of~$\Phi$, and by requiring that the end-to-end matrix~$W_{1:N}$ be initialized such that its left and right null spaces coincide with those of~$\Phi$.
Relaxation of this requirement is a direction for future work.
}
\be
\norm{W-\Phi}_F\leq\sigma_{min}(\Phi)-c
\label{eq:margin}
\text{\,.}
\ee
\end{definition}
The term ``deficiency margin'' alludes to the fact that if Equation~\eqref{eq:margin} holds, every matrix~$W'$ whose distance from~$\Phi$ is no greater than that of~$W$, has singular values $c$-bounded away from zero:
\vspace{1mm}
\begin{claim}
\label{claim:margin_interp}
Suppose~$W$ has deficiency margin~$c$ with respect to~$\Phi$.
Then, any matrix~$W'$ (of same size as~$\Phi$ and~$W$) for which $\norm{W'-\Phi}_F\leq\norm{W-\Phi}_F$ satisfies~$\sigma_{min}(W')\geq{c}$.
\end{claim}
\vspace{-3mm}
\begin{proof}
Our proof relies on the inequality $\sigma_{min}(A+B)\geq\sigma_{min}(A)-\sigma_{max}(B)$~---~see Appendix~\ref{app:proofs:margin_interp}.
\end{proof}
\vspace{-2mm}
We will show that if the weights $W_1,\ldots,W_N$ are initialized such that (they are approximately balanced and) the end-to-end matrix~$W_{1:N}$ has deficiency margin~$c>0$ with respect to the target~$\Phi$, convergence of gradient descent to global minimum is guaranteed.\note{
In fact, a deficiency margin implies that all critical points in the respective sublevel set (set of points with smaller loss value) are global minima.
This however is far from sufficient for proving convergence, as sublevel sets are unbounded, and the loss landscape over them is non-convex and non-smooth.
Indeed, we show in Appendix~\ref{app:fail} that deficiency margin alone is not enough to ensure convergence~---~without approximate balancedness, the lack of smoothness can cause divergence.
}
Moreover, the convergence will outpace a particular rate that gets faster when $c$ grows larger.
This suggests that from a theoretical perspective, it is advantageous to initialize a linear neural network such that the end-to-end matrix has a large deficiency margin with respect to the target.
Claim~\ref{claim:margin_init} in Appendix~\ref{app:balance_margin_init} provides information on how likely deficiency margins are in the case of a single output model (scalar regression) subject to customary zero-centered Gaussian initialization.
It shows in particular that if the standard deviation of the initialization is sufficiently small, the probability of a deficiency margin being met is close to~$0.5$; on the other hand, for this deficiency margin to have considerable magnitude, a non-negligible standard deviation is required.
\medskip
Taking into account the need for both approximate balancedness and deficiency margin at initialization, we observe a delicate trade-off under the common setting of Gaussian perturbations around zero:
if the standard deviation is small, it is likely that weights be highly balanced and a deficiency margin be met;
however overly small standard deviation will render high magnitude for the deficiency margin improbable, and therefore fast convergence is less likely to happen;
on the opposite end, large standard deviation jeopardizes both balancedness and deficiency margin, putting the entire convergence at risk.
This trade-off is reminiscent of empirical phenomena in deep learning, by which small initialization can bring forth efficient convergence, while if exceedingly small, rate of convergence may plummet (``vanishing gradient problem''), and if made large, divergence becomes inevitable (``exploding gradient problem'').
The common resolution of residual connections~\citep{he2016deep} is analogous in our context to linear residual networks, which ensure perfect balancedness, and allow large deficiency margin if the target is not too far from identity.
\subsection{Main Theorem} \label{sec:converge:theorem}
Using approximate balancedness (Definition~\ref{def:balance}) and deficiency margin (Definition~\ref{def:margin}), we present our main theorem~---~a guarantee for linear convergence to global minimum:
\vspace{1mm}
\begin{theorem}
\label{theorem:converge}
Assume that gradient descent is initialized such that the end-to-end matrix~$W_{1:N}(0)$ has deficiency margin~$c>0$ with respect to the target~$\Phi$, and the weights $W_1(0),\ldots,W_N(0)$ are $\delta$-balanced with $\delta=c^2\big/\big(256\cdot{N}^3\cdot\norm{\Phi}_{F}^{2(N-1)/N}\big)$.
Suppose also that the learning rate~$\eta$ meets:
\be
\eta\leq\frac{c^{(4N-2)/N}}{6144\cdot{N}^3\cdot\norm{\Phi}_{F}^{(6N-4)/N}}
\label{eq:descent_eta}
\text{~.}
\ee
Then, for any~$\epsilon>0$ and:
\be
T\geq\frac{1}{\eta\cdot{c}^{2(N-1)/N}}\cdot\log\left(\frac{\ell(0)}{\epsilon}\right)
\label{eq:converge_t}
\text{\,,}
\ee
the loss at iteration~$T$ of gradient descent~---~$\ell(T)$~---~is no greater than~$\epsilon$.
\end{theorem}
\subsubsection{On the Assumptions Made}
The assumptions made in Theorem~\ref{theorem:converge}~---~approximate balancedness and deficiency margin at initialization~---~are both necessary, in the sense that violating any one of them may lead to convergence failure.
We demonstrate this in Appendix~\ref{app:fail}.
In the special case of linear residual networks (uniform dimensions and identity initialization), a sufficient condition for the assumptions to be met is that the target matrix have (Frobenius) distance less than~$0.5$ from identity.
This strengthens one of the central results in~\citet{bartlett2018gradient} (see Section~\ref{sec:related}).
For a setting of random near-zero initialization, we present in Subsection~\ref{sec:converge:balance_init} a scheme that, when the output dimension is~$1$ (scalar regression), ensures assumptions are satisfied (and therefore gradient descent efficiently converges to global minimum) with constant probability.
It is an open problem to fully analyze gradient descent under the common initialization scheme of zero-centered Gaussian perturbations applied to each layer independently.
We treat this scenario in Appendix~\ref{app:balance_margin_init}, providing quantitative results concerning the likelihood of each assumption (approximate balancedness or deficiency margin) being met individually.
However the question of how likely it is that both assumptions be met simultaneously, and how that depends on the standard deviation of the Gaussian, is left for future work.
An additional point to make is that Theorem~\ref{theorem:converge} poses a structural limitation on the linear neural network.
Namely, it requires the dimension of each hidden layer~($d_i,~i=1,\ldots,N-1$) to be greater than or equal to the minimum between those of the input~($d_0$) and output~($d_N$).
Indeed, in order for the initial end-to-end matrix~$W_{1:N}(0)$ to have deficiency margin~$c>0$, it must (by Claim~\ref{claim:margin_interp}) have full rank, and this is only possible if there is no intermediate dimension~$d_i$ smaller than~$\min\{d_0,d_N\}$.
We make no other assumptions on network architecture (depth, input/output/hidden dimensions).
\subsubsection{Proof}
The cornerstone upon which Theorem~\ref{theorem:converge} rests is the following lemma, showing non-trivial descent whenever $\sigma_{min}(W_{1:N})$ is bounded away from zero:
\vspace{1mm}
\begin{lemma}
\label{lemma:descent}
Under the conditions of Theorem~\ref{theorem:converge}, we have that for every $t=0,1,2,\ldots$~:\note{
Note that the term~$\frac{dL^1}{dW}(W_{1:N}(t))$ below stands for the gradient of~$L^1(\cdot)$~---~a convex loss over (directly parameterized) linear models (Equation~\eqref{eq:lin_obj})~---~at the point~$W_{1:N}(t)$~---~the end-to-end matrix of the network at iteration~$t$.
It is therefore (see Equation~\eqref{eq:gd_loss}) non-zero anywhere but at a global minimum.
}
\be
\ell(t+1)\leq\ell(t)-\frac{\eta}{2}\cdot\sigma_{min}\big(W_{1:N}(t)\big)^{\frac{2(N-1)}{N}}\cdot\norm{\frac{dL^1}{dW}\big(W_{1:N}(t)\big)}_F^2
\label{eq:descent}
\text{~.}
\ee
\end{lemma}
\begin{proof}[Proof of Lemma~\ref{lemma:descent} (in idealized setting; for complete proof see Appendix~\ref{app:proofs:descent})]
\hspace{-0.5mm}We prove the lemma here for the idealized setting of perfect initial balancedness~($\delta=0$):
$$W_{j+1}^{\top}(0)W_{j+1}(0)=W_{j}(0)W_j^\top(0)\quad,~\forall{j}\in\{1,\ldots,N-1\}
\text{~,}$$
and infinitesimally small learning rate~($\eta\to0^+$)~---~\emph{gradient flow}:
$$\dot{W}_j(\tau)=-\frac{\partial{L}^N}{\partial{W}_j}\big(W_1(\tau),\ldots,W_N(\tau)\big)\quad,~j=1,\ldots,N\quad,~\tau\in[0,\infty)
\text{~,}$$
where~$\tau$ is a continuous time index, and dot symbol (in~$\dot{W}_j(\tau)$) signifies derivative with respect to time.
The complete proof, for the realistic case of approximate balancedness and discrete updates~($\delta,\eta>0$), is similar but much more involved, and appears in Appendix~\ref{app:proofs:descent}.
Recall that~$\ell(t)$~---~the objective value at iteration~$t$ of gradient descent~---~is equal to~$L^1(W_{1:N}(t))$ (see Equation~\eqref{eq:gd_loss}).
Accordingly, for the idealized setting in consideration, we would like to show:
\be
\frac{d}{d\tau}L^1\left(W_{1:N}(\tau)\right)\leq-\frac{1}{2}\sigma_{min}\big(W_{1:N}(\tau)\big)^{\frac{2(N-1)}{N}}\cdot\norm{\frac{dL^1}{dW}\big(W_{1:N}(\tau)\big)}_F^2
\label{eq:descent_ideal}
\text{\,.}
\ee
We will see that a stronger version of Equation~\eqref{eq:descent_ideal} holds, namely, one without the $1/2$ factor (which only appears due to discretization).
By (Theorem~$1$ and Claim~$1$ in)~\citet{arora2018optimization}, the weights $W_1(\tau),\ldots,W_N(\tau)$ remain balanced throughout the entire optimization, and that implies the end-to-end matrix~$W_{1:N}(\tau)$ moves according to the following differential equation:
\be
vec\left(\dot{W}_{1:N}(\tau)\right)=-{P}_{W_{1:N}(\tau)}\cdot{vec}\left(\frac{dL^1}{dW}\left(W_{1:N}(\tau)\right)\right)
\label{eq:e2e_gf}
\text{\,,}
\ee
where~$vec(A)$, for an arbitrary matrix~$A$, stands for vectorization in column-first order, and $P_{W_{1:N}(\tau)}$ is a positive semidefinite matrix whose eigenvalues are all greater than or equal to $\sigma_{min}(W_{1:N}(\tau))^{2(N-1)/N}$.
Taking the derivative of~$L^1(W_{1:N}(\tau))$ with respect to time, we obtain the sought-after Equation~\eqref{eq:descent_ideal} (with no $1/2$ factor):
\beas
\frac{d}{d\tau}L^1\left(W_{1:N}(\tau)\right)&=&\inprod{vec\left(\frac{dL^1}{dW}\big(W_{1:N}(\tau)\big)\right)}{vec\left(\dot{W}_{1:N}(\tau)\right)} \\
&=&\inprod{vec\left(\frac{dL^1}{dW}\big(W_{1:N}(\tau)\big)\right)}{-{P}_{W_{1:N}(\tau)}\cdot{vec}\left(\frac{dL^1}{dW}\left(W_{1:N}(\tau)\right)\right)} \\
&\leq&-\sigma_{min}\big(W_{1:N}(\tau)\big)^{\frac{2(N-1)}{N}}\cdot\norm{vec\left(\frac{dL^1}{dW}\big(W_{1:N}(\tau)\big)\right)}^2 \\
&=&-\sigma_{min}\big(W_{1:N}(\tau)\big)^{\frac{2(N-1)}{N}}\cdot\norm{\frac{dL^1}{dW}\big(W_{1:N}(\tau)\big)}_F^2
\text{\,.}
\eeas
The first transition here (equality) is an application of the chain rule;
the second (equality) plugs in Equation~\eqref{eq:e2e_gf};
the third (inequality) results from the fact that the eigenvalues of the symmetric matrix $P_{W_{1:N}(\tau)}$ are no smaller than $\sigma_{min}(W_{1:N}(\tau))^{2(N-1)/N}$ (recall that~$\norm{\cdot}$ stands for Euclidean norm);
and the last (equality) is trivial~---~$\norm{A}_F=\norm{vec(A)}$ for any matrix~$A$.
\end{proof}
With Lemma~\ref{lemma:descent} established, the proof of Theorem~\ref{theorem:converge} readily follows:
\begin{proof}[Proof of Theorem~\ref{theorem:converge}]
By the definition of~$L^1(\cdot)$ (Equation~\eqref{eq:lin_obj}), for any~$W\in\R^{d_N\times{d}_0}$:
$$\frac{dL^1}{dW}(W)=W-\Phi\quad\implies\quad\norm{\frac{dL^1}{dW}(W)}_F^2=2\cdot{L}^1(W)
\text{~.}$$
Plugging this into Equation~\eqref{eq:descent} while recalling that $\ell(t)=L^1(W_{1:N}(t))$ (Equation~\eqref{eq:gd_loss}), we have (by Lemma~\ref{lemma:descent}) that for every $t=0,1,2,\ldots$~:
$$L^1\big(W_{1:N}(t+1)\big)\leq{L}^1\big(W_{1:N}(t)\big)\cdot\Big(1-\eta\cdot\sigma_{min}\big(W_{1:N}(t)\big)^{\frac{2(N-1)}{N}}\Big)
\text{~.}$$
Since the coefficients $1-\eta\cdot\sigma_{min}(W_{1:N}(t))^{\frac{2(N-1)}{N}}$ are necessarily non-negative (otherwise would contradict non-negativity of $L^1(\cdot)$), we may unroll the inequalities, obtaining:
\be
L^1\big(W_{1:N}(t+1)\big)\leq{L}^1\big(W_{1:N}(0)\big)\cdot\prod\nolimits_{t'=0}^{t}\Big(1-\eta\cdot\sigma_{min}\big(W_{1:N}(t')\big)^{\frac{2(N-1)}{N}}\Big)
\text{\,.}
\label{eq:descent_concat}
\ee
Now, this in particular means that for every~$t'=0,1,2,\ldots$~:
$$L^1\big(W_{1:N}(t')\big)\leq{L}^1\big(W_{1:N}(0)\big)\quad\implies\quad\norm{W_{1:N}(t')-\Phi}_F\leq\norm{W_{1:N}(0)-\Phi}_F \text{\,.}$$
Deficiency margin~$c$ of~$W_{1:N}(0)$ along with Claim~\ref{claim:margin_interp} thus imply $\sigma_{min}\big(W_{1:N}(t')\big)\geq{c}$, which when inserted back into Equation~\eqref{eq:descent_concat} yields, for every~$t=1,2,3,\ldots$~:
\be
L^1\big(W_{1:N}(t)\big)\leq{L}^1\big(W_{1:N}(0)\big)\cdot\Big(1-\eta\cdot{c}^{\frac{2(N-1)}{N}}\Big)^t
\label{eq:descent_geo}
\text{~.}
\ee
$\eta\cdot{c}^{\frac{2(N-1)}{N}}$ is obviously non-negative, and it is also no greater than~$1$ (otherwise would contradict non-negativity of $L^1(\cdot)$).
We may therefore incorporate the inequality $1-\eta\cdot{c}^{2(N-1)/N}\leq\exp\big(-\eta\cdot{c}^{2(N-1)/N}\big)$ into Equation~\eqref{eq:descent_geo}:
$$L^1\big(W_{1:N}(t)\big)\leq{L}^1\big(W_{1:N}(0)\big)\cdot\exp\big(-\eta\cdot{c}^{2(N-1)/N}\cdot{t}\big)
\text{\,,}$$
from which it follows that $L^1(W_{1:N}(t))\leq\epsilon$ if:
$$t\geq\frac{1}{\eta\cdot{c}^{2(N-1)/N}}\cdot\log\left(\frac{L^1(W_{1:N}(0))}{\epsilon}\right)
\text{\,.}$$
Recalling again that $\ell(t)=L^1(W_{1:N}(t))$ (Equation~\eqref{eq:gd_loss}), we conclude the proof.
\end{proof}
\subsection{Balanced Initialization} \label{sec:converge:balance_init}
We define the following procedure, \emph{balanced initialization}, which assigns weights randomly while ensuring perfect balancedness:
\vspace{1mm}
\begin{procedure}[Balanced initialization]
\label{proc:balance_init}
Given $d_0, d_1, \ldots, d_N \in \N$ such that $\min\{d_1,\ldots,d_{N-1}\}\geq\min\{d_0,d_N\}$ and a distribution~$\D$ over $d_N\times{d}_0$~matrices, a \emph{balanced initialization} of~$W_j\in\R^{d_j\times{d}_{j-1}}$, $j{=}1,\ldots,N$, assigns these weights as follows:
\vspace{-1.5mm}
\begin{enumerate}[label=(\roman*)]
\item Sample $A\in\R^{d_N\times{d}_0}$ according to~$\D$.
\vspace{-1mm}
\item Take singular value decomposition~$A=U\Sigma{V}^\top$, where $U \in \R^{d_N \times \min\{d_0, d_N\}}$, $V \in \R^{d_0 \times \min\{d_0, d_N\}}$ have orthonormal columns, and $\Sigma \in \R^{\min\{d_0, d_N\} \times \min\{d_0, d_N\}}$ is diagonal and holds the singular values of $A$.
\vspace{-1mm}
\item Set $W_N\simeq{U}\Sigma^{1/N},W_{N-1}\simeq\Sigma^{1/N},\ldots,W_2\simeq\Sigma^{1/N},W_1\simeq\Sigma^{1/N}V^\top$, where the symbol~``$\simeq$'' stands for equality up to zero-valued padding.\note{
These assignments can be accomplished since $\min\{d_1,\ldots,d_{N-1}\}\geq\min\{d_0,d_N\}$.
}
\note{
By design $W_{1:N}=A$ and $W_{j+1}^{\top}W_{j+1}=W_{j}W_j^\top$, $\forall{j}\in\{1,\ldots,N{-}1\}$~---~these properties are actually all we need in Theorem~\ref{theorem:converge_balance_init}, and step~\emph{(iii)} in Procedure~\ref{proc:balance_init} can be replaced by any assignment that meets them.
\label{note:balance_init_props}
}
\end{enumerate}
\end{procedure}
The concept of balanced initialization, together with Theorem~\ref{theorem:converge}, leads to a guarantee for linear convergence (applicable to output dimension~$1$~---~scalar regression) that holds with constant probability over the randomness in initialization:
\vspace{1mm}
\begin{theorem}
\label{theorem:converge_balance_init}
For any constant $0<p<1/2$, there are constants $d_0',a>0$ \note{
As shown in the proof of the theorem (Appendix \ref{app:proofs:converge_balance_init}), $d_0',a>0$ can take on any pair of values for which:
\emph{(i)}~$d_0'\geq20$;
and~\emph{(ii)}~$\big(1 - 2\exp(-d_0'/16)\big)\big(3-4F(2/\sqrt{a/2})\big) \geq 2p$, where $F(\cdot)$ stands for the cumulative distribution function of the standard normal distribution.
For example, if~$p=0.25$, it suffices to take any~$d_0'\geq100,a\geq100$.
We note that condition~\emph{(i)} here ($d_0'\geq20$) serves solely for simplification of expressions in the theorem.
}
such that the following holds.
Assume $d_N=1,d_0\geq d_0'$, and that the weights $W_1(0),\ldots,W_N(0)$ are subject to balanced initialization (Procedure~\ref{proc:balance_init}) such that the entries in $W_{1:N}(0)$ are independent zero-centered Gaussian perturbations with standard deviation $s\leq \|\Phi\|_2/\sqrt{ad_0^2}$.
Suppose also that we run gradient descent with learning rate $ \eta \leq (s^2d_0)^{4-2/N}\big/\big(10^5 N^3 \| \Phi\|_2^{10-6/N}\big)$.
Then, with probability at least~$p$ over the random initialization, we have that for every~$\epsilon>0$ and:
$$
T \geq \frac4\eta \left( \ln(4) \left(\frac{\|\Phi\|_2}{s^2d_0}\right)^{2-2/N} + \| \Phi\|_2^{2/N-2}\ln(\| \Phi\|_2^2/(8\ep)) \right)
\text{\,,}
$$
the loss at iteration~$T$ of gradient descent~---~$\ell(T)$~---~is no greater than~$\epsilon$.
\end{theorem}
\vspace{-2mm}
\begin{proof}
See Appendix \ref{app:proofs:converge_balance_init}.
\end{proof}
\section{Experiments} \label{sec:exper}
Balanced initialization (Procedure~\ref{proc:balance_init}) possesses theoretical advantages compared with the customary layer-wise independent scheme~---~it allowed us to derive a convergence guarantee that holds with constant probability over the randomness of initialization (Theorem~\ref{theorem:converge_balance_init}).
In this section we present empirical evidence suggesting that initializing with balancedness may be beneficial in practice as well.
For conciseness, some of the details behind our implementation are deferred to Appendix~\ref{app:impl}.
We began by experimenting in the setting covered by our analysis~---~linear neural networks trained via gradient descent minimization of $\ell_2$~loss over whitened data.
The dataset chosen for the experiment was UCI Machine Learning Repository's ``Gas Sensor Array Drift at Different Concentrations'' \citep{vergara2012chemical,rodriguez2014calibration}.
Specifically, we used the dataset's ``Ethanol'' problem~---~a scalar regression task with~$2565$ examples, each comprising~$128$ features (one of the largest numeric regression tasks in the repository).
Starting with the customary initialization of layer-wise independent random Gaussian perturbations centered at zero, we trained a three layer network ($N=3$) with hidden widths ($d_1,d_2$) set to~$32$, and measured the time (number of iterations) it takes to converge (reach training loss within $\epsilon=10^{-5}$ from optimum) under different choices of standard deviation for the initialization.
To account for the possibility of different standard deviations requiring different learning rates (values for~$\eta$), we applied, for each standard deviation independently, a grid search over learning rates, and recorded the one that led to fastest convergence.
The result of this test is presented in Figure~\ref{fig:exper}(a).
As can be seen, there is a range of standard deviations that leads to fast convergence (a few hundred iterations or less), below and above which optimization decelerates by orders of magnitude.
This accords with our discussion at the end of Subsection~\ref{sec:converge:balance_init}, by which overly small initialization ensures approximate balancedness (small~$\delta$; see Definition~\ref{def:balance}) but diminishes deficiency margin (small~$c$; see Definition~\ref{def:margin})~---~``vanishing gradient problem''~---~whereas large initialization hinders both approximate balancedness and deficiency margin~---~``exploding gradient problem''.
In that regard, as a sanity test for the validity of our analysis, in a case where approximate balancedness is met at initialization (small standard deviation), we measured its persistence throughout optimization.
As Figure~\ref{fig:exper}(c) shows, our theoretical findings manifest themselves here~---~trajectories of gradient descent indeed preserve weight balancedness.
In addition to a three layer network, we also evaluated a deeper, eight layer model (with hidden widths identical to the former~---~$N=8$, $d_1=\cdots=d_7=32$).
In particular, using the same experimental protocol as above, we measured convergence time under different choices of standard deviation for the initialization.
Figure~\ref{fig:exper}(a) displays the result of this test alongside that of the three layer model.
As the figure shows, transitioning from three layers to eight aggravated the instability with respect to initialization~---~there is now a narrow band of standard deviations that lead to convergence in reasonable time, and outside of this band convergence is extremely slow, to the point where it does not take place within the duration we allowed ($10^6$~iterations).
From the perspective of our analysis, a possible explanation for the aggravation is as follows: under layer-wise independent initialization, the magnitude of the end-to-end matrix~$W_{1:N}$ depends on the standard deviation in a manner that is exponential in depth, thus for large depths the range of standard deviations that lead to moderately sized~$W_{1:N}$ (as required for a deficiency margin) is limited, and within this range, there may not be many standard deviations small enough to ensure approximate balancedness.
The procedure of balanced initialization (Procedure~\ref{proc:balance_init}) circumvents these difficulties~---~it assigns~$W_{1:N}$ directly (no exponential dependence on depth), and distributes its content between the individual weights $W_1,\ldots,W_N$ in a perfectly balanced fashion.
Rerunning the experiment of Figure~\ref{fig:exper}(a) with this initialization replacing the customary layer-wise scheme (using same experimental protocol), we obtained the results shown in Figure~\ref{fig:exper}(b)~---~both the original three layer network, and the deeper eight layer model, converged quickly under virtually all standard deviations tried.
As a final experiment, we evaluated the effect of balanced initialization in a setting that involves non-linear activation, softmax-cross-entropy loss and stochastic optimization (factors not accounted for by our analysis).
For this purpose, we turned to the MNIST tutorial built into TensorFlow \citep{abadi2016tensorflow},\note{
\url{https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/tutorials/mnist}
}
which comprises a fully-connected neural network with two hidden layers (width~$128$ followed by~$32$) and ReLU activation \citep{nair2010rectified}, trained through stochastic gradient descent (over softmax-cross-entropy loss) with batch size~$100$, initialized via customary layer-wise independent Gaussian perturbations centered at zero.
While keeping the learning rate at its default value $0.01$, we varied the standard deviation of initialization, and for each value measured the training loss after $10$~epochs.\note{
As opposed to the dataset used in our experiments with linear networks, measuring the training loss with MNIST is non-trivial computationally (involves passing through $60K$~examples).
Therefore, rather than continuously polling training loss until it reaches a certain threshold, in this experiment we chose to evaluate speed of convergence by measuring the training loss once after a predetermined number of iterations.
}
We then replaced the original (layer-wise independent) initialization with a balanced initialization based on Gaussian perturbations centered at zero (latter was implemented per Procedure~\ref{proc:balance_init}, disregarding non-linear activation), and repeated the process.
The results of this experiment are shown in Figure~\ref{fig:exper}(d).
Although our theoretical analysis does not cover non-linear activation, softmax-cross-entropy loss or stochasticity in optimization, its conclusion of balanced initialization leading to improved (faster and more stable) convergence carried over to such setting.
\begin{figure}
\vspace{-5mm}
\subfloat[]{\includegraphics[scale=0.21]{std_vs_convtime_unbalanced.png}} \
\subfloat[]{\includegraphics[scale=0.21]{std_vs_convtime_balanced.png}} \
\subfloat[]{\includegraphics[scale=0.21]{{unbalanced_shallow_balances}.png}} \
\subfloat[]{\includegraphics[scale=0.21]{mnist_std_train_loss.png}} \
\vspace{-1mm}
\caption{
Experimental results.
\textbf{(a)}~Convergence of gradient descent training deep linear neural networks (depths~$3$ and~$8$) under customary initialization of layer-wise independent Gaussian perturbations with mean~$0$ and standard deviation~$s$.
For each network, number of iterations required to reach $\epsilon=10^{-5}$ from optimal training loss is plotted as a function of~$s$ (missing values indicate no convergence within $10^6$~iterations).
Dataset in this experiment is a numeric regression task from UCI Machine Learning Repository (details in text).
Notice that fast convergence is attained only in a narrow band of values for~$s$, and that this phenomenon is more extreme with the deeper network.
\textbf{(b)}~Same setup as in~(a), but with layer-wise independent initialization replaced by balanced initialization (Procedure~\ref{proc:balance_init}) based on Gaussian perturbations with mean~$0$ and standard deviation~$s$.
Notice that this change leads to fast convergence, for both networks, under wide range of values for~$s$.
Notice also that the shallower network converges slightly faster, in line with the results of~\citet{saxe2014exact} and~\citet{arora2018optimization} for $\ell_2$~loss.
\textbf{(c)}~For the run in~(a) of a depth-$3$ network and standard deviation~$s={10^{-3}}$, this plot shows degree of balancedness (minimal~$\delta$ satisfying $\|W_{j+1}^{\top}W_{j+1}-W_{j}W_j^\top\|_F\leq\delta~,\,\forall{j}\in\{1,\ldots,N-1\}$) against magnitude of weights ($\min_{j=1,\ldots,N}\|W_{j}W_j^\top\|_F$) throughout optimization.
Notice that approximate balancedness persists under gradient descent, in line with our theoretical analysis.
\textbf{(d)}~Convergence of stochastic gradient descent training the fully-connected non-linear (ReLU) neural network of the MNIST tutorial built into TensorFlow (details in text).
Customary layer-wise independent and balanced initializations~---~both based on Gaussian perturbations centered at zero~---~are evaluated, with varying standard deviations.
For each configuration~$10$ epochs of optimization are run, followed by measurement of the training loss.
Notice that although our theoretical analysis does not cover non-linear activation, softmax-cross-entropy loss and stochastic optimization, the conclusion of balanced initialization leading to improved convergence carries over to this setting.
}
\label{fig:exper}
\vspace{-3mm}
\end{figure}
\section{Introduction} \label{sec:intro}
Deep learning builds upon the mysterious ability of gradient-based optimization methods to solve related non-convex problems.
Immense efforts are underway to mathematically analyze this phenomenon.
The prominent \emph{landscape} approach focuses on special properties of critical points (\ie~points where the gradient of the objective function vanishes) that will imply convergence to global optimum.
Several papers (\eg~\citet{ge2015escaping,lee2016gradient}) have shown that (given certain smoothness properties) it suffices for critical points to meet the following two conditions:
\emph{(i)}~\emph{no poor local minima}~---~every local minimum is close in its objective value to a global minimum;
and~\emph{(ii)}~\emph{strict saddle property}~---~every critical point that is not a local minimum has at least one negative eigenvalue to its Hessian.
While condition~\emph{(i)} does not always hold (\cf~\citet{safran2018spurious}), it has been established for various simple settings (\eg~\citet{soudry2016no,kawaguchi2016deep}).
Condition~\emph{(ii)} on the other hand seems less plausible, and is in fact provably false for models with three or more layers (\cf~\citet{kawaguchi2016deep}), \ie~for \emph{deep} networks.
It has only been established for problems involving \emph{shallow} (two layer) models, \eg~matrix factorization (\citet{ge2016matrix,du2018algorithmic}).
The landscape approach as currently construed thus suffers from inherent limitations in proving convergence to global minimum for deep networks.
A potential path to circumvent this obstacle lies in realizing that landscape properties matter only in the vicinity of trajectories that can be taken by the optimizer, which may be a negligible portion of the overall parameter space.
Several papers (\eg~\citet{saxe2014exact,arora2018optimization}) have taken this \emph{trajectory-based} approach, primarily in the context of \emph{linear neural networks}~---~fully-connected neural networks with linear activation.
Linear networks are trivial from a representational perspective, but not so in terms of optimization~---~they lead to non-convex training problems with multiple minima and saddle points.
Through a mix of theory and experiments, \citet{arora2018optimization}~argued that such non-convexities may in fact be beneficial for gradient descent, in the sense that sometimes, adding (redundant) linear layers to a classic linear prediction model can accelerate the optimization.
This phenomenon challenges the holistic landscape view, by which convex problems are always preferable to non-convex ones.
Even in the linear network setting, a rigorous proof of efficient convergence to global minimum has proved elusive.
One recent progress is the analysis of~\citet{bartlett2018gradient} for \emph{linear residual networks}~---~a particular subclass of linear neural networks in which the input, output and all hidden dimensions are equal, and all layers are initialized to be the identity matrix (\cf~\citet{hardt2016identity}).
Through a trajectory-based analysis of gradient descent minimizing $\ell_2$~loss over a whitened dataset (see Section~\ref{sec:prelim}), \citet{bartlett2018gradient}~show that convergence to global minimum at a \emph{linear rate}~---~loss is less than~$\epsilon>0$ after $\OO(\log\frac{1}{\epsilon})$~iterations~---~takes place if one of the following holds:
\emph{(i)}~the objective value at initialization is sufficiently close to a global minimum;
or \emph{(ii)}~a global minimum is attained when the product of all layers is positive definite.
The current paper carries out a trajectory-based analysis of gradient descent for general deep linear neural networks, covering the residual setting of~\citet{bartlett2018gradient}, as well as many more settings that better match practical deep learning.
Our analysis draws upon the trajectory characterization of~\citet{arora2018optimization} for gradient flow (infinitesimally small learning rate), together with significant new ideas necessitated due to discrete updates.
Ultimately, we show that when minimizing $\ell_2$~loss of a deep linear network over a whitened dataset, gradient descent converges to the global minimum, at a linear rate, provided that the following conditions hold:
\emph{(i)}~the dimensions of hidden layers are greater than or equal to the minimum between those of the input and output;
\emph{(ii)}~layers are initialized to be \emph{approximately balanced} (see Definition~\ref{def:balance})~---~this is met under commonplace near-zero, as well as residual (identity) initializations;
and \emph{(iii)}~the initial loss is smaller than any loss obtainable with rank deficiencies~---~this condition will hold with probability close to~$0.5$ if the output dimension is~$1$ (scalar regression) and standard (random) near-zero initialization is employed.
Our result applies to networks with arbitrary depth and input/output dimensions, as well as any configuration of hidden layer widths that does not force rank deficiency (\ie~that meets condition~\emph{(i)}).
The assumptions on initialization (conditions~\emph{(ii)} and~\emph{(iii)}) are necessary, in the sense that violating any one of them may lead to convergence failure.
Moreover, in the case of scalar regression, they are met with constant probability under a random initialization scheme.
We are not aware of any similarly general analysis for efficient convergence of gradient descent to global minimum in deep learning.
\medskip
The remainder of the paper is organized as follows.
In Section~\ref{sec:prelim} we present the problem of gradient descent training a deep linear neural network by minimizing the $\ell_2$~loss over a whitened dataset.
Section~\ref{sec:converge} formally states our assumptions, and presents our convergence analysis.
Key ideas brought forth by our analysis are demonstrated empirically in Section~\ref{sec:exper}.
Section~\ref{sec:related} gives a review of relevant literature, including a detailed comparison of our results against those of~\citet{bartlett2018gradient}.
Finally, Section~\ref{sec:conc} concludes.
\section{Gradient Descent for Deep Linear Neural Networks} \label{sec:prelim}
We denote by~$\norm{\vv}$ the Euclidean norm of a vector~$\vv$, and by~$\norm{A}_F$ the Frobenius norm of a matrix~$A$.
We are given a training set $\{(\x^{(i)},\y^{(i)})\}_{i=1}^{m}\subset\R^{d_x}\times\R^{d_y}$, and would like to learn a hypothesis (predictor) from a parametric family~$\HH:=\{h_\theta:\R^{d_x}\to\R^{d_y}\,|\,\theta\in\Theta\}$ by minimizing the $\ell_2$~loss:\note{
Much of the analysis in this paper can be extended to loss types other than~$\ell_2$.
In particular, the notion of deficiency margin (Definition~\ref{def:margin}) can be generalized to account for any convex loss, and, so long as the loss is differentiable, a convergence result analogous to Theorem~\ref{theorem:converge} will hold in the idealized setting of perfect initial balancedness and infinitesimally small learning rate (see proof of Lemma~\ref{lemma:descent}).
We leave to future work treatment of approximate balancedness and discrete updates in this general setting.
}
$$\min_{\theta\in\Theta}~L(\theta):=\frac{1}{2m}\sum\nolimits_{i=1}^m\|h_\theta(\x^{(i)})-\y^{(i)}\|^2
\text{\,.}$$
When the parametric family in question is the class of linear predictors, \ie~$\HH=\{\x\mapsto{W}\x\,|\,W\in\R^{d_y\times{d}_x}\}$, the training loss may be written as $L(W)=\frac{1}{2m}\|WX-Y\|_F^2$, where~$X\in\R^{d_x\times{m}}$ and~$Y\in\R^{d_y\times{m}}$ are matrices whose columns hold instances and labels respectively.
Suppose now that the dataset is \emph{whitened}, \ie~has been transformed such that the empirical (uncentered) covariance matrix for instances~---~$\Lambda_{xx}:=\frac{1}{m}XX^\top \in\R^{d_x\times{d}_x}$~---~is equal to identity.
Standard calculations (see Appendix~\ref{app:whitened}) show that in this case:
\be
L(W)=\frac{1}{2}\norm{W-\Lambda_{yx}}_F^2+c
\label{eq:loss_whitened}
\text{\,,}
\ee
where~$\Lambda_{yx}:=\tfrac{1}{m}YX^\top\in\R^{d_y\times{d}_x}$ is the empirical (uncentered) cross-covariance matrix between instances and labels, and $c$ is a constant (that does not depend on $W$).
Denoting~$\Phi:=\Lambda_{yx}$ for brevity, we have that for linear models, minimizing $\ell_2$~loss over whitened data is equivalent to minimizing the squared Frobenius distance from a \emph{target matrix}~$\Phi$:
\be
\min\nolimits_{W\in\R^{d_y\times{d}_x}}~L^1(W):=\frac{1}{2}\norm{W-\Phi}_F^2
\text{\,.}
\label{eq:lin_obj}
\ee
Our interest in this work lies on \emph{linear neural networks}~---~fully-connected neural networks with linear activation.
A depth-$N$ ($N\in\N$) linear neural network with hidden widths $d_1,\ldots,d_{N-1}\in\N$ corresponds to the parametric family of hypotheses $\HH:=\{\x\mapsto{W}_{N}W_{N-1}\cdots{W}_1\x\,|\,W_j\in\R^{d_j\times{d}_{j-1}},\,j=1,\ldots,N\}$, where $d_0:=d_x,\,d_N:=d_y$.
Similarly to the case of a (directly parameterized) linear predictor (Equation~\eqref{eq:lin_obj}), with a linear neural network, minimizing $\ell_2$~loss over whitened data can be cast as squared Frobenius approximation of a target matrix $\Phi$:
\be
\min\nolimits_{W_j\in\R^{d_j\times{d}_{j-1}},\,j=1,\ldots,N}~L^N(W_1,\ldots,W_N):=\frac{1}{2}\norm{W_{N}W_{N-1}\cdots{W}_1-\Phi}_F^2
\label{eq:lnn_obj}
\text{\,.}
\ee
Note that the notation~$L^N(\cdot)$ is consistent with that of Equation~\eqref{eq:lin_obj}, as a network with depth~$N=1$ precisely reduces to a (directly parameterized) linear model.
We focus on studying the process of training a deep linear neural network by \emph{gradient descent}, \ie~of tackling the optimization problem in Equation~\eqref{eq:lnn_obj} by iteratively applying the following updates:
\be
W_j(t+1)\leftarrow{W}_j(t)-\eta\frac{\partial{L}^N}{\partial{W}_j}\big(W_1(t),\ldots,W_N(t)\big)\quad,\,j=1,\ldots,{N}\quad,\,t=0,1,2,\ldots
\label{eq:gd}
\text{~~,}
\ee
where $\eta>0$ is a configurable learning rate.
In the case of depth~$N=1$, the training problem in Equation~\eqref{eq:lnn_obj} is smooth and strongly convex, thus it is known (\cf~\citet{boyd2004convex}) that with proper choice of~$\eta$, gradient descent converges to global minimum at a linear rate.
In contrast, for any depth greater than~$1$, Equation~\eqref{eq:lnn_obj} comprises a fundamentally non-convex program, and the convergence properties of gradient descent are highly non-trivial.
Apart from the case~$N=2$ (shallow network), one cannot hope to prove convergence via landscape arguments, as the strict saddle property is provably violated (see Section~\ref{sec:intro}).
We will see in Section~\ref{sec:converge} that a direct analysis of the trajectories taken by gradient descent can succeed in this arena, providing a guarantee for linear rate convergence to global minimum.
\medskip
We close this section by introducing additional notation that will be used in our analysis.
For an arbitrary matrix~$A$, we denote by~$\sigma_{max}(A)$ and~$\sigma_{min}(A)$ its largest and smallest (respectively) singular values.\note{
If~$A\in\R^{d\times{d'}}$, $\sigma_{min}(A)$~stands for the $\min\{d,d'\}$-th largest singular value.
Recall that singular values are always non-negative.
}
For~$d\in\N$, we use~$I_d$ to signify the identity matrix in~$\R^{d\times{d}}$.
Given weights $W_1,\ldots,W_N$ of a linear neural network, we let~$W_{1:N}$ be the direct parameterization of the \emph{end-to-end} linear mapping realized by the network, \ie~$W_{1:N}:=W_{N}W_{N-1}\cdots{W}_1$.
Note that $L^N(W_1,\ldots,W_N)=L^1(W_{1:N})$, meaning the loss associated with a depth-$N$ network is equal to the loss of the corresponding end-to-end linear model.
In the context of gradient descent, we will oftentimes use~$\ell(t)$ as shorthand for the loss at iteration~$t$:
\be
\ell(t):=L^N(W_1(t),\ldots,W_N(t))=L^1(W_{1:N}(t))
\text{\,.}
\label{eq:gd_loss}
\ee
\section{Related Work} \label{sec:related}
\vspace{-2mm}
Theoretical study of gradient-based optimization in deep learning is a highly active area of research.
As discussed in Section~\ref{sec:intro}, a popular approach is to show that the objective landscape admits the properties of no poor local minima and strict saddle, which, by~\citet{ge2015escaping,lee2016gradient,panageas2017gradient}, ensure convergence to global minimum.
Many works, both classic (\eg~\citet{baldi1989neural}) and recent (\eg~\citet{choromanska2015loss,kawaguchi2016deep,hardt2016identity,soudry2016no,haeffele2017global,nguyen2017loss,safran2018spurious,nguyen2018loss,laurent2018deep}), have focused on the validity of these properties in different deep learning settings.
Nonetheless, to our knowledge, the success of landscape-driven analyses in formally proving convergence to global minimum for a gradient-based algorithm, has thus far been limited to shallow (two layer) models only (\eg~\citet{ge2016matrix,du2018power,du2018algorithmic}).
An alternative to the landscape approach is a direct analysis of the trajectories taken by the optimizer.
Various papers (\eg~\citet{brutzkus2017globally,li2017convergence,zhong2017recovery,tian2017analytical,brutzkus2018sgd,li2018algorithmic,du2018gradient,du2018convolutional,liao2018almost}) have recently adopted this strategy, but their analyses only apply to shallow models.
In the context of linear neural networks, deep (three or more layer) models have also been treated~---~\cf~\citet{saxe2014exact} and~\citet{arora2018optimization}, from which we draw certain technical ideas for proving Lemma~\ref{lemma:descent}.
However these treatments all apply to gradient flow (gradient descent with infinitesimally small learning rate), and thus do not formally address the question of computational efficiency.
To our knowledge, \citet{bartlett2018gradient}~is the only existing work rigorously proving convergence to global minimum for a conventional gradient-based algorithm training a deep model.
This work is similar to ours in the sense that it also treats linear neural networks trained via minimization of $\ell_2$~loss over whitened data, and proves linear convergence (to global minimum) for gradient descent.
It is more limited in that it only covers the subclass of linear residual networks, \ie~the specific setting of uniform width across all layers ($d_0=\cdots=d_N$) along with identity initialization.
We on the other hand allow the input, output and hidden dimensions to take on any configuration that avoids ``bottlenecks'' (\ie~admits $\min\{d_1,\ldots,d_{N-1}\}\geq\min\{d_0,d_N\}$), and from initialization require only approximate balancedness (Definition~\ref{def:balance}), supporting many options beyond identity.
In terms of the target matrix~$\Phi$, \citet{bartlett2018gradient}~treats two separate scenarios:\note{
There is actually an additional third scenario being treated~---~$\Phi$~is asymmetric and positive definite~---~but since that requires a dedicated optimization algorithm, it is outside our scope.
}
\emph{(i)}~$\Phi$ is symmetric and positive definite;
and~\emph{(ii)}~$\Phi$ is within distance~$1/10e$ from identity.\note{
$1/10e$~is the optimal (largest) distance that may be obtained (via careful choice of constants) from the proof of Theorem~$1$ in~\citet{bartlett2018gradient}.
}
Our analysis does not fully account for scenario~\emph{(i)}, which seems to be somewhat of a singularity, where all layers are equal to each other throughout optimization (see proof of Theorem~$2$ in~\citet{bartlett2018gradient}).
We do however provide a strict generalization of scenario~\emph{(ii)}~---~our assumption of deficiency margin (Definition~\ref{def:margin}), in the setting of linear residual networks, is met if the distance between target and identity is less than~$0.5$.
| {'timestamp': '2019-10-29T01:06:05', 'yymm': '1810', 'arxiv_id': '1810.02281', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02281'} | arxiv |
\section{Introduction}\label{sec:intro}}
\input{tex/intro.tex}
\section{Motivation and Example Data} \label{sec:motiv}
\input{tex/motiv.tex}
\section{Related Work} \label{sec:rel}
\input{tex/rel.tex}
\section{Tasks for Binned 2D Data} \label{sec:tasks}
\input{tex/tasks.tex}
\section{Design Space} \label{sec:design}
\input{tex/design.tex}
\section{Implementation} \label{sec:impl}
\input{tex/impl.tex}
\section{Discussion and Outlook} \label{sec:dis}
\input{tex/dis.tex}
\section{Conclusion} \label{sec:conclusion}
\input{tex/conclusion.tex}
\ifCLASSOPTIONcaptionsoff
\newpage
\fi
\bibliographystyle{abbrv}
\subsection{Task List}
\ldaall
Tasks for 2D point data that was aggregated by binning are connected to the more general tasks for regular scatterplots, for which an analysis and categorization of tasks has been published~\cite{Sarikaya2018}.
The task space that we derive and discuss in this section, is an extended subset of this larger collection of tasks that can be supported by general, unbinned scatterplots.
We refine the derived set of tasks according to the task design space of Schulz~\latinphrase{et~al.}\xspace~\cite{Schulz2013}, and ground each of these abstract tasks in a concrete example from the previously introduced data sets.
Based on a review of relevant literature, Sarikaya and Gleicher~\cite{Sarikaya2018} collect and categorize a set of 12 tasks that users do with scatterplots.
Those tasks are grouped into three different categories, comprising \emph{object-centric} tasks, \emph{browsing}, and \emph{aggregate-level} tasks.
The first type, \emph{object-centric}, focuses on single data objects, and includes identifying and finding the location of a particular object.
In other words, \emph{object-centric} tasks cover all the low-level data characteristics of Schulz~\latinphrase{et~al.}\xspace's task design space~\cite{Schulz2013}.
The second category, \emph{browsing}, comprises tasks focused on either single data items or higher level structures such as clusters, and thus targets low- as well as high-level data characteristics.
The third category, \emph{aggregate-level} tasks, focus entirely on high-level data characteristics.
When working with binned scatterplots, the data analyst has decided that aggregating the data is the best way to perform the task at hand.
Since the aggregation step abstracts away from single items, leaving only high-level data characteristics, we can reduce the set of potential tasks supported by a binned scatterplot to \emph{browsing} and \emph{aggregate-level} tasks.
Binned representations of multi-class data introduces two new visual elements that analysis tasks can target, \emph{bins} and \emph{classes}.
The dimension that captures this is called the \emph{scope} (or \emph{cardinality}) of a task~\cite{Schulz2013}.
Each of the tasks in our space can either be targeted at bins (\emph{bin-centric}), or at classes (\emph{class-centric}).
Extending the task set along this dimension is helpful for tasks supported by binned representation of 2D data, since it significantly influences the adequacy of designs to serve a task.
Table~\ref{targetTable} lists all resulting tasks and diversifies them into a \emph{bin-centric} and a \emph{class-centric} version.
In addition, a more extensive table, mapping all of the abstract tasks to high-level data characteristics and example tasks discussed in the following section is available as supplemental material (see also \S\ref{sec:dis} for a discussion of task completeness).
\subsection{Task Examples}\label{sec:example_tasks}
We have already seen examples for the first six tasks from Table~\ref{targetTable} back in \S\ref{sec:motiv}.
Here, we introduce two additional datasets and show designs and examples for the remaining tasks.
\vspace{1mm} \noindent \textbf{Early Modern Drama Collection} contains the full text of 1,242 dramas from the years 1576--1700.
The texts are categorized into nine different genres, including \crule[tr]{0.25cm}{0.25cm}\xspace tragedy, \crule[tc]{0.25cm}{0.25cm}\xspace tragicomedy, and others (see caption of Figure~\ref{ldaall}).
Both dimensions have been generated using topic modeling to extract eight distinct topics based on the document-level co-occurrences of words across the corpus.
A topic is represented as a list of weighted words that are used in documents to talk about the topic.
We then picked two topics as dimensions to lay out the documents, based on the amount of words that each of the documents contains from the respective topic.
An example analysis scenario is to explore how those two topics separate the different drama genres.
Figure~\ref{ldaall}a shows a traditional scatterplot of the dataset based on those two dimensions.
While we are able to see some rough structure, especially in terms of class distribution for the larger classes such as for \crule[co]{0.25cm}{0.25cm}~comedies and \crule[tr]{0.25cm}{0.25cm}~tragedies, it is hard to spot the positions and distribution of the smaller classes.
To get a better sense of the general density distribution of the plot (\emph{task 7: characterize distribution -- bin}), we can take a look at the design in Figure~\ref{ldaall}b.
It uses color weaving to combine unnormalized color counts from all classes.
The number of colored fragments representing the overall density of each bin.
We can see that the general density is roughly distributed within a triangular shape, with density centers close to its three corners (\emph{task 9: identify anomalies -- bin}).
Next, we are interested in whether the different drama genres are separated based on the position within the plot (\emph{task 8: characterize distribution -- class}).
Figure~\ref{ldaall}c can give us initial insight into which bins are density centers for the classes.
It uses rectangular bins colored by interpolating the colors of all classes in each bin, weighted by densities normalized across categories.
Bins are thus dominated by the color of the class that has density peaks within the respective bin.
It thus provides an overview of class intensities across the space.
We can see that the two largest groups, \crule[co]{0.25cm}{0.25cm}~comedies and \crule[tr]{0.25cm}{0.25cm}~tragedies are mostly placed on the left and the right of the plot.
While Figure~\ref{ldaall}c colors entire bins based on color blending, Figure~\ref{ldaall}d shows density information for each class by mapping tone of each color to class intensity.
Rather than providing a coarse overview, it allows users to see more specific properties of class distributions and supports an in-depth analysis of class overlaps.
We can see that the density centers for the drama types \crule[tr]{0.25cm}{0.25cm}\xspace tragedy and \crule[co]{0.25cm}{0.25cm}\xspace comedy are situated along an axis from the left side of the space to its right side, with the density center for \crule[tc]{0.25cm}{0.25cm}\xspace tragicomedy right between both.
All other types are roughly aligned along a perpendicular axis from the top of the plot further down.
We can also see, that while class density centers seem to be separated by the dimensions of this space, there is a huge overlap between the classes.
One interesting class whose distribution pattern is different from the others (\emph{task 10: identify anomalies -- class}) is \crule[hi]{0.25cm}{0.25cm}\xspace history, which has its density center right in the middle of the plot and has lots of overlap with every other class in the dataset.
\treecoverall
\vspace{1mm} \noindent \textbf{Colorado Tree Coverage} dataset is part of the UCI machine learning data repository~\cite{Lichman2013}.
It contains data about the arbor environment of four wilderness areas in Colorado.
Each entry of the data set contains attributes of one individual tree, including variables such as tree type, position, and additional environmental factors.
Overall the data set covers seven different types of trees.
An example analysis scenario for this data set is to analyze how different environmental variables influence absolute and relative proportions of tree types in a region.
For this example, we focus on two specific variables from the data set.
The first one,`elevation', encodes the meters above sea level at which a tree grows, and helps to stratify the environment into different regions that tree types might prefer.
The second one, `horizontal distance to hydrology', encodes the number of meters (in horizontal direction) to the next water source.
Figure~\ref{treecoverall}a shows a traditional scatterplot of the roughly 600,000 trees.
We can get an impression of the areas in which different types of trees grow, but overdraw is a huge problem.
A question such as whether there is a correlation between elevation level and the variety of tree types that grow on that level (\emph{task 11: identify correlation -- bin}) is hard to answer.
From Figure~\ref{treecoverall}b, however, we can easily see that variety decreases with rising elevation based on the number of classes within the pie charts.
The design is based on hexagonal bins without showing explicit boundaries or bin shapes.
This design aspect has the advantage of reducing visual clutter, but it also makes it harder to read exact bin positions off the plot.
Pie charts convey class proportions in each of the bins, while the area of each pie chart encodes overall point density in the bin.
From this design, we can easily learn about the general density distribution across the bins in addition to a rough impression of relative class distributions.
Analyzing distributions within single classes, and the regions of overlap between multiple classes are, however, hard to explore with this design.
Figure~\ref{treecoverall}c is an alternative for this data set with explicit outlines for each bin.
The background colors are the result of blending together all class colors present in a bin, weighted according to their frequency within the bin.
This enables us to quickly read the main class present in a bin and gauge each bin's pureness with respect to class distribution.
Similar to the previous design, the plot conveys rough class distributions based on the blended background colors.
This design also shows a subset of points for each bin, sampled based on the distribution of classes within the bin, but at least one data point per class.
It allows us to see classes that have very low frequency compared to others.
From Figure~\ref{treecoverall}c we can see that the most prominent type of trees in an environment varies with elevation level.
We then wonder whether elevation level can help us separate between different tree types (\emph{task 12: identify correlation -- class}).
While there is a lot of overlap generally between types, we can see from Figure~\ref{ldaall}c, for example, that \crule[ponderosa]{0.25cm}{0.25cm}\xspace ponderosa pines do not grow above 2800m, while \crule[krumm]{0.25cm}{0.25cm}\xspace krummholz starts to appear at about 3300m.
Figure~\ref{ldaall}b also allows us to quickly spot regions of high (or low) density---such as the high concentration of trees at 2800--3200 meters, very close to the nearest water source (\emph{task 13: numerosity comparison -- bin}).
The next questions we might ask is whether both tree types in the area contribute equally to this peak, or whether this is due to one particular type (\emph{task 14: numerosity comparison -- class}).
From unnormalized frequencies in Figure~\ref{treecoverall}d, we can see that there are actually two overlapping density peaks in \crule[lodgepole]{0.25cm}{0.25cm}\xspace lodgepole pines, and, at slightly higher altitude levels \crule[spruce]{0.25cm}{0.25cm}\xspace spruce/fir that both combine to this peak in tree density.
Another question we might have for the dataset are general boundaries of tree growth (\emph{task 15: understand distances -- bin}).
From Figure~\ref{treecoverall}c we can see that \crule[cottonwood]{0.25cm}{0.25cm}\xspace cottonwood, \crule[douglas]{0.25cm}{0.25cm}\xspace douglas firs, and and \crule[ponderosa]{0.25cm}{0.25cm}\xspace ponderosa pines need water close by (700 meters to the nearest water source), while the other four types are much less dependent on close surface water.
The plot also shows that most trees have a preferred elevation range in which they grow, with bands of roughly 500-600 meters of altitude and large overlaps between the different tree types across those regions (\emph{task 16: understand distances -- class}).
\subsection{Fatality Analysis Reporting System (FARS) Dataset}
This is a dataset about fatal car crashes that includes car crashes in California from 2011-2015 \cite{farsdata2017}. We picked 5 of the most common crash types in the dataset and investigate their distribution. Figure \ref{farsall}(a) shows a scatterplot based on this dataset. We can see rough distribution that car crashes happen more in big cities. Figure \ref{farsall}(b) shows a splatterplot \cite{Mayorga2013} version of this dataset. Splatterplot is a design of KDE that shows aggregated information. We have clearer overview of the most dense area in this figure and relative density of a specific class. However, both scatterplot and splatterplot do not clearly show which crash type happens more often. Figure \ref{farsall}(c) shows a design of binned aggregation. In this figure, we can see that car crashes happen more in big cities and south California has more accidents. It is not surprising to see this since the traffic is heavier in cities. Los Angelas is a ``cars first" city, so it is reasonable to see more car crashes in Los Angelas. By using binned aggregation, we have the freedom of focusing on specific regions (e.g., comparing San Francisco and Los Angelas) by parametrizing the size and the position of the bins.
Besides, we can see that ``Drive off Road" (labeled as 2 in Figure \ref{farsall}) is the most common crash type no matter in big cities or not from Figure \ref{farsall}(c). In that case, we might want to investigate the reason why people are more likely to drive off road. Moreover, it seems that ``Control/Traction Loss" (labeled as 1 in Figure \ref{farsall}) happens more in the south-east part of California. A possible reason might be people tend to drive faster in that region.
\farsall
\subsection{Tree Cover Type Datasets} This is a standard dataset from the UCI machine learning repository \cite{Lichman2013}. It is derived from a cartographic survey of the Roosevelt National Forest of Colorado. It contains seven different kinds of tree cover types. We extracted two attributes from the dataset: elevation and horizontal distance to hydrology (nearest surface water). Elevation is the attribute that separates different tree types most. Its scatterplot is shown in Figure \ref{treecoverall}(a). Although we can see rough boundary of some classes in this figure, it is hard to see all 7 classes. It is even harder to tell proportion of different tree types in a specific region. Figure \ref{treecoverall}(b) shows the splatterplot of the dataset. In splatterplot, we can better see the range of different tree types when looking at elevation. We can also see that trees with larger elevation tend to spread out more in the domain of horizontal distance to hydrology. However, it is hard to read the color of overlapping part and we might need to carefully trace the boundary to understand the class labels. Figure \ref{treecoverall}(c) shows the dataset in binned aggregation. From this figure, we can see that the most dense part is when elevation is between 2800 - 3200 meters. Suprisingly, it is not the same area with most tree type diversity that we can clearly see in Figure \ref{treecoverall}(b). It is due to different parameters set in the function when generating splatterplot. People might have difficulty set a suitable threshold in splatterplot without enough statistic background. Yet, binned aggregation does not require this knowledge. It could show variety of tree types in a region and distribution of different tree types. It has lower chance to mislead people without concrete statistics background. From binned aggregation, we can find out that in the area with the most variety, tree type 2 has the largest proportion. We could further investigate whether tree type 2 is suitable to survive in more kinds of environments.
We can also see that tree type 1 and tree type 2 live in similar elevation and distance of hydrology. Having this information, we can further investigate whether these two tree types are competitor or mutually beneficial.
\treecoverall
\subsection{Data Aggregation Methods}
Binning is a frequently used method to help address the problem of overdraw with traditional scatterplots.
According to Battersby~\cite{Battersby2016}, its computational efficiency, and the perceptual advantages of regular grids for comparing densities within and between aggregated plots are reasons for the popularity of binning.
Cleveland describes how it can be used to address issues of overdraw and occlusion in his book~\cite{Cleveland1985}.
He places great importance on the ability of the binned representation to convey a sense of aggregate distributions (see also discussion of choosing bin shape and size in \S\ref{sec:shape} and \S\ref{sec:size}), while sacrificing the ability of the viewer to identify individual points.
Carr stresses the computational efficiency of binning, and reiterates its importance to show distributions by applying binning to SPLOMs in order to understand distributions across many dimensions~\cite{Carr1986}.
Aside from regular lattices, other shape types and tesselations can be used to achieve different design goals.
Battersby \latinphrase{et~al.}\xspace~\cite{Battersby2016} show that geographical distortion of bin shape can impact viewers' ability to compare count and density measures.
An example method of methodologically creating irregular bins is to ensure that each bin contains the same number of data instances~\cite{Bak2009,Hao2010}.
In this case, as the number of data items increases, spatial bins must also grow in size.
As a follow-up, Hao \latinphrase{et~al.}\xspace~\cite{Hao2010} propose variable binned scatterplots, a method that shows each region in a separate plot large enough to show all points without occlusion.
Cartograms are an example of modifying bin size to communicate magnitude of data instances, and different techniques have varying analysis trade-offs~\cite{Sun2010, Nusrat2015}.
For choropleth maps that communicate magnitude within bins with color, Brewer \latinphrase{et~al.}\xspace~\cite{Brewer1997} evaluate the use of diverging, sequential, and spectral color schemes to support different analysis tasks.
As an alternative to discrete aggregations methods, kernel density estimation (KDE) can aggregate point data to a continuous scalar field~\cite{Scott2015}.
Techniques such as Splatterplots~\cite{Mayorga2013} can utilize these methods to create semantically meaningful visualizations that automatically scale to the available screen-space.
While Splatterplots uses thresholding to denote areas of density, Chen \latinphrase{et~al.}\xspace~\cite{Chen2014} takes advantage of space-aware subsampling to illustrate proportional densities with smaller amounts of points.
Isocontours can also be computed from a KDE, describing densities much like a topographic map~\cite{Urness2003}.
Jo \latinphrase{et~al.}\xspace~\cite{Jo2019} describe how vonoroi tesselations can create variable bins shapes and sizes, dependent on the distribution.
While our focus is on regular bins, we also consider tasks and designs for irregular lattices as sources for design ideas.
\newTasksTable
\subsection{Visual Representations for Binned Data}
The results of binning multi-class data are scalar fields over a regular lattice.
For the visual encoding of this type of data, many alternatives are available to communicate both frequencies and distributions of classes, and facilitate comparison between them based on both.
Color is one common visual variable to encode frequency.
Aside from using continuous color channels such as luminance to convey frequency~\cite{Brewer1997}, color ramps can be chosen to emphasize frequency peaks~\cite{Liu2013}, and quantized to improve viewers' accuracy of color perception and recall~\cite{Padilla2017}.
For particular tasks, designs may want to highlight frequencies that do not match an underlying distribution---Correll and Heer~\cite{Correll2017} uses Bayesian surprise as an orthogonal dimension in a bi-variate color map, emphasizing those areas with unusually high or low frequency.
Another common use of color is to communicate class identity.
Color weaving~\cite{Shenas2007} assigns proportions of color conveying membership pixel-wise to an area, then permutes those pixels to create a proportional tapestry of color.
It thus uses color to communicate both, class identity as well as frequency.
Color weaving can help to elucidate class proportions in dense areas of the plot, as described by Luboschik \latinphrase{et~al.}\xspace~\cite{Luboschik2010}.
Attribute blocks~\cite{Miller2007} can show the proportions of a large number of classes by further subdividing bins, using each bin to encode a single class frequency via color.
Other choices for conveying frequency and class membership include texture and size, sometimes combined with a color encoding.
Ware~\cite{Ware2009} uses textons (small texture-based glyphs) and color to allow the viewer to compare two scalar fields.
Tobler~\cite{Tobler1973} uses textures that are able to convey continuous values in choropleth maps via quantization.
The ideas for visualizing regular and non-regular 2D density fields from these approaches helps to inform our exploration of visual designs suitable for binned aggregation throughout this paper.
\subsection{Linking Task and Design}
Taxonomies of tasks and designs use abstraction to emphasize differences and similarities without dependencies on the implementation and domain details.
Tasks are a core consideration in the design of visualizations, scaffolding the viewer to obtain the desired information about the data (see Munzner~\cite{Munzner2015} for an overview).
Early work by Shneiderman~\cite{Shneiderman1996} has been extended by numerous other task taxonomies; see Bremer and Munzner~\cite{Brehmer2013} for an overarching taxonomy.
More domain-specific task sets have been proposed for areas such as cartography~\cite{Andrienko2006,Roth2013}.
Of particular interest for this paper, Schulz \latinphrase{et~al.}\xspace~\cite{Schulz2013} create a generalized space of visualization analysis task, taking into account the cardinality of objects being considered, as well as the types of data characteristics (e.g., distribution, outliers) communicated by the task.
Our interest is in how tasks relate to the designs of a resulting binned visualization.
While no such work exists for this scenario, previous has focused on other combinations of design decisions and tasks.
Javed and Elmqvist~\cite{Javed2012} describe the design space of compositing visualizations, basing their analysis on the literature.
Schulz \latinphrase{et~al.}\xspace~\cite{Schulz2011} review and extend the visualization design space for hierarchical data, similar as we do for multi-class binning.
Borgo \latinphrase{et~al.}\xspace~\cite{Borgo2013} compile an overview of glyph-based visualization and design guidelines with associated tasks from examples in the literature.
Informed by the guidelines in Kerracher and Kennedy~\cite{Kerracher2017}, we validate our task classification through examining existing taxonomies and instantiating abstract tasks on concrete analyses.
Closely related to our paper, Sarikaya and Gleicher~\cite{Sarikaya2018} provide a space of analysis tasks, data characteristics, and design decisions derived from existing examples in the literature.
Their guidance is generalized to the entire space of scatterplot designs, suggesting a need for more specific analysis for particular scenarios such as for multi-class binning.
Jo \latinphrase{et~al.}\xspace~\cite{Jo2019} generate a grammar for deriving numerous binned designs, highlighting decisions of encoding type and normalization.
This work, however, stops short of drawing relationships between design decisions and the types of analysis tasks they support.
We seek to fill this gap with this work.
\subsection{Representing Bins}
The first three design dimensions discuss choices to generate and represent bins and their properties within the 2D space.
\subsubsection{Shape} \label{sec:shape}
All of the designs that we discuss are based around visual representations of the bins generated during the first part of the abstraction process.
For this reason, the choice of bin shape, which is part of the output of the first step of binning, depends on statistical and distributional characteristics of the data, as well as perceptual properties of the resulting visualization.
In addition to choosing an effective shape for the data and task at hand, designers should also take care in choosing the scale of axes, as the perception of distribution can be affected by the positioning of bins.
There are only three shapes to tessellate a 2D space: triangles, rectangles, and hexagons.
Scott~\cite{Scott1988} suggests that triangular bins should be avoided since dividing the space up into triangles results in a higher expected per-point position error than alternatives.
In addition, triangles require rotations of the shape.
Rectangular bins provide good contrast between orthogonal and diagonal neighbors~\cite{Birch2006}, making them a good choice if the alignment with vertical or horizontal neighbors are important.
They are the only shape with a constant interval along both axes, making them a good choice if either the task requires reading off intervals with a certain precision from the plot, or the chosen intervals have semantic meaning (such as temporal or spatial units).
Hexagons are particularly common on maps, and are considered aesthetically superior to alternatives~\cite{Carr1992}.
They are better at representing local neighborhoods of bins~\cite{Birch2007}, making them a good choice for bin-centric tasks that focus on local structure, such as \emph{tasks 1 and 2: explore neighborhood -- bin/class}.
Hexagons also introduce the least expected error between a point and the bin center, resulting in the least expected distortion of density counts~\cite{Scott1988}.
They are thus also well-suited for tasks that involve the identification of fine-grained local density gradients, such as \emph{tasks 9 and 10: identify anomalies -- bin/class}, or \emph{tasks 11 and 12: identify correlation -- bin/class}.
\subsubsection{Size} \label{sec:size}
Similar to bin shape, its size is also influenced by data characteristics and visual properties of the resulting display.
Its choice determines the number of bins, limiting or enhancing the spatial fidelity of the visualization.
For designs that are based on multiple plots (see discussion about comparison in \S\ref{sec:composition}), bin size can either be homogeneous or heterogeneous across the plots.
The latter allows designers to choose different spatial resolutions for each class, but complicates the mapping between plots (more in \S\ref{sec:interaction}).
Binning creates a 2D histogram of the data space, where bin size controls the degree of aggregation that is applied to the data.
It determines what details users are able to discern about the data.
Methods that find optimal solutions for a large range of different datasets have been studied by Wand~\cite{Wand1997} and Knuth~\cite{Knuth2006}.
Another aspect of bin size are perceptual aspects of the visual representations of the bins, which is governed by the available screen space for the visualization.
Smaller bin sizes reduces the fidelity of communicating both spatial and class-proportional information within each bin---this greatly affects class-specific tasks, such as \emph{task 14: numerosity comparison -- class}, or bin-centric ones that compare inbalanced class proportions, such as \emph{bin-centric tasks 1: explore neighborhood, 5: explore data, or 7: characterize distribution}).
The available space also affects color perception~\cite{Stone2012}.
Therefore, there is a balance in trade-offs between maximizing the number of bins to reduce spatial aliasing (smaller bin size), but large enough to convey distributional information for each bin (larger bin size).
\subsubsection{Bin Boundaries} \label{sec:boundary}
Bins that have no explicit boundaries have to contain glyphs to communicate distributional information (much like QTonS~\cite{Ware2009}, an overlay for a scalar field), such as the pie glyphs in Figure~\ref{treecoverall}b.
An advantage of boundary-less designs is reduced clutter.
For this reason, depending on the complexity and visual properties of the glyphs, smaller glyph sizes can be accommodated which are beneficial to tasks that profit from high spatial resolution (e.g., \emph{tasks 9 and 10: identify anomalies -- bin/class, and 11 and 12: identify correlation -- bin/class}).
However, missing bin boundaries make it harder to gauge the exact area a bin covers, hindering tasks that depend on this (e.g., \emph{tasks 7 and 8: characterize distribution -- bin/class}).
An example for a design that explicitly encodes the spatial boundaries of bins is shown in Figure~\ref{ldaall}b.
In addition to making bin intervals easier to read off the plot, explicit boundaries also help with mapping bins across different plots~\cite{Tory2003}, for example when using juxtaposed designs (as discussed in \S\ref{sec:composition}).
Another advantage of bin boundaries is that they introduce bins as separate visual elements into the plot, making it easier to support additional user interaction with them (see \S\ref{sec:interaction}).
\subsection{Composition}\label{sec:composition}
In this section, we discuss encoding classes and class distributions for each of the bins, and ways of composing this class-specific information into a multi-class density map.
\vspace{1mm}
\noindent \textbf{Class Identity}
The designs we discuss encode bin position in the data space as position in the plot.
Thus, while position would be a very salient channel for encoding identity~\cite{Mackinlay1986}, it is already in use for the two primary data attributes.
From the remaining choices, Livingston~\latinphrase{et~al.}\xspace~\cite{Livingston2012} find that color is quite effective.
This is by far the most popular choice in the literature, with few historic exceptions that use texture to encode class identity~\cite{Pierce1894}.
All of our designs and the following discussions are based on using color to encode class identity.
Those colors are combined in different ways to communicate a range of class distribution properties.
There are two exceptions to this, discussed in \S\ref{sec:colorplus}: one of our designs (attribute blocks) uses relative position within the bins, while another (hatching) uses angle to encode class identity.
Both designs redundantly encode these additional visual variables with color for class identity.
\vspace{1mm}
\noindent \textbf{Normalization}
After creating the spatial bins, the data items in each of the bins are reduced to raw frequency counts for each class present in the bin.
Normalization of those raw counts and the visual encoding of the resulting distribution are independent.
Still, choice of normalization has a significant influence on the adequacy of visual encodings and the types of comparisons that those encodings need to support for the task at hand.
The details of these dependencies are discussed with the designs in \S\ref{sec:distribution}.
There are three options for normalization:
\begin{itemize}
\item \emph{bin-internal}: all frequency counts are normalized by the maximum frequency in their bin.
\item \emph{class-internal}: all frequency counts are normalized by the maximum frequency in their class.
\item \emph{global}: all frequency values are normalized by the overall maximum frequency across bins and classes.
\end{itemize}
Designs based on bin-internal normalizations favor bin-centric tasks (\emph{odd-numbered tasks}).
As an example, Figure~\ref{treecoverall}b has been created using bin-internal normalization, with each of the pie charts depicting bin-relative class distributions.
It lets us compare overall densities and their distribution between bins and clusters of bins.
Comparing class intensities and numerosity of a particular class across the space, however, is not possible with this design.
Conversely, class-centric tasks (\emph{even-numbered tasks}) are supported with class-internal normalization that allows comparing class intensities across bins.
In addition, some class-centric tasks require global normalization, such as numerosity-based \emph{task 14: numerosity comparison -- class}, which depends on the ability to compare raw frequencies across bins.
Figure~\ref{ldaall}b and c are both use class-internal normalization and allow to compare class-specific properties.
Figure~\ref{treecoverall}d supports a class-centric task with global normalization, and allows for both comparison across and within bins.
\vspace{1mm}
\noindent \textbf{Scale}
Many of the designs are not effective at displaying details at the tail end of distributions.
For example, with unnormalized frequencies, if a large number of data items fall into smaller bins, it is difficult to see any details outside those dense bins.
The same is generally true for class distributions within bins.
Figure~\ref{nbabinall}b uses grayscale color to encode the number of total points in each bin, with darker background indicating higher numerosity.
Since the density of data items is particularly high around the basket, relative color difference of other bins across the space are diluted due to their relatively smaller difference in numerosity.
One possible solution is to scale the raw count numbers for each bin based an attenuation function.
The log-function is a popular choice~\cite{Cleveland1985b}.
Different variants are discussed in the literature as dynamic range reduction, see Shirley and Marschner~\cite{Shirley2009} for examples.
\vspace{1mm}
\noindent \textbf{Comparison}
The tasks from Table~\ref{targetTable} can be considered comparison tasks.
The bin-centric version of each task is a visual comparison between bin properties, while the class-centric versions are comparisons between local or global class properties.
Choice of visual design to support these comparisons has a significant effect on the types of tasks supported by a visualization.
Two comparison designs~\cite{Gleicher2011} widely used for binned scatterplots are juxtaposition and superimposition.
The former shows multiple visualization components separately, one per class in the data set (such as Figure~\ref{nbabinall}c).
Consequently, each class has its own coordinate system that can be adapted (and the resulting space aggregated) independently of the others.
Superimposition overlays multiple visualizations, one for each class, into a single view.
In this case, all data points share a common coordinate system.
Distributional information about classes is mixed on the bin level for superimposition-based designs (Figure~\ref{ldaall}c is an example for this).
Juxtaposition-based designs can only be combined with global or class-based normalization.
This makes them ideal for the analysis of density distributions within classes, and comparison of global features of those distributions across classes, such as \emph{class-centric tasks 4: search motif, 6: explore data , and 10: identify anomalies}.
One advantage of juxtaposed designs is that overall less information has to be presented in a bin, making it easier to find a good balance between proportional and spatial fidelity while remaining readable.
This also accommodates smaller bin sizes, resulting in potentially higher spatial resolution of the visualizations.
However, it is difficult to link classes across bins between multiple juxtaposed plots.
While this is true for plots with the same scale and bins, plots that differ in those properties make it even harder to visually match regions across multiple plots.
For this reason, tasks that require users to compare local features of density distributions across classes, such as \emph{class-centric tasks 2: explore neighborhood, 8: characterize distribution, and 14: numerosity comparison}, are better served with a superimposition-based design.
Juxtaposed designs neither support any of the bin-centric tasks well, because all of them require to collect densities across classes for each bin.
This is in line with Livingston~\latinphrase{et~al.}\xspace~\cite{Livingston2012}, who find that when tasks require reading multiple variables across different plots, juxtaposition has a higher error rate and slower response time.
\subsection{Density and Class Distribution}\label{sec:distribution}
This section discusses designs that convey classes, class proportions, and distributions within bins.
\subsubsection{Single Color}\label{sec:single_color}
These design alternatives are methods for using bin background color to communicate properties of the class distribution.
\vspace{1mm}
\noindent \textbf{Luminance (Grayscale or Color)}
While a univariate encoding does not communicate class distribution, it can convey item density within a bin.
Color luminance imparts an implicit order of magnitude~\cite{Munzner2015}.
This allows users to locate and explore bin properties related to item densities, and thus can serve a number of bin-centric tasks (e.g., \emph{tasks 1: explore neighborhood, 3: search motif, 5: explore data, 7: characterize distribution, 9: identify anomalies, 11: identify correlation, and 13: numerosity comparison}).
Padilla~\latinphrase{et~al.}\xspace~\cite{Padilla2017} find that binned color scales, as opposed to continuous ones, expedite tasks that include the identification of maxima (such as \emph{bin-centric tasks 5: explore data, 9: identify anomalies, and 13: numerosity comparison}).
Adding glyphs to the foreground of bins can extend task coverage of the base design (as in Figure~\ref{nbabinall}b, for example).
For class-based tasks, luminance can also be used in a juxtaposition-based design to convey densities of single classes separately.
To encode class identity, class colors are best used in each of the juxtaposed multiples instead of grayscale colors.
\vspace{1mm}
\noindent \textbf{Color of Majority Class}
Another option is to only show the color of the majority class for each bin.
Considering the choice of normalization, there are two versions of this, with bin-internal (or global normalization), or class-internal normalization.
With the former, each bin is colored according to the class that is most prominent (in terms of item numerosity) within a bin.
This is useful for \emph{bin-centric tasks 5: explore data, 7: characterize distribution, and 9: identify anomalies} that target the general distribution and anomalies.
The latter version colors bins based on which class has the highest relative proportion of members in a bin.
Figure~\ref{ldaall}b shows an example of this, revealing class-specific density centers.
Generally, the design serves tasks that target distribution and potential anomalies within classes, such as \emph{class-centric tasks 6: explore data, 8: characterize distribution, and 10: identify anomalies}.
The example in Figure~\ref{ldaall}b uses an additional luminance encoding of overall item densities for each bin.
This basic design is particularly effective in scenarios with a small set of classes.
\vspace{1mm}
\noindent \textbf{Color Blending}
With color blending (Figure~\ref{fig:blend_weave_and_hatch}a), class colors are combined according to a weighted average.
Again, weights can be based on class-internal or bin-internal normalization to focus on bin-centric and class-centric tasks, respectively.
Interpretation of blended colors is generally hard in cases with more than two base colors~\cite{Gama2014}.
Color blending is thus most useful for data sets with a small number of classes, and little overlap between more than two of them.
Compared to the previous method, it can provide a sense of the bin purity in terms of the classes it contains, helping to support some bin-centric (e.g., \emph{task 1: explore neighborhood}) and class-centric tasks (e.g., \emph{task 8: characterize distribution}).
\subsubsection{Color + Additional Variables}\label{sec:colorplus}
This section discusses color-based designs that use additional visual variables.
These differ from the previous three designs by occupying the entire bin area to convey distributional information, and can thus not be complemented with additional visualizations.
\vspace{1mm}
\noindent \textbf{Color Weaving}
An alternative to color blending is color weaving, a technique that permutes the positions of colored fragments while maintaining proportionality of each color.
It takes advantage of the visual system’s ability to summarize color within an area~\cite{Albers2014}.
Hagh-Shenas~\latinphrase{et~al.}\xspace~\cite{Shenas2007} show that users are better at discerning different contributing colors when using color weaving compared to color blending.
As a consequence, color weaving is as a more effective and scalable option to show class diversity and summary information for bins.
This, however, comes at the cost of not being able to combine this design with glyphs to cover additional tasks, because they would cover large areas of the space that are needed for accurate interpretation of the weaving pattern.
Depending on the normalization, color weaving can also be effective at conveying overall bin densities (as demonstrated in Figure~\ref{ldaall}b).
Bin-internal normalization will result in the optimal use of a bin's area to encode its class distributions by filling all available fragments (but does not allow comparisons across bins).
Global normalization, on the other hand, which allows for comparison of class frequencies across bins, results in some of the fragments of each bin remaining white.
Overall bin densities are then encoded by the ratio of white to colored fragments, allowing users to effectively compare overall densities across bins.
Figure~\ref{fig:blend_weave_and_hatch}b shows an example.
In addition to a variety of class-centric tasks, this design thus also supports many of the bin-centric tasks discussed for the luminance-based design in \S\ref{sec:single_color}.
Finally, we found that the third, class-internal, normalization option is not a good choice in combination with color weaving and may confuse users due to the implicit part-whole metaphor of color weaving.
This aspect of weaving is similar to pie chart glyphs, discussed in \S\ref{sec:glyphs}.
However, weaving can also be used in juxtaposed designs to generate multiple single-class density maps for class-centric tasks, such as in Figure~\ref{nbabinall}c.
One general disadvantage of weaving is that it is not very effective at conveying particularly small class proportions, since a low number of equally colored fragments is hard to discern.
\blendWeaveAndHatch
\vspace{1mm}
\noindent \textbf{Attribute Blocks: Tone and Position}
Attribute blocks~\cite{Miller2007} assign each class a square bin within a glyph.
Color luminance encoding a summary value for the class (see Figure~\ref{ldaall}d).
Livingston~\latinphrase{et~al.}\xspace~\cite{Livingston2012} show that attribute blocks have a high error rate for tasks that require reading multiple variates.
Their experiments only use position for class membership, with a color gradient for magnitude.
In our experience, using additional class colors (similar to Miller~\cite{Miller2007}) makes extracting class-specific distributions easier.
While attribute blocks can be combined with any type of normalization, they excel at class-centric tasks (using class-internal normalization), in particular those that involve analyzing class overlap across the space (\emph{class-centric tasks 6: explore data, 8: characterize distribution, 12: identify correlation, and 16: understand distances}).
\vspace{1mm}
\noindent \textbf{Hatching: Color and Angle}
Hatching is a particularly common choice to encode numerosity in monochrome choropleth maps~\cite{Peterson1979}.
A viable option for multi class data is to use simple, angled strokes for different classes, varying their density to encode class intensity.
Livingston~\latinphrase{et~al.}\xspace~\cite{Livingston2012} show that using orientation of lines to encode variable values (representing classes by angle) is a perceptually efficient, easily separable encoding for multiple variables.
In addition, it shows
An example of multi class hatching is shown in Figure~\ref{fig:blend_weave_and_hatch}c, with class-internal normalization.
It encodes class identity as both color and angle.
Despite the general trade-off between line thickness and resolution of density values, the design keeps classes separable due to redundant encoding, even if colors are hard to identify for thin lines~\cite{Stone2014}.
A disadvantage is that the drawing order of the lines influences their prominence across bins---denser lines exacerbate this effect.
One solution is adding interaction that lets users change class drawing order (as discussed in \S\ref{sec:interaction}).
This design is most effective for low to medium density values, and thus works best with global or class-internal normalization, especially for data that is well distributed throughout the space.
In addition, comparisons within classes and across bins are supported due to redundant encoding of class identity, making the design well-suited for class-centric tasks that analyze and compare class distributions (\emph{class-centric tasks 6: explore data, 8: characterize distribution, 10: identify anomalies}).
\subsubsection{Glyphs}\label{sec:glyphs}
Glyphs are small, independent visual objects that encode attributes of a data record~\cite{Borgo2013}.
They can either be added to the foreground of bins, or used in isolation.
When added to a base design, they increase task coverage in bins whose background is based on a single color value, while their effectiveness is reduced with more complex backgrounds by placing high cognitive load on users~\cite{Ware2013}.
We discuss three alternative glyph designs.
While they cover all of the tasks to convey class distributions, this list could be extended by additional glyphs that encode arbitrary properties of the data instances in a bin, thus, e.g., covering potential additional domain specific tasks of a particular dataset.
\vspace{1mm}
\noindent \textbf{Part-Whole (Pie Charts)}
Pie charts are a widely used solution to show proportion of different classes and part-whole relationships.
They are a common visualization technique available in geographic information systems to show distributions on top of choropleth maps~\cite{Anselin1999}.
There are multiple variations of pie charts~\cite{Kosara2010}, including donut and square pie charts.
Both regular pie and donut charts have comparable perceptual effectiveness~\cite{Skau2016}.
Figure~\ref{nbabinall}b shows standard pie charts, with color ordered according to class proportion and combined with a grayscale density map.
An alternative to encode overall item numerosity per bin is to use pie area, as shown in Figure~\ref{treecoverall}b.
While this has the advantage of reducing the number of visual elements in the plot, it exacerbates the poor visibility of sparse classes in the pies.
Pie charts can only be used with bin-internal normalization due to their part-whole metaphor, and there is evidence that they outperform alternatives when comparing class proportions across bins~\cite{Spence1991}.
This makes them a good solution for \emph{bin-centric tasks 3: search motif, 5: explore data, 7: characterize distribution, and 9: identify anomalies}.
However, care should be taken in case a tasks involves the identification of clusters across the space~\cite{Lewandowsky1993}.
\vspace{1mm}
\noindent \textbf{Baseline Proportional (Bar Charts)}
An alternative glyph, also borrowed from choropleth maps~\cite{Few2009}, are small bar charts, as shown in Figure~\ref{treecoverall}d.
They come in two flavors: regular and stacked.
Bar charts can be effective at conveying relative class proportion within each bin, and have the advantage of having a common bar baseline.
They have been used to successfully visualize multivariate datasets~\cite{Bo2014}, and allow users to accurately read values of proportion when the bin size is large enough.
Similar to pie charts, it can be hard to perceive class colors when the bars are small, though this problem can be somewhat alleviated by ordering bars according to class labels.
For stacked bar charts, users can have difficulties determining precise class proportions~\cite{Kosara2010}.
Despite these disadvantages, bar charts are a versatile design choice that can be used with all three types of normalization.
In contrast to pie charts, they allow for comparison across bins, which makes them suitable for class-centric tasks.
Bar charts are particularly useful for comparisons across bins and classes (e.g., for \emph{task 14: numerosity comparison -- class}).
\vspace{1mm}
\noindent \textbf{Points}
Point glyphs emphasize class variance within the bins.
They maintain a balance between showing class proportions and the spatial distribution of different classes.
For this, we sample the points in a bin to retain features of the underlying distribution.
This sampling strategy can be combined with all three normalization methods.
Bertini~\latinphrase{et~al.}\xspace~\cite{Bertini2006} and Chen~\latinphrase{et~al.}\xspace~\cite{Chen2014} show that sub-sampling points helps to overcome the problem of overdraw while preserving much of the spatial information.
Figure~\ref{treecoverall}c shows an example of this.
We sample points based on the class proportion and reduce overlap as much as possible.
In the case that a sampled point overlaps with the boundaries of the bin, its position is moved slightly towards the center.
To represent all of the classes present in a bin, proportion of a class may be distorted during sampling since we show at least one sample for each existing class.
This helps to identify small frequency phenomena, particularly for class-centric tasks, such as \emph{tasks 12: identify correlation, and 16: understand distances}.
\subsection{Interaction}\label{sec:interaction}
In addition to adding glyphs, another way of extending the supported tasks of a given design is adding interaction features to it.
Designs can support interaction on classes, bins, or both.
Selection of classes can either be done via the legend, by letting users hover over and click on labels.
Alternatively, in case a design includes glyphs, which have visually distinct elements for each class in a bin, interaction with these elements can highlight or select the respective class.
Selection of a class can either show additional information, such as distribution of the class or overlaps with other classes, filter all visual elements of a certain class, e.g., showing only the bars for one class in bar chart glyphs.
For designs that depend on the order of classes (Hatching in \S\ref{sec:colorplus}), highlighted or selected ones can be moved to the foreground.
Alternatively, it could open another view of the data that focuses on the selected class (similar to a juxtaposition-based design \S\ref{sec:composition}), switching to a class-centric visualization.
Generally, supporting filtering by class extends the tasks supported by a given design with additional, class-centric tasks.
Similar to classes, interacting with bins can also show additional information about each bin (e.g., raw counts of class items in a bin).
In addition, for juxtaposition-based designs, interaction can help users identify corresponding areas across multiple plots.
Corresponding referents can all be highlighted if multiple plots are based on identical bins.
If this is not the case, an additional overlay on the other plots can be used that shows the spatial extent of the selected bin across the other plots, conveying class and item overlaps with the existing bins of each juxtaposed plot.
Another mode of interaction on the bin-level is zooming.
Based on the zoom-level, once the items that can be viewed on the available screen space no longer overlap each other, the summary design could switch to a detail view that shows item per bins.
This can provide additional support for class- and bin-centric tasks that depend on local details, such as \emph{tasks 1: explore neighborhood -- bin, 2: explore neighborhood -- class, and 8: characterize distribution -- class}.
| {'timestamp': '2020-01-16T02:01:20', 'yymm': '1810', 'arxiv_id': '1810.02445', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02445'} | arxiv |
\section{Introduction}
There are many situations in cryptography where one is interested in
computing some function $F$ of a sensitive input $x$ but the
computational model is restricted so that only ``simple'' functions
$F$ can be directly computed. For instance, the entries of $x$ may be
encrypted so that only {\em affine} functions can be computed, or
distributed between multiple non-interacting parties so that only {\em
local} functions can be computed, or simply that we only know how to
construct schemes for handling simple functions.
For all of these reasons, it is useful to be able to ``encode''
complex functions as simple functions. An extremely influential
example of an ``encoding'' in the cryptographic literature is that of
garbling schemes (or randomized encodings), which have found
applications in many areas of cryptography and elsewhere
(see~\cite{Yao82,FKN94,IK00,AIK04,App11,BHR12,PSbook} and references
therein).
In this work, we consider the problem of \emph{inner product
encoding}, namely, representing an arbitrary predicate as the inner
product predicate on two vectors. Concretely, fix a Boolean function $P$ (a predicate) and
some modulus $q$ (may be composite as well as prime). We are interested in mappings $x \mapsto \vx, y \mapsto \vy$ that map to vectors in $\mathbb Z_q^\ell$ such that for
all $x,y$:
\[P(x,y) = 1 \Longleftrightarrow \ip{\vx,\vy}= 0 \bmod q,\]
and $\ell$ is as small as possible.
This notion is motivated by the study of predicate encryption in
\cite{KSW08}, where $q$ is typically very large, for instance, as
large as the domains of $P$, and can also be viewed as a natural
generalization of matching vector families to arbitrary predicates.
As an example, consider the equality
predicate over $[n]$. Here, if $q=2$, then it is not difficult
to show that the vectors must have length $\Omega(n)$. On the other
hand, if $q > n$, then it is sufficient to use vectors of length
$2$: the inner product of $(1,x)$ and $(y,-1)$ is $0 \bmod q$ iff $x=y$.
More generally, for any predicate $P :
\mathcal X \times \mathcal Y \rightarrow \{0,1\}$ and any prime $q \geq 2$,
the ``truth table'' construction achieves vectors of length
$\min\{ |\mathcal X|, |\mathcal Y|\}$.
Interestingly, inner product predicate encoding for the equality
predicate have been studied in combinatorics and complexity theory,
where they are known as matching vector families. Moreover, matching
vector families have found many applications, including the
construction of Ramsey graphs, private information retrieval (PIR)
protocols \cite{Grolmusz2000,Yek08,Efremenko12,DGY11,DG15}, and more recently,
secret-sharing schemes \cite{LVW17,LVW18,LV18}. Here,
prior works showed that if $q$ is a prime, then we must use vectors of
length $\Omega(n^{\frac{1}{q-1}})$ \cite{DGY11}.
\subsection{Our results}
Our main results are nearly tight bounds for many predicates considered in
the cryptographic literature such as greater than and threshold, for both
prime and composite modulus $q$. In particular, we have the following results for
prime modulus $q$:
\begin{itemize}
\item Greater than predicate for numbers in $[n]$ requires vectors of length
$n$. This rules out the possibility of deriving the predicate
encryption for range queries with $O(\sqrt{n})$ ciphertext and
secret key sizes in \cite{BW07} as a special case of inner product
predicate encryption.
\item Threshold for $n$-bit strings and threshold $t$ requires vectors
of length $2^{n-t+1}$. This rules out the possibility of constructing
full-fledged functional encryption schemes by carrying out FHE
decryption in the lattice-based predicate encryption of Gorbunov,
Vaikuntanathan and Wee \cite{GVW15} using a pairing-based functional
encryption scheme for the inner product predicate.
\end{itemize}
We then investigate encodings for composite $q$, specifically when $q$ is a product of $k$ distinct primes.
In many cases, a lower bound of $\ell/k$ for composite $q$ follows naturally if our method gives lower bound $\ell$ for prime $q$.
For predicates such as greater than, index and disjointness, we are able to show tight lower and upper bounds for both prime and composite $q$.
The full summary of upper and lower bounds is shown in Table \ref{tab:res}, and the listed predicates are described in Section \ref{sec:pre}.
Finally, we also consider probabilistic inner product predicate encoding.
For example, there is a probabilistic encoding of length $O((\log n)^2)$ for the greater than predicate for numbers in $[n]$, while any deterministic encoding must have length $\Omega(n)$, if $q$ is prime.
\begin{table}[h]
\begin{center}
\begin{tabular}{cccccc}\hline
predicate & \multicolumn{2}{c}{$q$ prime} & \multicolumn{2}{c}{$q$ product of $k$ primes}\\
& upper & lower & upper & lower\\\hline
$\mathbf{EQ}_n$\tablefootnote{Bounds from previous works, see Section \ref{sec:eq} for references.} & $O(qn^{\frac{1}{q-1}})$ & $\Omega(n^{\frac{1}{q-1}})$ & $2^{\tilde O\left((\log n)^{1/k}\right)}$ & $\Omega(\log n)$ \\
$\mathbf{GT}_n$ & $n$ & $n$ & $n/k$ & $n/k$\\
$\mathbf{DISJ}_n$\tablefootnote{\label{1sttablefoot}For sufficiently large $q$.}, $\mathbf{INDEX}_n, \mathbf{NEQ}_n$ & $n$ & $n$ & $n/k$ & $n/k$ \\
$\mathbf{ETHR}_n^t$\footref{1sttablefoot} \tablefootnote{Assuming $t \leq n-2$, see Section \ref{sec:ethr}.}& $n+1$ & $n/2$ & $n+1$ & $n/2k$ \\
$\mathbf{MPOLY}_n^{d,q}$ & $n^d$ & $n^d$ & $n^d$ & $n^d/k$ \\
$\mathbf{THR}_n^t$ & $n^{n-t+1}$ & $2^{n-t+1}$ & $n^{n-t+1}$ & $2^{n-t+1}/k$\\
$\mathbf{OR{-}EQ}_n^q$ & $2^n$ & $2^n$ & $2^n$ & $2^n/k$
\end{tabular}
\end{center}
\caption{Summary of upper and lower bounds}\label{tab:res}
\end{table}
\paragraph*{Our lower bound technique.} Our lower bound technique
is remarkably simple. Suppose that $q$ is prime and we can represent a predicate $P:
\mathcal X \times \mathcal Y \rightarrow \{0,1\}$ as an inner product
predicate on vectors of length $r$ corresponding to
mappings $x \mapsto \vx, y \mapsto \vy$. Following \cite{BDL13}, we consider a matrix $F$ of dimensions $|\mathcal X|
\times |\mathcal Y|$ over $\mathbb{Z}_q$ whose $(x,y)$'th entry is $\ip{\vx,\vy} \bmod q$.
Then the matrix $F$ has rank at most $r$, because we can write $F$ as
the product of two matrices of dimensions $|\mathcal X| \times r$ and
$r \times |\mathcal Y|$. Concretely, $F = UV$ where the $x$'th row of $U$
is $\vx^{\transpose}$ and the $y$'th column of $V$ is $\vy$. This means that to
show a lower bound on $r$, it suffices to show that $F$ has large rank,
e.g.~by exhibiting a full rank submatrix.
As an example, consider the greater than predicate on $[n]$ for any prime
modulus
$q$. Then, the matrix
$F$ is an $n \times n$ upper triangular matrix where all the entries on and above
the diagonal are non-zero. This matrix has rank $n$, hence any correct construction must have dimension at least $n$.
Note that the above lower bound argument breaks down when $q$ is composite.
In fact, if $q = 2^n$, there is an encoding for greater than with dimension
$1$: take $x \mapsto 2^x, y \mapsto 2^{n-y}$. Correctness follows from
the fact that $2^x \cdot 2^{n-y} = 0 \bmod 2^n \Leftrightarrow x \geq y$, and the
construction extends also to the setting where $q$ is a product of $n$
distinct primes.
In order to extend our lower bounds to composite $q$ that is the
product of $k$ distinct primes, we observe that if $F \bmod q$ contains a
triangular submatrix of dimensions $\ell \times \ell$, then there
exists some prime factor $p$ of $q$ such that $F \bmod p$ contains a
triangular submatrix of dimensions $\ell/k \times \ell/k$; this
follows from looking at the CRT decomposition of $q$ and a pigeonhole
argument. This simple observation allows us to translate many of our
lower bounds to the composite modulus setting, which we prove to be
essentially optimal via new upper bounds.
For instance, for the ``greater than'' predicate, we obtain a tight
bound of $n/k$ when $q$ is a product of $k$ distinct primes; this is
sharp contrast to standard matching vector families (i.e., the
equality predicate), where we have constructions of length
$2^{\tilde{O}((\log n )^{1/k})}$ when $q$ is a product of $k$ distinct
primes. For the upper bound, we begin with a construction of length $1$
for $k=n$ and then derive the more general construction by treating
the inputs as vectors of length $n$ and then dividing that into $n/k$
blocks each of length $k$.
Finally, we extend our results to the randomized setting. Here, we use a similar argument to show that the minimum size of a probabilistic inner product encoding is upper bounded by the probabilistic rank introduced by Alman and Williams \cite{AW17}.
\paragraph{Organization.}
The paper is organized as follows.
We describe our lower bound method in Section \ref{sec:main}.
The notation and predicates used throughout the rest of the paper are defined in Section \ref{sec:pre}.
In Section \ref{sec:det} we describe lower and upper bounds for these predicates.
Finally, we consider probabilistic encodings in Section \ref{sec:rand}.
\section{Main Theorem} \label{sec:main}
In this section we describe our lower bound technique.
Let $P : \mathcal X \times \mathcal Y \rightarrow \{0, 1\}$
be a predicate, and $q \geq 2$ be the integer modulus. We say that a matrix $F
: \mathcal X \times \mathcal Y$ \emph{represents} $P$ modulo $q$ if for all $x \in
\mathcal X, y \in \mathcal Y$, we have $F_{x,y} = 0 \bmod q$ iff
$P(x,y) = 1$.
An \emph{inner product encoding} of $P$ of length $\ell$ is a pair of mappings from $\clX, \clY$ to $Z_q^\ell$ that map $x, y$ to $\vx, \vy$ in a way that the matrix $F : \mathcal X \times \mathcal Y$ defined by $F_{x,y} = \ip{\vx, \vy} \bmod q = (\sum_{i=1}^{\ell} \vx_i \cdot \vy_i) \bmod q$ represents $P$.
Denote the length of the shortest reduction from $P$ to inner product modulo $q$ by $\DI(P,q)$ (Deterministic Inner product).
Then we have the following simple and effective lower bound method.
\begin{theorem} \label{thm:main} For any predicate $P$ and any prime $q \geq 2$, we have
\begin{equation*}\DI(P, q) = \min_{F} \rank(F),\end{equation*}
where $F$ is any matrix that represents $P$ modulo $q$.
\end{theorem}
\begin{proof}
We show that if $P$ can be represented by a matrix $F$ modulo $q$, then the necessary and sufficient length of the encoding from $P$ to $F$ is exactly $\rank(F)$.
The decomposition rank definition states that the rank of an $m \times n$ matrix $F$ is the smallest integer $r$ such that $F$ can be factored as $F=UV$, where $U$ is an $m \times r$ matrix and $V$ is a $r \times n$ matrix.
Let $U_{x,*}$ be the row vector of $U$ that corresponds to $x \in \clX$ and $V_{*,y}$ be the column vector of $V$ that corresponds to $y \in \clY$.
Then the pair of mappings $x \mapsto U_{x,*}^{\transpose}$ and $y \mapsto V_{*,y}$ is a correct encoding of $P$, which is also the shortest possible for $F$.
\end{proof}
Therefore, to show a lower bound on the length of an encoding for $P$, it is sufficient to exhibit a set of rows $R$ and a set of columns $C$ such that for any matrix $F$ that represents $P$, the submatrix $F[C,R]$ is a full rank submatrix.
Typically we find a large full rank upper triangular submatrix and apply Theorem \ref{thm:main}.
Other times, we prove a lower bound for some predicate $Q$, and then prove that the same lower bound holds for $P$ by showing a predicate reduction from $Q$ to $P$ (see Section \ref{sec:red} for details).
For composite $q$, we have the following lower bound:
\begin{theorem} \label{thm:composite}
Let $q = p_1\cdots p_k$ be a product of $k$ distinct primes.
Let $P$ be a predicate such that every matrix $F$ that represents $P$ modulo $q$ is a triangular $n \times n$ matrix such that all numbers on the main diagonal are non-zero modulo $q$.
Then
$$\DI(P,q) \geq n/k.$$
\end{theorem}
\begin{proof}
Let $F$ represent $P$ modulo $q$.
Let $F^{(i)} = F \bmod p_i$ (all entries taken modulo $p_i$).
Since all entries on the main diagonal of $F$ are non-zero, there exists $i \in [k]$ such that there at least $n/k$ non-zero entries on the main diagonal of $F^{(i)}$ by pigeonhole principle.
As $F^{(i)}$ is also a triangular matrix, the rank of $F^{(i)}$ modulo $p_i$ is at least $n/k$.
By Theorem \ref{thm:main}, the length of any encoding from $P$ to $F^{(i)}$ modulo $p_i$ must be at least $n/k$, hence also $\DI(P,q) \geq n/k$.
\end{proof}
\section{Definitions and Predicates} \label{sec:pre}
In this section, first we describe some of the notation used throughout the paper.
Then we define the predicates examined in the paper, and define the predicate reduction.
\paragraph{Notation.}
We denote the set of all subsets of $[n]$ by $2^{[n]}$.
For a set $S \subseteq [n]$, define the characteristic vector $\chi(S) \in \{0,1\}^n$ by
$$\chi(S)_i = \begin{cases} 1, & \text{if $i \in S,$} \\ 0, & \text{otherwise.}\end{cases}$$
Conversely, for a vector $x \in \{0, 1\}^n$, let $\chi^{-1}(x)$ be the characteristic set of $x$.
For simplicity, denote the characteristic vector of $\{i\}$ by $\e_i$ (the length is usually inferred from the context).
The characteristic vectors of $\varnothing$ and $[n]$ are denoted by $0^n$ and $1^n$.
We denote the identity matrix of dimension $n$ by $I_n$, and all ones matrix by $J_n$.
For a truth expression $T$, we define $[T]$ to be 1 if $T$ is true, and 0 if $T$ is false.
For example, $[x=y] = 1$ iff $x=y$.
For a number $x \in [2^n]$, let $\bin(x) \in \{0,1\}^n$ be the binary representation of $x-1$.
\paragraph{Predicates.} We consider the predicates listed below.
\begin{itemize}
\item Equality: $\mathcal{X} = \mathcal{Y} = [n]$ and
$\mathbf{EQ}_n(x,y) = [x = y].$
\item Greater than: $\mathcal{X} = \mathcal{Y} = [n]$ and
$\mathbf{GT}_n(x,y) = [x > y].$
\item Inequality: $\mathcal{X} = \mathcal{Y} = [n]$ and
$\mathbf{NEQ}_n(x,y) = [x \neq y].$
\item Index: $\mathcal{X} = \{0,1\}^n, \mathcal{Y} = [n]$ and
$\mathbf{INDEX}_n(x, i) = [x_i = 0].$
Here, $x_i$ denotes the $i$'th coordinate of $x$. Note that
we can also interpret $x$ as the characteristic vector of a subset
of $[n]$.
Because in our model $0 \bmod q$ corresponds to ``true'', we have defined the index to be true if the bit value in the corresponding position is 0.
\item Disjointness: $\clX = \clY = 2^{[n]}$ and
$\mathbf{DISJ}_n(S,T) = [S \cap T = \varnothing].$
\item Exact threshold: $\clX = \clY = 2^{[n]}$ and
$\mathbf{ETHR}_n^t(S,T) = [|S \cap T| = t],$
where $t \in [n]$ is the threshold parameter.
\item Threshold: $\clX = \clY = 2^{[n]}$ and
$\mathbf{THR}_n^t(S,T) = [|S \cap T| \geq t],$
where $t \in [n]$ is the threshold parameter.
\item Multilinear polynomials: $\mathcal X = \mathbb Z_q^n$, $\mathcal Y \subseteq \{p \mid p \in \mathbb Z_q[x_1,\ldots,x_n], \deg(p) \leq d\}$,
the latter is the set of all multilinear polynomials of degree at most $d$. Then
$\mathbf{MPOLY}_n^{d,q}(x,p) = [p(x_1, \ldots, x_n) = 0 \bmod q].$
\item Disjunction of equality tests: $\clX = \clY = \mathbb Z_q^n$ and
$\mathbf{OR{-}EQ}_n^q(x,y) = [\bigvee_{i=1}^n x_i = y_i].$
\end{itemize}
\paragraph{Reductions} \label{sec:red}
We say that a predicate $P_1 : \clX_1 \times \clY_1 \to \{0,1\}$ can be \emph{reduced} to a predicate $P_2 : \clX_2 \times \clY_2 \to \{0,1\}$ if there exist two mappings $f : \clX_1 \to \clX_2$ and $g : \clY_1 \to \clY_2$ such that $P_2(f(x),g(y)) = P_1(x,y)$ for all $x \in \clX_1, y \in \clY_1$ (or mappings $f : \clX_1 \to \clY_2$ and $g : \clY_1 \to \clX_2$).
In that case we write $P_2 \Rightarrow P_1$.
For example, consider the following reductions:
\begin{itemize}
\item $\mathbf{DISJ}_n \Rightarrow \mathbf{INDEX}_n \Rightarrow \mathbf{NEQ}_n$.
The reduction $\mathbf{DISJ}_n \Rightarrow \mathbf{INDEX}_n$ holds since $\mathbf{INDEX}_n(x,i) = \mathbf{DISJ}_n(\chi^{-1}(x),\{i\})$.
On the other hand, $\mathbf{INDEX}_n \Rightarrow \mathbf{NEQ}_n$, as $\mathbf{NEQ}_n(i,j) = \mathbf{INDEX}_n(\e_i,j)$.
\item $\mathbf{INDEX}_n \Rightarrow \mathbf{GT}_n$.
As $\mathbf{GT}_n(x,y) = \mathbf{INDEX}_n(\chi([y]),x)$, the reduction follows.
\item Let $P : \clX \times \clY \to \{0, 1\}$ be any predicate.
Then $\mathbf{INDEX}_{\min\{|\clX|,|\clY|\}} \Rightarrow P$.
Let $T$ be the $\clX \times \clY$ truth table of $P$ defined by $T_{x,y} = P(x,y)$.
Then we have $P(x,y) = \mathbf{INDEX}_{|\clX|}(T_x,y)$ and $\mathbf{INDEX}_{|\clX|} \Rightarrow P$.
Similarly, we also have $\mathbf{INDEX}_{|\clY|} \Rightarrow P$.
\end{itemize}
Effectively, then an inner product encoding for $P_2$ implies an encoding for $P_1$ and a lower bound for $P_1$ implies a lower bound for $P_2$.
This makes it easier to prove upper and lower bounds.
For example, as later we prove that $\DI(\mathbf{INDEX}_n,q) = n$ for prime $q$ (see Section \ref{sec:index}), the last reduction implies that $\DI(P,q) \leq \min\{|\clX|,|\clY|\}$ for all predicates $P$.
If $q$ is a product of $k$ distinct primes, then $\DI(P,q) \leq \min\{|\clX|,|\clY|\}/k$ for the same reason.
Therefore, for any predicate, if $k = \min\{|\clX|,|\clY|\}$, there is an encoding of $\clX$ and $\clY$ simply to numbers modulo $q$.
\section{Deterministic Encodings} \label{sec:det}
In this section, we apply our technique to provide lower bounds on deterministic inner product encodings for many well-known predicates.
For each of them, first we discuss the encodings and then proceed to prove lower bounds.
\subsection{Equality} \label{sec:eq}
An encoding for $\mathbf{EQ}_n$ over $q$ is a matching family of vectors modulo $q$ \cite{DGY11}.
The maximum size of a matching family of vectors of length $\ell$ modulo $q$ is denoted by $\MV(q,\ell)$ and has been studied extensively.
Lower and upper bounds on $\MV(q,\ell)$ give upper and lower bounds on $\DI(\mathbf{EQ}_n,q)$, respectively (in the relevant literature, usually $q$ and $\ell$ are denoted by $m$ and $n$, respectively).
For prime $q$, a tight $\DI(\mathbf{EQ}_n,q) = \Theta(qn^{\frac{1}{q-1}})$ bound is known \cite{DGY11}.
If $q$ is a product of $k$ primes, we have a $2^{\tilde O\left((\log n)^{1/k}\right)}$ upper bound from \cite{Grolmusz2000}.
For any composite $q$, we also have an $\Omega(\log n)$ lower bound from \cite{DH13}.
Here, first we show two simple upper bounds for $q =2$ and $q \geq n$.
Then we reprove the optimal lower bound for $q =2$ using our rank lower bound.
\paragraph*{Upper bounds.}
For $q = 2$, we construct an encoding of length $n$.
Let $\vx = \e_x$ and $\vy = 1^n - \e_y$.
Then $\ip{\vx,\vy} = \ip{\e_x,1^n} - \ip{\e_x,\e_y} = 1 - [x=y]$, thus it is a correct inner product encoding and $\DI(\mathbf{EQ}_n, 2) \leq n$.
Let $q$ be any integer such that $q \geq n$.
Let $\vx = (1, x)$ and $\vy = (y, -1)$.
Then $\ip{\vx, \vy} = y - x$, so it is 0 iff $x = y$.
Therefore, $\DI(\mathbf{EQ}_n, q) \leq 2$.
\paragraph*{Lower bound.}
We show a matching lower bound for case $q = 2$.
There is a unique matrix $F$ over $\mathbb{Z}_2$ that represents $\mathbf{EQ}_n$, namely $F_{x,y} = 0 \bmod q \Leftrightarrow x = y$.
Express $F = J_n - I_n$.
By sub-additivity of rank, we have $\rank(F) \geq \rank(I_n) - \rank(J_n) = n-1$.
Hence, by Theorem \ref{thm:main}, any inner product encoding of $\mathbf{EQ}_n$ modulo 2 requires vectors of length at least $n-1$, that is, $\DI(\mathbf{EQ}_n, 2) \geq n-1$.
\subsection{Index} \label{sec:index}
We prove that $\DI(\mathbf{INDEX}_n,q) = \lceil n/k \rceil$, for every $q$
that is a product of $k$ distinct primes.
For some $q$, the upper bound follows from $\mathbf{DISJ}_n \Rightarrow \mathbf{INDEX}_n$ (see Section \ref{sec:disj}).
However, there is a much simpler encoding, which we present below. Moreover,
this upper bound holds for every $q$ that is the product of $k$ distinct primes.
\paragraph*{Upper bound.}
We begin with the warm-up for the special case $k=n$. Here,
consider
$$\vx = \prod_{i=1}^n p_i^{1-x_i},\qquad \vy = q/p_y.$$
Then $\ip{\vx, \vy} = 0 \bmod q$ iff $x_y = 0$.
Next, we consider general $k,n$.
Since $\mathbf{INDEX}_{\lceil n/k\rceil \cdot k} \Rightarrow \mathbf{INDEX}_n$, it is enough to construct an encoding for the case $k \mid n$.
The data is the string $x \in \{0, 1\}^n$, and the index is given by $y \in [n]$.
Encode $x$ as an $n/k \times k$ binary matrix $X_{i,j} = x_{(i-1) \cdot k + j}$, and $y$ as an $n/k \times k$ binary matrix $Y_{i,j} = [y = (i-1) \cdot k + j]$.
Now we construct the encoding.
$$
\vx_i = \prod_{j=1}^k p_j^{X_{i,j}},
\hspace{1cm}
\vy_i = \begin{cases}
q/p_j, &\text{if $Y_{i,j}=1$,}\\
0, & \text{otherwise.}
\end{cases}
$$
Now we analyze the correctness of the protocol.
Let $i, j$ be such that $Y_{i,j} = 1$.
Then $\ip{\vx,\vy} = \prod_{l=1}^k p_l^{X_{i,l}} \cdot (q/p_j)$.
\begin{itemize}
\item If $X_{i,j} = 1$, then $\ip{\vx,\vy} = 0 \bmod q$.
\item If $X_{i,j} = 0$, then $p_j \nmid \ip{\vx,\vy}$, hence $\ip{\vx,\vy} \neq 0 \bmod q$.
\end{itemize}
\paragraph*{Lower bound.}
The lower bound follows from $\mathbf{INDEX}_n \Rightarrow \mathbf{NEQ}_n$ (see Section \ref{sec:neq}).
\subsection{Inequality} \label{sec:neq}
We show that $\DI(\mathbf{NEQ}_n,q) = \lceil n/k \rceil$, for every $q$
that is the product of $k$ distinct primes.
\paragraph*{Upper bound.}
The upper bound follows from $\mathbf{INDEX}_n \Rightarrow \mathbf{NEQ}_n$ (see Section \ref{sec:index}).
\paragraph*{Lower bound.}
Any matrix that represents $\mathbf{NEQ}_n$ is a diagonal matrix with non-zero entries on the main diagonal.
By Theorem \ref{thm:composite}, it follows that $\DI(\mathbf{NEQ}_n,q) \geq n/k$.
\subsection{Greater Than} \label{sec:gt}
We show that $\DI(\mathbf{GT}_n,q) = \lceil n/k \rceil$, for every $q$
that is the product of $k$ distinct primes.
\paragraph*{Upper bound.}
The upper bound follows from $\mathbf{INDEX}_n \Rightarrow \mathbf{GT}_n$ (see Section \ref{sec:index}).
If $q$ is prime, the encoding simplifies to $\vx = \e_x$ and $\vy = \sum_{i=1}^y \e_i$.
If $k = n$, a different simple encoding is $\vx = \prod_{i=1}^{x-1} p_i$ and $\vy = \prod_{i=y+1}^{n} p_i$.
\paragraph*{Lower bound.}
Let $F$ be any matrix that represents $\mathbf{GT}_n$ modulo $q$.
Then all entries below the main diagonal are 0, while all entries on and above the main diagonal are non-zero, hence $F$ is a triangular matrix.
By Theorem \ref{thm:composite}, we conclude that $\DI(\mathbf{GT}_n,q) \geq n/k$.
\subsection{Disjointness} \label{sec:disj}
We prove that $\DI(\mathbf{DISJ}_n,q) = \lceil n/k \rceil$ for an appropriate choice of $q$ that depends on $n$, and that $\DI(\mathbf{DISJ}_n,q) \geq n/k$ if $q$ is any product of $k$ distinct primes.
\paragraph*{Upper bound.}
We start with a simple encoding for $k = n$ that works for any product of $n$ distinct primes $q$.
Recall that the sets $S$ and $T$ are the input to disjointness.
Let
$$ \vx = \prod_{i=1}^n p_i^{1-\chi(S)_i}, \hspace{1cm} \vy = \prod_{i=1}^n p_i^{1-\chi(T)_i}.$$
Then $\ip{\vx,\vy} = \prod_{i=1}^n p_i^{2-\chi(S)_i-\chi(T)_i}$ is $0 \bmod q$ iff $S$ and $T$ are disjoint.
If $k < n$, then for any $p_i$ it is possible that although some of the products $\vx_i \cdot \vy_i$ are not divisible by $p_i$, their sum might be divisible by $p_i$, hence the encoding doesn't work for any $q$.
For the general case, the following variation of Dirichlet's theorem will be useful for us.
\begin{theorem}[Dirichlet] \label{thm:prime}
For any integer $q \geq 2$, there are infinitely many primes $p$ such that $p = 1 \bmod q$.
\end{theorem}
Let $q = p_1\cdots p_k$ be a product of $k$ distinct primes $p_1, \ldots, p_k$ to be defined later.
We construct an encoding of length $n/k$ for the case $k \mid n$.
Encode $S \subseteq [n]$ as an $n/k \times k$ binary matrix $X_{i,j} = \chi(S)_{(i-1) \cdot k + j}$.
Similarly encode $T$ as $Y$.
Let
$$
\vx_i = \prod_{j=1}^k p_j^{1-X_{i,j}},
\hspace{1cm}
\vy_i = \prod_{j=1}^k p_j^{1-Y_{i,j}}.
$$
Now we find the appropriate primes $p_1, \ldots, p_k$ for the general case.
We construct them and prove the correctness by induction on $k$.
\textbf{Base case.}
If $k=1$, then $q$ is a prime itself.
Pick any prime $q$ such that $q > n$.
We have $\ip{\vx,\vy} = \sum_{i=1}^n q^{2-\chi(S)_i-\chi(T)_i}$.
If $x$ and $y$ are disjoint, then $q \mid \ip{\vx,\vy}$.
Suppose that $S$ and $T$ are not disjoint.
Let $b = |S \cap T|$.
Then $\ip{\vx,\vy} = (\sum_{i \in S \cap T} 1) \bmod q = b \bmod q$.
As $b \leq n$, we have $b < q$, therefore $\ip{\vx,\vy} \neq 0 \bmod q$.
\textbf{Inductive step.}
Assume that there exists a correct encoding for some $q$ such that it is a product of $k-1$ distinct primes $p_1, \ldots, p_{k-1}$.
Let $p_k$ be a prime such that $p_k > (n/k)\cdot (p_1\cdots p_{k-1})^2$ and $p_k = 1 \bmod (p_1\cdots p_{k-1})$ (such exist by Theorem \ref{thm:prime}).
Suppose that $\ip{\vx,\vy} = p_k\cdot a + b$, where $b \in \{0,\ldots,p_k-1\}$.
Examine the sets $S^{(k)}= \{i \in [n/k] \mid ik \in S\}$ and $T^{(k)}= \{i \in [n/k] \mid ik \in T\}$.
\begin{itemize}
\item Suppose that $S^{(k)}$ and $T^{(k)}$ are not disjoint.
Then the set $I = S^{(k)} \cap T^{(k)}$ is non-empty.
If $i \notin I$, then at least one of $X_{i,k}$ and $Y_{i,k}$ is 0, thus $\vx_i \cdot \vy_i = \prod_{j=1}^k p_j^{2-X_{i,j}-Y_{i,j}}$ is divisible by $p_k$.
Thus, we have that $b = \sum_{i \in I} \prod_{j=1}^{k-1} p_j^{2-X_{i,j}-Y_{i,j}} < (n/k) \cdot (p_1\cdots p_{k-1})^2 < p_k$.
Therefore, $\ip{\vx,\vy} = b \bmod p_k \neq 0 \bmod p_k$.
\item Suppose that $S^{(k)}$ and $T^{(k)}$ are disjoint.
Then for all $i \in [n/k]$, we have that $p_k \mid \vx_i\vy_i$.
Therefore, $p_k \mid \ip{\vx,\vy}$.
Moreover, since $p_k = 1 \bmod (p_1\cdots p_{k-1})$, we have that $\vx_i \bmod (p_1\cdots p_{k-1}) = \prod_{j=1}^{k-1} p_j^{1-X_{i,j}}$ and $\vy_i \bmod (p_1\cdots p_{k-1}) = \prod_{j=1}^{k-1} p_j^{1-Y_{i,j}}$.
Therefore, $\ip{\vx,\vy} \bmod (p_1\cdots p_{k-1})$ is equal to 0 iff the sets $S \setminus S^{(k)}$ and $T \setminus T^{(k)}$ are disjoint by the inductive hypothesis.
\end{itemize}
\paragraph*{Lower bound.}
The lower bound follows from $\mathbf{DISJ}_n \Rightarrow \mathbf{INDEX}_n$ (see Section \ref{sec:index}).
\subsection{Exact Threshold} \label{sec:ethr}
\paragraph*{Upper bound.}
The following encoding modulo $q \geq n$ of length $n+1$ is due to Katz, Sahai and Waters \cite{KSW08}.
For all $1 \leq i \leq n$, let $\vx_i = \chi(S)_i$, and let $\vx_{n+1} = 1$.
For all $1 \leq i \leq n$, let $\vy_i = \chi(T)_i$, and let $\vy_{n+1} = -t$.
Then $\ip{\vx, \vy}$ is equal to 0 iff $|S \cap T| = t$.
Therefore, $\DI(\mathbf{ETHR}_n^t, q) \leq n+1$.
Surprisingly, if $t \geq n-1$, there exist constant size encodings.
\begin{itemize}
\item If $t = n$, there is an encoding of length 2.
The encoding is as follows: $\vx = (1, [S=[n]])$ and $\vy = (1,-[T=[n]])$.
Then we have $\ip{\vx, \vy} = 1 - [S=[n]]\cdot [T=[n]]$, which is 0 iff $S = T = [n]$.
\item If $t = n-1$, there is an encoding of length 3.
The encoding for $S$ and $T$ is as follows:
\begin{equation*}
\vx = \begin{cases}
(1,0,0), & \text{if $|S|=n$,} \\
(0,i,1), & \text{if $|S|=[n]\setminus \{i\}$,} \\
(1,-1,1), & \text{otherwise.}
\end{cases}
\hspace{1cm}
\vy = \begin{cases}
(1,0,0), & \text{if $|T|=n$,} \\
(0,1,-i), & \text{if $|T|=[n]\setminus \{i\}$.} \\
(1,1,1), & \text{otherwise.}
\end{cases}
\end{equation*}
It is easy to check by hand that $\ip{\vx,\vy}=0$ iff $|S\cap T|=n-1$.
Note that we require $q \geq n+2$.
\end{itemize}
\paragraph*{Lower bound.}
We show that for $1 \leq t \leq n-2$, we have $\DI(P,q) \geq \max\{n-t+2, t+2\}/k \geq (n/2+2)/k$.
\begin{enumerate}[(a)]
\item
First we prove that if $t \geq 1$, the length of any encoding must be at least $(n-t+2)/k$.
We show that by using two reductions.
Firstly, we have $\mathbf{ETHR}_n^t \Rightarrow \mathbf{ETHR}_{n-t+1}^1$, because we can map $S \mapsto S \cup \{n-t+2, \ldots, n\}$.
Secondly, we prove that $\mathbf{ETHR}_m^1 \Rightarrow \mathbf{GT}_{m+1}$.
Consider the following mappings:
\begin{equation}
f = \begin{cases}
1 \mapsto \varnothing, \\
i \mapsto [i-1],
\end{cases}
\hspace{1cm}
g = \begin{cases}
j \mapsto \{j\}, \\
m+1 \mapsto \varnothing.
\end{cases}
\end{equation}
Consider a pair of numbers $x, y \in [m+1]$.
If $x = 1$, then $\mathbf{GT}_{m+1}(x,y) = 0$ and also $\mathbf{ETHR}_m^1(f(x),g(y)) = \mathbf{ETHR}_m^1(\varnothing, g(y)) = 0$.
If $y = m+1$, then $\mathbf{GT}_{m+1}(x,y) = 0$ and $\mathbf{ETHR}_m^1(f(x),g(y)) = \mathbf{ETHR}_m^1(f(x), \varnothing) = 0$.
Otherwise, $\mathbf{ETHR}_m^1(f(x),g(y)) = \mathbf{ETHR}_m^1([x-1],\{y\}) = \mathbf{GT}_{m+1}(x,y)$.
Hence the reduction is correct.
Therefore, we conclude that $$\DI(\mathbf{ETHR}_n^t,q) \geq \DI(\mathbf{ETHR}_{n-t+1}^1,q) \geq \DI(\mathbf{GT}_{n-t+2},q) \geq (n-t+2)/k$$ by the lower bound on greater than of Section \ref{sec:gt}.
\item Now we prove that if $t \leq n-2$, the length of any encoding is at least $(t+2)/k$.
Again, we exhibit two reductions.
Firstly, $\mathbf{ETHR}_n^t \Rightarrow \mathbf{ETHR}_{t+2}^t$ simply mapping any set to itself.
Secondly, $\mathbf{ETHR}_m^{m-2} \Rightarrow \mathbf{NEQ}_m$.
This is because we can map $x \mapsto [m] \setminus \{x\}$ for any $x \in [m]$.
Then the size of the intersection $|([m]\setminus \{x\}) \cap ([m]\setminus \{y\})|$ is equal to $m-2$ if $x \neq y$, and $m-1$, if $x = y$.
Therefore, it follows that
$$\DI(\mathbf{ETHR}_n^t,q) \geq \DI(\mathbf{ETHR}_{t+2}^t,q) \geq \DI(\mathbf{NEQ}_{t+2},q) \geq (t+2)/k$$
by the lower bound on inequality of Section \ref{sec:neq}.
\end{enumerate}
Therefore, for any $1 \leq t \leq n-2$, any encoding must have length at least $\max\{n-t+2,t+2\}/k$ and we have that $\DI(\mathbf{ETHR}_n^t,q) = \Omega(n)$.
\subsection{Multilinear Polynomials} \label{sec:poly}
First we show a known encoding that gives $\DI(\mathbf{MPOLY}_n^d,q) \leq {n \choose \leq d} = O(n^d)$.
Then we show a lower bound of $\DI(\mathbf{MPOLY}_n^d,q) \geq {n \choose d}/ k = \Omega(n^d/k)$.
For prime $q$, we show an optimal lower bound $\DI(\mathbf{MPOLY}_n^d,q) \geq {n \choose \leq d}$.
\paragraph*{Upper bound.}
The following is a simple construction by \cite{KSW08}.
For $S \subseteq [n]$, let $X_S = \prod_{i\in S} x_i$ and let $p = \sum_{S \subseteq [n], |S| \leq d} a_S X_S$ be a multilinear polynomial of degree at most $d$.
For each subset $S \subseteq [n]$ such that $|S| \leq d$, let $\vx_S = X_S$ and $\vy_S = a_S$; then $\ip{\vx,\vy}$ is precisely equal to $p(x)$.
Since a multilinear polynomial of degree at most $d$ on $n$ variables has at most ${n \choose \leq d} = \sum_{i=0}^d {n \choose i} \leq (n+1)^d$ monomials, it follows that $\DI(\mathbf{MPOLY}_n^d,q) = O(n^d)$.
\paragraph*{Lower bound.}
We show a reduction $\mathbf{MPOLY}_n^d \Rightarrow \mathbf{NEQ}_{{n \choose d}}$.
Let $S$ be the bijection from the numbers in $\left[{n \choose d}\right]$ to subsets of $[n]$ of size $d$.
For a pair of inputs $x, y \in \left[{n \choose d}\right]$, consider mappings $x \mapsto \chi(S(x))$ and $y \mapsto X_{S(y)}$.
Since $\mathbf{MPOLY}_n^d(\chi(S(x)), X_{S(y)}) = 0$ iff $x \neq y$, it is a correct reduction.
Thus, $\DI(\mathbf{MPOLY}_n^d,q) \geq {n \choose d}/k = \Omega(n^d/k)$ by the lower bound from Section \ref{sec:neq}.
Note that if $q$ is prime, we can get a tight lower bound of ${n \choose \leq k}$.
Since any two distinct polynomials disagree on some inputs, each polynomial must be mapped to a different vector.
Therefore, the number of possible vectors must be at least the number of possible polynomials, $|\mathbb Z_q^n| \geq |\mathcal Y|$.
The total number of possible monomials of degree at most $d$ is ${n \choose \leq d}$.
Each monomial can have any coefficient in $\mathbb Z_q$.
It implies that $q^m \geq q^{{n \choose \leq d}}$ and $m \geq {n \choose \leq d}$.
\subsection{Threshold}
First we show an upper bound of $\DI(\mathbf{THR}_n^t,q) = O(n^{n-t+1})$ for $q \geq n$, and then a lower bound of $\DI(\mathbf{THR}_n^t,q) \geq 2^{n-t+1}/k$.
\paragraph*{Upper Bound.}
The idea is to encode the threshold into multilinear polynomial evaluation.
Let $x = \chi(S)$ and $y = \chi(T)$.
Examine the following polynomial:
\begin{equation*}p_y(x) = \left(\sum_{i=1}^n x_iy_i - t\right) \cdot \left(\sum_{i=1}^n x_iy_i - (t+1)\right)\cdot \ldots\cdot \left(\sum_{i=1}^n x_iy_i - n\right).\end{equation*}
Firstly, $\sum_{i=1}^n x_iy_i = |S \cap T|$, thus $p_y(x) = 0$ iff $|S \cap T| \geq t$.
Secondly, the degree of each factor is 1, hence $\deg(p_y) = n-t+1$.
Note that the polynomial $p_y$ is still multilinear, since all the variables are 0 or 1.
Therefore, we have a reduction $\mathbf{MPOLY}_n^{n-t+1} \Rightarrow \mathbf{THR}_n^t$.
The upper bound from Section \ref{sec:poly} implies that $\DI(\mathbf{THR}_n^t,q) \leq \DI(\mathbf{MPOLY}_n^{n-t+1},q) \leq {n \choose \leq n-t+1} = O(n^{n-t+1})$.
\paragraph*{Lower Bound.}
First of all, we have $\mathbf{THR}_n^t \Rightarrow \mathbf{THR}_{n-t+1}^1$, as we can map a set $S \subseteq [n-t+1]$ to $S \cup \{n-t+2,\ldots,n\}$.
Next we prove that $\DI(\mathbf{THR}_m^1,q) \geq 2^m/k$.
Let $F$ be any matrix representing $\mathbf{THR}_m^1$.
We show that $F$ is a triangular matrix with all entries on the main diagonal being non-zero.
Then the claim follows by Theorem \ref{thm:composite}.
Order the rows of $F$ by the increasing order of the size of the sets they correspond to.
Then order the columns of $F$ in such a way that the sets corresponding to the $i$-th row and the $i$-th column are the complements of each other.
As the complements don't overlap, the numbers on the main diagonal of $F$ are non-zero.
Now examine any entry on the $i$-th row and $j$-th column such that $i \geq j$.
Let $S$ correspond to the set of the $i$-th row and $T$ correspond to the set of the $j$-th column.
Since the columns are ordered by the decreasing size of the sets, we have that $|S| \geq m-|T|$, or equivalently $|S| + |T| \geq m$.
If $|S| + |T| > m$, then the sets must overlap and the value of $F_{i,j}$ is 0.
If $|S| + |T| = m$, then the only way $S$ and $T$ do not overlap is if $T$ is the complement of $S$.
In any case all the numbers below the main diagonal are 0, and non-zero on the main diagonal.
See Figure \ref{fig:matrix} for an example.
\begin{figure}[h]
\[
\begin{blockarray}{ccccccccc}
& \matindex{111} & \matindex{110} & \matindex{101} & \matindex{011} & \matindex{100} & \matindex{010} & \matindex{001} & \matindex{000} \\
\begin{block}{c[cccccccc]}
\matindex{000} & * & * & * & * & * & * & * & * \\
\matindex{001} & 0 & * & 0 & 0 & * & * & 0 & * \\
\matindex{010} & 0 & 0 & * & 0 & * & 0 & * & * \\
\matindex{100} & 0 & 0 & 0 & * & 0 & * & * & * \\
\matindex{011} & 0 & 0 & 0 & 0 & * & 0 & 0 & * \\
\matindex{101} & 0 & 0 & 0 & 0 & 0 & * & 0 & * \\
\matindex{110} & 0 & 0 & 0 & 0 & 0 & 0 & * & * \\
\matindex{111} & 0 & 0 & 0 & 0 & 0 & 0 & 0 & *\\
\end{block}
\end{blockarray}
\]
\caption{An example of $F$ for $m = 3$. Stars represent non-zero elements.} \label{fig:matrix}
\end{figure}
\subsection{Disjunctions of Equality Tests}
We show that for prime $q$, we have $\DI(\mathbf{OR{-}EQ}_n^q,q) \leq 2^n$ and if $q$ is a product of $k$ distinct primes, then $\DI(\mathbf{OR{-}EQ}_n^q,q) \geq 2^n/k$.
\paragraph*{Upper bound.}
We prove that $\mathbf{MPOLY}_n^{n,q} \Rightarrow \mathbf{OR{-}EQ}_n^q$.
Examine a multilinear polynomial
\begin{equation*}
p_y(x) = \prod_{i=1}^n (x_i-y_i).
\end{equation*}
Clearly, $p_y(x) = 0 \bmod q$ iff at least one equality holds.
Therefore, if we map $x \mapsto x$ and $y \mapsto p_y$, then we have a correct reduction to multilinear polynomial evaluation.
By the upper bound from Section \ref{sec:poly}, we have $\DI(\mathbf{OR{-}EQ}_n^q,q) \leq \DI(\mathbf{MPOLY}_n^{n,q},q) \leq \sum_{i=0}^n {n \choose i} = 2^n$.
\paragraph*{Lower bound.}
We prove that $\mathbf{OR{-}EQ}_n^q \Rightarrow \mathbf{NEQ}_{2^n}$.
For the input $x, y \in [2^n]$ to $\mathbf{NEQ}_n$, map $x \mapsto \bin(x)$ and $y \mapsto \bin(y) \oplus 1^n$.
As $x \neq y$ iff there exists an $i$ such that $\bin(x)_i \neq \bin(y)_i$, we have that $x \neq y$ iff $\mathbf{OR{-}EQ}_n^q(\bin(x),\bin(y)\oplus 1^n) = 1$.
The lower bound follows by Section \ref{sec:neq}.
\section{Randomized Constructions} \label{sec:rand}
We can formulate the problem in the randomized setting as follows.
Let $P : \clX \times \clY \to \{0, 1\}$ be a predicate.
Consider all pairs of mappings $\clU = \{(x \mapsto \vx, y \mapsto \vy) \mid \vx, \vy \in \mathbb{Z}_q^\ell\text{ for some $\ell$}\}$.
These also include mappings that are incorrect inner product encodings of $P$.
Let $\mu$ be a probability distribution over $\clU$.
Then $\mu$ is a \emph{probabilistic inner product encoding} modulo $q$ with error $\epsilon$, if
\begin{equation*}
\Pr[P(x,y) \neq [\ip{\vx, \vy} = 0 \bmod q ] \mid (x \mapsto \vx, y \mapsto \vy) \sim \mu] \leq \epsilon.
\end{equation*}
We consider the length of the longest encoding under $\mu$ to be the length of $\mu$ and denote it by $\RI^{\mu}(P, q)$ (Randomized Inner product).
Then define
\begin{equation*}
\RI_{\epsilon}(P, q) = \min_\mu \RI^\mu (P, q),
\end{equation*}
where $\mu$ ranges over all probabilistic inner product encodings of $P$ modulo $q$ with error $\epsilon$.
Next we reproduce the definition of the probabilistic rank (over $\mathbb{Z}_q$) by Alman and Williams \cite{AW17}:
\begin{definition}[Probabilistic Matrix]
For $n, m \in \mathbb N$, define a \emph{probabilistic matrix} over $\mathbb{Z}_q$ to be a distribution of matrices $\clM \subset \mathbb{Z}_q^{n \times m}$.
A probabilistic matrix $\clM$ \emph{computes} a matrix $A \in \mathbb{Z}_q^{n \times m}$ with error $\epsilon > 0$ if for every entry $(i, j) \in [n] \times [m]$,
\begin{equation*}
\Pr_{M \sim \clM} [A_{i,j} \neq M_{i,j} ] \leq \epsilon.
\end{equation*}
\end{definition}
\begin{definition}[Probabilistic Rank]
Let $q$ be prime.
Then a probabilistic matrix $\clM$ has \emph{rank} $r$ if the maximum rank of an $M$ in support of $\clM$ is $r$.
Define the $\epsilon$-\emph{probabilistic rank} of a matrix $A \in \mathbb{Z}_q^{n \times m}$ to be the minimum rank of a probabilistic matrix computing $M$ with error $\epsilon$.
Denote it by $\rank_{\epsilon}(A)$.
\end{definition}
As we can see, the probabilistic choice of a distribution $\mu$ corresponds to a matrix $M$ sampled from $\clM$.
By a similar reasoning as in the proof of Theorem \ref{thm:main}, we have the following theorem:
\begin{theorem} \label{rand}
For any predicate $P$, prime $q \geq 2$ and error $\epsilon$, we have
\begin{equation*}
\RI_\epsilon(P, q) \leq \min_{F} \rank_\epsilon(F),
\end{equation*}
where $F$ is any matrix that represents $P$ modulo $q$.
\end{theorem}
\begin{proof}
Let $F$ be any matrix that represents $P$ modulo $q$.
Suppose that $\clM$ is a probabilistic matrix that computes $F$.
Then any $M$ in support of $\clM$ defines an encoding of length $\rank(M)$ by the decomposition rank.
Therefore, there is a probability distribution over the encodings such that the maximum length is $\rank_{\epsilon}(F)$.
\end{proof}
For some predicates, the probabilistic rank can be much smaller than the deterministic rank.
Let $T(P)$ be a truth table of a predicate $P$ (defined by $T(P)_{x,y} = P(x,y)$).
The same authors prove that $\rank_{\epsilon}(T(\mathbf{EQ}_n)) = O(1/\epsilon)$ and $\rank_{\epsilon}(T(\mathbf{LEQ}_n)) = O((\log n)^2/\epsilon)$ (see Lemmas D.1 and D.2 in \cite{AW17}).
Since the matrix $T(P)$ represents the predicate $\lnot P$ (in our setting), these results imply that for any prime $q$:
\begin{enumerate}
\item $\RI_{\epsilon}(\mathbf{NEQ}_n,q) = O(1/\epsilon)$,
\item $\RI_{\epsilon}(\mathbf{GT}_n,q) = O((\log n)^2/\epsilon)$.
\end{enumerate}
We conclude by showing that these results immediately imply a constant length probabilistic encoding for $\mathbf{EQ}_n$ modulo any prime:
\begin{corollary}
For any prime $q$, we have
$\RI_{\epsilon}(\mathbf{EQ}_n,q) = O(1/\epsilon).$
\end{corollary}
\begin{proof}
Let $\clM$ be a probabilistic matrix that computes $T(\mathbf{EQ}_n)$ with error $\epsilon$.
The matrix $F(\mathbf{EQ}_n) = J_n - T(\mathbf{EQ}_n)$ represents $\mathbf{EQ}_n$.
Therefore, the probabilistic matrix $J_n - \clM$ computes $F(\mathbf{EQ}_n)$ with error $\epsilon$.
Since $\rank(F(\mathbf{EQ}_n)) \leq 1 + \rank(T(\mathbf{EQ}_n))$, we have that $\RI(\mathbf{EQ}_n,q) = O(1/\epsilon)$.
\end{proof}
\section{Acknowledgments}
We thank Srijita Kundu, Swagato Sanyal and Alexander Belov for helpful discussions, and Krišjānis Prūsis for suggestions on the presentation.
We greatly thank Miklos Santha for hospitality during our stay at CQT, and Andris Ambainis for support.
We are grateful to the anonymous reviewers for suggestions and useful feedback, and for pointing out the precise lower bound for prime $q$ in Section \ref{sec:poly}.
| {'timestamp': '2018-10-08T02:01:30', 'yymm': '1810', 'arxiv_id': '1810.02396', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02396'} | arxiv |
\section{Introduction}
\label{section_introduction}
Deep learning models have demonstrated impressive performance in a wide variety of applications~\cite{goodfellow2016deep,simonyan2014very}. However, recent works have shown that these models are susceptible to adversarial attacks: imperceptible but carefully chosen perturbation added to the input can cause the model to make highly confident but incorrect predictions ~\cite{szegedy2013intriguing,goodfellow2015explaining,kurakin2016adversarial}.
Exploring the adversarial robustness of neural networks has recently gained significant attention and there is a rapidly growing body of work related to this topic~\cite{kurakin2016adversarial,tramer2017ensemble,fawzi2018analysis,athalye2017synthesizing,carlini2017towards,kolter2017provable,wong2018provable,madry2017towards}. A wide variety of methods are proposed to defend a model against adversarial attacks~\cite{prakash2018deflecting,liao2018defense,song2017pixeldefend,samangouei2018defense}. Despite these
advances, many techniques are subsequently shown to be ineffective~\cite{athalye2018obfuscated,athalye2018robustness}, and adversarial training which uses adversarial samples in addition to clean images during the training process has been shown to be able to build relatively robust neural networks~\cite{madry2017towards,athalye2018obfuscated,dvijotham2018training}. With strong adversaries such as the Projected Gradient Descent (PGD)~\cite{madry2017towards} or the Iterative Fast Gradient Sign Method (I-FGSM)~\cite{kurakin2016adversarial} adversarially trained models are able to achieve state-of-the-art performance against a wide range of attacks.
Recent advances in the understanding of adversarial training provide insights of its effectiveness. It is shown that standard and robust models depend on very different sets of features~\cite{tsipras2018there,tanay2018built}. While standard models utilize features including non-robust ones that are weakly correlated with class labels and easily manipulated by small input perturbations, robust models only use robust features that are highly correlated with class labels and invariant to those perturbations. Although adversarial training learns robust features, there are no explicit design components to encourage a model to depend solely on robust features. Therefore, to further improve the robustness of a model, we propose feature regularization and prioritization schemes.
We first propose to use an attention mechanism that introduces to the model the flexibility of prioritizing features and bias a model towards robust features. We call the learned features at the final layer of a network the global features, and the ones at lower level layers the local features. In our attention module, we use the global features as a way to assign weights to the local features by a non-linear compatibility function. Since global features are directly used to produce class label prediction, we are effectively assigning weights to local features depending on their correlation with the labels. Robust features have higher correlation and therefore will be assigned larger weights which in turn contribute to the model's robustness.
Next, we propose to use feature regularization to learn robust features that are invariant to input perturbations. We add an $L_2$ regularization term that penalizes the distance between the learned features of a clean sample $x$ and that of its perturbed adversarial counterpart $x'$ to the training objective. By optimizing this regularizer, we are pushing the model to extract very similar features from the original image and the adversarial image, and thus only features that are invariant to the perturbations are learned and the added noise is effectively ignored. From another point of view, a model with small $L_2$ feature distance maps the two nearby points in the image space to nearby points in the learned high dimensional manifold, which is a desirable behavior.
In this paper, we propose an approach that enhances adversarial training with feature prioritization and regularization to improve the robustness of a model. We use extensive experiments to demonstrate that the attention module focuses on the area of an image which contains the actual object and helps the classifier to only rely on features extracted from those areas. The background clutter and irrelevant features which could be misleading are effectively suppressed. The feature regularization further encourages the model to extract robust features that are not manipulated by the adversarial perturbations. The resulting model has a highly interpretable gradient map that aligns very well with salient data characteristics.
The main contributions of this paper include:
\begin{itemize}
\item A method based on feature prioritization and regularization, which significantly outperforms adversarial training. Our model is evaluated on the MNIST, CIFAR-10, and CIFAR-100 datasets, and demonstrates superior performance relative to both standard classification accuracy and adversarial robustness.
\item We provide empirical justification for attention and show that it helps the model to rely on robust features by assigning larger weights to them. Through qualitative inspection, we show that the attention maps generated by our non-linear attention estimator focus sharply on the regions of interest while suppressing irrelevant background clutter.
\item In addition to qualitative evaluation of the gradient maps, we propose a novel experimental strategy that quantitatively demonstrates better alignment of the gradient maps generated by our model with salient data characteristics.
\end{itemize}
\section{Related Work}
\label{section_related_work}
Due to the extensive amount of literature in this area, we only review some of the most related works in this section. For a more comprehensive survey, please refer to Akhtar and Mian~\shortcite{akhtar2018threat}.
\textit{Adversarial training.} Kurakin et al.~\shortcite{kurakin2016adversarial} use adversarial training as a form of data augmentation where it injects adversarial examples during training. In every training mini batch, a mixture of clean images and adversarial images generated by one step Fast Gradient Sign Method (FGSM) are used to update the network's parameters. It was later improved by Na et al.~\shortcite{na2017cascade} by adding adversarial examples generated by iterative methods. Madry et al.~\shortcite{madry2017towards} proposed to replace all clean images with adversarial images which is a direct result of optimizing a saddle point (min-max) formulation. They suggest that PGD is a universal first-order adversary which is then used in their adversary generating process.
\textit{$L_2$ regularization}. A similar idea with feature regularization is proposed in Kannan et al.~\shortcite{kannan2018adversarial} which they call adversarial logit pairing (ALP), to prevent a model from being over-confident when making predictions. Compared with ALP, feature regularization is more intuitive as it motivates a model to learn very robust features that are invariant to input perturbations, which leads to a robust model. In addition, we propose to also use attention module to further encourage the model to favor robust features which will improve the robustness.
\textit{Attention Models}. Attention in CNN is most commonly deployed for query-based tasks~\cite{seo2016progressive,jetley2018learn}. Jetley et al.~\shortcite{jetley2018learn} presented a method to use a learned representation of the global image as a query to leverage multiple attention maps at different scales, which allows the expression of a complementary focus on different parts of the image. However, the application of attention to the adversarial robustness aspects has not been seriously explored. To the best of our knowledge, we are the first to employ an attention mechanism in training a robust deep neural network. In our application, we use a ReLU activated neural network instead of the linear-based method as the attention estimator. It allows highly non-linear compatibility between the learned global features and the lower-level local features.
\section{Approach}
\label{section_approach}
We now present our model that combines the attention module and $L_2$ feature regularization, and show how it can be applied to enhance the adversarial training to improve the adversarial robustness of a model and its accuracy. Figure~\ref{figure_model} provides an overview of our method. We start by forwarding each of the clean and adversarial images and computing the attention weights by a non-linear estimator. Then the individual attention feature is defined to be the weighted combination of the corresponding local features. Next, we define an $L_2$ regularization loss to be the Euclidean distance between the two sets of learned attention features. The attention features of the adversarial image are then used to produce the logits, which is followed by softmax layer to produce the cross-entropy loss. The final loss function of our model is a combination of cross-entropy loss and the regularization loss.
\begin{figure*}[t]
\begin{center}
\includegraphics[width=0.8\textwidth]{model.pdf}
\end{center}
\caption{Overview of the proposed model. The top and bottom networks are the same copy that share all network parameters. Both the clean and adversarial images are forwarded through the network to produce the corresponding attention features. The $L_2$ regularization loss is defined as the Euclidean distance between the two sets of attention features. The final model loss is a combination of the $L_2$ regularization loss and the cross-entropy loss for only the adversarial input. \label{figure_model}}
\end{figure*}
\subsection{Adversarial Training}
We adopt the adversarial training described in Madry et al.~\shortcite{madry2017towards} as the basic training approach. It replaces natural training examples by PGD examples, which is suggested to represent a universal first-order adversary. So far PGD has been shown to represent the strongest attack method \cite{athalye2018obfuscated,athalye2018robustness}. A model that is trained with PGD adversaries is also robust against a wide range of other attacks and not yet outperformed by any other approach. The adversarial training has a saddle point formulation:
\begin{equation}
\label{equation_pgd_saddle}
\min_\theta \mathbb{E}_{({\bm{x}}, y)\sim {\mathcal{D}}} [ \max_{\bm\delta \in S} L(\theta, {\bm{x}}+\bm\delta, y)]
\end{equation}
where ${\mathcal{D}}$ is the distribution of data ${\bm{x}}$ and class labels $y$, $L$ is the cross-entropy loss function for a model with parameters $\theta$, $\bm\delta$ is the additive adversarial perturbation with bound $S$. In this paper we consider $l_\infty$ bound as in Madry et al.~\shortcite{madry2017towards}. Our adversarial samples ${\bm{x}}'={\bm{x}}+\bm\delta$ are created by PGD:
\begin{equation}
{\bm{x}}^{t+1}=\Pi_{{\bm{x}}+S}\left({\bm{x}}^t+\alpha\,\text{sgn}(\nabla_{\bm{x}} L(\theta, {\bm{x}}, y))\right)
\end{equation}
PGD adversaries are computed at each iteration as an approximated optimum of the inner maximization in equation~(\ref{equation_pgd_saddle}) and an update of the parameters $\theta$ is made according to the outer minimization formulation.
\subsection{Attention Model}
As we discussed in Section~\ref{section_introduction}, our goal of attention model is to favor robust features in making predictions. We propose a non-linear attention model that acts as a feature prioritizing scheme, which is able to put more weight on robust features and less weight on non-robust features to increase the robustness of a classifier.
Let ${\bm{l}}_n^i$ be the learned feature vector at layer $i\in\{1, 2, ..., I\}$ of a neural network at spatial location $n\in\{1,2, ..., N\}$, and let ${\bm{g}}$ be the feature vector of the layer just before the final fully connected layer which produces the class label prediction scores (logits). We use a one-hidden-layer ReLU network to generate compatibility scores between the global feature ${\bm{g}}$ and local features ${\bm{l}}_n^i$:
\begin{equation}
c_n^i = f({\bm{l}}_n^i, {\bm{g}})
\end{equation}
where $f$ is the neural network and the concatenation of ${\bm{g}}$ and ${\bm{l}}_n^i$ is fed to the network to produce the compatibility scores $c_n^i$. We then normalize the scores with a softmax operation to get the attention weights:
\begin{equation}
w_n^i = \frac{\exp{c_n^i}}{\sum_{m}\exp{c_m^i}}
\end{equation}
Next, we compute the weighted sum of local feature vectors which is the attention feature vector at layer $i$:
\begin{equation}
{\bm{h}}^i = \sum_n w_n^i {\bm{l}}_n^i
\end{equation}
We use the outputs of the last residual block as the local feature for computing attention, and replace the global feature ${\bm{g}}$ with the corresponding attention descriptor ${\bm{h}}^i$ for final classification.
By using a neural network instead of the linear alignment models as in Jetley et al.~\shortcite{jetley2018learn}, we are able to capture non-linear compatibility between the local and global features when producing the attention weights, which is beneficial considering the multiple non-linear function activated layers between the local and global features.
\subsection{Feature Regularization}
In addition to the attention mechanism, we also propose to use an $L_2$ regularization term to encourage the model to extract similar features for the clean image and the corresponding adversarial image. Denote by ${\mathcal{G}}_\theta$ the deep neural network, ${\bm{x}}$ and ${\bm{x}}'$ the natural image and adversarial image. Denote by ${\mathcal{G}}_\theta({\bm{x}})$, ${\mathcal{G}}_\theta({\bm{x}}')$ the learned features of the layer just before the final fully connected layer (in our case this is the attention weighted global descriptor) which produces the class label prediction scores. The $L_2$ regularizer has the following form:
\begin{equation}
L_r({\bm{x}}, {\bm{x}}') = \|{\mathcal{G}}_\theta ({\bm{x}}) - {\mathcal{G}}_\theta ({\bm{x}}')\|_2
\end{equation}
By minimizing the regularization function, the model effectively learns very similar features for the clean sample and the adversarial sample, which are robust features since they are invariant to the adversarial perturbation. From another perspective, the learned features of a neural network lie on a high dimensional manifold that is linearly separable for different classes because the classification layer is a linear classifier followed by a softmax function. With adversarial training alone, a model only tries to map ${\bm{x}}$ and ${\bm{x}}'$ to the same side of the decision boundary, while with the additional regularization, they are not only on the same side but also mapped to nearby points in the space. This mapping is a desired behavior considering that, in the original image space, they are very close points representing essentially the same image.
\subsection{Model Loss}
Equipped with the presented methods, the total loss of our model is:
\begin{equation}
\text{Loss}=\mathbb{E}_{({\bm{x}}, y)\sim {\mathcal{D}}} [ L(\theta, {\bm{x}}', y) + \lambda \|{\mathcal{G}}_\theta ({\bm{x}}) - {\mathcal{G}}_\theta ({\bm{x}}')\|_2]
\end{equation}
where $\lambda$ is a hyperparameter that controls the relative weight of the $L_2$ regularization loss.
\section{Experiments and Results}
\label{section_experiments_and_results}
In this section, we evaluate our model on the MNIST, CIFAR-10 and CIFAR-100 datasets, and present empirical justification to attention module and some quantitative and qualitative results.
\subsection{Robustness on MNIST}
\label{subsection_results_on_mnist}
We use a CNN with two convolutional layers with 32 and 64 filters respectively, followed by two fully connected layers of size 1024 and 10. The network is trained with 40-step PGD adversary with a step size of 0.01 and $l_\infty$ bound of $\epsilon=0.3$. The settings are the same as in Madry et al.~\shortcite{madry2017towards}. Since MNIST is a very small scale dataset and the model is very robust with just adversarial training, we do not employ the attention mechanism, but only study the effectiveness of the proposed feature regularization method.
\begin{table}[h]
\begin{center}
\begin{tabular}{@{}l@{\hskip 0.07\textwidth}r@{\hskip 0.03\textwidth}r@{\hskip 0.03\textwidth}r@{}}
\toprule
\bf Method & \bf Natural & \bf White box & \bf Transfer \\ \midrule
Madry et al. & 98.72\% & 92.86\% & 95.97\% \\
AT-reg & \bf 98.97\% & \bf 95.95\% & \bf 96.90\% \\ \bottomrule
\end{tabular}
\caption{Performance comparison of the adversarial training and our proposed adversarial training with feature regularization (AT-reg) on MNIST against PGD 5 adversaries. Transfer attack accuracies are evaluated against adversaries generated from an independently trained copy of the same method with identical configurations.\label{table_mnist_results}}
\end{center}
\end{table}
The evaluation results are presented in Table~\ref{table_mnist_results}. Regarding the value of weight $\lambda$ of the $L_2$ regularizer, we find that roughly any $\lambda\in[0.001,0.1]$ works well. The reported results are obtained with $\lambda=0.1$. Table~\ref{table_mnist_results} shows that a model trained with the proposed feature regularization method is significantly more robust against PGD adversary than the baseline model with adversarial training alone. The improvement is more than 3\% for white box attack and 1\% for transfer attack.
\subsection{Robustness on CIFAR-10}
\label{subsection_results_on_cifar10}
We use the same wide residual network as Madry et al.~\shortcite{madry2017towards} with [16, 16, 32, 64] filters and its 3-times wider variant with [16, 48, 96, 192] filters respectively. For our attention model, we modify the ResNet by replacing the spatial global average pooling layer after the residual block 4 with a convolutional layer sandwiched between two max-pooling layers to obtain the global feature ${\bm{g}}$. We use a one-hidden-layer ReLU neural network with 64 hidden units as the non-linear attention weight estimator. The model is trained with 5-step PGD adversary and a step size of 2 and $l_\infty$ bound of $\epsilon=8/255$. In order to isolate and analyze the effectiveness of attention module and feature regularization independently, we train three models with the following configurations: adversarial training with feature regularization (AT-reg), adversarial training with attention (AT-att), and adversarial training with both attention and feature regularization (AT-att-reg). We then evaluate the models using PGD and CW~\cite{carlini2017towards} adversaries optimized with various number of steps under white box and transfer attack settings. Transfer attack accuracies are evaluated against adversaries generated from an independently trained copy of the same method with identical configurations.
\begin{table}[t]
\begin{center}
\begin{tabular}{@{}l@{\hskip -0.02\textwidth}r@{\hskip 0.015\textwidth}r@{\hskip 0.015\textwidth}c@{\hskip 0.002\textwidth}r@{}}
\toprule
\bf Method & \bf Madry et al. & \bf AT-reg & \bf AT-att & \bf AT-att-reg \\ \midrule
Natural & 80.79\% & 79.52\% & \bf 82.43\% & 81.20\%\\\midrule
White, PGD 5 & 49.89\% & 52.35\% & 51.22\% & \bf 53.38\%\\
White, PGD 20 &39.72\% & 44.25\% & 41.40\%&\bf 45.20\% \\
White, PGD 100 &38.76\% &43.73\% & 40.85\%&\bf 44.60\%\\
White, PGD 200 &38.64\% &43.70\% & 40.72\%&\bf 44.54\%\\
White, CW 30 &40.27\% &42.96\% & 40.60\%&\bf 44.37\%\\
White, CW 100 &39.98\% &42.87\% & 40.31\%&\bf 44.26\% \\\midrule
Transfer, PGD 5& 60.13\%& 61.82\% & \bf 63.26\% & 62.32\%\\
Transfer, PGD 20 &56.60\% &56.40\% &\bf 58.26\%&57.52\%\\
Transfer, PGD 100 &56.44\% &56.28\% &\bf 58.08\%&57.53\%\\
Transfer, PGD 200 &56.49\% &56.25\% &\bf 58.04\% &57.53\%\\
Transfer, CW 30 &57.11\% &56.86\% &\bf 58.07\%&57.57\%\\
Transfer, CW 100 &57.10\% &56.79\%&\bf 58.13\%&57.41\%\\ \bottomrule
\end{tabular}
\caption{Performance comparison of the adversarial training, adversarial training with feature regularization (AT-reg), adversarial training with attention (AT-att), and adversarial training with both (AT-att-reg) on CIFAR-10 against PGD and CW adversaries.\label{table_cifar10_narrow_results}}
\end{center}
\end{table}
\begin{table}[t]
\begin{center}
\begin{tabular}{@{}l@{\hskip -0.02\textwidth}r@{\hskip 0.015\textwidth}r@{\hskip 0.015\textwidth}c@{\hskip 0.002\textwidth}r@{}}
\toprule
\bf Method & \bf Madry et al. & \bf AT-reg & \bf AT-att & \bf AT-att-reg \\ \midrule
Natural & 85.41\% & 84.65\% & \bf 86.48\% & 85.98\%\\\midrule
White, PGD 5 & 49.15\% & 52.21\%& 50.91\% & \bf 53.23\%\\
White, PGD 20 &38.19\% & 41.00\% & 39.52\%&\bf 41.55\%\\
White, PGD 100 &37.39\% & 40.28\% & 38.98\%&\bf 40.78\%\\
White, PGD 200 &37.20\% & 40.24\% & 38.89\%&\bf 40.67\%\\
White, CW 30 &38.92\% &\bf 42.20\% & 40.75\% & 42.12\%\\
White, CW 100 &38.71\% & 41.88\% & 40.32\%&\bf 42.06\%\\\midrule
Transfer, PGD 5 & 68.03\% & 68.00\% &\bf 69.78\% & 69.00\%\\
Transfer, PGD 20 &62.77\% & 63.14\% &\bf 64.70\%& 64.01\%\\
Transfer, PGD 100 &62.65\% & 63.12\% &\bf 64.78\%& 64.15\%\\
Transfer, PGD 200 &62.73\% & 63.12\% &\bf 64.69\%& 64.11\%\\
Transfer, CW 30 &63.89\% & 64.23\% &\bf 65.65\% & 64.50\%\\
Transfer, CW 100 &63.77\% & 64.04\% &\bf 65.43\% &64.35\% \\\bottomrule
\end{tabular}
\caption{Performance comparison of the adversarial training, adversarial training with feature regularization (AT-reg), adversarial training with attention (AT-att), and adversarial training with both (AT-att-reg) on CIFAR-10 using the 3-times wide ResNet network against PGD and CW adversaries.}
\label{table_cifar10_wide_results}
\end{center}
\end{table}
The evaluation results of aforementioned narrow and 3-times wide models on CIFAR10 are presented in Table~\ref{table_cifar10_narrow_results} and Tabel~\ref{table_cifar10_wide_results}. We find that roughly any $\lambda\in[0.01,1]$ works well for feature regularization. The reported results are obtained with $\lambda=1$ for AT-reg and $\lambda=0.1$ for AT-att-reg.
From the table, we see that all of the three proposed models have better adversarial robustness over the baseline model that only uses adversarial training, and both models with attention show improvement on the classification accuracy on natural examples as well. Note that the white box accuracy of the 3-times wide models are lower than the narrow models, which is due to overfitting of adversarial training~\cite{song2018improving}, and could be solved by early stopping.
We assess the effectiveness of feature regularization by comparing baseline to AT-reg in both Tables. The robustness is significantly improved especially under stronger attack with more steps, more than 5\% in some cases.
Next, by comparing the results of models with and without the attention module, we can see that attention contributes to both standard and adversarial accuracy such that the robustness improves by 1.5\% and at the same time standard accuracy by a similar margin. The attention structure not only favors robust features, it also relies heavily on features extracted from the spatial area that contains the actual object of concern. By suppressing the background clutter and misleading perturbations in irrelevant areas, the model with attention module more precisely learns the underlying distribution of the data which leads to better accuracy.
AT-att-reg takes advantage of both techniques and offers the most improvement in robustness and also better standard accuracy. We think attention and feature regularization complements each other. While regularization encourages the model to learn robust features from the input, attention assigns larger weights to robust features to make the model rely even more on them.
\subsection{Empirical Justification for Attention}
First of all, in order to show the advantage of our proposed non-linear attention model over the linear alignment model in Jetley et al.~\shortcite{jetley2018learn}, we train two narrow ResNet on natural CIFAR-10 samples with the two attention schemes respectively and the accuracy is 92.87\% for our attention and 91.34\% for the linear attention model.
Next, we empirically demonstrate that the attention module assigns larger weights to more robust features by examining the attention weights relative to the feature robustness. Figure~\ref{attention_weights} shows the relationship between the robustness of a feature and the magnitude of its assigned attention weight. The robustness measure we use is the $L_2$ distance between the learned features of a clean and an adversarial image, i.e. the smaller the distance between the features, the more invariant the feature is against input perturbations, therefore the feature is more robust. We rank the features accordingly and compute the average attention weights for each feature across all images. As shown in Figure~\ref{attention_weights}, our proposed attention mechanism indeed assigns larger weights to more robust features and less weights to non-robust features, so the model is more invariant to adversarial perturbation.
\begin{figure}[t]
\begin{center}
\includegraphics[width=0.482\textwidth]{attention_weights.pdf}
\end{center}
\caption{The relationship between attention weights and feature robustness. The horizontal axis is the robustness rank, with 0 being the most robust and 63 the least robust, and the vertical axis is the corresponding attention weights. Left plot shows the results for training set and right plot is for test set of CIFAR-10. \label{attention_weights}}
\end{figure}
\begin{figure}[h]
\begin{center}
\includegraphics[width=0.48\textwidth]{attention_fig.pdf}
\end{center}
\caption{The learned attention maps of our model. The first row are the input images and the second are the attention maps learned at residual block 4. \label{figure_attention_map}}
\end{figure}
Finally, we show the attention maps of our model in Figure~\ref{figure_attention_map} to visualize the attention weights. The attention maps focus sharply on the objects in the images, and the most relevant features like the head and legs of an animal and the wings of an airplane contribute more to the model's prediction and ignore the irrelevant background clutter.
\subsection{Gradient Map}
\label{subsubsection_gradient_map}
In this section, we study the gradient maps, which are the gradients of the cross-entropy loss with respect to input image pixels. The gradient maps directly indicate how the input features are utilized by a model for prediction and highlight the features which affect the loss most strongly. A large gradient on an input feature signifies a heavy dependence from the model. Human vision is robust against small input perturbations and the perception of an image reflects the reliance on input features. Therefore, models that depend on robust features will be better aligned with human vision, and the alignment can be used to evaluate the robustness of a model. Next, we show that the gradient maps generated from our model align better with the salient data characteristics.
First we present the qualitative result. Figure~\ref{figure_grad_map} shows the gradient maps from Madry et al.~\shortcite{madry2017towards} and our model. Overall, we note that gradient maps from both models are highly interpretable and align very well with the image features. Upon careful inspection, it is evident that the gradient maps generated from our model are better than the baseline. To point out a few, note that, in columns 2, 3, 6 and 8, our gradient maps have cleaner backgrounds and the gradients only focus on the objects; especially in column 6, the baseline model has large gradients on the text field in the background which is irrelevant to the class label (automobile), while in our model gradients in that area are much more suppressed. In columns 1, 5, and 9 the edges of the faces and heads of the animals are depicted clearer in our model. Human inspection which could be very subjective, therefore, we also introduce a quantitative evaluation method for gradient maps.
\begin{figure}[t]
\begin{center}
\includegraphics[width=0.48\textwidth]{grad_fig.pdf}
\end{center}
\caption{Original CIFAR-10 images (top row) and corresponding gradient maps from Madry et al. [2017] model (mid row) and our model (bottom row). The raw gradients are clipped to within $\pm 3$ standard deviation and rescaled to lie in the [0, 1] range for visualization. \label{figure_grad_map}}
\end{figure}
\begin{table}[h]
\begin{center}
\begin{tabular}{@{}l@{\hskip 0.01\textwidth}r@{\hskip 0.01\textwidth}r@{\hskip 0.02\textwidth}r@{\hskip 0.01\textwidth}r@{}}
\toprule
& \multicolumn{2}{l}{\bf With clipping} & \multicolumn{2}{c}{\bf Without clipping}\\
\cmidrule[0.05em](r{1.6em}){2-3} \cmidrule[0.05em](l{0em}){4-5}
\bf Method & \bf Train data & \bf Test data& \bf Train data&\bf Test data \\ \midrule
Madry et al. & 27.10\% & 26.78\%& 28.60\% & 28.72\% \\
Ours & \bf 30.11\% & \bf 30.32\% & \bf 31.46\% & \bf 31.59\% \\
\bottomrule
\end{tabular}
\caption{Classification accuracy on the gradient maps from baseline and our model on both the training and test set of CIFAR-10. We run the experiment on gradient maps both with and without clipping to avoid the influence of gradient clipping.\label{table_grad_map_results}}
\end{center}
\end{table}
The problem we consider here is to decide how well the gradient maps align with the original images. The better they align, the more recognizable the gradient images are. A standard neural network extracts relevant features and make predictions based on them. When a gradient map is highly aligned with the original image, the neural net is able to identify more relevant features and thus the classification accuracy will be higher. Therefore, we can quantitatively compare the alignment by the classification accuracy of gradient maps. We use a pretrained network to classify the gradient maps for images in both the training set and the test set.
We pretrained the same ResNet model as in Section~\ref{subsection_results_on_cifar10} with only natural training data of CIFAR-10. It achieves 88.79\% accuracy on the test set. The classification results are presented in Table~\ref{table_grad_map_results}. To avoid the possible influence of gradient clipping we also run the evaluation on raw gradients. As demonstrated by the classification accuracy, the gradient maps from our model express significantly better alignment with the original images.
To summarize, both the qualitative and quantitative results show that the gradient maps from our model have better interpretability and alignment with the original images. It suggests that our model depends on robust features of the input images which explains the improved performance on both standard accuracy and adversarial robustness.
\subsection{Results on CIFAR-100}
Here we present our results on the CIFAR-100 dataset. The experiment setup is the same as CIFAR-10 in Section~\ref{subsection_results_on_cifar10}.
\begin{table}[h]
\begin{center}
\begin{tabular}{@{}l@{\hskip -0.02\textwidth}r@{\hskip 0.015\textwidth}r@{\hskip 0.015\textwidth}c@{\hskip 0.002\textwidth}r@{}}
\toprule
\bf Method & \bf Madry et al. & \bf AT-reg & \bf AT-att & \bf AT-att-reg \\ \midrule
Natural & 52.70\% & 49.53\% & \bf 53.67\% & 50.66\%\\\midrule
White, PGD 5 & 25.14\% &26.99\% & 26.33\% &\bf 27.76\%\\
White, PGD 20 &19.65\% & 23.16\%& 20.82\%& \bf 23.80\%\\
White, PGD 100 &19.47\% & 23.07\%& 20.59\%&\bf 23.62\%\\
White, PGD 200 &19.41\% & 22.96\%&20.53\% & \bf 23.62\%\\
White, CW 30 &18.64\% & 20.78\%& 19.39\%& \bf 20.88\%\\
White, CW 100 &18.61\% &20.63\% & 19.26\%& \bf 20.76\%\\\midrule
Transfer, PGD 5 & 35.37\% & 35.10\% &\bf 35.95\% & 35.17\%\\
Transfer, PGD 20 & 31.99\% & 31.88\%&\bf 32.48\%& 32.04\%\\
Transfer, PGD 100 & 32.03\% & 31.84\%& \bf 32.38\%& 32.00\%\\
Transfer, PGD 200 & 32.00\% & 31.80\%& \bf 32.37\%& 32.06\%\\
Transfer, CW 30 & 32.50\% & 31.96\%& \bf 32.75\%& 29.81\%\\
Transfer, CW 100 & 32.46\% & 31.86\%&\bf 32.74\% & 29.71\%\\\bottomrule
\end{tabular}
\caption{Performance comparison of the adversarial training, adversarial training with feature regularization (AT-reg), adversarial training with attention (AT-att), and adversarial training with both (AT-att-reg) on CIFAR-100 against PGD and CW adversaries.}
\label{table_cifar100_narrow_results}
\end{center}
\end{table}
From Table~\ref{table_cifar100_narrow_results}, similar with CIFAR-10, our model outperforms baseline by as much as 4\% on CIFAR-100 dataset.
\subsection{Comparison of Feature Regularization with Adversarial Logit Pairing}
Though feature regularization is more intuitive than adversarial logit pairing (ALP) as explained in Section~\ref{section_related_work}, their performance under PGD attack is similar. However, because ALP is based on logits, it is not as robust as feature regularization under CW attack~\cite{carlini2017towards}, which is based on logit margin.
\begin{table}[h]
\begin{center}
\begin{tabular}{@{}l@{\hskip 0.04\textwidth}r@{\hskip 0.015\textwidth}r@{\hskip 0.02\textwidth}r@{\hskip 0.015\textwidth}r@{}}
\toprule
\bf Method & \multicolumn{2}{c}{\bf ALP} & \multicolumn{2}{c}{\bf AT-reg}\\
\cmidrule[0.05em](r{1em}){2-3} \cmidrule[0.05em](l{0em}){4-5}
Adversary & CW 30 & CW 100& CW 30 & CW 100 \\ \midrule
Accuracy & 39.17\% & 39.15\%& \bf 42.96\% & \bf 42.87\% \\
\bottomrule
\end{tabular}
\caption{Performance comparison of ALP and feature regularization on CIFAR-10 against CW adversaries. \label{table_alp}}
\end{center}
\end{table}
As shown in Table~\ref{table_alp}, AT-reg outperforms ALP by around 3.8\% against CW attacks.
\section{Conclusion}
In this paper, we propose feature prioritization and regularization to enhance both standard classification accuracy and adversarial robustness of a model over the baseline adversarial training approach. We provide empirical justifications for attention to show that it effectively favors robust features and focuses sharply on the region of interest. We then conduct quantitative and qualitative evaluation on gradient maps to show that they align perfectly with salient data characteristics, which further proves that our model heavily relies on the robust features.
\bibliographystyle{named}
| {'timestamp': '2019-08-14T02:03:44', 'yymm': '1810', 'arxiv_id': '1810.02424', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02424'} | arxiv |
\section{Introduction}
Due to the highly dynamic nature of the World Wide Web, traditional
search engines (SEs) must face great challenges on scalability and
adaptability. Because of the limited resources available to a search
engine, it is hard to catch up with the fast expansion of the Web
and the frequent updates of its contents. Consequently, the overall
coverage of the search engines with respect to the size of the
entire web deceases with time. We need a scalable and highly
efficient search and index mechanism to make the data on the web in
a timely manner accessible.
To overcome these difficulties, in the past decade, various
information retrieval (IR) methods based on parallel and distributed
computing have been proposed. Among these methods, parallel
information retrieval \cite{Tomasic} that maintains a single index
and employs a server cluster to balance the load has been well
studied and successfully applied in real-world search engines such
as Google. However, it is not scalable with respect to the size and
dynamics of the Web. Furthermore, it cannot handle the hidden deep
web because of privacy issues. To alleviate these problems,
federated information retrieval \cite{Shokouhi} and meta-search
\cite{Meng} were proposed. They send a query simultaneously to
multiple search engines, collect the results from each search engine
after the query has been evaluated separately, and last merge the
results together (i.e., re-ranking). In this way, there is no need
to access directly to the pages or the index at each search engine.
FIR makes it possible to take advantage of the power of different
search engines and provide large coverage of the Web. Since FIR
facilitates cooperation among search engines, it can be more
efficient and effective than meta-search. For this reason, FIR has
attracted much attention in recent years.
As a promising solution to the scalability and adaptability
problems, FIR aims to support search on a large amount of data in a
distributed and self-organizing manner. In the FIR framework, each
search peer indexes and maintains its own document collection, thus
avoiding management problems associated with large data centers. A
broker is introduced to maintain a directory of the peers together
with summarization information, named descriptors, about them. For
query processing, the broker will select peers that have high
potential to return relevant documents for the query according to
the peer descriptors. Note that the broker does not have to know the
peers' indexes or original document sets. In this paper, we only
consider textual documents and content relevance in retrieval, so we
name it federated text retrieval (FTR).
In conventional centralized IR methods, query processing only
focuses on the problem of finding relevant documents using a single
index. On the contrary, FTR requires a three-phase query processing
procedure. First, it identifies promising peers which may return the
most relevant documents. Then it submits the query to the selected
search engines, each of which retrieves the results from its
collection. Finally, it merges the results together and returns them
to the user. Peer selection plays a key role in FTR, which is also
the major concern of this paper. With peer selection, we can make
query evaluation more efficient and, at the same time, save a lot of
computing resources (e.g., power, communication bandwidth, CPU time,
etc.). A number of peer selection approaches \cite{Callan,
Gravano:1} have been proposed, but they are mostly based on the word
histogram of the peers and traditional term matching techniques.
Obviously, the content structure in a collection is significantly
different from that in a document, because a document often focuses
on one topic while a collection may have documents belonging to
different topics. To precisely characterize a heterogeneous
collection, it is necessary to divide it into smaller but more
homogeneous clusters. Inspired by this basic idea, some approaches
\cite{Xu, Shen} utilize clustering to partition the document
collection into different topics and then rank the peers based on
the clusters. Experiments showed that topic-based ranking methods
can substantially improve the quality of peer selection. However,
these studies were only based on heuristics without much rationale
behind them. Besides, they rely heavily on the cluster quality and
ignore the relations among the clusters. In this paper, we propose a
novel approach called Cluster-based Distributed Latent Semantic
Indexing (C-DLSI) based on a formal analysis of the problem. In
particular, C-DLSI, by applying clustering to distinguish the topics
of a peer, extends the traditional LSI scheme and captures delicate
semantic features of the peer, thus providing more precise
characterization of the peer. Moreover, our method is quite scalable
and cost-efficient for the updates.
We detail our main contributions as follows:
\begin{enumerate}
\item An LSI-based framework (C-DLSI)
for text retrieval in distributed environments was proposed. It
encompasses directory maintenance and query processing.
\item Identification of the properties of FTR and the feasibility
analysis of extending LSI with clustering to improve the quality of
peer representation. Specifically, the relations among the clusters
are considered in C-DLSI to adapt to the properties of FTR. Our
method is efficient and adapts to frequent collection updates since
only the clusters affected by the updates need to be reindexed.
\item Based on the analysis of C-DLSI, novel descriptors of the peers
are proposed and a complete federated query processing strategy in
FTR is developed.
\item The extensive performance evaluation of C-DLSI on a TREC
dataset. Impacts of different parameter selections are fully
discussed.
\end{enumerate}
The rest of the paper is organized as follows. In Section 2, we
review the related work on FIR and peer selection. Some bases of our
method, including the framework of FTR, Latent Semantic Indexing
(LSI) and K-means Clustering are introduced in Section 3. In Section
4, we formalize the problem and present our approach C-DLSI in
details. The experimental setup and corresponding results are showed
in Section 5. The last section summarizes the results obtained in
this paper.
\section{Related Work}
Peer selection is a critical problem in FTR and distributed
information retrieval systems in general. It has been studied for
more than a decade. Many methods have been proposed to address this
issue. gGloss (generalized Glossary-Of-Servers Server)
\cite{Gravano:1, Gravano:2} is a well-known method. It keeps
statistics (document frequencies and total weights) about the
servers to estimate which servers are potentially most useful for a
given query. In particular, gGloss(0), a special form of gGloss,
which aggregates all similarity values between the documents and the
query, was shown to be the best and has been widely employed for
comparison \cite{Craswell, Shen, Sogrin}. In this paper, we also use
it as a baseline.
The Collection Retrieval Inference Network (CORI) \cite{Callan,
Powell} is another important work. It drew analogy between
collection ranking and document ranking and applied some form of
$TF\times IDF$ ranking strategy to rank the collections.
Specifically, it replaces TF with DF (document frequency), and IDF
with ICF (inverse collection frequency), the inverse of the
proportion of the collections carrying at least one document which
contains some query terms. Moreover, Yuwono and Lee \cite{Yuwono}
proposed the cue-validity variance (CVV) method for collection
selection. CVV measures the skewness of the distribution of a term
across the collections and estimates the usefulness of the term for
distinguishing a collection from another. Then terms with larger
variances will be given larger weights in index collection ranking.
An evaluation of a number of collection selection methods in a Web
environment was given in \cite{Craswell}. None of these methods
consider the topic space of the peers and utilize semantic
information beyond simple term matching to make a selection.
Latent Semantic Indexing (LSI) \cite{Deerwester} was originally
proposed to take advantage of implicit high-order structure in the
association between terms with documents, namely, semantic
structure, to improve the retrieval of relevant documents. Much
efforts have been made to improve its performance \cite{Letsche,
Jessup, Husbands} or broaden its applications \cite{Pham}. An
earlier work which tried to utilize LSI to improve the peer
selection of FTR is the latent semantic database selection (LSDS)
\cite{Sogrin}. It simply applied LSI to preprocess the document
collections, and conventional selection methods (e.g., CORI) on the
"cleaned" term/document matrices for ranking the collections.
However, this method did not capture the key properties of FTR and,
moreover, inherited the disadvantages of the conventional methods,
e.g., ignoring the topic space of the peers and the drawbacks
inherited from CORI.
To overcome the deficiencies of traditional methods, cluster-based
approaches were proposed to identify the topic space of the peers.
Document clustering was applied to organize collections around
topics and then language modeling was used to represent the topics
\cite{Xu}. This method allows the right topics to be effectively
identified for a given query. However, this method cannot
distinguish the documents within a topic. Shen and Lee \cite{Shen}
proposed another cluster-based method IS-cluster which utilized
cluster descriptors to rank the servers for meta-search engine. We
also use this method as a candidate for comparison in our
experiments. Term correlation was introduced to further improve
cluster-based methods \cite{Zhao}. However, it did not consider the
compatibility issue in FTR, which means that peer selection should
adapt to the local document ranking functions. Further, it is very
difficult to determine the parameters in the method. In this paper,
we extend LSI with the clustering method to especially adapt to FTR
and achieve better retrieval performances.
Recently, uncooperative federated search systems have been studied.
In this case, collections do not disclose their index statistics to
the broker. The broker has to sample documents from each collection
and uses them for collection selection. ReDDE \cite{Si:1} estimates
the number of relevant documents in collections and uses it to
improve collection selection. Estimation of the needed information
for collection selection from an uncooperative peer was addressed in
\cite{Liu}. \cite{Nottelmann} introduced a decision theoretic
framework (DTF) for collection selection, which tries to minimize
the overall costs of federated search including money, time, and
retrieval quality. Similarly, \cite{Si:2} proposed a unified utility
maximization framework (UUM) for resource selection, which evaluates
queries on sampled index. Furthermore, an enhanced model called RUM
\cite{Si:3} was proposed by considering the search effectiveness of
collections. In general, they do not consider the topic space of the
peers either and ignore the semantics. Thus, C-DLSI can also be
embedded into these methods with slightly change (e.g., applied on
the sampling documents) to adapt to this new scenario.
\section{Preliminaries}
In this section, we introduce some preliminaries which act as the
bases of our C-DLSI method. In particular, we first present the
general FTR framework in Section 3.1. Then we describe two important
techniques Latent Semantic Indexing (LSI) and document clustering in
Section 3.2 and Section 3.3, respectively.
\subsection{FTR Framework}
As a federated information retrieval scheme, FTR provides a loose
cooperation among search peers in which each peer maintains its own
local index and a central broker is employed to coordinate the
cooperative text retrieval. Specifically, each peer has a complete
search engine in itself. That is, it has its own crawler, index and
search component for information gathering, organizing and
retrieving, respectively. Besides, the peers share a common
descriptor publishing scheme to disclose to the broker summaries of
information in their repositories. On the other side, the broker of
the FTR system take charge of the query processing by maintaining a
centralized directory, which holds the descriptors of the peers'
local indexes.
\begin{figure}
\centering \epsfig{file=ftr.eps, width=3in} \caption{FTR
framework.}
\end{figure}
In FTR, two basic functions are supported: directory maintenance (or
peer descriptor publishing) and query processing. Figure 1 shows the
whole framework of FTR. First, each peer summarizes the descriptor
for its local index and publishes it to the directory in the central
broker. These descriptors are used by the broker to select suitable
peers in query processing. This process is known as the \emph{peer
representation} problem \cite{Bernstein}. Usually, a descriptor
contains connection information together with statistics for each
term in the peer or a limited number of sampled documents. In this
paper, we will provide a novel solution to peer representation in
Section 4.3.
When a query arrives at the broker, the broker selects the most
promising peers which may return the most relevant documents based
on the descriptors. This is the \emph{peer selection} problem
\cite{Callan}. Then the query is forwarded to the selected peers.
Based on the local index, each peer evaluates the query and returns
the results to the broker. Once receiving the results, the broker
will employ a reranking method to properly merge the results
together and present them to the user. It is called the \emph{result
merging} problem. We will consider these issues of the federated
query processing in Section 4.4.
\subsection{Latent Semantic Indexing}
Latent Semantic Indexing (LSI) proposed by Deerwester et al. aims at
taking advantage of the semantic structure of a document collection
to improve retrieval performance. Its objective is to overcome the
fundamental deficiencies of conventional keyword-based information
retrieval techniques. The problem stems from the fact that users are
interested in documents which share the same conceptual content with
the queries, but traditional IR techniques only perform keyword
matching between queries and documents and thus cannot deal with
synonymy and polysemy problems. To bridge the gap, LSI applies
singular value decomposition (SVD) on a term-document matrix to
statistically extract the implicit high-order structure in the
association of terms with documents, which can be used to find the
semantic representations of documents.
LSI is an extension of the vector space model, which approximates
the term-document matrix by the truncated SVD of the matrix. Given
an $m\times n$ term-document matrix $A$, the SVD of $A$ is
\begin{equation} A = U\Sigma V^T,\end{equation}
where $U$ and $V$ have orthonormal columns, $\Sigma$ is a diagonal
matrix having the singular values of $A$ in decreasing order
(denoted as $\sigma_1, \sigma_2, \ldots, \sigma_{rank(A)}$) along
its diagonal, and $T$ denotes the transpose of a vector or a matrix.
LSI decompose $A$ to a lower dimensional vector space $k$ by
retaining only the largest $k$ singular values, where $1\leq k <
rank(A)$. Specifically,
\begin{equation}\label{SVD} A_{k} = U_{k}\Sigma_{k} V_{k}^T,\end{equation}
where $U_{k}$ and $V_{k}$ consist of the first $k$ columns of $U$
and $V$ respectively, and $\Sigma_{k}$ is the $k\times k$ diagonal
matrix containing the largest $k$ singular values of $A$. Because
the number of factors $k$ can be much smaller than the number of
unique terms used to construct this space, terms will not be
independent and the terms with similar meaning will be located near
one another in the LSI space. The relevance score of a document
vector $d$ with a query vector $q$ is measured by the cosine or dot
product between the document vector $d_k$ in LSI space and $q$.
Without loss of generality, we assume that all vectors are
normalized. Then the relevance score can be described as,
\begin{equation} s(d, q) = d^T_k q.\end{equation}
In this paper, we apply the distributed latent semantic indexing to
peer selection and document ranking.
\subsection{Document Clustering}
Since a peer contains a large number of documents, it potentially
covers multiple topics compared to that of a single document. Thus,
a word histogram created for the entire peer cannot provide a
precise description of the peer, making it inadequate to apply a
document ranking approach to peer ranking. A proper peer selection
should consider the topics covered in the peers. In our framework,
we utilize a clustering technique to group the documents of a peer
and treat each cluster as an approximate topic. Then the peer is
evaluated based on the clusters' relevance scores with respect to a
given query.
Although the clustering process is an offline process in the
framework, we still need an efficient clustering method that can
handle a large number of documents and adapt to updates on the
peers. In this paper, we adopt the widely used k-means clustering
algorithm \cite{Jain} to deal with these problems. It uses an
iterative procedure to find $K$ partitions of objects, which
minimize the total intra-cluster variance (or the squared error
function). Specifically, it starts with $K$ randomly selected
objects to serve as the centroids and divides the objects according
to the distances from them. Then it generates $K$ new centroids
based on the current partitions and starts another round of division
until a stable state is reached. Empirically, the k-means algorithm
can converge quickly and is considered to be very efficient. For
document space, k-means is to maximize the following measure:
\begin{equation} I = \sum_{i=1}^K {n_i \mu_i^T \mu_i} \end{equation}
where $n_i$ denotes the document number of the $ith$ cluster, and
$\mu_i$ the centroid of the $ith$ cluster.
It is proven that the solution to the k-means clustering method
coincides with the principal points solution \cite{Flury}, which
means it is a point-representation scheme where the best $K$
representative points (i.e. topics) are obtained. On the contrary,
SVD provides a component-representation of the document space and
ensures the best representation of the information content in a
reduced dimensional vector space. We will show that extending LSI
with clustering can especially adapt to FTR.
\section{FTR with C-DLSI}
In this section, we present the details about our cluster-based
distributed latent semantic indexing (C-DLSI) method for FTR. By
identifying the special properties of FTR, we extend LSI accordingly
to treat the peer selection issue, which overcomes the deficiencies
of the conventional approaches. In Section 4.1, we first formulate
the peer selection problem in FTR, analyze the properties, and
identify the deficiencies of the traditional approaches. Then we
propose the C-DLSI method especially tailored for FTR in Section
4.2. Based on C-DLSI, the corresponding descriptors and a federated
query processing in FTR are presented in Section 4.3 and Section
4.4, respectively. Finally in Section 4.5, we describe an update
scheme for a peer in a highly dynamic environment.
\subsection{Properties of Peer Selection in FTR}
In FTR, if the distribution of relevant documents across the results
returned by the peers were known, the peers could be ranked by the
number of relevant documents they return, which is known as
relevance-based ranking (RBR) \cite{Callan:0}. Consider a set of
peers $M=\{p_i\}$. To simplify the explanation, we assume that each
peer is required to return the top $N$ results, i.e., $\theta_i =
\{d_{ij}\}$ $(1 \leq j \leq N)$ with decreasing relevance score for
peer $p_i$. Let $r(d, q)$ denote the probability of relevance for
document $d$ given query $q$. The ranking value $r(p_i, q)$ for peer
$p_i$ can be represented as,
\begin{equation} r(p_i, q) = \sum_{j=1}^N r(d_{ij}, q) \end{equation}
Assume that the global weight of a term in each document is given.
There are two major issues here. One is how to determine a proper
relevance value $s(d_{ij}, q)$ which can approximate $r(d_{ij}, q)$
well. The other is how to summarize the descriptors of the peers
based on which the ranking value $r(p_i, q)$ can be properly
estimated.
A simple solution is to estimate the relevance score $s(d_{ij}, q)$
by computing the inner products between $d_{ij}$ and $q$ which is
called gGloss(0) \cite{Gravano:1} and can be described as,
\begin{equation} s(d_{ij}, q)=d_{ij}^T q \end{equation}
By only maintaining the document number $n_i$ and the centroid
$\mu_i$ of the peer $p_i$, the broker can estimate the ranking value
of peer $p_i$ as,
\begin{equation} r(p_i, q)= n_i \mu_i^T q \end{equation}
which is equal to $\sum_{i=1}^{n_i} s(d_{ij}, q)$. To solve the
problem of various $idf$ values of a term among peers, CORI
\cite{Callan}, on the other hand, estimates the ranking value by
using the term frequency of each query term in each peer. A further
improvement of CORI is to combine it with LSI \cite{Sogrin}. Since
these methods do not consider the topic space of the peers, the
effect of polysemy, i.e., some terms common to two conceptually
independent topics, is ignored. Different from document ranking,
peer ranking is suffered from the polysemy issue more seriously,
because the accumulation of small semantic deviations of the
documents may lead to big error in peer ranking. For example,
consider a collection of two documents. One is related to "apple,
fruit" while the other is related to "computation, math". If we
ignore polysemy, we may draw the conclusion that the set is related
to "apple computer", even though the individual relevance scores of
the documents with the query "apple computer" are not high.
A direct way to solve the polysemy issue is to use clustering to
identify the topics in a peer. Consider a conceptually homogenous
cluster. If it is regarded to be relevant to a query, say, "apple,
computer, product", then a document in it which does not contain any
query terms, e.g., talking about "MacBook, OS", is still likely to
be relevant to the query. Therefore, we should also consider the
synonyms in a cluster. Unfortunately, to the best of our knowledge,
none of the existing methods can adapt well to this situation. For
example, if we directly apply LSI on the whole collection and then
cluster the documents, then the polysemy can not be effectively
identified by LSI. \cite{Shen} tried to solve this problem by
representing a document with the descriptor of its cluster.
Specifically, the weight $\overline{w_t}$ of a term $t$ in the
descriptor of a cluster $c_l$ is computed by,
\begin{equation}\overline{w}_t = \frac{\sum_{d_{ij}\in c_l}{w(d_{ij}, t)}}{n_{l,t}} \end{equation}
where $w(d_{ij}, t)$ denotes the weight of term $t$ in document
$d_{ij}$ and $n_{i,t}$ the number of the documents in $c_i$ which
contain term $t$. We can see that, to handle synonyms, the weight of
a term in the descriptor is estimated only according to the
documents which contain them. Then similar formulas as (6) and (7)
are utilized to compute the ranking value of the peers. Similarly,
\cite{Xu} employs language model to determine the relevant cluster
and all of the documents in a relevant cluster are regarded to be
relevant. However, these methods are restricted by two major
drawbacks. First, they rely heavily on the quality of clustering and
do not consider the relations among clusters. Second, since they
assume that all the documents in a cluster is equally relevant, it
may exaggerate the relevance score of weakly relevant or irrelevant
document and is difficult to decide a proper ranking list of the
documents, which is known as a compatibility issue. To overcome
these limitations and adapt to the properties of FTR, we extend LSI
with clustering which considers the relations among clusters and
captures more accurate descriptions of the peers.
\subsection{Cluster-based Distributed LSI (C-DLSI)}
In our method, the collection of a peer is partitioned into a number
of clusters $\{c_i\}$ (using k-means clustering). Then, LSI is
employed to derive the semantic structure within each cluster, i.e.,
LSI space $C'_i = U'_i \Sigma'_i {V'_i}^T$ for cluster $c_i$ with
term-document matrix $C_i = U_i\Sigma_i V_i^T$. To make the LSI
spaces among clusters comparable, we restrict $C'_i$ with singular
values larger than a threshold $\varepsilon$. Let $\sigma_{i,j}$
denote the $jth$ singular value in $\Sigma_i$ and a number $k$
satisfy,
\begin{displaymath} \sigma_{i,j}\geq \varepsilon,~1<j\leq k \end{displaymath}
\begin{displaymath} \sigma_{i,j}<\varepsilon,~k<j\leq rank(C_i) \end{displaymath}
Then, the LSI space of $C_i$ is redefined as,
\begin{equation} C'_i = (C_i)_{\varepsilon} = (U_i)_k (\Sigma_i)_k {(V_i)_k}^T\end{equation}
Consider a diagonal block matrix $A$ for a peer with the form,
\begin{equation}A=\left(
\begin{array}{cccc}
C_1 & & & \\
& C_2 & & \\
& & \ddots & \\
& & & C_K \\
\end{array}
\right)\end{equation}
where $C_i$ represents a conceptually independent topic, e.g.,
cluster $c_i$. It is easy to prove the following relation \cite{Li},
\begin{equation}{A_\varepsilon}=\left(
\begin{array}{cccc}
(C_1)_\varepsilon & & \\
& \ddots & \\
& & (C_K)_\varepsilon \\
\end{array}
\right)\end{equation}
It means if a collection is perfectly divided into a number of
conceptually independent topics and no polysemy exists, the LSI
space of a peer built in our method is equal to the traditional LSI
which is directly applied on the whole collection. Obviously, the
LSI spaces of the clusters can distinguish and capture the semantics
of the documents more precisely than the existing methods. In the
rest of this subsection, this idea will be further improved.
Each peer maintains the semantic structures of its clusters for
descriptor generation and federated query processing. Thus, we call
our method {\em cluster-based distributed LSI} (C-DLSI). Generally,
the clusters of a peer may have some relations from each other
because of several reasons, e.g., some topics are not conceptually
independent in nature or the clustering is not perfect enough and
some documents belonging to one topic are separated. In C-DLSI, a
semantic similarity measure between any two clusters (named paired
similarity) is introduced. This measure is estimated based on the
similarity of the LSI vector spaces and consequently, a network of
clusters is formed from words shared by each pair of clusters. With
the similarity network of clusters, C-DLSI can further exploit the
synonyms without loss of the polysemy information. Therefore, it can
especially adapt to FTR.
Similar to \cite{Bassu}, we define two levels of the paired
similarity. Consider two clusters $c_i$ and $c_j$ ($i\neq j$). Let
$T_i$ denote the term set for a cluster $c_i$ and $T_{ij}$ the
common term set for $c_i$ and $c_j$. The first level of paired
similarity $S1$ only captures the frequency of occurrence of common
terms. If $c_i$ and $c_j$ have common terms, we say there is a
direct link between them. Define the \emph{proximity} of $c_i$ and
$c_j$ to be the minimal number of the intermediate clusters which
link $c_i$ and $c_j$. Let $l$ denote the proximity between $c_i$ and
$c_j$, then $S1(c_i, c_j)$ is defined as (we only consider the case
of $l\leq 1$),
\begin{equation} S1(c_i, c_j)= (1/S_{ij}^l + l)^{-1} \end{equation}
where,
\begin{displaymath} S_{ij}^0 = \frac{|T_{ij}|^2}{|T_i| |T_j|} \end{displaymath}
\begin{displaymath} S_{ij}^1 = \max_{m} \frac{|T_{im}|^2 |T_{mj}|^2}{|T_i| |T_m|^2 |T_j|} \end{displaymath}
Moreover, a further level of the paired similarity captures the
semantics of the common terms, denoted as $S2$. Let $B_i = U'_i
{U'_i}^T$ denote the term similarity matrix for cluster $c_i$ and
$B_i^{Q}$ the restriction of $B_i$ to the term set $Q$. Define the
correlation measure between two $n\times m$ matrices $X$ and $Y$ as,
\begin{equation} R(X,Y) = |\frac{1}{nm}\sum_{i=1}^n{\sum_{j=1}^m{(\frac{X_{ij} - \overline{X}}{F_X})(\frac{Y_{ij} - \overline{Y}}{F_Y})}}| \end{equation}
where,
\begin{displaymath} \overline{X}=\frac{1}{mn} \sum_{i=1}^n {\sum_{j=1}^m
{X_{ij}}},~ \overline{Y}=\frac{1}{mn} \sum_{i=1}^n {\sum_{j=1}^m
{Y_{ij}}}
\end{displaymath}
\begin{displaymath} F_X = \frac{1}{mn} \sum_{i=1}^n {\sum_{j=1}^m
{X_{ij}^2}},~ F_Y = \frac{1}{mn} \sum_{i=1}^n {\sum_{j=1}^m
{Y_{ij}^2}}
\end{displaymath}
Then, $S2(c_i, c_j)$ is defined as,
\begin{equation} S2(c_i, c_j)= (1/S_{ij}^l + l)^{-1} \end{equation}
where,
\begin{displaymath} S_{ij}^0 = R(B_i^{T_{ij}},B_j^{T_{ij}}) \end{displaymath}
\begin{displaymath} S_{ij}^1 = \max_{m}{R(B_i^{T_{im}},B_m^{T_{im}})R(B_m^{T_{mj}},B_j^{T_{mj}})} \end{displaymath}
Based on these definitions, the paired similarity between $c_i$ and
$c_j$ is defined as,
\begin{equation}S(c_i, c_j)=S1(c_i, c_j) S2(c_i, c_j) \end{equation}
Before further explanation, we first consider an example of the
semantic structures in a collection as shown in Figure~\ref{fig:ss}.
Obviously, the polysemy of term "apple" can be identified via
clustering and divided into different clusters. However, some
conceptually relevant terms such as "MacBook" and "Computer" may
appear in different clusters. For a given query "computer", if only
the LSI space within a cluster is considered, then the relevant
documents in cluster 3 will be missed. For this reason, the paired
similarities among clusters are employed to extend the LSI space
built in a cluster.
\begin{figure}
\centering \epsfig{file=ss.eps, width=2.5in} \caption{An
example of the semantic structures in a collection.} \label{fig:ss}
\end{figure}
For a cluster $c_i$, let $L_i = \{c_{i_1}, \ldots, c_{i_n}\}$ be a
set of clusters in the same peer as $c_i$ which satisfies the
following conditions,
\begin{displaymath} \forall c_{i_j}\in L_i,~S(c_i, c_{i_j}) > \delta, \end{displaymath}
\begin{displaymath} and~ \forall c_{i_{j1}},c_{i_{j2}}\in L_i,~j1<j2 \Rightarrow S(c_i, c_{i_{j1}}) \geq S(c_i, c_{i_{j2}}) \end{displaymath}
where $\delta$ is a threshold above which the cluster is regarded to
be relevant to $c_i$. We call $L_i$ the relevant clusters of $c_i$.
Given a query $q$ (denote $T_q$ as its term set), the relevance
score of cluster $c_i$ is computed as the sum of the relevance
scores of $c_i$ to all of the terms in $q$, which can be represented
as,
\begin{equation} s(c_i, q)= \sum_{t\in T_q}{s(c_i, t)} \end{equation}
The relevance score of cluster $c_i$ to a term $t$, i.e., $s(c_i,
t)$, can be estimated in two cases.
1) If $t \in T_i$, we have,
\begin{equation} s(c_i, t)= n_i \mu_{i,t} q_t \end{equation}
where $n_i$ is the number of documents in $c_i$ and $\mu_{i,t}$ is
the weight of $t$ in the centroid $\mu_i$ of the LSI space of $c_i$.
2) If $t \notin T_i$, the relevance score can not be derived
directly by using the LSI space of $c_i$. Then we can rely on its
relevant clusters $L_i$ to estimate the relevance score. Let
$c_{i_m}$ be the first cluster of $L_i$ which satisfies $t \in
T_{i_m}$. The projection of $t$ into the LSI space of $c_{i_m}$ can
be presented as,
\begin{equation}t' = B'_{i_m, t} q_t\end{equation}
where $B'_{i_m, t}$ denotes the column of $B'_{i_m}$ which
corresponds to term $t$. Therefore, the relevance score of $c_i$ to
term $t$ can be approximated as,
\begin{equation} s(c_i, t)= n_i \mu_i^T t'= n_i \mu_i^T B'_{i_m, t} q_t \end{equation}
With the relevance scores $\{s(c_i, q)\}$ of the clusters $\{c_i\}$
to the query $q$, we can estimate the ranking value of a peer $p$.
Let $c_1, \ldots, c_K$ be the clusters of $p$ with decreasing
relevance scores. Then the ranking value is estimated by considering
the most $h$ relevant clusters, which can be represented as,
\begin{equation} r(p, q)= \sum_{i=1}^h {s(c_i, q)} \end{equation}
Moreover, C-DLSI is efficient and scalable, since the size of a
cluster is substantially smaller than that of the entire collection.
With regard to document updates, it only requires reindexing of the
affected clusters. Thus, it is suitable for highly dynamic
environment in which documents are frequently updated.
\subsection{Descriptors of Peers}
A peer will publish a descriptor of its content to the broker for
peer selection. In C-DLSI, since a collection has been clustered,
the descriptor of a peer consists of a set of cluster descriptors.
According to Formulas $(16)\sim (20)$, we need at least the document
number $n_i$, the centroid of the LSI space $\mu_i$, and the eigen
matrix $U'_i$ to describe a cluster $c_i$. However, $U'_i$ is
usually quite large and may cause heavy communications between the
broker and the peers. To overcome this difficulty, we rewrite
Formula (19) as follows,
\begin{equation} s(c_i, t)= n_i \mu_i^T B'_{i_m, t} q_t = n_i (B'^T_{i_m, t} \mu_i)^T q_t\end{equation}
It means we only need a value $B'^T_{i_m, t} \mu_i$ instead of the
vector $B'_{i_m, t}$ to estimate the relevance score. For any term
$t$, a list of vectors $\rho_i = \{U'_{i_1} U'^T_{i_1}
\mu_i,\ldots,U'_{i_n} U'^T_{i_n} \mu_i)\}$, which correspond to the
order of the relevant clusters $L_i = \{c_{i_1}, \ldots, c_{i_n}\}$,
are guaranteed to find the value $B'^T_{i_m, t} \mu_i$. Therefore,
the transmission of the matrix $U'_i$ can be saved. Based on this,
we define the descriptor $D_i$ for cluster $c_i$ in C-DLSI to
contain the following aggregate information:
\begin{enumerate}
\item The total number of documents in the cluster, $n_i$.
\item The centroid of LSI space in the cluster, $\mu_i$.
\item A list of vectors $\rho_i = \{U'_{i_1} U'^T_{i_1} \mu_i,\ldots,U'_{i_n} U'^T_{i_n}
\mu_i)\}$, which correspond to the order of the relevant clusters $L_i = \{c_{i_1}, \ldots,
c_{i_n}\}$.
\end{enumerate}
\noindent That is,
\begin{equation}D_{c_i} = \{ N_i, \mu_i, \rho_i \} \end{equation}
Then we define the descriptor $D_p$ for peer $p$ as,
\begin{equation}D_p = \{ D_{c_i} | c_i\in p \} \end{equation}
which represents the peer with more fine-grained descriptions of its
clusters. Since the number of clusters $K$ is extremely small,
publishing this descriptor causes little overhead in C-DLSI.
Note that we assume in this paper that there is little or no overlap
among the peers. This is a reasonable assumption in most cases.
Since each peer is supported to cover a different part of the web,
it corresponds to a distinct database. When this assumption is
violated, we can add more aggregate information into cluster
descriptors as proposed in \cite{Bender:1}.
\subsection{Federated Query Processing}
As described in Section 3, federated query processing in FTR
contains three steps, namely peer selection, local text retrieval,
and result merging. In this subsection, we will discuss these three
issues in C-DLSI.
As discussed in Section 4.2, the broker compute the ranking values
for all the peers according to Formula (20) based on the
descriptors. In particular, when computing the relevance score of a
cluster $c_i$ to a term $t$ of the query $q$ with $t \notin T_i$,
the broker will scan the list $\rho_i$ and find the first relevant
cluster $c_{i_m}$ which contains $t$. Then the relevance score
$s(c_i, t)$ is computed by,
\begin{equation} s(c_i, t)= n_i \rho^t_{i, m} q_t \end{equation}
where $\rho^t_{i, m}$ denotes the weight of $t$ in the $mth$ vector
of $\rho_i$. Otherwise, the relevance score $s(c_i, t)$ can be
directly computed according to Formula (17). The broker will choose
the peers with largest ranking values and forward the query $q$,
together with the IDs of the $h$ most relevant clusters, to each of
them. Then it enters the phase of local retrieval.
Local retrieval is performed by peers to retrieve relevant documents
from the collections. C-DLSI only considers the LSI spaces of the
$h$ most relevant clusters specified by the broker. The relevance
score of a document $d_j$ to query $q$ is evaluated based on its LSI
vector $d'_j$ in the corresponding cluster $c_i$. Similarly, we
have,
\begin{equation}s(d_j, q)= \sum_{t\in T_q}{s(d_j, t)} \end{equation}
If $t \in T_i$, then the relevance score of the document $d_j$ to
term $t$ can be computed by,
\begin{equation}s(d_j,t) = d'_{j,t} q_t \label{eqn:sim}\end{equation}
where $d'_{j,t}$ denotes the weight of $t$ in $d'_j$. Otherwise, the
first cluster in $L_i$ which contains term $t$ will be found,
denoted as $c_{i_m}$ and the relevance score is estimated as,
\begin{equation}s(d_j,t) = d'^T_j B'_{i_m, t} q_t \end{equation}
Thus, the evaluated documents can be sorted according to their
relevance scores, and only the top-ranked documents will be returned
as the results to the broker.
Result merging in FTR tries to provide a uniform ranked list of the
documents returned from multiple peers. Assume that each peer has
the global weights for all of the terms in the documents and applies
the same ranking function. Then the relevance score of a document
estimated by the peer is also valid as a global score among all
peers. Thus, we can simply merge the documents according to their
relevance scores returned by the corresponding peers in C-DLSI.
Another factor considered in our framework is the compatibility
between peer selection and local text retrieval. Since the goal of
FTR is to retrieve valuable peers that can return most relevant
documents, this process is also impacted by local text retrieval
schemes. Thus it requires the peer selection and local text
retrieval to be compatible and consistent, which is called the
compatibility issue. In C-DLSI, we try to guarantee this property in
peer selection method and local text retrieval. Previous research
has shown that LSI can help improve document retrieval in a single
collection. However, most conventional methods for peer ranking are
more likely to select the peers with the largest number of weighted
keywords, which does not conform to the basic principle of LSI.
Moreover, though several peer selection methods consider the
semantic structures of the collections, they ignore the
compatibility issue or it is hard to find a proper local text
retrieval method to adapt to their peer ranking scheme.
\subsection{Collection Update}
Although our C-DLSI method employs LSI in a distributed way and only
requires applying SVD in a relatively small scale (i.e., on clusters
only), collection update could still be costly for extremely large
and dynamic collections. In our framework, we utilize a lazy scheme
to handle this problem. In particular, each peer keeps all of the
semantic transformation matrices $\{U'_i\}$ of its own clusters
(refer to Section 4.2). When an update occurs, e.g., due to textual
update or newly crawled documents, it will first assign the updated
documents to the most related clusters, e.g., cluster $c_i$, and
then directly use $U'_i$ to evaluate the semantic vector $d'_j$
according to the following formula:
\begin{equation}d'_j = U'_i U'^T_i d_j\end{equation}
where $d_j$ is the updated document vector. It can be easily proven
that this form is consistent with the original form of Formula~(2).
If the amount of updates exceeds a threshold for a cluster, the
corresponding peer will rebuild its LSI by applying SVD on the
cluster again. This update handling scheme is also tested and
analyzed in the experiments.
\begin{table}
\centering \caption{Summary of the experimental data}
\begin{tabular}{|c|c|c|} \hline
Type & Count & Avg. Length\\ \hline Document & 53595 & 213.455\\
\hline Query & 50 & 2.740\\ \hline Term & 186319 & -\\
\hline\end{tabular}
\end{table}
\begin{figure}
\centering \epsfig{file=data.eps, width=2.5in} \caption{Number
of relevant documents for each query.}
\end{figure}
\section{Experiments}
To evaluate the C-DLSI method, we build a simulation platform with
one broker and $50$ peers. The documents come from the TREC
collection Volume 4 and Volume 5, which consist of over $500,000$
documents with about $2.1GB$ in total size. In this section, we will
first present the setup of the experiments, and then show the
results from the C-DLSI evaluation.
\subsection{Experimental Setup}
In our experimental platform, we use the documents of the TREC
collection Volume $4$ and Volume $5$. The queries are extracted from
TREC-6 ad hoc topics (topics $301-350$). To simulate short Web
queries, we use the terms appearing in the Title field of the topic
description as the keywords. In the following experiments, we will
also discuss the effect of query length on C-DLSI. Moreover, the
standard relevance judgments provided by NIST are used to evaluate
the retrieval effectiveness. Since only a portion of the documents
are manually judged, we select them as the indexed documents to make
the evaluation more reasonable. In particular, the selected
documents are uniformly distributed to $50$ indexing collections,
which is considered the hardest scenario compared to a skewed
distribution \cite{Shen}. Table 1 gives a summary of the data set
used in the experiments. Figure 4 and Figure 5 show the statistics
of the indexed documents for each query. We can see that the number
of relevant documents for each query is relatively small and it is
not easy to identify them for most queries.
\begin{figure}
\centering \epsfig{file=data1.eps, width=2.5in} \caption{The
probability of a document which contains keywords being relevant for
each query.}
\end{figure}
\begin{table}
\centering \caption{Parameters used in the experiments}
\begin{tabular}{|c|c|c|} \hline
Notation & Description & Values\\
\hline $K$ & Cluster $\#$ & $10, 20, 30$ \\
\hline $N$ & Retrieved doc $\#$ in each peer & $10, 20$ \\
\hline $G$ & Selected peer $\#$ (cast number) & $5, 10, \ldots, 50$ \\
\hline $\varepsilon$ & Threshold of LSI & $1, 1.5, \ldots, 9$ \\
\hline $h$ & Number of relevant clusters $\#$ & $5, 10, 15, 20$ \\
\hline
\end{tabular}
\end{table}
\begin{figure*}
\centering \epsfig{file=p10_10.eps, width=1.7in}
\epsfig{file=ap10_10.eps, width=1.7in}
\epsfig{file=p10_20.eps, width=1.7in}
\epsfig{file=ap10_20.eps, width=1.7in} \caption{Performance
comparison w. r. t. increasing cast number for $K = 10$.}
\end{figure*}
\begin{figure*}
\centering \epsfig{file=p20_10.eps, width=1.7in}
\epsfig{file=ap20_10.eps, width=1.7in}
\epsfig{file=p20_20.eps, width=1.7in}
\epsfig{file=ap20_20.eps, width=1.7in} \caption{Performance
comparison w. r. t. increasing cast number for $K = 20$.}
\end{figure*}
We use the LogEntropy weighting scheme \cite{Dumais} to compute the
weight vector of each document, which is defined as
\begin{displaymath}w_{ij} = [\log_2{(1+tf(i, j))}]\cdot [1+\sum_j{\frac{p_{ij}\log_2{p_{ij}}}{\log_2n}}] \end{displaymath}
\noindent where $tf(i,j)$ is the frequency of term $i$ in document
$j$, $n$ is the total number of documents in the collection, and
$p_{ij}=tf(i,j)/\sum_j{tf(i,j)}$. The parameters and their settings
used in the experiments are shown in Table 2. Generally, the
effectiveness of a FTR system is not evaluated by the precision at
recall points. Since only a subset of the peers is selected, it is
usually impossible to retrieve all of the relevant documents. As in
other research works \cite{Si:1}, we use two metrics to evaluate the
quality of the merged results. One is the top-N precision (P@N),
which can be defined as follows.
\begin{equation}P(q,N)=\frac{|R(N)|}{N} \end{equation}
\noindent where $R_N$ stands for the set of relevant documents in
the top $N$ results. As a complement, we also use another metric
named top-N average precision (AP@N) to evaluate the distribution of
the relevant documents in the top-N results. AP@N is defined as,
\begin{equation}AP(q,N)=\frac{\sum_{i=1}^N{P(q,i)}}{N}\end{equation}
which indicates that the higher the relevant documents are ranked,
the larger AP@N will be. Unless stated to the contrary, the
evaluation metrics shown in this paper are the average for all $50$
queries. For comparison, as mentioned in Section 2, we also
implemented two baseline algorithms gGloss(0) \cite{Gravano:1} and
IS-Cluster \cite{Shen} that were shown to be very effective.
\subsection{Experimental Results}
In the experiments, we first evaluate the performance of C-DLSI and
study the impacts of each parameter. Then we analyze the
compatibility issue for C-DLSI in FTR. Next, we compare our method,
denoted as C-DLSI($\varepsilon$), with another form of C-DLSI which
is based on a truncated value $k$, namely, C-DLSI($k$). Finally, we
examine the performance of the collection update algorithm. Since
FTR usually selects a small number of peers, we focus more on the
performance for small cast numbers (e.g., $T\leq 25$) in the
experiments.
\begin{table}
\centering \caption{Performance comparison for the three methods on
peer selection}
\begin{tabular}{|c|c|c|c|c||c|c|c|} \hline
\multirow{2}{*}{T} & \multicolumn{2}{|c|}{Comp0} &
\multicolumn{2}{|c||}{Comp1} & \multicolumn{3}{|c|}{Avg. Recall} \\
& $>$ & $<$ & $>$ & $<$ & gGloss(0) & IS-Cluster & C-DLSI \\
\hline 5 & \textbf{0.56} & 0.22 & \textbf{0.44} & 0.24 & 0.149 & \textbf{0.165} & 0.159 \\
\hline 10 & 0.4 & \textbf{0.42} & \textbf{0.4} & 0.32 & \textbf{0.288} & 0.282 & 0.28 \\
\hline 15 & \textbf{0.46} & 0.36 & 0.42 & 0.42 & 0.398 & 0.403 & \textbf{0.412} \\
\hline 20 & \textbf{0.38} & 0.36 & 0.38 & \textbf{0.5} & \textbf{0.521} & 0.52 & 0.51 \\
\hline 25 & 0.32 & \textbf{0.46} & 0.36 & \textbf{0.5} & 0.608 & \textbf{0.624} & 0.604 \\
\hline 30 & 0.34 & \textbf{0.46} & 0.36 & \textbf{0.4} & 0.686 & \textbf{0.702} & 0.698 \\
\hline 35 & 0.3 & \textbf{0.44} & 0.4 & \textbf{0.42} & 0.776 & \textbf{0.782} & 0.768 \\
\hline 40 & 0.34 & \textbf{0.4} & \textbf{0.42} & 0.38 & 0.853 & \textbf{0.859} & 0.858 \\
\hline 45 & 0.28 & \textbf{0.34} & \textbf{0.36} & 0.3 & \textbf{0.938} & 0.932 & 0.932 \\
\hline 50 & 0.0 & 0.0 & 0.0 & 0.0 & 1.0 & 1.0 & 1.0 \\
\hline
\end{tabular}
\end{table}
\subsubsection{Performance Evaluation}
At the beginning, the descriptors of all $50$ peers are stored in
the broker. During the experiments, the broker will load the short
queries extracted from TREC topics $301-350$ and perform peer
selection and final result merging. Table 3 presents the peer
selection results for each approach, where the setting of C-DLSI is
$K=20$, $\varepsilon=5$, and $h=10$. The comparison criterion is
based on the number of relevant documents contained in the selected
peers. Comp0 and Comp1 compare C-DLSI with gGloss(0) and IS-Cluster
respectively, by measuring the portion of the queries in which one
method outperforms the other. Specifically, $>$ means C-DLSI
outperforms gGloss(0) (IS-Cluster), while $<$ denotes the reverse.
Avg. Recall denotes the average recall of the selected peers for all
of the $50$ queries. We can see that C-DLSI as a whole outperforms
gGloss(0) and is close to IS-Cluster. Similar results can be
observed for other settings.
\begin{figure}
\centering \epsfig{file=gsm_20.eps, width=2.5in} \caption{An
example of gray-scale map for a peer when $K = 20$. The points
represent the weights of the terms. The vertical lines separate the
clusters.}
\end{figure}
For performance comparison, Figure 5 and Figure 6 show the top-N
precision (P@N) and top-N average precision (AP@N) of all three
methods for increasing cast number under two different settings. We
can see that C-DLSI with a proper threshold $\varepsilon$ (discussed
in Section 5.2.2), e.g., $\varepsilon = 5.5$ for cluster number $K =
10$, in general outperforms the other two methods under both
evaluation metrics. To understand these results further, we check
the characteristics of the peers in the simulation. Specifically,
the gray-scale map of a peer for $K=20$ is given in Figure 7. In
this map, some popular terms are removed. It shows that the TREC
data used in the experiments are relatively sparse, which means it
is generally difficult to properly rank them. Besides, it leads to
unsatisfactory clustering results. Based on this, we can only expect
a modest improvement by applying C-DLSI on this dataset. Note that
we use different collection assignments in two experiments to gain a
general conclusion. The determination of parameters are discussed in
Section 5.2.2. Since the performance of C-DLSI in different
collection assignments in general are similar, we mainly utilize the
collection assignment of $K=20$ as an example to investigate the
properties of C-DLSI in the following experiments.
\begin{figure}
\centering \epsfig{file=h.eps, width=2.5in} \caption{C-DLSI
performance (P@10) with different $h$ values for increasing cast
number. }
\end{figure}
\subsubsection{Impacts of Parameters}
\subsubsection*{Number of relevant clusters $h$}
In C-DLSI, only $top-h$ relevant clusters are used to judge the
relevance of a collection (see Section 4.5). Figure 8 shows the
performance of C-DLSI with different $h$ values for cast number 5,
10, 15, 20, 25 and 30. From the results, we can see that for the
smallest number $T=5$, the smallest $h$ value (i.e., $h=5$)
outperforms other settings. As the cast number increase, larger $h$
values gradually become more preferable. It supports the fact that
clustering is able to identify the documents which contain query
terms but are irrelevant to the query, e.g., by keeping them in the
clusters that refer to other topics. Thus, with smaller $h$, we can
remove the impacts of these irrelevant documents and provides better
relevance estimation of the peers. That is why this strategy can
achieve higher precision for most relevant peers (i.e., small cast
numbers). However, because of the limited clustering quality on the
peers which are not quite relevant to the query, some relevant
documents may be assigned to the wrong clusters, that refer to other
topics. In this case, exploring more clusters, which is achieved by
having larger $h$ values, will be more effective. Therefore, larger
$h$ gains better performance as more peers are considered (i.e.,
larger cast numbers). In the experiments, we choose $h=10$ for the
case of $K=20$ to analyze the performance of C-DLSI.
\begin{figure}
\centering \epsfig{file=sk1.eps, width=2.5in} \caption{C-DLSI
performance (P@10) with different $\varepsilon$ values for
increasing cast number. }
\end{figure}
\begin{figure}
\centering \epsfig{file=sk2.eps, width=2.5in} \caption{C-DLSI
performance for the case when peers select their $\varepsilon$
values independently. The performances of other methods such as
C-DLSI($\varepsilon=5$) and IS-Cluster are also given for
comparison. }
\end{figure}
\subsubsection*{Threshold $\varepsilon$ of LSI}
Basically, if the threshold $\varepsilon$ of LSI is zero, then
C-DLSI will degenerate to a pure cluster-based peer selection
method. In the experiments, we can see from Figure 9 that the
effectiveness of C-DLSI is not monotonously increasing with
$\varepsilon$. Further, it always reaches the highest in the middle.
In the example, the optimal value of $\varepsilon$ is $5$ for
$K=20$. That is why C-DLSI with proper threshold $\varepsilon$ can
improve the performance of the federated querying processing in FTR.
Another important issue here is how to decide the proper value of
$\varepsilon$ for each peer. Since each search peer in FTR maintains
their own LSI, the threshold $\varepsilon$ has to be decided
independently. In Figure 10, we consider this issue in the same
situation as in Figure 9 and make each peer select their local
optimal $\varepsilon$ independently. Based on the metric of AP@10,
each peer searches the optimal threshold $\varepsilon$ from the
testing interval between 1 and 9, which finally concentrates on
either 1 or 5. From the results, we can see that this threshold
decision method causes a slight performance decrease compared to the
optimal case of $\varepsilon=5$ but still outperforms the other
methods such as IS-Cluster. Generally, how to automatically decide
the proper $\varepsilon$ value for each peer and achieve a global
optimal performance remains a open question to be answered in our
future work.
\begin{figure}
\centering \epsfig{file=K1.eps, width=1.7in}
\epsfig{file=K2.eps, width=1.7in} \epsfig{file=K3.eps,
width=1.7in} \epsfig{file=K4.eps, width=1.7in}
\caption{Performance of the three methods w. r. t. different cluster
numbers.}
\end{figure}
\subsubsection*{Cluster number $K$}
In general, the quality of k-means clustering is determined by the
preset cluster number $K$. To examine how much the FTR approaches
rely on the clustering quality, we investigate the performance of
the three methods with different cluster numbers, as presented in
Figure 11 (each cluster number corresponds to a different collection
assignment). The results show that IS-Cluster is more sensitive to
the cluster number. For larger cluster number $K$ (e.g., $K = 20$ or
$30$), IS-Cluster outperforms gGloss(0). However, for small cluster
number $K$ (e.g., $K = 10$), IS-Cluster may be beaten by gGloss(0).
It indicates that IS-Cluster relies more on the clustering quality
and we have to select proper $K$ to guarantee a good performance. On
the contrary, C-DLSI is more stable and substantially outperforms
gGloss(0) most of the time. This characteristic means a lot since
the broker usually inclines to keep a small directory for
scalability or bandwidth considerations. C-DLSI can better adapt to
systemns with limited resource.
\begin{figure}
\centering \epsfig{file=ci.eps, width=2.5in}
\caption{Performance comparison between C-DLSI and the combination
methods (IS-Cluster or gGloss(0) plus LSI-based IR). }
\end{figure}
\subsubsection{Compatibility Issue in FTR} As shown in Table 3,
C-DLSI exhibits very close performance to IS-Cluster on peer
selection. For some cast numbers, IS-cluster is even better. Based
on this, we may consider whether a combination of IS-Cluster and
LSI-based text retrieval is also a good choice compared to C-DLSI.
In this subsection, we examine two combination methods, namely CM1
and CM2. Both of them retrieve documents in each peer based on LSI
as in C-DLSI. However, for peer selection, CM1 uses gGloss(0) while
CM2 uses IS-Cluster. Figure 12 shows the result of this comparison
and it shows that C-DLSI still outperforms the combined methods. For
example, although IS-Cluster and gGloss(0) get slightly better peer
selection result than C-DLSI when cast number $T=25$, the
combination methods are still inferior to C-DLSI at $T=25$. From the
result, we can see that although IS-Cluster is able to detect the
semantic meaning of each document, it does not adapt to LSI in local
text retrieval (actually, it is difficult to find a proper local
retrieval scheme for IS-Cluster because of its special property as
we point out in Section 4.1), thus achieving little improvement.
Therefore, the performance of the combination method CM2 is only
slightly better than CM1. However, the peer selection method of
C-DLSI can distinguish each document and obtain proper semantic
spaces based on LSI. Therefore, it is more adaptive to the LSI-based
text retrieval.
\begin{figure}
\centering \epsfig{file=th20_1.eps, width=1.7in}
\epsfig{file=th20_2.eps, width=1.7in} \caption{Performance
comparison between C-DLSI($\varepsilon$) and C-DLSI($k$) for the
case $K=20$.}
\end{figure}
\begin{figure}
\centering \epsfig{file=th10_1.eps, width=1.7in}
\epsfig{file=th10_2.eps, width=1.7in} \caption{Performance
comparison between C-DLSI($\varepsilon$) and C-DLSI($k$) for the
case $K=10$.}
\end{figure}
\begin{figure}
\centering \epsfig{file=gsm_10.eps, width=2.5in} \caption{An
example of gray-scale map for a peer when $K = 10$.}
\end{figure}
\subsubsection{C-DLSI($\varepsilon$) Vs. C-DLSI($k$)}
In this subsection, we compare our method C-DLSI, denoted as
C-DLSI($\varepsilon$), with another possible form of C-DLSI which is
based on a truncated number $k$, namely, C-DLSI($k$). Here we choose
the truncated value $k$ with the best performance of all possible
values for C-DLSI, e.g., $k = 80$ for the case $K=20$, and $k=60$
for the case $K=10$. The results are shown in Figure 13 and Figure
14 for the cases $K=20$ and $K=10$ respectively. We can see that
C-DLSI($\varepsilon$) in general beats C-DLSI($k$). In particular,
for the case $K=10$, when all of the indexing peers are selected ($G
= 50$), this gap becomes largest, indicating an $11.63\%$
improvement over C-DLSI($k$). We find that the numbers of the
relevant documents returned by the peers in two methods are quite
similar. It means C-DLSI($\varepsilon$) makes the LSI spaces among
clusters comparable and thus provides better result merging.
Finally, we also examine the C-DLSI scheme without considering the
cluster relations, denoted as C-DLSI-NR($\varepsilon$). The
performance are given in Figure 13 and Figure 14. Generally, by
considering cluster relations, C-DLSI($\varepsilon$) gains some
improvements compared to C-DLSI-NR($\varepsilon$). This gain becomes
larger for $K=20$, because the clustering quality in the case $K=20$
is worse than that of $K=10$ (as shown in Figure 15).
\subsubsection{Collection Update Scheme}
Finally, we will test our update scheme in FTR. In the experiment,
we only simulate one case of collection update, i.e., indexing new
documents. Specifically, we first index only $70\%$ of the total
documents and build the corresponding LSI. Then we gradually add new
documents from the remaining set, adding $5\%$ of the indexed size
in each step. Figure 16 shows an example $(K = 10, N = 10)$ of the
performance variation of the three methods during the update
procedure. We can see that the performance of C-DLSI still increases
with more documents added. For small cast number (e.g., $T = 10$),
C-DLSI outperforms (or at least be comparable to) gGloss(0)
(IS-Cluster) until the update amount reaches $30\%-35\%$
$(5\%-10\%)$. For larger cast number (e.g., $T = 20$), this valid
amount for C-DLSI before rebuilding the LSI decreases to $10\%-15\%$
($5\%-10\%$). Besides, we also get similar results for other
settings. It means that our update scheme is especially applicable
for FTR systems, in which the cast number is relatively small.
\begin{figure}
\centering \epsfig{file=up10.eps, width=1.7in}
\epsfig{file=up20.eps, width=1.7in} \caption{Performance
comparison with increasing update. }
\end{figure}
\section{Conclusion}
In this paper, we proposed a promising solution for the challenges
of FTR. Different from the existing methods, our proposed method,
Cluster-based Distributed Latent Semantic Indexing (C-DLSI),
captures the semantic structure of a peer by identifying the LSI
spaces within the clusters and considering the relations among them,
thus providing more precise evaluation of the peer. We analyzed the
characteristics of C-DLSI, based on which novel descriptors of the
peers and the federated query processing was proposed. Besides, we
devised an effective form of C-DLSI, namely, C-DLSI($\varepsilon$),
the performance of which is studied and verified by using gray-scale
map in the experiments. Our method is efficient since only the
clusters affected by the updates need to be reindexed. Moreover, we
consider the update problem of C-DLSI and provide an update scheme
to make the framework more efficient while guaranteeing its
effectiveness. The experimental results confirmed the superiority of
our model and update scheme, and showed that our method outperforms
other existing methods including the previous cluster-based method.
| {'timestamp': '2018-10-08T02:08:34', 'yymm': '1810', 'arxiv_id': '1810.02579', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02579'} | arxiv |
\section{INTRODUCTION}
Autonomous vehicles will have a substantial impact on people's daily life, both personally and professionally. For instance, automated vehicles can largely increase human productivity by turning driving time into working time, provide personalized mobility to non-drivers, reduce traffic accidents, or free up parking space and generalize valet service~\cite{autonomous:vehicle:guide:policymakers}. As such, developing automated vehicles is becoming the core interest of many, diverse industrial players. Recent years have witnessed great progress in autonomous driving \cite{drive:surroundview:route:planner}, resulting in announcements that autonomous vehicles have driven over many thousands of miles and that companies aspire to sell such vehicles in a few years. All this has fueled expectations that fully automated vehicles are coming soon. Yet, significant technical obstacles must be overcome before assisted driving can be turned into full-fletched automated driving, a prerequisite for the above visions to materialize.
While perception algorithms based on visible light cameras are constantly getting better, they are mainly designed to operate on images taken at daytime under good illumination~\cite{vision:atmosphere,semantic:foggy:scene}. Yet, outdoor applications can hardly escape from challenging weather and illumination conditions. One of the big reasons that automated cars have not gone mainstream yet is because it cannot deal well with nighttime and adverse weather conditions. Camera sensors can become untrustworthy at nighttime, in foggy weather, and in wet weather. Thus, computer vision systems have to function well also under these adverse conditions. In this work, we focus on semantic object recognition for nighttime driving scenes.
Robust object recognition using visible light cameras remains a difficult problem. This is because the structural, textural and/or color features needed for object recognition sometimes do not exist or highly disbursed by artificial lights, to the point where it is difficult to recognize the objects even for human. The problem is further compounded by camera noise~\cite{nighttime:noise:reduction:16} and motion blur. Due to this reason, there are systems using far-infrared (FIR) cameras instead of the widely used visible light cameras for nighttime scene understanding~\cite{night:vision:pedestrian:05,day:night:16}.
Far-infrared (FIR) cameras can be another choice~\cite{night:vision:pedestrian:05,day:night:16}. They, however, are expensive and only provide images of relatively low-resolution. Thus, this work adopts visible light cameras for semantic segmentation of nighttime road scenes. Another reason of this choice is that large-scale datasets are available for daytime images by visible light cameras~\cite{Cityscapes}. This makes model adaptation from daytime to nighttime feasible.
High-level semantic tasks is usually tackled by learning from many annotations of real images. This scheme has achieved a great success for good weather conditions at daytime. Yet, the difficulty of collecting and annotating images for all other weather and illumination conditions renders this standard protocol problematic. To overcome this problem, we depart from this traditional paradigm and propose another route. Instead, we choose to \emph{progressively} adapt the semantic models trained for daytime scenes to nighttime scenes, by using images taken at the twilight time as intermediate stages. The method is based on progressively self-learning scheme, and its pipeline is shown in Figure \ref{fig:pipeline}.
\begin{figure*}[t]
\includegraphics[trim={0 -0.03cm 0 0},clip,width=0.97\linewidth]{pipeline-crop.pdf}
\resizebox{0.95\linewidth}{!}{
\begin{tikzpicture}[tight background, scale=0.75, every node/.style={font=\large}]
\draw[white, fill=void, draw=white] (0,0) rectangle (1 * 4, 1) node[pos=0.5] {Void};
\draw[white, fill=road, draw=white] (1 * 4,0) rectangle (2 * 4, 1) node[pos=0.5] {Road};
\draw[white, fill=sidewalk, draw=white] (2 * 4,0) rectangle (3 * 4, 1) node[pos=0.5] {Sidewalk};
\draw[white, fill=building, draw=white] (3 * 4,0) rectangle (4 * 4, 1) node[pos=0.5] {Building};
\draw[white, fill=wall, draw=white] (4 * 4,-0) rectangle (5 * 4, 1) node[pos=0.5] {Wall};
\draw[black, fill=fence, draw=white] (5 * 4,-0) rectangle (6 * 4, 1) node[pos=0.5] {Fence};
\draw[white, fill=pole, draw=white] (6 * 4,-0) rectangle (7 * 4, 1) node[pos=0.5] {Pole};
\draw[white, fill=traffic light, draw=white] (7 * 4,-0) rectangle (8 * 4, 1) node[pos=0.5] {Traffic Light};
\draw[black, fill=traffic sign, draw=white] (8 * 4,-0) rectangle (9 * 4, 1) node[pos=0.5] {Traffic Sign};
\draw[white, fill=vegetation, draw=white] (9 * 4,-0) rectangle (10 * 4, 1) node[pos=0.5] {Vegetation};
\draw[black, fill=terrain, draw=white] (0 * 4,-1) rectangle (1 * 4, 0) node[pos=0.5] {Terrain};
\draw[white, fill=sky, draw=white] (1 * 4,-1) rectangle (4 * 2, 0) node[pos=0.5] {Sky};
\draw[white, fill=person, draw=white] (2 * 4,-1) rectangle (3 * 4, 0) node[pos=0.5] {Person};
\draw[white, fill=rider, draw=white] (3 * 4,-1) rectangle (4 * 4, 0) node[pos=0.5] {Rider};
\draw[white, fill=car, draw=white] (4 * 4,-1) rectangle (5 * 4, 0) node[pos=0.5] {Car};
\draw[white, fill=truck, draw=white] (5 * 4,-1) rectangle (6 * 4, 0) node[pos=0.5] {Truck};
\draw[white, fill=bus, draw=white] (6 * 4,-1) rectangle (7 * 4, 0) node[pos=0.5] {Bus};
\draw[white, fill=train, draw=white] (7 * 4,-1) rectangle (8 * 4, 0) node[pos=0.5] {Train};
\draw[white, fill=motorcycle, draw=white] (8 * 4,-1) rectangle (9 * 4, 0) node[pos=0.5] {Motorcycle};
\draw[white, fill=bicycle, draw=white] (9 * 4,-1) rectangle (10 * 4, 0) node[pos=0.5] {Bicycle};
\end{tikzpicture}}
\caption{The pipeline of our approach for semantic segmentation of nighttime scenes, by transferring knowledge from daytime scenes via the bridge of twilight time scenes.}
\vspace{-2mm}
\label{fig:pipeline}
\end{figure*}
The main contributions of the paper are: 1) a novel model adaptation method is developed to transfer semantic knowledge from daytime scenes to nighttime scenes; 2) a new dataset, named \emph{Nighttime Driving}, consisting of images of real driving scenes at nighttime and twilight time, with $35,000$ unlabeled images and $50$ densely annotated images. These contributions will facilitate the learning and evaluation of semantic segmentation methods for nighttime driving scenes. \emph{Nighttime Driving} is available at \url{http://people.ee.ethz.ch/~daid/NightDriving/}.
\section{Related Work}
\label{sec:related}
\subsection{Semantic Understanding of Nighttime Scenes}
A lot of work for nighttime object detection/recognition has focused on human detection, by using FIR cameras~\cite{night:vision:pedestrian:05,pedestrian:detection:tracking:night:09} or visible light cameras~\cite{cnn:human:detection:nighttime:17}, or a combination of both~\cite{nighttime:pedestrian:detection:08}.
There are also notable examples for detecting other road traffic objects such as cars~\cite{nighttime:object:proposal:18} and their rear lights~\cite{night:rear:lights:16}. Another group of work is to develop methods robust to illumination changes for robust road area detection~\cite{road:detection:illumination:invariant} and semantic labeling~\cite{outdoor:transformation:labeling:iv15}. Most of the research in this vein had been conducted before deep learning was widely used.
Semantic understanding of visual scenes have recently undergone rapid growth, making accurate object detection feasible in images and videos in daytime scenes~\cite{DomainAdaptiveFasterRCNN,refinenet}. It is natural to raise the question of how to extend those sophisticated methods to other weather conditions and illumination conditions, and examine and improve the performance therein. A recent effort has been made for foggy weather~\cite{semantic:foggy:scene}. This work would like to initiate the same research effort for nighttime.
\subsection{Model Adaptation}
\sloppy{Our work bears resemblance to works from the broad field of transfer learning. Model adaptation across weather conditions to semantically segment simple road scenes is studied in~\cite{road:scene:2013}.
More recently, domain adaptation based approach was proposed to adapt semantic segmentation models from synthetic images to real environments~\cite{curriculum:domain:adaptation:iccv17,cyCADA,learning:synthetic:data:cvpr18,semantic:foggy:scene,chen2018road}.
The supervision transfer from daytime scenes to nighttime scenes in this paper is inspired by the stream of work on model distillation/imitation~\cite{hinton2015distilling,supervision:transfer,dai:metric:imitation}. Our approach is similar in that knowledge is transferred from one domain to the next by distilled from the previous domain.} The concurrent work in \cite{SynRealDataFogECCV18} on adaptation of semantic
models from clear weather condition to light fog then to dense fog is closely related to ours.
\subsection{Road Scene Understanding}
Road scene understanding is a crucial enabler for applications such as assisted or autonomous driving. Typical examples include the detection of roads~\cite{recent:progress:lane}, traffic lights~\cite{traffic:light:survey:16}, cars and pedestrians~\cite{Cityscapes,semantic:foggy:scene}, and tracking of such objects~\cite{vehicles:road:survey:13,pathtrack}. We refer the reader to the excellent surveys~\cite{looking:at:human}. The aim of this work is to extend/adapt the advanced models developed recently for road scene understanding at daytime to nighttime, without manually annotating nighttime images.
\section{Approach}
\label{sec:approach}
Training a segmentation model with large amount of human annotations should work for nighttime images, similar to what has been achieved for daytime scene understanding \cite{MastRCNN,refinenet}. However, applying this protocol to other weather conditions and illumination conditions is problematic as it is hardly affordable to annotate the same amount of data for all different conditions and their combinations. We depart from this protocol and investigate an automated approach to transfer the knowledge from existing annotations of daytime scenes to nighttime scenes. The approach leverages the fact that illumination changes continuously between daytime and nighttime, through the twilight time. Twilight is the time between dawn and sunrise, or between sunset and dusk. Twilight is defined according to the solar elevation angle, which is the position of the geometric center of the sun relative to the horizon \cite{twilight:definition}. See Figure \ref{fig:twillight} for an illustration.
During a large portion of twilight time, solar illumination suffices enough for cameras to capture the terrestrial objects and suffices enough to alleviate the interference of artificial lights to a limited amount. See Figure \ref{fig:pipeline} for examples of road scenes at twilight time. These observations lead to our conjecture that the domain discrepancy between daytime scenes and twilight scenes, and the the domain discrepancy between twilight scenes and nighttime scenes are both smaller than the domain discrepancy between daytime scenes and nighttime scenes. Thus, images captured during twilight time can serve our purpose well --- transfer knowledge from daytime to nighttime. That is, twilight time constructs a bridge for knowledge transfer from our source domain daytime to our target domain nighttime.
\begin{figure}[t]
\centering
\includegraphics[width=0.9\linewidth]{Twilight2.png}
\caption{Twilight is defined according to the solar elevation angle and is categorized into three subcategories: civil twilight, nautical twilight, and astronomical twilight. (picture is from wikipedia).}
\label{fig:twillight}
\end{figure}
In particular, we train a semantic segmentation model on daytime images using the standard supervised learning paradigm, and apply the model to a large dataset recorded at civil twilight time to generate the class responses. The three subgroups of twilight are used: civil twilight, nautical twilight, and astronomical twilight \cite{twilight:definition}. Since the domain gap between daytime condition and civil twilight condition is relatively small, these class responses, along with the images, can then be used to fine-tune the semantic segmentation model so that it can adapt to civil twilight time. The same procedure is continued through nautical twilight and astronomical twilight. We then apply the final fine-tuned model to nighttime images.
This learning approach is inspired by the stream of work on model distillation~\cite{hinton2015distilling,dai:metric:imitation,supervision:transfer}. Those methods either transfer supervision from sophisticated models to simpler models for efficiency~\cite{hinton2015distilling,dai:metric:imitation}, or transfer supervision from the domain of images to other domains such as depth maps~\cite{supervision:transfer}. We here transfer the semantic knowledge of annotations of daytime scenes to nighttime scenes via the unlabeled images recorded at twilight time.
Let us denote an image by $\mathbf{x}$, and indicate the image taken at \emph{daytime}, \emph{civil twilight time}, \emph{nautical twilight time}, \emph{astronomical twilight time} and \emph{nighttime} by $\mathbf{x}^0$, $\mathbf{x}^1$, $\mathbf{x}^2$, $\mathbf{x}^3$, and $\mathbf{x}^4$, respectively.
The corresponding human annotation for $\mathbf{x}^0$ is provided and denoted by $\mathbf{y}^0$, where $\mathbf{y}^0(m,n) \in\{1, ..., C\}$ is the label of pixel $(m,n)$, and $C$ is the total number of classes. Then, the training data consist of labeled data at daytime $\mathcal{D}^0 =\{(\mathbf{x}^0_i, \mathbf{y}^0_{i})\}_{i=1}^{l^0}$, and three unlabeled datasets for the three twilight categories: $\mathcal{D}^1=\{\mathbf{x}^1_{j}\}_{j=1}^{l^1}$, $\mathcal{D}^2=\{\mathbf{x}^2_{k}\}_{k=1}^{l^2}$, and $\mathcal{D}^3=\{\mathbf{x}^3_{q}\}_{q=1}^{l^3}$, where $l^0$, $l^1$, $l^2$, and $l^3$ are the total number of images in the corresponding datasets.
The method consists of eight steps and it is summarized below.
\begin{enumerate}
\item [\textbf{1}:] train a segmentation model with daytime images and the human annotations:
\begin{equation}
\min_{\phi^0} \frac{1}{l^0}\sum_{i=1}^{l^0} L(\phi^0(\mathbf{x}^0_i), \mathbf{y}^0_i),
\end{equation} where $L(.,.)$ is the cross entropy loss function; \label{item1}
\item [\textbf{2}:] apply segmentation model $\phi^0$ to the images recorded at civil twilight time to obtain ``noisy'' semantic labels: $\hat{\mathbf{y}}^1 = \phi^0(\mathbf{x}^1)$, and augment dataset $\mathcal{D}^1$ to $\hat{\mathcal{D}}^1$: $\hat{\mathcal{D}}^1=\{(\mathbf{x}^1_j, \hat{\mathbf{y}}^1_j)\}_{j=1}^{l^1}$; \label{item2}
\item [\textbf{3}:] instantiate a new model $\phi^1$ by duplicating $\phi^0$, and then fine-tune (retrain) the semantic model on $\mathcal{D}^0$ and $\hat{\mathcal{D}}^1$:
\begin{equation}
\phi^1 \leftarrow \phi^0,
\end{equation}
and
\begin{equation}
\min_{\phi^1} \Big(\frac{1}{l^0}\sum_{i=1}^{l^0} L(\phi^1(\mathbf{x}^0_i), \mathbf{y}^0_i) + \frac{\lambda^1 }{l^1}\sum_{j=1}^{l^1} L(\phi^1(\mathbf{x}^1_j), \hat{\mathbf{y}}^1_j) \Big),
\label{eq:step3}
\end{equation}
where $\lambda^1$ is a hyper-parameter balancing the weights of the two data sources; \label{item3}
\item [\textbf{4}:] apply segmentation model $\phi^1$ to the images recorded at nautical twilight time to obtain ``noisy'' semantic labels: $\hat{\mathbf{y}}^2 = \phi^1(\mathbf{x}^2)$, and augment dataset $\mathcal{D}^2$ to $\hat{\mathcal{D}}^2$: $\hat{\mathcal{D}}^2=\{(\mathbf{x}^2_k, \hat{\mathbf{y}}^2_k)\}_{k=1}^{l^2}$;
\label{item4}
\item [\textbf{5}:] instantiate a new model $\phi^2$ by duplicating $\phi^1$, and fine-tune (train) semantic model on $\mathcal{D}^0$, $\hat{\mathcal{D}}^1$ and $\hat{\mathcal{D}}^2$:
\begin{equation}
\phi^2 \leftarrow \phi^1,
\end{equation}
and then
\begin{multline}
\min_{\phi^2} \Big( \frac{1}{l^0}\sum_{i=1}^{l^0} L(\phi^2(\mathbf{x}^0_i), \mathbf{y}^0_i) + \frac{\lambda^1}{l^1}\sum_{j=1}^{l^1} L(\phi^2(\mathbf{x}^1_j), \hat{\mathbf{y}}^1_j) \\
+ \frac{\lambda^2}{l^2}\sum_{k=1}^{l^2} L(\phi^2(\mathbf{x}^2_k), \hat{\mathbf{y}}^2_k) \Big),
\label{eq:step5}
\end{multline}
where $\lambda^1$ and $\lambda^2$ are hyper-parameters regulating the weights of the datasets; \label{item5}
\item [\textbf{6}:] apply segmentation model $\phi^2$ to the images recorded at astronomical twilight data to obtain ``noisy'' semantic labels: $\hat{\mathbf{y}}^3 = \phi^2(\mathbf{x}^3)$, and augment dataset $\mathcal{D}^3$ to $\hat{\mathcal{D}}^3$: $\hat{\mathcal{D}}^3=\{(\mathbf{x}^3_q, \hat{\mathbf{y}}^3_q)\}_{q=1}^{l^3}$;
; \label{item6}
\item [\textbf{7}:] instantiate a new model $\phi^3$ by duplicating $\phi^2$, and fine-tune (train) the semantic model on all four datasets $\mathcal{D}^0$, $\hat{\mathcal{D}}^1$, $\hat{\mathcal{D}}^2$ and $\hat{\mathcal{D}}^3$:
\begin{equation}
\phi^3 \leftarrow \phi^2,
\end{equation}
and then
\begin{multline}
\min_{\phi^3} \Big( \frac{1}{l^0}\sum_{i=1}^{l^0} L(\phi^3(\mathbf{x}^0_i), \mathbf{y}^0_i) + \frac{\lambda^1}{l^1}\sum_{j=1}^{l^1} L(\phi^3(\mathbf{x}^1_j), \hat{\mathbf{y}}^1_j) \\
+ \frac{\lambda^2}{l^2}\sum_{k=1}^{l^2} L(\phi^3(\mathbf{x}^2_k), \hat{\mathbf{y}}^2_k) + \frac{\lambda^3}{l^3}\sum_{q=1}^{l^3} L(\phi^3(\mathbf{x}^3_q), \hat{\mathbf{y}}^3_q) \Big),
\label{eq:step7}
\end{multline}
where $\lambda^1$, $\lambda^1$ and $\lambda^3$ are hyper-parameters regulating the weights of the datasets;
\label{item7}
\item [\textbf{8}:] apply model $\phi^3$ to nighttime images to perform the segmentation: $\hat{\mathbf{y}}^4 = \phi^3(\mathbf{x}^4)$.
\end{enumerate}
We term our method Gradual Model Adaptation. During training, in order to balance the weights of different data sources (in Equation~\ref{eq:step3}, Equation~\ref{eq:step5} and Equation~\ref{eq:step7}), we empirically give equal weight to all training datasets. An optimal value can be obtained via cross-validation. The optimization of Equation~\ref{eq:step3}, Equation~\ref{eq:step5} and Equation~\ref{eq:step7} are implemented by feeding to the training algorithm a stream of hybrid data, for which images in the considered datasets are sampled proportionally according to the parameters $\lambda^1$, $\lambda^2$, and $\lambda^3$. In this work, they all set to $1$, which means all datasets are sampled at the same rate.
Rather than applying the model trained on daytime images directly to nighttime images, Gradual Model Adaptation breaks down the problem to three progressive steps to adapt the semantic model. In each of the step, the domain gap is much smaller than the domain gap between daytime domain and nighttime domain. Due to the unsupervised nature of this domain adaptation, the algorithm will also be affected by the noise in the labels. The daytime dataset $\mathcal{D}^1$ is always used for the training, to balance between noisy data of similar domains and clean data of a distinct domain.
\section{Experiments}
\label{sec:experiment}
\subsection{Data Collection}
\emph{Nighttime Driving} was collected during 5 rides with a car inside multiple Swiss cities and their suburbs using a GoPro~Hero~5 camera. We recorded 5 large video sequence with length of about 2 hours. The video recording starts from daytime, goes through twilight time and ends at full nighttime. The video frames are extracted at a rate of one frame per second, leading to 35,000 images in total. According to \cite{twilight:definition} and the sunset time of each recording day, we partition the dataset into five parts: daytime, civil twilight time, nautical twilight time, astronomical twilight time, and nighttime. They consist of 8000, 8750, 8750, 8750, and 9500 images, respectively.
We manually select 50 nighttime images of diverse visual scenes, and construct the test set of \emph{Nighttime Driving} therefrom, which we term \emph{Nighttime Driving-test}.
The aforementioned selection is performed manually in order to guarantee that the test set has high diversity, which compensates for its relatively small size in terms of statistical significance of evaluation results.
We annotate these images with fine pixel-level semantic annotations using the 19 evaluation classes of the Cityscapes dataset~\cite{Cityscapes}: \emph{road}, \emph{sidewalk}, \emph{building}, \emph{wall}, \emph{fence}, \emph{pole}, \emph{traffic light}, \emph{traffic sign}, \emph{vegetation}, \emph{terrain}, \emph{sky}, \emph{person}, \emph{rider}, \emph{car}, \emph{truck}, \emph{bus}, \emph{train}, \emph{motorcycle} and \emph{bicycle}.
In addition, we assign the \emph{void} label to pixels which do not belong to any of the above 19 classes, or the class of which is uncertain due to insufficient illumination. Every such pixel is ignored for semantic segmentation evaluation.
\subsection{Experimental Evaluation}
Our model of choice for experiments on semantic segmentation is the RefineNet~\cite{refinenet}. We use the publicly available \emph{RefineNet-res101-Cityscapes} model, which has been trained on the daytime training set of Cityscapes. In all experiments of this section, we use a constant base learning rate of $5\times{}10^{-5}$ and mini-batches of size 1.
Our segmentation experiment showcases the effectiveness of our model adaptation pipeline, using twilight time as a bridge. The models which are obtained after the initial adaptation step are further fine-tuned on the union of the daytime Cityscapes dataset and the previously segmented twilight datasets, where the latter sets are labeled by the adapted models one step ahead.
We evaluate four variants of our method and compare them to the original segmentation model trained on daytime images directly. Using the pipeline described in Section \ref{sec:approach}, three models can be obtained, in particular $\phi^1$, $\phi^2$, and $\phi^3$.
We also compare to an alternative adaptation approach which generates labels (by using the original model trained on daytime data) for all twilight images at once and fine-tunes the original daytime segmentation model once. To put in another word, the three-step progressive model adaptation is reduced to a one-step progressive model adaptation.
\begin{table}[!tb]
\centering
\caption{Performance comparison between the variants of our method to the original segmentation model.}
\label{table:experiments}
\setlength\tabcolsep{5pt}
\begin{tabular}{lcc}
Model & Fine-tuning on twilight data & Mean IoU \\
\toprule
Refinenet \cite{refinenet} & --- & 35.2 \\
\midrule
Refinenet & $\phi^1$ ($\rightarrow$ civil) & 38.6 \\
Refinenet & $\phi^2$ ($\rightarrow$ civil $\rightarrow$ nautical) & 39.9 \\
Refinenet & $\phi^3$ ($\rightarrow$ civil $\rightarrow$ nautical $\rightarrow$ astronomical) & \textbf{41.6} \\
\midrule
Refinenet & $\rightarrow$ all twilight (1-step adaptation) & 39.1 \\
\end{tabular}
\vspace{-2mm}
\end{table}
\textbf{Quantitative Results}.
The overall intersection over union (IoU) over all classes of the semantic segmentation by all methods are reported in Tables~\ref{table:experiments}. The table shows that all variants of our adaptation method improve the performance of the original semantic model trained with daytime data. This is mainly due to the fact that twilight time fall into the middle ground of daytime and nighttime, so the domain gaps from twilight to the other two domains are smaller than the direct domain gap of the two.
\begin{figure*}[!tb]
\centering
\begin{tabular}{ccccc}
\hspace{-3mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_1120_leftImg8bit_img.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_1120_gtCoarse_color.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_1120_leftImg8bit_label_baseline.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_1120_leftImg8bit_label_ours.png} \\
\hspace{-3mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_1171_leftImg8bit_img.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_1171_gtCoarse_color.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_1171_leftImg8bit_label_baseline.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_1171_leftImg8bit_label_ours.png} \\
\hspace{-3mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_1306_leftImg8bit_img.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_1306_gtCoarse_color.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_1306_leftImg8bit_label_baseline.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_1306_leftImg8bit_label_ours.png} \\
\hspace{-3mm}
\includegraphics[width=0.24\textwidth]{1421382802_0_frame_2722_leftImg8bit.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421382802_0_frame_2722_gtCoarse_color.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421382802_0_frame_2722_leftImg8bit_label_baseline.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421382802_0_frame_2722_leftImg8bit_label_ours.png} \\
\hspace{-3mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_0604_leftImg8bit.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_0604_gtCoarse_color.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_0604_leftImg8bit_label_baseline.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_0604_leftImg8bit_label_ours.png} \\
\hspace{-3mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_0676_leftImg8bit.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_0676_gtCoarse_color.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_0676_leftImg8bit_label_baseline.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_0676_leftImg8bit_label_ours.png} \\
\hspace{-3mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_1687_leftImg8bit.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_1687_gtCoarse_color.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_1687_leftImg8bit_label_baseline.png}
& \hspace{-4.5mm}
\includegraphics[width=0.24\textwidth]{1421384698_0_frame_1687_leftImg8bit_label_ours.png} \\
\hspace{-1mm} \text{(a) nighttime image} & \hspace{-2mm} (b) ground truth & \hspace{-2mm} \text{(c) refineNet~\cite{refinenet} } & \hspace{-2mm} \text{(d) our method} \\
\end{tabular}
\resizebox{\linewidth}{!}{
\begin{tikzpicture}[tight background, scale=0.75, every node/.style={font=\large}]
\draw[white, fill=void, draw=white] (0,0) rectangle (1 * 4, 1) node[pos=0.5] {Void};
\draw[white, fill=road, draw=white] (1 * 4,0) rectangle (2 * 4, 1) node[pos=0.5] {Road};
\draw[white, fill=sidewalk, draw=white] (2 * 4,0) rectangle (3 * 4, 1) node[pos=0.5] {Sidewalk};
\draw[white, fill=building, draw=white] (3 * 4,0) rectangle (4 * 4, 1) node[pos=0.5] {Building};
\draw[white, fill=wall, draw=white] (4 * 4,-0) rectangle (5 * 4, 1) node[pos=0.5] {Wall};
\draw[black, fill=fence, draw=white] (5 * 4,-0) rectangle (6 * 4, 1) node[pos=0.5] {Fence};
\draw[white, fill=pole, draw=white] (6 * 4,-0) rectangle (7 * 4, 1) node[pos=0.5] {Pole};
\draw[white, fill=traffic light, draw=white] (7 * 4,-0) rectangle (8 * 4, 1) node[pos=0.5] {Traffic Light};
\draw[black, fill=traffic sign, draw=white] (8 * 4,-0) rectangle (9 * 4, 1) node[pos=0.5] {Traffic Sign};
\draw[white, fill=vegetation, draw=white] (9 * 4,-0) rectangle (10 * 4, 1) node[pos=0.5] {Vegetation};
\draw[black, fill=terrain, draw=white] (0 * 4,-1) rectangle (1 * 4, 0) node[pos=0.5] {Terrain};
\draw[white, fill=sky, draw=white] (1 * 4,-1) rectangle (4 * 2, 0) node[pos=0.5] {Sky};
\draw[white, fill=person, draw=white] (2 * 4,-1) rectangle (3 * 4, 0) node[pos=0.5] {Person};
\draw[white, fill=rider, draw=white] (3 * 4,-1) rectangle (4 * 4, 0) node[pos=0.5] {Rider};
\draw[white, fill=car, draw=white] (4 * 4,-1) rectangle (5 * 4, 0) node[pos=0.5] {Car};
\draw[white, fill=truck, draw=white] (5 * 4,-1) rectangle (6 * 4, 0) node[pos=0.5] {Truck};
\draw[white, fill=bus, draw=white] (6 * 4,-1) rectangle (7 * 4, 0) node[pos=0.5] {Bus};
\draw[white, fill=train, draw=white] (7 * 4,-1) rectangle (8 * 4, 0) node[pos=0.5] {Train};
\draw[white, fill=motorcycle, draw=white] (8 * 4,-1) rectangle (9 * 4, 0) node[pos=0.5] {Motorcycle};
\draw[white, fill=bicycle, draw=white] (9 * 4,-1) rectangle (10 * 4, 0) node[pos=0.5] {Bicycle};
\end{tikzpicture}}
\vspace{-4mm}
\caption{Qualitative results for semantic segmentation on \emph{Nighttime Driving-test}. }
\vspace{-4mm}
\label{fig:sem:seg1}
\end{figure*}
Also, it can be seen from the table that our method benefits from the progressive adaptation in three steps, i.e. from daytime to civil twilight, from civil twilight to nautical twilight, and from nautical twilight to astronomical twilight. The complete pipeline outperforms the two incomplete alternatives. This means that the gradual adaptation closes the domain gap progressively. As the model is adapted one more step forward, the gap to the target domain is further narrowed. Data recorded through twilight time constructs a trajectory between the source domain (daytime) and the target domain (nighttime) and makes daytime-to-nighttime knowledge transfer feasible.
Finally, we find that our three-step progressive pipeline outperforms the one-step progressive alternative. This is mainly due to the unsupervised nature of the model adaptation: the method learns from generated labels for model adaptation. This means that the accuracy of the generated labels directly affect the quality of the adaptation. The one-step adaptation alternative proceeds more aggressively and in the end learns from more noisy generated labels than than our three-step complete pipeline. The three-step model adaptation method generate labels only on data which falls slightly off the training domain of the previous model.
Our three-step model adaptation strikes a good balance between computational cost and quality control.
\textbf{Qualitative Results}. We also show multiple segmentation examples by our method (the three-step complete pipeline) and the original daytime RefineNet model in Figure \ref{fig:sem:seg1}. From the two figures, one can see that our method generally yields better results than the original RefineNet model. For instance, in the second image of Figure \ref{fig:sem:seg1}, the original RefineNet model misclassified some \emph{road} area as \emph{car}.
While improvement has been observed, the performance of for nighttime scenes is still a lot worse than that for daytime scenes. Nighttime scenes are indeed more challenging than daytime scenes for semantic understanding tasks. There are more underlying causal factors of variation that generated night data, which requires either more
training data or more intelligent learning approaches to disentangle
the increased number of factors. Also, the models are adapted in an unsupervised manner. Introducing a reasonable amount of human annotations of nighttime scenes will for sure improve the results. This constitutes our future work.
\textbf{Limitation}.
Many regions in nighttime images are uncertain for human annotators. Those areas should be treated as a separate, special class; algorithms need to be trained to predict this special class as well. It is misleading to assign a class label to those areas. This will be implemented in our next work. We also argue that street lamps should be considered as a separate class in addition to the classes considered in Cityscapes' daytime driving.
\section{CONCLUSIONS}
\label{sec:conclusion}
This work has investigated the problem of semantic image segmentation of nighttime scenes from a novel perspective. This paper has proposed a novel method to \emph{progressive} adapts the semantic models trained on daytime scenes to nighttime scenes via the bridge of twilight time --- the time between dawn and sunrise, or between sunset and dusk. Data recorded during twilight times are further grouped into three subgroups for a three-step progressive model adaptation, which is able to transfer knowledge from daytime to nighttime in an unsupervised manner. In addition to the method, a new dataset of road driving scenes is compiled. It consists of 35,000 images ranging from daytime to twilight time and to nighttime. Also, 50 diverse nighttime images are densely annotated for method evaluation. The experiments show that our method is effective for knowledge transfer from daytime scenes to nighttime scenes without using human supervision.
\vspace{1mm}
\noindent
\textbf{Acknowledgement} This work is supported by Toyota Motor Europe via the research project TRACE-Zurich.
\bibliographystyle{ieee}
| {'timestamp': '2018-10-08T02:08:32', 'yymm': '1810', 'arxiv_id': '1810.02575', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02575'} | arxiv |
\chapter*{Abstract}
The extension of image generation to video generation turns out to be a very difficult task, since the temporal dimension of videos introduces an extra challenge during the generation process. Besides, due to the limitation of memory and training stability, the generation becomes increasingly challenging with the increase of the resolution/duration of videos. In this work, we exploit the idea of progressive growing of Generative Adversarial Networks (GANs) for higher resolution video generation. In particular, we begin to produce video samples of low-resolution and short-duration, and then progressively increase both resolution and duration alone (or jointly) by adding new spatiotemporal convolutional layers to the current networks. Starting from the learning on a very raw-level spatial appearance and temporal movement of the video distribution, the proposed progressive method learns spatiotemporal information incrementally to generate higher resolution videos. Furthermore, we introduce a sliced version of Wasserstein GAN (SWGAN) loss to improve the distribution learning on the video data of high-dimension and mixed-spatiotemporal distribution. SWGAN loss replaces the distance between joint distributions by that of one-dimensional marginal distributions, making the loss easier to compute.
As suitable larger resolution video datasets are scarce, we collected 10,900 videos capturing face dynamics from Hollywood movie trailers. We used our new dataset to generate face videos of 256x256x32 resolution, while benefiting from sliced Wasserstein GAN loss within the progressive framework. Up to our knowledge, this is the first work that generates videos larger than 64x64x32 resolution. In addition to the gain on resolution, our model performs better than the existing methods in terms of both appearance and dynamics. The proposed model reaches a record inception score of 14.57 in unsupervised action recognition dataset UCF-101. Additionally, our method obtains a better FID score than the state-of-the-art methods, on two challenging datasets captured in the wild.
\chapter*{Acknowledgements}
\noindent I am highly indebted to Dr. Zhiwu Huang and Dr. Danda Paudel for their supervision and support during the thesis. Content related to Sliced Wasserstein Gan in section 5 was taken from manuscript prepared by Dr. Zhiwu Huang. I would also like to thank Jiqing Wu for his code related to Sliced Wasserstein GAN. Prof. Dr. Luc Van Gool and his Computer Vision Lab also deserve special acknowledgement for the resources. I would also like to thank Bernhard Kratzwald whose models for TGAN and VideoGAN I used for some experiments.\\
\noindent I would also like to thank NVIDIA team for releasing their work on Progressive Growing of GANs and donating GPUs to the lab.\\
\noindent My parents and siblings deserve special acknowledgement for their help and support throughout all my endeavors.
\chapter{Network Architecture}
\begin{table}
\begin{center}
\begin{tabular}{lccc}
\hline\noalign{\smallskip}
Generator & Activation & Output shape & Parameters\\
\noalign{\smallskip}
\hline
\noalign{\smallskip}
Latent vector & -& 128x1x1x1&-\\
Fully-connected & LReLU& 8192x1x1x1 &1.04m\\
Conv 3x3x3 & LReLU& 128x4x4x4&0.44m\\\hline
Upsample & - & 128x8x8x8&-\\
Conv 3x3x3 & LReLU& 128x8x8x8&0.44m\\
Conv 3x3x3 & LReLU& 128x8x8x8&0.44m\\\hline
Upsample & - & 128x8x16x16&-\\
Conv 3x3x3 & LReLU& 128x8x16x16&0.44m\\
Conv 3x3x3 & LReLU& 128x8x16x16&0.44m\\\hline
Upsample & - & 128x8x32x32&-\\
Conv 3x3x3 & LReLU& 64x8x32x32&0.22m\\
Conv 3x3x3 & LReLU& 64x8x32x32&0.22m\\\hline
Upsample & - & 64x16x64x64&-\\
Conv 3x3x3 & LReLU& 32x16x64x64&55k\\
Conv 3x3x3 & LReLU& 32x16x64x64&27k\\\hline
Upsample & - & 32x16x128x128&-\\
Conv 3x3x3 & LReLU& 16x16x128x128&13.8k\\
Conv 3x3x3 & LReLU& 16x16x128x128&6.9k\\\hline
Upsample & - & 16x32x256x256&-\\
Conv 3x3x3 & LReLU& 8x32x256x256&3.4k\\
Conv 3x3x3 & LReLU& 8x32x256x256&1.7k\\\hline
Conv 1x1x1 & LReLU& 3x32x256x256&27\\\hline
Total Parameters & & & 3.7m \\ \hline
\end{tabular}
\caption{Generator architecture for generation of 256x256x32 videos.}
\label{table:genarch}
\end{center}
\end{table}
\begin{table}
\begin{center}
\begin{tabular}{lccc}
\hline\noalign{\smallskip}
Discriminator & Activation & Output shape & Parameters\\
\noalign{\smallskip}
\hline
\noalign{\smallskip}
Input Image & -& 128x1x1&-\\
Conv 1x1x1 & LReLU& 128x4x4x4&32\\
Conv 3x3x3 & LReLU& 128x4x4x4&1.73k\\
Conv 3x3x3 & LReLU& 128x4x4x4&3.47k\\
Downsample & - & 128x8x8x8&-\\\hline
Conv 3x3x3 & LReLU& 128x8x8x8&6.92k\\
Conv 3x3x3 & LReLU& 128x8x8x8&13.85k\\
Downsample & - & 128x8x16x16&-\\\hline
Conv 3x3x3 & LReLU& 128x8x16x16&27.68k\\
Conv 3x3x3 & LReLU& 128x8x16x16&55.36k\\
Downsample & - & 128x8x32x32&-\\\hline
Conv 3x3x3 & LReLU& 64x8x32x32&0.11m\\
Conv 3x3x3 & LReLU& 64x8x32x32&0.22m\\
Downsample & - & 64x16x64x64&-\\\hline
Conv 3x3x3 & LReLU& 32x16x64x64&0.44k\\
Conv 3x3x3 & LReLU& 32x16x64x64&0.44k\\
Downsample & - & 32x16x128x128&-\\\hline
Conv 3x3x3 & LReLU& 16x16x128x128&0.44m\\
Conv 3x3x3 & LReLU& 16x16x128x128&0.44m\\
Downsample & - & 16x32x256x256&-\\\hline
Minibatch Stddev&-&129x4x4x4&- \\
Conv 3x3x3 & LReLU& 8x32x256x256&.44m\\
Fully-connected & linear & 1x1x1x128&1.04m\\
Fully-connected & linear & 1x1x1x1&129\\
Total Parameters & & & 3.7m \\\hline
\end{tabular}
\caption{Discriminator architecture for generation of 256x256x32 videos.}
\label{table:discarch}
\end{center}
\end{table}
\chapter{Latent Space Interpolations}
\section*{Golf Dataset}
\begin{figure}[H]
\centering
\includegraphics[width=.7\textwidth]{golf_interpolation}
\caption{Linear interpolation in latent space to generate samples from Golf dataset - 1.}
\label{fig:golfinterpolation1}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=.7\textwidth]{golf_interpolation_2}
\caption{Linear interpolation in latent space to generate samples from Golf dataset - 2}
\label{fig:golfinterpolation2}
\end{figure}
\section*{Aeroplane Dataset}
\begin{figure}[H]
\centering
\includegraphics[width=.7\textwidth]{aeroplane_interpolation}
\caption{Linear interpolation in latent space to generate samples from Aeroplane dataset - 1}
\label{fig:planeinterpolation1}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=.7\textwidth]{aeroplane_interpolation_2}
\caption{Linear interpolation in latent space to generate samples from Aeroplane dataset - 2}
\label{fig:planeinterpolation2}
\end{figure}
\section*{TrailerFaces}
\begin{figure}[H]
\centering
\includegraphics[width=.7\textwidth]{face_interpolation_1}
\caption{Linear interpolation in latent space to generate samples from TrailerFaces dataset - 1}
\label{fig:faceinterpolation1}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=.7\textwidth]{face_interpolation_2}
\caption{Linear interpolation in latent space to generate samples from TrailerFaces dataset - 2}
\label{fig:faceinterpolation2}
\end{figure}
\chapter{Background}
For limited number of computer vision problems such as object recognition, collection of labelled data is relatively easy. Supervised machine learning techniques have already reached super human performance on such tasks. However, for several other problems such as segmentation, collection of labelled data is not as easy and the performance of purely supervised techniques is still at sub-human level. Semi-supervised and unsupervised techniques are promising avenue for such problems with information bottleneck. There have been numerous works in the direction of unsupervised representation learning. In particular, in computer vision community, various techniques such as Variational Autoencoders (VAE), Autoregressive models and Generative Adversarial Networks (GAN) have been utilized before for unsupervised image generation. Out of these techniques, GANs in particular have been main focus of the community for last couple of years. Though GANs suffered from stability of training and failure to converge in early years, these issues have largely been addressed with improved loss function \cite{wgan}\cite{iwgan}\cite{swgan}\cite{gmswd}, robust network architecture \cite{pggan}\cite{stackgan} and improved training algorithms \cite{ttur}\cite{wgan}.
In following sections, we will briefly introduce GANs and discuss different techniques proposed so far for stable training of GANs.
\section{GAN}
\begin{figure}
\centering
\includegraphics[width=.9\textwidth]{gan}
\label{fig:gan}
\caption{Standard GAN Architecture.}
\end{figure}
Generative Adversarial Networks (GANs)\cite{ganivan} are unsupervised generative models that learn to generate samples from a given distribution in adversarial manner. The network architecture consists of generator $\mathcal{G}$ and discriminator $\mathcal{D}$ (in some cases also called critic). Given a random noise as input, the generator $\mathcal{G}:\mathbb{R}^k\rightarrow \mathbb{R}^m$, where $k$ is latent space dimension, tries to generate samples from a given distribution. The discriminator $\mathcal{D}$ tries to distinguish whether the generated sample is from a given distribution or not. The loss function is designed so that generator's goal is to generate samples that fool the discriminator. Similarly, the discriminator's goal is designed to avoid being fooled by the generator. As such, GANs can be interpreted as non-cooperative games. Let $\mathcal{G}:\mathbf{z}\in\mathbb{R}^k\rightarrow \mathbf{x}\in R^m$ be generator and $\mathcal{D}:\mathbf{x}\in\mathbb{R}^m\rightarrow \{0,1\}$ be discriminator. Then the loss function proposed in \cite{ganivan} is given by:
\begin{equation}
\mathcal{F}(\mathcal{D},\mathcal{G})=\mathbb{E}_{\mathbf{x}\sim p_\mathbf{x}}[-\log \mathcal{D}(\mathbf{x})]+\mathbb{E}_{\mathbf{z}\sim p_\mathbf{z}}[-\log(1-\mathcal{D}(\mathcal{G}(\mathbf{z})))],
\label{eq_ganloss}
\end{equation}
where $\mathbf{z}$ is latent code, $\mathbf{x}$ is data sample, $p_\mathbf{z}$ is probability distribution over latent space and $p_\mathbf{x}$ is probability distribution over data samples.
The two-player minimax game is then given by:
\begin{equation}
\min_{G}\max_{D} \mathcal{F}(\mathcal{D},\mathcal{G}).
\end{equation}
In early years, discriminators were trained with sigmoid cross entropy loss as they were trained as classifiers for real and generated data. However, it was argued in \cite{lsgan}, that such GANs suffer from vanishing gradient problem. Instead, in \cite{lsgan}, least squares GANs were proposed that used least squares loss to train discriminators instead of sigmoid cross entropy loss.
Despite some improvements from least squares loss\cite{lsgan}, GANs still suffered from several issues such as instability in training, mode collapse and lack of convergence. In \cite{itgan}, authors proposed various techniques such as feature matching and minibatch discrimination. In feature matching, activations of intermediate layers of discriminator are used to guide the generator. Formally, the new generator loss is given by:
\begin{equation}
||\mathbb{E}_{\mathbf{x}\sim p_\mathbf{x}}\mathbf{f}(\mathbf{x})-\mathbb{E}_{\mathbf{z}\sim p_\mathbf{z}}\mathbf{f}(\mathcal{G}(\mathbf{z}))||_2^2,
\end{equation}
where $\mathbf{f}$ replaces the traditional $\mathcal{D}$ in the form of a feature extractor rather than a discriminator. The discriminator is trained as usual. Minibatch discrimination technique was proposed to address the issue of mode collapse. To accomplish this, additional statistics that models affinity of samples in a minibatch is concatenated to features in the discriminator. it is important to note that the summary statistics is learned during training through large projection matrices.
\section{Wasserstein GAN}
In \cite{wgan}, authors argue that optimization of GAN loss given in Eq.~\ref{eq_ganloss} is same as minimization of Jensen-Shannon (JS) divergence between distribution of generated and real samples. In case the two distributions have non-overlapping support, JS-divergence can have jumps. This leads to aforementioned optimization issues. For stable training of GANs, authors propose to minimize Wasserstein Distance (WD) between the distributions which behaves smoothly even in case of non-overlapping support. Formally, the primal form of WD is given by:
\begin{equation}
W(p_r,p_g)=\inf_{\gamma\in\prod(p_r,p_g)}\mathbb{E}_{(x,y)\sim\gamma}[||x-y||],
\label{wdprimal}
\end{equation}
where $p_r, p_g$ are distributions of real and generated samples and $\prod(p_r,p_g)$ is the space of all possible joint probability distributions of $p_r$ and $p_g$. It is not feasible to explore all possible values of $\gamma\in\prod(p_r,p_g)$. So, authors propose to use the dual formulation which is better suited for approximation. Formally, the dual formulation of Eq.~\ref{wdprimal} is given by:
\begin{equation}
W(p_r,p_g) = \frac{1}{K}\sup_{||f||_L\leq K}\mathbb{E}_{\mathbf{x}\sim p_r}[\mathbf{f}(x)]-\mathbb{E}_{\mathbf{x}\sim p_g}[\mathbf{f}(\mathbf{x})],
\end{equation}
where $||f||_L\leq K$ is $K-$Lipschitz constraint. The GAN loss is then given by:
\begin{equation}
\mathcal{F}(\mathcal{G}, \mathcal{D}) = W(p_r,p_g)=\max_{w\in W}\mathbb{E}_{\mathbf{x}\sim p_r}[\mathbf{f}_w(\mathbf{x})] - \mathbb{E}_{\mathbf{z}\in p_r(\mathbf{z})}[\mathbf{f}_w(\mathcal{G}(\mathbf{z}))].
\label{eq_wganloss}
\end{equation}
Here, the discriminator takes the form of feature extractor and is parametrized by $w$. $\mathbf{f}$ is further required to be K-Lipschitz. In order to enforce the K-Lipschitz constraint, authors proposed weight clipping. However, as argued in the same paper, gradient clipping is a very rudimentary technique to enforce the Lipschitz constraint. In \cite{iwgan}, authors propose to penalize the norm of the gradient in order to enforce Lipschitz constraint. In particular, the new loss is defined as:
\begin{equation}
\mathcal{F}(\mathcal{D},\mathcal{G})=\mathbb{E}_{\mathbf{x}\sim p_\mathbf{x}}[\mathcal{D}(x)]-\mathbb{E}_{\mathbf{z}\sim p_\mathbf{z}}[\mathcal{D}(\mathcal{G}(\mathbf{z}))] + \lambda \mathbb{E}_{\hat{\mathbf{x}}\sim p_{\hat{\mathbf{x}}}}[(||\nabla_{\hat{\mathbf{x}}}\mathcal{D}(\hat{\mathbf{x}})||_2-1)^2]
\label{eq_iwganloss},
\end{equation}
where $\lambda$ is regularization parameter and $\hat{\mathbf{x}}$ is sampled uniformly from a straight line connecting real sample and generated sample.
\section{Conditional GANs}
It is relevant to briefly review Conditional GANs\cite{conditiongan}. They provide a framework to enforce conditions on the generator in order to generate samples with desired property. Such conditions could be class labels or some portion of original data as in case of future prediction. Under the new setting, the GAN loss defined in Eq.~\ref{eq_ganloss} becomes
\begin{equation}
\mathcal{F}(\mathcal{D},\mathcal{G})=\mathbb{E}_{\mathbf{x}\sim p_\mathbf{x}}[-\log \mathcal{D}(\mathbf{x})]+\mathbb{E}_{\mathbf{z}\sim p_\mathbf{z}}[-\log(1-\mathcal{D}(\mathcal{G}(\mathbf{z})))]
\label{eq:condtganloss}
\end{equation}
Concrete applications of Conditional GANs include generation of specific digits of MNIST dataset \cite{conditiongan} or a face with specific facial expression, age or complexion in the context of images \cite{stargan}, or future prediction\cite{ivgan} in context of videos to name a few.
Over the years, GANs have found applications in numerous areas. To name a few, such applications include image-to-image translation\cite{cyclegan}\cite{cyclecondt}\cite{bicyclegan}\cite{stargan}, 3D object generation\cite{3dgan}\cite{3dgan2}, super resolution\cite{superresolution1} , image inpainting\cite{inpaint1} etc.
\chapter{Conclusion and Discussion}
In this work, we explored the use of progressive growing of GANs for video generation. By progressively growing the network, we were able to generate videos of up to 256x256 resolution and 32 frames. Our model performed better than existing state-of-art models on UCF101 dataset as measured by Inception Score and FID Score. We obtained state of art inception score of 14.56 on UCF101 dataset. This is significant improvement over state-of-art score reported in \cite{mocogan}. This shows that the idea of first training on simpler problem and progressively increasing the complexity of the problem is also effective for video generative models. Though we observed that use of Sliced Wasserstein metric as loss for training GANs improves performance of the model as measured by inception score in some cases, more experiment is needed to make a definite conclusion. Perceptually, the results obtained are still not as realistic as were obtained in the case of image based on methods. Recently there has been surge in models that use optical flow\cite{ftgan}\cite{timelapse}\cite{texture} to generate videos. This is a promising direction to explore.
Following the approach of \cite{pggan}, the discriminator we used was mirror reflection of the generator architecture. Due to this, the network architecture of discriminator in our model is drastically different than that of C3D model which was used for quantitative comparison. As there are fewer feature channels in our Discriminator, it is weaker than C3D model or the discriminators used for previous works\cite{tgan}\cite{mocogan}\cite{vgan}. It is interesting to note that our model performs better than existing approaches despite a discriminator with fewer parameters.
There is enough space to explore if incorporation of the idea of progressive growing of gans to more complex architectures such as \cite{tgan}\cite{mocogan} that have different temporal and spatial generators. Furthermore, incorporation of prior information such as class label can be expected to drastically improve the results. The higher quality image generation in \cite{pggan} was possible due to higher quality well aligned training data. Application of similar super-resolution techniques can be expected to further improve the quality of video generation. Furthermore, well alignment of faces in TrailerFaces dataset can be expected to significantly impact the quality of videos generated. However, the problem of alignment of faces in videos is not as well-posed problem as alignment of faces in images and is more challenging.
For evaluation of our generative models, we relied on C3D models trained on Sports-1M dataset and fine tuned in UCF101 dataset. This model has clip level accuracy of approximately $75\%$ on test split. The effectiveness of a model with far from $100\%$ accuracy for evaluation of generative models is a research problem in itself. Furthermore, recently accuracy of $98.0\%$ was achieved on UCF101 with Two-Stream Inflated 3D ConvNet (I3D)\cite{quovadis}. We can expect the I3D model to give more valid Inception and FID Scores. Furthermore, for training on UCF101, we only used central 32 frames of UCF101 for training. This method was slightly different than use of randomly selected 32 consecutive frames\cite{tgan}\cite{mocogan}. It is also important to point out that, we obtained the best possible inception score of $83.18\%$. Whereas, in \cite{tgan}, best possible score of $34.33\%$ was reported. It is possible that authors downsampled original videos to 64x64 and then again upscaled to 128x128 before feeding into C3D model. This is reasonable as their model is trained on 64x64 videos. We directly downscaled to 128x128 before feeding into the network as we designed our network to train on 128x128 resolution.
\chapter{Evaluation Datasets}
To evaluate our video generative mode, we collected our own TrailerFaces dataset. Furthermore, we also evaluated our model on existing Golf~\cite{vgan}, Aeroplane~\cite{ivgan} and UCF101 datasets~\cite{ucf101_dataset}. In following sections, we will review these datasets briefly.
\section{Trailer Face Dataset}
\begin{figure}[!ht]
\centering
\includegraphics[width=.9\textwidth]{pipeline.png}
\label{fig:pipeline}
\caption{Pipeline for Construction of Dataset.}
\end{figure}
Large chunk of GAN papers evaluate and compare the generative models on facial datasets \cite{pggan}\cite{ttur}\cite{ganivan} such as CelebA\cite{celeba_dataset} in case of images and MUG dataset\cite{mug_dataset} or YouTube Faces\cite{youtubefaces_dataset} in case of videos~\cite{mocogan}\cite{rehuang2017face}. However, there is lack of publicly available high resolution datasets containing facial dynamics.
\begin{table}
\begin{center}
\begin{tabular}{lccccc}
\hline\noalign{\smallskip}
Dataset & Resolution (Aligned) & Sequences & Wild & Labels & Diverse Dynamics\\
\noalign{\smallskip}
\hline
\noalign{\smallskip}
TrailerFaces & 300x300 & 10,911 &\ding{51} &\ding{55}&\ding{51}\\
YoutubeFaces & 100x100 & 3,425 & \ding{51} & Identity&\ding{55}\\
AFEW & - & 1,426 & \ding{51} & Expressions & \ding{51} \\
MUG & 896x896 & 1,462 & \ding{55} & Expressions & \ding{55}\\ \hline
\end{tabular}
\caption{Comparision of our TrailerFaces dataset with existing datasets containing facial dynamics.}
\label{table:dataset_comparision}
\end{center}
\end{table}
In terms of resolution too, widely used datasets for video generation such as Golf and Aeroplane datasets too are only 128x128 resolution. UCF101 is widely used for evaluation of generative models. Though it contains 240x320 resolution samples, due to relatively small number of samples per class, learning meaningful features is not possible. Aeroplane and Golf datasets contain too diverse videos. Learning meaningful representation from such videos can be difficult for networks. Hence a novel dataset of human facial dynamics was collected from movie trailers.
\begin{table}[!ht]
\begin{center}
\begin{tabular}{lcccccc}
\hline\noalign{\smallskip}
Number of Frames & 30-33 & 34-39 & 40-47 & 48-57 & 58-69 & 70-423 \\
\noalign{\smallskip}
\hline
\noalign{\smallskip}
Total clips & 1781 & 3106 & 2291 & 1591 & 940 & 1201\\ \hline
\end{tabular}
\caption{Total number of clips with given number of frames.}
\label{table:dataset_frequency}
\end{center}
\end{table}
Our motivation to use movie trailers for dataset collection was motivated by the fact movie trailers highlight dramatic and emotionally charged scenes. Unlike whole movies, interviews or TV series, trailers contain scenes where stronger emotional response of actors are highlighted. Furthermore using trailers of thousands of movies increases the gender, racial and age-wise diversity of the faces in the clips. Approximately $6000$ complete Hollywood movie trailers were downloaded from YouTube. Number of SIFT feature matches between corresponding frames was used for shot boundary detection. Approximately $200,000$ shots were detected in those trailers. After splitting trailers into individual shots, those with too few or too many frames were removed. Face-detection was carried out to filter-out clips where at least 31 consecutive frames do not contain any faces. For face detection Haar-cascade based face detection tool from Open-CV was used. After detection of faces, Deep Alignment Network\cite{deepalignmentnetwork} was used for extraction of $68$-point facial landmark. Thus obtained facial landmarks were used for alignment using similarity transform. This was observed to be more stable across temporal dimension compared to state-of-art techniques like MTCNN. Finally, consecutive frames from those shots on which face detection was successful were selected. SIFT feature matching was again used to remove clips containing different personalities across frames.
\begin{figure}[!ht]
\centering
\includegraphics[width=.9\textwidth]{trailer_faces_samples}
\label{fig:trailerFacesSamples}
\caption{Samples from TrailerFaces Dataset. Random frames were chosen for visualization.}
\end{figure}
\section{UCF101 Dataset}
UCF101 dataset~\cite{ucf101_dataset} was originally collected for action recognition tasks. It contains 13320 videos from 101 different action categories. Some of the action categories in the videos include Sky Diving, Knitting and Baseball Pitch. In \cite{tgan} video based inception score was proposed for evaluation of quality of video generative models. As argued in \cite{tgan}, Inception score computation requires a dataset with class labels and a standard model trained for classification. For training, first training split of UCF101 dataset with 9,537 video samples was used.
\begin{figure}[!ht]
\centering
\includegraphics[width=.9\textwidth]{ucf_real}
\caption{Samples from UCF101 dataset. Random frames were selected for visualization.}
\label{fig:ucf101}
\end{figure}
\section{Golf and Aeroplane Datasets}
Golf and Aeroplane datasets contain 128x128 resolution datasets that can be used for evaluating video generative adversarial networks. Golf dataset in particular was used in \cite{tgan}\cite{vgan}\cite{ivgan}. Both of these datasets contain videos in the wild. Golf dataset contains more than half a million clips. We used the background stabilized clips for training our model. Aeroplane dataset contains more than 300,000 clips that are not background stabilized.
\begin{figure}[!ht]
\centering
\begin{subfigure}
\centering
\includegraphics[width=0.44\textwidth]{golf_reals.png}
\end{subfigure}%
\begin{subfigure}
\centering
\includegraphics[width=0.44\textwidth]{plane_reals.png}
\end{subfigure}
\label{fig:ucfgraphs}
\caption{Samples from Golf (right) and Aeroplane (left) datasets. Random frame was selected for visualization.}
\end{figure}
\chapter{Discussion}
\begin{comment}
The discussion section gives an interpretation of what you have done \cite{day2006wap}:
\begin{itemize}
\item \textit{What do your results mean?} Here you discuss, but you do not recapitulate results. Describe principles, relationships and generalizations shown. Also, mention inconsistencies or exceptions you found.
\item \textit{How do your results relate to other's work?} Show how your work agrees or disagrees with other's work. Here you can rely on the information you presented in the ``related work'' section.
\item \textit{What are implications and applications of your work?} State how your methods may be applied and what implications might be.
\end{itemize}
\noindent Make sure that introduction/related work and the discussion section act as a pair, i.e. ``be sure the discussion section answers what the introduction section asked'' \cite{day2006wap}.
\end{comment}
\chapter{Evaluation Metrices}
Evaluation of GANs is a non trivial problem. Some of the early works relied on evaluation based on surveys such as Amazon Mechanical Turk~\cite{itgan}\cite{vgan}\cite{ivgan}. More quantitative metrics such as Inception Score~\cite{itgan} and Frechet Inception Distance (FID) \cite{ttur} have been proposed for image based GAN evaluation. These metrices were shown to correlate well with human perception. We will briefly review these metrices in following sections.
\section{Inception Score}
Inception score was originally proposed in~\cite{itgan} for evaluation of GANs. In the paper, the authors argued that Inception Score correlated well with the visual quality of generated samples. Let $\mathbf{x}\sim \mathcal{G}$ be samples generated by the generator $\mathcal{G}$. $p(y|\mathbf{x})$ be the distribution of classes for generated samples and $p(y)$ be the marginal class distribution:
\begin{equation}
p(y)=\int_{\mathbf{x}}p(y|\mathbf{x})p_g(\mathbf{x}).
\end{equation}
The Inception score is defined as:
\begin{equation}
IS(\mathcal{G})=\exp(\mathbb{E}_{\mathbf{x}\sim p_g}\mathcal{D}_{KL} (p(y|\mathbf{x})||p(y))),
\end{equation}
where $\mathcal{D}_{KL}$ is the Kullback-Leibler divergence between $p(y|\mathbf{x})$ and $p(y)$.
In practice, the marginal class distribution is approximated with:
\begin{equation}
\hat{p}(y)=\frac{1}{N}\sum_{i=1}^Np(y|\mathbf{x}^{(i)}),
\end{equation}
where $N$ is number of samples generated.
Intuitively, maximum Inception Score is obtained when generated samples can be clearly classified as belonging to one of the classes in training set and the distribution of samples belonging to different classes is as uniform as possible. This encourages realistic samples and discourages mode collapse. The idea behind Inception score has been generalized to the context of video generation. In \cite{tgan} authors propose to use C3D model trained on Sports-1M dataset and finetuned on UCF101 dataset. It is important to point out that Inception score computation requires a model trained on specific classification problem and corresponding data. Furthermore Inception score does not compare the statistics of generated samples directly with statistics of real samples \cite{ttur}.
\section{Fr{\'e}chet Inception Distance}
Alternative measure to access the quality of generated samples was proposed in~\cite{ttur}. In the paper, authors propose to use pre-trained networks as feature extractors to extract low level features from both real and generated samples. If $\mathcal{D}$ be the CNN used to extract features, $(m_r, \Sigma_r)$ be mean and covariance of features extracted from real samples and $(m_f,\Sigma_f)$ be mean and covariance of features extracted from fake samples with $\mathcal{D}$, then the Fr{\'e}chet distance is defined as
\begin{equation}
d^2((m_r,\Sigma_r),(m_f,\Sigma_f))=||m_r-m_f||_2^2+Tr(\Sigma_r+\Sigma_f-2(\Sigma_r\Sigma_f)^{1/2}).
\end{equation}
FID was shown to correlate well to visual perception quality~\cite{ttur}. Since FID directly compares the summary statistics of generated samples and real samples, it can be considered to be more accurate than Inception score. Furthermore, as lower level features are used to compute FID score, it can be used to evaluate generative models for any dataset.
Similar to Inception score, FID can be generalized to compare video generative models. In particular, as C3D is standard model widely used in video recognition tasks, a C3D model trained on action recognition dataset can be used as feature extractor. Since output of final pooling layer is very high dimensional in case of C3D, output of first fully connected layer can be used to resonably compare the quality of generated samples.
\chapter{Experiments and Results}
To compare the performance of our model with state of art models, we present qualitative and quantitative results below. Since UCF101 has class labels and as it was used for evaluation in prior works, we evaluate our models by comparing Inception score on UCF101 dataset with compare Golf and Aeroplane datasets with FID score. For TrailerFaces dataset, we present qualitative results below.
\section{Qualitative Results}
\begin{figure}[H]
\centering
\includegraphics[width=0.99\textwidth]{training_progress}
\caption{Improvement in resolution of generated videos over time on TrailerFaces dataset. Single frames from each video clips were selected}
\label{fig:faceProgress}
\end{figure}
As discussed earlier, progressive growing scheme was utilized for training the video generative networks. The improvement in quality and level of details over the course of training is illustrated in Fig.~\ref{fig:faceProgress}. As seen from the figure, more detailed structures appear in the images over the course of training. Furthermore, the generated images look reasonable on TrailerFaces dataset. However, the quality is still not comparable to the quality of generated samples in the case of images \cite{pggan}.
As illustrated in Fig.~\ref{fig:planecomparision}, Fig.~\ref{fig:golfcomparision} and Fig.~\ref{fig:staticcomparision}, the structure of moving objects such aeroplanes, humans and animals is not distinct and they appear as blobs. Though appearance of dynamic objects is not well captured by the network, it can be inferred from Fig.~\ref{fig:planecomparision} and Fig.~\ref{fig:golfcomparision} that temporal dynamics seems more reasonable.
To analyze if the network has overfitted the dataset, we carried out linear interpolation in latent space and generated samples. As seen from Fig.~\ref{fig:golfinterpolation1},\ref{fig:golfinterpolation2},\ref{fig:planeinterpolation1},\ref{fig:planeinterpolation2},\ref{fig:faceinterpolation1},\ref{fig:faceinterpolation2}, samples from all datasets show that our network has good generalization ability and does not overfit the model.
\begin{figure}
\centering
\includegraphics[width=0.9\textwidth]{plane_comparision_2}
\caption{Qualitative comparision of samples from Aeroplane dataset generated by our method with that generated by Video GAN and Temporal GAN.}
\label{fig:planecomparision}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=0.9\textwidth]{golf_comparision_2}
\caption{Qualitative comparision of samples from Golf dataset generated by our method with that generated by Video GAN and Temporal GAN.}
\label{fig:golfcomparision}
\end{figure}
\begin{figure}
\centering
\begin{subfigure}
\centering
\includegraphics[width=0.45\textwidth]{plane_comparision}
\end{subfigure}%
\begin{subfigure}
\centering
\includegraphics[width=0.45\textwidth]{golf_comparision}
\end{subfigure}%
\caption{Qualitative comparision of clips generated with progressive approach (top), Temporal GAN (bottom left) and Video GAN (bottom right) on aeroplane (left) and golf datasets (right).}
\label{fig:staticcomparision}
\end{figure}
It can be observed that progressive growing technique can generate higher resolution videos without mode collapse or instability issues traditionally suffered by GANs. However, the issue that moving objects appear as blobs in generated samples as reported in \cite{vgan}, is still not completely solved.
\section{Inception score on UCF101}
Same protocol and C3D model proposed in \cite{tgan} was used for computation of inception scores. All scores except our own were taken from \cite{tgan} and \cite{mocogan}. To train our model, central 32 frames from UCF101 were selected and then each frame was resized and cropped to $128\times128$. In our experiments, best Inception score of $13.59$ was obtained with a single, though progressive model. Furthermore, with SWGAN loss, we were able to obtain inception score of $14.56$. Both of these scores are the best result we are aware of.
\setlength{\tabcolsep}{4pt}
\begin{table}[H]
\begin{center}
\begin{tabular}{lll}
\hline\noalign{\smallskip}
Model & Inception Score\\
\noalign{\smallskip}
\hline
\noalign{\smallskip}
VGAN\cite{vgan} & $8.18$ \\
TGAN\cite{tgan} & $11.85$ \\
MoCoGAN\cite{mocogan} & $12.42 $ \\
Progressive Video GAN & $13.59$ \\
\textbf{Progressive Video GAN} + \textbf{SWGAN} & \textbf{14.56}\\
Maximum Possible & $83.18$\\
\hline
\end{tabular}
\caption{Inception scores of Progressive Video GAN compared with other models on UCF101 dataset.}
\label{table:headings}
\end{center}
\end{table}
In all cases, first training split of UCF101 dataset was used. However, in \cite{tgan} and \cite{mocogan}, authors randomly sampled $16$ or $32$ consecutive frames during training. In our case, we restricted to central $32$ frames of video during training.
Surprisingly, inception score started decreasing on training the network further. One possible cause could be smaller minibatch size used at higher resolution. However, further experiment is necessary to make decisive conclusion about the behaviour.
\section{FID}
In this section, we compare FID score of samples generated with our model and one generated with models from VideoGAN and TGAN papers. In C3D model, output of fc-6 layer is 4096-d where as output of pool-5 layer is 8192-d. The output of fc-6 layer of C3D model was used to compute FID score for computational reasons. In order to compute FID score, 10,000 samples were generated with each model. Since VideoGAN and TGAN models were trained to generate on 64x64 resolution videos, we upscaled the videos to $128\times 128$ in order to compute FID score.
\begin{figure}
\centering
\begin{subfigure}
\centering
\includegraphics[width=0.48\textwidth]{fiducf.png}
\end{subfigure}%
\begin{subfigure}
\centering
\includegraphics[width=0.42\textwidth]{inceptionucf.png}
\end{subfigure}
\label{fig:ucfgraphs}
\caption{Comparison of our models on UCF101 dataset based on FID Score (left) and Inception Score (right).}
\end{figure}
\begin{figure}
\centering
\begin{subfigure}
\centering
\includegraphics[width=0.48\textwidth]{planefid.png}
\end{subfigure}%
\begin{subfigure}
\centering
\includegraphics[width=0.45\textwidth]{golffid.png}
\end{subfigure}
\label{fig:golfplanegraphs}
\caption{Comparison of our model with TGAN and VideoGAN based on Golf and Aeroplane Datasets as measured by FID score.}
\end{figure}
\begin{table}
\begin{center}
\begin{tabular}{lcc}
\hline\noalign{\smallskip}
Model & FID Score on Golf Dataset& FID Score on Aeroplane Dataset\\
\noalign{\smallskip}
\hline
\noalign{\smallskip}
VGAN\cite{vgan} & 113007 & 149094\\
TGAN\cite{tgan} & 112029 & 120417\\
\textbf{Progressive Video GAN} & \textbf{95544} & \textbf{102049}\\
\hline
\end{tabular}
\caption{Quantitative comparision of Progressive Video GAN with TGAN and VideoGAN based on FID score on Golf and Aeroplane datasets.}
\label{table:headings}
\end{center}
\end{table}
To report FID, TGAN and VideoGAN were trained on our own using code available on the internet. It is clear from both datasets that progressive video GAN performs significantly better than TGAN and VideoGAN. The difference is even more prominent in case of Aeroplane dataset where TGAN and Progressive Video GAN perform significantly better than VideoGAN. As mentioned earlier, Golf dataset was stabilized whereas Aeroplane dataset was not. This is easily explained by the fact that VideoGAN assumes stable background whereas TGAN and Progressive Video GAN make no such assumptions.
\begin{comment}
\begin{figure}
\centering
\begin{subfigure}
\centering
\includegraphics[height=8cm]{Facesprogan.pdf}
\end{subfigure}
\begin{subfigure}
\centering
\includegraphics[height=4cm]{ucf101.pdf}
\end{subfigure}%
\begin{subfigure}
\centering
\includegraphics[height=4cm]{Golfprogan.pdf}
\end{subfigure}
\label{fig:progan_qualitative}
\caption{Samples from models trained on Trailer Faces (top, $256\times 256$), UCF101 (bottom left, $128\times 128$) and Golf dataset (bottom right, $128\times 128$).}
\end{figure}
\end{comment}
\chapter{Introduction}
Compared to images, videos contain additional temporal dynamics. Hence, richer information about the scene can be extracted. Furthermore, images are also restricted to a single perspective and are prone to ambiguity. Despite this, most of the focus of computer vision community has been on static image based techniques. This can be attributed to computational and storage overhead of video based algorithms as well as complexity of modeling videos. As seen from action recognition problems, static images are not sufficient to correctly predict the event. This holds true even when best possible frame is chosen~\cite{huangmakes}. This motivates the work on video based computer vision algorithms.
The main motivation behind generative models for both images and videos lies in the notion that how well we understand a given object is directly related to how well we can generate that object. As such, neural network based unsupervised methods such as Autoencoders~\cite{draw}\cite{vae1}, Autoregressive models~\cite{pixelrnn}\cite{pixelcnn}\cite{vpn} and Generative Adversarial Networks (GAN)~\cite{ganivan}\cite{iwgan}\cite{tgan} have been widely used to design generative models. Several of such techniques have also been applied to video generative models. These generative models provide mechanism for unsupervised representation learning and have been widely employed for semi-supervised methods. Semi-supervised and unsupervised techniques are particularly useful when collecting data is relatively easy but labelling is very expensive. Such scenarios arise in several problems such as semantic segmentation, medical image analysis and facial action unit encoding.
GANs are one of most widely used generative models. In last couple of years, research in GAN has made significant progress in terms of stability of training and quantitative evaluation frameworks~\cite{itgan}\cite{ttur}. These improvements can primarily be attributed to improved loss function~\cite{lsgan}\cite{wgan}\cite{iwgan}\cite{swgan}\cite{gmswd}, robust network architectures~\cite{dcgan}\cite{pggan} and robust training schemes~\cite{pggan} that guarantee convergence. However as in the case of other computer vision works, most of the GANs have focused on image based problems. The research into GANs that focus on video generation is relatively scarce. Due to computational limitation and network instability, all existing works generate $64\times 64$ tiny clips~\cite{mocogan}\cite{tgan}\cite{vgan}\cite{ftgan}.
While designing models for video generation, it is natural to assume that temporal variations in videos behave differently than spatial variations. Spatial variations can be used to infer various objects present in the scene, where as the dynamics of these objects can be inferred from temporal variations. The relationship between and interaction of these objects may depend on both temporal and spatial variations. So, while modeling videos, it is natural to model temporal and spatial domains separately. This has been explored by using 1-D convolutions for temporal generator \cite{tgan} or Recurrent Neural Networks (RNN) to generate latent code for image based generators \cite{mocogan}. Using 1-D convolutions also reduces the model size\cite{1d1}\cite{1d2}. However, 3-D convolutions have survived the test of time and are widely used for problems ranging from object recognition, shot detection to video stabilization.
In this work, we explore whether the robust measures introduced for training GANs on image based problems \cite{pggan}\cite{swgan} generalize to video based frameworks. In particular, we generalize the scheme of Progressive Growing of GANs\cite{pggan} to video based problems. As discussed earlier, though 1-D convolutions \cite{tgan} or Recurrent Neural Networks \cite{mocogan} have been experimented in the context of generative models to model the temporal domain, we use simple 3-D convolutions to keep the model simple. This is particularly important in light of the complexity of the model introduced by progressive growing approach.
Realistic video generation has been accomplished in works such as~\cite{deepvideoportrait}\cite{lipsinc}\cite{timelapse}\cite{videoprediction}\cite{lecun}. However these works are restricted to very specific problems and domains. As such, they are not useful for general unsupervised representation learning or for use in semi-supervised techniques. Furthermore, the network architectures in such scenarios are highly specialized. In this work, we explore the more general problem of unsupervised video generation using Generative Adversarial Networks. In particular, we apply the idea of Progressively Growing GANs for video generation.
\section{Focus of this Work}
The main focus of the work is on unsupervised generation of higher resolution videos. Such an endeavour has several challenges. First, there is lack of sufficient large resolution video datasets. Next, generating larger videos incurs severe memory and computational constraints. Network training and convergence is also highly unstable. We address these issue with following contributions:
\begin{itemize}
\item Progressive growing of video generative adversarial networks
\item Improved loss function for better stability
\item Novel $300\times 300$ facial dynamics dataset with $10,910$ video clips
\end{itemize}
\section{Thesis Organization}
In chapter 2, readers will be introduced to basic ideas behind GANs and recent advances for stable training of GANs. In chapter 3, relevant literature will be reviewed and important models will be discussed in details. In chapter 4, proposed techniques for spatio-temporal growing of gans will be discussed. Sliced Wasserstein GAN loss for stable training will be presented in chapter 5. In chapter 6, various metrices used in this work for evaluating and comparing our model against other models will be presented. In chapter 7, we will discuss about novel dataset collected for this work. Additional datasets used for evaluating our model will be also be mentioned. Qualitative and quantitative comparision of our model with existing models will be presented in chapter 8. In chapter 9, we will discuss our findings and conclusions.
\chapter{Materials and Methods}
The objectives of the ``Materials and Methods'' section are the following:
\begin{itemize}
\item \textit{What are tools and methods you used?} Introduce the environment, in which your work has taken place - this can be a software package, a device or a system description. Make sure sufficiently detailed descriptions of the algorithms and concepts (e.g. math) you used shall be placed here.
\item \textit{What is your work?} Describe (perhaps in a separate chapter) the key component of your work, e.g. an algorithm or software framework you have developed.
\end{itemize}
\chapter{Progressive Video Generation}
GANs typically suffer from instability and failure to converge. Such issues are even more prominent for higher resolution images or video generation as the generator and discriminator contain too many parameters. In such cases improved loss function itself may not suffice to generate high resolution videos.
\begin{figure}[!ht]
\centering
\includegraphics[width=.8\textwidth]{proVid2}
\label{fig:provid2}
\caption{Progressive video generation. Initially low resolution and short videos are generated. Gradually, higher resolution and longer videos are generated.}
\end{figure}
To address this issue, the idea behind curriculum learning \cite{curriculum} can be utilized. In the beginning, smaller network with less parameters can be used to learn the lower resolution samples \cite{pggan}. Generator and discriminator can be trained to generate and discriminate downscaled videos. Learning a coarser model is relatively easier and turns out to be more stable. First learning simpler models and gradually increasing model complexity also leads to faster convergence. To increase model complexity during training, gradually new layers can be introduced both to the generator and the discriminator to generate larger resolution videos. Doing so helps the model to learn a finer distribution of samples. Progressively growing the network during training, helps to first estimate a coarser PDF and gradually refine it during training.
In order to progressively grow the network for video generation, the real $32\times256\times256$ video samples are downscaled to $4\times 4\times 4$ by applying 3-D average pooling filter. The generator then generates $4\times 4\times 4$ videos. New layers added during training gradually introduce more spatial and temporal details.
\section{Transition Phase}
\begin{figure}[!ht]
\centering
\includegraphics[width=.8\textwidth]{proVid}
\label{fig:provid1}
\caption{Transition phase during which new layers are introduced to both generator and discriminator.}
\end{figure}
During each phase, the final layer of generator consists of $1\times 1 \times 1$ convolution filters that map input feature channels to RGB videos. The discriminator in the similar fashion consists of $1\times 1 \times 1$ convolution filters that map input RGB videos to feature channels. While transitioning from one resolution to another resolution, new convolution layers are introduced to both discriminator and generator symmetrically to generate larger resolution videos. During transition from one level of detail to another level of detail, generator outputs videos of two different resolutions. The lower resolution videos are upscaled with nearest-neighbor upscaling. The linear combination of the upscaled video and higher resolution video is then fed to discriminator. The weight corresponding to higher resolution video generated by generator is smoothly increased from 0 to 1 and that corresponding to upscaled video is gradually decreased from 1 to 0. New layers are introduced in discriminator in similar manner.
\section{Minibatch Standard Deviation}
One way to avoid mode collapse is to use feature statistics of different samples within the minibatch and penalize the closeness of those features \cite{iwgan}. In this approach, the feature statistics are learned through parameters of projection matrices that summarize input activations \cite{pggan}\cite{wgan}. Instead, following \cite{pggan}, standard deviation of individual features from each spatio-temporal location across the minibatch is computed and then averaged. Thus obtained single summary statistics is concatenated to all spatio-temporal location and features of the minibatch.
\begin{figure}[!ht]
\centering
\includegraphics[width=.6\textwidth]{minibatchstd}
\label{fig:provid1}
\caption{Illustration of different steps of minibatch standard deviation layer: (a) feature vectors at each pixel across the minibatch, (b) standard deviation computation of each feature vector, (c) average operation, (d) replication and (e) concatenation.}
\end{figure}
Since there are no additional learnable parameters, this approach is computationally cheaper and yet as argued in \cite{pggan}, efficient.
\section{Pixel Normalization}
Following \cite{pggan} and in the direction of local response normalization proposed in \cite{alexnet}, normalization of feature vector at each pixel avoids explosion of parameters in generator and discriminator. The pixel feature vector normalization proposed in \cite{pggan} can be naturally extended to spatio-temporal case. In particular, if $a_{x,y,t}$ and $b_{x,y,t}$ be original and normalized feature vector at pixel $(x,y,t)$ corresponding to spatial and temporal position,
\begin{equation}
b_{x,y,t}=\frac{a_{x,y,t}}{\sqrt{\frac{1}{N}\sum_{j=0}^{N-1}(a^j_{x,y,t})^2+\epsilon}},
\end{equation}
where $\epsilon=10^{-8}$ and $N$ is number of feature maps. Though pixel vector normalization may not necessarily improve performance, it does avoid explosion of parameters in the network.
\chapter{Related Works}
As outlined in the title, our focus on this work is on higher resolution video generation with progressive growing of Sliced Wasserstein GANs (SWGAN). As such, we will briefly discuss existing works related to progressive growing technique, video generation and Sliced Wasserstein GANs in the following sections. Later, we will also discuss the details of the selected works relevant to this work.
As the complexity of the problem grows, it becomes more and more difficult to learn an appropriate model. To address this, the idea of curriculum learning was proposed in~\cite{curriculum}. The idea behind curriculum learning is to gradually increase the complexity of the problem during training. The idea to use multiple generators has been explored in~\cite{multigan} to address the issue of mode collapse. In~\cite{multidisc}, authors proposed to use multiple discriminators for stable training. Similarly, ~\cite{stackgan} introduces multi-stage GANs where consecutive GANs take input from GANs from previous stage. The details and complexity of features of the generated samples increases with increasing stages of GANs. This was one of the early GANs to generate reasonable images of size 256x256. Inspired by these concepts of using multiple generators and discriminators, and curriculum learning, authors of \cite{pggan} proposed the technique of progressively growing the network for stable generation of 1024x1024 images.
There have been numerous works that aim to improve the original objective function for GANs Eq.~\ref{eq_ganloss}. This has already been reviewed in detail in earlier chapter. LS-GAN\cite{lsgan}, WGAN\cite{wgan}, I-WGAN\cite{iwgan} are one of the most important works that aim to improve the original GAN loss function. Recently, Sliced Wasserstein GANs (SWGANs) that propose to use Sliced Wasserstein Distance (SWD) were proposed in \cite{swgan}\cite{gmswd}. As stated in~\cite{bonnette}, SWD is equivalent to WD. However, SWD is relatively easier to approximate compared to original WD\cite{kolouri}\cite{bonnette}. SWGANs are motivated by the fact that WD is ideal to measure distance between two distributions with non-overlapping support and enforcing the Lipschitz constraint on the dual formulation in non trivial.
In the direction of video generation, there are very limited works that try to model videos in unsupervised setting. One of the earliest works~\cite{vgan} tried to separate background and foreground for video generation. In~\cite{vpn}, Video Pixel Network (VPN) was proposed building on the work of Pixel CNNs. Temporal GAN~\cite{tgan} used temporal and image generators to generate temporal encoding and images separately. MoCoGAN~\cite{mocogan} also use temporal and spatial generators. However, they claim to separate motion and content of video using different techniques to encode latent space. One recent work~\cite{ftgan} tries to model videos by separating texture and optical flow. All of these works generate videos of 64x64 resolution. In this work we generate videos of up to 256x256 resolution. It is important to note that most of the above mentioned works design their model to do some sort of separation on the space of videos with different names such as foreground and background separation or texture and flow separation or motion and content separation. In this work, we do not carry any such separation entirely for model simplicity in light of model complexity introduced by progressively growing scheme. However, advantage of single stream models while generating unstabilized videos has been highlighted in \cite{ivgan}.
As the ideas behind progressive growing techniques\cite{pggan} and video generative networks\cite{tgan}\cite{vgan} are relevant to this work, these works will be discussed in detail in following section.
\section{Progressive Growing of GAN}
As mentioned earlier, the basic idea behind progressive growing of GANs is to gradually increase the complexity of the problem \cite{pggan}. To accomplish this, authors propose to first train the generators and discriminators on lower resolution samples. During training they propose to progressively introduce new layers to increasingly learn on more complex problem of generating higher resolution images.
\begin{figure}
\centering
\includegraphics[width=.65\textwidth]{progan2}
\caption{Transition phase during growing of generator and discriminator networks under the progressive growing scheme.}
\label{fig:progan}
\end{figure}
As illustrated in Fig.~\ref{fig:progan}, successively new networks layers are introduced to generators and discriminators. The transition from one stage of training to another stage of training is made smooth by using linear interpolation during transition phase. The interpolation factor is then smoothly changed during training. At every stage, the output layer of the generator consists of a 1x1 convolutions that map feature channels to RGB image. Similarly, the first layer of discriminator consists of 1x1 convolutions that map RGB image to feature channels. During the transition step, a linear interpolation of output of 1x1 convolutions from lower resolution feature channels and 1x1 convolutions from higher resolution feature channels is taken as output of generator. The scalar factor $\alpha$ corresponding to output of higher resolution feature channels is smoothly increased from $0$ to $1$. Similarly, during transition, both higher resolution and downscaled images are provided as input to different input layers of discriminator. Learning on simpler problem and gradually increasing complexity of the problem for both discriminator and generator can be expected to lead to faster convergence and stability. Authors claim in the paper that the improvement with proposed training scheme is orthogonal to improvements arising from loss functions. The idea of progressive growing has not yet been applied to video generation. In this work, we explore progressively growing of video generative networks.
\section{Video GAN}
In \cite{vgan}, authors propose a parallel architecture for unsupervised video generation. The architecture consists of two parallel streams consisting of 2D and 3D convolution layers for the generator and single stream 3D convolution layers for discriminator. As illustrated in Figure~\ref{fig:videogan}, the two stream architecture was designed to untangle foreground and background in videos.
\begin{figure}[!ht]
\centering
\includegraphics[width=.75\textwidth]{videogan}
\caption{Two stream architecture of the generator of Video GAN. Video GAN assumes stable background in the video clips.}
\label{fig:videogan}
\end{figure}
If $0\leq m(z)\leq 1$ be the mask that selectes either foreground or background, the output of generator, $\mathcal{G}$, at pixel $z$ is given by:
\begin{equation}
\mathcal{G}(z)=m(z)\odot f(z) + (1-m(z))\odot b(z),
\end{equation}
where $b(z)$ is output of background stream and $f(z)$ is output of foreground stream. In case of background stream, the same value of $b(z)$ is replicated over all time frames. Experimental results presented by authors supports the use of two stream architecture. However, one of the strong assumptions of the model is that of static background.
\section{Temporal GAN}
In \cite{tgan}, authors propose a cascade architecture for unsupervised video generation. As illustrated in Fig.~\ref{fig:tgan}, the proposed architecture consisting of temporal and image generator. Temporal generator, which consists of 1-D deconvolution layers, maps input latent code to a set of new latent codes corresponding to frames in the video. Each new latent code and the original latent code together are then fed to a new image generator. The resulting frames are then concatenated together to obtain a video. For the discriminator, TGAN uses single stream 3D convolution layers.
\begin{figure}[!ht]
\centering
\includegraphics[width=.75\textwidth]{tgan}
\caption{Temporal GAN uses a cascade architecture to generate videos. Temporal generator uses 1-D deconvolutions and spatial generator uses 2-D deconvolutions.}
\label{fig:tgan}
\end{figure}
Unlike in the case of Video GAN, this model makes no assumption about separation of background and foreground stream. As such, no requirement on background stabilization of videos is assumed.
\section{MoCoGAN}
Motion Content GAN (MoCoGAN) network architecture is similar to TemporalGAN (TGAN) \cite{tgan} in the sense it also has cascade architecture. Furthermore, it also uses temporal and image generators and 3D convolution layers based discriminator. However, unlike TGAN, temporal generator on MoCoGAN is based on Recurrent Neural Network (RNN) and the input to temporal generator is a set of latent variables. Furthermore, the outputs of temporal generator, motion codes, are concatenated with newly sampled content code to feed image generators. In discriminator, there is an additional image based discriminator. The authors claim that using such architecture helps to separate motion and content from videos.
\section{Other Related Works}
Video Pixel Networks (VPN) \cite{vpn} build on the work of PixelCNNs \cite{pixelcnn} for future prediction. In particular, they estimate probability distribution of raw pixel values in video using resolution preserving CNN encoders and PixelCNN decoders. Other works for future prediction include \cite{lecun}. Recently, optical flow based models have produced more realistic results. In particular, in \cite{ftgan} authors use flow and texture GAN to model optical flow and texture in videos. Several of the works have also focused on future prediction which is a slightly different problem than unsupervised video generation\cite{ivgan}\cite{lecun}.
\chapter{Sliced Wasserstein GAN Loss}
As discussed earlier chapters, in \cite{wgan}, authors proposed to
approximate Wasserstein Distance (WD) using it's dual formulation. The dual formulation was obtained using Kantorovich-Rubinstein duality. Thus obtained formulation has form of a saddle-point problem and is usually difficult to optimize \cite{deshpande}. Instead of the above discussed formulation, Sliced Wasserstein Distance (SWD) can be used to measure the distance between two distributions. It was proven in \cite{bonnette} that SWD is equivalent to WD. To compute the SWD, the plane is sliced using lines passing through the origin and higher dimensional marginal distributions are projected onto these lines using Radon transform. The Radon transform is performed using orthogonal projection matrices.
\begin{figure}[!ht]
\centering
\includegraphics[width=.8\textwidth]{swd}
\label{fig:swgan}
\caption{Intuition behind Sliced Wasserstein Distance. After projection, the Wasserstein Distance of 1-D marginals is integrated over all possible values of $\theta$.}
\end{figure}
The required metric is then given by integral of the projections along all such lines. As the projected marginal distributions are one dimensional, the SWD takes the form of functional of 1-D WD. Since closed form solution of 1-D WD exists, approximating SWD becomes easier. Mathematically, the SWD as a functional of 1-D WD is given by
\begin{equation}
\int_{\mathbb{S}^{N-1}}
\left(\sup_{f \in \mathrm{L}^1} \mathbb{E}_{\bm{X}_{\theta} \sim P_{X_{\theta}}} [f(\bm{X}_{\theta})] - \mathbb{E}_{\bm{Y}_{\theta} \sim P_{Y_{\theta}}} [f(\bm{Y}_{\theta})]\right)
d \theta,
\label{eq:swd}
\end{equation}
where $L^1$ is the function space of all $1-$Lipschitz functions, $P_{X_\theta},P_{Y_\theta}$ are the projected marginal distributions discussed earlier. As the latent space is usually low-dimensional in GANs, it is implicitly assumed that the distribution of real samples lies on low-dimensional manifold. Hence, if $x=[x_1, x_2, \dots, x_n]\in\mathbb{R}^{N\times n}$ be $N$ dimensional $n$ input samples, using standard discriminator setting, input data is encoded to $K$ dimensional latent code $y = [y_1,y_2,\dots,y_n]\in \mathbb{R}^{K\times n} $. Then orthogonal transform matrices $\theta=[\theta_1,\theta_2,\dots,\theta_K]\in\mathbb{R}^{K\times K}$ are applied to project the $K-$dimensional encodings into $K$ one dimensional marginal distributions. The $k-$Lipschitz mapping function $f$ is given by:
\begin{equation}
f(\bm{y}) =
\begin{pmatrix}
\phi(\lambda_{1} (\bm{\theta}_1^T \bm{y}) + b_{1}) \\
\vdots \\
\phi(\lambda_{K} (\bm{\theta}_K^T \bm{y}) + b_{K})
\end{pmatrix},
\label{eq:orth}
\end{equation}
where $\theta_i$ are projection matrices defined earlier. $\phi$ is an activation function, $\lambda_i$ and $b_i$ are scalars.
In practice, we compute $f(\bm{y}) = \frac{1}{K}\sum_{i=1}^{K}(\phi(\lambda_{i} (\bm{\theta}_1^T \bm{y}) + b_{i}))$ to approximate the integral of Eq.~\ref{eq:swd}, and the mapping function of the discriminator is $D=f \circ E$.
To avoid gradient explosion and vanishing for $E$, we additionally imposing the gradient regularizer on it. The final objective function is given by:
\begin{equation}
\begin{aligned}
\min_{\mathcal{G}} \max_{D} & \, \mathbb{E}_{\bm{X} \sim \mathbb{P}_X} [D(\bm{X})] -\mathbb{E}_{{\bm{Z}} \sim \mathbb{P}_Z} [D(G(\bm{Z}))]
\\ & + \lambda_1 \mathbb{E}_{\bm{\hat{X}}
\sim P_{\hat{X}}}
[\|\nabla_{\bm{\hat{X}}} E(\bm{\hat{X}})\|_2^2]
\\ & + \lambda_2 \mathbb{E}_{\bm{\hat{Y}}
\sim P_{\hat{Y}}}
[(\|\nabla_{\bm{\hat{Y}}} f(\bm{\hat{Y}}))\|_2-k)^2],
\end{aligned}
\label{eq:swgan}
\end{equation}
where we sample the $\bm{\hat{X}}, \bm{\hat{Y}}$ based on \cite{iwgan}, where $\lambda_1, \lambda_2$ are the coefficients to balance the penalty terms. $\lambda_2$ is also used to absorb the scale $k$ caused by the $k$-Lipschitz constraint.
| {'timestamp': '2018-12-07T02:13:33', 'yymm': '1810', 'arxiv_id': '1810.02419', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02419'} | arxiv |
\section{Introduction}
Sound recognition (SR) is the art and science of having machine to identify sounds \citep{jurafsky2014speech}. These sounds could be much beyond than speech and music. Among others it includes such examples as barking dogs, breaking glasses, crying babies and etc. Sound recognition is a key strategic technology that will be embedded in most connected devices offering AI capabilities. For example, every one of us has come across smart-phones with mobile assistants such as Apple Siri, Amazon Alexa or Google Assistant. These applications are dominating and in a way invading human interactions. In addition, there have also been successful uses of voice controlled systems in both medicine and in education for blind and/or handicapped people \citep{okada1998single, mohamed2014educational}. In the nearest future we will see exponential growth of speech recognition embedded devices that will assist to our every day lives. It requires to develop and optimize sound recognition algorithms that need to be fast enough to work in real time and support many different embedded platforms \citep{solovyev2018fpga}.
Classical approaches in sound recognition system are based on understanding the components of human speech. A phoneme is a contrastive unit in the sound system that helps to distinguish between meanings of words from a set of similar sounds corresponding to it pronounced in one or more ways. For example the word ”speech” has the four phonemes: S P I CH \citep{lee1989speaker, gruhn2011statistical}. To find phonemes, speech signals are slowly timed where their characteristics are stationary over a short period of time. In the feature extraction step, acoustic observations are extracted in frames of typically 25 ms. For the acoustic samples in that frame, a multi-dimensional vector is calculated and on that vector a fast Fourier transformation is performed \citep{lee1989speaker, shrawankar2013techniques}, to transform a function of time, e.g. a signal in this case, into their frequencies. In the decoding process where calculations is made to find which sequence of words is the most probable match to the feature vectors. For this step, three things has to be present; an acoustic model with a hidden Markov model (HMM) for each unit (phoneme or word), a dictionary containing possible words and their phoneme sequences and a language model with words or word sequences likelihoods \citep{jurafsky2014speech}. Using neural networks as acoustic models for HMM-based speech recognition originally was introduced over 20 years ago \citep{bourlard2012connectionist, mcclelland1986trace}. Much of this original work developed the basic ideas of hybrid DNN-HMM systems which are used in modern, state-of-the-art automatic SR systems \citep{mohamed2012acoustic}. However, until recently, neural networks were not a standard tool in the real time automatic SR systems. Computational constraints and the amount of available training data severely limited the pace at which it was possible to make progress.
Recently, deep learning-based approaches demonstrated performance improvements over conventional machine learning methods for many different applications \citep{lecun2015deep}. The neural networks built with memory capabilities have made speech recognition 99 percent accurate \citep{hinton2012deep, lecun2015deep, goodfellow2016deep}. Neural networks like LSTMs have taken over the field of Natural Language Processing \citep{gers1999learning, graves2005framewise, greff2017lstm}. A person’s speech can also be understood and processed into text by storing the last word of the particular sentence which is fascinating \citep{van2016wavenet, abdel2014convolutional}. Even more the beautiful scientific results now have state-of-the-art applications to the whole process of sound recognition to machine translation \citep{wu2016google, amodei2016deep, bahdanau2014neural}.
In this paper, we consider several approaches based on deep learning to the problem of sound classification that we applied in TensorFlow Speech Recognition Challenge organized by Google Brain team on Kaggle platform \footnote{\url{https://www.kaggle.com/c/tensorflow-speech-recognition-challenge}}. Here we review 1D convolutional neural networks that uses raw sound files as an input and image-based convolutional neural networks using 2D representation of sounds via Spectrogram, Melgrams and MFCC. We also describe the details of our solution that allowed us to reach pretty good classification accuracy and finish the challenge on 8-th place among 1315 teams.
\begin{figure*}[!t]
\centering
\includegraphics[width=8cm]{./figures/data_set.png}
\caption{Distribution of sound commands in the train data set.}
\label{fig::data_set}
\end{figure*}
\section{Methods}
\subsection{Data set description and pre-processing}
The training data consists of 60,000 audio files separated by 32 directories with the folder name being the label of the audio clip \citep{warden2018speech}. There are less labels that need to be predicted (12 vs 32 in the train). The labels that should to be identified are \emph{yes}, \emph{no}, \emph{up}, \emph{down}, \emph{left}, \emph{right}, \emph{on}, \emph{off}, \emph{stop}, \emph{go}. Everything else should be considered either \emph{silence} or \emph{unknown} classes. The distribution of classes in the train data set is shown in Fig. \ref{fig::data_set}. Each audio file in the data set is 1-second-long clip of voice commands that is converted into a 16-bit little-endian PCM-encoded WAVE file at a 16000 sample rate. This data set is not completely cleaned up for us. For example, several files in the train data set are not exactly 1 second long. Moreover, there are no \emph{silence} files as such. In these cases we are provided by longer recordings with \emph{background\_noises} that we can split up into 1 second fragments. In addition, one can also mix background noises with word files to get some different augmentations for our sounds during training. The test data set contains an audio folder with 150,000+ files in the format $clip\_000044442.wav$. The task is to predict the correct label. Note that not all of the files are evaluated for the leader-board score.
In the train data set audio files are named so the first element is the subject id of the person who gave the voice command, and the last element indicated repeated commands. Repeated commands are when the subject repeats the same word multiple times. Subject id is not provided for the test data, and you can assume that the majority of commands in the test data were from subjects not seen in train \citep{warden2018speech}. The files contained in the training audio are not uniquely named across labels, but they are unique if you include the label folder. For example, $00f0204f\_nohash\_0.wav$ is found in 14 folders, but that file is a different speech command in each folder.
One important thing before training models - we need to clean up the data. There are files with pretty low sound volumes. Some of these files are corrupt and only contain noise while others are basically background noise without any spoken word. To remove or correctly re-label these files it helps to sort all files on a dynamic range of the output volume. Then find out if there is a threshold minimum sound level below which all files can be classified as silence. For better performance of the procedure one can manually double check the candidate through listening them and looking at spectrograms.
\begin{figure*}[!t]
\includegraphics[width=\linewidth]{./figures/sound_reprs.png}
\caption{Different representations of a sound command that corresponds to the word "Down" ($down/1e4064b8\_nohash\_0.wav$ from the train data set). (Upper-left) The sound signal is a one-dimensional time domain signal; (upper-right) Log-spectrogram using the STFT values with a window size of $25$ ms and step of $10$ ms; (bottom-left) Convert a power spectrogram (amplitude squared) to decibel (dB) units; (bottom-right) Mel-frequency spectral coefficients (MFCC).}
\label{fig::sound_repr}
\end{figure*}
\subsection{Sound representation}
Although deep learning approach eliminates the need for hand-engineered features, we need to choose a representation for our data. The sound signal is a one-dimensional time domain signal. It is difficult to find the rule of how the frequency changes. If we convert the sound signal to frequency domain via Fourier transform (FT), it will show the signal frequency distribution. But at the same time, its time domain information will be missing, making it impossible to see the change of frequency distribution over time. Many joint time-frequency analysis methods have emerged to solve this problem.
One of the the classic method for joint time-frequency analysis is the short-time Fourier transform (STFT). STFT is a mathematical transformation associated with FT to determine the frequency and phase of a sine wave in a local region of the time-varying signal. The concept of STFT is to first choose a window function with time-frequency localization. Then assume that the analysis window function $w(t)$ was stationary over a short time, which ensures $f(t)w(t)$ is a stationary signal within different finite time widths. STFT uses fixed window functions, the most commonly used include the Hanning window, the Hamming window, and the Blackman-Haris window \citep{jurafsky2014speech}. The Hamming window, a generalized cosine window, is used in this article. It is usually represented as
$$
w(t) = a_0+(1-a_0)\cos\left(\frac{2\pi t}{T}\right),\quad 0\le t\le T
$$
where $a_0 = 0.53836$. This function is a member of both the cosine-sum and power-of-sine families. The Hamming window can efficiently reflect the attenuation relationship between energy and time at a certain moment. We show the spectrogram logarithmic the STFT values with a window size of $20$ ms and step of $10$ ms in Fig. \ref{fig::sound_repr}. In addition, we convert a power spectrogram (amplitude squared) to decibel (dB) units. This computes the scaling $10 * log_{10}(S/ref)$ in a numerically stable way (Zeros in the output correspond to positions where $S=ref$).
Spectrograms are usually in the form of a large map. In order to turn the sound features into a suitable size, they often need to be transformed into Mel spectrum via Mel scale filter bank. The Mel spectrum is known that the unit of frequency is Hertz (Hz) and the frequency range of human hearing is $20-20000$ Hz. Human auditory perception does not relate to scale units such as Hz in a linear manner. For example, if we have adapted to a $1000$ Hz sound, then when sound frequency is increased to $2000$ Hz, our ears could only perceive that the frequency may be slightly increased, and we would not realize that the frequency has doubled. The mapping for converting an ordinary frequency scale to Mel-frequency scale is as follows \citep{deng2003speech}:
$$
mel(f) = 2595\,\log_{10}(1+f/700)=1127\,\ln(1+f/700)
$$
Here is a log relationship between Hz and Mel frequency. If the frequency is low, Mel-frequency will change rapidly with Hz otherwise if the frequency is high, Mel-frequency will change slowly. This shows that human ears are sensitive to low frequency sounds and less responsive to high frequency sounds.
Another well-known speech extraction is based on Mel-frequency Cepstral Coefficients (MFCC). This method is one of the most popular feature extraction techniques used in speech recognition based on frequency domain using the Mel scale. MFCC is a representation of the real cepstral of a windowed short-time signal derived from the fast FT of that signal. The difference from the real cepstral is that a nonlinear frequency scale is used, which approximates the behaviour of the auditory system. Additionally, these coefficients are robust and reliable to variations according to speakers and recording conditions \citep{dave2013feature}. MFCCs use Mel-scale filter bank where the higher frequency filters have greater bandwidth than the lower frequency filters, but their temporal resolutions are the same \cite{deng2003speech}. The last step is to calculate Discrete Cosine Transformation (DCT) of the outputs from the filter (see Fig. \ref{fig::sound_repr}).
\begin{figure*}[!t]
\centering
\includegraphics[width=\linewidth]{./figures/cnn1d.png}
\caption{Block schemes for VGG-like and ResNet-like 1D convolutional neural networks. Red rectangles represents feature maps while rectangles with other colors correspond to different operations. For VGG-like network the Block 2 contains 2 convolution layers with the same number of output filters. Every convolution operation has a kernel size 9. For this network we use ReLu activation function placed after Batchnorm operation. For the ResNet-like network the identity block is repeated several times depending on size of a feature map.}
\label{fig::cnn1d}
\end{figure*}
In classical, but still state-of-the-art systems, MFCC or similar features are taken as the input to the system instead of spectrograms. However, in end-to-end (often neural-network based) systems, the most common input features are probably raw spectrograms, or mel power spectrograms. For example MFCC decorrelates features, but neural networks deal with correlated features well. As a result, further we will use only raw wave signal for 1D convolution networks, log-spectrograms and mel power spectrograms as an input image for 2D networks. For this work we use scipy\footnote{\url{https://scipy.org/}} and librosa\footnote{\url{https://librosa.github.io/}} python libraries - this code is a standard one for conversion into spectrogram and the software is free to make modifications to suit the needs.
\subsection{1D convolutional neural networks}
Convolutional neural networks (CNN) have demonstrated remarkable success in many Visual Recognition Challenges \citep{shvets2018automatic, rakhlin2018deep, iglovikov2017pediatric}. Such 2D-CNNs learn to recognize the local structure within an image. Inspired by these successes, the hypothesis for this section is that a 1D-CNN will be able to recognize local structure in our time dependant signals. We consider two types of 1D CNN
adapted from 2D architectures: VGG \citep{simonyan2014vgg} amd ResNet \citep{he2016resnet} where as an input we use raw signal (see Fig. \ref{fig::cnn1d}). The first type is based on the VGG16 architecture when several convolutional layers alternate with Batchnorm and MaxPooling layers. Then, at the end two blocks of fully connected layers are placed. There are also several differences in comparison to standard VGG16 architecture for 2D images. For example, in the first two layers we use MaxPooling operation that reduce the size of the tensor by 4. It is done to faster reduce dimensionality of the problem. In addition, we have more pooling layers in comparison to 2D case, because the size of input vector is pretty high and we need to reduce it at the end of the network before classification block. As a result the spacial size of the feature map before flatten is equal to 16. In contrast to VGG16 we use single convolution block in the first two layers and then increase it to two consecutive blocks. For activation part we use ReLU activation function placed after Batchnorm operations. As kernel size, we took the value 9, which would be somewhat similar to 3x3 for the case of a two-dimensional convolution. But as far as we understand, it may well work with small values namely, just as 3. Dropout is also applied with the value of 0.5 at the end of the network within fully connected layers to prevent over-fitting.
Similarly to VGG16 we implemented ResNet34/ResNet50 for 1D case. As in the previous case here we also have convolution layers with kernel size equal to 9 for all layers apart from the fist one where the kernel size is equal to 80. In addition, all pooling layers have factor equal to 4. The details of the network are provided in Fig. \ref{fig::cnn1d}.
\subsection{2D convolutional neural networks}
In 2D case as an input for networks we use log-spectrograms and mel power spectrograms with a standard set of convolutional neural networks available in PyTorch\footnote{\url{https://pytorch.org/}} and Keras\footnote{\url{https://keras.io/}}. We utilize only subset of the networks namely \emph{VGG16}, \emph{VGG19}, \emph{ResNet50}, \emph{InceptionV3}, \emph{Xception}, \emph{InceptionResnetV2} (also shown in Fig.\ref{fig::ensemble}). One very important point is that fine-tuning was forbidden by the competition rules. As a result, here we train all the networks randomly initializing weights. Moreover, we train all of the networks using the same set of hyper-parameters excluding input size that is different.
\begin{figure*}[!t]
\includegraphics[width=\linewidth]{./figures/ensamble_max1.png}
\caption{2D convolution neural networks that we used in this work and their ensemble.}
\label{fig::ensemble}
\end{figure*}
\section{Results}
We train all models using 4fold cross validation. The data separated between folds by voice id. It means that the voice of one participant did not fall into different folds. Since it was known that in the test set all 12 classes were distributed approximately evenly, we generated each batch with the same number of instances from each class. And for simplicity we chose the size of the batch multiple of 12.
In speech recognition, data augmentation helps with generalizing models and making them robust against variations in speed, volume, pitch or background noise. In our case augmentations consisted of the following operations: 1) Random change of playback speed rate in the range 0.7 to 1.4; 2) Time shift by a random value in the range -0.1 to +0.1 second; 3) Add random noise from background noise from 0 to 0.05 of the maximum volume of the current waveform. Further, if wave frame was obtained more than the size of the input of a neural network, it was randomly cut off to the desired length. If it turned out less than the desired length, it was supplemented with zeros from the beginning. In 1D cases all audio files are vectors with a length of 16000. First we chose the value 3x4096 = 12288 as the input for the networks and randomly chose such a segment from 16000 as augmentations, but then we realized that most likely it negatively affects the accuracy. As a result the input for neural networks became a vector of length 4x4096 = 16384.
The quantitative comparison of our models' performance is presented in the Table\ref{table:results}. In this table we present classification accuracy for single network models as well as ensemble of all models for validation, public leader-board and private leader-board datasets. The validation results represent average between 4Folds. One can notice that all the models provide similar performance even those based on 1D convolution neural networks. The ensemble of the models performs better because it reduce variance between models and get rid of outliers. In our case we perform the ensemble as a mean of softmax probabilities. It can be done as a majority vote between the models but its performance is slightly worse. The difference in accuracy between validation and leader-board datastes could be understood if we consider confusion matrix. In such a case we can see that not unknown commands are predicted as unknown, and the predictions are pretty uncertain (0.25-0.4 for unknown, a little less for some other class). We can slighly improve the performance if we play with a threshold for the unknown class. In addition, the test data set contains many files that are purely labeled and said by id's not contained in the train data set. One of the way to improve the performance of the models is to enrich substantially the train dataset by many other examples and somehow improve the quality of signals.
\begin{table}[t!]
\caption{Classification accuracy (in $\%$) for validation (train), public leader-board (LB) and private LB for several convolution 1D/2D models and their ensemble. Inference time (Time) per image is measured in $ms$ using 1 card gtx 1080ti.}
\label{table:results}
\centering
\begin{tabular}{|c | c | c | c | c | c |}
\hline
Model & Resolutions & Valid. Acc. & Publ. & Priv. & Time \\
\hline
VGG-16,\,1D &1x16384& 93.4 & 86.2 & 86.6 & 0.66 \\
ResNet34,\,1D &1x16384& 96.4 & 87.6 & 88.0 & 0.82 \\
ResNet50,\,1D &1x16384& 96.6 & 87.9 & 88.6 & 1.72\\
VGG-16 & 241x49& 94.0 & 87.6 & 88.0 & 1.11\\
Xception &129x124& 93.9 & 87.4 & 87.9 & 1.71\\
VGG-16 &129x124& 94.4 & 87.7 & 88.1 & 1.22\\
ResNet50 &199x199& 94.2 & 87.5 & 87.9 & 3.19\\
InceptionResnetV2 &199x199& 93.5 & 87.7 & 88.0 & 5.97\\
InceptionV3 &139x139& 94.4 & 87.6 & 88.3 & 2.10\\
InceptionResnetV2 &139x139& 93.7 & 87.3 & 87.8 & 4.62\\
ResNet50 &224x224& 94.7 & 87.8 & 88.4 & 3.55\\
ResNet50,\, mel &199x199& 93.9 & 87.1 & 87.9 & 3.15\\
Ensemble &- & 98.5 & 90.0 & 90.6 &-\\
\hline
\end{tabular}
\end{table}
\section{Conclusions}
In this study we presented deep learning-based approach for speech command classification in TensorFlow Speech Recognition Challenge organized by Google Brain team on Kaggle platform. We showed different representation of sound command such as wave frames and spectrograms that are used as a input in 1D and 2D convolutional networks. The most popular approaches to this problem are based on fine-tuning of Imagenet networks, but we showed that approaches based on 1D convolutional networks provide very similar performance. This work can be further extended considering different recurrent neural networks architectures, their combinations with convolutional networks and/or siamese networks. Due to the similar performance between several models we can conclude that the data preparation plays a major role for further improvements. Therefore, with the understanding of how to process sound on a machine, one can also work on building their own sound classification systems. The general rule is when it comes to deep learning, the data is the key component. Larger the data, better the accuracy \citep{warden2018speech}.
\section*{Acknowledgment}
The authors would like to thank Open Data Science\footnote{\url{ods.ai}} and Kaggle\footnote{\url{https://www.kaggle.com/}} communities of great people and colleagues for many valuable discussions and educational help in the growing field of machine/deep learning.
| {'timestamp': '2018-10-08T02:00:22', 'yymm': '1810', 'arxiv_id': '1810.02364', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02364'} | arxiv |
\section{Introduction}\label{sec:intro}
This paper is about quantum analogues of Bayesian reasoning. It works
towards one main result, Theorem~\ref{thm:quantuminference} below,
which gives a relation between locally updating a joint state and
Bayesian inference. This is a fundamental matter, which requires some
preparation in order to set the scene.
We use the term `classical' probability for the ordinary, non-quantum
form. We often use the word `state' for a probability distribution,
both in the classical and the quantum case. Classical Bayesian
probability is based on what is called Bayes' rule. It describes
probabilities of events (evidence) in an updated state. In fact, there
are two closely related rules, sometimes called `product rule' en
`Bayes rule' (proper). Making this distinction is not so relevant in
the classical case, but, as we shall see, it is very relevant in the
quantum case.
The paper starts with the back-and-forth constructions between a joint
state (distribution) on the one hand, and a channel with an initial
state on the other. A channel is a categorical abstraction of a
conditional probability. We shall describe this process in terms of
pairing and disintegration, following~\cite{ChoJ17a}. This process has
a logical dimension that relates locally updating a joint state
(`crossover inference') and Bayesian inference via the associated
channel, in a result called the Bayesian Inference Theorem (see
Theorem~\ref{thm:classicalconditioning} below). This result is already
described in~\cite{ChoJ17a}, but is repeated here in more concrete
form, and illustrated with an example.
The second part of the paper is about analogues in the quantum world.
The constructions back-and-forth between a joint state and a channel
exist in the literature~\cite{LeiferS13} and are adapted to the
current context. What is new here is the quantum logical analogue of
this back-and-forth process. It is shown that updating a state with
new evidence, in the form of a predicate, splits in two operations,
which we call `lower' and `upper' conditioning. Both forms exist
already, but not as counterparts. We show that the earlier mentioned
product rule holds for lower conditioning, but Bayes' rule itself
holds for upper conditioning. In classical probability, the `lower'
and `upper' versions coincide.
In a next step, the main result of the paper
(Theorem~\ref{thm:quantuminference}) shows how `lower' updating a
joint state can equivalently be done via Bayesian inference with
`upper' conditioning, using the channel that is extracted from the
joint state. This puts lower and upper conditioning into perspective
and unveils some fundamental aspects of a quantum Bayesian theory.
Finally, there are two separate points worth emphasising. First, several
constructions in this paper are illustrated with concrete
calculations, via the Python-based tool EfProb~\cite{ChoJ17b}; it
works both for classical and quantum probability and uses a common
language for both. Next, along the way we find a novel result about
how disintegration introduces `semi' higher order structure in
discrete probability, see Subsection~\ref{subsec:excursion}.
\section{Basics of discrete classical probability}\label{sec:discrete}
This section recalls the basics of (classical, finite) discrete
probability and fixes notation. For more information we refer
to~\cite{Jacobs17a}. A \emph{distribution}, also called a
\emph{state}, on a set $X$ is a function $\omega\colon X \rightarrow
[0,1]$ with finite support $\mathrm{supp}(\omega) =
\setin{x}{X}{\omega(x) \neq 0}$ and with $\sum_{x}\omega(x) =
1$. Such a distribution can also be written as formal convex sum
$\omega = \sum_{x} \omega(x)\ket{x}$. We write $\distributionsymbol(X)$ for the
set of such distributions. The mapping $X\mapsto\distributionsymbol(X)$ is a
monad on the category of sets, called the distribution monad.
A \emph{joint} state is a state on an $n$-ary product set. A binary
state is thus a distribution $\tau\in\distributionsymbol(X_{1} \times X_{2})$. It has
first and second \emph{marginals}, written here as
$\mathsf{M}_{1}(\tau) \in \distributionsymbol(X_{1})$ and $\mathsf{M}_{2}(\tau)
\in\distributionsymbol(X_{2})$. These marginal states are defined in the standard way
as $\mathsf{M}_{1}(\tau)(x_{1}) = \sum_{x_{2}}\tau(x_{1}, x_{2})$ and
$\mathsf{M}_{2}(\tau)(x_{2}) = \sum_{x_{1}}\tau(x_{1}, x_{2})$. In the
other direction, two states $\omega_{i}\in\distributionsymbol(X_{i})$ can be combined
to product state $\omega_{1}\otimes\omega_{2}\in\distributionsymbol(X_{1}\times
X_{2})$ via $(\omega_{1}\otimes\omega_{2})(x_{1},x_{2}) =
\omega_{1}(x_{1}) \cdot \omega_{2}(x_{2})$. Obviously,
$\mathsf{M}_{i}(\omega_{1}\otimes\omega_{2}) = \omega_{i}$.
A \emph{channel} is a function of the form $c\colon X \rightarrow
\distributionsymbol(Y)$, that is, a map $X\rightarrow Y$ in the Kleisli category
$\mathcal{K}{\kern-.4ex}\ell(\distributionsymbol)$ of the distribution monad $\distributionsymbol$. Such a channel $c$ has a
\emph{Kleisli extension} function, or \emph{state transformer}, $c \gg
(-) \colon \distributionsymbol(X) \rightarrow \distributionsymbol(Y)$ given by $(c \gg \omega)(y) =
\sum_{x} \omega(x) \cdot c(x)(y)$. For another channel $d\colon Y
\rightarrow \distributionsymbol(Z)$ there is a composite channel $d \mathrel{\raisebox{.15em}{$\scriptscriptstyle\circledcirc$}} c \colon
X \rightarrow \distributionsymbol(Z)$ given by $(d \mathrel{\raisebox{.15em}{$\scriptscriptstyle\circledcirc$}} c)(x) = d \gg
c(x)$. Channels $c_{i} \colon X_{i} \rightarrow \distributionsymbol(Y_{i})$ can be
combined to a product channel $c_{1}\otimes c_{2} \colon X_{1}\times
X_{2} \rightarrow \distributionsymbol(Y_{1}\times Y_{2})$ by $(c_{1}\otimes
c_{2})(x_{1}, x_{2}) = c_{1}(x_{1})\otimes c_{2}(x_{2})$.
A (fuzzy) predicate on a set $X$ is a function $p\colon X \rightarrow
[0,1]$. For another predicate $q\in [0,1]^{X}$ there is a (sequential)
conjunction predicate $p\mathrel{\&} q$ on $X$ via $(p\mathrel{\&} q)(x) =
p(x)\cdot q(x)$. For two predicates $p_{i} \in [0,1]^{X_i}$ on
different sets $X_{i}$ we can form a parallel conjunction predicate
$p_{1}\otimes p_{2} \in [0,1]^{X_{1}\times X_{2}}$, given by
$(p_{1}\otimes p_{2})(x_{1},x_{2}) = p_{1}(x_{1}) \cdot
p_{2}(x_{2})$. There is always a truth channel $\ensuremath{\mathbf{1}} \in [0,1]^{X}$
given by $\ensuremath{\mathbf{1}}(x) = 1$.
For a state $\omega\in\distributionsymbol(X)$ and a predicate $p\in [0,1]^{X}$ on the
same set $X$ the validity $\omega\models p$ in $[0,1]$ is the expected
value $\sum_{x} \omega(x) \cdot p(x)$. If this validity is non-zero,
one can form a conditioned state $\omega|_{p}$ on $X$, given by
$\omega|_{p}(x) = \frac{\omega(x)\cdot p(x)}{\omega\models p}$. This
updated state $\omega|_{p}$ is called `$\omega$ given $p$', and is
commonly written as $\omega(-|p)$. It is easy to check to see that
conditioning with truth does nothing: $\omega|_{\ensuremath{\mathbf{1}}} = \omega$.
\begin{proposition}
\label{prop:classicalbayes}
Assuming the conditionings of the states below exist, we have the
`product' rule on the left, and the `Bayesian' rule on the right:
\begin{equation}
\label{eqn:classicalbayes}
\begin{array}{rclcrcl}
\omega|_{p} \models q
& = &
\displaystyle\frac{\omega\models p\mathrel{\&} q}{\omega\models p}
& \hspace*{5em} &
\omega|_{p} \models q
& = &
\displaystyle\frac{(\omega|_{q}\models p)\cdot(\omega\models q)}{\omega\models p}.
\end{array}
\end{equation}
\noindent Moreover, successive conditioning can be reduced to a
single conditioning, as on the left below, so that conditioning becomes
commutative, as on the right:
\begin{equation}
\label{eqn:classicalsuccesiveconditioning}
\begin{array}{rclcrcl}
(\omega|_{p})|_{q}
& = &
\omega|_{p\mathrel{\&} q}
& \hspace*{5em} &
(\omega|_{p})|_{q}
& = &
(\omega|_{q})|_{p}.
\end{array}
\end{equation}
\end{proposition}
\begin{myproof}
The first equation in~\eqref{eqn:classicalbayes} follows simply by
unravelling the definitions. The second equation directly follows from
the first one, using that conjunction $\mathrel{\&}$ is
commutative. Similarly one obtains the equations
in~\eqref{eqn:classicalsuccesiveconditioning}. \hspace*{\fill}$\QEDbox$
\end{myproof}
Each channel $c \colon X \rightarrow \distributionsymbol(Y)$ also gives rise to a
\emph{predicate transformer} function $c \ll (-) \colon [0,1]^{Y}
\rightarrow [0,1]^{X}$, given by $(c \ll q)(x) = \sum_{y} c(x)(y)\cdot
q(y)$. We can now relate validity $\models$ and state/predicate
transformation ($\gg$ and $\ll$) via the following fundamental
equality of validities:
\begin{equation}
\label{eqn:classicalvaliditytransformation}
\begin{array}{rcl}
(c \gg \omega) \models q
& \;=\; &
\omega \models (c \ll q).
\end{array}
\end{equation}
\section{Classical Bayesian nets and disintegration}\label{sec:disintegration}
A major rationale for using Bayesian
networks~\cite{Pearl88,BernardoS00,Barber12,KollerF09} is efficiency
of representation: a joint probability distribution (state) on
multiple sample spaces (domains) quickly becomes very
large. Representing the same distribution in graphical form, as a
`Bayesian network' is often much more efficient. The directed graph
structure is determined by conditional independence. Semantically, the
directed arcs are given by channels, that is by stochastic matrices,
or more abstractly by Kleisli morphisms for the distribution
monad~\cite{Fong12,JacobsZ16,JacobsZ17}.
The essence of this semantical view on Bayesian network theory
consists of two parts.
\begin{enumerate}[label=(\Roman*)]
\item \label{essencebayesjoint} The ability to move back-and-forth
between a joint state and a graph (network) of channels. The
difficult direction is extracting the various channels of the graph
from a joint state. This is often called
\emph{disintegration}~\cite{ChoJ17a}.
\item \label{essencebayesinference} Equivalence of inference via joint
states and inference via associated channels. In general, inference
(or, Bayesian learning) happens via conditioning (updating,
revising) of states, in the light of evidence given by
predicates. Inference involves the propagation of such conditioning
via joint states and/or via channels, via the bank-and-forth
connections in~\ref{essencebayesjoint}, both in a forward and
backward direction (as in~\cite{JacobsZ16,JacobsZ18}).
\end{enumerate}
\noindent Point~\ref{essencebayesjoint} is well-known, but
point~\ref{essencebayesinference} is usually left implicit; it is
however a crucial part of why efficient representation of (big) joint
states as Bayesian network graphs can be used for Bayesian
reasoning. In this section we briefly elaborate both points below, and
illustrate them with an example.
Note that we do not claim that with these two
points~\ref{essencebayesjoint} and~\ref{essencebayesinference} we
capture all essentials of Bayesian network theory: \textit{e.g.}, we
do not address the matter of \emph{how} to turn a joint state into a
graph, via conditional independence or via causality. This question
has also be studied in a quantum setting, see
\textit{e.g.}~\cite{PienaarB15}.
\subsection{Disintegration}\label{subsec:disintegration}
\begin{wrapfigure}[5]{r}{0pt}
\begin{minipage}{11em}\centering
\vspace*{-1.5em}
\begin{equation}
\label{diag:pairing}
\hspace*{-1em}\ensuremath{\mathrm{pair}}(\omega,c)
\coloneqq
\vcenter{\hbox{%
\begin{tikzpicture}[font=\small,scale=0.7]
\node[state] (s) at (0,0) {$\omega$};
\node[copier] (copier) at (0,0.3) {};
\node[arrow box] (c) at (0.5,0.95) {$c$};
\coordinate (X) at (-0.5,1.5);
\coordinate (Y) at (0.5,1.5);
\draw (s) to (copier);
\draw (copier) to[out=150,in=-90] (X);
\draw (copier) to[out=15,in=-90] (c);
\draw (c) to (Y);
\end{tikzpicture}}}
\end{equation}
\end{minipage}
\end{wrapfigure}
Abstractly, point~\ref{essencebayesjoint} involves the correspondence
between a joint state on the one hand, and a channel and a (single)
state on the other hand. In one direction this is easy: given a state
$\omega$ on $X$ and a channel $c\colon X \rightarrow Y$ we can form a
joint state on $X\times Y$, namely as: $\ensuremath{\mathrm{pair}}(\omega, c) \coloneqq
\big((\idmap\otimes c) \mathrel{\raisebox{.15em}{$\scriptscriptstyle\circledcirc$}} \Delta\big) \gg \omega$, where $\Delta
\colon X \rightarrow X\times X$ is the copier channel with $\Delta(x)
= 1\ket{x,x}$. This construction is drawn as a picture on the
right~\eqref{diag:pairing}, using the graphical language associated
with monoidal categories. It will be used here only as illustration,
hopefully in an intuitive self-explanatory manner. We refer
to~\cite{Selinger11,CoeckeK16,ChoJ17a} for details.
\begin{wrapfigure}[6]{r}{0pt}
\begin{minipage}{13em}\centering
\begin{equation}
\label{diag:disintegration}
\vcenter{\hbox{%
\begin{tikzpicture}[font=\small,scale=0.7]
\node[state] (omega) at (0,0) {$\,\;\tau\;\,$};
\coordinate (X) at (-0.4,0.55) {};
\coordinate (Y) at (0.4,0.55) {};
\draw (omega) ++(-0.4, 0) to (X);
\draw (omega) ++(0.4, 0) to (Y);
\end{tikzpicture}}}
\;
=
\;
\vcenter{\hbox{%
\begin{tikzpicture}[font=\small]
\node[state] (omega) at (0.25,0) {$\,\;\tau\;\,$};
\node[copier] (copier) at (0,0.4) {};
\node[arrow box] (c) at (0.5,0.95) {$c$};
\coordinate (X) at (-0.5,1.5);
\coordinate (Y) at (0.5,1.5);
\coordinate (omega1) at ([xshiftu=-0.25]omega);
\coordinate (omega2) at ([xshiftu=0.25]omega);
\node[discarder] (d) at ([yshiftu=0.2]omega2) {};
\draw (omega1) to (copier);
\draw (omega2) to (d);
\draw (copier) to[out=150,in=-90] (X);
\draw (copier) to[out=15,in=-90] (c);
\draw (c) to (Y);
\end{tikzpicture}}}
\end{equation}
\end{minipage}
\end{wrapfigure}
Going in the other direction, from a joint state to a channel is less
trivial. It is called \emph{disintegration} \textit{e.g.}
in~\cite{ChoJ17a}. It involves a joint state $\tau$ on $X,Y$ from
which a channel $c\colon X \rightarrow Y$ is extracted, in such a way
that $\tau$ itself can be reconstructed from its first marginal
$\mathsf{M}_{1}(\tau)$ and the channel $c$. Pictorially this marginal
is represented by blocking its second wire via the ground symbol
$\ground$. We write $\ensuremath{\mathrm{extr}}(\tau)$ for this extracted channel
$c$. Then we can write Equation~\eqref{diag:disintegration} as $\tau =
\ensuremath{\mathrm{pair}}\big(\mathsf{M}_{1}(\tau), \ensuremath{\mathrm{extr}}(\tau)\big)$.
\begin{lemma}
\label{lem:disintegration}
Extracted channels $\ensuremath{\mathrm{extr}}(\tau)$ exist and are unique in classical
discrete probability, for joint states $\tau$ whose first marginal has
full support.
\end{lemma}
\begin{myproof}
First, a state $\omega\in\distributionsymbol(X)$ and a channel $c\colon X \rightarrow
\distributionsymbol(Y)$ yield a joint state $\ensuremath{\mathrm{pair}}(\omega, c) \in \distributionsymbol(X\times Y)$,
namely, as described in~\eqref{diag:pairing} above:
\[ \begin{array}{rcccl}
\ensuremath{\mathrm{pair}}(\omega, c)(x,y)
& = &
\big(((\idmap\otimes c) \mathrel{\raisebox{.15em}{$\scriptscriptstyle\circledcirc$}} \Delta) \gg \omega\big)(x,y)
& = &
\omega(x) \cdot c(x)(y).
\end{array} \]
\noindent In the other direction, let $\tau\in\distributionsymbol(X\times Y)$ be a
joint state whose first marginal $\mathsf{M}_{1}(\tau) \in \distributionsymbol(X)$ has
full support. The latter means that its support is the whole of $X$,
so that: $\mathsf{M}_{1}(\tau)(x) \neq 0$ for each $x$, or,
equivalently, $\all{x}{\ex{y}{\tau(x,y)\neq 0}}$. We can now define a
channel $\ensuremath{\mathrm{extr}}(\tau) \colon X \rightarrow \distributionsymbol(Y)$ by:
\[ \begin{array}{rcccl}
\ensuremath{\mathrm{extr}}(\tau)(x)(y)
& = &
\displaystyle\frac{\tau(x,y)}{\mathsf{M}_{1}(\tau)(x)}
& = &
\displaystyle\frac{\tau(x,y)}{\sum_{z} \tau(x,z)}.
\end{array} \eqno{\square} \]
\end{myproof}
For a more systematic, diagrammatic description of disintegration,
also for continuous probability, we refer to~\cite{ChoJ17a}. Here we
only need it for discrete probability, as a preparation for the
quantum case.
\subsection{Excursion on disintegration and
semi-exponentials}\label{subsec:excursion}
We conclude this part on disintegration with a novel observation. It
is interesting in itself, but it does not play a role in the
sequel. It shows that disintegration gives rise to higher order
`semi-exponential' structure, originally introduced
in~\cite{Hayashi85}. Recall that a categorical description of a
(proper) exponential in a cartesian closed category involves exponent
objects $Y^X$ with an evaluation map $\mathrm{ev} \colon Y^{X} \times X
\rightarrow Y$ such that for each map $f\colon Z\times X \rightarrow
Y$ there is an abstraction map $\Lambda(f) \colon Z \rightarrow
Y^{X}$. These $\mathrm{ev}$ and $\Lambda$ should satisfy:
\begin{equation}
\label{eqn:exponential}
\begin{array}{rclcrclcrcl}
\mathrm{ev} \mathrel{\circ} (\Lambda(f)\times\idmap)
& = &
f
& \qquad &
\Lambda(f \mathrel{\circ} (g\times\idmap))
& = &
\Lambda(f) \mathrel{\circ} g
& \qquad &
\Lambda(\mathrm{ev})
& = &
\idmap.
\end{array}
\end{equation}
\noindent The last two equations ensure that $\Lambda(f)$ is the
unique map $h$ with $\mathrm{ev} \mathrel{\circ} (h\times\idmap) = f$, since: $h =
\idmap \mathrel{\circ} h = \Lambda(\mathrm{ev}) \mathrel{\circ} h = \Lambda(\mathrm{ev} \mathrel{\circ}
(h\times\idmap)) = \Lambda(f)$.
For a \emph{semi-exponential}, the last equation
in~\eqref{eqn:exponential} need not hold. A semi-exponential is thus
more than a `weak' exponential (only the first equation) since it also
satisfies naturality (the second equation). In the language of the
$\lambda$-calculus, having `semi-exponentials' means that one has a
$\beta$-equation, but not an $\eta$-equation, see~\cite{Hayashi85}
or~\cite{HoofmanM95} for more details.
\begin{theorem}
\label{thm:semiexponential}
Let $\mathcal{K}{\kern-.4ex}\ell_{\mathsf{f}}(\distributionsymbol)$ be the subcategory of the Kleisli
category $\mathcal{K}{\kern-.4ex}\ell(\distributionsymbol)$ of the distribution monad on $\Cat{Sets}$ with only
\emph{finite} sets as objects. This category $\mathcal{K}{\kern-.4ex}\ell_{\mathsf{f}}(\distributionsymbol)$
is symmetric monoidal `semi' closed: it has semi-exponentials, which
are semi-right adjoint to the (standard) tensor product.
\end{theorem}
\begin{myproof}
It is well-known that cartesian products $\times$ on sets and parallel
product $\otimes$ on Kleisli maps (channels) makes the category
$\mathcal{K}{\kern-.4ex}\ell(\distributionsymbol)$, and also $\mathcal{K}{\kern-.4ex}\ell_{\mathsf{f}}(\distributionsymbol)$, symmetric monoidal
closed. We sketch how semi-exponentials $\multimap$ are obtained via
joint states whose first marginal has full support:
\[ \begin{array}{rcl}
X \multimap Y
& \coloneqq &
\setin{\tau}{\distributionsymbol(X\times Y)}{\mathrm{supp}\big(\mathsf{M}_{1}(\tau)\big) = X}.
\end{array} \]
\noindent This definition assumes that $X$ is not the empty set. In
that case we can set $\emptyset\multimap Y = 1$, the singleton set,
since $Z\times \emptyset \cong \emptyset$ so that there is a trivial
correspondence between maps $Z\times\emptyset\rightarrow\distributionsymbol(Y)$ and
maps $Z \rightarrow \distributionsymbol(1) = 1$.
We define an evaluation channel $\mathrm{ev} \colon (X\multimap Y)\times X
\rightarrow \distributionsymbol(Y)$ via disintegration:
\[ \begin{array}{rcccl}
\mathrm{ev}(\tau, x)(y)
& \coloneqq &
\ensuremath{\mathrm{extr}}(\tau)(x)(y)
& = &
\displaystyle\frac{\tau(x,y)}{\sum_{z}\tau(x,z)}.
\end{array} \]
\noindent For abstraction, let $f\colon Z\times X \rightarrow \distributionsymbol(Y)$
be given. We define $\Lambda(f) \colon Z \rightarrow \distributionsymbol(X\multimap
Y)$ as:
\[ \begin{array}{rclcrcl}
\Lambda(f)(z)
& \coloneqq &
1\bigket{\tau}
&\qquad \mbox{where} \qquad &
\tau(x,y)
& = &
\displaystyle\frac{f(z,x)(y)}{\# X},
\end{array} \]
\noindent and where $\# X$ is the number of elements in $X$. Here we
construct a joint state $\tau = \ensuremath{\mathrm{pair}}(\ensuremath{\mathsf{unif}}, f(z, -))$ as in the
beginning of this section, from the uniform distribution $\ensuremath{\mathsf{unif}}$ on
$X$ and the channel $f(z,-)\colon X \rightarrow \distributionsymbol(Y)$. We need to
check that $\Lambda(f)$ is well-defined, in particular that each first
marginal of $\Lambda(f)(z)(*) \in \distributionsymbol(X\times Y)$ has full support:
\[ \begin{array}{rcccccccl}
\mathsf{M}_{1}(\Lambda(f)(z)(*))(x)
& = &
\sum_{y} \Lambda(f)(z)(*)(x,y)
& = &
\sum_{y} \frac{f(z,x)(y)}{\# X}
& = &
\frac{1}{\# X}
& \neq &
0.
\end{array} \]
\noindent It is easy to check that the first two equations
from~\eqref{eqn:exponential} hold. \hspace*{\fill}$\QEDbox$
\auxproof{
We first check that the construction of $\tau$ is indeed a pair,
see the first equation in the proof of Lemma~\ref{lem:disintegration}:
\[ \begin{array}{rcccccl}
\ensuremath{\mathrm{pair}}(\ensuremath{\mathsf{unif}}, f(z,-))(x,y)
& = &
\ensuremath{\mathsf{unif}}(x) \cdot f(z,x)(y)
& = &
\displaystyle\frac{f(z,x)(y)}{\# X}
& = &
\tau(x,y).
\end{array} \]
\noindent Next we look at the required equations:
\[ \begin{array}{rcl}
\big(\mathrm{ev} \mathrel{\raisebox{.15em}{$\scriptscriptstyle\circledcirc$}} (\Lambda(f) \otimes\idmap)\big)(z,x)(y)
& = &
\mathrm{ev}(\Lambda(f)(z)(*), x)(y)
\\
& = &
\displaystyle\frac{\Lambda(f)(z)(x,y)}{\sum_{y'}\Lambda(f)(z)(x,y')}
\\
& = &
\displaystyle\frac{\nicefrac{f(z,x)(y)}{\# X}}
{\sum_{y'}\nicefrac{f(z,x)(y')}{\# X}}
\\
& = &
f(z,x)(y).
\end{array} \]
\noindent Next, for $g\colon W \rightarrow \distributionsymbol(Z)$,
\[ \begin{array}{rcl}
\Lambda(f \mathrel{\raisebox{.15em}{$\scriptscriptstyle\circledcirc$}} (g\otimes\idmap))(w)(*)(x,y)
& = &
\displaystyle\frac{(f \mathrel{\raisebox{.15em}{$\scriptscriptstyle\circledcirc$}} (g\otimes\idmap))(w,x)(y)}{\# X}
\\
& = &
\displaystyle\frac{\sum_{z} g(w)(z) \cdot f(z,x)(y)}{\# X}
\\
& = &
\sum_{z} g(w)(z) \cdot \displaystyle\frac{f(z,x)(y)}{\# X}
\\
& = &
\sum_{z} g(w)(z) \cdot \Lambda(f)(z)(*)(x,y)
\\
& = &
\big(\Lambda(f) \mathrel{\raisebox{.15em}{$\scriptscriptstyle\circledcirc$}} g\big)(w)(*)(x,y).
\end{array} \]
}
\end{myproof}
\subsection{Bayesian inference and disintegration}\label{subsec:inference}
We now turn to the second point~\ref{essencebayesinference} from the
very beginning of this section, about Bayesian inference, especially
in relation to the passage back-and-forth between joint states and
channels via pairing and extraction, as just described.
It may happen that a joint state $\tau\in\distributionsymbol(X\times Y)$ is equal to
the product of its two marginals, \textit{i.e.}~$\tau =
\mathsf{M}_{1}(\tau) \otimes \mathsf{M}_{2}(\tau)$. The state $\tau$ is
then called \emph{non-entwined}. The more common case is that a joint
state is entwinted, and its marginal components are correlated. If we
then update in one component, we see a change in the other
component. This is called \emph{crossover influence}
in~\cite{JacobsZ17,JacobsZ18}.
The essence of the point~\ref{essencebayesinference}, in the beginning
of this section, about inference and disintegration is that for a
joint state $\tau$, this crossover influence can be propagated through
the channel $c$ that is extracted from the state $\tau$ via
disintegration. This is expressed in the next result, called the
\emph{Bayesian Inference Theorem}.
\begin{theorem}
\label{thm:classicalconditioning}
Let $\tau\in\distributionsymbol(X\times Y)$ be a joint state, and $c = \ensuremath{\mathrm{extr}}(\tau)
\colon X \rightarrow \distributionsymbol(Y)$ the extracted channel obtained via
disintegration --- as described in
Subsection~\ref{subsec:disintegration}. For predicates $p\in
[0,1]^{X}$ and $q\in [0,1]^{Y}$ we then have:
\begin{equation}
\label{eqn:classicalconditioning}
\begin{array}{rclcrcl}
\mathsf{M}_{2}\big(\tau|_{p\otimes\ensuremath{\mathbf{1}}}\big)
& = &
c \gg \big(\mathsf{M}_{1}(\tau)\big|_{p}\big)
& \qquad\mbox{and}\qquad &
\mathsf{M}_{1}\big(\tau|_{\ensuremath{\mathbf{1}}\otimes q}\big)
& = &
\mathsf{M}_{1}(\tau)\big|_{c \ll q}.
\end{array}
\end{equation}
\end{theorem}
The first equation describes crossover inference on the left-hand-side
as \emph{forward} inference on the right: first update and then do
state transformation $\gg$. The second equation
in~\eqref{eqn:classicalconditioning} describes crossover inference in
the other component as \emph{backward} inference: first do predicate
transformation $\ll$ and then update. The terminology of `forward' and
`backward' inference comes from~\cite{JacobsZ16}, see
also~\cite{JacobsZ18}. An abstract graphical proof of the
equations~\eqref{eqn:classicalconditioning} is given
in~\cite{ChoJ17a}. But it is not hard to prove these equations
concretely, by unwrapping the definitions.
\auxproof{
\begin{proof}
Essentially this is a matter of unwrapping the relevant definitions.
We do the first case:
\[ \begin{array}[b]{rcl}
\big(c \gg ((\marg{\tau}{[1,0]})|_{p})\big)(y)
& = &
{\displaystyle\sum}_{x} c(x)(y) \cdot ((\marg{\tau}{[1,0]})|_{p})(x)
\\[+0.2em]
& = &
{\displaystyle\sum}_{x} c(x)(y) \cdot \displaystyle
\frac{(\marg{\tau}{[1,0]})(x)\cdot p(x)}{\marg{\tau}{[1,0]}\models p}
\\[+0.8em]
& \smash{\stackrel{\eqref{diag:disintegration}}{=}} &
{\displaystyle\sum}_{x} \displaystyle
\frac{\tau(x,y)\cdot p(x)}{\sum_{x'}(\marg{\tau}{[1,0]})(x')\cdot p(x')}
\\[+0.8em]
& = &
{\displaystyle\sum}_{x} \displaystyle
\frac{\tau(x,y)\cdot (p\otimes\ensuremath{\mathbf{1}})(x,y)}{\sum_{x',y'}(\tau(x',y')\cdot p(x')}
\\[+0.8em]
& = &
{\displaystyle\sum}_{x} \displaystyle
\frac{\tau(x,y)\cdot (p\otimes\ensuremath{\mathbf{1}})(x,y)}{\tau \models p\otimes\ensuremath{\mathbf{1}}}
\\[+0.6em]
& = &
{\displaystyle\sum}_{x} \tau|_{p\otimes\ensuremath{\mathbf{1}}}(x,y)
\\[+0.2em]
& = &
\big(\marg{(\tau|_{p\otimes\ensuremath{\mathbf{1}}})}{[0,1]}\big)(y).
\end{array} \eqno{\square} \]
\auxproof{
\[ \begin{array}{rcl}
\big((\marg{\tau}{[1,0]})|_{c \ll q}\big)(x)
& = &
\displaystyle\frac{(\marg{\tau}{[1,0]})(x) \cdot (c \ll q)(x)}
{\marg{\tau}{[1,0]} \models c \ll q}
\\[+0.8em]
& = &
{\displaystyle\sum}_{y} \displaystyle
\frac{(\marg{\tau}{[1,0]})(x) \cdot c(x)(y) \cdot q(y)}
{\sum_{x'} (\marg{\tau}{[1,0]})(x') \cdot (c \ll q)(x')}
\\[+0.8em]
& \smash{\stackrel{\eqref{diag:disintegration}}{=}} &
{\displaystyle\sum}_{y} \displaystyle
\frac{\tau(x,y) \cdot q(y)}
{\sum_{x',y'} (\marg{\tau}{[1,0]})(x') \cdot c(x')(y') \cdot q(y')}
\\[+0.8em]
& \smash{\stackrel{\eqref{diag:disintegration}}{=}} &
{\displaystyle\sum}_{y} \displaystyle
\frac{\tau(x,y) \cdot q(y)}{\sum_{x',y'}\tau(x',y') \cdot q(y')}
\\[+0.8em]
& = &
{\displaystyle\sum}_{y} \displaystyle
\frac{\tau(x,y) \cdot (\ensuremath{\mathbf{1}}\otimes q)(x,y)}{\tau \models \ensuremath{\mathbf{1}}\otimes q}
\\[+0.8em]
& = &
{\displaystyle\sum}_{y} \tau|_{(\ensuremath{\mathbf{1}}\otimes q)}(x,y)
\\[+0.2em]
& = &
\big(\marg{\tau|_{(\ensuremath{\mathbf{1}}\otimes q)}}{[1,0]}(x).
\end{array} \]
}
\end{proof}
}
\subsection{An illustration of inference in a classical
Bayesian network}\label{subsec:smoking}
We consider the relation between smoking and the presence of ashtrays
and (lung) cancer, in the following simple Bayesian network.
\[ \[email protected]@R-1.5pc{
{\setlength\tabcolsep{0.2em}\renewcommand{\arraystretch}{1}
\begin{tabular}{|c|c|}
\hline
smoking & $\mathop{\mathsf{P}}(\text{ashtray})$ \\
\hline\hline
$t$ & $0.95$ \\
\hline
$f$ & $0.25$ \\
\hline
\end{tabular}}
& \ovalbox{\strut ashtray} & & \ovalbox{\strut cancer} &
{\setlength\tabcolsep{0.2em}\renewcommand{\arraystretch}{1}
\begin{tabular}{|c|c|}
\hline
smoking & $\mathop{\mathsf{P}}(\text{cancer})$ \\
\hline\hline
$t$ & $0.4$ \\
\hline
$f$ & $0.05$ \\
\hline
\end{tabular}}
\\
\\
& & \ovalbox{\strut smoking}\ar[uul]_{a}\ar[uur]^{c}
\rlap{\quad\smash{\setlength\tabcolsep{0.2em}\renewcommand{\arraystretch}{1}
\begin{tabular}{|c|}
\hline
$\mathop{\mathsf{P}}(\text{smoking})$ \\
\hline\hline
$0.3$ \\
\hline
\end{tabular}}}
}\]
\noindent Thus, 95\% of people who smoke have an ashtray in their
home, and 25\% of the non-smokers too. On the right we see that in
this situation a smoker has 40\% chance of developing cancer, whereas
a non-smoker only has 5\% chance.
The question we want to address is: what is the influence of the
presence or absence of an ashtray on the probability of developing
cancer? Here the presence/absence of the ashtray is the `evidence',
whose influence is propagated through the network. We shall describe
the outcome using the EfProb tool~\cite{ChoJ17b}, concentrating on
evidence propagation, and not so much on the precise representation of
the above network, using channels \pythoninline{a} and
\pythoninline{c} associated with the conditional probability tables.
We first consider the prior probabilities of smoking,
ashtray, and cancer:
\begin{python}
>>> smoking
0.3|t> + 0.7|f>
>>> a >> smoking
0.46|t> + 0.54|f>
>>> c >> smoking
0.155|t> + 0.845|f>
\end{python}
\noindent The network gives rise to a joint state, by tupling the
ashtray, identity and cancer channels, and applying them to the
\pythoninline{smoking} state. We can then obtain the above three
prior probabilities alternatively via three marginalisations of this
joint state, namely as first, second, third marginals, by using in
EfProb the corresponding masks \pythoninline{[1,0,0]},
\pythoninline{[0,1,0]}, \pythoninline{[0,0,1]} after the
marginalisation sign \pythoninline{\%}.
\begin{python}
>>> joint = (a @ idn(bnd) @ c) * copy(bnd,3) >> smoking
>>> joint
0.114|t,t,t> + 0.171|t,t,f> + 0.00875|t,f,t> + 0.166|t,f,f>
+ 0.006|f,t,t> + 0.009|f,t,f> + 0.0263|f,f,t> + 0.499|f,f,f>
>>> joint
0.46|t> + 0.54|f>
>>> joint
0.3|t> + 0.7|f>
>>> joint
0.155|t> + 0.845|f>
\end{python}
\noindent We now wish to infer the (adapted) cancer probability when
we have evidence of ashtrays. We shall do this in two ways, first via
crossover inference using the above joint state. The ashtray evidence
\pythoninline{tt} needs to be extended (weakened) to a predicate with
the same domain as the joint state. In the
Equations~\eqref{eqn:classicalconditioning} this is written as:
$p\otimes\ensuremath{\mathbf{1}}$, but in EfProb it is: \pythoninline{tt @ truth(bnd) @
truth(bnd)}. We first use this predicate for updating the joint
state, written as \pythoninline{/} in EfProb, and then we marginalise
to obtain the third `cancer' component that we are interested in:
\begin{python}
>>> (joint / (tt @ truth(bnd) @ truth(bnd)))
0.267|t> + 0.733|f>
\end{python}
\noindent Alternatively we can compute this posterior cancer
probability by following the graph structure. The ashtray evidence
\pythoninline{tt} is now first turned into predicate \pythoninline{a
<< tt} on the state \pythoninline{smoking}. After updating this
state, we transform it to an updated cancer probability, via state
transformation \pythoninline{>>}. We can do this down-and-up
propagation in one go:
\begin{python}
>>> c >> (smoking / (a << tt))
0.267|t> + 0.733|f>
\end{python}
\noindent The fact that we get the same distribution is an instance of
the equations~\eqref{eqn:classicalconditioning}. As expected, in
presence of ashtrays the probability of cancer is higher.
Aside: clearly, ashtrays \emph{influence} (the probability of) cancer,
but they are not the \emph{cause}; in the graph this influence
happens via a common ancestor, namely smoking, working
statistically as `confounder', and as the actual cause of cancer.
\section{Towards quantum Bayesian theory}\label{sec:quantum}
The main aim of this paper is to investigate quantum analogues of the
Bayesian Inference Theorem~\ref{thm:classicalconditioning}, from the
conviction that any adequate quantum Bayesian network theory should
address these points~\ref{essencebayesjoint}
and~\ref{essencebayesinference} from the beginning of
Section~\ref{sec:disintegration} in a satisfactory
manner. Point~\ref{essencebayesjoint} has received ample attention in
quantum theory, see for
instance~\cite{LeiferS13,CoeckeS12,LeiferS14,AllenBHLS17}. But
Point~\ref{essencebayesinference} involving quantum conditioning has
not really been studied this explicitly. Our main result is that one
can also describe quantum conditioning consistently, both on joint
states and via channels, as in
Equations~\eqref{eqn:classicalconditioning}, but this requires in the
quantum case that one distinguishes \emph{two forms of conditioning},
which we shall call \emph{lower} and \emph{upper} conditioning,
written as $\sigma|_{p}$ and $\sigma|^{p}$ respectively\footnote{The
terminology `lower' and `upper' is simply determined by the position
of the predicate $p$, low in $\sigma|_{p}$ and up in
$\sigma|^{p}$.}. Classically these two forms of conditioning
coincide, but the quantum world is more subtle --- as usual. Lower
conditioning has appeared in effectus theory~\cite{ChoJWW15b} and
upper conditioning in the approach of~\cite{LeiferS13}. Here they are
clearly distinguished for the first time, and used jointly to capture
quantum inference and propagation of evidence. Interestingly, what is
commonly called Bayes' rule holds for upper conditioning, but not for
lower conditioning, for which we ``only'' have the product rule.
First we introduce the basics about states and predicates in the
quantum world. We shall do so for finite-dimensional quantum theory,
using the formalism of Hilbert spaces.
\subsection{Basics of quantum probability}\label{subsec:quantum}
Let $\mathscr{H}$ be a finite-dimensional complex Hilbert space. A
\emph{state} $\sigma$ of $\mathscr{H}$ is a positive operator on
$\mathscr{H}$ with trace one. That is, $\sigma$ is linear function
$\sigma \colon \mathscr{H} \rightarrow \mathscr{H}$ satisfying $\sigma
\geq 0$ and $\ensuremath{\mathrm{tr}}(\sigma) = 1$. A state is often called a
\emph{density matrix}. The canonical way to define a state is to start
from a vector $\ket{v} \in \mathscr{H}$ with norm $1$, and consider
the operator $\ket{v}\bra{v} \colon \mathscr{H} \rightarrow
\mathscr{H}$. It sends any element $\ket{w}\in\mathscr{H}$ to the
vector $\tuple{v|w}\cdot\ket{v}$. An arbitrary state is a convex
combination of such vector states $\ket{v}\bra{v}$. A \emph{joint}
state $\tau$ on two Hilbert space $\mathscr{H}$ and $\mathscr{K}$ is a
state on the tensor product $\mathscr{H}\otimes\mathscr{K}$.
A \emph{predicate}, also called an \emph{effect}, is a positive
operator $p$ on $\mathscr{H}$ below the identity: $0 \leq p \leq
\idmap$. The identity $\idmap$ is given by the identity/unit matrix,
and corresponds to the \emph{truth} predicate, often written as
$\ensuremath{\mathbf{1}}$. For each predicate $p$ there is an orthosupplement, written as
$p^\bot$, playing the role of negation. It is defined by $p^{\bot} =
\idmap - p$, and satisfies: $p^{\bot\bot} = p$ and $p + p^{\bot} =
\ensuremath{\mathbf{1}}$.
The most interesting logical operation on quantum predicates is
\emph{sequential conjunction} $\mathrel{\&}$. It is defined via the square
root operation on predicates, as:
\begin{equation}
\label{AndthenEqn}
\begin{array}{rcl}
p \mathrel{\&} q
& = &
\sqrt{p}\,q\sqrt{p}.
\end{array}
\end{equation}
\noindent We pronounce $\mathrel{\&}$ as `and-then', and read it as: after
$p$ with its side-effect, the predicate $q$ holds. This operation
$\mathrel{\&}$ has been studied in~\cite{GudderG02}, and re-emerged in
effectus theory~\cite{Jacobs15d,ChoJWW15b}. The square root of the
matrix $p$ exists since $p$ is positive. It is computed via
diagonalisation $\sqrt{p} = U\sqrt{D}U^{-1}$, where $p = UDU^{-1}$, in
which $\sqrt{D}$ is obtained from the diagonal matrix $D$ by taking
the square roots of the (positive) eigenvalues on the diagonal.
States $\sigma$ and predicates $p$ of the same Hilbert space
$\mathscr{H}$ can be combined in \emph{validity}, defined as:
\begin{equation}
\label{ValidityEqn}
\begin{array}{rcl}
\sigma\models p
& \;\coloneqq\; &
\ensuremath{\mathrm{tr}}(\sigma\,p) \;\in\; [0,1].
\end{array}
\end{equation}
\noindent This standard definition is also known as the Born rule.
\begin{rem}
\label{rem:classicaltoquantum}
There is a standard way to embed classical probability into quantum
probability. Suppose we have classical state $\omega$ and predicate
$p$ on a finite set $X = \{x_{1}, \ldots, x_{n}\}$ with $n$
elements. Then we consider the Hilbert space $\mathbb{C}^{n}$ with standard
basis given by vectors $\ket{i}$ with an $1$ on the $i$-th position
and zeros elsewhere. We write $\widehat{\omega} = \sum_{i}
\omega(x_{i})\ket{i}\bra{i}$ for the `diagonal' quantum state on
$\mathbb{C}^n$. By construction it is positive and has trace
$\sum_{i}\omega(x_{i}) = 1$.
Similarly, a classical predicate $p \in [0,1]^{X}$ gives a quantum
predicate $\widehat{p}$ on $\mathbb{C}^{n}$ via $\widehat{p} = \sum_{i}
p(x_{i})\ket{i}\bra{i}$. By construction, $0 \leq p \leq \idmap$. It
is easy to see that the classical and quantum validities coincide:
\[ \begin{array}{rcccccl}
\omega\models p
& = &
\sum_{i} \omega(i)\cdot p(i)
& = &
\ensuremath{\mathrm{tr}}\big(\widehat{\omega}\,\widehat{p}\big)
& = &
\widehat{\omega} \models \widehat{p}.
\end{array} \]
\noindent The mapping $\smash{\widehat{(\;\cdot\;)}}$ preserves the
logical structure on predicates, including sequential conjunction
$\mathrel{\&}$.
\end{rem}
\begin{rem}
\label{rem:stateispredicate}
In both classical and quantum probability, as described here, a state
is also a predicate. This is peculiar. When one moves to a higher level
of abstraction, this is no longer the case --- for instance by using
von Neumann algebras instead of Hilbert spaces, or by using continuous
probability distributions on measurable spaces instead of discrete
distributions on sets. In the next section we sometimes `convert' a
state into a predicate, but we shall make explicit when we do so. A
more abstract approach is possible, using the duality between states
and effects, see also Remark~\ref{rem:daggerconditioning}.
\end{rem}
\subsection{Two forms of quantum conditioning}\label{subsec:quantumconditioning}
This subsection introduces two forms of quantum conditioning of a
state by a predicate, called `lower' and `upper' conditioning, and
describes their basic properties.
\begin{definition}
\label{def:quantumconditioning}
Let $\sigma$ be a state, and $p$ a predicate, on the same Hilbert
space, for which the validity $\sigma\models p$ is non-zero.
We shall use the following terminology, notation and definition
for two forms of conditioning:
\[ \begin{array}{rclcrcl}
\mbox{lower:}\quad
\sigma|_{p}
& \coloneqq &
\displaystyle\frac{\sqrt{p}\,\sigma\sqrt{p}}{\sigma\models p}
& \qquad\qquad &
\mbox{upper:}\quad
\sigma|^{p}
& \coloneqq &
\displaystyle\frac{\sqrt{\sigma}\,p\sqrt{\sigma}}{\sigma\models p}.
\end{array} \]
\end{definition}
It is easy to see that both $\sigma|_{p}$ and $\sigma|^{p}$ are states
again --- using the familiar `rotation' property of traces: $\ensuremath{\mathrm{tr}}(AB) =
\ensuremath{\mathrm{tr}}(BA)$. Lower conditioning $\sigma|_{p}$ arises in effectus theory,
whereas upper conditioning $\sigma|^{p}$ comes
from~\cite{LeiferS13}. We first observe that this difference between
`lower' and `upper' does not exist classically.
\begin{lemma}
\label{lem:quantumconditioningclassical}
For classical (non-quantum) states and predicates, lower and upper
conditioning coincide with classical conditioning. To express this
more precisely we use the notation $\smash{\widehat{(\;\cdot\;)}}$
from Remark~\ref{rem:classicaltoquantum} to translate from classical
to quantum: for a classical state $\omega$ and predicate $p$,
\[ \begin{array}{rcccl}
\widehat{\omega}|_{\widehat{p}}
& = &
\omega|_{p}
& = &
\widehat{\omega}|^{\widehat{p}}.
\end{array} \]
\end{lemma}
\begin{myproof}
Diagonal matrices commute, so that
$\sqrt{\widehat{p}}\;\widehat{\omega}\,\sqrt{\widehat{p}} =
\widehat{\omega}\,\widehat{p} =
\sqrt{\widehat{\omega}}\,\widehat{p}\,\sqrt{\widehat{\omega}}$. \hspace*{\fill}$\QEDbox$
\end{myproof}
A second observation is about truth $\ensuremath{\mathbf{1}}$ and sequential conjunction
$\mathrel{\&}$. Both lower and upper conditioning with truth $\ensuremath{\mathbf{1}}$ does
nothing, like in the classical case, but successive conditioning
cannot be reduced to single conditioning, like in the first equation
in~\eqref{eqn:classicalsuccesiveconditioning}, in
Proposition~\ref{prop:classicalbayes}. In addition, the order in
quantum conditioning matters, just like the order of priming in
psychology matters~\cite{Jacobs17f}.
\begin{rem}
\label{rem:quantumconditioningconjunctions}
We have $\sigma|_{\ensuremath{\mathbf{1}}} = \sigma$ and $\sigma|^{\ensuremath{\mathbf{1}}} = \sigma$, but
in general successive quantum conditionings cannot be reduced to
a single conditioning via sequential conjunction:
\[ \begin{array}{rclcrcl}
(\sigma|_{p})|_{q}
& \neq &
\sigma|_{p\mathrel{\&} q}
& \qquad\mbox{and also}\qquad &
(\sigma|^{p})|^{q}
& \neq &
\sigma|^{p\mathrel{\&} q}.
\end{array} \]
\noindent Similarly, in general, quantum conditionings do not commute:
\[ \begin{array}{rclcrcl}
(\sigma|_{p})|_{q}
& \neq &
(\sigma|_{q})|_{p}
& \qquad\mbox{and}\qquad &
(\sigma|^{p})|^{q}
& \neq &
(\sigma|^{q})|^{p}.
\end{array} \]
\end{rem}
Interestingly, the two classical equations~\eqref{eqn:classicalbayes}
in Proposition~\ref{prop:classicalbayes} hold separately for the two
kinds of quantum conditioning.
\begin{proposition}
\label{prop:quantumbayes}
The `product' rule holds for lower conditioning and Bayes' rule holds
for upper conditioning:
\begin{equation}
\label{eqn:quantumbayes}
\begin{array}{rclcrcl}
\sigma|_{p} \models q
& = &
\displaystyle\frac{\sigma\models p\mathrel{\&} q}{\sigma\models p}
& \hspace*{5em} &
\sigma|^{p} \models q
& = &
\displaystyle\frac{(\sigma|^{q}\models p)\cdot(\sigma\models q)}{\sigma\models p}.
\end{array}
\end{equation}
\end{proposition}
\begin{myproof}
We simply go through the computations:
\[ \mystretch\begin{array}[b]{rcccccl}
\sigma|_{p} \models q
& = &
\ensuremath{\mathrm{tr}}\big(\sigma|_{p}\,q\big)
& = &
\ensuremath{\mathrm{tr}}\big(\frac{\sqrt{p}\,\sigma\sqrt{p}}{\sigma\models p}\,q\big)
& = &
\frac{1}{\sigma\models p}\cdot\ensuremath{\mathrm{tr}}\big(\sigma\sqrt{p}\,q\sqrt{p}\big)
\hspace*{\arraycolsep}=\hspace*{\arraycolsep}
\frac{\sigma\models p\mathrel{\&} q}{\sigma\models p}
\\[+0.3em]
\sigma|^{p} \models q
& = &
\ensuremath{\mathrm{tr}}\big(\sigma|^{p} \, q\big)
& = &
\ensuremath{\mathrm{tr}}\big(\frac{\sqrt{\sigma}\,p\sqrt{\sigma}}{\sigma\models p}\,q\big)
& = &
\frac{\sigma\models q}{\sigma\models p}\cdot
\ensuremath{\mathrm{tr}}\big(p\frac{\sqrt{\sigma}\,q\sqrt{\sigma}}{\sigma\models q}\big)
\hspace*{\arraycolsep}=\hspace*{\arraycolsep}
\frac{(\sigma|^{q}\models p)\cdot(\sigma\models q)}{\sigma\models p}.
\end{array} \eqno{\square} \]
\end{myproof}
\section{Quantum channels}\label{sec:quantumchannel}
In order to express the quantum analogues of the equations in
Theorem~\ref{thm:classicalconditioning} we need the notion of
`channel' in a quantum setting. It exists, and is alternatively often
called a quantum operation, see \textit{e.g.}\xspace~\cite{NielsenC00}. There are
several variations possible in the requirements, such as just positive
or complete positive, unitary or subunitary, normal or not. These
variations are not essential for what follows.
For a finite-dimensional Hilbert space $\mathscr{H}$ be write
$\mathcal{B}(\mathscr{H})$ for the set of linear maps $A\colon
\mathscr{H} \rightarrow \mathscr{H}$. Because $\mathscr{H}$ has finite
dimension, such $A$ are automatically bounded, or equivalently,
continuous. The set of operators $\mathcal{B}(\mathscr{H})$ is in fact
a Hilbert space itself, with Hilbert-Schmidt inner product
$\HSip{A}{B} = \ensuremath{\mathrm{tr}}(A^{\dag}B)$, where $A^{\dag}$ is the conjugate
transpose of $A$, as matrix. Moreover, there are canonical
isomorphisms $\mathcal{B}(\mathscr{H}\otimes\mathscr{K}) \cong
\mathcal{B}(\mathscr{H}) \otimes \mathcal{B}(\mathscr{K})$ and
$\mathcal{B}(\mathbb{C}) \cong \mathbb{C}$.
If $\mathscr{K}$ is another finite-dimensional Hilbert space, then a
\emph{CP-map} $\mathscr{H} \rightarrow \mathscr{K}$ is a completely
positive linear map $c\colon \mathcal{B}(\mathscr{K}) \rightarrow
\mathcal{B}(\mathscr{H})$. Notice the change of direction. This CP-map
$c$ is called a \emph{channel} if it preserves the unit/identity
matrix: $c(\idmap) = \idmap$. It may be called \emph{subchannel} if
$c(\idmap) \leq \idmap$. Each CP-map $c\colon \mathcal{B}(\mathscr{K})
\rightarrow \mathcal{B}(\mathscr{H})$ has a `dagger', written as
$c^{\#}\colon \mathcal{B}(\mathscr{H}) \rightarrow
\mathcal{B}(\mathscr{K})$, so that $\HSip{c(A)}{B} =
\HSip{A}{c^{\#}(B)}$, that is, $\ensuremath{\mathrm{tr}}(c(A)^{\dag}B) =
\ensuremath{\mathrm{tr}}(A^{\dag}c^{\#}(B))$.
For a channel $c \colon \mathscr{H} \rightarrow \mathscr{K}$ and a
predicate (effect) $q$ on $\mathscr{K}$ we define predicate
transformation via function application $c \ll q \coloneqq c(q)$.
Similarly, for a state $\sigma$ on $\mathscr{H}$ we define state
transformation via the dagger of the channel, as: $c \gg \sigma
\coloneqq c^{\#}(\sigma)$. Then, using that positive operators are
self-adjoint, we get the same
relation~\eqref{eqn:classicalvaliditytransformation} between validity
and state/predicate transformation as in the classical case:
\begin{equation}
\label{eqn:quantumvaliditytransformation}
\mystretch
\begin{array}{rcl}
c \gg \sigma \models q
\hspace*{\arraycolsep}=\hspace*{\arraycolsep}
\ensuremath{\mathrm{tr}}\big(c^{\#}(s)\,q\big)
& = &
\ensuremath{\mathrm{tr}}\big(c^{\#}(s)\,q^{\dag}\big)
\\
& = &
\ensuremath{\mathrm{tr}}\big(s\,c(q)^{\dag}\big)
\hspace*{\arraycolsep}=\hspace*{\arraycolsep}
\ensuremath{\mathrm{tr}}\big(s\,c(q)\big)
\hspace*{\arraycolsep}=\hspace*{\arraycolsep}
s \models c \ll q.
\end{array}
\end{equation}
\begin{definition}
\label{def:assert}
Let $p$ be a (quantum) predicate on Hilbert space $\mathscr{H}$. It gives
rise to a subchannel $\ensuremath{\mathrm{asrt}}_{p} \colon \mathscr{H} \rightarrow \mathscr{H}$
defined by:
\[ \begin{array}{rcl}
\ensuremath{\mathrm{asrt}}_{p}(A)
& \coloneqq &
\sqrt{p}\,A\,\sqrt{p}.
\end{array} \]
\end{definition}
This assert map $\ensuremath{\mathrm{asrt}}_p$ plays a fundamental role in effectus theory,
see~\cite{Jacobs15d,ChoJWW15b}, for instance because it allows us to
define sequential conjunction~\eqref{AndthenEqn} via predicate
transformation as $p \mathrel{\&} q = \ensuremath{\mathrm{asrt}}_{p} \ll q$.
\begin{rem}
\label{rem:daggerconditioning}
States/predicates on $\mathscr{H}$ are special instances of CP-maps
$\mathbb{C} \rightarrow \mathscr{H}$, resp.\ $\mathscr{H}\rightarrow\mathbb{C}$. If we
consider them as such channels, we can take their dagger
$(-)^{\#}$. Then we can relate upper and lower conditioning via an
exchange, namely as: $\sigma|^{p} = p^{\#}|_{\sigma^{\#}}$. This
re-formulation may be useful in a more general setting.
\end{rem}
\subsection{Representation of quantum channels}
As mentioned, a channel $c\colon \mathscr{H} \rightarrow \mathscr{K}$
is a (completely positive) linear function $\mathcal{B}(\mathscr{K})
\rightarrow \mathcal{B}(\mathscr{H})$ between spaces of operators.
Let's assume $\mathscr{H},\mathscr{K}$ have dimensions $n,m$,
respectively. The space of operators $\mathcal{B}(\mathscr{K})$ then
has dimension $m\times m$, so that the channel $c$ is determined by
its values on the $m\times m$ base vectors $\ket{i}\bra{j}$ of
$\mathcal{B}(\mathscr{K})$. Thus, the channel $c$ is determined by
$m\times m$ matrices of size $n\times n$, as in:
\begin{equation}
\label{diag:channelmatrix}
\begin{array}{cl}
\left(\begin{array}{ccc}
\left(\,\fbox{\strut\rule[-0.5em]{0em}{0em}$n\times n$}\,\right)
& \quad\cdots\quad &
\left(\,\fbox{\strut\rule[-0.5em]{0em}{0em}$n\times n$}\,\right)
\\
\vdots & & \vdots
\\
\left(\,\fbox{\strut\rule[-0.5em]{0em}{0em}$n\times n$}\,\right)
& \quad\cdots\quad &
\left(\,\fbox{\strut\rule[-0.5em]{0em}{0em}$n\times n$}\,\right)
\end{array}\right) &
\raisebox{+0.7em}{$\underset{\underset{\textstyle\downarrow}{\textstyle m}}{\textstyle\uparrow}$}
\\
\leftarrow\!m\!\rightarrow
\end{array}
\end{equation}
\noindent The matrix entries of the channel $c$ will be written via
double indexing, as $c_{k\ell,ij}$ for $1 \leq k,\ell \leq m$ and
$1\leq i,j \leq n$.
This matrix representation of a quantum channel is used in EfProb. It
is convenient, for instance because parallel composition $\otimes$ of
channels can simply be done by Kronecker multiplication of their
(outer) matrices~\eqref{diag:channelmatrix}. We briefly describe how
predicate and state transformation works.
Let $q$ be a predicate on $\mathscr{K}$, represented as a $m\times m$
matrix. Predicate transformation $c \ll q$ is done simply by linear
extension. It yields an $n\times n$ matrix, forming a predicate on
$\mathscr{H}$, via:
\begin{equation}
\label{eqn:qpredtransform}
\begin{array}{rcl}
c \ll q
& \coloneqq &
\sum_{k,\ell}\, q_{k\ell}\cdot c_{k\ell}.
\end{array}
\end{equation}
\noindent In the other direction we do state transformation essentially
via the dagger $c^{\#}$ of the channel $c$. Explicitly, it works as
follows. Let $\sigma$ be a state of $\mathscr{H}$, represented by
a $n\times n$ matrix. Then we obtain the transformed state $c \gg \sigma$
as an $m\times m$ matrix given by computing traces:
\begin{equation}
\label{eqn:qstatetransform}
\begin{array}{rcl}
\big(c \gg \sigma\big)_{k\ell}
& \coloneqq &
\ensuremath{\mathrm{tr}}(c_{\ell k}\,\sigma).
\end{array}
\end{equation}
\noindent Notice the change of order of indices: at position
$(k,\ell)$ of $c \gg \sigma$ we use the inner matrix $c_{\ell k}$
from~\eqref{diag:channelmatrix}. The reason is the implicit use of the
Hilbert-Schmidt inner product, given by $\HSip{A}{B} =
\ensuremath{\mathrm{tr}}(A^{\dag}\cdot B)$, where the dagger involves a conjugate transpose.
\subsection{Quantum pairing and extraction}
The pairing of a classical state and a channel in~\eqref{diag:pairing}
involves a copier $\mathord{\usebox\sbcopier}$. It does not exist in general in a quantum
setting because of the `no-cloning' theorem. But we do have `cup'
states $\cup$ with maximal entanglement. They are basis dependent:
given a finite-dimensional Hilbert space $\mathscr{H}$ with
orthonormal basis $\big(\ket{i}\big)$ of size $n$, we can for a state
$\cup$ of $\mathscr{H}\otimes\mathscr{H}$ as $\cup =
\frac{1}{n}\sum_{i,j}\ket{ii}\bra{jj}$. Similarly, there is `cap'
predicate $\cap$. The quantum pairing and extraction operations that
we describe in this subsection are due to~\cite{LeiferS13}. But the
more abstract description in terms of cups and caps does not occur
there. These operations depend on a choice of basis.
\auxproof{
We first unravel the definition of $\cup$ and then illustrate that
it equalis the EfProb implementation, for $n=2$ and $n=3$.
\[ \begin{array}{rcl}
2\cup_{2}
& = &
\left(\begin{smallmatrix} 1 \\ 0 \\ 0 \\ 0 \end{smallmatrix}\right)
\left(\begin{smallmatrix} 1 & 0 & 0 & 0 \end{smallmatrix}\right)
+
\left(\begin{smallmatrix} 1 \\ 0 \\ 0 \\ 0 \end{smallmatrix}\right)
\left(\begin{smallmatrix} 0 & 0 & 0 & 1 \end{smallmatrix}\right)
+
\left(\begin{smallmatrix} 0 \\ 0 \\ 0 \\ 1 \end{smallmatrix}\right)
\left(\begin{smallmatrix} 1 & 0 & 0 & 0 \end{smallmatrix}\right)
+
\left(\begin{smallmatrix} 0 \\ 0 \\ 0 \\ 1 \end{smallmatrix}\right)
\left(\begin{smallmatrix} 0 & 0 & 0 & 1 \end{smallmatrix}\right)
\\
& = &
\left(\begin{smallmatrix}
1 & 0 & 0 & 1 \\
0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 \\
1 & 0 & 0 & 1
\end{smallmatrix}\right)
\\
& = &
\left(\begin{smallmatrix} 1 \\ 0 \\ 0 \\ 1 \end{smallmatrix}\right)
\left(\begin{smallmatrix} 1 & 0 & 0 & 1 \end{smallmatrix}\right)
\\
3\cup_{3}
& = &
\left(\begin{smallmatrix} 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{smallmatrix}\right)
\left(\begin{smallmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \end{smallmatrix}\right)
+
\left(\begin{smallmatrix} 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{smallmatrix}\right)
\left(\begin{smallmatrix} 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \end{smallmatrix}\right)
+
\left(\begin{smallmatrix} 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{smallmatrix}\right)
\left(\begin{smallmatrix} 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \end{smallmatrix}\right)
\\
& = &
\left(\begin{smallmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 1 \\ 0 \\ 0 \\ 0 \\ 0 \end{smallmatrix}\right)
\left(\begin{smallmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \end{smallmatrix}\right)
+
\left(\begin{smallmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 1 \\ 0 \\ 0 \\ 0 \\ 0 \end{smallmatrix}\right)
\left(\begin{smallmatrix} 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \end{smallmatrix}\right)
+
\left(\begin{smallmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 1 \\ 0 \\ 0 \\ 0 \\ 0 \end{smallmatrix}\right)
\left(\begin{smallmatrix} 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \end{smallmatrix}\right)
\\
& = &
\left(\begin{smallmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 1 \end{smallmatrix}\right)
\left(\begin{smallmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \end{smallmatrix}\right)
+
\left(\begin{smallmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 1 \end{smallmatrix}\right)
\left(\begin{smallmatrix} 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \end{smallmatrix}\right)
+
\left(\begin{smallmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 1 \end{smallmatrix}\right)
\left(\begin{smallmatrix} 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \end{smallmatrix}\right)
\\
& = &
\left(\begin{smallmatrix}
1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 \\
\end{smallmatrix}\right)
\\
& = &
\left(\begin{smallmatrix} 1 \\ 0 \\ 0 \\ 0 \\ 1 \\ 0 \\ 0 \\ 0 \\ 1 \end{smallmatrix}\right)
\left(\begin{smallmatrix} 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 \end{smallmatrix}\right)
\end{array} \]
}
Given a state $\sigma$ of $\mathscr{H}$ and a channel $c\colon
\mathscr{H} \rightarrow \mathscr{K}$ we can thus form a joint state of
$\mathscr{H}\otimes\mathscr{K}$ via the `cup' state $\cup$ of
$\mathscr{H}\otimes\mathscr{H}$. Then we can define a pair state of
$\mathscr{H}\otimes\mathscr{K}$ via state transformation $\gg$ as in:
\begin{equation}
\label{eqn:quantumpairing}
\begin{array}{rclcrcl}
\ensuremath{\mathrm{pair}}(\sigma,c)
& \coloneqq &
\big(\ensuremath{\mathrm{asrt}}_{\sigma^{T}} \otimes c\big) \gg \cup
& \qquad\mbox{that is} \qquad
\bra{ik}\ensuremath{\mathrm{pair}}(\sigma,c)\ket{j\ell}
& = &
\overline{\big(\sqrt{\sigma}c_{k\ell}\sqrt{\sigma}\big)_{ij}}.
\end{array}
\end{equation}
\noindent In the other direction, given a joint state $\tau$ of
$\mathscr{H}\otimes\mathscr{K}$ we write $\ensuremath{\mathrm{proj}}(\tau)$ for the transpose
of its first marginal, so:
\begin{equation}
\label{eqn:quantumproject}
\begin{array}{rclcrcl}
\ensuremath{\mathrm{proj}}(\tau)
& \coloneqq &
\mathsf{M}_{1}(\tau)^{T}
& \qquad\mbox{where}\qquad &
\bra{i}\mathsf{M}_{1}(\tau)\ket{j}
& \coloneqq &
\sum_{k} \bra{ik}\tau\ket{jk}.
\end{array}
\end{equation}
\noindent We extract a channel $\ensuremath{\mathrm{extr}}(\tau) \colon \mathscr{H}
\rightarrow \mathscr{K}$ from $\tau$ in the manner defined
in~\cite{LeiferS13}:
\begin{equation}
\label{eqn:quantumextract}
\begin{array}{rcl}
\ensuremath{\mathrm{extr}}(\tau)_{k\ell}
& \coloneqq &
\sum_{i,j} \overline{\bra{ik}\tau\ket{j\ell}} \cdot
\big(\sqrt{\ensuremath{\mathrm{proj}}(\tau)^{-1}}\ket{i}\bra{j}\sqrt{\ensuremath{\mathrm{proj}}(\tau)^{-1}}\big).
\end{array}
\end{equation}
\noindent The next result is the analogue of
Lemma~\ref{lem:disintegration} about disintegration for classical
discrete probability.
\begin{proposition}[After~\cite{LeiferS13}]
\label{prop:quantumpairing}
A quandum state $\sigma$ and channel $c$, with matching types, can be
recovered from their pair, defined in~\eqref{eqn:quantumpairing}, via
projection~\eqref{eqn:quantumproject} and
extraction~\ref{eqn:quantumextract}
\[ \begin{array}{rclcrcl}
\ensuremath{\mathrm{proj}}(\ensuremath{\mathrm{pair}}(\sigma,c))
& = &
\sigma
& \hspace*{3em}\mbox{and}\hspace*{3em} &
\ensuremath{\mathrm{extr}}\big(\ensuremath{\mathrm{pair}}(\sigma,c)\big)
& = &
c.
\end{array} \]
\noindent Similarly, a joint state $\tau$ for which the transpose of
its first marginal $\ensuremath{\mathrm{proj}}(\tau)$, as defined above, is invertible can
be recovered as a pair, as on the left below. In addition, $\tau$'s
second marginal can be obtained via state transformation, as on the right:
\[ \begin{array}{rclcrcl}
\tau
& = &
\ensuremath{\mathrm{pair}}(\ensuremath{\mathrm{proj}}(\tau), \ensuremath{\mathrm{extr}}(\tau))
& \hspace*{7em} &
\mathsf{M}_{2}(\tau)
& = &
\ensuremath{\mathrm{extr}}(\tau) \gg \ensuremath{\mathrm{proj}}(\tau).
\end{array} \]
\end{proposition}
\begin{myproof}
We shall do the first equation and leave the others to the interested
reader.
\[ \mystretch\begin{array}{rcl}
\big(\ensuremath{\mathrm{proj}}(\ensuremath{\mathrm{pair}}(\sigma,c))\big)_{ij}
& = &
\sum_{k} \bra{jk}\ensuremath{\mathrm{pair}}(\sigma,c)\ket{ik}
\\
& \smash{\stackrel{\eqref{eqn:quantumpairing}}{=}} &
\sum_{k} \overline{\big(\sqrt{\sigma}c_{kk}\sqrt{\sigma}\big)_{ji}}
\\
& = &
\overline{\big(\sqrt{\sigma}\big(\sum_{k}c_{kk}\big)\sqrt{\sigma}\big)_{ji}}
\\
& = &
\overline{\sigma_{ji}} \qquad \mbox{since $c$ is unital,
\textit{i.e.}~$c \ll \ensuremath{\mathbf{1}} = \ensuremath{\mathbf{1}}$}
\\
& = &
\big(\sigma^{\dag}\big)_{ij}
\\
& = &
\sigma_{ij}.
\end{array} \]
\noindent The latter equation holds since a state is positive and thus
self-adjoint. \hspace*{\fill}$\QEDbox$
\auxproof{
Similarly,
\[ \begin{array}{rcl}
\ensuremath{\mathrm{extr}}\big(\ensuremath{\mathrm{pair}}(\sigma,c)\big)_{k\ell}
& = &
\sum_{i,j} \overline{\bra{ik}\ensuremath{\mathrm{pair}}(\sigma,c)\ket{j\ell}} \cdot
\big(\sqrt{\ensuremath{\mathrm{proj}}(\ensuremath{\mathrm{pair}}(\sigma,c))^{-1}}\ket{i}\bra{j}\sqrt{\ensuremath{\mathrm{proj}}(\ensuremath{\mathrm{pair}}(\sigma,c))^{-1}}\big)
\\
& = &
\sum_{i,j} \big(\sqrt{\sigma}c_{k\ell}\sqrt{\sigma}\big)_{ij}
\big(\sqrt{\sigma^{-1}}\ket{i}\bra{j}\sqrt{\sigma_{1}^{-1}}\big)
\\
& = &
\sum_{i,j,i',j'} \sqrt{\sigma}_{ii'}c_{k\ell,i',j'}\sqrt{\sigma}_{jj'}
\sqrt{\sigma^{-1}}\ket{i}\bra{j}\sqrt{\sigma_{1}^{-1}}
\\
& = &
\sum_{i',j'} c_{k\ell,i',j'}
\big(\sum_{i} \sqrt{\sigma}_{ii'}\sqrt{\sigma^{-1}}\ket{i}\big)
\big(\sum_{j}\bra{j}\sqrt{\sigma_{1}^{-1}}\sqrt{\sigma}_{jj'}\big)
\\
& = &
\sum_{i',j'} c_{k\ell,i',j'} \ket{i'}\bra{j'}
\\
& = &
c_{k\ell}.
\end{array} \]
Next,
\[ \begin{array}{rcl}
\bra{ik}\ensuremath{\mathrm{pair}}(\ensuremath{\mathrm{proj}}(\tau), \ensuremath{\mathrm{extr}}(\tau))\ket{j\ell}
& = &
\overline{\big(\sqrt{\ensuremath{\mathrm{proj}}(\tau)}\ensuremath{\mathrm{extr}}(\tau)_{k\ell}\sqrt{\ensuremath{\mathrm{proj}}(\tau)}\big)_{ij}}
\\
& = &
\overline{\big(\sqrt{\ensuremath{\mathrm{proj}}(\tau)}\big(\sum_{i',j'}
\overline{\bra{i'k}\tau\ket{j'\ell}}
\sqrt{\ensuremath{\mathrm{proj}}(\tau)^{-1}}\ket{i'}\bra{j'}\sqrt{\ensuremath{\mathrm{proj}}(\tau)^{-1}}\big)
\sqrt{\ensuremath{\mathrm{proj}}(\tau)}\big)_{ij}}
\\
& = &
\big(\sum_{i',j'} \bra{i'k}\tau\ket{j'\ell} \ket{i'}\bra{j'}\big)_{ij}
\\
& = &
\bra{ik}\tau\ket{j\ell}.
\end{array} \]
And finally:
\[ \begin{array}{rcl}
\lefteqn{\big(\ensuremath{\mathrm{extr}}(\tau) \gg \ensuremath{\mathrm{proj}}(\tau)\big)_{k\ell}}
\\
& = &
\ensuremath{\mathrm{tr}}\big(\ensuremath{\mathrm{extr}}(\tau)_{\ell k} \, \ensuremath{\mathrm{proj}}(\tau)\big)
\\
& = &
\sum_{i} \big(\ensuremath{\mathrm{extr}}(\tau)_{\ell k} \, \ensuremath{\mathrm{proj}}(\tau)\big)_{ii}
\\
& = &
\sum_{i,j} \ensuremath{\mathrm{extr}}(\tau)_{\ell k,ij} \ensuremath{\mathrm{proj}}(\tau)_{ji}
\\
& = &
\sum_{i,j,i',i''} \overline{\bra{i'\ell}\tau\ket{i''k}}
\bra{i}\sqrt{\ensuremath{\mathrm{proj}}(\tau)^{-1}}\ket{i'}\bra{i''}\sqrt{\ensuremath{\mathrm{proj}}(\tau)^{-1}}\ket{j}
\bra{j}\ensuremath{\mathrm{proj}}(\tau)\ket{i}
\\
& = &
\sum_{j,i',i''} \overline{\bra{i'\ell}\tau\ket{i''k}}
\bra{j}\sqrt{\ensuremath{\mathrm{proj}}(\tau)}\ket{i'}\bra{i''}\sqrt{\ensuremath{\mathrm{proj}}(\tau)^{-1}}\ket{j}
\\
& = &
\sum_{i',i''} \overline{\bra{i'\ell}\tau\ket{i''k}}
\ket{i'}\bra{i''}\idmap\ket{i'}
\\
& = &
\sum_{i} \overline{\bra{i\ell}\tau\ket{ik}}
\\
& = &
\sum_{i} \big(\tau^{\dag}\big)_{k\ell,ii}
\\
& = &
\sum_{i} \tau_{k\ell,ii}
\\
& = &
\big(\marg{\tau}{[0,1]}\big)_{k\ell}.
\end{array} \]
}
\end{myproof}
As an aside, for readers who are comfortable with diagrammatic
notation (see \textit{e.g.}~\cite{Selinger11,CoeckeK16}) one can write:
\vspace*{-0.8em}
\[ \ensuremath{\mathrm{pair}}(\sigma,c)
\;\;
=
\;\;
\vcenter{\hbox{%
\begin{tikzpicture}[font=\small]
\node[arrow box] (a) at (-1,0) {$\ensuremath{\mathrm{asrt}}_{\sigma^T}$};
\node[arrow box] (c) at (0,0) {$c$};
\draw (0.0,-0.3) to (c);
\draw (0,-0.3) arc(0.0:-180:0.5);
\draw (-1,-0.3) to (a);
\draw (a) to (-1,0.5);
\draw (c) to (0,0.5);
\end{tikzpicture}}}
\hspace*{3em}
\ensuremath{\mathrm{proj}}(\tau)
\;\;
=
\;\;
\vcenter{\hbox{%
\begin{tikzpicture}[font=\small]
\node[state] (t) at (0,0) {$\;\;\tau\;\;$};
\coordinate (t1) at ([xshiftu=-0.25]t);
\coordinate (t2) at ([xshiftu=0.25]t);
\node[discarder] (d) at ([yshiftu=0.3]t2) {};
\draw (t1) to ([yshiftu=0.2]t1);
\draw (t2) to (d);
\draw (-0.25,0.2) arc(0.0:180:0.4);
\draw (-1.05,-0.5) to (-1.05,0.2);
\end{tikzpicture}}}
\hspace*{3em}
\ensuremath{\mathrm{extr}}(t)
\;\;
=
\;\;
\vcenter{\hbox{%
\begin{tikzpicture}[font=\small]
\node[state] (t) at (0,0) {$\;\;\tau\;\;$};
\coordinate (t1) at ([xshiftu=-0.25]t);
\coordinate (t2) at ([xshiftu=0.25]t);
\node[arrow box, minimum height=1.5em] (a) at (-2.05,-0.3) %
{\raisebox{0.2em}{$\ensuremath{\mathrm{asrt}}_{\ensuremath{\mathrm{proj}}(\tau)^{-1}}$}};
\draw (t1) to ([yshiftu=0.1]t1);
\draw (t2) to ([yshiftu=0.7]t2);
\draw (-0.25,0.1) arc(0.0:180:0.9);
\draw (a) to ([yshiftu=+0.5]a);
\draw (a) to ([yshiftu=-0.6]a);
\end{tikzpicture}}}
\]
\section{A quantum Bayesian Inference Theorem}\label{sec:quantuminference}
This section contains the main result of this paper, namely the
quantum analogue of Theorem~\ref{thm:classicalconditioning}. It
describes how conditioning of a joint state can also be performed via
the extracted channel. The novelty in our quantum description is that
we need both lower and upper conditioning to capture what is going on.
\begin{theorem}
\label{thm:quantuminference}
Let $\tau$ be a state of $\mathscr{H}\otimes\mathscr{K}$ and let $p,q$
be predicates, on $\mathscr{H}$ and on $\mathscr{K}$ respectively.
Then:
\[ \begin{array}[b]{rclcrcl}
\mathsf{M}_{2}\big(\tau|_{p \otimes \ensuremath{\mathbf{1}}}\big)
& = &
\ensuremath{\mathrm{extr}}(\tau) \gg (\ensuremath{\mathrm{proj}}(\tau)|^{p^{T}})
& \qquad\mbox{and}\qquad &
\mathsf{M}_{1}\big(\tau|_{\ensuremath{\mathbf{1}} \otimes q}\big)
& = &
\big(\ensuremath{\mathrm{proj}}(\tau)|^{\ensuremath{\mathrm{extr}}(\tau) \ll q}\big)^{T}.
\end{array} \eqno{\square} \]
\end{theorem}
The proof is ommitted since it involves rather long and boring matrix
calculations. Instead we include a random test: the quantum versions
of pairing / projection / extraction and lower / upper conditioning
have been implemented in EfProb. They can be used to test
Theorem~\ref{thm:quantuminference} as below, by generating an
arbitrary state \pythoninline{t}, in this case of type $\mathbb{C}^{3}\otimes
\mathbb{C}^{5}$, together with arbitrary (suitably typed) predicates. The
EfProb notation for lower and upper conditioning is \pythoninline{/}
and \pythoninline{^}.
\begin{python}
>>> t = random_state([3,5])
>>> t1 = (t
>>> e = extract(t)
>>> p = random_pred([3])
>>> q = random_pred([5])
>>> t / (p @ truth([5]))
True
>>> t / (truth([3]) @ q)
True
\end{python}
\noindent The two equality tests \pythoninline{==} involve $5\times 5$
and $3\times 3$ matrices of complex numbers.
In the equations in Theorem~\ref{thm:quantuminference} we perform
lower conditioning on the joint state. One may ask if there are also
`dual' equations where upper conditioning on the joint state is
re-described via state/predicate transformation. We have not found
them.
\subsection*{Acknowledgements}
Thanks to Kenta Cho and Alex Kissinger for helpful feedback and
discussions.
\bibliographystyle{plain}
| {'timestamp': '2019-01-30T02:09:59', 'yymm': '1810', 'arxiv_id': '1810.02438', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02438'} | arxiv |
\section{Introduction}
\Ac{OFDM} is a modulation scheme which enables a radio to transmit multiple information symbols on orthogonal channels separated in the frequency domain \cite{Weinstein_1971}.
Because of its high spectral efficiency, in conjunction with its compatibility with multiple access techniques in space and frequency, it has been the dominant waveform for today’s major wireless communication standards.
However, one major drawback of \ac{OFDM} is that the \ac{PAPR} of the signal can be high for arbitrary modulations symbols, which can degrade the power efficiency. A large power back-off may also be required to avoid the non-linear distortion at the power amplifier at the expense of a reduced coverage range.
In addition, a non-contiguous resource allocation in an \ac{OFDM} symbol, which may be beneficial for low-latency and reliable communications or meeting regulatory requirements for the communications in unlicensed bands \cite{ericUL}, makes the \ac{PAPR} minimization a more challenging problem \cite{Gokceli_2019}.
Reducing the instantaneous peak power of an \ac{OFDM} symbol is not a trivial task.
In the literature, there are numerous approaches to attack this problem \cite{Han_2005, Rahmatallah_2013}.
One of the trends is to design codes such that the \ac{PAPR} of the resulting signal is bounded (see \cite{Wunder_2013} and the references therein).
In this direction, one can show that \acp{CS} from the cosets of Reed-Muller (RM) codes can limit the \ac{PAPR} of an \ac{OFDM} symbol to be less than or equal to 3 dB while still providing coding gain \cite{davis_1999}.
However, these sequences are typically contiguous, limited to \ac{PSK} alphabet, and it is difficult to make their lengths to be compatible with the resource allocations in major wireless standards.
In this study, we address the issue of designing a generic \ac{CS} encoder supporting a flexible resource allocation in the frequency domain.
\subsection{Contributions and Organization}
The first contribution of this study is the theoretical framework which reveals the algebraic structure of a recursion evolved with two linear operators at each step. In Lemma~\ref{th:framework}, we algebraically describe how the operators applied at the $n$th step are distributed to the coefficients of the final polynomial as a function of the locations of the operators in the recursion.
The second contribution is the application of the proposed theoretical framework to a recursive \ac{GCP} construction relying on Budi{\v s}in's methods \cite{Budisin_1990,Budisin_1990_ml,Garcia_2010_ml, garcia_2013}, which yields to Theorem~\ref{th:reduced}. We obtain the algebraic expressions related to the initial sequences, phase rotations, signs, scalars, and the shift factors applied at each step in the recursion. Hence, we provide insights into \acp{GCP} that can be hard to infer from the previous constructions. For example,
Theorem~\ref{th:reduced} extends James and Davis's result for phase term in \cite{davis_1999} by providing a separate algebraic structure for the amplitude term {\em concisely} which allows one to design constellation flexibly.
It also yields to \acp{CS} of length non-power of two from an initial \ac{GCP}.
As a result of Theorem~\ref{th:reduced}, we also achieve a non-contiguous \ac{CS} encoder which has not been discussed in the literature algebraically to the best of our knowledge.
The rest of the paper is organized as follows.
In Section \ref{sec:survey}, we survey the \ac{CS} construction methods. In Section \ref{sec:pre}, we summarize several concepts related to the sequences and set the notation used in the rest of the sections. In Section \ref{sec:encoding-with-an-iterative-process}, we establish a framework which extracts the algebraic structure of the coefficients of a polynomial generated from a recursion. In Section \ref{sec:derivation-of-complementary-sequence-encoder}, we re-express a recursive \ac{GCP} construction based on Budi{\v s}in's methods by using the established framework and remove the redundant parameters to achieve a concise algebraic expressions. We investigate the impact of each operator in the recursion and discuss the rules for synthesizing \acp{CS} with a \ac{QAM} constellation. In Section \ref{sec:performAnalysis}, we analyze the proposed encoder numerically. We conclude the paper in Section \ref{sec:conclusion}.
{\em Notation:} The sets of complex numbers, real numbers, non-negative real numbers, integers, non-negative integers, positive integers, and integers modulo $H$ are denoted by $\mathbb{C}$, $\mathbb{R}$, $\mathbb{R}_{0}^{+}$, $\mathbb{Z}$, $\mathbb{Z}_{0}^{+}$, $\mathbb{Z}^{+}$, and $\mathbb{Z}_H$, respectively. The set of $m$-dimensional integers where each element is in $\mathbb{Z}_H$ is denoted by $\mathbb{Z}^m_H$.
The symbol $\otimes$ and $\odot$ denote Kronecker and Hadamard products, respectively. The symbol $\circ$ represents function composition.
The transpose, Hermitian, the complex conjugation, and the modulo 2 operations are denoted by $(\cdot)^{\rm T}$, $(\cdot)^{\rm H}$, $(\cdot)^*$, and $(\cdot)_2$ respectively.
The notation $(\eleGa[{i}])_{i=0}^{N-1}$ represents the sequence $\textit{\textbf{a}}= (\eleGa[0],\eleGa[1],\dots, \eleGa[N-1])$. The constant ${\rm j}$ denotes $\sqrt{-1}$. The operation $\textit{\textbf{a}}\pm\textit{\textbf{b}}$ and the operation $\textit{\textbf{a}} \odot \textit{\textbf{b}}$ are the element-wise summation/subtraction and the element-wise multiplication of the sequence $\textit{\textbf{a}}$ and the sequence $\textit{\textbf{b}}$, respectively.
\section{Prior Art: Complementary Sequences}
\label{sec:survey}
\Acp{CS} were introduced by Marcel Golay in 1961 \cite{Golay_1961}.
In his foundational paper, he established a framework to synthesize \acp{GCP} with binary alphabet. He presented two general construction methods, known as {\em Golay's concatenation} and {\em Golay's interleaving}, by concatenating or interleaving \acp{GCP} of length $N$ and $M$ to form a \ac{GCP} of length $2NM$.
In 1974, R. J. Turyn proposed another construction method which takes two \acp{GCP} of length $N$ and length $M$ and results in a \ac{GCP} of length $NM$ \cite{Turyn_1974}.
In \cite{Sivaswamy_1978}, Sivasamy extended Golay's concatenation method for $M =1$ by applying a phase factor to the one of the sequences in a \ac{GCP} before the concatenation to form a \ac{GCP} of length $N\cdot 2^m$ after $m$ iterations. Later, Budi{\v s}in generalized Sivasamy's construction by shifting the phase-rotated sequence instead of simple concatenation \cite{Budisin_1990}.
He showed that if the $n$th shift is $N\cdot2^{\permutationShift[{n}]}$ where $\permutationShift[{n}]$ is the $n$th element of the sequence $\bm{\psi}$ defined by the permutation of $\{0,1,\dots,m-1\}$, a large number of the sequences of length $N\cdot2^{m}$ can be generated through a recursive process.
In \cite{Budisin_1990_ml}, he proposed another construction which explains how the scaling factors can be taken into account in a recursive method to generate multi-level \acp{GCP}. In \cite{Garcia_2010_ml, garcia_2013}, Budi{\v s}in's constructions with phase factors and scaling factors were combined in a single recursion.
Nevertheless, these earlier studies did not propose an explicit encoding for \acp{CS} or investigate \acp{CS} with certain alphabets.
Appealing applications of \acp{CS} on communication systems have been demonstrated around 1990s. By generalizing an earlier work of Boyd \cite{boyd_1986}, in 1991, Popovic showed that \acp{CS} were beneficial to control the peak instantaneous power of \ac{OFDM} signals \cite{Popovic_1991}. In 1997, Davis and Jedwab announced that a large class of \acp{CS} over $\mathbb{Z}_{2^h}$ of length $2^m$ can be obtained through generalized Boolean functions related to \ac{RM} codes \cite{Davis_1997} for $h\in\mathbb{Z}^{+}$.
In their seminal paper \cite{davis_1999}, they showed that the proposed method results in $m!/2\cdot2^{h(m+1)}$ \acp{GCP} involving $m!/2\cdot2^{h(m+1)}$ \acp{CS} which occur as the elements of the cosets of the first-order \ac{RM} code within the second-order \ac{RM} code, where $h\ge1$ is an integer. Since the Hamming distance between two sequences in the set is at least $2^{m-2}$, Davis and Jedwab established a key connection between \acp{CS} and \ac{RM} codes to achieve a coding scheme guaranteeing low \ac{PAPR} for \ac{OFDM} symbols while providing good error correction capability.
Paterson proved that Davis and Jedwab's result can be generalized to a larger class of \acp{CS} over $\mathbb{Z}_{H}$
of length $2^m$ where $H$ is even positive integer in \cite{paterson_2000}.
In the literature, the set of \acp{CS} generated through Davis and Jedwab's method is sometimes referred to as {\em \ac{GDJ}} or {\em standard} sequences.
The connection between \acp{CS} and \ac{RM} codes has been a cornerstone of various research directions. The first major challenge has been the low code rate of the encoder proposed by James and Davis \cite{davis_1999}. Since the sequence length increases much faster than the number of distinct \acp{CS} for the encoder, the corresponding code rate decreases dramatically for a larger number of uncoded bits. To address the low-code rate issue, one major direction has been exploring the \acp{CS} which cannot be generated through Davis and Jedwab's method, i.e., {\em nonstandard} sequences. Until Li and Chu found 1024 quaternary nonstandard \acp{CS} of length 16 via a computer search in 2005 \cite{Li_Chu_2005}, there were no evidence on the existence of nonstandard \acp{CS} of length $2^m$. In \cite{Li_2005}, Li and Kao showed that these sequences contain third-order monomials and can be synthesized from concatenation or interleaving of quaternary \ac{GCP} of length 8. In \cite{Fiedler_2006}, Fiedler and Jedwab provided another explanation how these new sequences arise by showing that some of the standard \acp{CS} in different cosets have identical \ac{APAC} functions.
To increase the code rate, another major research direction has been the generalization of Davis and Jedwab's method to obtain \acp{CS} with larger alphabets such as M-\ac{QAM} constellations.
In \cite{robing_2001}, R{\"o}{\ss}ing and V. Tarokh showed that 16-QAM sequences which result in low \ac{PAPR} can be constructed through a weighted sum of two \acp{CS} with the alphabet of \ac{QPSK} constellation.
In 2002, Chong et al. developed an important theorem which describes the Boolean functions associated with the "offset" sequences which is added to a "base" quaternary standard sequence to form a 16-\ac{QAM} \ac{CS} \cite{Chong_2002,Chong_2003}. They showed that there exist at least $(14+12m)(m!/2)4^{m+1}$ distinct \acp{CS} of length $2^m$ with the alphabet of 16-QAM constellation.
In \cite{Lee_2006}, Lee and Golomb extended the offset sequences obtained in \cite{Chong_2003} for 16-QAM to 64-QAM. They showed that a \ac{CS} with the alphabet of 64-QAM constellation requires two offset sequences. In 2008, Li revised Chong et al. and Lee and Golomb's theorems in \cite{Li_2008} and introduced new offset pairs leading to 64-QAM \acp{CS} proposed in \cite{Chang_2010}. In \cite{Li_2010}, Li showed that there exist at least $[(m+1)4^{2(q-1)}-(m+1)4^{(q-1)}+2^{q-1}](m!/2)4^{(m+1)}$ \acp{CS} for $4^q$-QAM sequences.
Albeit the benefit of the offset method for synthesizing a large number of distinct M-\ac{QAM} \acp{CS}, the offset method typically yields results that are not as concise as Davis and Jedwab's result for the standard sequences \cite{Chong_2003, Li_2008}. One primary difficulty for the offset method is that it is not trivial to obtain the algebraic structure of a sequence generated through the addition of two complex sequences originated from two different generalized Boolean functions. In \cite{Chong_2003}, Chong et al. remarked that {\em "unfortunately, these sequences were difficult to classify based on their polynomial structure. The classification of these sequences and their realization as OFDM QAM codes with low encoding/decoding complexities remains an interesting open problem."} This open problem is one of our motivations to synthesize \acp{CS} by separating the encoders for amplitude and the phase. From this aspect, our work is in line with Budi{\v s}in and Spasojevi\'c's recent work \cite{budisin_2018} which generates \acp{CS} by indexing the elements of the unitary matrices. However, our work differs from the work in \cite{budisin_2018} as we focus on the corresponding algebraic structure associated with each operation in a recursive function, which enables non-contiguous \acp{CS} and the \acp{CS} of length non-power of 2.
\section{Preliminaries and Further Notation}
\label{sec:pre}
\subsection{Polynomial Representation of a Sequence}
\label{subsec:poly_sequence}
We define the polynomial representation of the sequence $\textit{\textbf{a}}=(\eleGa[{i}])_{i=0}^{N-1}$ as
\begin{align}
\polySeq[\textit{\textbf{a}}][z] \triangleq \eleGa[N-1]z^{N-1} + \eleGa[N-2]z^{N-2}+ \dots + \eleGa[0]~,
\label{eq:polySeq}
\end{align}
for $z\in \mathbb{C}$.
The \ac{APAC} of the sequence $\textit{\textbf{a}}$ can be defined as
\begin{align}
\apac[\textit{\textbf{a}}][k] \triangleq
\begin{cases}
\apacPositive[\textit{\textbf{a}}][k], & \text{if}~ k \ge 0\\
\apacPositive[\textit{\textbf{a}}][-k]^*, &\text{if}~ k < 0
\end{cases}~,
\nonumbe
\end{align}
where $\apacPositive[\textit{\textbf{a}}][k]=\sum_{i=0}^{N-k-1} \eleGa[i]^*\eleGa[i+k] $ for
$k = 0,1,\dots,N-1$ and $0$ otherwise. One can show that \cite{parker_2003}
\begin{align}
\polySeq[\textit{\textbf{a}}][z]\polySeq[\textit{\textbf{a}}^*][z^{-1}]
= \apac[\textit{\textbf{a}}][0] + \sum_{k=1}^{N-1}(\apac[\textit{\textbf{a}}][k]z^{k} + \apac[\textit{\textbf{a}}][-k]z^{-k})~.
\label{eq:zDomainPower}
\end{align}
By restricting $z$ to be on the unit circle in the complex plane, i.e., $z\in\{{\rm e}^{{\rm j}\frac{2\pit}{T_{\rm s}}}| 0\let <T_{\rm s}
\}$, the polynomial representation given in \eqref{eq:polySeq} corresponds to an \ac{OFDM} symbol in continuous time where $T_{\rm s}$ denotes the \ac{OFDM} symbol duration. Therefore, the {instantaneous envelope power} of an \ac{OFDM} symbol can be expressed as $|\polySeq[\textit{\textbf{a}}][{{\rm e}^{{\rm j}\frac{2\pit}{T_{\rm s}}}}]|^2$. By exploiting the identity given by $\polySeq[\textit{\textbf{a}}][z]^* = \polySeq[\textit{\textbf{a}}^*][z^{-1}]$ for $z={\rm e}^{{\rm j}\frac{2\pit}{T_{\rm s}}}$ and using \eqref{eq:zDomainPower}, the instantaneous envelope power can be written as a function of the \ac{APAC} of the sequence $\textit{\textbf{a}}$ as
\begin{align}
|\polySeq[\textit{\textbf{a}}][z]|^2 &
\bigg\rvert_{z={\rm e}^{{\rm j}\frac{2\pit}{T_{\rm s}}}}
= \sum_{k=-N+1}^{N-1}\apac[\textit{\textbf{a}}][k]{\rm e}^{{\rm j}\frac{2\pit}{T_{\rm s}}k}
~.
\label{eq:instantaneousPower}
\end{align}
By using \eqref{eq:instantaneousPower}, an upper bound for the \ac{PAPR} of an OFDM symbol generated through an arbitrary sequence $\textit{\textbf{a}}$ can be obtained as
\begin{align}
PAPR \triangleq \frac{\max|\polySeq[\textit{\textbf{a}}][z]|^2 }{\expectationOperator[|\polySeq[\textit{\textbf{a}}][z]|^2]}\bigg\rvert_{z={\rm e}^{{\rm j}\frac{2\pit}{T_{\rm s}}}} \le \frac{\apac[\textit{\textbf{a}}][0] +
2\sum_{k=1}^{N-1}|\apac[\textit{\textbf{a}}][k]|}{\apac[\textit{\textbf{a}}][0]}~.
\label{eq:paprBound}
\end{align}
The inequality in \eqref{eq:paprBound} indicates that a sequence which has smaller $|\apac[\textit{\textbf{a}}][k]|$ for $k\neq0$ also yields less fluctuation in time when the same sequence is used in frequency.
\subsection{Algebraic Representation of a Sequence}
\label{subsec:algebraic_sequence}
A generalized Boolean function is a function $f$ that maps from $\mathbb{Z}^m_2=\{(\monomial[1],\monomial[2],\dots, \monomial[m])| \monomial[j]\in\mathbb{Z}_2\}$ to $\mathbb{Z}_H$ as $f:\mathbb{Z}^m_2\rightarrow\mathbb{Z}_H$ where $H$ is an integer. It can be uniquely expressed as a linear combination of the monomials over $\mathbb{Z}_H$ as
\begin{align}
\hspace{-2mm}f(\textit{\textbf{x}})= \sum_{k=0}^{2^m-1} \coeffientsANF[k]\prod_{j=1}^{m} \monomial[j]^{\orderMonomial[j]} = \coeffientsANF[0]1+ \dots+ \coeffientsANF[2^m-1]\monomial[1]\monomial[2]\mydots\monomial[m]~,
\label{eq:ANF}
\end{align}
where the coefficient of each monomial belongs to $\mathbb{Z}_H$, i.e., $\coeffientsANF[k]\in \mathbb{Z}_H$, $k = \sum_{j=1}^{m}\orderMonomial[j]2^{m-j}$ for $\orderMonomial[j]\in\mathbb{Z}_2$, and $f(\textit{\textbf{x}})$ denotes the function $f(\monomial[1],\monomial[2],\dots, \monomial[m])$.
We associate a sequence $\textit{\textbf{f}}$ of length $2^m$ with the function $f(\monomial[1],\monomial[2],\dots, \monomial[m])$ by listing its values as $(\monomial[1],\monomial[2],\dots, \monomial[m])$ ranges over its $2^m$ values in lexicographic order (i.e., the most significant bit is $\monomial[1]$). In other words, the $(x +1)$th element of the sequence $\textit{\textbf{f}}$ is equal to $f(\textit{\textbf{x}})=f(\monomial[1],\monomial[2],\dots, \monomial[m])$ where $x = \sum_{j=1}^{m}\monomial[j]2^{m-j}$.
Let $\funczArbitrary[\textit{\textbf{x}}]$ be a function which maps $\textit{\textbf{x}}\in\mathbb{Z} _2^m$ to $\mathbb{R}$, and $\coefficientArbitrary[1]$ and $\coefficientArbitrary[2]$ are arbitrary real coefficients, and $\funcaArbitrary[\textit{\textbf{x}}]$ and $\funcbArbitrary[\textit{\textbf{x}}]$ are arbitrary Boolean functions which maps $\textit{\textbf{x}}\in\mathbb{Z} _2^m$ to $\mathbb{Z}_2$. Then the following identities hold true:
\begin{align}
\funczArbitrary[\textit{\textbf{x}}] =& \coefficientArbitrary[1](\funcaArbitrary[\textit{\textbf{x}}]\pm\funcbArbitrary[\textit{\textbf{x}}])_2 \nonumber \\ \stackrel{(\text{a})}{=} & \coefficientArbitrary[1]\funcaArbitrary[\textit{\textbf{x}}]+\coefficientArbitrary[1]\funcbArbitrary[\textit{\textbf{x}}] - 2\coefficientArbitrary[1](\funcaArbitrary[\textit{\textbf{x}}]\funcbArbitrary[\textit{\textbf{x}}])_2~,
\label{eq:identity2}
\\
\funczArbitrary[\textit{\textbf{x}}] =& \coefficientArbitrary[1](\funcaArbitrary[\textit{\textbf{x}}](1\pm\funcbArbitrary[\textit{\textbf{x}}]))_2-\coefficientArbitrary[1]((1\pm\funcaArbitrary[\textit{\textbf{x}}])\funcbArbitrary[\textit{\textbf{x}}])_2 \nonumber\\\stackrel{(\text{b})}{=} & \coefficientArbitrary[1]\funcaArbitrary[\textit{\textbf{x}}]-\coefficientArbitrary[1]\funcbArbitrary[\textit{\textbf{x}}]~,
\label{eq:identity4}
\\
\funczArbitrary[\textit{\textbf{x}}] =& \coefficientArbitrary[1]((1\pm\funcaArbitrary[\textit{\textbf{x}}])(1\pm\funcbArbitrary[\textit{\textbf{x}}]))_2-\coefficientArbitrary[1](\funcaArbitrary[\textit{\textbf{x}}]\funcbArbitrary[\textit{\textbf{x}}])_2 \nonumber\\=& \coefficientArbitrary[1](1\pm\funcaArbitrary[\textit{\textbf{x}}])_2-\coefficientArbitrary[1]\funcbArbitrary[\textit{\textbf{x}}] \stackrel{(\text{c})}{=} \coefficientArbitrary[1]-\coefficientArbitrary[1]\funcaArbitrary[\textit{\textbf{x}}]-\coefficientArbitrary[1]\funcbArbitrary[\textit{\textbf{x}}] ~,
\label{eq:identity5}
\end{align}
While
$(\text{a})$ is because $\funczArbitrary[\textit{\textbf{x}}] = 0$ when both $\funcaArbitrary[\textit{\textbf{x}}]$ and $\funcbArbitrary[\textit{\textbf{x}}]$ are $1$ or $0$, and $\funczArbitrary[\textit{\textbf{x}}] = \coefficientArbitrary[1]$ for $\funcaArbitrary[\textit{\textbf{x}}]\neq\funcbArbitrary[\textit{\textbf{x}}]$, the identify in \eqref{eq:identity4} is an application of \eqref{eq:identity2} and can be derived after the arguments of $(\cdot)_2$ are arranged in the form of summations of two Boolean functions. The identify in \eqref{eq:identity5} can be obtained by using \eqref{eq:identity4} and \eqref{eq:identity2} sequentially. We use the identities given in \eqref{eq:identity2}-\eqref{eq:identity5} to simplify the generalized Boolean functions in Section~\ref{sec:derivation-of-complementary-sequence-encoder}.
\subsection{Golay Complementary Pair and Complementary Sequence}
The sequence pair $(\textit{\textbf{a}},\textit{\textbf{b}})$ of length $N$ is a \ac{GCP} if
\begin{align}
\apac[\textit{\textbf{a}}][k]+\apac[\textit{\textbf{b}}][k] = 0,~~ \text{for}~ k\neq0~.
\label{eq:GCP}
\end{align}
The sequences $\textit{\textbf{a}}$ and $\textit{\textbf{b}}$ are referred to as \ac{CS}. By using the definition of \ac{GCP} and exploiting \eqref{eq:zDomainPower}, a GCP $(\textit{\textbf{a}},\textit{\textbf{b}})$ satisfies
\begin{align}
|\polySeq[\textit{\textbf{a}}][z]|^2+|\polySeq[\textit{\textbf{b}}][z]|^2\bigg\rvert_{z={\rm e}^{{\rm j}\frac{2\pit}{T_{\rm s}}}} =\apac[\textit{\textbf{a}}][0]+\apac[\textit{\textbf{b}}][0]~.
\label{eq:timeDomainGCP}
\end{align}
The instantaneous peak power of the corresponding \ac{OFDM} signal generated through a \ac{CS} $\textit{\textbf{a}}$ is bounded since
$\max_{t}|\polySeq[\textit{\textbf{a}}][{
{\rm e}^{{\rm j}\frac{2\pit}{T_{\rm s}}}
}]|^2 \le \apac[\textit{\textbf{a}}][0]+\apac[\textit{\textbf{b}}][0]$. Furthermore, based on \eqref{eq:timeDomainGCP}, the \ac{PAPR} of the signal is less than or equal to $2$ if $\apac[\textit{\textbf{a}}][0]=\apac[\textit{\textbf{b}}][0]$. Note that for a non-unimodular alphabet, $\apac[\textit{\textbf{a}}][0]$ can be different from $\apac[\textit{\textbf{b}}][0]$. For example, $\textit{\textbf{a}}=(1,3,-1, 1)$ and $\textit{\textbf{b}}=(1,1,-1,-1)$ satisfy \eqref{eq:timeDomainGCP}, and $\apac[\textit{\textbf{a}}][0]=12$ and $\apac[\textit{\textbf{b}}][0]=4$.
A general recursive \ac{GCP} construction based on Budi{\v s}in's constructions in \cite{Budisin_1990, Budisin_1990_ml, Garcia_2010_ml, garcia_2013} can be given as follows:
\begin{theorem}[\cite{Budisin_1990, Budisin_1990_ml, Garcia_2010_ml, garcia_2013}]
\label{th:golayIterative}
Let $(\textit{\textbf{a}},\textit{\textbf{b}})$ be a \ac{GCP} of length $N$ and assume that the following operations occur at the $n$th step:
\begin{align}
\polySeq[{\seqGaIt[n]}][z] =&\angleScaleA[n][]\scaleA[n] \polySeq[{\seqGaIt[n-1]}][z]
+ \angleScaleB[n][]\scaleB[n]\angleGolay[n]\polySeq[{\seqGbIt[n-1]}][z] z^{\separationGolay[n]} w^{2^\permutationShift[{n}]}~, \nonumber\\
\polySeq[{\seqGbIt[n]}][z] =& \angleScaleB[n][*]\scaleB[n]\polySeq[{\seqGaIt[n-1]}][z]
- \angleScaleA[n][*] \scaleA[n]\angleGolay[n]\polySeq[{\seqGbIt[n-1]}][z] z^{\separationGolay[n]} w^{2^\permutationShift[{n}]}~,
\label{eq:iterationGolay}
\end{align}
where $\seqGaIt[0]=\textit{\textbf{a}}$, $\seqGbIt[0]=\textit{\textbf{b}}$,
$\scaleA[n],\scaleB[n]\in \mathbb{R}_{0}^{+}$
are the scalars, $z^{\separationGolay[n]}$ is the shifting factor where $\separationGolay[n]\in \mathbb{Z}$, $\angleScaleA[n][],\angleScaleB[n][],\angleGolay[n],w\in \{u:u\in\mathbb{C}, |u|=1\}$ are arbitrary complex numbers of unit magnitude for $n=1,2,\mydots,m$, and $\permutationShift[{n}]$ is the $n$th element of the sequence $\bm{\psi}=(\permutationShift[{n}])_{i=1}^{m}$ defined by a permutation of $\{0,1,\dots,m-1\}$. The sequences $\seqGaIt[m]$ and $\seqGbIt[m]$ then construct a GCP for $m\ge 1$.
\end{theorem}
Note that Theorem~\ref{th:golayIterative} does not show how to generate distinct \acp{CS}. The same recursion where the initial sequences $\textit{\textbf{a}}=\textit{\textbf{b}}=1$, $w=z$, and $\separationGolay[n]=0$ for $n=1,2,\mydots,m$ is investigated under paraunitary matrices in \cite{budisin_2018}. The coefficients of the polynomial at the final step are obtained by indexing the elements of the unitary matrices in \cite{budisin_2018}. The unique \acp{CS} are generated by using the properties of Gaussian integers for \ac{QAM} alphabet.
\section{Algebraic Structure of A Recursion}\label{sec:encoding-with-an-iterative-process}
Let $\functionf[n]$ and $\functiong[n]$ for $n=1,2,\dots,m$ be functions in a function space $\mathcal{F}$, generated by the following recursion:
\begin{align}
\functionf[n] = \operator[11][{n}]({\functionf[n-1]}) + \operator[12][{n}]({\functiong[n-1]})w^{2^\permutationShift[{n}]}~, \nonumber\\
\functiong[n] = \operator[21][{n}]({\functionf[n-1]}) + \operator[22][{n}]({\functiong[n-1]})w^{2^\permutationShift[{n}]}~,
\label{eq:iterationBasic}
\end{align}
where $w$ is an arbitrary complex number, $\permutationShift[{n}]$ is the $n$th element of the sequence $\bm{\psi}\triangleq(\permutationShift[{n}])_{i=1}^{m}$ defined by a permutation of $\{0,1,\dots,m-1\}$, $\operator[ij][{n}]\in\{\operatorBinary[0][n],\operatorBinary[1][n]\}$ is a linear operator which transforms one function to another function in $\mathcal{F}$, and $\functionf[0]=\functiong[0]=r$. Since $\bm{\psi}$ includes all non-negative integers less than $m$ and $\operatorBinary[0][n]$ and $\operatorBinary[1][n]$ are linear operators, $\functionf[m]$ and $\functiong[m]$ can be obtained as
\begin{align}
\functionf[m] = \sum_{x=0}^{2^m-1} \overbrace{\operatorBinary[{\funcGfForANF[m](\textit{\textbf{x}})}][m]\circ\dots\circ\operatorBinary[\funcGfForANF[2](\textit{\textbf{x}})][2]\circ\operatorBinary[\funcGfForANF[1](\textit{\textbf{x}})][1](r)}^{\compositeOperatorF[x][r] }w^x ~,
\label{eq:finalSequenceFBasic}
\end{align}
and
\begin{align}
\functiong[m] = \sum_{x=0}^{2^m-1} \overbrace{ \operatorBinary[\funcGgForANF[m](\textit{\textbf{x}})][m]\circ\dots\circ\operatorBinary[\funcGgForANF[2](\textit{\textbf{x}})][2]\circ\operatorBinary[\funcGgForANF[1](\textit{\textbf{x}})][1](r)}^{\compositeOperatorG[x][r] }w^x~,
\label{eq:finalSequenceGBasic}
\end{align}
where $\funcGfForANF[n](\textit{\textbf{x}})$ and $\funcGgForANF[n](\textit{\textbf{x}})$ are the Boolean functions. The Boolean functions $\funcGfForANF[n](\textit{\textbf{x}})$ and $\funcGgForANF[n](\textit{\textbf{x}})$ show which of the two operators, i.e., $\operatorBinary[0][n]$ and $\operatorBinary[1][n]$, are involved in the construction of $\compositeOperatorF[x][r]$ and $\compositeOperatorG[x][r]$ by setting the indices as $\operatorBinary[{\funcGfForANF[n](\textit{\textbf{x}})}][n]$ and $\operatorBinary[{\funcGgForANF[n](\textit{\textbf{x}})}][n]$, respectively. Hence, they are sufficient to obtain $\functionf[m]$ and $\functiong[m]$.
\begin{definition} [Construction sequences]
The sequences $\seqGf[n]\triangleq(\eleSeqf[{n,i}])_{i=0}^{2^m-1} \in \mathbb{Z}_2^{2^m} $ and $\seqGg[n]\triangleq(\eleSeqg[{n,i}])_{i=0}^{2^m-1} \in \mathbb{Z}_2^{2^m}$ associated with $\funcGfForANF[n](\textit{\textbf{x}})$ and $\funcGgForANF[n](\textit{\textbf{x}})$ are the $n$th construction sequences of $\functionf[m]$ and $\functiong[m]$ for $n=1,2,\dots,m$, respectively.
\end{definition}
\begin{lemma} (Algebraic representation of the construction sequences)
\label{th:framework}
Let $\vecArrangement[n]$ be a configuration vector defined by
$\vecArrangement[n]^{\rm T} \triangleq
[
\binaryAsignment[11][{n}]~\binaryAsignment[12][{n}]~
\binaryAsignment[21][{n}]~\binaryAsignment[22][{n}]
]\in \mathbb{Z}_2^4$, where $\binaryAsignment[ij][{n}]=0$ if $\operator[ij][{n}] = \operatorBinary[0][{n}]$ and $\binaryAsignment[ij][{n}]=1$ if $\operator[ij][{n}] = \operatorBinary[1][{n}]$. Then, $\funcGfForANF[n](\textit{\textbf{x}})$ and $\funcGgForANF[n](\textit{\textbf{x}})$ are the Boolean functions
given by
\begin{align}
\funcGfForANF[n](\textit{\textbf{x}}) &=
\begin{cases}
\displaystyle
\binaryAsignment[11][{n}] (1 - \monomial[{\permutationMono[{n}]}]) +
\binaryAsignment[12][{n}]\monomial[{\permutationMono[{n}]}]
& n=m \\
\displaystyle
\binaryAsignment[11][{n}](1- \monomial[{\permutationMono[{n}]}])(1 - \monomial[{\permutationMono[{n+1}]}]) \\~~~~+
\binaryAsignment[12][{n}]{\monomial[{\permutationMono[{n}]}]}(1 - \monomial[{\permutationMono[{n+1}]}]) \\~~~~+
\binaryAsignment[21][{n}](1 - \monomial[{\permutationMono[{n}]}])\monomial[{\permutationMono[{n+1}]}] \\~~~~+
\binaryAsignment[22][{n}]{\monomial[{\permutationMono[{n}]}]}\monomial[{\permutationMono[{n+1}]}]
& n<m \\
\end{cases}~, \label{eq:closedformANFsF}
\end{align}
\begin{align}
\funcGgForANF[n](\textit{\textbf{x}}) &=
\begin{cases}
\displaystyle
\binaryAsignment[21][{n}] (1 - \monomial[{\permutationMono[{n}]}]) +
\binaryAsignment[22][{n}]\monomial[{\permutationMono[{n}]}]
& n=m \\
\displaystyle
\binaryAsignment[11][{n}](1- \monomial[{\permutationMono[{n}]}])(1 - \monomial[{\permutationMono[{n+1}]}]) \\~~~~+
\binaryAsignment[12][{n}]{\monomial[{\permutationMono[{n}]}]}(1 - \monomial[{\permutationMono[{n+1}]}]) \\~~~~+
\binaryAsignment[21][{n}](1 - \monomial[{\permutationMono[{n}]}])\monomial[{\permutationMono[{n+1}]}] \\~~~~+
\binaryAsignment[22][{n}]{\monomial[{\permutationMono[{n}]}]}\monomial[{\permutationMono[{n+1}]}]
& n<m \\
\end{cases}~,
\label{eq:closedformANFsG}
\end{align}
for $n=1,2,\dots,m$, where $\permutationMono[n]=m - \permutationShift[n]$ is the $n$th element of the sequence $\bm{\pi}\triangleq(\permutationMono[n])_{n=1}^{m}$.
\end{lemma}
The proof for Lemma~\ref{th:framework} is given in Appendix~\ref{app:algConstruction}.
For a given configuration vector $\vecArrangement[n]$, Lemma~\ref{th:framework} reveals the algebraic structure of the $n$th construction sequence concisely. Since there exist $16$ possible options for the $n$th configuration vector $\vecArrangement[n]$, an immediate conclusion is that there also exist $16$ different possible Boolean functions for each step in the recursion given in \eqref{eq:iterationBasic}.
\begin{example}
\rm Assume the operator configuration given by $\operator[11][{n}]=\operator[12][{n}]=\operator[21][{n}]=\operatorBinary[0][{n}]$ and $\operator[22][{n}]=\operatorBinary[1][{n}]$ for all iterations, $m = 2$, and $\bm{\psi}=(0,1)$.
When $n = 1$,
\begin{align}
\functionf[1] &=
\operatorBinary[0][1]
({r})
+
\operatorBinary[0][{1}]
({r})
w~, \nonumber\\
\functiong[1] &=
\operatorBinary[0][{1}]
({r})
+
\operatorBinary[1][1]
({r})
w~.\nonumber
\end{align}
When $n = 2$,
\begin{align}
\functionf[2] &=
\operatorBinary[0][2]
\operatorBinary[0][1]
({r})
+
\operatorBinary[0][2]
\operatorBinary[0][{1}]
({r})
w\nonumber
\\&~~~~~~~~~~~~~~~~~~~~
+
\operatorBinary[0][2]
\operatorBinary[0][1]
({r})
w^2
+
\operatorBinary[0][2]
\operatorBinary[1][1]
({r})
w^3
~, \nonumber\\
\functiong[2] &=
\operatorBinary[0][2]
\operatorBinary[0][1]
({r})
+
\operatorBinary[0][2]
\operatorBinary[0][{1}]
({r})
w\nonumber
\\&~~~~~~~~~~~~~~~~~~~~~
+
\operatorBinary[1][2]
\operatorBinary[0][1]
({r})
w^2
+
\operatorBinary[1][2]
\operatorBinary[1][1]
({r})
w^3
~.\nonumber
\end{align}
By investigating the distribution of the operators at the final polynomial, i.e., when $n = m = 2 $, the corresponding construction sequences related to the first and the second steps are obtained as
$\seqGf[1] = (0,0,0,1)$,
$\seqGf[2] = (0,0,0,0)$,
$\seqGg[1] = (0,0,0,1)$, and
$\seqGg[2] = (0,0,1,1)$.
\label{ex:signConstructionSequences}
\end{example}
\begin{example}
\rm Consider the recursion given in Example \ref{ex:signConstructionSequences}. Since the recursion is configured as $\operator[11][{n}]=\operator[12][{n}]=\operator[21][{n}]=\operatorBinary[0][{n}]$ and $\operator[22][{n}]=\operatorBinary[1][{n}]$ for all iterations, the configuration vector is obtained as $ \vecArrangement[n]^{\rm T} =[0~0~0~1]$ for $n=\{1,2\}$. Hence, by using \eqref{eq:closedformANFsF} and \eqref{eq:closedformANFsG}, $\funcGfForANF[n](\textit{\textbf{x}})$ and $\funcGgForANF[n](\textit{\textbf{x}})$ are obtained as
\begin{align}
\funcGfForANF[n](\textit{\textbf{x}}) &= \begin{cases}
0, & \text{if}~n=m\\
\monomial[{\permutationMono[{n}]}]\monomial[{\permutationMono[{n+1}]}], & \text{if}~n<m
\end{cases}~,\nonumber
\end{align}
and
\begin{align}
\funcGgForANF[n](\textit{\textbf{x}}) = \begin{cases}
\monomial[{\permutationMono[{m}]}], & \text{if}~n=m\\
\monomial[{\permutationMono[{n}]}]\monomial[{\permutationMono[{n+1}]}], & \text{if}~n<m
\end{cases}~,\nonumber
\end{align}
respectively. Since $\permutationMono[n] = m - \permutationShift[n]$ and $\bm{\psi}=(0,1)$, the Boolean functions associated with the construction sequences $\seqGf[1]$, $\seqGf[2]$, $\seqGg[1]$, and $\seqGf[2]$ are obtained as $\funcGfForANF[1](\textit{\textbf{x}}) = \monomial[{\permutationMono[{1}]}]\monomial[{\permutationMono[{2}]}] = \monomial[2]\monomial[{1}]$, $
\funcGfForANF[2](\textit{\textbf{x}}) = 0$, $\funcGgForANF[1](\textit{\textbf{x}}) = \monomial[{\permutationMono[{1}]}]\monomial[{\permutationMono[{2}]}] = \monomial[2]\monomial[{1}]$, and $
\funcGfForANF[2](\textit{\textbf{x}}) = \monomial[{\permutationMono[{2}]}] = \monomial[1]$, respectively,
which yield to the same sequences obtained in Example \ref{ex:signConstructionSequences}.
\end{example}
\section{A Generic Complementary Sequence Encoder}\label{sec:derivation-of-complementary-sequence-encoder}
In this section, we utilize the framework established in Section~\ref{sec:encoding-with-an-iterative-process} to develop a generic complementary sequence encoder by extracting the algebraic structure for the recursion given in Theorem~\ref{th:golayIterative}, which forms our main theorem as follows:
\begin{theorem}[Main Theorem]
\label{th:reduced}
Let $(\textit{\textbf{a}},\textit{\textbf{b}})$ be a \ac{GCP} of length $N$ and $\bm{\pi}=(\permutationMono[n])_{n=1}^{m}$ be a sequence defined by a permutation of $\{1,2,\dots,m\}$. For any $\separationGolay[n]\in \mathbb{Z}_{0}^{+}$, $\scaleEexp[n],e'\in\mathbb{R}$, and $\angleexpAll[n],k', k'' \in[0,H)$ for $n=1,2,\mydots,m$, let
\begin{align}
&f_{\rm r}(\textit{\textbf{x}})
=\scaleEexp[m]\monomial[{\permutationMono[{m}]}]+{ \sum_{n=1}^{m-1}\scaleEexp[n](\monomial[{\permutationMono[{n}]}] +\monomial[{\permutationMono[{n+1}]}])_2 }+e'\label{eq:realPartReduced}~,
\\
&g_{\rm r}(\textit{\textbf{x}})
=\scaleEexp[m](1-\monomial[{\permutationMono[{m}]}])_2+{ \sum_{n=1}^{m-1}\scaleEexp[n](\monomial[{\permutationMono[{n}]}] +\monomial[{\permutationMono[{n+1}]}])_2 }+e'\label{eq:realPartReducedG}~,
\\
&f_{\rm i}(\textit{\textbf{x}})
= {\frac{H}{2}\sum_{n=1}^{m-1}\monomial[{\permutationMono[{n}]}]\monomial[{\permutationMono[{n+1}]}]}+\sum_{n=1}^m \angleexpAll[n]\monomial[{\permutationMono[{n}]}]+ k'\label{eq:imagPartReduced}~,
\\
&g_{\rm i}(\textit{\textbf{x}})
= {\frac{H}{2}\left(\monomial[{\permutationMono[{m}]}]+\sum_{n=1}^{m-1}\monomial[{\permutationMono[{n}]}]\monomial[{\permutationMono[{n+1}]}]\right)}_2+\sum_{n=1}^m \angleexpAll[n]\monomial[{\permutationMono[{n}]}]+ k''\label{eq:imagPartReducedG}~,
\\
&f_{\rm s}(\textit{\textbf{x}}) =\sum_{n=1}^m\separationGolay[n]\monomial[{\permutationMono[{n}]}]~,
\label{eq:shift}
\\
&f_{\rm o}(\textit{\textbf{x}},z)=\polySeq[{\textit{\textbf{a}}}][z](1-\monomial[{\permutationMono[{1}]}])_2+\polySeq[{\textit{\textbf{b}}}][z]\monomial[{\permutationMono[{1}]}]~.\label{eq:order}
\end{align}
Then, the sequences $\textit{\textbf{c}}$ and $\textit{\textbf{d}}$ where their polynomial representations are given by
\begin{align}
\polySeq[{\textit{\textbf{c}}}][z] &=
\sum_{x=0}^{2^m-1}
f_{\rm o}(\textit{\textbf{x}},z)\times
\xi^{f_{\rm r}(\textit{\textbf{x}}) + {\rm j} f_{\rm i}(\textit{\textbf{x}})}\times
z^{f_{\rm s}(\textit{\textbf{x}}) + xN}\label{eq:encodedFOFDMonly}\\
\polySeq[{\textit{\textbf{d}}}][z] &=
\sum_{x=0}^{2^m-1}
f_{\rm o}(\textit{\textbf{x}},z)\times
\xi^{g_{\rm r}(\textit{\textbf{x}}) + {\rm j} g_{\rm i}(\textit{\textbf{x}})}\times
z^{f_{\rm s}(\textit{\textbf{x}}) + xN}\label{eq:encodedGOFDMonly}
\end{align}
construct a \ac{GCP} of length $\lengthGaGb2^m+\sum_{n=1}^m\separationGolay[n]$, where $\xi={\rm e}^{\frac{2\pi}{H}}$.
\end{theorem}
The proof is given in Appendix~\ref{app:red} which results in following remark:
\begin{corollary}
\label{co:RecAlg}
Let $\scaleA[n]=\xi^{\scaleAexp[n]}$, $\scaleB[n]=\xi^{\scaleBexp[n]}$,
$\angleScaleA[n][]=\xi^{{\rm j}\angleScaleAexp[n]}$,
$\angleScaleB[n][]=\xi^{{\rm j}\angleScaleBexp[n]}$,
and $\angleGolay[n]=\xi^{{\rm j}\angleexp[n]}$.
Theorem~\ref{th:golayIterative} and Theorem~\ref{th:reduced} lead to identical \ac{GCP} if $\scaleEexp[n|n=1,2,\mydots,m]=\scaleBexp[n]-\scaleAexp[n]$, $e'= \sum_{n=1}^{m}\scaleAexp[n]$,
$\angleexpAll[1] =\angleexp[1]+\angleScaleBexp[1]-\angleScaleAexp[1]$, $
\angleexpAll[n|n=2,3,\mydots,m]=\angleexp[n]+\angleScaleBexp[n]-\angleScaleAexp[n]-\angleScaleBexp[n-1]-\angleScaleAexp[n-1]$, $k' = \sum_{n=1}^{m}\angleScaleAexp[n]$, and $k'' = -\angleScaleBexp[{m}] + \sum_{n=1}^{m-1}\angleScaleAexp[{n}]$.
\end{corollary}
\subsection{Comparison}
Theorem~\ref{th:reduced} extends the Davis and Jedwab's results in \cite{davis_1999} by considering both amplitude and phase of the elements of the generated \ac{CS}, which can be manipulated independently via two different Boolean functions. The parameters $\scaleEexp[n]$ for $n=1,2,\mydots,m$ and $e'$ change the real part of the exponent of $\xi$, which is beneficial to synthesize \acp{CS} with various amplitude levels without affecting the phase of the elements. Hence, this separation can be useful for a decoder as the underlying algebraic structure for the amplitude is independent from the one for the phase. In addition, it provides a unified algebraic framework for synthesizing \acp{CS} with various alphabets through the parameters $\scaleEexp[n]$ and $e'$, and $\angleexpAll[n]$ and $k'$.
Since $\angleexpAll[n]$ and $k'$ are in $[0,H)$, i.e., a range rather than $\mathbb{Z}_H$, it also offers flexibility in phase. It is worth noting that although the offset method synthesizes a large number sequences with \ac{QAM} alphabet, it does not offer an explicit separation between the amplitude and phase algebraically \cite{robing_2001, Chong_2003, Zeng_2014, Chong_2002, Li_2008, Lee_2006, Chang_2010, Jiang_2016,Tarokh_2003, Liu_2014, Li_2010}. Both paraunitary matrix-based construction in \cite{budisin_2018} and our framework originates from the Budisin's recursive constructions. However, the concise algebraic structures for the amplitude, shifting factors, and the initial sequences are not discussed in \cite{budisin_2018}.
\begin{example}
\rm
Let $m=3$, $\bm{\pi}=(2,1,3)$,
$\scaleEexp[n|n=2,3]=0$, $\scaleEexp[n|n=1]=\frac{2}{\pi}\ln(3)$,
$e'=0$,
$H=4$,
$\angleexpAll[n|n=1,2,3]=0$, $k'=0$,
$\separationGolay[n|n=1,2,3]=0$, $\textit{\textbf{a}} =\textit{\textbf{b}} = (1)$. Based on Theorem~\ref{th:reduced}, the basis vectors for $f_{\rm r}(\textit{\textbf{x}})$ can be listed as
\begin{align}
\monomial[{\permutationMono[{3}]}] = & (0, 1 , 0 , 1 , 0 , 1 , 0 , 1) \nonumber\\
\monomial[{\permutationMono[{2}]}] +\monomial[{\permutationMono[{3}]}] = & (0, 1, 0, 1, 1, 0, 1, 0) \nonumber\\
\monomial[{\permutationMono[{1}]}] +\monomial[{\permutationMono[{2}]}] = & (0, 0, 1, 1, 1, 1, 0, 0) \nonumber\\
1 = & ( 1, 1, 1, 1, 1, 1, 1, 1)
\nonumber
\end{align}
and $f_{\rm r}(\textit{\textbf{x}})$ leads to the sequence $(0,0,\scaleEexp[1],\scaleEexp[1],\scaleEexp[1],\scaleEexp[1],0,0)$. While the function $f_{\rm i}(\textit{\textbf{x}})$ gives the sequence
$(0,0,0,0,2,2,0,0)$, the function $f_{\rm o}(\textit{\textbf{x}},z) =\polySeq[{\textit{\textbf{a}}}][z](1-\monomial[{\permutationMono[{1}]}])_2+\polySeq[{\textit{\textbf{b}}}][z]\monomial[{\permutationMono[{1}]}] = \polySeq[{\textit{\textbf{a}}}][z](1-\monomial[2])_2+\polySeq[{\textit{\textbf{b}}}][z]\monomial[2] = 1$ results in $(1,1,1,1,1,1,1,1)$. Since $\separationGolay[n|n=1,2,3]=0$, the function $f_{\rm s}(\textit{\textbf{x}}) $ gives a zero sequence. Finally, combining all functions with \eqref{eq:encodedFOFDMonly}, the sequence $\textit{\textbf{c}}$ is obtained as $(1,1,3,3,3,-3,-1,1)$
\label{ex:synthesis}
\end{example}
Theorem~\ref{th:reduced} yields \acp{GCP} and \acp{CS} of length $N\cdot 2^m$ when a seed \ac{GCP} $(\textit{\textbf{a}},\textit{\textbf{b}})$ of length $N>1$ is utilized, respectively. If $\scaleEexp[n]$, $e'$, and $\separationGolay[n]$ are set to $0$, $\angleexpAll[n],k',k''\in\mathbb{Z}_H$, and $\textit{\textbf{a}}=\textit{\textbf{b}}=1$, Theorem~\ref{th:reduced} is reduced to the Davis and Jedwab's algebraic method derived in \cite{davis_1999} and synthesizes the standard \acp{GCP} of length $2^m$. On the other hand, under the same configuration, it determines $m!\cdotH^{m+1}$ \acp{CS} for $N>1$, which is different from the result obtained in \cite{davis_1999}. This is due to the fact that $f_{\rm o}(\textit{\textbf{x}},z)$ is a function of $\monomial[{\permutationMono[{1}]}]$. Hence, when the elements of $\bm{\pi}$ are reversed, the positions of the functions generated through the initial sequences, i.e., $\polySeq[{\textit{\textbf{a}}}][z]$ and $\polySeq[{\textit{\textbf{a}}}][z]$, change in \eqref{eq:encodedFOFDMonly} although $\xi^{ {\rm j} f_{\rm i}(\textit{\textbf{x}})}$ remains unchanged. Note that the initial sequences $(\textit{\textbf{a}},\textit{\textbf{b}})$ can yield to the \acp{CS} to be compatible with the resource allocation size in major wireless standards. For example, the minimum resource allocation in the frequency domain is $12$ for 5G NR or LTE. Therefore, the complementary sequences should be integer multiple of $12$. However, the length of available QAM-based complementary sequences in the literature (e.g., \cite{budisin_2018}) is typically $2^m$. The extension is not straightforward without Theorem~\ref{th:reduced}.
\begin{figure*}[t]
\centering
{\includegraphics[width =5.5in]{gm_cropped.pdf}
}
\caption{Complementary sequence generated by Theorem~\ref{th:reduced} and using it with an \ac{OFDM} transmitter.}
\label{fig:gm}
\end{figure*}
\begin{example}
\rm
Consider the parameters in Example~\ref{ex:synthesis} and replace $\textit{\textbf{a}}$ and $\textit{\textbf{b}}$ as $\textit{\textbf{a}} = (1,{\rm j},1,1,1,-1)$, and $\textit{\textbf{b}} = (1,{\rm j},1,-1,-1,1)$ \cite{holzmann_1991}. For $\bm{\pi}=(2,1,3)$, the function $f_{\rm o}(\textit{\textbf{x}},z) = \polySeq[{\textit{\textbf{a}}}][z](1-\monomial[{\permutationMono[{1}]}])_2+\polySeq[{\textit{\textbf{b}}}][z]\monomial[{\permutationMono[{1}]}] = \polySeq[{\textit{\textbf{a}}}][z](1-\monomial[2])_2+\polySeq[{\textit{\textbf{b}}}][z]\monomial[2] $ results in $(\polySeq[{\textit{\textbf{a}}}][z],\polySeq[{\textit{\textbf{a}}}][z],\polySeq[{\textit{\textbf{b}}}][z],\polySeq[{\textit{\textbf{b}}}][z],\polySeq[{\textit{\textbf{a}}}][z],\polySeq[{\textit{\textbf{a}}}][z],\polySeq[{\textit{\textbf{b}}}][z],\polySeq[{\textit{\textbf{b}}}][z])$. Therefore, the resulting sequence $\textit{\textbf{c}}$ can be expressed as $(\textit{\textbf{a}},\textit{\textbf{a}},3\cdot\textit{\textbf{b}},3\cdot\textit{\textbf{b}},3\cdot\textit{\textbf{a}},-3\cdot\textit{\textbf{a}},-\textit{\textbf{b}},\textit{\textbf{b}})$ from \eqref{eq:encodedFOFDMonly}. Now assume the order of the elements in $\pi$ are reversed. The function $f_{\rm o}(\textit{\textbf{x}},z) = \polySeq[{\textit{\textbf{a}}}][z](1-\monomial[3])_2+\polySeq[{\textit{\textbf{b}}}][z]\monomial[3]$ then gives $(\polySeq[{\textit{\textbf{a}}}][z],\polySeq[{\textit{\textbf{b}}}][z],\polySeq[{\textit{\textbf{a}}}][z],\polySeq[{\textit{\textbf{b}}}][z],\polySeq[{\textit{\textbf{a}}}][z],\polySeq[{\textit{\textbf{b}}}][z],\polySeq[{\textit{\textbf{a}}}][z],\polySeq[{\textit{\textbf{b}}}][z])$, while $f_{\rm r}(\textit{\textbf{x}})$ and $f_{\rm i}(\textit{\textbf{x}})$ remains the same. The final sequence is obtained as $\textit{\textbf{c}}=(\textit{\textbf{a}},\textit{\textbf{b}},3\cdot\textit{\textbf{a}},3\cdot\textit{\textbf{b}},3\cdot\textit{\textbf{a}},-3\cdot\textit{\textbf{b}},-\textit{\textbf{a}},\textit{\textbf{b}})$, which is different from the original one as the order of the initial sequences changed.
\label{ex:init}
\end{example}
In the literature, the construction methods mainly focus on contiguous \acp{CS}, i.e., \acp{CS} with no zero elements \cite{robing_2001, Chong_2003, Zeng_2014, Chong_2002, Li_2008, Lee_2006, Chang_2010, Jiang_2016,Tarokh_2003, Liu_2014, Li_2010, budisin_2018}. In contrast,
Theorem~\ref{th:reduced} explains how to generate non-contiguous \ac{CS} algebraically when $\separationGolay[n]\neq 0$ since the parameters $\separationGolay[n|n=1,2,\mydots,m]$ change the exponent of $z$, i.e., $f_{\rm s}(\textit{\textbf{x}})+xN$ in \eqref{eq:encodedFOFDMonly}.
When $z^{f_{\rm s}(\textit{\textbf{x}})+xN}$ is multiplied with $f_{\rm o}(\textit{\textbf{x}},z)$, either the sequence $\textit{\textbf{a}}$ or $\textit{\textbf{b}}$ based on $\monomial[{\permutationMono[{1}]}]$ is padded by $f_{\rm s}(\textit{\textbf{x}})+xN$ zeros in the $z$-domain. If $f_{\rm s}(\textit{\textbf{x}})\neq0$, the support of the initial sequences can be disjoint or intersect with each other. In other words, Theorem~\ref{th:reduced} gives flexibility to adjust the location of the sequences. Note that the overlapping can be avoided if the condition given by
\begin{align}
\separationGolay[k|{\permutationMono[{k}]=a}] \ge \sum_{\ell\in \{l| {\permutationMono[{l}]>a}\}} \separationGolay[\ell]~,
\label{eq:conditionNoOverlapping}
\end{align}
holds true for $1\le a\le m-1$ and $\separationGolay[n]\ge 0$. If \eqref{eq:conditionNoOverlapping} is satisfied, the alphabet for the non-zero elements of the sequence remains the same.
\begin{example}
\rm
Consider the parameters given in Example~\ref{ex:synthesis}. Let $\textit{\textbf{a}} = (1,{\rm j},1)$, and $\textit{\textbf{b}} = (1,1,-1)$ \cite{holzmann_1991}. The final sequence $\textit{\textbf{c}}$ becomes $(\textit{\textbf{a}},\textit{\textbf{a}},3\cdot\textit{\textbf{b}},3\cdot\textit{\textbf{b}},3\cdot\textit{\textbf{a}},-3\cdot\textit{\textbf{a}},-\textit{\textbf{b}},\textit{\textbf{b}})$. Now assume that $\separationGolay[n|n=1,3]=0$, $\separationGolay[2]=60$.
The function $f_{\rm s}(\textit{\textbf{x}}) $ leads to $(0,0,0,0,60,60,60,60)$. Hence, from \eqref{eq:encodedFOFDMonly}, the support of the last four parts of $\textit{\textbf{c}}$ are shifted by $60$. The resulting sequences can be expressed as
\begin{align}
\textit{\textbf{c}} = (\textit{\textbf{a}},\textit{\textbf{a}},3\cdot\textit{\textbf{b}},3\cdot\textit{\textbf{b}},\overbrace{0,\mydots,0}^{\separationGolay[2]=60},3\cdot\textit{\textbf{a}},-3\cdot\textit{\textbf{a}},-\textit{\textbf{b}},\textit{\textbf{b}})\nonumber
\end{align}
In other words, a non-contiguous \ac{CS} with two clusters of length of $12$ separated by $\separationGolay[2]=60$ zero elements is obtained where the alphabet on the clusters remains the same. If the sequence $\textit{\textbf{c}}$ is utilized in the frequency for an \ac{OFDM}-based system,
the corresponding signal achieves frequency diversity via two well-separated clusters while maintaining \ac{PAPR} to be less than or equal to $2$.
\end{example}
The polynomial \eqref{eq:encodedFOFDMonly} in Theorem~\ref{th:reduced} can be expressed as an encoding structure employed in an \ac{OFDM} transmitter as given in \figurename~\ref{fig:gm}. At the transmitter,
the mapping blocks can assign the information bits to $\pi$, $\scaleEexp[n]$, $e'$, $\angleexpAll[n]$, $k'$, and $\separationGolay[n]$ for $n=1,2,\mydots,m$. The amplitude encoder, phase encoder, and shift encoder are $f_{\rm r}(\textit{\textbf{x}})$, $f_{\rm i}(\textit{\textbf{x}})$, and $f_{\rm s}(\textit{\textbf{x}})+ xN$,
respectively. The initial sequences $\textit{\textbf{a}}$ and $\textit{\textbf{b}}$ are first re-ordered based on $f_{\rm o}(\textit{\textbf{x}},z)$ in the $z$-domain. While the phase encoder changes the phase of the sequences, the amplitude encoder scales the sequences
at the output of the order encoder. The shift encoder pads zeros to the beginning of the sequences. After
the summation of all modified sequences, the resulting sequence, denoted by $\textit{\textbf{c}}$ in \figurename~\ref{fig:gm}, is an
encoded complementary sequence.
\subsection{QAM Compatibility}
\label{sec:QAM}
In this study, we define a $4s^2$-QAM constellation as a set of points given by $S_{\rm QAM}=\{(2u-1)+{\rm j}(2v-1)|u,v\in\mathbb{Z},-s<u,v\les\}$ where $s\in\mathbb{Z}$ and $s\ge1$. Based on this definition, we provide further notations as follows:
\begin{itemize}
\item There exist $N_{\rm quad}=s^2$ points in one quadrant in the complex plane. We denote $S_{\rm quad}$ as the set of the points on the first quadrant.
\item There exist $N_{\rm h}=s$ points in $S_{\rm quad}$ on the $xy$-diagonal. We denote $S_{\rm h}$ as the set of the points in $S_{\rm quad}$ on the $xy$-diagonal.
\item There exist $N_{\rm nh}=s(s-1)/2$ points below or above the $xy$-diagonal on the first quadrant. The symbols $S_{\rm nh}^{+}$ and $S_{\rm nh}^{-}$ denote the sets of points in $S_{\rm quad}$ below the $xy$-diagonal and the sets of points in $S_{\rm quad}$ above the $xy$-diagonal on the first quadrant, respectively.
\item There exist $N_{\rm tri}=s(s+1)/2$ points in $S_{\rm tri} \triangleq S_{\rm h} \cup S_{\rm nh}^{-}$.
\end{itemize}
\begin{figure}[]
\centering
{\includegraphics[width =1.5in]{qamDef_cropped.pdf}
}
\caption{Illustration of the parameters for QAM constellation.}
\label{fig:QAMconstellationDef}
\end{figure}
Let $p$ be any point in $S_{\rm quad}$ and $p'$ be a point that is symmetric to $p$ about the $xy$-diagonal axis.
The distance between $p$ and the origin, the ratio between $\distanceToPoint[u,v]$ and $\distanceToPoint[1,1]$, the angle between the vector that passes through $p$ and $x$-axis, the angle between the vector that passes through $p$ and the $xy$-diagonal axis, and the angle between the vector that passes through $p'$ and the vector that passes through $p$ can be calculated as
\begin{align}
\distanceToPoint[u,v] &= \sqrt{(2u-1)^2+(2v-1)^2}~, \nonumber\\
\ratioBetweenDistanceAndInner[u,v] &= \frac{\distanceToPoint[u,v]}{\distanceToPoint[1,1]}=\frac{\distanceToPoint[u,v]}{\sqrt{2}}~, \nonumber\\
\angleBetweenPointAndXaxis[u,v] &= \text{atan}\left(\frac{2v-1}{2u-1}\right)~, \nonumber \\
\angleBetweenPointAndXYDiagonal[u,v] &= \frac{\pi}{4}-\angleBetweenPointAndXaxis[u,v]~, \nonumber\\
\angleBetweenPointAndSymPoint[u,v] & = 2 \angleBetweenPointAndXYDiagonal[u,v]~,\nonumber
\end{align}
respectively. The parameters $\distanceToPoint[u,v]$, $\angleBetweenPointAndXaxis[u,v]$, $\angleBetweenPointAndXYDiagonal[u,v]$, and $\angleBetweenPointAndSymPoint[u,v]$ are illustrated in \figurename~\ref{fig:QAMconstellationDef}.
The \acp{CS} with $4s^2$-\ac{QAM} constellation can be obtained via five different rules given as follows:
\subsubsection{Green Rule}
\begin{figure}[!t]
\centering
\subfloat[Green rule.]{\includegraphics[width =1.5in]{green_cropped.pdf}
\label{fig:greenRule}}
~
\subfloat[Yellow rule.]{\includegraphics[width =1.5in]{yellow_cropped.pdf}
\label{fig:yellowRule}}
\\
\subfloat[Blue rule.]{\includegraphics[width =1.5in]{blue_cropped.pdf}
\label{fig:blueRule}}
~
\subfloat[Cyan rule.]{\includegraphics[width =1.5in]{cyan_cropped.pdf}
\label{fig:cyanRule}}
\\
\subfloat[Orange rule.]{\includegraphics[width =1.5in]{orange_cropped.pdf}
\label{fig:orangeRule}}
\caption{Rules.}
\label{fig:rules}
\end{figure}
For any point $p\inS_{\rm quad}$, there exist another point $p''$ on another quadrant with the same distance to the origin as $p$ and separated by an integer multiple of $\pi/2$ radian in angle. Therefore, by scaling and rotating the 4-PSK \ac{GDJ} sequences, we can generate $N_{\rm quad}=s^2$ different sequence groups where each group has a different constellation in complex plane.
Considering Theorem~\ref{th:reduced}, let $\angleexpAll[n]\in\mathbb{Z}_4$ and $\scaleEexp[n]=0$ for $n=1,2,\mydots,m$ and $H=4$. Then, the parameters $k'\in \{z-\frac{4}{2\pi}\angleBetweenPointAndXYDiagonal[u,v]|z\in\mathbb{Z}_4\}$ and $e' = \frac{4}{2\pi}\ln\ratioBetweenDistanceAndInner[u,v]$ where $u,v\in\{1,2,\mydots,s\}$ generate the \acp{CS} with the \ac{QAM} constellation based on the green rule. For example, the constellation of a sequence generated with the green rule is shown for $u = 1$ and $v =2$, which leads to $\ratioBetweenDistanceAndInner[u,v] =\sqrt{5}$, and $\angleBetweenPointAndXYDiagonal[u,v]\approxeq-0.4636$ radian, in \figurename~\ref{fig:rules}\subref{fig:greenRule}.
The green rule generates \ac{GDJ} sequences for each point in $S_{\rm quad}$. In total, it yields only
$s^2\cdotG_0$
sequences for $N=1$ and $ s^2\cdotA_0$ sequences for $N>1$, where $G_0\triangleq\frac{m!}{2} 4^{m+1}$ and $A_0\triangleqm! 4^{m+1}$. Note that all the permutations of $\bm{\pi}$ generate different sequences due to $f_{\rm o}(\textit{\textbf{x}},z)$ for $N>1$ in Theorem~\ref{th:reduced}, which doubles the number of \acp{CS} at the expense of longer sequences.
\subsubsection{Yellow Rule}
A quick investigation on $f_{\rm r}(\textit{\textbf{x}})$ in \eqref{eq:realPart} shows that the amplitude of one half of the elements of the \ac{CS} are controlled by $(1-\monomial[{\permutationMono[{m}]}])_2$ and $(1-\monomial[{\permutationMono[{n}]}]-\monomial[{\permutationMono[{m+1}]}])_2$ through $\scaleAexp[n]$ while the other half is determined by $\monomial[{\permutationMono[{m}]}]$ and $(\monomial[{\permutationMono[{n}]}]+\monomial[{\permutationMono[{n}]}])_2$ through $\scaleBexp[n]$. Hence, each half can be scaled independently such that the scaled elements are on the \ac{QAM} constellation.
Based on Theorem~\ref{th:reduced}, let $\angleexpAll[n],k'\in\mathbb{Z}_4$ for $n=1,2,\mydots,m$ and $H=4$. To ensure that the elements of the \ac{CS} belong to the \ac{QAM} alphabet, with the light of \eqref{eq:realPart} and Corollary~\ref{co:RecAlg}, we set $\scaleAexp[\ell] = \frac{4}{2\pi}\ln\ratioBetweenDistanceAndInner[u,u]$, $\scaleBexp[\ell]= \frac{4}{2\pi}\ln\ratioBetweenDistanceAndInner[v,v]$ while $\scaleAexp[n|n\neq\ell] = \scaleBexp[n|n\neq\ell]= 0$ for $u,v\in\{1,2,\mydots,s\}$ and $u\neqv$.
Since $u\neqv$, the yellow rule always leads to two amplitude levels.
For example, for $u=1$ and $v=2$, $\scaleAexp[\ell] = \frac{4}{2\pi}\ln1=0$, $\scaleBexp[\ell]= \frac{4}{2\pi}\ln3\approxeq0.6994$ and the corresponding constellation of a sequence generated with yellow rule has two levels as shown in \figurename~\ref{fig:rules}\subref{fig:yellowRule}. Note that the points in the first quadrant are always in $S_{\rm h}$ with the yellow rule.
In Theorem~\ref{th:reduced}, the sum due to the sign, i.e., ${\frac{H}{2}\sum_{n=1}^{m-1}\monomial[{\permutationMono[{n}]}]\monomial[{\permutationMono[{n+1}]}]}$, does not change when the order of the elements of $\bm{\pi}$ are reversed. Hence, without taking $f_{\rm r}(\textit{\textbf{x}})$ into account only $\frac{m!}{2} 4^{m+1}$ \acp{CS} can be generated. When $f_{\rm r}(\textit{\textbf{x}})$ is employed with the yellow rule for $\ell<m$, the same behavior is also observed due to the summands in $c_{\rm r}(\textit{\textbf{x}})$. However, when $\ell=m$, $f_{\rm r}(\textit{\textbf{x}})$ is only a function of $\permutationMono[{m}]$. Therefore, $\bm{\pi}$ and the reversed $\bm{\pi}$ generate different sequences. Because of this exclusive behavior for $\ell=m$, the yellow rule generates $s(s-1)\cdot\left((m-1)\frac{m!}{2} 4^{m+1} + m! 4^{m+1} \right)$, i.e., $s(s-1)\cdot(m+1)\cdotG_0$ for $N=1$. When $N>1$, all the permutations of $\bm{\pi}$ generate different sequences. Hence, $s(s-1)\cdotm\cdot m! 4^{m+1} $, i.e., $s(s-1)\cdotm\cdotA_0$ sequences, can be generated.
\subsubsection{Blue Rule}
Although the yellow rule is able generate the constellation where the points in $S_{\rm h}$ in the first quadrant, it cannot reach the points in $S_{\rm nh}^{+}$ or $S_{\rm nh}^{-}$. The blue rule addresses this issue by ensuring that one half of the elements of the \ac{CS} are in $S_{\rm nh}^{+}$ or $S_{\rm nh}^{-}$ while the rest of the elements are in $S_{\rm h}$. It exploits the fact that
the parameters $\angleScaleAexp[{n}]$ and $\angleScaleBexp[{n}]$ change only the phase of the elements scaled by the parameters $\scaleAexp[n]$ and $\scaleBexp[n]$, respectively. This can be directly inferred from \eqref{eq:iterationGolay} through the locations of $\angleScaleA[n][]$, $\angleScaleA[n][*]$, $\angleScaleB[n][]$, $\angleScaleB[n][*]$ in the recursion.
For the blue rule, we exploit Corollary~\ref{co:RecAlg}. Let $\angleexp[n],c'\in\mathbb{Z}_4$ for $n=1,2,\mydots,m$ and $H=4$. We set either
$\scaleAexp[\ell] = \frac{4}{2\pi}\ln\ratioBetweenDistanceAndInner[u,u]$, $\scaleBexp[\ell]= \frac{4}{2 \pi}\ln\ratioBetweenDistanceAndInner[v,w]$, $\angleScaleAexp[{\ell}] = 0$, and $\angleScaleBexp[{\ell}] = \pm\frac{4}{2\pi}\angleBetweenPointAndXYDiagonal[v,w]$ or
$\scaleAexp[\ell] = \frac{4}{2\pi}\ln\ratioBetweenDistanceAndInner[v,w]$, $\scaleBexp[\ell]= \frac{4}{2 \pi}\ln\ratioBetweenDistanceAndInner[u,u]$, $\angleScaleAexp[{\ell}] = \pm\frac{4}{2\pi}\angleBetweenPointAndXYDiagonal[v,w]$, and $\angleScaleBexp[{\ell}] = 0$ while $\scaleAexp[n|n\neq\ell] = \scaleBexp[n|n\neq\ell]= \angleScaleAexp[{\ell|n\neq\ell}] = \angleScaleBexp[{\ell|n\neq\ell}] = 0$ for $u,v,w\in\{1,2,\mydots,s\}$ and $v>w$. The sign term $\pm$ is due to the fact that the parameter $\angleScaleAexp[\ell]$ (or $\angleScaleBexp[\ell]$) rotates half of the elements of the \ac{CS} to either clock-wise or counter clock-wise directions in the complex plane while $-\angleScaleAexp[\ell]$ (or $-\angleScaleBexp[\ell]$) rotates the same elements to either counter clock-wise or clock-wise directions based on \eqref{eq:imagPart}. Hence, the choice of sign changes the final sequence.
In \figurename~\ref{fig:rules}\subref{fig:blueRule}, the constellation of a complementary sequence generated by the blue rule is illustrated. In this example, $\scaleAexp[\ell] = \frac{4}{2\pi}\ln1 = 0$, $\scaleBexp[\ell]= \frac{4}{2 \pi}\ln\sqrt{5} \approxeq 0.5123$, $\angleScaleAexp[{\ell}] = 0$, and $\angleScaleBexp[{\ell}] = \pm0.2952$ as $\ratioBetweenDistanceAndInner[u,u]=1$, $\ratioBetweenDistanceAndInner[v,w] = \sqrt{5}$, and $\angleBetweenPointAndXYDiagonal[v,w] = 0.4636$ for $u = w= 1$ and $v = 2$. After one half of the elements of \ac{CS} is scaled by using $\scaleBexp[\ell]$, the corresponding elements move to the points indicated with a {\em star} in \figurename~\ref{fig:rules}\subref{fig:blueRule}.
Since the corresponding monomials for $\angleScaleBexp[{\ell}]$ in $f_{\rm i}(\textit{\textbf{x}})$ impact on the only scaled elements by $\scaleBexp[\ell]$ based on Theorem 1, by setting $\angleScaleAexp[{\ell}] = \frac{4}{2\pi}\angleBetweenPointAndXYDiagonal[v,w]$ (or $\angleScaleAexp[{\ell}] = -\frac{4}{2\pi}\angleBetweenPointAndXYDiagonal[v,w]$), the elements on {\em stars} moves to the points in $S_{\rm nh}^{+}$ or $S_{\rm nh}^{-}$ (or $S_{\rm nh}^{-}$ or $S_{\rm nh}^{+}$) on the first quadrant.
Like the yellow rule, $\bm{\pi}$ and the reversed $\bm{\pi}$ generate the same sequences for $n<m$.
However, they generate different sequences for $\ell=m$ since $f_{\rm r}(\textit{\textbf{x}})$ is only a function of $\permutationMono[{m}]$. As a result, the blue rule yields to $4\cdots\cdot \frac{s(s-1)}{2}\cdot\left((m-1)\frac{m!}{2} 4^{m+1} + m! 4^{m+1} \right)$, i.e., $2s^2(s-1)\cdot(m+1)\cdotG_0$ sequences for $N=1$. While the factor $4$ is due to the sign term $\pm$ and alternating scaled-and-rotated elements, the factor
$s\cdot \frac{s(s-1)}{2}$ is because of the number of elements in $S_{\rm h}$ and $S_{\rm nh}^{-}$. When $N>1$, $s(s-1)\cdotm\cdot m! 4^{m+1} $, i.e., $2s^2(s-1)\cdotm\cdotA_0$ sequences, can be generated as all the permutations of $\bm{\pi}$ are valid.
\subsubsection{Cyan Rule}
The cyan rule is like the blue rule, except both halves of the elements of the \ac{CS} is in $S_{\rm nh}^{+}$ or $S_{\rm nh}^{-}$, instead of only one half.
Let $\angleexp[n],c'\in\mathbb{Z}_4$ for $n=1,2,\mydots,m$ and $H=4$ in Corollary~\ref{co:RecAlg}. We choose
$\scaleAexp[\ell] = \frac{4}{2\pi}\ln\ratioBetweenDistanceAndInner[u,t]$, $\scaleBexp[\ell]= \frac{4}{2 \pi}\ln\ratioBetweenDistanceAndInner[v,w]$, $\angleScaleAexp[{\ell}] = \pm\frac{4}{2\pi}\angleBetweenPointAndXYDiagonal[u,t]$, and $\angleScaleBexp[{\ell}] = \pm\frac{4}{2\pi}\angleBetweenPointAndXYDiagonal[v,w]$ while $\scaleAexp[n|n\neq\ell] = \scaleBexp[n|n\neq\ell]= \angleScaleAexp[{\ell|n\neq\ell}] = \angleScaleBexp[{\ell|n\neq\ell}] = 0$ for $u,v,w,t\in\{1,2,\mydots,s\}$, $u>t$ and $v>w$. Similar to the blue rule, the sign terms are due to the behaviors of the parameters $\angleScaleAexp[\ell]$ and $\angleScaleBexp[\ell]$ in \eqref{eq:imagPart}.
In \figurename~\ref{fig:rules}\subref{fig:cyanRule}, the constellation of a complementary sequence generated by the cyan rule is illustrated. In this example, $\scaleAexp[\ell] = \frac{4}{2\pi}\ln\sqrt{5} \approxeq 0.5123$, $\scaleBexp[\ell]= \frac{4}{2 \pi}\ln\sqrt{29} \approxeq 1.0718$, $\angleScaleAexp[{\ell}] = \pm0.2952$, and $\angleScaleBexp[{\ell}] = \pm0.2422$ as $\ratioBetweenDistanceAndInner[u,t]=\sqrt{5}$, $\ratioBetweenDistanceAndInner[v,w] = \sqrt{29}$, $\angleBetweenPointAndXYDiagonal[u,t] = 0.4636$ radian, and $\angleBetweenPointAndXYDiagonal[v,w] =0.3805$ radian for $u = 2$,
$t = 1$,
$v = 4$,
and $w = 2$. After the halves of the \ac{CS} are scaled by using $\scaleAexp[\ell]$ and $\scaleBexp[\ell]$, the corresponding elements move to the points indicated with {\em star}s in \figurename~\ref{fig:rules}\subref{fig:blueRule}.
Since $\angleScaleAexp[{\ell}]$ and $\angleScaleBexp[{\ell}]$ change the phase of the scaled elements by $\scaleAexp[\ell]$ and $\scaleBexp[\ell]$, respectively, by setting $\angleScaleAexp[{\ell}]$ and $\angleScaleBexp[{\ell}]$ properly, the elements on {\em star} moves to the points in $S_{\rm nh}^{+}$ or $S_{\rm nh}^{-}$ on the first quadrant.
Like the yellow and blue rules, the cyan rule also exhibits the aforementioned exclusive behavior: all the permutations of $\bm{\pi}$ lead to different sequences for $\ell=m$ and $N=1$. Hence, it leads to $4\cdot \frac{s(s-1)}{2}\cdot\left (\frac{s(s-1)}{2}-1\right)\cdot\left((m-1)\frac{m!}{2} 4^{m+1} + m! 4^{m+1} \right)$, i.e., $(s+1)s(s-1)(s-2)\cdot(m+1)\cdotG_0$ sequences for $N=1$ and $(s+1)s(s-1)(s-2)m\cdotA_0$ sequences for $N>1$.
\subsubsection{Orange Rule}
The orange rule is similar to the yellow rule, but it displaces half of the elements of a \ac{CS} on the same level to different angles, instead of different amplitudes. For the orange rule, we consider Theorem~\ref{th:reduced} directly. Let $H=4$, $\angleexpAll[n|n\neq \ell]\in\mathbb{Z}_4$, $\scaleEexp[n]=0$, and $e' = \frac{4}{2\pi}\ln\ratioBetweenDistanceAndInner[u,v]$ for $ \ell,n\in\{1,2,\mydots,m\}$, $u,v\in\{1,2,\mydots,s\}$, and $u>v$. To rotate the points in the complex plane to the counter clockwise or clockwise, we choose either $\angleexpAll[\ell]\in \{{z-\frac{4}{2\pi}\angleBetweenPointAndSymPoint[u,v]|z\in\mathbb{Z}_4}\}$ and $k'\in \{z+\frac{4}{2\pi}\angleBetweenPointAndXYDiagonal[u,v]|z\in\mathbb{Z}_4\}$
or
$\angleexpAll[\ell]\in \{{z+\frac{4}{2\pi}\angleBetweenPointAndSymPoint[u,v]|z\in\mathbb{Z}_4}\}$ and $k'\in \{z-\frac{4}{2\pi}\angleBetweenPointAndXYDiagonal[u,v]|z\in\mathbb{Z}_4\}$, respectively. In \figurename~\ref{fig:rules}\subref{fig:orangeRule}, the constellation of a \ac{CS} generated through the orange rule is illustrated for $u = 2$ and $v =1$, which leads to $\ratioBetweenDistanceAndInner[u,v] =\sqrt{5}$, $\angleBetweenPointAndXYDiagonal[u,v]\approxeq0.4636$ radian, and $\angleBetweenPointAndXYDiagonal[u,v] = 0.9273$.
The orange rule leads to $2\cdot \frac{s(s-1)}{2}\cdotm\cdot\frac{m!}{2} 4^{m+1} $, i.e., $s(s-1)\cdotm\cdotG_0$ sequences for $N = 1$. It also generates $s(s-1)\cdotm\cdotA_0$ sequences for $N > 1$.
\section{Performance Analysis}
\label{sec:performAnalysis}
\subsection{Number of Bits vs. Sequence Length}
The total number sequences generated with Theorem~\ref{th:reduced} for $N=1$ and $N>1$ can be calculated as $((s^4-s^2)(m+1)+s)\cdotG_0$ and $((s^4-s^2)m+s^2)\cdotA_0$, respectively. For $N=1$, our result is aligned with the result from \cite{Li_2010} by using the offset method or Case I-II results in \cite{budisin_2018} via paraunitary matrices. In \cite{Li_2010}, Li showed that there exist at least $((m+1)4^{2(q-1)}-(m+1)4^{(q-1)}+2^{q-1})\cdotG_0$ \acp{CS} for $4^q$-QAM sequences. The corresponding parameter for $4^q$-QAM is equal to $s = \sqrt{4^q/4} = 2^{q-1}$ and it gives the same result when it is plugged into $(s^4-s^2)(m+1)+s$. For $N>1$, we show that the total number of sequences generated with the proposed rules is $((s^4-s^2)m+s^2)\cdot A_0=(\numberOfIterations4^{2(q-1)}-m4^{(q-1)}+2^{2q-2}\cdot)A_0$ for $4^q$-QAM alphabet.
\begin{figure}[t]
\centering
{\includegraphics[width =3.5in]{performance.eps}
}
\caption{Maximum number of uncoded bits versus sequence length for $N=1$ and $N=3$.}
\label{fig:performance}
\end{figure}
In \figurename~\ref{fig:performance}, the maximum number of uncoded bits that can be encoded with the proposed rules and the corresponding sequence length are given for $N=1$ and $N=3$ when $s = {1,2,4,8}$, i.e., \ac{QPSK}, 16-\ac{QAM}, 64-\ac{QAM}, 256-\ac{QAM}, and 1024-\ac{QAM}. The numerical results show that a large number of uncoded bit can be encoded within an \ac{OFDM} symbol for a larger $s$ while the sequence length can be adjusted by selecting $N$ compatible with the resource allocation in frequency. Note that the choice $N=3$ leads to \acp{CS} compatible with the 3GPP \ac{NR} resource allocation. In addition, the same number of information bits can be transmitted with non-contiguous \acp{CS} for a non-contiguous resource allocation in frequency by using \eqref{eq:shift} in Theorem \ref{th:reduced}.
\subsection{Adaptive Modulation and Coding}
\begin{table*}[]
\centering
\caption{The number of \acp{CS} on different sub-constellations (Unit: $G_0$ for $N=1$ / Unit: $A_0$ for $N>1$)}
\resizebox{\textwidth}{!}{%
\begin{tabular}{c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\cline{2-17}
& 1 & 2a & 2b & 3 & 4a & 4b & 5a & 5b & 6 & 6a & 6b & 7a & 7b & 8a & 8b & 9 \\ \hline
\multicolumn{1}{|c|}{1} & \cellcolor[HTML]{32CB00}1/1 & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \cellcolor[HTML]{FFFE65}$m+1$/$m$ & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \cellcolor[HTML]{FFFE65}$m+1$/$m$ & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \cellcolor[HTML]{FFFE65}$m+1$/$m$ \\ \hline
\multicolumn{1}{|c|}{2a} & \cellcolor[HTML]{5F81E2} & \cellcolor[HTML]{32CB00}1/1 & \cellcolor[HTML]{F8A102}$m$/$m$ & \cellcolor[HTML]{5F81E2} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \cellcolor[HTML]{5F81E2} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \cellcolor[HTML]{5F81E2} \\ \cline{1-1} \cline{3-4}
\multicolumn{1}{|c|}{2b} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \cellcolor[HTML]{F8A102}$m$/$m$ & \cellcolor[HTML]{32CB00}1/1 & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} \\ \hline
\multicolumn{1}{|c|}{3} & \cellcolor[HTML]{FFFE65}$m+1$/$m$ & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \cellcolor[HTML]{32CB00}1/1 & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \cellcolor[HTML]{5F81E2}$2m+2$/$2m$ & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \cellcolor[HTML]{FFFE65}$m+1$/$m$ \\ \hline
\multicolumn{1}{|c|}{4a} & \cellcolor[HTML]{5F81E2} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \cellcolor[HTML]{5F81E2} & \cellcolor[HTML]{32CB00}1/1 & \cellcolor[HTML]{F8A102}$m$/$m$ & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \cellcolor[HTML]{5F81E2} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \cellcolor[HTML]{5F81E2} \\ \cline{1-1} \cline{6-7}
\multicolumn{1}{|c|}{4b} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \cellcolor[HTML]{F8A102}$m$/$m$ & \cellcolor[HTML]{32CB00}1/1 & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} \\ \hline
\multicolumn{1}{|c|}{5a} & \cellcolor[HTML]{5F81E2} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \cellcolor[HTML]{5F81E2} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \cellcolor[HTML]{32CB00}1/1 & \cellcolor[HTML]{F8A102}$m$/$m$ & \cellcolor[HTML]{5F81E2} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \cellcolor[HTML]{5F81E2} \\ \cline{1-1} \cline{8-9}
\multicolumn{1}{|c|}{5b} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \cellcolor[HTML]{F8A102}$m$/$m$ & \cellcolor[HTML]{32CB00}1/1 & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} \\ \hline
\multicolumn{1}{|c|}{6} & \cellcolor[HTML]{FFFE65}$m+1$/$m$ & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \cellcolor[HTML]{FFFE65}$m+1$/$m$ & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \cellcolor[HTML]{32CB00}1/1 & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \cellcolor[HTML]{FFFE65}$m+1$/$m$ \\ \hline
\multicolumn{1}{|c|}{6a} & \cellcolor[HTML]{5F81E2} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \cellcolor[HTML]{5F81E2} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \cellcolor[HTML]{5F81E2} & \cellcolor[HTML]{32CB00}1/1 & \cellcolor[HTML]{F8A102}$m$/$m$ & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \cellcolor[HTML]{5F81E2} \\ \cline{1-1} \cline{11-12}
\multicolumn{1}{|c|}{6b} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \cellcolor[HTML]{F8A102}$m$/$m$ & \cellcolor[HTML]{32CB00}1/1 & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} \\ \hline
\multicolumn{1}{|c|}{7a} & \cellcolor[HTML]{5F81E2} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \cellcolor[HTML]{5F81E2} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \cellcolor[HTML]{5F81E2} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \cellcolor[HTML]{32CB00}1/1 & \cellcolor[HTML]{F8A102}$m$/$m$ & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \cellcolor[HTML]{5F81E2} \\ \cline{1-1} \cline{13-14}
\multicolumn{1}{|c|}{7b} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \cellcolor[HTML]{F8A102}$m$/$m$ & \cellcolor[HTML]{32CB00}1/1 & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} \\ \hline
\multicolumn{1}{|c|}{8a} & \cellcolor[HTML]{5F81E2} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \cellcolor[HTML]{5F81E2} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \cellcolor[HTML]{5F81E2} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \multicolumn{2}{c|}{\cellcolor[HTML]{96FFFB}} & \cellcolor[HTML]{32CB00}1/1 & \cellcolor[HTML]{F8A102}$m$/$m$ & \cellcolor[HTML]{5F81E2} \\ \cline{1-1} \cline{15-16}
\multicolumn{1}{|c|}{8b} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \multicolumn{2}{c|}{\multirow{-2}{*}{\cellcolor[HTML]{96FFFB}$4m+4$/$4m$}} & \cellcolor[HTML]{F8A102}$m$/$m$ & \cellcolor[HTML]{32CB00}1/1 & \multirow{-2}{*}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} \\ \hline
\multicolumn{1}{|c|}{9} & \cellcolor[HTML]{FFFE65}$m+1$/$m$ & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \cellcolor[HTML]{FFFE65}$m+1$/$m$ & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \cellcolor[HTML]{FFFE65}$m+1$/$m$ & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \multicolumn{2}{c|}{\cellcolor[HTML]{5F81E2}$2m+2$/$2m$} & \cellcolor[HTML]{32CB00}1/1 \\ \hline
\end{tabular}%
}
~\\
~\\
\begin{tabular}{c c c c c c c c c c c c c c c c c c}
\multicolumn{1}{c}{\cellcolor[HTML]{32CB00}} & :~Green rule & ~ & \multicolumn{2}{c}{\cellcolor[HTML]{5F81E2}} & :~Blue rule ~ & \multicolumn{2}{c}{\cellcolor[HTML]{96FFFB}} & :~Cyan rule~ & \multicolumn{2}{c}{\cellcolor[HTML]{FFFE65}} & :~Yellow rule~ & \multicolumn{2}{c}{\cellcolor[HTML]{F8A102}} & :~Orange rule \\
\end{tabular}
\label{tab:resultsLevels}
\end{table*}
In \tablename~\ref{tab:resultsLevels}, we provide the number of \acp{CS} based on the aforementioned rules and the \ac{QPSK} sub-constellations for up-to 64-\ac{QAM} (i.e., $s=4$) for $N=1$ and $N>1$). The labels at the rows and columns indicate different \ac{QPSK} sub-constellations in the $4s^2$-\ac{QAM} alphabet. We represent \ac{QPSK} sub-constellations with different amplitudes with the positive integer {\em numbers}, starting from the smallest $\distanceToPoint[u,v]$. We use {\em letters} to represent different rotations of the \ac{QPSK} sub-constellation with the same amplitude, starting from the largest $\angleBetweenPointAndXaxis[u,v]$. If the \ac{QPSK} sub-constellation has an element in $S_{\rm h}$, we do not use any letter to mark the rotation.
By using \tablename~\ref{tab:resultsLevels}, for example, one can infer that there exists $(2m+2)\cdotG_0$ and $2m\cdotA_0$ \acp{CS} generated by the blue rule for $N=1$ and $N>1$, respectively, where one half of the elements is on the sub-constellations labelled as 2a and 2b while the other half of the elements is on the sub-constellation based as 1. By alternating the halves, i.e., switching the row and column labels, a different set of \acp{CS} with the same cardinality can also be generated by the blue rule.
The interpretation of the rules with \tablename~\ref{tab:resultsLevels} can be useful for adaptive modulation and coding schemes which encode the information bits with \acp{CS}. Some of the rules or some part of the rules can be eliminated or included in the transmissions based on different criteria such as the peak power constraints, receiver complexity, \ac{SNR}, or throughput. For example, the \acp{CS} which have always the outer or inner points of the \ac{QAM} constellation (e.g., both halves are on label 9 or both halves are on label 1) may be eliminated to control the mean \ac{OFDM} symbol power in addition to the \ac{PAPR}. In another example, only green rule can be considered in the transmission to simplify the receiver complexity. For high throughput and high \ac{SNR} case, all rules with a large $s$ may be included in the transmission. Note that the extension of \tablename~\ref{tab:resultsLevels} for a larger $s$ is straightforward by capturing behaviour of the rules.
\subsection{Error Rate}
\begin{figure}[t]
\centering
{\includegraphics[width =3.5in]{performanceSE.eps}
}
\caption{Comparison of different schemes when BER is 1e-3.}
\label{fig:performanceSE}
\end{figure}
\def\rho{\rho}
\defp{p}
In \figurename~\ref{fig:performanceSE}, we compare the operating points for three coding schemes, i.e., the (11,32) block code used in \ac{NR}, polar code, and the \ac{CS} encoder. We mark the $\rm E_b/N_0$ when the coded \ac{BER} reaches to 1e-3 for different schemes in \figurename~\ref{fig:performanceSE}. We also indicate the 90th percentile \ac{PAPR} and peak power, denoted by $\rho$ and $p$, respectively. For the polar encoder, the codeword length is $2^m$ and the design SNR is set to 3 dB. As a special case, the codeword is padded by 2 zeros for 64-QAM to achieve the similar \ac{SE} of \acp{CS}. For the \ac{CS} encoder, we fix $\bm{\pi}=(1,2,3,4)$ and $m=4$. The information bits are mapped to the \acp{CS} arbitrarily.
For the (11,32) block code and the \ac{CS} encoder, we consider a minimum distance detector which calculate the distances between a received sequence and all possible sequences in the complex domain. For the polar decoder, we use \ac{SIC}. The (11,32) block code is approximately $1$~dB better than the \ac{CS} and the polar encoders for QPSK. However, the 90th percentile peak power for the \ac{CS} encoder is 5.8 dB and 8~dB lower than the (11,32) block code and the polar code, respectively. For 16-QAM and 64-QAM, the polar code performs noticeably better than \acp{CS} where the $\rm E_b/N_0$ difference is larger than 2.5 and 4.5 dB, respectively. On the other hand, the \ac{CS} encoder manages the peak power better than the polar encoder, which compensates the $\rm E_b/N_0$ gap by lowering $p$ by 5.5 dB and 4.2 dB for 16-QAM and 64-QAM, respectively.
It is worth noting that the performance of the \ac{CS} encoder is evaluated only for a small $m$ due to the complexity of minimum distance detector in this study. A low-complexity decoder which exploit Theorem~\ref{th:reduced} and the bit map for the \ac{CS} encoder for a better error rate performance can be investigated as part of future work.
\section{Conclusion}\label{sec:conclusion}
In this study,
we discuss a framework which algebraically describes the polynomial generated through a recursion consisting of two linear operators at each step.
The framework determines which of two operators at each step in the recursion should be applied to a coefficient of the polynomial via Boolean functions.
By applying the introduced framework to a recursive \ac{GCP} construction relying on Budi{\v s}in's methods, we show how the initial sequences, phase rotations, signs, real scalars, and the shifting factors applied at each step alter the elements of the sequences in the \ac{GCP}. As a result, we derive a non-contiguous \ac{CS} encoder by deriving the Boolean functions for the shifting factors. Hence, frequency diversity, coding gain, and low \ac{PAPR} are maintained for \ac{OFDM} symbols simultaneously.
We show there exist two encoders that control the amplitude and the phase of the elements of the sequences in a \ac{GCP} independently, which emerges from the phase rotations, signs, and the scalars in the recursion. Therefore, we extend Davis and Jedwab's result in \cite{davis_1999}, which describe the phase component of a modulation symbol.
In addition, we show how the initial sequences are ordered in the synthesized \acp{CS}, which is not trivial without explicit algrebraic structure. We also provide a deeper analysis on the \ac{QAM} \ac{CS}. By introducing five different rules for generating \acp{CS} with $4s^2$-\ac{QAM}, we show how to build an adaptive \ac{CS} encoder for \ac{QAM} constellation.
\appendices
\section{Proof of Lemma~\ref{th:framework}}
\begin{proof}
\label{app:algConstruction}
The cases where $m=1$ and $m=2$ are easily checked by hand, so assume that $m>2$. Consider a new recursion given by
\begin{align}
\functionfdot[\bar{n}] =
\begin{cases}
\binaryAsignment[11][{l}]{\functionfdot[\bar{n}-1]} + \binaryAsignment[12][{l}]{\functiongdot[\bar{n}-1]}w^{2^\permutationShift[{\bar{n}}]} & \bar{n}=l \\
{\functionfdot[\bar{n}-1]} + {\functiongdot[\bar{n}-1]}w^{2^\permutationShift[{\bar{n}}]} & \bar{n}\neql
\end{cases}~,
\nonumber\\
\functiongdot[\bar{n}] =
\begin{cases}
\binaryAsignment[21][{l}]{\functionfdot[\bar{n}-1]} + \binaryAsignment[22][{l}]{\functiongdot[\bar{n}-1]}w^{2^\permutationShift[{\bar{n}}]} & \bar{n}=l \\
{\functionfdot[\bar{n}-1]} + {\functiongdot[\bar{n}-1]}w^{2^\permutationShift[{\bar{n}}]} & \bar{n}\neql
\end{cases}~,
\label{eq:iterationBasicANFIso}
\end{align}
where $\binaryAsignment[ij][{l}]$ are given parameters in Lemma~\ref{th:framework}
and $\functionfdot[0]=\functiongdot[0]=1$. Then, by the definition of the polynomial representation of a sequence, $\functionfdot[m]$ and $\functiongdot[m]$ corresponds to the polynomial representations of the construction sequences $\seqGf[l]$ and $\seqGg[l]$, respectively. By evaluating \eqref{eq:iterationBasicANFIso}, the closed-form expressions of $\functionfdot[m]$ and $\functiongdot[m]$ can be expressed as
\begin{align}
\polySeq[{\seqGf[l]}][w] = \functionfdot[m] =
\begin{cases}
\displaystyle
\sum_{j=1}^2\binaryAsignment[1j][{l}]\polySeq[{\seqSub[j]}][w]
& l=m \\
\displaystyle
\sum_{i=1}^2\sum_{j=1}^2\binaryAsignment[ij][{l}]\polySeq[{\seqSub[ij]}][w]
& l<m \\
\end{cases}~,\label{eq:iterationBasicANFClosedFormF}\\
\polySeq[{\seqGg[l]}][w] = \functiongdot[m]=
\begin{cases}
\displaystyle
\sum_{j=1}^2\binaryAsignment[2j][{l}]\polySeq[{\seqSub[j]}][w]
& l=m \\
\displaystyle
\sum_{i=1}^2\sum_{j=1}^2\binaryAsignment[ij][{l}]\polySeq[{\seqSub[ij]}][w]
& l<m \\
\end{cases}~,
\label{eq:iterationBasicANFClosedFormG}
\end{align}
where
\begin{align}
\polySeq[{\seqSub[j]}][w] &\triangleq w^{2^\permutationShift[{l}](j-1)}
\prod_{\substack{n=1 \\ n\neql}}^{m}(1 + w^{2^\permutationShift[{n}]}) ~,
\label{eq:polyhSingleIndex}
\\
\polySeq[{\seqSub[ij]}][w] &\triangleq
w^{2^\permutationShift[{l}](j-1)+2^\permutationShift[{l+1}](i-1)}
\prod_{\substack{n=1 \\ n\neql,l+1}}^{m}(1 + w^{2^\permutationShift[{n}]}) ~.
\label{eq:polyhDoubleIndex}
\end{align}
We then decompose the polynomial representation of the sequence ${\bf 1}\triangleq(1)_{i=0}^{2^m-1}$ of length $2^m$ as a summation of $\polySeq[{\seqSub[1]}][w]$ and $\polySeq[{\seqSub[2]}][w]$ as
\begin{align}
\polySeq[{\bf 1}][w] &=
\prod_{n=1}^{m}(1 + w^{2^\permutationShift[{n}]})\nonumber \\&= \underbrace{\prod_{\substack{n=1 \\ n\neql}}^{m}(1 + w^{2^\permutationShift[{n}]}}_{\polySeq[{\seqSub[1]}][w]}) + \underbrace{w^{2^\permutationShift[{l}]} \prod_{\substack{n=1 \\ n\neql}}^{m}(1 + w^{2^\permutationShift[{n}]}}_{\polySeq[{\seqSub[2]}][w]})~.
\label{eq:seqOneDecomp}
\end{align}
The following statements hold true:
\begin{itemize}
\item The polynomial $\polySeq[{\bf 1}][w]$ includes all of the monomials with the coefficient of $1$ as it is the polynomial representation of the sequence ${\bf 1}$. The functions $\polySeq[{\seqSub[1]}][w]$ and $\polySeq[{\seqSub[2]}][w]$ also consist of the monomials with the degree of less than $2^m$, where the monomial coefficients are either $1$ or $0$ by their definitions. Therefore, based on \eqref{eq:seqOneDecomp}, $\polySeq[{\seqSub[1]}][w]$ and $\polySeq[{\seqSub[2]}][w]$ should be polynomials with no common monomials, i.e., $\seqSub[1]+\seqSub[2]={\bf 1}$.
\item The function $\polySeq[{\seqSub[2]}][w]$ is a polynomial where the degree of each monomial of $ \polySeq[{\seqSub[1]}][w]$ is increased by $2^\permutationShift[{l}]$ by their definitions. Hence, the sequence $\seqSub[2]$ should be the shifted version of the sequence $\seqSub[1]$ by $2^\permutationShift[{l}]$.
\end{itemize}
Since $\seqSub[1]+\seqSub[2]={\bf 1}$ and $\seqSub[2]$ is the shifted version of $\seqSub[1]$ by $2^\permutationShift[{l}]$, the $u$th element of the sequence $\seqSub[1]$ should be $1$ for $u=s2^\permutationShift[{l}]+(1,2,\dots,2^\permutationShift[{l}])$ for even $s$ and $0$ for odd $s$ where $0\le s < 2^{m - \permutationShift[{l}]}$. The sequences $\seqSub[1]$ and $\seqSub[2]$ can be expressed as
$
\seqSub[1] = {\bf 1} - \seqFirstOrderMonomial[{\permutationMono[{l}]}]
$
and
$
\seqSub[2] = {\seqFirstOrderMonomial[{\permutationMono[{l}]}]}~,
$
respectively, where the sequence $\seqFirstOrderMonomial[j]$ is defined as the sequence associated with the function of $f(\textit{\textbf{x}}) = \monomial[j]$ and its length is $2^m$ and
$\permutationMono[l] \triangleq m - \permutationShift[l]$.
\renewcommand{\baselinestretch}{1}
\begin{table*}[t]
\caption{The operator definitions and the Boolean functions for the construction sequences}
\centering
\resizebox{\textwidth}{!}{%
\begin{tabular}{l|c|c|c|c|c|}
& $\operatorBinary[0][n](r)$ & $\operatorBinary[1][n](r)$ & $\vecArrangement[n]^{\rm T}$ & $\funcGfForANF[n](\textit{\textbf{x}})$ & $\funcGgForANF[n](\textit{\textbf{x}})$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Scalar \\ $\scaleA[n]$ \end{tabular} & $\operatorScaleA[0][{n}](r)\triangleq\xi^0 r $ & $\operatorScaleA[1][{n}](r)\triangleq\xi^{\scaleAexp[n]} r $ & $[1~0~0~1]$ & $
\begin{cases}
1-\monomial[{\permutationMono[{m}]}], & n = m\\
1-\monomial[{\permutationMono[{n}]}]-\monomial[{\permutationMono[{n+1}]}] & n < m
\end{cases}$ & $
\begin{cases}
\monomial[{\permutationMono[{m}]}], & n = m\\
1-\monomial[{\permutationMono[{n}]}]-\monomial[{\permutationMono[{n+1}]}] & n < m
\end{cases}$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Scalar \\ $\scaleB[n]$ \end{tabular} & $\operatorScaleB[0][{n}](r)\triangleq\xi^0 r $ & $\operatorScaleB[1][{n}](r)\triangleq\xi^{\scaleBexp[n]} r $ & $[0~1~1~0]$ & $
\begin{cases}
\monomial[{\permutationMono[{m}]}], & n = m\\
\monomial[{\permutationMono[{n}]}]+\monomial[{\permutationMono[{n+1}]}] & n < m
\end{cases}$ & $
\begin{cases}
1-\monomial[{\permutationMono[{m}]}], & n = m\\
\monomial[{\permutationMono[{n}]}]+\monomial[{\permutationMono[{n+1}]}] & n < m
\end{cases}$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Phase \\ $\angleScaleA[n][]$ \end{tabular} & $\operatorAngleScaleA[0][{n}](r)\triangleq\xi^0 r $ & $\operatorAngleScaleA [1][{n}](r)\triangleq\xi^{{\rm j}\angleScaleAexp[n]} r $ & $[1~0~0~0]$ & $
\begin{cases}
1-\monomial[{\permutationMono[{m}]}], & n = m\\
(1-\monomial[{\permutationMono[{n}]}])(1-\monomial[{\permutationMono[{n+1}]}]) & n < m
\end{cases}$ & $
\begin{cases}
0, & n = m\\
(1-\monomial[{\permutationMono[{n}]}])(1-\monomial[{\permutationMono[{n+1}]}]) & n < m
\end{cases}$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Phase \\ $\angleScaleA[n][*]$ \end{tabular} & $\operatorAngleScaleA[0][{n}](r)\triangleq\xi^0 r $ & $\operatorAngleScaleA [1][{n}](r)\triangleq\xi^{-{\rm j}\angleScaleAexp[n]} r $ & $[0~0~0~1]$ & $
\begin{cases}
0, & n = m\\
\monomial[{\permutationMono[{n}]}]\monomial[{\permutationMono[{n+1}]}] & n < m
\end{cases}$ & $
\begin{cases}
\monomial[{\permutationMono[{m}]}], & n = m\\
\monomial[{\permutationMono[{n}]}]\monomial[{\permutationMono[{n+1}]}] & n < m
\end{cases}$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Phase \\ $\angleScaleB[n][]$ \end{tabular} & $\operatorAngleScaleB[0][{n}](r)\triangleq\xi^0 r $ & $\operatorAngleScaleB [1][{n}](r)\triangleq\xi^{{\rm j}\angleScaleBexp[n]} r $ & $[0~1~0~0]$ & $
\begin{cases}
\monomial[{\permutationMono[{m}]}], & n = m\\
\monomial[{\permutationMono[{n}]}](1-\monomial[{\permutationMono[{n+1}]}]) & n < m
\end{cases}$ & $
\begin{cases}
0, & n = m\\
\monomial[{\permutationMono[{n}]}](1-\monomial[{\permutationMono[{n+1}]}]) & n < m
\end{cases}$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Phase \\ $\angleScaleB[n][*]$ \end{tabular} & $\operatorAngleScaleB[0][{n}](r)\triangleq\xi^0 r $ & $\operatorAngleScaleB [1][{n}](r)\triangleq\xi^{-{\rm j}\angleScaleBexp[n]} r $ & $[0~0~1~0]$ & $
\begin{cases}
0, & n = m\\
(1-\monomial[{\permutationMono[{n}]}])\monomial[{\permutationMono[{n+1}]}] & n < m
\end{cases}$ & $
\begin{cases}
1-\monomial[{\permutationMono[{m}]}], & n = m\\
(1-\monomial[{\permutationMono[{n}]}])\monomial[{\permutationMono[{n+1}]}] & n < m
\end{cases}$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Sign \\ \end{tabular} & $\operatorSign[0][{n}](r)\triangleq\xi^0 r $ & $\operatorSign[1][{n}](r)\triangleq\xi^ {{\rm j}\frac{H}{2}}r $ & $[0~0~0~1]$ & $
\begin{cases}
0, & n = m\\
\monomial[{\permutationMono[{n}]}]\monomial[{\permutationMono[{n+1}]}] & n < m
\end{cases}$ & $
\begin{cases}
\monomial[{\permutationMono[{m}]}], & n = m\\
\monomial[{\permutationMono[{n}]}]\monomial[{\permutationMono[{n+1}]}] & n < m
\end{cases}$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Phase \\ $\angleGolay[n]$ \end{tabular} & $\operatorAngle[0][{n}](r)\triangleq\xi^0 r $ & $\operatorAngle[1][{n}](r)\triangleq\xi^{{\rm j}\angleexp[n]} r $ & $[0~1~0~1]$ & $ \monomial[{\permutationMono[{n}]}]$ & $
\monomial[{\permutationMono[{n}]}]$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Shift \\ $\separationGolay[n]$ \end{tabular} & $\operatorSeparation[0][{n}](r)\triangleqz^0r $ & $\operatorSeparation[1][{n}](r)\triangleqz^{\separationGolay[n]} r $ & $[0~1~0~1]$ & $ \monomial[{\permutationMono[{n}]}]$ & $
\monomial[{\permutationMono[{n}]}]$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Order \\ $\polySeq[{\textit{\textbf{a}}}][z]$ \end{tabular} & $\operatorOrderA[0][{n}](r)\triangleq\xi^0r $ & $\operatorOrderA[1][{n}](r)\triangleq\begin{cases}
\xi^0r , & n \neq 1\\
\polySeq[{\textit{\textbf{a}}}][z] & n = 1
\end{cases} $ & $[1~0~1~0]$ &
$ 1-\monomial[{\permutationMono[{n}]}]$
&
$ 1-\monomial[{\permutationMono[{n}]}]$
\\ \hline
\hspace{-3mm}\begin{tabular}{l}Order \\ $\polySeq[{\textit{\textbf{b}}}][z]$ \end{tabular} & $\operatorOrderB[0][{n}](r)\triangleq\xi^0r $ & $\operatorOrderB[1][{n}](r)\triangleq\begin{cases}
\xi^0r , & n \neq 1\\
\polySeq[{\textit{\textbf{b}}}][z] & n = 1
\end{cases} $ & $[0~1~0~1]$ & $ \monomial[{\permutationMono[{n}]}]$
&
$ \monomial[{\permutationMono[{n}]}]$
\\ \hline
\end{tabular}
}
\label{table:ANFgolay}
\end{table*}
The polynomials $\polySeq[{\seqSub[1]}][w]$ and $\polySeq[{\seqSub[2]}][w]$ can also be decomposed as $\polySeq[{\seqSub[11]}][w]$ + $\polySeq[{\seqSub[21]}][w]$ and $\polySeq[{\seqSub[12]}][w]$ + $\polySeq[{\seqSub[22]}][w]$, respectively, i.e., $\seqSub[11]+\seqSub[21]=\seqSub[1]$ and $\seqSub[12]+\seqSub[22]=\seqSub[2]$. Based on \eqref{eq:polyhDoubleIndex}, $\seqSub[21]$ and $\seqSub[22]$ are the shifted version of the sequence $\seqSub[11]$ and $\seqSub[12]$ by $2^\permutationShift[{l+1}]$, respectively. Similarly, $\seqSub[11]$, $\seqSub[21]$, $\seqSub[12]$, and $\seqSub[22]$ can be expressed as
$
\seqSub[11] = ({\bf 1} - \seqFirstOrderMonomial[{\permutationMono[{l}]}])\odot({\bf 1} - \seqFirstOrderMonomial[{\permutationMono[{l+1}]}])
$,
$
\seqSub[21] = ({\bf 1} - \seqFirstOrderMonomial[{\permutationMono[{l}]}])\odot\seqFirstOrderMonomial[{\permutationMono[{l+1}]}]
$,
$
\seqSub[12] = {\seqFirstOrderMonomial[{\permutationMono[{l}]}]} \odot ({\bf 1} - \seqFirstOrderMonomial[{\permutationMono[{l+1}]}])
$, and
$
\seqSub[22] = {\seqFirstOrderMonomial[{\permutationMono[{l}]}]}\odot\seqFirstOrderMonomial[{\permutationMono[{l+1}]}]~,
$,
respectively. By changing the variable $l$ with $n$ in \eqref{eq:iterationBasicANFClosedFormF} and \eqref{eq:iterationBasicANFClosedFormG}, and exploiting the Boolean functions for $\seqFirstOrderMonomial[1],\seqFirstOrderMonomial[2],\dots,\seqFirstOrderMonomial[m]$, $\funcGfForANF[n](\textit{\textbf{x}})$ and $\funcGgForANF[n](\textit{\textbf{x}})$ can then be obtained as \eqref{eq:closedformANFsF} and \eqref{eq:closedformANFsG}, respectively, through \eqref{eq:iterationBasicANFClosedFormF} and \eqref{eq:iterationBasicANFClosedFormG}.
\end{proof}
\section{Proof of Theorem~\ref{th:reduced}}
\begin{table*}[t]
\caption{The generalized Boolean functions for the sub-recursions}
\centering
\resizebox{\textwidth}{!}{
\begin{tabular}{l|c|c|}
& $\compositeOperatorF[x][r]$ & $\compositeOperatorG[x][r]$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Scale \\ $\scaleA[n]$ \end{tabular} & $\displaystyle
r\xi^{f_{\rm scale,a}(\textit{\textbf{x}})}
= r\xi^{\scaleAexp[m](1-\monomial[{\permutationMono[{m}]}])_2 + \sum_{n=1}^{m-1}\scaleAexp[n](1-\monomial[{\permutationMono[{n}]}] -\monomial[{\permutationMono[{n+1}]}])_2} $ & $\displaystyle r\xi^{g_{\rm scale,a}(\textit{\textbf{x}})}
= r\xi^{\scaleAexp[m]\monomial[{\permutationMono[{m}]}] +\sum_{n=1}^{m-1}\scaleAexp[n](1-\monomial[{\permutationMono[{n}]}]-\monomial[{\permutationMono[{n+1}]}])_2}$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Scale \\ $\scaleB[n]$ \end{tabular} & $\displaystyler\xi^{f_{\rm scale,b}(\textit{\textbf{x}})}
= r\xi^{ \scaleBexp[m]\monomial[{\permutationMono[{m}]}] + \sum_{n=1}^{m-1}\scaleBexp[n](\monomial[{\permutationMono[{n}]}] +\monomial[{\permutationMono[{n+1}]}])_2} $ & $\displaystyler\xi^{g_{\rm scale,b}(\textit{\textbf{x}})}
= r\xi^{\scaleBexp[m](1-\monomial[{\permutationMono[{m}]}])_2 +\sum_{n=1}^{m-1}\scaleBexp[n](\monomial[{\permutationMono[{n}]}]+\monomial[{\permutationMono[{n+1}]}])_2}$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Phase \\ $\angleScaleA[n][]$ \\ \end{tabular} & $\displaystyler\xi^{{\rm j}f_{\rm phase,a}(\textit{\textbf{x}})}
= r\xi^{{\rm j} \angleScaleAexp[{m}] (1-\monomial[{\permutationMono[{m}]}])_2 + {\rm j} \sum_{n=1}^{m-1}\angleScaleAexp[{n}] ((1-\monomial[{\permutationMono[{n}]}])(1-\monomial[{\permutationMono[{n+1}]}]))_2} $ & $\displaystyler\xi^{{\rm j}g_{\rm phase,a}(\textit{\textbf{x}})}
= r\xi^{{\rm j} \sum_{n=1}^{m-1}\angleScaleAexp[{n}] ((1-\monomial[{\permutationMono[{n}]}])(1-\monomial[{\permutationMono[{n+1}]}]))_2} $ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Phase \\ $\angleScaleA[n][*]$ \\ \end{tabular} & $\displaystyler\xi^{{\rm j}f_{\rm phase,a^*}(\textit{\textbf{x}})}
= r\xi^{-{\rm j} \sum_{n=1}^{m-1}\angleScaleAexp[{n}](\monomial[{\permutationMono[{n}]}]\monomial[{\permutationMono[{n+1}]}])_2}$ & $\displaystyler\xi^{{\rm j}g_{\rm phase,a^*}(\textit{\textbf{x}})}
= r\xi^{-{\rm j}\angleScaleAexp[{m}]\monomial[{\permutationMono[{m}]}]-{\rm j}\sum_{n=1}^{m-1}\angleScaleAexp[{n}]\monomial[{\permutationMono[{n}]}]\monomial[{\permutationMono[{n+1}]}]}$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Phase \\ $\angleScaleB[n][]$ \\ \end{tabular} & $\displaystyler\xi^{{\rm j}f_{\rm phase,b}(\textit{\textbf{x}})}
= r\xi^{{\rm j} \angleScaleBexp[{m}] \monomial[{\permutationMono[{m}]}] + {\rm j} \sum_{n=1}^{m-1}\angleScaleBexp[{n}] (\monomial[{\permutationMono[{n}]}](1-\monomial[{\permutationMono[{n+1}]}]))_2}$ & $\displaystyler\xi^{{\rm j}g_{\rm phase,b}(\textit{\textbf{x}})}
= r\xi^{{\rm j} \sum_{n=1}^{m-1}\angleScaleBexp[{n}] (\monomial[{\permutationMono[{n}]}](1-\monomial[{\permutationMono[{n+1}]}]))_2}$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Phase \\ $\angleScaleB[n][*]$ \\ \end{tabular} & $\displaystyler\xi^{{\rm j}f_{\rm phase,b^*}(\textit{\textbf{x}})}
= r\xi^{-{\rm j}\sum_{n=1}^{m-1}\angleScaleBexp[{n}]((1-\monomial[{\permutationMono[{n}]}])\monomial[{\permutationMono[{n+1}]}])_2}$ & $\displaystyler\xi^{{\rm j}g_{\rm phase,b^*}(\textit{\textbf{x}})}
= r\xi^{-{\rm j}\angleScaleBexp[{m}](1-\monomial[{\permutationMono[{m}]}])_2-{\rm j}\sum_{n=1}^{m-1}\angleScaleBexp[{n}]((1-\monomial[{\permutationMono[{n}]}])\monomial[{\permutationMono[{n+1}]}])_2}$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Sign \\ \end{tabular} & $\displaystyler\xi^{{\rm j}f_{\rm sign}(\textit{\textbf{x}})}
= r\xi^{{\rm j} \frac{H}{2}\sum_{n=1}^{m-1}\monomial[{\permutationMono[{n}]}]\monomial[{\permutationMono[{n+1}]}]}$ & $\displaystyler\xi^{{\rm j}g_{\rm sign}(\textit{\textbf{x}})}
= r\xi^{{\rm j}\frac{H}{2}\left(\monomial[{\permutationMono[{m}]}]+\sum_{n=1}^{m-1}\monomial[{\permutationMono[{n}]}]\monomial[{\permutationMono[{n+1}]}]\right)}$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Phase \\ $\angleGolay[n]$ \end{tabular} & $\displaystyler\xi^{{\rm j}f_{\rm phase}(\textit{\textbf{x}})}
= r\xi^{{\rm j} \sum_{n=1}^m \angleexp[n]\monomial[{\permutationMono[{n}]}]}$ & $\displaystyler\xi^{{\rm j}g_{\rm phase}(\textit{\textbf{x}})}
= r\xi^{{\rm j} \sum_{n=1}^m \angleexp[n]\monomial[{\permutationMono[{n}]}]}$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Shift \\ $\separationGolay[n]$ \end{tabular} & $\displaystyle\functionhz^{f_{\rm shift}(\textit{\textbf{x}})}
= \functionhz^{\sum_{n=1}^m \separationGolay[n]\monomial[{\permutationMono[{n}]}]}$ & $\displaystyle\functionhz^{g_{\rm shift}(\textit{\textbf{x}})}
= \functionhz^{\sum_{n=1}^m \separationGolay[n]\monomial[{\permutationMono[{n}]}]}$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Order \\ $\polySeq[{\textit{\textbf{a}}}][z]$ \end{tabular} & $\displaystyle\polySeq[{\textit{\textbf{a}}}][z]^{f_{\rm order,a}(\textit{\textbf{x}})} = (\polySeq[{\textit{\textbf{a}}}][z])^{(1-\monomial[{\permutationMono[{1}]}])_2}$ & $\displaystyle\polySeq[{\textit{\textbf{a}}}][z]^{g_{\rm order,a}(\textit{\textbf{x}})} = (\polySeq[{\textit{\textbf{a}}}][z])^{(1-\monomial[{\permutationMono[{1}]}])_2}$ \\ \hline
\hspace{-3mm}\begin{tabular}{l}Order \\ $\polySeq[{\textit{\textbf{a}}}][z]$ \end{tabular} & $\displaystyle\polySeq[{\textit{\textbf{b}}}][z]^{f_{\rm order,b}(\textit{\textbf{x}})} = \polySeq[{\textit{\textbf{b}}}][z]^{\monomial[{\permutationMono[{1}]}]}$ & $\displaystyle\polySeq[{\textit{\textbf{b}}}][z]^{g_{\rm order,b}(\textit{\textbf{x}})} = \polySeq[{\textit{\textbf{b}}}][z]^{\monomial[{\permutationMono[{1}]}]}$ \\ \hline
\end{tabular}
}
\label{table:ANFgolayComplete}
\end{table*}
\renewcommand{\baselinestretch}{1.5}
\label{app:red}
\begin{proof}
We re-write \eqref{eq:iterationGolay} as
\begin{align}
\functionf[n] &=
\operatorAngleScaleA[1][{n}]
\operatorAngleConjScaleA[0][{n}]
\operatorAngleScaleB[0][{n}]
\operatorAngleConjScaleB[0][{n}]
\nonumber\\&\circ
\operatorSign[0][{n}]
\operatorScaleA[1][{n}]
\operatorScaleB[0][{n}]
\operatorAngle[0][{n}]
\operatorSeparation[0][{n}]
\operatorOrderA[1][{n}]
\operatorOrderB[0][{n}]
({\functionf[n-1]})\nonumber\\
&+
\operatorAngleScaleA[0][{n}]
\operatorAngleConjScaleA[0][{n}]
\operatorAngleScaleB[1][{n}]
\operatorAngleConjScaleB[0][{n}]
\nonumber\\&\circ
\operatorSign[0][{n}]
\operatorScaleA[0][{n}]
\operatorScaleB[1][{n}]
\operatorAngle[1][{n}]
\operatorSeparation[0][{n}]
\operatorOrderA[0][{n}]
\operatorOrderB[1][{n}]
({\functiong[n-1]})
w^{2^\permutationShift[{n}]}~, \nonumber\\
\functiong[n] &=
\operatorAngleScaleA[0][{n}]
\operatorAngleConjScaleA[0][{n}]
\operatorAngleScaleB[0][{n}]
\operatorAngleConjScaleB[1][{n}]
\nonumber\\&\circ
\operatorSign[0][{n}]
\operatorScaleA[0][{n}]
\operatorScaleB[1][{n}]
\operatorAngle[0][{n}]
\operatorSeparation[1][{n}]
\operatorOrderA[1][{n}]
\operatorOrderB[0][{n}]
({\functionf[n-1]})\nonumber\\
&+
\operatorAngleScaleA[0][{n}]
\operatorAngleConjScaleA[1][{n}]
\operatorAngleScaleB[0][{n}]
\operatorAngleConjScaleB[0][{n}]
\nonumber\\&\circ
\operatorSign[1][{n}]
\operatorScaleA[1][{n}]
\operatorScaleB[0][{n}]
\operatorAngle[1][{n}]
\operatorSeparation[1][{n}]
\operatorOrderA[0][{n}]
\operatorOrderB[1][{n}]
({\functiong[n-1]})
w^{2^\permutationShift[{n}]}~,
\label{eq:iterationGolayWithOperators}
\end{align}
by using the operators defined in \tablename~\ref{table:ANFgolay}.
In \eqref{eq:iterationGolayWithOperators}, the operators related to the scalars, i.e., $\scaleA[n]$ and $\scaleB[n]$, and the phase rotations, i.e., $\angleScaleA[n][]$, $\angleScaleA[n][*]$, $\angleScaleB[n][]$, $\angleScaleB[n][*]$, and $\angleGolay[n]$, are denoted by $\operatorScaleA[\{0,1\}][{n}]$,
$\operatorAngleScaleA[\{0,1\}][{n}]$,
$\operatorAngleConjScaleA[\{0,1\}][{n}]$,
$\operatorAngleScaleB[\{0,1\}][{n}]$,
$\operatorAngleConjScaleB[\{0,1\}][{n}]$,
and $\operatorAngle[\{0,1\}][{n}]$ respectively.
The signs for $\polySeq[{\seqGaIt[n-1]}][z]$ and $\polySeq[{\seqGbIt[n-1]}][z]$ in \eqref{eq:iterationGolay} are generated through the operators $\operatorSign[\{0,1\}][{n}](r)$. While the operators $\operatorSeparation[\{0,1\}][{n}]$ apply a shifting factor to their arguments, the operators $\operatorOrderA[\{0,1\}][{n}]$ and $\operatorOrderB[\{0,1\}][{n}]$ generate the polynomials $\polySeq[{\textit{\textbf{a}}}][z]$ and $\polySeq[{\textit{\textbf{b}}}][z]$ for $n=1$, respectively. For the sake of unifying the operator formats, we express the corresponding operators by using the power of $\xi$ and define $\scaleA[n]\triangleq\xi^{\scaleAexp[n]}$, $\scaleB[n]\triangleq\xi^{\scaleBexp[n]}$,
$\angleScaleA[n][]\triangleq\xi^{{\rm j}\angleScaleAexp[n]}$,
$\angleScaleB[n][]\triangleq\xi^{{\rm j}\angleScaleBexp[n]}$,
and $\angleGolay[n]\triangleq\xi^{{\rm j}\angleexp[n]}$ and exploit the identity $\xi^{{\rm j}\frac{H}{2}}=-1$ in \tablename~\ref{table:ANFgolay}. The configuration vectors $\vecArrangement[n]$ for the sub-recursions are also given in \tablename~\ref{table:ANFgolay}. By plugging the configuration vectors $\vecArrangement[n]$ to \eqref{eq:closedformANFsF} and \eqref{eq:closedformANFsG}, $\funcGfForANF[n](\textit{\textbf{x}})$ and $\funcGgForANF[n](\textit{\textbf{x}})$ are obtained for each sub-recursion as in \tablename~\ref{table:ANFgolay} for $n=1,2,\dots,m$.
Finally, $\compositeOperatorF[x][r]$ and $\compositeOperatorG[x][r]$ for \eqref{eq:iterationGolayWithOperators} can be derived by composing $\compositeOperatorF[x][r]$ and $\compositeOperatorG[x][r]$ given for each sub-recursion in \tablename~\ref{table:ANFgolayComplete}. The parameter $w$ can be chosen arbitrarily on the unit circle based on \eqref{eq:iterationGolay}. For $w\triangleqz^{N}$, $\polySeq[{\seqGaIt[m]}][z]$ and $\polySeq[{\seqGbIt[m]}][z]$ can be calculated as
\begin{align}
\polySeq[{\seqGaIt[m]}][z] &= \sum_{x=0}^{2^m-1}
f_{\rm o}(\textit{\textbf{x}},z)\times
\xi^{f_{\rm r}(\textit{\textbf{x}}) + {\rm j} f_{\rm i}(\textit{\textbf{x}})}\times
z^{f_{\rm s}(\textit{\textbf{x}}) + xN}~,
\label{eq:encodedCSa}
\\
\polySeq[{\seqGbIt[m]}][z] &= \sum_{x=0}^{2^m-1}
f_{\rm o}(\textit{\textbf{x}},z)\times
\xi^{g_{\rm r}(\textit{\textbf{x}}) + {\rm j} g_{\rm i}(\textit{\textbf{x}})}\times
z^{f_{\rm s}(\textit{\textbf{x}}) + xN}
\label{eq:encodedCSb}
\end{align}
where
\begin{align}
f_{\rm r}(\textit{\textbf{x}})
=&f_{\rm scale,a}(\textit{\textbf{x}})+f_{\rm scale,b}(\textit{\textbf{x}})\nonumber\\
=& c_{\rm r}(\textit{\textbf{x}}) +\scaleAexp[m](1-\monomial[{\permutationMono[{m}]}])_2+\scaleBexp[m]\monomial[{\permutationMono[{m}]}] \label{eq:realPart}~,
\end{align}
\begin{align}
g_{\rm r}(\textit{\textbf{x}})
=&g_{\rm scale,a}(\textit{\textbf{x}})+g_{\rm scale,b}(\textit{\textbf{x}}) \nonumber~,\\
=& c_{\rm r}(\textit{\textbf{x}}) +\scaleBexp[m](1-\monomial[{\permutationMono[{m}]}])_2 +\scaleAexp[m]\monomial[{\permutationMono[{m}]}]\nonumber~,
\end{align}
\begin{align}
f_{\rm i}(\textit{\textbf{x}})
=& f_{\rm sign}(\textit{\textbf{x}})+f_{\rm phase}(\textit{\textbf{x}})+f_{\rm phase,a}(\textit{\textbf{x}}) \nonumber\\&+ f_{\rm phase,a^*}(\textit{\textbf{x}}) + f_{\rm phase,b}(\textit{\textbf{x}}) + f_{\rm phase,b^*}(\textit{\textbf{x}}) \nonumber~,
\\
=& c_{\rm i}(\textit{\textbf{x}})+\angleScaleAexp[{m}] (1-\monomial[{\permutationMono[{m}]}])_2 +\angleScaleBexp[{m}] \monomial[{\permutationMono[{m}]}]\label{eq:imagPart}~,
\end{align}
\begin{align}
g_{\rm i}(\textit{\textbf{x}})
=& g_{\rm sign}(\textit{\textbf{x}})+g_{\rm phase}(\textit{\textbf{x}})+g_{\rm phase,a}(\textit{\textbf{x}}) \nonumber\\&+ g_{\rm phase,a^*}(\textit{\textbf{x}}) + g_{\rm phase,b}(\textit{\textbf{x}}) + g_{\rm phase,b^*}(\textit{\textbf{x}}) \nonumber~,
\\
=& c_{\rm i}(\textit{\textbf{x}}) - \angleScaleAexp[{m}] \monomial[{\permutationMono[{m}]}] -\angleScaleBexp[{m}] (1-\monomial[{\permutationMono[{m}]}])_2+ \frac{H}{2}\monomial[{\permutationMono[{m}]}] \nonumber,
\end{align}
where
\begin{align}
c_{\rm r}(\textit{\textbf{x}})
\triangleq& { \sum_{n=1}^{m-1}\scaleAexp[n](1-\monomial[{\permutationMono[{n}]}] -\monomial[{\permutationMono[{n+1}]}])_2+\scaleBexp[n](\monomial[{\permutationMono[{n}]}] +\monomial[{\permutationMono[{n+1}]}])_2 }\nonumber~,
\\
c_{\rm i}(\textit{\textbf{x}})
\triangleq& {\frac{H}{2}\sum_{n=1}^{m-1}\monomial[{\permutationMono[{n}]}]\monomial[{\permutationMono[{n+1}]}]}+\sum_{n=1}^m \angleexp[n]\monomial[{\permutationMono[{n}]}]\nonumber
\\
&+\sum_{n=1}^{m-1}\angleScaleAexp[{n}] ((1-\monomial[{\permutationMono[{n}]}])(1-\monomial[{\permutationMono[{n+1}]}]))_2
-\angleScaleAexp[{n}](\monomial[{\permutationMono[{n}]}]\monomial[{\permutationMono[{n+1}]}])_2\nonumber
\\
& +\sum_{n=1}^{m-1}\angleScaleBexp[{n}] (\monomial[{\permutationMono[{n}]}](1-\monomial[{\permutationMono[{n+1}]}]))_2
-\angleScaleBexp[{n}]((1-\monomial[{\permutationMono[{n}]}])\monomial[{\permutationMono[{n+1}]}])_2\nonumber
~.
\end{align}
and
\begin{align}
f_{\rm s}(\textit{\textbf{x}}) =&f_{\rm shift}(\textit{\textbf{x}}) = g_{\rm shift}(\textit{\textbf{x}}) =\sum_{n=1}^m\separationGolay[n]\monomial[{\permutationMono[{n}]}]
\nonumber~,
\\
f_{\rm o}(\textit{\textbf{x}},z)=&\polySeq[{\textit{\textbf{a}}}][z]^{f_{\rm order,a}(\textit{\textbf{x}})}\polySeq[{\textit{\textbf{b}}}][z]^{f_{\rm order,b}(\textit{\textbf{x}})}\nonumber\\
\stackrel{(a)}{=}
&\polySeq[{\textit{\textbf{a}}}][z](1-\monomial[{\permutationMono[{1}]}])_2+\polySeq[{\textit{\textbf{b}}}][z]\monomial[{\permutationMono[{1}]}]~,
\nonumber
\nonumber
\end{align}
where (a) is due to the fact that $f_{\rm order,a}(\textit{\textbf{x}})$ (or $g_{\rm order,a}(\textit{\textbf{x}})$) is 1 when $f_{\rm order,b}(\textit{\textbf{x}})$ (or $g_{\rm order,b}(\textit{\textbf{x}})$) is 0 or vice versa.
Based on \eqref{eq:identity2},
$
\scaleAexp[n](1-\monomial[{\permutationMono[{n}]}] -\monomial[{\permutationMono[{n+1}]}])_2 = \scaleAexp[n] - \scaleAexp[n](\monomial[{\permutationMono[{n}]}] +\monomial[{\permutationMono[{n+1}]}])_2 \nonumber
$,
$\scaleAexp[m](1-\monomial[{\permutationMono[{m}]}])_2=\scaleAexp[m]-\scaleAexp[m]\monomial[{\permutationMono[{m}]}]$,
and
$\scaleBexp[m](1-\monomial[{\permutationMono[{m}]}])_2=\scaleBexp[m]-\scaleBexp[m]\monomial[{\permutationMono[{m}]}]$,
Hence, $f_{\rm r}(\textit{\textbf{x}})$ and $g_{\rm r}(\textit{\textbf{x}})$ can be re-written as
\begin{align}
f_{\rm r}(\textit{\textbf{x}})
=&\scaleEexp[m]\monomial[{\permutationMono[{m}]}]+{ \sum_{n=1}^{m-1}\scaleEexp[n](\monomial[{\permutationMono[{n}]}] +\monomial[{\permutationMono[{n+1}]}])_2 }+e'~,\nonumber\\
g_{\rm r}(\textit{\textbf{x}})
=&\scaleEexp[m](1-\monomial[{\permutationMono[{m}]}])_2+{ \sum_{n=1}^{m-1}\scaleEexp[n](\monomial[{\permutationMono[{n}]}] +\monomial[{\permutationMono[{n+1}]}])_2 }+e'~,\nonumber
\end{align}
respectively, where $\scaleEexp[n] = (\scaleBexp[n]-\scaleAexp[n])$ for $n = 1,2,\mydots,m$, and $e' = \sum_{n=1}^{m}\scaleAexp[n]$, and and they can be chosen independently. By using the identities given in \eqref{eq:identity2}-\eqref{eq:identity5},
$
\angleScaleAexp[{m}] (1-\monomial[{\permutationMono[{m}]}])_2 +\angleScaleBexp[{m}] \monomial[{\permutationMono[{m}]}] = \angleScaleAexp[{m}]+(\angleScaleBexp[{m}]-\angleScaleAexp[{m}])\monomial[{\permutationMono[{m}]}]
$,
$
\angleScaleAexp[{m}] \monomial[{\permutationMono[{m}]}] + \angleScaleBexp[{m}] (1-\monomial[{\permutationMono[{m}]}])_2 = \angleScaleBexp[{m}]+(\angleScaleAexp[{m}]-\angleScaleBexp[{m}])\monomial[{\permutationMono[{m}]}]
$,
$
\angleScaleAexp[{n}] ((1-\monomial[{\permutationMono[{n}]}])(1-\monomial[{\permutationMono[{n+1}]}]))_2 -\angleScaleAexp[{n}](\monomial[{\permutationMono[{n}]}]\monomial[{\permutationMono[{n+1}]}])_2=
\angleScaleAexp[{n}] -
\angleScaleAexp[{n}] \monomial[{\permutationMono[{n}]}] -\angleScaleAexp[{n}]\monomial[{\permutationMono[{n+1}]}]$, and
$
\angleScaleBexp[{n}] (\monomial[{\permutationMono[{n}]}](1-\monomial[{\permutationMono[{n+1}]}]))_2
-\angleScaleBexp[{n}]((1-\monomial[{\permutationMono[{n}]}])\monomial[{\permutationMono[{n+1}]}])_2 =
\angleScaleBexp[{n}] \monomial[{\permutationMono[{n}]}]
-\angleScaleBexp[{n}]\monomial[{\permutationMono[{n+1}]}]
$.
Hence, $f_{\rm i}(\textit{\textbf{x}})$ and $g_{\rm i}(\textit{\textbf{x}})$ can be re-expressed as
\begin{align}
f_{\rm i}(\textit{\textbf{x}})
=&
{\frac{H}{2}\sum_{n=1}^{m-1}\monomial[{\permutationMono[{n}]}]\monomial[{\permutationMono[{n+1}]}]}
+
\overbrace{
\sum_{n=1}^{m}\angleScaleAexp[{n}]
}^{k'}
+
\overbrace{
(\angleexp[1] + \angleScaleBexp[{1}]-\angleScaleAexp[{1}])}^{\angleexpAll[1]} \monomial[{\permutationMono[{1}]}]
\nonumber\\&+
\sum_{n=2}^{m}\overbrace{(\angleexp[n] +\angleScaleBexp[{n}]-\angleScaleAexp[{n}]-\angleScaleBexp[{n-1}]-\angleScaleAexp[{n-1}])}^{\angleexpAll[n]} \monomial[{\permutationMono[{n}]}]~. \nonumber
\end{align}
and
\begin{align}
g_{\rm i}(\textit{\textbf{x}})
=&
{\frac{H}{2}\left(\monomial[{\permutationMono[{m}]}]+\sum_{n=1}^{m-1}\monomial[{\permutationMono[{n}]}]\monomial[{\permutationMono[{n+1}]}]\right)}_2
+
\overbrace{
(\angleexp[1] + \angleScaleBexp[{1}]-\angleScaleAexp[{1}])}^{\angleexpAll[1]} \monomial[{\permutationMono[{1}]}]
\nonumber\\&+
\sum_{n=2}^{m}\overbrace{(\angleexp[n] +\angleScaleBexp[{n}]-\angleScaleAexp[{n}]-\angleScaleBexp[{n-1}]-\angleScaleAexp[{n-1}])}^{\angleexpAll[n]} \monomial[{\permutationMono[{n}]}]\nonumber\\
&
\overbrace{
-\angleScaleBexp[{m}] + \sum_{n=1}^{m-1}\angleScaleAexp[{n}]
}^{k''}
~, \nonumber
\end{align}
respectively. The length of $\seqGaIt[m]$ and $\seqGbIt[m]$ can be calculated as
$\max_{x}{N+f_{\rm s}(\textit{\textbf{x}}) + \lengthGaGbx}$, which gives $N 2^m+\sum_{n=1}^m\separationGolay[n]$
since the function $f_{\rm s}(\textit{\textbf{x}})$ gets its maximum and minimum values when $x$ is maximum, i.e., $2^m-1$, and minimum, i.e., $0$, respectively.
\end{proof}
\bibliographystyle{IEEEtran}
| {'timestamp': '2019-07-30T02:10:23', 'yymm': '1810', 'arxiv_id': '1810.02383', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02383'} | arxiv |
\section{Introduction}
Biochemical engineering deals with noisy and uncertain processes. Modelling these processes is often difficult, and exacerbated by the difficulty of observing mechanisms and reactions on the molecular level. We can hypothesise several different mathematical models to explain a system's behaviour and run experiments to discriminate between the models. The idea is that there is a real, expensive-to-evaluate system, and $M$ rival models predicting the system behaviour. These models are effectively different hypotheses about some underlying system mechanism. We seek to discard all inaccurate model(s) with as few experiments as possible.
For analytical models, where the functional relationship can be expressed in closed form, extensive literature exists for design of experiments for model discrimination, e.g.\ \cite{HunterReiner1965}, \cite{BoxHill1967}, \cite{BuzziFerraris1983}, \cite{BuzziFerraris1984}, \cite{BuzziFerraris1990}, \cite{AspreyMacchietto2000} and \cite{Michalik2010}. The challenge is that most mathematical models for industrially relevant biological and chemical processes are neither simple nor analytical. From an optimisation point-of-view, they are often complex black boxes, e.g.\ legacy code representing large systems of partial differential equations. For these models, we can simulate the process at discrete locations, but gradient information with respect to model parameters is not readily available. The number of function evaluations needed for finite-difference gradient approximation may also be computationally prohibitive. Automatic differentiation \citep{AD_Neidinger2010, AD_Farrell2013, AD_Baydin2018} can be used to retrieve gradient information from some models, but will not work e.g.\ for models with non-smoothness and discontinuities (\citeauthor{ConnScheinbergVicenteBook}, \citeyear{ConnScheinbergVicenteBook}, pp.~3--5; \citeauthor{MartelliAmaldi2014}, \citeyear{MartelliAmaldi2014}; \citeauthor{BOUKOUVALA2016701}, \citeyear{BOUKOUVALA2016701}). These may be due to switches (\pythoninline{if}/\pythoninline{else} statements) or internal optimisation steps in the models.
Existing methods for design of experiments for black-box model discrimination utilise Monte Carlo techniques, e.g.\ \cite{Vanlier2014}, \cite{Drovandi2014}, \cite{Ryan2015} and \cite{Woods2017}. The optimal experimental design is found through exhaustive sampling of the design and model parameter spaces. This can incur a significant computational burden, especially if model evaluation is computationally slow \citep{Vanlier2014, Ryan2016}. Even for small-scale problems, the computational time to find the optimal next experiment can be on the order of days or weeks, often rivalling the time needed to carry out the actual experiment.
Design of experiments for parameter estimation has received more attention in literature than design of experiments for model discrimination \citep{Ryan2016}. Combined design criteria for parameter estimation and model discrimination exist, e.g.\ \cite{Atkinson2008} and \cite{Waterhouse2009}, but tend to perform sub-optimally for model discrimination. Therefore, we focus on design of experiments for model discrimination.
Section~\ref{sec:doemd} presents the classical method of design of experiments, with descriptions of design criteria from literature. Section~\ref{sec:DJR} proposes a novel design criterion based on the Jensen-R\'enyi divergence measure. Section~\ref{sec:gpsurrogates} describes a novel method of using Gaussian process surrogate models to perform design of experiments for discriminating black-box models. From the surrogate models, the predictive distributions can be computed and used with design criteria from literature or our proposed design criterion. Section~\ref{sec:gpdoemd} presents the open-source Python library GPdoemd, which implements the Gaussian process surrogate method. Section~\ref{sec:results} presents results from several case studies to assess the performance of our proposed design criterion based on Jensen-R\'enyi divergence and Gaussian process surrogate model method. Finally, Sections~\ref{sec:discussion} and \ref{sec:conclusions} conclude the paper. Table~\ref{tab:notation} presents the paper's notation.
\begin{table}[!t]
\centering
\caption{Summary of notation.}
\label{tab:notation}
\begin{tabular}{c l}
\hline
Symbol & Description \Tstrut\Bstrut\\
\hline
$\mathcal{N}(\cdot, \cdot)$ & Gaussian distribution
\Tstrut\Bstrut\\[1.25mm]
$\mat A^{-1}$ & Inverse of matrix $\mat A$, such that $\mat A \mat A^{-1} = \mat I$.
\Tstrut\Bstrut\\[1.25mm]
$\mat A^\top$ & Transpose of matrix $\mat A$.
\Tstrut\Bstrut\\[1.25mm]
$|\mat A|$ & Determinant of matrix $\mat A$.
\Tstrut\Bstrut\\[1.25mm]
$\tr(\mat A)$ & Trace of matrix $\mat A$.
\Tstrut\Bstrut\\[1.25mm]
$\vec u$ & Design variable $\vec u \in \mathbb{R}^D$.
\Tstrut\Bstrut\\[1.25mm]
$D$ & Dimensionality of design variable space, $\vec u \in \mathbb{R}^D$.
\Tstrut\Bstrut\\[1.25mm]
$\vec \theta_i$ & Parameters of model $i$ , $\vec \theta_i \in \mathbb{R}^{D_i}$.
\Tstrut\Bstrut\\[1.25mm]
$D_i$ & Dimensionality of model $i$'s parameter space, $\vec \theta_i \in \mathbb{R}^{D_i}$.
\Tstrut\Bstrut\\[1.25mm]
$f_i$ & Model $i$
\Tstrut\Bstrut\\[1.25mm]
$M$ & Number of rival models $f_i$;\, $i = 1, \dots, M$.
\Tstrut\Bstrut\\[1.25mm]
$\vec f_i$ & Model $f_i$ evaluated at location $(\vec u, \vec \theta_i)$.
\Tstrut\Bstrut\\[1.25mm]
$f_{i,(e)}$ & Target dimension $e$ of model $f_i$; $e=1,\dots,E$.
\Tstrut\Bstrut\\[1.25mm]
$E$ & Number of target dimensions; $f_i:\,\mathbb{R}^{D + D_i} \to \mathbb{R}^E$.
\Tstrut\Bstrut\\[1.25mm]
$\vec \Sigma$ & Experimental noise covariance.
\Tstrut\Bstrut\\[1.25mm]
$\mathcal{D}$ & Set of experimental data
\Tstrut\Bstrut\\[1.25mm]
\hline
\end{tabular}
\end{table}
This paper is based on and extends two conference papers. Most of Section~\ref{sec:gpsurrogates} (excluding Section~\ref{sec:sparse_gp_regression}) repeats \cite{Olofsson2018_ICML, Olofsson2018_PSE}. Tables~\ref{tab:icmlresults} and~\ref{tab:vanlierresults} and Figure~\ref{fig:vanlier}a appear in~\cite{Olofsson2018_ICML}. But Section~\ref{sec:DJR} and~\ref{sec:gpdoemd}, i.e.\ derivation of the Jensen-R\'enyi divergence design criterion and description of the GPdoemd software package, respectively, are novel contributions of this paper. Additionally, we introduce new examples to the results section.
\section{Background}
\label{sec:doemd}
The fundamental principle of experimental design for model discrimination is selecting the next experimental point where the model predictions differ most \citep{HunterReiner1965}. The task is to find an appropriate measure of this difference as a function of the model inputs. The measure of difference between model predictions should incorporate our confidence in said model predictions. Uncertainty in the model predictions comes mainly from uncertainty in the model parameters, which are tuned by fitting the model to noisy observations in the data set $\mathcal{D}$. We assume zero-mean Gaussian distributed experimental noise with known (or upper-bounded) covariance $\vec \Sigma$. The experimental noise combines measurement noise and inherent system stochasticity. Skews in the noise distribution can often be handled, e.g.\ through a power transformation of the data \citep{BoxCoxTransform1964}.
Let each model $i$ assume experimental observations $\vec y = y(\vec u)$ are Gaussian distributed with $\vec y \sim \mathcal{N}(f_i(\vec u, \vec \theta_i), \Sigma_i(\vec u))$, where $f_i(\vec u, \vec \theta_i)$ is model $i$'s predicted mean and $\Sigma_i(\vec u) = \breve{\Sigma}_{i}(\vec u) + \vec \Sigma$ is the sum of model and noise covariance, given design $\vec u$ and model parameter estimate $\vec \theta_i$. The experimental data set $\lbrace \vec u_n, \vec y_n \rbrace_{n=1}^N$ is denoted $\mathcal{D}$. The model covariance $\breve{\Sigma}(\cdot)$ accounts for uncertainty in the model prediction due to uncertainty in the model parameter estimate $\vec \theta_i$ (see Figure~\ref{fig:rival_models}).
\begin{figure}[!t]
\centering
\includegraphics[width=0.65\textwidth]{figures/rival_models.pdf}
\caption{Observed data $\mathcal{D}$ and two rival models $f_1$ and $f_2$ predicting the outcome of possible future experiments. The predictive means with two standard deviations are plotted.}
\label{fig:rival_models}
\end{figure}
To simplify notation, let $\vec f_i = f_i (\vec u, \vec \theta_i)$ and $\vec \Sigma_i = \Sigma_i(\vec u)$ denote the predictive mean and covariance, respectively.
This section first describes the classical method of computing the model covariance $\breve{\Sigma}_{i}(\vec u)$ through a Laplace approximation, which fits a local Gaussian to the parameter distribution $p(\vec \theta_i \,|\, \mathcal{D})$, centred at the maximum \emph{a posteriori} estimate $\vec \theta_i = \vec \theta_i^\ast$. Next, we describe some classical design criteria, i.e.\ measures of difference in model predictions.
\subsection{Approximating the Model Covariance $\breve{\Sigma}(\vec u)$}
\label{sec:paramcovar}
The predictive model covariance $\breve{\Sigma}(\vec u)$ accounts for variance in the model prediction $\vec f_i$ due to uncertainty in the model parameters $\vec \theta_i$. Classical literature assumes approximately linear models with respect to the model parameters near $\vec \theta_i = \vec \theta_i^\ast$ \citep{BoxHill1967, BuzziFerraris1984, PrasasSomeswaraRao1977}. Given zero-mean Gaussian distributed experimental noise with covariance $\vec \Sigma$, model $i$'s parameter estimate is approximately Gaussian distributed, $\vec \theta_i \sim \mathcal{N}(\vec \theta_i^\ast, \vec \Sigma_{\theta,i})$. The covariance $\vec \Sigma_{\theta,i}$ is given by the Laplace approximation:
\begin{align}
\vec \Sigma_{\theta,i} &=
\left[ \sum_{n=1}^N \nabla_{\vec \theta} \vec f_i^\top(\vec u_n) \vec \Sigma^{-1} \nabla_{\vec \theta} \vec f_i(\vec u_n) \right]^{-1} \,,
\end{align}
with $\nabla_\theta \vec f_i (\vec u_n) = \left. \partial f_i(\vec u_n, \vec \theta_i) / \partial \vec \theta_i \right|_{\vec \theta_i = \vec \theta_i^\ast}$ the gradient of the model prediction for design $\vec u_n \in \mathcal{D}$ with respect to the model parameters.
The model covariance $\breve{\Sigma}_{i}(\vec u)$ at a test point $\vec u$ is then given by:
\begin{align}
\label{eq:analyticalmodelcovariance}
\breve{\Sigma}_{i}(\vec u) &=
\nabla_{\vec \theta} \vec f_i^\top(\vec u) \vec \Sigma_{\theta,i} \nabla_{\vec \theta} \vec f_i(\vec u) \,.
\end{align}
The covariance $\vec \Sigma_i$ of experimental observations according to model $i$, also taking the experimental noise covariance $\vec \Sigma$ into account, is $\vec \Sigma_i = \breve{\Sigma}_{i}(\vec u) + \vec \Sigma$.
\subsection{Design Criteria for Model Discrimination}
\label{sec:dcs}
The fundamental principle of sequential experimental design for model discrimination says to select the next experimental point where the model predictions differ the most \citep{HunterReiner1965}. The measure of how much the models differ is the \textit{design criterion} and the design optimisation problem maximises this design criterion.
Possibly the earliest recorded design criterion is the Mahalanobis distance between the models' predictive means, proposed by \cite{HunterReiner1965} and extended to multiple target dimensions and more than two rival models, e.g.\ by \cite{EspieMacchietto1989}:
\begin{align}
\label{eq:DHR}
D_{\mathrm{HR}}(\vec u) = \sum_{i=1}^{M-1} \sum_{j=i+1}^M (\vec f_i - \vec f_j)^\top \mat Q (\vec f_i - \vec f_j) \,,
\end{align}
where $\mat Q$ is a diagonal scaling matrix. This design criterion is popular in many practical applications, mainly because of its simplicity. \cite{AtkinsonFedorov1975} define a $T$-optimality criterion and argue that the $D_{\mathrm{HR}}$ is the only design criterion that can realise $T$-optimal experimental designs.
\cite{BoxHill1967} criticise the \eqref{eq:DHR} design criterion for not considering parameter uncertainty and experimental noise, i.e.\ maximising the difference between model predictions without regard for our confidence level in the predictions' accuracy. Instead, \cite{BoxHill1967} propose measuring the information gain of an additional experimental observation $\vec y_{N}$ through the change in Shannon entropy $H_{\mathrm{S},N} = \sum_{i=1}^M \pi_{i,N} \log \pi_{i,N}$, where $\pi_{i,N} = \hat{\pi}_{i,N} / \sum_{j} \hat{\pi}_{j,N}$ are normalised model posteriors with $\hat{\pi}_{i,N} = \mathcal{N}(\vec y_N\,|\, \vec f_i, \vec \Sigma_i) \pi_{i,N-1}$. From this, \cite{BoxHill1967} derive a new design criterion, extended to multiple target dimensions by \cite{PrasasSomeswaraRao1977}:
\begin{align}
\label{eq:DBH}
\begin{split}
D_{\mathrm{BH}}(\vec u) = \sum_{i=1}^{M-1} \sum_{j=i+1}^M \pi_{i,N} \pi_{j,N} \Big\lbrace
&\tr ( \vec \Sigma_i \vec \Sigma_j^{-1} + \vec \Sigma_j \vec \Sigma_i^{-1} - 2 \mat I )
\\&+ (\vec f_i - \vec f_j)^\top ( \vec \Sigma_i^{-1} + \vec \Sigma_j^{-1} ) (\vec f_i - \vec f_j) \Big\rbrace \,.
\end{split}
\end{align}
The \eqref{eq:DBH} design criterion is the upper bound on the expected change $\mathbb{E}_{\vec y_{N}}[H_{\mathrm{S},N}] - H_{\mathrm{S},N-1}$ in Shannon entropy from the next observation $\vec y_{N}$. Experiments are conducted until $\pi_{i,N} \approx 1$ for some model $i$, or until the experimental budget is exhausted.
\cite{Meeter1970} note that it seems strange to maximise the \textit{upper} bound on the expected change in Shannon entropy rather than the \textit{lower} bound. \cite{BuzziFerraris1983} criticise the use of the normalised model posteriors $\pi_{i,N}$ in~\cite{BoxHill1967} by pointing out that observing the same values $y_{1:N}$ in different order will yield different normalised model posteriors $\pi_{i,N}$, which contradicts common statistical sense. In a series of papers \citep{BuzziFerraris1983, BuzziFerraris1984, BuzziFerraris1990}, another design criterion is proposed:
\begin{align}
\label{eq:DBF}
\begin{split}
D_{\mathrm{BF}}(\vec u) = \sum_{i=1}^{M-1} \sum_{j=i+1}^M &\Big\lbrace \tr \left(2 \vec \Sigma (\vec \Sigma_{i}+\vec \Sigma_{j})^{-1} \right)
\\ &\quad+ (\vec f_i - \vec f_j)^\top (\vec \Sigma_{i}+\vec \Sigma_{j})^{-1} (\vec f_i - \vec f_j) \Big\rbrace \,.
\end{split}
\end{align}
The $D_{\mathrm{BF}}$ design criterion is a heuristic based on the cross-covariance of different models' prediction errors. It can also be seen as a generalisation of $D_{\mathrm{HR}}$ that incorporates parameter uncertainty~\citep[p. 5]{C_Hoffman_thesis}.
\cite{BuzziFerraris1983} and \cite{BuzziFerraris2009} note that under the null hypothesis (``the model is correct''), a model's prediction errors should be zero-mean Gaussian distributed with variance~$\vec \Sigma$. Hence, they propose using a $\chi^2$ test with $N\cdot E - D_i$ degrees of freedom to discard inaccurate models. \cite{BoxHill1967} rank models against each other and implicitly reject all but the least inaccurate model with respect to the data gathered. Using a $\chi^2$ test and discarding models that inadequately describe the observed data increases robustness against inaccurate models. Experiments are conducted until only one model remains, all models have been discarded, or the experimental budget is exhausted. For comparing two models ($M=2$), the $D_{\mathrm{BF}}$ design criterion also has the interpretation that if $D_{\mathrm{BF}}(\vec u)$ is not ``sufficiently larger than~1'', the models cannot be discriminated \citep{BuzziFerraris1983, BuzziFerrarisObservations}, which can be used as a stopping criterion. \cite{Schwaab2006} derive a similar design criterion to $D_{\mathrm{BF}}$ consisting of the second term inside the sums in \eqref{eq:DBF} weighted by each model's prediction error $\chi^2$ probability.
\cite{Michalik2010} argue that the design criteria $D_{\mathrm{BH}}$ in \eqref{eq:DBH} and $D_{\mathrm{BF}}$ in \eqref{eq:DBF} reward model \textit{lumping}, i.e.\ model aggregation, where the predictions of some models are similar but far apart from predictions of other model aggregations (see Figure~\ref{fig:lumping}).
\begin{figure}
\centering
\includegraphics[width=0.85\textwidth]{figures/model_aggregation.pdf}
\caption{(a) An example of model aggregation, where $f_1$/$f_2$ and $f_3$/$f_4$ pairwise yield similar predictions. Given data, we can discriminate between groups of model pairs $f_1$-$f_2$ and $f_3$-$f_4$ but may be unable to discriminate between models intra-pair. (b) No model aggregation. Model aggregation may affect model discrimination \citep{Michalik2010}.}
\label{fig:lumping}
\end{figure}
An observation at a point with model aggregation may determine whether a group of models are more accurate than another group of models, but does not discriminate between models within each of those groups. This is an interesting engineering trade-off: we may wish to identify the one best model, but significantly discriminating between model groups may be more practical than partially discriminating between many models \citep{BuzziFerrarisObservations}.
To avoid sampling at model aggregation points, \cite{Michalik2010} use Akaike's information criterion weights $w_i$ as a heuristic design criterion:
\begin{align}
\label{eq:DAW}
D_{\mathrm{AW}}(\vec u) &= \sum_{i=1}^M w_i p(f_i) \,,
\end{align}
with $p(f_i)$ model $f_i$'s prior probability and the Akaike weights $w_i$ defined as:
\begin{align}
w_i &= \frac{1}{\sum_{j=1}^M \exp \left( - \tfrac{1}{2} (\vec f_i - \vec f_j)^\top \vec \Sigma_{i}^{-1} (\vec f_i - \vec f_j) + D_i - D_j \right)} \,.
\end{align}
Experiments are conducted until $w_i \approx 1$ for some model $i$ (equivalent to one model scoring a significantly higher Akaike information criterion than other models) or until the experimental budget is exhausted. The set of rival models is assumed to contain a ``good'' model, so model discrimination using $w_i$ implicitly selects the least inaccurate model.
\section{$D_{\mathrm{JR}}$: Jensen-R\'enyi Divergence Design Criterion}
\label{sec:DJR}
Model discrimination considers the difference between observed data and model predictions. Hence, \cite{HunterReiner1965} proposed designing new experiments by maximising the difference between model predictions. All three design criteria $D_{\mathrm{BH}}$, $D_{\mathrm{BF}}$ and $D_{\mathrm{AW}}$ implicitly reward divergent model predictive distributions. This section proposes a design criterion that explicitly maximises the model predictive distributions' divergence.
The general expression for the divergence between $M$ predictive distributions $g_i(\vec u)$ for design $\vec u$ is:
\begin{align}
\label{eq:divergence}
\Div[H](\vec u) = H\left( \sum_{i=1}^M \pi_i g_i(\vec u) \right) - \sum_{i=1}^M \pi_i H(g_i(\vec u)) \,,
\end{align}
where $\pi_i$ are weights associated with the corresponding models, and $H$ is some entropy measure. \cite{Vanlier2014} propose a design criterion based on the Jensen-Shannon divergence between model predictive distributions. The Jensen-Shannon divergence $\Div[H_\mathrm{S}]$ is the divergence measure corresponding to the continuous Shannon entropy $H_\mathrm{S}$, or differential entropy, defined by:
\begin{align}
H_\mathrm{S}(G) = - \int G(\vec \gamma) \log G(\vec \gamma) \mathrm{d} \vec\gamma \,,
\end{align}
with information measured in natural units (logarithm base $e$). The expression for $\Div[H_\mathrm{S}](\vec u)$ in \eqref{eq:divergence} is intractable, even for the case of Gaussian distributions $g_i(\vec u) = \mathcal{N}(\vec f_i,\vec \Sigma_i)$. Hence, we can either approximate the divergence measure using Monte Carlo techniques~\citep{Vanlier2014}, or find a different entropy measure that yields a closed-form solution for the divergence of Gaussian distributions. Given the computational complexity of the former, we choose the latter option and turn to the \cite{Renyi1965} entropy measure, a generalisation of the Shannon entropy. Specifically, we look at the quadratic R\'enyi entropy $H_2$ defined as:
\begin{align}
H_2(G) = - \log \int G(\vec \gamma)^2 \mathrm{d} \vec \gamma\,.
\end{align}
For a Gaussian distribution $g_i(\vec u)$, the quadratic R\'enyi entropy is given by:
\begin{align}
\begin{split}
H_2(g_i(\vec u)) &= \tfrac{E}{2} \log (4\pi) + \tfrac{1}{2} \log \left| \vec \Sigma_{i} \right| \,.
\end{split}
\end{align}
For a mixture of Gaussian distributions $\hat{G}=\sum_i \pi_i g_i(\vec u)$, the quadratic R\'enyi entropy is given by~\citep{Wang2009, Nielsen2012}:
\begin{align}
\label{eq:H_2_G}
H_{2}(\hat{G})
&= - \log \sum_{i=1}^M \sum_{j=1}^M \frac{\pi_i \pi_j}{(2\pi)^\frac{E}{2}} \exp \left( - \tfrac{1}{2} \phi_{ij} (\vec u) \right) \,,
\end{align}
where, using $\tilde{\vec f}_{ij} = \vec \Sigma_{i}^{-1} \vec f_{i} + \vec \Sigma_{j}^{-1} \vec f_{j}$, the function $\phi_{ij}(\vec u)$ is given by:
\begin{align}
\begin{split}
\phi_{ij} (\vec u)
&= \vec f_{i}^\top \vec \Sigma_{i}^{-1} \vec f_{i} + \vec f_{j}^\top \vec \Sigma_{j}^{-1} \vec f_{j} - \tilde{\vec f}_{ij}^\top \left(\vec \Sigma_{i}^{-1} + \vec \Sigma_{j}^{-1} \right)^{-1} \tilde{\vec f}_{ij} \\
&\quad+ \log |\vec \Sigma_{i}| + \log |\vec \Sigma_{j}| + \log |\vec \Sigma_{i}^{-1} + \vec \Sigma_{j}^{-1}| \,.
\end{split}
\end{align}
By noting that $\phi_{ii}(\vec u) = \log|2 \vec \Sigma_{i}|$, we rewrite the expression in \eqref{eq:H_2_G} to:
\begin{align}
\begin{split}
H_2(\hat{G}) &= \tfrac{E}{2} \log(2\pi) - \log \sum_{i=1}^M \left[
\frac{\pi_i^2}{2^\frac{E}{2} | \vec \Sigma_i|^\frac{1}{2}}
+ 2 \sum_{j=1}^{i-1} \pi_i \pi_j\exp \left( - \tfrac{1}{2} \phi_{ij} (\vec u) \right) \right] \,,
\end{split}
\end{align}
which reduces computational effort. After these reformulations, the quadratic Jensen-R\'enyi divergence $\Div[H_2](\vec u)$ has a closed-form expression. We let:
\begin{align}
\label{eq:DJR}
D_{\mathrm{JR}}(\vec u) = \Div[H_2](\vec u) \,,
\end{align}
denote the quadratic Jensen-R\'enyi divergence design criterion.
The weights $\pi_i$ are not uniquely defined in $D_{\mathrm{JR}}$. They can be defined e.g.\ as the normalised posteriors $\pi_{i,N}$ of \citet{BoxHill1967}, the Akaike weights $w_i$ of \cite{Michalik2010}, or as $\pi_i=1$ if the model passes the $\chi^2$ test \citep{BuzziFerraris1983} and $\pi_i = 0$ otherwise. Similarly, the new $D_{\mathrm{JR}}$ design criterion is not derived from any specific method of model discrimination, but from the fundamental principle of maximising model predictive divergence. Thus, the design criterion $D_{\mathrm{JR}}$ is agnostic to the methods used for model weighting and discrimination.
\subsection{Design Criteria Trade-offs}
Figure~\ref{fig:dcs1} compares the different design criteria (bottom row) for three sets of different predictive distributions (top row) for four equally weighted models ($\forall\,i\!:\pi_i = 1/4$). The means $f_i(u)$ of the predictive distributions are the same in each plot, but the variance $\sigma_i^2(u)$ changes. The design criteria have all been normalised to lie in the range $[0,\,1]$.
\begin{figure}[!t]
\centering
\includegraphics[width=0.95\textwidth]{figures/dc_comp1.pdf}
\caption{Comparison of discrimination criteria (bottom row) for three different sets of predictive distributions (top row): constant variance (left), linearly decreasing variance (centre) and linearly increasing variance (right).}
\label{fig:dcs1}
\end{figure}
In the left-most Figure~\ref{fig:dcs1} column, the variance is constant. The top plot shows a model aggregation example. The $D_{\mathrm{BH}}$ and $D_{\mathrm{BH}}$ criteria prefer a small $u$, where $f_1$/$f_2$ and $f_3$/$f_4$ pairwise yield identical predictions, but the divergence between e.g.\ $f_1$ and $f_3$ is large. For constant covariance, i.e.\ independent of $u$, $D_{\mathrm{BH}}, D_{\mathrm{BF}} \propto D_{\mathrm{HR}}$. The $D_{\mathrm{AW}}$ and $D_{\mathrm{JR}}$ criteria, on the other hand, are maximised for medium $u$, where all model predictive distributions are divergent. In the middle Figure~\ref{fig:dcs1} column, the variance decreases linearly with $u$. In the right-most column, the variance increases linearly. In the middle and right-most columns, the change in the variance significantly impacts the $D_{\mathrm{BH}}$ and $D_{\mathrm{BF}}$ criteria maxima. The $D_{\mathrm{AW}}$ and $D_{\mathrm{JR}}$ criteria consistently favour a medium $u$, i.e.\ aim for perfect model discrimination.
In all three cases in Figure~\ref{fig:dcs1}, none of the predictions $f_i(u) \pm \sigma_i(u)$ overlap for medium-sized $u$. Using \citeauthor{Michalik2010}'s (\citeyear{Michalik2010}) model aggregation-based reasoning, placing the next experiment at moderate $u$ yields complete model disaggregation. However, with increasing model prediction uncertainty, the attractiveness of an experiment in the centre decreases, as shown in Figure~\ref{fig:dcs2} for the constant variance scenario.
\begin{figure}[!t]
\centering
\includegraphics[width=0.95\textwidth]{figures/dc_comp2.pdf}
\caption{Comparison of discrimination criteria (bottom row) for three different sets of predictive distributions (top row) with constant covariance increasing from left to right.}
\label{fig:dcs2}
\end{figure}
With increasing uncertainty, the $D_{\mathrm{JR}}$ criterion peak shifts to smaller $u$ before the $D_{\mathrm{AW}}$ criterion peak (see Figure~\ref{fig:u_opt}).
\begin{figure}[!t]
\centering
\includegraphics[width=0.85\textwidth]{figures/u_opt.pdf}
\caption{Optimal design $u^\ast = \argmax_u D_{\ast\ast}(u)$ when variance $\sigma^2$ increases for rival models in Figure~\ref{fig:dcs2}. Variances corresponding to the (i) left-most, (ii) centre and (iii) right-most plots of Figure~\ref{fig:dcs2} are marked on the $\sigma^2$ axis. $D_{\mathrm{BH}}$ and $D_{\mathrm{BF}}$ are on top of each other.}
\label{fig:u_opt}
\end{figure}
\cite{BuzziFerrarisObservations} argue that complete discrimination between groups of models is preferable to partial discrimination between all models. Figure~\ref{fig:dcs1} and~\ref{fig:dcs2} show that the design criteria represent different trade-offs between the risk of partial discrimination, and the reward of complete discrimination.
The design criteria are normalised to lie in the $[0,1]$ range for each plot independently. Hence, the maximum value of the design criteria in the left-most and right-most plots in Figure~\ref{fig:dcs2} are unequal, i.e.\ all design criteria prefer small $u$ in the left-most plot over small $u$ in the right-most plot.
\section{Design of Experiments for Black-Box Model Discrimination}
\label{sec:gpsurrogates}
We now consider designing experiments for black-box model discrimination, i.e.\ discriminating models without readily available gradient information. This gradient information is needed in the classical methods of design of experiments for computing model covariance (see Section~\ref{sec:paramcovar}).
We wish to bridge the gap between (i) classical analytical methods~\citep{BoxHill1967, BuzziFerraris1990, Michalik2010}, which are computationally cheap but with limited flexibility in the possible model types, and (ii) Monte Carlo-based methods~\citep{Vanlier2014, Ryan2015} that are flexible in model type but may be computationally prohibitive. We propose hybridising the classical and Monte Carlo-based methods: we sample the design and parameter spaces to learn surrogate models that can be incorporated into existing design and model discrimination criteria.
Surrogate models are common in applications where the original model does not easily lend itself to optimisation, e.g.~\new{\citet{PalmerRealff2002}, \citet{CaballeroGrossmann2008}}, \citet{FAHMI2012105}, \new{\citet{Boukouvala2017}, \citet{Beykal2018}}, \citet{JONES2018277}, \citet{CARPIO2018190} \new{and \citet{Yang2019}}. \new{Common surrogate models include e.g.~support vector machines~\citep{CortesVapnik1995}}. Our surrogate models are Gaussian processes (GPs), flexible regression tools common in statistical machine learning~\citep{RasmussenWilliams2006}, e.g.\ for Bayesian black-box optimisation%
~(\citeauthor{Shahriari2016}, \citeyear{Shahriari2016};
\citeauthor{ULMASOV20161051}, \citeyear{ULMASOV20161051};
\citeauthor{Mehrian2018}, \citeyear{Mehrian2018};
\citeauthor{Olofsson2019_IEEE}, \new{\citeyear{Olofsson2019_IEEE}};
\citeauthor{Babutzka2019}, \new{\citeyear{Babutzka2019}}).
GPs provide model prediction confidence bounds, and their analytical nature allows us to extend the classical analytical methods to non-analytical models. The next subsection provides background on GP regression, which infers predictive distributions for function values given function observations at training locations.
\subsection{Gaussian Process Regression}
GPs are distributions over functions. We can place a GP prior on a function $g(\vec z)$:
\begin{align}
g \sim \mathcal{GP} \left(m(\cdot), k(\cdot, \cdot)\right)
\end{align}
where $m$ and $k$ are the mean function and covariance function, respectively. Formally, a GP is a \textit{collection of random variables}, any finite subset of which is \textit{jointly Gaussian distributed}~\citep{RasmussenWilliams2006}. The random variables are the values of the function $g(\cdot)$, whose joint Gaussian distribution at two locations $\vec z$ and $\vec z'$ can be written:
\begin{align}
\begin{bmatrix} g(\vec z) \\ g(\vec z') \end{bmatrix}
\sim \mathcal{N} \left(
\begin{bmatrix} m(\vec z) \\ m(\vec z') \end{bmatrix}
,\,
\begin{bmatrix} k(\vec z, \vec z) & k(\vec z, \vec z') \\ k(\vec z', \vec z) & k(\vec z', \vec z') \end{bmatrix}
\right) \,.
\end{align}
Let $\mat Z$ and $g(\mat Z)$ denote the locations $\mat Z = [\vec z_1, \dots, \vec z_N]^\top$ and corresponding function values $g(\mat Z) = [g(\vec z_1), \dots, g(\vec z_N)]^\top$, and let $\mat K$ denote the Gram matrix with entries $K_{n,\ell} = k(\vec z_n, \vec z_\ell)$ and $n,\ell \in \lbrace 1,\dots,N \rbrace$. Then the function value at test point $\vec z$ and the function values at locations $\mat Z$ are jointly Gaussian distributed with:
\begin{align}
\begin{bmatrix} g(\vec z) \\ g(\mat Z) \end{bmatrix}
\sim \mathcal{N} \left(
\begin{bmatrix} m(\vec z) \\ \vec m \end{bmatrix}
,\,
\begin{bmatrix} k(\vec z, \vec z) & \vec k^\top \\ \vec k & \mat K \end{bmatrix}
\right)
\end{align}
where $\vec k = [k(\vec z, \vec z_1), \dots, k(\vec z, \vec z_N)]^\top$ and $\vec m = [m(\vec z_1), \dots, m(\vec z_N)]^\top$. Given observations $\vec y = g(\mat Z) + \vec \eta$, with $\vec \eta \sim \mathcal{N}(\vec 0, \sigma_\eta^2 \mat I)$ zero-mean Gaussian measurement noise with variance $\sigma_\eta^2$, we can compute the posterior predictive distribution at test location $\vec z$:
\begin{align}
f(\vec z) &\sim \mathcal{N}(\mu(\vec z), \sigma^2(\vec z)) \,,
\end{align}
where the mean and variance are given by:
\begin{align}
\label{eq:gp_mean_and_var}
\begin{split}
\mu (\vec z) &= m(\vec z) + \vec k^\top (\mat K + \sigma_\eta^2\mat I )^{-1} (\vec y - \vec m) \,, \\
\sigma^2 (\vec z) &= k(\vec z, \vec z) - \vec k^\top (\mat K + \sigma_\eta^2\mat I )^{-1} \vec k \,.
\end{split}
\end{align}
Figure~\ref{fig:gpr} illustrates GP regression given noisy observations of the underlying function. A commonly used covariance function $k$ is the radial basis function (RBF) kernel (also called the ``squared exponential'' or ``Gaussian'' kernel) with automatic relevance determination (ARD):
\begin{align}
\label{eq:rbfardkernel}
k(\vec z, \vec z') = \rho^2 \exp \left( -\tfrac{1}{2} (\vec z - \vec z')^\top \vec \Lambda^{-1} (\vec z - \vec z') \right)
\end{align}
where $\rho^2$ is the signal variance and $\vec \Lambda = \diag(\lambda_{1}^2,\dots,\lambda_{D}^2)$ is a diagonal matrix of squared length scales. Covariance functions, such as the RBF-ARD kernel, are said to be stationary if they only depend on the distance $r = \| \vec z - \vec z' \|$ between $\vec z$ and $\vec z'$ and not their specific values, i.e.\ $k(\vec z, \vec z') = k(\vec z + \vec \delta, \vec z' + \vec \delta)$.
\begin{figure}
\centering
\includegraphics[width=0.85\textwidth]{figures/gpr.pdf}
\caption{GP regression given noisy observations $\vec y$ (black dots) of an underlying function $f$ (solid line). The mean (dotted line) and two standard deviations (grey area) of the GP prediction are plotted.}
\label{fig:gpr}
\end{figure}
Together, $\rho^2$, $\vec \Lambda$ and $\sigma_\eta^2$ are the GP model hyperparameters. They are typically learnt by maximising the marginal likelihood $p(\vec y\,|\, \mat Z, \rho^2, \vec \Lambda, \sigma_\eta^2 )$ of the observations with respect to the hyperparameters. This can be done using gradient-based non-convex optimisation methods. The data $\mat Z$, $\vec y$ is commonly referred to as the \textit{training data}, and is used to learn the GP hyperparameters at training.
It is common to assume a zero-mean GP prior, i.e.\ $m(\cdot) \equiv 0$, for notational simplicity. If the mean is non-zero, it can be subtracted from observations and added later to predictions without affecting the result, as long as it is independent of the hyperparameters.
\subsection{Sparse Gaussian Process Regression}
\label{sec:sparse_gp_regression}
\new{The curse of dimensionality means that with increasing input dimensions, the amount of training data required to accurately model a system grows exponentially.} For large training data sets, the matrix inversion $(\mat K + \sigma_\eta^2 \mat I)^{-1}$ in GP regression becomes a computational bottleneck. The computational complexity of GP training scales as $\BigO{N^3}$. Computing the predictive mean and variance in \eqref{eq:gp_mean_and_var} scales as $\BigO{N}$ and $\BigO{N^2}$, respectively (with the term $(\mat K + \sigma_\eta^2 \mat I)^{-1} (\vec y - \vec m)$ pre-computed).
Various methods have been proposed to reduce this computational bottleneck by sparsifying the GP regression. Sparse GP regression methods approximate the predictive distributions by selecting a smaller set of $P$ inducing points. These inducing points can either be a subset of the original training data set \citep{SmolaBartlett2001, Seeger2003} or pseduo-inputs \citep{SnelsonGhahramani2005, titsias09a}. Sparse GP regression scales as $\BigO{N P^2}$ at training, and $\BigO{P}$ and $\BigO{P^2}$ for computing the predictive mean and variance, respectively. The number $P$ is chosen as a trade-off between predictive accuracy and computational complexity.
Other methods of reducing the computational bottleneck of GP regression look at e.g.\ the spectral representation of GPs~\citep{Hensman2018} or exploiting algebraic properties of the Kronecker and Khatri-Rao tensor products on a grid of inducing inputs~\citep{EvansNair2018}. A review of sparse and variational GP regression methods---some of which can be used for training sets with billions of data points---can be found in \cite{LiuReview2018}.
\subsection{Gaussian Process Surrogate Model}
We will now show how GPs can act as surrogates for the original models for the design of experiments for model discrimination. Let's begin by studying the predictions $\vec f = f(\vec u, \vec \theta)$ of a single model $f=f_i$, with $\vec \theta = \vec \theta_i$. We wish to find the model's predictive distribution, taking uncertainty in the model parameters $\vec \theta$ into account. We place independent GP priors on each output (or target dimension) $e=1,\dots,E$ of $f$:
\begin{align}
\label{eq:model_gp_prior}
f_{(e)} \sim \mathcal{GP}(m_{(e)}(\vec x), k_{\vec u,(e)}(\vec u, \vec u') k_{\vec \theta,(e)}(\vec \theta, \vec \theta')) \,.
\end{align}
Training data is required for learning the GP hyperparameters and performing GP regression. We sample designs $\vec u_\ell$ and model parameter values $\vec \theta_\ell \sim \mathcal{N}(\vec \theta^\ast, \epsilon \mat I)$, for some small $\epsilon$, and produce corresponding training targets $\vec y_\ell = f(\vec u_\ell, \vec \theta_\ell)$. Let $\vec z_\ell = [\vec u_\ell^\top, \vec \theta_\ell^\top]^\top$ denote the combined training inputs. The GP training data should not be confused with the experimental data set $\mathcal{D}$, which is used for parameter estimation and model discrimination.
The predictive distribution $f(\vec z) \sim \mathcal{N}(\mu(\vec z), \Sigma_{f}(\vec z))$ at a test location $\vec z = [\vec u^\top, \vec \theta^\top]^\top$ is given by:
\begin{align}
\begin{split}
\mu(\vec z) &= \left[ \mu_{(1)} (\vec z), \dots, \mu_{(E)} (\vec z) \right]^\top \,,\\
\Sigma_{f}(\vec z) &= \diag\left( \sigma_{(1)}^2 (\vec z), \dots, \sigma_{(E)}^2 (\vec z) \right) \,,
\end{split}
\end{align}
with the expressions for $\mu_{(e)}$ and $\sigma_{(e)}^2$ given in \eqref{eq:gp_mean_and_var}. Note that the covariance function $k_{(e)}$ for each target dimension is $k_{(e)}(\vec z, \vec z') = k_{\vec u,(e)}(\vec u, \vec u') k_{\vec \theta,(e)}(\vec \theta, \vec \theta')$, as given in \eqref{eq:model_gp_prior}.
Given a model parameter distribution $p(\vec \theta\,|\,\mathcal{D}) = \mathcal{N}(\vec \theta^\ast, \vec \Sigma_\theta)$, where $\vec \theta^\ast$ denotes the maximum \emph{a posteriori} parameter estimate with covariance $\vec \Sigma_\theta$, and $\mathcal{D}$ are real, experimental data, we wish to determine the resulting marginal model predictive distribution:
\begin{align}
\label{eq:marginal_dist}
p \left(f (\vec u) \,\middle|\, \mathcal{D} \right) = \int p \left( f (\vec u, \vec \theta)\,\middle|\,\vec \theta \right) p \left( \vec \theta \,\middle|\, \mathcal{D} \right) \mathrm{d} \vec \theta \,.
\end{align}
This distribution is intractable and has to be approximated. We approximate the marginal predictive distribution in \eqref{eq:marginal_dist} with a Gaussian distribution $\mathcal{N}(\breve{\mu}(\vec u), \breve{\Sigma}(\vec u))$, where $\breve{\mu}(\vec u) \approx \E_{\vec \theta|\Dexp} [ \vec \mu(\vec z) ]$ and $\breve{\Sigma}(\vec u) \approx \E_{\vec \theta|\Dexp} [ \Sigma_{f}(\vec z) ] + \V_{\vec \theta|\Dexp} [ \mu(\vec z) ]$.
We will compare first-order and second-order Taylor approximations of $\breve{\mu}$ and $\breve{\Sigma}$. For the remainder of this section, we let $\vec z^{\ast} = [\vec u^\top, \vec \theta^{\ast\top}]^\top$ and $\Delta \vec \theta = \vec \theta - \vec \theta^\ast$, and simplify the gradient notation as $\nabla_{\vec \theta} \mu_{(e)} = \nabla_{\vec \theta} \mu_{(e)} (\vec z) |_{\vec \theta=\vec \theta^\ast}$ and $\nabla_{\vec \theta} \sigma_{(e)}^2 = \nabla_{\vec \theta} \sigma_{(e)}^2 (\vec z) |_{\vec \theta=\vec \theta^\ast}$.
\subsection{First-Order Taylor Approximation}
\label{sec:first_order_taylor}
The first-order Taylor approximations of $\mu_{(e)}(\vec z)$ and $\sigma_{(e)}^2 (\vec z)$ around a parameter value $\vec \theta^\ast$ is given by:
\begin{align}
\begin{split}
\mu_{(e)} (\vec z) &\approx
\mu_{(e)} (\vec z^\ast) + \nabla_{\vec \theta} \mu_{(e)} \Delta \vec \theta \,, \\
\sigma_{(e)}^2 (\vec z) &\approx
\sigma_{(e)}^2 (\vec z^\ast) + \nabla_{\vec \theta} \sigma_{(e)}^2 \Delta \vec \theta \,.
\end{split}
\intertext{
The expressions for $\nabla_{\vec \theta} \mu_{(e)}$ and $\nabla_{\vec \theta} \sigma_{(e)}^2$ can be found in \ref{sec:gp_gradients}. With a Gaussian model parameter distribution $\mathcal{N}(\vec \theta^\ast, \vec \Sigma_\theta)$, using the first-order Taylor expansions, we find:
}
\begin{split}
\label{eq:taylor1predDist}
\breve{\mu}(\vec u) &\approx \mu(\vec z^\ast) \,,\\
\breve{\Sigma}(\vec u) &\approx \Sigma_{f} (\vec z^\ast) + \nabla_{\vec \theta} \vec \mu \vec \Sigma_\theta \nabla_{\vec \theta} \vec \mu^\top \,.
\end{split}
\end{align}
where $\nabla_{\vec \theta} \vec \mu \vec = [ \nabla_{\vec \theta} \mu_{(1)}^\top, \dots, \nabla_{\vec \theta} \mu_{(E)}^\top ]^\top \in \mathbb{R}^{E \times D_i}$. We see that the model covariance expression in \eqref{eq:taylor1predDist} is equivalent to the expression in \eqref{eq:analyticalmodelcovariance}, plus the added term $\Sigma_f(\vec z^\ast)$ for the uncertainty in the surrogate model. Because $\breve{\mu}(\vec u) \approx \mu(\vec z^\ast)$ without any added terms, we may also choose to replace $\mu(\vec z^\ast)$ with the original model $f(\vec z^\ast)$. This makes the added uncertainty term $\Sigma_f(\vec z^\ast)$ in the model covariance redundant.
\subsection{Second-Order Taylor Approximation}
\label{sec:second_order_taylor}
The second-order Taylor approximations of $\mu_{(e)}(\vec z)$ and $\sigma_{(e)}^2 (\vec z)$ around a parameter value $\vec \theta^\ast$ is given by:
\begin{align}
\begin{split}
\mu_{(e)} (\vec z) &\approx \mu_{(e)} (\vec z^\ast)
+ \nabla_{\vec \theta} \mu_{(e)} \Delta \vec \theta
+ \tfrac{1}{2} \Delta \vec \theta^\top \nabla_{\vec \theta}^2 \mu_{(e)} \Delta \vec \theta \,, \\
\sigma_{(e)}^2 (\vec z) &\approx \sigma_{(e)}^2 (\vec z^\ast)
+ \nabla_{\vec \theta} \sigma_{(e)}^2 \Delta \vec \theta
+ \frac{1}{2} \Delta \vec \theta^\top \nabla_{\vec \theta}^2 \sigma_{(e)}^2 \Delta \vec \theta \,.
\end{split}
\end{align}
The expression for $\nabla_{\vec \theta}^2 \sigma_{(e)}^2$ can be found in \ref{sec:gp_gradients}.
With a Gaussian model parameter distribution $\mathcal{N}(\vec \theta^\ast, \vec \Sigma_\theta)$, using the second-order Taylor expansions, we find that the marginal mean $\breve{\mu}(\vec u)$ has elements $e=1,\dots,E$ given by:
\begin{align}
\breve{\mu}_{(e)} (\vec u) \approx \mu_{(e)} (\vec z^\ast) + \tfrac{1}{2} \tr \left( \nabla_{\vec \theta}^2 \mu_{(e)} \vec \Sigma_\theta \right) \,.
\end{align}
The corresponding covariance $\breve{\Sigma}(\vec u)$ is approximated with the sum of (i) the diagonal matrix $\E_{\vec \theta|\Dexp} [ \Sigma_{f} (\vec z) ] \approx \diag(q_{(1)},\dots,q_{(E)})$ with elements:
\begin{align}
q_{(e)} &= \sigma_{(e)}^2 (\vec z^\ast)
+ \tfrac{1}{2} \tr \left( \nabla_{\vec \theta}^2 \sigma_{(e)}^2 \vec \Sigma_\theta \right) \,,
\end{align}
and (ii) the full covariance matrix $\V_{\vec \theta|\Dexp} [ \mu (\vec z)] \approx [q_{(e_1),(e_2)}]$ with elements:
\begin{align}
\begin{split}
q_{(e_1),(e_2)}
&= \nabla_{\vec \theta} \mu_{(e_1)} \vec \Sigma_\theta \nabla_{\vec \theta} \mu_{(e_2)}^\top
+ \tfrac{1}{2} \tr \left(
\nabla_{\vec \theta}^2 \mu_{(e_1)} \vec \Sigma_\theta \nabla_{\vec \theta}^2 \mu_{(e_2)} \vec \Sigma_\theta
\right) \,,
\end{split}
\end{align}
for $e_1,e_2 = 1, \dots, E$.
Figure~\ref{fig:taylors} illustrates the difference between the first- and second-order Taylor approximations. The first-order method directly correlates to the classical method of approximating the model parameter covariance and predictive distribution presented in Section~\ref{sec:paramcovar}, with $\vec f_i$ replaced with $\breve{\mu}(\vec u)$. When using the second-order Taylor approximation of the models' predictive distributions, it is still best to use the first-order Laplace approximation of the model parameter covariance since a second-order approximation can result in a singular $\vec \Sigma_\theta^{-1}$.
\begin{figure}
\centering
\includegraphics[width=\textwidth]{figures/taylors.pdf}
\caption{First- (left) and second-order (right) Taylor approximation of marginal predictive distribution (grey area on y-axis), given an input distribution (grey area on x-axis) and Taylor approximation (solid line) of the function (dotted line). The predictive distribution is shifted slightly downwards for the second-order approximation compared to the first-order one.}
\label{fig:taylors}
\end{figure}
The approximate marginalisation using first- or second-order Taylor approximations can also be used for surrogate models with inducing input sparse GP regression. The expressions for $\nabla_{\vec \theta} \mu_{(e)}$, $\nabla_{\vec \theta} \sigma_{(e)}^2$ and $\nabla_{\vec \theta}^2 \sigma_{(e)}^2$ using sparse GP regression with inducing inputs are directly equivalent to the gradient expressions for the full GP model (see \ref{sec:gp_gradients}).
\section{The GPdoemd Software Package}
\label{sec:gpdoemd}
GPdoemd\footnote{Available online at: \url{https://github.com/cog-imperial/GPdoemd}} is an open-source Python package implementing the GP surrogate method to design of experiments presented in Section~\ref{sec:gpsurrogates}. This section describes the package. Additional documentation for installing and using GPdoemd via a PDF document and Jupyter notebook demonstrations is on GitHub. GPdoemd uses functionality from the \citet{gpy2014} Python package for GP training and inference. Other dependencies are the standard numpy (v1.7-v1.15) and scipy (v0.17-v1.1) packages. GPdoemd is tested for Python version 3.4, 3.5 and 3.6. \new{There are several Python interfaces to query models written in other languages, e.g.~R or MATLAB. GPdoemd only requires point sampling of the original models in order to construct the GP surrogates.}
\subsection{Implementation}
GPdoemd consists of several modules, illustrated in Figure~\ref{fig:gpdoemd_modules}, that offer a choice between different GP kernel functions, inference methods, methods to approximate the marginal predictive distributions, design criteria and model discrimination methods. The modules can easily be extended and new functions implemented and added to the GPdoemd toolbox.
GPdoemd currently comes with the Table~\ref{tab:case_studies} case studies. Researchers may try the GP surrogate method and compare the performance to competing methods for design of experiments for model discrimination. The case study \pythonsmall{mixing} was developed for GPdoemd and considers different order micro- and macrofluid models. \ref{sec:casestudymixingappendix} describes the \pythonsmall{mixing} case study.
\begin{figure}[!t]
\centering
\includegraphics[width=\textwidth]{figures/gpdoemd_modules.pdf}
\caption{The modular structure of the GPdoemd open-source software package.}
\label{fig:gpdoemd_modules}
\vspace{-3mm}
\end{figure}
\begin{table}
\centering
\footnotesize
\begin{tabular}{l | l | c | c | c | c | l}
\hline
Name & Reference & $|\vec u|$ & $|\vec \theta_i|$ & $|\vec y|$ & $M$ & $f_i$ \Tstrut\Bstrut\\
\hline
\pythonsmall{bff1983} & \cite{BuzziFerraris1983} & 3 & 5 & 1 & 5 & A \Tstrut\Bstrut\\
\pythonsmall{bffeh1984} & \cite{BuzziFerraris1984} & 2 & 4 & 2 & 4 & A \Tstrut\Bstrut\\
\pythonsmall{bffc1990a} & \cite{BuzziFerraris1990} & 3 & 2--6 & 1 & 4 & A \Tstrut\Bstrut\\
\pythonsmall{mixing} & -- & 3, (1) & 1 & 1 & 5 & A \Tstrut\Bstrut\\
\pythonsmall{msm2010} & \cite{Michalik2010} & 3 & 1 & 1 & 10 & A \Tstrut\Bstrut\\
\pythonsmall{vthr2014linear} & \cite{Vanlier2014} & 1 & 2--4 & 1 & 4 & A \Tstrut\Bstrut\\
\pythonsmall{vthr2014ode} & \cite{Vanlier2014} & 3, (2) & 14 & 1 & 4 & BB \Tstrut\Bstrut\\
\pythonsmall{tandogan2017} & \cite{Tandogan2017} & 4 & 8--14 & 2 & 3 & BB \Tstrut
\end{tabular}
\caption{GPdoemd case studies, with the number of design variables $|\vec u|$ (number of discrete variables in parenthesis), model parameters $|\vec \theta_i|$, target dimensions $|\vec y|$, rival models $M$. The last column says whether the models are analytical (A) or black boxes (BB).}
\label{tab:case_studies}
\end{table}
\subsection{Syntax and Supported Features}
Assuming the rival models $f_i(\vec u, \vec \theta_i)$ have been proposed, GPdoemd assists in model discrimination. Figure~\ref{fig:gpdoemd_modules} illustrates the process.
\paragraph{Model type}
A model object is initialised using a Python dictionary containing the model name (\pythoninline{name}), the model function $f_i(\vec u, \vec \theta_i)$ handle (\pythoninline{call}), the design variable and model parameter dimensions $D$ and $D_i$ (\pythoninline{dim_x} and \pythoninline{dim_p}), the number of target dimensions $E$ (\pythoninline{num_outputs}), model parameter bounds (\pythoninline{p_bounds}), experimental noise (co)variance $\vec \Sigma$ (\pythoninline{meas_noise_var}), and a list of \new{the dimensions for binary design variables} (\pythoninline{binary_variables}). \new{Binary design variables are handled by creating separate GP surrogates for each binary combination.} This dictionary is passed to one of the implemented model types (Box~1 in Figure~\ref{fig:gpdoemd_modules}). \new{GPdoemd uses the GPy implementation of sparse GP regression, with variational learning of the inducing inputs~\citep{titsias09a}.}
\paragraph{Parameter estimation}
Given experimental data \pythoninline{Ydata} for designs \pythoninline{Xdata}, GPdoemd helps find the optimal model parameter values $\vec \theta^\ast$ using prediction error minimisation (Box~2 in Figure~\ref{fig:gpdoemd_modules}): differential evolution (\pythoninline{diff_evol}) or least squares with finite difference gradient approximation (\pythoninline{least_squares}). Both \pythoninline{diff_evol} and \pythoninline{least_squares} are wrappers for \pythoninline{scipy} functions.
\paragraph{GP kernels}
The GP surrogate models require a choice of GP kernel functions $k_x$ and $k_\theta$ for the GP prior $\mathcal{GP}(0, k_x k_\theta)$. GPdoemd currently supports 6 kernel functions (Box~3 in Figure~\ref{fig:gpdoemd_modules}) from the \pythoninline{GPy} package, with minor extensions.
\paragraph{Model parameter covariance}
GPdoemd assumes a Gaussian approximation $\mathcal{N}(\vec \theta^\ast, \vec \Sigma_\theta)$ of the model parameter distribution. GPdoemd currently implements a Laplacian approximation of $\vec \Sigma_\theta$.
\paragraph{Approximating marginal predictive distributions}
The hybrid approach approximates the marginal predictive distribution in with a Gaussian distribution. GPdoemd implements the first- and second-order Taylor approximations (Box~5 of Figure~\ref{fig:gpdoemd_modules}) of the first two moments of the models' predictive distributions in \eqref{eq:marginal_dist}.
\paragraph{Design criterion}
GPdoemd provides five different criteria (Box~6 in Figure~\ref{fig:gpdoemd_modules}) for designing the next experiment: \pythoninline{HR}~\citep{HunterReiner1965}, \pythoninline{BH}~\citep{BoxHill1967}, \pythoninline{BF}~\citep{BuzziFerraris1990} and \pythoninline{AW}~\citep{Michalik2010} and \pythoninline{JR} (Jensen-R\'enyi divergence, this work).
\paragraph{Discrimination criterion}
GPdoemd provides three different criteria (Box~7 in Figure~\ref{fig:gpdoemd_modules}) for model discrimination: normalised Gaussian posteriors $\pi_{i,N}$~\citep{BoxHill1967}, $\chi^2$ test \citep{BuzziFerraris1983}, and the Akaike information criterion weights \citep{Michalik2010}.
\subsection{Example}
Assume we have a list \pythoninline{dlist} of model dictionaries, experimental data \pythoninline{Xdata}, \pythoninline{Ydata} with experimental noise variance \pythoninline{measvar}, and lists \pythoninline{X}, \pythoninline{P} and \pythoninline{Y} of surrogate model training data (design, model parameters and predictions, respectively). We wish to select the optimal next experiment from candidates \pythoninline{Xnew}.
\begin{python}
N = Xnew.shape[0] # Number of test points
M = len( dlist ) # Number of rival models
E = Ydata.shape[1] # Number of target dimensions
mu, s2 = np.zeros(( N, M, E )), np.zeros(( N, M, E, E ))
for i,d in enumerate( dlist ):
# Initialise surrogate model
m = GPdoemd.models.GPModel(d)
# Estimate model parameter values
opt_method = GPdoemd.param_estim.least_squares
m.param_estim(Xdata, Ydata, opt_method, m.p_bounds)
# Set-up surrogate model
RBF = GPdoemd.kernels.RBF
Z = np.c_[ X[i], P[i] ]
m.gp_surrogate(Z=Z, Y=Y[i], kern_x=RBF, kern_p=RBF)
m.gp_optimise()
# Approximate model parameter covariance
m.Sigma = GPdoemd.param_covar.laplace_approximation( m, Xdata )
# Approximate marginal predictive distribution at test points
mu[:,i], s2[:,i] = GPdoemd.marginal.taylor_first_order( m, Xnew )
# Design criterion at test points
dc = GPdoemd.design_criteria.JR(mu, s2, measvar)
# Optimal next experiment
xnext = Xnew[ np.argmax(dc) ]
\end{python}
The newly designed experiment is executed, and \pythoninline{xnext} and the new observation added to \pythoninline{Xdata} and \pythoninline{Ydata}, respectively. If model discrimination fails, the process above is repeated in order to find the optimal next experiment.
\section{Results}
\label{sec:results}
We study the novel design criterion $D_{\mathrm{JR}}$ and the GP surrogate method using four case studies:
\allowdisplaybreaks{
\begin{itemize}
\item \textit{Ammonia synthesis}~\citep{BuzziFerraris1990}
\item \textit{Chemical kinetic models}~\citep{BuzziFerraris1984}
\item \textit{Mixing}~(\ref{sec:casestudymixingappendix})
\item \textit{Biochemical networks}~\citep{Olofsson2018_ICML}
\end{itemize}
}
The first case study considers four different models for synthesis of ammonia $\mathrm{NH}_{3}$ from hydrogen $\mathrm{H}_{2}$ and nitrogen $\mathrm{N}_{2}$. There are $D=3$ design variables, $D_i \in \lbrace 2, 4, 6 \rbrace$ parameters per model, and $E=1$ observable output. Each simulation has $N_0 = 5$ initial measurements and a maximum budget of 40 new experiments. \ref{sec:casestudyoneappendix} further describes the case study.
The second case study, further described in \ref{sec:casestudytwoappendix}, has four different chemical kinetic models. There are $D=2$ design variables, $D_i = 4$ parameters per model, and $E=2$ observable outputs. Each simulation has $N_0 = 5$ initial measurements and a maximum budget of 40 additional experiments.
The new mixing case study is third. It studies conversion of a reactant under mixing of a fluid. There are $D = 3$ design variables (one of which is binary), $D_i = 1$ parameter per model, and $E=1$ observable output. Each simulation has $N_0 = 2$ initial measurements and a maximum budget of 20 additional experiments. \ref{sec:casestudymixingappendix} further describes the case study.
The last case study is a version of the \cite{Vanlier2014} biochemical networks case study, with models consisting of systems of ordinary differential equations \citep{Olofsson2018_ICML}. There are $D=3$ design variables, $D_i=10$ parameters per model, and $E=2$ observable outputs. Each simulation has $N_0 = 20$ initial measurements and a maximum budget of 100 additional experiments. \cite{Olofsson2018_ICML} further describe the case study.
The models in the first three case studies are analytical, i.e.\ gradient expressions are available. Section~\ref{sec:dccomparison} uses the Section~\ref{sec:paramcovar} analytical expressions for a performance comparison between the novel design criterion $D_{\mathrm{JR}}$ and the classical design criteria $D_{\mathrm{BH}}$, $D_{\mathrm{BF}}$ and $D_{\mathrm{AW}}$. Section~\ref{sec:gpperformance} compares the GP surrogate method with the analytical method it emulates. Section~\ref{sec:vanliercasestudy} shows that the GP surrogate method successfully extends the analytical method for design of experiments for model discrimination to black-box models.
Let DC and MD denote the chosen design criterion and method of model discrimination, respectively. Section~\ref{sec:dcs} describes three different methods of model discrimination:
\allowdisplaybreaks{
\begin{itemize}
\item Normalised Gaussian posteriors $\pi_{i,N}$ with updates~\citep{BoxHill1967}. The procedure terminates when $\exists i:\, \pi_{i,N} \geq 0.999$.
\item $\chi^2$ test~\citep{BuzziFerraris1983}, where a model $i$ is deemed inadequate and discarded if $\chi_i^2 \leq 0.01$ for $N \cdot E - D_i$ degrees of freedom, with $N = |\mathcal{D}|$ the number of available data points.
\item Akaike weights $w_i$~\citep{Michalik2010}. The procedure terminates when $\exists i:\, w_{i} \geq 0.999$.
\end{itemize}
}
Alternatively, simulation terminates after reaching the maximum number of additional experiments. The Table~\ref{tab:resultmetrics} statistics are collected after each simulation. For good performance, the average A should be as low as possible. A small SE value indicates the estimated A is close to the ``true'' average. The success rate S should be close to 100\,\%. An inconclusive result (true or false negative) is preferable to a failed result (false positive), since selecting an inaccurate model can incur a large cost at a later stage (see Section~\ref{sec:discussion}).
\begin{table}[!t]
\centering
\begin{tabular}{l l}
\hline
A
& the average number of additional experiments required for \Tstrut \\
& \textit{successful} model discrimination, i.e.\ identifying the correct \\
& model as the data-generating model. \Bstrut \\
%
\hline
SE
& the standard error of the average number A of additional \Tstrut \\
& experiments. \Bstrut \\
%
\hline
S
& the success rate, i.e.\ the percentage of simulations in which \Tstrut \\
& the correct model was identified as the data-generating model. \Bstrut \\
%
\hline
F
& the failure rate, i.e.\ the percentage of simulations in which \Tstrut \\
& a model other than the correct model was identified as the\\
& data-generating model. \Bstrut \\
%
\hline
I
& the rate of inconclusive simulations, i.e.\ the percentage of \Tstrut \\
& simulations in which more than one model--or no models in the\\
& case of the $\chi^2$ test--remain when the experimental budget has\\
& been exhausted. \Bstrut \\
\hline
\end{tabular}
\caption{Statistics collected in the simulations.}
\label{tab:resultmetrics}
\end{table}
\subsection{Comparison of Design Criteria Performance}
\label{sec:dccomparison}
Table~\ref{tab:table_A} compares the novel design criterion $D_{\mathrm{JR}}$ to the classical design criteria $D_{\mathrm{BH}}$, $D_{\mathrm{BF}}$ and $D_{\mathrm{AW}}$ for the ammonia synthesis case study. The comparison also includes the alternative of not optimising the design, but randomly and uniformly sampling the next experimental design, denoted $U$. We use the gradient expressions in Section~\ref{sec:paramcovar} to approximate the models' marginal predictive distributions $\mathcal{N}(\vec f_i, \vec \Sigma_i)$. Table~\ref{tab:table_A} shows the simulation performance statistics from 100 sets of random initial measurements.
\begin{table}[!t]
\centering
\vspace{1mm}
\begin{tabular}{c | *{3}{| c c c } }
\hline
MD & & $\pi_{i,N}$ & & & $\chi_i^2$ & & & $w_i$ & \Tstrut\Bstrut\\
DC & $D_{\mathrm{BH}}$ & $D_{\mathrm{JR}}$ & $U$ & $D_{\mathrm{BF}}$ & $D_{\mathrm{JR}}$ & $U$ & $D_{\mathrm{AW}}$ & $D_{\mathrm{JR}}$ & $U$ \Tstrut\Bstrut\\
\hline
A & 20.85 & 22.24 & 34.50 & 20.56 & 21.12 & 14.50 & 7.11 & 6.61 & 21.25 \Tstrut\Bstrut\\
SE & 0.82 & 0.72 & 1.77 & 1.43 & 1.22 & 3.02 & 0.47 & 0.49 & 1.08 \Tstrut\Bstrut\\
S [\%] & 81 & 87 & 2 & 81 & 84 & 10 & 100 & 100 & 73 \Tstrut\Bstrut\\
F [\%] & 0 & 0 & 0 & 1 & 1 & 1 & 0 & 0 & 2 \Tstrut\Bstrut\\
I [\%] & 19 & 13 & 98 & 18 & 15 & 89 & 0 & 0 & 25 \Tstrut\Bstrut
\end{tabular}
\caption{Comparison of design criteria performance for the ammonia synthesis case study. The $D_{\mathrm{JR}}$ design criterion is compared to the classical design criteria $D_{\mathrm{BH}}$, $D_{\mathrm{BF}}$ and $D_{\mathrm{AW}}$ for their corresponding model discrimination methods (see Section~\ref{sec:dcs}). The columns $U$ uniformly sample the next experimental design rather than optimising the criterion.}
\label{tab:table_A}
\end{table}
For this case study, the new design criterion $D_{\mathrm{JR}}$ performs similarly to the classical criteria: $D_{\mathrm{JR}}$ has a higher average number of additional experiments (A) than $D_{\mathrm{BH}}$ and $D_{\mathrm{BF}}$, but also a higher success rate (S). Compared to $D_{\mathrm{AW}}$, $D_{\mathrm{JR}}$ has a lower average A. In all cases, the difference between the criteria's averages A is less than the sum of their standard errors SE.
The random design selection $U$ results are a sanity check: the success rate is significantly lower while the inconclusive rate is higher. For the $\pi_{i,N}$ model discrimination method, random design selection succeeded in only 2 simulations. For the $\chi^2$ model discrimination method, the average A is lower for the random design selection than for $D_{\mathrm{BF}}$ and $D_{\mathrm{JR}}$, due to a low success rate: random design selection only succeeded for the easier simulations. Making an informed decision for the next experimental design is obviously beneficial to reduce the number of extra experiments needed for model discrimination.
\subsection{Performance of Gaussian Process Surrogate Method}
\label{sec:gpperformance}
We next compare the GP surrogate method of approximating the marginal predictive distribution to the analytical method (Section~\ref{sec:paramcovar}). We will show that the GP surrogate method is not significantly worse at model discrimination than the analytical method, since otherwise the GP surrogates would be ineffective for extending the analytical method to black-box models. For notational convenience, we call the GP surrogate method with first- and second-order Taylor approximations of the marginal predictive distribution GP-T1 and GP-T2, respectively. \new{In each case study, training data is generated from a grid in input space to ensure some level of space-filling.}
First, we compare the GP surrogate method to the classical analytical method on the ammonia synthesis case study~\citep{BuzziFerraris1990}. Table~\ref{tab:table_gp_ammonia} shows the performance statistics of GP-T1 and GP-T2 from simulations from 100 sets of random initial measurements. We compare these statistics to the analytical method statistics in Table~\ref{tab:table_A}.
\begin{table}[!t]
\centering
\begin{subtable}{0.7\linewidth}
\begin{tabular}{c | *{3}{| c c } }
\hline
MD & \multicolumn{2}{|c}{$\pi_{i,N}$} & \multicolumn{2}{|c}{$\chi_i^2$} & \multicolumn{2}{|c}{$w_i$} \Tstrut\Bstrut\\
DC & $D_{\mathrm{BH}}$ & $D_{\mathrm{JR}}$ & $D_{\mathrm{BF}}$ & $D_{\mathrm{JR}}$ & $D_{\mathrm{AW}}$ & $D_{\mathrm{JR}}$ \Tstrut\Bstrut\\
\hline
A & 19.72 & 21.73 & 17.28 & 17.55 & 6.73 & 6.53 \Tstrut\Bstrut\\
SE & 0.68 & 0.70 & 1.30 & 1.12 & 0.39 & 0.41 \Tstrut\Bstrut\\
S [\%] & 86 & 84 & 79 & 82 & 100 & 100 \Tstrut\Bstrut\\
F [\%] & 0 & 0 & 1 & 2 & 0 & 0 \Tstrut\Bstrut\\
I [\%] & 14 & 16 & 20 & 16 & 0 & 0 \Tstrut\Bstrut
\end{tabular}
\caption{GP-T1 (first-order Taylor)}
\end{subtable}
~\\[3mm]
\begin{subtable}{0.7\linewidth}
\begin{tabular}{c | *{3}{| c c } }
\hline
MD & \multicolumn{2}{|c}{$\pi_{i,N}$} & \multicolumn{2}{|c}{$\chi_i^2$} & \multicolumn{2}{|c}{$w_i$} \Tstrut\Bstrut\\
DC & $D_{\mathrm{BH}}$ & $D_{\mathrm{JR}}$ & $D_{\mathrm{BF}}$ & $D_{\mathrm{JR}}$ & $D_{\mathrm{AW}}$ & $D_{\mathrm{JR}}$ \Tstrut\Bstrut\\
\hline
A & 6.31 & 6.13 & 17.29 & 13.64 & 3.03 & 2.94 \Tstrut\Bstrut\\
SE & 0.21 & 0.24 & 1.55 & 1.73 & 0.14 & 0.12 \Tstrut\Bstrut\\
S [\%] & 96 & 95 & 63 & 22 & 100 & 99 \Tstrut\Bstrut\\
F [\%] & 0 & 0 & 0 & 2 & 0 & 1 \Tstrut\Bstrut\\
I [\%] & 4 & 5 & 37 & 76 & 0 & 0 \Tstrut\Bstrut
\end{tabular}
\caption{GP-T2 (second-order Taylor)}
\end{subtable}%
\caption{Performance statistics of GP surrogate method with first- (GP-T1) and second-order (GP-T2) Taylor approximation of the marginal predictive distribution for the ammonia synthesis case study. Compare to statistics for analytical method in Table~\ref{tab:table_A}.}
\label{tab:table_gp_ammonia}
\end{table}
Table~\ref{tab:table_gp_ammonia}a shows that GP-T1 performs similarly to the analytical method. The averages A are similar, taking the sometimes relatively large standard errors SE into account. In Table~\ref{tab:table_gp_ammonia}b, GP-T2 largely produces better simulation statistics than both the analytical method and GP-T1. GP-T2 appears to produce marginal predictive distributions more beneficial for model discrimination in this case study. It may be that the second-order characteristics of GP-T2 improve the marginal predictive distribution accuracy. It may also be that the models' structure (all model parameters appear in exponents in the denominator) advantage models with the fewest model parameters ($f_1$ and $f_2$). In this case study, we generate data from model $f_1$.
\begin{table}[!t]
\centering
\begin{tabular}{c | *{3}{| ccc} }
\hline
& \multicolumn{3}{c}{Analytical} & \multicolumn{3}{|c}{GP-T1} & \multicolumn{3}{|c}{GP-T2} \Tstrut\Bstrut\\
MD & $\pi_{i,N}$ & $\chi_i^2$ & $w_i$ & $\pi_{i,N}$ & $\chi_i^2$ & $w_i$ & $\pi_{i,N}$ & $\chi_i^2$ & $w_i$ \Tstrut\Bstrut\\
DC & $D_{\mathrm{BH}}$ & $D_{\mathrm{BF}}$ & $D_{\mathrm{AW}}$ & $D_{\mathrm{BH}}$ & $D_{\mathrm{BF}}$ & $D_{\mathrm{AW}}$ & $D_{\mathrm{BH}}$ & $D_{\mathrm{BF}}$ & $D_{\mathrm{AW}}$ \Tstrut\Bstrut\\
\hline
A & 2.60 & 2.87 & 2.08 & 4.31 & 2.23 & 2.72 & 4.14 & 2.29 & 2.64 \Tstrut\Bstrut\\
SE & 0.04 & 0.12 & 0.04 & 0.09 & 0.06 & 0.08 & 0.09 & 0.07 & 0.06 \Tstrut\Bstrut\\
S [\%] & 86.4 & 64.2 & 62.4 & 95.6 & 47.4 & 88.6 & 96.9 & 46.6 & 90.1 \Tstrut\Bstrut\\
F [\%] & 13.6 & 5.0 & 37.6 & 4.4 & 4.8 & 11.4 & 3.1 & 9.9 & 9.9 \Tstrut\Bstrut\\
I [\%] & 0.0 & 30.8 & 0.0 & 0.0 & 47.8 & 0.0 & 0.0 & 43.5 & 0.0 \Tstrut\Bstrut\\
\end{tabular}
\caption{Performance comparison between the GP surrogate method with first- (GP-T1) and second-order (GP-T2) Taylor approximation of the marginal predictive distribution, and the analytical methods, for the chemical kinetic models case study.}
\label{tab:icmlresults}
\end{table}
Next, we compare the GP surrogate method to the classical analytical method on the chemical kinetic models case study \citep{BuzziFerraris1984}. Table~\ref{tab:icmlresults} shows the performance statistics of GP-T1, GP-T2 and the analytical method from simulations from 500 sets of random initial measurements. In this table, GP-T1 and GP-T2 perform similarly. For the $\pi_{i,N}$ and $w_i$ model discrimination methods, the GP surrogate method has higher averages A than the analytical method, but also higher success rates and lower failure rate. For the $\chi^2$ model discrimination method, the situation reverses, though the difference in average A is smaller and for GP-T1 the failure rate is still lower. Overall, Table~\ref{tab:icmlresults} indicates that the GP surrogate method is more conservative than the classical analytical method. This conservatism may arise from the added surrogate uncertainty term $\Sigma_f$ in \eqref{eq:taylor1predDist} yielding a larger predicted variance for the surrogate than the original model.
Lastly, we compare the GP surrogate method to the classical analytical method on the mixing case study (\ref{sec:casestudymixingappendix}). The mixing case study has the option from which model to generate experimental data. Table~\ref{tab:table_gp_mixing} shows the performance statistics for GP-T1, GP-T2 and the analytical method from simulations from 100 sets of random initial measurements, with experimental data generated from model $f_3$. This case study has a high success rate and low number of additional experiments required for all discrimination criteria and methods of model discrimination.
\begin{table}[!t]
\centering
\begin{subtable}{0.65\linewidth}
\begin{tabular}{c | *{3}{| c c } }
\hline
MD & \multicolumn{2}{|c}{$\pi_{i,N}$} & \multicolumn{2}{|c}{$\chi_i^2$} & \multicolumn{2}{|c}{$w_i$} \Tstrut\Bstrut\\
DC & $D_{\mathrm{BH}}$ & $D_{\mathrm{JR}}$ & $D_{\mathrm{BF}}$ & $D_{\mathrm{JR}}$ & $D_{\mathrm{AW}}$ & $D_{\mathrm{JR}}$ \Bstrut\\
\hline
A & 4.42 & 4.25 & 2.09 & 1.30 & 2.47 & 2.38 \Tstrut\Bstrut\\
SE & 0.09 & 0.07 & 0.04 & 0.05 & 0.06 & 0.09 \Tstrut\Bstrut\\
S [\%] & 100 & 100 & 100 & 100 & 100 & 100 \Tstrut\Bstrut\\
F [\%] & 0 & 0 & 0 & 0 & 0 & 0 \Tstrut\Bstrut\\
I [\%] & 0 & 0 & 0 & 0 & 0 & 0 \Tstrut\Bstrut
\end{tabular}
\caption{Analytical}
\end{subtable}
~\\[3mm]
\begin{subtable}{0.65\linewidth}
\begin{tabular}{c | *{3}{| c c } }
\hline
MD & \multicolumn{2}{|c}{$\pi_{i,N}$} & \multicolumn{2}{|c}{$\chi_i^2$} & \multicolumn{2}{|c}{$w_i$} \Tstrut\Bstrut\\
DC & $D_{\mathrm{BH}}$ & $D_{\mathrm{JR}}$ & $D_{\mathrm{BF}}$ & $D_{\mathrm{JR}}$ & $D_{\mathrm{AW}}$ & $D_{\mathrm{JR}}$ \Bstrut\\
\hline
A & 4.65 & 4.48 & 1.78 & 1.24 & 2.61 & 2.19 \Tstrut\Bstrut\\
SE & 0.16 & 0.13 & 0.08 & 0.09 & 0.06 & 0.09 \Tstrut\Bstrut\\
S [\%] & 99 & 100 & 99 & 100 & 100 & 100 \Tstrut\Bstrut\\
F [\%] & 0 & 0 & 0 & 0 & 0 & 0 \Tstrut\Bstrut\\
I [\%] & 1 & 0 & 1 & 0 & 0 & 0 \Tstrut\Bstrut
\end{tabular}
\caption{GP-T1 (first-order Taylor)}
\end{subtable}
~\\[3mm]
\begin{subtable}{0.65\linewidth}
\begin{tabular}{c | *{3}{| c c } }
\hline
MD & \multicolumn{2}{|c}{$\pi_{i,N}$} & \multicolumn{2}{|c}{$\chi_i^2$} & \multicolumn{2}{|c}{$w_i$} \Tstrut\Bstrut\\
DC & $D_{\mathrm{BH}}$ & $D_{\mathrm{JR}}$ & $D_{\mathrm{BF}}$ & $D_{\mathrm{JR}}$ & $D_{\mathrm{AW}}$ & $D_{\mathrm{JR}}$ \Bstrut\\
\hline
A & 5.75 & 4.45 & 1.21 & 1.15 & 2.27 & 2.30 \Tstrut\Bstrut\\
SE & 0.16 & 0.23 & 0.06 & 0.11 & 0.05 & 0.10 \Tstrut\Bstrut\\
S [\%] & 99 & 95 & 100 & 100 & 100 & 100 \Tstrut\Bstrut\\
F [\%] & 0 & 0 & 0 & 0 & 0 & 0 \Tstrut\Bstrut\\
I [\%] & 1 & 5 & 0 & 0 & 0 & 0 \Tstrut\Bstrut
\end{tabular}
\caption{GP-T2 (second-order Taylor)}
\end{subtable}%
\caption{Performance comparison between the GP surrogate method with first- (GP-T1) and second-order (GP-T2) Taylor approximation of the marginal predictive distribution, and the analytical methods, for the mixing case study. Noisy observed data is generated from model $f_3$.}
\label{tab:table_gp_mixing}
\end{table}
\begin{table}[!t]
\centering
\begin{subtable}{0.65\linewidth}
\begin{tabular}{c | *{3}{| c c } }
\hline
MD & \multicolumn{2}{|c}{$\pi_{i,N}$} & \multicolumn{2}{|c}{$\chi_i^2$} & \multicolumn{2}{|c}{$w_i$} \Tstrut\Bstrut\\
DC & $D_{\mathrm{BH}}$ & $D_{\mathrm{JR}}$ & $D_{\mathrm{BF}}$ & $D_{\mathrm{JR}}$ & $D_{\mathrm{AW}}$ & $D_{\mathrm{JR}}$ \Bstrut\\
\hline
A & 54.71 & 50.79 & 50.97 & 45.00 & 26.07 & 27.70 \Tstrut\Bstrut\\
SE & 2.25 & 2.08 & 4.88 & 3.96 & 1.56 & 1.68 \Tstrut\Bstrut\\
S [\%] & 75 & 72 & 34 & 49 & 98 & 97 \Tstrut\Bstrut\\
F [\%] & 0 & 0 & 0 & 1 & 2 & 2 \Tstrut\Bstrut\\
I [\%] & 25 & 28 & 66 & 50 & 0 & 1 \Tstrut\Bstrut\\
\end{tabular}
\caption{Analytical}
\end{subtable}
~\\[3mm]
\begin{subtable}{0.65\linewidth}
\begin{tabular}{c | *{3}{| c c } }
\hline
MD & \multicolumn{2}{|c}{$\pi_{i,N}$} & \multicolumn{2}{|c}{$\chi_i^2$} & \multicolumn{2}{|c}{$w_i$} \Tstrut\Bstrut\\
DC & $D_{\mathrm{BH}}$ & $D_{\mathrm{JR}}$ & $D_{\mathrm{BF}}$ & $D_{\mathrm{JR}}$ & $D_{\mathrm{AW}}$ & $D_{\mathrm{JR}}$ \Bstrut\\
\hline
A & 53.13 & 50.88 & 49.03 & 44.23 & 26.91 & 28.05 \Tstrut\Bstrut\\
SE & 1.95 & 1.96 & 4.84 & 4.23 & 1.52 & 1.79 \Tstrut\Bstrut\\
S [\%] & 71 & 74 & 33 & 43 & 100 & 98 \Tstrut\Bstrut\\
F [\%] & 0 & 0 & 2 & 1 & 0 & 2 \Tstrut\Bstrut\\
I [\%] & 29 & 26 & 65 & 56 & 0 & 0 \Tstrut\Bstrut\\
\end{tabular}
\caption{GP-T1 (first-order Taylor)}
\end{subtable}
~\\[3mm]
\begin{subtable}{0.65\linewidth}
\begin{tabular}{c | *{3}{| c c } }
\hline
MD & \multicolumn{2}{|c}{$\pi_{i,N}$} & \multicolumn{2}{|c}{$\chi_i^2$} & \multicolumn{2}{|c}{$w_i$} \Tstrut\Bstrut\\
DC & $D_{\mathrm{BH}}$ & $D_{\mathrm{JR}}$ & $D_{\mathrm{BF}}$ & $D_{\mathrm{JR}}$ & $D_{\mathrm{AW}}$ & $D_{\mathrm{JR}}$ \Bstrut\\
\hline
A & 75.69 & 83.05 & 60.70 & 52.86 & 12.32 & 22.96 \Tstrut\Bstrut\\
SE & 5.82 & 2.25 & 4.13 & 11.89 & 0.82 & 2.65 \Tstrut\Bstrut\\
S [\%] & 16 & 39 & 33 & 7 & 59 & 45 \Tstrut\Bstrut\\
F [\%] & 17 & 2 & 0 & 3 & 41 & 55 \Tstrut\Bstrut\\
I [\%] & 67 & 59 & 67 & 90 & 0 & 0 \Tstrut\Bstrut\\
\end{tabular}
\caption{GP-T2 (second-order Taylor)}
\end{subtable}%
\caption{Performance comparison between the GP surrogate method with first- (GP-T1) and second-order (GP-T2) Taylor approximation of the marginal predictive distribution, and the analytical methods, for the mixing case study. Noisy observed data is generated from model $f_5$.}
\label{tab:table_gp_mixing2}
\end{table}
Table~\ref{tab:table_gp_mixing2} shows the performance statistics for GP-T1, GP-T2 and the analytical method from simulating 100 sets of random initial measurements, with experimental data generated from model $f_5$. The mixing case study with data generated from model $f_5$ is more difficult, so we increase the maximum number of additional experiments to 100. Table~\ref{tab:table_gp_mixing2} shows that GP-T1 and the analytical method perform similarly. GP-T2 performs poorly for this case study: the failure rates for the $\pi_{i,N}$ and $w_i$ methods of model discrimination are often comparable to the corresponding success rates. The averages A are higher and the success rates lower for the mixing case study with data generated from model $f_5$ instead of model $f_3$. This is due to indiscriminability between models $f_4$ and $f_5$ (further discussed in Section~\ref{sec:vanliercasestudy}).
The results in Tables~\ref{tab:table_A}--\ref{tab:table_gp_mixing2} were generated for $j=1,\dots,21$ combinations of case studies, methods of model discrimination and design criteria (excluding random design). In each case study, $\ell=1,\dots,100$ random initial data sets were generated. Thus, a total of 2100 experiments were run for each of GP-T1, GP-T2 and the analytical method.
Define $a_{j,\ell}$ as the number of additional experiments needed for \textit{successful} model discrimination in combination $j$ with initial data set $\ell$ (using GP-T1, GP-T2 or the analytical method).
Simulations resulting in unsuccessful model discrimination are ignored for now. The average A and standard error SE in Table~\ref{tab:resultmetrics} are defined for combination $j$ as $\mathrm{A}_j = \mathrm{mean}\lbrace a_{j,1}, \dots, a_{j,100} \rbrace$ and $\mathrm{SE}_j = \mathrm{std}\lbrace a_{j,1}, \dots, a_{j,100} \rbrace / \sqrt{100}$. Figure~\ref{fig:Rplot} shows the outcomes of all case study simulations and compares the averages with standard errors for GP-T1, GP-T2 and the analytical method.
\begin{figure}[!t]
\centering
\includegraphics[width=\textwidth]{figures/Rplot.pdf}
\caption{Comparison of the number of additional experiments $a_{j,\ell}$ needed for successful model discrimination using the analytical method or (a)-(b) GP-T1 or (c)-(d) GP-T2. Plots (a) and (c) show the outcomes of all simulation with successful model discrimination for both the analytical and GP-T1 (1828 simulations) or GP-T2 (1615 simulations). Plots (b) and (d) show the average A (with standard error SE) computed for each case study, design criterion and method of model discrimination.}
\label{fig:Rplot}
\end{figure}
Figure~\ref{fig:Rplot} indicates that GP-T1 performs similarly to the analytical method. The number of additional experiments $a_{j,\ell}$ is not expected to be the same in each simulation, since we add random noise to each measurement. The similar average performance indicates that the GP surrogate method successfully emulates the analytical method, which also uses a first-order approximation.
In most case studies, GP-T2 performs as well as---or better than---GP-T1. For case studies where the GP surrogate model makes accurate predictions, a second-order approximation of the marginal predictive distributions may be more accurate than a first-order approximation. However, for the difficult mixing case study, with data generated from model $f_5$, GP-T2 performed worse. Figure~\ref{fig:Rplot} shows that the GP-T1 average performance is more similar to the analytical (first-order) method's performance than GP-T2.
\subsection{Non-Analytical Case Study}
\label{sec:vanliercasestudy}
\begin{table}[!t]
\centering
\begin{tabular}{c | *{3}{c} | *{3}{c} }
\hline
& \multicolumn{3}{c|}{\emph{4 models}} & \multicolumn{3}{c}{\emph{3 models}} \Tstrut\\
MD& $\pi_{i,N}$ & $\chi_i^2$ & $w_i$ & $\pi$ & $\chi_i^2$ & $w_i$ \tstrut\\
DC& $D_{\mathrm{BH}}$ & $D_{\mathrm{BF}}$ & $D_{\mathrm{AW}}$ & $D_{\mathrm{BH}}$ & $D_{\mathrm{BF}}$ & $D_{\mathrm{AW}}$ \tstrut\\
\hline
A & 20.10 & 39.83 & 29.62 & 15.80 & 21.91 & 9.74 \Tstrut\\
SE & 3.72 & 12.09 & 7.72 & 2.05 & 2.52 & 1.70 \tstrut\\
S [\%] & 15.9 & 9.5 & 33.3 & 89.5 & 77.2 & 95.6 \tstrut\\
F [\%] & 7.9 & 0.0 & 7.9 & 6.1 & 0.9 & 1.8 \tstrut\\
I [\%] & 76.2 & 90.5 & 58.7 & 4.4 & 21.9 & 2.6 \tstrut\\
\end{tabular}
\caption{Results from the biochemical networks case study. With four models, we encounter model indiscriminability: Two of the models make predictions too similar to successfully discriminate between them in a majority of simulations. Experimental data is generated from one of the two models. If we remove the other model, we find that we are able to successfully perform model discrimination.}
\label{tab:vanlierresults}
\end{table}
We wish to verify that the GP surrogate method successfully extends the classical, analytical method for design of experiment for model discrimination to situations with black-box models. The Table~\ref{tab:vanlierresults} results for 4 models show that the the success rates are significantly lower for this case study than for previous case studies. For the $\pi_{i,N}$ model discrimination method, the success rate is only twice as high as the failure rate. Rates of inconclusive results are high, despite allowing 100 additional experiments with averages A all below 50. The reason is that, in this case study, the prediction difference between models $f_1$ and $f_2$ is often smaller than the experimental noise.
For a simulation, we can examine the evolving model discrimination criterion ($\pi_{i,N}$, $\chi^2$ or $w_i$) while adding measurements. For example, Figure~\ref{fig:vanlier} shows the evolution of the Akaike weights $w_i$ for all simulations. Figure~\ref{fig:vanlier}a suggests that models $f_1$ and $f_2$ cannot be discriminated in many simulations. To verify this, we remove model $f_2$ from the set of rival models. Table~\ref{tab:vanlierresults} (3 models) and Figure~\ref{fig:vanlier}b show that removing model $f_2$ enables correct identification of model $f_1$ as the data-generating model in most simulations.
\begin{figure}[!t]
\centering
\includegraphics[width=\textwidth]{figures/vanlier.pdf}
\caption{Results from biochemical networks case study with (a) four rival models and (b) three rival models. The first four plots from the left show the evolution of the Akaike weights $w_i$ for all simulations. The right-most plots show the averages (with one standard deviation). The plots in (a) and statistics in Table~\ref{tab:vanlierresults} indicate that model $f_1$ and $f_2$ are almost indiscriminable. When we remove model $f_2$ from the set of models, as in (b), the GP surrogate method successfully finds that $f_1$ is the data-generating model.}
\label{fig:vanlier}
\end{figure}
\section{Discussion}
\label{sec:discussion}
Model discrimination is a very important problem, and optimal design of experiments forms part of the solution. For example, model discrimination is crucial in developing new drugs. \cite{DiMasi2016} estimate the average pre-approval R\&D cost for new drugs to \$2.56B, of which \$1.1B is spent in the pre-clinical stage (in 2013 US dollars). Successful model discrimination early in the drug development may lower costs, whereas inaccurate models passing the pre-clinical stage can incur significant costs \citep{ScannelBosley2016, Plenge2016}. Hence, inaccurate models should be discarded as early as possible in the drug development process. Model discrimination is a major hurdle e.g.\ in \emph{in silico} pharmacokinetics \citep{heller2018technologies}.
The optimal design of experiments for model discrimination literature has focused on either classical analytical approaches or Monte Carlo-based approaches. The former is computationally cheap but limited in the model structures and approximations it can accommodate, whereas the latter is flexible and accurate but may be computationally expensive. Hence, there is a trade-off between flexibility, accuracy and computational speed. Our GP surrogate method adds another alternative: we can accommodate non-analytical models as easily as analytical models in a computationally inexpensive way. A commonly-observed limitation of GP surrogates is the scaling to the large training data sets required to accurately emulate models with high-dimensional design and parameter spaces. As mitigation, our surrogate approach with approximate marginalisation of model parameters accommodates sparse GP surrogate models, which increases the maximum number of input dimensions the surrogate models can accommodate. \new{Because different users might face different restrictions on computational time (for generating training data and training the GP surrogates), and because different models' behaviour can differ significantly, we do not attempt to provide general guidelines for how best to generate training data. The maximum number of input dimensions the GP surrogates can accommodate depends on how much training data is required to accurately replicate the original models, which in turn depends on how sensitive each target dimension is to the model inputs.}
Beyond the GP surrogate method, we have derived the novel design criterion $D_{\mathrm{JR}}$ and discussed trade-offs between different experimental designs. Investigating these trade-offs is enabled by our GPdoemd toolbox. In our experiments, the different design criteria sometimes perform similarly and (in those cases) the model discrimination method has a large impact on the success rate or the number of additional experiments required. GPdoemd allows switching between these discrimination methods. GPdoemd could be further extended to alternative model discrimination criteria including the Minimum Message Length \citep{WallaceBoulton1968}, the Bayesian Information Criterion \citep{Schwarz1978} or the Widely Applicable (Bayesian) Information Criterion \citep{Watanabe2010,Watanabe2013}. Another important consideration is parameter estimation: We may discard the data-generating model due to poor parameter estimation. GPdoemd could be extended to incorporate global parameter estimation.
Model indiscriminability is a major hurdle for model discrimination. Parametric models may be very flexible, spanning a large part of the target space depending on the specific model parameter values. \new{Useful stopping criteria for design of experiments, e.g.~\citeauthor{BuzziFerraris1983}'s (\citeyear{BuzziFerraris1983}) criterion $D_{\mathrm{BF}}(\vec u) > 1$ mentioned in Section~\ref{sec:dcs}, are difficult to come by.} In practice, we may need to rethink the experimental set-up to reduce measurement noise or add new system inputs or target dimensions. Another option is to analyse the physical meaning of the model parameters with the goal of tightening the bounds on the allowed model parameter values. The smaller design space should in turn reduce the target space spanned by the model predictions.
\new{This paper has addressed sequential design of experiments, but engineers researchers may want to design several new experiments to run in parallel. This is called \emph{batch optimisation} in the Bayesian optimisation literature~\citep{Gonzalez2016}. \citet{Galvanin2006, Galvanin2007} and \citet{Bazil2012} have studied design of parallel experiments for parameter estimation, but there have been fewer contributions on design of parallel experiments for model discrimination. A simple heuristic is to design new experiments in a sequential fashion while penalising new experiments in the vicinity of experiments already added to the next batch.}
The Section~\ref{sec:results} experiments are not in every way representative of model discrimination in a real setting. The large-scale tests of the $D_{\mathrm{JR}}$ design criterion and GP surrogate method require fixed thresholds for when model discrimination (using $\pi_{i,N}$, $\chi^2$ or $w_i$) rejects or selects a model. Our experiments set the ``winning'' threshold for $\pi_{i,N}$ and $w_i$ to 99.9\%, which is arguably high. But a high threshold also decreases the failure risk. In practice, an engineer may select a model maintaining a probability score, e.g.\ of $w_i=0.98$ over multiple experiments. Regardless of the precise threshold value, the results in Section~\ref{sec:results} may indicate the methods' relative performance in a real setting.
This paper considers models of the type $\vec y = f(\vec u, \vec \theta) + \vec \epsilon$. Many processes for which we need to design experiments for model discrimination are time-dependent, and best described by state-space models. \cite{CheongManchester2014a,CheongManchester2014b} look at model discrimination and fault detection in dynamic systems, but do not take model parameter uncertainty into account. Neither do \cite{SkandaLebiedz2010,SkandaLebiedz2013}. Ignoring parameter uncertainty may lead to overconfidence in the models' accuracy. \cite{ChenAsprey2003} study non-linear state-space models with model parameter uncertainty. They use a classical approach of estimating the model parameter uncertainty using analytical gradient information. \cite{Georgakis2013} uses a data-driven approach to design dynamic experiments for model parameter estimation. We believe that our GP surrogate method can be extended to design of experiments for discrimination of rival state-space models. \cite{KoFox2009} and \cite{deisenroth2009} use GPs to learn non-linear dynamics, and propagate uncertainty in the system state to the model prediction.
\section{Conclusions}
\label{sec:conclusions}
Design of experiments for black-box model discrimination is a difficult but important problem. Our novel method, hybridising the classical and Monte Carlo-based approaches using GP surrogate models, performs similarly to the analytical approach on classical case studies and several orders of magnitude faster than existing black-box approaches. It allows flexibility with regards to the structure and software implementations of the underlying models. Limitations lie in scaling the GPs to the large training data sets required to accurately emulate models with high-dimensional design and parameter spaces.
The GP surrogate method has been implemented in the open-source GPdoemd Python package and made available on GitHub. The GPdoemd package allows researchers and engineers to implement design of experiments for model discrimination and includes methods for approximating marginal predictive distributions, design of experiments, and model discrimination. For methodology experts wishing to develop new model discrimination approaches, GPdoemd also includes a standard set of case studies.
\section*{Acknowledgements}
\noindent
This work has received funding from the European Union's Horizon 2020 research and innovation programme under the Marie Sk\l{}odowska-Curie grant agreement no.\ 675251, and an EPSRC Research Fellowship to R.M.\ (EP/P016871/1).
| {'timestamp': '2019-03-11T01:14:49', 'yymm': '1810', 'arxiv_id': '1810.02561', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02561'} | arxiv |
\section{Technical Interference}
\label{sec:technical-interference}
In this section, we demonstrate a case of Chinese technical interference in Bitcoin. Specifically, we discuss how the GFW imparts a latency overhead on all traffic it processes, including Bitcoin traffic. Until protocol upgrades were introduced to address this problem in June 2016,
Chinese miners were disadvantaged by this latency as it slowed the rate at which their proposed blocks could propagate. This created an incentive for those miners to mine empty blocks because those were less disadvantaged by the latency. However, empty blocks are bad for Bitcoin, as they process no transactions but consume network resources, thus damaging system throughput.
\subsection{Analysis}
Bitcoin blocks adhere to a fixed size limit of 1MB.
\footnote{The SegWit protocol upgrade, activated in August 2017, kept the 1MB limit for transactions but allowed other block data to consume an additional 3MB.
This is why Figure~\ref{fig:avgblocksize} shows that some recent blocks are larger than 1MB.}
Since mid-2016, blocks on the main chain have generally been at or above 800KB in size, suggesting that throughput is at 80\% of capacity, although prior to this smaller blocks were the norm (see Figure~\ref{fig:avgblocksize}).
\begin{figure}[t]
\centering
\subfloat[][]{
\includegraphics[width=0.49\textwidth]{average_block_size.png}
\label{fig:avgblocksize}
}
\subfloat[][]{
\includegraphics[width=0.49\textwidth]{pct_empty_blocks.png}
\label{fig:pctemptyblocks}
}
\caption{
(a) Average block size in MB, averaged weekly, using data from \cite{BCInfo-BlockSize18}.
(b) Percentage of published blocks per day that are empty, using data from \cite{Blockchair18}.
}
\end{figure}
Miners are free to include as many or as few transactions in a block as they want. Because the difficulty of mining a block does not depend on its size, to maximize their profits miners would be expected to include as many fee-bearing transactions in their blocks as possible (even though transaction fees are quite small compared to the block reward). If there are not enough fee-bearing transactions in the mempool to fill a block, a rational miner might publish a block with some empty space because although including additional non-fee-bearing transactions does not cost them anything, it also does not earn them anything.
Based on this incentive structure, empty blocks (those containing only the coinbase transaction) should be exceedingly rare, as there are virtually always some fee-bearing transactions in the mempool. However, historically empty blocks were occasionally produced. There are reasons a miner might do this and forgo transaction fees; for example, once a miner is notified that a block has been found by another miner, they may start mining an empty block in the time it takes to download and validate that block and choose the next set of transactions. Although this process is typically fairly quick, the probabilistic nature of mining means that sometimes the miner successfully finds that empty block in time, and so they publish it to reap the block reward.
Prior to May 2015, empty blocks were produced at a consistent rate of $2 - 3\%$, except for a few aberrations in 2011 and 2012 before Bitcoin was widely used (see Figure~\ref{fig:pctemptyblocks}). Beginning in May 2015, a noticeable spike up to around $5\%$ that lasts through June 2016 is visible.
We examined the behavior of the eight largest mining pools during this period, which cumulatively found nearly 80\% of all blocks. Table~\ref{tbl:hashrate15-16} summarizes this information. The four Chinese pools cumulatively account for 64\% of the hash power while non-Chinese pools account for 24\%.
Looking at the combined average rates of empty blocks produced by each of these pool groups (Figure~\ref{fig:pctemptyblocksgrouped15-16}), we see that the Chinese pool group produced an unusually high rate of empty blocks, spiking up above 7\%.
\footnote{Within the group, two individual pools (AntPool and BW Pool) peaked with empty block rates as high as 13\% (see Figure~\ref{fig:pctemptyblockschinese15-16}).}
Meanwhile, non-Chinese miners produced empty blocks at a historically consistent rate of around 2\%.
These observations suggest that some factor that applied to Chinese miners -- but not other miners -- created an incentive to mine empty blocks. We posit that this factor is the Great Firewall, and more specifically, the bandwidth bottleneck it imparts.
\begin{table}[t]
\centering
\caption{Nationality of mining pools and their share of hash rate between May 1, 2015 and June 30, 2016.}
\label{tbl:hashrate15-16}
\begin{tabular}{|l|l|l|}
\hline
\textbf{Mining pool} & \textbf{Located in China} & \textbf{\begin{tabular}[c]{@{}l@{}}Estimated share of\\ network hash rate\end{tabular}} \\ \hline
F2Pool & Yes & 22.17 \\ \hline
AntPool & Yes & 21.54 \\ \hline
BTCC & Yes & 12.79 \\ \hline
BitFury & No & 12.39 \\ \hline
BW Pool & Yes & 7.84 \\ \hline
KnCMiner & No & 4.89 \\ \hline
SlushPool & No & 4.72 \\ \hline
21 Inc. & No & 2.27 \\ \hline
\end{tabular}
\end{table}
\begin{figure}[t]
\centering
\subfloat[][]{
\includegraphics[width=0.49\textwidth]{pct_empty_blocks_zoomed_and_grouped.png}
\label{fig:pctemptyblocksgrouped15-16}
}
\subfloat[][]{
\includegraphics[width=0.49\textwidth]{pct_empty_blocks_zoomed_chinese.png}
\label{fig:pctemptyblockschinese15-16}
}
\caption{
(a) Percentage of published blocks that are empty, sampled once per three weeks and grouped by national affiliation, using data from
\cite{Blockchair18}. See Table \ref{tbl:hashrate15-16} for information on mining pool hash rates and national affiliations.
(b) Percentage of blocks published by Chinese-controlled pools that are empty, sampled once per three weeks, using data from \cite{Blockchair18}.
}
\end{figure}
The GFW is known to limit bandwidth by inducing packet loss in TCP streams. In 2017 a test showed 6.9\% packet loss in connections between the US and China and only 0.2\% for connections between the US and Hong Kong, which is just outside the GFW \cite{Xu17}. Packet loss causes latency, as dropped packets must be re-requested and re-sent, and this was also observed in the same test (218ms latency for Chinese agents compared to 81ms for Hong Kong).
This latency has been observed to affect Bitcoin block propagation. In 2015 it was shown that block propagation across the GFW was an order of magnitude slower than propagation between nodes on the same side of the GFW \cite{ToomimScalingBTC2015}. Separate research the following year found that mean propagation times for near-full Bitcoin blocks were 3.9 seconds between nodes on the same side of the GFW and 17.4 seconds between nodes on opposite sides, representing a slowdown of nearly 450\% \cite{Rizun2016}.
Propagation latency perverts the incentives for miners behind the GFW because they are at an inherent disadvantage. If a miner behind the GFW finds a valid next block at the same time as an outside miner, the latter can more quickly propagate their block to the rest of the network, meaning they are more likely to win a forking race and have their block accepted.
Mining smaller blocks, which propagate more quickly, can counteract this disadvantage for miners behind the GFW. While transaction fees are designed to dissuade empty block mining, those fees fluctuate and at times are insubstantial. Across the period when empty block rates were high, transaction fees averaged only .25 BTC per block. The block reward of 25 BTC was far more valuable, so mining more empty blocks to earn more block rewards would seem profitable.
Compact block relay was incorporated into the Bitcoin Core client on June 22, 2016 as BIP152 (Bitcoin Improvement Propsal \#152) \cite{BIP152PR}. Leveraging the fact that full nodes store transactions they have already seen in their mempool, the BIP significantly reduced the bandwidth required for block propagation. Specifically, it permitted peers to avoid sending full blocks to each other and instead send compact block ``sketches'' along with a small set of transactions the sender guesses the receiver has not yet seen. Under this protocol, a full block can be relayed using only 15KB of data \cite{Gomez16}, reducing the bandwidth requirement of block propagation by 98\%.
With BIP152 incorporated, block propagation time became largely independent of block size, and so the incentive to mine empty blocks was eliminated. Correspondingly, the practice quickly subsided to its pre-2015 level (as seen in Figures~\ref{fig:pctemptyblocksgrouped15-16} and~\ref{fig:pctemptyblockschinese15-16}).
While this particular threat to Bitcoin has abated, it demonstrates the power of China's technical capabilities for domestic control to weaken Bitcoin, even unintentionally, on a global scale. We now turn to an analysis of other vectors by which China could leverage their capabilities to attack Bitcoin.
\section*{Appendix 1: Charting Bitcoin's Trajectory in China}
\label{apndx:china}
In this appendix, we briefly explore the factors that led to Bitcoin's dramatic growth in China and outline the evolution of the exchange and mining sectors and relevant regulations.
A number of factors set the stage in 2013 for Bitcoin to achieve popularity in China.
First, two economic trends in the aughts -- growth in private wealth and favorable foreign exchange rates for the Yuan -- drove increased buying power and desire for investment assets among consumers.
Because access to investment assets was (and still is) tightly controlled in China's command economy, Bitcoin was attractive due to its lack of regulation and potential for significant profit~\cite{Wong17}.
Second, by this time online and mobile payment systems were far more popular in China than anywhere else in the world~\cite{gloudeman_bitcoins_2014}. Bitcoin bears many similarities to such systems, especially when used through a mobile wallet app, so Chinese consumers may have been less hesitant to adopt Bitcoin than others.
Finally, China has long enforced a centralized political ideology and policies of strong social control. Banks in China are overwhelmingly controlled by the state, anonymous communication online is banned, and service providers are mandated to enforce Chinese state censorship on their platforms. Bitcoin represented an ideology of decentralization and individual autonomy that stood in direct opposition to these ideas, and its potential to provide a means of transacting anonymously and free from censorship was radical and appealing.
\subsection*{Exchanges}
Chinese exchanges grew to dominate the total exchange volume of Bitcoin from 2013 to 2017 (see Figure~\ref{fig:chinaexchange}). By the end of 2013, Chinese exchanges handled over 50\% of all trades and the single exchange BTC China was the largest in the world by trade volume, processing nearly a third of all transactions~\cite{McMillan13}.
Permitting large amounts of CNY to be converted to Bitcoin would seem to conflict with the protectionist economic policies of China, which include preventing capital flight -- the movement of capital out of China~\cite{ju2016capital}.
Bitcoin is a popular vector for capital flight because of its pseudonymity and limited oversight~\cite{drug2017national,amineh2018china}.
These qualities make Bitcoin attractive for other forms of crime as well, particularly money laundering. According to the 2017 National Drug Threat Assessment by the US Drug Enforcement Agency, ``China has been an enduring hub for trade-based money laundering schemes" whereby Chinese-made goods are purchased in bulk in USD and then sold in Mexico and South America for local currency.
``Chinese manufacturers who want Bitcoin undoubtedly ease the money laundering process" because criminal organizations can transfer large amounts of BTC to Chinese companies without incurring the scrutiny that would be applied were the funds in USD~\cite{drug2017national}.
When China announced their first Bitcoin regulations in December 2013, they cited criminal activity as the cause along with speculative risk~\cite{Mullany13}.
The policy banned financial institutions from buying and selling Bitcoin or treating it as a currency in any way.
Bitcoin itself was not made illegal, and exchanges were allowed to continue facilitating trades as long as they obeyed anti-money laundering regulations such as identifying users, but by cutting off the ability to exchange bitcoins for fiat currency, China undermined the main business model for Bitcoin exchanges and eliminated much of the utility of Bitcoin~\cite{Hill14}.
Chinese Bitcoin exchanges quickly exploited loopholes in the new regulation and deployed workarounds.
\footnote{These included selling voucher codes that customers could trade offline and redeem on the exchange, deploying physical ATMs that could exchange cash for bitcoins, and using corporate or even personal bank accounts to process transactions~\cite{Mu14,Bischoff14}.
}
Confusion ensued as regulators curbed some of this activity, but in the end most exchanges simply closed their accounts with Chinese commercial banks and used alternative financial systems.
\footnote{Following this confusion, the congressional US-China Economic and Security Review Commission observed in an issue brief that ``the true attitude of China's regulators towards Bitcoin is characteristically ambiguous"~\cite{gloudeman_bitcoins_2014}.}
After a few months of uncertainty, the Chinese exchange market stabilized and exchange activity continued its surge with little regulatory interference for the next two years with CNY exchange comprising 98\% of all Bitcoin exchange activity in December 2016.
\footnote{This value seems anomalously high and led to allegations of inflation or manipulation. One explanation is the unusual fee structure of Chinese exchanges in which trades are free and withdrawal fees decrease as a user's trade volume increases, incentivizing spurious trades. Varying estimates place China's real market share at this time as between 50\% and 85\% -- still a dominant position~\cite{Woo17}.}
In early 2017, regulators issued a series of warnings to exchanges to stay compliant with the 2013 policy~\cite{Rizzo17Feb,Rizzo17Jan}.
This regulation was accompanied by a ban on initial coin offerings (ICOs), an increasingly popular fundraising vehicle in which investors receive stake in the form of cryptocurrency tokens. Justifying the ban, regulators called ICOs "disruptive to economic and financial stability"~\cite{Zhao17}.
In the coming months, exchanges made some more efforts to improve anti-money laundering practices and curb speculation by instituting trading fees, but in September 2017 officials ordered the exchanges to shut down.
Loopholes such as over-the-counter sales, peer-to-peer trading, and foreign listings were banned in early 2018 forcing exchanges to finally abandon the Chinese market and relocate~\cite{scott_china_2018}. As a result, Chinese exchanges now accounts for less than 1\% of the global market.
\subsection*{Mining}
From January 2015 to January 2018, Chinese pools grew from accounting for 42\% of the total Bitcoin network hash power to 77\% (see Figure~\ref{fig:hashpower}).
\footnote{Prior to this time, block attribution is too sparse to reliably estimate relative share. We attribute the following pools to Chinese managers: AntPool, Bixin, BTCC, BTC.com, BTC.TOP, BW.COM, DPOOL, F2Pool, Poolin, ViaBTC, and 58COIN.}
Miners can contribute to Chinese-managed pools from all over the world, so these figures do not represent the share of hash power physically located in China.
However, China does host more mining facilities than any other country (data is not available to measure the precise share)~\cite{Hileman17}.
These facilities are primarily located in remote areas with inexpensive electricity and cheap land, such as Sichuan province and Inner Mongolia.
These advantages allow Chinese miners to achieve greater profit margins than their competitors in other countries; a study in early 2018 found that one bitcoin could be mined in China at $\frac{2}{3}$ the electricity cost of the same operation in the U.S.~\cite{Elitefixtures18}.
Another advantage enjoyed by Chinese miners is proximity to world-leading chip manufacturing facilities. In particular, the Application-Specific Integrated Circuits (ASICs) used for mining are overwhelmingly produced in China, with the most prominent manufacturer, BitMain, claiming to have produced 70\% of the chips used globally in 2017~\cite{Peck17}.
The growth of Chinese mining was further fueled by tax incentives and energy and land discounts offered by provincial governments. However, in early 2018 local regulators were directed by the central bank to ensure that Bitcoin miners no longer received preferential treatment~\cite{Yujian18} and shortly thereafter to scale down Bitcoin mining by regulating power usage, land use, taxes, and environmental protection~\cite{ReutersPolice18}. The stated motivation for the regulation was to make more electricity available for distribution to underserved regions, but the near-simultaneity with heavy exchange regulation suggests a focused effort to reduce Bitcoin's overall popularity and usage in China. These efforts are ongoing, but as Figure~\ref{fig:hashpower} shows, Chinese-managed mining pools remain dominant.
\section*{Appendix 2}
\begin{table}
\caption{A taxonomy of attacks China can deploy to influence the Bitcoin ecosystem.}
\label{tbl:attacks}
\centering
\begin{tabular*}{\textwidth}{ l l l l }
\hline
\mAC{1. Censor specific users or miners} \\
\mG{Ideological statement, law enforcement, foreign influence} \\
\hline
\textbf{Attacks} & \textbf{Visbility} & \textbf{Target} & \textbf{Capabilities} \\
(a) Punitive forking & Overt & Users & High hash rate \\
(b) Feather forking & Overt & Users & Low hash rate \\
(c) Eclipse attack & Covert & Users & \mTwo{Control over a large}{number of peers} \\
\mTwo{(d) Internet traffic}{ tampering} & Overt & Users & \mTwo{Internet traffic}{tampering} \\
\hline
\mAC{2. Deanonymize users}\\
\mG{Ideological statement, law enforcement}\\
\hline
\textbf{Attacks} & \textbf{Visbility} & \textbf{Target} & \textbf{Capabilities} \\
(a) Heuristic address clustering & Covert & Users &
Compute power \\
(b) Traffic monitoring & Covert & Users & Internet surveillance \\
\mTwo{(c) Compel service providers}{ to deanonymize customers} & Covert & Users & Coercion/regulation \\
\mTwo{(d) Third-party tracking}{ of Web purchases} & Covert/Overt & Users & \mThree{Internet surveillance;}{Coercion/regulation;}{Tracker injection} \\
\mTwo{(e) Compel users directly}{to deanonymize} & Covert & Users & Coercion/regulation \\
\hline
\mAC{3. Weaken consensus / Destabilize Bitcoin} \\
\mG{Ideological statement, foreign influence} \\
\hline
\textbf{Attacks} & \textbf{Visbility} & \textbf{Target} & \textbf{Capabilities} \\
(a) Race attack & Overt & Users & \mTwo{Medium hash rate;}{Well-connectedness} \\
(b) Finney attack & Overt & Users & \mTwo{Medium hash rate;}{Well-connectedness} \\
(c) Brute force attack & Overt & Users & \mTwo{Medium hash rate;}{Well-connectedness} \\
(d) Balance attack & Overt & Users & \mThree{Low hash rate;}{Internet traffic}{tampering} \\
(e) Goldfinger attack & Overt & Ecosystem \hspace{1mm} & High hash rate\\
(f) Selfish mining & Overt & Miners & \mTwo{Low hash rate;}{Well-connectedness} \\
(g) Eclipse attack & Covert & Miners & \mTwo{Control over a large}{number of peers} \\
\hline
\mAC{4. Disrupt competing mining operations} \\
\mG{Increase control} \\
\hline
\textbf{Attacks} & \textbf{Visbility} & \textbf{Target} & \textbf{Capabilities} \\
(a) Selfish mining & Overt & Miners & \mTwo{Low hash rate;}{Well-connectedness} \\
(b) Block withholding & Covert/Overt \hspace{1mm} & Miners & Low hash rate\\
(c) Fork after withholding & Covert/Overt & Miners & Low hash rate \\
\end{tabular*}
\end{table}
\section{Threats}
\label{sec:risks}
There are many known attacks on Bitcoin's consensus, miners, software clients, and communication network (see~\cite{Conti17} for a survey).
In this section, we catalog four classes of attacks that China could perpetrate on Bitcoin using the capabilities outlined in \autoref{sec:china} and posit a set of metrics for understanding the attack classes.
\subsection{Metrics}
\textbf{Goals:} There are four goals that China may wish to achieve by attacking Bitcoin. First, as discussed in Appendix 1, Bitcoin stands in ideological opposition to China's centralized governing philosophy, so they may be motivated to weaken or destroy it to make an \textit{ideological statement}; for example, demonstrating the futility of decentralized control paradigms. Virtually any violation of Bitcoin's security suffices to achieve this goal as long as it is highly visible.
Second, the government may attack Bitcoin for the purpose of \textit{law enforcement}: administering capital controls or preventing other illegal activity. Targeting specific users for deanonymization and censorship would allow China to crack down on illicit uses of Bitcoin.
Third, although China has expressed distrust of Bitcoin, they may still determine that \textit{increasing control} over the system is beneficial (e.g., to achieve other goals outlined in this section). By disrupting non-Chinese mining pools, especially those with significant hash power, China could further increase the proportion of hash power they can control and thus exert more influence over Bitcoin.
Finally, as Bitcoin becomes more widely used and more tightly integrated into global financial systems, it becomes a possible vector for attacking foreign economies. To \textit{exert influence in a foreign country} where Bitcoin is in use, China may aim to weaken or even totally destroy Bitcoin. This could be done by targeting specific users or miners for attack or by generally weakening consensus to increase volatility to a breaking point.
\begin{raggedleft}
\textbf{Visibility:}
Some attacks on Bitcoin can be performed surreptitiously while others are easily detectable.
We distinguish \textit{covert} attacks, which are difficult to detect and only minimally perturb the Bitcoin network or ledger, from \textit{overt} attacks which produce visible signatures suggesting Chinese culpability.
Note that any attack can be overt if China announces their actions; we do not classify an attack as overt if this is the only way it can be linked to China.
\end{raggedleft}
\begin{raggedleft}
\textbf{Targets:}
An attack can target Bitcoin users, miners, or the entire ecosystem.
\end{raggedleft}
\begin{raggedleft}
\textbf{Capabilities:}
We discuss China's capabilities to effect Bitcoin in \autoref{sec:china} and note the difficulty of accurately estimating hash power under their control. For our attack analysis, we divide attacks dependent on hash rate into three thresholded categories.
If an attack requires the majority of the network hash rate (i.e., 51\% or more), we label that as \textit{high threshold}.
Attacks that are more effective with the majority of the hash rate but are possible with less have a \textit{medium threshold}, and attacks requiring significantly less than a majority of the hash rate are \textit{low threshold}.
\end{raggedleft}
\subsection{Attacks}
\label{subsec:attacks}
\input{attacks_tbl}
\autoref{tbl:attacks} summarizes the different classes of attacks that are feasible for China, specifies the technical means by which each could be achieved, and connects them to the goals outlined above. Further discussion of each individual attack class follows.
\begin{raggedleft}
\textbf{Censorship:}
One class of attacks in China's arsenal is the ability to perform targeted censorship of Bitcoin users, preventing them from committing transactions to the blockchain. By censoring specific users, China could achieve three possible goals: first, they could make an ideological statement that even decentralized ecosystems like Bitcoin are still subject to China's centralized control; second, they could censor Bitcoin addresses known to belong to criminals to crack down on illegal activity; and third, they could weaken organizations or foreign economies that rely on Bitcoin by selectively censoring addresses important to those parties.
\end{raggedleft}
With control of at least 51\% of the hash rate, Chinese mining pools could simply announce that they will not mine on chains containing transactions from their list of censored addresses. This is called a \textit{(a)} \textit{punitive forking} attack. With less than 51\% of the hash power, Chinese miners could still attempt to fork whenever they see a censored transaction, but some attempts may fail. However, the forks that succeed orphan the blocks found by miners that include censored transactions, reducing their profits, so some may be convinced to follow China's censorship rules. This is a \textit{(b)} \textit{feather forking} attack~\cite{millerforum,narayanan2016bitcoin}. As both attacks require announcing intent, we classify them as overt.
One way China could reduce the hash power required for forking-based censorship attacks is through an \textit{(c)} \textit{eclipse attack}~\cite{Heilman15}.
By directing a large number of peers to monopolize all incoming and outgoing connections to specific victim nodes, this attack controls what those victim nodes see and do in the Bitcoin network in order to prevent them from learning about the transactions China wants to censor.
This reduces the portion of the network that is counteracting censorship attacks by trying to approve the transactions China is trying to censor, meaning that less hash power is required to succeed at censorship, especially if the targeted victim nodes are miners with substantial hash power.
This attack can be performed covertly, as victimized peers are unlikely to realize that their connections are being manipulated.
The final attack that China can employ for censorship is \textit{(d)} Internet traffic tampering using the GFW and control over domestic ISPs. China could either block blacklisted transactions originating in China from propagating or prevent blacklisted transactions originating outside of China from entering the country and reaching Chinese miners. This attack is overt because it would be clear to Bitcoin users if Chinese miners were not adding their transactions to their blocks.
\begin{raggedleft}
\textbf{Deanonymization:}
Bitcoin is designed to preserve the pseudonymity of its users, meaning that their real-world identity cannot be linked to a Bitcoin address they have used to transact.
However, in practice there are complications that make deanonymization attacks possible.
\end{raggedleft}
China might seek to deanonymize users for two reasons. First, they may wish to enforce laws and regulations; for example, enforcing capital flight restrictions by identifying users purchasing foreign goods or exchanging Bitcoin into foreign currencies. They might also use a deanonymization attack for ideological (or political) ends: to publicly reveal malfeasance by subversives or political opponents or simply to demonstrate the superiority of centralized control as an ideology and discourage enthusiasm for decentralized systems.
We identify four attacks that China could use to deanonymize specific users.
First, they could use known research techniques to \textit{(a)} heuristically cluster pseudonymous identities (e.g., connect multiple addresses to the same user)~\cite{Meiklejohn13,Ron13}.
The simplest example of such a heuristic is to cluster addresses that appear as multiple inputs to the same transaction, as they presumably belong to the same user.
The only required capabilities are access to the blockchain and marginal compute power to run the analytics, so these attacks are not unique to China; virtually anyone could commit them.
Where China has an advantage over typical adversaries is in linking these pseudonyms to IP addresses. One approach would be to covertly \textit{(b)} monitor Bitcoin network traffic and identify which IP addresses transactions originate from~\cite{Biryukov14,Koshy14}.
Because Bitcoin traffic is unencrypted, this can be done through deep packet inspection (DPI).
China could also use \textit{(c)} coercion or regulation to covertly compel service providers that deal in Bitcoin, such as merchants or exchanges, to identify their users.
Further, it has been shown that when Bitcoin is used for online purchases, enough information is leaked to web trackers that they can uniquely identify the transaction on the blockchain and link it to any identifying information provided by the purchaser~\cite{Goldfeder17}. China could covertly \textit{(d)} intercept this tracking information over the Internet (using DPI) to perform the same attack, compel domestic tracking companies to provide the information (also covertly), or inject their own trackers into Internet traffic to collect similar information themselves. Tracker injection could be detected by anyone specifically monitoring Internet traffic for such attacks, so we note that it would be overt.
Finally, China could target users directly using \textit{(e)} coercion or regulation to compel them to deanonymize themselves or their transaction partners. Again, as long as targets are compelled to keep quiet about orders to reveal information, this attack is covert.
\begin{raggedleft}
\textbf{Undermine consensus and destabilize Bitcoin:}
Nakamoto consensus maintains a consistent and irreversible ordering of approved transactions, which is essential for Bitcoin to be usable as a means of transacting and for distributing mining rewards fairly.
Thus, both users and miners are heavily invested in keeping consensus strong.
\end{raggedleft}
When consensus is weak, there is disagreement about the set or ordering of accepted transactions, which is destabilizing to the whole system.
It causes forks to occur more frequently as nodes with different views of the blockchain resolve their conflicts and introduces the opportunity for a \textit{double-spend attack}, in which an attacker spends the same coins in two different transactions.
A successful double-spend would be catastrophic as users would no longer have confidence that accepted transactions were truly irreversible.
Thus, any weakening of Bitcoin consensus would be destabilizing and could cause the eventual destruction or abandonment of Bitcoin.
This means that the goals China could achieve by such an attack are limited: destabilizing or destroying Bitcoin could only make an ideological statement (demonstrating the futility of decentralized paradigms) or serve as an attack on institutions that rely on Bitcoin.
We begin by discussing the different ways China could execute a double-spend.
Typically, in these attacks the first transaction ($T_1$) is used to make a purchase from a merchant, and once the purchase is fulfilled, the second transaction ($T_2$) sends the coins to an address controlled by the attacker.
If the merchant sees a block containing $T_1$ and immediately confirms it, the attacker can quickly issue $T_2$ and hope that it gets included into a block that miners then continue to mine off of, orphaning $T_1$'s block.
This is a type of double-spend called a \textit{(a)} \textit{race attack}, and to pull it off, China would apply their hash power to find both blocks quickly and their well-connectedness within the Bitcoin network to quickly propagate those blocks.
To mitigate the risk of double-spends, merchants are encouraged to wait for a number of additional blocks to be found before accepting any transaction.
This is called \textit{$n$-confirmation}, where $n$ is the number of blocks that the merchant waits.
Techniques exist to perform double-spends even against n-confirmation merchants.
One example is a \textit{(b)} \textit{Finney attack}, where a miner with significant hash power finds separate blocks containing $T_2$ and $T_1$, broadcasts only the second, then later broadcasts the first after the merchant has completed the purchase. Other miners must pick up on the $T_2$ block for it to win the forking race, but the attacker can also privately mine a chain containing $T_2$ and only publish it after it reaches length $n$ (a \textit{(c)} \textit{brute force attack}). An attacker with close to 51\% hash power can succeed with these attacks probabilistically, increasing their odds if they also have an advantage in quickly propagating blocks as Chinese miners do.
Finding multiple consecutive blocks more quickly than the rest of the network requires a significant share of the hash rate.
Because China also has the ability to tamper with network traffic, they can pull off a double spend with a lower threshold for hash power using a \textit{(d)} \textit{balance attack}~\cite{Natoli16}.
Here, China would disrupt communication between two mining groups, then issue $T_1$ to one group ($G_1$) and $T_2$ to the other group ($G_2$).
Each group would be building a valid chain containing their respective transaction, and after some time China would dedicate their hash power to $G_2$, outpacing $G_1$ and invalidating $T_1$.
Using the GFW to disrupt cross-border Bitcoin traffic would allow China to execute this attack against foreign merchants by setting $G_1$ to be miners outside of the GFW and $G_2$ to be domestic miners.
With a majority share of the hash rate, China could execute a \textit{(e)} \textit{Goldfinger attack} in which they apply their hash power to arbitrarily control the system.
According to the analysis of Kroll et al. in \cite{Kroll13}, Bitcoin can only survive such an attack if the remainder of the miners are willing to pay a cost greater than what China is willing to pay to pull off the attack.
Because other Bitcoin miners are loosely organized and China can bring massive resources to bear, the most likely scenario is a death spiral in which China can credibly threaten a Goldfinger attack and rational miners will be scared off, thus destroying Bitcoin.
Finally, China could use a more subtle attack to weaken Bitcoin consensus: \textit{(f)} \textit{selfish mining} (also known as \textit{block discarding}).
A selfish miner keeps found blocks secret until they find enough consecutive blocks to outpace (or match the length of) the public chain.
They sacrifice revenue to do so, but can reduce others' revenue even more, incentivizing those miners to join the selfish coalition and increase the attacker's power to execute other destabilizing attacks.
\footnote{Eyal et al.~\cite{Eyal13} showed that if 50\% of the network mines on the attacker's chain, the attacker only needs 25\% of the network hash power to succeed.}
This attack is overt as it produces an noticable signature of forks in the blockchain.
All of these attacks can be made easier using the eclipse attack discussed above.
By targeting miners with significant hash power and controlling which transactions they see, China could prevent them from contributing their hash power to forks that China is trying to orphan.
According to Heilman et al.~\cite{Heilman15}, this permits a Goldfinger attack to be achieved with only 40\% of the network hash power, and it similarly lowers the threshold for the other forking-based destabilization attacks we have described.
\begin{raggedleft}
\textbf{Disrupt competing miners:}
In addition to targeting Bitcoin users, China can attack other mining pools in order to consolidate their control over Bitcoin and make other attacks easier.
The \textit{(a)} selfish mining strategy described above is one way to achieve this goal; as miners losing profits join the more profitable Chinese-controlled pools, they also enter China's zone of control.
\cite{Conti17} outlines a number of more direct attacks on competing mining pools, and in this section we highlight two that China is capable of.
\end{raggedleft}
In both attacks, China could direct their hash power to pose as mining participants in other pools and then undermine those pools.
The simplest version is a \textit{(b)} \textit{block withholding} attack, where Chinese miners submit partial proofs-of-work (PPoWs) but do not submit full blocks when they find them \cite{rosenfeld2011analysis}.
This may not arouse suspicion because the probabilistic nature of mining means that it is reasonable that a given miner finds many PPoWs but no full blocks, but the mining pool will be missing out on block rewards. This may cause that pool's miners to abandon mining or switch to a more profitable (possibly Chinese-controlled) pool.
The other possibility is that Chinese miners posing as contributors to a foreign pool could wait to submit a found block until a miner outside the pool broadcasts one, creating a fork.
In the paper describing this \textit{(c)} \textit{fork after withholding} attack, Kwon et al.~\cite{kwon17beselfish} show that it is profitable for the attacker, thus reducing other miners' profits by the zero-sum nature of Bitcoin mining.
Both attacks have low hash power requirements to deploy, but their success rate improves substantially with increased hash power \cite{rosenfeld2011analysis}.
They can be covert over short periods, but over time produce visible signatures, making them overt over long periods.
\footnote{The attacks themselves reveal little information to the victim mining pool, but the change in mining patterns of the Chinese pools may be noticeable; for example, if a particular mining pool is receiving disproportionately fewer full blocks compared to the number of discovered blocks and observed Chinese mining hash power dedicated to mining on the Bitcoin network is decreasing, an observer can infer that Chinese mining pools are dedicating resources to mining pool attacks.}
\section{Bitcoin}
\label{sec:bitcoin}
Bitcoin is a distributed ledger that tracks payments in a digital currency.
Whereas traditional currencies and payment systems rely on monolithic financial institutions to control supply and mediate transactions, Bitcoin distributes those responsibilities among a set of peers called miners who are rewarded for their efforts by receiving payouts in the currency.
This approach
diffuses trust, allowing users to place small amounts of trust in many different parties rather than all of their trust in a single entity.
\subsection{Technical overview}
\label{subsec:bitcoin-technical-overview}
As outlined in \cite{Bonneau15}, Bitcoin consists of three components: transactions transferring ownership of coins, the consensus protocol, and the communications network.
\begin{raggedleft}
\textbf{Transactions:}
Bitcoin transactions are protocol messages that transfer currency called bitcoins (abbreviated BTC) from one user to another.
Each user is represented by a public/private key pair, and the hash of the public key serves as an address that can be associated with transaction inputs and outputs.
By creating a new transaction, a user can claim bitcoins output from a prior transaction if they prove ownership of the corresponding private key.
\end{raggedleft}
\begin{raggedleft}
\textbf{Consensus protocol:}
In order to maintain consensus, transactions are organized into a shared public ledger, implemented as a series of blocks.
Each block contains a set of transactions, a timestamp, an arbitrary number called a nonce, a hash of the previous block, and some other protocol information.
Storing the previous hash means that each block is cryptographically linked to its predecessor, creating the blockchain data structure.
Integrity is preserved through the blockchain since any alteration to an earlier block will cause its hash to change and therefore `break' the chain.
\end{raggedleft}
Miners collect transactions, check their validity, organize them into blocks and publish them to the network.
They are rewarded for the effort of creating blocks by a special transaction in each block that sends a quantity of bitcoins to an address of the miner's choosing.
This is called the block reward, and it is the only means by which new bitcoins are created.
To determine which block is next in the chain to maintain global consensus, Bitcoin uses a computational puzzle called \textit{Proof of Work}.
A valid block is defined as one whose double SHA256 hash is below a target threshold value.
Miners fix all of the fields of the block except for the nonce, then randomly guess different nonces until a valid block is found.
If multiple valid next blocks are mined, a fork occurs and other miners must choose which branch to mine off of.
To resolve forks, miners simply mine from the longest branch.
Typically miners collaborate in groups called mining pools.
Pool members submit partial proofs-of-work (PPoWs), which are blocks that hash to a value close to the target but are not actually valid.
PPoWs serve to measure the amount of work that a miner has been conducting in the effort to find a block.
They are sent to a pool manager who allocates rewards to members in proportion to the computational work they performed.
\begin{raggedleft}
\textbf{Communication network:}
Bitcoin nodes use a peer-to-peer broadcast network to announce and propagate transactions and blocks.
Nodes in the communications network follow a set of rules to enhance performance and support the consensus protocol; for example, they will only forward new data once to prevent infinite propagation and will only relay valid data to prevent invalid blocks or transactions from being spread on the network.
\end{raggedleft}
The communication network's performance and degree of centralization have an effect on the consensus protocol.
With respect to performance, high latency between nodes can cause temporary forks which in turn cause instability.
With respect to centralization, centralized control of nodes or the connections between them can affect the fairness of the protocol.
For example, if a miner controls enough of the nodes, they can favor their own blocks to win the forks and earn the block reward.
Similarly, if anyone is able to censor the network, they can prevent blocks and transactions from spreading.
Thus, to ensure stability and fairness, Bitcoin requires a low latency, decentralized, uncensorable network.
\begin{raggedleft}
\textbf{Usage of Bitcoin:}
In practice, some people use Bitcoin as a store of value, but it is mostly used as a speculative investment asset.
It remains largely divorced from existing monetary systems, although in some places it has gained a foothold.
In countries experiencing high degrees of inflation, Bitcoin and other cryptocurrencies gain popularity because they do not rely on the country's financial infrastructure and their value cannot be manipulated by the government.
In Venezuela, for example, some citizens have converted rapidly inflating Bolivars into Bitcoin to store value or purchase goods online, and mining has become increasingly common as a source of income~\cite{Torpey18}.
Similar trends have been observed when similar economic conditions have occurred in Greece, Zimbabwe, and Ukraine~\cite{Armario17}.
In the US, investment banks have begun to tentatively embrace Bitcoin, with Goldman Sachs leading the way by first facilitating Bitcoin trading on other platforms and soon offering its own Bitcoin derivative products to clients~\cite{Popper18}.
\end{raggedleft}
\section{Bitcoin in China}
\label{sec:china}
Bitcoin's rise in China began in 2013. In the following years, Chinese exchanges grew to dominate the global exchange market, as shown by the relative share of Bitcoin exchange transactions executed in Chinese Yuan (CNY) versus other currencies (Figure~\ref{fig:chinaexchange}). Mining pools managed by individuals in China have constituted over half of the total network hash power since 2015 (Figure~\ref{fig:hashpower}) and currently more hash power is located in China than in any other country~\cite{Hileman17}.
Through this time, China's official position on Bitcoin remained ambiguous and regulators proved unwilling to institute tight controls despite expressing concerns over criminal activity, subversion of capital controls, and speculative risk. This tenuous equilibrium between demand by Chinese users and investors and intermittent regulatory impedance shaped Bitcoin's global trajectory until it was punctured in 2017 by firm regulations on the exchange industry. Appendix 1 provides a more detailed discussion of the Bitcoin exchange and mining sectors in China over this period. In this section, we identify how China's dominant position in the Bitcoin ecosystem and tight control over domestic economic and technical resources grant them capabilities to influence Bitcoin.
\begin{figure}[t]
\label{fig:china}
\centering
\subfloat[][]{
\includegraphics[width=0.49\textwidth]{cny_vs_all_13_18.png}
\label{fig:chinaexchange}
}
\subfloat[][]{
\includegraphics[width=0.49\textwidth]{china_hash_power_since_2015.png}
\label{fig:hashpower}
}
\caption[]{
(a) Percentage of global bitcoin exchange volume processed in CNY from 2013-2018, using data from \cite{bitcoinityExchange}.
(b) Percentage of total Bitcoin hash power controlled by pools managed within China\protect\footnotemark, using data from \cite{BTChashrate}.
}
\end{figure}
\footnotetext{We attribute the following pools to Chinese managers: AntPool, Bixin, BTCC, BTC.com, BTC.TOP, BW.COM, DPOOL, F2Pool, Poolin, ViaBTC, and 58COIN.}
\begin{flushleft}
\textbf{Regulatory authority:}
The Chinese government enjoys broad regulatory authority that it can bring to bear on domestic Bitcoin users, exchanges, and miners. Regulators have issued policy decrees to directly influence the exchange and mining sectors and also targeted Bitcoin indirectly through externalities like energy prices (see Appendix 1 for details).
\end{flushleft}
\begin{flushleft}
\textbf{Internet traffic tampering and surveillance:}
China operates a variety of Internet control measures that can affect Bitcoin traffic. The most well-understood system is the Great Firewall (GFW), which performs on-path surveillance and traffic filtering using deep packet inspection (DPI) and active probing of connection endpoints~\cite{ensafi2015analyzing}. As an on-path tool, the GFW can observe network traffic and inject new packets but it cannot prevent packets that have already been sent from reaching their destination. For more active traffic tampering, China operates a separate in-path tool known as the Great Cannon, which can inject malicious code into packets in transit and levy denial-of-service attacks by redirecting traffic to a target host~\cite{Marczak15}. Both of these systems primarily operate on traffic transiting between China and the rest of the world, but central government regulators also control all Internet Service Providers (ISPs) in China, allowing for collection and analysis of domestic traffic.
\end{flushleft}
\begin{flushleft}
\textbf{Hash power:}
At the time of writing, 74\% of the hash power on the Bitcoin network is in Chinese-managed mining pools. Pool miners cannot be directly controlled by China, but the managers are located within China and as such are subject to Chinese authorities. Because managers are responsible for assigning mining jobs and propagating completed blocks, they control the inputs and outputs of their miners, allowing Chinese authorities indirect control over that hash power.
China has more direct control over the hash power physically located in China. This is a significant share of the global hash rate -- more than controlled by any other single country~\cite{Hileman17} -- but the precise quantity is unknown.
\end{flushleft}
\begin{flushleft}
\textbf{Well-connectedness within the Bitcoin network:}
Which blocks reach consensus in Bitcoin depends in part on how quickly they propagate through the network from their source miner to other peers. Blocks found in China are already proximate to a majority share of hash power, so they can reach consensus more quickly than blocks found elsewhere. If the Chinese government assumed control of domestic hash power, this property would grant them an advantage in selecting blocks for the ledger, which is important for some types of attacks (see~\autoref{sec:risks}).
\end{flushleft}
\section{Conclusion}
\label{sec:conclusion}
As the value and economic utility of Bitcoin have grown, so has the incentive to attack it. We singled out China for analysis because they are the most powerful potential adversary to Bitcoin, and we found that they have a variety of salient motives for attacking the system and a number of mature capabilities, both regulatory and technical, to carry out those attacks. As future work, we suggest an analysis of existing solutions to the specific threats China poses to Bitcoin and the identification and mitigation of gaps in those protections.
\newpage
\section{Introduction}
In 2008 Satoshi Nakamoto published the Bitcoin white paper, using cryptography to create the world's first decentralized currency~\cite{Nakamoto09}.
Since its creation, Bitcoin's popularity has grown substantially, reaching a market capitalization of over \$100 billion USD as it continues to attract interest from technology enthusiasts, black markets, and legitimate markets~\cite{blocksci-market-cap}.
Despite this popularity, the security of Bitcoin is still not fully understood. Many serious attacks have been theorized by researchers but have not yet come to pass, leading to the adage ``Bitcoin is secure in practice but not in theory.'' Some analyses approach this strange characterization of Bitcoin by saying that the security model of Bitcoin must consider the socioeconomic and political forces in addition to the underlying cryptography~\cite{Bonneau15,bonneau2018hostile}.
The decentralized nature of Bitcoin presents unique socioeconomic and political challenges. Operation and maintenance tasks are distributed across a massive number of peers called miners, and because there is no central governing structure, these miners are kept honest by a carefully balanced incentive scheme. The system is designed so that anyone can contribute by devoting some computing power to mining, but over the last several years, Bitcoin mining has become heavily centralized due to advances in specialized hardware that render commodity hardware obsolete. As a result, miners have congregated into mining pools: consortia of miners who work together and share profits.
As of June 2018, over 80\% of Bitcoin mining is performed by six mining pools~\cite{blocksci-hashrate-distribution}, and five of those six pools are managed by individuals or organizations located in China.
One broadly understood security property of Bitcoin is that no single party can control more than 50\% of the hash rate, so this statistic is worrying. The Chinese government exerts strong, centralized control over economic and financial activity and also operates extensive surveillance and censorship regimes over the domestic Internet. These capabilities do not grant them direct command of all of the hash power in Chinese-managed pools, but they do have a variety of tools at their disposal to influence those pools and Bitcoin in general. They have deployed multiple rounds of restrictive regulations that have upended global and domestic Bitcoin markets, and as we show in \autoref{sec:technical-interference}, Chinese Internet surveillance has affected transaction throughput.
This interest and activity in Bitcoin by China raises many questions. Where does China actually stand on Bitcoin? Do they have motivations to influence Bitcoin globally, and have they succeeded in doing so in the past? What capabilities do they have to influence Bitcoin?
\textbf{Contributions:} In this paper, we explore whether and how China threatens the security, stability, and viability of Bitcoin through its position in the Bitcoin ecosystem, political and economic control over domestic activity, and technical control over its domestic Internet infrastructure.
We find that China has motivations to threaten Bitcoin and has influenced it through domestic regulatory and technical measures. We also show that China has a number of mature capabilities for executing a variety of attacks. We enumerate and classify the attacks that China can execute and what goals that they would achieve. Finally, we outline directions for future research, including additional dimensions of analysis and surveying potential mitigations to the threat China poses.
\textbf{Organization:}
The paper is organized as follows. \autoref{sec:bitcoin} summarizes the design and operation of Bitcoin. \autoref{sec:china} briefly summarizes China's relationship with Bitcoin and the technical and non-technical capabilities China could bring to bear on Bitcoin. \autoref{sec:technical-interference} presents an analysis of how China's Internet censorship limited throughput for Bitcoin as a whole, demonstrating a link between Chinese domestic policy and the global stability of Bitcoin. \autoref{sec:risks} systematizes the risk that China poses to the Bitcoin ecosystem. Finally, \autoref{sec:conclusion} concludes and outlines directions for future work.
| {'timestamp': '2018-10-08T02:04:22', 'yymm': '1810', 'arxiv_id': '1810.02466', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02466'} | arxiv |
\section{Introduction}
\IEEEPARstart{D}{igital} satellite data with different spatial and spectral resolution are available for almost every locality on the Earth's land surface \cite{ElJanati2014,Thenkabail2015,VanderWerff2016,Hewson2017,DosReisSalles2017}. This enables the procurement of detailed information from surficial features and processes at different scales. Linear features are considered as one of the most important surficial features in different fields of study \cite{Hao2007,He2008,Pirasteh2013}. A linear feature is a two-dimensional, straight or slightly curved line, linear pattern or alignment of discontinuous patterns evident in an image, photo or map \cite{Wang1993}. Linear features represent the expression of some degree of linearity of a single or diverse grouping of both natural and cultural features \cite{Wang1993,Simonett1983}. Their specific physiographic characteristics make it possible to detect them due to the tonal change in digital satellite data \cite{Hashim2013}. Natural features include any linear features formed by natural processes such as geological lineaments, drainage networks, and vegetation alignments. Cultural features comprise man-made features such as road networks, railroads, and power line corridors \cite{Wang1993}.\\
The identification of linear features in remote sensing imagery can be complex since their spatial and spectral characteristics vary along their extent \cite{Wang1993}. A variety of techniques have emerged for extracting linear features from digital satellite data for different applications such as detecting road networks \cite{Valero2010,Singh2013}, stream networks \cite{Martinez2009,Paiva2015}, and geological lineaments \cite{Hashim2013,Marghany2010}. Geological lineaments are an expression of the underlying geological structure and include faults, dykes, shear zones and folds. Linear to curvilinear faults, dykes and shear zones are of particular interest in assisting mineral prospecting because of their association with hydrothermal mineralization \cite{BeiranvandPour2015,BeiranvandPour2016,Manuel2017} but their applications also extend to hydrogeological \cite{Bhuiyan2015,Dasho2017,Akinluyi2018,Takorabt2018} and tectonic studies \cite{Arian2015,Daryani2015,Masoud2017}. Faults, dykes and shear zones may be used to delineate major structural units, analyze of structural deformation patterns, and identify geological boundaries and uncover mineral deposits \cite{Glasser2009,Saadi2009,Raharimahefa2009,Ramli2010,BeiranvandPour2014}. Mineral deposits are commonly clustered around specific positions along deep crustal structures, which often have surface expressions in the absence of sedimentary or regolith cover \cite{Lund2011,Hein2013}. Understanding the structural mechanisms for hydrothermal ore deposits along deep crustal discontinuities are pivotal in terms of economic considerations but are still in dispute. Some researchers posit that fault bends are the primary control for ore clusters, while others believe that fault intersections are most important \cite{Lu2016}. Although, both cases are sometimes important in formation of hydrothermal ore deposits. Irrespective of the mechanism, detecting geological lineaments can help link surface lineament expressions to deep-seated structural discontinuities, which ultimately aids in mineral prospectivity mapping.\\
Although manual interpretation is effective at identifying geological lineaments \cite{Saadi2008,Saad2011}, computer vision techniques are required to make this process efficient. Computer vision is an interdisciplinary field that employs a wide range of algorithms for gaining a high-level understanding from digital images or videos. In other words, it seeks to automate tasks akin to what the human visual system can accomplish \cite{Ballard1982,Sonka2014}. Computer vision is concerned with automatic extraction, analysis and understanding of useful information from a single image or a sequence of images. It involves the development of a theoretical and algorithmic basis to achieve automatic visual understanding \cite{Szeliski2010}. Some of the applications of computer vision include systems for automatic inspection, detecting events, modelling objects and organizing information \cite{Szeliski2010}. In the geosciences, computer vision has diverse applications including surface modelling \cite{James2012}, rock type classification \cite{Patel2016}, motion analysis \cite{Gutierrez2002}, edge detection and extracting linear features from digital imagery \cite{Cross1988}.\\
The use of computer vision and satellite images to map geological lineaments has been particularly useful in regional scale studies that are inaccessible, unsafe or costly to navigate \cite{Karnieli1996,Shahzad2011}. Traditionally, lineament mapping is based on a visual or manual photointerpretation. Manual digitizing of lineaments is subjective, time consuming and expensive \cite{Rahnama2014a}. Therefore, a reliable and standard framework consisting of available computer vision techniques is needed. This framework must be able to work with different satellite images representing different spatial and spectral resolutions. The success of geological lineament extraction procedures depends on the sequence of applied techniques, and the reliability and accuracy of the edge detection and line extraction mechanisms \cite{Karantzalos2006}. Selection of computer vision techniques, appropriate edge detection methods and line extraction methods are pivotal in tectonic linear feature extraction because they exert significant influence on the accuracy of the final results.\\
In this study, we present a framework for detecting geological lineaments using computer vision techniques that include edge detection and line extraction methods. To demonstrate the validity of this framework, we use Landsat 8 satellite data and Shuttle Radar Topography Mission (SRTM) digital elevation models for extracting geological lineaments of the Yinnetharra 1:100,000 map sheet located in the Capricorn Orogen, Western Australia. Satellite data are subjected to dimensionality reduction, noise removal and lineament enhancement prior to edge detection and line extraction algorithms. The extracted geological lineaments are compared to our manual photointerpretation and geological mapping by the Geological Survey of Western Australia \cite{Johnson2012}. We also investigate the correlation between extracted geological lineaments and known mineral occurrences in the study area. The final product of our workflow is an efficient evidential data layer for detecting hydrothermal mineral deposits.\\
The rest of this paper is organized as follows. In section 2, geological setting of the study area is investigated. Section 3 reviews different computer vision techniques which have been applied in this study. Then, materials and the proposed framework for extracting geological lineaments are described in section 4. Results of applying the proposed framework are reported in section 5. The evaluation and limitations of the proposed framework are discussed in section 6. Finally, Section 7 concludes the paper with a summary of the future works.
\section{Geological setting of the study area}
The Yinnetharra 1:100,000 map sheet is situated within the western portion of the Capricorn Orogen, known as the Gascoyne Province (Fig. \ref{figure01}) \cite{Johnson2013}. The Gascoyne Province, and the wider Capricorn Orogen, record the protracted amalgamation of the West Australian Craton and subsequent intracontinental tectono-thermal activity. Two main events have been found to contribute to forming the West Australian Craton. First, the ca. 2195--2145 Ma Ophthalmia Orogeny sutured the Glenburgh Terrane (comprised of the Halfway Gneiss) to the Pilbara Craton \cite{Rasmussen2005,Krapez2017}. The Opthalmia Orogeny was associated with the deposition of the Moogie Metamorphics, which was deposited into a foreland basin that formed as a response to the Glenburgh--Pilbara collision \cite{Johnson2013}. Second, the ca. 2005--1950 Ma Glenburgh Orogeny amalgamated the combined Pilbara Craton--Glenburgh Terrane with the Yilgarn Craton to form the West Australian Craton \cite{Johnson2013,Olierook2018}. The Glenburgh Orogeny was associated with two major Andean-type granitoid formations, the Dalgaringa and Bertibubba Supersuites, and several subduction-related basins \cite{Olierook2018,Johnson2011}. After unification, the Capricorn Orogen experienced at least five intracontinental tectono-magmatic events, each decreasing in severity of tectonic character and magmatism \cite{Johnson2017}. The first two events, the 1830--1780 Ma Capricorn Orogeny and 1680--1620 Ma Mangaroon Orogeny, were both associated with significant granitoid magmatism of the Moorarie and Durlacher Supersuites, respectively \cite{Sheppard2005,Sheppard2010}. Later events were predominantly amagmatic but were still associated with up to amphibolite-facies metamorphism and hydrothermal activity \cite{Sheppard2007,Korhonen2017}.\\
Both suturing and intracontinental tectonic events have developed a pervasive east--west striking structural fabric in the Gascoyne Province that has compartmentalized the region into several geological \lq{zones}\rq{} that share tectonic characteristics \cite{Sheppard2010}. In the south, zone and formation boundaries trend SW--NE whereas major structures are oriented NW--SE in the north, yielding a wedge-shaped geometry for the western margin of the Capricorn Orogen (Fig. \ref{figure01}). Compared to the rest of the Capricorn Orogen, the Gascoyne Province is relatively well exposed, but there are still significant regions of recent cover that hamper mineral exploration. Known precious and base metal mineralization predominantly occur along and are associated with structural discontinuities \cite{Johnson2013}. A crucial aspect to the mineralization potential in the Capricorn Orogen is the repeated reactivation of major structures over a billion years, which allows mineralization to be upgraded to economic scales \cite{Pirajno2004,Zi2015}.
\begin{figure*}
\centering
\includegraphics[width=\linewidth]{01.png}
\caption{a) Map of the Capricorn Orogen showing the tectonic units and study area; b) simplified geological map of Yinnetharra 1:100,000 map sheet.}
\label{figure01}
\end{figure*}
\section{Computer vision techniques}
\subsection{Dimension reduction}
Dimension reduction is a machine learning method that reduces a set of random variables by obtaining a set of principle variables \cite{Zhang2010,Lafon2006}. Dimension reduction techniques can be divided into transformation methods (feature extraction) and feature selection methods \cite{Huang2007}. Transformation methods, such as Principal Component Analysis (PCA), Independent Component Analysis (ICA) and Minimum Noise Fraction (MNF), can separate significant and insignificant parts of the data in addition to reducing data dimensionality. Dimension reduction techniques are initially used to compress available information stored in multiple bands into a few bands. In other words, a multispectral image is converted into a greyscale image preserving maximum information. This technique can also be applied for different purposes such as statistical analysis and classification \cite{Lafon2006}.
\subsubsection{Principal component analysis}
Principal component analysis is an exploratory analysis method which aims to find a set of linearly uncorrelated components (principal components) which could serve as projections from the original data. The first principal component has the largest possible variance, and each succeeding component in turn has the next highest variance possible under the constraint that it must be orthogonal to the preceding components. The mathematical model of the PCA can be expressed as \cite{Yang2015}:
\begin{equation}
\label{equation01}
z = Px
\end{equation}
where $x$ is a vector consisting of $n$ rows of random variables $x_{1}$, $x_{2}$,..., $x_{n}$, each $x_{i}$ giving a particular datum that has zero mean, $P$ is the $n \times n$ standardized orthogonal transformation matrix or projection square matrix in which each projection vector (row vector) is constrained to be a unit vector, $z$ is a vector consisting of $n$ rows of random variables $z_{1}$, $z_{2}$,..., $z_{n}$ projected by $P$ from $x$.\\
Principal component analysis is one of the techniques that is applied to transform remote sensing data in order to reveal the most important features of an image \cite{Singh1985,Mackiewicz1993}. It is a technique for extracting a smaller set of variables with less redundancy from high-dimensional data sets in order to retain as much of the information as possible \cite{Eklundh1993,Liu2009}. Principal component analysis allows the determination of linear combinations of variables, feature extraction, dimension reduction, multidimensional data visualization and underlying variable identification \cite{Richards2013}. The principal components are a projection of the data onto principal axes, known as eigenvectors. A small number of principal components is often sufficient to account for the majority of the variance in the data \cite{Hall1997,Tobin2007}.
\subsubsection{Independent component analysis}
An alternative method for source separation is independent component analysis \cite{Comon1994,Hyvarinen1999,Ghahramani2004}. Unlike PCA, this method both decorrelates input signals and also reduces higher-order statistical dependencies \cite{Lee1998,Hyvarinen1999a}. Independent component analysis is a well-established statistical signal/data processing technique that aims at decomposing a set of multivariate signals into a base of statistically independent data-vectors with minimal loss of information \cite{Fiori2003,Ji2014}. Independent component analysis reveals hidden factors that underlie sets of random variables, measurements, or signals and it attempts to make the separated signals as independent as possible.\\
Independent component analysis has a wide range of applications in the field of signal processing, although it has been less considered as a common technique in image processing \cite{Benlin2008}. It is thought that lack of both comprehensive understanding of the ICA principle, and proper procedures to interpret the results generated by the ICA, can be one of the main reasons that ICA is under used in the geosciences, especially for multi- or hyper-spectral image processing. ICA is a special case of blind source separation that aims to separate source signals from mixture signals with or without little prior information about the source signals or the mixing process \cite{Cardoso1998}. The mixture model can be given by \cite{Yang2015}:
\begin{equation}
\label{equation02}
x = As
\end{equation}
where $x$ is a vector consisting of received mixture signals, $s$ is a vector that contains unknown source signals, and $A$ is an unknown full rank and invertible mixing matrix. In blind source separation models, the possible distribution of each source is unknown and we are not interested in, and do not have prior information about, any source. However, the lack of prior knowledge about the mixture is compensated for by a statistically strong and often physically plausible assumption of statistical independence between the source signals \cite{Cardoso1998}. This assumption provides a possible solution: finding some signals that are independent from each other which can be mixed to reproduce the observed signals. Therefore, the aim of ICA is to find a set of uncorrelated components as independent as possible from each other. Accordingly, the decomposition model can be given as \cite{Yang2015}:
\begin{equation}
\label{equation03}
s = Wx = WAs
\end{equation}
where $W$ is the unknown unmixing square matrix to be determined. For simplification of the model without loss of generality, the independent components and the mixture signals are always assumed to have zero mean and unit variance. This assumption yields that there is no variance ranking of the independent components. Via various estimators of independence, there are many mature algorithms available for implementing ICA. In this study, the Fast ICA, a fixed-point algorithm that uses an approximation of negentropy as measurement of independence, is chosen for data processing due to its computing efficiency, flexible parameters and robustness \cite{Hyvarinen1999a}.
\subsubsection{Minimum noise fraction}
Minimum noise fraction is similar to the PCA transform and is an effective technique for reducing a large multi-dimensional data set into a fewer number of components that contain the majority of information \cite{Green1988}. Unlike a PCA transform, the resulting axes or components are not necessarily orthogonal, but are ordered by decreasing signal-to-noise ratio. Moreover, MNF is applied to isolate noise from signal in a dataset and to determine inherent dimensionality of an image. Minimum noise fraction is also able to reduce computational requirements for subsequent processing \cite{Boardman1994}.\\
The MNF transform implemented in this study involves two cascaded PCA transformations. The first transformation, based on an estimated noise covariance matrix, decorrelates and rescales the noise in the data. The second step is a standard PCA transformation of the noise-reduced data. There can be as many components as there are input bands; however, each component, starting from the first, describes less and less of the overall variance of the data set. Typically, only a small number of components are required to describe most of the information for the entire data set. The contribution of each component to the overall information in a multivariate data set (i.e., multispectral or hyperspectral imagery) is measured by an eigenvalue. A larger eigenvalue indicates that a component contains more information from the data set. The contribution of each band to each component is measured by an eigenvector, which can be interpreted akin to a correlation coefficient. Unlike a PCA transform, the resulting axes (components) are not necessarily orthogonal but are ordered by decreasing signal-to-noise ratio \cite{Harris2005}.
\subsection{Image enhancement}
The image enhancement techniques are applied to increase the quality of image interpretation based on enhancing edges of features prior to their detection and extraction. Different types of filtering such as adaptive and convolutional filtering are part of this suite of techniques.\\
Adaptive filtering uses the standard deviation of those pixels within a local box surrounding each pixel to calculate a new pixel value. Typically, the original pixel value is replaced with a new value calculated based on the surrounding valid pixels which satisfy the standard deviation criteria \cite{Crow2008}. The adaptive filters are particularly adept at preserving image sharpness and detail while suppressing noise. Lee filter is an adaptive filter which is used to smooth noisy and speckled data that have an intensity related to the image scene and that also have an additive and/or multiplicative component \cite{Lee1980}.\\
Convolutional filters yield images in which brightness value at a given pixel is a function of weighted average of surrounding pixels' brightness. Convolution of a user-selected kernel with the image array returns a new, spatially filtered image. Different kernel size and values produce different types of filters. Standard convolutional filters include high pass, low pass, Laplacian, directional, median, Sobel and Roberts \cite{Richards2013,Haralick1987}. In the proposed framework for extracting geological lineaments, we have applied median and compared directional and Laplacian filters. A median filter is applied for smoothing the image, while preserving edges larger than the kernel dimensions and also to remove speckling noise \cite{Chan2005}. This low frequency filter replaces each center pixel with the median value within the neighborhood specified by the filter size \cite{Haralick1987}. A directional filter is a first derivative edge enhancement filter that selectively enhances image features having specific direction components (gradients) \cite{Zhang2006a}. The sum of the directional filter kernel elements is zero. The result is that areas with uniform pixel values are zeroed in the output image, while those that are variable are presented as bright edges. A Laplacian filter is a second derivative edge enhancement filter that operates without regard to edge direction \cite{Lee1990}. Laplacian filtering emphasizes maximum values within the image using a kernel with a high central value typically surrounded by negative weights in north--south and east--west directions and zero values at the kernel corners \cite{Haralick1987}.
\subsection{Lineament extraction}
Linear features can be divided into two major subclasses that include edges and lines on a digital greyscale image. An edge in an image is an abrupt discontinuity in image brightness, which may result from surface boundaries, shadow boundaries or changes in surface reflectance. A line in an image is a digital valley or ridge of image brightness \cite{Wang1993}. Lines may be formed, for example, by roads, rivers, and vegetation alignments, as well as by geological faults and joints. Lineament extraction methods can be conducted via manual photointerpretation by an expert or (semi-)automatic detection using computer vision techniques \cite{Vassilas2002}. The automatic methods have resulted in a more efficient lineament extraction process \cite{Tripathi2000,Masoud2006,Masoud2011}. A lineament extraction process comprises two main steps, namely edge detection and line extraction.
\subsubsection{Edge detection}
In general, automatic lineament extraction methods are based on edge detection techniques that enhance the pixels at the edges on an image, instead of directly extracting edge contours. An edge in an image is defined as a boundary or contour at which a significant change occurs in some physical aspect of the image. Linear operators can detect edges through the use of masks that represent the ideal edge steps in various directions \cite{Ali2001}. They can detect lines and curves in much the same way. Traditional edge detectors were based on a rather small neighborhood, which only examined each pixel's nearest neighbor \cite{Cyganek2003,Awad2008}. This may work well but due to the size of the neighborhood that is being examined, there are limitations to the accuracy of the final edge. These local neighborhoods will only detect local discontinuities, and it is possible that this may cause false edges to be extracted. A more powerful approach is to use a set of first or second difference operators based on neighborhoods having a range of sizes and combine their outputs, so that discontinuities can be detected at various scales \cite{Ballard1982}.\\
Laplace, zero-crossing and gradient operators are the primary edge detection techniques \cite{Ali2001,Patel2011}. Laplace operators compute some quantity related to the divergence of the intensity surface gradient of the greyscale images. Zero-crossing operators determine whether or not the digital Laplacian or the estimated second direction derivative has a zero-crossing within the pixel \cite{Ali2001}. Gradient operators compute some quantity related to the magnitude of the slope of the greyscale image wherein the image pixel values are noisy discretized samples. The major drawback of such an operator is the fact that determining the actual location of the edge and slope turnover point is difficult \cite{Ali2001}. The frequency and connectivity of the extracted edges by common edge detection methods are strongly affected by the type and spatial resolution of the source datasets, signal-to-noise ratio and the parameters of the edge detection methods \cite{Zhang2006}. In other words, results of most edge detection methods involve fragmented edges and should be ultimately interpreted visually.\\
An alternative technique is known as Canny edge detection, which is based on computing the squared gradient magnitude \cite{Canny1986}. Local maxima of the gradient magnitude that are above some threshold are identified as the edges. The advantages of the Canny edge operator are deriving an optimal operator in the sense that minimizes the probability of multiply detecting an edge, minimizing the probability of failing to detect an edge, and minimizing the distance of the reported edge from the true edge. There is a tradeoff between detection and localization; the more accurate the detector the less accurate the localization and vice-versa \cite{Ali2001}. An objective function has been designed to achieve some optimization constraints including maximizing the signal-to-noise ratio to give perfect detection which favors the marking of true positives; achieving perfect localization to accurately mark the edges; minimizing the number of responses to a single edge which favors the identification of true negatives and prevents marking non-edges \cite{Ali2001}.
\subsubsection{Line extraction}
After edge detection, additional processing must be performed in order to remove false edge responses and to link gaps between edges, ultimately turning isolated edges into lines. This processing turns the linearization of the edge pixels into continuous contours, using certain criteria such as closeness or some specific geometric property such as the degree of curvature \cite{Ghita2002}.\\
Edge-linking methods can be classified into two categories, namely local processing methods and global processing methods \cite{Rahnama2014}. In local processing methods such as the Hough transform and gradient-based methods, edge pixels are grouped to form edges by considering each pixel's relationship to any neighboring edge pixels \cite{Ghita2002}. This method is suitable to link edge pixels in situations where the shape of the edge is unknown. The Hough transform is a well-known technique which tolerates noise and discontinuities in an image but it has limitations such as high computing time, unwieldy memory requirements and limited capability in preserving edge pixel connectivity \cite{Hashim2013}. The global processing methods such as pixel connectivity-edge linking use all edge pixels. Pixels displaying similarities such as same edge geometry are used to find the best fit of a known shape. The global methods do not need to connect the edge pixels. However, these methods may miss small pieces of edges or noise pixels may wrongly be handled as edge segments \cite{Yang2011}. The pixel connectivity-edge linking algorithms have been widely used in applications which involve extraction of continuous line segments \cite{Hashim2013}.
\section{Materials and methods}
\subsection{Landsat 8 satellite data}
The Landsat 8 satellite carries two instruments including the Operational Land Imager (OLI) and Thermal Infrared Sensor (TIRS). The OLI comprises nine spectral bands with a spatial resolution of 30 meters for bands 1 to 7 and 9. The resolution for band 8 (panchromatic) is 15 meters. The Thermal Infrared Sensor (TIRS ) provides two thermal bands 10 and 11 that provide more accurate surface temperatures but are less useful for geological purposes \cite{Irons2012,Loveland2012}. These sensors both provide improved signal-to-noise radiometric performance quantized over a 12-bit dynamic range that enables better characterization of land cover state and condition compared to other Landsat satellites \cite{Reuter2010}. Moreover, geological features and the geomorphological framework are more readily distinguished.\\
The cloud-free Landsat 8 OLI level-2 data product (surface reflectance) is used in this study and was obtained from USGS EarthExplorer (\url{https://earthexplorer.usgs.gov}). The considered scene was acquired on 13 February 2018. Surface reflectance products provide an estimate of the surface spectral reflectance as it would be measured at ground level in the absence of atmospheric scattering or absorption \cite{Vermote2016}. The scene was pre-georeferenced to UTM zone 50 south projection with the WGS-84 datum, but all the outputs of this study are provided in GDA-94. Bands 1 and 9 are not used in this study, because they have been designed for retrieving atmospheric aerosol properties and detecting cirrus cloud, respectively \cite{Adiri2016}.
\subsection{Structural geological maps}
Structural geological maps represent the expression of underlying geological structures exposed at the Earth's surface \cite{Lisle2003}. Structural analysis involves the description of the structural geometry of a deformed field area, kinematic analysis and dynamic analysis \cite{Lageson2009}. Descriptive structural analysis is obtained through detailed field mapping, yielding positions, orientations and lengths of linear structures, including faults, dykes and fold axes. No geological map is ever complete but mapping by the Geological Survey of Western Australia (GSWA) at 1:100,000 is an appropriate benchmark for assessing the validity of our final workflow results.
\subsection{Manual photointerpretation}
Photointerpretation can be defined as the dialectic and interdisciplinary integration of personal experience, reasoning, expertise and ground truth \cite{Rokos1995}. In manual photointerpretation, fundamental photo-recognition elements of visual interpretation, as well as their appropriate combinations, are used \cite{Soille2002}. In remote sensing data, manual interpretation is restricted to analyzing only one or three channels of the satellite data at a time. Further, our visual acuity does not allow us to identify all spectral differences in imagery. A human interpreter can only detect and evaluate noticeable differences in the imagery and she/he cannot carry out repeatable interpretation work. The manual approach suffers from its inability to deal quickly with a large quantity of image data. Therefore, visual interpretation of digital imagery provided by remote sensing platforms does not allow full exploitation of the data provided \cite{Lillesand2014}. Nevertheless, manual photointerpretation is another technique that can be used to validate the proposed semi-automated workflow. Thus, we used manual photointerpretation to generate a geological lineament map that can be readily contrasted with the semi-automated extracted lineaments.\\
The simplest way and first step to work with multispectral data such as Landsat 8 is to display them as a False Color Composite (FCC). False color composite images have diverse applications in geological studies such as discriminating textural characteristics of igneous rocks from those of sedimentary rocks. Structural features are readily recognizable by applying a proper RGB color combination of the available bands. Several FCC images can be generated using the OLI bands, but the ones which assist to discriminate different lithological units, alteration zones and structural features are the most important in manual photointerpretation. Therefore, the optimum FCC image plays an important role in prospecting hydrothermal mineral deposits without using computer vision techniques \cite{Liu2013,Mwaniki2015}. There are different statistical methods for determining the best FCC image including optimum index factor, Sheffield index and correlation index \cite{Beauchemin2001}. In this study, the correlation index -- known as the most efficient index -- is applied for determining the best FCC image using the MATLAB code available at \url{https://github.com/intelligent-exploration/IP_MinEx}.
\subsection{Computer vision-based framework for semi-automated extraction of geological lineaments}
A detailed computer vision-based framework for semi-automatic extraction of geological lineaments from optical remote sensing data is presented in Fig. \ref{figure02}. This framework starts with acquiring satellite images (Fig. \ref{figure02}a). According to the level of satellite images, radiometric and geometric corrections are applied (Fig. \ref{figure02}b). To transform satellite images from multiple bands into a greyscale (single-band) image, three dimension reduction techniques are used and compared (PCA, ICA and MNF) using ENVI 5.3 software (Fig. \ref{figure02}c). After image transformation, Lee and median filters (Fig. \ref{figure02}d, e) are applied respectively to the output component of the three dimension reduction techniques with the highest eigenvalue. To enhance edges, directional and Laplacian filters (Fig. \ref{figure02}f) are subsequently applied on greyscale images using ENVI 5.3. The directional filter is applied using a $3 \times 3$ kernel in four directions with azimuths of \ang{0}, \ang{45}, \ang{90} and \ang{135}. Using these azimuths, the directional filter visually enhances the edges striking N--S, NE--SW, E--W and NW--SE, respectively. The Laplacian filter uses a $3 \times 3$ kernel with a value of 4 for the center pixel and values of -1 for the N--S and E--W pixels.\\
Edge detection is performed using a Canny edge detector applied on the final greyscale image (Fig. \ref{figure02}g). Canny edge detection is preferred over Laplace, zero-crossing or gradient operators because it is resistant to a noisy environment and signals can be enhanced with respect to the noise ratio by a non-maxima suppression method which results in one pixel wide ridges as the output. Lines are then extracted from the binary image produced by the Canny edge detection process using pixel connectivity-edge linking (Fig. \ref{figure02}h). Pixel connectivity-edge linking is preferred over Hough transform or gradient based methods because all pixels identified as linear edge pixels are maintained \cite{Guru2004,Vucinic2010}.\\
The edge detection and lineament extraction process relies on setting six different thresholds by the user utilizing PCI Geomatica 2016 software, including filter radius, edge gradient, curve length, line fitting error, angular difference and linking distance (Fig. \ref{figure02}j; Table \ref{table01}). Filter radius and edge gradient threshold are effective for the edge detection and the other thresholds are applied for the line extraction. Several combinations of the thresholds within the proposed ranges in Table \ref{table01} were evaluated and various validation criteria as well as the ground truth were applied to reach the optimum values which gave a satisfactory result. The Canny edge detection and pixel connectivity-edge linking methods are applied separately on every four output images after implementing directional filter (Fig. \ref{figure05}a--\ref{figure05}d) for extracting the lineaments. The extracted lineaments from each image are combined and a comprehensive lineament map which covers major directions is generated.
\begin{table*}
\centering
\resizebox{\linewidth}{!}{%
\begin{tabular}{|c|c|c|c|c|c|}
\hline
Threshold & Unit & Description & Proposed range & Proposed value (directional filter) & Proposed value (Laplacian filter) \\
\hline
Filter radius & Pixel & Filter radius used in the edge detection & 3-–8 & 5 & 5 \\
\hline
Edge gradient & - & Edge gradient value used in the edge detection & 10-–70 & 50 & 10 \\
\hline
Curve length & Pixel & Minimum length of a curve to be taken as a lineament & 10-–50 & 50 & 50 \\
\hline
Line fitting error & Pixel & Tolerance allowed in curve fitting to form a polyline & 2-–5 & 5 & 5 \\
\hline
Angular difference & Degree & Angle not to be exceeded between two polylines to be linked & 3-–20 & 10 & 10 \\
\hline
Linking distance & Pixel & Maximum distance between two polylines to be linked & 10–-50 & 50 & 50 \\
\hline
\end{tabular}}
\caption{Thresholds applied for the edge detection and line extraction in this study \cite{Hashim2013,Adiri2017}.}
\label{table01}
\end{table*}
The filter radius is initially used to determine the number of pixels to be considered around each pixel for applying the Canny edge detector. The edge gradient threshold then specifies the values of pixels to be taken as the edges and those remaining as background. Applying these two steps results in a binary map product. According to the curve length, this binary map undergoes a contour number reduction in order to leave just those referring to curves. In other words, a curve with a number of pixels smaller than that indicated by the threshold will not be taken into consideration. The resulting curves generate polylines if they fall within the tolerance defined by the line fitting error. Finally, two polylines in the simplest case will bind to form a lineament if their two end points form an angle respecting the value specified by the angular difference and the distance by the linking distance \cite{Adiri2017}.\\
According to the spatial resolution of the OLI imagery, streams are the most important cultural linear features which can be mistaken for geological linear features. Here, we used Shuttle Radar Topography Mission (SRTM) data with a spatial resolution of 30 m to delineate streams using the Esri Arc Hydro Tools (Fig. \ref{figure02}m). The map presented in Fig. \ref{figure03}b is applied to convert a lineament map (Fig. \ref{figure02}k) to a geological lineament map with minimal cultural lineaments (Fig. \ref{figure02}l--o). A buffer zone with a radius of 5 pixels (150 m) surrounding the streams is created to prevent errors caused by shifting pixels in SRTM digital elevation model. Lineaments that overlap the buffer zone by more than half their length are removed. Therefore, geological rather than cultural lineaments are more likely to be preserved in the final product (Fig. \ref{figure02}l--o).
\begin{figure}
\centering
\includegraphics[width=\linewidth]{02.png}
\caption{Methodology flowchart of this study for semi-automatic extraction of the geological lineaments. Input data to this flowchart include a digital satellite image (Landsat 8) and a digital elevation model (SRTM).}
\label{figure02}
\end{figure}
\section{Results}
\subsection{Optimum false color composite image}
The application of correlation index identifies RGB 752 as the best FCC image for visually discriminating lithological units and structural features, and manual photointerpretation of the study area (Fig. \ref{figure03}) \cite{Kamel2015,Abdelaziz2018}. Based on the ranking of available FCC images, RGB 753, 652 and 653 are alternatives. According to Fig. \ref{figure03} and extracted geological lineaments using manual photointerpretation, principal structural linear features strike NW--SE with subordinate lineaments striking NE--SW in the Yinnetharra region, akin to the dominant structural trend identified from geological mapping (Fig. \ref{figure01}).
\begin{figure}
\centering
\includegraphics[width=\linewidth]{03.png}
\caption{Extracted geological lineaments using manual photointerpretation draped over false color composite (RGB 752) image of the study area generated by the OLI bands. In this image, different colors imply the presence of different lithological units.}
\label{figure03}
\end{figure}
\subsection{Comparison of dimension reduction transformations}
The output component of the PCA, ICA and MNF with the highest eigenvalue (including polishing using Lee and median filters on each, Fig. \ref{figure02}) yields greyscale images presented in Fig. \ref{figure04}. Geological lineaments are recognizable as dark and bright lines in the three output components (Fig. \ref{figure04}). Pixel values of the PCA and ICA components show negatively skewed distributions, while the MNF component shows a positively skewed distribution. The range of pixel values in the PCA component is much higher than the ICA and MNF components. Comparison of the components shows that dark and bight pixels as two anomalous populations of the pixel value distribution have been better separated in the MNF component.
\begin{figure*}
\centering
\includegraphics[width=\linewidth]{04.png}
\caption{Output components of the a) PCA, b) ICA and c) MNF techniques with the highest eigenvalue. These components have been polished by the Lee and median filters respectively.}
\label{figure04}
\end{figure*}
Comparison of the different dimension reduction techniques with manual photointerpretation shows that the MNF component is more robust than the PCA and ICA components for extracting geological lineaments (Fig. \ref{figure05}). Focusing on a horizontal profile across a small sector in the west of the Yinnetharra map sheet reveals that the number of peaks (i.e., positive anomalous pixels) on the profile obtained from the MNF component correlates well with the intersected geological lineaments identified via manual photointerpretation. The MNF profile shows a relatively uniform background signal with strongly pronounced positive anomalies. In contrast, the graphs obtained from the PCA and ICA components show intense fluctuation across the profile, showing a poorer correlation to the lineaments identified via manual photointerpretation.
\begin{figure*}
\centering
\includegraphics[width=\linewidth]{05.png}
\caption{a) Geological lineament map provided by manual photointerpretation draped over a false Landsat 8 color composite image (RGB 752). The investigated horizontal profile in this map is shown in orange. b–d) The changes of pixel values relevant to the PCA, ICA and MNF components with the highest eigenvalue across the profile, respectively.}
\label{figure05}
\end{figure*}
\subsection{Comparison of directional and Laplacian filters}
Application of directional and Laplacian filters on each of the outputs shown in Fig. \ref{figure04} reveals geological and cultural lineaments (Fig. \ref{figure06}). Streams and other large linear features can be readily identified in filtered images. However, there are some differences between the outputs of applying directional and Laplacian filters in terms of enhancing some of the geological lineaments. For example, the Laplacian filter failed to enhance most of the NW--SE striking geological lineaments located in the southwest of the study area, which are related to high number of hydrothermal mineral deposits. Applying a directional filter in different azimuths enhances geological structures striking in different directions and the results show that it is more robust in enhancing small lineaments compared to the Laplacian filter. Small NE--SW striking lineaments located in the northeast of the study area are probably mafic dykes (Mundine Well Dyke Swarm \cite{Wingate2000}), and these are better enhanced using the directional filter compared to the Laplacian filter (Fig. \ref{figure06}a).
\begin{figure*}
\centering
\includegraphics[width=\linewidth]{06.png}
\caption{Images obtained by applying a) a Laplacian filter and a directional filter in four directions with azimuths of b) \ang{0}, c) \ang{45}, d) \ang{90}, e) \ang{135} on the output component of the MNF technique with the highest eigenvalue.}
\label{figure06}
\end{figure*}
\subsection{Extraction of geological lineaments}
The most recognizable cultural linear features are streams, which may be mistaken for geological linear features (Fig. \ref{figure07}). Removal of streams and their buffer zones yield different geological lineament maps for directional and Laplacian filters (Fig. \ref{figure08}). To aid visualization and validation, a lineament density map is produced for each of the filters as well as the manual photointerpretation and GSWA lineament maps to analyze the dispersion pattern of the lineaments (Fig. \ref{figure08}).
\begin{figure}
\centering
\includegraphics[width=\linewidth]{07.png}
\caption{Extracted streams using SRTM digital elevation model.}
\label{figure07}
\end{figure}
\begin{figure*}
\centering
\includegraphics[width=0.9\linewidth]{08.png}
\caption{Superposition of geological lineaments and hydrothermal mineral occurrences on density maps resulted from the proposed framework using the MNF component improved by the a, b) directional and c, d) Laplacian filters; e, f) geological lineaments mapped by the manual photointerpretation and g, h) the GSWA. Density maps are created by summing the lineament length available in a defined grid size. For computational practicality, the size of each grid is set to 10 pixels (300 m) and the search radius is set to 50 pixels (1500 m). Lineament density values are taken into fuzzy space using a linear function, which yields values between 0 and 1 that makes it easier to compare them.}
\label{figure08}
\end{figure*}
The geological lineament map provided by the directional filter shows a significantly higher number of the lineaments compared to the map provided by the Laplacian filter (Fig. \ref{figure08}). Comparison of these with the result of manual photointerpretation and the GSWA map shows that the major trends of the geological lineaments have been displayed correctly. The map provided by the Laplacian filter is more correlated with the GSWA map but the density map of the geological lineaments extracted using the directional filter is highly correlated with hydrothermal mineral occurrences (Fig. \ref{figure08}). Areas with high density values located in the northeast and southwest of the study area (Fig. \ref{figure08}e) are associated with igneous granitic units, which can host diverse types of economic mineralization \cite{Candela1992}.
\subsection{Orientation analysis of extracted geological lineaments}
The geological lineaments extracted via directional and Laplacian filters (Fig. \ref{figure06}) reveal similar primary azimuth directions of \ang{100}--\ang{110}, which account for almost 10\% and 12\% of all extracted structures, respectively (Figs. \ref{figure08}, \ref{figure09}, Table \ref{table02}). The directional and Laplacian filters show subtle differences in subordinate populations, striking at \ang{20}--\ang{30} and \ang{40}--\ang{50}, respectively (Fig. \ref{figure09}, Table \ref{table02}).\\
The NW--SE striking lineaments are strongly correlated with the GSWA map and manual photointerpretation (Fig. \ref{figure09}). The geological lineaments extracted using manual photointerpretation shows a major and minor azimuth of \ang{90}--\ang{100} and \ang{20}--\ang{30}, accounting for almost 15\% and 7\% of all extracted geological lineaments, respectively (Fig. \ref{figure09}c, Table \ref{table02}). Geological mapping by the GSWA reveals a major azimuth of \ang{110}--\ang{120} that accounts for almost 26\% of all extracted geological lineaments (Fig. \ref{figure09}d, Table \ref{table02}). There is a far broader spread of NW--SE trending structures for the extracted lineaments using remote sensing data compared to those mapped by the GSWA. The subordinate NE--SW striking features identified via semi-automated lineament extraction are well represented in the manual photointerpretation but are comparatively rare in the GSWA map (Figs. \ref{figure08}, \ref{figure09}).
\begin{figure*}
\centering
\includegraphics[width=0.8\linewidth]{09.png}
\caption{Rose diagrams showing the number and orientation of the geological lineaments extracted by the proposed framework using a) directional and b) Laplacian filters applied on the MNF component. As a means of validation, rose diagrams of the geological lineaments mapped by c) manual photointerpretation and d) the GSWA are also shown.}
\label{figure09}
\end{figure*}
\begin{table*}
\centering
\begin{tabular}{|c|c|c|c|c|}
\hline
Method & Azimuth of the major strike & Percentage & Azimuth of the minor strike & Percentage \\
\hline
Proposed framework using directional filter & 100--110 & 10 & 20--30 & 6 \\
\hline
Proposed framework using Laplacian filter & 100--110 & 12 & 40--50 & 6 \\
\hline
Manual photointerpretation & 90--100 & 15 & 20--30 & 7 \\
\hline
GSWA geological lineament map & 110--120 & 26 & - & - \\
\hline
\end{tabular}
\caption{Comparison of different geological lineament maps generated by applying different methods.}
\label{table02}
\end{table*}
\subsection{Correlation of geological lineaments with hydrothermal mineral occurrences}
A strong spatial association is observed between geological lineaments (e.g., faults, dykes) and hydrothermal mineral occurrences (Fig. \ref{figure08}). Converting geological lineaments into a density pattern (Fig. \ref{figure10}) further supports the notion that geological lineaments and hydrothermal mineralization are co-located. A density map of the extracted geological lineaments using a directional filter on the MNF component shows the highest correlation with hydrothermal occurrence locations (i.e., the highest area under curve in Fig. \ref{figure10}). The result of applying a directional filter shows an even better correlation with the hydrothermal mineralization compared to the result of manual photointerpretation. Amongst all the available maps, the GSWA geological lineament density map shows the lowest correlation with the hydrothermal mineral occurrences.
\begin{figure}
\centering
\includegraphics[width=\linewidth]{10.png}
\caption{Spatial association between hydrothermal mineral occurrences and different geological lineament density maps. Lineament density values are taken into fuzzy space using a linear function. The \emph{x} axis shows the fuzzy thresholds from 0 to 1. The \emph{y} axis shows the percentage of known hydrothermal mineral occurrences that are placed in anomalous areas according to the thresholds shown in \emph{x} axis.}
\label{figure10}
\end{figure}
\section{Discussion}
\subsection{Evaluation of semi-automated computer vision framework}
In general, evaluation and validation of the different operations used in this study, against manual photointerpretation of the geological mapping, reveals an optimum dimension reduction technique, convolutional filter and edge detection parameter values. Each of these processes are discussed in turn.\\
Manual photointerpretation of the digital satellite data indicates that geological mapping by the GSWA captured most, but not all, of the geological lineaments in the Yinnetharra region of the Gascoyne Province (Fig. \ref{figure08}). Comparison of the extracted geological lineaments, using the proposed framework with manual photointerpretation and geological lineament map by the GSWA, reveals that applying MNF dimension reduction transformation is more reliable and results are closer to the field observations than the PCA and ICA (Fig. \ref{figure04}). The primary reason for the superior results from the MNF technique is high signal-to-noise ratio of the applied component \cite{Vassilas2002,Nielsen2011} and uniform behavior of each pixel's brightness value (positive peaks) facing the geological lineaments.\\
Visual (Fig. \ref{figure08}) and statistical (Fig. \ref{figure09}) comparisons show that the extracted geological lineaments using the proposed framework and applying a Laplacian filter on the MNF output component with the highest eigenvalue are well correlated with the GSWA geological lineament map. However, it is clear that the density map of the extracted geological lineaments using a directional filter is highly correlated with the hydrothermal mineral occurrences (Fig. \ref{figure10}). Moreover, the result of applying directional filter is similar to the map provided by the manual photointerpretation. The directional filter is able to enhance lineaments in desired directions which is an advantage in geological studies compared to the Laplacian filter. As geologists have prior knowledge of major structural trends, this approach is valid in regions where sufficient outcrop exists for field-based studies. Additionally, the images obtained by applying the directional filter significantly increases the efficiency of lineament extraction algorithms particularly through detecting small lineaments \cite{Lopes2016}. The broader spread of extracted lineament data using both filters and the manual photointerpretation compared to those extracted using the GSWA map is attributed to the short length of the extracted geological lineaments (Fig. \ref{figure09}) \cite{Adiri2017}.\\
The Canny edge detection and pixel connectivity-edge linking algorithms have been widely used in different fields \cite{Hashim2013,Ali2001,Liu2004,Elmahdy2016}. In this study, we increased the efficiency of these methods for extracting geological lineaments using the proposed framework. The initial steps of the proposed framework including dimension reduction techniques, adaptive and convolutional filters enhance the edges and increase the efficiency of edge detection and line extraction processes. Moreover, we present an optimum range of parameters applied in the lineament extraction operation for the Yinnetharra region (Table \ref{table01}). Optimum values of mentioned parameters may be different for each study area because of different spectral characteristics in each region, but our values provide a baseline for future studies. According to the field observations and geological evidence such as hydrothermal mineral occurrences, which are highly correlated with the structural features, our proposed framework is able to extract a high fraction of the geological lineaments (Fig. \ref{figure08}). A density map of the extracted geological lineaments using the proposed framework can be provided as the final product and can be used as an efficient evidential layer for prospecting hydrothermal mineral deposits.\\
Geological lineament maps provided by field observations are biased by the mapping geologist, who may have different views in dealing with the same structural features. The proposed framework is significantly less biased by the operator, but it is possible to modify the final map by applying new parameters to approach the desired geological lineament map. Ultimately, although it is always important to validate results whenever possible to geological maps, additional lineaments may be revealed through via a semi-automated computerized framework.
\subsection{Limitations of the proposed framework and future improvements}
The lineament extraction process applied in this study is limited to a specific curve length, while the geological lineaments show variable lengths on the Earth's surface. This semi-automated process extracts geological lineaments as multipart lines, which may be significantly in error with real structural discontinuities. Although structural discontinuities may naturally segmented by fault relays, longer, continuous faults are also likely to be present \cite{Vermilye1999}. In terranes where regolith or sedimentary cover is a problem, it is often difficult to differentiate between linked and single faults and, consequently, most geologists opt for producing single, longer faults as these require less inference \cite{Taylor2001,Fondriest2015}. Applied edge detection and line extraction methods in the proposed framework can be replaced with recently introduced methods based on image segmentation for other applications, to overcome above mentioned limitations \cite{Xiaoqi2016}.\\
The process of removing streams from the extracted lineaments using the proposed framework can also be improved by introducing new criteria through discriminating streams and geological lineaments. Here, an SRTM digital elevation model was used for mapping streams, but according to the Landsat 8 image (Fig. \ref{figure03}), some bifurcated streams failed to be identified using our semi-automated framework. High resolution images obtained using UAV-based photogrammetry can be considered as alternative input data to the proposed framework to overcome limited spatial resolution of the satellite data for efficient discrimination of streams and geological lineaments \cite{Vasuki2014}.\\
The proposed framework can be considered as a general methodology, which can be also used in other geoscientific fields such as hydrogeological and tectonic studies for mapping geological lineaments. We emphasize that maps provided using the proposed framework, which show the exposed geological lineaments on the Earth’s surface and deep-seated faults, can be further improved using other geophysical techniques, including magnetic, gravity and even radiometric data.
\section{Conclusion}
In this study, we present a computer vision-based framework for detecting geological lineaments using optical remote sensing data. The proposed framework involves diverse techniques for reducing dimensionality, removing noise and enhancing the lineaments in addition to edge detection and line extraction. The comparison of different dimension reduction techniques shows that the extracted geological lineaments using the output component of the MNF technique are best correlated with the available geological lineament map provided by the manual photointerpretation.\\
The Canny edge detector and pixel connectivity-edge linking algorithm are applied, respectively, to detect edges and to extract lines through providing a lineament map. The SRTM digital elevation model is applied to remove streams from the extracted lineaments to produce a geological lineament map. The extracted geological lineaments are compared to ground truth. Irrespective of the applied dimension reduction technique and convolutional filter, we observe a high fraction of the extracted geological lineaments are matched to the GSWA geological lineament map.\\
We also investigate the correlation between the density map of the extracted geological lineaments and known hydrothermal mineral occurrences in the study area. We conclude that the geological lineaments which are extracted using a directional filter are highly correlated with the hydrothermal mineral occurrences, even more than the map provided by the manual photointerpretation. We demonstrate that the output of the proposed framework can be applied to create an efficient evidential layer for prospectivity mapping of the hydrothermal mineral deposits.\\
In future work, the proposed framework can be used to map geological lineaments in other regions. The incorporation of various sources of data such as other types of geophysical maps (e.g., gravity, magnetics, and radiometrics) can be used to further enhance the framework. Moreover, statistical methods can be used to optimize parameters applied in lineament extraction algorithms. This could lead to better the convergence of the rose diagram obtained from the extracted geological lineaments and the field observations which are close to the real data.
\bibliographystyle{ieeetr}
| {'timestamp': '2018-10-05T02:14:48', 'yymm': '1810', 'arxiv_id': '1810.02320', 'language': 'en', 'url': 'https://arxiv.org/abs/1810.02320'} | arxiv |
\section{Conclusion}
\label{sec:conclusion}
In this paper, we study the \textit{maximal} $k$\textit{-biplex enumeration} problem.
We develop an efficient reverse search-based algorithm with the polynomial delay guarantee.
Extensive experiments on real and synthetic datasets demonstrate that our algorithm outperforms the existing methods in terms of total running time and delay significantly.
{
In the future, we will investigate efficient parallel and distributed implementations. Another interesting research direction is to adapt the proposed reverse search-based algorithm to enumerate some other cohesive subgraphs over bipartite graphs.}
\section{Extensions of \texttt{iTraversal}}
\label{sec:size-constrained}
In some scenarios, one may want to impose some size constraints on one side or both sides of a MBP to be enumerated. For example, one is interested in only those MBPs with the size on either side to be at least a threshold $\theta$. We show that such constraints can be conveniently incorporated to the \texttt{iTraversal} algorithm so that not all MBPs need to be enumerated, which achieves better efficiency. In contrast, for \texttt{bTraversal}, these constraints cannot be incorporated easily and all MBPs need to be enumerated and then a filtering step as post-processing is necessary, which is inefficient. For illustration, we consider the constraint that a MBP has the sizes on its both sides at least $\theta$, and we call such a MBP a \emph{large MBP}. However, the techniques can be easily customized for slightly different constraints such that a MBP has the size on its left or right side at least a threshold $\theta$.
\if 0
We now adapt \texttt{iTraversal} (Alg. \ref{alg:itraversal}) to list all MBPs $H(L,R)$ with size larger than $\theta$, i.e., $|L|\geq \theta$ and $|R|\geq \theta$.
A natural solution is to call \texttt{iTraversal} and then filter out MBPs with size smaller than $\theta$.
However, this adaptation suffers from massive computations for enumerating small MBPs.
Hence, we solve this issue via employing the following pruning techniques in \texttt{iTraversal}. Intuitively, they allow us to prune batches of small MBPs by skipping unnecessary procedures or enumerating less combinations during the execution.
Note that, w.l.o.g., we still assume left-side traversal in this section.
\noindent\textbf{(1) Core pruning.}
We observe that a large $k$-biplex $(L, R)$ is a $(\theta-k)$-core subgraph. Here, $k$-core is a subgraph with each vertex having degree at least $k$. This is because $\delta(v,R) \geq |R|-k \geq \theta-k,~\forall~v\in L$ and $\delta(u,L) \geq |L|-k \geq \theta-k,~\forall~u\in R$. We present this result in the following lemma.
\begin{lemma}
\label{lemma:core}
A $k$-biplex $(L, R)$ with $|L|\ge \theta$ and $|R|\ge \theta$ is a $(\theta-k)$-core subgraph.
\end{lemma}
Based on Lemma \ref{lemma:core}, we can first conduct a $(\theta-k)$-core decomposition on the bipartite graph $G$, which prunes all vertices with the degree smaller than $(\theta-k)$~\cite{batagelj2003m,liu2019efficient} and then enumerate the large MBPs on the remaining graph. Note that this pruning technique is not specific to any algorithm.
\fi
\smallskip\noindent\textbf{Right-side pruning.}
Recall that \texttt{iTraversal} adopts the right-shrinking traversal, i.e., it traverses along links from a solution $H = (L, R)$ to another $H' = (L', R')$ with $R' \subseteq R$. This would allow several opportunities for pruning. \underline{(1) Almost-satisfying graph pruning}: When an almost-satisfying graph $G[H, v]$ is formed in Step 1 of \texttt{iThreeStep}, we prune it if $\delta(v,R) + k < \theta$. This is because any solution found based on this almost-satisfying graph would involve $v$ at the left side and less than $\theta$ vertices at the right side (including at most $\delta(v,R)$ vertices that connect $v$ and $k$ vertices that disconnect $v$). \underline{(2) Local solution pruning}: When enumerating the local solutions of an almost-satisfying graph $G[(L,R), v]$ in Step 2 of \texttt{iThreeStep}, the enumerations of the subsets $R'$ of $R$ with $|R'| < \theta$ can be pruned (correspondingly, the enumerations of the subsets $L'$ of $L$ can be saved) since all solutions formed from these local solutions would have a size on their right side being smaller than $\theta$ (due to the right-shrinking traversal). \underline{(3) Solution pruning}: When a solution $H = (L, R)$ with $|R| < \theta$ is found, we skip the recursive call of \texttt{iThreeStep} from $H$ since all solutions that will be found via this call would have the size of their right side at most $|R|$ and smaller than $\theta$ (due to the right-shrinking traversal).
\smallskip\noindent\textbf{Left-side pruning.}
Based on the exclusion strategy, we derive the following pruning technique. When a solution $H$ is found, we check whether $|\mathcal{L}|-|\mathscr{E}(H)|<\theta$, where $\mathscr{E}(H)$ is the exclusion set maintained for $H$ by the exclusion strategy. If so, we skip the recursive call \texttt{iThreeStep} from $H$ so that all links from $H$ are pruned. To verify, consider a solution $H'=(L',R')$ that can be reached from $H$ via the call \texttt{iThreeStep} from $H$. { There are two cases. \underline{Case 1:} $L'\cap \mathscr{E}(H)\neq \emptyset$. The link from $H$ to $H'$ would be pruned by the exclusion strategy. \underline{Case 2:} $L'\cap \mathscr{E}(H) = \emptyset$. We have $|L'| \le |\mathcal{L}|-| \mathscr{E}(H)| < \theta$, and thus $H'$ cannot be a large MBP.}
\if 0
\subsection{Enumerating Maximal Bicliques (MBPCs)}
\label{subsec:MBPC}
Basically, we can directly set $k=0$ as a $k$-biplex will reduce to a biclique when $k=0$. Moreover, the `all-to-all' constraint allows the following improvements.
\begin{itemize}[leftmargin=*]
\item \textbf{Efficient procedures.} For \texttt{EnumAlmostSat}, given an almost-satisfying graph $G[(L,R),v]$, it returns exactly a local solution $(L\cup\{v\}, \Gamma_G(v,R))$. For \texttt{ExtendToMax}, given a local solution $(L,R)$, it first selects vertex $w$ with the smallest degree $\delta_G(\mathscr{L},w)$, then checks vertices in $\Gamma_G(\mathscr{L},w)\backslash L$ (instead of $\mathscr{L}\backslash L$).
\item \textbf{Efficient redundancy checking.} Instead of employing the B-tree to avoid repeated outputs, we prove that \texttt{iTraversal} without the B-tree lists all maximal bicliques without redundancies, which is guaranteed by the exclusion-aware traversal.
\end{itemize}
\fi
\section{The \texttt{EnumAlmostSat} Procedure}
\label{sec:enumalmostsat}
Let $(L, R)$ be a solution and $(L\cup\{v\}, R)$ be an almost-satisfying graph, where $v\in \mathcal{L} \backslash L$. The \texttt{EnumAlmostSat} procedure is to enumerate all local solutions within $(L\cup \{v\}, R)$, which involve $v$.
Essentially, the task is to explore a search space of $\{(L', R')\}$, where $L'\subseteq L$ and $R'\subseteq R$, and find those $(L', R')$'s such that $(L'\cup\{v\}, R')$ is a local solution. Note that this search space has a size of $O(2^{|L|+|R|})$, and hence simply enumerating each pair $(L', R')$ would be costly.
In this paper, we develop a series of techniques for refining the enumerations on $L$ and $R$ so as to reduce and/or prune the search space (Section~\ref{subsec:refine-y-1}, \ref{subsec:refine-y-2}, \ref{subsec:refine-x-2}, and \ref{subsec:refine-x-1}).
\if 0
{ An illustration of partitions and enumerations on $L$ and $R$ is given in Figure \ref{fig:set_partition}, and would be used throughout this section.}
For the enumerations on $R$, we first observe that all vertices that connect to $v$ are involved in all local solutions and thus we can focus on enumerating on the set containing other vertices in $R$, denoted by $R_{enum}$ (Section~\ref{subsec:refine-y-1}). We then further identify some enumerations on $R_{enum}$, which cannot constitute local solutions and thus can be pruned (Section~\ref{subsec:refine-y-2}). For the enumerations on $L$, we first observe that given an enumerated subset $R'$ of $R$, subgraphs $(L\cup\{v\}, R')$ would become local solutions if at most a certain number of vertices are removed from a subset of $L$, denoted by $L_{remo}$ (Section~\ref{subsec:refine-x-1}). Furthermore, we can impose an order for enumerating the subsets of vertices to be removed so that some subsets would be pruned (Section~\ref{subsec:refine-x-2}).
\fi
We finally present an algorithm based on these refined enumerations and analyze its time complexity (Section~\ref{subsec:enumalmostsat}).
\if 0
Fortunately, the search space $\{(L', R')\}$ can be pruned significantly. Specifically, many vertices can be excluded from being enumerated for $L'$ and $R'$ because they would appear in \emph{all} local solutions within $H(L\cup\{v\}, R)$. To see this, consider (1) all vertices in $L$ and $R$ disconnect at most $k$ vertices from the other side in $H(L, R)$, (2) if a vertex disconnects at most $k$ vertices from the other side in $H(L, R)$, it would disconnect at most $k$ vertices from the other side in any subset of $H(L, R)$, and (3) each local solution $(L'\cup \{v\}, R')$ corresponds to a subset of $H(L, R)$ plus one vertex $v$ (i.e., the difference between the location solution and a subset of $H(L, R)$ is tiny). Therefore, many vertices would disconnect at most $k$ vertices from the other side in a local solution, as they do in a $H(L, R)$. Note that (1) is based on the fact that $H(L\cup\{v\}, R)$ is an almost-satisfying graph (i.e., $H(L, R)$ is a $k$-biplex) and (2) is based on the fact that $k$-biplex is a hereditary property~\cite{DBLP:journals/jcss/CohenKS08} (i.e., the subset of a $k$-biplex is also a $k$-biplex). In the following, we develop three techniques for excluding vertices in $L$ and $R$ from being enumerated for $L'$ and $R'$, respectively in Section~\ref{subsec:refine-y-1}, Section~\ref{subsec:refine-y-2}, and Section~\ref{subsec:refine-x}. In Section~\ref{subsec:enumalmostsat}, we present the overall algorithm and its time complexity analysis.
\fi
\subsection{Refined Enumeration on $R$: 1.0}
\label{subsec:refine-y-1}
{ We start with an observation presented in the following lemma { (the proofs of the lemmas in this section are presented in the technical report~\cite{TR})}.}
\begin{lemma}
Given an almost-satisfying graph $(L\cup\{v\}, R)$, each vertex $u\in R$ that connects $v$ is involved in all local solutions within $(L\cup\{v\}, R)$.
\label{lemma:refine-y-1}
\end{lemma}
\if 0
{
\begin{proof}{
{
The complete proof is in the technical report \cite{TR}.}
}
\end{proof}
}
\fi
\if 0
Suppose $(L'\cup \{v\}, R')$ is a local solution and does not involve $u$, i.e., $u\notin R'$. Then, we consider another subgraph $(L'\cup \{v\}, R'\cup\{u\})$, which is larger than $(L'\cup \{v\}, R')$. We derive a contradiction by showing that $(L'\cup \{v\}, R'\cup\{u\})$ is a $k$-biplex since (1) each vertex $v' \in L'$ disconnects at most $k$ vertices from $R'\cup \{u\}$ (note that $R'\cup \{u\}$ is subset of $R$ and $v'$ disconnects at most $k$ vertices from $R$), (2) $v$ disconnects at most $k$ vertices from $R'\cup \{u\}$ (note that $v$ disconnects at most $k$ vertices from $R'$ and $v$ connects $u$), (3) each vertex $u'\in R'$ disconnects at most $k$ vertices from $L'\cup\{v\}$ (note that $(L'\cup\{v\}, R')$ is a $k$-biplex) and (4) vertex $u$ disconnects at most $k$ vertices from $L' \cup \{v\}$ (note that $u$ disconnects at most $k$ vertices from $L'$ and $u$ connects $v$).
\fi
Based on Lemma~\ref{lemma:refine-y-1}, we can partition $R$ into two sets, namely one containing those vertices that connect $v$ and the other containing the remaining vertices. We denote the former by $R_{keep}$ and the latter by $R_{enum}$.
{ An illustration is shown in Figure~\ref{fig:set_partition}(a).}
Then, $R_{keep}$ is involved in all local solutions within $(L\cup \{v\}, R)$ and hence the enumeration of the vertices in $R_{keep}$ can be avoided when enumerating $R'\subseteq R$. Specifically, when enumerating the subsets of $R$, we enumerate $R''\subseteq R_{enum}$ only and for each $R''$, we construct a $R'$ as $R'' \cup R_{keep}$. In addition, we only need to enumerate those $R''$'s with $|R''| \le k$ since otherwise $v$ would disconnect more than $k$ vertices in $R'$ and $(L'\cup\{v\}, R')$ cannot be a $k$-biplex. With this, the number of subsets of $R$ to enumerate is reduced from $O(2^{|R|})$ to $O({|R_{enum}|}^k)$.
\subsection{Refined Enumeration on $R$: 2.0}
\label{subsec:refine-y-2}
{
Based on Section~\ref{subsec:refine-y-1}, the search space is reduced from one containing all subsets of $R$ to one containing all subsets $R''$ of $R_{enum}$ with $|R''|\leq k$. In this section, we further prune some subsets $R''$ of $R_{enum}$ by refining the enumeration on $R_{enum}$.
Specifically, we partition $R_{enum}$ into two groups, namely $R_{enum}^1 \!=\! \{u\in R_{enum} \mid \overline{\delta}(u, L) \le k-1\}$ and $R_{enum}^2 = R_{enum} \backslash R_{enum}^1= \{u\in R_{enum} \mid \overline{\delta}(u, L) =k\}$. Instead of enumerating $R'' \subseteq R_{enum}$ with $|R''|\le k$ directly, we enumerate $R_1''\subseteq R_{enum}^1$ and $R_2''\subseteq R_{enum}^2$ with $|R_1'' \cup R_2''| \le k$ and construct $R''$ as $R_1'' \cup R_2''$.
{ An illustration is shown in Figure~\ref{fig:set_partition}(a).}
We then have the following lemma for pruning some enumerations of $R_1''$ and $R_2''$.
\begin{lemma}
\label{lemma:refine-y-2}
Let $R' = R'' \cup R_{keep}$ and $R'' = R_1'' \cup R_2''$, where $R_1''\subseteq R_{enum}^1$, $R_2''\subseteq R_{enum}^2$, and $|R_1'' \cup R_2''| \le k$. There does not exist a subset $L'$ of $L$ such that $(L'\cup \{v\}, R')$ is a local solution if (1) $|R_1''\cup R_2''| < k$ and (2) $R_{enum}^1 \backslash R_1'' \neq \emptyset$.
\end{lemma}
\if 0
\begin{proof}
{
The complete proof is in the technical report \cite{TR}.}
\end{proof}
\fi
\if 0
\begin{proof}
This can be verified by contradiction. Suppose there exists a subset $L'\subseteq L$ such that $(L'\cup \{v\}, R')$ is a local solution. Then, another subgraph $(L'\cup \{v\}, R'\cup \{u\})$, where $u\in R_{enum}^1 \backslash R_1''$, would be a $k$-biplex since (1) each vertex $v'\in L'$ disconnects at most $k$ vertices from $R'\cup\{u\}$ (note that $R'\cup\{u\}$ is subset of $R$ and $v'$ disconnects at most $k$ vertices from $R$), (2) $v$ disconnects at most $k$ vertices from $R'\cup\{u\}$ (note that $v$ disconnects $u$ and only those vertices in $R''$ and $|R''|<k$), (3) each vertex $u'\in R'$ disconnects at most $k$ vertices from $L'\cup\{v\}$ (since $(L'\cup \{v\},R')$ is a local solution) and (4) $u$ disconnects at most $k$ vertices from $L'\cup\{v\}$ (note that $u$ disconnects at most $k-1$ vertices from $L$ since $u\in R_{enum}^1$ and $u$ disconnects $v$ since $u\in R_{enum}$).
\end{proof}
\fi
Based on Lemma~\ref{lemma:refine-y-2}, we can prune those enumerations of $R_1''$ and $R_2''$ with $|R_1''\cup R_2''| < k$ and $R_{enum}^1\backslash R_1'' \neq \emptyset$, and thus it reduces the enumerations of subsets $R''$ of $R_{enum}$.
}
\begin{figure}[]
\centering
\centering
\begin{tabular}{l c r}
\begin{minipage}{3.90cm}
\includegraphics[width=4.1cm]{figure/partition11}
\end{minipage}
& &
\begin{minipage}{3.00cm}
\includegraphics[width=2.8cm]{figure/partition12}
\end{minipage}
\\
(a) Partitions on $L$
& &
(b) Partitions on $R$
\end{tabular}
\caption{ Illustration of partitions on $L$ and $R$.}
\label{fig:set_partition}
\end{figure}
\subsection{Refined Enumeration on $L$: 1.0}
\label{subsec:refine-x-1}
Given a subset $R'$ of $R$, where $R' = R'' \cup R_{keep}$ and $R'' = R''_1 \cup R''_2$, we enumerate the subsets of $L$ and for each subset $L'$, construct $(L'\cup \{v\}, R')$ as a candidate of a local solution. A straightforward method is to enumerate all subsets of $L$. However, the search space would be $O(2^{|L|})$. In this section, we aim to refine the enumeration on $L$ so that the search space is reduced.
{
We have an observation presented in the following lemma.}
{
\begin{lemma}
\label{lemma:refine-x-1}
In the subgraph $(L'\cup \{v\}, R')$, where $L' = L$ and $R' = R_{keep} \cup R''_1 \cup R''_2$, all vertices except for those in $R''_2$ disconnect at most $k$ vertices and vertices in $R''_2$ disconnect exactly $(k+1)$ vertices.
\end{lemma}
\if 0
{
\begin{proof}
This can be verified by the definitions of $k$-biplex, $R_{keep}$, $R_1''$ and $R_2''$. The detailed proof is in the { technical report~\cite{TR}}.
\end{proof}
}
\fi
\if 0
\begin{proof}
This can be verified as follows. (1) Each vertex $v'\in L$ disconnects at most $k$ vertices in $R'$ (this is because $\overline{\delta}(v', R) \le k$ since $(L, R)$ is a $k$-biplex, and $R'\subseteq R$). (2) Vertex $v$ disconnects at most $k$ vertices in $R'$ (this is because $\overline{\delta}(v, R') = \overline{\delta}(v, R''\cup R_{keep}) = \overline{\delta}(v, R'') \le |R''| \le k$. Note that $v$ connects every vertex in $R_{keep}$ by the definition of $R_{keep}$). (3) Each vertex $u\in R_{keep}$ disconnects at most $k$ vertices in $L\cup \{v\}$ (this because $u$ disconnects at most $k$ vertices in $L$ given that $(L, R)$ is a $k$-biplex and $u$ connects $v$ by the definition of $R_{keep}$). (4) Each vertex $u_1$ in $R''_1$ disconnects at most $k$ vertices in $L\cup \{v\}$ (this is because $\overline{\delta}(u_1, L) \le k-1$ by the definition of $R_{enum}^1$ and $u_1$ disconnects $v$). (5) Each vertex $u_2$ in $R''_2$ disconnects \emph{exactly} $(k+1)$ vertices in $L\cup \{v\}$ (this is because $\overline{\delta}(u_2, L) = k$ by the definition of $R_{enum}^2$ and $u_2$ disconnects $v$).
\end{proof}
\fi
Based on Lemma~\ref{lemma:refine-x-1}, we can construct potential local solutions $(L'\cup \{v\}, R')$ by removing a \emph{minimal} set $\overline{L'}$ of vertices from $L$ so that all vertices in $R''_2$ would disconnect at most $k$ remaining vertices, where $L' = L \backslash \overline{L'}$. Note that (1) after removing $\overline{L'}$ from $L$, those remaining vertices in $L\cup \{v\}$ (i.e., the vertices in $L'\cup \{v\}$) and vertices in $R_{keep} \cup R''_1$ would still disconnect at most $k$ vertices due to the hereditary property and
(2) $\overline{L'}$ needs to be \emph{minimal} so that $(L'\cup \{v\}, R')$ would be a \emph{maximal} $k$-biplex.
In addition, when a vertex $v'$ that connects all vertices in $R''_2$ is removed, each vertex in $R''_2$ would still disconnect $(k+1)$ vertices. Therefore, we focus on the set $L_{remo}$ of the vertices that disconnect at least one vertex in $R''_2$, i.e., $L_{remo} = \{v'\in L \mid \overline{\delta}(v', R''_2) > 0\}$, and enumerate subsets $\overline{L'}$ of $L_{remo}$ to be removed.
}
{ An illustration is shown in Figure~\ref{fig:set_partition}(b).}
{
For each minimal set $\overline{L'}$ such that $(L'\cup\{v\}, R')$ is a local solution, where $L' = L\backslash \overline{L'}$, it involves no more than $|R''_2|$ vertices. This is because only vertices in $R''_2$ disconnect more than $k$ vertices (exactly $(k+1)$ vertices) and to make one vertex in $R''_2$ disconnect at most $k$ vertices, it is enough to remove one vertex from $L_{remo}$}.
In conclusion, we enumerate $\overline{L'}$ from $L_{remo}$ with $|\overline{L'}| \le |R''_2| \le k$ to be removed, and for each $\overline{L'}$, we construct $(L'\cup \{v\}, R')$ as a candidate of local solution, where $L' = L\backslash \overline{L'}$. In this way, the search space of enumerating $L$ is reduced from $O(2^{|L|})$ to $O(|L_{remo}|^k)$.
\subsection{Refined Enumeration on $L$: 2.0}
\label{subsec:refine-x-2}
When enumerating $\overline{L'}$ from $L$ to be removed, we follow an increasing order of $|L|$ from $0$ to $|R''_2|$. If for a subset $\overline{L'}$ and $L' = L\backslash \overline{L'}$, $(L' \cup \{v\}, R')$ is a local solution, we prune all supersets of $\overline{L'}$ from being enumerated to be removed since removing each of them would construct a $k$-biplex that is not maximal within $(L\cup\{v\},R)$.
\subsection{\texttt{EnumAlmostSat}: Summary and Analysis}
\label{subsec:enumalmostsat}
We present the algorithm for the \texttt{EnumAlmostSat} procedure in Algorithm~\ref{alg:enumalmostsat}, which is based on the 2.0 versions for enumerating $R$ and $L$.
{ We use $Powerset(L_{remo})$ to denote the set of all subsets of $L_{remo}$ (Line 4 and 7).} { Note that output solutions in { line 6} can be non-globally optimal since an almost-satisfying graph {rather than} the whole graph is used as the context for checking the maximality.}
The correctness can be guaranteed by the lemmas and discussions in this section.
\begin{algorithm}
\small
\caption{The algorithm: {\tt \texttt{EnumAlmostSat}}.}
\label{alg:enumalmostsat}
\KwIn{Almost-satisfying graph $(L\cup\{v\},R)$;}
\KwOut{All local solutions including $v$ within $(L\cup\{v\},R)$;}
Partition $R$ into $R_{keep}$, $R_{enum}^1$ and $R_{enum}^2$ (Section~\ref{subsec:refine-y-1} and \ref{subsec:refine-y-2})\;
\ForEach{$R' = R_{keep} \cup R''_1\cup R''_2$ (as constructed in Section~\ref{subsec:refine-y-2})}{
Construct $L_{remo}$ as $\{v'\in L \mid \overline{\delta}(v', R''_2) > 0\}$\;
\ForEach{$\overline{L'} \in Powerset({L_{remo}})$ with $|\overline{L'}|\! \le\! |R''_2|$ in an ascending order of $|\overline{L'}|$}{
Construct $L'$ as $L\backslash \overline{L'}$\;
\If{$(L'\cup\{v\}, R')$ is a local solution}{
Prune those subsets from $Powerset({L_{remo}})$, which are supersets of $\overline{L'}$\;
Print $(L'\cup\{v\}, R')$\;
}
}
}
\end{algorithm}
\noindent\textbf{Time complexity.}
The time complexity of \texttt{EnumAlmostSat} is dominated by that of enumerating subsets of $R$ and $L$ (Line 2-8).
There are $O(|R_{enum}|^k)$ enumerations of $R''$ (Line 2), and for each one, it incurs the following costs. First, it partitions $L$, which takes $O(|L|\cdot |R|)$ time (Line 3). Second, it enumerates subsets $\overline{L'}$ of $L_{remo}$ with the size at most $|R_2''|$ on $L_{remo}$ (Line 4). There are $O(|L_{remo}|^k)$ such $\overline{L'}$'s, and for each $\overline{L'}$, the cost is dominated by that of checking the maximality (Line 6), which is $O(|L|\cdot |R|)$.
{
In summary, \texttt{EnumAlmostSat} would return at most $\gamma=O(|R_{enum}|^k\cdot |L_{remo}|^k)$ local solutions, and the time complexity of \texttt{EnumAlmostSat} is $\beta=O(|R_{enum}|^k\cdot |L_{remo}|^k \cdot |L|\cdot|R|)$, which is polynomial with $k$ as a constant.
}
\section{Experiments}
\label{sec:exp}
\textbf{Datasets.} We use both real and synthetic datasets. The real datasets are taken from various domains {(http://konect.cc/)} and summarized in Table \ref{tab:dataset}.
The synthetic datasets are Erd{\"o}s-R{\'e}yni (ER) graphs, which are generated by first creating a certain number of vertices and then randomly creating a certain number of edges between pairs of vertices. { We set the number of vertices and edge density as 100k and 10 for synthetic datasets, respectively, by default. Here, the edge density of a graph $G=(\mathcal{L}\cup \mathcal{R},\mathcal{E})$ is defined as $|\mathcal{E}|/(|\mathcal{L}|+|\mathcal{R}|)$.}
\begin{table}[t]
\centering
\scriptsize
\small
\caption {Real datasets}
\label{tab:dataset}
\begin{tabular}{c|c|r|r|r}
\hline
\multicolumn{1}{c|}{\textbf{Name}}
& \multicolumn{1}{c|}{\textbf{Category}}
& \multicolumn{1}{c|}{$|\mathcal{L}|$}
& \multicolumn{1}{c|}{$|\mathcal{R}|$}
& \multicolumn{1}{c}{$|\mathcal{E}|$}
\\
\hline\hline
Divorce & HumanSocial &9 &50 & 225 \\
\hline
Cfat & Miscellaneous &100 &100 & 802 \\
\hline
Crime & Social & 551 & 829 & 1,476 \\
\hline
Opsahl & Authorship &2,865 &4,558 & 16,910 \\
\hline\hline
Marvel & Collaboration &19,428 &6,486 & 96,662 \\
\hline
Writer & Affiliation &89,356 &46,213 & 144,340 \\
\hline
Actors & Affiliation &392,400 &127,823 & 1,470,404 \\
\hline
IMDB &Communication &428,440 &896,308 & 3,782,463 \\
\hline
DBLP & Authorship & 1,425,813 &4,000,150 & 8,649,016 \\
\hline
Google & Hyperlink &17,091,929 &3,108,141 & 14,693,125 \\
\hline
\end{tabular}
\end{table}
\smallskip
\noindent\textbf{Algorithms.} We compare our algorithm \texttt{iTraversal}, with three baselines, namely, \texttt{iMB} \cite{yu2021efficient}, \texttt{FaPlexen} \cite{DBLP:conf/aaai/ZhouXGXJ20} and \texttt{bTraversal}.
\texttt{iMB} was proposed for enumerating maximal $k$-biplexes. \texttt{FaPlexen} is the state-of-the-art algorithm for enumerating large maximal $k$-plexes and we run it on the inflated graph of a bipartite graph for enumerating maximal $k$-biplexes. \texttt{bTraversal} follows the conventional framework of reverse search and implements the \texttt{EnumAlmostSat} procedure by first inflating the graph and then using an existing algorithm for enumerating local maximal $k$-plexes~\cite{DBLP:conf/sigmod/BerlowitzCK15}.
\smallskip
\noindent\textbf{Settings.}
All algorithms were implemented in C++ and executed on a machine with a 2.66GHz processor and 32GB of memory, with CentOS installed.
We set the running time limit (INF) as 24 hours and the memory budget (OUT) as 32GB. The source codes are available at https://github.com/KaiqiangYu/SGMOD22-MBPE.
\subsection{Comparison among Algorithms}
\label{subsec:comparison-results}
\noindent{\textbf{Results of running time (real datasets).}}
{ The results of running time when returning the first 1,000 MBPs (by following the existing studies~\cite{DBLP:conf/sigmod/BerlowitzCK15}) are shown in Figure~\ref{fig:real}(a) for varying datasets, (b) and (c) for varying $k$, and (d) and (e) for varying the number of returned MBPs (results on Writer and DBLP are shown only and those on other datasets show similar clues and { are put in the technical report \cite{TR})}.} We have the following observations. First, \texttt{iTravesal} outperforms all other algorithms and can finish on all datasets. Second, \texttt{iMB} cannot finish { within INF} on large datasets due to its ineffective pruning techniques. Third, \texttt{FaPlexen} cannot finish { within OUT} on large datasets either, mainly due to its underlying graph inflation procedure. For example, for Marvel which has 96 thousand edges, it would generate more than 200 million edges after graph inflation. Therefore, we exclude \texttt{iMB} and \texttt{FaPlexen} for the remaining experiments of enumerating MBPs. Fourth, \texttt{bTraversal} is more scalable than \texttt{iMB} and \texttt{FaPlexen} but still cannot finish on the Google dataset { within INF}. Fifth, \texttt{iTraversal} and \texttt{bTraversal} have their running time increase as $k$ and the number of MBPs grows, and \texttt{iTraversal} is up to four orders of magnitude faster than \texttt{bTraversal}. { We note that \texttt{iTraversal} has its running time clearly rising as $k$ increases when compared with \texttt{bTraversal}. The reason is that \texttt{iTraversal} adopts the proposed \texttt{L2.0+R2.0}, whose pruning power gets weaker as $k$ increases, while \texttt{bTraversal} adopts a procedure based on graph inflation, which is not that sensitive to $k$.}
%
\begin{figure}[]
\centering
\centering
\begin{minipage}{8cm}
\includegraphics[width=8cm]{figure/all_dataset3}
\end{minipage}
\\
\ \ \ \ \ (a) Varying datasets ($k=1$)
\begin{tabular}{c c}
\begin{minipage}{3.50cm}
\includegraphics[width=4.1cm]{figure/efficiency_writer_k}
\end{minipage}
&
\begin{minipage}{3.50cm}
\includegraphics[width=4.1cm]{figure/efficiency_dblp_k}
\end{minipage}
\\
\ \ \ \ (b) Varying $k$ (Writer)
&
\ \ \ \ (c) Varying $k$ (DBLP)
\\
\begin{minipage}{3.50cm}
\includegraphics[width=4.1cm]{figure/writer_r}
\end{minipage}
&
\begin{minipage}{3.50cm}
\includegraphics[width=4.1cm]{figure/dblp_r}
\end{minipage}
\\
(d) Varying \# of MBPs (Writer)
&
(e) Varying \# of MBPs (DBLP)
\end{tabular}
\caption{ Results of running time (real datasets)}
\label{fig:real}
\end{figure}
\smallskip\noindent{\textbf{Results of delay (real datasets).}}
The results are shown in Figure~\ref{fig:small_dataset}. Note that we use small datasets for this experiment since some baseline algorithms \texttt{iMB} cannot find all solutions on larger datasets { within INF} and thus the delay cannot be measured. In general, the delay of all algorithms increases with $k$ and \texttt{iTraversal} has the smallest delays. This is consistent with our theoretical analysis that the delay of \texttt{iTraversal} is polynomial while those of \texttt{iMB} and \texttt{FaPlexen} are exponential w.r.t. the size of the input bipartite graph.
\begin{figure}[ht]
\centering
\centering
\begin{tabular}{c c}
\begin{minipage}{3.80cm}
\includegraphics[width=4.1cm]{figure/small_data_delay2}
\end{minipage}
&
\begin{minipage}{3.80cm}
\includegraphics[width=4.0cm]{figure/divorce_delay2}
\end{minipage}
\\
(a) Varying datasets ($k=1$)
&
(b) Varying $k$ (Divorce)
\end{tabular}
\caption{ Results of delay}
\label{fig:small_dataset}
\end{figure}
\smallskip
\noindent{\textbf{Scalability test/Varying \# of vertices (synthetic datasets).}}
The results when returning the first 1,000 MBPs are shown in Figure~\ref{fig:syn}(a).
\texttt{iTraversal} achieves at least 100$\times$ speedup compared with \texttt{bTraversal} and can handle large datasets with 100 million vertices and 1 billion edges { within INF} while \texttt{bTraversal} cannot.
\smallskip
\noindent{\textbf{Varying edge density (synthetic datasets).}}
The results are shown in Figure~\ref{fig:syn}(b). \texttt{iTraversal} outperforms \texttt{bTraversal} by around 1-5 orders of magnitude. The speedup decreases as the graph becomes denser. Possible reasons include: (1) the density gap between the original almost-satisfying graph and the inflated graph narrows { (note that \texttt{bTraversal} involves a graph inflation step for implementing \texttt{EnumAlmostSat})} and { (2) the number of solutions decreases in dense bipartite graphs.}
\begin{figure}[]
\centering
\centering
\begin{tabular}{c c}
\begin{minipage}{3.50cm}
\includegraphics[width=4cm]{figure/random_v}
\end{minipage}
&
\begin{minipage}{3.50cm}
\includegraphics[width=4cm]{figure/random_e}
\end{minipage}
\\
(a) Varying \# of vertices
&
(b) Varying edge density
\end{tabular}
\caption{Results of running time (synthetic datasets)}
\label{fig:syn}
\end{figure}
\smallskip
\noindent\textbf{Extension of \texttt{iTraversal} for enumerating large MBPs (real datasets)}. We compare the extension of \texttt{iTraversal} with \texttt{iMB}, for which some pruning techniques are developed for { enumerating large MBPs~\cite{yu2021efficient}}. We exclude \texttt{FaPlexen} and \texttt{bTraversal} for comparison because (1) \texttt{FaPlexen} cannot handle large datasets due to the graph inflation procedure and (2) \texttt{btraversal} cannot be extended with techniques for pruning small MBPs, but needs to enumerate all MBPs and then filter out those small ones. In addition, for both \texttt{iTraversal} and \texttt{iMB}, we perform a $(\theta-k)$-core decomposition~\cite{liu2019efficient} on the input bipartite graph first before enumerating large MBPs on them. This is due to the fact that each large MBP, i.e., a MBP with the size of both sides at least $\theta$, corresponds to a $(\theta-k)$-core, which is clear. The results of running time { on Writer and DBLP} are shown in Figure~\ref{fig:size_constraint} for varying $\theta$. We observe that the running time decreases as $\theta$ grows. { This is because both the size of $(\theta-k)$-core and the number of large MBPs decrease as $\theta$ grows.} \texttt{iTraversal} is faster than \texttt{iMB} by up to four orders of magnitude.
\begin{figure}[ht]
\centering
\centering
\begin{tabular}{c c}
\begin{minipage}{3.70cm}
\includegraphics[width=4.1cm]{figure/writer_theta2}
\end{minipage}
&
\begin{minipage}{3.70cm}
\includegraphics[width=4.1cm]{figure/dblp_theta2}
\end{minipage}
\\
(a) Varying $\theta$ ($k$=1, Writer)
&
(b) Varying $\theta$ ($k$=1, DBLP)
\end{tabular}
\caption{ Results of enumerating large MBPs}
\label{fig:size_constraint}
\end{figure}
\subsection{Performance Study of \texttt{iTraversal}}
\noindent{\textbf{\texttt{bTraversal} vs \texttt{iTraversal}}}
We compare three different versions of \texttt{iTraversal}, namely (1) \texttt{iTraversal}: the full version involving left-anchored traversal, right-shrinking traversal and exclusion strategy, (2) \texttt{iTraversal-ES}: the full version without the exclusion strategy, and (3) \texttt{iTraversal-ES-RS}: \texttt{iTraversal-ES} without the right-shrinking traversal. We also consider the \texttt{bTraversal} for comparison. All these algorithms adopt the \texttt{L2.0+R2.0} algorithm for the \texttt{EnumAlmostSat} procedure for fair comparison. We measure the number of links of the solution graph and the running time. The results are shown in Figure \ref{fig:strategy}. Note that we use those small real datasets for this experiment only since \texttt{bTraversal} cannot find all solutions { within INF}. We set the maximum allowed number of links (UPP) as $10^{10}$. Figure \ref{fig:strategy}(a) and (b) show that \texttt{iTraversal} would generate the sparsest solution graph and achieves up to 1000$\times$ speedup compared with \texttt{bTraversal}. These results also verify the effectiveness of left-anchored traversal, right-shrinking traversal, and exclusion strategy. Figure \ref{fig:strategy}(c) and (d) show the results of varying $k$. The scale of solution graph and the running time of all algorithms grow exponentially w.r.t. $k$.
\begin{figure}[]
\centering
\centering
\begin{tabular}{c c}
\begin{minipage}{3.70cm}
\includegraphics[width=4.0cm]{figure/solution_dataset3}
\end{minipage}
&
\begin{minipage}{3.70cm}
\includegraphics[width=4.0cm]{figure/time_dataset3}
\end{minipage}
\\
\ \ \ (a) Solution graph ($k=1$)
&
\ \ \ {(b) Running time ($k=1$)}
\\
\begin{minipage}{3.70cm}
\includegraphics[width=4.1cm]{figure/divorce_solution1}
\end{minipage}
&
\begin{minipage}{3.70cm}
\includegraphics[width=4.1cm]{figure/divorce_time1}
\end{minipage}
\\
\ \ \ (c) Solution graph (Divorce)
&
\ \ \ (d) Running time (Divorce)
\end{tabular}
\caption{\texttt{bTraversal} vs \texttt{iTraversal}}
\label{fig:strategy}
\end{figure}
\smallskip
\noindent{\textbf{Performance study of \texttt{EnumAlmostSat}.}}
We consider different combinations of enumeration methods on $R$ and $L$ as described in Section~\ref{sec:enumalmostsat}. The algorithm \texttt{L1.0+R1.0} corresponds to the combination of ``refined enumeration on $L$: 1.0'' and ``refined enumeration on $R$: 1.0''. Similarly, we have \texttt{L1.0+R2.0}, \texttt{L2.0+R1.0}, and \texttt{L2.0+R2.0}. In addition, we consider a baseline method \texttt{Inflation} which conducts a graph inflation procedure and then uses an existing procedure for enumerating local maximal $k$-plexes \cite{DBLP:conf/sigmod/BerlowitzCK15}.
We execute these algorithms 1,000 times with random almost-satisfying graphs that are constructed based on Writer { and DBLP}. { Specifically, we run $\texttt{iTraversal}$ on { a dataset (Writer or DBLP)}, collect the first 1,000 MBPs and then for each MBP $H=(L,R)$, we add to $H$ a random vertex $v\in \mathcal{L}\backslash L$.} We present the average running time in Figure \ref{fig:enum}. According to the results, the running time of all algorithms grows as $k$ increases and \texttt{L2.0+R2.0} is the fastest, achieving up to 1000$\times$ speedup compared with \texttt{Inflation}.
\begin{figure}[ht]
\centering
\begin{tabular}{c c}
\begin{minipage}{3.70cm}
\includegraphics[width=4.0cm]{figure/enum_writer_py4}
\end{minipage}
&
\begin{minipage}{3.70cm}
\includegraphics[width=4.0cm]{figure/enum_dblp_py4}
\end{minipage}
\\
(a) Varying $k$ (Writer)
&
(b) Varying $k$ (DBLP)
\end{tabular}
\caption{Comparison among algorithms of \texttt{EnumAlmostSat}}
\label{fig:enum}
\end{figure}
\smallskip
\noindent{\textbf{Left-anchored traversal vs Right-anchored traversal}.}
Recall that the left-anchored traversal is based on an initial solution $H_0 = (L_0, \mathcal{R})$. A symmetric option is to use an intial solution $H_0' = (\mathcal{L}, R_0)$ as described in Section~\ref{subsec:iTraversal}. We compare these two options by varying $k$ and measuring the running of time of returning the first 1,000 MBPs.
{ The results are put in the technical report \cite{TR} for sake of the space.}
We observe from the results that these two options have similar results. { For left-anchored traversal, the scale of its solution graph depends on both sides, e.g., the number of almost-satisfying graphs is affected by $\mathcal{L}$ and the number of local MBPs within an almost-satisfying graphs is affected by both $\mathcal{L}$ and $\mathcal{R}$. There are no clear metrics to determine a dominating side.}
\subsection{Case Study: Fraud Detection}
\label{subsec:case-study}
{
{ In this case study, we investigate four types of cohesive subgraphs, namely biclique, $k$-biplex, $(\alpha, \beta)$-core, and $\delta$-quasi-biclique (abbreviated as $\delta$-QB), for a fraud detection task in face of camouflage attacks~\cite{DBLP:conf/kdd/HooiSBSSF16}.}
Specifically, we use the ``Amazon Review Data'' (the software category)~\cite{dataset}, which contains 459,436 reviews on 21,663 softwares by 375,147 users.
We then consider a scenario with the random camouflage attack~\cite{DBLP:conf/kdd/HooiSBSSF16},
which injects a fraud block with 2K fake users, 2K fake products (i.e., softwares), 200K fake comments, and 200k camouflage comments to the data.
The fake comments (resp. camouflage comments) are randomly generated between pairs of fake users and fake products (resp. real products) such that each fake user has an equal number of fake comments and camouflage ones.
The rationale behind the random camouflage attack is that in reality, fake users could be coordinated to comment on a set of products and/or deliberately post comments on some real products so as not to be spotted out~\cite{DBLP:conf/kdd/HooiSBSSF16}.
\if 0
We then find $k$-biplexes with different settings of $k$, namely 0, 1, and 2. When $k$=$0$, $k$-biplexes correspond to bicliques. We impose size constraints on the number of users (denoted by $\theta_L$) and the number of products (denoted by $\theta_R$) and find large $k$-biplexes with different sizes. { We also find $(\alpha,\beta)$-cores by setting $\alpha$=$\theta_R$ and $\beta$=$\theta_L$.}
\fi
{\color{red} { We then find four types of cohesive subgraphs, namely biclique, $k$-biplex (with $k=1$ and $k=2$), $(\alpha,\beta)$-core, and $\delta$-QB (with $\delta=0.01$, 0.1, 0.2 and 0.3).
For biclique, $k$-biplex and $\delta$-QB, we explore different size constraints on the number of users (denoted by $\theta_L$) and the number of products (denoted by $\theta_R$).} For $(\alpha,\beta)$-core, we explore different settings of $\alpha$ and $\beta$ with $\alpha$=$\theta_R$ and $\beta$=$\theta_L$.}
{ We classify all users and products that are involved in the found subgraphs as fake items and others as real ones.} We then measure the precision, recall and F1 score.
{
The results are shown in Figure~\ref{fig:case_study1}, where $\theta_L (\beta)$ is fixed at 4 and $\theta_R (\alpha)$ varies from 3 to 7.}
We have the following observations.
\begin{itemize}[leftmargin=*]
\item \textbf{$k$-biplex.}
It has both high precision and high recall with appropriate settings of $\theta_R$ (e.g., for $1$-biplex, it has precision around $90\%$ and recall around $100\%$ when $\theta_R = 5$).
This shows that in a scenario with random camouflage attacks, fake users and products can be effectively spotted out by finding $k$-biplexes. In this scenario, a group of fake users (e.g., those who are coordinated) would connect most of products in a pool (e.g., those that are to be promoted by paying the fake users) and deliberately disconnect few of the products, and this phenomenon is effectively captured by $k$-biplexes. { In addition, we find that $k$-biplexes with a large $k$ would involve many disconnections and become less cohesive. Hence, small $k$'s are usually used for $k$-biplex in real applications, e.g., the setting $k=1$ achieves the best result for this fraud detection application.}
\item \textbf{biclique.}
{ It
usually has very low recall as shown in Figure~\ref{fig:case_study1}(b)} (e.g., it has recall around 55\% when $\theta_R = 4$ and close to 0 when $\theta_R \ge 5$), since biclique requires complete connections which is too strict. { We remark that if no users are found, the precision and F1 score are undefined, marked as ``ND'' in Figure~\ref{fig:case_study1}(a) and (c).}
\item \textbf{$(\alpha,\beta)$-core.}
It has high recall but very low precision, since it would usually find large but sparse subgraphs (e.g., it has precision below 25\% in all settings shown in the figure and not beyond 30\% even with larger $\alpha$'s). {
{ We note that all ($\alpha, \beta$)-cores found are connected.}
In addition, we observe that its precision grows as both $\alpha$ and $\beta$ become larger, but then the recall would drop. By exploring various settings of $\alpha$ and $\beta$, we find that when $\alpha=30$ and $\beta=12$, it has the best F1 score of 0.64, which is still worse than that of 1-biplex (i.e., 0.96).}
{ \item \textbf{$\delta$-QB.} With larger $\delta$'s, it would allow more disconnections in a $\delta$-QB, and thus the precision decreases and the recall increases. In addition, with larger $\theta_R$'s, it would find fewer $\delta$-QBs that are large, and thus the precision increases and the recall decreases. By trying various settings, we found that when $\delta=0.2$ and $\theta_R=6$, it has the best F1 score of 0.88, which is worse than that of 1-biplex. We also note that a $k$-biplex with the sizes of both sides at least $\theta$ is a $k/\theta$-QB, and a $\delta$-QB with the sizes of both sides at most $\theta$ is a $\lceil \theta\delta\rceil$-biplex. With typical settings of $k$ (e.g., below 5) and $\delta$ (e.g., a small real number below 1), $k$-biplexes are usually denser than $\delta$-QBs since for the latter, there could be possibly be many disconnections when the sizes are large.
}
\end{itemize}
In summary, $k$-biplexes are superior over other structures for fraud detection, as confirmed by the F1 scores shown in Figure~\ref{fig:case_study1}(c) (with the best of each method in bold).}
\begin{figure}[]
\centering
\centering
\begin{tabular}{c c}
\begin{minipage}{3.70cm}
\includegraphics[width=4.0cm]{figure/case_study_pre5}
\end{minipage}
&
\begin{minipage}{3.70cm}
\includegraphics[width=4.0cm]{figure/case_study_pre_quasi1}
\end{minipage}
\end{tabular}
\\
(a) Precision
\vspace{0.10in}
\\
\begin{tabular}{c c}
\begin{minipage}{3.70cm}
\includegraphics[width=4.0cm]{figure/case_study_rec5}
\end{minipage}
&
\begin{minipage}{3.70cm}
\includegraphics[width=4.0cm]{figure/case_study_rec_quasi1}
\end{minipage}
\end{tabular}
\\
(b) Recall
\vspace{0.10in}
\\
\begin{minipage}{8cm}
\includegraphics[width=8cm]{figure/c1}
\end{minipage}
\begin{minipage}{8cm}
\includegraphics[width=8cm]{figure/F1_quasi1}
\end{minipage}
\\
(c) F1 score
\caption{ Case Study: Fraud Detection}
\label{fig:case_study1}
\end{figure}
\section{Introduction}
\label{sec:introduction}
In many applications, two types of entities are involved and interact with each other. Some examples include (1) { social media} where users comment on articles~\cite{zhang2020overview}, (2) e-commerce services where customers post reviews on or purchase products~\cite{wang2006unifying}, (3) { collaboration networks where authors publish papers~\cite{ley2002dblp}}, etc. In these applications, the two types of entities and the interactions between them can be naturally modelled as a \emph{bipartite graph} {\color{red} with the entities being vertices and the interactions being edges.}
{
For a given bipartite graph, a \emph{dense}/\emph{cohesive} subgraph within it usually carries interesting information that can be used for solving practical problems such as fraud detection~\cite{yu2021graph,gangireddy2020unsupervised}, online recommendation~\cite{DBLP:conf/kdd/PoernomoG09a, DBLP:conf/icdm/GunnemannMRS11} and community search~\cite{DBLP:conf/ssdbm/HaoZW020,DBLP:journals/corr/abs-2011-08399}. }
{\color{red} For example,
in social networking applications, when a group of users are paid to promote a specific set of fake articles via retweets, the induced subgraph by these users and the articles would be dense. Identifying such dense subgraphs would help to detect the fake users and articles~\cite{gangireddy2020unsupervised}.
{ As a second example, in e-commerce services, after identifying a dense subgraph between customers and products, it would be natural to recommend {products to} those customers which disconnect the products within the subgraph
~\cite{amer2009group}.
}
}
Quite a few definitions have been proposed for a dense bipartite graph, including biclique~\cite{zhang2014finding},
$(\alpha,\beta)$-core~\cite{liu2019efficient},
$k$-bitruss~\cite{wang2020efficient},
$k$-biplex~\cite{DBLP:journals/sadm/SimLGL09,yu2021efficient},
$\delta$-quasi-biclique~\cite{DBLP:conf/cocoon/LiuLW08}, etc.
These definitions impose different requirements on the connections and/or disconnections within a subgraph. For example, biclique requires that any vertex from one side \emph{connects} \emph{all} vertices from the other side, $(\alpha, \beta)$-core requires that any vertex from one side \emph{connects} at least \emph{a certain} number of vertices from the other side, and $k$-biplex requires that any vertex from one side \emph{disconnects} \emph{at most} $k$ vertices from the other side, where $k$ is a small positive integer { specified by users}.
In this paper, we study the problem of enumerating \emph{\underline{M}aximal $k$-\underline{B}i\underline{P}lexes}, called \emph{MBP}s, for the following considerations.
First, $k$-biplex imposes a strict enough requirement on the connections within a subgraph yet allows some disconnections which are common in real applications (due to data quality issues such as { incomplete data}).
Second, $k$-biplex satisfies the \emph{hereditary property}~\cite{DBLP:journals/jcss/CohenKS08}, i.e., any subgraph of a $k$-biplex is { still a $k$-biplex}. This can be utilized to design efficient frameworks for { enumerating} MBPs (details will be discussed later).
Third, other definitions have some shortcomings when used for the aforementioned applications. Specifically,
(1)~biclique may impose a too strict requirement on the connections, i.e., with even one single connection missed from a biclique, the subgraph is no longer a biclique. (2)~$(\alpha, \beta)$-core and $k$-bitruss can be computed efficiently, but they
impose no constraints on the disconnections within a subgraph, i.e., a vertex may disconnect many vertices from the other side. (3)~$\delta$-quasi-biclique does not satisfy the hereditary property { so} enumerating the corresponding maximal structures is much harder than enumerating MBPs.
{\color{red} We { have conducted} some case studies, which show that $k$-biplex works better for fraud detection on e-commerce platforms and captures more cohesive subgraphs than other definitions including biclique and $(\alpha, \beta)$-core (details will be presented in Section~\ref{subsec:case-study}).}
\if 0
It has been used to find groups of stocks sharing similar price performance from stock market \cite{DBLP:journals/isci/SimLGL11,DBLP:journals/sadm/SimLGL09} and groups of proteins within the same domain from biological data \cite{DBLP:journals/sadm/SimLGL09}. Due to the noisy and incomplete data, MBP leads to more significant discoveries than using maximal bicliques \cite{DBLP:journals/isci/SimLGL11,DBLP:journals/sadm/SimLGL09}.
\fi
There are several existing methods, which can be used or adapted for enumerating MBPs. The first one is called \texttt{iMB}~\cite{DBLP:journals/sadm/SimLGL09,yu2021efficient}{, which} uses two prefix trees { to organize} the subsets of vertices of { the two} sides and searches MBPs with backtracking and various pruning strategies. Nevertheless, it suffers from { two} issues: (1) it is not scalable and cannot handle big graphs since most of its pruning techniques { rely highly} on some size constraints imposed on the $k$-biplexes to enumerate; (2) the delay, which represents the amount of { waiting time} for the next MBP { to return or for} the termination of the algorithm, is exponential w.r.t. the number of vertices of the bipartite graph. The second { baseline} is based on \emph{graph inflation}. Specifically, it first inflates a given bipartite graph into a general one by including an edge between every pair of two vertices at the same side and then enumerates all maximal $(k\!+\!1)$-plexes on the inflated general graphs (for which, the state-of-the-art is \texttt{FaPlexen}~\cite{DBLP:conf/aaai/ZhouXGXJ20}). Here, a $(k+1)$-plex on a general graph represents a subgraph, where each vertex $v$ disconnects at most $(k+1)$ vertices (including $v$) within the subgraph~\cite{DBLP:conf/sigmod/BerlowitzCK15}. The correctness of this method is based on the fact that a $k$-biplex on the bipartite graph corresponds to a $(k+1)$-plex on the inflated general graph. Nevertheless, the graph inflation step would usually generate very dense graphs
and enumerating $(k+1)$-plexes on a dense graph is rather time-consuming.
{ In this paper, we adopt a \emph{reverse search} framework~\cite{DBLP:journals/jcss/CohenKS08} which we call \texttt{bTraversal} for enumerating MBPs. \texttt{bTraversal} is originally designed for enumerating maximal subgraph structures that satisfy the hereditary property (each such structure is called a \emph{solution}).
The key insight is that given a solution $H$, it is possible to find another solution by \emph{excluding} some existing vertices from $H$ and then \emph{including} some new ones to $H$. %
Specifically, \texttt{bTraversal} involves two steps. First, it finds one solution $H_0$ as the initial one, which can be any one among all solutions.
Second, it finds solutions from $H_0$ via a procedure of excluding and including vertices from and to $H_0$ and then recursively performs the procedure from those found solutions until no new solutions are found. Suppose we take each solution as a vertex and create a directed edge from solution $H$ to solution $H'$ if \texttt{bTraversal} can find $H'$ from $H$ via the aforementioned procedure of excluding and including vertices. Then, we obtain a graph structure on top of all { found} solutions, which is called a \emph{solution graph}~\cite{DBLP:conf/stoc/ConteU19}. We refer to the vertices and directed edges in the solution graph as nodes and links, respectively. Then, \texttt{bTraversal} corresponds to a \emph{depth-first search} (DFS) procedure over the solution graph. According to~\cite{DBLP:conf/stoc/ConteU19}, the solution graph constructed in this way is \emph{strongly connected} and thus \texttt{bTraversal} is able to enumerate all solutions starting from any solution.
}
Nevertheless, \texttt{bTraversal} is still insufficient in the following aspects. First, \texttt{bTraversal} requires that any solution should be reachable from any other solution in the solution graph (i.e., the solution graph is strongly connected) so that it can find \emph{all} solutions from \emph{any} initial solution. To fulfill this requirement, it would find many solutions from one solution. Consequently, the underlying solution graph tends to be dense and the DFS procedure on the solution graph would be costly. Note that the time complexity of DFS is proportional to the number of links in the solution graph.
Second, \texttt{bTraversal} is originally designed for general structures that satisfy the hereditary property, but not just for the $k$-biplexes. Consequently, it overlooks those unique characteristics of $k$-biplexes that would otherwise help to improve the algorithm.
Third, \texttt{bTraversal} does not support enumerating MBPs with size at least a threshold (called large MBPs) - it { has} to enumerate all MBPs first and then filter out the MBPs violating the size constraint, which is inefficient.
We observe that the requirement of a strongly connected solution graph by \texttt{bTraversal} is stronger than necessary. In fact, it would be sufficient as long as all solutions are reachable from some \emph{specific} solution since we can then start the DFS procedure from this solution { to} reach all solutions. Motivated by this observation, in this paper, we propose an improved framework called \texttt{iTraversal}, which { begins} DFS from a carefully selected solution. Specifically, it selects $H_0 = (L_0, \mathcal{R})$ as the initial solution, where $\mathcal{R}$ is the set containing all vertices from the right side of the bipartite graph and $L_0$ is any maximal set of vertices from the left side with $(L_0, \mathcal{R})$ being a $k$-biplex. With this designated initial solution, \texttt{iTraversal} makes it possible to significantly sparsify the solution graph that is defined by \texttt{bTraversal} while maintaining that all solutions are reachable from this initial solution. Specifically, we develop a series of three techniques for sparsifying the solution graph, namely (1) left-anchored traversal, (2) right-shrinking traversal, and (3) exclusion strategy. Technique (1) is based on a discovery that in one step of \emph{including} vertices { to generate new} solutions from a certain solution, pruning all vertices on the right side from being included would still guarantee that all solutions are reachable from { our} initial solution. Technique (2) is based on another discovery that by retaining only those links from a solution $H= (L, R)$ to another solution $H' = (L', R')$ with $R'\subseteq R$ and removing all { the} other links, all solutions are still reachable from the initial solution. Technique (3) is a technique that prunes a vertex from being included { to find new} solutions from a solution if the vertex appears in an \emph{exclusion set} that is maintained during the running { of \texttt{iTraversal}}.
Based on our experimental results, the number of links in the solution graph of \texttt{iTraversal} sparsified with the three techniques is about 0.1\% of that in the original solution graph of \texttt{bTraversal}.
{ In summary, our major contributions are { summarized} as follows.
\begin{itemize}[leftmargin=*]
\item We propose a new framework \texttt{iTraversal} for enumerating MBPs. We further develop three techniques, namely left-anchored traversal, right-shrinking traversal, and exclusion strategy, for sparsifying the solution graph under \texttt{iTraversal}. We prove that the delay of finding the next solution with \texttt{iTraversal} is \emph{polynomial} w.r.t. the number of vertices and improves that of the conventional \texttt{bTraversal} { framework} (Section~\ref{sec:Traversal}).
{ We remark that (1) the first two techniques are novel and work only with \texttt{iTraversal} but not with \texttt{bTraversal} and (2) the third technique was proposed for \texttt{bTraversal} but its correctness for \texttt{iTraversal}, which is not trivial to prove, is verified in this paper.}
\item We design { an efficient algorithm for a key procedure} that is involved in the \texttt{iTraversal} framework, which is to enumerate solutions within a graph that \emph{almost} satisfies the definition of $k$-biplex
(Section~\ref{sec:enumalmostsat}).
\item {\color{red} We extend \texttt{iTraversal} to enumerate those MBPs with the size of at least a threshold (i.e., large MBPs) without enumerating all MBPs, which is not possible { when using} the conventional \texttt{bTraversal}} { framework} (Section~\ref{sec:size-constrained}).
\item We conduct extensive experiments on both real and synthetic datasets, which verify that { (1) $k$-biplex works better in a fraud detection task than some other structures including biclique and $(\alpha, \beta)$-core and captures cohesive subgraphs and} { (2) the proposed algorithms with new techniques are up to { four} orders of magnitude faster than existing algorithms including the one based on \texttt{bTaversal} (Section~\ref{sec:exp}).}
\end{itemize} }
{ { Among other sections, we define our} problem in Section~\ref{sec:problem}, review the related work in Section~\ref{related} and conclude the paper in Section~\ref{sec:conclusion}.}
\if 0
Bipartite graphs are widely used to model diverse real-world applications with two different types of entities, such as user-product networks \cite{wang2006unifying}, collaboration networks \cite{ley2002dblp}, costumer-webpage networks \cite{beutel2013copycatch} and gene co-expression networks \cite{kaytoue2011mining}. Many mining tasks have been proposed on these bipartite graphs, among which some focus on discovering dense or cohesive structures to characterize the whole networks. Consequently, various dense structures extended from unipartite graphs have been investigated extensively, e.g., biclique \cite{kloster2019mining, zhang2014finding}, bitruss \cite{wang2020efficient}, $(\alpha,\beta)$-core \cite{liu2019efficient}, butterfly \cite{sanei2018butterfly}, etc. Among those structures, biclique with fully connected edges between two disjoint vertex sets is recognized as a natural extension to bipartite graphs. However, its strict definition limits flexibilities and practicalities in many real-world applications. For example, we would lose some solutions due to the inevitable noisy and missing data during the collection process. In addition, we sometimes are required to find structures that are similar to but not exactly the same as bicliques.
Motivated by this, we shift from bicliques to \emph{$k$-biplexes} which correspond to the traditional bicliques with $k$ of missing edges tolerable. To be specific, a $k$-biplex with two disjoint vertex sets $L$ and $R$ is a subgraph of the bipartite graph, such that each vertex in $L(R)$ is allowed to be disconnected from at most $k$ vertices in $R(L)$. To reduce redundancies, we propose to study \emph{maximal} $k$-biplex enumeration problem in the paper, which enumerates all maximal $k$-biplexes in a given bipartite graph. For instance, Figure. \ref{fig:example_case} depicts a maximal 1-biplex (on the right) of a given example graph (on the left), where dashed lines mean missing edges, i.e., $(v_0,u_4)$, $(v_2,u_3)$ and $(v_3,u_0)$. It is clear that each vertex on both side misses at most 1 edge.
\begin{figure}[]
\centering
\includegraphics[width=0.88\linewidth]{draft/figure/example_case}
\vspace{-0.10in}
\caption{A user-movie network.}
\label{fig:example_case}
\vspace{-0.10in}
\end{figure}
{
\noindent{\textbf{Applications.}} Enumerating maximal $k$-biplexes can be easily incorporated in various real applications.
\noindent{$\bullet$} \textit{Fake news detection.}
In social media, there exist groups of fake users employed by companies to propagate fake news, i.e., articles or comments with fabricated contents \cite{zhang2020overview}. Therefore, extensive studies have devoted efforts to solve the fake news detection problem \cite{shu2019defend,yang2019unsupervised}, which in turn makes fake users pretend to behave as normal users do.
In this case, fake users would seldom promote exactly the same group of fake news together,
i.e., the group of fake users and the group of news the users promote would not form a biclique structure since some edges are missing.
Therefore, biclique structures are not good choices for these applications.
A better choice is to use $k$-biplex
which tolerates some edges and also provides the flexibility for users to set different tolerance level.
\noindent{$\bullet$} \textit{Product Recommendation.}
In customer-product networks, an important task is to recommend products to a group of customers who have similar interests, i.e., sharing movies with a user's friends \cite{yuan2014generative, DBLP:conf/www/GorlaLR013,DBLP:journals/pvldb/Amer-YahiaRCDY09}. To address the issue of incomplete data with noisy and missing values, a fault-tolerant recommendation has been proposed where a key step is to discover cohesive customer groups \cite{DBLP:conf/kdd/PoernomoG09a, DBLP:conf/icdm/GunnemannMRS11},
which could potentially be captured by $k$-biplexs.
\noindent{$\bullet$} \textit{Protein network analysis.}
In protein-protein interaction networks, recent works aim to discover interacting pairs of protein groups.
These groups could be modeled as maximal $k$-biplexes instead of maximal bicliques based on two key observations. First, most-to-most interactions are more general in pairs of protein groups, while those all-to-all interactions are rarities \cite{tong2002combined}. Second, biological data is usually incomplete and noisy with low quality \cite{chiang2007coverage}. Therefore, $k$-biplex can not only fulfill the flexible requirements but also tolerate the missing data.
}
\noindent{\textbf{Existing Approaches and Challenges.}} In the existing literature, there are several distinct methods that can be adopted to solve our enumeration problem.
\noindent (1) \textit{Graph inflation.} Basically, $k$-biplex is a generalization of the well-studied $k$-plex. Here, a $k$-plex refers to a induced subgraph of the general graph such that each vertex is allowed to disconnected from most $k$ vertices (including itself). A $k$-biplex can be equivalently transformed to a $(k+1)$-plex by the graph inflation, which adds edges to each pair of vertices in the same side. The algorithms designed for the maximal $k$-plex enumeration problem can be adopted to list $k$-biplexes. In particular, \textit{FaPlexen} \cite{DBLP:conf/aaai/ZhouXGXJ20} is the state-of-the-art method which originates from the Bron-Kerbosch algorithm \cite{bron1973algorithm} and further improves the worst-case running time by employing a novel pivot heuristic and branching strategies. To utilize \textit{FaPlexen}, we need to inflate the bipartite graph to the general graph. However, the resulted dense graph with large number of edges limits its scalability and practicality. For example, a empty bipartite graph $G(L\cup R,E)$ with $|L|=|R|=n$ and $|E|=0$ would be inflated to a general graph with density $d=(n^2-n)/(2n^2-n)$ nearly 0.5.
\noindent (2) \textit{Tree-based methods.} One approach proposed in {\cite{DBLP:journals/sadm/SimLGL09}} for mining all maximal $k$-biplexes with size constraint, denoted as \textit{MQBminer}, is performed on constructed prefix trees by incorporating backtracking and branch-and-bound techniques to prune away some subtrees that cannot generate any maximal $k$-biplex. Its efficiency depends on the scale of search space, for which it thus employs several pruning strategies. However, most of their pruning techniques depend on a size constraint $\theta$, i.e., each side of a $k$-biplex has at least $\theta$ vertices, which become either inefficient or ineffective in the setting of $\theta=0$. Besides, the delay between two solutions is exponential of the size of the given graph in the worst case.
\noindent (3) \textit{Traversal-based methods.} Other techniques of solving an enumeration problem propose to iteratively employ a yielded maximal subgraph $S$ and a vertex $v$ not in $S$ to generate new maximal subgraphs, while ensuring all solutions can be found by continuing to this process until some stopping criterion is satisfied \cite{DBLP:conf/stoc/ConteU19, DBLP:journals/jcss/CohenKS08, DBLP:journals/siamcomp/TsukiyamaIAS77}. Following this framework, \cite{DBLP:conf/sigmod/BerlowitzCK15} implement an efficient algorithm to enumerating all maximal $k$-plexes in general graphs, which can be easily adopted to solve our problem. To be specific, it contains three key steps: (1) It starts with a random solution $S_0$ and iteratively constructs a new almost satisfied graph by adding a vertex $v$ that is not in $S_0$; (2) For each constructed graph, we enumerates all local maximal solutions $S'$; (3) For each local maximal solution $S'$, we extend it to global maximal solution $S_i$ and check the redundancy. Then, we repeat the same procedures for the new yielded solution until all of them are processed. To employ it for our problem, we need to adopt several sub-procedures, e.g., enumerating all local maximal $k$-plexes, to the $k$-biplex setting by graph inflation. Although it can guarantee a polynomial delay with respect to $k$, the bottleneck of first two steps, enumerating large number of vertices and local maximal solutions, lead to a dense solution graph with too many edges, which limits its scalability to large datasets.
\noindent{\textbf{Contributions.}} In this paper, we overcome these challenges and make the following contributions. Intuitively, the proposed algorithm is a traversal-based approach, where we aim to construct a sparse solution graph via employing less vertices and local maximal solutions to generate the next solution.
\noindent{(1)} \textit{One-side traversal.}
Since the existing approach starts the algorithm with a random solution, we propose to begin with a particular initial solution. The unique property of the initial solution allows it to only add one side vertices of the given bipartite graph to the yielded solutions in the first step, which highly reduces the number of recursive calls and leads to a sparse solution graph.
\noindent{(2)} \textit{Non-increasing traversal.} Based on the one-side traversal strategy, we propose to further reduce links in solution graphs, resulting in traversing along some particular links called non-increasing links. Note that the remaining links correspond to a kind of generation between two solutions. Specifically, we only allow the generation from $S_i(X_i,Y_i)$ to $S_{i+1}(X_{i+1},Y_{i+1})$ such that $Y_{i+1}\subseteq Y_i$.
\noindent{(3)} \textit{Exclusion techniques.} We further enhance our one-side non-increasing traversal by incorporating the exclusion techniques, which would construct less almost satisfied graphs.
\noindent{(4)} \textit{Polynomial delay.} Combining above strategies, we propose a general framework to enumerate maximal subgraphs with particular properties in bipartite graphs, which not only work for $k$-biplexes. We further guarantee the delay of proposed algorithms is polynomial with respect to $k$.
\noindent{\textbf{Organization.}} The rest of the paper is organized as follows. Section \ref{sec:problem} presents the problem definition. Our main contribution of an efficient traversal-based framework is presented in Section \ref{sec:Traversal}. Section \ref{sec:enumalmostsat} provides a specific implementation of the key sub-procedure. Section \ref{sec:size-constrained} adopts the proposed algorithm to solve the size-constrained problem. Section \ref{sec:exp} reports experimental results on real and synthetic datasets. Section \ref{related} presents the related work. Section \ref{sec:conclusion} concludes the paper. {Due to space limitation, for some lemmas, we show the complete proof in the technical report.}
\fi
\section{Related Work}
\label{related}
{
\noindent{\textbf{Dense subgraphs of bipartite graphs.}}
Extensive studies have been conducted on finding and/or enumerating dense subgraphs of bipartite graphs, including bicliques \cite{zhang2014finding,DBLP:conf/ijcai/AbidiZCL20,mukherjee2016enumerating,DBLP:journals/pvldb/LyuQLZQZ20,DBLP:journals/corr/abs-2007-08836,kloster2019mining}, $(\alpha,\beta)$-cores \cite{liu2019efficient}, $k$-biplexes~\cite{DBLP:journals/sadm/SimLGL09,yu2021efficient}, $k$-bitrusses \cite{DBLP:conf/dasfaa/Zou16,wang2020efficient} and quasi-bicliques \cite{DBLP:conf/cocoon/LiuLW08,wang2013near,ignatov2018mixed,DBLP:conf/icfca/Ignatov19}.
Existing studies of bicliques focus on maximal biclique enumeration~\cite{zhang2014finding,DBLP:conf/ijcai/AbidiZCL20,mukherjee2016enumerating,kloster2019mining} and maximum biclique discovery~\cite{DBLP:journals/pvldb/LyuQLZQZ20,DBLP:journals/corr/abs-2007-08836}.
$(\alpha,\beta)$-cores have been used in applications such as recommendation systems~\cite{ding2017efficient} and community search~\cite{DBLP:conf/ssdbm/HaoZW020,DBLP:journals/corr/abs-2011-08399}.
Existing studies of $k$-biplexes focus on large maximal $k$-biplex enumeration~\cite{DBLP:journals/sadm/SimLGL09,yu2021efficient}.
A $k$-bitruss~\cite{DBLP:conf/dasfaa/Zou16,wang2020efficient} is a bipartite graph where each edge is contained in at least $k$ butterflies,
where a butterfly corresponds to a complete 2$\times$2 biclique~\cite{DBLP:journals/pvldb/WangLQZZ19}.
There are two types of definition for a quasi-biclique $H=(L,R)$, namely (1) $\delta$-quasi-biclique~\cite{DBLP:conf/cocoon/LiuLW08}, where each vertex in $L$ (resp. $R$) misses at most $\delta \cdot |R|$ (resp. $\delta \cdot |L|$) edges with $\delta\in [0,1)$) and (2) $\gamma$-quasi-biclique~\cite{ignatov2018mixed}, where at most $\gamma \cdot |L|\cdot|R|$ edges can be missed with $\gamma\!\in\! [0,1)$.
Existing studies of quasi-bicliques focus on finding the maximum quasi-biclique \cite{DBLP:conf/cocoon/LiuLW08,wang2013near,ignatov2018mixed,DBLP:conf/icfca/Ignatov19}. { There are some other studies which find subgraphs with a certain density and degree~\cite{DBLP:conf/kdd/MitzenmacherPPT15,DBLP:conf/bigdata/LiuSC13}.}
In this paper, we focus on $k$-biplex for reasons as discussed in Section~\ref{sec:introduction} (i.e., $k$-biplex imposes strict enough requirements on connections within a subgraph, tolerates some disconnections, and satisfies the hereditary property).}
\smallskip
\noindent{\textbf{Maximal subgraphs enumeration.}}
In general, there are two types of methodology, namely Bron-Kerbosch scheme~\cite{bron1973algorithm} and reverse search~\cite{DBLP:journals/dam/AvisF96,DBLP:journals/jcss/CohenKS08},
for enumerating maximal subgraphs of desired properties.
The original Bron-Kerbosch (BK) algorithm is proposed in \cite{bron1973algorithm} for enumerating maximal cliques.
BK uses branch-and-bound and backtracking to filter out the branches that cannot yield desired subgraphs.
Quite a few variants of BK have been proposed for solving various enumeration problems, including (bi)cliques~\cite{DBLP:journals/tcs/TomitaTT06,DBLP:journals/jea/EppsteinLS13,zhang2014finding,DBLP:conf/ijcai/AbidiZCL20}, $k$-plexes~\cite{DBLP:conf/aaai/ZhouXGXJ20,DBLP:conf/kdd/ConteMSGMV18}, signed cliques~\cite{chen2020efficient,DBLP:journals/tkde/LiDQWXYQ21}, motif cliques~\cite{DBLP:conf/icde/HuCCSFL19}, temporal cliques~\cite{DBLP:journals/snam/HimmelMNS17}, quasi-bicliques~\cite{DBLP:journals/sadm/SimLGL09} and etc.
{ However, the time complexity of BK and its variants is polynomial w.r.t. the worst-case number of desired subgraphs.}
In addition, these algorithms output desired subgraphs with exponential delay.
Reverse search was first proposed as a general framework for enumerating subgraphs~\cite{DBLP:journals/dam/AvisF96}.
It defines a ``successor'' function to traverse from one solution to the others, which corresponds to a DFS on an implicit solution graph where the nodes represent desired subgraphs and the links capture the traversals from desired subgraphs to other desired subgraphs.
{
Recently, this framework has been adopted to solve various enumeration problems, e.g., independent sets \cite{DBLP:journals/siamcomp/TsukiyamaIAS77,DBLP:conf/spire/ConteGMUV17}, cliques \cite{DBLP:conf/swat/MakinoU04,DBLP:journals/algorithmica/ChangYQ13,DBLP:journals/algorithmica/ConteGMV20}, {\color{red} $k$-plexes~\cite{DBLP:conf/sigmod/BerlowitzCK15}, and general structures that satisfy the hereditary property \cite{DBLP:conf/stoc/ConteU19, DBLP:journals/jcss/CohenKS08,cao2020enumerating}}}.
The algorithms following this framework achieve an output-sensitive time complexity that is proportional to the number of desired subgraphs (within the input graph). Moreover, there is a polynomial time guarantee on the time cost per solution.
In this paper, we adopt the reverse search framework and develop various techniques for improving and instantiating the framework for enumerating maximal $k$-biplexes.
{ We note that our techniques of improving the framework for $k$-biplexes are new and different from those that were developed for other specific structures such as independent sets and cliques and the latter cannot be applied to $k$-biplexes.}
\section{The \texttt{iTraversal} Algorithm}
\label{sec:Traversal}
\begin{figure}[]
\centering
\includegraphics[width=0.77\linewidth]{figure/three_step_p1}
\vspace{-0.15in}
\caption{Input graph used throughout the paper.}
\label{fig:input_graph}
\vspace{0.12in}
\includegraphics[width=0.77\linewidth]{figure/three_step_p2}
\vspace{-0.15in}
\caption{Illustration of the \texttt{ThreeStep} procedure.}
\label{fig:three-step}
\end{figure}
{ We adopt a \emph{reverse search} framework which we call \texttt{bTraversal}~\cite{DBLP:journals/jcss/CohenKS08} for enumerating MBPs. \texttt{bTraversal} is a framework for enumerating maximal subgraph structures that satisfy the hereditary property. In the sequel, we review \texttt{bTraversal} in Section~\ref{subsec:bTraversal}.} We observe that \texttt{bTraversal} imposes a requirement that is more demanding than necessary and we relax it to achieve an improved framework called \texttt{iTraversal} in Section~\ref{subsec:iTraversal}. We then develop a series of three techniques, namely left-anchored traversal (Section~\ref{sec:one-side}), right-shrinking traversal (Section~\ref{sec:non-increasing}), and exclusion strategy (Section~\ref{sec:algorithm}) for further boosting \texttt{iTraversal}'s performance. Finally, we present a summary of \texttt{iTraversal} and its running time and delay in Section~\ref{sec:algorithm}.
\subsection{The Basic Framework: \texttt{bTraversal}}
\label{subsec:bTraversal}
The key insight of \texttt{bTraversal} is that given a solution $H$ (which corresponds to a set of vertices), it is possible to find another solution by \emph{excluding} some existing vertices from and \emph{including} some new ones to $H$.
The rationale is that (1) due to the hereditary property, $H$ is a $k$-biplex so it will still be a $k$-biplex after some vertices are excluded; and (2) after some vertices are excluded from $H$, it becomes possible to include some new vertices to $H$ while retaining the property and thus it finds another solution.
\begin{figure*}
\hspace*{-.4cm}
\centering
\begin{tabular}{c c c c c c c}
\begin{minipage}{3cm}
\includegraphics[width=3.5cm]{figure/s1}
\end{minipage}
&
&
\begin{minipage}{3.5cm}
\includegraphics[width=3.5cm]{figure/s2}
\end{minipage}
&
&
\begin{minipage}{3cm}
\includegraphics[width=3.5cm]{figure/s3}
\end{minipage}
&
&
\begin{minipage}{3.5cm}
\includegraphics[width=3.5cm]{figure/s4}
\end{minipage}
\\
(a) \texttt{bTraversal} ($\mathcal{G}$)
&
&
(b) Left-anchored traversal ($\mathcal{G}_L$)
&
&
(c) Right-shrinking traversal ($\mathcal{G}_R$)
&
&
(d) \texttt{iTraversal} ($\mathcal{G}_E$)
\end{tabular}
\caption{Solution graphs underlying different algorithms (based on the input graph in Figure~\ref{fig:input_graph}).}
\label{fig:solution_graph}
\end{figure*}
{Specifically, \texttt{bTraversal} first finds} one solution $H_0$ as the initial one, which can be any one among all solutions. This can be achieved easily, say, by iteratively including vertices to an initially empty set while retaining the $k$-biplex property until it is not possible to do so. {It then} finds solutions from $H_0$ via a procedure of excluding and including vertices from and to $H_0$ and recursively performs the procedure from those solutions found for finding more solutions until no new solutions are found. It uses the following three-step procedure for finding solutions from one solution $H$, which we call \texttt{ThreeStep}.
\begin{itemize}[leftmargin=*]
{
\item \textbf{Step 1 (Almost-satisfying graph formation).}
For each vertex $v\in V(G) \backslash V(H)$, it forms a new induced subgraph $G[V(H)\cup \{v\}]$ (or simply $G[H\cup v]$) by including $v$ to $H$. We call each such graph $G[H\cup v]$ an \emph{almost-satisfying graph} since it is not a $k$-biplex (since otherwise $H$ is not maximal) and would be so if one vertex, i.e., $v$, is excluded.
\item \textbf{Step 2 (Local solution enumeration).}
{ For each almost-satisfying graph $G[H\cup v]$, it enumerates all (induced) subgraphs $H_{loc}$ of $G[H\cup v]$ that (1) involve $v$, (2) are $k$-biplexes, and (3) are \emph{maximal} w.r.t. $G[H\cup v]$ (which means that there exists no vertex $u\in V(H)\cup \{v\} \backslash V(H_{loc})$ such that $G[H_{loc}, u]$ is a $k$-biplex).} Essentially, it solves the MBP enumeration problem with the input of $G[H\cup v]$, which should be much easier than the original one with the input $G$. We call such a subgraph $H_{loc}$ a \emph{local solution} since it is maximal locally w.r.t. $G[H\cup v]$ and may not be maximal w.r.t. $G$.
We call the procedure of enumerating all local solutions within an almost-satisfying graph $G[H\cup v]$ \texttt{EnumAlmostSat}. In Section~\ref{sec:enumalmostsat}, we present an implementation of \texttt{EnumAlmostSat}.
}
\item \textbf{Step 3 (Local solution extension).}
For each local solution $H_{loc}$, it extends $H_{loc}$ to a real solution $H'$ (i.e., $H'$ is maximal w.r.t. $G$), by iteratively including to $H_{loc}$ vertices from outside $H_{loc}$ until $H_{loc}$ becomes maximal w.r.t. $G$. We remark that during this step, for each local solution $H_{loc}$, it is extended to only one real solution $H'$, e.g., it includes vertices to $H_{loc}$ by following a pre-set order on all vertices.
\end{itemize}
\begin{example}
Consider the \texttt{ThreeStep} for finding $H_1$ from $H_0$ in Figure \ref{fig:three-step} with $k=1$. We (1) form an almost-satisfying graph $G[H_0,v_0]$ by including $v_0$ to $H_0$, (2) find a local solution $H_{loc}$ by excluding $u_4$ from $G[H_0,v_0]$ and (3) extend $H_{loc}$ to $H_1$ by including $v_1$ to $H_{loc}$ while retaining the $k$-biplex property.
\end{example}
{ We summarize the \texttt{bTraversal} algorithm in Algorithm~\ref{alg:btraversal}. A solution may be traversed from multiple solutions. To avoid duplication, a B-tree is used for storing those solutions that have been found, where the key of a solution is specified by the vertices of the solution (Line 1 and 7-8).}
\begin{algorithm}{}
\small
\caption{The algorithm: {\tt \textit{bTraversal}}.}
\label{alg:btraversal}
\KwIn{Bipartite graph $G=(\mathcal{L}\cup \mathcal{R},\mathcal{E})$, integer $k\geq 1$;}
\KwOut{All maximal $k$-biplexes;}
\textbf{Initialize} $H_0$ as any maximal $k$-biplex, B-tree $\mathcal{T}=\{H_0\}$\;
\texttt{ThreeStep}$(G, H_0,\mathcal{T})$\;
\SetKwBlock{Enum}{Procedure \texttt{ThreeStep}$(G, H,\mathcal{T})$}{}
\Enum{
(\textbf{Step 1}) \ForEach{ $v$ in $V(G)\backslash V(H)$ }{
(\textbf{Step 2}) \ForEach{ $H_{loc}$ in \texttt{EnumAlmostSat}$(G[H,v])$}{
(\textbf{Step 3})
Extend $H_{loc}$ to be a maximal $k$-biplex $H'$ with vertices from $V(G)\backslash V(H_{loc})$\;
\If{$H'\notin \mathcal{T}$}{
Insert $H'$ to $\mathcal{T}$\;
\texttt{ThreeStep}$(G, H',\mathcal{T})$\;
}
}
}
}
\end{algorithm}
Suppose we take each solution as a node and create a directed edge from solution $H$ to solution $H'$ if \texttt{bTraversal} can find $H'$ from $H$ via the above three-step procedure. Then, we obtain a graph structure on top of all solutions. This graph structure is called a \emph{solution graph}~\cite{DBLP:conf/stoc/ConteU19}, which we denote by $\mathcal{G}$. { We note that a solution graph is a multi-graph since from one solution $H$, \texttt{bTraversal} may find another solution $H'$ by forming different almost-satisfying graphs.} We refer to the vertices and directed edges in the solution graph as nodes and links, respectively, and reserve the former notions for those in the graph $G$. Then, \texttt{bTraversal} corresponds to a \emph{depth-first search} (DFS) procedure over the solution graph $\mathcal{G}$. According to~\cite{DBLP:conf/stoc/ConteU19}, the solution graph $\mathcal{G}$ is \emph{strongly connected} and thus \texttt{bTraversal} is able to enumerate all solutions starting from any solution.
{ To illustrate, consider the input graph in Figure \ref{fig:input_graph} with $k=1$. The corresponding solution graph is shown in Figure \ref{fig:solution_graph}(a), which is strongly connected with 10 solutions and 76 links.}
\subsection{An Improved Framework: \texttt{iTraversal}}
\label{subsec:iTraversal}
\texttt{bTraversal} makes a requirement that any solution is reachable from any other solution in the solution graph (i.e., the solution graph is strongly connected) so that it can find \emph{all} solutions from \emph{any} initial solution. To fulfill this requirement, it would find many solutions from one solution. To see this, consider the above three-step procedure \texttt{ThreeStep}, where $O(|V(G)|)$ almost-satisfying graphs are formed (Step 1), for each almost-satisfying graph, an exponential number of local solutions are enumerated (Step 2), and each local solution is extended to a real solution (Step 3). Consequently, the underlying solution graph would be dense and the DFS procedure on the solution graph would be costly. Note that the time complexity of DFS is proportional to the number of links in the solution graph.
We observe that the requirement of a strongly connected solution graph by \texttt{bTraversal} is stronger than necessary. In fact, it would be sufficient as long as all solutions are reachable from some \emph{specific} solution since we then can start the DFS procedure from this specific solution and reach all solutions. Motivated by this, in this paper, we propose an improved traversal framework called \texttt{iTraversal}, which performs the DFS procedure from some \emph{specific} but not \emph{arbitrary} solution on a solution graph. With a designated initial solution, \texttt{iTraversal} makes it possible to significantly sparsify the solution graph that is defined by \texttt{bTraversal} while maintaining that all solutions are reachable from the initial solution.
To illustrate, consider again the example in Figure~\ref{fig:input_graph}. The solution graph that is defined by \texttt{bTraversal} is shown in Figure~\ref{fig:solution_graph}(a), which involves 76 links and is strongly connected. One solution graph that could be defined by \texttt{iTraversal} is shown in Figure~\ref{fig:solution_graph}(d) and the initial solution that could be chosen by \texttt{iTraversal} is $H_0=(v_4,\{u_i\}_{i=0}^4)$. All solutions are reachable from $H_0$ in the sparsified solution graph with 13 links.
One immediate question is: \emph{what is a good initial solution $H_0$ among all possible solutions?} We consider two desiderata: (1) $H_0$ can be computed easily and (2) the solution graph defined by \texttt{bTraversal} can be sparsified significantly (by dropping some links from the solution graph) while all solutions are still kept reachable from $H_0$.
Our proposal is to use $H_0 = (L_0, \mathcal{R})$ as the initial solution, where $L_0$ is any maximal set of vertices from $\mathcal{L}$ with $(L_0, \mathcal{R})$ being a $k$-biplex~\footnote{An alternative proposal is $H_0 = (\mathcal{L}, R_0)$ that is defined symmetrically and all techniques proposed in this paper would still apply. These two proposals are symmetric and are evaluated empirically in experiments.}. To illustrate, consider the example in Figure~\ref{fig:input_graph} with $k=1$. We obtain $H_0=(L_0,\mathcal{R})$ where $L_0=\{v_4\}$ and $\mathcal{R}=\{u_0,u_1,u_2,u_3,u_4\}$. Next, we explain how $H_0$ meets the two desiderata.
Consider the first desideratum. We can construct $H_0$ easily as follows. First, we initialize $H_0$ as $(\emptyset, \mathcal{R})$. Note that $(\emptyset, \mathcal{R})$ is a $k$-biplex since there are no vertices at the left side (i.e., $\emptyset$) and for each vertex at right side (i.e., $\mathcal{R}$), it disconnects from no vertices from the left side. Second, we extend $H_0$ by iteratively including vertices from $\mathcal{L}$ while maintaining that $H_0$ is a $k$-biplex until this is not possible. At the end, $H_0$ corresponds to a maximal $k$-biplex, i.e., a solution. This process would check for each vertex from $\mathcal{L}$ whether it can be included to $H_0$, which is efficient.
Consider the second desideratum. With $H_0 = (L_0, \mathcal{R})$ as the initial solution, we are able to identify a set of paths to traverse from $H_0$ to all solutions { since $H_0$ includes $\mathcal{R}$ and can reach every solution by iteratively including vertices from the left side of the target solution and excluding vertices that are not in the target solution.}
Hence, we can drop a large amount of links that do not appear along any of these paths ({ details are in Section~\ref{sec:one-side} and Section~\ref{sec:non-increasing}}). In this way, the solution graph $\mathcal{G}$ could be sparsified significantly while retaining that all solutions are reachable from $H_0$, as shown in Figure \ref{fig:solution_graph}(d).
\if 0
With $H_0 = (L_0, R)$ as the initial solution, there are two implications. First, for any possible solution $H' = (L', R')$, it has $R'\subseteq R$ which indicates us to only use the left-anchored vertices to form almost-satisfying graphs. Second, its right side is the universal set, which indicates us to approach a solution by iteratively excluding vertices from the right side without including.
More details are given in the following subsections.
\fi
\subsection{\texttt{iTraversal}: Left-anchored Traversal}
\label{sec:one-side}
Let $H'' = (L'', R'')$ be any solution that is different from the initial solution $H_0=(L_0,\mathcal{R})$ and $\mathcal{P} = \langle H_0, H_1, ..., H_n\rangle$ be a path from $H_0$ to $H_n=H''$ in $\mathcal{G}$. Consider the first link among the path $\mathcal{P}$, i.e., $\langle H_0, H_1\rangle$. Recall that when finding $H_1$ from $H_0$ via the procedure \texttt{ThreeStep} in Section~\ref{subsec:bTraversal}, it first \emph{includes} a vertex $v\in V(G) \backslash V(H_0)$ for forming an almost-satisfying graph (Step 1). We observe that this vertex $v$ is always from the left side since $V(G)\backslash V(H_0) = \mathcal{L} \backslash L_0$. We call such a link, which is formed by including a vertex from the left side for forming an almost-satisfying graph in the procedure \texttt{ThreeStep}, as a \emph{left-anchored} link. { We note that left-anchored links are defined based on solutions but not intermediate ones (e.g., local solutions) and each link is either a left-anchored link or a non-left-anchored one.} { To illustrate, consider the link $\langle H_0,H_1 \rangle$ from $H_0$ to $H_1$ in Figure \ref{fig:three-step}.} It is a left-anchored link
since the almost-satisfying graph is formed by including vertex $v_0\in \mathcal{L}$.
\begin{figure}[t]
\centering
\includegraphics[width=0.82\linewidth]{figure/four_step_procedure}
\caption{
Illustration of the four-step procedure of finding a path involving only left-anchored links, i.e., $\mathcal{P}_L(H'')$ (black nodes denote the vertices in the target solution $H''$).}
\label{fig:four_step_procedure}
\end{figure}
Based on the above discussion, we know that the first link of any path from $H_0$ to $H''$ is a left-anchored link. This triggers the following question: \emph{can we always find a path from $H_0$ to $H''$, which involves left-anchored links only?} The answer is interestingly positive.
In the following, we present a procedure, which defines for any solution $H''$ a path $\langle H_0,H_1,...,H_n \rangle$ with $H_n=H''$ in $\mathcal{G}$, which traverses from $H_0$ to $H''$ and involves left-anchored links only. We denote this path by $\mathcal{P}_L(H'')$. Specifically, the procedure has four steps and maintains the following invariant (which can be proved by induction).
\begin{equation}
R'' \subseteq R_i, \text{~~for~~}i = 0, 1, ..., n
\end{equation}
\begin{itemize}[leftmargin=*]
\item \textbf{Step 1: Path initialization.} Initialize $i$ to be 0.
Note that $R'' \subseteq R_i = \mathcal{R}$ (basis step for proving the invariant).
\item \textbf{Step 2: Termination checking.} If $L'' \backslash L_i\! =\! \emptyset$, set $n\!=\!i$ and stop.
\item \textbf{Step 3: Path expanding.} Find another solution $H_{i+1}$ from $H_i$ via a \emph{left-anchored} link in $\mathcal{G}$ as follows:
\begin{itemize}
\item \textbf{Step 3.1.} Pick a vertex $v$ in $L'' \backslash L_i$ and form an almost-satisfying graph $G[H_i, v]$.
\item \textbf{Step 3.2.} Find a local solution $H_{i+1}' = (L_{i+1}', R_{i+1}')$ by extending $((L''\cap L_i) \cup \{v\}, R'')$ to be maximal within $G[H_i, v]$. Note that $((L''\cap L_i) \cup \{v\}, R'')$ is: (1) a subgraph of $G[H_i, v]$ (since $(L''\cap L_i) \subseteq L_i$ and $R''\subseteq R_i$) and (2) a $k$-biplex (since it is subgraph of $H''$).
\item \textbf{Step 3.3.} Extend $H_{i+1}'$ to be a MBP (within $G$), which we denote by $H_{i+1} = (L_{i+1}, R_{i+1})$. Note that $R''\subseteq R_{i+1}' \subseteq R_{i+1}$ (induction step for proving the invariant).
\end{itemize}
\item \textbf{Step 4: Repetition.} Increase $i$ by 1 and go to Step 2.
\end{itemize}
\begin{example}
\label{example:four-step}
Given solution $H''\!=\!(L'',R'')$, where $L''\!=\!\{v_1,v_2,v_4\}$ and $R''=\{u_0,u_1,u_2\}$, based on the input graph in Figure \ref{fig:input_graph} with $k=1$. We consider a path from $H_0=(L_0,\mathcal{R})$, where $L_0=\{v_4\}$, to $H''$ formed by the above procedure, as shown in Figure \ref{fig:four_step_procedure}. For the first round, we (1) initialize the path, (2) check $L''\backslash L_0=\{v_1,v_2\}$, (3.1) pick vertex $v_1$ and form an almost-satisfying graph $G[H_0,v_1]$, (3.2) find a local solution $(\{v_1,v_4\},\{u_0,u_1,u_2,u_3\})$ which includes $L''\cap L_0 \cup \{v_1\}=\{v_1,v_4\}$ and $R''$ and (3.3) extend it to a solution $H_1=(L_1,R_1)$ where $L_1=\{v_0,v_1,v_4\}$ and $R_1=\{u_0,u_1,u_2,u_3\}$. We repeat for the second round, (2) check $L''\backslash L_1=\{v_2\}$, (3.1) form an almost-satisfying graph $G[H_1,v_2]$, (3.2) find a local solution $(\{v_1,v_2,v_4\}, \{u_0,u_1,u_2\})$ which includes $L''\cap L_1 \cup \{v_2\}=\{v_1,v_2,v_4\}$ and $R''$ and (3.3) extend it to a solution $H_2=(L_2,R_2)$ where $L_2=\{v_1,v_2,v_4\}$ and $R_2=\{u_0,u_1,u_2\}$. Finally, we check $L_2\backslash L''=\emptyset$ and get $H_2=H''$.
\end{example}
\begin{lemma}
\label{lemma:left-anchored-path}
The procedure of finding the path $\mathcal{P}_L(H'')$ for a given solution $H''$ would always terminate and path $\mathcal{P}_L(H'')$ ends at $H''$, i.e., $H_n = H''$.
\end{lemma}
\begin{proof}
We first prove that the procedure would always terminate. To this end, we define a similarity measurement between two MBPs. Given two MBPs $H\! =\! (L, R)$ and $H'\! =\! (L', R')$, we define the \emph{similarity} between $H$ and $H'$, denoted by $S(H, H')$, as the number of vertices that are shared by $H$ and $H'$, i.e.,
\begin{equation}
S(H, H') = |V(H) \cap V(H')| = |L\cap L'| + |R\cap R'|.
\label{equation:solution-similarity}
\end{equation}
We deduce that $H_{i+1}$ shares at least one more vertex with $H''$ than $H_i$ for $i = 0, 1, ..., n-1$. That is,
\begin{equation}
S(H_{i+1}, H'')\! \ge\! S(H_i, H'') + 1, \text{~~for~~}i=0, 1, ..., n-1.
\end{equation}
This is because (1) both $R_{i+1}$ and $R_i$ include $R''$ (based on the invariant of the procedure); and (2) $L_{i+1}$ includes all vertices that are shared by $L_i$ and $L''$ and at least one vertex $v$ from $L''\backslash L_i$.
Therefore, we further deduce that the procedure would always stop since the similarity to $H''$ increases by at least 1 after each round and it is bounded by $|H''|$.
We then prove that $H_n = H''$ by contradiction. Suppose $H_n \neq H''$. { We deduce that $H''$ would not be an MBP since $H_n = (L_n, R_n)$ is a larger k-biplex containing $H''$, given (1) $H''\subseteq H_n$ (since $L''\backslash L_n = \emptyset$ which means $L'' \subseteq L_n$ and $R''\subseteq R_n$ based on the invariant), (2) $H''\neq H_n$ based on the assumption, and (3) $H_n$ is a $k$-biplex.} This leads to a contradiction.
\end{proof}
In conclusion, we succeed in finding for any solution $H''$ a path that traverses from $H_0$ to $H''$ and involves left-anchored links only in $\mathcal{G}$. Therefore, we propose to \emph{drop} all non-left-anchored links from $\mathcal{G}$. We denote the resulting solution graph by $\mathcal{G}_L$. { For example, $\mathcal{G}_L$ based on the input graph in Figure~\ref{fig:input_graph} is shown in Figure~\ref{fig:solution_graph}(b), which involves 41 links and all solutions are reachable from $H_0$.} It is clear that a DFS procedure from $H_0$ on $\mathcal{G}_L$, which we call the \emph{left-anchored traversal}, would return all solutions. We present this result in the following lemma.
\begin{lemma}
\label{lemma:left-anchored-traversal}
{
Given a bipartite graph $G=(\mathcal{L}\cup \mathcal{R},\mathcal{E})$ with an initial MBP $H_0 = (L_0,\mathcal{R})$, the left-anchored traversal enumerates all MBPs.
}
\end{lemma}
\smallskip\noindent\textbf{Remarks.}
{ We remark that the four-step procedure for finding the path $\mathcal{P}_L(H'')$ is a conceptual one for verifying the correctness of the left-anchored traversal only. The implementation of left-anchored traversal will be discussed in Section~\ref{sec:algorithm}.} { In addition, we note that the sparsified solution $\mathcal{G}_L$ is no longer strongly connected as $\mathcal{G}$ does.} To see this, consider that a solution in the form of $(\mathcal{L}, R_0)$ (formed by extending $(\mathcal{L}, \emptyset)$ to be an MBP). There exist no links going from this solution in $\mathcal{G}_L$ since its left side is full. In our experiments, we show that $\mathcal{G}_L$ is significantly sparser than $\mathcal{G}$, e.g., $\mathcal{G}_L$ has about 20$\times$ fewer links than $\mathcal{G}$ on average.
\subsection{\texttt{iTraversal}: Right-shrinking Traversal}
\label{sec:non-increasing}
\begin{figure}[]
\centering
\includegraphics[width=0.82\linewidth]{figure/shrinking_procedure}
\caption{ Illustration of the procedure for finding a path involving only right-shrinking links, i.e., $\mathcal{P}_R(H'')$ (the path with gray nodes refers to a new path after updating).}
\label{fig:shrinking_procedure}
\end{figure}
Consider a link from $H\! =\! (L, R)$ to $H'\! =\! (L', R')$ in $\mathcal{G}_L$. We say it is a \emph{right-shrinking link} iff $R'\! \subseteq\! R$.
Note that we focus on the right side for this definition.
Consider the path $\mathcal{P}_L(H'')\! =\! \langle H_0, H_1, ..., H_n\rangle$ from $H_0$ to a solution $H''$, where $H'' = H_n$, as defined in Section~\ref{sec:one-side}. We have two observations: (1) the first link (which is from $H_0$ to $H_1$) is a right-shrinking link since $R_1 \subseteq R_0$ and (2) the last link (which is from $H_{n-1}$ to $H_n$) is also a right-shrinking link since $R_n = R'' \subseteq R_{n-1}$ according to the invariant in Section~\ref{sec:one-side}. This triggers the following question: \emph{can we reach $H''$ from $H_0$ by traversing right-shrinking links only in $\mathcal{G}_L$?} The answer is interestingly also positive.
In the following, we present a procedure, which defines a path in $\mathcal{G}_L$ for any solution $H''$, which traverses from $H_0$ to $H''$ and involves right-shrinking links only. We denote this path by $\mathcal{P}_R(H'')$. Specifically, the procedure has four steps as follows. A visual illustration of the following procedure is shown in Figure \ref{fig:shrinking_procedure}.
\begin{itemize}[leftmargin=*]
\item \textbf{Step 1 (Path initialization).} Find the path $\mathcal{P}_L(H'')$ from $H_0$ to $H''$ via the four-step procedure in Section~\ref{sec:one-side} and initialize $\mathcal{P}_R(H'')$ to be $\mathcal{P}_L(H'')$.
\item \textbf{Step 2 (Termination checking).} Check if $\mathcal{P}_R(H'')$ involves only right-shrinking links; If so, stop; otherwise, let $\langle H, H'\rangle$ be the \emph{last} non-right-shrinking link in $\mathcal{P}_R(H'')$, $\mathcal{P}_1$ be the portion from $H_0$ to $H'$ in $\mathcal{P}_R(H'')$, and $\mathcal{P}_2$ be the portion from $H'$ to $H''$ in $\mathcal{P}_R(H'')$. Note that $\mathcal{P}_2$ involves right-shrinking links only.
\item \textbf{Step 3 (Path updating).}
\begin{itemize}
\item \textbf{Step 3.1.} Find the path $\mathcal{P}_{L}(H')$ from $H_0$ to $H'$ via the four-step procedure in Section~\ref{sec:one-side}.
\item \textbf{Step 3.2.} Update $\mathcal{P}_R(H'')$ by replacing $\mathcal{P}_1$ with $\mathcal{P}_{L}(H')$. Note that both $\mathcal{P}_1$ and $\mathcal{P}_{L}(H')$ start with $H_0$ and end at $H'$.
\end{itemize}
\item \textbf{Step 4 (Repetition).} Go to Step 2 for another round.
\end{itemize}
\begin{lemma}
\label{lemma:right-shrinking-path}
The procedure of finding the path $\mathcal{P}_R(H'')$ for a given solution $H''$ would always terminate and the found $\mathcal{P}_R(H'')$ involves right-shrinking links only.
\end{lemma}
\begin{proof}
We first prove that the procedure would always terminate with two steps.
First, we show that $H'$ at one round does not appear in $\mathcal{P}_2$ at a previous round by contradiction. Let $\langle H_{cur}, H_{cur}'\rangle$ be the last non-right-shrinking link at the current round and $\langle H_{pre}, H_{pre}'\rangle$ be that at the previous round. Suppose $H_{cur}'$ appears in the path $\mathcal{P}_2$ at the previous round. { There exist a path from $H_{cur}'$ to $H_{pre}'$
(since $H_{pre}'$ is in the current $\mathcal{P}_2$ from $H_{cur}'$ to $H''$)
and another one from $H_{pre}'$ to $H_{cur}'$
(since $H_{cur}'$ is in the previous $\mathcal{P}_2$ from $H_{pre}'$ to $H''$),
both involving right-shrinking links only. We then deduce that $R_{pre}'\subseteq R_{cur}'$ and $R_{cur}'\subseteq R_{pre}'$, which imply that $R_{cur}' = R_{pre}'$.
In addition, we have $R_{pre}'\subseteq R_{cur}$ based on the invariant in Section~\ref{sec:one-side} over the left-anchored sub-path $\langle H_{cur},...,H_{pre}'\rangle$.}
We deduce that $R_{cur}' = R_{pre}' \subseteq R_{cur}$, which leads to a contradiction to the fact that $\langle H_{cur}, H_{cur}'\rangle$ is non-right-shrinking link. Second, we deduce that $\mathcal{P}_2$ would involve at least one more new solution after each round, which further implies that the above procedure would always terminate since the number of unique solutions is bounded.
We then prove that the path $\mathcal{P}_R(H'')$ involves right-shrinking links only. This can be clearly verified by the Step 2 (Termination checking), i.e., the procedure only stops when $\mathcal{P}_R(H'')$ involves right-shrinking links only.
\end{proof}
In conclusion, we succeed in finding for any solution $H''$ a path that traverses from $H_0$ to $H''$ and involves right-shrinking links only in $\mathcal{G}_L$. Therefore, we propose to \emph{drop} all non-right-shrinking links from $\mathcal{G}_L$. We denote the resulting solution graph by $\mathcal{G}_R$. { For example, $\mathcal{G}_R$ based on the input graph in Figure~\ref{fig:input_graph} is shown in Figure~\ref{fig:solution_graph}(c), which involves 21 links and all solutions are reachable from $H_0$.} It is clear that a DFS procedure from $H_0$ on $\mathcal{G}_R$, which we call the \emph{right-shrinking traversal}, would return all solutions. We present this result in the following lemma.
\begin{lemma}
\label{lemma:right-shrinking-traversal}
{
Given a bipartite graph $G=(\mathcal{L}\cup \mathcal{R},\mathcal{E})$ with an initial MBP $H_0 \!=\! (L_0,\mathcal{R})$, the right-shrinking traversal lists all MBPs.
}
\end{lemma}
\begin{comment}
{
We then answer \textit{how to drop non-right-shrinking links during the traversal.} Consider a link $\langle H,H'' \rangle$, where $H=(L,R)$, formed by the
three-step procedure. Specifically, we (1) form an almost-satisfying graph $G[H,v]$, (2) get a local solution $H_{loc}=(L_{loc},R_{loc})$ and (3) extend $H_{loc}$ to another solution $H''=(L'',R'')$. A direct method is to check whether $R''\subseteq R$. If not, link $\langle H,H''\rangle$ is non-right-shrinking, for which we drop $H''$ without checking whether it has been yielded before.
However, (a) this lazy approach works after \texttt{ExtendToMax} which takes $\mathcal{O}(|V_G|(d+|H|))$ where $d$ is the maximum degree of vertices in $G$ (for each vertex $u\in V(G)\backslash H$, it needs $\mathcal{O}(d)$ to get $\delta(u,H)$ and $\mathcal{O}(|H|)$ to check each vertex in $H$);
(b) It ignores the effect of \texttt{ExtendToMax} on the number of right-shrinking links. We observe that the only requirement of \texttt{ExtendToMax} is to find a solution $H''\supseteq H_{loc}$. Although $H_{loc}$ can be extended to different solutions, \texttt{ExtendToMax} can pick any one as the output. As the total number of links is fixed in $\mathcal{G}_L$, the more non-right-shrinking links yielded, the sparser solution graph resulted.
To tackle these issues, observe that if \texttt{ExtendToMax} first extends $R_{loc}$, i.e., iteratively including a vertex to $R_{loc}$ from $\mathcal{R}\backslash R_{loc}$, it would priorly pick the solution that can lead to a non-right-shrinking link. Motivated by this, we propose a non-right-shrinking link boosting and early dropping strategy. If a vertex $u\in\mathcal{R}\backslash R_{loc}$ can be used to form a $k$-biplex $G[H_{loc},u]$, we can stop the extension and drop $H_{loc}$, which takes $\mathcal{O}(|L|(d+|H|))$.
}
{
\begin{example}
Given solution $H=(L,R)$, where $L=\{v_2,v_4\}$ and $R=\{u_0,u_1,u_2,u_4\}$, in Figure \ref{fig:three-step} w.r.t. $k=1$. Consider the three-step procedure for $H$, i.e., (1) form an almost-satisfying graph $G[H,v_3]$ and (2) get a local solution $H_{loc}=(L_{loc},R_{loc})$ where $L_{loc}=\{v_2,v_3,v_4\}$ and $R_{loc}=\{u_0,u_1,u_4\}$. Note that $H_{loc}$ can be extended to two solutions $H'=G[H_{loc}, v_0]$ and $H''=G[H_{loc},u_3]$. We see link $\langle H,H' \rangle$ is right-shrinking and link $\langle H,H'' \rangle$ is non-right-shrinking. If \texttt{ExtendToMax} returns $H'$, we cannot drop this link. However,
the proposed strategy can drop it as $H''=G[H_{loc},u_3]$ is a $k$-plex.
\end{example}
}
\end{comment}
\smallskip\noindent\textbf{Remarks.} { We remark that the four-step procedure for finding the path $\mathcal{P}_R(H'')$ is a conceptual one for verifying the correctness of the right-shrinking traversal only. The implementation of right-shrinking traversal will be discussed in Section~\ref{sec:algorithm}.} In addition, the right-shrinking traversal is on top of the left-anchored traversal. Besides leading to a sparser solution graph, it re-organizes the search space. { To be specific, any solution $H''=(L'',R'')$ reachable from $H=(L,R)$ in $\mathcal{G}_R$ must satisfy $R''\!\subseteq\! R$.}
One benefit is that it would be natural to impose some size constraints on the MBPs to be enumerated. { The traversal from solution $H=(L,R)$ can be pruned if $R$ shrinks below the size threshold (details will be presented in Section~\ref{sec:size-constrained})}.
\subsection{\texttt{iTraversal}: Summary and Analysis}
\label{sec:algorithm}
We present the \texttt{iTraversal} algorithm, which employs left-anchored traversal and right-shrinking traversal in Algorithm~\ref{alg:itraversal}. \texttt{iTraversal} differs from \texttt{bTraversal} in the following aspects. \underline{First}, it takes $(L_0, \mathcal{R})$ but not an arbitrary MBP as the initial solution, where $L_0$ is a maximal subset of $\mathcal{L}$ such that $(L_0, \mathcal{R})$ is a MBP (Line 1). \underline{Second}, in Step 1 of forming almost-satisfying graphs, it \emph{prunes} those vertices in $\mathcal{R}$ from consideration so that it would traverse along left-anchored links only (Line 5). This implements the left-anchored traversal. \underline{Third}, in Step 2 of enumerating local solutions, it \emph{prunes} those local solutions $H_{loc}$ for which there exists a vertex $u\in \mathcal{R}$ such that $u$ is not in $H_{loc}$ and $H_{loc}\cup \{u\}$ is a $k$-biplex (Line 7). These local solutions can be pruned since they can be extended to solutions with the right side containing a vertex that is not contained by the right side of the current solution, i.e., the links from the current solution to these solutions are non-right-shrinking links. This implements the right-shrinking traversal.
\begin{algorithm}{}
\small
\caption{The algorithm: {\tt \textit{iTraversal}}.}
\label{alg:itraversal}
\KwIn{Bipartite graph $G=(\mathcal{L}\cup \mathcal{R},\mathcal{E})$, integer $k\geq 1$ ;}
\KwOut{All maximal $k$-biplexes;}
\textbf{Initialize} $H_0=(L_0,\mathcal{R})$, B-tree $\mathcal{T}=\{H_0\}$\;
\texttt{iThreeStep}$(G, H_0,\mathcal{T})$\;
\SetKwBlock{Enum}{Procedure \texttt{iThreeStep}$(G, H,\mathcal{T})$}{}
\Enum{
(\textbf{Step 1}) \ForEach{ $v$ in $V(G)\backslash V(H)$}{
\lIf{$v$ in $\mathcal{R}$}{
\textbf{Continue;} //Left-anchored traversal
}
(\textbf{Step 2}) \ForEach{ $H_{loc}$ in \texttt{EnumAlmostSat}$(G[H,v])$}{
\lIf{there exists $u$ in $\mathcal{R}\backslash V(H_{loc})$ s.t. $G[H_{loc},\{u\}]$ is $k$-biplex}{
\textbf{Continue;} //Right-shrinking traversal}
(\textbf{Step 3})
Extend $H_{loc}$ to be a maximal $k$-biplex $H'$ with vertices from $V(G)\backslash V(H_{loc}) \backslash \mathcal{R}$\;
\If{$H'\notin \mathcal{T}$}{
Insert $H'$ to $\mathcal{T}$\;
\texttt{iThreeStep}$(G, H',\mathcal{T})$\;
}
}
}
}
\end{algorithm}
\smallskip
\noindent\textbf{Remark.} For \texttt{bTraversal}, it can be further enhanced with a so-called \emph{exclusion} strategy~\cite{DBLP:conf/sigmod/BerlowitzCK15}. { The idea is to maintain for each solution an \emph{exclusion} set once the solution is traversed and then prune the links towards those solutions which involve a vertex in the exclusion set. Details are referred to the technical report~\cite{TR}. We verify that this strategy is applicable to \texttt{iTraversal}, for which the correctness proof is included in the technical report~\cite{TR} for the sake of space.} In conclusion, \texttt{iTraversal} implements left-anchored traversal, right-shrinking traversal and the exclusion strategy. The solution graph underlying \texttt{iTraversal} is denoted by $\mathcal{G}_E$, which is even sparser than $\mathcal{G}_R$.
For example, $\mathcal{G}_E$ based on the input graph in Figure~\ref{fig:input_graph} is shown in Figure~\ref{fig:solution_graph}(d), which involves 13 links and all solutions are reachable from $H_0$.
\smallskip
\noindent\textbf{Total running time}.
Let $\alpha$ be the number of solutions.
The time cost of \texttt{iTraversal} is dominated by that of calling the \texttt{iThreeStep} procedure $\alpha$ times, each when a solution is found for the first time.
Consider the time cost of the \texttt{iThreeStep} procedure.
Let $\beta$ be the time complexity of the \texttt{EnumAlmostSat} procedure and $\gamma$ be the number of local solutions returned by the \texttt{EnumAlmostSat} procedure.
The \texttt{EnumAlmostSat} procedure is called $O(|\mathcal{L}|)$ times, costing $O(|\mathcal{L}|\cdot \beta)$ time.
{
There are $O(|\mathcal{L}|\cdot \gamma)$ local solutions and for each, the cost is the sum of $O(|\mathcal{R}|\cdot|H_{max}|)$ (for Line 7), $(|\mathcal{L}|\cdot |H_{max}|)$ (for Line 8), and $O(\log \alpha \cdot |H_{max}|)$ (for Line 9-11), where $H_{max}=(L_{max},R_{max})$ is the solution with the maximum size.
Therefore, the overall time complexity of \texttt{iTraversal} is $O(\alpha\cdot (|\mathcal{L}| \cdot \beta + |\mathcal{L}| \cdot\gamma \cdot (|V(G)|\cdot |H_{max}| + \log \alpha \cdot |H_{max}|)))$. Here, $\alpha$ is exponential w.r.t. the bipartite graph size. { $\beta=O((|L_{max}|\cdot|R_{max}|)^{k+1})$ and $\gamma=O((|L_{max}|\cdot|R_{max}|)^{k})$ are polynomial with $k$ as a constant and will be discussed in Section~\ref{sec:enumalmostsat}.
In a simpler form, the time complexity is $O(\alpha \cdot|\mathcal{L}|\cdot(|L_{max}|\cdot|R_{max}|)^{k+1} \cdot|V_G|\cdot|H_{max}|)$.}
}
\smallskip
\noindent\textbf{Delay}. The delay of an enumeration algorithm corresponds to the maximum of three parts, namely (1) the time spent after the algorithm starts and before the first solution is found, (2) the time spent between any two consecutive solutions are found, and (3) the time spent after the last solution is found and till the algorithm terminates.
With a small trick~\cite{takeaki2003two}, i.e., we print a solution before and after the recursive call (Line 11 of Algorithm~\ref{alg:itraversal}) in an alternating manner during the sequence of recursive calls, the algorithm would output at least one solution every two successive recursive calls of the \texttt{iThreeStep} procedure. { Therefore, the delay corresponds to the time complexity of the \texttt{iThreeStep} procedure, i.e., $O\big(|\mathcal{L}| \cdot \beta + |\mathcal{L}| \cdot\gamma \cdot (|V(G)|\cdot |H_{max}| + \log \alpha \cdot |H_{max}|))\big)$, which is polynomial with $k$ as a constant ($\beta$ and $\gamma$ are polynomial, which will be discussed in Section~\ref{sec:enumalmostsat}).
We remark that (1) \texttt{iTraversal} improves the delay of \texttt{bTraversal} based on the same implementation of \texttt{EnumAlmostSat}, which is $O\big(|V(G)| \cdot \beta + |V(G)| \cdot\gamma \cdot (|V(G)|\cdot |H_{max}| + \log \alpha \cdot |H_{max}|))\big)$; and (2) {\texttt{iMB}} and the graph inflation based algorithm \texttt{FaPlexen} have their delay exponential w.r.t. the size of the bipartite graph~\cite{yu2021efficient,DBLP:conf/aaai/ZhouXGXJ20}. }
\if 0
{ \smallskip\noindent\textbf{Remarks.} We note that recent studies on the maximal clique enumeration problem propose to sparsify the corresponding solution graph as trees \cite{DBLP:journals/algorithmica/ChangYQ13,DBLP:journals/algorithmica/ConteGMV20}. However, this is hard to achieve for $k$-biplex. This is because the cohesiveness of $k$-biplex is looser than that of (bi)clique and the number of MBPs is exponentially larger which leads to the high overlaps, e.g., the number of links in solution graph exponentially increases w.r.t $k$ (as shown in Figure \ref{fig:strategy}(c)). }
\fi
\section{Acknowledgement}
The research of Cheng Long and Kaiqiang Yu is supported by the Ministry of Education, Singapore, under its Academic Research Fund (Tier 2 Award MOE-T2EP20220-0011 and Tier 1 Award RG20/19 (S)) and by the Nanyang Technological University Start-Up Grant from the College of Engineering under Grant M4082302. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not reflect the views of the Ministry of Education, Singapore. The research of Shengxin Liu is supported by the National Natural Science Foundation of China under Grant 62102117. The research of Da Yan is supported by NSF OAC-1755464 (CRII).
\section{Problem Definition}
\label{sec:problem}
In this paper, we consider an undirected and unweighted bipartite graph $G = (\mathcal{L} \cup \mathcal{R},\mathcal{E})$ with two disjoint vertex sets $\mathcal{L}$, $\mathcal{R}$ and an edge set $\mathcal{E}$. $\mathcal{L}$ and $\mathcal{R}$ are supposed to be on the left and right side, respectively.
{ We denote by $V(G)$ the set of vertices in $G$, i.e., $V(G) = \mathcal{L} \cup \mathcal{R}$, and by $E(G)$ the set of edges in $G$, i.e., $E(G) = \mathcal{E}$.}
{ Given $L \subseteq \mathcal{L}$ and $R \subseteq \mathcal{R}$, the {\em induced (bipartite) subgraph} $G[L \cup R]$ of $G$ consists of the set of vertices $L\cup R$ and the set of edges between $L$ and $R$.}
{
Note that all subgraphs mentioned in this paper refer to induced subgraphs, and we use $H$ or $(L,R)$ as a shorthand of $H=G[L\cup R]$.}
{
Given $v\in \mathcal{L}$ and $R\subseteq \mathcal{R}$,
we define $\Gamma(v, R)$ (resp. $\overline{\Gamma}(v, R)$) to be the set of vertices that are in $R$ and connect (resp. disconnect) $v$, i.e., $\Gamma(v, R)=\{u\mid (v,u)\in \mathcal{E} \text{ and } u \in R \}$ (resp. $\overline {\Gamma}(v, R)=\{u\mid (v,u)\not \in \mathcal{E} $ and $u \in R \}$).
Note that $\Gamma(v, R) \cup \overline{\Gamma}(v, R) = R$.
In addition, we define $\delta(v,R) = |\Gamma(v, R)|$ and $\overline {\delta}(v,R) = |\overline {\Gamma}(v, R)|$.
Given $u\in \mathcal{R}$ and $L\subseteq \mathcal{L}$,
$\Gamma(u,L)$ (resp. $\overline {\Gamma}(u,L)$) and $\delta(u,L)$ (resp. $\overline {\delta}(u,L)$) are similarly defined. Next, we introduce the cohesive bipartite structure $k$-biplex that is exploited in this paper.
}
\begin{definition}[$k$-biplex \cite{DBLP:journals/sadm/SimLGL09}]
{ Let $k$ be a positive integer.} An induced subgraph $G[L \cup R]$ of a bipartite graph $G$ is said to be a {\em $k$-biplex} if { (1) $\overline {\delta}(v,R) \leq k$, $\forall v \in L$ and (2) $\overline {\delta}(u,L) \leq k$, $\forall u \in R$.}
\label{definition:k-biplex}
\end{definition}
For a $k$-biplex, parameter $k$ represents the number of missing edges that each vertex in $G[L\cup R]$ can tolerate.
{ We note that it is possible to use different $k$'s at different sides and the techniques developed in this paper can be easily adapted to this case.}
Moreover, the $k$-biplex structures satisfy the \emph{hereditary property}~\cite{DBLP:journals/jcss/CohenKS08}, which we present in the following lemma.
\begin{lemma} [Hereditary Property]
If $H=(L,R)$ is a $k$-biplex, any subgraph $H'=(L',R')$ of $H$ with $L'\subseteq L, R'\subseteq R$ is a $k$-biplex.
\end{lemma}
This can be easily verified by the fact that with some vertices excluded from a $k$-biplex, each remaining vertex has the number of disconnections non-increasing, i.e., still bounded by $k$.
As there might exist a large number of $k$-biplexes, one common practice is to return a compact representation of the set of all $k$-biplexes, namely the set of all \emph{maximal $k$-biplexes}.
\begin{definition}[Maximal $k$-biplex]
A $k$-biplex $G[L\cup R]$ is said to be \emph{maximal} if and only if there is no other $k$-biplex $G[L'\cup R']$ which is a superset of $G[L\cup R]$ (i.e., $L \subseteq L'$ and $R \subseteq R'$).
\label{definition:maximal-k-biplex}
\end{definition}
In this paper, we use MBP as a shorthand of maximal $k$-biplex when the context is clear.
We are ready to formalize the problem exploited in this paper:
\begin{problem}[Maximal $k$-biplex Enumeration \cite{DBLP:journals/sadm/SimLGL09}]
Given a bipartite graph $G = (\mathcal{L} \cup \mathcal{R}, \mathcal{E})$ and a positive integer $k$,
the {\em Maximal $k$-biplex Enumeration Problem} aims to report all MBPs.
\end{problem}
We call each maximal induced subgraph of graph $G$ that is a $k$-biplex as a \emph{solution}. The maximal $k$-biplex enumeration problem is to enumerate all solutions. We use the terms ``maximal $k$-biplex (MBP)'' and ``solution'' interchangeably throughout this paper.
\if 0
In some real applications, small cohesive subgraphs, e.g., communities with one or two members, are not significant. However, a maximal $k$-biplex can be small, e.g., an independent set of $2\times k$ vertices. To bridge the gap, we propose the size-constrained problem.
\begin{problem}[Large Maximal $k$-biplex Enumeration (LMax$k$BE) \cite{DBLP:journals/sadm/SimLGL09}]
Given a bipartite graph $G = (\mathcal{L} \cup \mathcal{R}, \mathcal{E})$, a positive integer $k$ and a non-negative integer $\theta$, the {\em Large Maximal $k$-biplex Enumeration Problem} aims to report all MBPs $H=(L,R)$ that are of size larger than $\theta$, i.e., $|L|\geq \theta$ and $|R|\geq \theta$.
\end{problem}
\fi
\if 0
\noindent\textbf{Relationship with Biclique.}
A biclique corresponds to a bipartite graph, where each vertex at one side is linked to each vertex at the other side \cite{zhang2014finding}, i.e., a counterpart of clique in bipartite graphs. It is clear that a $k$-biplex with $k=0$ reduces to a \emph{biclique}. That is, conventional bicliques are special instances of $k$-biplexes. Therefore, the techniques developed in this paper can be used for enumerating maximal bicliques, but not vice versa.
\smallskip\noindent\textbf{Relationship with $k$-plex.}
A $k$-plex corresponds to an induced subgraph of a \emph{general graph},
where each vertex in the subgraph disconnects at most $k$ vertexes (including itself) in the same subgraph.
Note that a $k$-plex with $k = 1$ reduces to a clique.
Note that a $k$-biplex in a bipartite graph $G(\mathcal{L} \cup \mathcal{R}, \mathcal{E})$ would become a \emph{$(k+1)$-plex} in a ``inflated'' graph $G'(\mathcal{L}\cup \mathcal{R}, \mathcal{E}')$ by creating an edge between any two vertexes at the same side, i.e., $\mathcal{E}' = \mathcal{E} \cup \{(u, u') | u\in \mathcal{L}, u'\in \mathcal{L}\} \cup \{(v,v')|v\in \mathcal{R}, v'\in \mathcal{R}\}$.
Note that $G'$ becomes a non-bipartite graph.
This is because before the ``inflation'', each vertex in the $k$-biplex disconnects at most $k$ vertexes from the other side, and after the ``inflation'', each vertex would disconnects at most $(k+1)$ vertexs \emph{from both sides} (including at most $k$ from the other side and exactly $1$ from the same side).
Therefore, a baseline solution for the MBP enumeration problem could be one with two steps: (1) to inflate the bipartite graph by creating edges among vertexes at the same side and (2) to execute an existing algorithm for enumerating maximal $k$-plexes on the inflated graph.
While this baseline makes it possible to leverage existing algorithms for $k$-plexes, it suffers a severe scalability issue. For example, for a sparse bipartite graph $G(\mathcal{L}\cup \mathcal{R}, \mathcal{E})$ with no edges and $|\mathcal{L}|$=$|\mathcal{R}|$=$n$, the inflated graph $G'$ would have a density $d$=$(n^2-n)/(2n^2-n)$ nearly 50\%.
As will be shown in our empirical study, this baseline (with the state-of-the-art algorithm for $k$-plexes) cannot run in a reasonable amount of time (e.g., 24 hours) on a graph with about 100K vertexes.
\noindent\textbf{Relationship with proportional quasi-biclique.}
A $\delta$-quasi biclique ($\delta\in (0,0.5]$ is a real number) corresponds to a bipartite graph, where each vertex in one side connects at least $(1-\delta)\times 100\%$ of vertices in the other side \cite{DBLP:conf/cocoon/LiuLW08}.
The tolerance (number of missing edges) of a $\delta$-quasi-biclique $H=(L,R)$ is relative to $L$ and $R$ instead of a constant. Hence,
it does not have hereditary property, i.e., an induced subgraph of $\delta$-quasi-biclique may not be a $\delta$-quasi-biclique. This poses a critial issue in efficient mining of $\delta$-quasi-biclique.
A $k$-biplex $H=(L,R)$ is such a quasi-biclique where $\delta=k/\min (|L|,|R|)$. Hence, the MBPs returned by LMax$k$BE would be a set of $k/\theta$-quasi-bicliques. \fi
\begin{comment}
\begin{table}
\scriptsize
\small
\centering
\caption {Notations and meanings.}\label{tab:notation}
\vspace{-0.15in}
\begin{tabular}{c|l}
\hline
{\bf Notation} & {\bf Meaning}\\
\hline\hline
$G(L\cup R,E)$ & a bipartite graph with vertex set $L$, $R$ and edge set $E$\\
\hline
$V_G$ & the vertex set of $G(L\cup R,E)$, $V_G=L\cup R$\\
\hline
$G[X\cup Y]$ & a subgraph of $G$ induced by vertex set $X\subseteq L$ and $Y\subseteq R$\\
\hline
$H(X,Y)$ & a shorthand of $H=G[X\cup Y]$ where $X\subseteq L$ and $Y\subseteq R$\\
\hline
$\Gamma_G(u, Y)$ & the set of $u$'s neighbors
in $Y$, $\delta_G(u,Y)=|\Gamma_G(u, Y)|$\\
\hline
$\overline{\Gamma_G}(u, Y)$ & the set of $u$'s non-neighbors in $Y$, $\overline{\delta_G}(u,Y)=|\overline{\Gamma_G}(u, Y)|$\\
\hline
\end{tabular}
\vspace{-0.15in}
\end{table}
\end{comment} | {'timestamp': '2021-12-30T02:21:43', 'yymm': '2112', 'arxiv_id': '2112.14414', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14414'} | arxiv |
\section{Appendix}
\label{sec:appendix}
\subsection{Notations}
Here we summarize the notations used in our proposed model and experiments.
\subsection{diffusion sub-network constructions}
We formulate the process of constructing the diffusion sub-network for a given query.
\section{Conclusion}
\label{conclude}
This paper investigates the influence of information diffusion on user purchasing behaviors in an online shopping platform.
Taking \textit{Taocode}~
as a case study,
we collect a large-scale real-world dataset that includes over 100M \textit{Taocode}~sharing records.
Based on the dataset,
we conduct empirical observations to explore the intrinsic properties of \textit{product interest diffusion} on \textit{Taobao},
finding that \textit{Taocode}~ diffusion exerts a strong influence on user purchasing behaviors,
while both structural and temporal dynamics of diffusion networks play a key role in such correlations.
Inspired by these observational insights, we design an end-to-end GNN-based framework, dubbed \textit{InfNet},
to model the product interest diffusion via \textit{Taocode}.
More specifically, we apply both graph- and sequence-level attention mechanisms to capture the dynamics of user interests on different products at different time steps.
On the item-level purchasing prediction task on the real-world \textit{Taocode}~diffusion datasets from six different product categories,
\textit{InfNet}~achieves significantly better performance compared with state-of-the-art baselines;
moreover, ablation studies demonstrate the additional predictive power introduced by the careful design of our structural and temporal components.
We hope this work will bring insights for user purchase behavior modeling,
especially from the perspective of user interest diffusion and social interactions.
\vpara{Acknowledgments.}
This work is supported by the National Key Research and Development Project of China (No. 2018AAA0101900) and a research funding from Alibaba Group.
Yang Yang's work is supported by Tongdun Technology.
\section{Experiments}
\label{sec:exp}
\subsection{Experimental setup}
\vpara{Prediction Datasets.}
We select \mbox{\textit{Taocode}~}sharing messages from six categories for our experiments.
In more detail, in order to formulate the purchasing prediction problem with clear input and avoid data selection biases, we collect 30,000 \mbox{\textit{Taocode}~}records for each category on each day
during the three days following the observational time window in \mbox{\secref{sec:observe}}, with a total of 540,000 samples,
referred to as ``\textit{the prediction datasets}''.
We regard the receiver and the item of each \mbox{\textit{Taocode}~}record as a purchasing query $q$, which asks whether the user will buy this item within a specific time span.
We then inquire into the purchasing logs during the time period to label these queries (i.e., whether or not the user will buy the item).
For each query sample, the input for our model is the dynamic diffusion sub-network defined in \secref{subsec:model:sub-graph},
within the given time period.
More specifically, we divide the whole time span into four equal segments, meaning that there are a total of four diffusion sub-graphs constructed for each query with one week as a time step.
To keep the offline experiment consistent with the online situation, where we could not obtain any information ahead of the querying time when making predictions,
we randomly split the datasets on the first two days into training and validation sets
with a ratio of 7:3,
with all queries on the third day are used for testing.
Overall statistics of the datasets for the item-level purchasing prediction task are presented in \tableref{tbl:exp:data}.
\begin{table}[t!]
\caption{Statistics of the prediction datasets.
\small
Due to data security requirement, we rename the categories into ranked ids.
\normalsize
}
\label{tbl:exp:data}
\begin{tabular}{c|c|c|c|c}
\hline
Category & \# Users & \# Items & \# Edge &\# Purchase \\ \hline
Cate\#1 & 1,261,486 & 33,184 & 2,730,610 & 21,633 \\ \hline
Cate\#2 & 1,289,775 & 38,776 & 2,832,443 & 29,538 \\ \hline
Cate\#3 & 664,732 & 5,196 & 1,396,300 & 80,278 \\ \hline
Cate\#4 & 997,957 & 19,632 & 2,160,293 & 11,657 \\ \hline
Cate\#5 & 891,134 & 74,487 & 1,911,424 & 9,181 \\ \hline
Cate\#6 & 1,267,316 & 47,920 & 2,806,235 & 41,008 \\ \hline
All & 6,372,400 & 21,9195 & 13,837,305 & 122,739 \\ \hline
\end{tabular}
\end{table}
\begin{table*}[t!]
\caption{Experimental results of item-level purchasing prediction tasks.
\small
We use $^*$ to denote the best result among all models,
while an underline indicates the best performance among the baseline methods.
}
\label{table:performance}
\begin{tabular}{c|p{0.75cm}p{0.75cm}|p{0.75cm}p{0.75cm}|p{0.75cm}p{0.75cm}|p{0.75cm}p{0.75cm}|p{0.75cm}p{0.75cm}|p{0.75cm}p{0.75cm}}
\toprule
\multirow{2}{*}{\textbf{\diagbox{Methods}{Datasets}}} & \multicolumn{2}{c|}{\textit{Cate\#1}} & \multicolumn{2}{c|}{\textit{Cate\#2}} & \multicolumn{2}{c|}{\textit{Cate\#3}} & \multicolumn{2}{c|}{\textit{Cate\#4}} & \multicolumn{2}{c|}{\textit{Cate\#5}} & \multicolumn{2}{c}{\textit{Cate\#6}} \\
& \textit{ROC} & \textit{PR} & \textit{ROC} & \textit{PR} & \textit{ROC} & \textit{PR} & \textit{ROC} & \textit{PR} & \textit{ROC} & \textit{PR} & \textit{ROC} & \textit{PR}\\ \midrule
LR &0.607&0.310&0.565&0.371&0.523&0.048&0.641&0.200&0.636&0.152&0.567&0.479\\
BPR &0.599&0.317&0.550&0.367&0.598&0.057&0.614&0.164&0.562&0.134&0.549&0.492\\\midrule
SR-GNN &0.600&0.318&0.569&0.382&0.599&0.059&0.603&0.187&0.558&0.126&0.558&0.495\\
MGNN-SPred & 0.604&0.319&0.554&0.370&0.573&0.054&0.637&0.190&0.559&0.126&0.567&0.514\\
GCE-GNN &0.615&0.330&0.573&0.389&\underline{0.613}&0.064&0.655&0.206&0.561&0.127&0.569&0.515
\\\midrule
EATNN &0.508&0.246&0.512&0.340&0.508&0.042&0.507&0.120&0.512&0.107&0.505&0.450\\
GraphRec &0.547&0.277&0.562&0.375&0.542&0.048&0.623&0.171&0.573&0.132&0.515&0.474\\
DiffNet &\underline{0.639}&\underline{0.357}&\underline{0.582}&\underline{0.392}&0.612&\underline{0.071}&\underline{0.687}&\underline{0.233}&\underline{0.654}&\underline{0.187}&\underline{0.612}&\underline{0.598}\\ \midrule
\textit{InfNet}-S &0.650&0.368&0.620&0.428&0.587&0.065&0.669&0.240&0.704&0.244&0.635&0.578\\
\textit{InfNet} &\textbf{0.671*}&\textbf{0.409*}&\textbf{0.644*}&\textbf{0.466*}&\textbf{0.643*}&\textbf{0.100*}&\textbf{0.726*}&\textbf{0.319*}&\textbf{0.742*}&\textbf{0.323*}&\textbf{0.657*}&\textbf{0.606*}\\
\bottomrule
\end{tabular}
\end{table*}
\vpara{Baselines.} We compare our proposed model, \textit{InfNet}, with several groups of state-of-the-art baselines:
\begin{itemize}[leftmargin=*]
\item{Traditional methods.}
We first compare our model with a classical machine learning method: Logistic Regression (LR) based on feature engineering.
We also choose one of the most popular frameworks in the item predictions, Bayesian Personalized Ranking (BPR)~\cite{rendle2012bpr},
which proposes a maximum posterior estimator as the generic optimization criterion for personalized ranking.
\item{Session-based methods.}
Another line of online purchasing predictions works are the session-based models.
Since \textit{Taocode}~message sharing sequence can be naturally regarded as user actions within a session,
we choose three popular session-based baselines: SR-GNN~\cite{wu2019session}, MGNN-SPred~\cite{wang2020beyond} and GCE-GNN~\cite{wang2020global}.
\item{Social recommendation methods.}
To verify the effectiveness of \textit{InfNet}~ in capturing social dynamics across the interest diffusion networks,
we compare three popular social recommendation frameworks: EATNN~\cite{chen2019efficient}, GraphRec~\cite{fan2019graph} and DiffNet~\cite{wu2020diffnet++}.
EATNN introduces attention mechanisms to model users' preferences and assigning a personalized transfer scheme for each user.
GraphRec incorporates user-item and user-user graphs,
and uses attentions to model the importance of different social relationships.
DiffNet considers the social diffusion by applying GCN~\cite{gcn} on the social networks and SVD++ to the item recommendations.
\end{itemize}
\vpara{Evaluation metrics and implementation details.}
We evaluate the predictive performance of \textit{InfNet}~ and baseline methods in terms of AUC for the Precision-Recall (PR) and ROC curves, as these metrics are widely applied in recommendation systems~\cite{davis2006relationship}.
In order to fairly compare the performance of different models,
and to adjust to our problem settings,
we make some modifications to the deployment of baselines:
\begin{itemize}[leftmargin=*]
\item{LR based on feature engineering.}
We carefully extract three categories of features:
(1) cost-related features, which contain the price of the product in the query and the total spending of the user in the past 30 days;
(2) graph-related features, which contains the in- and out-degree of users in the diffusion network;
(3) features of users' historical \textit{Taocode}~sharing records, i.e., the information about products the user has shared and received.
\item{Session-based methods}.
We regard users’ \textit{Taocode}~sharing records during the given time span as a session (these are used to extract node and edge features in \textit{InfNet}),
then add the price-related features when encoding the item information as a one-hot vector.
\item{Social-based recommendations}.
For all GNN-based models, the input is the static interest diffusion network by aggregating all dynamic sub-networks in \textit{InfNet}, which are constructed from users' previous sharing records.
Moreover, since above-mentioned methods are based on static graphs and features,
to fairly compare their performance with \textit{InfNet}, we design the \textit{InfNet}-S, where all user and item features are completely consistent with the social-based recommendation baselines.
\end{itemize}
\begin{table*}[ht!]
\caption{In-deep analysis on \textit{InfNet}.
\small
``-'' means we remove the corresponding part in \textit{InfNet}. The reported metric is AUC\_{PR}.}
\normalsize
\begin{tabular}{c|c||c|c|c|c|c|c}
\toprule
\textbf{Analytical Category} & \textbf{Variant} & Cate\#1 & Cate\#2 & Cate\#3 & Cate\#4 & Cate\#5 & Cate\#6 \\\midrule
& \textbf{None} & 0.393&0.460&0.091&0.312&0.292&0.597 \\
\multirow{2}{*}{(a) Sequence Encoder Selection} & \textbf{Mean-Pooling} & 0.402&0.464&0.086&0.308&0.313&0.603 \\
& \textbf{GRU} & 0.403&0.466&0.094&0.316&0.322&0.606 \\\midrule
& \textbf{-User feature} & 0.407&0.464&0.086&0.297&0.305&0.599 \\
(b) Effect of \textit{Taocode}. & \textbf{-Item feature} & 0.399&0.456&0.092&0.289&0.290&0.578 \\
\multicolumn{1}{l|}{} & \textbf{-Taocode feature} & 0.355&0.406&0.079&0.282&0.236&0.577 \\\midrule
(c) Attention mechanism. & \textbf{-Attention} & 0.399&0.456&0.092&0.289&0.290&0.578 \\\midrule
(d) Structural encoder & \textbf{-\textit{Structural block}} & 0.403&0.464&0.085&0.313&0.318&0.587
\\\midrule
\multicolumn{2}{c||}{\textbf{\textit{InfNet}}} & \textbf{0.409}&\textbf{0.466}&\textbf{0.100}&\textbf{0.319}&\textbf{0.323}&\textbf{0.605}
\\ \bottomrule
\end{tabular}
\label{tbl:ablation}
\end{table*}
Besides, we use the Adam~\cite{kingma2014adam} optimizer with a learning rate of 0.001, and the batch size is set as 512.
In \textit{InfNet}, we search the hidden sizes $c$ in the range [16, 32, 64, 128], and $c=64$ reaches the best performance.
For the GNNs in \eqnref{eq:messagepassing},
we have tried GIN \cite{gin}, GCN \cite{gcn} and GAT \cite{gat}.
We find that there are little differences on the performance of different GNNs models, and choose GAT whose average performance is the best among all candidates.
For the sequence encoder in \eqnref{eq:seqence encoder}, we select Masked Self-Attention (\secref{subsec:exp:ablation}), where the Readout function is similar to \cite{gat}.
\subsection{Experimental results}
We present the performance of all methods on item-level purchasing prediction task on the \textit{Taocode}~ dataset in \tableref{table:performance}.
Overall, \textit{InfNet}~ achieves the best performances on all six categories:
\textit{InfNet}~ is expected to be able to capture the spread of product interests along with both structural and temporal dynamics of \textit{Taocode}~diffusions,
and brings in an averaged relative performance increase of 4.6\% and 6.3\% in terms of AUC\_{PR} and AUC\_{ROC} respectively compared with the best baseline method,
demonstrating the effectiveness of our approach for purchasing predictions:
\begin{itemize}[leftmargin=*]
\item In detail, although BPR only utilizes the information of user-item interactions while LR infers purchasing behaviors using only the user and item features,
their performances are competitive with many baselines, which indicates that handcrafted features are crucial in item-level purchasing predictions.
\item Most of the session-based methods focus primarily on the correlations between items across different time steps.
However, due to the huge number of possible action sequences (\textit{Taocode}~sharing) within a session,
this group of methods could be easily over-fitted on the training set, and they also ignore some key properties of users' purchasing behavior.
And when the scale of the dataset is relatively large (Cate\#1, \#2, \#5 and \#6), session-based models achieve only a limited improvement over LR and BPR.
\item Social recommendation methods are the most appropriate to our experimental setting, and most similar to \textit{InfNet}, as they not only consider the user-item interactions but also model the social dynamics among users.
For instance, EATNN uses a whole data-based optimization strategy for neural models,
GraphRec constructs both item-item and user-user graphs based on users' social interactions,
and DiffNet uses a fuse layer to combine users' and items' features,
then apply GCN to model the interest diffusion in the social network.
However, EATNN and GraphRec only consider the structural properties of \textit{Taocode}~ diffusion networks while ignore the attributes on nodes and edges,
which may lose too much information of \textit{Taocode}~messages.
Furthermore, EATNN aims to rank all items for each user without negative sampling, bringing in performance drops on purchasing predictions of each single item.
Although DiffNet achieves the best performance among all baselines,
it does not consider the different influence of a user on her different neighbors, as well as the various impacts of \textit{Taocode}~records with different items.
Therefore, those social recommendation methods cannot make accurate predictions on item-level purchases based on \textit{Taocode}~ diffusion.
\end{itemize}
\subsection{In-depth analysis of \textit{InfNet}}
\label{subsec:exp:ablation}
\textit{InfNet}~ consists of a structural encoder based on a node-aware GNN,
and a dynamic \textit{Taocode}~ diffusion encoder with attention-based edge aggregations and a sequence encoder.
To investigate whether these encoders or attention mechanisms actually work and how they influence the performance of \textit{InfNet},
we conduct ablation studies by removing each part of key component,
and evaluate the performances of these variants of \textit{InfNet}~ in \tableref{tbl:ablation}:
\begin{itemize}[leftmargin=*]
\item \textbf{Sequence Encoder Selection}. We adopt Masked Self-attention as the sequence encoder in \eqnref{eq:seqence encoder},
where elements in each time step are encoded only with reference to the previous time steps.
Besides, there are many other deep architectures designed to encode sequences, such as RNN-based methods.
In order to verify the influence of self-attention,
we compare with the model replacing with GRU.
In addition, to validate the necessity of sequence encoding, we further compare our methods with simple Mean-Pooling or even None (use only the output of last time step without any encoder).
According to the results shown in \tableref{tbl:ablation}(a),
it is important to capture the temporal dynamics at different time steps by a sequence encoder,
and simply using mean-pooling is unable to capture long- and short-term dependence, thus it cannot achieve a good performance on some time-sensitive categories (Cate\#3 and \#4).
We choose Self-Attention because it is better at capturing long-term dependencies and achieves superior performance than GRU.
\item \textbf{Effect of \textit{Taocode}}. In order to intuitively demonstrate the importance of \textit{Taocode}~, we remove different part of input features. As shown in \tableref{tbl:ablation}(b),
masking \textit{Taocode}~ features results in the sharpest drop in performance. This indicates that \textit{Taocode}~ is a key factor to predict users' purchasing behavior, so \textit{InfNet}~can model \textit{Taocode}~diffusion better for purchase prediction.
\item \textbf{Attention mechanism}.
In \eqnref{eq:attention-in} and \eqnref{eq:attention-out}, \textit{InfNet}~ assigns dynamic weights to each edge via graph attentions. In order to clarify the importance of the attention mechanism,
we draw a comparison between \textit{InfNet}~ and its variant without attention.
As \tableref{tbl:ablation}(c) shows, the performances of \textit{InfNet}-Attention are worse on all six categories. with a maximum drop of 10.2\% on Cate \#3. Therefore, we conclude that the attention mechanism is essential for modeling \textit{Taocode}~ interest diffusion.
\item \textbf{Structural encoder}. \textit{Structural block}~ is designed to encode user's structural information. To evaluate whether this module can help us infer users' purchase behavior, we compare with \textit{InfNet}~ without this component.
Again, as in \tableref{tbl:ablation}(d),
removing \textit{Structural block}~ leads to a 2.3\% decline in performance.
\end{itemize}
To summarize, according to the above discussions: (1) The sequence encoder is a necessary component, and self-attention is the best choice for \textit{InfNet}. (2) \textit{Taocode}~ is the most informative among the three input features of \textit{InfNet}. (3) Attention mechanism can help \textit{InfNet}~ better model \textit{Taocode}~interest diffusion. (4) Structural information also benefits in improving the proposed model.
\begin{table}[ht]
\caption{Comparison on cold-start problem. C\# is short for Cate\# and using bold to highlight the better improvement.}
\small
\normalsize
\begin{tabular}{c|c||c|c|c|c|c}
\toprule
Group & Method &\textit{C\#1}&\textit{C\#2}&\textit{C\#3}&\textit{C\#4}&\textit{C\#5}\\ \midrule
\multirow{3}{*}{\textit{Cold.}}
& DiffNet &0.331&0.332&0.061&0.159&0.143 \\\cline{2-7}
& Ours&0.392 &0.381&0.113&0.230& 0.276\\\cline{2-7}
& \textbf{Impv.}& \textbf{18.4\%}& 14.8\% &\textbf{85.2\%}&\textbf{44.7\%}&\textbf{93.0\%}
\\\hline\hline
\multirow{3}{*}{\textit{Warm.}}
& DiffNet & 0.358&0.396&0.074&0.244&0.188 \\\cline{2-7}
& Ours&0.410&0.472 &0.086&0.329& 0.329 \\\cline{2-7}
& \textbf{Impv.}&14.5\%&\textbf{19.2\%}&16.2\%&34.8\%& 75.0\% \\
\bottomrule
\end{tabular}
\label{exp:case}
\end{table}
\subsection{Cold-start challenge}
As we observed in \secref{subsec:exp:ablation}, \textit{Taocode}~ features are important for purchase predictions.
To further verify the power of \textit{InfNet}, we conduct an analysis on the challenge which traditional recommendation system suffered, namely the \textbf{cold-start problem}~\cite{schein2002methods}. There are two distinct categories of cold start: product cold-start and user cold-start, while here we focus on user cold-start problem.
In our setting, we denote \textit{Cold} for the group of users who have no purchase records in the past and \textit{Warm} on the contrary.
We then compare \textit{InfNet}~ with DiffNet (the best baseline), shown in \tableref{exp:case}.
Although both models suffer in cold-start dilemma (perform worse under the \textit{Cold} setting compared with \textit{Warm}),
\textit{InfNet}~ shows a better improvement than DiffNet with cold-start.
More specifically, except for Cate\#2, \textit{InfNet}~'s improvements over DiffNet on \textit{Cold} are significantly higher than that of \textit{Warm},
It shows that \textit{InfNet}~ is a potentially better approach to tackle the cold-start problem.
\section{Introduction}
Online shopping has become an increasingly common practice for thousands of households.
As reported by \textit{Alibaba Group}\footnote{See the FY 2020 annual report on \url{https://www.alibabagroup.com/en/ir/reports}.},
in the fiscal year of 2020,
the mobile MAUs across the China retail marketplaces comes to 846 million,
and the total GMV of \mbox{\textit{Taobao}}\footnote{the biggest online shopping website in the world that belongs to Alibaba Group.} reaches 3,387 billions of CNY.
Due to the extremely large scale of online retail marketplaces,
it has become crucial for e-commerce platforms to better understand users' online purchasing behaviors.
One classical but challenging problem in this area is that of purchasing predictions~\cite{grbovic2015commerce}:
given a user, along with a specific product or a category of goods, the question is how likely the user would be to buy this item.
Existing works have made great efforts in this field.
Traditional methods mainly consider users and products by matrix factorization,
statistical learning models~\cite{sismeiro2004modeling}, etc.
Deep learning-based models adopt deep neural networks to integrate the diverse information in the e-commerce system~\cite{xu2019relation,zhou2019deep,wang2020beyond,wu2020diffnet++},
such as users' clicking, browsing and purchasing histories.
Most of these previous frameworks utilize the historical information of both users and products;
however, few of them have studied the impact of information diffusion~\cite{yang2015rain,yang2016social} across the social network on users' online purchasing behaviors~\cite{ma2011recommender,ye2012exploring,ma2009learning}.
Taking a concrete example in practice,
a user will be more likely to buy a product at a time when she actually needs it,
or alternatively, when some close friends recommend that item to her
(even though she might not have any urgent demand for it).
Furthermore, such preferences for different products can spread across online social networks:
a user who receives a recommendation from her friends may share this item with other users within her social circle~\cite{song2006personalized}, thus promoting further possible purchases,
while the scale of sharing could explode as the message is propagated throughout the social relationships between users.
We refer to this phenomena as diffusion of user interests in products, i.e., ``\textit{interest diffusion}'' for short,
which is likely to influence the purchasing behavior of users
to some degree.
Although such social factors are expected to be highly relevant to users' purchasing decisions,
they have been rarely studied in previous works for two main reasons.
First, interest diffusion across online e-commerce platforms is always \textit{implicit} and \textit{hard to observe}.
While we can easily obtain users' browsing, purchasing and product review histories,
or even discussions on public social media platforms,
the majority of recommendations and interest diffusion occur between acquaintances via private social communications,
which are difficult to discover and analyze.
Indeed, previous works have explored the impact of product sharing on users' shopping behavior through analysis of email data~\cite{portrait,viral};
however, the social cost of using emails to share goods is much higher than using instant social tools,
meaning that these studies may be biased in real-world scenarios.
Second, interest diffusion across social networks is very complicated to model,
since diffusion trajectories change naturally at any time with the spread of social interactions,
and on online shopping platforms, user interest in different products could exhibit various diffusion patterns.
Modeling the dynamics of interest diffusion remains a challenging research problem.
\begin{figure}[t!]
\centering
\includegraphics[width=0.45\textwidth]{./fig/intro1.pdf}
\caption{An illustration of \textit{Taocode}~diffusion process.
\small
When users browse an item on~\textit{Taobao}~(a),
they can share its homepage to friends by generating the \textit{Taocode}~message (b),
and sending it via social media.
The \textit{Taocode}~ then spread over the social network (c).
\normalsize
}
\label{fig:tcode case}
\end{figure}
Excitingly, \textit{Taocode}, a kind of specially coded text-link on \textit{Taobao},
provides us with an appropriate testbed to observe and capture the social influences and product interest diffusion between users in the online shopping scenario.
\textit{Taocode}~ is essentially a hyper-link containing the information of some specific product on \textit{Taobao}.
\figref{fig:tcode case} illustrates how the \textit{Taocode}~is created and spread.
It is convenient for users to create and share a \textit{Taocode}~ by clicking specific options in \textit{Taobao}~ when they browse an item,
and anyone who receives the \textit{Taocode}~ can browse this product by opening the embedded hyper-link.
More importantly, since \textit{Taocodes}~ spread within \textit{Taobao},
the diffusion process of each sharing message can be recorded in its entirety;
we can trace the \textit{explicit sharing path} of the item on the diffusion flow,
and obtain the details of which user shares which product with whom at what time.
This provides us with a great opportunity to model the dynamics of product sharing diffusion.
This paper presents a large-scale study on the effect of product interest diffusion on online shopping platforms,
taking \textit{Taocodes}~sharing on \textit{Taobao}~as an example.
It is pioneering work from the perspective of user interest diffusion to predict item-level purchases.
We sample a total of 100M \mbox{\textit{Taocode}}~ sharing records,
and then construct the \textit{interest diffusion networks} from those \textit{Taocode}~records at different time steps:
there is a unique diffusion network within each single time span,
where each node represents a user,
and the directed edges between two nodes denote the relationships of \textit{Taocode}~ sharing.
Moreover, the dynamics of the network structures reveal the message diffusion across the edges,
which may reflect the purchasing preferences of users regarding different groups of items.
Given a specific query of a user-item pair,
our goal is to estimate how likely the user is to buy this product based on purchasing and \textit{Taocode}~ diffusion histories,
by utilizing the sequence of interest diffusion networks during the given time span.
As discussed above, modeling interest diffusion networks remains challenging:
it is difficult for deep sequential models to handle geometric data,
while most existing GNNs may be unable to deal with the dynamic edge weights at different times.
To deeply understand how \textit{Taocode}~messages are spread over the social network,
we first conduct empirical observations across the entire \textit{Taocode}~ diffusion (\secref{sec:observe}),
which provides several comprehensive insights:
1) \textit{Taocodes}~sharing behaviors are indeed highly correlated with users' purchasing decisions,
in that users who send or receive more \textit{Taocodes}
are likely to make more purchases;
2) the influence of \textit{Taocode}~ diffusion varies across different product categories, e.g.,
items with higher price index are more likely to be purchased after being shared via \textit{Taocodes};
3) the graph structures of interest diffusion networks reflect users' purchasing preferences:
for instance, users whose neighbors share \textit{Taocodes}~ more actively tend to have higher purchasing rates;
4) temporal factors play an important role in \textit{Taocode}~ diffusion, i.e.,
the time interval between \textit{Taocode}~senders buying and sharing the item has implicit impacts on the receivers.
Motivated by these findings, along with the advances of sequence- and graph-level attentions,
we propose \textit{InfNet}~ to integrate both the structural and temporal information of dynamic attributed diffusion networks.
The key hints derived from our observations are that,
on one hand, a user's preference for different items is highly related with her own and her neighbors' interest diffusion patterns,
while on the other hand, those patterns are linked with time and are affected by neighborhoods' dynamic product interests at different time steps.
In other words, the structural and temporal dynamics of interest diffusion change in an interrelated fashion,
and should thus be incorporated into a unified framework.
Accordingly, we adopt a multi-level attention mechanism to model the interest diffusion patterns,
i.e., two graph attentions on diffusion networks,
and a self-attention-based encoder on diffusion sequences.
Extensive experiments applying purchasing predictions to real-world datasets
on \textit{Taobao}~ demonstrate the effectiveness of our proposed model:
\textit{InfNet}~ significantly outperforms 8~ state-of-the-art baselines,
ranging from session-based models to GNN-based social recommendation frameworks.
We also conduct ablation studies to determine how different levels of attention work,
and visualize several cases to illustrate the diffusion patterns of products extracted by \textit{InfNet}.
Overall, the contributions of this paper can be described as follows:
\begin{itemize}[leftmargin=*]
\item We present a large-scale study on the effect of product sharing in online shopping scenarios,
and investigate the problem of online purchasing predictions from an information diffusion perspective.
More specifically, we take \textit{Taocode}, a specially coded type of text link of \textit{Taobao}, as a case study.
\item Comprehensive observations over 100M \textit{Taocode}~sharing records illustrate several implicit characteristics of product interest diffusion across the social network on \textit{Taobao}.
\item Motivated by our observational insights, we design an end-to-end framework, named \textit{InfNet}, to make item purchasing predictions.
Experimental results validate the effectiveness of the way, in which we adopt multi-level sequential and graph attentions to capture the users' preferences for different products and the interest diffusion dynamics.
\end{itemize}
\section{Model: \textit{\textit{InfNet}~}}
\label{sec:model}
\begin{figure*}[ht]
\centering
\includegraphics[width=1.0\textwidth]{./fig/model.pdf}
\caption{Framework of \textit{InfNet}.
\small (a) is the overview of \textit{InfNet}, (b) is the framework of diffusion encoder in \textit{InfNet}. (c) is the detail of edge-level aggregation. Note, in (c), user's hidden states only used to count attention weight.
}
\label{fig:model:overview}
\end{figure*}
In this section, we introduce the proposed model \textit{InfNet}~ for modeling the structure and temporal dynamics of \textit{Taocode}~ diffusion in the interest diffusion networks.
Given the input of a purchasing query at a specific time step that contains the target user and item,
our framework first builds a sequence of ``dynamic sub-networks'' for each query,
after which we apply two different attention-based aggregation strategies on dynamic node and edge attributes to learn users' hidden representations.
Finally, the user's embedding, along with the item features are fed into the outer classifier,
to predict whether the target user will purchase the item during the given time span.
An overview of the framework is presented in \figref{fig:model:overview}.
\subsection{Preprocessing: Sub-graph construction}
\label{subsec:model:sub-graph}
For each purchasing query $q=(u, p, t_i)$ and the entire dynamic interest diffusion network $\mathcal{G} = \{\mathcal{G}_1, \cdots, \mathcal{G}_{t_i}\}$,
we build a sequence of sub-graphs $\mathcal{G}^q$ of $\mathcal{G}$ to conduct the end-to-end graph classification, i.e., the purchasing prediction of query $q$.
The process of constructing the sub-networks can be described as follows :
\begin{itemize}[leftmargin=*]
\item \vpara{Seed node sampling:} We define the target user $u$ and its 1-hop neighbors $\mathcal{S}_u(p)$ as the set of seed nodes,
denoted as $\{u\} \bigcup \mathcal{S}_u(p)$, where $\mathcal{S}_u(p)$ is the set of \textit{sender nodes} that shares item $p$ with $u$.
\item \vpara{Sub-network construction:} Given the set of seed nodes, we adopt a breadth-first search (BFS) strategy to sample the nodes
from each original diffusion network $\mathcal{G}_t (1\le t \le t_i)$, by searching for two-hop neighbors, i.e., the search deepth is set to two;
and moreover, an edge exists between two nodes $(u, v)$ in $\mathcal{G}_t^q$ if the user $u$ shares some product $p$ with $v$ at time step $t$.
\item \vpara{Node and edge attributes:}
The node features of a user $u$, denoted as $\mbox{Attr}(u)$, consists of two parts:
the first part is the user's purchasing histories which are independent from the diffusion networks,
i.e., the price she pays for different products in the past year;
the other part is a one-hot vector, indicating whether this node is the target user in the query or it is among the seed nodes,
which can help the model better identify the nodes that it should focus on.
As for the edge features,
we first define the item feature $\mbox{Attr}(p)$ as a one-hot vector, where each bin represents a specific range of prices.
Then for an edge $(u,v,t)$, its features $e_{uv}^t$ is summed over features of all items that are sent from the user $u$ to $v$ during the period $t$.
Note that edge features may change across queries at different time, since for a specific time span $t$,
we only aggregate features of items that are shared during $t$.
\end{itemize}
\subsection{\textit{Structural block}}
As \figref{fig:ob:all} (b) shows, the local graph structure in the diffusion network is an important factor to infer whether \textit{Taocode}~sharing can prompt purchases.
Therefore, we use a \textit{Structural block}~to learn the users' embeddings to capture such structural characteristics.
\textit{Structural block}~can be implemented by any GNNs with node aggregation strategy, which can embed nodes' structural information~\cite{gin}. It can be denoted by a uniform Message-Passing framework:
for a specific user $u$, the first layer is a non-linear transformation on user attributes, and output the initial hidden representation $x^u$:
\begin{equation}
x^k_u = \mbox{Combine}(x^{k-1}_u, \mbox{Aggr}({x^{k-1}_v}|v \in \mathcal{N}_u))
\label{eq:messagepassing}
\end{equation}
where $k$ is the layer index,
$\mbox{Combine}(\cdot,\cdot)$ combines hidden states of $u$ with her neighbors,
and $\mbox{Aggr}(*)$ denotes the aggregation function (sum or mean operation).
By this step, the representation vector $x_u^k$ is expected to contain the information of both $u$ and her neighbors.
After stacking $K_1$ layers of \eqnref{eq:messagepassing},
the output is the final structural embedding of the user $u$,
denoted as $s_u = x^{K_1}_u$
\subsection{\textit{Diffusion block}}
While \textit{Structural block}~ only aggregates on the node attributes, edge features encode much more information of \textit{Taocode}~diffusion:
as \figref{fig:ob:all} (c) and (d) suggest,
if we want to better predict the user $u$'s purchasing decision on the item $p$,
we may need to know how many close neighbors of $u$,
as well as whether there exist some users who have shared $p$ to $u$ having purchased this item.
Moreover, the temporal information of \textit{Taocode}~ diffusion can also help us capture both short- and long-term influence of such social interactions on users' purchasing behavior.
However, existing methods rarely consider the dynamic item diffusion among users: most of them apply frameworks similar to \eqnref{eq:messagepassing}, which is unsuitable for a \textit{Taocode}~ diffusion network.
Consider a situation, in which user $v$ has received many \textit{Taocodes}~of computers and clothes, and sends a clothing \textit{Taocode}~to $u$.
The diffusion from $v$ to $u$ pertains only to clothes;
therefore, node information of $v$ related to computers may evidently introduces noise that hampers the prediction of $u$'s purchase behavior.
So we further design \textit{Diffusion block}~ to fully model the \textit{Taocode}~diffusion via edge-level aggregations and learn users' final representations.
Inspired by real-world situations and our observations (\secref{sec:observe}),
we design a special multi-layer aggregation strategy.
The key idea is that, rather than directly aggregating neighbors' node features,
we first learn the weight of each edge, then aggregate the edge features between the user and her neighbors to get an updated representation.
Through the attention mechanism, neighbors' node representations will affect the nodes' final representation in an implicit way, and it can avoid noisy aggregations.
Formally, let $e_{uv}^t$ denotes the edge feature of user $v$ sent to user $u$ at time $t$.
To capture the dynamics of \textit{Taocode},
we independently aggregate the attributes of edges connected with the user to get the hidden state of each time step, denoted as ${h'_{u}}^{k,t}$, where $k$ is the layer number.
Each hidden state ${h'_{u}}^{k,t}$ only contains all interplay on social networks involving $u$.
We then utilize a sequence encoder to combine users' hidden states in different time steps to get the dynamic representations of users.
In detail, the same user at different time step has the same initial hidden state $h^{0,t}_u$, which is obtained by a non-linear transformation of user attributes $\mbox{Attr}(u)$;
then for user $u$ in $k^{th}$ layer at time step $t$, we conduct separate aggregations of users' in- and out-edges and obtain two representations $In_u^{k,t}$ and $Out_u^{k,t}$. They represent the information users receive and send. We combine them to get the hidden state $h'^{k,t}_u$ at time step $t$:
\begin{equation}
In^{k,t}_u = \sum_{v \in \mathcal{S}_u^t} {\mbox{ATT}^k_{in}(h^{k-1,t}_u,h^{k-1,t}_v,e_{uv}^t)e_{vu}^{t}}
\label{eq:attention-in}
\end{equation}
\begin{equation}
Out^{k,t}_u = \sum_{v \in \mathcal{R}_u^t} {\mbox{ATT}^k_{out}(h^{k-1,t}_u,h^{k-1,t}_v,e_{vu}^t)e_{vu}^{t}}
\label{eq:attention-out}
\end{equation}
\begin{equation}
h'^{k,t}_u = [In^{k,t}_u,Out^{k,t}_u]
\end{equation}
Here $\mbox{ATT}^*_*(*)$ is an attention function that takes the user's hidden states in the last layer, as well as edge attributes as inputs, and output the attention weights of the edge attributes.
It fuses these three inputs, then employs a non-linear transformation to obtain the scalar values.
The attention mechanism can be clarified as:
\begin{equation}
w_{uv}^{k,t} = \mbox{LeakyReLU}(W_{in}^k[h_u^{k-1,t},h_v^{k-1,t},e_{uv}^t])
\end{equation}
\begin{equation}
\mbox{ATT}^k_{in}(h^{k-1,t}_u,h^{k-1,t}_v,e_{uv}^t) = \frac{exp(w_{uv}^{k,t})} {\sum_{c\in\mathcal{S}_u^t}{exp(w_{uc}^{k,t})}}
\label{func:softmax}
\end{equation}
where $W_{*}^k \in \mathbb{R}^{1\times 3c}$, and we adopt a softmax function ~\cite{gat} on edges to make the summed weights of all $u$'s neighbors equal to 1.
This operation can alleviate over-fitting and facilitate fair comparison of various edges.
The out-edge attention is the same as that of in-edge, except that in \eqnref{func:softmax}, it is summed over $\mathcal{R}_u^t$ rather than $\mathcal{S}_u^t$.
After obtaining the hidden state at each time step $t$, i.e.,
a sequence of representations of different time steps for each user $u$,
we use a sequence encoder to capture the temporal dynamics:
\begin{equation}
h^{k,t}_u = \mbox{Enc}(h'^{k,i}_u | i<=t)
\label{eq:seqence encoder}
\end{equation}
The $\mbox{Enc}(*)$ can be a simple operator such as Mean-pooling or a more complex operator such as GRU~\cite{gru}, Masked self-attention~\cite{vaswani2017attention}, etc.
However, as this aspect is not our main focus, here we do not expand on it in detail, and will analyze the performance of different encoding methods in \secref{sec:exp}.
After $K_2$ layers of \textit{Diffusion block}, we obtain the final dynamic representation $d_u = \mbox{Readout}(h^{K_2,t}_u|_{t=1}^{t=t_i})$, where $\mbox{Readout}(*)$ denotes readout the overall representation of sequence. For example, we can directly readout the representation in last time step in GRU~\cite{gru}, or readout by sum with weights in Self-Attention ~\cite{dosovitskiy2020image}.
\subsection{Model learning}
After we obtain the users' structural and \textit{Taocode}~ diffusion representations,
we combine them to predict the users' purchasing behavior:
whether user $u$ will purchase item $p$, namely query $q=(u,p)$.
We focus not only on $u$'s representation and item $p$'s attributes, but also consider the users who send item $p$ to $u$:
\begin{equation}
g_q = \sum_{v \in \mathcal{S}_u(p)}{[s_v,d_v]}
\label{func:final}
\end{equation}
Here $\mathcal{S}_u(p)$ is the set of seed users (\secref{subsec:model:sub-graph}), in which all users are $u$'s neighbors who send item $p$ to $u$.
We then combine these three parts and make the predictions through a simple output layer:
\begin{equation}
y' = \sigma([d_u,s_u,g_q, \mbox{Attr}(p)])
\end{equation}
where $\mbox{Attr}(p)$ denotes the features of item $p$.
In general, the downstream task can be regarded as a binary classification problem, thus we use \textit{cross-entropy} as the loss function:
\begin{equation}
\mathcal{L}(\Theta) = \sum_{q_i \in Q} -y_i \mbox{log}y_i'+(1-y_i)\mbox{log}(1-y_i')
\end{equation}
Here, $\Theta$ denotes all learnable parameters in \textit{InfNet}, $Q$ is the set of all queries, and $y_i$ is the ground truth of the query $q_i$.
\section{Model: \textit{\textit{InfNet}~}}
\label{sec:model}
\begin{figure*}[ht]
\centering
\includegraphics[width=1.0\textwidth]{./fig/test.pdf}
\caption{Overview of \textit{InfNet}.
\small
\czq{fix model figure and caption@xuanwen}
\normalsize
}
\label{fig:model:overview}
\end{figure*}
\begin{table}[t!]
\caption{Notation table.
\small Note that all those notations can be incorporated with a super- or subscript $t$
which indicates the time step.
\normalsize
}
\begin{tabular}{c|p{0.75\columnwidth}}
\toprule
Notation & Description\\
\hline
$\mathcal{G}$& the interest diffusion network\\ \hline
$\mathcal{G}^q$& the sub-network of $\mathcal{G}$ for a query $q$ \\ \hline
$\mathbf{X},x_u$& node representations in the node-aware \textit{InfNet}~(\textit{InfNet}-N), where $u$ denotes a specific user\\\hline
$\mathbf{H},h_u$& node representations in the edge-aware \textit{InfNet}~(\textit{InfNet}-E), where $u$ denotes a specific user\\\hline
$E,e_{uv}$& edge representation in \textit{InfNet}-E, where $e_{uv}$ denotes a specific directed edge between user $u$ and $v$\\\hline
$\mathcal{E}_{in}, \mathcal{E}_{out}$& the set of in/out edges of the interest diffusion (sub-) network\\\hline
$\mathcal{E}^{u}_{in}, \mathcal{E}^{u}_{out}$& the set of in/out edges of a user $u$ in the interest diffusion (sub-) network\\\hline
$\mathcal{S}_u$& the set of \textit{sender nodes} that share \textit{Taocode}~to $u$ in the network, i.e., neighbors of in edges.\\\hline
$\mathcal{R}_u$ & the set of \textit{receiver nodes} that receive \textit{Taocode}~from $u$ in the network, i.e., neighbors of out edges\\\hline
$\mathcal{N}_u$& all neighbors of node $u$ in the diffusion network\\\hline
$a_{uv}$& attention weight of edge $e_{uv}$\\
\bottomrule
\end{tabular}
\label{tbl:notations}
\end{table}
In this section, we introduce the proposed model, Bi-directional Graph Attention Networks (\textit{InfNet}),
for modeling structural and temporal dynamics of \textit{Taocode}~ diffusions in the interest diffusion networks.
Given the input of a purchasing query at a specific time step that contains the targeting user and item,
our framework first builds a sequence of dynamic sub-networks for each query,
where the features of nodes and edges are carefully extracted from the targeting user and item;
then we apply the \textit{edge-aware GNN} to aggregate the dynamic edge attributes across the time into node features,
and use \textit{node-aware bi-directional GAT} to capture the structural characteristics by aggregating neighbors' information.
Finally, the graph-level representations along with features of the targeting item are feed into the outer classifier,
to predict whether the target user will make a purchase on the item during the given time span.
The framework overview is illustrated in \figref{fig:model:overview},
and to make it clear, we summarize the notations of our model in \tableref{tbl:notations}.
\subsection{Preprocessing: sub-graph construction}
\label{subsec:sub-graph}
For each purchasing query $q=(u, p, t)$ and the whole dynamic interest diffusion network $\mathcal{G} = \{\mathcal{G}_1, \cdots, \mathcal{G}_t\}$,
we first build a sequence of sub-graphs $\mathcal{G}^q$ of $\mathcal{G}$ to conduct the end-to-end graph classification, i.e., purchasing prediction of query $q$.
The process of constructing the sub-networks can be described as follows:
\begin{itemize}[leftmargin=*]
\item \vpara{seed node sampling:} we define the target user $u$ and its neighbors $\mathcal{S}_u(p)$ as the set of seed nodes,
denoted as $\{u\} \bigcup \mathcal{S}_u(p)$, Where $\mathcal{S}_u(p)$ is the set of \textit{sender nodes} that shares item $p$ to $u$.
\item \vpara{sub-network construction:} given the set of seed nodes, we adopt a breath-first search (BFS) strategy to sample the nodes in $\mathcal{G}_t^q$
from each original diffusion network $\mathcal{G}_t$, by searching for two-hop neighbors, i.e., search breadth is set as two;
and there exists an edge for two nodes $(u, v)$ in $\mathcal{G}_t^q$ if the user $u$ shares some product $p$ to $v$ at the time step $t$.
Node and edge features would be defined the same as in $\mathcal{G}_t$.
\end{itemize}
And algorithm formulations can be referred in \algref{alg:sub-graph sample}.
Based on the graph structures, there are sufficient node and edge attributes.
The node features of a user $u$, denoting as $Attr(u)$, has two parts.
The first part is the user's purchasing histories which are independent with the diffusion networks,
i.e., the price she pays for products in the past year;
and the other part is a one-hot vector, indicating whether this node is the target user in the query or it is among the seed nodes,
which can help our model better identify the nodes that need to be focused~\cite{zhang2018link}.
\begin{algorithm}[t!]
\caption{Diffusion sub-graph construction}
\label{alg:sub-graph sample}
\begin{algorithmic}[1]
\REQUIRE purchasing query $q=(u,p,t)$, \\original interest diffusion network $\mathcal{G}_t$\\
\ENSURE diffusion sub-network $\mathcal{G}_t^q$ of query $q$\\
\STATE Initialize the set of seed nodes $V = \{u \bigcup \mathcal{S}_u^t\}$ and $\mathcal{G}_t^q = \emptyset$
\FOR{hop $k$ in range $\{1, 2\}$}
\FORALL{$v$ in $V$}
\STATE add all neighbors of $v$ in $\mathcal{G}_t$, i.e., $\mathcal{N}_v^t$ to $V$
\ENDFOR
\ENDFOR
\STATE set the nodes of $\mathcal{G}_t^q$ as $V$
\FOR{each pair of nodes $(u, v)$ in $\mathcal{G}_t^q$}
\IF{ $e_{uv} \in \mathcal{G}_t$}
\STATE add the edge $e_{uv}$ along with its features to $\mathcal{G}_t^q$
\ENDIF
\ENDFOR
\RETURN $\mathcal{G}_t^q$
\end{algorithmic}
\end{algorithm}
As for the edge features,
we first define the item feature $Attr(p)$ as a one-hot vector, where each bin represents a specific range of the price.
Then for an edge $e_{vu}$, its feature $Attr(e_{vu})$ is summed over features of all the items which are sent from the user $v$ to $u$.
Note that the edge features may change across the queries, since for a specific time span $t$,
we only sum over item features that are shared between these two users during the period of $t$.
\subsection{Edge aggregation: \textit{InfNet}-E}
We then aim to model the \textit{Taocode}~diffusions given a sequence of diffusion sub-networks with user $u$ as the centered node.
Our general idea is to learn a graph-level representation which contains the information of diffusion patterns of the user;
and traditional GNNs based on message passing~\cite{gin,hgt} first learn the node representations by only aggregating neighborhood features,
since the unattributed edges just represents a specific relationship between pairs of nodes.
However, such kind of methods may not be suitable for our scenario
since the edge features in the \textit{Taocode}~diffusion network may contain the key properties of a \textit{Taocode}~sharing,
such as the basic information of the shared products. But if the node only aggregates the features of the edges, it loses some key properties about the graph structure, such as the degree of the node in query.
Our model first uses a edge-aware GNNs (\textit{InfNet}-E) with bi-direction graph attention mechanism to aggregate edge features with different weights into the nodes' attributes by time step. We then obtain the graph's global information through a node-aware GNNs (\textit{InfNet}-N) that aggregates node attributes containing edge information. In this way, our model can capture the local sharing information of the network and the global information of the network. This section will introduce \textit{InfNet}-E in detail.
At time step $t$,
the weight of an edge depends not only on its feature but also on the attributes of two users it connect.
Simultaneously, the edge features of the two nodes before does also affect the edge weight in time step t. Therefore, our formula is as follows:
\begin{equation}
w^t_{vu} = LeakyReLU(a^T[W^{t-1}e_{vu}^{t-1},W^te_{vu}^{t},h_v^{t-1},h_u^{t-1}])
\end{equation}
Where $W$ denotes the learnable parameters, $a^T$ is a learnable vector.
Next, for easily comparing the coefficients between different nodes, we apply an attention mechanism similar to~\cite{gat}. In our scenario, the softmax operation need \textbf{bi-direction} consideration of two nodes. We use two softmax functions to get the final weight. One of the softmax functions considers all in-edges of receiving node, and the other considers all out-edges of the sending node:
\begin{equation}
l^t_{vu} = \frac{exp(w_{vu}^t)}{\sum_{k\in \mathcal{S}_u^t} exp(w_{ku}^t)} \label{con:l}
\end{equation}
\begin{equation}
r^t_{vu} = \frac{exp(w_{vu}^t)}{\sum_{k\in \mathcal{R}_{v}^t} exp(w_{vk}^t)}\label{con:r}
\end{equation}
then the two results are multiplied after operating the square:
\begin{equation}
a^t_{vu} = \sqrt{l^t_{vu}}*\sqrt{r^t_{vu}} \label{con:a}
\end{equation}
where $a_{vu}^t$ is the final attention weight of $e_{vu}^t$,
and the weight obtained by the two-directed considered softmax function can smooth the influence of each node on the surrounding nodes,
similarly as proposed in the \textit{Symmetric Normalized Laplacian}~\cite{chung1997spectral}.
Since the dynamic diffusion sub-network is a directed graph,
the edge sent from the user is different from the edge received,
we separately aggregate the node's in- and out- edges:
\begin{equation}
In_u^{t} = \sum_{v\in \mathcal{S}_u^t} a_{vu}^tW^t e_{vu}^{t}
\end{equation}
\begin{equation}
Out_u^{t} = \sum_{v\in \mathcal{R}_{v}^t} a_{uv}^tW^t e_{uv}^{t}
\end{equation}
where $\mathcal{S}_u$ denotes the set of \textit{sender nodes} that share \textit{Taocode}~to $u$ in the network, i.e., neighbors of in edges. $\mathcal{R}_u$ is the set of \textit{receiver nodes} that receive \textit{Taocode}~from $u$ in the network, i.e., neighbors of out edges.
Then we concatenate them as the final hidden state of user $u$ at the time step $t$.
Taking into account the existence of long-term dependence (see section 3.3),
we use GRU ~\cite{gru,ggnn} to aggregate the hidden state of each time step of a node:
\begin{equation}
h^{t}_{u} = GRU([In_u^t,Out_u^t], h^{t-1}_u)
\end{equation}
and the initial representation of the node is defined as a linear transformation of the original feature of that node:
\begin{equation}
h^{0}_u = ReLU(\Theta^0 * Attr(u))
\end{equation}
Our model supports the multi-head attention mechanism ~\cite{mutihead,gat}. Note that in the calculation of each head, the node attributes are the same. Moreover, for avoiding too many parameters need to be learned, all heads share a same GRU.
After $T$ aggregations, the edge information at all time steps has been aggregated to the node representation. In edge feature aggregation, the attributes of nodes only participate in the calculation of attention weights, and will not directly participate in the aggregation. Therefore, even if there are many time steps, it will not cause excessive smoothness due to mutual aggregation of nodes.
\subsection{Node aggregation: \textit{InfNet}-N}
In the edge feature aggregation, since the nodes only participate in the calculation of attention weights and aggregations are not directly applied on nodes,
we cannot learn the global representation of the graph and nodes' feature of neighbors.
Therefore, after the edge features at each time step are sequentially aggregated into node features, we need to learn the overall representation of the graph and smooth attributes of nodes through another GNN architecture that can propagate node representations.
Since node attributes could be more important in some scenarios, we add a residual connection~\cite{he2016deep} before the node aggregation:
\begin{equation}
\mathbf{X}^0=\mathbf{H}^{T}+\mathbf{H}^0
\end{equation}
Meanwhile, at this stage, we are more focused on the structure of the network, so we merge the T dynamic interest diffusion networks $\{\mathcal{G}_1^q...\mathcal{G}_T^q\}$ and transformed them into an undirected graph $\mathcal{G}^q$ without edge features. We use $\mathcal{N}_u$ to denote the set of node $u$'s neighbors in $\mathcal{G}^q$.
The formula of a layer in \textit{InfNet}-N is approximately the same as GAT~\cite{gat}, but when calculating the weight of the edge, we use a two-direction softmax function, see Equation \ref{con:l}, \ref{con:r}, \ref{con:a};
but \textit{InfNet}-N does not consider the direction of edge,
the $\mathcal{S}_u^t$ in Equation \ref{con:l} and the $\mathcal{R}_v^t$ in Equation \ref{con:r} are replaced by $\mathcal{N}_u$ and $\mathcal{N}_v$ respectively.
After $K$ layers, we can get the final node representation $X^K$. Since there is already an attention mechanism in \textit{InfNet}-E, we directly average the representations of all nodes in the graph to get the global representation $G_q$ of the network built by query $q$:
\begin{equation}
G_q= \frac{1}{n}\sum_{i=1}^n x_i^{K}
\end{equation}
where $n$ is the number of all node in the network.
\subsection{Downstream tasks}
For predicting user $u$ whether purchase item $p$ in a query $q=(u,p)$, the final representation of the user, the features of the item $p$, and the global representation of the entire network build by query is the vital factors. Moreover, the seed nodes (see section 4.1) are also important for our task, so we average their final representation in Equation \ref{con:e}.
\begin{equation}
G_q' = \frac{1}{|\mathbf{S}_u(p)|}\sum_{v \in \mathbf{S}_u(p)}x_v^K \label{con:e}
\end{equation}
Then we combine them and output the predictions through a simple linear layer:
\begin{equation}
y' = \mbox{Softmax}(\mbox{Linear}([G_q,G_q',x_u^K, \mbox{Attr}(p)]))
\end{equation}
where $Attr{(p)}$ is the features of item $p$.
In general, our downstream task can be regarded as a problem of binary classification.
We use the \textit{cross entropy} in our loss function which is defined as follows:
\begin{equation}
\mathcal{L}(\Theta_{all}) = \sum_{q_i \in Q} -y_i \mbox{log}y_i'+(1-y_i)\mbox{log}(1-y_i')
\end{equation}
where $\Theta_{all}$ denotes all learnable parameters in \textit{InfNet}, $Q$ is the set of all queries, and $y_i$ is the ground truth of the query $q_i$.
\section{Observational studies}
\label{sec:observe}
\begin{figure*}[ht]
\centering
\includegraphics[width=1.0\textwidth]{./fig/observation.pdf}
\caption{Observational studies on \textit{Taocode}~ diffusion.
\small
(a) illustrates the positive correlations between the PI and CI Lift of items, indicating that \textit{Taocode}~has a stronger influence over expensive goods.
Both (b) and (c) reflect the structural properties of \textit{Taocode}~diffusion; for example, the numbers of \textit{Taocode}~messages being sent and received by a user and her neighbors would affect her purchasing behavior.
(d) finds that \textit{Taocode}~messages could have a long-term impact on users' purchases.
\normalsize }
\label{fig:ob:all}
\end{figure*}
In this section, we provide an in-depth examination of a large-scale dataset of \textit{Taocode}~ sharing records from three different perspectives; this is done to facilitate a better understanding of \textit{Taocode}~ diffusion's intrinsic properties, along with its influences on the users' purchases.
\subsection{Dataset descriptions}
The dataset for our observational studies is described as follows:
we sample records of \textit{Taocode}~ sharing between \textit{Taobao}~ users during a specific period of time in 2020.
The entire dataset contains over 100 million \textit{Taocode}~sharing records.
Each record consists of basic information, including:
1) who creates and shares the \mbox{\textit{Taocode}}, namely the \textit{sender};
2) who receives the \mbox{\textit{Taocode}}, namely the \textit{receiver};
3) when the receiver opens the \mbox{\textit{Taocode}~}link, namely the \textit{timestamp},
and 4) the details of the item that this \mbox{\textit{Taocode}~} represents, including its \textit{Price Index} (PI)\footnote{Price Index, defined as $\mbox{PI}=f(\mbox{price})$, reflecting the price level of the product, where $f(\cdot)$ is a monotonically increasing non-linear scalar mapping due to privacy concerns.} and the category it belongs to.
To determine the correlations between sharing and purchasing, we extract the purchasing logs related to the \textit{Taocode}~sharing records.
In fact, there is no explicit evidence to indicate that a user buys an item as a direct result of receiving the \textit{Taocode}~;
thus, we adopt the implicit influences of \textit{Taocode}~ by collecting the purchasing records of the receiver and the item that each \textit{Taocode}~message contains,
and assume that \textit{Taocode}~ sharing is the main reason that leads to the purchases if the receiver buys that item \textit{after} receiving a \textit{Taocode}~ within a predefined time span.
Note that for the purchasing predictions,
we collect another group of \textit{Taocode}~samples,
and the above-mentioned dataset is only used for the observations, feature extractions for users and items, along with the \textit{Taocode}~diffusion network construction.
We will introduce the ``prediction dataset'' for the purchasing predictions in \secref{sec:exp}.
\subsection{\textit{Taocode}'s effect on purchases}
\label{subsec:observe:effect}
The first research question is:
\textbf{Does \textit{Taocode}~diffusion have impacts on users' purchasing behaviors? (Q1)}
To directly answer the question, we introduce the \textit{conversion index}~(CI):
\begin{definition}
The Conversion Index (CI) of an item $p$ is the proportion of its purchasing records to the total, i.e.,
$$f(\frac{\mbox{\#(purchasing records of $p$)}}{\mbox{\#(all records of $p$)}})$$
$f$ is a monotonically increasing scalar function that maps the origin proportion to another value for data privacy issues.
It can be formulated under different conditions: (1) CI of browsing, where records are browsing histories; (2) CI of \textit{Taocode}, where records are \textit{Taocode}~ messages.
We further denote the ratio of \mbox{\textit{Taocode}~}sharing CI and browsing CI, i.e., $\frac{\mbox{CI(\textit{Taocode})}}{\mbox{CI(sharing)}}$,
as \textit{CI Lift}, to reveal the effect of \mbox{\textit{Taocode}~}sharing on purchasing behaviors.
If an item has a high CI Lift, it is much more likely that it will be purchased after being shared via \mbox{\textit{Taocode}}.
\end{definition}
We compare the averaged CI of both the \textit{Taocode}~ sharing and product browsing records for all products.
The first of our findings is that items shared via \mbox{\textit{Taocode}~} are much more likely to be purchased:
a 31.0\% higher CI on average (p-value$<$0.01) than that with browsing records alone.
Meanwhile, we group the items by their leaf categories, count the averaged PI among each group, and compare their CI Lift.
As shown in \figref{fig:ob:all}(a), there is a statistically significant positive correlations between CI Lift and averaged PI (slope=0.0448, p-value<0.01). The Spearman correlation between PI and CI Lift is 0.336 (p-value$<$0.01).
In other words, as the item's PI increases, its CI Lift becomes higher;
i.e., \textit{Taocode}~sharing can further promote its purchase rate,
which indicates that when buying expensive goods, users often engage in more consultation before making a final decision.
As the only condition we control is that of whether the products are shared via \textit{Taocode},
we conclude that \textbf{\textit{Taocode}~diffusion does indeed affect users' purchasing behaviors}:
users will be more willing to make a purchase if they receive the \textit{Taocode}~message from someone else.
\subsection{Structural dynamics of \textit{Taocode}}
\label{subsec:observe:structural}
We next investigate how \textit{Taocode}~ affect the purchases in the following two subsections, starting with the following question:
\textbf{Are there any structural characteristics of \textit{Taocode}~diffusion patterns? (Q2)}
We first examine the structural properties of \textit{Taocode}~diffusion networks.
We merge all edges among each dynamic interest diffusion network $\mathcal{G}_t$ at every time step $t$ into one graph $\mathcal{G}$,
and calculate the sum of the in and out degree with respect to different item categories for each user.
Since more than 80\% users have a degree between 1 and 9,
and the degree distribution exhibits a long-tail shape,
we only count \textit{Taocodes}~ where the degrees of both sender and receiver lie between 1 and 9.
The results are shown in \figref{fig:ob:all}(b):
the average CI of all \textit{Taocode}~ records is 19.0, reaching a maximum of 22.7 when the sender's degree is 9 and the receiver's is 1,
and 20.9 when the degrees of the sender and receiver are 1 and 9 respectively.
It is consistent with previous findings in the literature that ``consumers who are central in networks are quite susceptible to others' influences''~\cite{lee2010the}.
However, CI of \textit{Taocodes}~ where the degrees of both sender and receiver are 1 or 9 are only 17.2 and 17.9 ( much lower than average).
Contradicting the initial assumption that \textit{Taocode}~ sharing between high degree users would have a higher CI,
we find that when the gap of degrees between the sender and receiver is larger, CI becomes higher.
This may be explained by noting that a user's online purchases are likely to happen more frequently
if she interacts socially with another user who has a very different pattern of social behaviors.
For example, if a user $u$ who often shares products with others, sends a \textit{Taocode}~message to user $v$ that who uses \textit{Taocode}~ relatively infrequently,
one possible motivation for this sharing is that the item is of urgent demand for $v$;
thus, $v$ is more likely to make a purchase than usual.
Next, we investigate the influence of the receiver's neighbors in the \textit{Taocode}~diffusion.
More specifically, for a \textit{Taocode}~message $(u, v, p, t)$, we look at $v$'s 1-hop neighbors who have received and bought the same product $p$, denoted as \textit{close neighbors}.
The intuition here is that, the number of \textit{close neighbors} of the receiver can reflect the popularity of the item during the diffusion flow to some degree.
We group \textit{Taocode}~records by the number of \textit{close neighbors} of the receivers,
and compare their average CI across different product categories,
as illustrated in \figref{fig:ob:all}(c).
We find that, in general, the more close neighbors the receiver has, the more likely it is that the receiver will buy the item;
i.e., the average CI increases from 18.8 to 25.3 as the $x$-$axis$~ becomes large.
We can therefore conclude that users would have a higher CI on an item if many of their neighbors are in the diffusion flow of this product,
(i.e., receive the \textit{Taocode}~message of this item and buy it).
Our observations are consistent with ~\cite{portrait}, who found that users with social connections may have similar shopping behaviors.
In conclusion, \textbf{the network structure of interest diffusion networks may help us in modeling user purchasing behaviors.}
\subsection{Temporal dynamics of \textit{Taocode}}
\label{subsec:observe:temporal}
Finally, we tackle the temporal dynamics of \textit{Taocode}~diffusion:
\textbf{Does the senders' past receiving history do have impact on receivers' purchasing? (Q3)}
In the literature, a diffusion cascade can be defined as a information flow, as item $p$ flows by $u_1$->$u_2$->$u_3$->...->$u_k$.
To simplify the diffusion process, we only look at the 2-hop cascades that end with the user $u_3$ in the above example.
For convenience of explanation, we refer to the target user as $u_3$, and his/her 1-hop and 2-hop neighbor on an in-edge of a diffusion path as $u_2$ and $u_1$ respectively.
We aim to figure out 1) Does the 1-hop neighbor($u_2$)'s receiving records have impact on the receiver($u_3$)'s purchasing and 2) How does the impact changes over time?
We present the observational result in \figref{fig:ob:all}(d), where x-axis $\delta$ donate the time gap(weeks) between the time when $u_2$ received the same \textit{Taocode}~ and the current \textit{Taocode}~ sent to $u_3$, note that if $u_2$ does not receive the same \textit{Taocode}~ before, the $\delta$ is set to 0. while y-axis donate the \textit{conversion index}.
The first of our finding is that the average CI of \textit{Taocode}~ with $\delta=0$ (no 2-hop neighbors) is 19.1$\pm$4.32, which is lower than the case when 2-hop neighbors exists($\delta$>0).
Moreover, there are no significant differences in the averaged CI between different time gaps $\delta$:
the results of remaining groups ($\delta=2,3,4$ weeks) are in 19.5$\pm$4.49, 19.2$\pm$4.59, and 19.99$\pm$4.16 respectively.
However when it comes to the case in which the sender buys the item later (the blue bars),
we can observe that the average CI is much higher than that of the red bars,
even if the previous \textit{Taocode}~sharing occurs more than four weeks ago (20.4$\pm$4.07, vs. 19.99).
This suggests that \textbf{both the long- and short-term temporal dynamics of \textit{Taocode}~diffusion do indeed exist.}
This is consistent with the common-sense conclusion that (1) the more frequently \textit{Taocode}~ messages are spread within a short time span,
the more likely it is that the item has great popularity with a higher CI;
(2) alternatively, a user $u$ will probably share some product with others long after she receives, and after spending some time making sure that the item deserves the recommendation.
Thus, the temporal dynamics of \textit{Taocode}~diffusion could be an important factor in influencing user purchasing behaviors.
\section{Problem formulation}\label{sec:preliminaries}
To clearly illustrate the proposed framework focusing on the purchasing predictions from the perspective of information diffusion,
we first give the detailed and formal definitions of interest diffusion based on \textit{Taocode}~ sharing and the problem formulation.
We refer to the set of users and products in our dataset from \textit{Taobao}~ as $\mathcal{V}$ and $\mathcal{P}$ respectively,
and further denote $t_i \in T=\{t_1, t_2, \cdots, t_n\}$ as the time step;
here, $n$ is the number of the observed time step,
and each $t_i = (t_b^i, t_e^i)$ represents a specific period of time, starting at $t_b^i$ and ending at $t_e^i$.
\begin{definition}
\textbf{\textit{Taocode}~ diffusion.}
Each \textit{Taocode}~ sharing message represents a diffusion record,
which we formulate as a 4-tuple $d \in \mathcal{D}_t = \{(u, v, p, t_d)\ | u, v \in \mathcal{V}, p \in \mathcal{P}, t=(t_b, t_e) \in T\}$,
satisfying $t_b \le t_d \le t_e$.
Here, $u$ and $v$ denote the receiver and sender respectively of the \textit{Taocode}~message,
$p$ is the item that is shared, and $t_d$ is the time at which the \textit{Taocode}~ is received by $u$ from $v$.
\end{definition}
\begin{definition}
\textbf{Interest diffusion network}
is a directed attributed network $\mathcal{G_D} = (\mathcal{V}, \mathcal{E}, \mathcal{H} | \mathcal{D})$
constructed from a \textit{Taocode}~ diffusion set $\mathcal{D}$,
where each node $u \in \mathcal{V}$ represents an online shopping user with feature vector $\mathcal{H}_u$,
while the edge $e \in \mathcal{E}$ indicates the interest diffusion messages between users,
with the features $H_e$ denoting the edge attributes.
Formally, there exists an edge $e_{uv}$ between two users $u$ and $v$,
if the tuple $(u, v, p^*, t^*)$ is an element in $\mathcal{D}$ for some item $p^*$ and timestamp $t^*$,
and the attribute $H_{e_{uv}}$ of the edge $e_{uv}$ contains the detailed information of the product $p^*$, e.g., PI, categories, etc.
\label{def:idn}
\end{definition}
\begin{definition}
\textbf{Dynamic interest diffusion network} is a sequence of interest diffusion networks $\mathcal{G} = \{\mathcal{G}_1, \cdots, \mathcal{G}_n\}$
constructed from \textit{Taocode}~diffusion sets $\mathcal{D} = \{\mathcal{D}_1, \cdots, \mathcal{D}_n\}$, where $i$ indicates the time step $t_i$.
For each time step $t$, we collect all \textit{Taocode}~ diffusions $\mathcal{D}_t$ that occurs during the given time span $(t_b, t_e)$ from the data source,
and add edges into the network $\mathcal{G}_t$ as described in \defref{def:idn}.
\end{definition}
\textbf{Problem definition.}
Considering a dynamic interest diffusion network $\mathcal{G}$, along with a query $q = (v,p,t_i)$ that $v\in\mathcal{V}, p\in\mathcal{P}, t_i\in T$,
the problem we aim to solve is that of determining whether the user $v$ will purchase product $p$ within the time span $t_i$.
Since the total number of items on an online shopping platform (\textit{Taobao}.com in our experiment) is very large,
to simplify the problem and investigate the influence of \textit{Taocode}~diffusion,
we implement a restriction that $v$ should receive \textit{Taocode}~messages containing the product $p$ from some other users during the time span $t_{i - 1}$.
We do not place limitations on that whether the user $v$ has received the \textit{Taocode}~ before $t_{i - 1}$;
thus, both the short- and long-term impact of \textit{Taocode}~diffusion are expected to be modeled to achieve better performance.
The additional benefit is that the number of possible queries is significantly reduced,
which makes it feasible to conduct comparison experiments between selected baselines.
\section{Related work}
\vpara{Purchase prediction in the recommendation system.}
Online shopping has been investigated since the early stages of the Web. Purchase behavior prediction in e-commerce is a classic but difficult problem.
Many previous works studies online shopping behaviors based on features of users and products~\cite{sismeiro2004modeling,portrait,viral}, such as item price and user credit records, etc.
Besides, traditional collaborative filtering~\cite{sarwar2001item} and deep learning techniques are used to predict the probabilities of which item will be purchased by the user.
Some of them try to extract the implicit correlations between users and items~\cite{koren2008factorization,he2017neural,wang2019neural,he2020lightgcn}.
Another kind of methods focus on the click and purchase records of users, which treat the click/purchase records as a sequence and encoding them with a sequence encoder such as RNNs~\cite{hidasi2015session}, and GNNs~\cite{wu2019session,wang2020beyond,wang2020global}.
The goal of these methods is digging out the regular pattern of item purchases.
\vpara{Social recommendations.}
Due to the potential value of social relations and user interactions in the recommendation systems, social recommendation has attracted increasing attention~\cite{tang2013social}. As theories from the domain of social science show the homophily and influence~\cite{bakshy2012role} between social relations, various approaches are proposed to build social recommendation systems such as trust ensemble~\cite{ma2009learning}, trust SVD~\cite{guo2015trustsvd}, and social regularization~\cite{ma2011recommender}.
More recently, deep learning methods as well as transfer learning~\cite{chen2019efficient} and GNNs~\cite{fan2019graph,wu2019neural,wu2020diffnet++,xu2019relation} are also adopted to solve the problem.
\vpara{Deep learning on graphs.}
Recently, GNNs have achieved state-of-the-art performance on many tasks~\cite{gcn,gat,gin,wang2021modeling}.
Based on the Message-Passing framework, many works have expanded the capabilities to tackle different types of graph,
such as heterogeneous graphs~\cite{hgt} and dynamic graphs~\cite{hu2021time,zhou2018dynamic}. These improvements make GNNs better compatible for purchase prediction in real-world applications~\cite{fan2019metapath,song2019session}.
| {'timestamp': '2022-01-03T02:06:34', 'yymm': '2112', 'arxiv_id': '2112.14446', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14446'} | arxiv |
\section{Introduction}
\label{sec:intro}
Neural Machine Translation \citep[NMT,][]{sutskever2014sequence,bahdanau2015neural,vaswani2017attention} has made revolutionary advances in the past several years.
However, the effectiveness of these data-driven NMT systems is heavily reliant on the large-scale training corpus, where the word frequencies demonstrate a long-tailed distribution according to Zipf's Law~\cite{Zipf1949HumanBA}.
The inherently imbalanced data leads NMT models to commonly prioritize the generation of frequent words while neglect the rare ones.
Therefore, predicting low-frequency yet semantically rich words remains a bottleneck of current data-driven NMT systems \cite{vanmassenhove-etal-2019-lost}.
\begin{figure}[ht]
\centering
\includegraphics[scale=0.71]{Figures/Dis_Recall_5_2.png}
\caption{Average token representation distance and 1-gram recall of token buckets with different frequencies on NIST Zh-en test sets and a well-trained vanilla Transformer model. We sort all tokens in target vocabulary based on their frequencies in LDC training set, and divide them into five equal-size buckets. Obviously, the average token distance and 1-gram recall similarly deteriorate with decreasing frequency.}
\label{fig:example}
\end{figure}
A common practice to facilitate the generation of infrequent words is to smooth the frequency distribution of tokens. For example, it has become a de-facto standard to split words into more fine-grained translation units such as subwords \cite{wu2016google,sennrich2016neural-bpe}.
Despite that, NMT systems still face the token imbalance phenomenon \cite{gu2020token}.
More recently, some efforts have been dedicated to applying adaptive weights to target tokens in training objectives based on their frequency \cite{gu2020token,Xu2021}.
By heightening the exposure of low-frequency tokens during training, these models can meliorate the neglect of low-frequency tokens and improve lexical diversity of the translations.
However, simply promoting low-frequency tokens via loss re-weighting may potentially sacrifice the learning of high-frequency ones
~\cite{gu2020token,DBLP:conf/emnlp/WanYWZCZC20,zhou2020uncertainty}.
Besides, our further investigation on these methods reveals that generating more unusual tokens comes at the unexpected expense of their prediction precision (Section \ref{sec:1-gram-metric}).
In modern NMT models, the categorical distribution of the predicted word in a decoding step is generated by multiplying the last-layer hidden state by the softmax embedding matrix.\footnote{In the following we will call the softmax embeddings as word embeddings, since sharing them in NMT decoder has been a de-facto standard \cite{iclr2017tying}.}
Therefore, unlike previous explorations, we preliminarily investigate low-frequency word predictions from the perspective of the word representation. As illustrate in Figure~\ref{fig:example}, we divide all the target tokens into several subsets according to their frequencies, and check token-level predictions of each subset based on the vanilla Transformer~\cite{vaswani2017attention}. Our observation is that the average word embedding distance\footnote{L2 distance on normalized word embeddings.} and 1-gram recall\footnote{The 1-gram recall (also known as ROUGE-1 \cite{Lin2004ROUGEAP}) is defined as the number of tokens correctly predicted in output divided by the total tokens in reference.} of these subsets demonstrate a similar downward trend with word frequency decrease.
Another important fact is that the embedding of a ground-truth word and the corresponding hidden state will be pushed together during training to get a more significant likelihood~\cite{gao2019representation}.
It inspires us that making the hidden states more diversified could potentially benefit the prediction of low-frequency words. On the one hand, more diversified hidden states could expand word embedding space due to their collaboration in NMT models, which is exactly what we expect given the correlation shown in Figure \ref{fig:example}. On the other hand, regarding each decoding step as a multi-class classification task, more diversified hidden states can generate better classification boundaries that are more friendly to long-tailed classes (or low-frequency words).
To this end, we propose incorporating contrastive learning into NMT models to improve low-frequency word predictions. Our contrastive learning mechanism has two main characteristics. Firstly, unlike previous efforts that contrast at the sentence level~\cite{acl2021multilingual,iclr2021CONTRASTIVE}, we exploit token-level contrast at each decoding step to produce hidden states more uniformly distributed. Secondly, our contrastive learning is frequency-aware. As long-tailed tokens form a more compact embedding space, we propose to amplify the contrastive effect for relatively low-frequency
tokens. In particular, for an anchor and one of its negatives, we will apply a soft weight to the corresponding distances based on their frequencies—generally, the lower their frequency, the greater the weight.
We have conducted experiments on Chinese-English and English-German translation tasks. The experimental results demonstrate that our method can significantly outperform the baselines and consistently improve the translation of words with different frequencies, especially rare ones.
Overall, our contributions are mainly three-fold:
~\begin{itemize}
\item We propose a novel \textbf{F}requency-aware token-level \textbf{C}ontrastive \textbf{L}earning method (FCL) for NMT, providing a new insight of addressing the low-frequency word prediction from the representation learning perspective.
\item Extensive experiments on Zh-En and En-De translation tasks show that FCL remarkably boosts translation performance, enriches lexical diversity, and improves word representation space.
\item Compared with previous adaptive training methods, FCL demonstrates the superiority of (1) promoting the output of low-frequency words
without sacrificing the token-level prediction precision and (2) consistently improving token-level predictions across different frequencies, especially for infrequent words.
\end{itemize}
\section{Methodology}
In this section, we mathematically describe the proposed Frequency-aware Contrastive Learning (FCL) method in detail. FCL firstly cast autoregressive neural machine translation as a sequence of classification tasks, and differentiate the hidden representations of different target tokens in Transformer decoder by a token-level contrastive learning method (TCL).
To facilitate the translation of low-frequency words, we further equip TCL with frequency-aware soft weights, highlighting the classification boundary for the infrequent tokens. An overview of TCL and FCL is illustrated in Figure \ref{fig:model}.
\subsection{Token-Level Contrastive Learning}
\label{sec:TCL}
In this section we briefly introduce the Token-level Contrastive Learning (TCL) method for NMT. Different from the previous explorations in NMT which contrast the sentence-level representation in the scenario of multilingualism \cite{acl2021multilingual} or adding perturbation \cite{iclr2021CONTRASTIVE}, TCL exploits contrastive learning objectives in the token granularity. Concretely, TCL contrasts the hidden representations of target tokens before softmax classifier. There are two ways in TCL to construct positive instances for each target token: a supervised way to explore the presence of golden label in reference and a supplementary way to take advantage of dropout noise.
\subsubsection{Supervised Contrastive Learning}
For supervised contrastive learning, the underlying thought is to pulling together the same tokens and pushing apart the different tokens. Inspired by \citet{khosla2020supervised}, we propose a token-level contrastive framework for NMT, which contrasts the in-batch token representations in Transformer decoder. For each target token, we explore the inherent supervised information in the reference to construct the positive samples by the same tokens from the minibatch, and the negative samples are formed by the in-batch tokens different from the anchor.
In this way, the model can learn effective representation with clear boundaries for the target tokens.
\subsubsection{Supplementary Positives with Dropout Noise}
In a supervised contrast learning scenario, however, a target token may have no same token in the minibatch due to the token imbalance phenomenon. This limitation is particularly severe when it comes to low-frequency tokens. Thus the supervised contrastive objectives can barely ameliorate the representations of infrequent tokens since in most cases they have no positive instance.
Inspired by \citet{gao2021simcse}, we construct a pseudo positive instance for each anchor by applying independently sampled dropout strategy. By feeding a parallel sentence pair twice into the NMT model and applying different dropout samples, we can obtain a supplementary hidden representation for each target token with dropout noise. In this way, the supplement can serve as the positive instance for the original token representation. Thereby each target token will be assigned at least one positive instance for an effective contrastive learning.
\subsubsection{Formalization}
The proposed token-level contrastive leaning combines the above two strategies to build the positive instances and use the other in-batch tokens as the negatives.
Formally, given a minibatch with $K$ parallel sentence pairs, $\{{\mathbf x}_k,{\mathbf y}_k\}_{k=1...K}$, which contains a total of $M$ source tokens and $N$ target tokens, the translation probability $p(y_i|\mathbf{y}_{<i},\mathbf{x})$ for the $i^{th}$ in-batch target token $y_i$ is commonly calculated by multiplying the last-layer decoder hidden state $s_i$ by the softmax embedding matrix $\mathbf{W_s}$ in a softmax layer:
\begin{equation}
p(y_i|\mathbf{y}_{<i},\mathbf{x}) \propto {\rm{exp}}(\mathbf{W_s} \cdot s_i),
\label{E3}
\end{equation}
In TCL, we feed the inputs to the model twice with independent dropout sample and get two hidden representations $s_i$ and $s'_i$ for a target token $y_i$. For an anchor $s_i$, $s'_i$ serves as the positive, as well as the representations of target tokens that same as $y_i$. The token-level contrastive objective can be formulated as:
\vspace{-2ex}
\begin{equation}
L_{TCL} = -\frac{1}{N} \sum_{i=1}^{N} \sum_{s_p \in S_p(i)} {\rm log}\frac{e^{sim(s_i\cdot s_p)}}{ {\textstyle \sum_{j=1}^{N}} e^{sim(s_i\cdot s_j)}},
\end{equation}
where $sim(s_i\cdot s_p)$ denotes the cosine similarity between $s_i$ and $s_p$. Here, $S_p(i)= S_{sup}(i) \cup S_{drop}(i)$ is the set of all positive instances for $y_i$. $S_{sup}(i) = \{s_p:p \neq i, p=1...N,y_p=y_i\}$ denotes the positives in supervised contrastive setting, and $S_{drop}(i) = \{s'_i\}$ is the counterpart constructed by dropout noise.
Finally, the overall training objective combines the traditional NMT objective $L_{MT}$ and the token-level contrastive objective $L_{TCL}$:
\begin{equation}
L = L_{MT} + \lambda L_{TCL},
\end{equation}
where $\lambda$ is a hyperparameter to balance the effect of TCL.
\subsection{Frequency-Aware Contrastive Learning}
Token-level contrastive learning treats tokens equally when widening their boundary. However, due to the severe imbalance on token frequency,
a small number of high-frequency tokens make up the majority of token occurrence in a minibatch while most low-frequency words rarely occur in a minibatch. Thus, TCL mainly contrasts the frequent tokens whereas neglects the contrast between the low-frequency tokens. In fact, as illustrated in Section \ref{sec:intro}, the representation of infrequent tokens are more compact and underinformative, which are in more need of amelioration.
Intuitively, in this scenario a better blueprint for contrast is to put more emphasis on the contrast of infrequent tokens. As a consequence, the model can assign more distinctive representations for infrequent tokens and facilitate the translation of infrequent tokens.
To this end, we further propose a Frequency-aware Contrast Learning (\textbf{FCL}) method, which utilizes a soft contrastive paradigm to assign frequency-aware soft weights in contrast and thus highlights the contrast of the infrequent tokens.
Formally, for each target token $y_i$, we assign a soft weight $w(i,j)$ for the contrast between the anchor $y_i$ and a negative sample $y_j$. This frequency-aware is determined by the frequencies of both $y_i$ and $y_j$. In FCL, the positives and negatives are built up with the same strategy in token-level contrastive learning. The soft contrastive learning objects can be rewritten as follows:
\begin{equation}
L_{FCL} = -\frac{1}{N} \sum_{i=1}^{N} \sum_{s_p \in S_p(i)} {\rm log}\frac{e^{sim(s_i\cdot s_p) }}{ {\textstyle \sum_{j=1}^{N}} w(i,j)e^{sim(s_i\cdot s_j) }},
\end{equation}
where $w(i,j)$ is a soft weight in light of frequencies of both the anchor $y_i$ and a negative sample $y_j$.
The underlying insight is to highlight the contrastive effect for infrequent tokens.
The \textbf{frequency-aware soft weight} $w(i,j)$ is formulated as:
\begin{equation}
\begin{aligned}
& w(i,j) = {\gamma} f(y_i)f(y_j),\\
f( y & _i) = 1-\frac{{\rm log( Count}(y_i))}{\underset{j=1...N}{\rm max} {\rm log(Count}(y_j))},
\end{aligned}
\end{equation}
where $f(y_i)$ and $f(y_j)$ are the individual frequency score for $y_i$ and $y_j$, respectively. $\gamma$ is a scale factor for $w(i,j)$. Count$(y_i)$ denotes the word count of $y_i$ in the training set. In our implement,
the mean value of frequency-aware weights for all negatives of anchor $y_i$ is normalized to be 1.
Accordingly, we weight the traditional NMT objective $L_{MT}$ and the frequency-aware contrastive objective $L_{FCL}$ by a hyperparameter $\lambda$ as follows:
\begin{equation}
L = L_{MT} + \lambda L_{FCL}.
\end{equation}
\section{Experimental Settings}
\label{sec:setting}
\begin{table*}[!htpb]
\centering
\begin{tabular}{l||ccccccc||cc}
\hline
\multirow{2}{*}{} & \multicolumn{7}{c||}{Zh-En} & \multicolumn{2}{c}{En-De} \\
Systems & MT02 & MT03 & MT04 & MT05 & MT08 & AVG & $\Delta$ & WMT14&$\Delta$\\ \hline
\multicolumn{10}{c}{Baseline NMT systems} \\ \hline
Transformer & 47.06 & 46.89 & 47.63 & 45.40 & 35.02 & 44.40 & & 27.84 \\ \hdashline
Focal & 47.11 & 45.70 & 47.32 & 45.26 & 35.61 & 44.20 & -0.20 &27.91& +0.07 \\
Linear & 46.84 & 46.27 & 47.26 & 45.62 & 35.59 & 44.32 & -0.08 &28.02 &+0.18 \\
Exponential & 46.93 & 47.45 & 47.52 & 46.11 & 36.04 & 44.81 & +0.41 & 28.17 & +0.33 \\
Chi-Square & 47.14 & 47.15 & 47.68 & 45.46 & 36.15 & 44.72 & +0.32 & 28.31 & +0.47\\
BMI & 48.05 & 47.11 & 47.64 & 45.97 & 35.93 & 44.94 & +0.54 &28.28 & +0.44\\
CosReg & 47.11 & 46.98 & 47.72 & 46.60 & 36.66 & 45.01 & +0.61 & 28.38& +0.54\\
\hline
\multicolumn{10}{c}{Our NMT systems} \\ \hline
TCL & 48.28$^{\dagger\dagger}$ & 47.90$^{\dagger\dagger}$ & 48.31$^{\dagger\dagger}$ & 46.23$^\dagger$~ & 36.67$^{\dagger\dagger}$ & 45.48$^{\dagger\dagger}$ & +1.08 & 28.51$^\dagger$~ & +0.67\\
FCL & \textbf{48.95}$^{\dagger\dagger}$ & \textbf{48.63}$^{\dagger\dagger}$ & \textbf{48.38}$^{\dagger\dagger}$ & \textbf{46.82}$^{\dagger\dagger}$ & \textbf{37.00}$^{\dagger\dagger}$ & \textbf{45.96}$^{\dagger\dagger}$ & \textbf{+1.56} & \textbf{28.65}$^{\dagger\dagger}$ & \textbf{+0.81}\\
\hline
\end{tabular}
\caption{Main results on NIST Zh-En and WMT14 En-De tasks. $\Delta$ shows the average BLEU improvements over the test sets compared with Transformer baseline. ``$\dagger$'' and ``$\dagger\dagger$'' indicate the improvement over Transformer is statistically significant ($p<$ 0.05 and $p<$ 0.01, respectively), estimated by bootstrap sampling \cite{Koehn2004StatisticalST}.}
\label{table:main}
\end{table*}
\subsection{Setup}
\paragraph{Data Setting} We evaluate our model on both widely used NIST Chinese-to-Engish (Zh-En) and WMT14 English-German (En-De) translation tasks.
\begin{itemize}
\item For Zh-En translation, we use the LDC\footnote{The training set includes LDC2002E18, LDC2003E07, LDC2003E14, Hansards portion of LDC2004T07, LDC2004T08 and LDC2005T06.} corpus as the training set, which consists of 1.25M sentence pairs. We adopt NIST 2006 (MT06) as the validation set and NIST 2002, 2003, 2004, 2005, 2008 datasets as the test sets.
\item For En-De Translation, the training data contains 4.5M sentence pairs collected from WMT 2014 En-De dataset. We adapt newstest2013 as the validation set and test our model on newstest2014.
\end{itemize}
We adopt Moses tokenizer to deal with English and German sentences, and segment the Chinese sentences with the Stanford Segmentor.\footnote{\url{https://nlp.stanford.edu/}} Following common practices, we employ byte pair encoding \cite{sennrich2016neural-bpe} with 32K merge operations.
\paragraph{Implementation Details}
We examine our model based on the advanced Transformer architecture and \emph{base} setting~\cite{vaswani2017attention}. All the baseline systems and our models are implemented on top of THUMT toolkit \cite{zhang2017thumt}.
During training, the dropout rate and label smoothing are set to 0.1. We employ the Adam optimizer with $\beta_2$ = 0.998. We use 1 GPU for the NIST Zh-En task and 4 GPUs for WMT14 En-De task. The batch size is 4096 for each GPU.
The other hyper-parameters are the same as the default ``\emph{base}'' configuration in \citet{vaswani2017attention}.
The training of each model is early-stopped to maximize BLEU score on the development set.
The best single model in validation is used for testing. We use $multi{\rm{-}}bleu.perl$\footnote{https://github.com/moses-smt/mosesdecoder/blob/ master/scripts/generic/multi-bleu.perl} to calculate the case-sensitive BLEU score
For TCL and FCL, the optimal $\lambda$ for contrastive learning loss is 2.0. The scale factor $\gamma$ in FCL is set to be 1.4.
All these hyper-parameters are tuned on the validation set.
Note that compared with Transformer, TCL and FCL have no extra parameters and require no extra training data, hence demonstrating consistent inference efficiency. Due to the supplementary positives with dropout noise in contrastive objectives, the training speed of FCL is about 1.59$\times$ slower than vanilla Transformer.
\subsection{Baselines}
We re-implement and compare our proposed token-level contrastive learning (TCL) and frequency-aware contrastive learning (FCL) methods with the following baselines:
\begin{itemize}
\item \textbf{Transformer} \cite{vaswani2017attention} is the most widely-used NMT system with self-attention mechanism.
\item \textbf{Focal} \cite{lin2017focal} is a classic adaptive training method proposed for tackling label imbalance problem in object detection.
In Focal loss, difficult tokens with low prediction probabilities are assigned with higher learning rates.
We treat it as a baseline because the low-frequency tokens are intuitively difficult to predict.
\item \textbf{Linear} \cite{jiang2019improving} is an adaptive training method with a linear weight function of word frequency.
\item \textbf{Exponential} \cite{gu2020token} is an adaptive training method with the exponential weight function.
\item \textbf{Chi-Square} \cite{gu2020token} is an adaptive training method that adopts a chi-square distribution as the weight function. The exponential and chi-square weight functions are shown in Figure \ref{subfigure:exp_k2}.
\item \textbf{BMI} \cite{Xu2021} is a bilingual mutual information based adaptive training objective which estimates the learning difficulty between the source and the target to build the adaptive weighting function.
\item \textbf{CosReg} \cite{gao2019representation} is a cosine regularization term to maximize the distance between any two word embeddings to mitigate representation degeneration problem. We also treat it as a baseline.
\end{itemize}
\section{Experimental Results}
\subsection{Main Results}
Table \ref{table:main} shows the performance of the baseline models and our method variants on NIST Zh-En and WMT En-De translation tasks. We have the following observations.
First, regarding the adaptive training methods, those carefully designed adaptive objectives (e.g., Exponential, Chi-Square, and BMI) achieve slight performance improvement compared with two previous ones (Focal and Linear). As revealed in ~\citet{gu2020token}, Focal and Linear will harm high-frequency token prediction by simply highlighting the loss of low-frequency ones. In fact, our further investigation shows that these newly proposed adaptive objectives alleviate but do not eliminate the negative impact on more frequent tokens, and the increasing weight comes with an unexpected sacrifice in word prediction precision. This is the main reason for their marginal improvements (see more details in Section \ref{sec:1-gram-metric}).
Second, even as a suboptimal model, our proposed TCL outperforms all adaptive training methods on both Zh-En and En-De translation tasks. This verifies that expanding softmax embedding latent space can effectively improve the translation quality, which is confirmed again by the results of CosReg.
Compared with CosReg improving the uniformity using a data-independent regularizer, ours leverage the rich semantic information contained in the training instances to learn superior representations, thus performing a greater improvement.
Third, FCL further improves TCL, achieving the best performance and significantly outperform Transformer baseline on NIST Zh-En and WMT En-De tasks. For example, FCL achieves an impressive BLEU improvement of 1.56 over vanilla Transfomer on Zh-En translation. The results clearly demonstrate the merits of incorporating frequency-aware soft weights into contrasting.
\begin{table}[t]
\centering
\begin{tabular}{l|lll}
\hline
Method & High & Medium & Low \\ \hline
Transformer & 50.11 & 43.92 & 39.30 \\ \hdashline
Exponential & 49.89\scriptsize\emph{(-0.22)} &44.20\scriptsize\emph{(+0.28)} &40.42\scriptsize\emph{(+1.12)} \\
Chi-Square & 50.13\scriptsize\emph{(+0.02)} &44.18\scriptsize\emph{(+0.26)} &39.95\scriptsize\emph{(+0.65)} \\
BMI &50.35\scriptsize\emph{(+0.24)} &44.02\scriptsize\emph{(+0.10)} &40.44\scriptsize\emph{(+1.14)}\\ \hdashline
TCL & 50.74\scriptsize\emph{(+0.63)} &45.05\scriptsize\emph{(+1.13)} &40.73\scriptsize\emph{(+1.43)} \\
FCL &\textbf{50.95\scriptsize\emph{(+0.84)}} &\textbf{45.42\scriptsize\emph{(+1.50)}} &\textbf{41.30\scriptsize\emph{(+2.00)}} \\
\hline
\end{tabular}
\caption{BLEU scores on NIST Zh-En test subsets with different proportions of low-frequency words. ``Low'' denotes the subset in which the target sentences contain more low-frequency words, while ``High'' is the opposite. Our methods yield better translation quality across different subsets.}
\label{tabel:subsets}
\end{table}
\begin{figure*}[t!]
\centering
\subfigure[1-Gram Recall Gap]{
\begin{minipage}[t]{0.235\textwidth}
\centering
\includegraphics[scale = 0.405]{Figures/Recall_gap_5_3.png}
\end{minipage}
\label{Recall_gap}
}
\subfigure[1-Gram Precision Gap]{
\begin{minipage}[t]{0.235\textwidth}
\centering
\includegraphics[scale = 0.405]{Figures/Precision_gap_5_3.png}
\end{minipage}
\label{Precision_gap}
}
\subfigure[1-Gram F1 Gap]{
\begin{minipage}[t]{0.235\textwidth}
\centering
\includegraphics[scale = 0.405]{Figures/F1_gap_5_3.png}
\end{minipage}
\label{F1_gap}
}
\subfigure[Adaptive Weighting Functions]{
\begin{minipage}[t]{0.235\textwidth}
\centering
\includegraphics[scale = 0.405]{Figures/exp_k2_4.png}
\end{minipage}
\label{subfigure:exp_k2}
}
\caption{(a)/(b)/(c) The 1-Gram Recall/Precision/F1 gaps between various models and transformer. The horizontal dashed line means the Transformer baseline. (d) The Exponential and Chi-Square weighting functions in \citet{gu2020token} with descending token frequency.
As seen, our methods consistently recall more tokens across different frequencies, in the meanwhile, maintaining the preciseness of prediction.}
\label{Gap}
\end{figure*}
\subsection{Effects on Translation Quality of Low-Frequency Tokens}
\label{sec:rare-word-quality}
In this section, we investigate the translation quality of low-frequency tokens.\footnote{This experiment and the following ones are all based on Zh-En translation task.} Here we define a target word as a low-frequency word if it appears less than two hundred times in LDC training set\footnote{These words take up the bottom 40\% of the target vocabulary in terms of frequency.}. We then rank the target sentences in NIST test sets by the proportion of low-frequency words and divide them into three subsets: ``High'', ``Middle'', and ``Low''.
The BLEU scores on the three subsets are shown in Table \ref{tabel:subsets}, from which we can find a similar trend across all methods that the more low-frequency words in a subset, the more notable the performance improvement. Another two more critical observations are that: (1) FCL and TCL demonstrate their superiority over the adaption training methods across all three subsets of different frequencies. (2) The performance improvements on three subsets we achieved (e.g., 0.84, 1.50, and 2.00 by FCL ) consistently keeps remarkable, while the effects of the adaption training methods on subset ``High'' and ``Middle'' are modest. Note that the Exponential objective even brings a performance degradation on ``High''. These observations verify that our method effectively improves the translation quality of rare tokens, and suggest that improving representation space could be a more robust and systematic way to optimize predictions of diversified-frequency tokens than adaptive training.
\begin{table}[t]
\centering
\begin{tabular}{l|l l l}
\hline
Method & MATTR$\uparrow$ & HD-D$\uparrow$ &MTLD$\uparrow$ \\ \hline
Transformer & ~~86.87 & ~86.13 & ~70.96\\ \hdashline
Exponential & ~~87.52 & ~86.86 & ~75.77\\
Chi-Square & ~~87.16 & ~86.44 & ~71.97\\
BMI & ~~87.33 & ~86.64 & ~74.05\\ \hdashline
TCL & ~~87.00 & ~86.25 & ~71.81\\
FCL & ~~87.38 & ~86.71 & ~73.86\\ \hdashline
$Reference$ & ~~88.98 & ~88.23 & ~82.47\\
\hline
\end{tabular}
\caption{Lexical diversity of translations on NIST test sets. \\ $\uparrow$ means greater value for greater diversity. Both the proposed models and the related studies raise the lexical richness.}
\label{table:lexical_diversity}
\end{table}
\iffalse
\begin{table}[]
\centering
\begin{tabular}{l|lllll}
\hline
& Seg$_0$ & Seg$_1$ & Seg$_2$ & Seg$_3$ & Seg$_4$ \\ \hline
Transformer & 87.42 & 7.21 & 3.14 & 1.60 & 0.62 \\\hdashline
Exponential & 85.49 & 7.85 & 3.82 & 1.93 & 0.92 \\
Chi-square & 87.12 & 7.27 & 3.26 & 1.70 & 0.65 \\
BMI & 86.93 & 7.39 & 3.27 & 1.69 & 0.71 \\\hdashline
CL & 87.39 & 7.17 & 3.09 & 1.67 & 0.68 \\
FCL & 87.23 & 7.22 & 3.19 & 1.65 & 0.71 \\\hdashline
$Reference$ & 84.48 & 7.91 & 3.90 & 2.31 & 1.40 \\\hline
\end{tabular}
\caption{Token distributions with different frequency in references. Seg$_n$ indicates vocabulary segmentation with $n^{th}$ highest average frequency.}
\label{table:frequency}
\end{table}
\fi
\subsection{Effects on Lexical Diversity}
As overly ignoring the infrequent tokens will lead to a lower lexical diversity~\cite{vanmassenhove-etal-2019-lost}, we investigate our methods' effects on lexical diversity following ~\citet{gu2020token} and~\citet{Xu2021}. We statistic three lexical diversity metrics based on the translation results on NIST test sets, including moving-average type-token ratio (MATTR) ~\cite{covington2010cutting}, the approximation of hypergeometric distribution (HD-D)
and the measure of textual lexical diversity (MTLD) \cite{mccarthy2010mtld}. The results are reported in Table \ref{table:lexical_diversity}, from which we can observe lexical diversity enhancements brought by FCL and TCL over vanilla Transformer,
proving the improved tendency of our method to generate low-frequency tokens.
More importantly, we find that Exponential yields the best lexical diversity, though its overall performance improvement in terms of BLEU is far from ours. This observation inspired us to conduct a more thorough investigation of the token-level predictions, which will be described next.
\begin{figure*}[t!]
\centering
\subfigure[Transformer]{
\begin{minipage}[t]{0.32\textwidth}
\centering
\includegraphics[scale = 0.58]{Figures/emb_transformer_3_2.png}
\end{minipage}
\label{Recall_gap}
}
\subfigure[Transformer with TCL]{
\begin{minipage}[t]{0.32\textwidth}
\centering
\includegraphics[scale = 0.58]{Figures/emb_cl_3_2.png}
\end{minipage}
\label{Precision_gap}
}
\subfigure[Transformer with FCL]{
\begin{minipage}[t]{0.32\textwidth}
\centering
\includegraphics[scale = 0.58]{Figures/emb_fcl_3_2.png}
\end{minipage}
\label{F1_gap}
}
\caption{Visualization of word representations (or softmax embeddings) in (a) Transformer, (b) Transformer with TCL, and (c) Transformer with FCL trained on LDC Zh-En dataset. The tokens are evenly divided into three buckets according to the token frequency in the training set. The red dots (``High'') represents the first third of target tokens with high frequency, while the orange and blue ones denote the ``Medium'' and ``Low'' buckets, respectively. In baseline system, the rarer the token, the more serious the problem of representation degeneration is. Obviously, the proposed methods progressively alleviate this problem.}
\label{embedding}
\end{figure*}
\subsection{Effects on Token-Level Predictions}
\label{sec:1-gram-metric}
Recapping that the three metrics of lexical diversity mainly involve token-level recall, we start by investigating the 1-Gram Recall (or ROUGE-1)
of different methods. First, we evenly divide all the target tokens into five groups according to their frequencies, exactly as we did in Figure 1. The 1-Gram Recall results are then calculated for each group, and the gaps between vanilla Transformer and other methods are illustrated in Figure~\ref{Gap} (a) with descending token frequency. Regarding the adaptive training methods, we can more clearly see how different token weights affect the token-level predictions by combing Figure~\ref{Gap} (a) and Figure~\ref{Gap} (d) (plots of the Exponential and Chi-Square weighting functions). Here We mainly discuss based on Exponential for convenience, but note that our main findings also apply to Chi-Square. Generally, we find that 1-Gram Recall enhancement is positively related to the token exposure (or weights), roughly explaining why Exponential achieves the best lexical diversity.
Despite the high 1-Gram Recall of Exponential, its unsatisfied overall performance reminds us that the precision of token-level prediction matters. The 1-Gram Precision\footnote{also known as 1-Gram Accuracy in \citet{Feng2020ModelingFA}.} results illustrated in Figure~\ref{Gap} (b) verifies our conjecture. Different from the trend in Figure \ref{Gap} (a), the gaps of Exponential here looks negatively related to the token exposure. This contrast suggests that though the adaptive training methods generate more low-frequency tokens, the generated ones are more likely to be incorrect. Our FCL and TCL, however, maintain the preciseness of token prediction across different frequencies. The 1-Gram Precision improvements of FCL on low-frequency words (Low and Very Low) are even better than high-frequency ones.
Finally, we investigate the 1-Gram F1, a more comprehensive metric to evaluate token-level predictions by considering both 1-Gram Recall and Precision. Based on the polylines shown in Figure~\ref{Gap} (C), we can conclude two distinguished merits of our method compared to the adaptive training methods: (1) enhancing low-frequency word recall without sacrificing the prediction precision and (2) improving token-level predictions across different frequencies consistently, which also confirms the observation in Section ~\ref{sec:rare-word-quality}.
\subsection{Effects on Representation Learning}
Since we approach low-frequency word predictions from a representation learning perspective, we finally conduct two experiments to show how our method impacts word representation, though it is not our primary focus.
\begin{table}[t]
\centering
\begin{tabular}{l|l|l|l|l}
\hline
Method & -Uni $\uparrow$ & Dis $\uparrow$ & $I_1({\rm \mathbf W})\uparrow$ & $I_2({\rm \mathbf W})\downarrow$ \\ \hline
Transformer & 0.2825 & 0.3838 & 0.7446 & 0.0426\\ \hdashline
Exponential & 0.1148 & 0.2431 & 0.7394 & 0.0432\\
Chi-Square & 0.2276 & 0.3442 & 0.7217 & 0.0425\\
BMI & 0.2118 & 0.3190 & 0.7644 & 0.0430\\ \hdashline
TCL & 0.7024 & 0.5988 & \textbf{0.7903} & 0.0399 \\
FCL & \textbf{0.7490} & \textbf{0.6192} & 0.7652 & \textbf{0.0394}\\
\hline
\end{tabular}
\caption{The uniformity and isotropy of softmax embeddings on LDC Zh-En machine translation. $\uparrow$ means a positive correlation with the uniformity of the representation and $\downarrow$ represents a negative correlation to the contrary. Our methods can generate more expressive representations. }
\label{uniformity}
\end{table}
Table \ref{uniformity} summarizes the uniformity (Uni)~\cite{DBLP:conf/icml/0001I20}, average distance (Dis) as well as the two isotropy criteria $I_1({\rm \mathbf W})$ and $I_2({\rm \mathbf W})$ \cite{wang2020improving} of the word embedding matrix in NMT systems. Compared with the Transformer baseline and the adaptive training methods, our TCL and FCL substantially improve the measure of uniformity and isotropy, revealing that the target word representations in our contrastive methods are much more expressive.
To further examine the word representation space, we look at the 2-dimensional visualizations of softmax embeddings by principal component analysis (PCA). One obvious phenomenon in Figure \ref{embedding} (a) is that the tokens with different frequencies lie in different subregions of the representation space. Meanwhile, the embeddings of low-frequency words are squeezed into a more narrow space, which is consistent with the representation degeneration phenomenon proposed by \citet{gao2019representation}.
For TCL in Figure \ref{embedding} (b), this problem is alleviated by the token-level contrast of hidden representations, while the differences in word distribution with different word frequencies still persist. As a comparison shown in Figure \ref{embedding} (c), our frequency-aware contrastive learning methods that highlight the contrast of infrequent tokens can produce a more uniform and frequency-robust representation space, leading to the inherent superiority in low-frequency word prediction.
\section{Related Work}
\paragraph{Low-Frequency Word Translation} is a persisting challenge for NMT due to the token imbalance phenomenon.
Conventional researches range from introducing fine-grained translation units \cite{luong2016achieving,lee2017fully}, seeking optimal vocabulary \cite{wu2016google,sennrich2016neural-bpe,gowda2020finding,DBLP:conf/acl/LiuYLZLZZS20}, to incorporating external lexical knowledge \cite{luong2015addressing,arthur2016incorporating,Zhang2021PointDA}.
Recently, some approaches alleviate this problem by well-designed loss function with adaptive weights, in light of the token frequency \cite{gu2020token} or bilingual mutual information \cite{Xu2021}. Inspired by these work, we instead proposed a token-level contrastive learning method and introduce frequency-aware soft weights to adaptively contrast the representations of target words.
\paragraph{Contrastive Learning} has been a widely-used technique to learn representations in both computer vision \cite{Hjelm2019LearningDR,khosla2020supervised,Chen2020ASF} and neural language processing \cite{Logeswaran2018AnEF,fang2020cert,gao2021simcse,DBLP:conf/acl/LinYYLZLHS20}. There are also several recent literatures that attempt to boost machine translation with the effectiveness of contrastive learning. \citet{Yang2019ReducingWO} proposes to reduce word omission by max-margin loss. \citet{acl2021multilingual} learns a universal cross-language representation with a contrastive learning paradigm for multilingual NMT. \citet{iclr2021CONTRASTIVE} adopt a contrastive learning method with perturbed examples to mitigates the exposure bias problem. Different from the previous work that contrasts the sentence-level log-likelihoods or representations, our contrastive learning methods
pay attention to token-level representations and introduce frequency feature to facilitate rare word generation.
\paragraph{Representation Degeneration} has attracted increasing interest recently \cite{gao2019representation,xu2021leveraging}, which refers that the embedding space learned in language modeling or neural machine translation is squeezed into a narrow cone due to the weight tying trick.
Recent researches mitigate this issue by performing regularization during training \cite{gao2019representation,wang2020improving}. The distinction between our methods and these work is that our contrastive methods are applied on the hidden representations of the diverse instances in the training corpus rather than directly performing regularizations on the softmax embeddings.
\section{Conclusion}
In this paper, we investigate the problem of low-frequency word prediction in NMT from the representation learning aspect. We propose a novel frequency-aware contrastive learning strategy which can consistently boost translation quality for all words by meliorating word representation space. Via in-depth analyses, our study suggests the following points which may contribute to subsequent researches on this topic:
1) The softmax representations of rarer words are distributed in a more compact latent space, which correlates the difficulty of their prediction; 2) Differentiating token-level hidden representations of different tokens can meliorates the expressiveness of the representation space and benefit the prediction of infrequent words; 3) Emphasizing the contrast for unusual words with frequency-aware information can further optimize the representation distribution and greatly improve low-frequency word prediction; and
4) In rare word prediction, both recall and precision are essential to be assessed, the proposed 1-Gram F1 can simultaneously consider the two aspects.
\section*{Acknowledgements}
We thank anonymous reviewers for valuable comments. This research was supported by National Key R\&D Program of China under Grant No.2018YFB1403202 and the central government guided local science and technology development fund projects (science and technology innovation base projects) under Grant No.206Z0302G.
| {'timestamp': '2021-12-30T02:24:20', 'yymm': '2112', 'arxiv_id': '2112.14484', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14484'} | arxiv |
\section{Introduction}
In recent years, Graph Neural Networks (GNNs) have been widely used due to their promising performance in various graph-based applications~\cite{xu2018powerful,gilmer2017neural,pei2020geom,wei2021pooling,zhang2019autosf}.
In the literature, different GNN models can be built by designing the aggregation operations
\footnote{The aggregation operation in this paper is equivalent to the the message passing layers in GraphGym~\cite{you2020design}.}
and the topology.
To improve the model capacity, diverse aggregation operations~\cite{kipf2016semi,hamilton2017inductive,velivckovic2017graph,xu2018powerful} are designed to aggregate the information from the neighborhood.
On the other hand, topology design is also important for the model capacity~\cite{cortes2017adanet,xu2018representation,li2019deepgcns}.
One typical topology design manner in GNNs is to stack the aggregation operations.
The higher-order neighborhoods can be accessed based on the stacking manner~\cite{kipf2016semi}, thus, higher-level features can be extracted recursively to increase the model capacity~\cite{li2018deeper}.
However, as the network goes deeper, the node representations of connected nodes become indistinguishable,
which is called the over-smoothing problem~\cite{li2018deeper}.
To address this problem, the identity skip-connection is applied in topology design thus the features of different levels can be utilized to improve the model capacity, e.g., JK-Net~\cite{xu2018representation}, ResGCN~\cite{li2019deepgcns} and DenseGCN~\cite{li2019deepgcns}.
Apart from the stacking manner in GNN topology design,
\cite{Gabriele2020PNA,leng2021enhance} use multiple aggregation operations in each layer to extract features independently and fuse these features to enhance the information extraction of local neighbors.
However, multiple aggregations require more resources, hence it is costly to obtain higher-level information when stacking more layers.
To summarize, there are two mainstream GNN topology design manners as shown in Figure~\ref{fig-deeper-wider}
(i) stacking aggregation operations to obtain the higher-level features (methods on the yellow background);
(ii) using multiple aggregation operations to obtain the adequate and independent feature extraction stage on local neighbors.
Both of these two manners can improve model capacity.
However, the former is easy to get the performance drop due to the over-smoothing problem, and the latter is costly to obtain the higher-level information.
Then when designing a GNN model for a specific task, a natural question arises: \textit{Can we enjoy the benefits while alleviate the corresponding deficiencies on top of these two topology design manners?}
In that way, we can further improve the model capacity on top of existing GNN models.
\begin{figure}[t]
\centering
\includegraphics[width=0.85\linewidth]{./fig/feature_flow_architectures_2}
\caption{The illustration of two topology design manners. For simplicity, the aggregation operation is denoted by the rectangle. The fusion operation $\oplus$, $\otimes$ and $\Join$ represent the summation, maximum and concatenation, respectively.}
\label{fig-deeper-wider}
\end{figure}
However, it is non-trivial to achieve this since there lacks a systematic approach for the GNN topology design in existing works, and it is unknown how to combine the aforementioned two GNN topology design manners.
In the literature, the topology of a neural network can be represented by its ``computational graph'' where the nodes represent the operations and the directed edges link operations in different layers~\cite{xie2019exploring,valsesia2020don,xie2021understanding,yuan2021differentiable,gu2021dots}.
In this way, the topology of a neural network can be obtained by designing the links among the nodes in the ``computational graph''.
In existing GNNs, designing the links among operations is equivalent to selecting the features of different levels which proved useful in improving the performance~\cite{valsesia2020don,xu2018representation,you2020design}.
Nevertheless, the fusion strategy designed to make better utilization of the selected features is also indispensable in improving the GNN model capacity~\cite {xu2018representation,zhao2020simplifying,zhao2021search}.
By reviewing extensive human-designed GNNs, we observe that diverse fusion strategies are employed to integrate the features generated by linked operations.
As the representative GNNs shown in Figure~\ref{fig-deeper-wider}, ResGCN~\cite{li2019deepgcns} adds up the residual features in each layer, JK-Net~\cite{xu2018representation} provides three fusion operations (maximum for example) to integrate the representations of the intermediate layers, and PNA~\cite{Gabriele2020PNA} concatenates the results of multiple aggregation operations.
Therefore, in designing the topology of GNNs, it is important to take the links as well as the fusion strategies into consideration.
On top of the existing GNNs, we design a novel framework to unify the GNN topology designs with feature selection and fusion strategies. Therefore, the topology design target is transformed into the design of these 2 strategies.
As shown in Figure~\ref{fig-search-space}, without loss of generality, the framework is represented as a directed acyclic graph (DAG), which is constructed with an ordered sequence of blocks.
Based on this framework, diverse topology designs including existing works can be modeled by different selection and fusion strategies.
Then, another challenge is to design adaptive feature selection and fusion strategies to achieve the SOTA performance
given a specific graph-based task, since the preferable GNN topology can significantly differ across different datasets~\cite{you2020design}.
Therefore, to address this challenge, we borrow the power of neural architecture search (NAS), which has been successful in designing data-specific CNNs \cite{zoph2016neural,liu2018darts} and GNNs \cite{gao2019graphnas,zhao2021search}, to achieve the adaptive topology design.
To be specific, we firstly propose a novel search space that contains a set of selection and fusion operations, and then develop an improved differentiable search algorithm based on a popular one, i.e., DARTS \cite{liu2018darts}, by addressing the obvious optimization gap induced by two opposite operations in the search space.
Finally, we extract the optimal strategies based on the unified framework when the searching process terminates, then an adaptive topology design is obtained.
In this paper, we learn to design the topology of GNNs in a novel feature fusion perspective and it can be dubbed F$^2$GNN (Feature Fusion GNN).
Extensive experiments are conducted by integrating the proposed method with predefined and learnable aggregation operations on eight real-world datasets (five homophily and three heterophily), then the performance gains demonstrate the effectiveness of the proposed method.
Furthermore, we conduct experiments to evaluate the advantages of F$^2$GNN in designing the topology of GNNs, from which we can observe that F$^2$GNN can enjoy the benefits and alleviate the deficiencies of existing topology design manners, especially alleviating the over-smoothing problem, by utilizing different levels of features adaptively.
To summarize, the contributions of this work are as follows:
\begin{itemize}
\item In this paper, we provide a novel feature fusion perspective in designing the GNN topology and propose a novel framework to unify the existing topology designs with feature selection and fusion strategies. It transforms the GNN topology design into the design of this two strategies.
\item To obtain the adaptive topology design, we develop a NAS method on top of the unified framework containing a novel search space and an improved differentiable search algorithm.
\item Extensive experiments on eight real-world datasets (five homophily and three heterophily) demonstrate that the proposed F$^2$GNN can improve model capacity (performance) while alleviating the deficiencies, especially alleviating the over-smoothing problem.
\end{itemize}
\noindent\textbf{Notations.}
We represent a graph as $\mathcal{G} =(\mathcal{V}, \mathcal{E}) $,where $\mathcal{V}$ and $\mathcal{E}$ represent the node and edge sets. $\textbf{A} \in \mathbb{R}^{|\mathcal{V}| \times |\mathcal{V}|}$ is the adjacency matrix of this graph where $|\mathcal{V}|$ is the node number. The class of node $u$ is represented as $y_u$.
In the proposed framework, the output features of block $i$ are denoted as $\bH^i$, and in other methods, $\bH^i$ represents the output features of layer $i$. $\bH^{output}$ represents the output of a GNN.
\section{Related Work}
\subsection{Topology Designs in Graph Neural Network}
GNNs are built by designing the aggregation operations and topologies.
One mainstream topology design manner is to stack aggregation operations~\cite{kipf2016semi,hamilton2017inductive,velivckovic2017graph}. The high-level information can be captured to improve the model capacity while easily resulting in the over-smoothing problem in deeper networks~\cite{li2018deeper}.
To address this problem and improve the model capacity, the identity skip-connections are provided additionally to integrate different levels of features.
JK-Net~\cite{xu2018representation} and DAGNN~\cite{liu2020towards} integrate the features of all the intermediate layers at the end of GNNs;
ResGCN~\cite{li2019deepgcns} and DenseGCN~\cite{li2019deepgcns} have the same connection schemes as ResNet and DenseNet; GCNII~\cite{chen2020simple} adds up the initial features in each layer.
Apart from the stacking manner, multiple aggregation operations provide adequate and independent feature extraction on the local neighbors to improve the model capacity.
PNA~\cite{Gabriele2020PNA} and HAG~\cite{leng2021enhance} provide multiple aggregation operations in each layer to learn features from local neighbors independently;
MixHop~\cite{abu2019mixhop}, IncepGCN~\cite{rong2019dropedge} and InceptionGCN~\cite{kazi2019inceptiongcn}, which are the inception-like methods, provide multiple aggregations in each branch to extract different levels of features independently.
However, multiple aggregations require more resources, hence it is costly to obtain higher-level information.
Considering the benefits and deficiencies of the existing topology designs, we propose a novel method F$^2$GNN in the feature fusion perspective to design the topology of GNNs adaptively.
It can unify the existing topology designs and provide a platform to explore more topology designs, which are more expressive than these human-designed ones.
\subsection{Graph Neural Architecture Search}
\label{sec-related-gnas}
NAS methods use a search algorithm to find the SOTA neural networks automatically in a pre-defined search space and representative methods are~\cite{zoph2016neural,liu2018darts,xie2018snas,li2020sgas}.
Very recently, researchers tried to automatically design GNNs by NAS.
These methods mainly focus on designing the aggregation operations on top of the vanilla stacking manner, e.g., GraphNAS~\cite{gao2019graphnas} provides the attention function, attention head number, embedding size, etc. Similar search spaces are also used in~\cite{li2021one}.
Several methods further provide the skip-connection design based on this stacking manner, e.g., SNAE~\cite{zhao2020simplifying} and SNAG~\cite{zhao2021search} are built on JK-Net~\cite{xu2018representation} and learn to select and fuse the features of intermediate layers in the output node, AutoGraph~\cite{li2020autograph} is built on DenseNet~\cite{huang2017densely} and learns to select features in each layer, GraphGym~\cite{you2020design} provides the residual feature selection and fusion strategies in designing GNNs on top of the stacking manner.
Besides these methods, RAN~\cite{valsesia2020don} learns to design the GNN topologies. It uses the computational graph to represent the GNN topology and then designs the links with a randomly-wired graph generator~\cite{xie2019exploring}. However, it lacks the explorations of fusion strategies that can improve feature utilization in GNNs.
Apart from the search space designs, diverse search algorithms are provided to search the SOTA neural networks from the proposed search space, e.g., incorporating the Reinforcement Learning (RL) into the searching strategy~\cite{zoph2016neural,gao2019graphnas,zhao2020simplifying} or using the Evolutionary Algorithm (EA) directly~\cite{guo2020single,li2020autograph,chen2021graphpas}.
Considering the search efficiency, the differentiable algorithm is proposed to search architectures with gradient descent. It relaxes the discrete search space into continuous and then treats the architecture search problem as a bi-level optimization problem~\cite{liu2018darts,zhao2021search,li2021one,cai2021rethinking}.
More graph neural architecture search methods can be found in~\cite{zhang2021automated,wang2022profiling,ding2021diffmg,wang2021autogel,wei2021pooling,zhang2019autosf,zhang2019interstellar,zhang2021knowledge,qin2021graph}. Compared with existing methods which mainly focus on designing aggregation operations, in this work we explore the additional topology design, which can thus be regarded as an orthogonal and complementary approach to improve the GNN model capacity.
\section{Feature Fusion Framework}
\label{sec-unified-framework}
In this section, we elaborate on the proposed feature fusion framework and show how to translate this framework into diverse GNNs.
\subsection{The Proposed Unified Framework}
In the literature, GNNs can be built by designing the aggregation operation and its topology.
The topology is designed in two major manners: stack aggregation operations to obtain higher-level features or use multiple operations to provide rich and independent local feature extractions.
By reviewing existing human-designed GNNs, we observe that features of different levels are selected due to diverse selection strategies, and it leads to the utilization of diverse fusion strategies to integrate these features~\cite {li2019deepgcns,xu2018representation,abu2019mixhop,Gabriele2020PNA}.
In other words, the feature selection and fusion strategies lead to the key difference of topology designs in GNNs. Therefore, the topology designs utilized in existing methods can be unified with these two strategies.
Based on this motivation, we propose a feature fusion framework to unify these two topology design manners. As shown in Figure~\ref{fig-search-space}, without loss of generality, the framework is represented as a DAG which is constructed with an ordered sequence of one input block, $N$ SFA blocks ($N=4$ for example; SFA: \underline{s}election, \underline{f}usion and \underline{a}ggregation), and one output block.
The input block only contains a simple pre-process operation, i.e., Multilayer Perceptron (MLP) in this paper, that supports the subsequent blocks.
The SFA block contains the selection, fusion and aggregation operations.
For the $i$-th SFA block as shown in Figure~\ref{fig-search-space}(b), there exists $i$ predecessors thus $i$ feature selection operations $f_s$ are utilized to select the features generated by the previous blocks.
One fusion operation $f_f$ is used to fuse these selected features, and one aggregation operation $f_a$ is followed to aggregate messages from the neighborhood.
Therefore, the high-level features can be generated by $\bH^i = f_a(f_f(\{f_s^0(\bH^0), \cdots, f_s^{i-1}(\bH^{i-1})\}))$.
In the output block, a 2-layer MLP that serves as the post-process operation is provided after the $N+1$ selection operations and one fusion operation.
On top of the unified framework, the topology design is transformed into the design of selection and fusion strategies.
Compared with existing methods that focus on designing aggregation operations, our framework provides a platform to explore the GNN topology designs which is more expressive than existing methods.
\begin{figure}[t]
\centering
\includegraphics[width=0.9\linewidth]{./fig/framework}
\caption{(a) The proposed framework consists of an ordered sequence of one input block, $N$ SFA blocks (four as an example here) and one output block.
(b) For the $i$-th SFA block, we have $i$ selection operations $f_s$ and one fusion operation $f_f$ to utilize the features generated by $i$ predecessors. Then one aggregation operation $f_a$ is followed to aggregated messages from the neighborhood.}
\label{fig-search-space}
\end{figure}
\begin{figure*}[t]
\label{fig-approximation}
\begin{minipage}{0.25\linewidth}
\centering
\footnotesize
\begin{tabular}{c|l}
\hline
Method & Equation \\ \hline
Vanilla GNN & $\bH^{l+1} = f_a(\bH^l)$ \\ \hline
ResGCN~\cite{li2019deepgcns} & $\bH^{l+1} = f_a(\bH^l + \bH^{l-1})$ \\ \hline
JK-Net~\cite{xu2018representation} & $\bH^{output} = f_f( \bH^1,\cdots, \bH^{L}) $ \\ \hline
GCNII~\cite{chen2020simple} & $\bH^{l+1} = \alpha \bH^0 + (1-\alpha)f_a(\bH^l)$ \\ \hline
PNA~\cite{Gabriele2020PNA} & $\bH^{l+1} = \mathop{\parallel}\limits_{i \in M} f_a(\bH^l) $ \\ \hline\ MixHop~\cite{abu2019mixhop} & $\bH^{l+1} = \mathop{\parallel}\limits_{i \in P} \bA^i\bH^l$ \\ \hline
\end{tabular}
\end{minipage}
\hfill
\begin{minipage}{0.7\linewidth}
\centering
\includegraphics[width=0.95\linewidth]{./fig/approximation}
\end{minipage}
\caption{The formulation and illustrations of the closely related methods. $\oplus$ denotes the summation operation and $\Join$ denotes the concatenation operation.}
\end{figure*}
\subsection{Translating the framework into diverse GNNs}
The feature fusion framework can unify the existing topology designs thus we can translate the framework into diverse GNNs.
The formulation and illustrations of the most closely related methods are shown in Figure~3. For simplicity, the feature transformation is ignored.
Vanilla GNNs~\cite{kipf2016semi,hamilton2017inductive,velivckovic2017graph,xu2018powerful} are constructed by stacking aggregation operations and these methods can be approximated as the single path in our framework.
ResGCN~\cite{li2019deepgcns} and JK-Net~\cite{xu2018representation} provide extra identity skip-connections to utilize the different levels of features, thus diverse selection and fusion operations are utilized as illustrated in Figure~3(b) and (c), respectively.
GCNII~\cite{chen2020simple} uses the initial residual connections to address the over-smoothing problem, and it can be approximated as in Figure~3(d).
PNA~\cite{Gabriele2020PNA} uses $M$ aggregation operations in each layer, and it can be approximated by $M$ branches in this framework.
MixHop~\cite{abu2019mixhop} concatenates the features based on the power of adjacency matrix $\bA^i$. $P$ is the set of the adjacency powers, and this method can be approximated as in Figure~3(f).
For the graph neural architecture search methods which focus on design aggregation operations~\cite{gao2019graphnas,li2021one} or provide additional skip-connection learning~\cite{zhao2020simplifying,zhao2021search} on top of the stacking manner, they can be treated as the variants of vanilla and JK-Net, respectively.
Thus, we can see the advantage of the proposed framework, which can provide a systematic and unified view of existing GNN topology designs. Next, we show how to obtain the data-specific GNN topology design on top of this unified framework.
\section{Design GNNs with the framework}
On top of the unified framework, generating one adaptive topology design is a non-trivial task since it is still unknown how to design the optimal feature selection and fusion strategies given a specific task.
In this paper, we adopt the NAS method to address this challenge.
As the commonly-recognized paradigm of NAS, the search space which contains the selection and fusion operation sets is provided.
Then the topology design can be decomposed into the decision of operations in the search space.
To demonstrate the versatility of our method, we further provide the aggregation operation set thus we can design GNNs with topologies and aggregation operations simultaneously.
The differentiable search algorithm~\cite{liu2018darts} is widely used considering the efficiency and effectiveness. Nevertheless, we observe the performance gap in applying this algorithm due to the two opposite selection operations, i.e., \texttt{ZERO} and \texttt{IDENTITY}. Thus, we develop a new algorithm to alleviate this problem.
\subsection{Search Space}
\label{sec-search-space}
One GNN can be built by designing the aggregation operations and the topology.
The aggregation operations are widely explored in existing methods. In general, GNNs use the same aggregation operation in each layer. \cite{gao2019graphnas,zhao2020simplifying,zhao2021search} learn to design the layer-wise aggregations with the help of the NAS methods as introduced in Section~\ref{sec-related-gnas}.
Therefore, in this paper, we design the topology designs on these two aggregation variants.
\subsubsection{Predefined aggregation operation}
The predefined aggregation is utilized in each SFA block and then we need to design the selection and fusion operations in the framework with the help of NAS. After the search terminates, we can obtain the designed GNN with the given aggregation operation. We provide 2 aggregation operations GraphSAGE and GAT thus this method can be dubbed F$^2$SAGE and F$^2$GAT, respectively. Other aggregation operations like GCN and GIN can be trivially integrated with the proposed framework.
Without loss of generality, we provide a set of candidate selection operations $\mathcal{O}_s$ and fusion operations $\mathcal{O}_f$ in the search space as shown in Table~\ref{tb-search-space}.
\noindent\textbf{Selection Operations.}
For the selection operation, there are only ``selected'' and ``not selected'' stages for each feature in existing methods. Thus, we provide two operations \texttt{IDENTITY} and \texttt{ZERO} to select features, which can be represented as $f(\bh)=\bh$ and $f(\bh)=\textbf{0}\cdot\bh$, respectively.
\noindent\textbf{Fusion Operations.} In SFA block and the output block, one fusion operation is needed to fuse the selected features. Based on the literature, we provide six fusion operations to fuse these features with the summation, average, maximum, concatenation, LSTM cell and attention mechanism, which are denoted as \texttt{SUM}, \texttt{MEAN}, \texttt{MAX}, \texttt{CONCAT}, \texttt{LSTM} and \texttt{ATT}, respectively.
\subsubsection{Learnable aggregation operation}
Compared with the existing graph neural architecture search methods which focus on designing the aggregation operations, we provide the extra aggregation operation set $\mathcal{O}_a$ thus we can design GNNs with topologies and aggregation operations simultaneously. This method is dubbed F$^2$GNN.
\noindent\textbf{Aggregation Operations.}
Four widely used aggregation operations are used in this paper : GCN~\cite{kipf2016semi}, GAT~\cite{velivckovic2017graph}, GraphSAGE~\cite{hamilton2017inductive} and GIN~\cite{xu2018powerful}, which denoted as \texttt{GCN}, \texttt{GAT}, \texttt{SAGE} and \texttt{GIN}, respectively.
In this paper, we focus on designing the topology of GNNs thus only four aggregations are provided. More operations in existing methods can be trivially added if needed.
\begin{table}[]
\caption{The operations used in our search space.}
\begin{tabular}{l|l}
\hline
& Operations \\ \hline
Selection $\mathcal{O}_s$ & \texttt{ZERO}, \texttt{IDENTITY} \\ \hline
Fusion $\mathcal{O}_f$&\texttt{SUM}, \texttt{MEAN}, \texttt{MAX}, \texttt{CONCAT}, \texttt{LSTM}, \texttt{ATT} \\ \hline
Aggregation $\mathcal{O}_a$ & \texttt{GCN}, \texttt{GAT}, \texttt{SAGE}, \texttt{GIN}\\ \hline
\end{tabular}
\label{tb-search-space}
\end{table}
\subsection{The Improved Search Algorithm}
\label{sec-search-algo}
Based on the proposed framework and the search space, the search algorithm is used to search operations from the corresponding operation set.
Considering the efficiency and effectiveness which have been demonstrated in \cite{liu2018darts,zhao2021search}, without loss of generality, the differentiable search algorithm is employed.
\noindent\textbf{Preliminary: Differentiable Architecture Search.}
A supernet is defined to subsume all models on top of the unified framework and the search space, and it is achieved by mixing the candidate operations~\cite{guo2020single,liu2018darts}. The results of the mixed operation can be calculated by a weighted summation of all candidate operations which denoted as $\bar{o}(x)=\sum\nolimits_{k=1}^{\left|\mathcal{O}\right|} c_ko_k(x)$, where $c_k \in (0,1)$ is the weight of $k$-th candidate operation $o_k(\cdot)$.
In general, the operation weight $c_k$ is generated by one relaxation function $c_k= \frac{\exp(\alpha_k)}{\sum\nolimits_{i=1}^{\left|\mathcal{O}\right|} \exp(\alpha_i)}$ and $\alpha_k$ is the corresponding learnable supernet parameter for $c_k$~\cite{liu2018darts}.
Based on the relaxation function, the discrete selection of operations is relaxed into continuous and we can generate the final results in the output block step by step as shown in Figure~\ref{fig-search-space}. Thus the supernet can be optimized with gradient descent which can accelerate the search process in orders of magnitude.
After finishing the search process, we preserve the operations with the largest weights in each mixed operation, from which we obtain the searched GNN.
\noindent\textbf{The optimization gap in feature fusion.}
We optimize the supernet in the search process and then derive the GNN after the search is finished.
However, it is difficult to generate the best childnet from the supernet since we optimize the supernet in the search process and only select the childnet in reality, which is called optimization gap~\cite{chen2021progressive,xie2021weight} and the evaluation results can be found in Section~\ref{sec-ablation-gap}.
The performance drop caused by the optimization gap is extremely obvious in the our method since we provide two opposite operations in the selection operation set. In the following, we briefly explain this problem.
For the features generated by block $i$, the results of mixed selection operation in block $j$ ($j>i$) can be represented as the weighted summation of \texttt{ZERO} and \texttt{IDENTITY} operations as shown in
\begin{align}
\label{eq-block-output}
\bar{o}^{ij}(\textbf{x}_i)=\sum\nolimits_{k=1}^{\left|\mathcal{O}_s\right|} c_k^{ij}o_k^{ij}(\textbf{x}_i) = c_1^{ij}\textbf{0} + c_2^{ij}\textbf{x}_i=c_2^{ij}\textbf{x}_i.
\end{align}
Then the results of mixed fusion operation in block $j$ can be generated by
\begin{align}
\label{eq-combination}
\bar{o}^j(\textbf{x}) = \sum\nolimits_{k=1}^{\left|\mathcal{O}_f\right|} c_k^{j}o_k^j(\textbf{x}) = \sum\nolimits_{k=1}^{\left|\mathcal{O}_f\right|} c_k^{j}f_k^j(\{\bar{o}^{ij}(\textbf{x}_i)|i=0,\cdots,j-1\}),
\end{align}
where $f_k^j$ is the $k$-th candicate fusion operation in block $j$.
When the weight of \texttt{ZERO} operation $c_1$ is larger than the weight of \texttt{IDENTITY} operation $c_2$, in the childnet, the \texttt{ZERO} operation should be chosen and one zero tensor results in Eq.~\eqref{eq-block-output} are expected. Furthermore, one zero tensor results will be obtained in Eq.~\eqref{eq-combination} if no feature is selected in this block.
However, in the supernet, the mixed operation results $c_2^{ij}\textbf{x}_i$ in Eq.~\eqref{eq-block-output} will be generated.
That is, in this case, one zero tensor result is expected while we got $c_2^{ij}\textbf{x}_i$ in reality in each mixed selection operation. The \texttt{IDENTITY} operation has a large influence in Eq.~\eqref{eq-block-output} when \texttt{ZERO} is selected, and the influence will accumulate along with the feature selection operation in the framework.
Therefore, the gap between the supernet results and the childnet results in our framework is extremely obvious due to these two opposite selection operations, and we cannot derive the best childnet from the supernet due to this gap as the evaluation in Section~\ref{sec-ablation-gap}.
\noindent\textbf{Improved search with the usage of temperature.} Considering the influence of \texttt{IDENTITY} operation, we add a temperature in Softmax function as $c_k= \frac{\exp(\alpha_k/\lambda)}{\sum\nolimits_{i=1}^{\left|\mathcal{O}\right|} \exp(\alpha_i/\lambda)}$.
Thus, with a small temperature $\lambda$, the operation weight vector \textbf{c} close to a one-hot vector, and the results of mixed selection operation in Eq.~\eqref{eq-block-output} close to a zero tensor when the \texttt{ZERO} operation is selected. That is, the \texttt{IDENTITY} operation will have a smaller influence on the selection results when the \texttt{ZERO} operation is chosen, and the optimization gap in our method can be alleviated. Similar solutions can be found in ~\cite{xie2018snas,chen2019progressive}.
In this paper, we set $\lambda=0.001$ and the influence of different temperatures will be shown in Section~\ref{sec-ablation-gap}.
\noindent\textbf{Deriving process.}
The architecture searching task is treated as the bi-level optimization problem.
Our method is optimized with gradient descent introduced in~\cite{liu2018darts,zhao2021search}. More details can be found in Appendix~\ref{appendix-alg}.
After finishing the search process, we preserve the operation with the largest weight in each mixed operation, from which we obtain the searched architecture.
\section{Experiments}
\subsection{Experimental Settings}
\label{sec-exp-set}
\noindent\textbf{Datasets.}
Existing GNNs assume strong homophily where neighbors are in the same class. The homophily ratio can be calculated by $h=\frac{\left| \{(u,v):(u,v) \in \mathcal{E} \wedge y_u=y_v\}\right|}{\left| \mathcal{E} \right|}$ which is the fraction of edges in a graph which connect nodes that have the same class label.
As shown in Table \ref{tb-dataset}, five widely used homophily datasets (higher homophily ratio $h$) and three heterophily datasets (lower homophily ratio $h$) are selected to evaluate the performance of our method. More introductions about these datasets can be found in Appendix~\ref{appendix-dataset}.
The comparisons between the F$^2$GNN and other heterophily methods~\cite{zhu2020beyond,du2021gbk} will be considered in future work.
\begin{table}[]
\centering
\small
\caption{Statistics of the eight datasets in our experiments.}
\begin{tabular}{c|c|c|c|c|c}
\hline
Datasets & \#Nodes & \#Edges & \#Features & \#Classes & $h$ \\ \hline
Cora~\cite{sen2008collective} & 2,708 & 5,278 & 1,433 & 7 & 0.81 \\
Computers~\cite{mcauley2015image} & 13,381 & 245,778 & 767 & 10 & 0.78 \\
DBLP~\cite{bojchevski2017deep} & 17,716 & 105,734 & 1,639 & 4 & 0.83 \\
PubMed~\cite{sen2008collective} & 19,717 & 44,324 & 500 & 3 & 0.80 \\
Physics~\cite{shchur2018pitfalls} & 34,493 & 495,924 & 8,415 & 5 & 0.93 \\ \hline
Wisconsin~\cite{pei2020geom} & 251 & 466 & 1,703 & 5 & 0.21 \\
Actor~\cite{pei2020geom} & 7,600 & 30,019 & 932 & 5 & 0.22 \\
Flickr~\cite{zeng2019graphsaint} & 89,250 & 899,756 & 500 & 7 & 0.32 \\
\hline
\end{tabular}
\label{tb-dataset}
\end{table}
\noindent\textbf{Baselines.}
On top of the predefined aggregations, we provide nine GNNs constructed with different topologies.
(a) GNNs are constructed by stacking two and four aggregation operations;
(b) based on the stacking manner, we construct 4-layers GNNs on top of three commonly used topology designs ResGCN~\cite{li2019deepgcns}, DenseGCN~\cite{li2018deeper} and JK-Net~\cite{xu2018representation}. They are denoted as RES, DENSE and JK, respectively;
(c) 4-layer GNNII is constructed based on the topology shown in Figure 3(d);
(d) the topology of 1-layer PNA and MixHop are shown in Figure 2(e) and Figure 2(f), respectively. The PNA and MixHop baselines in our experiment are constructed by stacking two layers.
(e) the topology designs are constructed by selecting operations from the search space randomly, which is denoted as Random in our experiments.
Compared with F$^2$GNN which designs the topology and aggregation operations simultaneously, we provide three graph neural architecture search baselines: (a) an RL based method SNAG~\cite{zhao2020simplifying}, (b) a differentiable method SANE~\cite{zhao2021search}, and (c) a random search algorithm that uses the same search space as F$^2$GNN.
More details of these baselines are provided in Appendix~\ref{appendix-baseline}.
\begin{table*}[]
\centering
\footnotesize
\caption{Performance comparisons of our method and all baselines. We report the average test accuracy and the standard deviation with 10 splits. ``L2'' and ``L4'' mean the number of layers of the base GNN architecture, respectively. The best result in each group is highlighted in gray, and the second best one is underlined.
The group accuracy rank and the overall accuracy rank of each method are calculated on each dataset. The average rank on all datasets is provided. The Top-2 methods in each group and the Top-3 methods in this table are highlighted in gray.}
\label{tb-performance-agg}
\begin{tabular}{c|c|ccccc|ccc|cc}
\toprule
Aggregation & Topology & Cora & DBLP & PubMed & Computers & Physics & Actor & Wisconsin & Flickr & \begin{tabular}[c]{@{}c@{}}Avg. Rank\\ (Group)\end{tabular} & \begin{tabular}[c]{@{}c@{}}Avg. Rank\\ (All)\end{tabular} \\ \hline
\multirow{10}{*}{SAGE} & Stacking (L2) & 86.09(0.50) & 83.58(0.33) & 88.96(0.29) & 91.14(0.30) & 96.42(0.11) & 34.78(1.10) & 79.61(5.56) & 51.21(0.71) & 6.63 & 15.00 \\
& Stacking (L4) & 85.68(0.61) & 83.83(0.32) & 88.23(0.28) & 90.52(0.42) & 95.97(0.14) & 34.61(1.08) & 60.39(10.77) & 53.07(0.50) & 8.25 & 17.00 \\
& RES (L4) & 85.66(0.52) & 83.39(0.30) & 88.99(0.25) & {\ul 91.51(0.18)} & 96.31(0.17) & 35.16(0.94) & 76.47(5.26) & {\ul 53.72(0.27)} & 5.25 & 13.13 \\
& DENSE (L4) & 86.68(0.59) & 83.30(0.73) & {\ul 89.42(0.27)} & 90.74(0.51) & 96.48(0.14) & 34.78(0.60) & 77.06(6.01) & 53.17(0.19) & 4.50 & 12.75 \\
& JK (L4) & 86.47(0.60) & 83.94(0.62) & 89.21(0.29) & 91.21(0.30) & {\ul 96.56(0.05)} & {\ul 36.53(0.92)} & 81.96(4.71) & 52.41(0.33) & 4.75 & 10.38 \\
& GNNII (L4) & 85.83(0.42) & {\ul 84.46(0.45)} & 89.21(0.24) & 91.38(0.27) & 96.45(0.15) & 35.70(1.11) & 81.57(4.13) & 52.24(0.29) & 4.50 & 11.50 \\
& PNA (L2) & 84.29(0.67) & 82.76(0.42) & 89.25(0.26) & 90.67(0.42) & 96.32(0.10) & 33.89(2.68) & 75.29(6.46) & 52.09(0.73) & 8.88 & 17.75 \\
& MixHop (L2) & 84.81(0.95) & 82.65(0.65) & 89.25(0.28) & 88.56(1.61) & 96.11(0.17) & 35.19(0.62) & 81.57(2.51) & 51.75(0.59) & 6.75 & 17.75 \\
& Random & {\ul 86.75(0.29)} & 83.60(0.29) & 89.21(0.04) & 91.30(0.19) & 96.46(0.03) & 36.30(0.58) & {\ul 85.10(5.63)} & \gray 54.10(0.15) & \gray 3.50 & 8.75 \\
& F$^2$SAGE & \gray 87.72(0.26) & \gray 84.81(0.06) & \gray 89.73(0.26) & \gray 91.81(0.26) & \gray 96.72(0.01) & \gray 36.61(1.00) & \gray 85.88(1.92) & 53.66(0.16) & \gray 2.00 & \gray 4.38 \\ \hline
\multirow{10}{*}{GAT} & Stacking (L2) & 85.92(0.72) & {\ul 84.34(0.26)} & 87.56(0.23) & 91.49(0.21) & 95.76(0.16) & 29.28(1.02) & 53.73(7.24) & {\ul 53.83(0.28)} & 5.25 & 14.25 \\
& Stacking (L4) & 86.16(0.55) & 84.29(0.41) & 85.73(0.34) & 89.08(0.43) & 93.47(3.93) & 26.45(1.00) & 45.29(5.65) & 50.34(2.68) & 8.25 & 19.88 \\
& RES (L4) & 84.66(0.92) & 84.11(0.34) & 87.56(0.44) & 90.84(0.49) & 95.67(0.28) & 28.98(0.36) & 48.82(3.77) & 53.63(0.24) & 7.50 & 18.50 \\
& DENSE (L4) & 85.31(0.86) & 83.43(0.37) & 88.67(0.19) & 91.30(0.37) & 96.16(0.06) & 31.78(1.03) & 53.33(7.73) & 53.61(0.26) & 6.25 & 16.38 \\
& JK (L4) & {\ul 86.55(0.46)} & 83.73(0.35) & {\ul 89.71(0.16)} & 91.80(0.23) & 96.80(0.09) & 35.43(0.88) & 84.51(5.58) & 53.02(0.29) & \gray 3.88 & 8.75 \\
& GNNII (L4) & 85.40(1.06) & 83.83(0.33) & 88.44(0.25) & {\ul 91.91(0.11)} & 96.14(0.15) & 30.29(0.78) & 55.29(6.25) & 53.03(0.29) & 5.38 & 15.00 \\
& PNA (L2) & 85.06(0.72) & 83.46(0.47) & 87.18(0.30) & 90.84(0.24) & 95.85(0.18) & 28.56(0.82) & 49.22(5.91) & \gray 54.02(0.33) & 7.38 & 18.25 \\
& MixHop (L2) & 85.38(1.04) & 82.50(0.34) & 88.91(0.19) & 91.27(0.37) & 96.46(0.21) & 35.70(0.90) & 81.57(4.40) & 53.67(0.30) & 5.13 & 13.25 \\
& Random & 85.73(0.06) & 83.60(0.19) & 88.86(0.18) & 91.76(0.14) & {\ul 96.84(0.09)} & {\ul 36.07(0.83)} & {\ul 86.08(4.15)} & 52.43(0.29) & 4.38 & 10.38 \\
& F$^2$GAT & \gray 88.31(0.12) & \gray 84.76(0.04) & \gray 90.38(0.14) & \gray 92.04(0.17) & \gray 97.10(0.03) & \gray 36.65(1.13) & \gray 87.06(4.13) & 53.45(0.19) & \gray 1.63 & \gray 3.13 \\ \hline
\multirow{4}{*}{Learnable} & SNAG (L4) & 84.99(1.04) & 84.29(0.15) & 87.93(0.16) & 85.98(0.72) & 96.18(0.11) & 28.13(0.74) & 43.92(4.65) & 53.50(0.31) & 4.00 & 18.63 \\
& SANE (L4) & 86.40(0.38) & 84.58(0.13) & 89.34(0.31) & 91.02(0.21) & {\ul 96.80(0.06)} & {\ul 36.77(1.15)} & {\ul 86.47(3.09)} & 53.92(0.14) & 2.63 & 6.38 \\
& Random & {\ul 86.99(0.60)} & {\ul 84.62(0.15)} & {\ul 89.37(0.26)} & {\ul 91.03(0.20)} & 96.72(0.04) & 36.29(1.52) & 85.49(4.31) & \gray 54.33(0.11) & \gray 2.25 & 6.13 \\
& F$^2$GNN & \gray 87.42(0.42) & \gray 84.95(0.15) & \gray 89.79(0.20) & \gray 91.42(0.26) & \gray 96.92(0.06) & \gray 37.08(1.00) & \gray 88.24(3.72) & {\ul 53.96(0.20)} & \gray 1.13 & \gray 2.75 \\ \bottomrule
\end{tabular}
\end{table*}
\noindent\textbf{Implementation details.}
For Cora, DBLP, Computers, PubMed and Physics, we split the dataset with 60\% for training, 20\% for validation and test each considering supernet training and evaluation.
For Wisconsin and Actor, we adopt the 10 random splits used in~\cite{pei2020geom,zhu2020beyond}(48\%/32\%/20\% of nodes per class for train/validation/test).
For Flickr dataset, we adopt the split in~\cite{zeng2019graphsaint}(50\%/25\%/25\% of nodes per class for train/validation/test).
For all NAS methods (Random baselines, SNAG, SANE and our method), we search a GNN with the corresponding search space. Then all the searched GNNs and the human-designed baselines are tuned individually with hyperparameters like embedding size, learning rate, dropout, etc.
With the searched hyperparameters, we report the average test accuracy and the standard deviation on 10 repeated results.
More details about the implementation stage are shown in Appendix~\ref{appendix-implementation}.
\subsection{Performance Comparisons}
The results are given in Table \ref{tb-performance-agg}.
Firstly, based on two predefined aggregation operations, there is no absolute winner among eight human-designed GNNs constructed with existing topology designs.
Among them, with the utilization of different feature selection and fusion strategies, six baselines have a better performance than two stacking baselines in two groups in general.
The performance gain demonstrates the importance of feature utilization in improving the model capacity.
Secondly, by designing GNN topologies with adaptive feature selection and fusion strategies, the proposed method can achieve the top rank on two predefined aggregations. In particular, the SOTA performance is achieved on seven out of eight datasets.
Thirdly, with the same search space, the Random baselines also achieve considerable performance gains on all these datasets, which demonstrates the effectiveness of the unified framework in Section \ref{sec-unified-framework}.
Nevertheless, the Random baseline is outperformed by the proposed method, which indicates the usefulness of the improved search algorithm in designing the topology of GNNs.
\begin{figure}[t]
\centering
\includegraphics[width=0.8\linewidth]{./fig/searched}
\caption{The searched topologies on Cora, Physics and Actor datasets with two human-designed aggregation operations: GraphSAGE and GAT. The index of each block in the framework is annotated and the dark blocks indicate they are not used in the searched GNNs.}
\label{fig-searched_arch}
\end{figure}
On the other hand, looking at the results of the learnable aggregation operations, SANE and SNAG only focus on selecting features in the output block based on a stacking manner (A sketch of the topology is given in Figure \ref{fig-sane-framework} in Appendix~\ref{appendix-baseline}.). These methods have limited topology design space and can be treated as special instance of F$^2$GNN.
Compared with these two methods, F$^2$GNN and Random methods design GNNs on the proposed unified framework and achieve higher performance. Thus it demonstrates the effectiveness of the adaptive topology design, i.e., feature selection and fusion strategies based on the unified framework.
Besides, \cite{liu2018darts,zhao2021search} have shown the efficiency advantage of the differentiable methods (our method and SANE) over those RL and randomly based methods. We also obtained the two orders of magnitude less search cost in our experiments (The details of the search cost comparison are shown in Section~\ref{sec-ablation-gap}.).
These 2 differentiable methods stay at the top of the rank list (F$^2$GNN ranks 2.75 and SANE ranks 6.38), which indicates the power of differentiable search algorithms in designing GNNs.
\noindent\textbf{Searched topologies.}
We visualize the searched topologies on Cora, Physics and Actor datasets with different aggregation operations in Figure~\ref{fig-searched_arch}.
We emphasize on several interesting observations in the following:
\noindent$\bullet$ The topologies are different for different aggregation operations and datasets. The performance gain and the top ranking demonstrate the necessity of designing data-specific GNN topologies.
\noindent$\bullet$ The initial features generated by the input block are utilized in the output block in almost all GNNs. These features contain more information about the node itself which are important for node representation learning as mentioned in~\cite{chen2020simple,zhu2020beyond}.
\noindent$\bullet$ We can benefit from the multiple aggregation design manner which provides adequate and independent local feature extractions, e.g., two aggregation operations are selected in the second layer on Cora and the first layer on Physics.
\noindent$\bullet$ On Actor, the representative heterophily dataset, we obtained an MLP network based on F$^2$SAGE. This topology design is consistent with H$_2$GCN ~\cite{zhu2020beyond} which shows that the graph structure is not always useful for the final performance, and it further demonstrates the effectiveness and the versatility of our method. More searched topologies are shown in Appendix~\ref{appendix-searched} and more results about heterophily datasets are given in Appendix~\ref{appendix-hetero}.
\subsection{Advantages of the Adaptive Topology Design}
\label{sec-exp-advantage}
In designing the topology of GNNs, stacking aggregation operations devoted to obtaining higher-level features but easily got the over-smoothing problem as the network goes deeper, and the multiple aggregation operations provide adequate and independent feature extraction stage on local neighbors while are costly to obtain the higher-level information.
The performance gains in Table~\ref{tb-performance-agg} and the searched topology designs in Figure~\ref{fig-searched_arch} indicate the effectiveness of designing the topology of GNNs with two design manners.
With the proposed F$^2$GNN which can design topology with the NAS method adaptively, we show the advantages of our method in alleviating the deficiencies of the existing two topology design manners.
\noindent\textbf{Alleviating the over-smoothing problem.}
As the network goes deeper, the node representations become indistinguishable and easily got performance drop, which is called over-smoothing~\cite{li2018deeper}.
MAD (Metric for Smoothness)~\cite{chen2020measuring} is used to measure the smoothness of the features.
In Figure~\ref{fig-mad-layer}, we show the comparisons of test accuracy and MAD value on the Cora dataset on the conditions of different layers and SFA blocks.
For comparisons, on top of the GraphSAGE, we provide three topologies that have been proved helpful in alleviating the over-smoothing problem, and more results can be found in Appendix~\ref{appendix-oversmoothing}.
Other methods~\cite{rong2019dropedge,feng2020graph,chen2020measuring} which can alleviate this problem will be left into future work.
In Figure~\ref{fig-mad-layer}, RES, JK and MixHop can achieve stable performance and higher MAD values compared with the stacking baseline. It demonstrates the effectiveness of different levels of features in alleviating the over-smoothing problem.
Compared with these baselines, F$^2$SAGE can achieve the best performance and higher MAD values by utilizing features in each block adaptively. It can further indicate the effectiveness of our method.
\begin{figure}[t]
\centering
\includegraphics[width=0.85\linewidth]{./fig/cora_mad}
\caption{Comparisons of test accuracy and the MAD value on the Cora dataset. The predefined aggregation operation is the GraphSAGE.
``L4'' represents the 4 layer baseline ($N=4$ in our method), and so on. Darker colors mean larger values. }
\label{fig-mad-layer}
\end{figure}
\noindent\textbf{Flexibility in obtaining the higher-level features.}
The multiple aggregation operations provide an adequate and independent feature extraction stage on local neighbors while are costly to obtain the higher-level information.
To make a comparison with this topology design manner, we visualize the utilization of different levels of features on the Cora dataset in Figure~\ref{fig-ranges-blocks}. If the features of level $j$ are selected in Block $i$, then the cell $(Bi, Lj)$ is denoted as 1, otherwise, as 0.
We obtained the features of level 2 with four aggregation operations as shown in Figure~\ref{fig-ranges-blocks}(a) and obtained the features of level 5 with eight aggregation operations as shown in Figure~\ref{fig-ranges-blocks}(c). However, with the same number of aggregations, i.e., 8 and 4, PNA can only obtain the features of level 2 and level 1, respectively.
Besides, on the Cora dataset, our method achieves higher performance than PNA with 35\% (0.39MB on F$^2$SAGE and 0.60MB on PNA) and 15\% (0.22MB on F$^2$GAT and 0.26MB on PNA) fewer parameters on the GraphSAGE and GAT, respectively.
Thus, our method is more efficient and flexible in obtaining the higher-level features.
From Figure~\ref{fig-ranges-blocks}, we can observe that the lower-level features, which are distinguishable and helpful for prediction~\cite{li2018deeper}, are more likely to be utilized in each block compared with higher-level ones.
Besides, the over-smoothing problem is generated by stacking aggregation operations thus the features in higher-level become indistinguishable. This problem can be alleviated by selecting different levels of features in each block adaptively based on the proposed method.
As a summary, we evaluate the over-smoothing problem and visualize how different levels of features are utilized in our framework. The results demonstrate that our method can alleviate corresponding deficiencies of these two manners by utilizing features adaptively in each block.
Combined with the performance gain and the top ranking in Table~\ref{tb-performance-agg}, the advantages of our method over the existing two topology design manners are significant and the aforementioned topology design target can be achieved with the proposed method.
\begin{figure}[t]
\centering
\includegraphics[width=0.8\linewidth]{./fig/block_prob}
\centering
\caption{We visualize the usage of different levels of features in F$^2$SAGE on the Cora dataset. $N$ is the number of SFA blocks. The cell $(Bi,Lj)=1$ represents the features of level $j$ are selected in Block $i$. }
\label{fig-ranges-blocks}
\end{figure}
\subsection{Ablation study}
In this section, we conduct ablation studies on the proposed framework.
\subsubsection{The Importance of Fusion Strategy}
In designing topologies, existing methods mainly focus on the links among operations~\cite{xie2019exploring,valsesia2020don}. By reviewing the extensive human-designed GNNs, we observe that the feature selection and fusion strategies result in the main difference of topology designs in GNNs.
It indicates that the selection and fusion strategies are key components in designing the topology of GNNs, and the fusion strategies should be considered since they can improve the utilization of features in different levels~\cite{xu2018representation,zhao2020simplifying,zhao2021search}.
To evaluate the importance of fusion strategy, we learn to design topologies with fixed fusion operations instead. As shown in Table~\ref{tb-ablation-fusion}, with the three predefined fusion operations, the performance drop is evident on three variants, which demonstrates the importance of the fusion strategy.
Therefore, designing the topology of GNNs with the selection and fusion operations is significant compared with the existing methods.
\begin{table}[]
\caption{Performance comparisons of different fusion operations. The best results are highlighted and the second are underlined.}
\centering
\footnotesize
\begin{tabular}{c|c|c|c}
\hline
Method & Cora & PubMed & Physics \\ \hline
F$^2$SAGE-SUM & 84.73(0.63) & 89.39(0.21) & 96.44(0.01) \\
F$^2$SAGE-MEAN & 84.30(0.61) & {\ul 89.58(0.22)} & 96.42(0.03) \\
F$^2$SAGE-CONCAT & {\ul 86.07(0.45)} & 89.31(0.19) & {\ul 96.69(0.01)} \\ \hline
F$^2$SAGE & \gray 87.72(0.26) & \gray 89.73(0.26) & \gray 96.72(0.01) \\ \hline
\end{tabular}
\label{tb-ablation-fusion}
\end{table}
\subsubsection{The Evaluation of the Improved Search Algorithm}
\label{sec-ablation-gap}
The efficiency of the differentiable search algorithm over others is significant and has been proved in existing methods~\cite{liu2018darts,zhao2021search,li2021one}. Therefore, we provide an improved differentiable search algorithm to design GNNs.
In Table~\ref{tb-performance-agg}, SNAG and Random methods need to sample architectures and then train from scratch. In our experiments, they require 26.44 and 0.903 GPU hours to search GNNs on the Cora dataset. SANE and F$^2$GNN employ the differentiable search algorithm and the search cost are 0.007 and 0.028 GPU hours on the Cora dataset, respectively.
However, we observe that the optimization gap has a large influence on the feature selection operation due to the two opposite selection operations.
As shown in Table~\ref{tb-gap}, we use the validation accuracy to quantify the optimization gap in the feature fusion framework. These accuracies are obtained at the end of the search and after architecture derivation without fine-tuning.
We can observe that when the temperature is too large, i.e., 1 and 0.1, the validation accuracy gap of the supernet and the childnet is large when we search the feature selection and fusion operations. In these cases, the \texttt{ZERO} operation is selected for most features.
However, in the F$^2$AGG method, which only searches aggregation operations based on the selection operation \texttt{IDENTITY} and fusion operation \texttt{SUM},
the accuracy gap is much smaller.
Therefore, considering the two opposite operations in the selection operation set, we use the small temperature of 0.001 instead.
The performance gains in Table~\ref{tb-performance-agg} indicate the effectiveness of the improved search algorithm in addressing the optimization gap in feature fusion and obtaining the expressive GNNs.
\subsubsection{The Influence of the Number of SFA Blocks}
\label{sec-num-blocks}
In this paper, we only use four SFA blocks for example. Here we conduct experiments to show the influences of the number of SFA blocks.
In Figure~\ref{fig-ablation-blocks}, F$^2$SAGE achieves a stable performance on the condition of different SFA blocks, yet the stacked baselines obtained the performance drop due to the over-smoothing problem as shown in Figure~\ref{fig-mad-layer}.
The increasing number of SFA blocks do not bring about the performance drop due to the adaptive utilization of different levels of features, which then demonstrates the strong ability of our method in alleviating the over-smoothing problem.
\begin{table}[t]
\footnotesize
\centering
\caption{Comparisons of the validation accuracy in the supernet and the childnet on the Cora dataset.}
\begin{tabular}{c|c|c|c|c}
\hline
\multirow{2}{*}{Temperature $\lambda$} & \multicolumn{2}{c|}{F$^2$SAGE} & \multicolumn{2}{c}{F$^2$AGG} \\ \cline{2-5}
& Supernet & Childnet & \multicolumn{1}{c|}{Supernet} & \multicolumn{1}{c}{Childnet} \\ \hline
1 & 80.33 & 6.68 & 86.83 & 85.71 \\ \hline
0.1 & 73.65 & 10.96 & 84.23 & 83.86 \\ \hline
0.01 & 70.13 & 70.13 & 84.60 & 84.60 \\ \hline
0.001 & 80.15 & 80.15 & 86.83 & 86.83 \\ \hline
\end{tabular}
\label{tb-gap}
\end{table}
\begin{figure}[t]
\centering
\includegraphics[width=0.9\linewidth]{./fig/SFAnum}
\caption{Performance comparisons of the different SFA block numbers on F$^2$SAGE. Different colors represent different block numbers.}
\label{fig-ablation-blocks}
\end{figure}
\section{Conclusion and Future Work}
In this paper, we provide a novel feature fusion perspective in designing the GNN topology and propose a novel framework to unify the existing topology designs with feature selection and fusion strategies. In this way, designing the topology of GNNs is transformed into designing the feature selection and fusion strategies in the unified framework.
To obtain an adaptive topology design, we develop a NAS method.
To be specific, we provide a set of candidate selection and fusion operations in the search space and develop an improved differentiable search algorithm to address the obvious optimization gap in our method.
Extensive experiments are conducted on the predefined and learnable aggregation operations on eight real-world datasets (five homophily and three heterophily).
The results demonstrate the effectiveness and versatility of the proposed method, and we can enjoy the benefits and alleviate the deficiencies of existing topology design manners, especially alleviating the over-smoothing problem, by utilizing different levels of features adaptively.
For future work, we will investigate the influence of different candidate operations and algorithms, and explore F$^2$GNN in large-scale graphs~\cite{hu2020ogb} and the heterophily datasets.
\begin{acks}
We thank Dr. Quanming Yao and Dr. Yongqi Zhang to improve the method and manuscript.
We also thank all anonymous reviewers for their constructive comments, which help us to improve the quality of this manuscript.
\end{acks}
\clearpage
\bibliographystyle{ACM-Reference-Format}
| {'timestamp': '2022-02-02T02:20:10', 'yymm': '2112', 'arxiv_id': '2112.14531', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14531'} | arxiv |
\section{Proof of Theorem~\ref{thrm: algolb}}\label{sec: thrm: algolb}
For every job $J_i$, define $B_i$ as the set of tasks that are executed between time $r_i$ and time $c_i(\mathcal{BAL})$ under $\mathcal{BAL}$. In other words,
\[B_i = \{J_{i',k'} | r_i < c_{i',k'}(\mathcal{BAL}) \leq c_i(\mathcal{BAL})\}.\]
Thus $|B_i| = f_i(\mathcal{BAL})$.
Further divide $B_i$ into the following two sets according to the release time.
\[B_{i,1} = \{J_{i', k'}|J_{i', k'} \in B_i \land r_{i'} \leq r_i\}\]
\[B_{i,2} = \{J_{i', k'}|J_{i', k'} \in B_i \land r_{i'} > r_i\}\]
We first upper bound $|B_{i,1}|^2$ in the following lemma.
\begin{lemma}\label{lemma: Xi1UB}
For any $i \in [1, n]$,
$|B_{i,1}|^2 =O(F(\mathcal{OPT}))$.
\end{lemma}
\begin{proof}
Because tasks in $B_{i,1}$ are released by time $r_i$ and are completed after time $r_i$ under $\mathcal{BAL}$,
we have $q(r_i) \geq |B_{i,1}|$.
Thus, $|B_{i,1}|^2 \leq q(r_i)^2
= O\left(\sum_{t \in \mathbb{N}}{q(t)}\right) = O(F(\mathcal{OPT}))$,
where the first equality follows from $q(t+1) \geq q(t)-1$ for any $t \in \mathbb{N}$,
and the second equality follows from Lemma~\ref{prop: LBQ}.
\end{proof}
\noindent We further divide $B_{i,2}$ into the following two sets.
\begin{align*}
N_{i} &= \{J_{i', k'} | J_{i', k'} \in B_{i,2} \land \mbox{$J_{i', k'}$ is executed as a normal task}\}\\
S_{i} &= \{J_{i', k'} | J_{i', k'} \in B_{i,2}
\land \mbox{$J_{i', k'}$ is executed as a starving task}\}\\
\end{align*}
\begin{lemma}\label{lemma: NiSRPT}
For any $i \in [1, n]$,
$|N_i| = O(f_i(\mathcal{SRPT}))$.
\end{lemma}
\begin{proof}
Let $J_{i', k'} \in N_i$.
It suffices to show $r_i < c_{i', k'}(\mathcal{SRPT}) < c_{i}(\mathcal{SRPT})$.
The first inequality holds because $J_{i', k'} \in B_{i,2}$ and thus
$r_i < r_{i'} < c_{i', k'}(\mathcal{SRPT})$.
Next, consider the second inequality and note that $c_{i}(\mathcal{SRPT}) = c_{i,p_i}(\mathcal{SRPT})$.
Because $J_{i', k'}$ is executed as a normal task,
$J_i$ cannot be a starving job when $J_{i', k'}$ is executed.
In other words, when $J_{i', k'}$ is executed, both $J_{i', k'}$ and $J_{i, p_i}$ are
normal tasks.
By the design of Line~12 in Algorithm~\ref{algo}, the fact that
$\mathcal{BAL}$ executes $J_{i', k'}$ before $J_{i, p_i}$
then implies
$c_{i', k'}(\mathcal{SRPT}) < c_{i,p_i}(\mathcal{SRPT})$.
\end{proof}
\noindent By Lemma~\ref{lemma: NiSRPT} and Corollary~\ref{coro: SRPTcr}, we then have
\begin{lemma}
$\sum_{i=1}^{n}{|N_{i}|^2} = O(n)F(\mathcal{OPT})$.
\end{lemma}
\noindent Next, we upper bound $|S_i|$.
Define $f_{i,k}(\mathcal{S}) = c_{i,k}(\mathcal{S}) - r_i$.
The following lemma is a simple application of Lemma~\ref{prop: LBQ}.
\begin{lemma}\label{lemma: uf}
For any work-conserving schedule $\mathcal{S}$,
\[F(\mathcal{OPT}) \geq \sum_{i=1}^{n}{\sum_{k=1}^{p_i}{f_{i,k}(\mathcal{S})}}.\]
\end{lemma}
\begin{proof}
By Lemma~\ref{prop: LBQ}, we have
$F(\mathcal{OPT})
\geq \sum_{i=1}^{n}{\sum_{t = r_i}^{c_i(\mathcal{S})}{q_{t, \mathcal{S}}(i)}}$.
Recall that $q_{t, \mathcal{S}}(i)$ counts the number of remaining tasks of $J_i$ at time $t$ under
$\mathcal{S}$.
Thus, in $\sum_{i=1}^{n}{\sum_{t = r_i}^{c_i(\mathcal{S})}{q_{t, \mathcal{S}}(i)}}$,
a task $J_{i,k}$ is counted from time $r_i$ to time
$c_{i,k}(\mathcal{S})-1$.
Thus, $J_{i,k}$ is counted $(c_{i,k}(\mathcal{S})-1)-r_i+1 = f_{i,k}(\mathcal{S})$ times.
As a result,
$ F(\mathcal{OPT})
\geq \sum_{i=1}^{n}{\sum_{t = r_i}^{c_i(\mathcal{S})}{q_{t, \mathcal{S}}(i)}}
= \sum_{i=1}^{n}{\sum_{k=1}^{p_i}{f_{i,k}(\mathcal{S})}}$.
\end{proof}
\noindent To prove Theorem~\ref{thrm: algolb}, it is then sufficient
to prove the following lemma.
\begin{lemma}\label{lemma: Xi2UB}
For any $i \in [1, n]$,
$|S_{i}|^2 = O(n)\sum_{k=1}^{p_i}{f_{i,k}(\mathcal{BAL})}$.
\end{lemma}
Observe that Lemma~\ref{lemma: Xi2UB} and Lemma~\ref{lemma: uf} imply
$\sum_{i=1}^{n}{|S_{i}|^2} = O(n)F(\mathcal{OPT})$.
\subsection*{Proof of Lemma~\ref{lemma: Xi2UB}}
For any task $J_{i,k}$, we partition $S_i$ into two sets by comparing
the completion time of the task in $S_i$ to
the completion time of $J_{i,k}$.
Specifically, define
\[S_{i,k} = \{J_{i',k'} |
J_{i',k'} \in S_i
\land c_{i',k'}(\mathcal{BAL}) < c_{i,k}(\mathcal{BAL})
\}\]
\[\overline{S_{i,k}} = \{J_{i',k'} |
J_{i',k'} \in S_i
\land c_{i',k'}(\mathcal{BAL}) > c_{i,k}(\mathcal{BAL})
\}\]
Note that because $S_i$ is a subset of $B_{i,2}$,
tasks in $S_i$ cannot be from $J_i$. Thus, for any task in $S_i$, its completion time under
$\mathcal{BAL}$ cannot be $c_{i,k}(\mathcal{BAL})$.
Thus, $|S_i| = |S_{i,k}| + |\overline{S_{i,k}}|$.
Moreover, because tasks in $S_{i,k}$ are
executed between time $r_i+1$ and time $c_{i,k}(\mathcal{BAL})-1$ under $\mathcal{BAL}$, we have
$|S_{i,k}| \leq (c_{i,k}(\mathcal{BAL})-1) - (r_i+1) < f_{i,k}(\mathcal{BAL})$.
Thus, to prove Lemma~\ref{lemma: Xi2UB}, it suffices to prove
\begin{equation}\label{eq: lemma: Xi2UB} \tag{$\ast\ast$}
|S_i|^2 = O(n)\sum_{k=1}^{p_i}{|S_{i,k}|}.
\end{equation}
Note that for any FaS job $J_{i'}$, its number of starving tasks is maximized when it becomes starving.
Thus, for any FaS job $J_{i'}$, it has at most $q_{t_{i'}}(i')$ starving tasks throughout the course of
the execution of $BAL(\theta)$.
Because $S_i$ only contains starving tasks, $J_{i'}$ has at most $q_{t_{i'}}(i')$ tasks in $S_i$.
We further use the following claim to upper bound $q_{t_{i'}}(i')$.
\begin{claim} \label{claim: Xi2P}
Let $J_{i'}$ be a job that has some task in $S_i$.
Then $q_{t_{i'}}(i') \leq q_{t_{i'}}(i)$.
\end{claim}
\begin{proof}
Let $t = t_{i'}$.
Because $J_{i'}$ has some task in $S_i$, we have $r_{i'} > r_i$ and thus
\begin{equation}\nonumber
t-r_{i'} < t-r_i.
\end{equation}
It is then sufficient to show that
\begin{equation} \label{eq: Xi2P}
\frac{t-r_{i'}}{q_{t}(i')} \geq \frac{t-r_{i}}{q_{t}(i)}.
\end{equation}
\noindent \textbf{Case 1: $J_i$ is a FaN job.}
Thus, when $J_{i'}$ becomes starving, $J_i$ is a normal job.
Therefore, $\frac{t-r_{i'}}{q_{t}(i')} \geq \theta > \frac{t-r_{i}}{q_{t}(i)}$.
\noindent \textbf{Case 2: $J_i$ is a FaS job.}
In this case, $t_{i'} \leq t_i$ must hold; otherwise, if $t_{i'} > t_{i}$, then by the design of $BAL(\theta)$,
all the starving tasks of $J_{i'}$ must be executed after $J_i$ is completed.
Thus, $J_{i'}$ cannot have any task in $S_i$.
As a result, we only need to consider two possible subcases: $t_{i'} < t_i$ and $t_{i'} = t_i$.
If $t_{i'} < t_i$, then at time $t_{i'}$, $J_i$ is normal and
$J_{i'}$ is starving. Thus, Eq.~\eqref{eq: Xi2P} holds for the same reason as in Case~1.
If $t_{i'} = t_i$, then by the fact that $BAL(\theta)$ executes a starving task of $J_{i'}$
before $J_i$ is completed and the
tie-breaking rule of $BAL(\theta)$, we have
$\gamma_{i'} \geq \gamma_i$, which implies Eq.~\eqref{eq: Xi2P}.
\end{proof}
By Claim~\ref{claim: Xi2P}, every job $J_{i'}$ has at most
$q_{t_{i'}}(i) \leq p_i$ tasks in $S_i$. Therefore,
\begin{equation}\label{eq: SiUB}
|S_i| \leq n \cdot p_i.
\end{equation}
Next, we upper bound $|\overline{S_{i,k}}|$ to lower bound the right-hand side
of Eq.~\eqref{eq: lemma: Xi2UB}.
\begin{claim}\label{claim: tigeq}
Let $J_{i'}$ be a job that has some tasks in $\overline{S_{i,k}}$.
Then $t_{i'} \geq c_{i,k}(\mathcal{BAL})$.
\end{claim}
\begin{proof}
For the sake of contradiction, assume $t_{i'} < c_{i,k}(\mathcal{BAL})$.
\noindent \textbf{Case 1: $J_i$ is a FaN job or $J_i$ is a FaS job with
$t_{i'} < t_{i}$.} In this case, because $t_{i'} < c_{i,k}(\mathcal{BAL})$,
by the design of $BAL(\theta)$,
$J_{i'}$ is completed before $J_{i,k}$ is completed under $\mathcal{BAL}$.
Thus, $J_{i'}$ cannot have any task in $\overline{S_{i,k}}$,
which contradicts to the assumption of $J_{i'}$.
\noindent \textbf{Case 2: $J_i$ is a FaS job with $t_{i'} \geq t_{i}$.}
In this case, the assumption that $J_{i'}$ has a task in $S_i$ implies that
$t_{i'} = t_{i}$ and that after time $t_{i'}$, $J_i$ cannot be executed until
$J_{i'}$ is completed. Because $t_{i'} < c_{i,k}(\mathcal{BAL})$,
$J_{i'}$ cannot have any task in $\overline{S_{i,k}}$,
which contradicts to the assumption of $J_{i'}$.
\end{proof}
\begin{claim}\label{claim:pi-k}
For any job $J_{i'}$,
$J_{i'}$ has at most $p_i-k$ tasks in $\overline{S_{i,k}}$.
\end{claim}
\begin{proof}
Assume that $J_{i'}$ has at least one task in $\overline{S_{i,k}}$.
By Claim~\ref{claim: tigeq}, $t_{i'} \geq c_{i,k}(\mathcal{BAL})$.
Thus, by Claim~\ref{claim: Xi2P},
$q_{t_{i'}}(i') \leq q_{t_{i'}}(i) \leq q_{c_{i,k}(\mathcal{BAL})}(i)
= p_i-k$.
Thus, $J_{i'}$ has at most $p_i-k$ starving tasks throughout the course of the execution of
$BAL(\theta)$. Because $\overline{S_{i,k}}$ only contains starving tasks,
$J_{i'}$ has at most $p_i-k$ tasks in $\overline{S_{i,k}}$.
\end{proof}
By Claim~\ref{claim:pi-k}, we have
\begin{equation}\label{eq: overlineub}
|\overline{S_{i,k}}| \leq n(p_i-k).
\end{equation}
\paragraph*{Proof of Eq.~\eqref{eq: lemma: Xi2UB}}
Let $k^* = p_i- \lfloor \frac{|S_i|}{2n} \rfloor$.
By Eq.~\eqref{eq: SiUB}, $k^* \geq p_i-\lfloor \frac{p_i}{2} \rfloor \geq 1$.
Therefore, task $J_{i,k^*}$ exists.
By Eq.~\eqref{eq: overlineub}, we have
\[
|S_{i,k^*}| = |S_i| - |\overline{S_{i,k^*}}| \geq
|S_i| - n(p_i-k^*) = |S_i| - n\left(p_i-\left(p_i- \lfloor \frac{|S_i|}{2n} \rfloor \right)\right)
\geq |S_i| - n\left(\frac{|S_i|}{2n}\right) = \frac{|S_i|}{2}.
\]
Therefore,
\begin{align*}
&n\sum_{k=1}^{p_i}{|S_{i,k}|}
\geq n\sum_{k=k^*}^{p_i}{|S_{i,k}|}
\geq n\sum_{k=k^*}^{p_i}{|S_{i,k^*}|}
= n (p_i-k^*+1)|S_{i,k^*}|
\geq n \left(\lfloor \frac{|S_i|}{2n} \rfloor+1\right) \frac{|S_i|}{2}\\
&\geq \frac{|S_i|}{2} \frac{|S_i|}{2},
\end{align*}
where the second inequality follows from
$S_{i,p_i} \supseteq S_{i,p_i-1} \supseteq \cdots \supseteq S_{i,1}$.
\subsection{Proof of Lemma~\ref{prop: LBQ}}\label{appendix: prop: LBQ}
For any work-conserving schedule $\mathcal{S}$, we have
\begin{align*}\nonumber
&F(\mathcal{OPT})
= \sum_{i=1}^{n}{\sum_{t = r_i}^{c_i(\mathcal{OPT})-1}{(c_i(\mathcal{OPT})-r_i)}}
\geq \sum_{i=1}^{n}{\sum_{t = r_i}^{c_i(\mathcal{OPT})-1}{p_i}}\\
&\geq \sum_{i=1}^{n}{\sum_{t = r_i}^{c_i(\mathcal{OPT})-1}{q_{t, \mathcal{OPT}}(i)}}
=\sum_{t \in \mathbb{N}}{q(t)}
= \sum_{i=1}^{n}{\sum_{t = r_i}^{c_i(\mathcal{S})}{q_{t, \mathcal{S}}(i)}}.
\end{align*}
\section{The Algorithm and The Proof Sketch of Theorem~\ref{thrm: algolb}}\label{sec: thealgo}
We consider the online problem of minimizing the $\ell_2$ norm of flow time.
In this problem, there are $n$ jobs, $J_1, J_2, \cdots, J_n$, and one machine.
Each job $J_i$ has a processing time $p_i$ and a release time $r_i$.
As in~\cite{doi:10.1137/130911317, doi:10.1137/18M1202451},
we assume that $p_i$ and $r_i$ are in $\mathbb{N}$.\footnote{In this paper,
we assume $\mathbb{N}$ contains 0.}
For any schedule $\mathcal{S}$, we use $c_i(\mathcal{S})$ to denote the
completion time of job $J_i$ under $\mathcal{S}$.
The flow time of a job $J_i$ under schedule $\mathcal{S}$, denoted
by $f_i(\mathcal{S})$, is $c_i(\mathcal{S}) - r_i$.
Define
\[F(\mathcal{S}) = \sum_{i=1}^{n}{f_i(\mathcal{S})^2}.\]
The goal is to compute a schedule $\mathcal{S}$ that minimizes
the $\ell_2$ norm of flow time, i.e., $\sqrt{F(\mathcal{S})}$. Thus,
any $c$-competitive algorithm for minimizing $F$ is
$c^{1/2}$-competitive for minimizing the $\ell_2$ norm of flow time.
Throughout this paper, we use $\mathcal{BAL}, \mathcal{SRPT}, \mathcal{FCFS}$, and
$\mathcal{OPT}$ to denote the schedule obtained by $BAL(\theta)$,
SRPT, FCFS, and the optimal solution, respectively.
A job is said to be \textbf{active} at time $t$ under schedule $\mathcal{S}$,
if it is released by time $t$ but has not yet been completed by time $t$
under $\mathcal{S}$. We use $A(t, \mathcal{S})$ to denote the index set of the
active jobs under $\mathcal{S}$ at time $t$.
For every $t \in \mathbb{N}$, the \textbf{time slot} $[t]$
is defined as the time interval between time $t$ and time $t+1$.
Thus, we can divide time into time slots $[0], [1], [2], \cdots$.
We can view each job $J_i$ as a chain of tasks
$J_{i,1}, J_{i,2}, \cdots, J_{i,p_i}$, where each task has unit processing time.
Because all the processing times and release times are in $\mathbb{N}$,
by a simple exchange argument, we can assume that under the optimal schedule,
the machine never executes more than one task in time slot $[t]$ for any
$t \in \mathbb{N}$ (i.e., the machine is either idle or is executing
the same task throughout the entire time slot $[t]$).
Thus, in this paper, we view a schedule $\mathcal{S}$ as a function that
maps every $t \in \mathbb{N}$ to some (possibly empty) task executed
in time slot $[t]$. If a task $J_{i,k}$ is executed in time slot $[t]$ under schedule $\mathcal{S}$,
then its completion time, denoted by $c_{i,k}(\mathcal{S})$, is $t+1$.
Without loss of generality, we assume that every schedule $\mathcal{S}$
processes tasks following the order of the chain (i.e.,
$c_{i,1}(\mathcal{S}) < c_{i,2}(\mathcal{S}) < \cdots < c_{i,p_i}(\mathcal{S})$).
In this paper, for any $a, b \in \mathbb{N}$ with $a \leq b$, $[a,b]$ is defined as
$\{i | i \in \mathbb{N}, a \leq i \leq b\}$. If $a > b$, then $[a,b] = \varnothing$.
Moreover, we define a \textbf{map} as a non-negative function with a finite domain.
The next definition introduces a map that focuses on active jobs' remaining tasks.
\begin{definition}
For any schedule $\mathcal{S}$ and any time $t$, define
\begin{equation}\nonumber
q_{t, \mathcal{S}}(i)=
\begin{cases}
\mbox{the number of remaining tasks of $J_i$ at time $t$ under $\mathcal{S}$} &
\text{if $i \in A(t, \mathcal{S})$}\\
0 & \text{if $i \in [1,n] \setminus A(t, \mathcal{S})$}
\end{cases}
\end{equation}
\end{definition}
\begin{figure}[h]
\begin{center}
\includegraphics[width=11cm]{example4}
\caption{Example of $q_{3, \mathcal{SRPT}}(i)$.}
\label{fig: exq}
\end{center}
\end{figure}
\begin{example}
Consider the schedule obtained by SRPT for the instance shown in Fig.~\ref{fig: exq}.
Assume that SRPT first executes $J_1$. Then at time 3, the numbers of remaining tasks
of $J_1$ and $J_2$ are 4 and 6, respectively. Thus, $q_{3, \mathcal{SRPT}}(1) = 4$
and $q_{3, \mathcal{SRPT}}(2) = 6$. Because jobs $J_3, J_4, J_5, J_6$ are not active
at time 3, we have $q_{3, \mathcal{SRPT}}(i) = 0$, for all $3 \leq i \leq 6$.
\end{example}
\subsection{The Algorithm: $BAL(\theta)$}
For brevity, we define $q_t(i)$ as $q_{t, \mathcal{BAL}}(i)$.
$BAL(\theta)$ categorizes active jobs into two types, starving and normal, according to the
given threshold $\theta$.
Every job is normal initially.
An active job $J_i$ is said to
be \textbf{starving} at time $t$
if $\frac{t-r_i}{q_t(i)} \geq \theta$.
Moreover, once $J_i$ becomes starving, every remaining task of $J_i$ is said to
be starving as well.
Once a job becomes starving, the job will always be starving
until completion. If a job never becomes starving,
it is termed a \textbf{Finished-as-Normal (FaN) job};
otherwise, it is termed a \textbf{Finished-as-Starving (FaS) job}.
Recall that in the introduction,
$t_i$ is the time at which $J_i$ becomes starving.
In other words, if $J_i$ is an FaS job, then
$t_i$ is the smallest $t$ that satisfies
$\frac{t-r_i}{q_t(i)} \geq \theta$.
We extend the definition of $t_i$ to FaN jobs as follows:
If $J_i$ is an FaN job, $t_i$ is defined as its completion time (i.e., $t_i = c_i(\mathcal{BAL})$).
Finally, for any FaS job $J_i$,
define $\gamma_i = \frac{t_i-r_i}{q_{t_i}(i)}$.
In the pseudocode of $BAL(\theta)$, we use $ST$ to
denote the index set of the starving jobs and initially $ST = \varnothing$.
When there are starving jobs, $BAL(\theta)$ executes the starving job that
has the smallest $t_i$.
In other words, $BAL(\theta)$ executes the job that becomes starving first.
Ties are broken by choosing the job that has the largest $\gamma_i$.
If there are still ties, break them by choosing the smallest job
index.\footnote{These tie-breaking rules are only
used in the proof of Theorem~\ref{thrm: algolb}.}
If there is no starving job, $BAL(\theta)$ then follows SRPT. Specifically,
let $M_{SRPT}(t)$ and $M_{BAL}(t)$
be the sets of tasks that are executed in time slots $[0], [1], [2], \cdots, [t]$
under SRPT and $BAL(\theta)$, respectively. Define $M_{BAL}(-1) = \varnothing$.
Note that $BAL(\theta)$ can obtain $M_{SRPT}(t)$ by simulating SRPT.
At time $t$, if there is no starving job, then among the tasks in $M_{SRPT}(t) \setminus M_{BAL}(t-1)$,
$BAL(\theta)$ executes the one that is completed the earliest under SRPT.
Observe that for any two tasks $a$ and $b$ that are executed when there
is no starving job (i.e., $a$ and $b$ are normal tasks when they are executed),
their relative execution order follows SRPT
(i.e., if $a$ is completed before $b$ under $BAL(\theta)$,
then $a$ is completed before $b$ under SRPT).
Clearly, $BAL(\theta)$ produces a feasible schedule.
\begin{algorithm}[t]
\begin{small}
\caption{$BAL(\theta)$}
\label{algo}
\For {$t \gets 0$ \KwTo $\infty$} {
\For{\textup{every active job }$J_i$}{
\If{$i \notin ST \land \frac{t-r_i}{q_t(i)} \geq \theta$}{
$t_i \gets t, \gamma_i \gets \frac{t-r_i}{q_{t}(i)}$\\
Add $i$ to $ST$\\
}
}
\If{$ST \neq \varnothing$}{
$i^* = \argmin_{i \in ST}{t_i}$ (Ties are broken by
choosing the index $i$ with the highest $\gamma_i$.
If there are still ties,
break them by choosing the smallest job index.)\\
\textup{Execute job $J_{i^*}$ in time slot $[t]$}\\
\If{$J_{i^*}$ \textup{is completed at time} $t+1$} {
Remove $i^*$ from $ST$\\
}
} \ElseIf {$M_{SRPT}(t) \setminus M_{BAL}(t-1) \neq \varnothing$}{
Among all the tasks in $M_{SRPT}(t) \setminus M_{BAL}(t-1)$,
execute the one that has the smallest completion time under SRPT.\\
}
}
\end{small}
\end{algorithm}
\subsection{Proof Sketch of Theorem~\ref{thrm: algolb}}
Due to space limit, the complete proof of Theorem~\ref{thrm: algolb} is given in
Appendix~\ref{sec: thrm: algolb}.
In this subsection, we only give a proof sketch.
To minimize the $\ell_2$ norm of flow time (and many other reasonable objective functions),
we should not waste any time slot. Specifically, at every time $t \in \mathbb{N}$,
if some active jobs are not completed, then one of them must be executed in time slot $[t]$.
A schedule that satisfies the above property is called a \textbf{work-conserving} schedule.
Clearly, for any time $t$, all work-conserving schedules have the same total number of remaining tasks
over all active jobs. Specifically, for any two work-conserving schedules $\mathcal{S}_1$
and $\mathcal{S}_2$ and any time $t$, we have
\[\sum_{i=1}^{n}{q_{t,\mathcal{S}_1}(i)}
= \sum_{i=1}^{n}{q_{t,\mathcal{S}_2}(i)}.\]
Thus, we define $q(t)$ as the total number of remaining tasks overall all active jobs at time $t$ under any
work-conserving schedule.
For example, consider the instance shown in Fig.~\ref{fig: exq} at time $t = 3$. We then have $q(t) = 10$.
The following lemma, whose proof can be found in Appendix~\ref{appendix: prop: LBQ},
gives the relationship between the number of remaining tasks of active jobs and $F(\mathcal{OPT})$.
\begin{lemma}\label{prop: LBQ}
For any work-conserving schedule $\mathcal{S}$,
\[F(\mathcal{OPT})
\geq \sum_{t \in \mathbb{N}}{q(t)}
= \sum_{i=1}^{n}{\sum_{t = r_i}^{c_i(\mathcal{S})}{q_{t, \mathcal{S}}(i)}}.\]
\end{lemma}
Let $B_i$ be the set of tasks executed between time
$r_i$ and time $c_i(\mathcal{BAL})$ under $\mathcal{BAL}$.
To upper bound $f_i(\mathcal{BAL}) = c_i(\mathcal{BAL}) - r_i$,
it suffices to upper bound $|B_i|$.
To this end, we divide $B_i$ into three sets:
\begin{enumerate}
\item We first consider the subset $B_{i,1}$ of $B_i$ that
consists of tasks released by time $r_i$. Because these tasks are completed after
time $r_i$ under $\mathcal{BAL}$,
we have $|B_{i,1}| \leq q(r_i)$.
We then use Lemma~\ref{prop: LBQ} to upper bound $|B_{i,1}|$.
\item We then consider the set $B_{i,2} = B_i \setminus B_{i,1}$.
To upper bound $|B_{i,2}|$, we first consider the subset $N_i$ of $B_{i,2}$ that consists of
tasks that are executed as normal tasks.
We can upper bound $|N_i|$ because when $\mathcal{BAL}$ executes normal tasks,
it follows SRPT, which is $O(n^{1/2})$-competitive.
\item Finally, we consider $S_i = B_{i,2} \setminus N_i$.
Tasks in $S_i$ are executed as starving tasks.
We also use Lemma~\ref{prop: LBQ} to upper bound $|S_i|$.
One of the critical properties is the following: If $J_{i'}$ has some tasks in $S_i$,
then at time $t = t_{i'}$, $q_{t}(i') \leq q_{t}(i)$.
\end{enumerate}
\section{Missing Proofs in Section~\ref{sec: intro}}
\subsection{Competitive Analyses of SRPT and FCFS}\label{appendix: SRPT_FCFS}
\begin{prop}
Let $\mathcal{S}$ be a schedule that minimizes the $\ell_1$ norm of flow time.
Then $F(\mathcal{S}) \leq n \cdot F(\mathcal{OPT})$.
\end{prop}
\begin{proof}
\begin{align*}
n \cdot F(\mathcal{OPT}) &= \left(\sum_{i=1}^{n}{1^2}\right) \left( \sum_{i=1}^{n}{{f_i(\mathcal{OPT})}^2}\right)
\geq \left(\sum_{i=1}^{n}{f_i(\mathcal{OPT})}\right)^2 \geq \left(\sum_{i=1}^{n}{f_i(\mathcal{S})}\right)^2\\
&\geq \sum_{i=1}^{n}{f_i(\mathcal{S})^2}
= F(\mathcal{S}),
\end{align*}
where the first inequality follows from the Cauchy-Schwarz inequality and the
second inequality follows from the assumption that $\mathcal{S}$ minimizes the $\ell_1$ norm of flow time.
\end{proof}
It is well-known that SRPT minimizes the average flow time (or equivalently, the $\ell_1$ norm of flow time). Thus, we have the following corollary.
\begin{coro}\label{coro: SRPTcr}
SRPT is $O(n^{\frac{1}{2}})$-competitive for minimizing the $\ell_2$ norm of flow time.
\end{coro}
\begin{prop}
Let $\mathcal{S}$ be a schedule that minimizes the $\ell_{\infty}$ norm of flow time.
Then $F(\mathcal{S}) \leq n \cdot F(\mathcal{OPT})$.
\end{prop}
\begin{proof}
$$n \cdot F(\mathcal{OPT}) \geq n \max_{i}{{f_i(\mathcal{OPT})}^2} \geq n \max_{i}{{f_i(\mathcal{S})}^2}
\geq F(\mathcal{S}),$$
where the
second inequality follows from the assumption that $\mathcal{S}$ minimizes the $\ell_{\infty}$
norm of flow time.
\end{proof}
Because FCFS minimizes the maximum flow time (i.e., the $\ell_{\infty}$ norm of flow
time)~\cite{10.5555/314613.314715}, we have the following corollary.
\begin{coro}\label{coro: FCFScr}
FCFS is $O(n^{\frac{1}{2}})$-competitive for minimizing the $\ell_2$ norm of flow time.
\end{coro}
\subsection{Lower Bounds for SJF and SETF}\label{appendix: SJF}
In the lower bound instance, for every job $J_i$, $p_i = n-i+1$. We set $r_1 = 1$.
For $i \geq 2$, we set $r_i = r_{i-1}+p_{i-1}-1$.
Fig.~\ref{fig: ex3} shows such an instance when $n = 7$.
For ease of exposition, assume that $n$ is an even number.
Let $\mathcal{S}$ be the schedule obtained by applying SJF on the instance.
It is easy to see that under SJF, the job completion order is $J_{n}, J_{n-1}, J_{n-2}, \cdots, J_1$.
Thus, for every job $J_i$ with $i \in [1, \frac{n}{2}]$, $J_i$ cannot be completed before
$J_{\frac{n}{2}+1}, J_{\frac{n}{2}+2}, \cdots, J_{n}$ are completed.
Therefore, for every job $J_i$ with $i \in [1, \frac{n}{2}]$,
$f_i(\mathcal{S}) = \Omega(1+2+3+\cdots+\frac{n}{2})=\Omega(n^2)$.
As a result, $F(\mathcal{S}) = \Omega(n^5)$.
Next, consider the schedule $\mathcal{FCFS}$.
It is easy to see that for every job $J_i$, $f_i(\mathcal{FCFS}) = n$.
Therefore, $F(\mathcal{OPT}) \leq F(\mathcal{FCFS}) = \Theta(n^3)$.
We then have the following result.
\begin{prop}
The competitive ratio of SJF for minimizing the $\ell_2$ norm of flow time is $\Omega(n)$.
\end{prop}
\noindent It is easy to see that the same instance also shows that SETF has a competitive
ratio of $\Omega(n)$.
\begin{figure}[h]
\begin{center}
\includegraphics[width=12cm]{example3}
\caption{A lower bound instance of SJF and SETF when $n=7$.}
\label{fig: ex3}
\end{center}
\end{figure}
\begin{prop}
The competitive ratio of SETF for minimizing the $\ell_2$ norm of flow time is $\Omega(n)$.
\end{prop}
\input{fcfs}
\subsection{Proof of Corollary~\ref{coro: beat}}\label{appendix: coro: beat}
By definition, $\tilde{n}$ is a $(\beta, \alpha)$-estimate with $\beta = n^{-\epsilon_1}$ and
$\alpha = n^{\epsilon_2}$. By Theorem~\ref{thrm: algo}, the competitive ratio of
$BAL(\tilde{n}^{\frac{2}{3}})$ for minimizing the $\ell_2$ norm of flow time
is
$O\left(\left(n^{\frac{\epsilon_1}{6}}+n^{\frac{\epsilon_2}{3}}\right) n^{\frac{1}{3}}\right)
=O\left(n^{\frac{1}{3} + \frac{1}{6} \max{(\epsilon_1, 2\epsilon_2)}} \right)$.
Let $c = \min{\left(\frac{1-\epsilon_1}{6}, \frac{1-2\epsilon_2}{6}\right)} > 0$.
Then \[\frac{1}{3} + \frac{1}{6} \max{(\epsilon_1, 2\epsilon_2)}
=\max{\left(\frac{\epsilon_1+2}{6}, \frac{2\epsilon_2+2}{6}\right)}
=\max{\left(\frac{1}{2}-\frac{1-\epsilon_1}{6}, \frac{1}{2}-\frac{1-2\epsilon_2}{6}\right)}
=\frac{1}{2}-c.\]
\subsection{A Lower Bound Instance for the Priority-Based Scheduling Algorithm} \label{appendix: pri}
In this subsection, we give a lower bound instance for the priority-based
scheduling algorithm mentioned in Section~\ref{subsec: related}.
Specifically, in every time slot $[t]$, the algorithm executes a task of
the job that has the highest priority at time $t$,
where the priority of a job $J_i$ at time $t$
is defined as
$\frac{t-r_i}{\text{remaining processing time of $J_i$ at time $t$}}$.
The lower bound instance is parameterized by an integer $k$.
There are $k+1$ different classes of jobs, $C_0, C_1, \cdots, C_{k}$.
Every job in $C_h$ has a processing time of $P_h = 2^{k-h}$.
$C_0$ has two jobs, and both of them are released at time 0.
All the job classes other than $C_0$ have the same total processing time of $X = 5 \cdot 2^k$.
Let $R_{h,i}$ be the release time of the $i$th job in $C_h$.
We set $R_{0,1} = 0$ and $R_{1,1} = 2^k$.
For any $2 \leq h \leq k$, $R_{h,1} = R_{h-1,1}+X$.
For every $1 \leq h \leq k$, and $2 \leq i \leq \frac{X}{P_h}$, we set $R_{h,i} = R_{h,i-1}+P_h$.
Observe that if we remove one job in $C_0$, then every job can be executed once it is released.
Fig.~\ref{fig: exPRI} shows the lower bound instance when $k = 3$.
\begin{figure}[!h]
\begin{center}
\includegraphics[width=\textwidth]{PRI}
\caption{A lower bound instance of the priority-based scheduling algorithm when $k=3$.}
\label{fig: exPRI}
\end{center}
\end{figure}
We first consider the schedule obtained by SRPT. Under SRPT, the last completed job is from $C_0$,
and every other job can be executed once it is released. Thus,
$F(\mathcal{SRPT}) = (P_0)^2+(kX+2P_0)^2 + \sum_{h=1}^{k}{(\frac{X}{P_h} \cdot P_h^2)}
= O(k^2X^2) = O(k^2 2^{2k})$.
Let $\mathcal{S}$ be the schedule obtained by the priority-based scheduling algorithm.
We have the following claim, whose proof is postponed to the end of this subsection.
\begin{claim}\label{claim: PRI}
For any $2 \leq h \leq k$, at time $R_{h,1}$ under $\mathcal{S}$,
one active job is from $C_{h}$,
and all the other active jobs are from $C_{h-1}$.
Moreover, the total remaining processing time of the jobs from $C_{h-1}$ at time $R_{h,1}$
under $\mathcal{S}$ is $2^k$.
\end{claim}
By Claim~\ref{claim: PRI}, at time $R_{k, 1}$ under $\mathcal{S}$,
there are $\frac{2^k}{2^1}$ active jobs in $C_{k-1}$.
Clearly, all these jobs have flow times of $\Omega(2^k)$ under $\mathcal{S}$.
Thus, $F(\mathcal{S}) = \Omega(2^{3k})$.
Thus, \[
\frac{F(\mathcal{S})}{F(\mathcal{OPT})} \geq \frac{F(\mathcal{S})}{F(\mathcal{SRPT})}
= \Omega(\frac{2^k}{k^2}).\]
Finally, observe that $n=\Theta(2^k)$. We then have the following
result.
\begin{prop}
The competitive ratio of the priority-based scheduling algorithm
for minimizing the $\ell_2$ norm of flow time is $\Omega(\frac{n^{1/2}}{\log n})$.
\end{prop}
\subsubsection*{Proof of Claim~\ref{claim: PRI}}
We prove the claim by induction on $h$. We first consider the case where $h = 2$.
Clearly, at time $2^k$, one job in $C_0$ is completed under $\mathcal{S}$.
In addition, $\mathcal{S}$ starts to execute the second job in $C_0$ at time $2^k$.
At time $2^k+2^k$, both jobs in $C_0$ are completed.
As a result, at time $R_{2, 1}$, one active job is from $C_{2}$,
and all the other active jobs are from $C_{1}$.
Observe that there is no idle time slot under $\mathcal{S}$ before all jobs are completed.
Moreover, if we remove one job in $C_0$, which has size $2^k$,
then every job can be executed once it is released.
Thus, for any $1 \leq h \leq k$, $1 \leq i \leq \frac{X}{P_h}$, at time $R_{h,i}$,
the total remaining processing time of active jobs is $2^k+P_h$.
Thus, at time $R_{2, 1}$ the total remaining processing time of jobs from $C_{1}$ is $2^k$.
This completes the proof for the induction basis.
Assume that the claim holds for $h = v$ for some $v \in [2, k-1]$.
We prove the claim also holds for $h = v+1$.
Let $\tau = R_{v, 1} + 3 \cdot 2^k$.
Let $T_v$ be the time interval between $\tau$ and $R_{v+1, 1} -1$.
By the induction hypothesis, during $T_v$ under $\mathcal{S}$,
all the active jobs are from $C_{v-1}$ and $C_{v}$,
and their total remaining processing time is at most $2^k+P_v$.
Observe that $\mathcal{S}$ always executes jobs in the same class following their releasing order.
Thus, during $T_v$, the age of any job in $C_v$ is at most $2^k+P_v$.
A job is said to be \textit{intact} if $\mathcal{S}$ has not executed any task of the job.
Therefore, during $T_v$, the priority of any intact job in $C_v$ is at most
$\frac{2^k+P_v}{p_v} =2^{v}+1$.
Next, we lower bound the priority of any active job in $C_{v-1}$ during $T_v$.
Clearly, the age of any active job in $C_{v-1}$ after time $\tau$ is at least
$3 \cdot 2^k$. Thus, the priority of any active job in $C_{v-1}$ during $T_v$
is at least $\frac{3 \cdot 2^k}{P_{v-1}} =
3 \cdot 2^{v-1} = 2^v + 2^{v-1}> 2^{v}+1$, where the
inequality follows from $v \geq 2$.
Thus, starting from time $\tau$, $\mathcal{S}$ cannot execute any intact
job in $C_v$ before all the jobs in $C_{v-1}$ are completed.
Clearly, at any time under $\mathcal{S}$, among all the active jobs from $C_v$,
at most one of them is not intact.
Thus, $\mathcal{S}$ can start to execute the remaining jobs in $C_{v-1}$ before time $\tau + P_v$.
By the induction hypothesis, at time $\tau$,
the total remaining processing time of jobs from $C_{v-1}$ is at most $2^k$.
Thus, all the remaining jobs from $C_{v-1}$ can be completed before time $\tau + P_v + 2^k < R_{v+1, 1}$.
As a result, at time $R_{v+1, 1}$ under $\mathcal{S}$, one active job is from $C_{v+1}$,
and all the other active jobs are from $C_v$. By an argument similar to that for
the induction basis, the total remaining processing time of jobs from $C_v$ at time
$R_{v+1,1}$ under $\mathcal{S}$ is $2^k$.
Thus, the proof for the induction step is completed.
\section{A Lower Bound of the Competitive Ratio for Minimizing the $\ell_2$ Norm of Flow Time}\label{appendix: LB}
\begin{theorem}
Even if $n$ is known a priori, the competitive ratio of any randomized
algorithm for minimizing the $\ell_2$ norm of flow time
is $\Omega(n^{\frac{1}{10}})$.
\end{theorem}
The proof is based on the proof of~\cite[Theorem 1]{doi:10.1137/090772228}.
In~\cite{doi:10.1137/090772228}, Bansal and Pruhs use Yao's minimax principle,
and they give a distribution that has two possible instances, $\mathcal{I}_1$
and $\mathcal{I}_2$, where $\mathcal{I}_1$ has fewer jobs than $\mathcal{I}_2$.
In our proof, we simply add small dummy jobs to the end of $\mathcal{I}_1$
so that both instances have the same number of jobs.
\begin{proof}
Let $\mathcal{A}$ be any deterministic algorithm.
Without loss of generality, assume that $\mathcal{A}$ knows $n$ a priori.
We will give a distribution over two problem instances of the same number of jobs,
and show that $\mathcal{A}$ has a competitive ratio of $\Omega(n^{\frac{1}{10}})$
on average with respect to the distribution.
The proof then follows from Yao's minimax principle~\cite{yao}.
The inputs are parameterized by an integer $L$.
The two possible instances, denoted by $\mathcal{I}_1$ and $\mathcal{I}_2$, are identical before time $L^5$.
In addition, both instances have a probability of 0.5 to occur.
At time $0$, a large job $J_1$ with processing time $L^3$ arrives.
At time $t \in \{0, L^2, 2L^2, 3L^2, \cdots, (L^3-1)L^2\}$,
a medium job with processing time $L^2$ arrives.
Thus, there are $L^3$ medium jobs.
In $\mathcal{I}_1$, at time $t \in \{L^5+L^3, L^5+L^3+1, L^5+L^3+2, L^5+L^3+3, \cdots, 2L^5+L^3-1\}$,
a small job with unit processing time arrives.
In $\mathcal{I}_2$, at time $t \in \{L^5, L^5+1, L^5+2, L^5+3, \cdots, 2L^5-1\}$,
a small job with unit processing time arrives.
As a result, $n = 1+L^3+L^5 = \Theta(L^5)$ in both instances.
Let $t^* = L^5 - 1$.
Because $\mathcal{I}_1$ and $\mathcal{I}_2$ are identical before time $L^5$,
each instance still has a probability of 0.5 to occur at time $t^*$, even if $n$ is known.
Let $\mathcal{S}$ be the schedule obtained by $\mathcal{A}$. We divide the proof into two cases.
\noindent \textbf{Case 1: $\mathcal{A}$ does not finish $J_1$ by time $t^*$.}
Thus, $J_1$ has flow time $\Omega(L^5)$ and $F(\mathcal{S}) = \Omega((L^5)^2)$.
At time $t^*$, with probability 0.5, the instance is $\mathcal{I}_1$,
and we consider the schedule $\mathcal{FCFS}$ obtained by applying FCFS
to $\mathcal{I}_1$. It is easy to see that
$F(\mathcal{FCFS}) = \Theta((L^3)^2+((L^3)^2)L^3 + (1^2)L^5)=\Theta(L^9)$.
Therefore, in this case, $\mathcal{A}$'s average competitive ratio is
$\Omega(\sqrt{L})$.
\noindent \textbf{Case 2: $\mathcal{A}$ finishes $J_1$ by time $t^*$.}
In this case, $\mathcal{A}$ has to spend $\Theta(L^3)$ units of time on medium jobs after time $L^5$.
At time $t^*$, with probability 0.5, the instance is $\mathcal{I}_2$,
and we consider the schedule $\mathcal{SRPT}$ obtained by applying SRPT to $\mathcal{I}_2$.
Clearly, $F(\mathcal{SRPT}) = \Theta(((L^2)^2)L^3 + (1^2)L^5 + (L^5)^2) = \Theta(L^{10})$.
We then consider $F(\mathcal{S})$ in the following two subcases:
\noindent \textbf{Case 2A: $\mathcal{S}$ spends at most $L^3/2$ units of time
on medium jobs between time $L^5$ and time $1.5L^5$.}
In this subcase, $\Omega(\frac{L^3/2}{L^2})$ medium jobs are not finished under $\mathcal{S}$ by time $1.5L^5$.
These medium jobs have flow time $\Omega(L^5)$, and thus
$F(\mathcal{S}) = \Omega((L^5)^2 \cdot L) = \Omega(L^{11})$.
Thus, in this subcase, $\mathcal{A}$'s average competitive ratio is $\Omega(\sqrt{L})$.
\noindent \textbf{Case 2B: $\mathcal{S}$ spends
more than $L^3/2$ units of time on medium jobs between
time $L^5$ and time $1.5L^5$.}
In this subcase, at time $1.5L^5$, at least $L^3/2$ small jobs have arrived but are not
finished under $\mathcal{S}$.
Let $S_{small}$ be the set of the small jobs that are not finished by time $1.5L^5$ under $\mathcal{S}$,
including the small jobs that arrive after time $1.5L^5$. Thus, $|S_{small}| = \Theta(L^5)$.
By a simple exchange argument, it can be shown that after time $1.5L^5$,
the best strategy for $\mathcal{A}$ to minimize
$\sum_{J_i \in S_{small}}{f_i(\mathcal{S})^2}$, which is a lower bound of $F(\mathcal{S})$,
is to execute jobs in $S_{small}$ in increasing order of their release times.
Therefore, each of these $\Theta(L^5)$ small jobs has flow time $\Omega(L^3)$.
As a result, $F(\mathcal{S}) = \Omega((L^3)^2 \cdot L^5) = \Omega(L^{11})$.
Thus, in this subcase, $\mathcal{A}$'s average competitive ratio is $\Omega(\sqrt{L})$.
Finally, because $L= \Theta(n^{1/5})$,
the average competitive ratio of $\mathcal{A}$ is $\Omega(n^{1/10})$ in all cases.
\end{proof}
\input{LB}
\section{Missing Proofs for Theorem~\ref{thrm: algo}: Lower Bounds of $F(\mathcal{OPT})$}
\label{appendix: thealgo}
\subsection{Proof of Lemma~\ref{lemma: preub}}\label{appendix: lemma: preub}
Let $I = \{i | pre(i) = 1, i \in [1,n]\}$.
Obviously, $\sum_{i \in I}{pre(i)^2} \leq F(\mathcal{OPT})$.
Thus, we only need to consider job indices that are not in $I$.
Let $i \in [1,n] \setminus I$.
Define $T_i = [r_i, t_i-1]$.
Note that because $i \notin I$, $t_i-1 > r_i$ and
\begin{equation}\nonumber
pre(i)^2 = O\left(\sum_{j=0}^{pre(i)-1}{j} \right)
= O\left(\sum_{t \in T_i}{(t-r_i)} \right).
\end{equation}
When $t \in T_i$, $\frac{t-r_i}{q_t(i)} < \tilde{n}^{\frac{2}{3}}$,
and thus $t-r_i < \tilde{n}^{\frac{2}{3}}q_t(i)$.
As a result, we have
\begin{equation}\nonumber
pre(i)^2 = O\left(\tilde{n}^{\frac{2}{3}}\right)\sum_{t \in T_i}{q_t(i)}.
\end{equation}
We then have
\begin{equation}\nonumber
\sum_{i \in [1, n] \setminus I}{pre(i)^2}
= O\left(\tilde{n}^{\frac{2}{3}}\right)\sum_{i \in [1, n] \setminus I}{\sum_{t \in T_i}{q_t(i)}}
\stackrel{\text{by Lemma~\ref{prop: LBQ}}}{=} O\left(\tilde{n}^{\frac{2}{3}}\right)F(\mathcal{OPT})
= O\left((\alpha n)^{\frac{2}{3}}\right)F(\mathcal{OPT}).
\end{equation}
\subsection{Proof of Lemma~\ref{lemma: LB2}}\label{appendix: lemma: LB2}
To derive a lower bound of $F(\mathcal{OPT})$,
we remove some tasks from the instance at time $t^*$
so that under $\mathcal{OPT}$,
every job $J_i$ has exactly $m_{\mathcal{OPT}}(i)$ remaining tasks at time $t^*$.
The above modification is achievable because $q_{t^*, \mathcal{OPT}} \succeq m_{\mathcal{OPT}}$.
Let $i^*$ be the smallest integer such that $m_{\mathcal{OPT}}(i^*) > 0$.
Further assume that starting from time $t^*$,
the goal of $\mathcal{OPT}$ becomes to minimize
\begin{equation}\label{eq: newgoal}
\sum_{i= i^*}^{n}{(c'_i(\mathcal{OPT})-t^*)^2},
\end{equation}
where $c'_i(\mathcal{OPT})$ is the completion time of $J_i$ under
$\mathcal{OPT}$ in the modified instance.
Observe that for all $i \geq i^*$, because $q_{t^*, \mathcal{OPT}}(i)
\geq m_{\mathcal{OPT}}(i) > 0$,
$J_i$'s original release time is at most $t^*$.
Thus, Eq.~\eqref{eq: newgoal} is a lower bound of $F(\mathcal{OPT})$.
By Eq.~\eqref{eq: reindex}, to
minimize Eq.~\eqref{eq: newgoal},
$\mathcal{OPT}$ should execute $J_{i^*}, J_{i^*+1}, \cdots, J_{n}$
in increasing order of their job indices.
Thus, for any $i \geq i^*$,
$c_i'(\mathcal{OPT})-t^* = \sum_{h=i^*}^{i}{m_{\mathcal{OPT}}(h)}$, which implies Lemma~\ref{lemma: LB2}.
\section{Missing Proofs for the First Shrinking Step (Lemma~\ref{lemma: 1stshrink})}
\label{appendix: lemma: 1stshrink}
To obtain the proper map $m_{\mathcal{BAL}}$,
we first shrink $\hat{q}_{t^*}$ to get an intermediate map $m_{INT}$,
and then shrink $m_{INT}$ to obtain $m_{\mathcal{BAL}}$.
\subsection{Construct $m_{INT}$ by Shrinking $\hat{q}_{t^*}$}
The intermediate map $m_{INT}$ satisfies $S(m_{INT}) = q(t^*)$.
Moreover, during the process of shrinking $\hat{q}_{t^*}$,
we preserve $\hat{q}_{t^*}(i)$ as much as possible if $\hat{q}_{t^*}(i)$ is relatively large.
To formalize the above idea, we first introduce the following definition,
which sorts the domain of a map
in decreasing order of their outputs.
\begin{definition}
Let $f$ be any map.
Define $\pi_f$ as a function that maps any $k \in [1, |\dom f|]$ to
the element in $\dom f$ that has the $k$th largest output of $f$
(ties can be broken arbitrarily).
Thus, $\dom f = \{ \pi_f(1), \pi_f(2), \cdots, \pi_f(|\dom f|)\}$
and
$f(\pi_f(1)) \geq f(\pi_f(2)) \geq \cdots \geq f(\pi_f(|\dom f|))$.
\end{definition}
Next, we define the the sum of the top-$k$ outputs of a map $f$.
\begin{definition}
Let $f$ be any map. Define
\begin{equation}\nonumber
S_k(f)=
\begin{cases}
0 & \mbox{if $k =0$}\\
\sum_{j=1}^{k}{f(\pi_f(j))} & \mbox{if $k \in [1, |\dom f|]$}\\
S(f) & \mbox{if $k > |\dom f|$}
\end{cases}
\end{equation}
\end{definition}
Given any integer $c \in [1, S(f)]$, the next definition shrinks $f$ to obtain a map
$f_{\langle c \rangle}$ such that $S(f_{\langle c \rangle}) = c$. Moreover, we
preserve the top-$k$ outputs of $f$ as much as possible.
\begin{definition}\label{defi: truncate}
Let $f$ be any map such that $S(f) \geq 1$.
Let $c$ be any integer in $[1, S(f)]$.
Let $lu(f,c)$ be the least integer such that $S_{lu(f,c)}(f) \geq c$.
The \textbf{truncation} of $f$ at $c$, denoted by $f_{\langle c \rangle}$,
is a map with domain $\dom f$ such that
\begin{equation}\nonumber
f_{\langle c \rangle}(\pi_f(k))=
\begin{cases}
f(\pi_f(k)) & \mbox{if $k \in [1, lu(f,c)-1]$}\\
c - S_{k-1}(f) & \mbox{if $k = lu(f,c)$}\\
0 & \mbox{if $k \in [lu(f,c)+1, |\dom f|]$}
\end{cases}
\end{equation}
Finally, $f_{\langle c \rangle}$ is said to be a valid truncation if $c \in [1, S(f)]$.
\end{definition}
\begin{example}
Assume $f(i) = 10i$ and $\dom f = [1, 10]$.
We then have $S_3(f) = 100+90+80 = 270$ and
$S_4(f) = 100+90+80+70 = 340$.
If $c = 300$, then $lu(f,c) = 4$,
$f_{\langle c \rangle}(10) = 100, f_{\langle c \rangle}(9) = 90,
f_{\langle c \rangle}(8) = 80$, and $f_{\langle c \rangle}(7) = 30$.
For all $i \in [1, 6]$, $f_{\langle c \rangle}(i) = 0$.
\end{example}
We have the following simple fact.
\begin{fact}\label{fact: propTR}
Let $f_{\langle c \rangle}$ be a valid truncation. Then $f_{\langle c \rangle}$ is a map.
Moreover, $S(f_{\langle c \rangle}) = c$ and $f_{\langle c \rangle} \preceq f$.
\end{fact}
\begin{claim}\label{claim: TRValid}
Let $f = \hat{q}_{t^*}$. Then $f_{\langle q(t^*) \rangle}$ is
a valid truncation.
\end{claim}
\begin{proof}
By the definition of $\hat{q}_{t^*}$, $\hat{q}_{t^*}$ is a map.
Because $1 \leq u(t^*) \leq q(t^*) = S(q_{t^*}) \leq S(\hat{q}_{t^*}) = S(f)$,
we have $q(t^*) \in [1, S(f)]$.
\end{proof}
By the above claim, we then set $m_{INT} = f_{\langle q(t^*) \rangle}$,
where $f = \hat{q}_{t^*}$.
\subsection{Construct $m_{\mathcal{BAL}}$ by Shrinking $m_{INT}$}
Let $I_S = \{i | \text{$J_i$ becomes starving by time $t^*$}\}$.
To construct $m_{\mathcal{BAL}}$, the next lemma shrinks $m_{INT}$
by zeroing out all the outputs of the elements not in $I_S$.
\begin{lemma}\label{lemma: _1stshrink}
Let $f = \hat{q}_{t^*}$ and $m_{INT} = f_{\langle q(t^*) \rangle}$.
Define
\begin{equation}\label{eq: defimalg}
m_{\mathcal{BAL}}(i)=
\begin{cases}
m_{INT}(i) &\mbox{if } i \in I_S\\
0 &\mbox{if } i \in [1,n] \setminus I_S\\
\end{cases}
\end{equation}
Then $m_{\mathcal{BAL}}$ is a proper map such that $m_{\mathcal{BAL}} \preceq m_{INT}$.
\end{lemma}
\begin{proof}
By Claim~\ref{claim: TRValid} and Fact~\ref{fact: propTR},
$m_{INT}$ is non-negative. Thus, $m_{\mathcal{BAL}} \preceq m_{INT}$.
To prove that $m_{\mathcal{BAL}}$ is a proper map, it suffices to prove the following two inequalities:
\begin{equation}\label{eq: 1shrinkinga}
\sum_{i=1}^{n}{q_{t_i}(i)^2} \geq \sum_{i \in I_S}{m_{INT}(i)^2}
\end{equation}
and
\begin{equation}\label{eq: 1shrinkingb}
\sum_{i \in I_S}{m_{INT}(i)} \geq u(t^*).
\end{equation}
\subparagraph*{Proof of Eq.~\eqref{eq: 1shrinkinga}.}
By Claim~\ref{claim: TRValid} and Fact~\ref{fact: propTR},
we have $m_{INT} \preceq f = \hat{q}_{t^*}$.
Thus,
\begin{equation}\nonumber
\sum_{i=1}^{n}{q_{t_i}(i)^2}
\geq \sum_{i \in I_S}{q_{t_i}(i)^2}
= \sum_{i \in I_S}{\hat{q}_{t^*}(i)^2}
\geq \sum_{i \in I_S}{m_{INT}(i)^2}.
\end{equation}
\subparagraph*{Proof of Eq.~\eqref{eq: 1shrinkingb}.}
Let $I_{N} = A(t^*, \mathcal{BAL}) \setminus I_S$.
Observe that for every $i \in I_{N}$, $q_{t^*}(i) = \hat{q}_{t^*}(i)$.
We then have
\begin{equation}\label{eq: 1shrinkingb1}
q(t^*)
= u(t^*) + \sum_{i \in I_{N}}{q_{t^*}(i)}
= u(t^*) + \sum_{i \in I_{N}}{\hat{q}_{t^*}(i)}
\geq u(t^*) + \sum_{i \in I_{N}}{m_{INT}(i)}.
\end{equation}
In addition, we have
\begin{equation}\label{eq: 1shrinkingb2}
q(t^*) = S(f_{\langle q(t^*) \rangle}) = S(m_{INT})
= \sum_{i \in I_S}{m_{INT}(i)}
+ \sum_{i \in I_{N}}{m_{INT}(i)},
\end{equation}
where the last equality holds because $\hat{q}_{t^*}(i) = 0$
if $i \notin I_S \cup I_N$.
Combining Eq.~\eqref{eq: 1shrinkingb1} and Eq.~\eqref{eq: 1shrinkingb2},
we then have $\sum_{i \in I_S}{m_{INT}(i)} \geq u(t^*)$.
\end{proof}
Observe that because $m_{INT} = f_{\langle q(t^*) \rangle} \preceq f = \hat{q}_{t^*}$,
we have $m_{INT} \preceq \hat{q}_{t^*}$, which combined with Lemma~\ref{lemma: _1stshrink}
proves Lemma~\ref{lemma: 1stshrink}.
\section{Missing Proofs for the Second Shrinking Step (Lemma~\ref{lemma: 2ndshrink})}
\label{appendix: lemma: 2ndshrink}
We first prove the following lemma, which is due to Line~12 of Algorithm~\ref{algo}.
\begin{lemma}\label{lemma:algfrf}
For any $t \in \mathbb{N}$,
$q_{t, \mathcal{SRPT}} \preceq \hat{q}_t$.
\end{lemma}
\begin{proof}
It suffices to show that for all $i \in [1, n]$, $q_{t, \mathcal{SRPT}}(i) \leq \hat{q}_t(i)$.
\subparagraph*{Case 1: $J_i$ is an FaN job or $J_i$ is an FaS job with $t_i \geq t$.}
In this case, by Line 12 of Algorithm~\ref{algo},
for any $t' < t$, if $\mathcal{BAL}$ executes a task $J_{i,k}$ in time slot $[t']$,
then it must be the case that $\mathcal{SRPT}$ executes $J_{i,k}$ in some
time slot $[t'']$ with $t'' \leq t'$.
Thus, $q_{t, \mathcal{SRPT}}(i) \leq q_t(i) = \hat{q}_t(i)$.
\subparagraph*{Case 2: $J_i$ is an FaS job with $t_i < t$.}
In this case, we have
$\hat{q}_t(i)
= q_{t_i}(i)
\geq q_{t_i, \mathcal{SRPT}}(i)
\geq q_{t, \mathcal{SRPT}}(i)$.
\end{proof}
We use Lemma~\ref{lemma: TR123} to shrink $q_{t^*, \mathcal{SRPT}}$.
Because Lemma~\ref{lemma: TR123} is a simple result of Lemma~\ref{lemma: S1S2},
we give the proof of Lemma~\ref{lemma: TR123} after we prove Lemma~\ref{lemma: S1S2}.
\begin{lemma} \label{lemma: TR123}
Let $f$ and $g$ be any two maps that satisfy the following two constraints:
\begin{description}
\item[T1:] $g \preceq f$
\item[T2:] $S(g) \geq 1$
\end{description}
Then $f_{\langle S(g)\rangle}$ is a valid truncation.
Moreover, for any map $f' \preceq f_{\langle S(g)\rangle}$,
there exists a map $g'$ such that
$g' \preceq g$ and $f' \leadsto g'$.
\end{lemma}
\subsection*{Proof of Lemma~\ref{lemma: 2ndshrink}}
Consider Lemma~\ref{lemma: TR123} and fix $f = \hat{q}_{t^*}$,
$f' = m_{\mathcal{BAL}}$,
and $g = q_{t^*, \mathcal{SRPT}}$.
By Lemma~\ref{lemma:algfrf}, T1 holds.
T2 holds because $S(g) = q(t^*) \geq u(t^*) \geq 1$.
By Lemma~\ref{lemma: _1stshrink},
$f' = m_{\mathcal{BAL}} \preceq m_{INT} = f_{\langle q(t^*) \rangle} = f_{\langle S(g)\rangle}$.
By Lemma~\ref{lemma: TR123}, $g'$ is the desired map $m_{\mathcal{SRPT}}$.
\section{Missing Proofs for the Third Shrinking Step
(Lemma~\ref{lemma: FRFt} and Lemma~\ref{lemma: S1S2})}\label{appendix: lemma: 3rdshrink}
\subsection{The Definition of Majorization and Some Simple Properties About $S_k$}
Recall that informally, if map $f$ majorizes map $g$, then for any positive integer $k$, the sum of the
top-$k$ outputs of $f$ is at least that of $g$. Next,
we formally define the notion of majorization.
\begin{definition}
For any two maps $f$ and $g$, we say that $f$ majorizes $g$
if the following two conditions are satisfied.
\begin{itemize}
\item $S(f) = S(g)$
\item $S_k(f) \geq S_k(g), \forall k \in \mathbb{N}$
\end{itemize}
\end{definition}
\begin{remark}
The notion of majorization is first studied by Hardy et al.~\cite{hardy},
and Golovin et al. use majorization to study all symmetric norms
of flow time~\cite{golovin_et_al:LIPIcs:2008:1753}.
The original definition of majorization deals with vectors instead of maps.
For example, in~\cite{golovin_et_al:LIPIcs:2008:1753}, the notion
of majorization is applied to vectors consisting of the flow time of all jobs.
In this paper, we do not directly consider the flow time.
Instead, we consider the number of remaining tasks of active jobs.
In addition, we will consider the restriction of a map to some subset of $[1,n]$
(e.g., $A(t, \mathcal{SRPT})$, the index set of the
active jobs under $\mathcal{SRPT}$ at time $t$) in the proof of
Lemma~\ref{lemma: FRFt}.
Thus, we use maps instead of vectors.
\end{remark}
To prove Lemma~\ref{lemma: FRFt},
we will consider the restriction of some map $f$ to some subset of $\dom f$.
Specifically, for any map $f$ and any set $S \subseteq \dom f$,
the restriction of $f$ to $S$, denoted by $f|_S$, is a map
from $S$ to $\mathbb{N}$ such that $f|_S(i) = f(i)$ for any $i \in S$.
The following definition adds an element $x$ and its associated output $y$ to a map $f$.
\begin{definition}
For any map $f$, any $x \notin \dom f$,
and any $y \in \mathbb{N}$,
define $f \cup (x, y): \dom f \cup \{x\} \rightarrow \mathbb{N}$
as a map such that $(f \cup (x, y))(i) = f(i)$
if $i \in \dom f$ and $(f \cup (x, y))(x) = y$.
\end{definition}
\noindent The following definition considers the union of two disjoint maps.
\begin{definition}
For any two maps $f$ and $h$ such that
$\dom f \cap \dom h = \varnothing$,
define $f \cup h: \dom f \cup \dom h \rightarrow \mathbb{N}$
as a map such that
$(f \cup h)|_{\dom f} = f$ and $(f \cup h)|_{\dom h} = h$.
\end{definition}
\begin{example}
Assume $f(1) = 1$, $f(2) = 2$, $h(3) = 3$, and $h(4) = 4$.
Further assume $\dom f = \{1, 2\}$ and $\dom h = \{3, 4\}$.
We then have $\dom (f \cup h) = \{1, 2, 3, 4\}$ and
$(f \cup h)(1) = 1, (f \cup h)(2) = 2, (f \cup h)(3) = 3$,
and $(f \cup h)(4) = 4$.
\end{example}
\begin{claim}\label{lemma: union}
Let $f$ and $g$ be any two maps such that $S_k(f) \geq S_k(g)$ for any
$k \in \mathbb{N}$.
Let $x \notin (\dom f \cup \dom g)$.
Then for any $k, y \in \mathbb{N}$,
$S_k(f \cup (x,y)) \geq S_k(g \cup (x,y))$.
\end{claim}
\begin{proof}
Assume that in $\dom f$ (respectively, $\dom g$), there are $p_f$
(respectively, $p_g$) elements $i$ satisfying $f(i) \geq y$
(respectively, $g(i) \geq y$).
\subparagraph*{Case 1: $p_f \leq p_g$.}
\begin{itemize}
\item If $k \leq p_g$,
then $S_k(f \cup (x,y)) \geq S_k(f)
\geq S_{k}(g) = S_k(g\cup (x,y))$.
\item If $k \geq p_g+1$,
then $S_k(f \cup (x,y))
= S_{k-1}(f)+y \geq S_{k-1}(g)+y
= S_k(g\cup (x,y))$.
\end{itemize}
\subparagraph*{Case 2: $p_g < p_f$.}
\begin{itemize}
\item If $k \leq p_g$,
then $S_k(f\cup (x,y)) = S_k(f)
\geq S_k(g) = S_k(g \cup (x,y))$.
\item If $p_g+1 \leq k \leq p_f$,
then $S_k(f\cup (x,y))
= S_k(f)
\geq S_{p_g}(f)+y(k-p_g)
\geq S_{p_g}(g)+y(k-p_g)
\geq S_k(g \cup (x,y))$.
\item If $k \geq p_f+1$,
then $S_k(f\cup (x,y)) = S_{k-1}(f)+y
\geq S_{k-1}(g)+y = S_k(g \cup (x,y))$.
\end{itemize}
\end{proof}
The following claim is a simple result of the above claim.
\begin{claim}\label{coro: topk}
Let $f$, $g$, and $h$ be any three maps such that
$\dom f \cap \dom h = \varnothing$,
$\dom g \cap \dom h = \varnothing$,
and $S_k(f) \geq S_k(g), \forall k \in \mathbb{N}$.
Then $S_k(f \cup h) \geq S_k(g \cup h), \forall k \in \mathbb{N}$.
\end{claim}
\begin{proof}
We prove Claim~\ref{coro: topk} by induction on $|\dom h|$.
When $|\dom h| = 1$, the claim holds due to Claim~\ref{lemma: union}.
Assume the claim holds when $|\dom h| = z$.
When $|\dom h| = z+1$, pick any $x \in \dom h$.
Consider the map $h' = h|_{\dom h \setminus \{x\}}$.
Thus, $|\dom h'| = z$ and by the induction hypothesis, we then have
$S_k(f \cup h') \geq S_k(g \cup h')$ for any $k \in \mathbb{N}$.
By Claim~\ref{lemma: union}, we then have
$S_k((f \cup h') \cup (x, h(x))) \geq S_k((g \cup h') \cup (x, h(x)))$
for any $k \in \mathbb{N}$.
The proof then follows from $(f \cup h') \cup (x, h(x)) = f \cup h$ and
$(g \cup h') \cup (x, h(x)) = g \cup h$.
\end{proof}
\subsection{Proof of Lemma~\ref{lemma: FRFt}}
The proof is by induction on $t$.
Clearly, the lemma holds when $t = 0$.
Assume that the lemma holds when $t = h$.
Thus,
\[
S_k(q_{h, \mathcal{SRPT}}|_{A(h, \mathcal{SRPT})}) \geq
S_k(q_{h, \mathcal{S}}|_{A(h, \mathcal{S})}),
\forall k \in \mathbb{N}.
\]
Because SRPT always executes the job with the least remaining tasks,
and $\mathcal{S}$ is work-conserving,
we then have
\[
S_k(q_{h+1, \mathcal{SRPT}}|_{A(h, \mathcal{SRPT})}) \geq
S_k(q_{h+1, \mathcal{S}}|_{A(h, \mathcal{S})}),
\forall k \in \mathbb{N}.
\]
Let $I_{h+1}$ be the index set of the jobs released at time $h+1$.
By Claim~\ref{coro: topk}, we then have
\[
S_k(q_{h+1, \mathcal{SRPT}}|_{A(h, \mathcal{SRPT}) \cup I_{h+1}}) \geq
S_k(q_{h+1, \mathcal{S}}|_{A(h, \mathcal{S}) \cup I_{h+1}}),
\forall k \in \mathbb{N},
\]
which implies
\[
S_k(q_{h+1, \mathcal{SRPT}}) \geq
S_k(q_{h+1, \mathcal{S}}),
\forall k \in \mathbb{N}.
\]
Finally, because both $\mathcal{SRPT}$ and $\mathcal{S}$ are
work-conserving, we have $S(q_{h+1, \mathcal{SRPT}}) =
S(q_{h+1, \mathcal{S}})$, which completes the proof.
\subsection{Proof of Lemma~\ref{lemma: S1S2}}\label{appendix: lemma: S1S2}
For any map $f$, we use $f^+$ to denote the restriction
of $f$ to $\{i| f(i) > 0\}$.
Let $d_{f} = |\dom f^+|$ and $d_{g} = |\dom g^+|$.
Because $f$ majorizes $g$, we have
\begin{equation}\nonumber
S_{d_g}(g^+)
= S(g^+)=S(f^+)>
S_{d_{f}-1}(f^+)
\geq S_{d_{f}-1}(g^+).
\end{equation}
Therefore, $d_g > d_f-1$ and thus
\begin{equation}\label{eq: dgdf}
d_{g} \geq d_{f}.
\end{equation}
We write $\dom f$ as $\{a_1, a_2, \cdots, a_{|\dom f|}\}$ such that
$f(a_1) \geq f(a_2) \geq f(a_3) \geq f(a_{|\dom f|})$.
Similarly, we write $\dom g$ as $\{b_1, b_2, \cdots, b_{|\dom g|}\}$ such that
$g(b_1) \geq g(b_2) \geq g(b_3) \geq g(b_{|\dom g|})$.
We divide $\dom f$ into three sets, $I_0$, $I_1$, and $I_2$,
where $I_0 = \dom f \setminus \dom f^+ = \{a_k| k \in [d_f+1, |\dom f|]\}$,
$I_1 = \{a_k | f'(a_k) \leq g(b_k), k \in [1, d_{f}]\}$, and
$I_2 = \{a_k | f'(a_k) > g(b_k), k \in [1, d_{f}]\}$.
Note that by Eq.~\eqref{eq: dgdf}, $b_k$ exists for any $k \in [1, d_{f}]$.
The proof proceeds as follows:
For $I_1$ (respectively, $I_2$), we will construct a map $g_1$ (respectively, $g_2$) that is dominated by $g$.
The desired map $g'$ will be constructed based on $g_1$ and $g_2$.
\subsubsection{Construction and Properties of $g_1$}
If $I_1 \neq \varnothing$, we construct a map $g_1$ dominated by $g$.
Initially, $g_1(i) = 0$ for all $i \in \dom g$.
For each $a_k \in I_1$, set $g_1(b_k)$ as $f'(a_k)$.
Thus, $g_1 \preceq g$.
In addition, we have
\begin{equation}\label{eq: m1A}
S(g_1) = \sum_{a_k \in I_1}{f'(a_k)}
\end{equation}
and
\begin{equation}\label{eq: m1B}
S(g_1^2) = \sum_{a_k \in I_1}{f'(a_k)^2}.
\end{equation}
\subsubsection{Construction of $g_2$}
If $I_2 \neq \varnothing$, we construct another map $g_2$ dominated by $g$.
Initially, $g_2(i) = 0$ for any $i \in \dom g$.
We rewrite $I_2$ as $\{a_{\kappa(1)}, a_{\kappa(2)}, \cdots, a_{\kappa(|I_2|)}\}$ so that
$\kappa(1) \leq \kappa(2) \leq \cdots \leq \kappa(|I_2|)$.
For brevity, for any positive integers $x$ and $y$ with
$x \leq y \leq d_g$, define
\begin{equation}\nonumber
S_{x,y}(g) = \sum_{k \in [x,y]}{g(b_k)}.
\end{equation}
Define $y(0) = \kappa(1)-1$.
The construction of $g_2$ proceeds in rounds.
In the $j$th ($j \in [1, |I_2|]$) round, we set
\begin{equation} \label{eq: xim2}
x(j) = \max{(\kappa(j), y(j-1)+1)}.
\end{equation}
We set $y(j)$ to be the smallest integer such that
\begin{equation} \label{eq: yim2}
S_{x(j),y(j)}(g) \geq \frac{f'(a_{\kappa(j)})}{2}.
\end{equation}
We then set
\begin{equation} \label{eq: m2setting}
g_2(b_k) = g(b_k), \forall k \in [x(j), y(j)].
\end{equation}
\begin{example}
Consider the maps $f$, $f'$, and $g$ shown in Fig.~\ref{fig: exmajor}.
We then have $I_2 = \{a_1, a_2, a_8\}$. Thus, $\kappa(1) = 1, \kappa(2) = 2, \kappa(3) = 8$.
\begin{enumerate}
\item In Round 1, we set $x(1) = \kappa(1) = 1$ and $y(1) = 3$.
Observe that \[\frac{f'(a_{\kappa(1)})}{2} \leq S_{x(1),y(1)}(g) < f'(a_{\kappa(1)}).\]
\item In Round 2, we set $x(2) = y(1)+1 = 4$ and $y(2) = 6$.
Observe that \[\frac{f'(a_{\kappa(2)})}{2} \leq S_{x(2),y(2)}(g) < f'(a_{\kappa(2)}).\]
\item In Round 3, we set $x(3) = \kappa(3) = 8$ and $y(3) = 9$.
Observe that \[\frac{f'(a_{\kappa(3)})}{2} \leq S_{x(3),y(3)}(g) < f'(a_{\kappa(3)}).\]
\end{enumerate}
\end{example}
\begin{figure}[h]
\begin{center}
\includegraphics[width=11cm]{major}
\caption{An example of $g_2$.}
\label{fig: exmajor}
\end{center}
\end{figure}
\subsubsection{Correctness of the Construction of $g_2$}
To prove the above construction is correct, it suffices to prove that in every round $j$,
$x(j)$ is valid (i.e., $x(j) \leq d_g$) and
$y(j)$ is valid (i.e., there exists $y(j)$ that satisfies Eq.~\eqref{eq: yim2}).
We first prove the following claim.
\begin{claim}\label{cl:xyleqf}
If $x(j)$ and $y(j)$ are valid,
then $S_{x(j), y(j)}(g) < f'(a_{\kappa(j)})$.
\end{claim}
\begin{proof}
First, we have
\begin{equation}\nonumber
f'(a_{\kappa(j)})
\stackrel{\text{by $a_{\kappa(j)} \in I_2$}}{>}
g(b_{\kappa(j)})
\stackrel{\text{by Eq.~\eqref{eq: xim2}}}{\geq}
g(b_{x(j)}).
\end{equation}
Thus, $S_{x(j), x(j)}(g) < f'(a_{\kappa(j)})$.
Moreover, for any $h \in [1, |\dom g|-1]$, we have $g(b_{h}) \geq g(b_{h+1})$.
Thus, if $S_{x(j), h}(g) < f'(a_{\kappa(j)})/2$, then $S_{x(j), h+1}(g) < f'(a_{\kappa(j)})$.
The proof then follows from the definition of $y(j)$.
\end{proof}
Next, we prove that the following statements
$\mathcal{X}(j)$ and $\mathcal{Y}(j)$ hold for any
$j \in [1, |I_2|]$ by induction on $j$:
\begin{description}
\item[$\mathcal{X}(j)$:] $x(j) \leq d_g$.
\item[$\mathcal{Y}(j)$:] $S_{x(j), d_g}(g) \geq \sum_{h=j}^{|I_2|}{f'(a_{\kappa(h)})}$.
\end{description}
Observe that $\mathcal{X}(j)$ and $\mathcal{Y}(j)$ imply that
$x(j)$ and $y(j)$ are valid, respectively.
When $j = 1$, $x(1) = \kappa(1) \leq d_f \leq d_g$. Thus, $\mathcal{X}(1)$
holds. In addition, we have
\begin{align*}
&S_{x(1), d_g}(g) = S_{\kappa(1), d_g}(g) =
S(g) - S_{\kappa(1)-1}(g)
\geq
S(f) - S_{\kappa(1)-1}(f)\\
&= \sum_{h = \kappa(1)}^{d_f}{f(a_h)}
\geq \sum_{h = \kappa(1)}^{d_f}{f'(a_h)}
\geq \sum_{h=1}^{|I_2|}{f'(a_{\kappa(h)})}.
\end{align*}
Thus, $\mathcal{Y}(1)$ holds.
Assume $\mathcal{X}(j)$ and $\mathcal{Y}(j)$ hold when $j = z$
for some $z \in [1, |I_2|-1]$.
To prove $\mathcal{X}(z+1)$ and $\mathcal{Y}(z+1)$ hold,
we first consider the case where $\kappa(z+1) \geq y(z)+1$.
In this case, $x(z+1) = \kappa(z+1) \leq d_f \leq d_g$.
Thus, $\mathcal{X}(z+1)$ holds.
In addition, we have
\begin{align*}
&S_{x(z+1), d_g}(g) = S_{\kappa(z+1), d_g}(g) =
S(g) - S_{\kappa(z+1)-1}(g)
\geq
S(f) - S_{\kappa(z+1)-1}(f)\\
&= \sum_{h = \kappa(z+1)}^{d_f}{f(a_h)}
\geq \sum_{h = \kappa(z+1)}^{d_f}{f'(a_h)}
\geq \sum_{h=z+1}^{|I_2|}{f'(a_{\kappa(h)})}.
\end{align*}
Thus, $\mathcal{Y}(z+1)$ holds.
Next, we consider the case where
$y(z)+1 > \kappa(z+1)$. Thus, $x(z+1) = y(z)+1$.
We have
\begin{align}
\nonumber &S_{x(z), d_g}(g)-S_{x(z), y(z)}(g)
\stackrel{\text{by $\mathcal{Y}(z)$}}{\geq}
\sum_{h=z}^{|I_2|}{f'(a_{\kappa(h)})} - S_{x(z), y(z)}(g)\\
\label{eq: xyvalid}
&\stackrel{\text{by Claim~\ref{cl:xyleqf}}}{>}
\sum_{h=z}^{|I_2|}{f'(a_{\kappa(h)})} - f'(a_{\kappa(z)})
= \sum_{h=z+1}^{|I_2|}{f'(a_{\kappa(h)})}.
\end{align}
Because $a_{\kappa(z+1)} \in I_2$, $f'(a_{\kappa(z+1)}) > 0$.
By Eq.~\eqref{eq: xyvalid},
$S_{x(z), d_g}(g)-S_{x(z), y(z)}(g) > 0$.
As a result, $d_g \geq y(z)+1=x(z+1)$ and
\begin{equation}\nonumber
S_{x(z+1), d_g}(g) = S_{y(z)+1, d_g}(g) = S_{x(z), d_g}(g)-S_{x(z), y(z)}(g)
\stackrel{\text{by Eq.~\eqref{eq: xyvalid}}}{>}
\sum_{h=z+1}^{|I_2|}{f'(a_{\kappa(h)})}.
\end{equation}
Thus, both $\mathcal{X}(z+1)$ and $\mathcal{Y}(z+1)$ hold.
By mathematical induction, $\mathcal{X}(j)$ and $\mathcal{Y}(j)$ hold
for any $j \in [1, |I_2|]$.
\subsubsection{Properties of $g_2$}
Clearly, $g_2$ is dominated by $g$.
By Eq.~\eqref{eq: xim2}, $[x(j), y(j)] \cap [x(j'), y(j')] = \varnothing$
if $j \neq j'$.
In addition, because we have $g_2(b_k) > 0$ only when $k \in [x(j), y(j)]$
for some $j \in [1, |I_2|]$,
we then have
\begin{equation}\label{eq: m2A}
S(g_2) = \sum_{j=1}^{|I_2|}{\sum_{k \in [x(j), y(j)]}{g_2(b_k)}}
\stackrel{\text{by Eq.~\eqref{eq: m2setting} and Eq.~\eqref{eq: yim2}}}{\geq}
\sum_{j=1}^{|I_2|}{\frac{f'(a_{\kappa(j)})}{2}}
= \frac{1}{2}\sum_{i \in I_2}{f'(i)}.
\end{equation}
In addition, we have
\begin{equation}\label{eq: m2B}
\sum_{i \in I_2}{f'(i)^2}
\stackrel{\text{by Claim~\ref{cl:xyleqf}}}{>}
\sum_{j=1}^{|I_2|}{S_{x(j), y(j)}(g)^2}
\stackrel{\text{by Eq.~\eqref{eq: m2setting}}}{=}
\sum_{j=1}^{|I_2|}{\left(\sum_{k \in [x(j), y(j)]}{g_2(b_k)}\right)^2}
\geq S(g_2^2).
\end{equation}
\subsubsection{Construction of $g'$ Based on $g_1$ and $g_2$}
If $\sum_{i \in I_1}{f'(i)} \geq \sum_{i \in I_2}{f'(i)}$, we set $g' = g_1$.
Otherwise, we set $g'=g_2$.
Because both $g_1$ and $g_2$ are dominated by $g$, $g' \preceq g$.
Observe that $S(f') = \sum_{i \in I_1}{f'(i)} + \sum_{i \in I_2}{f'(i)}$.
Thus, if $g' = g_1$, by Eq.~\eqref{eq: m1A}, we have
$S(g') = S(g_1) = \sum_{i \in I_1}{f'(i)} \geq \frac{1}{2}S(f')$.
By Eq.~\eqref{eq: m1B},
we have $S(f'^2) \geq \sum_{i \in I_1}{f'(i)^2} = S(g_1^2)
= S(g'^2)$.
Finally, if $g' = g_2$, by Eq.~\eqref{eq: m2A}, we have
$S(g') = S(g_2) \geq \frac{1}{2}\sum_{i \in I_2}{f'(i)} \geq \frac{1}{4}S(f')$.
By Eq.~\eqref{eq: m2B}, we have
$S(f'^2) \geq \sum_{i \in I_2}{f'(i)^2} > S(g^2_2) = S(g'^2)$.
Thus, $f' \leadsto g'$.
\subsection{Proof of Lemma~\ref{lemma: TR123}}
We prove Lemma~\ref{lemma: TR123} by Lemma~\ref{lemma: S1S2}.
First note that by T1, $S(g) \leq S(f)$.
Thus, by T2, $f_{\langle S(g)\rangle}$ is a valid truncation.
We will prove $f_{\langle S(g)\rangle}$ majorizes $g$.
The proof then follows by Lemma~\ref{lemma: S1S2}.
By Fact~\ref{fact: propTR}, $S(f_{\langle S(g)\rangle}) = S(g)$.
It is then sufficient to prove
\begin{equation}\label{eq: TRSMgoal}
S_k(f_{\langle S(g)\rangle}) \geq S_k(g), \forall k \in \mathbb{N}.
\end{equation}
To prove Eq.~\eqref{eq: TRSMgoal},
we consider the following two cases.
\subparagraph*{Case 1: $k \leq lu(f,S(g))-1$.}
The case where $k = 0$ is trivial. Thus, we assume $k \in [1, lu(f,S(g))-1]$.
By the definition of truncation, we have
\begin{equation}\nonumber
S_k(f_{\langle S(g)\rangle}) = S_k(f), \forall k \in [1, lu(f,S(g))-1].
\end{equation}
By T1,
\begin{equation}\nonumber
S_k(f) \geq S_k(g), \forall k \in [1, |\dom f|].
\end{equation}
Thus,
\begin{equation}\nonumber
S_k(f_{\langle S(g)\rangle}) \geq S_k(g),
\forall k \in [1, lu(f, S(g))-1].
\end{equation}
\subparagraph*{Case 2: $k \geq lu(f,S(g))$.}
In this case, we have
$S_k(f_{\langle S(g)\rangle}) = S(g) \geq S_k(g)$.
\input{num}
\end{appendices}
\subsection{Analysis of FCFS for Small $P$} \label{sec: fcfs2}
Let $p_{max} = \max_i{p_i}$, $p_{min} = \min_i{p_i}$, and $P = \frac{p_{max}}{p_{min}}$.
This subsection is devoted to prove the following result.
\begin{theorem}\label{thrm: fcfsP}
When $P = O(1)$, FCFS is $O(1)$-competitive
for minimizing the $\ell_2$ norm of flow time.
\end{theorem}
Clearly, the following theorem implies Theorem~\ref{thrm: fcfsP}.
\begin{theorem}\label{thrm: _fcfsP}
FCFS is $O(\sqrt{P})$-competitive
for minimizing the $\ell_2$ norm of flow time.
\end{theorem}
To prove Theorem~\ref{thrm: _fcfsP}, it suffices to prove
\begin{equation}\label{eq: thrm: fcfsPgoal}
\sum_{i=1}^{n}{f_i(\mathcal{FCFS})^2} = O(P)\sum_{i=1}^{n}{f_i(\mathcal{OPT})^2}.
\end{equation}
Observe that $f_i(\mathcal{S})^2 = \Theta\left(1+\sum_{t=r_i}^{c_i(\mathcal{S})-1}{(t-r_i)}\right)$.
For any set of job indices $\mathcal{J}$, define $Age_t(\mathcal{J})$ as $\sum_{i \in \mathcal{J}}{(t-r_i)}$.
Recall that $A(t, \mathcal{S})$ is the set of active job indices at time $t$ under schedule $\mathcal{S}$.\footnote{For simplicity, we say a job is in $A(t, \mathcal{S})$ if its index is in $A(t, \mathcal{S})$.}
Thus, for any schedule $\mathcal{S}$, we have
\[\sum_{i=1}^{n}{f_i(\mathcal{S})^2}
= \Theta\left(n+\sum_{i=1}^{n}{\sum_{t=r_i}^{c_i(\mathcal{S})-1}{Age_t(\{i\})}}\right)
= \Theta\left(n+\sum_{t \in \mathbb{N}}{Age_t(A(t, \mathcal{S}))}\right).\]
Therefore, to prove Eq.~\eqref{eq: thrm: fcfsPgoal}, it suffices to prove that for any time $t$,
\begin{equation}\label{eq: thrm: fcfsPgoal2}
Age_t(A(t, \mathcal{FCFS})) = O(P)Age_t(A(t, \mathcal{OPT})).
\end{equation}
For brevity, in the following proof, we omit the subscript $t$ in $Age_t$ and
the input $t$ in $A(t, \mathcal{S})$. We consider the following two cases.
\noindent \textbf{Case 1:} $A(\mathcal{OPT}) \setminus A(\mathcal{FCFS})
\neq \varnothing$.
Under FCFS, jobs are processed in increasing order of their release times.
Therefore, if $J_1$ is completed before $J_2$ under FCFS,
then $r_1 \leq r_2$ and $Age(\{1\}) = t-r_1 \geq t-r_2 = Age(\{2\})$.
We then have the following simple fact about FCFS.
\begin{fact} \label{fact: fcfsopt}
Let $J_1 \in A(\mathcal{OPT}) \setminus A(\mathcal{FCFS})$.
Let $J_2 \in A(\mathcal{FCFS}) \setminus A(\mathcal{OPT})$.
Then $Age(\{1\}) \geq Age(\{2\})$.
\end{fact}
We have the following lemma about non-preemptive and work-conserving schedules.
We postpone the proof to the end of this subsection.
Note that FCFS is non-preemptive and work-conserving, and $\mathcal{OPT}$ is work-conserving.
\begin{lemma}\label{lemma: sne}
Let $\mathcal{S}$ be any work-conserving schedule.
Let $\mathcal{S}_{NW}$ be any non-preemptive and work-conserving schedule.
If $A(\mathcal{S}) \setminus A(\mathcal{S}_{NW}) \neq \varnothing$,
then
\[|A(\mathcal{S}_{NW}) \setminus A(\mathcal{S})| = O(P)|A(\mathcal{S}) \setminus A(\mathcal{S}_{NW})|.\]
\end{lemma}
We are now ready to prove Eq.~\eqref{eq: thrm: fcfsPgoal2}.
\begin{align*}
Age(A(\mathcal{FCFS}))
&= Age(A(\mathcal{FCFS}) \cap A(\mathcal{OPT}))
+Age(A(\mathcal{FCFS}) \setminus A(\mathcal{OPT}))\\
&\leq Age(A(\mathcal{FCFS}) \cap A(\mathcal{OPT}))
+O(P)Age(A(\mathcal{OPT}) \setminus A(\mathcal{FCFS}))\\
&=O(P)Age(\mathcal{OPT}),
\end{align*}
where the inequality follows from Fact~\ref{fact: fcfsopt} and
Lemma~\ref{lemma: sne}.
\noindent \textbf{Case 2:} $A(\mathcal{OPT}) \setminus A(\mathcal{FCFS})
= \varnothing$. In other words, $A(\mathcal{OPT}) \subseteq A(\mathcal{FCFS})$.
Because FCFS is non-preemptive, at any time $t$,
there can be at most one job $J_h$ that is partially processed (i.e., FCFS has completed some, but not all,
tasks of $J_h$). We first consider the case where $J_h$ does not exist.
Thus, $\mathcal{FCFS}$ does not complete any task of the jobs
in $A(\mathcal{FCFS})$ by time $t$.
Because $A(\mathcal{OPT}) \subseteq A(\mathcal{FCFS})$ and
both $\mathcal{FCFS}$ and $\mathcal{OPT}$ are work-conserving,
we then have $A(\mathcal{OPT}) = A(\mathcal{FCFS})$.
Thus, Eq.~\eqref{eq: thrm: fcfsPgoal2} holds.
We then consider the case where $J_h$ exists.
Because $J_h$ is the only partially processed job at time $t$ under FCFS
and $A(\mathcal{OPT}) \subseteq A(\mathcal{FCFS})$,
\begin{equation}\label{eq: thrm: fcfsPcase21}
h \in A(\mathcal{OPT}).
\end{equation}
Because $J_h$ is partially processed by FCFS,
we then have
\begin{equation}\label{eq: thrm: fcfsPcase22}
Age(\{h\}) \geq Age(\{i\}), \forall i \in A(\mathcal{FCFS}).
\end{equation}
Assume that $\mathcal{FCFS}$ completes $y$ tasks of $J_h$ by time $t$.
Thus, $\mathcal{OPT}$ completes $y$ tasks of jobs in $A(\mathcal{FCFS})$
by time $t$. As a result, $\mathcal{OPT}$ completes at most
$\frac{y}{p_{min}} \leq P$ jobs in $A(\mathcal{FCFS})$ by time $t$.
Thus,
\begin{equation}\label{eq: thrm: fcfsPcase23}
|A(\mathcal{FCFS}) \setminus A(\mathcal{OPT})| \leq P.
\end{equation}
As a result,
\begin{align*}
Age(A(\mathcal{FCFS}))
= &Age(A(\mathcal{FCFS}) \cap A(\mathcal{OPT}))
+Age(A(\mathcal{FCFS}) \setminus A(\mathcal{OPT}))\\
\stackrel{\text{by Eq.~\eqref{eq: thrm: fcfsPcase22} and
Eq.~\eqref{eq: thrm: fcfsPcase23}}}{\leq}
&Age(A(\mathcal{FCFS}) \cap A(\mathcal{OPT}))
+P \cdot Age(\{h\})\\
\stackrel{\text{by Eq.~\eqref{eq: thrm: fcfsPcase21} }}{\leq}
&Age(A(\mathcal{FCFS}) \cap A(\mathcal{OPT}))
+P \cdot Age(A(\mathcal{OPT}))
=O(P)Age(\mathcal{OPT}).
\end{align*}
\subsection*{Proof of Lemma~\ref{lemma: sne}}
Let $z$ be the number of remaining tasks of jobs in $A(\mathcal{S}_{NW})$
at time $t$ under $\mathcal{S}_{NW}$. Because both schedules are work-conserving,
$z$ is also the number of remaining tasks of jobs in $A(\mathcal{S})$ at time $t$
under $\mathcal{S}$. We categorize the remaining tasks as follows.
\[z_{NW, I} = \mbox{the numbers of remaining tasks of jobs in }
A(\mathcal{S}_{NW}) \cap A(\mathcal{S}) \mbox{ at time } t \mbox{ under }
\mathcal{S}_{NW}\]
\[z_{NW, D} = \mbox{the numbers of remaining tasks of jobs in }
A(\mathcal{S}_{NW}) \setminus A(\mathcal{S}) \mbox{ at time } t \mbox{ under }
\mathcal{S}_{NW}\]
\[z_{I} = \mbox{the numbers of remaining tasks of jobs in }
A(\mathcal{S}) \cap A(\mathcal{S}_{NW}) \mbox{ at time } t \mbox{ under }
\mathcal{S}\]
\[z_{D} = \mbox{the numbers of remaining tasks of jobs in }
A(\mathcal{S}) \setminus A(\mathcal{S}_{NW}) \mbox{ at time } t \mbox{ under }
\mathcal{S}\]
Thus,
\begin{equation}\label{eq: lemma: sne1}
z= z_{NW,I}+z_{NW,D} = z_{I}+z_{D}.
\end{equation}
Clearly,
\begin{equation}\label{eq: lemma: sne2}
|A(\mathcal{S}) \setminus A(\mathcal{S}_{NW})|
\geq \lceil \frac{z_{D}}{p_{max}}\rceil.
\end{equation}
On the other hand, because $\mathcal{S}_{NW}$ is non-preemptive,
there is at most one
job in $A(\mathcal{S}_{NW})$ that is processed partially.
As a result,
\begin{equation}\label{eq: lemma: sne3}
|A(\mathcal{S}_{NW}) \setminus A(\mathcal{S})| \leq \lceil \frac{z_{NW,D}}{p_{min}}\rceil.
\end{equation}
Next, we establish the relationship between $z_{NW,D}$ and $z_{D}$.
Because $\mathcal{S}_{NW}$ is non-preemptive,
for any subset $\mathcal{J}$ of $A(\mathcal{S}_{NW})$,
at most one job in $\mathcal{J}$ is partially processed at time $t$ under $\mathcal{S}_{NW}$.
Let $\mathcal{J} = A(\mathcal{S}_{NW}) \cap A(\mathcal{S})$.
Thus, $z_{NW,I}
> \left( \sum_{i \in \mathcal{J}}{p_i} \right) - p_{max}
\geq z_{I} - p_{max}$.
This inequality together with Eq.~\eqref{eq: lemma: sne1} implies
\begin{equation}\label{eq: lemma: sne4}
z_{NW,D} < z_{D}+p_{max}.
\end{equation}
As a result,
\begin{align*}
|&A(\mathcal{S}_{NW}) \setminus A(\mathcal{S})|
\stackrel{\text{by Eq.~\eqref{eq: lemma: sne3}}}{\leq}
\lceil \frac{z_{NW,D}}{p_{min}}\rceil
\stackrel{\text{by Eq.~\eqref{eq: lemma: sne4}}}{\leq}
\lceil \frac{z_{D}+p_{max}}{p_{min}}\rceil
\leq \frac{z_{D}}{p_{min}} + \frac{p_{max}}{p_{min}} + 1 \\
&= \frac{P\cdot z_{D}}{p_{max}} + P + 1
\stackrel{\text{by Eq.~\eqref{eq: lemma: sne2}}}{\leq}
P|A(\mathcal{S}) \setminus A(\mathcal{S}_{NW})| + P + 1
=O(P)|A(\mathcal{S}) \setminus A(\mathcal{S}_{NW})|,
\end{align*}
where the last equality follows from the assumption that
$A(\mathcal{S}) \setminus A(\mathcal{S}_{NW}) \neq \varnothing$.
\begin{remark}
Recall that FCFS minimizes the maximum flow time. In fact, when
$P$ is small, FCFS is also good at minimizing the average flow time.
Specifically, we have the following theorem.
\end{remark}
\begin{theorem}
When $P = O(1)$, FCFS is $O(1)$-competitive
for minimizing the average flow time.
\end{theorem}
\begin{proof}
First note that minimizing the average flow time is equivalent to minimizing the total flow time.
We then prove it by simplifying the proof for Theorem~\ref{thrm: _fcfsP}.
In particular, the definition of $Age_t(\mathcal{J})$ becomes $|\mathcal{J}|$.
Observe that under the new definition, Eq.~\eqref{eq: thrm: fcfsPgoal2},
which can be proved similarly as before, implies the theorem.
\end{proof}
\section{Introduction}\label{sec: intro}
In job scheduling, the flow time of a job is the amount of time between job release and job completion.
In this paper, we consider two fundamental job scheduling problems
related to flow times: minimizing the average flow time (or equivalently, the total flow time)
and minimizing the maximum flow time.
In practice, the former concerns the system-wide Quality of Service (QoS), and
the latter concerns fairness.
Since optimizing the overall utility usually leads to unfairness, it should not be too
surprising to see that these two objectives may contradict each other.
Indeed, it is well-known that Shortest Remaining Processing Time (SRPT), which
minimizes the average flow time, may cause some large jobs to have long
and inequitable flow times (i.e., job starvation).
In contrast, First-Come-First-Served (FCFS), which minimizes the
maximum flow time~\cite{10.5555/314613.314715}, may deteriorate the average
flow time. We use the following two examples to illustrate the relationship between
SRPT and FCFS.
\begin{example}
In the instance shown in Fig.~\ref{fig: ex1}, jobs $J_1$ and $J_2$ are released
at time 1, and both have processing times of 2. All the other jobs $J_i$s
are released at time $i$ and have
unit processing times. Assume that under SRPT, $J_1$ is completed first.
Thus, $J_2$ is starving in the sense that it has to wait until all the other
jobs are completed. As a result, the maximum flow time under SRPT
is $\Theta(n)$. Under FCFS, however, the flow time of every job is only $O(1)$.
\end{example}
\begin{figure}[h]
\begin{center}
\includegraphics[width= 9.55 cm]{example1}
\caption{A bad instance for SRPT.}
\label{fig: ex1}
\end{center}
\end{figure}
\begin{example} Consider Fig.~\ref{fig: ex2}.
Compared with Fig.~\ref{fig: ex1},
the processing times of $J_1$ and $J_2$ in Fig.~\ref{fig: ex2} are increased
to $n$. Under FCFS, the flow time of every job is $\Theta(n)$.
Thus, FCFS's average flow time is $\Theta(n)$.
However, under SRPT, only $J_1$ and $J_2$ have
flow times of $\Theta(n)$,
and all the other jobs have flow times of $1$.
Thus, SRPT's average flow time is only $O(1)$.
\end{example}
\begin{figure}[h!]
\begin{center}
\includegraphics[width= 9.55 cm]{example2}
\caption{A bad instance for FCFS.}
\label{fig: ex2}
\end{center}
\end{figure}
Because both the average flow time and the maximum flow time
are fundamental and important job scheduling objectives, our goal is
to design an online scheduling algorithm that balances these two objectives.
To this end, a common approach
is to minimize the $\ell_2$ norm of flow time~\cite{doi:10.1137/090772228}.
Specifically, let $f_i(\mathcal{S})$ be the flow time of a job $J_i$ under schedule $\mathcal{S}$,
and let $n$ be the number of jobs.
Then the $\ell_2$ norm of flow time under schedule $\mathcal{S}$ is
\[
\sqrt{f_1(\mathcal{S})^2+f_2(\mathcal{S})^2+\cdots+f_n(\mathcal{S})^2}.
\]
For the problem of minimizing the $\ell_2$ norm of flow time,
there are offline approximation algorithms based on linear programming rounding~\cite{doi:10.1137/130911317,
doi:10.1137/19M1244512, doi:10.1137/1.9781611975482.96, doi:10.1137/18M1202451}.
For the online setting, only standard algorithms, including SRPT,
Shortest Job First (SJF), Shortest Execution Time First (SETF), and Round Robin (RR),
have been analyzed under speed augmentation~\cite{doi:10.1137/090772228,
10.1145/2755573.2755581}. Without speed augmentation, SRPT and FCFS have the same asymptotic
competitive ratio of $O(n^{1/2})$ for this problem
(refer to Appendix~\ref{appendix: SRPT_FCFS} for proof).\footnote{The competitive
ratio of an algorithm $\mathcal{A}$
for minimizing $obj$ is $\max_{\mathcal{I}}{\frac{obj(\mathcal{A}, \mathcal{I})}{obj(\mathcal{OPT},
\mathcal{I})}}$, where $obj(\mathcal{A}, \mathcal{I})$ is the objective
value achieved by algorithm $\mathcal{A}$ on problem instance $\mathcal{I}$,
and $\mathcal{OPT}$ is the optimal algorithm.
$\mathcal{A}$ is $c$-competitive if its competitive ratio is at most $c$.
In addition, $\mathcal{A}$ is $s$-speed $c$-competitive if it is $c$-competitive
when it is given a machine that is $s$ times faster than the original machine.}
No online algorithm is known to achieve a better competitive ratio than SRPT and FCFS.
Specifically, the lower bound instance of RR in~\cite{doi:10.1137/090772228} shows that RR's competitive
ratio is $\Omega(n^{1/2}/ \log{n})$.
Moreover, the competitive ratios of SJF and SETF are
$\Omega(n)$ (refer to Appendix~\ref{appendix: SJF} for proof).
\subsection{The Complementary Relationship Between SRPT and FCFS}
As mentioned earlier, SRPT and FCFS minimize the average flow time
and the maximum flow time, respectively.
SRPT and FCFS are in fact well suited for minimizing
the $\ell_2$ norm of flow time under different conditions.
Specifically, some empirical results indicate that when
the job size\footnote{In this paper, we use the terms job processing
time and job size interchangeably.}
distribution is heavy tailed, the fear that SRPT may cause starvation
is unfounded~\cite{10.1145/384268.378792, doi:10.1137/090772228,
biersack2007scheduling,
271492, 10.1007/3-540-45540-X_2, 10.1145/1125274.1125276}.
Moreover, in their seminal work, Bansal and Pruhs
proved that SRPT is $(1+\epsilon)$-speed $O(\frac{1}{\epsilon})$-competitive
for minimizing the $\ell_2$ norm of flow time for any
$\epsilon > 0$~\cite{doi:10.1137/090772228}.
In contrast, FCFS is not $(1+\epsilon)$-speed $O(\frac{1}{\epsilon})$-competitive
for minimizing the $\ell_2$ norm of flow time.
To see this, let $c > 1$ be any constant integer and consider the instance shown in
Fig.~\ref{fig: ex2}. By increasing the number of size-$n$ jobs released
at time 1 from 2 to $2c$, it can be shown that FCFS's competitive ratio
for minimizing the $\ell_2$ norm of flow time
is $\Omega(n^{1/2})$, even if it is given a machine that is $c$-times
faster than the original one.
Next, we discuss the condition that makes FCFS suitable for minimizing
the $\ell_2$ norm of flow time.
Let $P$ be the ratio of the maximum job processing time to
the minimum job processing time.
In Appendix~\ref{sec: fcfs2}, we show that when $P = O(1)$,
FCFS is $O(1)$-competitive for minimizing the $\ell_2$ norm of flow time.
SRPT, in contrast, is not $O(1)$-competitive
for minimizing the $\ell_2$ norm of flow time even if $P=O(1)$.
For example, the instance depicted in Fig.~\ref{fig: ex1} shows that
when $P=2$, SRPT's competitive ratio for minimizing the $\ell_2$
norm of flow time is $\Omega(n^{1/2})$.
The above discussion not only demonstrates the advantages of SRPT and FCFS,
it also shows that SRPT and FCFS may complement each other.
Thus, we wonder whether combining SRPT and FCFS can lead to
a better algorithm. We also aim to combine SRPT and FCFS in an
online fashion. This paper is therefore devoted to the following question:
\begin{question}\label{question}
Can combining SRPT and FCFS lead to a better online algorithm
for minimizing the $\ell_2$ norm of flow time?
\end{question}
\begin{remark}\label{remark: offline}
Because SRPT and FCFS complement each other, one may consider
the following algorithm: Run both SPRT and FCFS, and then
adopt the better one. However, this is fundamentally an offline algorithm.
Moreover, if the job size distribution varies with time,
neither SRPT nor FCFS should be used exclusively
throughout the course of scheduling.
\end{remark}
\subsection{Balancing SRPT and FCFS via Starvation Mitigation}
To answer Question~\ref{question}, we adopt the
following simple framework, which we refer to as starvation mitigation:
\begin{enumerate}
\item Initially, every job is \textit{normal}, and we follow SRPT.
\item If a job has been delayed for too long,
the job becomes \textit{starving}.
\item When there are starving jobs, process the job that becomes starving first;
\newline otherwise, follow SRPT.
\end{enumerate}
One of the technical challenges of this approach is carefully deciding the timing $t_i$ at which a job $J_i$
becomes starving. Intuitively, if the timing $t_i$ is earlier,
then the scheduling algorithm is more akin to FCFS.
In particular, if $t_i$ is set to the release time of $J_i$, then the algorithm becomes FCFS.
In contrast,
if the timing $t_i$ is later, then the scheduling algorithm is more
akin to SRPT.
In particular, if $t_i = \infty$, then the algorithm becomes SRPT.
We show in this paper that if $t_i$s are determined properly,
then the competitive ratio for minimizing the $\ell_2$ norm of flow time can be reduced significantly.
Next, we use Figs.~\ref{fig: ex1} and~\ref{fig: ex2} to explain our basic idea for
determining $t_i$. Note that for both instances,
we can assume that $J_1$ is completed first, and $J_3, J_4, \cdots, J_n$ are
completed in increasing order of their release times.
We therefore focus on $J_2$.
Let $r_i$ be the release time of $J_i$.
Define the \textbf{age} of $J_i$ at time $t$ as $t-r_i$.
Consider the instance shown in Fig.~\ref{fig: ex1},
and set $t_2$ to the time at which $J_2$'s age equals $\sqrt{n}$.
Then $J_2$ is completed at time $O(\sqrt{n})$.
As a result,
the flow time of $J_2$ is $O(\sqrt{n})$, and the flow times of other
jobs are $O(1)$. It is easy to see that this schedule minimizes the
$\ell_2$ norm of flow time (up to a constant factor).
We should not determine $t_i$ solely based on $J_i$'s age, however.
To see this, consider the instance shown in Fig.~\ref{fig: ex2},
where $J_2$'s processing time is increased from 2 to $n$.
If we still set $t_2$ to the time at which $J_2$'s age equals $\sqrt{n}$,
then the resulting schedule still behaves like FCFS, rather than the desired SRPT.
The above discussion suggests that to determine $t_i$, we should consider both the age and
the remaining processing time of $J_i$. In this paper, $t_i$ is the first time at which
\[
\frac{\text{age of $J_i$}}{\text{remaining processing time of $J_i$}}
\geq \theta,
\]
where $\theta \in \mathbb{R}^+$ is a fixed number (independent of $i$) to be specified later.
Intuitively, $\theta$ can be viewed as the threshold for becoming a starving job.
The complete description of the algorithm can be found in Algorithm~\ref{algo}.
In the remainder of the paper, we use $BAL(\theta)$ to denote the algorithm when the threshold
is set to $\theta$.
\paragraph*{Balancing Without Extra Speed}
Bansal and Pruhs proved that without speed augmentation, the competitive
ratio of every online scheduling algorithm for minimizing the $\ell_2$
norm of flow time is $\Omega(n^{1/10})$~\cite{doi:10.1137/090772228}.
They coped with the hardness
result by applying speed augmentation to SRPT. In hindsight,
the extra speed mitigates the starvation caused by SRPT.
In this paper, we mitigate the starvation caused by SRPT purely algorithmically with the help of FCFS.
Moreover, we do not analyze $BAL(\theta)$
under speed augmentation because
it allows us to compare $BAL(\theta)$ with SRPT and FCFS more transparently and
to answer Question~\ref{question} more fairly.
\subsection{Our Results}
In our first result, the setting of the threshold
$\theta$ for becoming a starving job is left to the system administrator.
The system administrator can balance the
system-wide QoS (i.e., average flow time) and the system-wide fairness
(i.e., maximum flow time) by fine-tuning the value of $\theta$.
Intuitively, the higher the threshold $\theta$ is,
the more important the system-wide QoS is;
the lower the threshold $\theta$ is,
the more important the system-wide fairness is.
Specifically, $BAL(0)$ and $BAL(\infty)$ are identical to FCFS and SRPT,
respectively. Recall that both SRPT and FCFS
are $O(n^{1/2})$-competitive for minimizing the $\ell_2$ norm of flow time.
Moreover, not every algorithm is $O(n^{1/2})$-competitive for minimizing the
$\ell_2$ norm of flow time.
For example, the competitive ratios of SJF and SETF are $\Omega(n)$.
The next theorem shows that, regardless of the setting of the threshold $\theta$,
$BAL(\theta)$ is $O(n^{1/2})$-competitive.
\begin{theorem}\label{thrm: algolb}
For any $\theta \geq 0$, $BAL(\theta)$ is $O(n^{1/2})$-competitive for minimizing
the $\ell_2$ norm of flow time.
\end{theorem}
In our second result, we assume that an estimate $\tilde{n}$ of the number of jobs $n$ is
available.\footnote{In Appendix~\ref{appendix: LB}, we slightly modify the proof
in~\cite{doi:10.1137/090772228} to show that the aforementioned $\Omega(n^{1/10})$
lower bound on the competitive ratio for minimizing the
$\ell_2$ norm of flow time holds even if $n$ is known a priori.}
For example, job scheduling is usually most critical during peak periods,
and the job arrival process is normally modeled as a Poisson process.
The product of the job arrival rate and the duration of
the peak period would therefore be a good estimate of $n$.
Nonetheless, in this study, we do not make any assumptions about the
job arrival process or the estimation method.
We instead assume that an estimate of $n$ is given with bounded error.
Specifically, for any $\beta$ and $\alpha$ that satisfy
$0 < \beta \leq 1 \leq \alpha$, $\tilde{n}$ is called a
$(\beta, \alpha)$-estimate of $n$ if $1 \leq \beta n \leq \tilde{n} \leq \alpha n$. (We follow the naming convention in~\cite{DBLP:conf/innovations/ScullyGM22},
where $\beta$ stands for ``below'' and $\alpha$ stands for ``above.'')
Our second result is obtained by setting the threshold $\theta$ to $\tilde{n}^{\frac{2}{3}}$.
\begin{theorem}\label{thrm: algo}
Let $\tilde{n}$ be a $(\beta, \alpha)$-estimate of $n$.
Then $BAL(\tilde{n}^{\frac{2}{3}})$ is $O\left(\left(\beta^{-\frac{1}{6}}+\alpha^{\frac{1}{3}}\right)
n^{\frac{1}{3}}\right)$-competitive for minimizing the $\ell_2$ norm of flow time.
\end{theorem}
Theorem~\ref{thrm: algo} implies that $BAL(n^{\frac{2}{3}})$ is
$O(n^{\frac{1}{3}})$-competitive for minimizing the $\ell_2$ norm of flow time.
Prior to this work, no known online algorithm had achieved a
competitive ratio better than $O(n^{1/2})$.
The following corollary of Theorem~\ref{thrm: algo}
shows that even if $\tilde{n}$ is a loose estimate of $n$,
$BAL(\tilde{n}^{\frac{2}{3}})$ can still achieve a
competitive ratio better than $O(n^{1/2})$.
The proof of Corollary~\ref{coro: beat} can be found in Appendix~\ref{appendix: coro: beat}.
We stress that Theorem~\ref{thrm: algolb} guarantees that,
regardless of the quality of
the estimate $\tilde{n}$, $BAL(\tilde{n}^{\frac{2}{3}})$ is
$O(n^{1/2})$-competitive for minimizing the $\ell_2$ norm of flow time.
\begin{coro}\label{coro: beat}
Let $\epsilon_1$ and $\epsilon_2$ be two constants such that $0 \leq \epsilon_1 < 1$ and
$0 \leq \epsilon_2 < \frac{1}{2}$.
Let $\tilde{n}$ be an estimate of $n$ such that $n^{1-\epsilon_1} \leq \tilde{n} \leq n^{1+\epsilon_2}$.
Then the competitive ratio of $BAL(\tilde{n}^{\frac{2}{3}})$ for minimizing the $\ell_2$ norm of flow time
is $O\left(n^{\frac{1}{3}+\frac{1}{6}\cdot\max{(\epsilon_1, 2\epsilon_2)}}\right)
= O\left(n^{\frac{1}{2}-c}\right)$, where $c > 0$ is some constant dependent upon $\epsilon_1$ and $\epsilon_2$.
\end{coro}
\subsection{Take-Away Messages From the Numerical Study}
In Appendix~\ref{sec: sim}, we compare $BAL(\theta)$ to SRPT, FCFS, and RR
numerically when the job arrival process is a Poisson process with
arrival rate $\lambda$ and the job sizes follow Bounded Pareto distributions.
It has been shown that many job size distributions in different computing systems
are well-modeled by Bounded Pareto distributions~\cite{10.1145/378420.378792}.
Recall that $P$ is the ratio of the maximum job processing time to
the minimum job processing time.
We use Bounded Pareto distributions to generate distributions with
large $P$, which are well-suited for SRPT,
and distributions with small $P$, which are well-suited for FCFS.
Define $\rho$ as the product of the average job size and
the job arrival rate. Thus, $\rho$ can be viewed as the load of the system,
and we vary $\rho$ from 0.5 to 2. We schedule jobs that arrive between time
0 and time $2^{20}$. Thus, we set $\tilde{n} = 2^{20} \lambda$.
The following are the take-away messages from the numerical study.
\subparagraph*{1. When $\rho \leq 1$, $BAL(\tilde{n}^{\frac{2}{3}})$ is
almost identical to SRPT.} When $\rho \leq 1$, only a few jobs are categorized
as starving jobs under $BAL(\tilde{n}^{\frac{2}{3}})$.
Thus, $BAL(\tilde{n}^{\frac{2}{3}})$
and SRPT have almost the same performance when $\rho \leq 1$.
To better exploit the starvation mitigation mechanism,
we can decrease $\theta$. Specifically,
the numerical results show that $BAL(\tilde{n}^{\frac{1}{3}})$ is
better than $BAL(\tilde{n}^{\frac{2}{3}})$ when $\rho \leq 1$.
Before we state the second take-away message,
recall the $\Omega(n^{1/10})$ lower bound established
in~\cite{doi:10.1137/090772228}.
Bansal and Pruhs implicitly proved that this lower bound holds
even if the optimal algorithm is restricted to choosing between the schedules
obtained by SRPT or FCFS. Like $BAL(\theta)$, this restricted optimal
algorithm can also be viewed as a combination of SRPT and FCFS.
Indeed, this restricted optimal algorithm is the offline
algorithm mentioned in Remark~\ref{remark: offline}, and
its superiority is readily demonstrated by the lower bound in~\cite{doi:10.1137/090772228}.
The superiority and the offline nature of this
restricted optimal algorithm thus inspire us to
study Question~\ref{question} in the quest for an effective online replacement.
We are now ready to state the second and most important take-away message.
\subparagraph*{2. When $\rho > 1$, $BAL(\tilde{n}^{\frac{2}{3}})$
is an effective replacement for the restricted
optimal algorithm.} When $\rho > 1$, the system is overloading.
Note that the performance of a scheduling algorithm under overloading is
an important factor in determining the goodness of
the algorithm~\cite{10.1145/378420.378792}.
When the system is overloading, the starvation mitigation
mechanism kicks in under $BAL(\tilde{n}^{\frac{2}{3}})$.
Specifically, we provide the following results:
\begin{itemize}
\item When $P$ is large and $\rho > 1$,
$BAL(\tilde{n}^{\frac{2}{3}})$ preserves the advantage of SRPT.
$BAL(\tilde{n}^{\frac{2}{3}})$
may in fact perform slightly better than SRPT.
As a result, $BAL(\tilde{n}^{\frac{2}{3}})$ outperforms RR and FCFS.
\item When $P$ is small and $\rho > 1$, $BAL(\tilde{n}^{\frac{2}{3}})$ preserves
the advantage of FCFS. $BAL(\tilde{n}^{\frac{2}{3}})$
may in fact perform slightly better than FCFS.
As a result, $BAL(\tilde{n}^{\frac{2}{3}})$ outperforms RR and SRPT.
\end{itemize}
We remark that the numerical results show that $BAL(\tilde{n}^{\frac{1}{3}})$
and $BAL(\tilde{n})$ are not effective replacements for the restricted
optimal algorithm when $\rho > 1$. Thus, like Theorem~\ref{thrm: algo}, this result suggests
setting $\theta$ to $\tilde{n}^{\frac{2}{3}}$.
\subsection{Related Work}\label{subsec: related}
In their seminal work, Bansal and Pruhs introduced
the online problem of minimum $\ell_p$ norm of flow
time~\cite{doi:10.1137/090772228}. They proved that
SRPT and SJF are $(1+\epsilon)$-speed $O(\frac{1}{\epsilon})$-competitive
and SETF is $(1+\epsilon)$-speed $O(\frac{1}{\epsilon^{2+2/p}})$-competitive~\cite{doi:10.1137/090772228}.
The results are further extended to all symmetric norms of
flow time~\cite{golovin_et_al:LIPIcs:2008:1753} and identical
machines~\cite{10.1145/1007352.1007411,
10.5555/2133036.2133046}.
Moreover, Im et al. showed that RR is $O(1)$-speed $O(1)$-competitive for the $\ell_2$
norm of flow time~\cite{10.1145/2755573.2755581}.
In~\cite{angelopoulos2019primal, doi:10.1137/120902288},
more general objective functions have been considered. Specifically, for a job $J_i$ with flow time $f_i$,
a cost $g_i(f_i)$ is incurred. The only restriction on $g_i$ is that $g_i$ must be non-decreasing.
For this general cost minimization problem, there are $O(1)$-speed $O(1)$-competitive
online algorithms~\cite{angelopoulos2019primal, doi:10.1137/120902288}.
For the offline setting, there are $O(1)$-approximation algorithms
for minimizing the $\ell_p$ norm of flow
time without speed augmentation~\cite{doi:10.1137/19M1244512,
doi:10.1137/1.9781611975482.96, doi:10.1137/18M1202451}. All known non-trivial offline algorithms for
this problem are based on linear programming
rounding~\cite{doi:10.1137/130911317, doi:10.1137/19M1244512,
doi:10.1137/1.9781611975482.96, doi:10.1137/18M1202451}.
There are quite a few scheduling algorithms that attempt to
alleviate the starvation caused by SRPT~\cite{bai2017pias,
10.1007/BFb0037157, 10.1145/2987550.2987563, 9269382,
10.1117/12.538820, 646697, 7018931, 9521259}. However,
these works do not provide theoretical guarantees for minimizing
the $\ell_2$ norm of flow time. Among these algorithms,
the one in~\cite{646697} is most similar to ours.
In~\cite{646697}, every job is associated with a priority
that increases as the age increases and as the remaining processing time decreases.
The algorithm always executes the job that has the highest priority.
We can also modify our algorithm so that it
always executes the job that has the highest
$\frac{\text{age}}{\text{remaining processing time}}$.
Thus, the modified algorithm does not need the threshold $\theta$.
However, the modified algorithm has a competitive ratio of
$\Omega(n^{1/2}/\log n)$
for minimizing the $\ell_2$ norm of flow time (refer to Appendix~\ref{appendix: pri} for proof).
\section{Numerical Results}\label{sec: sim}
In this section, we compare $BAL(\theta)$ with SRPT, FCFS, and RR, numerically.
We assume that the job arrival process is a Poisson process
with arrival rate $\lambda$, and we schedule jobs that arrive
between time 0 and time $T = 2^{20}$. Thus, we set
\[\tilde{n} = T \lambda.\]
We assume that the job size follows a Bounded Pareto distribution that is
parameterized by the shape parameter (i.e., the exponent of the power law),
$L$ (i.e., the lowest possible value of job sizes),
and $H$ (i.e., the highest possible value of job sizes).
It has been shown that many job size distributions in different computing systems
are well-modeled by a Bounded Pareto distribution with a
shape parameter close to 1~\cite{10.1145/378420.378792}.
Throughout the simulation, we set the shape parameter to 1.1.
We always set the values of $L$ and $H$
so that the average job size is 32.
We define $\rho$ as the product of the average job size and the job
arrival rate (i.e., $\rho = 32\lambda$). Thus, $\rho$ can be viewed as
the load of the system.
We consider the following two types of Bounded Pareto distributions:
\begin{description}
\item[Large-$P$:]
$(L,H) \in \{(6.66, 2^{11}), (6.07, 2^{12}), (5.62, 2^{13}), (5.26, 2^{14}),
(4.97, 2^{15})\}$. Specifically, when $H$ is set to $2^{11}$, the largest $6.5\%$ of the jobs comprise
$50\%$ of the load; when $H$ is set to $2^{15}$, the largest $2.2\%$ of the jobs comprise $50\%$ of the load.
Due to the heavy-tailed property of these distributions, SRPT is well suited for
these job size distributions~\cite{10.1145/384268.378792, doi:10.1137/090772228,
biersack2007scheduling,
271492, 10.1007/3-540-45540-X_2, 10.1145/1125274.1125276}.
\item[Small-$P$:]
$(L,H) \in \{(26.07, 40), (21.91, 50), (19.36, 60), (17.63, 70), (16.37, 80)\}$.
By Theorem~\ref{thrm: _fcfsP}, FCFS is well suited for this type of job size distributions.
\end{description}
Let $\mathcal{RR}$ be the schedule obtained by RR. In Figs.~\ref{fig: bpSRPT}~to~\ref{fig: bpRR},
we plot $\sqrt{\frac{F(\mathcal{S})}{F(\mathcal{BAL})}}$,
where $\mathcal{S} \in \{\mathcal{SRPT}, \mathcal{FCFS}, \mathcal{RR}\}$.
All results are averaged over 10 independent runs.
\subsection{Comparison of SRPT and $BAL(\theta)$}
We focus first on Fig.~\ref{fig: bpSRPT2}, where we set $\theta = \tilde{n}^{\frac{2}{3}}$.
For large-$P$ distributions, $BAL(\tilde{n}^{\frac{2}{3}})$ and SRPT have almost the same performance.
Compared with Fig.~\ref{fig: bpSRPT1} and Fig.~\ref{fig: bpSRPT3}, setting $\theta = \tilde{n}^{\frac{2}{3}}$
properly mitigates the starvation caused by SRPT. Specifically, when $\theta = \tilde{n}^{\frac{1}{3}}$,
$BAL(\theta)$ mitigates starvation prematurely and deteriorates the performance;
when $\theta = \tilde{n}$, the starvation mitigation mechanism is seldom invoked.
Notice that when $\theta = \tilde{n}^{\frac{2}{3}}$,
$BAL(\theta)$ even performs slightly better than SRPT when
$1.5 \leq \rho \leq 2$.
For small-$P$ distributions, $BAL(\tilde{n}^{\frac{2}{3}})$ outperforms SRPT when $1 \leq \rho \leq 2$. The advantage of $BAL(\tilde{n}^{\frac{2}{3}})$ over SRPT reaches its peak when
$\rho$ is slightly greater than 1. This situation is captured by the instance shown in
Fig.~\ref{fig: ex1}, in which starvation mitigation can greatly reduce SRPT's $\ell_2$ norm of flow time.
For small-$P$ distributions, when $\rho$ is high (e.g., $\rho = 2$),
the advantage of $BAL(\tilde{n}^{\frac{2}{3}})$ over SRPT is less evident.
This is because for small-$P$ distributions, when $\rho$ is high,
all work-conserving scheduling algorithms have similar $\ell_2$ norm of flow time.
To see this, first note that the expected maximum flow time
of any work-conserving scheduling algorithm is upper bounded by $O(\rho T)$.
Thus, the expected $\ell_2$ norm of flow time of every work-conserving scheduling algorithm
is upper bounded by $O\left(\sqrt{\tilde{n} (\rho T)^2}\right)$.
Next, consider the system at time $t = (1 + \frac{\rho-1}{2})T$.
At time $t$, the expected number of remaining jobs of any work-conserving scheduling algorithm
is lower bounded by \[
\frac{\rho T - t}{p_{max}} = \frac{(\rho-1)T}{2p_{max}}
= \Omega(\frac{\rho T}{p_{max}}) = \Omega(\tilde{n}),
\]
where the second equality holds when $\rho > 1$ and the last equality holds because $P = O(1)$.
Moreover, the flow times of these remaining jobs are lower bounded by $t - T = \Omega(\rho T)$.
Thus, the expected $\ell_2$ norm of flow time of every work-conserving scheduling algorithm
is lower bounded by $\Omega\left(\sqrt{\tilde{n} (\rho T)^2}\right)$.
Notice that for small-$P$ distributions, when $\rho$
decreases from $\frac{32}{30}$ to $1$
(i.e., when $\lambda^{-1}$ increases from
30 to 32), $\sqrt{\frac{F(\mathcal{SRPT})}{F(\mathcal{BAL})}}$ drops to approximately 1
in Fig.~\ref{fig: bpSRPT2}.
This is because when $\rho = 1$ and $\theta = \tilde{n}^{\frac{2}{3}}$,
most jobs can be completed before becoming starving. Specifically,
for small-$P$ distributions,
when $\rho = \frac{32}{30}$ and $\theta = \tilde{n}^{\frac{2}{3}}$,
more than $30\%$ of the tasks are executed as starving tasks.
In contrast, when $\rho = 1$ and $\theta = \tilde{n}^{\frac{2}{3}}$, less than
$1\%$ of the tasks are executed as starving tasks. As a result, when
$\rho \leq 1$, the performance of $BAL(\tilde{n}^{\frac{2}{3}})$ is almost
identical to that of SRPT.
The above discussion shows that if $\theta = \tilde{n}^{\frac{2}{3}}$, the starvation mitigation mechanism
is seldom invoked when $\rho \leq 1$. To increase the chance of invoking the
starvation mitigation mechanism, we decrease the value of $\theta$ to $\tilde{n}^{\frac{1}{3}}$.
As a result, when $\rho = 1$, usually more than $30\%$ of the tasks are executed as starving tasks.
Fig.~\ref{fig: bpSRPT1} shows that for small-$P$ distributions,
setting $\theta = \tilde{n}^{\frac{1}{3}}$
can improve over SRPT when $\rho \leq 1$.
\input{BP_FCFS}
Finally, Fig.~\ref{fig: bpSRPT3} shows that when $\theta = \tilde{n}$, the performance of
$BAL(\theta)$ and SRPT are almost identical.
This is because when $\theta = \tilde{n}$,
the starvation mitigation mechanism
is seldom invoked.
Note that in the following subsections, because SRPT and $BAL(\tilde{n})$ have almost the same
$\ell_2$ norm of flow time,
we compare SRPT with FCFS and RR by comparing $BAL(\tilde{n})$ with FCFS and RR.
\subsection{Comparison of FCFS and $BAL(\theta)$}
Because Fig.~\ref{fig: bpSRPT3} shows that SRPT and $BAL(\tilde{n})$ have almost identical performance,
we first use Fig.~\ref{fig: bpFCFS3}, which compares $BAL(\tilde{n})$ and FCFS, to compare SRPT and FCFS.
For large-$P$ distributions,
SRPT (and $BAL(\tilde{n})$) clearly outperforms FCFS. This is because when FCFS is executing large jobs,
many small jobs are starving. Note that this property still exists even if
$\rho$ is only $\frac{1}{2}$.
When $\rho = \frac{1}{2}$, the mean job interarrival time is 64.
However, the size of a large job is much greater than 64, and thus
there are still many small jobs arriving at the system during the
execution of a large job, even if $\rho = \frac{1}{2}$.
For small-$P$ distributions, FCFS is almost always better than SRPT.
This is because SRPT may unnecessarily starve jobs that are only slightly larger than the others.
As explained in the previous subsection, for small-$P$ distributions,
all work-conserving schedules have a similar $\ell_2$ norm of flow time when
$\rho$ is high.
Thus, SRPT and FCFS have similar performances when
$\rho$ is high.
When $\rho < 1$, FCFS beats SRPT.
This is because when the job arrival process is Poisson,
the system still experiences transient overloads even if $\rho$ is moderately
low (e.g., $\frac{1}{2} \leq \rho \leq 1$).
During these transient overloads, SPRT still unnecessarily delays the execution of jobs that are
only slightly larger than the others, which deteriorates the $\ell_2$ norm of flow time.
Next, we compare FCFS and $BAL(\tilde{n}^{\frac{2}{3}})$.
For small-$P$ distributions, FCFS performs better than $BAL(\tilde{n}^{\frac{2}{3}})$
when $\rho$ is low. This is because when $\rho$ is low, the starvation mitigation
mechanism is seldom invoked under the setting $\theta = \tilde{n}^{\frac{2}{3}}$.
As a result, $BAL(\tilde{n}^{\frac{2}{3}})$ is almost identical to SRPP,
which leads to a worse performance than FCFS.
However, when $\rho > \frac{32}{30}$, the starvation mitigation mechanism
kicks in and the performance is greatly improved.
As a result, $BAL(\tilde{n}^{\frac{2}{3}})$ and FCFS have almost identical
performance when $\rho > \frac{32}{30}$. Observe that $BAL(\tilde{n}^{\frac{2}{3}})$
may even perform slightly better than FCFS when $\rho > \frac{32}{30}$.
For large-$P$ distributions,
because $BAL(\tilde{n}^{\frac{2}{3}})$ preserves the advantage of SRPT over FCFS,
$BAL(\tilde{n}^{\frac{2}{3}})$ clearly outperforms FCFS.
\input{BP_RR}
\subsection{Comparison of RR and $BAL(\theta)$}
We use Fig.~\ref{fig: bpRR3} first to compare SRPT and RR. For large-$P$ distributions,
SRPT performs better than RR because RR still allocates processing time to large jobs
even when there are many small jobs waiting to be processed. For large-$P$ distributions,
the advantage of SRPT over RR is
not as evident as the advantage of SRPT over FCFS. This is because, unlike FCFS, RR does not completely
delay small jobs while executing large jobs.
For small-$P$ distributions, SRPT is better than RR when the system is overloaded.
This is because RR frequently switches job executions in such a case.
Thus, if many (say, $k$) jobs of size $\Theta(p)$
are released roughly at the same time, then all these jobs will have flow times of $\Omega(kp)$.
In other words, every job has a flow time that is close to the maximum flow time
under RR.
Under SRPT, however, some jobs can have much smaller flow times.
As a result, SRPT performs better than RR when the system is overloaded.
For small-$P$ distributions, RR is better than SRPT
when $\rho$ is close to one.
This is because SRPT may unnecessarily
delay jobs that are only slightly larger than the others for a long period of
time, which leads to a poor maximum flow time.
In contrast, RR has a much smaller maximum flow time.
Recall that Fig.~\ref{fig: ex1} shows a slightly overloaded instance with
a small value of $P$.
Observe that RR has a maximum flow time of $O(1)$ and outperforms SRPT on that instance.
For small-$P$ distributions, the system experiences transient overloads
when $\rho$ is moderately low (e.g., $\frac{1}{2} \leq \rho \leq 1$).
During the period of transient overloading,
jobs cannot be starved for too long under SRPT.
In addition, RR frequently switches job executions during
the period of transient overloading, which deteriorates the average flow time.
As a result, SRPT performs better than RR when $\rho$ is moderately low.
Finally, we use Fig.~\ref{fig: bpRR2} to compare RR and $BAL(\tilde{n}^{\frac{2}{3}})$.
For small-$P$ distributions, thanks to starvation mitigation, the advantage of
$BAL(\tilde{n}^{\frac{2}{3}})$ over RR
is more evident than the advantage of SRPT over RR, and
$BAL(\tilde{n}^{\frac{2}{3}})$ is always better than RR when
$\rho > 1$. When $\rho \leq 1$, because
the starvation mitigation mechanism is seldom invoked, $BAL(\tilde{n}^{\frac{2}{3}})$ acts in a way similar to
SRPT. Nonetheless, as shown in Fig.~\ref{fig: bpRR1},
if we decrease the value of $\theta$ to $\tilde{n}^{\frac{1}{3}}$ to
increase the chance of invoking the starvation mitigation mechanism, then
$BAL(\theta)$ performs better than RR under this setting.
For large-$P$ distributions, because $BAL(\tilde{n}^{\frac{2}{3}})$ preserves
the advantage of SRPT over RR, $BAL(\tilde{n}^{\frac{2}{3}})$ performs better than RR.
\section{Proof of Theorem~\ref{thrm: algo}}\label{sec: tech}
For any job $J_i$, define $pre(i) = t_i-r_i$, and define
$post(i) = c_i(\mathcal{BAL}) - t_i$.
Thus, $f_i(\mathcal{BAL}) = pre(i) + post(i)$ and
\begin{equation} \nonumber
F(\mathcal{BAL}) = \sum_{i=1}^{n}{(pre(i)+post(i))^2} =
O\left(\sum_{i=1}^{n}{pre(i)^2}+\sum_{i=1}^{n}{post(i)^2}\right).
\end{equation}
In the next lemma, we use Lemma~\ref{prop: LBQ} to upper bound $\sum_{i=1}^{n}{pre(i)^2}$.
The proof can be found in Appendix~\ref{appendix: lemma: preub}.
\begin{lemma} \label{lemma: preub}
$\sum_{i=1}^{n}{pre(i)^2} = O\left((\alpha n)^{\frac{2}{3}}\right)F(\mathcal{OPT})$.
\end{lemma}
By the above lemma, to prove Theorem~\ref{thrm: algo}, it suffices to
show $\sum_{i = 1}^{n}{post(i)^2} = O\left(\beta^{-\frac{1}{3}} n^{\frac{2}{3}}\right)F(\mathcal{OPT})$.
Note that $post(i) = 0$ if $J_i$ is an FaN job.
Next, we give an upper bound of $post(i)$ for an FaS job $J_i$.
Recall that once $J_i$ becomes starving, all the remaining tasks of $J_i$
become starving as well.
Let $u(t)$ be the number of starving tasks at time $t$.
Thus, by the design of $BAL(\theta)$,
$J_i$'s completion time is at most $t_i+u(t_i)$.
Therefore, $post(i) \leq u(t_i)$.
Define $t^* = \argmax_{t \in \mathbb{N}}{u(t)}$.
We then have $post(i) \leq u(t^*)$ and thus
$\sum_{i = 1}^{n}{post(i)^2} = O(n \cdot u(t^*)^2)$.
As a result, to prove Theorem~\ref{thrm: algo}, it is sufficient to show
\begin{equation} \label{eq: ultimategoal} \tag{$\ast$}
F(\mathcal{OPT}) = \Omega\left((\beta n)^{\frac{1}{3}} \cdot u(t^*)^2\right).
\end{equation}
To prove Eq.~\eqref{eq: ultimategoal}, we first introduce two lower bounds of $F(\mathcal{OPT})$.
\subsection{The First Lower Bound of $F(\mathcal{OPT})$}
The first lower bound is a simple application of Lemma~\ref{prop: LBQ}.
By Lemma~\ref{prop: LBQ}, we have
\begin{equation} \label{eq: keylb1}
F(\mathcal{OPT})
\geq \sum_{i=1}^{n}{\sum_{t = r_i}^{t_i}{q_{t}(i)}}
\geq \sum_{i=1}^{n}{\sum_{t = r_i}^{t_i}{q_{t_i}(i)}}
\geq \tilde{n}^{\frac{2}{3}} \sum_{i=1}^{n}{q_{t_i}(i)^2},
\end{equation}
where the last inequality holds because by the design of $BAL(\tilde{n}^{\frac{2}{3}})$,
$t_i-r_i \geq \tilde{n}^{\frac{2}{3}}q_{t_i}(i)$ for any FaS job $J_i$.
For any FaN job $J_i$, we have $q_{t_i}(i) =0$.
Observe that when
some job $J_i$ has $q_{t_i}(i) = \Omega(u(t^*))$,
Eq.~\eqref{eq: keylb1} alone is sufficient
to prove Eq.~\eqref{eq: ultimategoal}.
However, if every FaS job $J_i$ has $q_{t_i}(i) = \Theta\left(\frac{u(t^*)}{n}\right)$, then Eq.~\eqref{eq: keylb1}
is insufficient to prove Eq.~\eqref{eq: ultimategoal}.
Thus, to prove Eq.~\eqref{eq: ultimategoal}, we combine Eq.~\eqref{eq: keylb1}
with the following lower bound of $F(\mathcal{OPT})$.
\subsection{The Second Lower Bound of $F(\mathcal{OPT})$}\label{subsubsec: lb2}
Observe that to minimize $F(\mathcal{S})$ when
all jobs are released at the same time,
jobs should be executed in increasing order of their processing times.
To derive the second lower bound of $F(\mathcal{OPT})$ by this idea,
jobs that are not active at time $t^*$ under $\mathcal{OPT}$ are ignored (and thus their flow times are
not counted in $F(\mathcal{OPT})$). For every job $J_i$ that is active at time $t^*$ under $\mathcal{OPT}$,
we gift $F(\mathcal{OPT})$ by setting $r_i = t^*$ and $p_i = q_{t^*, \mathcal{OPT}}(i)$.
We then execute jobs in increasing order of their new processing times.
The above idea will be used in the proof of Lemma~\ref{lemma: LB2}.
If there are $n' = \Theta(n)$ active jobs at time $t^*$ under
$\mathcal{OPT}$, and each of these $n'$ jobs
has $\Theta\left(\frac{u(t^*)}{n}\right)$ remaining tasks at time $t^*$,
then this lower bound alone is sufficient to prove Eq.~\eqref{eq: ultimategoal}.
Specifically, in the derivation of the lower bound,
all the new processing times are $\Theta\left(\frac{u(t^*)}{n}\right)$.
When the first $n'/2$ jobs are completed,
all the remaining $n'/2 = \Theta(n)$ jobs have been delayed by $\Omega(u(t^*))$ time slots,
which leads to $F(\mathcal{OPT}) = \Omega\left(n \cdot u(t^*)^2\right)$.
However, when most remaining tasks belong to a few jobs
(e.g., $O(1)$ jobs) at time $t^*$ under $\mathcal{OPT}$,
this lower bound is insufficient to prove Eq.~\eqref{eq: ultimategoal}.
\subsection{Combining the Two Lower Bounds}
The above discussion suggests that the two
lower bounds complement each other.
Indeed, consider the following inequality.
\begin{equation} \label{eq: bridge}
\sum_{i=1}^{n}{q_{t_i}(i)^2} \geq \sum_{i=1}^{n}{q_{t^*, \mathcal{OPT}}(i)^2}.
\end{equation}
Observe that the left-hand side of Eq.~\eqref{eq: bridge} appears
in the first lower bound, and $q_{t^*, \mathcal{OPT}}(i)$ appears in the second lower bound.
If Eq.~\eqref{eq: bridge} holds, we can use Eq.~\eqref{eq: bridge} to bridge the two lower bounds
and prove Eq.~\eqref{eq: ultimategoal}.
Unfortunately, Eq.~\eqref{eq: bridge} dose not always hold.
To see this, observe that $\sum_{i=1}^{n}{q_{t_i}(i)}$ may be equal to $u(t^*)$
(e.g., when all FaS jobs have $t_i = t^*$).
However, $\sum_{i=1}^{n}{q_{t^*, \mathcal{OPT}}(i)} = q(t^*)$
may be much greater than $u(t^*)$.
As a result, the right-hand side of Eq.~\eqref{eq: bridge} may be much greater than
the left-hand side of Eq.~\eqref{eq: bridge}.
In this paper, we prove a relaxed version of Eq.~\eqref{eq: bridge}.
Informally, we shrink $q_{t^*, \mathcal{OPT}}$ so that
Eq.~\eqref{eq: bridge} holds.
Specifically, a map $f'$ is said to be \textbf{dominated by} a map $f$, denoted by
$f' \preceq f$, if $\dom f' = \dom f$ and
$f'(i) \leq f(i), \forall i \in \dom f$.\footnote{For any map $f$,
$\dom f$ denotes the domain of $f$.}
The action of \textbf{shrinking} a map $f$ is equivalent to constructing a map dominated by $f$.
In the relaxed version of Eq.~\eqref{eq: bridge}, we shrink
$q_{t^*, \mathcal{OPT}}$ to obtain a map $m_{\mathcal{OPT}}$.
The property $m_{\mathcal{OPT}} \preceq q_{t^*, \mathcal{OPT}}$
allows us to apply the technique developed for the second lower
bound to $m_{\mathcal{OPT}}$.
Moreover, $\sum_{i=1}^{n}{m_{\mathcal{OPT}}(i)}$ cannot be too small;
otherwise, the resulting second lower bound would be too loose.
The above idea is made formal in the following lemma.
\begin{lemma} \label{lemma: LB1}
There exists a map $m_{\mathcal{OPT}}$ that satisfies the following properties:
\begin{description}
\item[P1:] $\sum_{i=1}^{n}{q_{t_i}(i)^2} \geq \sum_{i=1}^{n}{m_{\mathcal{OPT}}(i)^2}$
\item[P2:] $m_{\mathcal{OPT}} \preceq q_{t^*, \mathcal{OPT}}$
\item[P3:] $\sum_{i=1}^{n}{m_{\mathcal{OPT}}(i)} = \Omega(u(t^*))$
\end{description}
\end{lemma}
By P1 and Eq.~\eqref{eq: keylb1}, we have
\begin{equation}\label{eq: finalkeylb1}
F(\mathcal{OPT}) \geq \tilde{n}^{\frac{2}{3}} \sum_{i=1}^{n}{m_{\mathcal{OPT}}(i)^2}.
\end{equation}
By P2 and the technique developed for the second lower bound, we have the following lemma.
The proof can be found in Appendix~\ref{appendix: lemma: LB2}.
\begin{lemma}\label{lemma: LB2}
Let $m_{\mathcal{OPT}}$ be the map defined in Lemma~\ref{lemma: LB1}.
Reindex jobs so that
\begin{equation} \label{eq: reindex}
m_{\mathcal{OPT}}(1) \leq m_{\mathcal{OPT}}(2) \leq \cdots \leq m_{\mathcal{OPT}}(n).
\end{equation}
We then have
\begin{equation}\nonumber
F(\mathcal{OPT}) \geq
\sum_{i=1}^{n} {\left(\sum_{h=1}^{i} {m_{\mathcal{OPT}}(h)}\right)^2}.
\end{equation}
\end{lemma}
\subsection{Proof of Eq.~\eqref{eq: ultimategoal}}
Like Lemma~\ref{lemma: LB2}, we reindex jobs so that
Eq.~\eqref{eq: reindex} holds.
We then have
\begin{align*}
&F(\mathcal{OPT}) &\\
&= \Omega\left(\sum_{i=1}^{n}{\left(\sum_{h=1}^{i}{m_{\mathcal{OPT}}(h)}\right)^2}
+\tilde{n}^{\frac{2}{3}}\sum_{i=1}^{n}{m_{\mathcal{OPT}}(i)^2}\right)
&\text{ (by Lemma~\ref{lemma: LB2} and Eq.~\eqref{eq: finalkeylb1})}\\
&= \Omega\left(\tilde{n}^{\frac{1}{3}}\right)
\sqrt{\left(\sum_{i=1}^{n}{\left(\sum_{h=1}^{i}{m_{\mathcal{OPT}}(h)}\right)^2}\right)
\left(\sum_{i=1}^{n}{{m_{\mathcal{OPT}}(i)}^2}\right)}
&\text{ (by the AM–GM inequality)}\\
&= \Omega\left(\tilde{n}^{\frac{1}{3}}\right)\sum_{i=1}^{n}
{
\left(\sum_{h=1}^{i} {m_{\mathcal{OPT}}(h)} \right)
m_{\mathcal{OPT}}(i)
}
&\text{ (by the Cauchy-Schwarz inequality)}\\
&= \Omega\left((\beta n)^{\frac{1}{3}}\right)\left(\sum_{i=1}^{n}{m_{\mathcal{OPT}}(i)}\right)^2 &\\
&= \Omega\left((\beta n)^{\frac{1}{3}}\right)u(t^*)^2 &\text{ (by P3 in Lemma~\ref{lemma: LB1})}.
\end{align*}
\subsection{Construction of $m_{\mathcal{OPT}}$}\label{subsec: overview}
Lemma~\ref{lemma: LB1} seeks a map $m_{\mathcal{OPT}}$ that can be constructed
by \textit{properly} shrinking $q_{t^*, \mathcal{OPT}}$.
For ease of exposition, a map
$f: [1,n] \rightarrow \mathbb{N}$ is said to be \textbf{proper}
if it satisfies the following two properties:
\begin{enumerate}
\item $\sum_{i=1}^{n}{q_{t_i}(i)^2} \geq \sum_{i=1}^{n}{f(i)^2}$
\item $\sum_{i=1}^{n}{f(i)} = \Omega(u(t^*))$
\end{enumerate}
Using the above terminology, it suffices to
construct a proper map by shrinking $q_{t^*, \mathcal{OPT}}$.
To construct a proper map, we frequently consider the sum of all the outputs (or the square of the outputs)
of a map. Thus, we introduce the following shorthand notations.
\begin{definition}
For any map $f$, define $S(f) = \sum_{i \in \dom f}{f(i)}$,
and define $f^2$ as a map such that $\dom f^2 = \dom f$
and $f^2(x) = f(x)^2$ for any $x \in \dom f^2$.
\end{definition}
Once we construct a proper map $f$, we can use $f$ to
prove that another map $g$ is proper by
comparing $f$ and $g$. The next definition gives the desired relationship
between $f$ and $g$.
\begin{definition}
For any two maps $f$ and $g$, we write $f \leadsto g$
if $S(f^2) \geq S(g^2)$ and $S(g) = \Omega(S(f))$.
\end{definition}
Clearly, if $f$ is a proper map and $f \leadsto g$, then
$g$ is also a proper map. To prove Lemma~\ref{lemma: LB1},
we first construct a proper map $m_{\mathcal{BAL}}$ based on $q_{t^*}$.
We then use $m_{\mathcal{BAL}}$ to construct other proper maps.
Note that Lemma~\ref{lemma: LB1} is trivial when $u(t^*) = 0$.
Thus, in the remainder of the paper, we assume $u(t^*) \geq 1$.
\subsubsection{The First Shrinking Step and the First Proper Map $m_{\mathcal{BAL}}$}\label{subsec: 1ststep}
We introduce an auxiliary map $\hat{q}_t$ that freezes the number of
remaining tasks of an FaS job once it becomes starving.
Specifically, for any $t \in \mathbb{N}$ and $i \in [1,n]$,
we define $\hat{q}_t(i)$ as follows.
\[
\hat{q}_t(i) =
\begin{cases}
q_t(i) &\mbox{if ($J_i$ is an FaN job) or ($J_i$ is an FaS job and $t \leq t_i$)}\\
q_{t_i}(i) &\mbox{if $J_i$ is an FaS job and $t > t_i$}
\end{cases}
\]
We stress that the definition of $\hat{q}_t(i)$ can be applied to
$t > c_i(\mathcal{BAL})$.
The following lemma, whose proof can be found in Appendix~\ref{appendix: lemma: 1stshrink},
shows that we can construct a proper map
$m_{\mathcal{BAL}}$ by shrinking $\hat{q}_{t^*}$.
The proof is mainly based on the relationship between
$\hat{q}_t$ and $q_t$.
\begin{lemma}\label{lemma: 1stshrink}
There is a proper map $m_{\mathcal{BAL}}$ such that $m_{\mathcal{BAL}} \preceq \hat{q}_{t^*}$.
\end{lemma}
\subsubsection{The Second Shrinking Step and the Second Proper Map $m_{\mathcal{SRPT}}$}
Next, we shrink $q_{t^*, \mathcal{SRPT}}$ to obtain a proper map
$m_{\mathcal{SRPT}}$ with the help of $m_{\mathcal{BAL}}$.
\begin{lemma}\label{lemma: 2ndshrink}
There is a map $m_{\mathcal{SRPT}}$ such that $m_{\mathcal{BAL}} \leadsto m_{\mathcal{SRPT}}$
and $m_{\mathcal{SRPT}} \preceq q_{t^*, \mathcal{SRPT}}$.
\end{lemma}
To prove the above lemma, we use the property
$m_{\mathcal{BAL}} \preceq \hat{q}_{t^*}$ stated in Lemma~\ref{lemma: 1stshrink}.
We also use the property that for any time $t$ and any job $J_i$,
$\hat{q}_t(i) \geq q_{t, \mathcal{SRPT}}(i)$.
This property is due to Line~12 of Algorithm~\ref{algo}.
The proof of Lemma~\ref{lemma: 2ndshrink} can be found in Appendix~\ref{appendix: lemma: 2ndshrink}.
\subsubsection{The Last Shrinking Step and the Desired Map $m_{\mathcal{OPT}}$}
Finally, we shrink $q_{t^*, \mathcal{OPT}}$ with the help of
$m_{\mathcal{SRPT}}$. To this end, we use the notion of majorization.
Informally speaking, if map $f$ majorizes map $g$, then for any positive integer $k$,
the sum of the top-$k$ largest outputs of $f$ is at least that of $g$.
Because SRPT always executes the job that has the least remaining tasks,
we have the following lemma.
\begin{lemma}\label{lemma: FRFt}
Let $\mathcal{S}$ be a work-conserving schedule. For any $t \in \mathbb{N}$,
$q_{t, \mathcal{SRPT}}$ majorizes $q_{t, \mathcal{S}}$.
\end{lemma}
We then use the following lemma to shrink $q_{t^*, \mathcal{OPT}}$ properly.
\begin{lemma}\label{lemma: S1S2}
If map $f$ majorizes map $g$, then for any map $f' \preceq f$,
there is a map $g'$ such that $g' \preceq g$
and $f' \leadsto g'$.
\end{lemma}
Due to space constraint, we give the formal definition of majorization
and the proofs of Lemma~\ref{lemma: FRFt} and Lemma~\ref{lemma: S1S2} in
Appendix~\ref{appendix: lemma: 3rdshrink}.
\subsubsection*{Proof of Lemma~\ref{lemma: LB1}}
Consider Lemma~\ref{lemma: S1S2} and fix
$f = q_{t^*, \mathcal{SRPT}}$ and $g = q_{t^*, \mathcal{OPT}}$.
By Lemma~\ref{lemma: FRFt}, $f$ majorizes $g$.
Let $f' = m_{\mathcal{SRPT}}$.
By Lemma~\ref{lemma: 2ndshrink}, $f' \preceq f$.
By Lemma~\ref{lemma: S1S2}, there is a map $g'$
such that $g' \preceq g$ and $f' \leadsto g'$.
Let $m_{\mathcal{OPT}} = g'$.
Thus, P2 is satisfied.
By Lemma~\ref{lemma: 1stshrink},
$m_{\mathcal{BAL}}$ is a proper map. Finally, because
$m_{\mathcal{BAL}}
\stackrel{\text{by Lemma~\ref{lemma: 2ndshrink}}}{\leadsto}
m_{\mathcal{SRPT}} =f'
\leadsto g' = m_{\mathcal{OPT}}$, $m_{\mathcal{OPT}}$ is also a proper map, which proves P1 and P3.
| {'timestamp': '2022-09-26T02:14:03', 'yymm': '2112', 'arxiv_id': '2112.14403', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14403'} | arxiv |
\section{Introduction}
Robotic sensor networks, which combine the local sensing capabilities of various sensors with the mobility of robots, can provide more versatility than conventional fixed sensor networks due to their capability to extend the sensing range and improve the resolution of sensory data maps \cite{deng2017energy}. These networks have been studied extensively in survey of global environment \cite{matthew2017boustrophedon,feng2020an,patrikar2020wind,ma2016an}, industrial environment perception \cite{zhang2019intelligent}, radio signal search \cite{li2020multi}, and so on.
To construct sensor networks, we first deploy many sensors in a working space. Then, we establish communication channels with the central server to collect and fuse data acquired from all sensors. Since the wireless communication range of sensors is limited, sensors usually make an indirect connection with the central server, such as a mesh network that connects all sensors and the central server by relay channels.
However, the relay network requires a routing table that must be rebuilt every time the robot network is reconfigured, which is cumbersome for robotic sensor networks. This problem is particularly noticeable in unmanned aerial vehicles (UAVs) or small robots since they need to use relatively weak communication modules to reduce power consumption.
Decentralizing the system can be a proper solution to network problems by removing the dependency of robots on the central server. For example, if a robot can infer the entire sensory map only from the local information directly provided by surrounding robots, the search task can be completed without the help of the central server. This paper applies decentralization to the environmental learning phase and the path planning phase, respectively. With an online information fusion algorithm, we build a distributed autonomous system of multiple robots to search and learn even dynamic environments that change over time.
\begin{figure}[t]
\begin{center}
\includegraphics[width=0.45\textwidth]{figures/overview/overview_4.pdf}
\caption{Temperature monitoring simulation in Seoul using multiple UAVs; (left) trajectories of UAVs performing cooperative work through a distributed communication network, and (right) the reconstructed temperature map.}
\label{fig:overview}
\end{center}
\vspace{-0.5cm}
\end{figure}
\subsection{Literature Review}
The first part of our work is multi-robot environmental learning in a distributed manner. For environmental learning, some useful techniques exist such as Gaussian mixture model (GMM) \cite{shi2020adaptive,luo2019distributed,gu2008distributed}, finite element method (FEM) \cite{elwin2020distributed}, and Gaussian process (GP) regression \cite{patrikar2020wind,ma2016an,li2020multi}. In particular, GP is a popular approach that derives a spatial relationship between sampled data using a kernel and performs Bayesian inference for prediction at an unknown region.
However, most GP-related researches focus on centralized systems, making it difficult to expand to large-scale multi-robot systems due to network resource limitations such as channel bandwidth and transmit power. Distributed multi-agent Gaussian regression is introduced in \cite{pillonetto2019distributed}, which designs a finite-dimensional GP estimator by using Karhunen–Loève (KL) expansion \cite{levy2008karhunen}. In contrast to the decentralized GP presented in \cite{viseras2016decentralized}, the distributed GP provides a common copy of the global estimate to all agents by exchanging the estimated information with their neighbors. This paper extends \cite{jang2020multi}, which shows that distributed GPs can construct environmental models using mobile robots in order to take the distributed path planning into account.
The second part of our work is informative path planning in a distributed multi-robot system. As an initial study of informative path planning, the problem of optimal sensor placement has been investigated to create an environmental map in a given space by properly placing a finite number of sensors \cite{krause2008near,luo2019distributed,gu2008distributed}.
Since then, by applying GPs and information theory, the research of optimal sensor placement has grown into the informative path planning research as presented in \cite{ma2016an,shi2020adaptive,flaspohler2019information,silveria2018reconstruction,ma2017informative,meliou2007nonmyopic,bottarelli2019orienteering}. Some studies have combined GP with conventional planning algorithms such as rapidly-exploring random tree (RRT) \cite{yang2013a}, dynamic programming (DP) \cite{ma2017informative}, or Monte Carlo tree search (MCTS) \cite{chen2019pareto}.
Besides the above approaches that mainly focus on informative path planning for single agents, many studies have applied informative planning for multi-robot systems. In \cite{viseras2016decentralized,li2020multi}, although both studies deal with decentralized multi-robot exploration using GP, these algorithms are not scalable as they consider only two robots. \cite{du2021parallelized} introduced the combination of the Kalman filter (KF) and the reduced value iteration (RVI) method for the parallelized active information gathering. While this technique is scalable to a large number of robots, it is noted that the environmental model has to be known, and only discrete environments can be represented since the model is expressed in KF. Considering the scalability for multi-robot systems, we extend the MCTS path planning in a distributed manner to be compatible with the distributed GP.
\subsection{Our Contribution}
To achieve our goal of fully distributed multi-robot informative planning, we divide the whole process into two phases: environmental learning and path planning. During these phases, we focus on three main contributions as follows.
• We develop an online distributed GP algorithm for environmental learning through Karhunen–Loève expansion and an infinite impulse response filter. This algorithm is capable of learning a dynamic environment.
• We propose a distributed informative path planning algorithm using a distributed MCTS combined with GP. In addition, we introduce the trajectory merging method to consider predicted trajectories of other agents.
• We build a fully distributed exploration and learning architecture using only local peer-to-peer communication for system scalability, as shown in Table \ref{table:scalability}.
We perform a multi-robot exploration simulation with a virtual environment setting and real-world dataset \cite{ncdc} provided by the National Climate Data Center (NCDC) in South Korea as shown in Fig. \ref{fig:overview}.
The outline of this paper is as follows. Section \rom{2} briefly describes a multi-robot system setup and preliminaries. Section \rom{3} presents a method for online distributed environmental learning. Section \rom{4} combines environmental learning and MCTS in the distributed system. Simulations for the synthetic environment and real-world dataset are presented in Section \rom{5}. Section \rom{6} concludes the paper.
\begin{table}[ht]
\caption{Scalability comparison between centralized and distributed systems for multi-agent tasks. See text for symbols.}
\label{table:scalability}
\centering
\begin{tabular}{|l||l|l|}
\hline
& \multicolumn{1}{c|}{\textbf{Centralized}} & \multicolumn{1}{c|}{\textbf{Distributed (ours)}} \\ \hline
\begin{tabular}[c]{@{}l@{}}GP Computation\\ Complexity\end{tabular} & $O((mn)^3)$\quad\hfill (\cite{li2020multi,viseras2016decentralized})& $O(E^3)$\quad\hfill (\cite{jang2020multi}) \\ \hline
\begin{tabular}[c]{@{}l@{}}MCTS Planner \\Action Cardinality\end{tabular} & $\lvert \mathcal{A} \rvert^n$\quad\hfill (\cite{kartal2016monte})& $\lvert \mathcal{A} \rvert$\quad\hfill (\cite{best2019dec})\\ \hline
\begin{tabular}[c]{@{}l@{}}Communication\\ Complexity\end{tabular} & $O(n^2)$\quad\hfill (\cite{kartal2016monte,shi2020adaptive})& $O(n)$\quad\hfill (\cite{li2020multi,viseras2016decentralized,jang2020multi}) \\ \hline
\end{tabular}
\vspace{-0.2cm}
\end{table}
\iffalse
GP cent | li2020multi,viseras2016decentralized
GP dist | jang2020multi
MCTS cent | kartal2016monte
MCTS dist | best2019dec
Comm cent | kartal2016monte,shi2020adaptive
Comm dist | li2020multi,viseras2016decentralized,jang2020multi
\fi
\section{Multi-Robot System Setup and Preliminaries}\label{sec:problem_statement}
We focus on the environment learning problem in multi-robot systems by considering a target domain as a 3-dimensional compact set $\mathbb{X}_w\subset\mathbb{R}^3$. Multiple robots (e.g., ground vehicles or UAVs with onboard sensors) explore an unknown area and estimate environmental information using both self-measurements and shared data received from neighbors. All robots can discover obstacles nearby using the range sensor and only communicate with adjacent robots within the communication distance.
\begin{figure*}[ht]
\begin{center}
\includegraphics[trim = 0mm 0mm 0mm 0mm, clip, width=0.8\textwidth]{figures/structure/structure8.pdf}
\caption{Structure of the distributed exploration and environmental model learning system. Each agent has its own distributed GP and distributed MCTS planner modules that operate through peer-to-peer communication with each other.}
\label{fig:structure}
\end{center}
\vspace{-0.5cm}
\end{figure*}
\iffalse
\begin{table}[]
\centering
\caption{Temporary nomenclature.}
\begin{tabular}{|l||l|}
\hline
& \multicolumn{1}{c|}{\textbf{Meaning}} \\ \hline
$n$ & Number of robots \\ \hline
$\mathcal{N}=\{1,2,\cdots,n\}$ & Index set of robots \\ \hline
$y_k^i,\quad i\in\mathcal{N}$ & measurement of robot $i$ at time $k$ \\ \hline
$\mathbf{x}_k^i\in\mathbb{X}_w,\quad i\in\mathcal{N}$ & position of robot $i$ at time $k$ \\ \hline
$\mathbb{X}_w$ & Compact set of position domain \\ \hline
$f(\cdot)$ & Environmental process \\ \hline
$\mathcal{N}_{k}^{i}=\{j|\ {||\mathbf{x}_{k}^{i}-\mathbf{x}_{k}^{j}||}<d_{comm},j\in\mathcal{N}/i\}$ & Set of neighbors for robot $i$ \\ \hline
$d_{comm}$ & Communication distance \\ \hline
$\mathcal{N}^{i+}=\mathcal{N}^{i}\cup \{i\}$ & Set of neighbors including itself\\ \hline
\end{tabular}
\end{table}
\fi
\subsection{Multi-Robot System Setup}\label{subsec:multi-robot_sytem_setup}
As depicted in Fig. \ref{fig:overview}, we consider $n$ robot agents exploring the environment. Each robot $i$ takes the measurement $y_k^i$ of an unknown environmental process $f(\cdot)$ in its position $\mathbf{x}_{k}^{i}\in \mathbb{X}_w$ ($i=1,\cdots,n$) at time $k$ which has the following relationship:
\begin{ceqn}
\begin{equation}\label{eq:measurement_model}
\renewcommand{\arraystretch}{1.2
\setlength{\arraycolsep}{2pt}%
\begin{array}{ r>{{}}l @{\quad} l @{\quad} r>{{}}l @{\quad} l }
y_{k}^{i}&=&f(\mathbf{x}_{k}^{i})+v_{k}^{i},\\
\end{array}
\end{equation}
\end{ceqn}
where the measurement of $f(\mathbf{x}_{k}^{i})$ is corrupted by the additive white Gaussian noise $v_{k}^{i}\sim\mathcal{N}(0,\sigma_{v}^{2})$.
Each robot has its process modules, \textit{Distributed GP} and \textit{Distributed MCTS}, for the distributed monitoring task. During these processes, they share GP variables and predicted trajectories through a peer-to-peer communication network. This operation process is summarized in Fig. \ref{fig:structure}. The controller design process is not covered in this work.
To implement the communication network of $n$ robots, we define a set of neighbors for robot $i$ as $\mathcal{N}_{k}^{i}=\{j|\ {||\mathbf{x}_{k}^{i}-\mathbf{x}_{k}^{j}||}<d_{comm},j\in\mathcal{N}/i\}$, where $\mathcal{N}=\{1,2,\cdots,n\}$ is the index set of agents and $d_{comm}$ is the communication range. $\mathcal{N}^{i+}$ means $\mathcal{N}^{i}\cup \{i\}$. For arbitrary variable $A$, $A^{i+}$ means $\{A^{j}\}_{j\in \mathcal{N}^{i+}}$, and $A^{i-}$ means $\{A^{j}\}_{j\in \mathcal{N}^{i}}$ for brevity.
\subsection{Conventional Gaussian Process}\label{subsec:conventional_gp}
GP regression, which is data-driven non-parametric learning, can provide Bayesian inference over the set $\mathbb{X}_w$, taking into account joint Gaussian probability distribution between the sampled dataset \cite{rasmussen2003gaussian}. In \eqref{eq:measurement_model}, the unknown process model $f(\cdot)$ is assumed to follow a zero-mean Gaussian process as
\begin{ceqn}
\begin{equation}\label{eq:process_model}
\renewcommand{\arraystretch}{1.2
\setlength{\arraycolsep}{2pt}%
\begin{array}{ r>{{}}l @{\quad} l @{\quad} r>{{}}l @{\quad} l }
f(\cdot)\sim \mathcal{G}\mathcal{P}(0,\kappa(\mathbf{x'},\mathbf{x''})).\\
\end{array}
\end{equation}
\end{ceqn}
$\kappa(\mathbf{x'},\mathbf{x''})$ is a \textit{kernel} or \textit{covariance function} for positions $\mathbf{x'},\mathbf{x''}\in\mathbb{X}_{w}$, and the original \textit{squared exponential} (SE) kernel is defined as
\begin{ceqn}
\begin{align}\label{eq:kernel}
\kappa(\mathbf{x'},\mathbf{x''})=\sigma_{s}^2\text{exp}(-\frac{1}{2}(\mathbf{x'}-\mathbf{x''})^\top\Sigma_{l}^{-1}(\mathbf{x'}-\mathbf{x''})),
\end{align}
\end{ceqn}
where $\sigma_{s}^2$ is the signal variance of $f(\cdot)$, and $\Sigma_{l}$ is the length scale. The hyper parameters $\sigma_{s}^2$ and $\Sigma_{l}$ can be determined by maximizaing the marginal likelihood \cite{rasmussen2003gaussian}.
Formally, let $D_k^i=\{(\mathbf{x}_t^i,y_t^i)\}_{t\in M_k}$ be the training dataset sampled by the robot $i$, where $t$ is the sampling time. $M_k$ is the set of sampling time indices up to time $k$. With the dataset $D_k^i$ of size $m_k^i$, we can simply define the input data matrix as $\mathbf{X}_k^i=[\mathbf{\bar{x}}_{1}^i,\cdots,\mathbf{\bar{x}}_{m_k^i}^i]^\top\in \mathbb{R}^{m_k^i\times 3}$ and the output data vector as
$\mathbf{y}_k^i=[\bar{y}_{1}^i, \cdots, \bar{y}_{m_k^i}^i]^\top\in \mathbb{R}^{m_k^i\times 1}$. According to the test point $\mathbf{x}\in\mathbb{X}_w$, the posterior distribution over $f(\mathbf{x})$ by robot $i$ is derived as follows:
\begin{ceqn}
\begin{equation}\label{eq:posterior_distribution}
p(f(\mathbf{x})|\mathbf{X}_k^i,\mathbf{y}_k^i,\mathbf{x}) \sim \mathcal{N}(\bar{f}^i(\mathbf{x}),\Sigma^i(\mathbf{x})),\\
\end{equation}
\end{ceqn}
where
\begin{subequations}\label{eq:GP_mean_var}
\begin{align}
\bar{f}^i(\mathbf{x})&=\mathbf{k}^\top(\mathbf{X}_k^i,\mathbf{x})(\mathbf{K}(\mathbf{X}_k^i,\mathbf{X}_k^i)+\sigma_{v}^{2}I)^{-1}\mathbf{y}_k^i \label{eq:GP_mean_var(a)},\\
\begin{split}
\Sigma^i(\mathbf{x})&= \kappa(\mathbf{x},\mathbf{x}) \label{eq:GP_mean_var(b)}\\
&\ \ -\mathbf{k}^\top(\mathbf{X}_k^i,\mathbf{x})(\mathbf{K}(\mathbf{X}_k^i,\mathbf{X}_k^i)+\sigma_{v}^{2}I)^{-1}\mathbf{k}(\mathbf{X}_k^i,\mathbf{x}).
\end{split}
\end{align}
\end{subequations}
$\mathbf{K}(\mathbf{X}_k^i,\mathbf{X}_k^i)$ is the $m_k^i\times m_k^i$ kernel matrix whose $(u,v)$-th element is $\kappa(\mathbf{\bar{x}}_u^i,\mathbf{\bar{x}}_v^i)$ for $\mathbf{\bar{x}}_u^i,\mathbf{\bar{x}}_v^i \in \mathbf{X}_k^i$. $\mathbf{k}(\mathbf{X}_k^i,\mathbf{x})$ is the $m_k^i\times 1$ column vector that is also obtained in the same way.
\subsection{Informative Path Planning}\label{subsec:informative_planning}
To obtain the better description of a spatial process model, robots perform informative path planning. It maximizes the \textit{information gain} $\mathbb{I}(;)$, which is the mutual information between the process $f$ and measurements $\mathbf{y}$:
\begin{align}\label{eq:information_gain}
\mathbb{I}(\mathbf{y};f)=\textrm{H}(\mathbf{y})-\textrm{H}(\mathbf{y}|f),
\end{align}
where $\textrm{H}(\cdot)$ is the \textit{entropy} of a random variable. Let $X_{1:k}^i$ be the possible trajectory of robot $i$ and $X_{1:k}=\{X_{1:k}^1,\cdots,X_{1:k}^n\}$ be the possible trajectories of all robots. Then, the multi-robot team's global objective function $J(X_{1:k})$ is defined as follows:
\begin{align}\label{eq:global_objective_function}
J(X_{1:k})=\mathbb{I}(\mathbf{y}_{1:k};f).
\end{align}
$\mathbf{y}_{1:k}$ is the measurements corresponding to $X_{1:k}$. As a result, the optimal trajectories for all agents are defined as follows:
\begin{ceqn}
\begin{equation}\label{eq:optimal_trajectory_all}
\renewcommand{\arraystretch}{1.2
\setlength{\arraycolsep}{-1pt}%
\begin{array}{ r>{{}}l @{\ } l @{\ } r>{{}}l @{\ } l }
X_{1:k}^{*}&=&\argmax\limits_{X_{1:k}}J(X_{1:k})\\
&=&\argmax\limits_{X_{1:k}}\mathbb{I}(\mathbf{y}_{1:k};f)\\
&=&\argmax\limits_{X_{1:k}}(\textrm{H}(\mathbf{y}_{1:k})-\textrm{H}(\mathbf{y}_{1:k}|f)).
\end{array}
\end{equation}
\end{ceqn}
In this study, the entropy $\textrm{H}(\cdot)$ is obtained using GP. With the result of GP estimation \eqref{eq:GP_mean_var}, the optimal trajectory generation for each agent will be addressed in Section \ref{sec:monte_carlo}.
\section{Environmental Learning: Distributed Gaussian Process}\label{sec:spatial_model_learning}
In this section, we expand the conventional GP in Section \ref{subsec:conventional_gp} to the distributed GP. The first step is to expand the conventional kernel \eqref{eq:kernel} to be an infinite sum of eigenfunctions. Then, the expanded kernel is used to make a finite-dimensional GP estimator, and the estimator is reformulated to a distributed form. With a consecutive state update rule, the GP estimator works in a distributed manner.
\subsection{Karhunen–Loève (KL) Kernel Expansion}
Let the usual GP consider $n$ robots. We can simply define the input data matrix for $n$ robots as $\mathbf{X}_k=[\mathbf{X}_k^{1\top},\cdots,\mathbf{X}_k^{n\top}]^\top\in \mathbb{R}^{mn\times 3}$. For simplicity, it is assumed that $m_k^i$'s are same for all robots, and we omit the subscript $k$, so $m^i_k=m$ hereafter. With the matrix $\mathbf{X}_k$, the usual GP requires all the sampled data $\mathbf{X}_k$ and inversion of $K(\mathbf{X}_k,\mathbf{X}_k)$ with $O((mn)^{3})$ operations. These requirements are impractical when peer-to-peer communication is only used, and the computational burden also increases depending on the data size. For this reason, a new kernel method is needed. The kernel \eqref{eq:kernel} can be expanded in terms of eigenfunctions $\phi_{e}$ and corresponding eigenvalues $\lambda_{e}$ as follows \cite{levy2008karhunen}:
\begin{align}\label{eq:eigenfunction_decomposition2}
\kappa(\mathbf{x}',\mathbf{x}'')=\sum\limits_{e=1}^{+\infty}\lambda_{e}\phi_{e}(\mathbf{x}')\phi_{e}(\mathbf{x}''),
\end{align}
where $\lambda_{e}\phi_{e}(\mathbf{x}')=\int_{\mathbb{X}_w}\kappa(\mathbf{x}',\mathbf{x}'')\phi_{e}(\mathbf{x}'')d\mu(\mathbf{x}'')$.
\iffalse
\begin{align}\label{eq:eigenfunction_decomposition1}
\lambda_{e}\phi_{e}(\mathbf{x})=\int_{\chi}\kappa(\mathbf{x},\mathbf{x}')\phi_{e}(\mathbf{x}')d\mu(\mathbf{x}').
\end{align}
\fi
It is difficult to derive the kernel eigenfunctions in a closed-form, but the SE kernel expansion has already been obtained via Hermite polynomials, as mentioned in \cite{zhu1997gaussian}. Then, the process model $f$ for the position $\mathbf{x}\in\mathbb{X}_w$ is expanded as
\begin{align}\label{eq:measurement_model2}
\begin{array}{r @{\ } l @{\ } l>{{}}l @{\ } l }
f(\mathbf{x})&=&\sum\limits_{e=1}^{E}a_{e}\phi_{e}(\mathbf{x})+\sum\limits_{e=E+1}^{+\infty}a_{e}\phi_{e}(\mathbf{x})\\
&=&f_{E}(\mathbf{x})+\sum\limits_{e=E+1}^{+\infty}a_{e}\phi_{e}(\mathbf{x}),
\end{array}
\end{align}
where $a_{e}\sim \mathcal{N}(0,\lambda_{e})$ for $e=1,2,\cdots,\infty$.
\iffalse
\begin{align}\label{eq:measurement_model3}
a_{e}\sim \mathcal{N}(0,\lambda_{e}),\ \ e=1,2,\cdots.
\end{align}
\fi
$f_{E}(\mathbf{x})$ is the $E$-dimensional model of $f(\mathbf{x})$ where $E$ is a constant design parameter. This parameter can be tuned by the SURE strategies \cite{pillonetto2019distributed}. As shown in \cite{zhu1997gaussian}, the optimal $E$-dimensional models can be obtained by a convex combination of the first $E$-kernel eigenfunctions as the size of sampled dataset increases to infinity.
\subsection{Multi-Agent Distributed Gaussian Process}\label{subsec:Multi-agent distributed Gaussian process}
We apply $E$-dimensional approximation to the GP estimator in \eqref{eq:GP_mean_var} to derive the estimation of $f_E(\mathbf{x})$. According to $E$-dimensional approximation, the kernel function \eqref{eq:eigenfunction_decomposition2} can be described as $\kappa(\mathbf{x}',\mathbf{x}'')\approx \sum\limits_{e=1}^{E}\lambda_{e}\phi_{e}(\mathbf{x}')\phi_{e}(\mathbf{x}'')$.
For the input data matrix $\mathbf{X}_k$, kernel matrices included in \eqref{eq:GP_mean_var} are defined by
\begin{subequations}
\begin{align}\label{eq:kernel2}
\renewcommand{\arraystretch}{1.3}
\mathbf{K}(\mathbf{X}_k,\mathbf{X}_k)&= G\Lambda_{E}G^\top,\\
\mathbf{k}(\mathbf{X}_k,\mathbf{x})&=G\Lambda_{E}\Phi(\mathbf{x}),
\end{align}
\end{subequations}
where $\Phi(\mathbf{x}):=
\begin{bmatrix}
\phi_{1}(\mathbf{x}),\cdots,\phi_{E}(\mathbf{x})
\end{bmatrix}^\top$ and $G:=
\begin{bmatrix}
\Phi(\mathbf{\bar{x}}_{1}^{1})\cdots\Phi(\mathbf{\bar{x}}_{m}^{1}),\cdots,\Phi(\mathbf{\bar{x}}_{1}^{n})\cdots\Phi(\mathbf{\bar{x}}_{m}^{n})
\end{bmatrix}^\top$. $\Lambda_{E}$ is the diagonal matrix of kernel eigenvalues.
With \eqref{eq:GP_mean_var(a)} and \eqref{eq:kernel2}, the $E$-dimensional estimator for GP is expressed as follows \cite{pillonetto2019distributed}:
\begin{align}\label{eq:GP_E_dim_mean_estimator}
\renewcommand{\arraystretch}{1.2
\setlength{\arraycolsep}{2pt}%
\begin{array}{ r>{{}}l @{\quad} l @{\quad} r>{{}}l @{\quad} l }
\bar{f}_{E}(\mathbf{x})&:=&
\Phi^\top(\mathbf{x})H_{E}\mathbf{y},
\end{array}
\end{align}
where
\label{eq:GP_E_dim_mean_estimator_sub}
\begin{align}
H_{E}&:=
\left(\dfrac{G^\top G}{mn}+\dfrac{\sigma_{v}^{2}}{mn}\Lambda_{E}^{-1}\right)^{-1}\dfrac{G^\top}{mn}.
\label{eq:GP_E_dim_mean_estimator_sub(b)}
\end{align}
Because each agent cannot obtain $G$ and $\mathbf{y}$ in \eqref{eq:GP_E_dim_mean_estimator} without a fully connected network, we decompose the associated terms included in \eqref{eq:GP_E_dim_mean_estimator_sub(b)} as follows:
\iffalse
\begin{subequations}\label{eq:GP_decomposition}
\begin{equation}\label{eq:GP_decomposition(a)}
\renewcommand{\arraystretch}{1.2
\setlength{\arraycolsep}{2pt}%
\begin{array}{ r>{{}}l @{\quad} l @{\quad} r>{{}}l @{\quad} l }
\ \ \ \ \ \dfrac{G^\top G}{mn}&=
\dfrac{1}{mn}\sum\limits_{i=1}^{n}\sum\limits_{k=1}^{m}\Phi(\mathbf{x}_{k}^{i})\Phi^\top(\mathbf{x}_{k}^{i})\\
&=
\dfrac{1}{n}\sum\limits_{i=1}^{n}\alpha_{m}^{i},\\
\end{array}
\end{equation}
\begin{equation}\label{eq:GP_decomposition(b)}
\renewcommand{\arraystretch}{1.2
\setlength{\arraycolsep}{2pt}%
\begin{array}{ r>{{}}l @{\quad\quad\quad\;\,} l @{\quad} r>{{}}l @{\quad} l }
\dfrac{G^\top\mathbf{y}}{mn}&=\dfrac{1}{mn}\sum\limits_{i=1}^{n}\sum\limits_{k=1}^{m}\Phi(\mathbf{x}_{k}^{i})y_{k}^{i}\\
&=
\dfrac{1}{n}\sum\limits_{i=1}^{n}\beta_{m}^{i},
\end{array}
\end{equation}
\end{subequations}
\fi
\begin{subequations}\label{eq:GP_decomposition}
\begin{equation}\label{eq:GP_decomposition(a)}
\renewcommand{\arraystretch}{1.2
\setlength{\arraycolsep}{2pt}%
\begin{array}{ r>{{}}l @{\quad} l @{\quad} r>{{}}l @{\quad} l }
\dfrac{G^\top G}{mn}&=
\dfrac{1}{mn}\sum\limits_{i=1}^{n}\sum\limits_{t=1}^{m}\Phi(\mathbf{\bar{x}}_{t}^{i})\Phi^\top(\mathbf{\bar{x}}_{t}^{i})=
\dfrac{1}{n}\sum\limits_{i=1}^{n}\alpha_{m}^{i},\\
\end{array}
\end{equation}
\begin{equation}\label{eq:GP_decomposition(b)}
\renewcommand{\arraystretch}{1.2
\setlength{\arraycolsep}{2pt}%
\begin{array}{ r>{{}}l @{\quad\quad\quad\;\,} l @{\quad} r>{{}}l @{\quad} l }
\dfrac{G^\top\mathbf{y}}{mn}&=\dfrac{1}{mn}\sum\limits_{i=1}^{n}\sum\limits_{t=1}^{m}\Phi(\mathbf{\bar{x}}_{t}^{i})\bar{y}_{t}^{i}=
\dfrac{1}{n}\sum\limits_{i=1}^{n}\beta_{m}^{i},
\end{array}
\end{equation}
\end{subequations}
where $\alpha_{m}^{i}:=\sum_{t=1}^{m}\Phi(\mathbf{\bar{x}}_{t}^{i})\Phi^\top(\mathbf{\bar{x}}_{t}^{i})/m$ and $\beta_{m}^{i}:=\sum_{t=1}^{m}\Phi(\mathbf{x}_{t}^{i})\bar{y}_{t}^{i}/m$ are \textit{GP states} after the $m$-th sensor measurements. Now \eqref{eq:GP_E_dim_mean_estimator} is reformulated in the following distributed form:
\begin{ceqn}
\begin{equation}\label{eq:GP_E_dim_mean_estimator2}
\renewcommand{\arraystretch}{1.2
\setlength{\arraycolsep}{2pt}%
\begin{array}{ r>{{}}l @{\quad} l @{\quad} r>{{}}l @{\quad} l }
\bar{f}_{E}^{i}(\mathbf{x})&:=&
\Phi^\top(\mathbf{x})\left(\alpha_{m}^{i}+\dfrac{\sigma_{v}^{2}}{mn}\Lambda_{E}^{-1}\right)^{-1}\beta_{m}^{i}.\\
\end{array}
\end{equation}
\end{ceqn}
As the results of average consensus protocol \cite{saber2003consensus}, \eqref{eq:GP_E_dim_mean_estimator2} converges to \eqref{eq:GP_E_dim_mean_estimator} after iterative communication. Similarly, the distributed form of $\Sigma(\mathbf{x})$ in \eqref{eq:GP_mean_var(b)} is expressed as
\begin{ceqn}
\begin{equation}\label{eq:GP_E_dim_var_estimator}
\renewcommand{\arraystretch}{1.2
\setlength{\arraycolsep}{2pt}%
\begin{array}{ r>{{}}l @{\quad} l @{\quad} r>{{}}l @{\quad} l }
\Sigma_{E}(\mathbf{x})
&:=&
\kappa(\mathbf{x},\mathbf{x})-\Phi^\top(\mathbf{x})H_{E}G\Lambda_{E}\Phi(\mathbf{x}),
\end{array}
\end{equation}
\end{ceqn}
\begin{ceqn}
\begin{equation}\label{eq:GP_E_dim_var_estimator2}
\renewcommand{\arraystretch}{1.2
\setlength{\arraycolsep}{-1pt}%
\begin{array}{ r>{{}}l @{\ } l @{\ } r>{{}}l @{\ } l }
\Sigma_{E}^{i}(\mathbf{x}):&=&\kappa(\mathbf{x},\mathbf{x})-\Phi^\top(\mathbf{x})
\left(\alpha_{m}^{i}+\dfrac{\sigma_{v}^{2}}{mn}\Lambda_{E}^{-1}\right)^{-1}\\
&&\times \alpha_{m}^{i} \Lambda_{E}
\Phi(\mathbf{x}).
\end{array}
\end{equation}
\end{ceqn}
When we compare \eqref{eq:GP_mean_var} with \eqref{eq:GP_E_dim_mean_estimator2} and \eqref{eq:GP_E_dim_var_estimator2}, the computational complexity of the distributed algorithm is $O(E^{3})$, whereas that of the centralized algorithm is $O((mn)^{3})$ due to the matrix inversion \cite{pillonetto2019distributed}. Therefore, the distributed algorithm is more scalable since $E\ll mn$ in general.
\subsection{Online Information Fusion by Moving Agents}\label{subsec:online_information_fusion_by_moving_agents}
If the $(m+1)$-th new training dataset $\{(\mathbf{\bar{x}}_{m+1}^{i},\bar{y}_{m+1}^{i})\}_{i=1}^{n}$ are obtained, $\{\alpha_{m}^{i}\}_{i=1}^{n}$ and $\{\beta_{m}^{i}\}_{i=1}^{n}$ have to be discarded to include new data so that the consensus process must be restarted from scratch. To avoid repeated restarts and keep the continuity of environmental estimate, we introduce the online information fusion algorithm.
Let us assume that the sensor measurement frequencies of all agents are same for convenience. The update rule of $\alpha_{m}^{i}$ and $\beta_{m}^{i}$ is defined as follows:
\begin{ceqn}
\begin{equation}\label{eq:GP_alpha_beta}
\renewcommand{\arraystretch}{1.6
\setlength{\arraycolsep}{2pt}%
\begin{array}{ r>{{}}l @{\ } l @{\ } r>{{}}l @{\ } l }
\alpha_{m+1}^{i}&=&(1-r)\alpha_{m}^{i}+r\Phi(\mathbf{\bar{x}}_{m+1}^{i})\Phi^\top(\mathbf{\bar{x}}_{m+1}^{i}),\\
\beta_{m+1}^{i}&=&(1-r)\beta_{m}^{i}+r\Phi(\mathbf{\bar{x}}_{m+1}^{i})y_{m+1}^{i},
\end{array}
\end{equation}
\end{ceqn}
where $\alpha_{0}^{i}=0$ and $\beta_{0}^{i}=0$. This rule is an infinite impulse response (IIR) filter. If $r=(m+1)^{-1}$, The update rule reflects all dataset equally, so it is suitable for static environmental learning. If $r>(m+1)^{-1}$, this rule reflects more of the recent data, so it is suitable for dynamic environmental learning. Simulation results for each environmental learning are shown in Chapter \ref{sec:simulation}.
\begin{theorem}\label{th:update}
Using an average consensus protocol and update rules in \eqref{eq:GP_alpha_beta}, new data are successively fused with the existing $\{\alpha_{m}^{i}\}_{i=1}^{n}$ and $\{\beta_{m}^{i}\}_{i=1}^{n}$, so that $\{\alpha_{m+1}^{i}\}_{i=1}^{n}$ and $\{\beta_{m+1}^{i}\}_{i=1}^{n}$ converge towards \eqref{eq:GP_decomposition(a)} and \eqref{eq:GP_decomposition(b)}, respectively, in a distributed manner.
\end{theorem}
\begin{proof}
See the Appendix in \cite{jang2020multi}.
\end{proof}
\begin{figure}
\begin{center}
\includegraphics[trim = 0mm 0mm 0mm 0mm, clip, width=8.5cm]{figures/dec_mcts/3/dec_mcts2.pdf}
\caption{Illustration of the distributed MCTS process. Nearby robots exchange their predicted trajectories. These trajectories are used to temporarily update GPs and grow search trees. This process is repeated until the time budget is met.}
\label{fig:distributed_mcts}
\end{center}
\vspace{-0.5cm}
\end{figure}
\section{Path Planning: Distributed Monte Carlo Tree Search}\label{sec:monte_carlo}
Using the distributed model learning discussed in the previous section, all agents create a local environmental map that converges to the global environmental map even in a distributed network. To find the most promising search trajectories with the learned map, all agents should consider every possible action. However, because the cardinality of possible action set grows exponentially with respect to the number of robots, the distributed planning strategy is needed in multi-robot path planning \cite{du2021parallelized}. In \cite{best2019dec}, the decentralized MCTS approach is studied to alleviate the cardinality of possible action set from $\lvert \mathcal{A} \rvert^n$ to $\lvert \mathcal{A} \rvert$, where $\mathcal{A}$ represents the discrete action space of each robot. We apply this advantage to our GP-based informative planning of multiple robots. With the distributed MCTS, each robot calculates a promising trajectory by communication with neighboring agents only. This process is shown in Fig. \ref{fig:distributed_mcts}. This section introduces the trajectory merging method to reflect the neighbor's path in each agent's tree search process. The contents of this section are summarized in Algorithm \ref{al:tree} and \ref{al:distributedMCTS}.
\subsection{Trajectory merging}
For each agent $i$, $X_{k+1:k+T}^i=(\mathbf{\hat{x}}_{k+1}^i,\cdots,\mathbf{\hat{x}}_{k+T}^i)$ denotes the predicted trajectory with the prediction length $T$, or it can be represented by $X_T^i$ for brevity.
Assuming that the agent $i$ receives the predicted trajectories of neighboring agents $X_T^{i-}=\{{X_T^{j}}\}_{j\in\mathcal{N}_{i}}$, we modify the GP sate $\alpha_{m}^{i}$ as follows:
\begin{ceqn}
\begin{equation}\label{eq:GP_alpha_beta2}
\renewcommand{\arraystretch}{1.6
\setlength{\arraycolsep}{2pt}%
\begin{array}{ r>{{}}l @{\ } l @{\ } r>{{}}l @{\ } l }
\hat{\alpha}_{m}^{i}&(X_T^{i-})=\dfrac{mn}{mn+\mathrm{n}(X_T^{i-})}\alpha_{m}^{i}\\
+&\dfrac{\mathrm{n}(X_T^{i-})}{mn+\mathrm{n}(X_T^{i-})}\sum\limits_{j\in\mathcal{N}_i}\sum\limits_{t=1}^{T}\Phi(\mathbf{\hat{x}}_{k+t}^{j})\Phi^\top(\mathbf{\hat{x}}_{k+t}^{j}).
\end{array}
\end{equation}
\end{ceqn}
$\mathrm{n}(X_T^{i-})$ is the number of sensing points included in $X_T^{i-}$. With \eqref{eq:GP_alpha_beta2} and the $E$-dimensional estimator in \eqref{eq:GP_E_dim_var_estimator2}, we define the trajectory-merged GP estimator as follows:
\begin{ceqn}
\begin{equation}\label{eq:GP_E_dim_var_estimator3}
\renewcommand{\arraystretch}{1.2
\setlength{\arraycolsep}{-1pt}%
\begin{array}{ r>{{}}l @{\ } l @{\ } r>{{}}l @{\ } l }
\hat{\Sigma}_{E}^{i}(\mathbf{x}):&=&\kappa(\mathbf{x},\mathbf{x})\\
&&-\Phi^\top(\mathbf{x})
\left(\hat{\alpha}_{m}^{i}+\dfrac{\sigma_{v}^{2}}{mn+\mathrm{n}(X_T^{i-})}\Lambda_{E}^{-1}\right)^{-1}\\
&&\times\hat{\alpha}_{m}^{i}\Lambda_{E}
\Phi(\mathbf{x}).
\end{array}
\end{equation}
\end{ceqn}
In this way, predicted trajectories of neighboring agents are temporarily included in the acquired data set of the GP estimator. Because \eqref{eq:GP_alpha_beta2} and \eqref{eq:GP_E_dim_var_estimator3} are temporary values for tree search in distributed MCTS, they do not affect $\alpha_{m}^{i}$ and disappear after getting new predicted trajectories. This process is summarized in the Distributed MCTS block of Fig. \ref{fig:structure}. With this result, the path planning process will be explained in the next section.
\subsection{Informational reward function}\label{subsec:informational_reward}
As we mentioned in \eqref{eq:global_objective_function}, the information gain $\mathbb{I}$ is the objective function we have to maximize. With the definition in \eqref{eq:optimal_trajectory_all}, the optimal trajectory considering neighboring paths is defined as follows.
\begin{ceqn}
\begin{equation}\label{eq:optimal_trajectory}
\renewcommand{\arraystretch}{1.2
\setlength{\arraycolsep}{-1pt}%
\begin{array}{ r>{{}}l @{\ } l @{\ } r>{{}}l @{\ } l }
X_T^{i*}&=&\argmax\limits_{X_T^{i}\in \mathbb{X}_{k}^{i}}J(X_T^{i}\cup X_T^{i-}\cup X_{1:k})\\
&=&\argmax\limits_{X_T^{i}\in \mathbb{X}_{k}^{i}}\mathbb{I}(\mathbf{y}_{T}^{i} \cup \mathbf{y}_{T}^{i-}\cup \mathbf{y}_{1:k};f),
\end{array}
\end{equation}
\end{ceqn}
$\mathbf{y}_T^i$ and $\mathbf{y}_T^{i-}$ are the measurements corresponding to $X_T^i$ and $X_T^{i-}$, respectively. $\mathbb{X}_{k}^{i}$ is the domain of possible trajectories for agent $i$. As shown in \eqref{eq:information_gain}, information gain is represented with entropies as follows:
\begin{ceqn}
\begin{equation}
\renewcommand{\arraystretch}{1.2
\setlength{\arraycolsep}{-1pt}%
\begin{array}{ r>{{}}l @{\ } l @{\ } r>{{}}l @{\ } l }
\mathbb{I}(\mathbf{y}_{T}^{i}\cup \mathbf{y}_{T}^{i-}\cup \mathbf{y}_{1:k};f)&=&\textrm{H}(\mathbf{y}_{T}^{i}\cup \mathbf{y}_{T}^{i-}\cup \mathbf{y}_{1:k})\\
&&-\textrm{H}(\mathbf{y}_{T}^{i}\cup \mathbf{y}_{T}^{i-}\cup \mathbf{y}_{1:k}|f).\\
\end{array}
\end{equation}
\end{ceqn}
Using the mesuarement model \eqref{eq:measurement_model} and the entropy calculation for the normal distribution \cite{srinivas2012information}, conditional entropy becomes
\begin{ceqn}
\begin{equation}
\renewcommand{\arraystretch}{1.2
\setlength{\arraycolsep}{-1pt}%
\begin{array}{ r>{{}}l @{\ } l @{\ } r>{{}}l @{\ } l }
\textrm{H}(\mathbf{y}_{T}^{i}\cup \mathbf{y}_{T}^{i-}\cup \mathbf{y}_{1:k}|f)=\frac{1}{2}\log{|2\pi e \sigma_{v}^{2}I|}.
\end{array}
\end{equation}
\end{ceqn}
$\textrm{H}(\mathbf{y}_{T}^{i}\cup \mathbf{y}_{T}^{i-}\cup \mathbf{y}_{1:k})$ is decomposed using conditional entropy, and it is obtained by calculating the entropy of GP as follows:
\begin{ceqn}
\begin{equation}
\renewcommand{\arraystretch}{1.2
\setlength{\arraycolsep}{-1pt}%
\begin{array}{ r>{{}}l @{\ } l @{\ } r>{{}}l @{\ } l }
\textrm{H}(\mathbf{y}_{T}^{i}\cup \mathbf{y}_{T}^{i-}\cup \mathbf{y}_{1:k})&=&\textrm{H}(\mathbf{y}_{T}^{i-}\cup \mathbf{y}_{1:k})+\textrm{H}(\mathbf{y}_{T}^{i}|\mathbf{y}_{T}^{i-}\cup \mathbf{y}_{1:k})\\
&\approx&\textrm{H}(\mathbf{y}_{T}^{i-}\cup \mathbf{y}_{1:k})+\frac{1}{2}\log{|2\pi e \hat{\Sigma}_{E}^{i}(X_{T}^{i})|}.\\
\end{array}
\end{equation}
\end{ceqn}
As a result, with the trajectory-merged GP estimator in \eqref{eq:GP_E_dim_var_estimator3}, the optimal trajectory for agent $i$ is defined as follows:
\begin{ceqn}
\begin{equation}\label{eq:optimal_trajectory2}
\renewcommand{\arraystretch}{1.2
\setlength{\arraycolsep}{-1pt}%
\begin{array}{ r>{{}}l @{\ } l @{\ } r>{{}}l @{\ } l }
X_{T}^{i*}&=&\argmax\limits_{X_{T}^{i}\in \mathbb{X}_{k}^{i}}J(X_{T}^{i}\cup X_{T}^{i-}\cup X_{1:k})\\
&\approx&\argmax\limits_{X_{T}^{i}\in \mathbb{X}_{k}^{i}}\frac{1}{2}\log{|2\pi e \hat{\Sigma}_{E}^{i}(X_{T}^{i})|}\\
&=&\argmax\limits_{X_{T}^{i}\in \mathbb{X}_{k}^{i}}\mathcal{R}^{i}(X_{T}^{i}).\\
\end{array}
\end{equation}
\end{ceqn}
We call $\mathcal{R}^{i}(\cdot)$ the \textit{informational reward function}, which is utilized in the tree search algorithm.
\begin{figure}
\begin{center}
\includegraphics[width=0.45\textwidth]{figures/closing/closing8.pdf}
\caption{Node closing method for obstacle avoidance in MCTS. (left) finite action space that the robot can take. (right) tree expansion and node closing process.}
\label{fig:closing}
\end{center}
\vspace{-0.5cm}
\end{figure}
\subsection{Tree Search with D-UCB Alogrithm}
Using the informational reward function defined in \ref{subsec:informational_reward}, the tree search algorithm iteratively explores and evaluates predictive path candidates according to the discounted upper confidence bound (D-UCB) rule to find the optimal path. D-UCB rule assigns the probabilistic search priority to the action candidates.
The tree structure consists of nodes $s$ and edges $(s,a)$ for all legal actions $a\in \mathcal{A}(s)$. Each edge contains a set of variables $\{N_{s}^{a}, W_{s}^{a}, \tau_{s}^{a}, C_{s}^{a}\}$ where $N_{s}^{a}$ is the visit count, $W_{s}^{a}$ is the total action value, $\tau_{s}^{a}$ is the number of iterations for tree search (shown in line 5 of Algorithm \ref{al:distributedMCTS}), and $C_{s}^{a}$ is a closing variable which will be discussed. We follow the tree search process in Algorithm \ref{al:tree} and the distributed MCTS with GP in Algorithm \ref{al:distributedMCTS}. The MCTS process can be divided into four main steps as follows.
\subsubsection{Selection} (lines 4, 12-22 of Algorithm \ref{al:tree}) The selection phase focuses on finding a leaf node $s_{\textit{leaf}}$. Following the D-UCB rule, the selected action at node $s$ is defined as follows \cite{srinivas2012information}:
\begin{ceqn}
\begin{equation}\label{eq:UCB_action}
\renewcommand{\arraystretch}{1.2
\setlength{\arraycolsep}{-1pt}%
\begin{array}{ r>{{}}l @{\ } l @{\ } r>{{}}l @{\ } l }
a_{t}=\argmax\limits_{a\in\mathcal{A}(s)}\left(\dfrac{W_{s}^{a}\gamma^{\tau-\tau_{s}^{a}}}{N_{s}^{a}\gamma^{\tau-\tau_{s}^{a}}}+U_{s}^{a}\right),
\end{array}
\end{equation}
\end{ceqn}
where
\begin{ceqn}
\begin{equation}\label{eq:UCB1}
\renewcommand{\arraystretch}{1.2
\setlength{\arraycolsep}{-1pt}%
\begin{array}{ r>{{}}l @{\ } l @{\ } r>{{}}l @{\ } l }
U_{s}^{a}=\sqrt{\dfrac{\ln\sum_{a'\in\mathcal{A}(s)}{N_{s}^{a'}\gamma^{\tau-\tau_{s}^{a'}}}}{N_{s}^{a}\gamma^{\tau-\tau_{s}^{a}}}}.
\end{array}
\end{equation}
\end{ceqn}
The first term on the right-hand side of \eqref{eq:UCB_action} means exploration term for the tree search, and the second term means exploitation term. As shown in Algorithm \ref{al:distributedMCTS}, each agent periodically receives the predicted trajectories of adjacent agents, which are utilized in the tree search process. It means that the tree, obtained by using previously given trajectories, may not be optimal when new neighboring trajectories are received. Therefore, adopting the discount factor $\gamma$ makes the previously visited nodes less influential on the current UCB value.
If the current node has no selectable actions because of path blockage, the node closes ($C_{s}^{a}\leftarrow 1$) and the algorithm returns to the parent node to restart the selection process. We call this process as node closing method illustrated in Fig. \ref{fig:closing} and lines 15-21 of Algorithm \ref{al:tree}.
\renewcommand{\algorithmiccomment}[1]{\(\hfill\hfill\hfill\hfill\hfill\hfill\hfill\hfill\hfill\hfill\hfill\hfill\hfill\hfill\hfill\hfill\triangleright\ \)#1}
\normalem
\begin{algorithm}[t]
\caption{Tree Search with Obstacle Avoidance}\label{al:tree}
\DontPrintSemicolon
\Fn{TreeSearch$(T_{k}^{i},\tau)$}{
$s_{0}\leftarrow$ \emph{getRootNode}$(T_{k}^{i})$\;
\For{$t\leftarrow 1\ ${\normalfont to }$N_{\text{iteration}}$}
{
$s_{\textit{leaf}}\leftarrow$ \emph{selection}$(s_{0},\tau)$\;
$(s_{t},a)\leftarrow$ \emph{expansion}$(s_{\textit{leaf}},\tau)$\;
\If{collisionCheck$(s_{t})$}{
$C_{s_{\textit{leaf}}}^{a}\leftarrow$ \textit{true}\;
\Continue\;
}
$r_{t}\leftarrow$ \emph{simulation}$(s_{t})$\;
\emph{backprop}$(s_{t},r_{t})$\;
}
\KwRet $T_{k}^{i}$\;
}
\Fn{selection$(s_{\textit{leaf}},\tau)$}{
\While{\Not leafNodeFound}
{
\If{\Not $depth(s_{leaf})>T$}
{
\If{$C_{s_{\textit{leaf}}}^{a}=\textit{true}\ \forall{a\in\mathcal{A}(s_{\textit{leaf}})}$}
{
$C_{s_{\textit{leaf}-1}}^{a_{\textit{leaf}-1}}\leftarrow \textit{true}$\;
back to the parent node\;
$s_{\textit{leaf}}\leftarrow s_{\textit{leaf}-1}$\;
}
\Else{$a\leftarrow$D-UCB($s_{\textit{leaf}},\tau$)\Comment{eq. \eqref{eq:UCB_action}}\;
$s_{\textit{leaf}}\leftarrow getNode(s_{\textit{leaf}},a)$\;}
}
}
\KwRet $s_{\textit{leaf}}$\;
}
\Fn{simulation$(s_{t})$}{
$X_{T}^{i}\leftarrow$ trajectory from $s_{0}$ to $s_{t}$\;
\For{$j\leftarrow\ $depth$(s_{t})\ ${\normalfont to }$T$}
{
$X_{T}^{i}\leftarrow\{X_{T}^{i},\textit{randomWalk}(\mathbf{x}_{k+j}^{i})\}$\;
}
\KwRet $\mathcal{R}^{i}(X_{T}^{i})$\;
}
\end{algorithm}
\ULforem
\subsubsection{Expansion} (line 5 of Algorithm \ref{al:tree})
The expansion phase expands the selected node with uniformly sampled action from the action space $\mathcal{A}(s)$ if the depth of the selected node does not exceed the search depth $T$. When the expanded node collides with an obstacle, the algorithm closes this edge ($C_{s}^{a}\leftarrow 1$) and returns to the selection phase.
\subsubsection{Simulation} (lines 9, 23-27 of Algorithm \ref{al:tree}) In the simulation phase, it calculates the informational reward $\mathcal{R}_{i}(X_T^i)$ of the selected trajectory. If the selected node's depth is less than the search depth $T$, it performs random walks. After that, the reward is calculated with the predicted trajectory $X_{T}^{i}$ as shown in Section \ref{subsec:informational_reward}.
\subsubsection{Backpropagation} (line 10 of Algorithm \ref{al:tree}) The edge variables are updated in a backward pass. The visit counts are incremented, $N_{s}^{a}\leftarrow N_{s}^{a}\gamma^{\tau-\tau_{s}^{a}}+1$, and the total action value is updated, $W_{s}^{a}\leftarrow W_{s}^{a}\gamma^{\tau-\tau_{s}^{a}}+R_{i}$. As described in the \textit{selection} step, the discount factor $\gamma$ is applied to reduce the weight of the previous value.
\renewcommand{\algorithmiccomment}[1]{\(\hfill\hfill\hfill\hfill\hfill\hfill\hfill\hfill\hfill\hfill\hfill\hfill\hfill\hfill\hfill\hfill\triangleright\ \)#1}
\normalem
\begin{algorithm}[t]
\caption{Distributed MCTS with GP for agent $i$}\label{al:distributedMCTS}
\DontPrintSemicolon
\KwInput{$\mathbf{x}^{i}_{k},\alpha^{i}_{m-1},\beta^{i}_{m-1},X_{T}^{i-}$}
\KwOutput{$X_{T}^{i}$}
$y^{i}_{k}\leftarrow$\emph{getMeasurement}$(\mathbf{x}^{i}_{k})$\Comment{eq. \eqref{eq:measurement_model}}\;
$(\alpha^{i}_{m},\beta^{i}_{m})\leftarrow$\emph{updateGP}$(\alpha^{i}_{m-1},\beta^{i}_{m-1},\mathbf{x}^{i}_{k},y^{i}_{k})$\Comment{eq. \eqref{eq:GP_alpha_beta}}\;
$(\alpha_{m}^{i},\beta_{m}^{i})\leftarrow$\emph{GPconsensus}$(\alpha_{m}^{i},\beta_{m}^{i})$\Comment{eq. (18) in \cite{jang2020multi}}\;
$T_{k}^{i}\leftarrow$\emph{initializeTree}$(\mathbf{x}_{k}^{i})$\;
\For{$\tau\leftarrow 1\ ${\normalfont to }$N_{\text{search}}$}
{
$(\hat{\alpha}_{m}^{i},\hat{\beta}_{m}^{i})\leftarrow$\emph{TrajectoryMerging}$(X_{T}^{i-})$\Comment{eq. \eqref{eq:GP_alpha_beta2}}\;
$T_{k}^{i}\leftarrow$ \emph{TreeSearch}$(T_{k}^{i},\hat{\alpha}_{m}^{i},\hat{\beta}_{m}^{i},\tau)$\Comment{Algorithm \ref{al:tree}}\;
$X_{T}^{i}\leftarrow$ \emph{getBestTraj}$(T_{k}^{i})$\;
$X_{T}^{i-}\leftarrow$ \emph{communicateTraj}$(X_{T}^{i})$\;
}
\KwRet $X_{T}^{i}$\;
\end{algorithm}
\ULforem
\section{Simulation Result}\label{sec:simulation}
This section presents environmental learning simulations on the various situations. The first simulation is on a time-invariant synthetic environment, and the second is on a dynamic environment based on the real-world meteorological dataset. These environmental models are unknown a priori, and each robot obtains the sensory data from the current location. Furthermore, since the communication range is finite, some agents may not be able to communicate with each other.
\begin{figure*}[ht]
\begin{center}
\includegraphics[trim = 0mm 0mm 0mm 0mm, clip, width=0.9\textwidth]{figures/simulation/sim5/4/xlarge_dist_GP_dec_mcts_2.pdf}
\caption{Simulation 1-A. The process of the environmental model construction by 12 agents with fully distributed informative planning. (a) Change of GP estimate and (b) uncertainty propagation over time from $0$ to $50$ seconds in order from the left figure. (c) Ground truth of environmental model. Yellow lines in (b) indicate communication links between agents. All presented results are obtained by agent $\#1$ (red dot in (b)). (d) Environmental model estimation error. The solid green line shows the box plot of RMSE values between all agents and the ground truth. The dashed red line shows the box plot of RMSE values between all agents and the agent $\#1$. This graph means that all GP estimation results converge to the same result with only local communication.}
\label{fig:simulation1}
\end{center}
\vspace{-0.5cm}
\end{figure*}
\begin{figure*}[ht]
\centering
\begin{minipage}{0.3\textwidth}
{\includegraphics[width=1.0\textwidth]{figures/simulation/sim7/2/902_log_dist_GP_dec_mcts_depth_RMSE_avg.pdf}}
\caption*{(a) Search depths}
\end{minipage}
\begin{minipage}{0.3\textwidth}
\centering
{\includegraphics[width=1.0\textwidth]{figures/simulation/sim7/2/903_log_dist_GP_dec_mcts_iter_RMSE_avg.pdf}}
\caption*{(b) Number of iterations}
\end{minipage}
\begin{minipage}{0.3\textwidth}
\centering
{\includegraphics[width=1.0\textwidth]{figures/simulation/sim7/2/904_log_dist_GP_dec_mcts_agent_RMSE_avg.pdf}}
\caption*{(c) Number of agents}
\end{minipage}
\caption{Simulation 1-B. Environmental model construction with different conditions. (a) 6 agents' exploration results with different search depths. (b) 8 agents' exploration results with the different number of iterations. (c) Exploration results with the different number of agents.}
\label{fig:simulation2}
\vspace{-0.5cm}
\end{figure*}
\subsection{Simulation 1 - synthetic environment learning}
We perform the fully distributed informative planning simulation for multiple agents. They conduct exploration to obtain an estimate of the environmental map, considering collision avoidance and coordination. They can communicate only with neighbors within a range of 10 m (the map size is $20$ m $\times$ $20$ m) and move at $1$ m/s constantly. We set $\sigma_{s}^2=1$ and $\Sigma_l=\text{diag}([0.02, 0.02])$ for the Gaussian kernel \eqref{eq:kernel}, and we set $E=80$ for $E$-dimensional estimator \eqref{eq:GP_E_dim_mean_estimator} and \eqref{eq:GP_E_dim_var_estimator}.
The progress over time from $0$ to $50$ seconds is shown in Fig. \ref{fig:simulation1}. As shown in Figs. \ref{fig:simulation1}(a)-(b), twelve agents search the map together and generate the GP estimate presenting the ground truth model in \ref{fig:simulation1}(c). The agents scatter naturally and find the next locations to be updated based on the variance map. Also, as they avoid the places where the estimate is already reliable, they can minimize the redundant actions that can decrease the exploration efficiency. Through Fig. \ref{fig:simulation1}(b), it can be confirmed that the information of all agents is diffused through a communication link.
Although Figs. \ref{fig:simulation1}(a)-(b) show results from agent $\#1$ only, all the distributed GP estimates of each agent converge to the same by the average consensus as shown in Fig. \ref{fig:simulation1}(d). In other words, all agents do not simply use local information only in the exploration process but construct a global GP estimation map in a distributed manner.
\begin{figure}[ht]
\centering
\includegraphics[width=0.4\textwidth]{figures/simulation/sim8/2/908_log_all_GP_all_mcts_RMSE_avg.pdf}
\caption{Simulation 1-C. 4 agents' exploration results with different type of systems for 10 trials (with different environments).}
\label{fig:simulation3}
\vspace{-0.5cm}
\end{figure}
\begin{figure*}[ht]
\begin{center}
\includegraphics[trim = 0mm 0mm 0mm 0mm, clip, width=0.95\textwidth]{figures/simulation/sim6/3/seoul_dist_GP_dec_mcts_1.pdf}
\caption{Simulation 2. The process of the real-world heat map reconstruction performed by 6 moving UAVs with fully distributed informative planning. (a) Actual change of the heat map and (b) Environmental learning result from $0$ to $5$ hours in order from the left figure. (c) Initial locations and trajectories of UAVs.}
\label{fig:simulation4}
\end{center}
\vspace{-0.5cm}
\end{figure*}
We conduct more simulations in various environments to investigate the factors that affect search performance. In the tree search algorithm, the search depth $T$ and the number of iterations $N_{iterations}$ are the factors that directly affect the search result. The simulation results in Figs. \ref{fig:simulation2}(a)-(b) show that the search performance is proportional to both $T$ and $N_{iterations}$. The deeper the search, the more distant paths are considered. As the number of searching iterations increases, the probability of finding an optimal route increases. Fig. \ref{fig:simulation2}(c) shows that the search performance can be improved as the number of agents increases through a distributed algorithm. From these results, we can see that our algorithm is scalable for a large number of robots as well.
Fig. \ref{fig:simulation3} compares the search performance of distributed systems, centralized systems, and independent systems. In the independent system, agents explore the area without communication. The centralized system has a central server that gathers all the information regardless of the communication range, and the server calculates paths for all agents.
Because the action space of centralized system $(\mathrm{n}(\mathcal{A})^n)$ is much bigger than that of distributed system $(\mathrm{n}(\mathcal{A}))$, we set about 22 times more $N_{iterations}$ for the centralized system than the distributed system. Even with limited communication and much fewer iterations, the distributed system performs similarly to the centralized system.
\subsection{Simulation 2 - real-world dataset environmental learning}
This section presents simulation result for the exploration in a dynamic environment (Fig. \ref{fig:overview}), using a real-world meteorological dataset. The simulation uses temperature data collected from weather stations in Seoul, South Korea \cite{ncdc}. The reason we choose the weather data for Seoul is that weather stations are densely distributed (the area of Seoul is $605.25\ \text{km}^{2}$). We create a heat map for a ground truth based on the data measured from 0 am to 5 am on July 16th, 2020.
In this scenario, a team of UAVs flies over the search area and gathers temperature data from the current UAV's location. They fly at a constant velocity of 20 km/h. Because their communication distance is limited to 20 km, sometimes they can be disconnected from one another.
Some snapshots taken during the simulation are shown in Fig. \ref{fig:simulation4}. The ground truth over time is shown in Fig. \ref{fig:simulation4}(a), and the GP estimation is shown in Fig. \ref{fig:simulation4}(b). After 1.7 hours, the estimation result is similar to the ground truth. After that, the results track the true value continuously even when the actual environment changes.
\section{Conclusions}
This paper presents fully distributed robotic sensor networks to obtain a global environmental model estimate. We combine the Gaussian process with the Monte Carlo tree search in a distributed manner for peer-to-peer communication. Our method allows multiple robots to collaboratively perform exploration, taking into account collision avoidance and coordination. We validate our algorithm in various environments, including a time-varying temperature monitoring task using a real-world dataset. The results confirm that multiple agents can successfully explore the environment, and it is scalable with the increasing number of agents in the distributed network.
\ifCLASSOPTIONcaptionsoff
\newpage
\fi
| {'timestamp': '2021-12-30T02:22:17', 'yymm': '2112', 'arxiv_id': '2112.14433', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14433'} | arxiv |
\section{Introduction} \label{sec:intro}
Stochastic dynamic matching problems,
in which items arrive at random instants
to be matched with other items,
have recently drawn a lot of attention
in the stochastic-modeling community.
These challenging control problems
are indeed highly relevant in many applications, including
supply-chain management,
pairwise kidney exchange programs,
and online marketplaces.
In pairwise kidney exchange programs for example,
each item represents a donor-receiver pair,
and two pairs can be matched
if the donor of each pair
is compatible with the receiver of the other pair.
In online marketplaces,
items are typically divided into two categories,
called demand and supply,
and the objective is
to maximize a certain long-term performance criteria
by appropriately matching
demand items with supply items.
In this paper, we consider the following
dynamic matching problem.
Items of different classes
arrive according to independent Poisson processes.
Compatibility constraints between items
are described by a simple graph on their classes,
such that two items can be matched
if their classes are neighbors in the graph.
Unmatched items are stored
in the queue of their class,
and the matching policy decides
which matches are performed and when.
All in all, a stochastic matching model
is described by a triplet $(G, \mu, \Phi)$,
where $G = (\V, \E)$ is the compatibility graph,
$\mu = (\mu_1, \mu_2, \ldots, \mu_n)$
is the vector of per-class arrival rates,
and $\Phi$ is the matching policy.
In \Cref{fig:illustration} for instance,
there are four item classes
numbered from~1 to~4;
classes~2 and~4 are compatible with all classes,
while classes~1 and~3 are only
compatible with classes~2 and~4.
\def1{1}
\def.4{.4}
\newcommand{\queue}[2]{
\begin{tikzpicture}[rotate=#1]
\draw (0, 0) -- (1, 0) -- (1, .4) -- (0, .4);
\ifthenelse{#2>0}{
\foreach \x in {1,..., #2}
{\draw[fill=blue!90!black] ({1*(1-(\x-1)/8)}, 0) -- ({1*(1-\x/8)}, 0)
-- ({1*(1-\x/8)}, .4) -- ({1*(1-(\x-1)/8)}, .4) -- cycle;}
}{}
\end{tikzpicture}
}
\begin{figure}[ht]
\centering
\begin{tikzpicture}
\node[class] (1) {\queue{0}{2}};
\path (1) ++(30:3.2cm) node[class] (2) {\queue{-90}{0}};
\path (2) ++(-30:3.2cm) node[class] (3) {\queue{180}{6}};
\path (2) ++(-90:3.2cm) node[class] (4) {\queue{90}{4}};
\draw (2) ++(0,1.5) edge[->] node[right] {$\mu_2$} ++(0,-1);
\draw (4) ++(0,-1.5) edge[->] node[right] {$\mu_4$} ++(0,+1);
\draw (1) ++(-1.5, 0) edge[->] node[above] {$\mu_1$} ++(1, 0);
\draw (3) ++(1.5,0) edge[->] node[above] {$\mu_3$} ++(-1,0);
\draw (1) edge node[above, sloped] {$\lambda_{1, 2}$} (2)
(1) edge node[above, sloped] {$\lambda_{1, 4}$} (4)
(3) edge node[above, sloped] {$\lambda_{2, 3}$} (2)
(3) edge node[above, sloped] {$\lambda_{3, 4}$} (4)
(2) edge node[right] {$\lambda_{2, 4}$} (4);
\end{tikzpicture}
\caption{Illustration of a matching model $(G, \mu, \Phi)$ on the diamond graph. \label{fig:illustration}}
\end{figure}
We propose a unified approach
to study two closely-related performance criteria,
namely the stability and the matching rates along edges.
Formally, a matching model $(G, \mu, \Phi)$
is said to be stable
if the associated continuous-time Markov chain
is positive recurrent.
Assuming that the matching model $(G, \mu, \Phi)$ is stable,
the matching rate $\lambda_k$
along an edge~$k \in \E$
with endpoints $i, j \in \V$
is the rate at which
class-$i$ items and class-$j$ items
are matched.
\subsection{Contributions}
The following observation
is powerful despite its simplicity,
and it is fundamental to all our results.
Under any stable policy,
the arrival rate of class-$i$ items
is equal to the departure rate of these items,
which in turn is equal to the sum of the matching rates
along the edges that are incident to node~$i$.
In other words, the matching rates satisfy
the following \emph{conservation} equation:
\begin{align*}
\sum_{k \in \E_i} \lambda_k = \mu_i,
\quad i \in \V,
\end{align*}
where $E_i \subseteq \E$
is the set of edges that are incident to node~$i$.
In matrix form, this equation rewrites $A \lambda = \mu$,
where $A$ is the incidence matrix
of the compatibility graph~$G$.
The solution set of this conservation equation
is related to the structure of the graph~$G$
via the linear application
$y \in \R^m \mapsto Ay \in \R^n$,
where $n$ is the number of nodes (or classes),
and $m$ is the number of edges.
We say that the graph~$G$
is surjective (resp.\ injective, bijective)
if the linear application
$y \in \R^m \mapsto Ay \in \R^n$
is surjective (resp.\ injective, bijective),
and we give simple equivalent conditions
in terms of the graph structure
(\Cref{def:surjective,def:injective,def:bijective,def:only,prop:dimensions}).
Our main contributions are threefold,
and all rely on these definitions.
We first prove that there exists a direct relation between
the possible solutions
of the conservation equation,
the structure of the compatiblity graph,
and the existence of a stable policy.
More specifically,
we prove that a compatibility graph~$G$ is stabilizable
(in the sense that there exist a vector~$\mu$
and a policy~$\Phi$ such that the matching model
$(G, \mu, \Phi)$ is stable)
if and only if the graph~$G$ is surjective
(\Cref{prop:stability-region-nonempty}).
We then prove that a matching problem~$(G, \mu)$
is stabilizable
(in the sense that there exists a policy~$\Phi$
such that the matching model $(G, \mu, \Phi)$ is stable)
if and only if the conservation equation
has a solution with positive components
(\Cref{prop:stability-region-form}).
In particular,
this allows us to verify stabilizability
in a time that is polynomial
in the number of classes and edges.
We next describe the affine space
of solutions of the conservation equation
and the convex polytope of solutions
with non-negative components.
When this convex polytope
is reduced to a single point,
we derive a closed-form expression for the solution
(\Cref{prop:unicyclic}).
When this convex polytope
is not reduced to a single point,
we characterize its vertices,
again using the graph structure.
We prove in particular that
a non-negative solution of the conservation equation
is a vertex of the convex polytope if and only if
the subgraph restricted to the support
of this vector is injective
(\Cref{prop:vertex}).
Lastly, we investigate the parts of the polytope that can be achieved by an actual stable policy.
We first focus on greedy policies, i.e. policies that never postpone a feasible match.
We show that greedy policies are limited to the interior of the polytope and that in general, the inclusion is strict
(\Cref{prop:greedypositive,prop:greedyCompleteGraph,prop:greedyDiamond,cor:greedyDiamond}).
In contrast, non-greedy policies can reach any point of the interior of this polytope (\cref{prop:converging-semigreedy,cor:semigreedy-interior}). They can also reach part or all the boundary of this polytope, depending on conditions that are again
expressed in terms of the bijectivity of subgraphs of~$G$ (\Cref{prop:vertex-stability,cor:vertex-stability}).
\subsection{State of the art}
We now review the relevant work
related to (static or dynamic) matching problems.
\paragraph*{Non-bipartite or general stochastic matching}
Our work is part of a broader research effort
on the stochastic matching model
that will be described in details
in \Cref{subsec:model}
\cite{BMM21,BMMR20,CDFB20,C22,JMRS20,MM16,MBM21}.
Among these works, the following are particularly relevant
because directly related to our results on stability.
The paper~\cite{MM16} is the earliest work
on this matching model.
It derives several
necessary and sufficient
stability conditions that
are instrumental in several of our results,
in particular \Cref{prop:stability-region-nonempty,prop:stability-region-form}.
This work also proves that the \emph{match-the-longest} policy
is maximally stable (in the sense that always leads to stability whenever the matching problem $(G, \mu)$ is stabilizable), a result
that is also applied
in \Cref{prop:stability-region-form}.
The papers~\cite{C22,MBM21} focus
on the \emph{first-come-first-matched} policy.
In particular, \cite{MBM21} proves
that the first-come-first-matched policy
is maximally stable,
and~\cite{C22} provides
a new sufficient stability condition
we prove to be also necessary
in \Cref{prop:stability-region-form}.
Other variants of the model
were studied recently,
and an interesting future work
would consist of generalizing our results
to these variants.
In particular, the paper~\cite{JMRS20}
consider item abandonments,
the paper~\cite{BMMR20}
considers graphs with loops,
and the papers~\cite{GW14,NS19,RM21}
allow matches between several items
by replacing the graph with a hypergraph.
The recent paper~\cite{BMM21}
is perhaps the closest to ours,
and we provide a detailed discussion
to highlight the relation with our paper.
The equivalence of statements~(ii) and~(iv)
in \cite[Theorem~1]{BMM21}
is synonym to the equivalence of
statements~\ref{cond:stability-region-form-2}
and~\ref{cond:stability-region-form-3}
in \Cref{prop:stability-region-form}.
Our proof is significantly shorter
because it relies more heavily
on existing results.
\cite[Theorem~4]{BMM21}
is a special case of our observation
at the beginning of \Cref{sec:unicyclic}
that the conservation equation has a unique solution
if and only if the graph is bijective
(and not surjective-only).
Several other formulas derived in
\cite[Section~7]{BMM21}
are special cases of
the formulas derived in \Cref{prop:unicyclic}.
The model in~\cite{BMM21}
is slightly more general
because it consider graphs with loops,
that is, an edge can have identical endpoints,
but this paper does not adopt
the mixed graph-theory
and linear-algebra approach
that supports most of our results.
\paragraph*{Bipartite stochastic matching}
The first example of a stochastic matching model
in the literature,
which predated the model that we consider,
is the bipartite matching model
introduced in~\cite{CKW09}
and studied
in~\cite{ABMW17,AW12,ADW21,BGM13,BM16,CBD19,CD21}.
In this model, the compatibility graph is bipartite,
with two parts that correspond
to supply and demand items,
respectively.
This bipartite model differs from ours
by its arrival process:
time is slotted and, during each time slot,
one demand item \emph{and} one supply item arrive.
Several works have made contributions about
stability~\cite{AW12,BGM13}
and matching rates~\cite{AW12},
and obtained results similar
to those derived in the literature
on our model.
The bipartite nature of the graph
simplifies some calculations, for instance
by allowing the application
of flow-maximization algorithms
to calculate optimal matching rates.
\paragraph*{Static and fractional matching}
The static matching problem,
in which the nodes of the graph
represent items (rather than classes),
has been extensively studied
in mathematics, computer science, and economy~\cite{LP09}.
Although the questions raised
in static and dynamic matching are often different,
the conservation equation that we obtain
is reminiscent of several results in static matching.
For example,
finding a maximum-cardinality matching
in the graph~$G$
(that is, a maximum-cardinality set
of edges without common endpoints)
is equivalent to finding integers
$\lambda_k \in \{0, 1\}$ for each edge~$k \in \E$
that maximize $\sum_{k \in \E} \lambda_k$
while satisfying the conservation equation
with $\mu_i = 1$ for each $i \in \V$.
The relaxation of this integer linear program
leads to the so-called fractional matching problem,
which has been studied
in the literature~\cite[Section~7.2]{LP09}.
Therefore, the fractional matching polytope
defined in \cite[Section~7.5]{LP09}
is a special case of the convex polytope
that we consider in \Cref{subsec:positive-solutions},
and our characterization of this convex polytope
is a natural generalization
of existing characterizations of the fractional polytope
\footnote{The fractional matching polytope is actually defined using non-strict inequalities rather than equalities.
However, one can verify that both convex polytopes have the same non-zero vertices.}.
\subsection{Outline}
The remainder of the paper is organized as follows.
\Cref{sec:model}
gives a formal definition of the model and explains our approach.
In particular, we introduce the conservation equation
and define the notions of
surjective, injective, and bijective graph
that will be instrumental
in the rest of the paper.
In \Cref{sec:stability},
we give necessary and sufficient stability conditions
in terms of the solutions of the conservation equation.
\Cref{sec:unicyclic,sec:general}
characterize the solution set
of the conservation equation
and give a closed-form expression of the solution
when it is unique.
Lastly, in \Cref{sec:non-unicyclic},
we study the set of matching rates
that are effectively achievable
under a stable matching policy.
\section{Model and approach} \label{sec:model}
We now provide a detailed description of our model and introduce the concepts of injective, surjective, and bijective compatibility graphs.
\subsection{Stochastic dynamic matching} \label{subsec:model}
Consider a stochastic dynamic matching system
in which items arrive at random times
to be matched with other items.
Each incoming item may be matched
with any unmatched item of a compatible class;
in this case, both items disappear immediately.
Unmatched items are gathered in a waiting queue.
In this paper, such a stochastic dynamic matching system
will be described by a triplet $(G, \mu, \Phi)$,
where $G$ is the compatibility graph,
$\mu$ is the vector of arrival rates,
and $\Phi$ is the matching policy.
We now review each component in details.
Notation is summarized in \cref{table:notation},
and an example is shown in \Cref{fig:illustration}.
\subsubsection{Compatibility graph}
Compatibility constraints between items
are described by a graph $G=(V, E)$,
called the \emph{compatibility graph} of the model,
which is simple
(undirected and without loop).
We let $n$ denote the number of nodes
and $m$ the number of edges.
The set of nodes is denoted by
$\V = \{v_1, v_2, \ldots, v_n\}$,
and each node corresponds to a class in the matching model.
When there is no ambiguity, for ease of notation,
we will refer to a class~$v_i$ using its index~$i$.
The set of edges is denoted by
$\E = \{e_1, e_2, \ldots, e_m\}$.
These edges represent compatibility constraints
between item classes, in the sense that
a class-$i$ item and a class-$j$ item
can be matched with one another
if and only if there is an edge with endpoints~$i$ and~$j$ in the graph.
When there is no ambiguity, for ease of notation,
we will refer to an edge $e_k \in \E$ with endpoints $i, j \in \V$
using either its index~$k$ or its set of endpoints $\{i, j\}$.
In \Cref{fig:illustration} for instance,
there are four item classes numbered from~$1$ to~$4$.
Classes~$2$ and~$4$ are compatible with all classes,
but classes~$1$ and~$3$ are only compatible
with classes~$2$ and~$4$.
The absence of loop means that an item of a given class
cannot be matched with other items of the same class.
\subsubsection{Vector of arrival rates}
Class-$i$ items arrive according to an independent Poisson process with rate $\mu_i>0$, for each $i \in \V$. The vector of arrival rates is denoted by $\mu = (\mu_1, \mu_2, \ldots, \mu_n) \in \Rp^n$. Scaling all components of~$\mu$ by the same positive constant is equivalent to changing the time unit, so we can renormalize $\mu$ without changing the system dynamics. In this paper, we will often use the \emph{unit} normalization in which~$\sum_{i \in \V} \mu_i = 1$.
The couple $(G, \mu)$ is called a \emph{matching problem}.
\subsubsection{Matching policy}
Given a matching problem $(G, \mu)$,
the policy specifies,
upon each item arrival,
which matches are performed
depending on the system state
and the class of the incoming item.
The nature of the information that
the state needs to retain
in order to obtain a continuous-time Markov chain
depends on the policy that we consider.
To overcome this difficulty, we assume that
the state descriptor is an integral part
of the definition of a policy.
Formally, a matching policy~$\Phi$
is a tuple $(\C, \pi)$,
where $\C$ is a countably infinite state space
and $\pi$ is a function that defines transitions.
More specifically,
for each $c \in \C$ and $i \in \V$,
$\pi(\cdot | c, i): \C \to \Rnn$
is a probability distribution on $\C$,
so that $\pi(d|c, i)$ is the probability
that the system jumps from state~$c$ to state~$d$
upon the arrival of a class-$i$ item.
We assume that the matching policy is \emph{adapted}
to the matching problem $(G, \mu)$,
in the sense that
only items with compatible classes are matched,
and matches occur only upon item arrivals.
In the rest of the paper,
we will focus exclusively
on matching policies
that satisfy \Cref{ass:policy} below.
\begin{assumption} \label{ass:policy}
We assume that the matching policy~$\Phi$
satisfies the following assumptions:
\begin{enumerate}
\item \label{ass:policy-1}
The evolution of the system state
defines a continuous-time
irreducible Markov chain
with state space~$\C$.
\item \label{ass:policy-2}
The system state contains enough information
to calculate the sizes of the waiting queues of the system, i.e. the number of unmatched items of each class.
In other words, there exists a function
$h: \C \to \N^n$ such that,
for each $c \in \C$ and $i \in \V$,
the $i$-th component of the vector $h(c)$
is the number of unmatched class-$i$ items in state~$c$.
\item \label{ass:policy-3}
The state space $\C$ contains a state $\varnothing$ such that $h(\varnothing)=0$,
and we have $h(c) \neq 0$ for each $c \in \C \setminus \{\varnothing\}$.
We call $\varnothing$ the \emph{empty state}.
\end{enumerate}
\end{assumption}
\noindent Statement~\ref{ass:policy-1} in \Cref{ass:policy}
is standard~\cite{BGM13,MM16}.
Statements~\ref{ass:policy-2} and~\ref{ass:policy-3}
guarantee that the intuitive notion of system stability
is indeed captured by the positive recurrence
of the Markov chain $\{X(t), t \ge 0\}$,
as formalized in \Cref{def:stability} below.
These two statements will be applied
in the proofs of \Cref{prop:stability-region-greedy,prop:greedyCompleteGraph,prop:greedyDiamond,cor:greedyDiamond}.
These proofs remain valid if there are multiple empty sets,
as long as
the preimage $h^{-1}(0) = \{c \in \C: h(c) = 0\}$
of the vector $0 \in \N^n$ is a finite set.
Statement~\ref{ass:policy-3} will also be applied
in the proof of
\Cref{prop:convexity}.
Not all policies have an empty state; for example, this statement rules out policies that match an incoming item only when there are already at least two unmatched items (assuming the initial state is not empty).
We call $(h(c))_i$, the number of unmatched class-$i$ items in state~$c$, the \emph{queue size of $i$ in $c$} ($c$ is ommitted if it is clear in the context). Similarly, we say that \emph{queue $i$ is empty} (resp. non-empty) to express that $(h(c))_i=0$ (resp. $(h(c))_i>0$).
We now introduce some examples of policies that will be used in the paper.
\paragraph*{Greedy policies}
A policy is said to be \emph{greedy}
if an incoming item is matched
as soon as it arrives if possible, that is,
when there is an unmatched item that is compatible.
Equivalently, a policy is greedy
if the set of unmatched items classes under this policy
is always an independent set of the compatibility graph.
Here are two examples of deterministic greedy policies:
\begin{itemize}
\item \textbf{Match-the-longest}:
an incoming item is matched immediately
with an item of the compatible class
that has the longest queue, if any.
The system state
$q = (q_1, q_2, \ldots, q_n)$
gives the queue size of each class,
and its state space is
$\C = \{q \in \N^n: q_i q_j = 0
\text{ if } j \in \V_i\}$, where $V_i \subset V$ is the set of nodes adjacent to node $i$, for each $i \in \V$.
The transition probabilities are as follows:
\begin{itemize}
\item if there is $j \in \V_i$
such that $q_j > 0$,
then $\pi(q - e_{j^*}|q, i) = 1$,
where $j^* = \text{argmax}_{j \in \V_i}(q_j, j)$ (we use the class index to tie-break queues of same size)
and $e_{j^*}$ is the $n$-dimensional vector
with~$1$ in component~$j^*$ and~0 elsewhere;
\item otherwise, $\pi(q + e_i|q,i) = 1$.
\end{itemize}
As a state of \emph{match-the-longest} is exactly the sizes of the queues, its function $h$ is the identity ($h(q)=q$).
\item \textbf{First-come-first-matched}:
an incoming item is matched immediately
with the compatible item
that has been waiting the longest, if any.
The system state
$c = (c_1, c_2, \ldots, c_p)$
gives the sequence of unmatched item classes,
ordered by arrival times,
so that $c_1$ is the class
of the oldest unmatched item.
The state space $\C \subseteq \V^*$ is made of all finite sequences that do not contain items from compatible classes.
In other words, $\C = \bigcup_{\I \in \ind} \I^*$, where $\ind$ is the set of independent sets of the graph~$G$.
The transition probabilities are as follows:
\begin{itemize}
\item if there exists $r \in \{1, 2, \ldots, p\}$
such that $c_r \in \V_i$,
$\pi(c'|c,i) = 1$
with $c' = (c_1, \ldots, c_{r^*-1},$
$c_{r^*+1}, \ldots, c_p)$,
where $r^* = \min\{r \in \{1, 2, \ldots, p\}: c_r \in \V_i\}$;
\item otherwise,
$\pi(c'|c,i) = 1$ with
$c' = (c_1, c_2, \ldots, c_p, i)$.
\end{itemize}
The function $h$ associated to a \emph{first-come-first-matched} policy is just a counter function: $(h(c))_i=|\{j \in c: j=i\}|$.
\end{itemize}
Note that an empty state $\varnothing$ exists for every greedy policy as long as the compatibility graph~$G$ has no isolated node: from any state with unmatched items, an empty state can be reached with an appropriate sequence of incoming items.
\paragraph*{Filtering policies}
A policy is said to be \emph{filtering} if there exists $\E' \subsetneq E$ such that for any state $c\in \C$ and arrival node $i \in \V$, the probability to choose $e \notin E'$ when the state is $c$ and an item of class $i$ arrives is $0$. Informally, a filtering policy operates on a subgraph $G' = (\V, \E')$ of $G$. The edges from $E'$ (resp. from $E\setminus E '$) are called the \emph{allowed} edges (resp. the \emph{forbidden} edges) of the policy.
A policy is said to be \emph{semi-filtering} with a threshold $k$ if there exists $\E' \subsetneq E$ such that for any state $c\in \C$ such that $\max_{j\in \V}(h(c))_j < k$ and arrival node $i \in \V$, the probability to choose $e \notin E'$ when the state is $c$ and an item of class $i$ arrives is $0$. Informally, a semi-filtering policy acts as a filtering policy \emph{as long as the queue sizes are not too big}.
A greedy policy like \emph{match-the-longest} can be turned into a filtering or semi-filtering policy by making it operate on a subgraph $G'$ (up to a threshold $k$ for the semi-filtering case). In general, the resulting policy is not greedy (on $G$), but it still admits an empty state $\varnothing$ as long as the subgraph $G'$ has no isolated node.
Filtering and semi-filtering versions of \emph{match-the-longest} will be used in \Cref{sec:non-unicyclic}.
\paragraph*{Stability}
In the remainder, we will identify
the \emph{matching model} $(G, \mu, \Phi)$
with the continuous-time Markov chain $\{X(t), t \ge 0\}$. This allows us to define the notions of \emph{stability}, \emph{stabilizability}, and \emph{maximal stability} in \Cref{def:stability} below.
\begin{definition}[Stability, Stabilizability, and Maximal stability] \label{def:stability} ~
\begin{enumerate}
\item A matching model $(G, \mu, \Phi)$ is called \emph{stable}
if the associated Markov process $\{X(t), t \ge 0\}$ is positive recurrent.
\item A compatiblity graph~$G$ is called \emph{stabilizable}
if there exist
a vector $\mu \in \Rp^n$ of arrival rates
and a matching policy~$\Phi$
such that
the matching model $(G, \mu, \Phi)$ is stable.
\item A matching problem $(G, \mu)$
is called \emph{stabilizable}
if there exists a matching policy~$\Phi$ such that
the matching model $(G, \mu, \Phi)$ is stable.
\item A \emph{generic} policy is a function $\Phi$ that associates, to each compatibility graph~$G$, a matching policy $\Phi(G)$ adapted to $G$.
A generic policy $\Phi$ is called \emph{maximally stable} if the matching model $(G, \mu, \Phi(G))$ is stable whenever $(G, \mu)$ is stabilizable.
\end{enumerate}
\end{definition}
With a slight abuse of language, we also use the term \emph{generic policy} to describe the matching policy $\Phi(G)$ for any compatibility graph~$G$.
The greedy policies \emph{match-the-longest} and \emph{first-come-first-matched} introduced above are obviously generic. They
were proved to be maximally stable in~\cite{MM16,MBM21}.
\begin{remark}
On a broader note, our definition of a matching policy is intended to be general, but we still impose several limitations for ease of notation.
For instance, our assumption that items can only be matched upon arrivals rules out policies that perform matches in batches at fixed time intervals.
We believe that all our results can be extended to other policies if necessary on a case-by-cases basis.
\end{remark}
\subsubsection{Vector of matching rates and conservation equation}
If the matching model $(G, \mu, \Phi)$ is stable, the \emph{matching rate} $\lambda_k$ along edge~$e_k = \{i, j\}$ is defined as the long-run average number of matches between a class-$i$ item and a class-$j$ item per time unit.
Let $\lambda(G, \mu, \phi) = (\lambda_1, \ldots, \lambda_m) \in \Rnn^m$
denote the vector of matching rates associated with $(G, \mu, \phi)$.
For ease of notation, in the rest of the paper, we will use $\lambda(\Phi)$ or~$\lambda$, instead of $\lambda(G, \mu, \Phi)$, if the underlying matching problem or model is clear in the context.
These matching rates satisfy the following
\emph{conservation} equation:
\begin{align} \label{eq:system-equations}
\sum_{k \in \E_i} \lambda_k = \mu_i,
\quad i \in \V,
\end{align}
where $\E_i \subseteq \E$
is the set of edges that are incident to node~$i$,
for each $i \in \V$.
In matrix form, this conservation equation writes
\begin{align} \label{eq:system-matrix}
A \lambda = \mu,
\end{align}
where the $n \times m$ matrix~$A = (a_{i, k})_{i \in \V, k \in \E}$
is the \emph{incidence} matrix of the graph~$G$,
defined by $a_{i, k} = 1$ if edge~$k$ is incident to node~$i$
and $a_{i, k} = 0$ otherwise.
The majority of the results presented here are deeply connected to the conservation equation~\eqref{eq:system-matrix}. In particular, the last part of the paper focuses on the solutions of \eqref{eq:system-matrix} and considers, for a given stabilizable problem $(G, \mu)$, the following sets:
\begin{align*}
\La &= \{y \in \R^m: A y = \mu\}\text{ (studied in \cref{subsec:all-solutions}),}\\
\Lann &= \{y \in \Rnn^m: A y = \mu\}\text{ (studied in \cref{subsec:positive-solutions}),}\\
\Lap &= \{y \in \Rp^m: A y = \mu\}\text{ (introduced in \cref{sec:non-unicyclic}),}\\
\La_\Gre &= \left\{\lambda(\Phi): \Phi\text{ is a stable greedy policy}\right\}\text{ (studied in \cref{subsec:greedy-rates}),}\\
\La_\Pol &= \left\{\lambda(\Phi): \Phi\text{ is a stable policy}\right\}\text{ (studied in \cref{subsec:nongreedy-rates}).}
\end{align*}
Note that, while it is not the main focus of the present work, long-term matching rates can usually be defined even if the matching model $(G, \mu, \Phi)$ is unstable. In that case, the sum of matching rates along the edges incident to a node are at most equal to the arrival rates, that is, $A\lambda \leq \mu$. \Cref{lemma:phi-inf} shows an example of an unstable policy that admits a limit matching rate.
\begin{table}[ht!]
\begin{tabular}{|l|p{10cm}|}
\hline
\multicolumn{2}{|c|}{General notation} \\
\hline \hline
$\N, \R, \Rnn, \Rp$ & Sets of non-negative integers, real numbers, non-negative real numbers, positive real numbers. \\
\hline
$\ge$, $\le$, $>$, $<$ & Component-wise comparison in $\R^n$. \\
\hline
$|\A|$ & Cardinality of the set $\A$. \\
\hline \hline
\multicolumn{2}{|c|}{Graph notation} \\
\hline \hline
$G=(V, E)$ & Simple graph $G$ with $|V|=n$ vertices and $|E|=m$ edges. \\
\hline
$v_i$ & Vertex indexed by $i$ (denoted $i$ if there is not ambiguity). \\
\hline
$e_{i, j}$, $\{i, j\}$, or $e_k$ & Edge between vertices $i$ and $j$, indexed by $k$. \\
\hline
$\ind$ & Family of independent sets of the graph~$G$. \\
\hline
$\V_i \subseteq \V$ & Set of neighbors of node~$v_i$ in the graph~$G$. \\
\hline
$\V(\I) = \bigcup_{i \in \I} \V_i$ & Set of neighbors of the vertices indexed by the independent set~$\I \in \ind$. \\
\hline
$d_{i, j}$ & Distance between nodes~$i$ and~$j$. \\
\hline
$d_{i, k} = \min(d_{i,j}, d_{i,j'})$ & Distance between node~$i$ and edge~$k$ with endpoints $j$ and $j'$. \\
\hline
$\K_\ell$ & Complete graph of size $\ell\geq 3$. \\
\hline
$\Cy_\ell$ & Cycle of size $\ell\geq 3$. \\
\hline
$\Pa_\ell$ & Path of length $\ell\geq 0$.\\
\hline
$\KP_{\ell, r, p}$ & Kayak paddle: two cycles $\Cy_\ell$ and $\Cy_r$ attached by a path $\Pa_p$. \\
\hline \hline
\multicolumn{2}{|c|}{Matching notation} \\
\hline \hline
$\mu=(\mu_i)_{1\leq i \leq n}$ & Vector of arrival rates of the item classes. \\
\hline
$\Phi$ & A matching policy. \\
\hline
$\lambda =(\lambda_k)_{1\leq k \leq m}
=(\lambda_{i, j})_{\{i, j\}\in E}$ & Vector of matching rates along the edges. \\
\hline
$\La_\Pol$ & Set of matching rates achieved by stable policies. \\
\hline
$\La_\Gre$ & Set of matching rates achieved by stable greedy policies. \\
\hline \hline
\multicolumn{2}{|c|}{Linear-algebra notation} \\
\hline \hline
$x = (x_1, x_2, \ldots, x_n)$ & A vector in $\R^n$.
All vectors in $\R^n$ are column vectors. \\
\hline
$y = (y_1, y_2, \ldots, y_m)$ & A vector in $\R^m$.
All vectors in $\R^m$ are column vectors. \\
\hline
$A = (a_{i, k})_{i \in \V, k \in \E}$ & Incidence matrix of the graph~$G$. \\
\hline
$A^\intercal = (a_{k, i})_{k \in \E, i \in \V}$
& Transpose of the matrix~$A$. \\
\hline
$\ker(A) = \{y \in \R^m: Ay = 0\}$ & Right kernel of the matrix~$A$.
Its dimension is called the nullity of~$A$. \\
\hline
$\ker(A^\intercal) = \{x \in \R^n: A^\intercal x = 0\}$
& Left kernel of the matrix~$A$.
Its dimension is the nullity of $A^\intercal$. \\
\hline
$d = m - n$ & Dimension of the right kernel of the matrix~$A$ if $G$ is surjective. \\
\hline
$\B=(b_1, \ldots, b_d)$ & Basis of the right kernel of the matrix~$A$ if $G$ is surjective. \\
\hline
$\La=\{y \in \R^m: A y = \mu\}$ & Affine space of the solutions of the conservation equation \eqref{eq:system-matrix}. \\
\hline
$\Lann = \{y \in \Rnn^m: A y = \mu\}$ & Polytope of non-negative solutions of \eqref{eq:system-matrix}. \\
\hline
$\Lap = \{y \in \Rp^m: A y = \mu\}$ & Set of positive solutions of \eqref{eq:system-matrix}. \\
\hline
\end{tabular}
\caption{Table of notation \label{table:notation}}
\end{table}
\subsubsection{Numerical evaluation}
To support the results presented in this paper, especially the ones from \Cref{sec:non-unicyclic}, simulations were performed using the Python package \emph{Stochastic Matching}~\cite{SM22}. Unless otherwise stated, a matching model is evaluated by simulating $10^{10}$ arrivals.
\subsection{Surjectivity, injectivity, and bijectivity} \label{subsec:graph}
\Cref{def:surjective,def:injective,def:bijective,def:only} below
introduce the notions of \emph{surjectivity},
\emph{injectivity}, and \emph{bijectivity} of a graph.
In a nutshell, a compatibility graph~$G$ is said to be
surjective (resp.\ injective, bijective)
if the linear application defined by its incidence matrix~$A$
is surjective (resp.\ injective, bijective).
Interestingly, we find equivalent conditions
in terms of the graph structure.
As we will see later,
these notions are fundamental to study
the stability of stochastic matching models
and the associated matching rates.
In particular, we will see in \Cref{sec:stability}
that a compatiblity graph~$G$ is stabilizable
if and only if $G$ is surjective
in the sense of \Cref{def:surjective}.
Later, in \Cref{sec:stability,sec:unicyclic},
we will see that the matching rates
in a matching problem $(G, \mu)$
are independent of the matching policy~$\Phi$
(as long as the model is stable)
if and only if $G$ is bijective
in the sense of \Cref{def:bijective}.
Examples are shown in \Cref{fig:surjective-injective}.
\begin{figure}[ht]
\subfloat[Graph that is neither surjective nor injective. \\
The nullity of $A^\intercal$ is 1 and the nullity of $A$ is 1.]{
\begin{tikzpicture}[
every node/.style={, minimum size=.3cm}]
\node[class] (1) {$1$};
\path (1) ++(30:1.3cm) node[class] (2) {$2$};
\path (1) ++(-30:1.3cm) node[class] (4) {$4$};
\path (4) ++(+30:1.3cm) node[class] (3) {$3$};
\draw (1) edge (2)
(1) edge (4)
(2) edge (3)
(4) edge (3);
\node at ($(1)-(2cm,0)$) {};
\node at ($(3)+(2cm,0)$) {};
\end{tikzpicture}
}
\hfill
\subfloat[Surjective-only graph. \\
The nullity of $A^\intercal$ is 0
and the nullity of $A$ is 1.]{
\begin{tikzpicture}[
every node/.style={, minimum size=.3cm}]
\node[class] (1) {$1$};
\path (1) ++(30:1.3cm) node[class] (2) {$2$};
\path (1) ++(-30:1.3cm) node[class] (4) {$4$};
\path (4) ++(+30:1.3cm) node[class] (3) {$3$};
\draw (1) edge (2)
(1) edge (4)
(2) edge (3)
(4) edge (3)
(2) edge (4);
\node at ($(1)-(2cm,0)$) {};
\node at ($(3)+(2cm,0)$) {};
\end{tikzpicture}
}
\\
\subfloat[Injective-only graph. \\
The nullity of $A^\intercal$ is 1 and the nullity of $A$ is 0.]{
\begin{tikzpicture}[
every node/.style={, minimum size=.3cm}]
\node[class] (1) {$1$};
\path (1) ++(-90:1.3cm) node[class] (2) {$2$};
\path (1) ++(-30:1.3cm) node[class] (3) {$3$};
\path (3) ++(0:1.3cm) node[class] (4) {$4$};
\draw (1) edge (3)
(2) edge (3)
(3) edge (4);
\node at ($(1)-(2cm,0)$) {};
\node at ($(4)+(2cm,0)$) {};
\end{tikzpicture}
}
\hfill
\subfloat[Bijective graph. \\
The nullity of $A^\intercal$ is 0 and the nullity of $A$ is 0.]{
\begin{tikzpicture}[
every node/.style={, minimum size=.3cm}]
\node[class] (1) {$1$};
\path (1) ++(-90:1.3cm) node[class] (2) {$2$};
\path (1) ++(-30:1.3cm) node[class] (3) {$3$};
\path (3) ++(0:1.3cm) node[class] (4) {$4$};
\draw (1) edge (2)
(1) edge (3)
(2) edge (3)
(3) edge (4);
\node at ($(1)-(2cm,0)$) {};
\node at ($(4)+(2cm,0)$) {};
\end{tikzpicture}
}
\caption{Examples of surjective and injective graphs.}
\label{fig:surjective-injective}
\end{figure}
\begin{definition}[Surjective graph] \label{def:surjective}
Consider a simple graph $G = (\V, \E)$
with $n$ nodes and $m$ edges.
Let~$A$ denote the $n \times m$ incidence matrix of~$G$.
The graph~$G$ is called \emph{surjective}
if one of the following equivalent conditions is satisfied:
\begin{enumerate}
\item \label{surjective-1}
The function $y \in \R^m \mapsto Ay \in \R^n$ is surjective.
\item \label{surjective-2}
The equation $A y = \mu$
of unknown $y \in \R^m$
has at least one solution
for each $\mu \in \R^n$.
\item \label{surjective-3}
The left kernel of the matrix~$A$ is trivial.
\item \label{surjective-4}
Each connected component of the graph~$G$ is non-bipartite.
\end{enumerate}
\end{definition}
\begin{proof}
The equivalence of
conditions~\ref{surjective-1}, \ref{surjective-2},
and \ref{surjective-3} is a well-known result
in linear algebra.
We prove that conditions~\ref{surjective-3}
and~\ref{surjective-4} are equivalent.
This proof is adapted from \cite[Lemma~2.2.3]{C04}.
Let $a_1, a_2, \ldots a_n$ denote
the rows of the matrix~$A$,
so that $a_i = (a_{i,k})_{k \in \{1, \ldots, m\}}$,
where $a_{i, k} = 1$ if node~$i$ is an endpoint of edge~$k$,
and $a_{i, k} = 0$ otherwise.
A vector $x = (x_1, x_2, \ldots, x_n) \in \R^n$
belongs to the left kernel of the matrix~$A$ if and only if
\begin{align*}
x_1 a_1 + x_2 a_2 + \ldots + x_n a_n = 0.
\end{align*}
For each $k \in \{1, \ldots, m\}$,
the $k$-th component of this equation reads $x_j = - x_i$,
where $i$ and $j$ are the endpoints of edge~$k$.
An induction argument shows that,
for every path $i_1, i_2, \ldots, i_k$
in the graph~$G$,
we have $x_{i_p} = (-1)^p x_{i_1}$
for each $p \in \{1, 2, \ldots, k\}$.
First assume that each connected component of~$G$ is non-bipartite,
and let $\V'$ denote
the set of nodes in a given connected component.
Since this component is non-bipartite,
there exists a cycle
$i_1, i_2, \ldots, i_k, i_{p+1} = i_1$
consisting of an odd number~$p$ of nodes.
The previous remark implies that $x_{i_1} = 0$,
which in turn implies that $x_i = 0$ for each $i \in \V'$.
On the contrary,
if there exists a connected component of~$G$
that is bipartite with parts $\V_+$ and $\V_-$,
then we build a non-zero vector by choosing
$x_i = 1$ for each $i \in \V_+$,
$x_i = -1$ for each $i \in \V_-$,
and $x_i = 0$ for each $i \in \V \setminus (\V_+ \cup \V_-)$.
\end{proof}
\begin{definition}[Injective graph] \label{def:injective}
Consider a simple graph $G = (\V, \E)$
with $n$ nodes and $m$ edges.
Let~$A$ denote the $n \times m$ incidence matrix of~$G$.
The graph~$G$ is called \emph{injective}
if one of the following equivalent conditions is satisfied:
\begin{enumerate}
\item \label{injective-1}
The function $y \in \R^m \mapsto Ay \in \R^n$ is injective.
\item \label{injective-2}
The equation $A y = \mu$
of unknown $y \in \R^m$
has at most one solution
for each $\mu \in \R^n$.
\item \label{injective-3}
The right kernel of the matrix~$A$ is trivial.
\item \label{injective-4}
Each connected component of the graph~$G$
contains at most one odd cycle and no even cycle;
in other words, each connected component of~$G$
is either a tree or a unicyclic graph with an odd cycle.
\end{enumerate}
\end{definition}
\begin{proof}
The equivalence of
conditions~\ref{injective-1}, \ref{injective-2},
and \ref{injective-3} is a well-known result
in linear algebra.
We now prove that conditions~\ref{injective-3}
and~\ref{injective-4} are equivalent.
Let us assume for now
that the graph~$G$ is connected.
We first remark that the proof of \Cref{def:surjective} shows that
the nullity of $A^\intercal$
is 0 if $G$ is non-bipartite
and $1$ if $G$ is bipartite.
We therefore distinguish two cases:
\begin{itemize}
\item If~$G$ is non-bipartite,
the nullity of $A^\intercal$ is~0.
The rank-nullity theorem implies that
the rank of $A^\intercal$ is~$n$,
so that the rank of $A$ is also~$n$.
A second application of the rank-nullity theorem
implies that the nullity of $A$ is $m - n$.
In particular, $\ker(A) = \{0\}$
if and only if $m = n$.
\item If~$G$ is bipartite,
the nullity of $A^\intercal$ is~1,
and we conclude similarly that
the nullity of $A$ is $m - n + 1$.
In particular, $\ker(A) = \{0\}$
if and only if $m = n - 1$.
\end{itemize}
All in all, we obtain that condition~\ref{injective-3} is true
if and only if
either the graph~$G$ is non-bipartite
and contains as many edges as nodes,
or the graph~$G$ is bipartite
and contains one less edge than it contains nodes.
This, in turn, is equivalent to condition~\ref{injective-4}.
If the graph~$G$ is not connected,
we can rewrite the matrix~$A$ as a bloc matrix
in which each bloc corresponds to a connected component,
and we can then use the previous argument
to prove the equivalence for each connected component.
\end{proof}
\begin{definition}[Bijective graph] \label{def:bijective}
Consider a simple graph~$G = (\V, \E)$
with $n$~nodes and $m$~edges.
Let $A$ denote the $n \times m$ incidence matrix of~$G$.
The graph~$G$ is called \emph{bijective}
if the following equivalent conditions are satisfied:
\begin{enumerate}
\item \label{bijective-1}
The function $y \in \R^m \mapsto Ay \in \R^n$ is bijective.
\item \label{bijective-2}
The equation $A y = \mu$
of unknown $y \in \R^m$
has exactly one solution
for each $\mu \in \R^n$.
\item \label{bijective-3}
The matrix~$A$ is invertible.
\item \label{bijective-4}
Each connected component of the graph~$G$
contains one cycle and this cycle is odd.
\end{enumerate}
\end{definition}
\begin{proof}
The function $y \in \R^m \mapsto Ay \in \R^n$ is bijective
if and only if it is both surjective and injective.
Hence, the equivalence of
conditions~\ref{bijective-1} to~\ref{bijective-4}
follows directly from \Cref{def:surjective,def:injective}.
\end{proof}
\begin{definition}[Surjective-only graph and injective-only graph] \label{def:only}
A simple graph~$G$ is called
\emph{surjective-only} (resp.\ \emph{injective-only})
if~$G$ is surjective but not injective
(resp.\ injective but not surjective).
\end{definition}
The following proposition
gives necessary conditions for surjectivity and injectivity
in terms of the number of nodes and edges in the graph.
\begin{proposition} \label{prop:dimensions}
Consider an undirected graph~$G = (\V, \E)$
with $n$ nodes and $m$ edges.
\begin{enumerate}
\item \label{dimensions-1}
If~$G$ is surjective, then $n \le m$.
\item \label{dimensions-2}
If~$G$ is injective, then $n \ge m$.
\item \label{dimensions-3}
If~$G$ is bijective, then $n = m$.
\item \label{dimensions-4}
If $G$ is surjective,
then $G$ is also injective
if and only if $n = m$.
\item \label{dimensions-5}
If $G$ is injective,
then $G$ is also surjective
if and only if $n = m$.
\end{enumerate}
\end{proposition}
\begin{proof}
These statements are again well-known results in linear algebra.
\end{proof}
\section{Stability conditions} \label{sec:stability}
This section gives necessary and sufficient conditions
under which a compatiblity graph~$G$ or a matching problem~$(G, \mu)$
is \emph{stabilizable} in the sense of \Cref{def:stability}.
\subsection{Stabilizable graph} \label{subsec:stability-region-nonempty}
The following proposition gives
necessary and sufficient conditions
for a graph~$G$ to be stabilizable,
in terms of either its structure
or its incidence matrix.
\begin{proposition} \label{prop:stability-region-nonempty}
Let~$G$ be an undirected graph.
The following conditions are equivalent:
\begin{enumerate}
\item \label{cond:stability-region-nonempty}
The graph~$G$ is stabilizable.
\item \label{cond:stability-region-nonempty-1}
The graph~$G$ is surjective.
\end{enumerate}
\end{proposition}
\begin{proof}
Equivalence between condition~\ref{cond:stability-region-nonempty}
in \Cref{prop:stability-region-nonempty}
and condition~\ref{surjective-4} in \Cref{def:surjective}
has been proved in \cite[Theorem~1]{MM16}.
\end{proof}
Unless stated otherwise, in the rest of the paper,
we assume that the graph~$G$ is surjective.
The equivalence between
condition~\ref{cond:stability-region-nonempty}
in \Cref{prop:stability-region-nonempty}
and condition~\ref{surjective-4} in \Cref{def:surjective}
was already proved in \cite{MM16}
in the context of stochastic matching models.
However, to the best of our knowledge,
the equivalence between
condition~\ref{cond:stability-region-nonempty}
in \Cref{prop:stability-region-nonempty}
and the other definitions of surjectivity introduced in \Cref{def:surjective}
has not been considered
in the literature on stochastic matching models yet.
As we will see later, this new characterization
of the stabilizability of a graph~$G$
will be useful to analyze the matching rates.
\subsection{Stabilizable arrival rates} \label{subsec:stability-region-form}
We now turn to the stabilizability
of a matching problem~$(G, \mu)$.
As recalled in \Cref{subsec:model}, two examples of greedy policies
that stabilize the model
whenever this matching problem is stabilizable are
\emph{match-the-longest}~\cite{MM16}
and \emph{first-come-first-matched}~\cite{MBM21}.
\Cref{prop:stability-region-form} below
provides necessary and sufficient conditions
for the matching problem $(G, \mu)$ to be stabilizable;
condition~\ref{cond:stability-region-form-2}
was already derived in \cite{MM16},
but condition~\ref{cond:stability-region-form-3} is new.
\begin{proposition} \label{prop:stability-region-form}
Consider an undirected surjective graph~$G$
and a vector~$\mu \in \Rp^n$.
The following conditions are equivalent:
\begin{enumerate}
\item \label{cond:stability-region-form-1}
The matching problem $(G, \mu)$ is stabilizable.
\item \label{cond:stability-region-form-2}
For each $\I \in \ind$,
we have $\sum_{i \in \I} \mu_i
< \sum_{i \in \V(\I)} \mu_i$.
\item \label{cond:stability-region-form-3}
The conservation equation~\eqref{eq:system-matrix}
has a solution~$\lambda \in \Rp^m$ (i.e., with all components positive).
\end{enumerate}
\end{proposition}
\begin{proof}
Equivalence of conditions~\ref{cond:stability-region-form-1}
and~\ref{cond:stability-region-form-2}
follows from Lemma~1, Proposition~2, and Theorem~2 in~\cite{MM16}.
We now prove that
conditions~\ref{cond:stability-region-form-2}
and~\ref{cond:stability-region-form-3}
are equivalent.
Condition~\ref{cond:stability-region-form-2}
implies condition~\ref{cond:stability-region-form-3} because:
(i) according to~\cite{MM16},
under condition~\ref{cond:stability-region-form-2},
$(G, \mu, \Phi)$ is stable if $\Phi$ is the \emph{match-the-longest} policy, and
(ii) the associated vector~$\lambda$ of matching rates
satisfies condition~\ref{cond:stability-region-form-3}
by ergodicity.
That condition~\ref{cond:stability-region-form-3}
implies condition~\ref{cond:stability-region-form-2}
was proved in \cite[Lemma~12]{C22}.
\end{proof}
One might imagine that
the time complexity to verify
condition~\ref{cond:stability-region-form-2}
in \Cref{prop:stability-region-form}
is exponential in the number~$n$ of classes in general,
as the number of independent sets
itself is exponential in~$n$.
Yet it was proved in \cite[Proposition~1]{MM16}
that there exists an $O(n^3)$-time algorithm
to verify this condition.
Unfortunately, this verification is indirect
in the sense that it requires constructing
a second graph
called the bipartite double cover of~$G$.
From this perspective,
condition~\ref{cond:stability-region-form-3}
gives a more direct way of verifying
whether a graph~$G$ is stabilizable.
We make a case disjunction,
depending on whether the graph~$G$
(which we have assumed to be surjective)
is surjective-only or bijective.
\begin{remark}
\label{rem:degree-proportional}
As observed in \cite[Lemma~12]{C22},
if the graph~$G$ is surjective, one can always find an particular vector~$\mu \in \R_{\ge 0}^n$ such that the matching problem $(G, \mu)$ is stabilizable by choosing $\mu = A y$ for some $y\in \Rp^m$. A simple example is $y=(\beta, \ldots, \beta)$ for some $\beta>0$, which corresponds to having the components of $\mu$ proportional to the degree of each node.
\end{remark}
\paragraph*{Checking stability on bijective graphs}
If the graph~$G$ is bijective, then the matrix~$A$ is invertible and the conservation equation~\eqref{eq:system-matrix} has a unique solution $A^{-1}\mu$. This implies that the matching problem $(G, \mu)$ is stabilizable if and only if all components of $A^{-1} \mu$ are positive.
The special case of bijective graphs will be investigated in details in \cref{sec:unicyclic}, including a direct expression of $A^{-1} \mu$.
\paragraph*{Checking stability on surjective-only graphs}
If the compatibility graph~$G$ is surjective-only, the conservation equation~\eqref{eq:system-matrix} has multiple solutions. To determine if one of these solutions is positive,
it suffices to solve a linear optimization problem
that maximizes the smallest component
of a solution of~\eqref{eq:system-matrix}.
In block-matrix notation,
this linear optimization problem
can be written as:
\begin{align} \label{eq:linear}
\begin{aligned}
\underset{z \in \R^{m+1}}{\text{Maximize}}
\quad &
\left[ \begin{matrix}
0_{1 \times m} & 1
\end{matrix} \right]
z, \\
\text{Subject to}
\quad &
\left[ \begin{matrix}
A & 0_{n \times 1}
\end{matrix} \right]
z = \mu, \\
& \left[ \begin{matrix}
I_{m \times m} & - 1_{m \times 1}
\end{matrix} \right]
z \ge 0_{m \times 1},
\end{aligned}
\end{align}
where, for clarity, we let
$0_{p \times q}$ denote the $p \times q$ zero matrix,
$1_{p \times q}$ the $p \times q$ all-ones matrix,
$I_{p \times p}$ the $p$-dimensional identity matrix.
Here, the first $m$ components of the vector~$z$ are the components of a vector~$y \in \R^m$
that satisfies~\eqref{eq:system-matrix},
and the last component of~$z$ is a lower bound of the components of this vector~$y$.
The equality constraint means that $y$ satisfies~\eqref{eq:system-matrix},
and the inequality constraint
means that the last component of~$z$
is less than or equal to its other components.
The value to maximize is
the last component of the vector~$z$.
The linear optimization problem~\eqref{eq:linear}
has a solution with positive components
if and only if the conservation equation~\eqref{eq:system-matrix}
has a solution with positive components.
According to Proposition~\ref{prop:stability-region-form},
this is equivalent to saying that
the matching problem $(G, \mu)$ is stabilizable.
Therefore, to verify if
a matching problem $(G, \mu)$ is stabilizable,
it suffices to find a solution of
the linear optimization problem~\eqref{eq:linear}
and to check if all its components are positive.
Observe that the optimization problem~\eqref{eq:linear}
always has solutions with finite components.
Indeed, the set of vectors
that satisfy the constraints
of~\eqref{eq:linear}
contains at least one valid solution with real-valued components (this is again a consequence of the surjectivity of~$G$). We just need to consider an arbitrary solution $y$ of the conservation equation~\eqref{eq:system-matrix} (see \Cref{sec:particular-solution} for a concrete example using the Moore-Penrose inverse) and to let $z_y = (y_1, y_2, \ldots, y_m, \min(y))$. Any solution better than $z_y$ has all its components lower-bounded by $\min(y)$ and upper-bounded by
$\max(\mu)-\min(0,(n-1)\min(y))$. The latter bound is obtained by observing that, if edge~$k$ is incident to node~$i$ and if $(y'_1, y'_2, \ldots, y'_m, x')$ is a solution of~\eqref{eq:linear} such that $x'\geq \min(y)$, then $y'_k=\mu_{i}-\sum_{\ell \in E_i\setminus k}y'_\ell$ by~\eqref{eq:system-matrix}. We then use the inequalities $\mu_{i}\leq \max(\mu)$ and $\sum_{\ell \in E_i\setminus k}y'_\ell\geq \min(0,(n-1)x')\geq \min(0,(n-1)\min(y))$. Therefore, the solutions better than $z_y$ belong to a compact set of $\R^{m+1}$, which ensures the existence of an optimal solution with finite components.
The optimization problem~\eqref{eq:linear}
is a textbook linear optimization problem.
It can be solved
with a time complexity that is polynomial
in the number~$n$ of nodes
and the number~$m$ of edges using many methods,
for instance the interior-point-method~\cite{K84}.
If $z$ is a solution of ~\eqref{eq:linear}, we call the corresponding $y\in \R^m$ a \emph{maximin} solution of the conservation equation \cref{eq:system-matrix}.
\subsection{Early examples}
We now illustrate
\cref{prop:stability-region-nonempty,prop:stability-region-form}
on a few toy examples
that will also introduce useful notions for
\cref{sec:unicyclic,sec:general,sec:non-unicyclic}.
\subsubsection{Bijective graphs}
We first consider a compatibility graph~$G$
that is both surjective and injective.
According to \Cref{def:bijective},
the conservation equation~\eqref{eq:system-matrix}
has a unique solution for each vector $\mu \in \R^n$ of arrival rates.
\Cref{prop:stability-region-form} implies that
the components of this solution are positive
if and only if the matching problem $(G, \mu)$ is stabilizable.
By \Cref{rem:degree-proportional},
one can always exhibit
a vector $\mu \in \Rp^n$ of arrival rates
that satisfies this condition.
\begin{example}[Triangle] \label{eq:triangle}
\label{ex:triangle}
If the graph~$G$ is a triangle graph $\C_3$ and the vector $\mu = (\mu_1, \mu_2, \mu_3)$ is given, the solution of the conservation equation~\eqref{eq:system-matrix} is unique and showed in \cref{fig:triangle}. According to condition~\ref{cond:stability-region-form-3} in \Cref{prop:stability-region-form}, $(G, \mu)$ is stabilizable if and only if all components of this solution are positive. This is indeed equivalent to condition~\ref{cond:stability-region-form-2} in \Cref{prop:stability-region-form}, which reads $\mu_1 < \mu_2 + \mu_3$, $\mu_2 < \mu_1 + \mu_3$, and $\mu_3 < \mu_1 + \mu_2$. Note that an alternate way to express this condition consists of saying that $\mu_1$, $\mu_2$, and $\mu_3$ are the lengths of the sides of a non-degenerate triangle. Under these conditions, the matching model $(G, \mu, \Phi)$ is stable under the unique greedy policy~$\Phi$ (this will be shown in \cref{prop:greedyCompleteGraph}).
\begin{figure}[!ht]
\centering
\begin{tikzpicture}[
every node/.style={, minimum size=.3cm}]
\node[class] (1) {$1$};
\path (1) ++(0:3cm) node[class] (2) {$2$};
\path (1) ++(-60:3cm) node[class] (3) {$3$};
\draw (1) edge node[above] {$\frac{\mu_1+\mu_2-\mu_3}{2}$} (2)
(1) edge node[left] {$\frac{\mu_1+\mu_3-\mu_2}{2}$} (3)
(2) edge node[right] {$\frac{\mu_2+\mu_3-\mu_1}{2}$} (3);
\end{tikzpicture}
\caption{Matching rates in the triangle graph $\C_3$. \label{fig:triangle}}
\end{figure}
\end{example}
\begin{example}[Paw graph] \label{ex:paw}
If $G$ is a paw graph, the solution of the conservation equation~\eqref{eq:system-matrix} is again unique and showed in \cref{fig:pan}. $\bar\mu_3 = \mu_3-\mu_4$ represents the remaining rate of class~$3$ after the needs of class~$4$ have been deduced. After this subtraction, the matching rates along edges $\{1, 2\}$, $\{1, 3\}$, and $\{2, 3\}$ are as defined in the triangle graph of \Cref{fig:triangle}.
Note that, if positive matching rates guarantee the existence of stable greedy policies like \emph{match-the-longest}, some greedy policies can be unstable. \Cref{lemma:subpaw} will give a ``recipe'' that can be used to build an unstable greedy policy on a stabilizable matching problem $(G, \mu)$ with a paw graph~$G$.
\begin{figure}[!ht]
\centering
\begin{tikzpicture}[
every node/.style={, minimum size=.3cm}]
\node[class] (1) {$1$};
\path (1) ++(-90:3cm) node[class] (2) {$2$};
\path (1) ++(-30:3cm) node[class] (3) {$3$};
\path (3) ++(0:3cm) node[class] (4) {$4$};
\draw (1) edge node[left] {$\frac{\mu_1+\mu_2-\bar\mu_3}{2}$} (2)
(1) edge node[above, sloped] {$\frac{\mu_1+\bar\mu_3-\mu_2}{2}$} (3)
(2) edge node[below, sloped] {$\frac{\mu_2+\bar\mu_3-\mu_1}{2}$} (3)
(3) edge node[above] {$\mu_4$} (4);
\end{tikzpicture}
\caption{Matching rates in the paw graph. $\bar{\mu}_3=\mu_4-\mu_3$ denotes the residual rate that class~$3$ can provide to classes~$1$ and~$2$. \label{fig:pan}}
\end{figure}
\end{example}
\subsubsection{Bipartite graph (that is neither injective nor surjective)}
\begin{example}[Square graph] \label{ex:square}
\Cref{fig:square} shows a square graph $G = \C_4$. This graph is not surjective because it is bipartite between $\{1, 3\}$ (odd component) and $\{2, 4\}$ (even component). Therefore, according to \Cref{prop:stability-region-nonempty}, this graph is not stabilizable. Yet, given a vector $\mu = (\mu_1, \mu_2, \mu_3, \mu_4)$ of arrival rates, the conservation equation~\eqref{eq:system-matrix} may still have a solution with positive components. This does not contradict \cref{prop:stability-region-form}, as the three statements in this proposition are equivalent only if the graph~$G$ is surjective.
Assuming unit normalization, the conservation equation \eqref{eq:system-matrix} has a solution if and only if
\begin{equation}
\label{eq:square}
\mu_1 + \mu_3 = \mu_2 + \mu_4 = \frac{1}{2}\text{.}
\end{equation}
If \eqref{eq:square} is not satisfied, the difference between the numbers of unmatched items from the odd and even components evolves like a biased random walk on the integer number line $\{\ldots, -2, -1, 0, 1, 2, \ldots\}$. This implies that the underlying Markov process is transient, as the number of unmatched items in the component with the highest arrival rate grows linearly with time. On the other hand, if \eqref{eq:square} is satisfied, then the random walk is unbiased, but the system is still unstable because the corresponding Markov chain is null recurrent. (Existing studies of matching in bipartite graphs usually solve this issue by coupling arrivals in both components~\cite{AW12,BGM13,CKW09} or by assuming that items have a finite patience time~\cite{JMRS20}.)
If~\eqref{eq:square} is satisfied, the solutions of the conservation equation~\eqref{eq:system-matrix} can be described with a parameter $\alpha$ as shown in \cref{fig:square}. The positive solutions correspond to values of $\alpha$ such that $-2\min(\mu_1\mu_2, \mu_3\mu_4)<\alpha<2\min(\mu_2\mu_3, \mu_1\mu_4)$.
\begin{figure}[!ht]
\centering
\begin{tikzpicture}[
every node/.style={, minimum size=.3cm}]
\node[class] (1) {$1$};
\path (1) ++(30:3cm) node[class] (2) {$2$};
\path (1) ++(-30:3cm) node[class] (4) {$4$};
\path (4) ++(+30:3cm) node[class] (3) {$3$};
\draw (1) edge node[sloped, above] {$2\mu_1\mu_2+\alpha$} (2)
(1) edge node[sloped, below] {$2\mu_1\mu_4-\alpha$} (4)
(2) edge node[sloped, above] {$2\mu_2\mu_3-\alpha$} (3)
(4) edge node[sloped, below] {$2\mu_3\mu_4+\alpha$} (3);
\end{tikzpicture}
\caption{Matching rates in the square graph $\C_4$ (not stabilizable), with the normalization $\mu_1+\mu_3=\bar\mu_2+\bar\mu_4=\frac 12$.} \label{fig:square}
\end{figure}
\end{example}
\subsubsection{Surjective-only graphs}
We finally consider
compatiblity graphs~$G$ that are surjective but not injective.
In other words, the graph~$G$ is stabilizable
and the conservation equation~\eqref{eq:system-matrix}
has an infinite number of solutions.
Whether or not these solutions are achievable by a matching policy
will be discussed in \Cref{sec:non-unicyclic}.
\begin{example}[Diamond (double-fan) graph] \label{ex:diamond}
\Cref{fig:diamond} shows a diamond graph, that is, a square graph with an additional edge between nodes~$2$ and~$4$. Compared to \Cref{ex:square}, this additional edge makes the graph non-bipartite, and therefore surjective, so that the graph is stabilizable according to \Cref{prop:stability-region-nonempty}. For ease of computation, we assume that the vector $\mu = (\mu_1, \mu_2, \mu_3, \mu_4)$ of arrival rates is normalized so that $\mu_1+\mu_3=\frac12$. According to condition~\ref{cond:stability-region-form-2} in \cref{prop:stability-region-form}, the matching problem $(G, \mu)$ is stabilizable if and only if
\begin{align} \label{eq:diamond-stabilizability}
\mu_2 &< \mu_1 + \mu_3 + \mu_4,
&
\mu_4 &< \mu_1 + \mu_2 + \mu_3,
&
\mu_1 + \mu_3 &< \mu_2 + \mu_4
\end{align}
With $\beta = \frac12 (\mu_2 + \mu_4 - \mu_1 - \mu_3)
= \frac12 (\mu_2 + \mu_4) - \frac{1}{4}$,
$\bar\mu_2 = \mu_2 - \beta$, and $\bar\mu_4 = \mu_4 - \beta$,
these conditions rewrite:
\begin{align}
\label{ineq:diamond}
\bar\mu_4
&>0,
&
\bar\mu_2
&>0,
&
\beta
&>0\text{.}
\end{align}
If these inequalities are satisfied, the general solution of the conservation equation~\eqref{eq:system-matrix} can be described with a parameter $\alpha$ as shown in \Cref{fig:diamond}. In particular, the positive solutions correspond to values of $\alpha$ such that $-2\min(\mu_1\bar\mu_2, \mu_3\bar\mu_4)<\alpha<2\min(\bar\mu_2\mu_3, \mu_1\bar\mu_4)$.
\begin{figure}[!ht]
\centering
\begin{tikzpicture}[
every node/.style={, minimum size=.3cm}]
\node[class] (1) {$1$};
\path (1) ++(30:3cm) node[class] (2) {$2$};
\path (1) ++(-30:3cm) node[class] (4) {$4$};
\path (4) ++(+30:3cm) node[class] (3) {$3$};
\draw (1) edge node[sloped, above] {$2\mu_1\bar\mu_2+\alpha$} (2)
(1) edge node[sloped, below] {$2\mu_1\bar\mu_4-\alpha$} (4)
(2) edge node[sloped, above] {$2\mu_3\bar\mu_2-\alpha$} (3)
(4) edge node[sloped, below] {$2\mu_3\bar\mu_4+\alpha$} (3)
(2) edge node[right] {$\beta$} (4);
\end{tikzpicture}
\caption{\label{fig:diamond}Matching rates in the diamond graph, with the normalization $\mu_1+\mu_3=\frac 12$. $2\beta = \mu_2 + \mu_4 - \mu_1 - \mu_3 = \mu_2+\mu_4 - \frac{1}{2}$ is the difference between the arrival rates of the even and odd components. $\bar\mu_2= \mu_2 - \beta$ and $\bar\mu_4= \mu_4 - \beta$ represent the residual rates that classes~$2$ and~$4$ can provide to classes~$1$ and~$3$.}
\end{figure}
Intuitively, compared to the square graph, stabilizable matching problems $(G, \mu)$ have a positive difference of $2\beta$ between the arrival rates of the even and odd components. This difference is absorbed by the central edge $\{2, 4\}$, which has matching rate $\beta$. After subtracting~$\beta$ from $\mu_2$ and $\mu_4$, the solutions of the conservation equation~\eqref{eq:system-matrix} are exactly the same as in the square graph of \Cref{ex:square}.
Like \Cref{ex:triangle} and unlike \cref{ex:paw}, the matching model $(G, \mu, \Phi)$ is stable for every greedy policy~$\Phi$ provided that~\eqref{ineq:diamond} is satisfied (this will be shown in \cref{cor:max-greedy}).
\end{example}
\begin{example}[Kayak paddle graph] \label{ex:paddle}
\Cref{fig:kayak} shows a kayak paddle $G = \KP_{3,3,1}$, consisting of two triangles linked by an edge.
According to \cref{prop:stability-region-form}, the matching problem $(G, \mu)$ is stabilizable if and only if there exists $\alpha>0$ such that $(\mu_1, \mu_2, \mu_3-\alpha)$ and $(\mu_4-\alpha, \mu_5, \mu_6)$ are the vectors of arrival rates of two stabilizable triangle graphs $\C_3$.
The solutions of the conservation equation~\eqref{eq:system-matrix} can be described by varying $\alpha$ as shown in Figure \ref{fig:kayak}. Assuming that the matching problem $(G, \mu)$ is stabilizable, the solutions of the conservation equation~\eqref{eq:system-matrix} with positive components correspond to the values of $\alpha$ such that
$$0 < \alpha < \min(\mu_3-|\mu_2-\mu_1|, \mu_4-|\mu_5-\mu_6|)\text{.}$$
Intuitively, solutions with positive components have a positive matching rate $\alpha$ along edge $\{3,4\}$. After subtracting this rate from $\mu_3$ and $\mu_4$, the subgraphs restricted to nodes $1$, $2$, and $3$ and to nodes $4$, $5$, and $6$, respectively, behave exactly like the triangle of \cref{fig:triangle}.
Like \Cref{ex:paw} and unlike \cref{ex:triangle,ex:diamond}, the fact that $(G,\mu)$ is stabilizable does not guarantee the stability of any greedy policy.
\begin{figure}[t]
\centering
\begin{tikzpicture}
\def2.5cm{3cm}
\node[class] (1) {$1$};
\foreach \i/\s/\a in {2/1/90, 3/1/30, 4/3/0, 5/4/30, 6/4/-30}
\path (\s) ++(\a:2.5cm) node[class] (\i) {$\i$};
\draw (1) edge node[left] {$\frac{\mu_1+\mu_2-\mu_3+\alpha}{2}$} (2)
(1) edge node[sloped, below] {$\frac{\mu_1+\mu_3-\mu_2-\alpha}{2}$} (3)
(2) edge node[sloped, above] {$\frac{\mu_2+\mu_3-\mu_1-\alpha}{2}$} (3)
(3) edge node[above] {$\alpha$} (4)
(5) edge node[right] {$\frac{\mu_5+\mu_6-\mu_4+\alpha}{2}$} (6)
(4) edge node[sloped, above] {$\frac{\mu_4+\mu_5-\mu_6-\alpha}{2}$} (5)
(4) edge node[sloped, below] {$\frac{\mu_4+\mu_6-\mu_5-\alpha}{2}$} (6);
\end{tikzpicture}
\caption{Matching rates in the kayak paddle $\KP_{3, 3, 1}$. \label{fig:kayak}}
\end{figure}
\end{example}
\section{Matching rates in bijective graphs} \label{sec:unicyclic}
In the remainder, we will consider exclusively
matching problems~$(G, \mu)$ that are stabilizable.
According to \Cref{prop:stability-region-nonempty,def:surjective},
this implies that the graph~$G$ is surjective, or equivalently,
that each connected component of $G$ is non-bipartite.
According to statement~\ref{dimensions-4} in \Cref{prop:dimensions}
and to \Cref{prop:stability-region-form},
there are only two possible cases:
\begin{enumerate}
\item \label{case-1}
If $n = m$, the graph~$G$ is also bijective.
The conservation equation~\eqref{eq:system-matrix}
has a unique solution given by $\lambda = A^{-1} \mu$. This solution, which has positive components, gives the matching rates achieved by any stable policy.
Each connected component of the graph~$G$ is a unicyclic graph,
and its unique cycle is odd.
\item \label{case-2}
If $n < m$, the graph~$G$ is surjective-only.
The conservation equation~\eqref{eq:system-matrix}
has an infinite number of solutions,
one of which has positive components.
Each connected component of the graph~$G$ is non-bipartite,
and at least one of these connected components
contains an even cycle or a pair of odd cycles.
\end{enumerate}
Case~\ref{case-1} is studied in this section,
while case~\ref{case-2} will be studied
in \Cref{sec:general,sec:non-unicyclic}.
In \Cref{prop:unicyclic} below,
we give a simpler expression
for the unique solution $\lambda = A^{-1} \mu$
of the conservation equation~\eqref{eq:system-matrix}
in terms of the arrival rate vector~$\mu$,
under the assumption that the graph~$G$ is bijective.
We assume without loss of generality that the graph~$G$ is connected,
as otherwise we can consider each connected component independently.
Compared to the expression $\lambda = A^{-1} \mu$,
the advantage of \Cref{prop:unicyclic} is twofold:
it does not require calculating a matrix inversion,
and it highlights the monotonicity
of the matching rates
with respect to the arrival rates.
This result will be illustrated
in \Cref{ex:unicyclic-1,ex:unicyclic-2}.
\begin{proposition} \label{prop:unicyclic}
Consider a matching problem $(G, \mu)$
with a compatibility graph~$G = (\V, \E)$
that is connected and bijective,
and consider an edge~$k \in \E$.
\begin{enumerate}
\item \label{unicyclic-1}
If edge~$k$ does not belong
to the (unique odd) cycle of the graph~$G$,
then edge~$k$ separates the graph~$G$
into two parts, namely a tree and a unicyclic graph.
If $\V_k \subset \V$ denotes
the set of nodes that belong to the tree
(including one of the endpoints of edge~$k$),
then the matching rate along edge~$k$ is given by
\begin{align} \label{eq:unicyclic-border}
\lambda_k
= \sum_{i \in \V_k}
(-1)^{d_{i, k}} \mu_i.
\end{align}
\item \label{unicyclic-2}
If edge~$k$ belongs to the (unique odd) cycle of the graph~$G$,
then the matching rate along edge~$k$ is given by
\begin{align} \label{eq:unicyclic-cycle}
\lambda_k
= \frac12 \left(
\sum_{i \in \V}
(-1)^{d_{i, k}} \mu_i
\right),
\end{align}
where $d_{i, k}$ is the distance between node~$i$ and edge~$k$,
that is, the minimum distance between node~$i$ and an endpoint of edge~$k$.
\end{enumerate}
\end{proposition}
\begin{proof}
We first prove~\eqref{eq:unicyclic-border}
for every edge~$k$ that does not belong to the cycle.
As observed in the proposition,
each edge~$k$ that does not belong to the cycle
separates the graph into two parts,
one of which is a tree with node set~$\V_k$;
the rooted tree associated with~$k$
is obtained by designating
the corresponding endpoint of edge~$k$ as the root.
We now prove~\eqref{eq:unicyclic-border}
by induction on the height this rooted tree.
Equation~\eqref{eq:unicyclic-border}
is true if the depth of this tree is zero.
Indeed, in this case,
the endpoint of edge~$k$ that belongs to the tree,
say node~$i$, has no other incident edge,
so that applying~\eqref{eq:system-equations}
to node~$i$ yields $\lambda_k = \mu_i$,
which is consistent with~\eqref{eq:unicyclic-border}.
Now consider an edge~$k$
so that the associated rooted tree
has height $h \ge 1$.
By applying~\eqref{eq:system-equations}
to the root~$i$ of this associated rooted tree,
we obtain
\begin{align*}
\lambda_k
= \mu_i - \sum_{\ell \in \E_i \setminus \{k\}} \lambda_\ell.
\end{align*}
The induction hypothesis guarantees
that~\eqref{eq:unicyclic-border}
is satisfied for every $\ell \in \E_i \setminus \{k\}$
(as the height of the associated rooted tree is at most $h - 1$).
The result for edge~$k$ follows by observing that
$d_{j, k} = d_{j, \ell} + 1$
for each $\ell \in \E_i \setminus \{k\}$
and $j \in \V_\ell$
and that
$\V_k = \{i\} \cup (\bigcup_{\ell \in \E_i \setminus \{k\}} \V_\ell)$
(all sets being disjoint).
We now prove~\eqref{eq:unicyclic-cycle}
for each edge~$k$ that belongs to the cycle.
Since the graph~$G$ is unicyclic,
deleting edge~$k$ from~$G$
yields a (connected) tree,
which can be seen as a bipartite graph.
We let $\V_+$ denote set of nodes in the part
that contains both endpoints of edge~$k$
(that both endpoints belong to the same part
follows from the fact that the cycle is odd)
and $\V_-$ the set of nodes in the other part.
We obtain
\begin{align*}
\sum_{i \in \V_+} \mu_i
- \sum_{i \in \V_-} \mu_i
&= \sum_{i \in \V_+}
\sum_{\ell \in \E_i} \lambda_\ell
- \sum_{i \in \V_-}
\sum_{\ell \in \E_i} \lambda_\ell
= 2 \lambda_k.
\end{align*}
The first equality
follows from~\eqref{eq:system-equations}.
The second equality holds because
each edge~$\ell \in \E \setminus \{k\}$
has one endpoint in~$\V_+$ and another in~$\V_-$,
so that $\lambda_\ell$ appears exactly
once in the first nested sum and once in the second;
on the contrary,
since both endpoints of edge~$k$ belong to $\V_+$,
$\lambda_k$ appears twice in the first nested sum
and zero times in the second.
Equation~\eqref{eq:unicyclic-cycle} follows
by observing that $d_{i, k}$ is even
if and only if $i \in \V_+$.
\end{proof}
We remark that the influence of the arrival rate of a node on an edge matching rate only depends on the parity of the distance between the edge and the node. The actual distance does not. In particular, even in a very large (bijective) graph, a node far away from an edge has the same (although possibly reversed) impact as an endpoint of that edge.
\begin{example}[Cycle graph with 5 nodes] \label{ex:unicyclic-1}
A cycle graph is the simplest bijective graph that we can consider,
as it contains an odd cycle and no other edges.
In the cycle graph of \Cref{fig:odd-cycle},
a direct application of statement~\ref{unicyclic-1}
in \Cref{prop:unicyclic} yields
\begin{align*}
\lambda_{1,2} = \frac12 (\mu_1 + \mu_2 - \mu_3 + \mu_4 - \mu_5).
\end{align*}
Matching rates along other edges follow by symmetry.
From the point of view of edge $\{1, 2\}$,
we can partition nodes into two sets,
namely $\{1, 2, 4\}$ and $\{3, 5\}$.
The former (resp.\ latter) set contains nodes
at an even (resp.\ odd) distance of edge~$\{1, 2\}$,
and increasing the arrival rate of these nodes
increases (resp.\ decreases) the matching rate along edge~$\{1, 2\}$.
\begin{figure}[!ht]
\centering
\begin{tikzpicture}
\foreach \i/\a in {4/-90, 3/-18, 2/34, 1/146, 5/198}
{\node[class] (\i) at (\a:2cm) {$\i$};}
\foreach \i/\j/\l in {
1/2/$\frac{\mu_1+\mu_2-\mu_5-\mu_3+\mu_4}{2}$,
2/3/,
3/4/,
4/5/,
5/1/}
{\draw (\i) edge node[above] {\l} (\j);}
\end{tikzpicture}
\caption{Matching rates in the pentagon graph $\C_5$. Only rate $\lambda_{1, 2}$ is shown for ease of display. The other rates are deduced by permutation.}
\label{fig:odd-cycle}
\end{figure}
\end{example}
\begin{example}[Lying puppet] \label{ex:unicyclic-2}
We now consider the graph of \figurename~\ref{fig:puppet}.
Edges $\{1, 2\}$, $\{1, 3\}$, and $\{2, 3\}$ belong to the cycle,
and the other edges do not.
According to Proposition~\ref{prop:unicyclic}, we have
\begin{align*}
\lambda_{1, 2}
&= \frac{\mu_1 + \mu_2 - \bar\mu_3}2,
&
\lambda_{1, 3}
&= \frac{\mu_1 - \mu_2 + \bar\mu_3}2,
&
\lambda_{2, 3}
&= \frac{- \mu_1 + \mu_2 + \bar\mu_3} 2,
\end{align*}
where $\bar\mu_3 = \mu_3 - \lambda_{3, 4}$,
and
\begin{figure}[!ht]
\centering
\tikzstyle{slab}=[sloped, above]
\tikzstyle{slob}=[sloped, below]
\begin{tikzpicture}
\def2.5cm{2cm}
\node[class, minimum size=0] (1) {$1$};
\foreach \i/\s/\a in {2/1/90, 3/1/30, 4/3/0, 5/4/-90, 6/4/90, 7/4/0, 8/7/-30, 9/7/30}
\path (\s) ++(\a:2.5cm) node[class] (\i) {$\i$};
\foreach \i/\j/\l/\p in {
1/2/$\frac{\mu_1+\mu_2-\bar{\mu}_3}{2}$/left,
2/3/$\frac{\mu_2+\bar{\mu}_3-\mu_1}{2}$/slab,
1/3/$\frac{\mu_1+\bar{\mu}_3-\mu_2}{2}$/slob,
3/4/$\bar{\mu}_4$/above,
4/5/$\mu_5$/left,
4/6/$\mu_6$/left,
4/7/$\bar{\mu}_7$/above,
7/8/$\mu_8$/slob,
7/9/$\mu_9$/slab}
\draw (\i) edge node[\p] {\l} (\j);
\end{tikzpicture}
\caption{Matching rates in a ``lying puppet'' graph
with $n = 9$ nodes and $m = 9$ edges.
The differences $\bar{\mu}_7=\mu_7-\mu_8-\mu_9$, $\bar{\mu}_4=\mu_4-\mu_5-\mu_6-\bar{\mu}_7$, and $\bar{\mu}_3=\mu_3-\bar{\mu}_4$ are the residual rates that classes $7$, $4$, and $3$ provide to their neighbors of lower index.}
\label{fig:puppet}
\end{figure}
\begin{align*}
\lambda_{4, 5}
&= \mu_5,
&
\lambda_{4, 6}
&= \mu_6,
&
\lambda_{7, 8}
&= \mu_8,
\\
\lambda_{7, 9}
&= \mu_9,
&
\lambda_{4, 7}
&= \mu_7 - \lambda_{7, 8} - \lambda_{7, 9},
&
\lambda_{3, 4}
&= \mu_4 - \lambda_{4, 5} - \lambda_{4, 6} - \lambda_{4, 7}.
\end{align*}
This second set of equations can be obtained
either by a direct application of~\eqref{eq:unicyclic-border}
or by applying~\eqref{eq:system-equations} recursively
from the leaves.
Indeed, applying~\eqref{eq:system-equations}
to nodes $5$, $6$, $8$, and $9$ gives directly
the values of $\lambda_{4,5}$, $\lambda_{4,6}$,
$\lambda_{7,8}$, and $\lambda_{7,9}$,
then applying~\eqref{eq:system-equations}
to node~$7$ gives the value of $\lambda_{4,7}$,
and finally applying~\eqref{eq:system-equations}
to node~$4$ gives the value of $\lambda_{3,4}$.
The values of $\lambda_{1,2}$, $\lambda_{1,3}$, and $\lambda_{2,3}$
are similar to~\Cref{ex:paw},
where the arrival rate~$\mu_3$ is again replaced
with the effective arrival rate~$\bar\mu_3$
from the point of view of classes~1 and~2.
\end{example}
\section{Solution of the conservation equation in surjective-only graphs} \label{sec:general}
Consider a stabilizable matching problem $(G, \mu)$
with a surjective-only compatibility graph~$G$.
According to \Cref{def:surjective,def:injective,def:only},
each connected component of the graph~$G$ is non-bipartite,
and at least one of these connected components
contains an even cycle or a pair of odd cycles.
This means that the conservation equation~\eqref{eq:system-matrix}
has an infinite number of solutions,
and that at least one of these solutions
has positive components.
This section describes these solutions. \Cref{subsec:all-solutions}
characterizes the affine space of all real-valued solutions
of the conservation equation~\eqref{eq:system-matrix},
while \Cref{subsec:positive-solutions}
focuses on the convex polytope
made of the solutions with non-negative components.
Whether or not these solutions
are achievable by a matching policy
will be discussed in \Cref{sec:non-unicyclic}.
Note that the results stated in this section are also applicable to bijective graphs but they are of little interest in that case: the solution is unique and \Cref{sec:unicyclic} already gives a closed-form expression for it. This is why we focus on surjective-only graphs.
\subsection{Affine space of real-valued solutions} \label{subsec:all-solutions}
Let $\La$ denote the set
of solutions of the conservation equation~\eqref{eq:system-matrix},
with positive, zero, or negative components, that is
\begin{align} \label{eq:Pi-def}
\La = \left\{ y \in \R^m: A y = \mu \right\}.
\end{align}
In \Cref{sec:coordinate-spaces} we observe that $\La$ is an affine space of dimension $d = n - m$ that can be described as a translation of the kernel of the incidence matrix by a solution of the conservation equation \eqref{eq:system-matrix}. \Cref{sec:particular-solution} gives possible solutions that can be used. \ref{sec:basis-of-the-kernel-of-the-incidence-matrix} gives an algorithm to construct a basis for the kernel of the incidence matrix directly from the graph.
\subsubsection{Edge basis, kernel basis}\label{sec:coordinate-spaces}
The following proposition
characterizes the set of solutions
of the conservation equation~\eqref{eq:system-matrix}
using the incidence matrix.
\begin{proposition} \label{prop:affine-space}
Consider a stabilizable matching problem $(G, \mu)$
with a surjective-only compatibility graph~$G$.
Let $A$ denote the incidence matrix of~$G$.
The solution set $\La$
of the conservation equation~\eqref{eq:system-matrix}
is the affine space obtained by translating
the kernel of the matrix~$A$
by a particular solution $y^\circ$
of the conservation equation~\eqref{eq:system-matrix}, that is,
\begin{align} \label{eq:Pi}
\La = \left\{ y^\circ + y: y \in \ker(A) \right\}.
\end{align}
Furthermore, the linear space $\ker(A)$
and the affine space $\La$
have dimension $d = m - n$.
\end{proposition}
\begin{proof}
That the set~$\La$ is of the form~\eqref{eq:Pi}
is a well-known result in linear algebra.
\Cref{def:surjective} about surjectivity implies
that $\text{rank}(A) = n$, and we conclude from the rank-nullity theorem that the nullity of~$A$ is $d = n - m$. The affine space $\La$ has the same dimension according to~\eqref{eq:Pi}.
\end{proof}
\Cref{eq:Pi} tells that, up to translation, $\La$ is only defined by the structure of the graph $G$. The vector of arrival rates $\mu$ only impacts the translation $y^\circ$.
Thanks to \Cref{prop:affine-space},
given a particular solution $y^\circ$
of the conservation equation~\eqref{eq:system-matrix}, and a basis
$\B = (b_1, b_2, \ldots, b_d)$ of $\ker(A)$,
we can rewrite the affice space~$\La$ as
\begin{align*}
\La = \left\{
y^\circ + \alpha_1 b_1 + \alpha_2 b_2
+ \ldots + \alpha_d b_d :
\alpha_1, \alpha_2, \ldots, \alpha_d \in \R
\right\}.
\end{align*}
Said differently,
we can define the following
affine isomorphism between
the coordinate space $\R^d$
and the $d$-dimensional affine space~$\La$:
\begin{align} \label{eq:linear-bijection}
\alpha = (\alpha_1, \alpha_2, \ldots, \alpha_d)
\in \R^d
\mapsto
y = y^\circ
+ \alpha_1 b_1
+ \alpha_2 b_2
+ \ldots
+ \alpha_d b_d \in \La.
\end{align}
Therefore, for given $y^\circ$ and $\B$, there are two natural basis to represent vectors in $\Lambda$:
\begin{itemize}
\item \textbf{Edge basis}:
A vector of $\Lambda$
is described by a vector
$y = (y_1, y_2, \ldots, y_m) \in \R^m$,
where $y_k$ represents
a potential matching rate
along edge~$k$,
for each $k \in \E$.
\item \textbf{Kernel basis}:
A vector of $\Lambda$
is described by a vector
$\alpha = (\alpha_1, \alpha_2, \ldots, \alpha_d) \in \R^d$,
where $d = m - n$
is the dimension of the affine space~$\Lambda$.
\end{itemize}
If $B$ is the $m\times d$ matrix that represents $\B$ in the edge basis, the change-of-basis formulas are as follows:
\begin{itemize}
\item A vector of $\La$ with coordinates $\alpha$ in kernel basis has coordinates $y^\circ+B\alpha$ in edge basis;
\item A vector of $\La$ with coordinates $y$ in edge basis has coordinates $B^+(y-y^\circ)$ in kernel basis, where $B^+$ is the pseudo-inverse of $B$.
\end{itemize}
As $\B$ is a basis, the columns of $B$ are independent, so that the pseudo-inverse $B^+$ has the following simple expression:
\begin{align*}
B^+ = (B^\intercal B)^{-1} B^\intercal,
\end{align*}
where the $d \times d$ matrix $B^\intercal B$ is invertible because
$\ker(B^\intercal B) = \ker(B) = \{0\}$.
In practice, which basis we are actually using will be made clear by our choice of letters
(either $y$ or $\alpha$). Both basis have their benefits. The edge basis, by definition, gives directly the potential matching rates. The kernel basis allows to work in lower dimension ($d$ instead of $m$) and to ignore the conservation equation \eqref{eq:system-matrix}, which is implicitly enforced.
For graphs that have a low kernel dimension $d$, it is convenient to mix both approaches and to represent a generic vector of $\La$, i.e. a generic solution of the conservation equation~\eqref{eq:system-matrix}, in the form $y^\circ + B\alpha$. For instance, the solutions on \cref{ex:diamond,ex:paddle} are actually displayed in \Cref{fig:diamond,fig:kayak} using that convention. This representation, along with the possibility to switch between edge basis and kernel basis, will be used extensively in \Cref{subsec:positive-solutions,sec:non-unicyclic}.
We now focus on $y^\circ$ (the chosen \emph{origin} for $\La$) and $\B$.
\subsubsection{Particular solution}\label{sec:particular-solution}
A standard way to simultaneously find a particular solution $y^\circ$ and characterize $\ker(A)$ consists of using the pseudoinverse (or Moore-Penrose inverse) of the matrix~$A$. \Cref{def:surjective} about surjectivity implies that the rows of~$A$ are linearly independent, so that the pseudoinverse~$A^+$ of~$A$ has the following simple expression:
\begin{align*}
A^+ = A^\intercal (AA^\intercal)^{-1},
\end{align*}
where the $n \times n$ matrix $AA^\intercal$ is invertible because
$\ker(AA^\intercal) = \ker(A^\intercal) = \{0\}$.
We can then describe
a particular solution $y^\perp$
and the kernel $\ker(A)$ as follows:
\begin{align*}
y^\perp &= A^+ \mu,
&
\ker(A) &= \left\{ (I_{m \times m} - A^+A)y: y \in \R^m \right\},
\end{align*}
where $I_{m \times m}$ is
the $m$-dimensional identity matrix.
The vector $y^\perp$
is the \emph{least-squares solution}
of the conservation equation~\eqref{eq:system-matrix},
and it is orthogonal to~$\ker(A)$.
In general, the components of this solution are not non-negative even if non-negative solutions exist. For example, if $G$ is the diamond graph of \Cref{ex:diamond},
then the matching problem $(G, \mu)$
with $\mu = (4,5,1,2)$ is stabilizable,
but the solution given by the pseudoinverse is
$y^\perp = (\frac{11}4, \frac54, 1, \frac54, -\frac14)$.
If one prefers a positive solution for $y^\circ$, one alternate possibility is to use a \emph{maximin} solution by solving the linear optimization problem \cref{eq:linear}. Remind that to ensure the existence of a maximin solution we used the fact that at least one solution exists, which justifies the introduction of the solution based on the Moore-Penrose inverse.
As stated above, the Moore-Penrose inverse also provides an implicit characterization of $\ker(A)$. However, this characterization is not very practical as it relies on a projection from $\R^m$ to $\ker(A)$. We now give a more direct characterization by building a basis for $\ker(A)$ based on the structure of the compatibility graph $G$.
\subsubsection{Basis of the kernel of the incidence matrix}\label{sec:basis-of-the-kernel-of-the-incidence-matrix}
Recall that a vector $y \in \R^m$
belongs to $\ker(A)$
if and only if $A y = 0$, which reads
$\sum_{k \in \E_i} y_k = 0$
for each $i \in \V$.
In other words, a vector $y \in \R^m$ belongs to $\ker(A)$ if and only if the sum of the components of~$y$ associated with the edges incident to the same node is zero.
Using this observation,
we first give examples of subgraphs
that are supports of
vectors that belong to~$\ker(A)$,
and then we give an algorithm
that generates a basis
$\B = (b_1, b_2, \ldots, b_d)$ of $\ker(A)$.
First observe that an even cycle, if it exists,
defines a vector in $\ker(A)$:
it suffices to assign alternatively the values $+1$ and $-1$
to the edges of this cycle
and the value $0$ to all other edges.
In the diamond graph of \Cref{ex:diamond}
for instance,
if edges are numbered in lexicographical order, then
$y = (1, -1, -1, 0, 1)$ is a vector of the unidimensional kernel,
associated with the even cycle 1--2--3--4 (see \Cref{fig:kernel}).
Intuitively, even cycles can be used to move weights between ``odd'' and ``even'' edges without modifying the value of the product~$Ay$. Actually, in this particular example, the only way to increase the matching rate along edges $\{1, 2\}$ and $\{3, 4\}$ is to reduce the matching rate along edges $\{2, 3\}$ and $\{1, 4\}$, and conversely.
\begin{figure}[ht]
\centering
\begin{tikzpicture}
\def2.5cm{2cm}
\node[class] (1) {$1$};
\foreach \i/\s/\a in {2/1/30, 4/1/-30, 3/4/30}
\path (\s) ++(\a:2.5cm) node[class] (\i) {$\i$};
\draw (1) edge node[above left] {$1$} (2)
(1) edge node[below left] {$-1$} (4)
(2) edge node[above right] {$-1$} (3)
(4) edge node[below right] {$1$} (3)
(2) edge node[right] {$0$} (4);
\end{tikzpicture}
\caption{\label{fig:kernel}Vector of the kernel space of the diamond graph.}
\end{figure}
Apart from even cycles, other structures of interest are kayak paddles $\KP_{\ell, r, p}$ in which the lengths $\ell$ and $r$ of both cycles are odd. These graphs have a unidimensional kernel, and a base vector can be found by assigning properly the values $+1$ and $-1$ along the cycles and the values $+2$ and $-2$ along the path. \Cref{fig:kernel2} shows such an assignment for $\KP_{3, 5, 2}$.
\begin{figure}[!ht]
\centering
\begin{tikzpicture}
\def2.5cm{2cm}
\node[class] (1) {$1$};
\foreach \i/\s/\a in {2/1/90, 3/1/30, 4/3/0, 5/4/0,
6/5/54, 7/6/-18, 8/7/-90, 9/5/-54}
\path (\s) ++(\a:2.5cm) node[class] (\i) {$\i$};
\draw (1) edge node[left] {$1$} (2)
(1) edge node[below right] {$-1$} (3)
(2) edge node[above right] {$-1$} (3)
(3) edge node[above] {$2$} (4)
(4) edge node[above] {$-2$} (5)
(5) edge node[left] {$1$} (6)
(6) edge node[above] {$-1$} (7)
(7) edge node[right] {$1$} (8)
(8) edge node[below] {$-1$} (9)
(9) edge node[left] {$1$} (5)
;
\end{tikzpicture}
\caption{\label{fig:kernel2}Vector of the kernel space of the kayak paddle $\KP_{3, 5, 2}$.}
\end{figure}
Surprisingly, for any surjective graph~$G$, one can build a basis of $\ker(A)$ using only subgraphs of~$G$ that are even cycles and kayak paddles. This is what Algorithm~\ref{algo:spanning} does. It finds $m-n$ distinct edges and associates to each one either an even-cycle base vector or a kayak-paddle base vector. We assume without loss of generality that the graph~$G$ is connected (in addition to being surjective-only). If not, we can apply the algorithm to each connected component separately, and then we embed the obtained vectors via zero padding.
\begin{algorithm}[ht]
\KwData{A connected surjective-only graph~$G = (\V, \E)$}
\KwResult{A basis $\B$ of the kernel
of the incidence matrix~$A$ of~$G$}
$\B \leftarrow \emptyset$ \\
$\T \leftarrow$ the set of edges of a spanning tree of~$G$ \\
$a \leftarrow$ an edge in $\E \setminus \T$
such that $\T \cup \{a\}$
contains an odd cycle
\label{algo:edgek} \\
\For{$s \in \E \setminus (\T \cup \{a\})$}{
$b \leftarrow 0_{m\times 1}$\\
\eIf{
$\T \cup \{a, s\}$ contains an even cycle $C_\ell$}{
$c_1,\ldots,c_\ell$ $\leftarrow$ edges of $C_\ell$,
numbered from an arbitrary starting point\\
\For{$d\in \{1,\ldots,\ell\}$}{
$k \leftarrow$ index of $c_d$ in $E$\\
$b_k = (-1)^d$}
}{
$\T \cup \{a, s\}$ contains a kayak paddle $\KP_{\ell, r, p}$ with $\ell$ odd, $r$ odd, and $p\geq 0$\\
$v_i \leftarrow$ node connecting the kayak cycle $C_\ell$ to the kayak central path\\
$v_j \leftarrow$ node connecting the kayak cycle $C_r$ to the kayak central path\\
$c_1,\ldots,c_\ell$ $\leftarrow$ edges of $C_\ell$, numbered starting from node $v_i$\\
\For{$d\in \{1,\ldots,\ell\}$}{
$k \leftarrow$ index of $c_d$ in $E$\\
$b_k = (-1)^d$}
$c_1,\ldots,c_p$ $\leftarrow$ edges of the central path, numbered starting from node $v_i$\\
\For{$d\in \{1,\ldots,p\}$}{
$k \leftarrow$ index of $c_d$ in $E$\\
$b_k = 2(-1)^{d+1}$}
$c_1,\ldots,c_r$ $\leftarrow$ edges of $C_r$, numbered starting from node $v_j$\\
\For{$d\in \{1,\ldots,r\}$}{
$k \leftarrow$ index of $c_d$ in $E$\\
$b_k = (-1)^{d+p+1}$}
}
$\B \leftarrow \B \cup \{b\}$
}
\vspace{.3cm}
\caption{Construction of a basis of the kernel of the incidence matrix~$A$ of the graph~$G$. This algorithm was initially introduced in \cite[Section~3]{D73} to build a basis of the eigenspace associated with the eigenvalue $-2$ of the adjacency matrix~$C$ of a line graph~$L$.}
\label{algo:spanning}
\end{algorithm}
\Cref{fig:triamond-kernel,fig:codomino-kernel} show possible runs of Algorithm~\ref{algo:spanning} on the triamond and codomino graphs, both of which have a two-dimensional kernel. Note that the basis is not unique and depends on our initial choice of the spanning tree $\T$ and the augmenting edge $a$ (see lines 2 and 3 in Algorithm~\ref{algo:spanning}). We now verify that Algorithm~\ref{algo:spanning} termines and yields the desired result.
\tikzset{
spanner/.style={line width=.7mm},
extra/.style={dotted, line width=.7mm},
k1/.style={red, line width=.7mm},
k2/.style={white!40!blue, line width=.7mm},
}
\def\threefan{
\node[class] (1) {$1$};
\foreach \i/\s/\a in {2/1/0, 3/2/0, 5/1/-60, 4/5/0}
\path (\s) ++(\a:2.5cm) node[class] (\i) {$\i$};
}
\def2.5cm{1.7cm}
\begin{figure}[ht]
\centering
\begin{tikzpicture}[
pics/sample/.style={code={\draw[#1] (0,0) --(0.6,0) ;}}]
\path (2) ++(0,2.5cm)
node[matrix,draw,nodes={anchor=center},inner sep=2pt, ampersand replacement=\&] {
\pic{sample=spanner}; \& \node{Spanning tree}; \&
\pic{sample=extra}; \& \node{Augmenting edge}; \\
\pic{sample=k1}; \& \node{First kernel vector}; \&
\pic{sample=k2}; \& \node{Second kernel vector}; \\
};
\end{tikzpicture}
\\[.2cm]
\subfloat[Construction A.]{
\centering
\begin{tikzpicture}
\def.7mm{.7mm}
\threefan
\draw (1) edge[spanner] (5)
(4) edge[extra] node[right] {$a$} (3)
(2) edge[spanner] (4)
(5) edge[spanner] (2)
(2) edge[spanner] (3)
(1) edge[k1] node[above] {$s_1$} (2)
(5) edge[k2] node[above] {$s_2$} (4);
\end{tikzpicture}}
\hfill
\subfloat[First vector for A ($\KP_{3, 3, 0}$).]{
\begin{tikzpicture}
\def.7mm{.7mm}
\threefan
\draw (1) edge[k1] node[k1, above] {$1$} (2)
(1) edge[k1] node[left] {$-1$} (5)
(2) edge[k1] node[left] {$1$} (5)
(2) edge[k1] node[above] {$-1$} (3)
(2) edge[k1] node[right] {$-1$} (4)
(3) edge[k1] node[right] {$1$} (4)
(5) edge node[above] {$0$}(4)
;
\end{tikzpicture}}
\hfill
\subfloat[Second vector for A ($C_4$).]{
\begin{tikzpicture}
\def.7mm{.7mm}
\threefan
\draw (1) edge node[above] {$0$} (2)
(1) edge node[left] {$0$} (5)
(2) edge node[right] {$0$} (4)
(5) edge[k2] node[above] {$1$}(4)
(5) edge[k2] node[left] {$-1$} (2)
(3) edge[k2] node[above] {$1$} (2)
(3) edge[k2] node[right] {$-1$} (4)
;
\end{tikzpicture}}
\\
\subfloat[Construction B.]{
\begin{tikzpicture}[
pics/sample/.style={code={\draw[#1] (0,0) --(0.6,0) ;}}]
\def.7mm{.7mm}
\threefan
\draw (1) edge[spanner] (2)
(2) edge[spanner] (3)
(3) edge[spanner] (4)
(4) edge[spanner] (5)
(1) edge[extra] node[left] {$a$} (5)
(2) edge[k1] node[right] {$s_1$} (4)
(2) edge[k2] node[left] {$s_2$} (5);
\end{tikzpicture}}
\hfill
\subfloat[First vector for B ($C_4$).]{
\begin{tikzpicture}
\def.7mm{.7mm}
\threefan
\draw (1) edge[k1] node[k1, above] {$-1$} (2)
(1) edge[k1] node[left] {$1$} (5)
(2) edge[k1] node[right] {$1$} (4)
(5) edge[k1] node[above] {$-1$}(4)
(2) edge node[left] {$0$} (5)
(2) edge node[above] {$0$} (3)
(3) edge node[right] {$0$} (4)
;
\end{tikzpicture}}
\hfill
\subfloat[Second vector for B ($C_4$).]{
\begin{tikzpicture}
\def.7mm{.7mm}
\threefan
\draw (1) edge node[above] {$0$} (2)
(1) edge node[left] {$0$} (5)
(2) edge node[right] {$0$} (4)
(5) edge[k2] node[above] {$-1$}(4)
(5) edge[k2] node[left] {$1$} (2)
(3) edge[k2] node[above] {$-1$} (2)
(3) edge[k2] node[right] {$1$} (4)
;
\end{tikzpicture}}
\caption{
\label{fig:triamond-kernel}
Two possible constructions of a kernel basis for the triamond graph.
}
\end{figure}
\def\codomino{
\node[class] (1) {$1$};
\foreach \i/\s/\a in {2/1/30, 6/1/-30, 3/2/0, 5/6/0, 4/5/30}
\path (\s) ++(\a:2.5cm) node[class] (\i) {$\i$};
}
\def2.5cm{1.3cm}
\begin{figure}[ht]
\centering
\subfloat[Construction A.]{
\begin{tikzpicture}
\def.7mm{.7mm}
\codomino
\draw (1) edge[spanner] (6)
(2) edge[spanner] (6)
(5) edge[spanner] node[below, white] {0} (6)
(3) edge[spanner] (5)
(4) edge[spanner] (5)
(3) edge[extra] node[above] {$a$} (4)
(1) edge[k1] node[above] {$s_1$} (2)
(2) edge[k2] node[above] {$s_2$} (3);
\end{tikzpicture}}
\hfill
\subfloat[First vector for A ($\KP_{3, 3, 1}$).]{
\begin{tikzpicture}
\def.7mm{.7mm}
\codomino
\draw (1) edge[k1] node[above] {$1$} (2)
(6) edge[k1] node[right, xshift=-.1cm] {$-1$} (2)
(1) edge[k1] node[below, xshift=-.1cm] {$-1$} (6)
(5) edge[k1] node[below] {$2$} (6)
(4) edge[k1] node[above] {$1$} (3)
(4) edge[k1] node[below, xshift=.1cm] {$-1$} (5)
(5) edge[k1] node[left, xshift=.1cm] {$-1$} (3)
(2) edge node[above] {$0$} (3);
\end{tikzpicture}}
\hfill
\subfloat[Second vector for A ($\C_4$).]{
\begin{tikzpicture}
\def.7mm{.7mm}
\codomino
\draw (1) edge node[below] {$0$} (6)
(1) edge node[above] {$0$} (2)
(4) edge node[above] {$0$} (3)
(4) edge node[below] {$0$} (5)
(2) edge[k2] node[above] {$1$}(3)
(5) edge[k2] node[left, xshift=.1cm] {$-1$} (3)
(6) edge[k2] node[right, xshift=-.1cm] {$-1$} (2)
(6) edge[k2] node[below] {$1$} (5);
\end{tikzpicture}}
\\
\subfloat[Construction B.]{
\begin{tikzpicture}
\def.7mm{.7mm}
\codomino
\draw (1) edge[spanner] (2)
(2) edge[spanner] (3)
(3) edge[spanner] (4)
(4) edge[spanner] (5)
(6) edge[spanner] node[below, white] {0} (5)
(3) edge[extra] node[left] {$a$} (5)
(1) edge[k1] node[below] {$s_1$} (6)
(2) edge[k2] node[right] {$s_2$} (6);
\end{tikzpicture}}
\hfill
\subfloat[First vector for B ($\C_6$).]{
\begin{tikzpicture}
\def.7mm{.7mm}
\codomino
\draw (1) edge[k1] node[above] {$-1$} (2)
(2) edge[k1] node[above] {$1$} (3)
(3) edge[k1] node[above, xshift=.1cm] {$-1$} (4)
(4) edge[k1] node[below] {$1$} (5)
(5) edge[k1] node[below, xshift=-.1cm] {$-1$} (6)
(6) edge[k1] node[below] {$1$} (1)
(2) edge node[right] {$0$} (6)
(5) edge node[left] {$0$} (3);
\end{tikzpicture}}
\hfill
\subfloat[Second vector for B ($\C_4$).]{
\begin{tikzpicture}
\def.7mm{.7mm}
\codomino
\draw (1) edge node[below] {$0$} (6)
(1) edge node[above] {$0$} (2)
(4) edge node[above] {$0$} (3)
(4) edge node[below] {$0$} (5)
(2) edge[k2] node[above] {$-1$}(3)
(5) edge[k2] node[left] {$1$} (3)
(6) edge[k2] node[right] {$1$} (2)
(6) edge[k2] node[below] {$-1$} (5);
\end{tikzpicture}}
\caption{\label{fig:codomino-kernel}
Two possible constructions of a kernel basis for the codomino graph.}
\end{figure}
\begin{proposition} \label{prop:spanning}
Algorithm~\ref{algo:spanning} terminates and returns a basis of the kernel of the incidence matrix~$A$ of the compatibility graph~$G$.
\end{proposition}
\begin{proof}
See Appendix~\ref{app:spanning}.
\end{proof}
Importantly, given an edge~$k \in \E$,
all solutions of the conservation equation~\eqref{eq:system-matrix}
have the same value along edge~$k$
if and only if
edge~$k$ does not belong
to the support of any basis vector.
According to Algorithm~\ref{algo:spanning},
this is equivalent to say that edge~$k$
belongs neither to an even cycle
nor to a kayak paddle.
In the diamond graph of \Cref{ex:diamond} for instance,
the edge $\{2,4\}$ is the only one
that does not belong to the even cycle 1--2--3--4,
and it is also the only one with a fixed value~$\beta$.
In general, if an edge~$k \in \E$ satisfies this unicity condition,
then the matching rate along edge~$k$
in a stable matching model $(G, \mu, \Phi)$
is independent of the policy~$\Phi$.
Note that there is no general relation between
the number of edges with uniquely-defined matching rates
and the dimensionality~$d$ of the affine space~$\La$.
\subsection{Convex polytope of positive solutions} \label{subsec:positive-solutions}
We now consider the set $\Lann$ of solutions
of the conservation equation~\eqref{eq:system-matrix}
that have non-negative components, that is,
\begin{align} \label{eq:Piplus}
\Lann = \La \cap \Rnn^m
= \{ y \in \R^m: A y = \mu, y \ge 0\}.
\end{align}
The set~$\Lann$ is a $d$-dimensional convex polytope in $\R^m$,
as it is the intersection of a $d$-dimensional affine space
with the positive orthant $\Rnn^m$,
both of which are convex.
The set~$\Lann$ is neither empty
nor degenerated to a dimension lower than $d$
because the matching problem $(G, \mu)$ is assumed to be stabilizable, which means that $\La$ contains a point with positive components (i.e. in the interior of the positive orthant). It is bounded because
each $y \in \Lann$ satisfies
$0 \le y_k \le \min_{i \in \V_k}(\mu_i)$
for each $k \in \E$.
Equation \eqref{eq:Piplus} describes $\Lann$ in the edge basis. As $\Lann$ is a subset of $\La$, we can also express its elements in the kernel basis introduced in \Cref{sec:coordinate-spaces}. In the kernel basis, $\Lann$ is defined by the vectors whose coordinates belong to
\begin{align} \label{eq:Piplusalpha}
\Pi_{\geqslant 0} = \{ \alpha \in \R^d: y^\circ + B\alpha \ge 0\}.
\end{align}
As \Cref{eq:Piplus,eq:Piplusalpha} basically represent the same polytope up to the change-of-basis formulas introduced in \Cref{sec:coordinate-spaces}, in the remainder, we will use the same letter $\Lann$ to describe both sets; the implicit basis we are actually using will be made clear by our choice of letters ($y$ for the edge basis or $\alpha$ for the kernel basis).
\subsubsection{Vertices of the convex polytope}\label{subsubsec:vertices}
Vertices can be informally defined as the \emph{corners} or extreme points of a convex polytope.
\Cref{def:vertex} gives a formal definition of a vertex (as well as those of a face and a facet, which will be useful later).
\begin{definition}[Vertices and facets, adapted from \cite{Z95}] \label{def:vertex}
A \emph{face} of a convex polytope $\Pi$ is an intersection of $\Pi$ with a hyperplane such that the polytope~$\Pi$ is entirely contained in one of the two halfspaces determined by the hyperplane.
A \emph{vertex} of~$\Pi$ is a face of dimension~0,
while a \emph{facet} of~$\Pi$ is a face of dimension~$d-1$.
A vertex can also be defined as follows:
a vector $y \in \Pi$ is
a facet of~$\Pi$
if, and only if, it cannot be written
as a convex combination
of points in $\Pi {\setminus} \{y\}$.
\end{definition}
The vertices of $\Lann$ are important if one wants to optimize some linear function of the matching rate, as stated by \Cref{prop:vertices-optimal}.
This kind of optimization occurs in many problems related to dynamic matching systems (see for example \cite{NS19} and references within).
\begin{proposition}\label{prop:vertices-optimal}
Let $w=(w_1, \ldots, w_m)\in \R^m$ be a reward function associated to the edges of the compatibility graph. Consider the problem of finding the non-negative solutions of the conservation equation~\eqref{eq:system-matrix}~that maximizes the reward:
\begin{equation}
F = \{y\in \Lann : w^\intercal y =\max_{z\in \Lann} w^\intercal z\}\text{.}
\end{equation}
$F$ is a non-empty face of $\Lann$. In particular, there exists a vertex $y\in \Lann$ that maximizes the reward (i.e. $y\in F$).
\end{proposition}
\begin{proof}
This is a standard convex optimization result. The fact that $\Lann$ is bounded guarantees the existence of a maximum $r_{\max}$ amongst the rewards inside $\Lann$. $F$, which is the intersection of the hyperplane $\{y\in \R^m: w^\intercal y = r_{\max}\}$ and $\Lann$, is hence a non-empty face of $\Lann$. The fact that any non-empty face contains a vertex is a consequence of the latice structure of the faces of a polytope.
\end{proof}
The interest of \Cref{prop:vertices-optimal} is the following: if for any vertex $v$ of $\Lann$ one can provide a stable policy $\Phi$ whose matching rate is $v$, or at least arbitrarily close to $v$, then we can optimize with a stable policy any linear reward function (or at least be arbitrarily close to the optimal). Finding such policies will be the main focus of \Cref{subsec:nongreedy-rates}.
\Cref{prop:vertex} below gives a simple yet powerful characterization of vertices.
The proof of this proposition is borrowed from~\cite{CS22}.
\begin{proposition} \label{prop:vertex}
Consider a vector $y \in \Lann$.
Let $\E_y = \{k \in \E: y_k > 0\}$
denote the support of the vector~$y$ and
$G_y = (\V, \E_y)$ the subgraph of~$G$
obtained by deleting the edges that are not in~$\E_y$.
The following statements are equivalent:
\begin{enumerate}
\item \label{vertex-1}
The vector~$y$ is a vertex of $\Lann$.
\item \label{vertex-2}
The graph~$G_y$ is injective.
\end{enumerate}
\end{proposition}
\begin{proof}
Let $A_y$ denote the incidence matrix of~$G_y$.
By \Cref{def:vertex}, if $y$ is not a vertex, there exist $z_1, z_2 \in \Lann{\setminus}\{y\}$ and $0<\theta<1$ such that $y=\theta z_1+(1-\theta)z_2$. The components of the vectors $z_1$ and $z_2$ are non-negative, so this equality implies that their supports are included into the support of the vector~$y$. In particular, if $y'$ and $z_1'$ denote the restrictions of $y$ and $z_1$ to components in $\E_y$, respectively, we obtain $A_yy'=A y = \mu = A z_1 = A_yz'_1$ with $y' \neq z'_1$, which means that $G_y=(V, \E_y)$ is not injective.
Conversely, if $G_y$ is not injective, there exists a non-zero vector $z'$ in $\R^{|\E_y|}$ such that $A_yz'= 0$. If we embed $z'$ into $\R^{|\E|}$ with zero-padding, we obtain a non-zero vector~$z$ such that $Az = 0$, and whose support is included into that of the vector~$y$. This implies that there exists $\varepsilon>0$ such that both $y-\varepsilon z$ and $y+\varepsilon z$ belong to $\Lann$. The convex combination $y=\frac 12 (y-\varepsilon z) + \frac 12 (y+\varepsilon z)$ proves that the vector~$y$ is not a vertex of $\Lann$.
\end{proof}
Examples of vertices are shown in \Cref{fig:codomino-simple,fig:codomino-multiple,fig:whirl}
and will be discussed in details later. For now, it is sufficient to observe that,
since the subgraph restricted to the support of a vertex is injective,
this subgraph is either bijective
(as in \Cref{fig:ys1,fig:ys2,fig:ys3,fig:ys4,fig:ys5,fig:yw1,fig:yw2,fig:yw3,fig:yw4})
or injective-only
(as in \Cref{fig:y1,fig:y2,fig:y3,fig:yw5}).
\Cref{coro:achievable} below characterizes the stabilizability of $(G_y, \mu)$ for a vertex $y$. This will be useful in \Cref{subsec:nongreedy-rates}, where the construction of a stable policy on $G$ to achieve a vertex $y$ will depend on the bijectivity of $G_y$.
\begin{corollary} \label{coro:achievable}
Consider a vertex~$y$ of $\Lann$, and
define $\E_y$ and $G_y$ as in \Cref{prop:vertex}.
We distinguish two cases,
depending on the value of $p = |\E_y|$:
\begin{enumerate}
\item If $p = n$, i.e. exactly $d$ components of $y$ are null, then the subgraph~$G_y$ is bijective and
the matching problem $(G_y, \mu)$ is stabilizable.
\item If $p < n$, i.e. strictly more than $d$ components of $y$ are null, then the subgraph $G_y$ is injective-only and
the matching problem $(G_y, \mu)$ is not stabilizable.
\end{enumerate}
\end{corollary}
\begin{proof}
Let $A_y$ denote the incidence matrix of~$G_y$. We know from \Cref{prop:vertex}
that $G_y$ is injective.
In particular,
the restriction~$y'$ of the vector~$y$
to its positive components
is the only solution
of the conservation equation $A_y z = \mu$,
of unknown $z \in \R^p$.
It also follows from \Cref{prop:dimensions}
that $p \le n$, and that
the subgraph~$G_y$ is bijective if and only if $p = n$.
We know consider the two cases separately:
\begin{enumerate}
\item If $p = n$, then $G_y$ is bijective.
\Cref{prop:stability-region-form}
implies that the matching problem $(G_y, \mu)$
is stabilizable,
as $G$ is surjective and $y'$ is a solution
of the conservation equation~$A_y z = \mu$
with positive components.
\item If $p < n$, then $G_y$ is injective-only.
\Cref{prop:stability-region-nonempty}
implies that the matching problem
$(G_y, \mu)$ is not stabilizable.
\end{enumerate}
\end{proof}
\begin{remark}
Again consider a vertex~$y$ of $\Lann$,
and define~$G_y$ and~$A_y$
as in \Cref{prop:vertex}.
According to \Cref{def:injective,def:surjective,def:only},
the subgraph~$G_y$ is injective if and only if
each connected component of~$G_y$ is
either a tree or a unicyclic graph with an odd cycle.
For each connected component of $G_y$ that is a tree,
and therefore a bipartite graph
with parts $V_+$ and $V_-$,
the existence of vertex~$y$ implies that
\begin{align} \label{eq:image}
\sum_{i \in \V_+} \mu_i
= \sum_{i \in \V_-} \mu_i.
\end{align}
Equation~\eqref{eq:image} follows
by summing~\eqref{eq:system-equations}
over the nodes in $\V_+$ on the one hand,
summing~\eqref{eq:system-equations}
over the nodes in $\V_-$ on the other hand,
and verifying that the left-hand sides of both equations
are equal.
In fact, one can verify that
the vector~$\mu$ belongs to the image of $A_y$
if and only if $\mu$ satisfies \eqref{eq:image}
for each tree connected component of~$G_y$.
Note that this condition is empty if $G_y$ is bijective,
as each connected component
of $G_y$ then contains an odd cycle.
Conversely, one can wonder
which injective surgraph~$G'$ of~$G$
defines a vertex of $\Lann$.
Satisfying~\eqref{eq:image}
for each tree connected component of~$G'$
only guarantees the existence
of a (unique) solution $z \in \R^p$
to the conservation equation~$A_y z = \mu$.
If each component of~$z$ is positive, then
we indeed obtain a corner of $\Lann$
by embedding $z$ in $\R^m$ with zero padding;
otherwise, $G'$ does not define a vertex of~$\Lann$.
\end{remark}
\subsubsection{Bijective vertices and facets of the convex polytope}\label{subsubsec:facets}
By a slight abuse of notation, we will say that a vertex $y\in \Lann$ is bijective (resp. injective-only) to express that $G_y$ is bijective (resp. injective-only). As stated above, the bijectivity of vertices plays an important role in the study of the matching rates that can be achieved by stable policies, which will be the matter of \Cref{sec:non-unicyclic}. We now detail the relationship between the bijectivity of vertices and the inequalities that define $\Lann$.
Following \Cref{coro:achievable}, the bijectivity of a vertex is determined by the number of its components that are positive in edge coordinates.
Recall that the $d$-dimensional polytope $\Lann$ is actually characterized by the $m$ inequalities $y_k \ge 0$ for each $k \in \E$. In particular, this polytope has at most $m$ facets, one for each inequality, but it typically has fewer. Indeed, some inequalities may be redundant and/or not tight, in a sense that will be defined in \Cref{def:inequalities} below. For example, by looking more closely at the general solution obtained for the diamond graph in \Cref{fig:diamond}, we conclude that:
\begin{itemize}
\item The inequality $y_{2,4} \ge 0$ is satisfied trivially by every vector $y \in \La$,
as we have $y_{2, 4}=\beta > 0$.
Therefore, this inequality
does not define a facet.
\item If $\mu_1\bar{\mu}_2<\mu_3\bar{\mu}_4$,
the inequality $y_{1,2} \ge 0$
supersedes the inequality $y_{3,4} \ge 0$,
and conversely.
If $\mu_1\bar{\mu}_2 = \mu_3\bar{\mu}_4$,
these two inequalities are equivalent.
In both cases, the inequalities $y_{1,2} \ge 0$ and $y_{3,4} \ge 0$
lead to a single facet.
\item If $\mu_1\bar{\mu}_4 < \mu_3\bar{\mu}_2$, the inequality $y_{1,4} \ge 0$ supersedes the inequality $y_{2,3} \ge 0$, and conversely. If $\mu_1\bar{\mu}_4 = \mu_3\bar{\mu}_2$,
these two inequalities are equivalent.
In both cases, the inequalities $y_{1,4} \ge 0$ and $y_{2,3} \ge 0$
lead to a single facet.
\end{itemize}
All in all, the $1$-dimensional convex polytope~$\Lann$ associated with the diamond graph of \Cref{ex:diamond} has two facets, even if it is defined by five inequalities.
\Cref{def:inequalities} below will help us relate these notions to the number of zero components of the vertices of the convex polytope~$\Lann$.
\begin{definition}[Adapted from \cite{BP83,Z95}] \label{def:inequalities}
Let $k \in \E$.
\begin{enumerate}
\item The inequality $y_k \ge 0$ is said to be \emph{tight} if there exists a vector $y\in \Lann$ such that $y_k=0$, in which case we also say that this inequality is tight for the vector~$y$.
\item The inequality $y_k\geq 0$ is said to be \emph{redundant} if removing this inequality does not change the polytope $\Lann$, in the sense that
\begin{align*}
\Lann = \{y \in \R^m: Ay = \mu, y_\ell \ge 0 \text{ for each } \ell \in \E \setminus \{k\}\}.
\end{align*}
Otherwise, this inequality
is called \emph{irredundant}.
\item The matching problem $(G, \mu)$ is said to be \emph{essential} if all tight inequalities are irredundant.
\item The polytope $\Lann$ is said to be \emph{simple} if every vertex of $\Lann$ belongs to exactly $d$ facets, which is the minimal number of facets a vertex belongs to.
\end{enumerate}
\end{definition}
Importantly, the number of positive components of a vertex~$y$ (considered in \Cref{coro:achievable}) is the number of inequalities that are not tight for this vertex. More generally, \Cref{def:inequalities} has the following intuitive interpretation. An inequality is tight if the convex polytope~$\Lann$ intersects the hyperplane obtained by transforming this inequality into an equality. Non-tight inequalities are ``useless'' (and redundant) because they are never satisfied as equalities by any vector in~$\Lann$. The matching problem $(G, \mu)$ is essential if each tight inequality defines a distinct facet of the convex polytope~$\Lann$. Under this condition, the number of facets that contain a vertex is equal to the number of inequalities that are tight for this vertex. In particular, as we will see in \Cref{prop:simple}, if the matching problem $(G, \mu)$ is essential and the polytope $\Lann$ is simple, then every vertex satisfies exactly $d$ (tight) inequalities as equalities, which means that this vertex has $d$ zero components, and therefore $n = m - d$ positive components, so that this vertex is bijective.
All these notions are illustrated in
\Cref{ex:essential,ex:non-essential,ex:non-simple}
below, which show in particular that a matching problem $(G, \mu)$ may be essential even if the polytope $\Lann$ is not simple, and conversely.
Consistently with \Cref{ex:diamond} above,
these examples use a kernel basis to verify effortlessly whether an inequality is tight and/or irredundant.
\tikzset{
dot/.style = {circle, fill=orange, minimum size=#1,
inner sep=0pt, outer sep=0pt},
dot/.default = 4pt
}
\begin{figure}[ht!]
\centering
\subfloat[Inequalities. \label{tab:essential}]{
\begin{tabular}{|c|c|c|c|}
\hline
Edge basis
& Kernel basis
& Tight?
& Irredundant? \\ \hline
$y_{1,2} \ge 0$ &
$\alpha_1 \le 2$ &
\ding{55} & \ding{55} \\ \hline
$y_{1,6} \ge 0$ &
$\alpha_1 \ge -2$ &
\ding{55} & \ding{55} \\ \hline
$y_{2,3} \ge 0$ &
$\alpha_1 - \alpha_2 \ge -1$ &
\ding{51} & \ding{51} \\ \hline
$y_{2,6} \ge 0$ &
$\alpha_2 \ge -2$ &
\ding{55} & \ding{55} \\ \hline
$y_{3,4} \ge 0$ &
$\alpha_1 \le 1$ &
\ding{51} & \ding{51} \\ \hline
$y_{3,5} \ge 0$ &
$\alpha_2 \ge -1$ &
\ding{51} & \ding{51} \\ \hline
$y_{4,5} \ge 0$ &
$\alpha_1 \ge -1$ &
\ding{51} & \ding{51} \\ \hline
$y_{5,6} \ge 0$ &
$\alpha_1 + \alpha_2 \le 1$ &
\ding{51} & \ding{51} \\ \hline
\end{tabular}
}
\\
\subfloat[Generic solution of the conservation equation~\eqref{eq:system-matrix}. \label{fig:codomino-general}]{
\begin{tikzpicture}
\def2.5cm{2.4cm}
\codomino
\draw (1) edge node[above, sloped] {$2 - \alpha_1$} (2)
(1) edge node[below, sloped] {$2 + \alpha_1$} (6)
(2) edge node[above] {$1 + \alpha_1 - \alpha_2$} (3)
(2) edge node[above, sloped] {$2 + \alpha_2$} (6)
(3) edge node[above, sloped] {$1 - \alpha_1$} (4)
(5) edge node[above, sloped] {$1 + \alpha_2$} (3)
(4) edge node[below, sloped] {$1 + \alpha_1$} (5)
(5) edge node[below] {$1 - \alpha_1 - \alpha_2$} (6);
\end{tikzpicture}
}
\hfill
\subfloat[Polytope $\Lann$ in kernel basis.
\label{fig:codomino-simple-polytope}]{
\begin{tikzpicture}[scale=1.6]
\draw[->] (-1.5,0) -- (1.5,0);
\node[anchor=west] at (1.5,0) {$\alpha_1$};
\draw[->] (0,-1.3) -- (0,1.3);
\node[anchor=south] at (0,1.3) {$\alpha_2$};
\node[anchor=north east] {0};
\node (v1) at (-1,-1) {};
\node (v2) at (-1,0) {};
\node (v3) at (0,1) {};
\node (v4) at (1,0) {};
\node (v5) at (1,-1) {};
\path[draw=blue, very thick, fill=blue, fill opacity=.2]
(v1.center) -- (v2.center) -- (v3.center)
-- (v4.center) -- (v5.center) -- cycle;
\node[anchor=north, text=orange]
at (v1) {$(-1, -1)$};
\node[anchor=west, text=orange, yshift=.1cm]
at (v3) {$(0, 1)$};
\node[anchor=south east, text=orange, xshift=.12cm, yshift=.1cm]
at (v2) {$(-1, 0)$};
\node[anchor=south west, text=orange, xshift=-.12cm, yshift=.1cm]
at (v4) {$(1, 0)$};
\node[anchor=north, text=orange]
at (v5) {$(1, -1)$};
\foreach \i in {1,...,5}
\node[dot] at (v\i) {};
\end{tikzpicture}
}
\\
\subfloat[Edge coordinates of $(0, 1)$. \label{fig:ys1}]{
\begin{tikzpicture}
\def2.5cm{1.28cm}
\codomino
\draw (1) edge[k2] node[above] {$2$} (2)
(1) edge[k2] node[below] {$2$} (6)
(2) edge node[above] {$0$} (3)
(2) edge[k2] node[right] {$3$} (6)
(3) edge[k2] node[above] {$1$} (4)
(3) edge[k2] node[left] {$2$} (5)
(4) edge[k2] node[below] {$1$} (5)
(5) edge node[below] {$0$} (6);
\end{tikzpicture}
}
\hfill
\subfloat[Edge coordinates of $(-1, 0)$. \label{fig:ys2}]{
\begin{tikzpicture}
\def2.5cm{1.28cm}
\codomino
\draw (1) edge[k2] node[below] {$1$} (6)
(1) edge[k2] node[above] {$3$} (2)
(4) edge[k2] node[above] {$2$} (3)
(4) edge node[below] {$0$} (5)
(2) edge node[above] {$0$} (3)
(5) edge[k2] node[left] {$1$} (3)
(6) edge[k2] node[right] {$2$} (2)
(6) edge[k2] node[below] {$2$} (5);
\end{tikzpicture}
}
\hfill
\subfloat[Edge coordinates of $(1, 0)$. \label{fig:ys3}]{
\begin{tikzpicture}
\def2.5cm{1.28cm}
\codomino
\draw (1) edge[k2] node[above] {$1$} (2)
(1) edge[k2] node[below] {$3$} (6)
(2) edge[k2] node[above] {$2$} (3)
(2) edge[k2] node[right] {$2$} (6)
(3) edge node[above] {$0$} (4)
(3) edge[k2] node[left] {$1$} (5)
(4) edge[k2] node[below] {$2$} (5)
(5) edge node[below] {$0$} (6);
\end{tikzpicture}
}
\\
\subfloat[Edge coordinates of $(-1, -1)$. \label{fig:ys4}]{
\begin{tikzpicture}
\def2.5cm{1.28cm}
\codomino
\draw (1) edge[k2] node[below] {$1$} (6)
(1) edge[k2] node[above] {$3$} (2)
(4) edge[k2] node[above] {$2$} (3)
(4) edge node[below] {$0$} (5)
(2) edge[k2] node[above] {$1$} (3)
(5) edge node[left] {$0$} (3)
(6) edge[k2] node[right] {$1$} (2)
(6) edge[k2] node[below] {$3$} (5);
\end{tikzpicture}
}
\qquad
\subfloat[Edge coordinates of $(1, -1)$. \label{fig:ys5}]{
\begin{tikzpicture}
\def2.5cm{1.28cm}
\codomino
\draw (1) edge[k2] node[above] {$1$} (2)
(1) edge[k2] node[below] {$3$} (6)
(2) edge[k2] node[above] {$3$} (3)
(2) edge[k2] node[right] {$1$} (6)
(3) edge node[above] {$0$} (4)
(3) edge node[left] {$0$} (5)
(4) edge[k2] node[below] {$2$} (5)
(5) edge[k2] node[below] {$1$} (6);
\end{tikzpicture}
}
\caption{An essential matching problem $(G, \mu)$
with a simple polytope $\Lann$.
The vector of arrival rates is
$\mu = (4, 5, 3, 2, 3, 5) \in \R^6$,
a particular solution of the conservation equation~\eqref{eq:system-matrix}
is $y^\circ = (2, 2, 1, 2, 1, 1, 1, 1) \in \R^8$,
and the chosen base vectors for $\ker(A)$ are
$b_1 = (-1, 1, 1, 0, -1, 0, 1, -1)$ and
$b_2 = (0, 0, -1, 1, 0, 1, 0, -1)$.
}
\label{fig:codomino-simple}
\end{figure}
\begin{example}[Essential matching problem] \label{ex:essential}
\Cref{fig:codomino-simple} considers a codomino graph with the vector of arrival rates $\mu =(4, 5, 3, 2, 3, 5)$. A particular solution of
the conservation equation~\eqref{eq:system-matrix}
is $y^\circ = (2, 2, 1, 2, 1, 1, 1, 1) \in \R^8$,
and the basis of $\ker(A)$ consists of the vectors
$b_1 = (-1, 1, 1, 0, -1, 0, 1, -1)$
and $b_2 = (0, 0, -1, 1, 0, 1, 0, -1)$
obtained in construction~B
of \Cref{fig:codomino-kernel}.
The generic solution of the conservation equation~\eqref{eq:system-matrix}
is shown in \Cref{fig:codomino-general}.
The inequalities are listed in \Cref{tab:essential}.
The 2-dimensional polytope~$\Lann$,
shown in \Cref{fig:codomino-simple-polytope} in kernel basis,
is characterized by five tight inequalities which are also irredundant:
\begin{align*}
-1 &\le \alpha_1 \le 1,
&
\alpha_2 &\ge -1,
&
\alpha_1 - \alpha_2 &\ge -1,
&
\alpha_1 + \alpha_2 &\le 1.
\end{align*}
The matching problem $(G, \mu)$
is essential.
In kernel basis,
the vertices of
the convex polytope~$\Lann$ are
$(0, 1)$, $(-1, 0)$, $(1, 0)$,
$(-1, -1)$, and $(1, -1)$,
and we can verify on \Cref{fig:codomino-simple-polytope}
that each vertex belongs to exactly 2 facets.
Therefore, like all 2-dimensional polytopes,
$\Lann$ is simple.
All in all, each vertex of $\Lann$ has 2 zero components and 6 positive components in edge coordinates, so that this vertex is bijective.
These vertices are represented
in edge basis in \Cref{fig:ys1,fig:ys2,fig:ys3,fig:ys4,fig:ys5}.
\end{example}
\begin{figure}[ht!]
\centering
\subfloat[Inequalities \label{tab:non-essential}]{
\begin{tabular}{|c|c|c|c|}
\hline
Edge basis
& Kernel basis
& Tight?
& Irredundant? \\ \hline
$y_{1,2} \ge 0$ &
$\alpha_1 \le 1$ &
\ding{51} & \ding{55} \\ \hline
$y_{1,6} \ge 0$ &
$\alpha_1 \ge -1$ &
\ding{51} & \ding{55} \\ \hline
$y_{2,3} \ge 0$ &
$\alpha_1 - \alpha_2 \ge -2$ &
\ding{51} & \ding{55} \\ \hline
$y_{2,6} \ge 0$ &
$\alpha_2 \ge -1$ &
\ding{51} & \ding{55} \\ \hline
$y_{3,4} \ge 0$ &
$\alpha_1 \le 1$ &
\ding{51} & \ding{55} \\ \hline
$y_{3,5} \ge 0$ &
$\alpha_2 \ge -1$ &
\ding{51} & \ding{55} \\ \hline
$y_{4,5} \ge 0$ &
$\alpha_1 \ge -1$ &
\ding{51} & \ding{55} \\ \hline
$y_{5,6} \ge 0$ &
$\alpha_1 + \alpha_2 \le 0$ &
\ding{51} & \ding{51} \\ \hline
\end{tabular}
}
\\
\subfloat[Generic solution of the conservation equation~\eqref{eq:system-matrix}. \label{fig:codomino-multiple-general}]{
\begin{tikzpicture}
\def2.5cm{2.4cm}
\codomino
\draw (1) edge node[above, sloped] {$1 - \alpha_1$} (2)
(1) edge node[below, sloped] {$1 + \alpha_1$} (6)
(2) edge node[above] {$2 + \alpha_1 - \alpha_2$} (3)
(2) edge node[above, sloped] {$1 + \alpha_2$} (6)
(3) edge node[above, sloped] {$1 - \alpha_1$} (4)
(5) edge node[above, sloped] {$1 + \alpha_2$} (3)
(4) edge node[below, sloped] {$1 + \alpha_1$} (5)
(5) edge node[below] {$- \alpha_1 - \alpha_2$} (6);
\end{tikzpicture}
}
\hfill
\subfloat[Polytope $\Lann$ in kernel basis. Dashed lines show tight redundant inequalities.
\label{fig:codomino-multiple-polytope}]{
\begin{tikzpicture}[scale=1.1]
\node at (-2.75, 0) {};
\node at (2.75, 0) {};
\draw[->] (-1.6,0) -- (1.6,0);
\node[anchor=west] at (1.6,0) {$\alpha_1$};
\draw[->] (0,-1.6) -- (0,1.6);
\node[anchor=south] at (0,1.5) {$\alpha_2$};
\node[anchor=north east] {0};
\node (v1) at (-1,1) {};
\node (v2) at (-1,-1) {};
\node (v3) at (1,-1) {};
\path[fill=blue, fill opacity=.2]
(v1.center) -- (v2.center) -- (v3.center)
-- cycle;
\node[anchor=south east, text=orange]
at (v1) {$(-1, 1)$};
\node[anchor=north, text=orange]
at (v2) {$(-1, -1)$};
\node[anchor=west, text=orange, xshift=.12cm, yshift=.1cm]
at (v3) {$(1, -1)$};
\path[dashed, draw=blue, very thick]
(v1.center) -- (v2.center) -- (v3.center);
\path[draw=blue, very thick]
(v1.center) -- (v3.center);
\path[draw=blue, very thick, dashed] (-1.5, 0.5) -- (-.5, 1.5);
\path[draw=blue, very thick, dashed] (1, -1.5) -- (1, -.5);
\foreach \i in {1,...,3}
\node[dot] at (v\i) {};
\end{tikzpicture}
}
\\
\subfloat[Edge coordinates of $(-1, 1)$. \label{fig:y1}]{
\begin{tikzpicture}
\def2.5cm{1.28cm}
\codomino
\draw (1) edge[k2] node[above] {$2$} (2)
(1) edge node[below] {$0$} (6)
(2) edge node[above] {$0$} (3)
(2) edge[k2] node[right] {$2$} (6)
(3) edge[k2] node[above] {$2$} (4)
(3) edge[k2] node[left] {$2$} (5)
(4) edge node[below] {$0$} (5)
(5) edge node[below] {$0$} (6);
\end{tikzpicture}
}
\hfill
\subfloat[Edge coordinates of $(-1, -1)$. \label{fig:y2}]{
\begin{tikzpicture}
\def2.5cm{1.28cm}
\codomino
\draw (1) edge node[below] {$0$} (6)
(1) edge[k2] node[above] {$2$} (2)
(4) edge[k2] node[above] {$2$} (3)
(4) edge node[below] {$0$} (5)
(2) edge[k2] node[above] {$2$} (3)
(5) edge node[left] {$0$} (3)
(6) edge node[right] {$0$} (2)
(6) edge[k2] node[below] {$2$} (5);
\end{tikzpicture}
}
\hfill
\subfloat[Edge coordinates of $(1, -1)$. \label{fig:y3}]{
\begin{tikzpicture}
\def2.5cm{1.28cm}
\codomino
\draw (1) edge node[above] {$0$} (2)
(1) edge[k2] node[below] {$2$} (6)
(2) edge[k2] node[above] {$4$} (3)
(2) edge node[right] {$0$} (6)
(3) edge node[above] {$0$} (4)
(3) edge node[left] {$0$} (5)
(6) edge node[below] {$0$} (5)
(5) edge[k2] node[below] {$2$} (4);
\end{tikzpicture}
}
\caption{Non-essential matching problem $(G, \mu)$
with a simple polytope $\Lann$.
The vector of arrival rates is
$\mu = (2, 4, 4, 2, 2, 2) \in \R^6$,
a particular solution of the conservation equation~\eqref{eq:system-matrix}
is $y^\circ = (1, 1, 2, 1, 1, 1, 1, 0) \in \R^8$,
and the chosen base vectors for $\ker(A)$ are
$b_1 = (-1, 1, 1, 0, -1, 0, 1, -1)$ and
$b_2 = (0, 0, -1, 1, 0, 1, 0, -1)$.
}
\label{fig:codomino-multiple}
\end{figure}
\begin{example}[Non-essential matching problem] \label{ex:non-essential}
\Cref{fig:codomino-multiple} shows the same codomino graph as in \Cref{ex:essential}, with the same basis of $\ker(A)$, but with the vector of arrival rates $\mu = (2, 4, 4, 2, 2, 2)$.
A particular solution of the conservation equation~\eqref{eq:system-matrix}
is $y^\circ = (1, 1, 2, 1, 1, 1, 1, 0)$,
and the general solution is shown
in \Cref{fig:codomino-multiple-general}.
The inequalities are listed in \Cref{tab:non-essential}.
The 2-dimensional convex polytope $\Lann$
is shown in kernel basis
in \Cref{fig:codomino-multiple-polytope}.
All inequalities are tight, but only one is irredundant,
so we conclude that
the matching problem $(G, \mu)$
is not essential,
even if the polytope $\Lann$ is still simple.
Correspondingly, even if each vertex
belongs to exactly two facets,
they all have
more than two zero components, so none of them is bijective.
For example, the vertex $(1, -1)$ in kernel basis has coordinates
$(0, 2, 4, 0, 0, 0, 2, 0)$ in edge basis (\Cref{fig:y3}).
This vertex has five zero components in edge coordinates
(and only three positive components) even if this vertex belongs to only two facets.
\end{example}
\def\whirl{
\node[class] (1) {$1$};
\foreach \i/\s/\a in {2/1/30, 3/2/30, 4/3/-30, 5/4/-30, 8/1/-30, 7/8/-30, 6/7/30, 9/1/90, 10/5/-90}
\path (\s) ++(\a:2.5cm) node[class] (\i) {$\i$};
}
\begin{figure}[ht!]
\centering
\subfloat[Generic solution of the conservation equation~\eqref{eq:system-matrix}.\label{fig:whirl-edges}]{
\begin{tikzpicture}[scale=0.65, every node/.style={transform shape}]
\def2.5cm{2.6cm}
\whirl
\draw (1) edge node[above, sloped] {$\alpha_3$} (2)
(2) edge node[above, sloped] {$1-\alpha_1-\alpha_3$} (3)
(3) edge node[above, sloped] {$2-\alpha_2+\alpha_3$} (4)
(4) edge node[above, sloped] {$1+\alpha_2-\alpha_3$} (5)
(5) edge node[below, sloped] {$1+\alpha_3$} (6)
(6) edge node[below, sloped] {$1-\alpha_2-\alpha_3$} (7)
(7) edge node[below, sloped] {$2-\alpha_1+\alpha_3$} (8)
(8) edge node[below, sloped] {$1+\alpha_1-\alpha_3$} (1)
(1) edge node[left] {$2-\alpha_1$} (9)
(9) edge node[above, sloped] {$2+\alpha_1$} (2)
(5) edge node[right] {$2-\alpha_2$} (10)
(10) edge node[below, sloped] {$2+\alpha_2$} (6)
(3) edge node[left] {$3+\alpha_1+\alpha_2$} (7)
;
\end{tikzpicture}
}
\hfill
\subfloat[Polytope $\Lann$ in kernel basis.
\label{fig:whirl-polytope}]{
\begin{tikzpicture}[scale=1.2]
\draw[->, opacity=.3] (-1.6,0) -- (1.6,0);
\node[anchor=west] at (1.6,0) {$\alpha_1$};
\draw[->, opacity=.3] (-.9,-.9) -- (1.4,1.4);
\node[anchor=south] at (1.4,1.4) {$\alpha_2$};
\draw[->, opacity=.3] (0,-.9) -- (0,2.2);
\node[anchor=south] at (0,2.2) {$\alpha_3$};
\node (v1) at (-1.6,-.6) {};
\node (v2) at (.4,-.6) {};
\node (v3) at (1.6,.6) {};
\node (v4) at (-.4,.6) {};
\node (v5) at (0,2) {};
\path[draw=blue, very thick, fill=blue, fill opacity=.1]
(v1.center) -- (v2.center) -- (v3.center) -- (v4.center) -- cycle;
\path[draw=blue, very thick, fill=blue, fill opacity=.1]
(v1.center) -- (v4.center) -- (v5.center) -- cycle;
\path[draw=blue, very thick, fill=blue, fill opacity=.1]
(v3.center) -- (v4.center) -- (v5.center) -- cycle;
\path[draw=blue, very thick, fill=blue, fill opacity=.1]
(v1.center) -- (v2.center) -- (v5.center) -- cycle;
\path[draw=blue, very thick, fill=blue, fill opacity=.1]
(v3.center) -- (v2.center) -- (v5.center) -- cycle;
\node[anchor=north, text=orange]
at (v1) {$(-1, -1, 0)$};
\node[anchor=north west, text=orange]
at (v2) {$(1, -1, 0)$};
\node[anchor=west, text=orange]
at (v3) {$(1, 1, 0)$};
\node[anchor=east, xshift=-.6cm, text=orange]
at (v4) {$(-1, 1, 0)$};
\node[anchor=east, text=orange]
at (v5) {$(0, 0, 1)$};
\foreach \i in {1,...,5}
\node[dot] at (v\i) {};
\end{tikzpicture}
}
\\
\subfloat[Edge coordinates of $(-1, -1, 0)$. \label{fig:yw1}]{
\begin{tikzpicture}[scale=0.67, every node/.style={transform shape}]
\def2.5cm{1.6cm}
\whirl
\draw (1) edge node[above, sloped] {$0$} (2)
(2) edge[k2] node[above, sloped] {$2$} (3)
(3) edge[k2] node[above, sloped] {$3$} (4)
(4) edge node[above, sloped] {$0$} (5)
(5) edge[k2] node[below, sloped] {$1$} (6)
(6) edge[k2] node[below, sloped] {$2$} (7)
(7) edge[k2] node[below, sloped] {$3$} (8)
(8) edge node[below, sloped] {$0$} (1)
(1) edge[k2] node[left] {$3$} (9)
(9) edge[k2] node[above, sloped] {$1$} (2)
(5) edge[k2] node[right] {$3$} (10)
(10) edge[k2] node[below, sloped] {$1$} (6)
(3) edge[k2] node[left] {$1$} (7)
;
\end{tikzpicture}
}
\hfill
\subfloat[Edge coordinates of $(1, -1, 0)$. \label{fig:yw2}]{
\begin{tikzpicture}[scale=0.67, every node/.style={transform shape}]
\def2.5cm{1.6cm}
\whirl
\draw (1) edge node[above, sloped] {$0$} (2)
(2) edge node[above, sloped] {$0$} (3)
(3) edge[k2] node[above, sloped] {$3$} (4)
(4) edge node[above, sloped] {$0$} (5)
(5) edge[k2] node[below, sloped] {$1$} (6)
(6) edge[k2] node[below, sloped] {$2$} (7)
(7) edge[k2] node[below, sloped] {$1$} (8)
(8) edge[k2] node[below, sloped] {$2$} (1)
(1) edge[k2] node[left] {$1$} (9)
(9) edge[k2] node[above, sloped] {$3$} (2)
(5) edge[k2] node[right] {$3$} (10)
(10) edge[k2] node[below, sloped] {$1$} (6)
(3) edge[k2] node[left] {$3$} (7)
;
\end{tikzpicture}
}
\hfill
\subfloat[Edge coordinates of $(1, 1, 0)$. \label{fig:yw3}]{
\begin{tikzpicture}[scale=0.67, every node/.style={transform shape}]
\def2.5cm{1.6cm}
\whirl
\draw (1) edge node[above, sloped] {$0$} (2)
(2) edge node[above, sloped] {$0$} (3)
(3) edge[k2] node[above, sloped] {$1$} (4)
(4) edge[k2] node[above, sloped] {$2$} (5)
(5) edge[k2] node[below, sloped] {$1$} (6)
(6) edge node[below, sloped] {$0$} (7)
(7) edge[k2] node[below, sloped] {$1$} (8)
(8) edge[k2] node[below, sloped] {$2$} (1)
(1) edge[k2] node[left] {$1$} (9)
(9) edge[k2] node[above, sloped] {$3$} (2)
(5) edge[k2] node[right] {$1$} (10)
(10) edge[k2] node[below, sloped] {$3$} (6)
(3) edge[k2] node[left] {$5$} (7)
;
\end{tikzpicture}
}
\\
\subfloat[Edge coordinates of $(-1, 1, 0)$. \label{fig:yw4}]{
\begin{tikzpicture}[scale=0.67, every node/.style={transform shape}]
\def2.5cm{1.6cm}
\whirl
\draw (1) edge node[above, sloped] {$0$} (2)
(2) edge[k2] node[above, sloped] {$2$} (3)
(3) edge[k2] node[above, sloped] {$1$} (4)
(4) edge[k2] node[above, sloped] {$2$} (5)
(5) edge[k2] node[below, sloped] {$1$} (6)
(6) edge node[below, sloped] {$0$} (7)
(7) edge[k2] node[below, sloped] {$3$} (8)
(8) edge node[below, sloped] {$0$} (1)
(1) edge[k2] node[left] {$3$} (9)
(9) edge[k2] node[above, sloped] {$1$} (2)
(5) edge[k2] node[right] {$1$} (10)
(10) edge[k2] node[below, sloped] {$3$} (6)
(3) edge[k2] node[left] {$3$} (7)
;
\end{tikzpicture}
} \qquad
\subfloat[Edge coordinates of $(0, 0, 1)$. \label{fig:yw5}]{
\begin{tikzpicture}[scale=0.67, every node/.style={transform shape}]
\def2.5cm{1.6cm}
\whirl
\draw (1) edge[k2] node[above, sloped] {$1$} (2)
(2) edge node[above, sloped] {$0$} (3)
(3) edge[k2] node[above, sloped] {$3$} (4)
(4) edge node[above, sloped] {$0$} (5)
(5) edge[k2] node[below, sloped] {$2$} (6)
(6) edge node[below, sloped] {$0$} (7)
(7) edge[k2] node[below, sloped] {$3$} (8)
(8) edge node[below, sloped] {$0$} (1)
(1) edge[k2] node[left] {$2$} (9)
(9) edge[k2] node[above, sloped] {$2$} (2)
(5) edge[k2] node[right] {$2$} (10)
(10) edge[k2] node[below, sloped] {$2$} (6)
(3) edge[k2] node[left] {$3$} (7)
;
\end{tikzpicture}
}
\caption{Essential matching problem $(G, \mu)$
with a non-simple polytope $\Lann$.
The arrival rate is $\mu=(3,3,6,3,4,4,6,3,4,4)\in \R^{10}$. A particular solution
and the chosen base vectors for $\ker(A)$ are implicitly shown on the edges of \cref{fig:whirl-edges}.
\label{fig:whirl}
}
\end{figure}
\begin{example}[Non-simple polytope] \label{ex:non-simple}
We finally exhibit an essential matching problem with a non-simple associated polytope. As 2-dimensional polytopes are simple, we need to consider a more complex example.
We consider the matching problem of \cref{fig:whirl-edges}. The arrival rate is $\mu=(3,3,6,3,4,4,6,3,4,4)\in \R^{10}$. The particular solution and kernel basis are shown on the edges.
The set $\Lann$,
shown in \Cref{fig:whirl-polytope} in kernel basis,
is an Egyptian pyramid characterized by the following tight inequalities:
\begin{align*}
\alpha_3
&\ge 0,
&
1+\alpha_1-\alpha_3 &\ge 0,
&
1-\alpha_1-\alpha_3 &\ge 0,
&
1+\alpha_2-\alpha_3 &\ge 0,
&
1-\alpha_2-\alpha_3 &\ge 0.
\end{align*}
These five inequalities are irredundant (each one corresponds to exactly one of the five facets), so we conclude that the matching problem $(G, \mu)$ is essential.
In kernel basis, the vertices of this convex polytope are
$(-1,-1,0)$, $(1,-1, 0)$, $(1,1, 0)$,
$(-1, 1,0)$, and $(0,0,1)$.
These vertices are shown in edge basis in \Cref{fig:yw1,fig:yw2,fig:yw3,fig:yw4,fig:yw5}. The polytope~$\Lann$ is not simple because the vertex $(0, 0, 1)$ (the ``top'' of the pyramid) belongs to 4 facets, while the polytope has dimension~3. Consistently, we can see in \Cref{fig:yw5} that this vertex has four zero components and only nine positive components in edge basis; the subgraph defined by the support of this vertex is injective-only.
\end{example}
In light of the examples above, we can give the following characterization of the bijective vertices of $\Lann$.
\begin{proposition} \label{prop:simple}
Let $y$ be a vertex of $\Lann$. The following statements are equivalent:
\begin{enumerate}
\item \label{simple-1}
$y$ is bijective.
\item \label{simple-3}
$y$ belongs to exactly $d$ facets of $\Lann$ and none of the inequalities tight for $y$ is redundant.
\end{enumerate}
In particular, all vertices of $\Lann$ are bijective if, and only if, the matching problem $(G, \mu)$ is essential and the polytope $\Lann$ is simple.
\end{proposition}
\begin{proof}
We first remark that the number of null components of an element $y\in \Lann$ are by definition the number of inequalities that are tight for $y$. It is in particular at least the number of facets that intersect $y$, with equality if, and only if, none of the inequalities tight for $y$ is redundant.
If $y$ is a vertex, $y$ belongs to at least $d$ facets. It is bijective if, and only if, $d$ of its components are null, which in view of the remark above is equivalent to say that $y$ belongs to exactly $d$ facets of $\Lann$ and none of the inequalities tight for $y$ is redundant.
As for the last statement, it follows a directly from \Cref{def:inequalities}.
\end{proof}
\section{Matching rates in surjective-only graphs} \label{sec:non-unicyclic}
\Cref{sec:general} describes $\Lann$, the set of non-negative solutions of the conservation equation~\eqref{eq:system-matrix}. In this section, we investigate which of these solutions may, or may not, be achieved by a (stable) policy. There are many cases where this question matters:
\begin{itemize}
\item As stated in \Cref{prop:vertices-optimal}, if an edge-dependent reward is earned each time a match is performed, the long-term reward is maximized by favoring edges with the maximal reward and, more precisely, by achieving a vector on a face of the polytope $\Lann$.
\item In \emph{chained matching}, the matches performed in the stable matching model $(G, \mu, \Phi)$ form the (non-Poisson) arrival process of another matching model, with a compatibility graph $G' = (\E, \E')$ (the edges of $G$ are the nodes of $G'$). In particular, the matching rate vector $\lambda$ of the first model is the vector of arrival rates in the second model. Being able to control the vector $\lambda$ can therefore help stabilize the second model.
\end{itemize}
Unless otherwise stated, we consider a stabilizable matching problem $(G, \mu)$ with a surjective-only compatibility graph~$G$, so that the set~$\Lann$ of non-negative solutions of the conservation equation~\eqref{eq:system-matrix} is non-trivial.
Given a policy $\Phi$ that stabilizes the matching problem $(G, \mu)$, we let $\lambda(\Phi)$ denote the vector of matching rates in the matching model $(G, \mu, \Phi)$.
We consider the set of matching rates achieved by stable policies (resp.\ of stable greedy policies), defined as follows:
\begin{align*}
\La_\Pol
&= \left\{
\lambda(\Phi): \Phi\text{ is a stable policy of the matching model }(G, \mu)
\right\}, \\
\La_\Gre
&= \left\{
\lambda(\Phi): \Phi\text{ is a stable greedy policy of the matching model }(G, \mu)
\right\}.
\end{align*}
\Cref{subsec:greedy-rates} focuses on the set~$\La_\Gre$. We show in particular that $\La_\Gre\subseteq \Lap$, where $\Lap$ is the (non-empty) set of solutions of the conservation equation~\eqref{eq:system-matrix} with positive components. We also show that, in many cases, the inclusion is strict. Informally, this result shows that greedy policies are not very good at navigating inside $\Lann$. In contrast, we show in \Cref{subsec:nongreedy-rates} that filtering policies can be used to reach some faces of $\Lann$. In particular, if all vertices of $\Lann$ are bijective, we have $\La_\Pol= \Lann$. Finally, in \Cref{subsec:nongreedy-rates}, we also use semi-filtering policies to show that $\Lap\subseteq \La_\Pol$.
The following result will be useful
throughout this section.
\begin{proposition}
\label{prop:convexity}
The sets $\La_\Pol$ and $\La_\Gre$ are convex.
\end{proposition}
\begin{proof}
We first show the convexity of $\La_\Pol$. Let $\Phi_1=(\C_1, \pi_1)$ and $\Phi_2=(\C_2, \pi_2)$ be two stable policies and $0<\beta<1$ be a linear coefficient. To build a stable policy $\Phi_\beta$ such that $\lambda(\Phi_\beta)=\beta\lambda(\Phi_1)+(1-\beta)\lambda(\Phi_2)$, we combine $\Phi_1$ and $\Phi_2$ in proper proportions.
Let $\varnothing_1\in \C_1$ (resp.\ $\varnothing_2\in \C_2$) denote the empty state of $\Phi_1$ (resp.\ $\Phi_2$), as defined in \Cref{subsec:model}. Let $T_1$ (resp.\ $T_2$) be the mean return time to the empty state $\varnothing_1$ (resp.\ $\varnothing_2$) in the matching model $(G, \mu, \Phi_1)$ (resp.\ $(G, \mu, \Phi_2)$).
We construct the policy $\Phi_\beta$ on the state space $\C_1\times\C_2$ with empty state $(\varnothing_1, \varnothing_2)$. On the arrival of an item of class~$i \in \V$:
\begin{itemize}
\item If the current state is $(c_1, \varnothing_2)$ with $c_1 \in \C_1 \setminus \{\varnothing_1\}$, then we apply the policy~$\Phi_1$, that is, we choose a new state $c'_1 \in \C_1$ according to $\pi_1(\cdot|c_1, i)$ and move to the state $(c'_1, \varnothing_2)$.
\item If the current state is $(\varnothing_1, c_2)$ with $c_2 \in \C_2 \setminus \{\varnothing_2\}$, then we apply the policy~$\Phi_2$, that is, we choose a new state $c'_2\in \C_2$ according to $\pi_2(\cdot|c_2, i)$ and move to the state $(\varnothing_1, c'_2)$.
\item If the current state is $(\varnothing_1, \varnothing_2)$, then we apply $\Phi_1$ with probability $p_1 = \frac{\beta T_2}{\beta T_2+(1-\beta)T_1}$ and $\Phi_2$ otherwise. In other words, the next state is $(c_1, \varnothing_2)$ with probability $p_1$ and $(\varnothing_1, c_2)$ with probability $1 - p_1$, where $c_1$ is chosen according to $\pi_1(\cdot | \varnothing_1, i)$ and $c_2$ is chosen according to $\pi_2(\cdot | \varnothing_2, i)$.
\end{itemize}
In essence, every time the system is in state~$(\varnothing_1, \varnothing_2)$, the policy $\Phi_\beta$ selects either the policy $\Phi_1$ or the policy $\Phi_2$ and follows this policy until the next passage in the empty state~$(\varnothing_1, \varnothing_2)$. Importantly, if we only consider the time intervals when the policy~$\Phi_1$ (resp.\ $\Phi_2$) is applied, the evolution is exactly the same as under policy~$\Phi_1$ (resp.\ $\Phi_2$). In particular, the long-term matching rate observed on these intervals is $\lambda(\Phi_1)$ (resp. $\lambda(\Phi_2)$). This guarantees that the evolution of the state $(c_1, c_2)$ under the policy~$\Phi_\beta$ defines an irreducible continuous-time Markov chain with state space~$\C_1 \times \C_2$, and that the matching model $(G, \mu, \Phi_\beta)$ is stable.
By construction, the long-run fraction of time that $\Phi_1$ (resp.\ $\Phi_2$) is chosen is proportional to $\beta T_2$ (resp.\ $(1-\beta)T_1$). This implies that the fractions of decisions taken according to $\Phi_1$ and $\Phi_2$ are proportional to $\beta$ and $(1-\beta)$, respectively. As the matching rate when $\Phi_\beta$ behaves like $\Phi_1$ (resp. $\Phi_2$) is $\lambda(\Phi_1)$ (resp. $\lambda(\Phi_2)$), we conclude that
$\lambda(\Phi_\beta)=\beta\lambda(\Phi_1)+(1-\beta)\lambda(\Phi_2)$.
This proves that $\La_\Pol$ is convex.
To prove the convexity of $\La_\Gre$, it suffices to observe that, if the policies $\Phi_1$ and $\Phi_2$ are greedy, so is the policy $\Phi_\beta$.
\end{proof}
\subsection{Greedy policies} \label{subsec:greedy-rates}
Greedy policies are appealing candidates when one wants to choose a policy for a matching problem $(G, \mu)$: they are usually simple to implement and some of them, like \emph{match-the-longest} or \emph{first-come-first-matched}, are maximally stable on stable graphs.
However, this section will show that they are not very flexible in terms of achievable matching rates. Although we do not provide a universal tight description of $\La_\Gre$ (which we believe to be a difficult task), we do provide several examples that indicate that $\La_\Gre$ is generally (but not always) reduced relative to $\Lann$.
For a start, as stated by \Cref{prop:greedypositive}, greedy policies cannot reach the boundaries of the convex polytope $\Lann$.
\begin{proposition} \label{prop:greedypositive}
If the compatibility graph~$G$ is surjective-only and the matching problem $(G, \mu)$ is stabilizable, then the set $\La_\Gre$ is non-empty and $\La_\Gre \subseteq \Lap$.
\end{proposition}
\begin{proof}
The set $\La_\Gre$ is non-empty because
the greedy policies
\emph{match-the-longest}~\cite{MM16} and
\emph{first-come-first-matched}~\cite{MBM21}
are known to be stable.
We now prove that $\La_\Gre \subseteq \Lap$.
Consider a stable greedy policy~$\Phi$ and let $\lambda = (\lambda_k: k \in \E)$ denote the corresponding vector of matching rates. Consider an edge $e_k = \{i, j\}$. Since the policy $\Phi$ is greedy, two items of classes~$i$ and~$j$ are always matched if the following sequence of events occurs: the system is in the empty state~$\varnothing$, a class-$i$ item arrives, and a class-$j$ item arrives. Let $p_\varnothing$ denote the stationary probability that the matching model $(G, \mu, \Phi)$ is in the empty state~$\varnothing$. We now that $p_\varnothing > 0$ because this matching model is stable, and the previous remark implies that $\lambda_k \geq p_\varnothing \mu_{i}\mu_{j} / \sum_{\ell \in \V}\mu_\ell>0$. Since this is true for each edge $e_k \in \E$, we conclude that $\lambda \in \Lap$.
\end{proof}
\Cref{prop:greedypositive} has a consequence on the capacity of greedy policies to maximize some reward function.
\begin{corollary}
Consider the problem of maximizing an edge-dependent reward defined by a vector $w$ as stated in \Cref{prop:vertices-optimal}. Let $r_{\max} = \max_{y\in \Lann} w^\intercal y$ be the optimal reward. One of the two exclusive statements below is true:
\begin{enumerate}
\item All vectors of $\Lann$ are optimal, i.e. $\forall y \in \Lann, w^\intercal y = r_{\max}$.
\item All stable greedy policies are suboptimal, i.e. $\forall \lambda \in \La_\Gre, w^\intercal\lambda < r_{\max}$.
\end{enumerate}
\end{corollary}
\begin{proof}
We know from \Cref{prop:vertices-optimal} that the set of $y\in \Lann$ that maximize the reward is a non-empty face $F$ of $\Lann$. If $F=\Lann$, we are obviously in the first case (all $y\in \Lann$ are optimal). One can verify that this corresponds to situations where $w$ is orthogonal to $\ker(A)$ (for example if all components of $w$ are identical). Otherwise, because of the lattice structure of the faces of a polytope, $F$ belongs to a facet of $\Lann$, which means that there is at least one edge that is null for all vectors of $F$. In particular, as all components of the matching rates of a stable greedy policy are positive, no greedy policy is optimal.
\end{proof}
To further support the intuition that greedy policies are not very good
at navigating the set $\Lann$, \Cref{subsubsec:greedy-rates-complete,subsubsec:greedy-rates-diamond} study two examples where $\La_\Gre$ is a strict subset of $\Lap$. However, this is not a universal result, as \Cref{subsubsec:greedy-rates-fish} gives a (well-chosen) counter-example where $\La_\Gre=\Lap$.
\Cref{subsec:nongreedy-rates} will show how the introduction of (semi-)filtering policies drastically improves things and allows us to reach $\Lap$
and some of the faces of $\Lann$.
\subsubsection{Complete graph} \label{subsubsec:greedy-rates-complete}
\Cref{prop:greedyCompleteGraph} below essentially states that greedy policies do not allow any degree of freedom in the case of complete graphs, in the sense that all stable greedy policies lead to the same dynamics and the same vector of matching rates. In contract, the polytope $\Lann$ has dimension $m - n = \frac{n(n-3)}2$, where $n$ is the number of classes and $m = \binom{n}{2} = \frac{n(n-1)}2$ is the number of possible matches.
\begin{proposition} \label{prop:greedyCompleteGraph}
Consider the complete graph $K_n$ with $n\geq 3$.
\begin{enumerate}
\item \label{complete-1}
The matching problem $(K_n,\mu)$ is stabilizable if and only if $\mu_i < \frac{\bar\mu}{2}$ for each $i \in \V$, where $\bar\mu = \sum_{i \in \V} \mu_i$ is the total arrival rate.
\item \label{complete-2}
All greedy policies are equivalent in the sense that the evolution of $h(c)$ (the vector counting the number of unmatched items of each class) defines a continuous-time Markov chain with the same transition diagram and state space~$\mathcal{N} \subseteq \N$, given by
\begin{align*}
\mathcal{N} = \{0\} \cup
\left(
\bigcup_{i \in \V}
\left\{
x \delta_i,
x \in \N^*
\right\}
\right),
\end{align*}
where, for each $i \in \V$, $\delta_i$ is the $n$-dimensional vector with one in component~$i$ and zero elsewhere, and $\N^*$ is the set of positive integers.
We let~$\Phi_\Gre$ denote the greedy policy with minimal state space $\C = \mathcal{N}$.
\item \label{complete-3}
If the matching problem $(K_n, \mu)$ is stabilizable, then the matching model $(K_n, \mu, \Phi_\Gre)$ is stable, and the associated matching rates are given by
\begin{equation}
\label{eq:kn-greedy-rate}
\lambda_k
=\mu_{i}p_j+\mu_{j}p_i,
\quad e_k = \{i, j\} \in \E,
\end{equation}
where $p_i$ is the stationary probability that the queue $i$ is non-empty, given by
\begin{equation}
\label{eq:kn-greedy-probability}
p_i = \frac{\frac{\mu_i}{\bar\mu-2\mu_i}}{1+\sum_{\ell=1}^n\frac{\mu_\ell}{\bar\mu-2\mu_\ell}},
\quad i \in \V.
\end{equation}
In particular, we have $\La_\Gre \subsetneq \Lap$ for each $n\ge 4$.
\end{enumerate}
\end{proposition}
\begin{proof}
Statement~\ref{complete-1} is a direct consequence of \cref{prop:stability-region-form}.
We now prove statement~\ref{complete-2}. Since the compatibility graph is complete, two items can be matched if and only if they belong to different classes. As a result, a greedy policy can only reach states in which at most one queue is non-empty. Moreover, under a greedy policy, if a class-$i$ item arrives and finds a non-empty queue~$j \neq i$, the incoming class-$i$ item is matched with a class-$j$ item, and the queue size of $j$ is decreased by 1. Otherwise, the queue size of $i$ is increased by 1. This is sufficient to prove statement~\ref{complete-2}.
The proof of statement~\ref{complete-3} builds upon the previous observation. The natural greedy policy $\Phi_\Gre$ is an instance of the match-the-longest policy, which is known to be maximally stable~\cite{MM16}.
Equation~\eqref{eq:kn-greedy-rate}
follows from the PASTA property
and the observation that,
for each $i, j \in V$ with $i \neq j$,
a match between classes~$i$ and~$j$ happens
in one of the following two cases:
\begin{itemize}
\item a class-$i$ item arrives while the queue $j$ is non-empty, which happens at rate $\mu_{i}p_j$;
\item a class-$j$ item arrives while the queue $i$ is non-empty, which happens at rate $\mu_{j}p_i$.
\end{itemize}
To prove \eqref{eq:kn-greedy-probability}, it suffices to observe that the Markov chain defined in statement~\ref{complete-1} has a very specific structure: for each $i \in \V$, the restriction of the transition diagram of this Markov chain to the states where all queues but $i$ are empty defines a birth-and-death process with birth rate $\mu_{i}$ (a class-$i$ item arrives) and death rate $\bar\mu - \mu_{i}$ (an item of a class $j\neq i$ arrives and is matched with a class-$i$ item). If $p_\varnothing$ denotes the stationary probability of the empty state, it follows that
\begin{align*}
p_i
= p_\varnothing \sum_{c \ge 1}
\left( \frac{\mu_i}{\bar\mu - \mu_i} \right)^c
=p_\varnothing\frac{\mu_i}{\bar\mu-2\mu_i},
\quad i \in \V.
\end{align*}
The value of $p_\varnothing$ follows from the normalizing equation $p_\varnothing + \sum_{i \in \V} p_i = 1$.
\end{proof}
\Cref{fig:k4greedy} illustrates this result on a complete graph $\K_4$ in which all arrival rates are equal to 3. In kernel basis, the polytope $\Lann$ is defined by the inequalities $\alpha_1\leq 1$, $\alpha_2\leq 1$, and $\alpha_1+\alpha_2 \geq -1$, i.e. it is a triangle of vertices $(-2, 1)$, $(1, -2)$, and $(1, 1)$. Yet, only the solution $\alpha = (0, 0)$ can be achieved by a greedy policy.
\begin{figure}[!ht]
\subfloat[Generic solution of the conservation equation~\eqref{eq:system-matrix}.]{
\begin{tikzpicture}
\def2.5cm{2.5cm}
\node[class] (1) {$1$};
\foreach \i/\s/\a in {2/1/90, 3/2/0, 4/3/-90}
\path (\s) ++(\a:2.5cm) node[class] (\i) {$\i$};
\node at (-2cm, 0) {};
\node at (5.5cm, 0) {};
\draw (1) edge node[above, sloped] {$1-\alpha_1$} (2)
(3) edge node[above, sloped] {$1-\alpha_1$} (4)
(2) edge node[above] {$1+\alpha_1+\alpha_2$} (3)
(1) edge node[below] {$1+\alpha_1+\alpha_2$} (4)
(2) edge node[sloped, above, pos=.25] {$1-\alpha_2$} (4)
(1) edge node[sloped, above, pos=.25] {$1-\alpha_2$} (3);
\end{tikzpicture}
}
\hfill
\subfloat[$\Lann$ in kernel basis. $\La_\Gre$ is the red point.]{
\begin{tikzpicture}[scale=1.0]
\node at (-3, 0) {};
\node at (3, 0) {};
\draw[->] (-2,0) -- (1.5,0);
\node[anchor=west] at (1.5,0) {$\alpha_1$};
\draw[->] (0,-2) -- (0,1.3);
\node[anchor=south] at (0,1.3) {$\alpha_2$};
\node (v1) at (-2,1) {};
\node (v2) at (1,-2) {};
\node (v3) at (1,1) {};
\node (v4) at (0, 0) {};
\path[draw=blue, very thick, fill=blue, fill opacity=.2]
(v1.center) -- (v2.center) -- (v3.center) -- cycle;
\node[anchor=east, text=orange]
at (v1) {$(-2, 1)$};
\node[anchor=west, text=orange]
at (v3) {$(1, 1)$};
\node[anchor=west, text=orange]
at (v2) {$(1, -2)$};
\node[anchor=south east, text=red]
at (v4) {$(0, 0)$};
\foreach \i in {1,...,3}
\node[dot] at (v\i) {};
\node[dot, red] at (v4) {};
\end{tikzpicture}
}
\caption{\label{fig:k4greedy}Matching problem $(K_4, \mu)$ with $\mu=(3, 3, 3, 3)$.}
\end{figure}
\subsubsection{Diamond graph} \label{subsubsec:greedy-rates-diamond}
\Cref{prop:greedyDiamond,cor:greedyDiamond} below focus on the diamond graph. We show that the set $\La_\Gre$ of vectors reachable by a greedy policy, while not reduced to a single vector like for a complete graph, is still a strict subset of the set $\Lap$.
\begin{proposition} \label{prop:greedyDiamond}
Consider the matching problem $(G, \mu)$ of \cref{ex:diamond}, with the normalization $\mu_1 + \mu_3 = \bar\mu_2 + \bar\mu_4 = \frac12$.
We define the following values:
\begin{align*}
q_{1,3} &= \frac{1}{4\beta},
&
q_{1} &= \frac{\mu_1}{\mu_3+2\beta},
&
q_{3} &= \frac{\mu_3}{\mu_1+2\beta},\\
q_2 &= \frac{\bar{\mu}_2+\beta}{2\bar{\mu}_4},
&
q_4 &= \frac{\bar{\mu}_4+\beta}{2\bar{\mu}_2},
&
p_\varnothing &= \frac{1}{1+q_{1,3}+q_2+q_4}.
\end{align*}
The matching problem $(G, \mu)$ is stable for all greedy policies. Moreover, the matching rates under any greedy policy verify:
\begin{equation}
\begin{aligned}
\label{eq:diamond-greedy-ineq}
\lambda_{2, 4} &= \beta,
&
\lambda_{1,2} &> p_\varnothing\mu_1 q_2+p_\varnothing\mu_2q_1,
&
\lambda_{1,4} &> p_\varnothing\mu_1 q_4+p_\varnothing\mu_4q_1,
\\
& & \lambda_{3,2} &> p_\varnothing\mu_3 q_2+p_\varnothing\mu_2q_3,
&
\lambda_{3,4} &> p_\varnothing\mu_3 q_4+p_\varnothing\mu_4q_3.
\end{aligned}
\end{equation}
In particular, if we let $\beta$ grow to infinity without changing the values of $\mu_1, \bar\mu_2, \mu_3$, and $\bar\mu_4$, we have
\begin{equation}
\label{eq:diamond-greedy-limit}
\begin{aligned}
\lim_{\beta \to +\infty} \lambda_{1,2} &= 2\mu_1\bar{\mu}_2,
&
\lim_{\beta \to +\infty} \lambda_{1,4} &= 2\mu_1\bar{\mu}_4,\\
\lim_{\beta \to +\infty} \lambda_{3,2} &= 2\mu_3\bar{\mu}_2,
&
\lim_{\beta \to +\infty} \lambda_{3,4} &= 2\mu_3\bar{\mu}_4.\\
\end{aligned}
\end{equation}
\end{proposition}
\begin{proof}
While for the complete graph, a greedy policy has no decision to take, here a greedy policy makes decisions on two occasions:
\begin{itemize}
\item a class-$2$ item arrives while queues $1$ and $3$ are non-empty;
\item a class-$4$ item arrives while queues $1$ and $3$ are non-empty.
\end{itemize}
In all other situations, the decision of the policy is automatic. In particular, the evolution of the queue size of $2$, the queue size of $4$, and the sum of queue sizes of $1$ and $3$ (i.e. the number of unmatched items that belong to class $1$ or $3$, without distinction) are independent of the greedy policy considered. We will leverage this to prove \eqref{eq:diamond-greedy-ineq}.
Let $p_\varnothing$ denote the stationary probability of the empty state. We can partition the reachable states of the system into three $M/M/1$ queues sharing the same empty state:
\begin{itemize}
\item The states where all queues but $2$ are empty behave like a $M/M/1$ queue with load $\rho_2 = \frac{\bar\mu_2+\beta}{1+\beta-\bar\mu_2}$. In particular, the probability that queue $2$ is non-empty is $p_\varnothing\frac{\rho_2}{1-\rho_2}=p_\varnothing q_2$.
\item The states where all queues but $4$ are empty behave like a $M/M/1$ queue with load $\rho_4 = \frac{\bar\mu_4+\beta}{1+\beta-\bar\mu_4}$. In particular, the probability that queue $4$ is not empty is $p_\varnothing\frac{\rho_4}{1-\rho_4}=p_\varnothing q_4$.
\item The states where queues $2$ and $4$ are empty, partitioned by the sum of the queue sizes of $1$ and $3$, behave like a $M/M/1$ queue with load $\rho_{1, 3} = \frac{1}{1+4\beta}$. In particular, the probability that the queue $1$ or the queue $3$ is non-empty is $p_\varnothing\frac{\rho_{1, 3}}{1-\rho_{1, 3}}=p_\varnothing q_{1, 3}$.
\end{itemize}
It follows that the probability of the empty state is $p_\varnothing=\frac{1}{1+q_2+q_4+q_{1, 3}}$.
Now consider the matches between classes~$1$ and~$2$. There are two cases where these matches occur:
\begin{itemize}
\item A class-$1$ item arrives while $2$ is not empty. This happens with intensity $\mu_1p_\varnothing q_2$.
\item A class-$2$ item arrives and is matched with a class-1 item. The exact intensity depends on the policy but a strict lower bound is $p_\varnothing q_1\mu_2$ ($p_\varnothing q_1$ is a strict lower bound of the probability that $1$ is the only non-empty class; it comes from discarding the cases where $1$ is not empty after one remaining item $3$ has been removed; the remaining cases behave like a $M/M/1$ queue with load $\frac{\mu_1}{1/2+2\beta}$).
\end{itemize}
In other words, $\lambda_{1,2} > p_\varnothing \mu_1 q_2+p_\varnothing \mu_2q_1$. The lower bounds for $\lambda_{1,4}$, $\lambda_{3,2}$, and $\lambda_{3,4}$ are derived the same way. The equality $\lambda_{2, 4}=\beta$ has already been observed in \cref{ex:diamond}. It comes from the fact that the edge $\{2,4\}$ does not belong to $\ker(A)$ and has the same matching rate in all stable policies.
Lastly, we need to prove \cref{eq:diamond-greedy-limit}.
First observe that $\lim_{\beta \to +\infty} p_\varnothing \mu_1q_2= 2\mu_1\bar{\mu}_2$ and $\lim_{\beta \to +\infty} p_\varnothing \mu_1q_4= 2\mu_1\bar{\mu}_4$, while $\lim_{\beta \to +\infty} p_\varnothing \mu_2q_1 = \lim_{\beta \to +\infty} p_\varnothing \mu_4q_1 = 0$. Hence if we add the two first inequalities in \cref{eq:diamond-greedy-ineq} and take the limit we get
$$\lim_{\beta \to +\infty}\lambda_{1,2}+\lambda_{1,4}\geq 2\mu_1\bar{\mu}_2+2\mu_1\bar{\mu}_4=\mu_1.$$
By conservation principle we always have $\lambda_{1,2}+\lambda_{1,4}=\mu_1$, which implies the two first lines in \eqref{eq:diamond-greedy-limit}. The two last lines are obtained the same way by considering $\lambda_{3,2}$ and $\lambda_{3,4}$.
\end{proof}
\Cref{prop:greedyCompleteGraph,prop:greedyDiamond} show that there are matching problems $(G, \mu)$ where no greedy policy can approach a border of $\Lann$ beyond a certain point. This suggests in particular that greedy policies are not always adapted to optimize cost functions of the matching rates.
One interpretation of \cref{eq:diamond-greedy-limit} is as follows: as the matching rate? $\beta$ between classes $2$ and $4$ grows, all other things being equal, the probability that queue $1$ or queue $3$ is non-empty goes to $0$ as the only dominant cases are: queue $2$ is non-empty ($p_2\approx 2\bar\mu_2$); queue $4$ is not empty ($p_4\approx 2\bar\mu_4$). This means that the probability that one particular policy has an actual decision to make goes to $0$: all greedy policies tend to behave the same way.
The following characterizes the vertices of $\La_\Gre$.
\begin{corollary} \label{cor:greedyDiamond}
Consider the matching problem $(G, \mu)$ of \cref{ex:diamond}, again with the normalization $\mu_1 + \mu_3 = \bar\mu_2 + \bar\mu_4 = \frac12$. In kernel basis, we have
\begin{align*}
\Lann=[-2\min(\mu_1\bar{\mu}_2, \mu_3\bar{\mu}_4), 2\min(\bar{\mu}_2\mu_3, \mu_1 \bar{\mu}_4)].
\end{align*}
Let $\Phi_+$ and $\Phi_-$ denote the greedy policies that give priority to edges $\{1, 2\}$ and $\{3, 4\}$ and to edges $\{2, 3\}$ and $\{1, 4\}$, respectively. If we let $\alpha_+$ (resp.\ $\alpha_-$) denote, in kernel basis, the matching rates under policy $\Phi_+$ (resp.\ $\Phi_-$), we have:
\begin{align*}
&-2\min(\mu_1\bar{\mu}_2, \mu_3\bar{\mu}_4) < \alpha_- \leq \alpha_+ < 2\min(\bar{\mu}_2\mu_3, \mu_1 \bar{\mu}_4),
\\[.1cm]
&\La_\Gre = [\alpha_-, \alpha_+] \subsetneq \Lap
\text{ (in kernel basis),} \\[.1cm]
&\lim_{\beta \to +\infty} \alpha_-
= \lim_{\beta \to +\infty} \alpha_+=0
\end{align*}
\end{corollary}
\begin{proof}
We only need to prove that $\La_\Gre = [\alpha_-, \alpha_+]$, as the rest of the corollary is a rephrasing of \cref{prop:greedyDiamond} in kernel basis.
We first prove that the policy $\Phi_+$ maximizes the matching rates along edges $\{1, 2\}$ and $\{3, 4\}$ among all stable greedy policies.
We consider a greedy policy $\Phi$ and couple the matching models $(G, \mu, \Phi)$ and $(G, \mu, \Phi_+)$ to have the same arrival processes. The key is to notice that the queue size of $2$, the queue size of $4$, and the sum of the queue sizes of $1$ and $3$ have the exact same evolution (cf proof of \Cref{prop:greedyDiamond}) in both policies. To monitor the different behaviors, we can just observe the difference $d$ between the queue size of $1$ in $\Phi_+$ and the queue size of $1$ in $\Phi$. Upon arrival of a class-$i$ item, consider the different possibilities of evolution for $d$:
\begin{itemize}
\item $d$ has the same value before and after the arrival: that means that $\Phi_+$ and $\Phi$ have taken the same matching decision.
\item Otherwise, one of the policy matched an item from class $1$ while the other matched an item from class $3$. In particular the arriving item is of class $2$ or $4$. We then distinguish four subcases:
\begin{enumerate}
\item $d$ was non-negative and increased. That means that $\Phi_+$ matched an item from class $3$ while $\Phi$ matched an item from class $1$. The queue $1$ in $\Phi_+$ was non-empty (because of the sign of $d$), so the arrival item was of class $4$ (otherwise $\Phi^+$ would have matched an item from class $1$). We can conclude that $\Phi_+$ matched a pair $\{3, 4\}$ while $\Phi$ matched a pair $\{1, 4\}$.
\item $d$ was positive and decreased.
\item $d$ was non-positive and decreased. That means that $\Phi_+$ matched an item from class $1$ while $\Phi$ matched an item from class $3$. The queue $3$ in $\Phi_+$ was non-empty (because of the sign of $d$), so the arrival item was of class $2$ (otherwise $\Phi^+$ would have matched an item from class $3$). We can conclude that $\Phi_+$ matched a pair $\{1, 2\}$ while $\Phi$ matched a pair $\{3, 2\}$.
\item $d$ was negative and increased.
\end{enumerate}
\end{itemize}
Assuming that we started from the empty state, we can conclude that the number of matches along edges $\{1, 2\}$ and $\{3, 4\}$ is always greater or equal in $\Phi_+$ than in $\Phi$: the only situations where $\Phi$ selects $\{1, 2\}$ or $\{3, 4\}$ and $\Phi_+$ does not necessarily correspond to case 2 or case 4 above. These cases can be associated in a one-to-one basis with a past case $1$ or a past case $3$, where $\Phi_+$ selects $\{1, 2\}$ or $\{3, 4\}$ and $\Phi$ does not. This shows that, among all greedy policy, $\Phi_+$ maximizes $\alpha$. Using a similar reasoning with $\Phi_-$, it follows that in kernel basis the vector of matching rates associated with any stable greedy policy belongs to the interval $[\alpha_-, \alpha_+]$. The conclusion follows by applying \Cref{prop:convexity}.
\end{proof}
To illustrate \cref{cor:greedyDiamond}, we consider in \cref{fig:diamond-curve} a symmetric example where $\mu_1 = \bar\mu_2 = \mu_3 = \bar\mu_4 = \frac 14$. The figure compares $\Lann$ and $\La_\Gre$ with the bounds~\eqref{eq:diamond-greedy-ineq} and limits~\eqref{eq:diamond-greedy-limit} (converted in kernel basis).
We observe, as announced by \Cref{cor:greedyDiamond}, that $\La_\Gre$ converges to $0$ when $\beta$ grows. We also notice that the bounds from \cref{eq:diamond-greedy-ineq} are not tight when $\beta$ is small, but that $\Phi_+$ and $\Phi_-$ seem to be able to be as close as we want to the borders of $\Lann$ when $\beta$ is small enough (this does not contradict the fact that for any given $\beta$, $\La_\Gre$ is strictly inside $\Lann$). The reason for the gap is that to get \cref{eq:diamond-greedy-ineq}, we discarded some cases where both queues $1$ and $3$ are non-empty (cf the second case of the proof for $\lambda_{1,2}$): these situations become not negligible when $\beta$ is small.
\begin{figure}
\centering
\begin{tikzpicture}
\definecolor{darkgray153}{RGB}{153,153,153}
\definecolor{darkgray176}{RGB}{176,176,176}
\definecolor{darkorange25512714}{RGB}{255,127,14}
\definecolor{forestgreen4416044}{RGB}{44,160,44}
\definecolor{gainsboro216}{RGB}{216,216,216}
\definecolor{lightgray204}{RGB}{204,204,204}
\definecolor{steelblue31119180}{RGB}{31,119,180}
\begin{axis}[
height=8cm,
legend cell align={left},
legend style={fill opacity=0.8, draw opacity=1, text opacity=1, draw=lightgray204,
font=\footnotesize, at={(0.99,0.94)}},
yticklabel style={
/pgf/number format/fixed,
/pgf/number format/precision=2
},
scaled y ticks=false,
log basis x={10},
tick align=outside,
tick pos=left,
width=12cm,
x grid style={darkgray176},
xlabel={\(\displaystyle \beta\)},
xmin=0.001, xmax=10,
xmode=log,
xtick style={color=black},
y grid style={darkgray176},
ylabel={\(\displaystyle \alpha\)},
ymin=-0.1375, ymax=0.1375,
ytick style={color=black}
]
\path [draw=gainsboro216, fill=gainsboro216]
(axis cs:0.001,0.125)
--(axis cs:0.001,-0.125)
--(axis cs:0.00137382379588326,-0.125)
--(axis cs:0.0018873918221351,-0.125)
--(axis cs:0.00259294379740467,-0.125)
--(axis cs:0.00356224789026244,-0.125)
--(axis cs:0.00489390091847749,-0.125)
--(axis cs:0.00672335753649933,-0.125)
--(axis cs:0.00923670857187387,-0.125)
--(axis cs:0.0126896100316792,-0.125)
--(axis cs:0.0174332882219999,-0.125)
--(axis cs:0.0239502661998749,-0.125)
--(axis cs:0.0329034456231267,-0.125)
--(axis cs:0.0452035365636024,-0.125)
--(axis cs:0.0621016941891562,-0.125)
--(axis cs:0.0853167852417281,-0.125)
--(axis cs:0.117210229753348,-0.125)
--(axis cs:0.161026202756094,-0.125)
--(axis cs:0.221221629107045,-0.125)
--(axis cs:0.30391953823132,-0.125)
--(axis cs:0.41753189365604,-0.125)
--(axis cs:0.573615251044868,-0.125)
--(axis cs:0.788046281566991,-0.125)
--(axis cs:1.08263673387405,-0.125)
--(axis cs:1.48735210729351,-0.125)
--(axis cs:2.04335971785694,-0.125)
--(axis cs:2.80721620394118,-0.125)
--(axis cs:3.85662042116347,-0.125)
--(axis cs:5.29831690628371,-0.125)
--(axis cs:7.27895384398315,-0.125)
--(axis cs:10,-0.125)
--(axis cs:10,0.125)
--(axis cs:10,0.125)
--(axis cs:7.27895384398315,0.125)
--(axis cs:5.29831690628371,0.125)
--(axis cs:3.85662042116347,0.125)
--(axis cs:2.80721620394118,0.125)
--(axis cs:2.04335971785694,0.125)
--(axis cs:1.48735210729351,0.125)
--(axis cs:1.08263673387405,0.125)
--(axis cs:0.788046281566991,0.125)
--(axis cs:0.573615251044868,0.125)
--(axis cs:0.41753189365604,0.125)
--(axis cs:0.30391953823132,0.125)
--(axis cs:0.221221629107045,0.125)
--(axis cs:0.161026202756094,0.125)
--(axis cs:0.117210229753348,0.125)
--(axis cs:0.0853167852417281,0.125)
--(axis cs:0.0621016941891562,0.125)
--(axis cs:0.0452035365636024,0.125)
--(axis cs:0.0329034456231267,0.125)
--(axis cs:0.0239502661998749,0.125)
--(axis cs:0.0174332882219999,0.125)
--(axis cs:0.0126896100316792,0.125)
--(axis cs:0.00923670857187387,0.125)
--(axis cs:0.00672335753649933,0.125)
--(axis cs:0.00489390091847749,0.125)
--(axis cs:0.00356224789026244,0.125)
--(axis cs:0.00259294379740467,0.125)
--(axis cs:0.0018873918221351,0.125)
--(axis cs:0.00137382379588326,0.125)
--(axis cs:0.001,0.125)
--cycle;
\addlegendimage{area legend, draw=gainsboro216, fill=gainsboro216}
\addlegendentry{$\Lambda_{\geqslant 0}$}
\path [draw=darkgray153, fill=darkgray153]
(axis cs:0.001,0.121342049774471)
--(axis cs:0.001,-0.121342049774471)
--(axis cs:0.00137382379588326,-0.120226995808294)
--(axis cs:0.0018873918221351,-0.118561312725928)
--(axis cs:0.00259294379740467,-0.116992507948148)
--(axis cs:0.00356224789026244,-0.114726743292916)
--(axis cs:0.00489390091847749,-0.111903476720563)
--(axis cs:0.00672335753649933,-0.108358955025466)
--(axis cs:0.00923670857187387,-0.104077990123693)
--(axis cs:0.0126896100316792,-0.098834252904329)
--(axis cs:0.0174332882219999,-0.0926268705793193)
--(axis cs:0.0239502661998749,-0.0853382531108102)
--(axis cs:0.0329034456231267,-0.077050098214234)
--(axis cs:0.0452035365636024,-0.0678888207559152)
--(axis cs:0.0621016941891562,-0.0580850333697344)
--(axis cs:0.0853167852417281,-0.0480365731426026)
--(axis cs:0.117210229753348,-0.0382329711219192)
--(axis cs:0.161026202756094,-0.0291656058915846)
--(axis cs:0.221221629107045,-0.0212743314319169)
--(axis cs:0.30391953823132,-0.0148264784215806)
--(axis cs:0.41753189365604,-0.00988075934173411)
--(axis cs:0.573615251044868,-0.00630987866222599)
--(axis cs:0.788046281566991,-0.00388735388245449)
--(axis cs:1.08263673387405,-0.00232084458163656)
--(axis cs:1.48735210729351,-0.00134887778123826)
--(axis cs:2.04335971785694,-0.000764304901645203)
--(axis cs:2.80721620394118,-0.000416973322910467)
--(axis cs:3.85662042116347,-0.000236412878478528)
--(axis cs:5.29831690628371,-0.000124123410349428)
--(axis cs:7.27895384398315,-7.65970248155466e-05)
--(axis cs:10,-2.81064000000088e-05)
--(axis cs:10,2.81064000000088e-05)
--(axis cs:10,2.81064000000088e-05)
--(axis cs:7.27895384398315,7.65970248155466e-05)
--(axis cs:5.29831690628371,0.000124123410349428)
--(axis cs:3.85662042116347,0.000236412878478528)
--(axis cs:2.80721620394118,0.000416973322910467)
--(axis cs:2.04335971785694,0.000764304901645203)
--(axis cs:1.48735210729351,0.00134887778123826)
--(axis cs:1.08263673387405,0.00232084458163656)
--(axis cs:0.788046281566991,0.00388735388245449)
--(axis cs:0.573615251044868,0.00630987866222599)
--(axis cs:0.41753189365604,0.00988075934173411)
--(axis cs:0.30391953823132,0.0148264784215806)
--(axis cs:0.221221629107045,0.0212743314319169)
--(axis cs:0.161026202756094,0.0291656058915846)
--(axis cs:0.117210229753348,0.0382329711219192)
--(axis cs:0.0853167852417281,0.0480365731426026)
--(axis cs:0.0621016941891562,0.0580850333697344)
--(axis cs:0.0452035365636024,0.0678888207559152)
--(axis cs:0.0329034456231267,0.077050098214234)
--(axis cs:0.0239502661998749,0.0853382531108102)
--(axis cs:0.0174332882219999,0.0926268705793193)
--(axis cs:0.0126896100316792,0.098834252904329)
--(axis cs:0.00923670857187387,0.104077990123693)
--(axis cs:0.00672335753649933,0.108358955025466)
--(axis cs:0.00489390091847749,0.111903476720563)
--(axis cs:0.00356224789026244,0.114726743292916)
--(axis cs:0.00259294379740467,0.116992507948148)
--(axis cs:0.0018873918221351,0.118561312725928)
--(axis cs:0.00137382379588326,0.120226995808294)
--(axis cs:0.001,0.121342049774471)
--cycle;
\addlegendimage{area legend, draw=darkgray153, fill=darkgray153}
\addlegendentry{$\Lambda_G = [\alpha_-, \alpha_+]$}
\addplot [semithick, steelblue31119180]
table {
0.001 0.123513880984001
0.00137382379588326 0.122965380133147
0.0018873918221351 0.12221798933221
0.00259294379740467 0.121202663230901
0.00356224789026244 0.119829013522194
0.00489390091847749 0.117980934369978
0.00672335753649933 0.115513264788586
0.00923670857187387 0.112251522724322
0.0126896100316792 0.107998063674394
0.0174332882219999 0.102549387293948
0.0239502661998749 0.0957297719217437
0.0329034456231267 0.0874440352863653
0.0452035365636024 0.0777445400992993
0.0621016941891562 0.0668938494623066
0.0853167852417281 0.0553899286915132
0.117210229753348 0.043919034256954
0.161026202756094 0.0332265083524708
0.221221629107045 0.0239431134157176
0.30391953823132 0.0164413517478063
0.41753189365604 0.0107860577249372
0.573615251044868 0.00678887156435563
0.788046281566991 0.0041214546499551
1.08263673387405 0.00242723563461812
1.48735210729351 0.00139448003175793
2.04335971785694 0.000785518692266257
2.80721620394118 0.000435750498386622
3.85662042116347 0.000238899706971801
5.29831690628371 0.000129817664902263
7.27895384398315 7.00747726247869e-05
10 3.76392652815249e-05
};
\addlegendentry{Upper bound from \eqref{eq:diamond-greedy-ineq}}
\addplot [semithick, darkorange25512714]
table {
0.001 0
0.00137382379588326 0
0.0018873918221351 0
0.00259294379740467 0
0.00356224789026244 0
0.00489390091847749 0
0.00672335753649933 0
0.00923670857187387 0
0.0126896100316792 0
0.0174332882219999 0
0.0239502661998749 0
0.0329034456231267 0
0.0452035365636024 0
0.0621016941891562 0
0.0853167852417281 0
0.117210229753348 0
0.161026202756094 0
0.221221629107045 0
0.30391953823132 0
0.41753189365604 0
0.573615251044868 0
0.788046281566991 0
1.08263673387405 0
1.48735210729351 0
2.04335971785694 0
2.80721620394118 0
3.85662042116347 0
5.29831690628371 0
7.27895384398315 0
10 0
};
\addlegendentry{$\alpha=0$}
\addplot [semithick, forestgreen4416044]
table {
0.001 -0.123513880984001
0.00137382379588326 -0.122965380133147
0.0018873918221351 -0.12221798933221
0.00259294379740467 -0.121202663230901
0.00356224789026244 -0.119829013522194
0.00489390091847749 -0.117980934369978
0.00672335753649933 -0.115513264788586
0.00923670857187387 -0.112251522724322
0.0126896100316792 -0.107998063674394
0.0174332882219999 -0.102549387293948
0.0239502661998749 -0.0957297719217437
0.0329034456231267 -0.0874440352863653
0.0452035365636024 -0.0777445400992993
0.0621016941891562 -0.0668938494623066
0.0853167852417281 -0.0553899286915132
0.117210229753348 -0.043919034256954
0.161026202756094 -0.0332265083524708
0.221221629107045 -0.0239431134157176
0.30391953823132 -0.0164413517478063
0.41753189365604 -0.0107860577249372
0.573615251044868 -0.00678887156435563
0.788046281566991 -0.0041214546499551
1.08263673387405 -0.00242723563461812
1.48735210729351 -0.00139448003175793
2.04335971785694 -0.000785518692266257
2.80721620394118 -0.000435750498386622
3.85662042116347 -0.000238899706971801
5.29831690628371 -0.000129817664902263
7.27895384398315 -7.00747726247869e-05
10 -3.76392652815249e-05
};
\addlegendentry{Lower bound from \eqref{eq:diamond-greedy-ineq}}
\end{axis}
\end{tikzpicture}
\caption{\label{fig:diamond-curve} Evolution of $\La_\Gre$ as a function of $\beta$ for the diamond graph with $\mu_1 = \bar\mu_2 = \mu_3 = \bar\mu_4 = \frac 14$. For each $\beta$, $\La_\Gre$ is estimated by a simulation of $\Phi_+$, leveraging the symmetry of the matching problem. $\Lann$ and other bounds are displayed for comparison. All results are expressed in kernel basis.}
\end{figure}
\subsubsection{Fish graph} \label{subsubsec:greedy-rates-fish}
In view of the examples above, one can start to understand how the constraint of greediness makes difficult to adjust the matching rate of a greedy policy. In most stabilizable surjective-only matching problems, one should expect $\La_\Gre \subsetneq \Lap$. However, as shown by \Cref{prop:kayak-greedy,cor:kayak-greedy}, there is at least one counter-example of a stabilizable surjective-only matching model where $\La_\Gre = \Lap$.
\begin{proposition}
\label{prop:kayak-greedy}
Consider the matching problem $(G, \mu)$ depicted \cref{fig:fish}. $(G, \mu)$ is stabilizable and $\Lann=[0, 1]$ (in kernel basis).
For $k\geq 0$, let $\Phi_k$ be the greedy matching policy defined by:
\begin{itemize}
\item if the queue size of $4$ is less than $k$, choose by decreasing order of priority edges $\{1,3\}$, $\{2,3\}$, $\{3, 4\}$, $\{5,6\}$, or one of the other edges;
\item otherwise choose by decreasing order of priority edges $\{3, 4\}$, $\{5,6\}$, $\{1,3\}$, $\{2,3\}$, or one of the other edges.
\end{itemize}
We have:
\begin{itemize}
\item $(G, \mu, \Phi_k)$ is stable for all $k\geq 0$;
\item if $\alpha_+(k)$ denotes the matching rate of $\Phi_k$ in kernel basis, $\lim_{k\to \infty}\alpha_+(k)=1$.
\end{itemize}
\end{proposition}
\begin{corollary}
\label{cor:kayak-greedy}
For the matching problem $(G, \mu)$ described in \cref{fig:fish}, we have $\La_\Gre = ]0, 1[ = \Lap$.
\end{corollary}
\begin{figure}[!ht]
\centering
\begin{tikzpicture}
\def2.5cm{2cm}
\node[class] (1) {$1$};
\foreach \i/\s/\a in {2/1/90, 3/1/30, 4/3/30, 5/4/-30, 6/3/-30}
\path (\s) ++(\a:2.5cm) node[class] (\i) {$\i$};
\draw (1) edge node[left] {$3$} (2)
(1) edge node[above, sloped] {$1$} (3)
(2) edge node[above, sloped] {$1$} (3)
(3) edge node[above, sloped] {$\alpha$} (4)
(4) edge node[above, sloped] {$2-\alpha$} (5)
(5) edge node[above, sloped] {$1+\alpha$} (6)
(3) edge node[above, sloped] {$1-\alpha$} (6);
\end{tikzpicture}
\caption{Generic solution of the conservation equation~\eqref{eq:system-matrix}~on a fish graph with arrival rates $\mu = (4, 4, 3, 2, 3, 2)$.\label{fig:fish}}
\end{figure}
The proof of \ref{prop:kayak-greedy} requires three main steps:
\begin{enumerate}
\item We first need to show that using priorities, one can limit the matching rates between class-$3$ items and class-$4$ or class-$6$ items;
\item Using this limitation, we build an \emph{unstable} greedy policy $\Phi_{+\infty}$ for which the matching rate at edge $\{3, 6\}$ is null;
\item We then show that the family of \emph{stable} greedy policies $\Phi_k$ that can be arbitrarily close to $\Phi_{+\infty}$ in the sense that the matching rate at edge $\{3, 6\}$ can be arbitrarily close to zero.
\end{enumerate}
Notice that $\Phi_k$ is uniquely defined: all decisions that may occur in \cref{fig:fish} are uniquely determined. The fact that $(G, \mu)$ is stabilizable is a direct consequence of the existence of positive solutions (e.g. $\alpha=1/2$). The fact that $\Lann = [0, 1]$ can be immediately deduced from the generic solution of the conservation equation~\eqref{eq:system-matrix}~in \Cref{fig:fish}.
The first step for proving \cref{prop:kayak-greedy} is \Cref{lemma:subpaw} below: the matching rate between class $3$ and (class $4$ or class $6$) is limited when the priority of $\{1, 3\}$ and $(2, 3)$ is high.
\begin{lemma}
\label{lemma:subpaw}
Let $(G, \mu)$ be a matching problem that contains the triangle subgraph depicted in \cref{fig:triangle2} (the triangle is only connected to the rest of $G$ through node $3$). Let $\Phi$ be a greedy policy where vertex $3$ always prefer $1$ or $2$ over any other edge (the behavior of $\Phi$ for other decisions can be arbitrary). If $\beta>1/2$, we have:
\begin{itemize}
\item The process of the queue sizes at $1$, $2$, and $3$ is positive recurrent;
\item The total matching rate $\lambda_{3,X}$ between $3$ and nodes other than $1$ and $2$ is limited (i.e. upper-bounded) by $\frac{1}{1+2\beta}$.
\end{itemize}
\end{lemma}
\begin{figure}[!ht]
\centering
\begin{tikzpicture}
\node[class] (1) {$1$};
\path (1) ++(-90:2cm) node[class] (2) {$2$};
\path (1) ++(-30:2cm) node[class] (3) {$3$};
\foreach \a/\i in {60/5, 30/6, 0/7, -30/8, -60/9}
\path (3) ++(\a:3cm) node (\i) {};
\draw (1) edge node[left] {$\beta-\frac{1-\lambda_{3,X}}{2}$} (2)
(1) edge node[above, sloped] {$\frac{1-\lambda_{3,X}}{2}$} (3)
(2) edge node[below, sloped] {$\frac{1-\lambda_{3,X}}{2}$} (3);
\foreach \i in {5,...,9}
\draw (3) edge[dotted] (\i);
\end{tikzpicture}
\caption{Triangle sub-graph\label{fig:triangle2}, with arrival rates $\mu = (\beta, \beta, 1, \ldots)$. Node $3$ is the unique bridge between the triangle and the rest of the graph. $\lambda_{3, X}=\mu_3-\lambda_{2, 3}-\lambda_{1,3}$ denotes the sum of matching rates between $3$ and the rest of the graph.}
\end{figure}
\begin{proof}
Consider some $\beta>1/2$. We first observe that the queue size of $3$ is stable as it is controlled by $2\beta > 1$ (nodes $1$ and $2$ are not linked to anyone but each other and $3$). To prove the stability of the queues $1$ and $2$, we must show that $\{1,3\}$ and $\{2,3\}$ have positive rates, which is the case if $\lambda_{3,X}<1$. To do that, we associate to each arrival sequence of items $1$, $2$, and $3$ the following virtual policy $\Psi$: the item are matched as in $\Phi$, with the assumption that $3$ always has a non-empty neighbor in the rest of the graph. Within $\Psi$, the rest of the graph acts like a ``black hole'' so whenever an item $3$ arrives and $1$ and $2$ are empty, it is matched with some node from the rest of the graph. We can easily check that the number of matches $\{3, X\}$ made under $\Phi$ is always at most the number of matches $\{3, X\}$ under $\Psi$. Under $\Psi$, $3$ is always empty (all arrivals are instantly matched) and we can partition the state of queues in $1$, $2$, and $3$ into two $M/M/1$ queues sharing the same empty state, each one having load $\rho:=\frac{\beta}{1+\beta}$. It follows that the probability of the empty state is
$$p_\varnothing=\frac{1}{1+2\frac{\rho}{1-\rho}} = \frac{1}{1+2\beta}\text{.}$$
The matching rate of $\{3, X\}$ in $\Psi$ is exactly $p_\varnothing$ (arrival of a class-$3$ item while queues $1$ and $2$ are empty), so the matching rate $\lambda_{3,X}$ in the original policy $\Phi$ checks
$$\lambda_{3,X}\leq \frac{1}{1+2\beta} < 1\text{.}$$
In particular, the queues $1$ and $2$ are stable.
\end{proof}
The second step for proving \cref{prop:kayak-greedy} is \Cref{lemma:phi-inf} below, which consists of producing a greedy policy that is unstable with respect to node $4$ but stable for the other nodes.
\begin{lemma}
\label{lemma:phi-inf}
In the matching $(G, \mu)$ depicted \cref{fig:fish2}, let $\Phi_\infty$ be the greedy matching policy defined by: choose by decreasing order of priority edges $\{1,3\}$, $\{2,3\}$, $\{3, 4\}$, $\{5,6\}$, or one of the other edges.
We have:
\begin{itemize}
\item $(G, \mu, \Phi_\infty)$ is unstable;
\item The process defined by the queue sizes of all nodes but $4$ is positive recurrent;
\item The matching rates achieved by the system are the ones from \cref{fig:fish2} (the conservation equation~\eqref{eq:system-matrix}~does not hold).
\end{itemize}
\end{lemma}
\begin{figure}[!ht]
\centering
\begin{tikzpicture}
\def2.5cm{2cm}
\node[class] (1) {$1$};
\foreach \i/\s/\a in {2/1/90, 3/1/30, 4/3/30, 5/4/-30, 6/3/-30}
\path (\s) ++(\a:2.5cm) node[class] (\i) {$\i$};
\draw (1) edge node[left] {$\frac{32}{11}$} (2)
(1) edge node[above, sloped] {$\frac{12}{11}$} (3)
(2) edge node[above, sloped] {$\frac{12}{11}$} (3)
(3) edge node[above, sloped] {$\frac{9}{11}$} (4)
(4) edge node[above, sloped] {$1$} (5)
(5) edge node[above, sloped] {$2$} (6)
(3) edge node[above, sloped] {$0$} (6);
\end{tikzpicture}
\caption{Matching rates under the unstable policy $\Phi_{+\infty}$ ($\mu = (4, 4, 3, 2, 3, 2)$). The unstable node $4$ does not satisfy the conservation equation~\eqref{eq:system-matrix}, as its total matching rate is $\frac{20}{11}<2$.\label{fig:fish2}}
\end{figure}
\begin{proof}
We first apply \cref{lemma:subpaw} on vertices $1$ to $3$, using a scaling of $3$ and $\beta=4/3$. It shows that $1$, $2$, and $3$ are stable and that $\lambda_{3,X}$ is at most $3\frac{1}{1+2\frac 43}=\frac{9}{11}$.
We now focus on the even cycle 3--4--5--6. The rate from classes $4$, and $6$, $\mu_4+\mu_6=4$ needs to be absorbed by items from classes $3$ and $5$ but the rate of class $5$ is $3$ and the rate that class $3$ can allocate to the cycle is at most $\frac{9}{11}<1$.
We deduce that the sum of the queue sizes of $4$ or $6$ is transient. However, $5$ always chooses class $6$ if it can and $\mu_5>\mu_6$ so the queue size $6$ is stable. This means that queue size of $4$ is the unique transient process and that the queue size $5$ is stable.
In fact, as the queue size of $4$ is non-empty with probability $1$, the queue sizes of $3$ and $5$ are empty with probability $1$. It also means that $\Phi_\infty$ behaves like the virtual policy $\Psi$ (cf proof of \Cref{lemma:subpaw}) for nodes $1$, $2$, and $3$. This gives $\lambda_{1, 2}$, $\lambda_{1, 3}$, $\lambda_{2, 3}$, and $\lambda_{3, X}$. Because of the priority rule, $\lambda_{3,4}=\lambda_{3,X}$ and $\lambda_{3,6}=0$. The last matching rates are obtained by using the conservation principle on the (stable) nodes $6$ and $5$.
\end{proof}
We now perform the last step and prove \cref{prop:kayak-greedy}.
\begin{proof}[Proof of \cref{prop:kayak-greedy}]
We first need to prove that $\Phi_k$ is stable. The queue size of $4$ is positive recurrent: as soon as it is greater than $k$, all arrival from $3$ are matched to class-$4$ items so the departure rate becomes greater than the arrival rate ($\mu_3=3>\mu_4=2$). Stability of other vertices ensues. Call $p_\varnothing(k)$ the probability that $4$ is empty under $\Phi_k$. As $\Phi_k$ behaves for $4$ like the transient process of $\Phi_\infty$ up to size $k$, we have $\lim_{k\to \infty}p_\varnothing(k)=0$. A match $\{3, 6\}$ can only occur when an item $3$ or $6$ arrives while vertex $4$ is empty so we have $0\leq 1-\alpha_+(k)\leq 5 p_\varnothing(k)$, which concludes the proof.
\end{proof}
\begin{proof}[Proof of \cref{cor:kayak-greedy}]
We proved that there is a family of greedy policies such that their matching rate can be arbitrarily close to $1$ (in kernel basis). We just need to exhibit another family such that the matching rate, in kernel basis, can be arbitrarily close to $0$ and use the convexity of $\La_\Gre$ to conclude.
For $k\geq 0$, let $\Phi_{-k}$ be the greedy matching policy defined by:
\begin{itemize}
\item if there are less than $k$ items of type $4$ in the system, choose by decreasing order of priority edges $\{1,3\}$, $\{2,3\}$, $\{3, 6\}$, $\{4,5\}$, or one of the other edges;
\item otherwise choose by decreasing order of priority edges $\{3, 6\}$, $\{4,5\}$, $\{1,3\}$, $\{2,3\}$, or one of the other edges.
\end{itemize}
Using exactly the same proof than for \cref{prop:kayak-greedy} ($\Phi_{-k}$ is $\Phi_k$ after switching the labels $4$ and $6$), we get that if $\alpha_-(k)$ denotes the matching rate of $\Phi_{-k}$ in kernel basis, $\lim_{k\to \infty}\alpha_-(k)=0$.
\end{proof}
\begin{figure}
\centering
\subfloat[Evolution of $\alpha_-(k)$ and $\alpha_+(k)$.]{\input{fish_semilog_10}}
\hfill
\subfloat[Evolution of $\alpha_-(k)$ in logarithmic scale.\label{subfig:greedy_area_2}]{\input{fish_loglog_10}}
\caption{
Evolution of $\alpha_-(k)$ and $\alpha_+(k)$ as a function of the threshold $k$, as defined in \Cref{prop:kayak-greedy,cor:kayak-greedy} and proofs. All results are expressed in kernel basis.\label{fig:greedy_area_2}
}
\end{figure}
\Cref{fig:greedy_area_2} shows $\alpha_-(k)$ and $\alpha_+(k)$, obtained by simulation. We can observe that they converge to $0$ and $1$ respectively, validating \Cref{cor:kayak-greedy}. Moreover the convergence seems linear, i.e. like $\rho^k$ for some $0<\rho<1$, as hinted by \Cref{subfig:greedy_area_2}.
\subsection{Arbitrary policies}
\label{subsec:nongreedy-rates}
We now investigate $\La_\Pol\subseteq \Lann$, the subset of matching rates that can be achieved by an arbitrary stable policy. As $\La_\Pol$ is convex, we first focus on its relation with the vertices of $\Lann$, which is given by \Cref{prop:vertex-stability}.
\begin{proposition}
\label{prop:vertex-stability}
Let $y$ be vertex of $\Lann$.
\begin{itemize}
\item If $y$ is bijective, $y \in \La_\Pol$;
\item If $y$ is injective-only, $y \notin \La_\Pol$.
\end{itemize}
\end{proposition}
\begin{proof}
Let $G_y=(V, \E_y)$ be the subgraph of $G$ associated to $y$.
The first part is straightforward by considering a \emph{match-the-longest} policy with a filter on $\E_y$, denoted $\Phi(y)$. $(G_y, \mu)$ is stabilizable and $y$ is its unique matching rate. $\Phi(y)$ behaves like a greedy \emph{match-the-longest} policy on $G_y$, so $(G, \mu, \Phi(y))$ is stable and its matching rate is $y$. The second part is obtained by noticing that if $y$ is injective-only, $G_y$ admits at least a bipartite component (more specifically a tree). The arrival drift between the two parts of the bipartite component makes impossible the existence of a stable policy.
\end{proof}
\Cref{prop:vertex-stability} essentially states that bijective vertices are easy to reach, while injective-only vertices are not due to a ``bipartite curse''. This gives us a first partial characterization of $\La_\Pol$.
\begin{corollary}
\label{cor:vertex-stability}
If a face $F$ of $\Lann$ contains only bijective vertices, $F\in \La_\Pol$. In particular, $\La_\Pol = \Lann$ if and only if $\Lann$ is simple and $(G, \mu)$ is essential.
\end{corollary}
\begin{proof}
We just use the \cref{prop:convexity} (convexity of $\La_\Pol$) and \cref{prop:vertex-stability}. The last statement comes from \cref{prop:simple}.
\end{proof}
To go further, we propose to introduce a family of stable policies that is able to arbitrarily approach a vertex of $\Lann$ event if it is injective-only.
\begin{proposition}
\label{prop:converging-semigreedy}
Let $y$ be a vertex of $\Lann$. For $k\geq 0$, consider the following semi-filtering policy, denoted $\Phi_k(y)$:
\begin{itemize}
\item If the size of the longest queue is less than $k$, apply a filtering \emph{match-the-longest} policy on $G_y=(V, \E_y)$;
\item Otherwise, apply a greedy \emph{match-the-longest} policy.
\end{itemize}
$\Phi_k(y)$ is stable and $\lim_{k\to \infty}\lambda(\Phi_k(y))=y$.
\end{proposition}
\begin{proof}[Sketch of proof]
In essence, the technique is similar to the one used for \cref{prop:kayak-greedy}: we take an unstable policy that achieves the desired goal and make it stable by reverting to a stable policy when the queue sizes become too large. If the threshold is high enough, most of the matchings will be made under the unstable policy.
We present here a sketch of proof for the hard case where $G_y$ is a tree (like in \cref{ex:diamond} when $\mu_1\bar{\mu}_2=\mu_3\bar{\mu}_4$). When $G_y$ has multiple connected components, bijective or injective-only, the proof needs to be adapted accordingly.
The stability of $\Phi_k(y)$ comes from the fact that apart from a finite set of states (the states where the queue sizes are less than $k$), $\Phi_k(y)$ behaves like a stable policy.
Let $p_\ell$ be the probability that the longest queue of the system has size $\ell$. If we look at $\ell\geq k$, the stability induces a negative drift, which means that we have $\sum_{\ell \geq k}p_\ell \leq C p_k$ for a constant $C$ that does not depend on $k$. Conversely, for $\ell\leq k$, the size of the longest queue is mostly controlled by the drift of an unbiased random walk between the two parts of the bipartite graph, which means $p_\ell \geq c p_k$ for another constant $c$. By combining the two, we get that the probability that the longest queue of the system has a size greater than $k$ tend to $0$ when $k$ goes to infinity. As matchings outside $\E_y$ only occur when the longest queue is greater than $k$, we conclude that the matching rate of an edge outside $\E_y$ goes to $0$, which by continuity of the conservation principle and injectivity of $G_y$ means that $\lim_{k\to \infty}\lambda(\Phi_k(y))=y$.
\end{proof}
One drawback of \cref{prop:converging-semigreedy} is that the average size of the longest queue will tend to grow with $k$ when the vertex is injective-only. In other words, there exists a trade-off between approaching an injective-only vertex and the minimization of the waiting time.
This issue is somehow similar to the threshold-based greedy policies we introduce for \cref{prop:kayak-greedy}, where the vertices of $\Lann$ could be asymptotically reached by making the average queue size of a given node grow.
Note that in~\cite{NS19}, a family of policies is introduced to optimize a reward function on edges. Their goal is similar to ours, with two main differences: first they aim at optimizing a reward function on matching rates but do not provide any description of the limit rate, while we show that the limit rate is a vertex of $\Lann$; second their family is a linear combination of a reward-based policy and a virtual queue policy, parameterized by a balance factor $\beta$, while we rely on semi-filtering greedy policies with a threshold cut $k$. Yet, they also notice in their solution that the system has an average queue size that grows in $1/\beta$, which is the equivalent of our $k$.
\begin{figure}[ht]
\centering
\subfloat[Distribution of the queue size of one node for several thresholds.\label{fig:codomino-queue-size}]{\input{codomino_linear_10}}
\hfill
\subfloat[Total matching rate along forbidden edges as a function of the threshold ($16\leq k \leq 16384$).\label{fig:codomino-leak}]{\input{codomino_loglog_10}}
\caption{\label{fig:codomino-curve} Evaluation of a semi-filtering policy applied to the matching problem described in \Cref{ex:non-essential}. The target vertex is the one from \Cref{fig:y3}.}
\end{figure}
To illustrate \ref{prop:converging-semigreedy}, we evaluated $\Phi_k(y)$ on the codomino matching problem from \Cref{ex:non-essential}. \Cref{fig:codomino-curve} presents the results for the vertex $y$ depicted in \Cref{fig:y3}. $y$ is injective-only: its support is three non-adjacent edges ($\{1, 6\}, \{2, 3\}, \{4, 5\}$), i.e. three connected components that are all bipartite.
\Cref{fig:codomino-queue-size} shows the complementary cumulative distribution function (CCDF) for the size of queue $1$ (the other nodes have a similar distribution) for different value of $k$. We observe the following:
\begin{itemize}
\item Half of time, the queue is empty. It can be related to the cases where the unbiased drift between the number of class-$1$ arrivals and the number of class-$6$ arrivals favors class $6$, so the queue $6$ is non-empty and items from class $1$ are matched on arrival.
\item The rest of time, the size of queue $1$ seems to be uniformly distributed between $0$ and $k$.
\item The cases where the queue size is greater than $k$ seem negligible.
\end{itemize}
These observations are consistent with the proof of \Cref{prop:converging-semigreedy}: most of the time, a semi-filtering policy is in its filtering regime, and the evolution of queues within this regime looks like an unbiased random walk capped by $k$.
\Cref{fig:codomino-leak} shows the convergence of $\lambda(\Phi_k(y))$ to $y$ by measuring as a function of $k$ the \emph{leaking rate}, i.e. the total matching rates observed along the forbidden edges ($\{1, 2\}, \{2, 6\}, \{3, 4\}, \{3, 5\}, \{5, 6\}$). The convergence seems to be logarithmic, i.e. like $k^{-1}$. This is in line with the fact that the probability to have a queue size greater than $k$, e.g. to disable the filtering, is in $k^{-1}$.
\begin{corollary}
\label{cor:semigreedy-interior}
Any positive solution of the conservation equation \eqref{eq:system-matrix} can be obtained by a stable policy. In other words,
\begin{equation*}
\Lap\subseteq \La_\Pol \subseteq \Lann\text{.}
\end{equation*}
\end{corollary}
\begin{proof}
Obviously $\La_\Pol \subseteq \Lann$ because any stable policy must respect the conservation principle.
From \cref{prop:converging-semigreedy}, we know that any vertex of $\Lann$ is part of the closure of $\La_\Pol$, so by convexity of $\La_\Pol$ this closure is $\Lann$. In particular, $\La_\Pol$ contains the interior of $\Lann$, which is $\Lap$.
\end{proof}
| {'timestamp': '2022-05-31T02:33:10', 'yymm': '2112', 'arxiv_id': '2112.14457', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14457'} | arxiv |
\section{Introduction}
OSS is freely available to users, who can modify, enhance or view the source code implementation. The massive popularity of OSS is due to its collaborative nature. Collaboration is crucial for developing software projects at scale. Developers around the globe come together to build an application or add functionality as a team and sharpen their skills. Collaboration helps in engendering novel ideas from the community of diverse developers, produces better outcomes, and envisions support for a project at a massive scale \cite{collaboration}.
The birth of social coding sites such as GitHub has completely democratized the concept of collaboration in OSS. Before the existence of git, developers had limited options for collaborative development such as SVN. Developers can nowadays fork a project and add their changes to their local copy without needing approval from the project owners.
The idea of forking in OSS has evolved. Traditionally, forking implied cloning a project and branching off new independent development. Forking was rare and was often intended to compete with or supersede the original project \cite{how_to_run, hackers_on_forking, perspective_on_forking}. In the modern view, forks in version control systems such as git are public copies of repositories that developers can modify, potentially, but not necessarily, to integrate those changes back into the original repo. Forking has made the reuse of existing code of software projects more straightforward. Instead of exchanging emails with software patches, developers can separately modify and experiment with the original project to either start a new project or contribute to an existing one \cite{why_fail}.
With the rise of social coding and explicit support in version control systems, forking of OSS repositories has become very popular. Consequently, developers are creating open-source code at an unprecedented rate. GitHub has more than 19 million users and 52 million repositories (without excluding forks) \cite{why_fail}.
Despite the popularity of OSS and the relative ease of development provided by forking-based social coding, more than 80\% of the OSS projects fail \cite{sustainability_forecast}. \textbf{This great failure rate makes us ponder from a social point of view: Why do most of the OSS projects do not succeed?} According to our definition, success means self-sustaining in the longer run. Previous research has attempted to solve the question mentioned above \cite{why_fail, collaboration}. However, to the best of our knowledge, no work has been done to investigate a direct relationship between an OSS project's success or failure and forking practices.
We make a foray in this direction as developing projects with forks comes with costs. Independent development means contributions are not always visible to others unless there is an explicit merge-back attempt. Coordination overhead rises as the number of forks increases \cite{feature_based}. Specifically, we notice the following hurdles:
\begin{enumerate}
\item Redundant Development: Contributors often independently implement similar functionality in their local forks that wastes development time and resources \cite{feature_based, what_the_fork}.
\item Fragmented Communities: Developers maintain many software versions in parallel through their forks, resulting in fragmented communities. It makes it harder for users to choose the project variant that best matches their needs or is the most actively maintained \cite{what_the_fork}. Hard forks, sometimes known as "forks of forks," push the project in different directions than intended by the core team.
\item Management Issues: Lack of modularity in the code structure and limited communication between contributors and core team members impede the growth of a project. Monolithic architecture is difficult to reason with and even worse to change. Inadequate communication between contributors and the core team leads to uncertainty about future growth.
\item Scalability Concerns: As the project's size grows, so does the number of commits and the frequency of pull requests. When a significant number of commits and pull requests in a short period, it becomes difficult for the maintainers to assess all of the changes promptly.
\end{enumerate}
Overall, we consider many forking-based development inefficiencies in projects; specifically redundant development, fragmented communities, lack of modularity, insufficient communication between developers and contributors, pushing large. numbers of commits, and frequently pull requests (PRs) to the main branch. We investigate how these inefficiencies are co-related to a project's success or failure. Comprehensively, we aim to establish a weak causal relationship between efficient forking practices and the success of a project. Specifically, \textbf{Does adhering to the efficient forking practices by a project correlate with its success?} We explore further to find answers to the following questions:
\begin{hyp}\label{rq:first}
Is there a difference in the number of duplicate pull requests (PRs) and hard forks causing redundancy between successful and unsuccessful projects?
\end{hyp}
\begin{hyp}\label{rq:second}
Does the frequency of pull requests (PRs) raised to the main project have anything to do with the success of a project?
\end{hyp}
\begin{hyp}\label{rq:third}
Is the size of the commits pushed to the main branch relevant to the success of a project?
\end{hyp}
\begin{hyp}\label{rq:fourth}
Is the modularity of a project characteristic of its success?
\end{hyp}
\begin{hyp}\label{rq:fifth}
Is coordination between the developers and the core team when working on a problem or a new feature important for a project's success?
\end{hyp}
To collect our metrics for quantifying the concerns which engender due to the forking-based inefficiencies and find their significance to the success and failure of a project, we used the ASFI dataset \cite{dataset}. The dataset contains a categorized list of retired (failed) and graduated (successful) projects with their corresponding GitHub URL. We collect the set of metrics representing forking-based attributes using GitHub APIs and python library, PyDriller. Next, we build a logistic regression model to evaluate their significance to a project's success. We found that the central management index, logic coupling index, additive contribution index, and presence of hard forks are significant metrics that correlate with a project's success.
We summarize the contribution of our research as follows:
\begin{enumerate}
\item Investigation of various inefficiencies emerging due to forking-based development in OSS and defined those quantitatively through a set of metrics.
\item Collection of data for eight metrics for further analysis using over 300 projects mentioned in the ASFI dataset.
\item Analysis of metrics using a logistic regression model and AIC to find the significant metrics representing the forking-based development practices affecting the success of a project.
\end{enumerate}
The code for the metric calculation and analysis is available on GitHub \footnote{Data and scripts are available: \url{ https://GitHub.com/anurag-asu/se-project-team-17}}.
\section{Literature Review}
In this section, we shed light on the current research and techniques for analyzing projects that use code forking. We also discuss some recent project sustainability work. We will present various methods and their shortcomings as they correlate to our work.
{\bf Apache Software Foundation Incubator:} Open and diverse communities tend to be more robust and productive than closed ones \cite{apache}. Apache Software Foundation Incubator (ASFI) is one of the open communities that gives guidelines on how to accept new committers and enables more community development. They believe that good software emerges if they foster and take good care of the community \cite{sustainability}.
One of the goals of ASFI is to help projects become self-sustainable and eventually join the ASF community. ASF guidelines require all projects to make all communication publicly available through their mailing lists and committers are required to discuss first before making any changes. If it did not happen on the mailing list, it did not happen \cite{oss_mailinglist}. One unique aspect of ASF is that these projects are incubated during their “nascent stage of development,” when there is continuous recruitment of new committers, and detailed discussions are happening with project mentors \cite{dataset}. This data is collected until the project exits the incubator. Since the definition of success is entirely subjective, categorizing projects as successful or not is quite challenging \cite{collaboration}. However, ASF alleviates this challenge by employing experienced personnel to characterize the projects in the incubator.
Yin et al. \cite{dataset} parsed the Apache Software Foundation Incubator (ASFI) to form a comprehensive dataset of 312 projects, classified as graduated, retired, and in incubation by the experienced admins of the AFSI community. This extrinsically labeled dataset forms our basis for categorizing successful and failed projects, as rightly envisioned by the authors.
{\bf Success and Sustainability of OSS Projects:}
Recently, ample research has been done on predicting the success of open source projects \cite{factors_oss, attributes_oss, determinants_oss} and finding the reasons for their failures \cite{why_fail}. From the research done, it seems that many projects fail due to their "one-man" nature \cite{collaboration}. Since project knowledge is limited to one or a few developers, projects will start to dwindle or die as soon as those single developers quit working. The phrase "Truck Factor" refers to the number of developers who must be hit by a truck before the project begins to suffer \cite{truck_factor}. Coelho et al. \cite{why_fail} presented a list of nine reasons like the project was usurped by a competitor, the project became functionally obsolete, lack of time of the main contributor, etc. as to why open source projects fail. The authors also demonstrated the presence of a significant gap in terms of optimal open-source maintenance, like the availability of contribution guidelines and the use of continuous integration, between unsuccessful projects and the most popular and active projects on GitHub. Other works attempted to develop a model based on statistical correlation \cite{planning_to_mature, measuring_oss_success, factors_oss}, but they did not have any objective heuristics to define the success of a project.
Identifying the elements related to OSS success can aid in the development of solutions when a project has a setback. In the paper \cite{sustainability}, the authors try to forecast a project becoming sustainable using their novel interpretable model. Also, based on these models, they offer an approach for real-time monitoring and actionable suggestions that projects may utilize to rectify their sustainability trajectories. While they help ongoing projects on the path of sustainability, our research will help developers to employ efficient forking and development practices from the inception of the project to increase its probability of being sustainable.
{\bf Forking-based Development:} With the increase in social coding, there is a rapid increase in forking, which is splitting an independent development line to foster more collaborative development. Prior research has also shown that forking increases community interaction opportunities \cite{social_coding_forking, community_engagement, pull_based_development, open_collaboration_public_sector}. For example, forks account for more than half of the commits in the Marlin project \cite{marlin}. The number of forks a project received seems to be a good reflection of its quality and worth as it indicates that a project had a lot of interest from the community and was therefore likely to be good or interesting \cite{social_coding_forking}. The increase in forks, however, spawned new challenges.
\emph{Redundant Development:} Many projects reject PRs because of redundant development \cite{what_the_fork, community_engagement, pull_based_development, almost_there, duplicatePR_dataset}. Working on a change only to learn that other developers have already made similar changes or have done so in tandem can be demotivating. To tackle this, many researchers have built software to detect such duplicates in the past \cite{feature_based, duplicatePR_dataset, detecting_duplicatePRs, identifying_redundancies}. In our research, we also develop a method to detect duplicates and calculate the ratio of duplicate PRs across different projects to investigate the effects of this inefficiency in a project.
\emph{Fragmented Communities:} Many OSS projects attract independent contributors through forking. These forks can further draw more developers, creating a separate line of development. However, these hard forks can steer the project away from its original direction \cite{social_forking, marlin}. Such fragmentation might pose a threat to the long-term viability of open-source projects when two distinct communities form \cite{what_the_fork}. When such types of communities spawn, fragmentation-related attributes can hinder the development of the main project. We calculate the presence of hard forks across projects to explore if this attribute leads to a project’s collapse.
\emph{Modularity:} In an OSS development environment, modularity is a desirable attribute of projects \cite{factors_oss, oss_innovation, linux_edge}. MacCormack et al. \cite{exploring_complex_software} proposed that more modular projects would be more appealing to potential contributors. Midha et al. \cite{factors_oss} dis-covered that the modularity of open-source projects is positively related to technical success. However, modularity may not necessarily correspond to how developers think \cite{perspective_on_forking}. Researchers have presented various metrics for measuring project modularity in the past. For example, many methodologies use program analysis to identify relationships between software structures \cite{measure_functional_cohesion, discriminant_merit}. In our research, we employ some of these metrics, specifically, logic coupling index and additive contribution index, to assess the modularity of projects.
\emph{Coordination mechanisms:} OSS initiatives involve a large number of individuals (over hundreds), making coordination a very crucial aspect of a project. Bird \cite{bird2011sociotechnical} tried to find out if OSS projects are haphazard or organized. The author concluded that during the OSS life cycle, subgroups form. The same group of developers ends up working on the same files. The author, however, did not relate the coordination of developers to its sustainability. Zhou et al. \cite{what_the_fork} formulated two different metrics to quantify coordination among developers in a fork-based development. In our study, we employ both these metrics, namely centralized management, and pre-communication index, to find the measure of coordination.
\section{Hypotheses}
Our goal is to find the correlation of efficient forking with a project's success. Here we generate our hypotheses based on prior work and formulate metrics that will help us answer our research questions \ref{rq:first}, \ref{rq:second}, \ref{rq:third}, \ref{rq:fourth}, \ref{rq:fifth}.
Many secondary forks (also known as forks of forks) contribute to other forks but not to the original repository, causing these forks, also known as hard forks to wander away from the main development line \cite{social_forking, concepts_operations}. Hard forks are seen as risky and antisocial to projects, as they can fragment a community and lead to confusion for both maintainers and users \cite{how_to_run, understand_open_source, hackers_on_forking, cathedral}. There aren't many examples of communities from the main project surviving a hard fork \cite{what_the_fork}. Redundant development, on the other hand, is one of the common reasons for rejecting PRs that impede contribution \cite{community_engagement, almost_there, duplicatePR_dataset}. Working carefully to resolve an issue only to discover that other developers have made similar improvements previously or in parallel can be demotivating. Zhou et al. \cite{what_the_fork} consider projects that reduce accidental redundancies and have fewer hard forks as more efficient. Thus, we hypothesize that a successful project should have a relatively fewer number of duplicate PRs and even fewer hard forks.
\begin{hypo} \label{hypo:first}
Ratio of duplicate pull requests are lower for a successful project
\end{hypo}
\begin{hypo} \label{hypo:second}
Presence of hard forks are lower for a successful project
\end{hypo}
Many researchers and practitioners emphasize the importance of modularity in open-source development \cite{oss_innovation, factors_oss, linux_edge}. Torvalds \cite{linux_edge} states, “for without [modularity], you cannot have people working in parallel.” MacCormack et al. \cite{exploring_the_structure} suggest that more modular projects can be more attractive to potential contributors. We, therefore, hypothesize that modularity is one of the factors that contribute to the success of a project. Logic coupling index and additive contribution index \cite{what_the_fork} are both predictors of modularity. A lower logic coupling index, which measures the degree to which two or more files change together, signals higher modularity. The additive contribution index, which measures to what degree contributions are additive, indicates better modularity for a higher value.
\begin{hypo} \label{hypo:third}
Logic coupling index is lower for a successful project
\end{hypo}
\begin{hypo} \label{hypo:fourth}
Additive contributing index is higher for a successful project
\end{hypo}
Researchers have exhaustively explored different degrees of coordination and their tradeoffs in distributed collaboration. Brandts and Cooper \cite{centralization} state that central coordination makes it easier to plan and manage a product. We hypothesize that project coordinating contributions upfront encourages more focused development activities in a project that aligns with the maintainer’s vision. The issue tracker in version control systems keeps track of forks that contain the corresponding code changes for each issue, as other forks are of little interest to maintainers and unsolicited PRs remain ignored for years \cite{what_the_fork}. We also hypothesize that better pre-communication, i.e. evaluating developers' discussions on changes for resolving an issue with the core team before submitting PRs, leads to better coordination and, as a result, a higher project success rate.
\begin{hypo} \label{hypo:fifth}
Central Management index is higher for a successful project
\end{hypo}
\begin{hypo} \label{hypo:sixth}
Pre-communication index is higher for a successful project
\end{hypo}
A commit represents the snapshot of a project in a given state and has all the information about the code changes compared to the previous version. Prior work \cite{commit_size} has modeled the distribution of commit sizes in open source projects to find its relation with project sizes. The findings reveal that when the number of developers on a project grows, the size of commits reduces insignificantly. To correlate the effects of commit size with the success of a project, we use the dimensionality metric. It calculates the average number of lines of code changed per commit in a project. We, therefore, hypothesize that the size of the commits should not be a significant factor for a project's success.
\begin{hypo} \label{hypo:seventh}
Dimensionality index does not have a correlation success of a project
\end{hypo}
OSS projects are developed globally by contributors, who collaborate through the pull-based model that lowers the barrier to entry for OSS developers by synthesizing, automating, and optimizing the contribution process \cite{duplicate_prs_empirical}. Hu et al. \cite{multi_review} have shown that more review-switching may bring longer resolution latency of a pull-request. As the number of PRs within a time frame increases, denoted by the frequency index, there will be longer resolution time and correspondingly fewer contributions to the project. Therefore, we hypothesize that the rate of contributions should have a relation with the project's capability to incorporate changes efficiently and be sustainable.
\begin{hypo} \label{hypo:eigth}
Frequency index value correlates with the success of a project
\end{hypo}
\section{Methodology}
In this section, we explain the process to gather and calculate the metrics to quantify the features of the projects.
\subsection{Dataset}
We calculate the metrics for the projects in the ASFI dataset \cite{dataset}. The projects are labeled as graduated or retired by the ASFI community. As a virtue of this, we have an objective classification of the projects. The dataset contains 312 data points consisting of 204 graduated, 60 retired, and 48 `in incubation` projects.
\emph{Data Pre-processing:} Out of these 312 projects, the GitHub URLs for 91 projects were incorrect or no longer functional as they returned HTTP 404 responses. We could only find 63 working URLs replacements for those 91 projects. A summary of the dataset used is given in the table [\ref{table:Dataset}] above.
\begin{centering}
\begin{table}
\small
\caption{\textbf{ASFI Dataset Summary}}
\small
\begin{tabular}{l*{3}{c}r}
& Originally & Working GitHub URLs\\
\hline
Incubating & 48 & 48\\
Graduated & 204 & 200 \\
Retired & 60 & 36\\
\hline
Total & 312 & 284\\
\hline
\end{tabular}\\
\label{table:Dataset}
\end{table}
\end{centering}
\subsection{Data Methods}
To gather the metrics for the projects, we used \textit{PyDriller} \cite{pydriller} and its' built-in functions to retrieve the commit data and data which is intrinsically present in the codebase. PyDriller, however, does not contain information about forks or pull requests. We used \textit{GitHub API} \cite{GitHubapi} to extract relevant information to calculate the metrics relying on the PRs, Issues, and comment data such as the presence of hard forks, ratio of duplicate PRs, etc. We used the \textit{pandas} library of python to interact with the data and collect the metrics.
\textbf{Issues faced with GitHub:} GitHub API is free to use, however, its rate is limited to 5,000 authenticated requests per hour. As a result, certain metrics consumed days to run. To alleviate this issue, we had to batch and distribute the data gathering to multiple accounts. Some of the projects listed on the ASFI website are not hosted on GitHub. Though a GitHub mirror is present for some of these projects, these mirrors do not contain any kind of communication level data that one might expect from a GitHub project. This makes it ineffective to use such repositories as it contributes towards a threat to internal validity.
\textbf{Issues faced with PyDriller:} PyDriller is a slow tool and, through our experiments, we found it taking up to 24 hours to calculate metrics. This made it harder to iterate through code changes.
\subsection{Metrics}
We calculate a set of eight metrics to find a correlation between efficient forking practices and the success of a project.
The metric collected has been summarized and visualized in Fig.\ref{fig:histogram}.
\textbf{Logic coupling Index:} is used to assess the modularity of the project by measuring the degree to which two or more files need to change together or co-evolve, in the most recent commits by contributors. We estimate the ratio of file pairs that were changed, i.e. added or modified, together in those commits out of all file pairs in the projects using PyDriller. Next, by computing the mean of recent commits, we aggregate this metric at the project level. We assess the most recent 150 commits for each project to remove bias from past but now altered practices. Lower logic coupling indexes suggest higher modularity, as fewer files are altered at the same time.
\textrm{Logic coupling Index =}
\[\textstyle\dfrac{\sum_{commit=1}^{commit=n} \textstyle\dfrac{\textrm{file pairs changed in the commit}}{\textrm{total file pairs in the project}}}{\textrm{n}} \]
\textrm{, where n = total number of commits}
\textbf{Additive contribution Index:} is a second modularity measure that assesses the extent to which contributions are additive, i.e contributions by adding files rather than editing existing ones. We calculate the ratio of new files added out of all files modified per commit, extracted through PyDriller. For a project, it’s the average ratio of overall commits from contributors. The higher additive contribution index shows that more modifications were additive, implying stronger modularity from the viewpoint of contributors.
\textrm{Additive contribution Index =}
\[\textstyle\dfrac{\sum_{commit=1}^{commit=n} \textstyle\dfrac{\textrm{number of files added in the commit}}{\textrm{number of files changed in the commit}}}{\textrm{n}} \]
\textrm{, where n = total number of commits}
\textbf{Ratio of Duplicate PRs:} is a clear metric for redundant work. We measure the fraction of the closed PRs rejected, by maintainers, stating as being redundant. We use GitHub API to fetch the attributes of the PR requests. To identify duplicate PRs in a project, we use regex matching and look for comments in the PR such as ‘duplicated’, ‘superseded’, ‘replicated’, etc. in PR comments.
\textrm{Ratio of duplicate PRs =}
\[\textstyle\dfrac{\textrm{duplicated closed PRs identified}}{\textrm{total PRs}} \]
\begin{figure}
\centering
\includegraphics[scale=0.25]{flow_hard_forks.png}
\small
\caption{\textbf{Flowchart of finding hard forks using GitHub API calls. We first look at the number of forks for each repository. Then, we get the PRs for each fork, and check if the PR has been merged or not using the GitHub API "/merge" call for the PR. And, if 2 or more PRs have been merged successfully, we consider that a hard fork.}}
\label{fig:hardfork}
\end{figure}
\textbf{Presence of hard forks:} a fork that has at least 2 merged pull requests from external developers is identified as a hard fork \cite{what_the_fork}. For calculating this metric, as shown in Fig.\ref{fig:hardfork}, we use the REST API by GitHub to get a list of forks, and for each fork, we get a list of pull requests. Then, we see the merge status of each pull request in that fork to categorize if there are any merged PRs in a particular fork. If we find 2 or more merged PRs for a fork, we assign a boolean value of TRUE/FALSE for that project categorizing if the project has a hard fork or not.
\textbf{Centralized management Index:} This metric is used to quantify the contributions which start with a centralized discussion before a PR. It measures the fraction of PRs that link to issues out of all PRs from all contributors. The list of PRs is fetched using GitHub API for a project and regex is used to search for keywords like ‘issue \#123’ or ‘\#123’ in the title, comments, and/or git messages. Some projects refer to issues not hosted on GitHub. The reference, however, still follows the convention of starting with '\#'.
\textrm{Centralized Management Index =}
\[\textstyle\dfrac{\textrm{PRs with issues referenced in the title/description}}{\textrm{description total PRs}} \]
\textbf{Pre-communication index:} This observes the coordination amongst the developers and contributors. in this metric, we look for the public announcement made by the contributors regarding the issue they are working on.
We do this in a hierarchical order, as shown in Fig.\ref{fig:pre_communication}. We first look for the announcement on the PR, then we look for if the author is one of the assignees of the PR. Next, we check if the PR is linked to an issue and parse these issues to check if the author has been assigned the issue or if the author has raised the issue. Finally, we check the comments in the linked issue for traces of participation by the author of the PR.
\textrm{Pre-communication Index=}
\[\textstyle\dfrac{\textrm{PRs with pre-communication}}{\textrm{Total PRs}} \]
\begin{figure}
\centering
\hspace*{-1.6cm}
\includegraphics[scale=0.6]{pre_communication.png}
\small
\caption{\textbf{Flow chart of figuring out if a PR’s author has pre-communicated about the issue/feature before starting to work on it. We first look for the announcement of ‘WIP’, then we look for if the author is one of the assignees of the PR. Next, we check if the PR is linked to an issue and parse the issue to check if the author has been assigned the issue. Finally, we check the comments in the linked issue for traces of participation by the author of the PR.}}
\label{fig:pre_communication}
\end{figure}
\textbf{Dimensionality Index:} measures the size of commits, more precisely average lines of code changes (added + deleted) per file per commit in a project. This metric tries to capture the distribution of the size of commits between successful and failed projects. We used PyDriller \cite{pydriller} and traverse all commits pushed by developers to a project to get the lines of code changed per commit. The dimensionality index value for a project is the average of lines of code changed to the number of files changed across all commits.
\textrm{Dimensionality Index =}
\[\textstyle\dfrac{\sum_{commit=1}^{commit=n} \textstyle\dfrac{\textrm{lines of code changed in the commit}}{\textrm{number of files changed in the commit}}}{\textrm{n}} \]
\textrm{, where n = total number of commits}
\textbf{Frequency Index:} is a metric to take into account the rate of contributions made by developers to a project and the degree to how difficult it is for the core team to incorporate the changes. It's measured as the average number of PRs raised to the main branch in a particular time interval. We decided on an initial time interval of 14 days for collecting this metric. Noticing a great variability in the data collected we then decided to check the number of PRs raised during a month. Since PyDriller does not have pull requests data we rely on GitHub APIs \cite{GitHubapi} to collect them for a project. Using paginated pull APIs we get all the PRs and count the number of PRs raised during 30 days. The index value is then just the average of the counts of all the PRs raised.
\textrm{Frequency Index =}
\[\textstyle\dfrac{\sum_{interval=1}^{interval=n}\textrm{total number of PRs raised}}{\textrm{n}} \]
\textrm{, where n = total number of intervals}
\begin{figure}
\includegraphics[scale=0.21]{boxplot/logic_index_b.png}
\small
\label{fig:boxplot1}
\includegraphics[scale=0.21]{boxplot/logic_index_a.png}
\small
\label{fig:boxplot2}
\includegraphics[scale=0.21]{boxplot/additive_index_b.png}
\small
\label{fig:boxplot3}
\includegraphics[scale=0.21]{boxplot/additive_index_a.png}
\small
\label{fig:boxplot4}
\includegraphics[scale=0.21]{boxplot/central_index_b.png}
\small
\label{fig:boxplot5}
\includegraphics[scale=0.21]{boxplot/central_index_a.png}
\small
\label{fig:boxplot6}
\caption{\textbf{Boxplot data distribution of significant metrics before (on the left) and after (on the right) removing outliers.\\
Label: Green - Graduated projects, Pink - Retired projects.
Note: Since \textit{presence of hard forks} has binary data, boxplot for it cannot be formed.}}
\label{fig:boxplot}
\end{figure}
\subsection{Quantitative Analysis}
After all, values are gathered and calculated, the metrics are cleaned and analyzed using R. Using box plots, as shown Fig.\ref{fig:boxplot}, we inspected the data variability and removed the outliers that are above or below the 1.5 interquartile range. In Fig.\ref{fig:histogram}, we show the data distributions of the collected metrics in our dataset after the cleaning process.
Next, we use logistic regression to assess the significance of each predictor since logistic regression is more suitable for a value with a binomial property like the success of a project. It will tell us whether the predictor is significant or not. If a predictor is significant we can also use the coefficient to assess the scale of the predictor whether it has a high influence or not. Then we use backward stepwise regression, using the stepAIC function in R, that seeks the model with the least Akaike Information Criterion(AIC) possible to determine the predictor(s) among all metrics to find the most relevant variable to the success of a project. Lastly, we crosscheck how well the model fits using McFadden’s pseudo-R$^{2}$ measure.
\begin{figure}
\includegraphics[scale=0.18]{histogram/logic_coupling_index.png}
\small
\label{fig:histogram1}
\includegraphics[scale=0.18]{histogram/additive_contribution_index.png}
\small
\label{fig:histogram2}
\includegraphics[scale=0.18]{histogram/ratio_of_duplicate_PR.png}
\small
\label{fig:histogram3}
\includegraphics[scale=0.18]{histogram/presence_of_hard_fork.png}
\small
\label{fig:histogram4}
\includegraphics[scale=0.18]{histogram/central_management_index.png}
\small
\label{fig:histogram5}
\includegraphics[scale=0.18]{histogram/pre_communication_index.png}
\small
\label{fig:histogram6}
\includegraphics[scale=0.18]{histogram/dimensionality_of_commits.png}
\small
\label{fig:histogram7}
\includegraphics[scale=0.18]{histogram/frequency_of_prs.png}
\small
\label{fig:histogram8}
\caption{\textbf{Histogram distribution of our metrics data. Note: \textit{presence of hard forks} has binary data. The red arrows point towards the hypothesized higher efficiency for the metric. Note: \textit{Dimensionality of commits} and \textit{Frequency of PRs} has no arrows as we do not hypothesize any direction of efficiency but only a presence of correlation with the outcome of a project.}}
\label{fig:histogram}
\end{figure}
\section{Results}
In this section, we discuss the results from the quantitative data analysis. Using logistic regression and backward stepwise regression, we examined the outcomes corresponding to our research questions.
\subsection{Statistical Analysis}
We used logistic regression to test each metric for its significance on the success or failure of a project based on the graduated and retired status in ASFI dataset \cite{dataset}. Table [\ref{table:logistic_regression}] shows the summary of the logistic regression model, where each metric was separately considered for its significance. And, table [\ref{table:r2}] shows the summary of McFadden’s pseudo-R$^{2}$ measure for all of the metrics. \\
\begin{centering}
\begin{table}
\small
\caption{\textbf{Logistic Regression Summary}}
\setlength\tabcolsep{2pt}
\begin{tabular}{l*{2}{c}r}
\textbf{Coefficients} & \textbf{Estimate Std.} & \textbf{p-value} \\
\hline
(Intercept) & 0.88917 & 0.000258*** \\
Frequency Index & 0.03136 & 0.554512 \\
(Intercept) & 0.41228 & 0.495 \\
Dimensionality Index & 0.01685 & 0.283 \\
(Intercept) & 2.6377 & 2.2e-05*** \\
Additive Contribution Index & -17.3226 & 0.00768** \\
(Intercept) & 1.7177 & 1.26e-06*** \\
Logic Coupling Index & -151.6851 & 0.0434* \\
(Intercept) & 0.5952 & 0.0157* \\
Central Management Index & 13.1342 & 0.0209* \\
(Intercept) & 1.5773 & 3.93e-16*** \\
Pre-communication Index & 4.0689 & 0.227 \\
(Intercept) & 1.6081 & 2e-16*** \\
Ratio of Duplicate PRs & 324.1628 & 0.25 \\
(Intercept) & 0.4447 & 0.08262 \\
Hard forks & 1.3318 & 0.00132 \\
\hline
Signif. codes: 0 ‘***’ 0.001 & ‘**’ 0.01 ‘*’ & 0.05 ‘.’ 0.1 ‘ ’ 1\\
\hline
\end{tabular}\\
\label{table:logistic_regression}
\end{table}
\end{centering}
\vspace*{-0.5em}
\textbf{RQ\ref{rq:first}: Is there a difference in the number of duplicate PRs and the existence of hard forks between successful and unsuccessful projects? [H\ref{hypo:first}] [H\ref{hypo:second}]}\\
The ratio of PRs raised having redundant development is not a significant variable with a p-value of 0.244, as shown in the table [\ref{table:logistic_regression}] above. But the presence of hard forks [H\ref{hypo:second}] is indeed significant having a p-value of 0.00132. We, therefore, conclude that the number of duplicate PRs having redundant development does not correlate to the success of a project but the presence of hard forks does. We did not find enough evidence to accept [H\ref{hypo:first}]. For the [H\ref{hypo:second}], we found an interesting observation. The number of hard forks has a positive coefficient in our regression model, indicating that the number of hard forks in a project increases the probability of success of a project. But, according to our hypotheses [H\ref{hypo:second}], there should be relatively fewer hard forks for a successful project.\\
\textbf{RQ\ref{rq:second}: Does the frequency of pull requests (PRs) raised to the main project have anything to do with the success of a project? [H\ref{hypo:eigth}]}\\
To test our hypothesis [H\ref{hypo:eigth}], we built a logistic regression model keeping frequency index as an independent variable. From table [\ref{table:logistic_regression}] we found that the numbers of PR's raised within a time frame have a p-value of 0.492. This is greater than 0.05, which implies that it is not a significant indicator in determining the success of a project. Thus, we reject our hypothesis [H\ref{hypo:eigth}] since we didn't find enough evidence to accept it. In short, we found that the frequency of pull requests does not correlate with the success of a project.\\
\textbf{RQ\ref{rq:third}: Is the size of the commits pushed to the main branch relevant to the success of a project? [H\ref{hypo:seventh}]}\\
The size of the commits is another one of the additional metrics that we believed to have no relationship with the project success. The dimensionality index [H\ref{hypo:seventh}] in our regression model resulted in a p-value of 0.145 which is greater than the expected value of 0.05. This indicates that it is not a significant variable relevant to the success of a project. Therefore, we accept the null hypothesis [H\ref{hypo:seventh}] to answer our third research question, i.e. the size of commits does not have any correlation with the success of a project.\\
\begin{centering}
\begin{table}
\caption{\textbf{R$^{2}$ value}}
\small
\setlength\tabcolsep{3pt}
\begin{tabular}{l*{2}{c}r}
\textbf{Metrics} & \textbf{McFadden’s pseudo-R$^{2}$} \\
\hline
Frequency Index & 0.00243885 \\
Dimensionality Index & 0.01388824 \\
Additive Contribution Index & 0.04913989 \\
Logic Coupling Index & 0.02475378 \\
Central Management Index & 0.06018577 \\
Pre-communication Index & 0.1994757 \\
Ratio of Duplicate PRs & 0.01255469 \\
Hard forks & 0.07834034 \\
\hline
\end{tabular}\\
\label{table:r2}
\end{table}
\end{centering}
\textbf{RQ\ref{rq:fourth}: Is modularity of a project characteristic of it's success? [H\ref{hypo:third}, H\ref{hypo:fourth}]} \\
We were looking for the correlation of modular architecture of a project with its success. In our methodology, the modularity of a project is quantified using two metrics, logic-coupling index, and additive contribution index. From table [\ref{table:logistic_regression}], both additive contribution index and logic coupling index has a p-value lower than 0.05, which implied that they are significant metrics to determine the success of a project. The coefficient of the logic coupling index is negative, conforming to our hypothesis [H\ref{hypo:third}] that a successful project should not have logic coupling in multiple files across the project. However, in contrast to our hypothesis [H\ref{hypo:fourth}], the coefficient for the additive contribution index was negative. It implied that more files added while developing software may increase the possibility of failure to the project. McFadden’s pseudo-R$^{2}$ for additive contribution index and logic coupling index are 0.05 and 0.03 consecutively which indicated that the additive contribution index is a better predictor compared to Logic coupling in terms of determining the success of a project. Therefore, we can answer our research question that modularity is significant to the success of a project. The less logic-coupling and fewer added files in the project signify a better chance that the project will be a success.\\
\textbf{{RQ\ref{rq:fifth}: Is coordination between the developers and the core team of a project for working on an issue or new feature relevant to its success? [H\ref{hypo:fifth}, H\ref{hypo:sixth}]}} \\
The coordination between developers and the core team was measured using two metrics, the pre-communication index, and the central management index. As shown in the table [\ref{table:logistic_regression}], the p-value for the central management index is 0.0209, signifying a correlation to the success of a project. The positive coefficient for this metric confirmed our hypothesis [H\ref{hypo:fifth}] and provided us with enough evidence to accept it. For the pre-communication index, the p-value suggested that it is not a significant predictor. Hence, we reject the hypothesis [H\ref{hypo:sixth}]. Furthermore, McFadden’s pseudo-R$^{2}$ for central management index of 0.05 implied that central management is a better model to predict the success of a project. To summarize, we infer from our results that the interaction between the contributors of a project before a PR is important for its success. Whereas, declaration of commitment to an issue is not necessarily important for its success.
\begin{centering}
\begin{table}
\caption{\textbf{stepAIC Summary}}
\small
\setlength\tabcolsep{3pt}
\begin{tabular}{l*{2}{c}r}
\textbf{Coefficients} & \textbf{Estimate Std.} & \textbf{p-value} \\
\hline
(Intercept) & 1.009589 & 0.1071\\
Dimensionality & 0.007572 & 0.3596 \\
Additive Index & -8.568041 & 0.0569 \\
Hard forks & 1.083335 & 0.0144* \\
\hline
Signif. codes: 0 ‘***’ & 0.001 ‘**’ 0.01 ‘*’ & 0.05 ‘.’ 0.1 ‘ ’ 1\\
\hline
\end{tabular}\\
\label{table:stepAIC}
\end{table}
\end{centering}
\subsection{Backward Stepwise Regression}
After we investigated the significance of the metrics individually to a project's success using a logistic regression model, we performed a backward stepwise selection analysis, using stepAIC function in R, on all of our metrics combined. The results, as shown in the table [\ref{table:stepAIC}], confirms that two of the metrics which are additive contribution index and presence of hard forks are significant predictors for a project's success. The central management index and logic coupling index, even though correlated individually, are not considered as significant predictors in the stepAIC analysis.
\subsection{Conclusion}
From our findings, we answer our main research question, that \textbf{not all forking practices we examined to lead to a project's success.} Every measure of modularity (logic coupling or additive contribution), which is ardently supported by the software community, does not increase the odds of the success of a project. The same findings were observed in the case of the management of a project. Understanding the trajectory of the project's future goals by contributors and maintainers (central management) is more crucial than communication about who will be working on a particular task (pre-communication). Furthermore, the presence of hard forks in a project, as well as the rate at which contributors attempt to incorporate modifications to a project, have no negative impact on its success. The size of the commits (dimensionality) is not a determining factor as it does not vary significantly between successful and retired projects. Since multiple duplicate pull requests (PRs) are rare in projects in the ASFI dataset, their presence isn't a significant factor that is correlated to a project's failure.
\section{Discussion}
In this section, we present the main findings derived from the results of our research. We also mention the strengths and limitations of our study, including threats to validity. Finally, we discuss future work that can be done based on our findings.
\subsection{Main Findings}
Based on the results, we present the following findings based on our metrics data.
\textbf{Redundant development:} In software engineering, redundant work is seen as a negative attribute in project development. We hypothesized that the ratio of duplicate PRs should be low [H\ref{hypo:first}] for a successful project as it indicates that people are doing a similar task, which wastes development time and resources \cite{produce_oss, what_the_fork}. Our model doesn’t suggest that there’s adequate evidence that the ratio of duplicate PRs has a significant impact on project success. We suspect this happens because duplicates are rare in most projects in ASFI \cite{what_the_fork}. This idea is further supported by the fact that we get sparse data for this metric. The number of projects with duplicate PRs was extremely low, and the quantity of duplicate PRs was minimal when compared to the overall number of PRs closed.
\textbf{Hard Forks:} We also hypothesized that the presence of hard forks is not a desired quality for a successful project [H\ref{hypo:second}] as it leads to fragmented communities \cite{social_forking, what_the_fork}. However, we discovered that hard forks are not a "negative" attribute that will cause a project to fail based on the results of our statistical analysis. We infer this because the coefficient for this metric was positive implying that the presence of hard forks increases the likelihood of a project becoming successful. We further believe that since the project has been successful, many developers wish to use it as their base and contribute to it, or change it to fit their needs. In addition, we find that regardless of the presence of hard forks, successful projects with solid central management and a clear vision of the project's trajectory draw contributors to the main project and keep it alive.
\textbf{Modularity:} The importance of modularity in software engineering projects is well understood as it facilitates software evolution and provides collaboration \cite{how_to_invent, produce_oss, on_the_criteria}. Both of the modularity measures, i.e. logic coupling index, and additive contribution index, have been found as significant factors in determining success. The coefficient of additive contribution index, however, in the logistic regression table [\ref{table:logistic_regression}] suggests otherwise [H\ref{hypo:fourth}]. From our interpretation, both measures of modularity do not signify the direction of a project, i.e. whether it is going to be successful or not. To be exact, more files added than being modified during the development does not mean the project is going to be successful.
\textbf{Coordination:} Even though forking has given the freedom to the developers to create a local copy without any intervention from the maintainers and contribute back when the development is done \cite{trans_and_colla}, coordination is associated with significant improvements to the efficiency of an open-source community. In our research, the result supports the hypothesis on the importance of central coordination. We have the evidence to accept [H\ref{hypo:fifth}] which indicates that the central management index is highly influential to the success of a project. On the contrary, we do not have enough evidence to confirm the significance of the pre-communication index. A possible explanation to why we do not have enough evidence is that the contributors could have used a communication channel other than GitHub Issue and PR section. Furthermore, we only examined the recent 150 PRs and Issues discussions associated with the PRs to reduce the exorbitant time of fetching the entire data over the GitHub API. Nevertheless, from the open-source communication over GitHub, it is implied from our analysis that pre-communication was not significant for the success of the ASFI projects. From the result of our research, we can conclude that it is more important to have central communication on "what" to do with the project rather than "who" would do the part.
\textbf{Dimensionality and frequency of contributions:} We also formulated two of the metrics which measure the frequency of the PRs raised and the size of the commits pushed by the developers. Our model suggests that the size of the commits does not correlate with the success of a project which aligns with our [H\ref{hypo:seventh}]. Kolassa et al. in their exploration \cite{commit_size} also mentions that indeed the scale of a project or the number of developers making contributions have no significant influence on the commit size, i.e. it more or less remains the same. However, our AIC model results, as seen in table [\ref{table:stepAIC}] indicates the dimensionality metric as one of the significant predictors, which is surprising as we didn't find enough evidence from our model to reject the [H\ref{hypo:seventh}]. We need further research and analysis to check why the metric came out significant in AIC. Our model also did not give us any significant evidence to accept the [H\ref{hypo:eigth}]. We assume this happens as the core team isn't concerned about the quantity of PRs but about the ones targeting a specific issue, tracked by the issue trackers in the version control system. So even though the rate of contribution across the project is high, good central coordination keeps the focus of the maintainers on the PRs achieving the goals as envisioned by the maintainers.
\subsection{Strengths and Limitations}
Prior research on the sustainability of projects did not have any objective way to declare a project as a success or failure. In our study, we examined the ASFI dataset, which includes specific labels for the status of each project. As a result, we were able to link the project's qualities to objectively specified labels. Previous works \cite{what_the_fork, perspective_on_forking, social_coding_forking, identifying_redundancies} have looked into efficient forking practices to foster contributions, but they didn't study whether self-sustaining projects use those efficient forking practices. We investigated this through our study, where we test our hypotheses and formulate metrics for assessing the correlation between forking practices and the sustainability of a project. Additionally, our project features robust python scripts for mining GitHub data, which can be used to enhance the project list.
\textbf{Threats to validity:}
One of the main drawbacks of using the ASFI dataset is generalizing the research implications beyond the ASF community. The list of projects is of a relatively small scale, with hundreds of projects only. There is also limited diversity as we see an inherent imbalance between graduated vs. retired projects. There may also be a presence of systematic bias in our data, meaning what we measure is not the likelihood of getting that metric data. With automatic detection, false-positive errors are inevitable, which means that some pull requests (PRs) reported as duplicate pull requests (PRs) aren't duplicates when their context is studied thoroughly. Due to limited access issues in the GitHub API, we did not identify external contributors. As a result, some of the forks may be incorrectly categorized as hard forks only based on the number of PRs in that fork.
Furthermore, developers may have opted to communicate outside of GitHub Pull Request and Issue sections. We might have introduced some threat to internal validity as we only calculate our metrics based on the information available on the project's GitHub page and not external chats or emails. The pre-communication index required more than 100,000 requests over the GitHub API due to the hierarchical nature of the metric. To reduce the calculation time of this metric, we only consider the first 5 pages or 150 recent Pull Requests per project.
The assumptions mentioned for redundant development are somewhat contrary to Apache Software community guidelines as communication is of utmost importance in ASF projects to cause redundancy. However, it is not hard to imagine these scenarios where that data may not reflect as we think it is.
\subsection{Future Work}
We performed backward stepwise regression using all of our metrics as a starter model. As shown in the table [\ref{table:stepAIC}], the metrics that are left are dimensionality index, additive contribution index, and presence of hard forks. The dimensionality index, however, was not a significant predictor when considered individually and hence needs further research. A machine learning model can also be created to forecast the probability of success of a project. For some of our metrics, the quality of data collected can be improved by incorporating data about external contributors and external communication channels. Also, for metrics relying heavily on GitHub APIs, we capped the number of pages fetched considering the rate limit policy of GitHub and the time constraints. We can refine them by using alternate GitHub mining sources such as GHTorrent. Finally, we can extend our research beyond the ASFI dataset to a larger dataset with a variety of projects to generalize the findings of our research to the broader OSS community.
\section{Team member and Attestation}
Anurag Dhasmana, Arindaam Roy, Divjeet Singh Jas, Kiranpreet Kaur, Pinn Prugsanapan \\
\emph{*All team members have read and contributed equally to this research.}
\small{
\bibliographystyle{unsrt}
| {'timestamp': '2021-12-30T02:23:46', 'yymm': '2112', 'arxiv_id': '2112.14464', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14464'} | arxiv |
\section{Reviewer comments}
\hspace{5cm}\large{ \textbf{Reviewer 1}}
\normalsize
1. Related work misses a couple of recent works done in order to improve the accuracy of event predictions.
2. More baselines should be chosen in the paper to compare with the proposed BNHP.
3. There are many typos.
\hspace{5cm}\large{ \textbf{Reviewer 2}}
\normalsize
1. This is a very general contribution on ML. No particular or specific link with the WWW and the mining and content analysis problems arising from it is provided.
I believe TheWebConf is not the most suitable venue for presenting this contribution. If the paper is published here, it will fail to reach the audience that might be interested in it and, as a consequence, will have a reduced impact.
A general ML/deep-learning or an uncertainty-in-AI venue should be considered instead.
\hspace{5cm}\large{ \textbf{Reviewer 3}}
\normalsize
1. Use related datasets to make this work become more relevant to TheWebConf.
2. They only select one baseline model (in 2019) for comparison. This is not enough to show the proposed method is better than previous methods.
3. Please cite the paper with proper information. For example, the selected baseline (FNHP) is proposed in NeurIPS-2019 [2] instead of an ArXiv paper.
4. Presentation issues and typos.
\end{letter}
\end{document}
\section{Bayesian Neural Hawkes Process Algorithm}
Bayesian neural Hawkes process (BNHP) learns the weight matrices (variational parameters) by minimizing the following objective function (variational lower bound)
\begin{equation}
\label{eqn:supp1}
\begin{split}
& - \sum_{i=1}^N \big( \log (\frac{ \partial}{\partial \tau} \Phi(\tau_i |\boldsymbol{h}_{i-1}, t_{i}; \hat{W}_i) )
- \Phi(\tau_i|\boldsymbol{h}_{i-1}, t_{i}; \hat{W}_i) \big) \\
& + \lambda ( \parallel \bar{W}_t \parallel^{2} + \parallel \bar{V}_r \parallel^{2} + \parallel \bar{U}_r \parallel^{2} + \parallel \bar{b}_r \parallel^{2})
\end{split}
\end{equation}
After learning the parameters $\bar{W} = \{\bar{W}_t, \bar{V}_r, \bar{U}_r, \bar{b}_r\}$, predicting the future event occurrence time is done as described in Algorithm~\ref{alg:algorithm1}, where $\hat{W}_s$ denotes a weight vector sample obtained using dropout at test time.
\begin{algorithm}
\begin{algorithmic}[1]
\State \textbf{Input:} $\{t_1, t_2, t_3, \ldots, t_p\}$, number of MC samples $S$, parameters $W$ and neural HP network $f^W(\cdot)$ which consider previous $M$ inter-arrival times.
\State\textbf{Output:} Time of occurrence of future predictions $\hat{t}_{p+1}, \hat{t}_{p+2}, \ldots, \hat{t}_{n} $ and uncertainty intervals as $\{\hat{t}_{p+1}^L$, $\hat{t}_{p+1}^U\}$, $\{\hat{t}_{p+2}^L$, $\hat{t}_{p+2}^U\}$ and $\{\hat{t}_{n}^L$, $\hat{t}_{n}^U\}$
\State Train the model to learn $\bar{W}$ from the train data $\{t_1, t_2, t_3, \ldots, t_p\}$ by minimizing the loss \eqref{eqn:supp1}.
\For{$i\gets p+1,n$}
\For{$s \gets 1, S$}
\State $\Phi_i^{s}(\tau) \gets f^{(\hat{W}_s)}(\{\tau_k,t_k\}_{k=i-M}^{i-1})$
\State $\lambda_i^{s}(\tau) \gets \frac{\partial}{\partial \tau} \Phi_i^{s}(\tau)$
\State $\bar{t}_{i}^{(s)} \gets \textsc{Bisection}(\Phi_i^{s}(\tau))$
\EndFor
\State $\hat{t}_{p} \gets \frac{1}{S} \sum_{s=1}^S \bar{t}_{i}^{(s)} $
\State $\sigma_p^2 \gets \frac{1}{S} \sum_{s=1}^S (\bar{t}_{p}^{(s)} - \hat{t}_{p})^2$
\State $\hat{t}_{p}^L = \hat{t}_{p} - k*\sigma_p$, $\hat{t}_{p}^U = \hat{t}_{p} + k*\sigma_p$
\EndFor
\end{algorithmic}
\caption{Proposed Approach}
\label{alg:algorithm1}
\end{algorithm}
\section{Dataset Details}
In this section, we describe the details of the dataset used for our setup. Dataset statistics are mentioned in Table \ref{Tab:dataset_stats}. We perform the following preprocessing for the real world datasets for our experimental setup.
\textbf{1)} \textbf{Crime:} This dataset contains the records of the police department calls for service in San Francisco~\footnote{\url{https://catalog.data.gov/dataset/police-calls-for-service}}.
Each record contains the crime and timestamp associated with the call along with other information. We have selected ten such crimes as \textit{Burgalary, Drugs, Fraud, Injury, Accident, Intoxicated Person, Mentally disturbed, Person with knife, Stolen Vehicle, Suicide Attempt, Threats/Harrassment} and their associated timestamps. Each sequence corresponds to a crime.
\textbf{2)} \textbf{Music:} This dataset contains the history of music listening of users at \textit{lastfm}~\footnote{\url{https://www.dtic.upf.edu/~ocelma/MusicRecommendationDataset/lastfm-1K.html}}. We consider 20 sequences from 20 most active users in the month of January, 2009. Each sequence corresponds to one user.
\textbf{3)} \textbf{New York Taxi:} The dataset contains trip records for taxis in New York City. Each pick-up record is considered as an event. This datset contains spatial attributes in the form of latitude-longitude pair along with time of occurrence of events. We consider 100,000 events for each user and a sequence is constructed for each vendor.
\textbf{4)} \textbf{Foursquare:} This is a location-based social network which contains information about check-ins of user. We have considered top 200 users during the period April 2012 to February, 2013. Each sequence corresponds to each user. This dataset also contains spatial attributes as latitude-longitude along with time of occurrence of events.
\begin{table}
\centering
\caption{Dataset Statistics}
\label{Tab:dataset_stats}
\begin{tabular}{|c|c|}
\hline
Dataset & \# events \\
\hline
Sim-Poisson & 80,000 \\
\hline
Sim-Hawkes & 80,000 \\
\hline
Crime & 217,662 \\
\hline
Music & 112,610 \\
\hline
NYC & 200,000 \\
\hline
Foursquare & 95,702 \\
\hline
\end{tabular}
\end{table}
\section{Implementation Details}
Herein, we present training details for all our experiments. We split our dataset into training, validation and test set as 70-10-20. The split is made across all sequences. Therefore, the first 70\%, next 10\% and last 20\% of the events in each sequence are used for training, validation and testing respectively. The best hyperparameters are selected using the validation set. We consider a recurrent neural network with one layer and 64 units and 5-layer feed-forward neural network with 16 units in each layer. Recurrent Neural Network is associated with a dropout at input level as well as recurrent layer level. Along with that, there is a dropout associated with feedforward neural network to represent cumulative hazard function. Also, we use \textit{Tanh} activation function. We use Adam optimizer with learning rate, $\beta_1$ and $\beta_2$ as 0.0001, 0.90 and 0.99 along with L2 regularization. We have used 50 different architectures using Monte Carlo Dropout. The results are reported after averaging the results after running the model three times. More architecture details for hyperparameter settings is mentioned in the the supplementary. We perform 1-step lookahead prediction where we use actual time of occurrence of events as past events for the historical information to predict future event. We have perfomed all the experiments on Intel(R) Xeon(R) Silver 4208 CPU @ 2.10GHz, GeForce RTX 2080 Ti GPU and 128 GB RAM. We have implemented our code in Tensorflow 1.5.0 \cite{tensorflow2015-whitepaper}.
\begin{figure}[t]
\centering
\caption{Correlation between MAE and PIL}
\label{fig:mae_corr2}
\subfloat[PIL] {\includegraphics[scale=0.24]{exp_predict2bb_mu_hpmc_timestamp_timediff_ogatta_1stddev_var11_TEST_18_batchsize3SMALL_seq_uncertainty.png} \label{fig:corr2_uncertainty}} \quad
\subfloat[MAE]{\includegraphics[scale=0.24]{exp_predict2bb_mu_hpmc_timestamp_timediff_ogatta_1stddev_var11_TEST_18_batchsize3SMALL_seq_mae.png} \label{fig:corr2_mae}}
\end{figure}
\section{Correlation Analysis}
Also, Figure \ref{fig:mae_corr2} displays averaged AD and PIC for a batch of three for a sequence of events corresponding to a user of \textit{Music} dataset. Here also, it is evident that the correlation between AD and prediction interval length.
\begin{table*}
\centering
\caption{Hyperparameter settings for the experimental set-up}
\label{Table:hyperparameter}
\begin{tabular}{|c|c|}
\hline
\begin{tabular}[c]{@{}c@{}}Hyperparameters\\ \\ trials\end{tabular} & \begin{tabular}[c]{@{}c@{}}Layers for representing cumulative hazard function = [2,5]\\ Dropout = [0.01,0.5,0.8,0.9]\\ Recurrent dropout = [0.01,0.1,0.5]\\ RNN Input dropout = [0.01,0.1,0.5]\\ Regularization constant = [0.001]\\ Batch size = [128,256,512,1024]\\ Truncation depth = [10,20,40,100]\end{tabular} \\
\hline
\begin{tabular}[c]{@{}c@{}}Hyperparameters\\ for reported\\ results\end{tabular} & \begin{tabular}[c]{@{}c@{}}Layers for representing cumulative hazard function = 5\\ Dropout = 0.5\\ Regularization constant = 0.001\\ Seed = 11\\ Truncation depth = 20\\ Recurrent dropout = \{im-Poisson: 0.1, Sim:Hawkes: 0.1, Crime: 0.1, Music: 0.1\}\\ RNN Input dropout = \\ \{im-Poisson: 0.1, Sim:Hawkes: 0.1, Crime: 0.1, Music: 0.1\}\\ Batch size = \\ \{im-Poisson: 512, Sim:Hawkes: 512, Crime: 512, Music: 1024\}\\ Epochs = \\ \{im-Poisson: 500, Sim:Hawkes: 1500, Crime: 500, Music: 1500\}\end{tabular} \\
\hline
\end{tabular}
\end{table*}
\bibliographystyle{named}
\section{Introduction}
This short example shows a contrived example on how to format the authors' information for {\it IJCAI--22 Proceedings}.
\section{Author names}
Each author name must be followed by:
\begin{itemize}
\item A newline {\tt \textbackslash{}\textbackslash{}} command for the last author.
\item An {\tt \textbackslash{}And} command for the second to last author.
\item An {\tt \textbackslash{}and} command for the other authors.
\end{itemize}
\section{Affiliations}
After all authors, start the affiliations section by using the {\tt \textbackslash{}affiliations} command.
Each affiliation must be terminated by a newline {\tt \textbackslash{}\textbackslash{}} command. Make sure that you include the newline on the last affiliation too.
\section{Mapping authors to affiliations}
If some scenarios, the affiliation of each author is clear without any further indication (\emph{e.g.}, all authors share the same affiliation, all authors have a single and different affiliation). In these situations you don't need to do anything special.
In more complex scenarios you will have to clearly indicate the affiliation(s) for each author. This is done by using numeric math superscripts {\tt \$\{\^{}$i,j, \ldots$\}\$}. You must use numbers, not symbols, because those are reserved for footnotes in this section (should you need them). Check the authors definition in this example for reference.
\section{Emails}
This section is optional, and can be omitted entirely if you prefer. If you want to include e-mails, you should either include all authors' e-mails or just the contact author(s)' ones.
Start the e-mails section with the {\tt \textbackslash{}emails} command. After that, write all emails you want to include separated by a comma and a space, following the same order used for the authors (\emph{i.e.}, the first e-mail should correspond to the first author, the second e-mail to the second author and so on).
You may ``contract" consecutive e-mails on the same domain as shown in this example (write the users' part within curly brackets, followed by the domain name). Only e-mails of the exact same domain may be contracted. For instance, you cannot contract ``[email protected]" and ``[email protected]" because the domains are different.
\end{document}
\section{Introduction}
Many dynamic systems are characterized by sequences of discrete events over continuous time.
Such temporal data are generated in various applications such as earthquakes, taxi-pickups, financial transactions, patient visits to hospitals etc. Despite these diverse domains, a common question across all the platforms is: Given an observed sequence of events, can we predict the time for the occurrence of the next event.
A practical model should not only be capable of doing prediction but also model uncertainty in its predictions.
For example, in healthcare predicting the patient arrival and uncertainty around prediction in the form of a time interval can help in queue management in hospitals. Similarly, uncertainty estimates for volcanic eruptions and earthquakes can help in risk management and make proactive decisions. A proper modelling of uncertainty will help users to determine what predictions by the event prediction model one can rely upon. Therefore, we need a model for event time prediction which can capture uncertainty.
However, the neural models used for predicting temporal events make a point estimation of parameters and lack the required uncertainty modelling capability. This can lead to unreliable and overconfident predictions which can adversely affect decision making in many real-world applications. Therefore, we need to develop models which will also consider \textit{the confidence of the model in making the prediction}.
Popular approaches for modeling event-data are based on point processes which are defined using a latent intensity function. A Hawkes process (HP)~\cite{hawkes1971spectra} is a point process with self-triggering property i.e. occurrences of previous events trigger occurrences of future events.
A parametric form of the Hawkes process assumes monotonically decaying influence over past events, which may limit the expressive ability of the model and can deteriorate the performance on complex data sets. Therefore, recent techniques model the intensity function as a neural network~\cite{mei2017neural,du2016recurrent,xiao2017modeling,omi2019fully} so that the influence of past events can be modelled in a non-parametric manner without assuming a particular functional form.
Neural network based models typically tend to yield overconfident predictions and are incapable of properly modelling predictive uncertainty~\cite{gal2016uncertainty}. This can be overcome by combining Bayesian principles in neural networks, leading to Bayesian neural networks (BNN)~\cite{neal2012bayesian}.
BNN puts a distribution over the weight parameters and computes a posterior over them using Bayes theorem.
Predictions are made using Bayesian model averaging using this posterior distribution which help in modelling uncertainty. However, determination of posterior is fraught with practical difficulties. Monte Carlo (MC) Dropout proposed by~\cite{gal2016dropout,gal2016theoretically} provides a practical and useful approach to develop BNNs. They proved that dropout regularization can be seen as equivalent to performing Bayesian inference over weights of a neural network.
In this paper, we propose \textit{Bayesian Neural Hawkes Process (BNHP)} where we develop Monte Carlo dropout for a neural Hawkes process consisting of recurrent and feed-forward neural networks. BNHP is not only capable of modelling uncertainty but also improves the prediction of the event-times. Our contribution can be summarized as:
\begin{itemize}[leftmargin=10mm]
\item We propose a novel model which combines the advantages of the neural Hawkes process and Bayesian neural network for modelling uncertainty over time of occurrence of events. We also extend the proposed approach to spatio-temporal event modeling set-up.
\item We develop MC dropout for a neural Hawkes process network which consists of both recurrent and feed-forward neural networks.
\item We demonstrate the effectiveness of BNHP for uncertainty modelling and prediction of event times and locations on several simulated and real world data.
\end{itemize}
\section{Related Work}
\textbf{Hawkes process:}
Point processes~\cite{valkeila2008introduction} are useful to model the distribution of points and are defined using an underlying intensity function.
Hawkes process~\cite{hawkes1971spectra} is a point process \cite{valkeila2008introduction} with self-triggering property.
i.e occurrence of previous events trigger occurrences of future events.
Hawkes process has been used in earthquake modelling~\cite{paper20}, crime forecasting~\cite{paper19}, finance~\cite{bacry2015hawkes,embrechts2011multivariate} and epidemic forecasting~\cite{paper18,chiang2021hawkes}.
However, to avoid parametric models various research works have proposed~\cite{du2016recurrent,mei2017neural,omi2019fully,zuo2020transformer} where intensity function is learnt using neural networks, which are better at learning unknown distributions.
Along the direction of the spatio-temporal Hawkes process, \cite{du2016recurrent} has considered spatial attributes by discretizing space and considering them as marks, which is unable to model spatio-temporal intensity function. \cite{okawa2019deep,zhou2021neural} has proposed spatio-temporal intensity as a mixture of kernels. \cite{chen2020neural} has proposed Neural ODE for modeling spatio-temporal point processes.
Another work \cite{ilhan2020modeling} has applied random Fourier features based transformations to represent kernel operations in spatio-temporal Hawkes process. A recent work~\cite{zhou2021neural} has introduced deep spatio-temporal point process where they integrate spatio-temporal point process with deep learning by modeling space-time intensity function as mixture of kernels where intensity is inferred using variational inference.
Bayesian Neural Networks (BNNs) \cite{neal2012bayesian,gal2016uncertainty} are widely used framework to find uncertainty estimates for deep models. However, one has to resort to approximate inference techniques~\cite{graves2011practical,neal2012bayesian} due to intractable posterior in BNNs. An alternative solution is to incorporate uncertainty directly into the loss function~\cite{lakshminarayanan2017simple,pearce2018high}.
Monte Carlo Dropout proposed by~\cite{gal2016dropout,gal2016theoretically} proved that dropout regularization~\cite{srivastava2014dropout} can act as approximation for Bayesian inference over the weights of neural networks.
There are few works~\cite{zhang2020variational,zhang2019efficient,wang2020uncertainty} where uncertainty is captured over the parameters of parametric hawkes process. In~\cite{chapfuwa2020calibration} authors have proposed an adversarial non-parametric model that accounts for calibration and uncertainty for time to event and uncertainty prediction.
However, neural point processes are a widely adopted model for event modeling due to its theoretical and practical effectiveness in various applications. Therefore, the goal of this paper is to augment the capabilities of the neural point process to predict future events with the uncertainty estimation capability. To achieve this, we propose a novel approach which combines neural point process and Monte Carlo dropout for performing uncertainty estimation for event-time prediction.
\section{Bayesian Neural Hawkes Process}
We consider the input sequence $S = \{t_i\}_{i=1}^N$ in the observation interval $[0, T]$ and inter-event time interval as $\tau_i = t_i - t_{i-1}$.
Our goal is to predict the time of occurrence of next events along with uncertainty estimates over the predicted time.
We consider a neural Hawkes process (NHP)~\cite{omi2019fully}, which consider a combination of recurrent neural network and feed-forward neural network to model the likelihood associated with the sequence of events $\{t_i\}_{i=1}^N$ and predict the future events. We propose Bayesian Neural Hawkes process by developing MC dropout jointly over recurrent and feed-forward neural networks in an NHP.
\subsection{Neural Hawkes Process}
\label{Section:NHP}
A major characteristic of the Hawkes process~\cite{hawkes1971spectra} is the conditional intensity function which conditions the next event occurrence based on the history of events. Following recent advances in Hawkes process~\cite{du2016recurrent,omi2019fully}, neural Hawkes processes were proposed which model the intensity function as a nonlinear function of history using a neural network. In particular \cite{omi2019fully} uses a combination of recurrent neural network and feedforward neural network to model the intensity function. This allows the intensity function to take any functional form depending on data and help in better generalization performance.
We represent history by using hidden representations generated by recurrent neural networks (RNNs) at each time step. The hidden representation $\boldsymbol{h}_i$ at time $t_i$ is obtained as
\begin{equation}
\boldsymbol{h}_i = RNN(\tau_i, \boldsymbol{h}_{i-1}; W_r ) = \sigma(\tau_i V_r + \boldsymbol{h}_{i-1} U_r + b_r)
\label{eq:rnn}
\end{equation}
where $W_r$ represents the parameters associated with RNN such as input weight matrix $V^r$, recurrent weight matrix $U_r$, and and bias $b_r$. $\boldsymbol{h}_i$ is obtained by repeated application of the RNN block on a sequence formed from previous $M$ inter-arrival times.
This is used as input to a feedforward neural network to compute the intensity function (hazard function) and consequently the cumulative hazard function for computing the likelihood of event occurrences.
In the proposed model, we consider the following input to the feed-forward neural network \Romannum{1}) the hidden representation generated from RNN, \Romannum{2}) time of occurrence of the event and \Romannum{3}) elapsed time from the most recent event. To better capture the uncertainty in predicting points in future time, we considered the time at which the intensity function needs to be evaluated.
We model the conditional intensity as a function of the elapsed time from the most recent event, and is represented as $\lambda(t-t_i|\boldsymbol{h}_i, t)$,
where $\lambda(\cdot)$ is a non-negative function referred to as a hazard function.
Therefore, we define cumulative hazard function in terms of inter-event interval
\begin{equation}
\tau = t - t_{i} = \Phi(\tau|\boldsymbol{h}_i, t) = \int_{0}^{\tau}\lambda(s|\boldsymbol{h}_i, t)ds
\end{equation}
Cumulative hazard function is modeled using a feed-forward neural network (FNN)
\begin{equation}
\Phi(\tau|\boldsymbol{h}_i, t ) = FNN(\tau, h_i, t; W_t).
\end{equation}
However, we need to fulfill two properties of cumulative hazard function. Firstly, it has to be a monotonically increasing function of $\tau$ and secondly, it has to be positive valued. We achieve these by maintaining positive weights and positive activation functions in the neural network~\cite{chilinski2020neural,omi2019fully}. The hazard function itself can be then obtained by differentiating the cumulative hazard function with respect to $\tau$ as
\begin{equation}
\lambda(\tau|\boldsymbol{h}_i, t) = \frac{\partial}{\partial \tau}\Phi(\tau|\boldsymbol{h}_i, t)
\end{equation}
The log-likelihood of observing event times is defined as follows using the cumulative hazard function:
\begin{equation}
\begin{split}
\label{eq:log_lik_nhp}
& \log p(\{t_i\}_{i=1}^N ; W) = \sum_{i=1}^N \log p(t_i|\mathcal{H}_i;W) =
\sum_{i=1}^N \big( \log (\frac{ \partial}{\partial \tau} \Phi(\tau_i |\boldsymbol{h}_{i-1}, t_{i}; W) )
- \Phi(\tau_i|\boldsymbol{h}_{i-1}, t_{i}; W) \big)
\end{split}
\end{equation}
where $\tau_i = t_{i}-t_{i-1}$ and $W = \{W_r, W_t\}$ represents the combined weights associated with RNN and FNN. In NHP, the weights of the networks are learnt by maximizing the likelihood given by (\ref{eq:log_lik_nhp}). The gradient of the log-likelihood function is calculated using backpropagation.
\begin{figure}
\centering
\includegraphics[scale=0.20]{BNHP_Arxiv.png}
\caption{Framework for the proposed approach. Input: Time of occurrence associated with sequence of events. Output: time of occurrence of future events along with the uncertainty estimate.}
\label{fig:framework_uncertainty}
\end{figure}
\subsection{Monte Carlo Dropout for Neural Hawkes Process}
\label{sect:bnhp}
In this section, we discuss our proposed framework \textit{Bayesian Neural Hawkes Process (BNHP)} (shown in Figure \ref{fig:framework_uncertainty}), for estimating uncertainty over time of occurrence of events.
We propose a simple and practical approach based on Monte Carlo (MC) Dropout~\cite{gal2016dropout}] to model uncertainty in NHP.
We develop MC Dropout for the NHP model which consists of two kinds of networks - RNN processing the input sequence and FNN producing the cumulative hazard function.
To model uncertainty, we follow a Bayesian approach, where we treat the weight matrices as random variables and put a prior distribution such as a standard Gaussian over them, i.e. $p(W) = \mathcal{N}(W;0,I)$.
A Bayesian model will learn a posterior distribution over the parameters, instead of point estimates which allows them to capture uncertainty in the model.
The likelihood of observing the event times given the weight parameters is defined by \eqref{eq:log_lik_nhp}.
We find the posterior distribution over the parameters $p(W | \{t_i\}_{i=1}^N )$ given the observed sequence of events using the Bayes Theorem,
\begin{equation}
\begin{aligned}
p(W \mid \{t_i\}_{i=1}^N )=\frac{p(\{t_i\}_{i=1}^N \mid W ) p(W)}{p(\{t_i\}_{i=1}^N)}.
\end{aligned}
\end{equation}
However, the posterior computation is intractable due to non-linear functions modelled using neural networks. Hence, we find an approximate distribution $q(W)$ to the posterior $p(W | \{t_i\}_{i=1}^N)$ using variational inference (VI)~\cite{blei17}. The parameters of $q(W)$ is obtained by minimizing the variational lower bound (ELBO) involving Kullback-Leibler (KL) divergence.
\begin{eqnarray}
- \sum_{i=1}^N \int q(W)\, \log p(t_i|\mathcal{H}_i;W) \,dW + KL(q(W) \parallel p(W)) \nonumber
\label{eqn:elbo}
\end{eqnarray}
Monte-Carlo (MC) dropout~\cite{gal2016dropout} assumes a particular form for the variational approximation which makes the ELBO computation equivalent to training the neural networks with dropout regularization.
It has been shown that using VI with this specific form for the variational approximation is equivalent to applying dropout during training and testing~\cite{gal2016dropout}.
A challenge with the neural Hawkes process in applying MC dropout is that, we have two kinds of neural networks with two types of weight parameters: $W_t$ associated with the FNN and $W_r$ associated with the RNN. Consequently, we use different variational approximations over each of the parameter types and thus different dropout regularizations as described below. We assume the variational distribution $q(W)$ can be decomposed as product of the variational distributions $q(W_t)$ and $q(W_r)$. We assume the following form for the variational distribution $q(W_t) = \prod_{l=1}^L q(W_t^l)$, where a sample $\hat{W}_t^l$ associated with layer $l$ is obtained from $q(W_t^l)$ as
\begin{eqnarray}
\label{eq:vardistr}
\hat{W}_t^l \sim \bar{W}_t^l \cdot diag([\mathbf{z}^l]) \quad \, \quad \mathbf{z}^l \sim Bernoulli(p)
\end{eqnarray}
where $p$ is the drop probability and $\bar{W}_t^l$ are variational parameters (also weight matrix) to be estimated from the ELBO. Due to binary valued $\mathbf{z}^l$, $\hat{W}^l$ sampled from $q(W^l)$ will have some of the columns of the weight matrix set to zero aiding in dropout regularization.
For the weights $W_r$ in the RNN , we use a variant of the standard MC-Dropout to perform learning and inference. First we assume the variational distribution $q(W_r)$ to factorize over the weight matrices $V^r$, $U_r$, and $b_r$,
\begin{equation}
q(W_r) = q(V_r)q(U_r)q(b_r)
\end{equation}
For each of these weight matrices, we assume the variational distribution to factorize over the rows,
\begin{equation}
q(V_r) = \prod_{k=1}^K q(V_{rk})
\end{equation}
Each row in the weight matrix follows an approximate distribution :
\begin{equation}
q(V_{rk}) = p \mathcal{N}(V_{rk};0,\sigma_r^2 I) + (1-p) \mathcal{N}(V_{rk};\bar{V}_{rk}, \sigma_r^2 I)
\label{eqn:rnnvar}
\end{equation}
where $p$ is the drop probability, $\bar{V}_{rk}$ is the weight vector (also variational parameters) and $\sigma_r^2$ is the variance. The distribution \eqref{eqn:rnnvar} is similar to the sampling process in \eqref{eq:vardistr} when the variance is small. We sample the weight matrices $\hat{W}_r = \{ \hat{V}_r, \hat{U}_r, \hat{b}_r\}$ associated with RNN from the variational distribution defined by \eqref{eqn:rnnvar}. This results in the masking of random rows of the weight matrices. In the case of RNN, the same masked weight matrices are used for processing all the elements in the input sequence~\cite{gal2016theoretically}. But, different sequences use different masked weights.
For obtaining the distribution over the inter-arrival time $\tau_i$, we first obtain hidden representation $\mathbf{h}_{i-1}$ using an RNN with sampled weight matrices $\hat{W}_{ri}$. This is then fed through FNN along with other inputs and sampled weight matrix $\hat{W}_{ti}$ to obtain the cumulative hazard function $\Phi(\tau_i|\boldsymbol{h}_{i-1}, t_i, \hat{W}_i)$.
Consequently, the variational lower bound (ELBO) is written as
\begin{eqnarray}
& L_{VI}(\bar{W})
= - \sum_{i=1}^N \log p(t_i|\mathcal{H}_i;\hat{W}_i) + \lambda \parallel \bar{W} \parallel^{2} \nonumber \\
\label{eqn:elbodrop}
&=- \sum_{i=1}^N \big( \log (\frac{ \partial}{\partial \tau} \Phi(\tau_i |\boldsymbol{h}_{i-1}, t_{i}; \hat{W}_i) )
- \Phi(\tau_i|\boldsymbol{h}_{i-1}, t_{i}; \hat{W}_i) \big) \nonumber
+ \lambda ( \parallel \bar{W}_t \parallel^{2} + \parallel \bar{V}_r \parallel^{2} + \parallel \bar{U}_r \parallel^{2} + \parallel \bar{b}_r \parallel^{2})
\end{eqnarray}
where $\bar{W} = \{\bar{W}_t, \bar{V}_r, \bar{U}_r, \bar{b}_r\}$ represents all the weight matrices (variational parameters) that needs to be learnt by minimizing the objective function \eqref{eqn:elbodrop}. We can observe that this is equivalent to learning weight parameters in a neural Hawkes process by minimizing the negative log-likelihood \eqref{eq:log_lik_nhp}, but with dropout regularization and $\ell_2$ norm regularization (obtained by simplifying the KL term) over the weight matrices.
\subsection{Prediction and Uncertainty Estimation}
\label{sec:pred_uncertainty}
For prediction, Bayesian models make use of the full posterior distribution over parameters rather than a point estimate of the parameters. This allows them to make robust predictions and model uncertainty over the predictions. After learning the variational parameters $\bar{W}$, we use the approximate posterior $q(W)$ to make predictions. The probability of predicting the time of next event given the history of previous event times with last event at $t_N$ is computed as
\begin{equation}
p(t_*|\mathcal{H}) = \int p(t_*|\mathcal{H};W) q(W) dW = \frac{1}{S} \sum_{s=1}^S p(t_*|\mathcal{H};\hat{W}_s) \nonumber
\end{equation}
where we approximated the integral with a Monte-Carlo approximation~\cite{neal2012bayesian} with $S$ samples from $q(W)$ ($\hat{W}_s \sim q(W) $) and $\tau_* = t_* - t_N$. We can observe that sampling from $q(W)$ leads to performing dropout at the test time and the final prediction is obtained by averaging the prediction over multiple dropout architectures. Here, uncertainty in the weights induces model uncertainty for event time prediction.
Monte-Carlo dropout on NHP provides a feasible and practical technique to model uncertainty in event prediction. MC dropout is equivalent to performing $M$ forward passes through the NHP with stochastic dropouts at each layer but considering the specific nature of the network (recurrent or feedforward).
Final prediction is done by taking an average prediction from the $M$ network architectures formed out of dropout in the forward pass. This can be seen as equivalent to ensemble of NHPs which could also lead to improved predictive performance.
For each network, we use the bisection method~\cite{omi2019fully} to predict the time of the next event. Bisection method provides the median $t_*$ of the predictive distribution over next event time using the relation $\Phi(t_* - t_N|\boldsymbol{h}_N, t_*; \hat{W})=\log(2)$. We obtain $S$ median event times, with each median event time $t_{*_s}$ obtained using a network with sampled weight $\hat{W}_s$. The mean event time is then found by averaging $S$ times obtained from different sampled weights, $t_* = \frac{1}{S} \sum_{s=1}^S t_{*_s}$.
The variance of predicted time is obtained as
\begin{equation}
Var(t_*) = {\sigma_*}^2 = \frac{1}{S} \sum_{s=1}^S (t_{*_s} - t_*)^2
\end{equation}
We also define lower and upper bound of predicted time as
\begin{equation}\label{eq:bound}
{t}_{*}^L = {t}_* - k\sigma_* ; \quad
{t}_{*}^U = {t}_* + k\sigma_*
\end{equation}
Algorithm~\ref{alg:algorithm1} provides the details of the prediction process, where $\hat{W}_s$ denotes a weight vector sample obtained using dropout at test time.
\begin{algorithm}
\begin{algorithmic}[1]
\State \textbf{Input:} $\{t_1, t_2, t_3, \ldots, t_p\}$, number of MC samples $S$, parameters $W$ and neural HP network $f^W(\cdot)$ which consider previous $M$ inter-arrival times.
\State\textbf{Output:} Time of occurrence of future predictions $\hat{t}_{p+1}, \hat{t}_{p+2}, \ldots, \hat{t}_{n} $ and uncertainty intervals as $\{\hat{t}_{p+1}^L$, $\hat{t}_{p+1}^U\}$, $\{\hat{t}_{p+2}^L$, $\hat{t}_{p+2}^U\}$ and $\{\hat{t}_{n}^L$, $\hat{t}_{n}^U\}$
\State Train the model to learn $\bar{W}$ from the train data $\{t_1, t_2, t_3, \ldots, t_p\}$ by minimizing the loss \eqref{eqn:elbodrop}.
\For{$i\gets p+1,n$}
\For{$s \gets 1, S$}
\State $\Phi_i^{s}(\tau) \gets f^{(\hat{W}_s)}(\{\tau_k,t_k\}_{k=i-M}^{i-1})$
\State $\lambda_i^{s}(\tau) \gets \frac{\partial}{\partial \tau} \Phi_i^{s}(\tau)$
\State $\bar{t}_{i}^{(s)} \gets \textsc{Bisection}(\Phi_i^{s}(\tau))$
\EndFor
\State $\hat{t}_{p} \gets \frac{1}{S} \sum_{s=1}^S \bar{t}_{i}^{(s)} $
\State $\sigma_p^2 \gets \frac{1}{S} \sum_{s=1}^S (\bar{t}_{p}^{(s)} - \hat{t}_{p})^2$
\State $\hat{t}_{p}^L = \hat{t}_{p} - k*\sigma_p$, $\hat{t}_{p}^U = \hat{t}_{p} + k*\sigma_p$
\EndFor
\end{algorithmic}
\caption{Proposed Approach}
\label{alg:algorithm1}
\end{algorithm}
\subsection{Bayesian Neural Hawkes Process for Spatio-Temporal Modeling (ST-BNHP)}
We extend the Bayesian Neural Hawkes Process developed for modeling uncertainty over time to modeling uncertainty over space. For applications involving spatio-temporal data such as traffic flow prediction, and human mobility prediction it is useful to obtain uncertainty over spatial points apart from the temporal uncertainty.
Following \cite{valkeila2008introduction}, we model conditional intensity function for modelling the spatio-temporal data as $\lambda(t,x) = \lambda(t) p(\mathbf{x} | t)$,
where $\mathbf{x} \in \mathcal{R}^D$ represents a spatial point or location and $p( \mathbf{x}| t)$ is the conditional spatial density of location $\mathbf{x}$ at t given $H_t$.
Since many mobility patterns involve movement in close-by regions, we model the conditional spatial density $p(\mathbf{x}_i|t_i)$ as a Gaussian conditioned on the history, i.e. all the past events, times and locations ($(t_{i-}, \mathbf{x}_{i-})$). Thus,
\begin{equation}
\begin{split}
\label{eqn:Gaussian}
p(\mathbf{x}_i | t_{i-}, \mathbf{x}_{i-}) &= \mathcal{N}(\mathbf{x}_i ; \mu(t_{i-}, \mathbf{x}_{i-}),
\sigma(t_{i-}, \mathbf{x}_{i-}))
\end{split}
\end{equation}
In the proposed model, we consider parameters of the Gaussian $\mu(\cdot)$ and $\sigma(\cdot)$ as functions of past event times and locations and are modeled using a feed-forward neural network.
\[
[\mu(t_{i-}, \mathbf{x}_{i-}), \sigma(t_{i-}, \mathbf{x}_{i-}) ]= FNN(\boldsymbol{h}_i, \mathbf{x}_{i-};W_l)
\]
where $\boldsymbol{h}_i$ is the hidden representation obtained from the RNN model with the sequence of the past event times as input.
The log likelihood for the spatio-temporal neural Hawkes model can be written as $\sum_{i=1}^N LL(t_i,\mathbf{x}_i; W,W_l)$, where
\begin{equation}
\label{eq:log-likelihood-spatial}
LL(t_i,\mathbf{x}_i; W,W_l) = \log p(t_i|\mathcal{H}_i;W) + \log p(\mathbf{x}_i| t_{i-}, x_{i-}; W_l). \nonumber
\end{equation}
To obtain spatio-temporal Bayesian neural Hawkes (ST-BNHP) model, we consider a distribution over $W_l$ and follow a similar approach as in Section \ref{sect:bnhp}, where a variational distribution $q(W_l)$ over $W_l$ is defined as in \eqref{eq:vardistr}. The resulting ELBO considers the spatial likelihood and can be written as
\begin{equation}
\label{eq:log-likelihood-spatial-montecarlo}
\begin{split}
& - \sum_{i=1}^N LL(t_i,\mathbf{x}_i;\hat{W}_i,\hat{W}_{li}) + \lambda (\parallel \bar{W} \parallel^{2} + \parallel \bar{W}_l \parallel^{2} ) \end{split}
\end{equation}
where $\hat{W}_{li} \sim q(W_l)$ and $\bar{W}_l$ is the variational parameter (weight matrix). The parameters are learnt by minimizing the lower bound \eqref{eq:log-likelihood-spatial-montecarlo} and is equivalent to learning with dropout regularization. Prediction is done as discussed in Section \ref{sect:bnhp}, where one considers multiple dropout architectures (corresponding to different samples of weight matrices), and taking an average over them. For each dropout architecture, we predict the time of occurrence of the next event using the bisection method and the location of of the next event by sampling from the conditional Gaussian $\mathcal{N}(\mathbf{x}_* ; \mu(t_{N-}, \mathbf{x}_{N-}),
\sigma(t_{N-}, \mathbf{x}_{N-}))$.
\begin{table*}
\centering
\tabcolsep=0.05cm
\begin{tabular}{c|cccc|cccc|cccc|cccc}
\hline
\begin{tabular}[c]{@{}c@{}}\\\end{tabular} & & \multicolumn{4}{c}{Sim-Poisson} & \multicolumn{4}{c}{Sim-Hawkes} & \multicolumn{4}{c}{Crime} & \multicolumn{3}{c}{Music} \\
\hline
\textbf{Metric} & SHP & NHP~ & EH & BNHP & SHP & NHP & EH & BNHP & SHP & NHP & EH & BNHP & SHP & NHP & EH & BNHP \\
\hline
\textbf{MNLL} & 1.21 & 1.36 & * & \textbf{0.196} & 1.08 & 1.26 & * & \textbf{0.166} & 1.809 & 1.42 & * & \textbf{0.279} & 1.239 & 0.97 & * & \textbf{-0.322} \\
\textbf{MAE}~ & 0.81 & 0.76 & 0.172 & \textbf{0.078} & 0.382 & 0.83 & 0.234 & \textbf{0.156} & 0.903 & 0.82 & 0.242 & \textbf{0.158} & 0.997 & 0.58 & 0.104 & \textbf{0.060} \\
\textbf{PIC@1} & 0.0 & 0.0 & 0.019 & \textbf{0.946} & 0.0 & 0.0 & 0.012 & \textbf{0.725} & 0.0 & 0.0 & 0.002 & \textbf{0.586} & 0.0 & 0.0 & 0.265 & \textbf{0.836} \\
\textbf{PIC@2} & 0.0 & 0.0 & 0.031 & \textbf{0.996} & 0.0 & 0.0 & 0.029 & \textbf{0.976} & 0.0 & 0.0 & 0.005 & \textbf{0.856} & 0.0 & 0.0 & 0.312 & \textbf{0.963} \\
\textbf{PIC@5} & 0.0 & 0.0 & 0.061 & \textbf{1.0} & 0.0 & 0.0 & 0.058 & \textbf{0.999} & 0.0 & 0.0 & 0.015 & \textbf{0.997} & 0.0 & 0.0 & 0.458 & \textbf{0.996} \\
\hline
\end{tabular}
\caption{Comparison of the proposed approach (BNHP) against the baselines (Please note that EH uses least square loss and hence MNLL for EH is not comparable to our results, hence MNLL for EH is marked with '*'. ) }
\label{Tab:experiments}
\end{table*}
\begin{table*}
\centering
\begin{tabular}{cccccccccc}
\hline
Dataset & Method & MNLL & \begin{tabular}[c]{@{}c@{}}MNLL\\Temporal\end{tabular} & \begin{tabular}[c]{@{}c@{}}MNLL\\Spatial\end{tabular} & \begin{tabular}[c]{@{}c@{}}MAE\\time\end{tabular} & \begin{tabular}[c]{@{}c@{}}MAE\\lat\end{tabular} & \begin{tabular}[c]{@{}c@{}}MAE\\long\end{tabular} & \begin{tabular}[c]{@{}c@{}}PIC\\time\end{tabular} & \begin{tabular}[c]{@{}c@{}}PIC\\spatial\end{tabular} \\
\hline
\multirow{1}{*}{Foursquare} & ST-HomogPoisson & 8.204 & - & - & 4.229 & 1.23 & 1.824 & 0.026 & 0.025 \\
& ST-NHP & 5.366 & 1.562 & 3.804 & 2.048 & 0.889 & 0.798 & 0.0 & 0.387 \\
& ST-BNHP & \textbf{2.817} & \textbf{0.477} & \textbf{2.340} & \textbf{1.122} & \textbf{0.754 } & \textbf{0.760} & \textbf{0.877} & \textbf{0.649} \\
\hline
\multirow{2}{*}{Taxi} & ST-HomogPoisson & 13.711 & - & - & 2.472 & 4.386 & 1.527 & 0.041 & 0.056 \\
& ST-NHP & 3.812 & 1.476 & 2.335 & 1.501 & 0.639 & 0.581 & 0.0 & 0.546 \\
& ST-BNHP & \textbf{2.392} & \textbf{0.054} & \textbf{2.338} & \textbf{0.133} & \textbf{0.589} & \textbf{0.536} & \textbf{0.386} & \textbf{0.721} \\
\hline
\end{tabular}
\caption{Comparison of the proposed approach (ST-BNHP) against the baselines for spatio-temporal modeling }
\label{Tab:st-experiments}
\end{table*}
\begin{table}[t]
\centering
\caption{Dataset Statistics}
\label{Tab:dataset_stats}
\begin{tabular}{|c|c|}
\hline
Dataset & \# events \\
\hline
Sim-Poisson & 80,000 \\
\hline
Sim-Hawkes & 80,000 \\
\hline
Crime & 217,662 \\
\hline
Music & 112,610 \\
\hline
NYC & 200,000 \\
\hline
Foursquare & 95,702 \\
\hline
\end{tabular}
\end{table}
\section{Experiments and Results}
\paragraph{Dataset Details}
We extensively perform experiments on six datasets including two synthetic and four real-world datasets. Dataset statistics are mentioned in Table \ref{Tab:dataset_stats}.
\begin{itemize}
\item \textbf{Simulated Poisson (Sim-Poisson):} We simulate a homogeneous poisson process with conditional intensity $\lambda$ = 1.
\item \textbf{Simulated Hawkes (Sim-Hawkes):} We use the Hawkes process, in which the kernel function is given by the sum of multiple exponential functions. The conditional intensity function is given by $\lambda(t) = \mu + \sum_{t_i < t} \sum_{j=1}^2 \alpha_j \beta_j \exp{(- \beta_j(t - t_i))}$. We have used $\mu = 0.05 $, $\alpha_1 = 0.4$, $\alpha_2 = 0.4$, $\beta_1 = 1.0$, $\beta_1 = 20.0$.
\item \textbf{Crime:} This dataset contains the records of the police department calls for service in San Francisco~\footnote{\url{https://catalog.data.gov/dataset/police-calls-for-service}}. Each record contains the crime and timestamp associated with the call along with other information. We have selected ten such crimes as \textit{Burgalary, Drugs, Fraud, Injury, Accident, Intoxicated Person, Mentally disturbed, Person with knife, Stolen Vehicle, Suicide Attempt, Threats/Harrassment} and their associated timestamps. Each sequence corresponds to a crime.
\item \textbf{Music:} This dataset contains the history of music listening of users at \textit{lastfm}~\footnote{\url{https://www.dtic.upf.edu/~ocelma/MusicRecommendationDataset/lastfm-1K.html}}. We consider 20 sequences from 20 most active users in the month of January, 2009. Each sequence corresponds to one user.
\item \textbf{New York Taxi:} The dataset contains trip records for taxis in New York City. Each pick-up record is considered as an event. This datset contains spatial attributes in the form of latitude-longitude pair along with time of occurrence of events. We consider 100,000 events for each user and a sequence is constructed for each vendor.
\item \textbf{Foursquare:} This is a location-based social network which contains information about check-ins of users. We have considered top 200 users during the period April 2012 to February, 2013. Each sequence corresponds to each user. This dataset also contains spatial attributes as latitude-longitude along with time of occurrence of events.
\end{itemize}
We have used the New York Taxi and Foursquare dataset for spatio-temporal modeling.
\paragraph{Evaluation metrics}
We consider these metrics for evaluation of our results
\begin{itemize}
\item \textbf{Mean Negative Log Likelihood (MNLL): } Log-likelihood considers the probability of predicting the actual observations, and we expect a good model to have a lower MNLL score.
\item \textbf{Mean Absolute Error for prediction (MAE):} The measure computes purely the absolute error in predicting the time without considering the probability. A model with low MAE will reflect a better model.
\item \textbf{Prediction Interval Coverage (PIC):} It represents the number of times an actual event occurs within the estimated interval. Hence, higher PIC will represent a better model.
\item \textbf{Prediction Interval Length (PIL):} It represents the length of difference between upper bound and lower bound of the predicted interval (Refer \eqref{eq:bound}). We report the mean and variance of interval length ($2*k*\sigma$). Higher PIL signifies more uncertainty associated with the event.
\end{itemize}
These evaluation metrics are tweaked for spatio-temporal modeling as well. For example, spatial MNLL represents conditional spatial density. MAE and PIL are calculated separately for latitude and longitude. Moreover, we modulate PIC in spatial manner by considering an actual event to occur within the estimated latitude and longitude bounds.
\paragraph{Baselines}
We compare our experimental setup with the following baselines.
\begin{itemize}
\item \textbf{NHP:} Neural Hawkes process (NHP)~\cite{omi2019fully} serves as a baseline for evaluating the performance of predicted time of occurrence of event.
\item \textbf{SHP:} We consider the standard Hawkes Process with exponential kernel as another baseline. NHP and SHP model probability distribution over event times $p(\tau | h_i) $, though they do not model epistemic uncertainty like BNHP.
\item \textbf{Ensemble Hawkes (EH):} We propose a new baseline capable of modelling epistemic uncertainty - an ensemble of parametric HP using exponential kernels with different hyper-parameters.
To avoid convergence issues, we use least-square loss \cite{xu2018benefits} for training EH. Due to this, MNLL of EH won't be comparable with other methods which use survival likelihood. Each ensemble consists of 10 models with decays ranging between 0.001 to 0.1.
\item \textbf{ST-HomogPoisson:} The intensity is assumed to be constant over space and time. This is used as a baseline against ST-BNHP.
\item \textbf{ST-NHP:} is the NHP augmented with the Gaussian spatial conditional density defined in \eqref{eqn:Gaussian}.
\end{itemize}
\paragraph{Implementation Details}
Herein, we present training details for all our experiments. We split our dataset into training, validation and test set as 70-10-20. The split is made across all sequences. Therefore, the first 70\%, next 10\% and last 20\% of the events in each sequence are used for training, validation and testing respectively. The best hyperparameters are selected using the validation set. We consider a recurrent neural network with one layer and 64 units and 5-layer feed-forward neural network with 16 units in each layer. Recurrent Neural Network is associated with a dropout at input level as well as recurrent layer level. Along with that, there is a dropout associated with feedforward neural network to represent cumulative hazard function. Also, we use \textit{Tanh} activation function. We use Adam optimizer with learning rate, $\beta_1$ and $\beta_2$ as 0.0001, 0.90 and 0.99 along with L2 regularization. We have used 50 different architectures using Monte Carlo Dropout. The results are reported after averaging the results after running the model three times. We perform 1-step lookahead prediction where we use actual time of occurrence of events as past events for the historical information to predict future event. We have perfomed all the experiments on Intel(R) Xeon(R) Silver 4208 CPU @ 2.10GHz, GeForce RTX 2080 Ti GPU and 128 GB RAM. We have implemented our code in Tensorflow 1.5.0 \cite{tensorflow2015-whitepaper}.
\subsection{Results}
We perform evaluation of the proposed methodology across quantitative and qualitative dimensions. We compare our results with the baselines and are reported in Table~\ref{Tab:experiments}. We can observe that the proposed methodology is performing well in terms of time of prediction of event as well as uncertainty estimation for the event. The proposed method BNHP achieves significantly better MNLL and MAE as compared to NHP, SHP and ensemble of Hawkes Process for all the datasets. A better generalization performance can be attributed to the ensemble of NHP architectures obtained through dropout at test time. In addition to improved predictive performance, our approach also provides better uncertainty estimates. We quantify the uncertainty interval on the basis of how well the predicted intervals capture the actual occurrence of events. We report \textit{PIC@k} in Table~\ref{Tab:experiments} for different values of k ($k=\{1,2,3\}$) in computing the upper bound and lower bound of the prediction interval(Refer \eqref{eq:bound}). SHP and NHP provide very small interval lengths and the actual points will not lie in this small interval, hence their PIC values are close to $0$. So, we compare the PIC of the proposed approach with an ensemble of Hawkes Processes. We can observe that we predict better PIC values compared to EH. We augment the proposed model to spatio-temporal event modeling as well where we predict uncertainty associated with time and location of the event. We report the results in Table \ref{Tab:st-experiments}. The proposed extension (ST-BNHP) performs better than both the baselines for both the datasets in terms of MNLL and MAE. We can observe that \textit{PIC@1} values are also better for predicted time and location (in terms of latitude and longitude) of occurrence of an event. One could argue that too wide intervals may yield higher \textit{PIC}, but such intervals may be of no use. However, if the predicted intervals are too high, the algorithm will output higher MNLL score (or smaller log-likelihood). On the contrary, if the interval length is too small, then the number of events captured within the predicted interval will also be less, hence yielding a low PIC. Ideally, the length of the uncertainty interval should be large enough to capture points well and small enough to yield low MNLL. We observe that the proposed BNHP model gives lowest MNLL and highest PIC. Also, MAE scores are also better for the real-world datasets. Our method achieves significantly better results in terms of MNLL, MAE and PIC both on synthetic and real world data sets, establishing it as an effective technique for spatio-temporal modelling.
\subsection{Analysis}
\begin{figure}[t]
\centering
\subfloat[Sim-Poisson Dataset] {\includegraphics[scale=0.28]{quantile_synthetic_homog.png} \label{fig:quantile_sim}} \quad
\subfloat[Crime Dataset]{\includegraphics[scale=0.28]{quantile_crime.png} \label{fig:quantile_crime}}
\caption{Predictive variance against quantiles of absolute deviation. }
\label{fig:quantile_plots}
\vspace{-4mm}
\end{figure}
\begin{table}[t]
\vspace{-2mm}
\centering
\begin{tabular}{c|c|c|c|c}
\hline
\textbf{Dataset} & Sim-Poisson & Sim-Hawkes & Music & Crime \\
\hline
\textbf{correlation} & 0.537 & 0.324 & 0.336 & 0.107 \\
\hline
\vspace{-5mm}
\end{tabular}
\caption{Spearman Coefficient between MAE and PIL (positive value indicates positive correlation) }
\label{Tab:correlation}
\end{table}
\paragraph{Relevance of Predictive Uncertainty}
Evaluating uncertainty for an event data is a difficult task. We expect a model to be more confident for correct predictions and should exhibit smaller uncertainty. Consequently, it should assign lower PIL for correct predictions and vice-versa. To acknowledge this behavior, we plot Quantile Plots of absolute deviation against the average variance predicted by the model. For this, we consider quantile $q$ of the absolute deviation (AD) of predicted time and actual time $| \hat{t}_i - t_i |$. Then we average prediction interval length (Avg-PIL), of all the events with absolute deviation less than the quantile value.
\[
\text{Avg-PIL} = \{ \text{Average}(2*\sigma_i) | \quad \forall |t_i - \hat{t}_i| <= \text{q-th quantile}\}
\]
We can observe the quantile plots of averaged predictive variance against the absolute deviation of the predicted time for simulated Poisson and Crime dataset in the Figure \ref{fig:quantile_plots}. An increasing line suggests that as absolute deviation increases, predictive uncertainty also increases, hence supporting our hypotheses.
We also validate our hypothesis using correlation between predictive variance and AD. We calculate Spearman coefficient between AD and PIL for all the datasets and report in Table~\ref{Tab:correlation}. Here, we can observe that the Spearman coefficient is positive for all datasets, supporting our hypothesis.
\begin{figure}[t]
\centering
\caption{Correlation between MAE and PIL}
\label{fig:mae_corr2}
\subfloat[PIL] {\includegraphics[scale=0.24]{exp_predict2bb_mu_hpmc_timestamp_timediff_ogatta_1stddev_var11_TEST_18_batchsize3SMALL_seq_uncertainty.png} \label{fig:corr2_uncertainty}} \quad
\subfloat[MAE]{\includegraphics[scale=0.24]{exp_predict2bb_mu_hpmc_timestamp_timediff_ogatta_1stddev_var11_TEST_18_batchsize3SMALL_seq_mae.png} \label{fig:corr2_mae}}
\end{figure}
Also, Figure \ref{fig:mae_corr2} displays averaged AD and PIC for a batch of three for a sequence of events corresponding to a user of \textit{Music} dataset. Here also, it is evident that the correlation between AD and prediction interval length.
\paragraph{Sensitivity Analysis}
We also perform sensitivity analysis on crime dataset for different dropouts. The results are reported in Table~\ref{Tab:sensitivitydropout}. We observe that smaller values of dropout probabilities will not change the results much. Though we can obtain a very high PIC value of 0.999 with a drop probability of $0.8$, this is not the best setting due to very high MAE. So, the algorithm is producing wider intervals to cover many events, however the MAE is increasing. On the contrary, dropout 0.1 is producing low MAE, however PIC is also low. So, actual event coverage will be low for such a model.
\paragraph{Spatial Analysis}
The proposed approach outputs spatial uncertainty in terms of lower and upper bound on latitude and longitude. To analyze spatial uncertainty in the units of distance, we calculate the distance between the predicted latitude-longitude bounds (PIL) for locations associated with a user from the Foursquare dataset and plot in Figure \ref{fig:spatial_taxi_density}. Also, Table \ref{Tab:corr_spatial} lists the correlation between predictive variance and absolute deviation (AD) for predicted time, latitude and longitude. The positive correlation coefficient indicates that predictive uncertainty increases with increase in AD.
\begin{figure}
\centering
\includegraphics[scale=0.20]{spatialplot_4sq_user2.png}
\caption{Plots for locations from Foursquare with color coding showing distance between predicted lower and upper bound(in km)}
\label{fig:spatial_taxi_density}
\vspace{-4mm}
\end{figure}
\section{Conclusion}
We propose \textit{Bayesian Neural Hawkes Process} for predicting event occurrence times and modelling uncertainty. BNHP combines the advantages of NHP and Bayesian learning, resulting in improved predictive performance and uncertainty modelling capability. The proposed model uses a practical approach based on MC Dropout and extends it for the NHP model. We further develop BNHP for modelling spatio-temporal data. Our experiments on simulated and real datasets demonstrate the efficacy of the proposed approach.
\vspace{5mm}
\begin{minipage}[t]{\textwidth}
\hspace{1cm} \begin{minipage}[b]{0.40\textwidth}
\begin{tabular}[t]{|c|c|c|}
\hline
\textbf{Dropout} & \textbf{MAE} & \textbf{PIC} \\ \hline
0.01 & 0.201 & 0.294 \\ \hline
0.1 & 0.193 & 0.227 \\ \hline
0.6 & 0.203 & 0.737 \\ \hline
0.8 & 5.57 & 0.999 \\ \hline
\end{tabular}
\captionof{table}{Sensitivity Analysis for \\different dropouts for Crime dataset}
\label{Tab:sensitivitydropout}
\end{minipage}
\begin{minipage}[b]{0.40\textwidth}
\centering
\begin{tabular}[t]{|c|c|c|}
\hline
& \textbf{Foursq} & \textbf{Taxi} \\
\hline
Time & 0.91 & 0.75 \\
\hline
Lat & 0.17 & 0.01 \\
\hline
Long & 0.18 & 0.01 \\
\hline
\end{tabular}
\captionof{table}{Correlation between MAE and PIL for spatial coordinates. }
\label{Tab:corr_spatial}
\end{minipage}
\end{minipage}
\nocite{tick}
\bibliographystyle{named}
\section{Introduction}
Many dynamic systems are characterized by sequences of discrete events in continuous time. Such sequence indicates the occurrence of events by considering the time of occurrence of event along with some event attributes.
This temporal data is generated from various application domains such as earthquakes, robbery cases, taxi-pickups, financial transaction, patient visit to hospitals etc. Despite these diverse domains, a common question across all the platforms is: Given an observed sequence of events, can we predict the time for the occurrence of the next event. Accurately predicting the occurrence of temporal events can be helpful in a myriad of applications like disaster response \cite{veen2008estimation}, social media analysis \cite{liang2019deep} etc. and such predictions can be helpful in taking decisions by using AI-enabled systems.
Most of these applications involve predicting future events.
However, the neural models used for predicting temporal events make a point estimation of parameters and lacks the required uncertainty modelling capability. This can lead to unreliable confident predictions which can adversely affect decision making in many real-world applications. Therefore, its important to develop models capable of modelling uncertainty in its predictions. Hence, in addition to predicting when the next event is likely to occur, one can also predict \textit{how confident model is for the predicted time}. As humans, we deal with prediction and uncertainties in everyday life for various events. For example, we decide at what time we should leave home to catch a flight and we make an uncertainty estimate about the time at which we will reach airport considering traffic on road based on day and time of the flight. Knowledge about uncertainty helps to stay informed and make proactive and reliable decisions.
For example, uncertainty about patient arrival can help in queue management in hospitals. Similarly, uncertainty estimate for volcanic eruptions and earthquake can help in risk management and make proactive decisions. This will help user to determine what prediction we can rely produced by the event prediction model. So, awareness of uncertainty can help the decision maker to make a strategic judgement. Therefore, we need a model for event time prediction which capable of capturing uncertainty.
A popular tool for modeling event-based data is point process and is defined using an underlying intensity function. A Hawkes process (HP)~\cite{hawkes1971spectra} is a point process with self-triggering property i.e occurrence of previous events trigger occurrences of future events.
A parametric form of the Hawkes process assumes monotonically decaying influence over past events, which may limit the expressive ability of the model and can deteriorate the predictive performance. Therefore, the intensity function can be modelled using a neural network~\cite{mei2016neural,du2016recurrent,xiao2017modeling,omi2019fully} so that the influence of past events can be modeled in a non-parametric manner without assuming a particular functional form that can induce bias.
However, neural network based models tend to yield overconfident predictions and are incapable of quantifying predictive uncertainty~\cite{gal2016uncertainty}. However, proper uncertainty quantification is essential for many practical applications. This can be achieved by combining bayesian principles with neural networks, leading to Bayesian neural networks (BNN)~\cite{neal2012bayesian}.
Bayesian neural networks (BNNs)~\cite{neal2012bayesian,gal2016uncertainty} are widely used framework to find uncertainty estimates for deep models. Bayesian neural network puts a distribution over the weight parameters and computes a posterior over them using Bayes theorem.
Predictions are made using Bayesian model averaging using this posterior distribution which help in modelling uncertainty. However, determination of posterior is fraught with practical difficulties, hence purely bayesian approach is unattractive. Monte Carlo Dropout proposed by~\cite{gal2016dropout,gal2016theoretically} proved that dropout regularization can act as an approximation for the Bayesian inference over the weights of the neural network.
In this paper, we propose \textit{Bayesian Neural Hawkes Process (BNHP)} in which we combine neural Hawkes process with Monte Carlo dropout for modelling uncertainty in predicting the event-times. Our contribution can be summarized as:
\vspace{-\topsep}
\begin{itemize}[noitemsep]
\item We propose a novel model which combine the advantages of neural Hawkes process and Bayesian neural network for modelling uncertainty over time of occurrence of events. We also extend the proposed approach to spatio-temporal event modeling set-up.
\item Our method is simpler to implement and easy-to-deploy which will have considerable practical significance.
\item We demonstrate the usefulness of modelling uncertainty for event modeling through experiments on several simulated and real world data.
\end{itemize}
\vspace{-\topsep}
\section{Related Work}
\textbf{Hawkes process:} Hawkes process~\cite{hawkes1971spectra} is a point process \cite{valkeila2008introduction,yan2019recent} with self-triggering property i.e occurrence of previous events trigger occurrences of future events.
However, parametric models may not be capable of capturing event dynamics in some cases.
To avoid this, various research works have proposed~\cite{du2016recurrent,mei2016neural,xiao2017modeling,omi2019fully,zuo2020transformer} where intensity function is learnt using neural network, which are better at learning arbitrary and unknown distributions.
Existing literature has introduced recent works along the direction of spatio-temporal Hawkes process as well. \cite{du2016recurrent} has considered spatial attributes by discretizing space and considering them as marks. However, this approach is unable to model spatio-temporal intensity function. \cite{okawa2019deep,ilhan2020modeling} has proposed spatio-temporal intensity as mixture of kernels where mixture weights are learnt using neural network.
\cite{chen2020neural} has proposed Neural ODE for modeling spatio-temporal point process. A recent work~\cite{zhou2021neural} has introduced deep spatio-temporal point process where they integrate spatio-temporal point process with deep learning by modeling space-time intensity function as mixture of kernels where intensity is inferred using variational inference.
\textbf{Bayesian Neural Networks:} Bayesian Neural Networks (BNNs) \cite{neal2012bayesian,gal2016uncertainty} are widely used framework to find uncertainty estimates for deep models. However, one has to resort to approximate inference techniques~\cite{graves2011practical,neal2012bayesian} due to intractable posterior in BNNs. An alternative solution is to
incorporate uncertainty directly into the loss function and directly optimize neural networks by backpropagation~\cite{lakshminarayanan2016simple,pearce2018high}. Monte Carlo Dropout proposed by~\cite{gal2016dropout,gal2016theoretically} proved that dropout regularization~\cite{srivastava2014dropout} can act as approximation for the Bayesian inference over the weights of the neural network.
There are some other efforts in the literature related to uncertainty estimation for Hawkes process. There are few works~\cite{zhang2020variational,zhang2018efficient,zhou2019efficient,wang2020uncertainty} where authors have proposed bayesian parameteric hawkes process models where they find uncertainty over the parameters of hawkes process. However, our work proposes bayesian neural hawkes process to model the time of occurence of events along with the epistemic uncertainty. A related work for event modeling is~\cite{chapfuwa2020calibration} where authors have proposed an adversarial non-parametric model that accounts for calibration and uncertainty for time to event and uncertainty prediction.
Another work \cite{wu2021uncertainty} has introduced a model for uncertainty in Accelerated Failure Time (AFT) \cite{prentice1978linear} models using combination of recurrent neural network and sparse Gaussian process. However, neural point processes are widely adopted model for event modeling due to its theoretical and practical effectiveness in various applications. Therefore, the goal of this paper is to augment the capabilities of neural point process to predict future events with the uncertainty estimation capability. To achieve this, we propose a novel approach which combines neural point process and Monte Carlo dropout for performing time prediction along with uncertainty estimation.
\section{Bayesian Neural Hawkes Process}
We consider the input sequence $S = \{t_i\}_{i=1}^N$ in the observation interval $[0, T]$ and inter-event time interval as $\tau_i = t_i - t_{i-1}$.
Our goal is to predict the time of occurrence of next events along with uncertainty estimate over the predicted time.
We consider a state-of-the-art Neural Hawkes process~\cite{omi2019fully}, which consider a combination of recurrent neural network and feed-forward neural network to model the likelihood associated with the sequence of events $\{t_i\}_{i=1}^N$ and predict the future events. We develop Bayesian Neural Hawkes process based on variants of this architecture, though our approach is applicable to any Neural Hawkes process architecture.
\subsection{Neural Hawkes Process}
\label{Section:NHP}
A major characteristic of the Hawkes process~\cite{hawkes1971spectra} is the conditional intensity function which conditions the next event occurrence based on the history of events. Following recent advances in Hawkes process~\cite{du2016recurrent,omi2019fully}, Neural Hawkes process were proposed which model the intensity function as a nonlinear function of history using a neural network. In particular \cite{omi2019fully} uses a combination of recurrent neural network and feedforward neural network to model the intensity function. This would allow the intensity function to take any functional form depending on the data and help in better generalization performance.
We represent history by using hidden representation generated by recurrent neural networks (RNNs) \cite{hochreiter1997long} at each time step. This hidden representation $\boldsymbol{h}_i$ at time $t_i$ is obtained as:
\setlength{\abovedisplayskip}{1pt}
\setlength{\belowdisplayskip}{1pt}
\setlength{\abovedisplayshortskip}{1pt}
\setlength{\belowdisplayshortskip}{1pt}
\begin{equation}
\boldsymbol{h}_i = RNN(\tau_i, \boldsymbol{h}_{i-1}; W_r ) = \sigma(\tau_i V_r + \boldsymbol{h}_{i-1} U_r + b_r)
\label{eq:rnn}
\end{equation}
where $W_r$ represents the parameters associated with RNN such as input weight matrix $V^r$, recurrent weight matrix $U_r$, and and bias $b_r$.
This hidden representation $\boldsymbol{h}_i$ is obtained by repeated application of the RNN block on a sequence formed from $M$ consecutive inter-arrival times $\tau_{i-(M-1)}, \ldots, \tau_{i-1},\tau_{i}$.
This is used as input to a feedforward neural network to compute the intensity function (hazard function) and consequently the cumulative hazard function for computing the likelihood of occurrence of events.
In the proposed model, we consider the following input to the feed-forward neural network \Romannum{1}) the hidden representation generated from recurrent neural network, \Romannum{2}) time of occurrence of the event and \Romannum{3}) elapsed time from the most recent event. To better capture the uncertainty in predicting points in future time, we considered the additional input which is the time at which the intensity function needs to be evaluated.
We model the conditional intensity as a function of the elapsed time from the most recent event, and is represented as $\lambda(t-t_i|\boldsymbol{h}_i, t)$,
where $\lambda(\cdot)$ is a non-negative function referred to as hazard function.
Therefore, we model cumulative hazard function in terms of inter-event interval $\tau = t - t_{i}$ as $\Phi(\tau|\boldsymbol{h}_i, t) = \int_{0}^{\tau}\lambda(s|\boldsymbol{h}_i, t)ds$.
Cumulative hazard function is modeled using a feed-forward neural network
\begin{equation}
\Phi(\tau|\boldsymbol{h}_i, t ) = FNN(\tau, h_i, t; W_t)
\end{equation}
where FNN($\cdot$) represents a feed-forward neural network. However, we need to fulfill two properties of cumulative hazard function. Firstly, cumulative hazard function has to be monotonically increasing function of $\tau$. We achieve this by maintaining positive weights in the neural network \cite{chilinski2020neural,omi2019fully}. Secondly, cumulative hazard function is positive valued, which is achieved by using positive activation function. The hazard function itself can be then obtained by differentiating the cumulative hazard function with respect to $\tau$ as $
\lambda(\tau|\boldsymbol{h}_i, t) = \frac{\partial}{\partial \tau}\Phi(\tau|\boldsymbol{h}_i, t)$
The log-likelihood function is reformulated as follows using the cumulative hazard function:
\begin{equation}
\begin{split}
\label{eq:log_lik_nhp}
\log p(\{t_i\}_{i=1}^N ; W) = \sum_{i=1}^N \log p(t_i|\mathcal{H}_i;W) = \\ \sum_{i=1}^N \big( \log (\frac{ \partial}{\partial \tau} \Phi(\tau_i |\boldsymbol{h}_{i-1}, t_{i}; W) )
- \Phi(\tau_i|\boldsymbol{h}_{i-1}, t_{i}; W) \big) \end{split}
\end{equation}
where $\tau_i = t_{i}-t_{i-1}$ and $W = \{W_r, W_t\}$ represents the combined weights associated with RNN and FNN weights. In neural HP, the weights of the networks are learnt by maximizing the likelihood given by the Equation~(\ref{eq:log_lik_nhp}). The gradient of the log-likelihood function is calculated using backpropagation.
\begin{figure}
\centering
\includegraphics[scale=0.15]{BNHP_Arxiv.png}
\caption{Framework for the proposed approach. Input: Time of occurrence associated with sequence of events. Output: time of occurrence of future events along with the uncertainty estimate.}
\label{fig:framework_uncertainty}
\end{figure}
\subsection{Monte Carlo Dropout for Neural Hawkes Process}
\label{sect:bnhp}
In this section, we discuss our proposed framework \textit{Bayesian Neural Hawkes Process (BNHP)} (shown in Figure \ref{fig:framework_uncertainty}), for estimating uncertainty over time of occurrence of the discrete events.
We suggest a simple methodology with two basic components - \Romannum{1}) Neural Hawkes process which models the asynchronous event occurrence \Romannum{2}) quantification of uncertainty by leveraging Monte Carlo (MC) Dropout. We will explain how to combine
these two components in the proposed architecture to predict time and uncertainty interval over the predicted time for the future events. We develop MC Dropout for a neural Hawkes process model which consists of two kinds of networks - RNN processing the input sequence and FNN producing the cumulative hazard function.
We follow a Bayesian modeling approach, where we treat the weight matrices as random variables and put a prior distribution such as a standard Gaussian over them, i.e. $p(W) = \mathcal{N}(W;0,I)$.
A Bayesian model will learn a posterior distribution over the parameters, instead of point estimates which allows them to capture uncertainty in the model.
The likelihood of observing the event times given the weight parameters is defined by \eqref{eq:log_lik_nhp}.
We find the posterior distribution over the parameters $p(W | \{t_i\}_{i=1}^N )$ given the observed sequence of events using the Bayes Theorem
\begin{equation}
\begin{aligned}
p(W \mid \{t_i\}_{i=1}^N )=\frac{p(\{t_i\}_{i=1}^N \mid W ) p(W)}{p(\{t_i\}_{i=1}^N)}
\end{aligned}
\end{equation}
However, the posterior computation is intractable due to non-linear functions modelled using neural networks. Hence, we find an approximation $q(W)$ to the posterior $p(W | \{t_i\}_{i=1}^N)$ using variational inference~\cite{blei17}. The parameters of the approximate posterior $q(W)$ can be obtained by minimizing the following variational lower bound (ELBO).
\begin{eqnarray}
L_{VI}(W)
= - \sum_{i=1}^N \int q(W)\, \log p(t_i|\mathcal{H}_i;W) \,dW + \nonumber \\ KL(q((W) \parallel p((W))
\label{eqn:elbo}
\end{eqnarray}
Monte-Carlo (MC) dropout~\cite{gal2016dropout} assumes a particular form for the variational approximation which makes the ELBO computation equivalent to training the neural networks with dropout regularization.
It has been shown that using variational inference with this specific form for the variational approximation is equivalent to applying dropout during training and testing~\cite{gal2016dropout}.
A challenge with neural Hawkes process in applying MC dropout is that, we have two kinds of neural networks with two types of weight parameters: $W_t$ associated with the FNN and $W_r$ associated with the RNN. Consequently, we use different variational approximations over each of the parameter types and thus different dropout regularizations as described below. We assume the variational distribution $q(W)$ can be decomposed as product of the variational distributions $q(W_t)$ and $q(W_r)$. We assume the following form for the variational distribution $q(W_t) = \prod_{l=1}^L q(W_t^l)$, where a sample of $\hat{W}_t^l$ (FNN weight parameters associated with layer $l$ ) is obtained from $q(W_t^l)$ as
\begin{eqnarray}
\label{eq:vardistr}
\hat{W}_t^l \sim \bar{W}_t^l \cdot diag([\mathbf{z}^l]) \quad \, \quad \mathbf{z}^l \sim Bernoulli(p)
\end{eqnarray}
where $p$ is the drop probability and $\bar{W}_t^l$ are variational parameters (also weight matrix) to be estimated from the ELBO. Due to binary valued $\mathbf{z}^l$, $\hat{W}^l$ sampled from $q(W^l)$ will have some of the columns of the weight matrix set to zero aiding in dropout regularization.
For the weights in the RNN $W_r$, we use a variant of the MC-Dropout to perform learning and inference. First we assume the variational distribution $q(W_r)$ to factorize over the weight matrices $V^r$ (input weight matrix), $U_r$ (recurrent weight matrix ), and bias $b_r$, i.e. $q(W_r) = q(V_r)q(U_r)q(b_r)$. For each of these weight matrices we assume the variational distribution to factorize over the rows, for e.g $q(V_r) = \prod_{k=1}^K q(V_{rk})$. Each row in the weight matrix follows an approximate distribution :
\begin{equation}
q(V_{rk}) = p \mathcal{N}(V_{rk};0,\sigma_r^2 I) + (1-p) \mathcal{N}(V_{rk};\bar{V}_{rk}, \sigma_r^2 I)
\label{eqn:rnnvar}
\end{equation}
where $p$ is the drop probability, $\bar{V}_{rk}$ is the weight vector (also variational parameters) and $\sigma_r^2$ is the variance. The distribution \eqref{eqn:rnnvar} is similar to the sampling process in \eqref{eq:vardistr} when the variance is small. We sample the weight matrices $\hat{W}_r = \{ \hat{V}_r, \hat{U}_r, \hat{b}_r\}$ associated with RNN from the variational distribution defined by \eqref{eqn:rnnvar}. This results in the masking of random rows of the weight matrices. In the case of RNN, the same masked weight matrices are used for processing all the elements in the input sequence~\cite{gal2016theoretically}. But, different sequences may use different masked weight matrices.
For obtaining the distribution over the inter-arrival time $\tau_i$, we consider the previous $M$ inter-arrival times $\tau_{i-M}, \ldots, \tau_{i-1}$, feed it through an RNN with sampled weight matrices $\hat{W}_{ri}$ to obtain hidden representation $\mathbf{h}_{i-1}$. This is then fed through FNN along with other inputs and sampled weight matrix $\hat{W}_{ti}$ to obtain the cumulative hazard function $\Phi(\tau_i|\boldsymbol{h}_{i-1}, t_i, \hat{W}_i)$. Consequently, the variational lower bound in \eqref{eqn:elbo} can be written as
\begin{eqnarray}
L_{VI}(\bar{W})
= - \sum_{i=1}^N \log p(t_i|\mathcal{H}_i;\hat{W}_i) + \lambda \parallel \bar{W} \parallel^{2}
\label{eqn:elbodrop}
\end{eqnarray}
where $\bar{W} = \{\bar{W}_t, \bar{V}_r, \bar{U}_r, \bar{b}_r\}$ represents all the weight matrices (variational parameters) that needs to be learnt by minimizing the objective function \eqref{eqn:elbodrop}. We can observe that this is equivalent to learning weight parameters in a neural Hawkes process by minimizing the negative log-likelihood \eqref{eq:log_lik_nhp}, but with dropout regularization and $\ell_2$ norm regularization (obtained by simplifying the KL term) over the weight matrices.
For prediction, Bayesian models make use of the full posterior distribution over parameters rather than a point estimate of the parameters. This allows them to make robust predictions and model uncertainty over the predictions. After learning the variational parameters $\bar{W}$, we use the approximate posterior $q(W)$ to make predictions. The probability of predicting the time of next event given the history of previous event times with last event at $t_N$ is computed as
\begin{equation}
\begin{split}
p(t_*|\mathcal{H}) = \int p(t_*|\mathcal{H};W) q(W) dW = \frac{1}{S} \sum_{s=1}^S p(t_*|\mathcal{H};\hat{W}_s) \\
= \frac{1}{S} \sum_{s=1}^S \frac{ \partial}{\partial \tau_*} \Phi(\tau_* |\boldsymbol{h}_N, t_*; \hat{W}_s) \exp\{ - \Phi(\tau_* |\boldsymbol{h}_N, t_*; \hat{W}_s \}
\end{split}
\end{equation}
where we approximated the integral with a Monte-Carlo approximation~\cite{neal2012bayesian} with $S$ samples from $q(W)$ ($\hat{W}_s \sim q(W) $) and $\tau_* = t_* - t_N$. We can observe that sampling from $q(W)$ leads to performing dropout at the test time and the final prediction is obtained by averaging the prediction over multiple dropout architectures. Here, uncertainty in the weights induces model uncertainty for event time prediction. Monte-carlo dropout on neural Hawkes process provides a feasible and practical technique to model uncertainty in event prediction.
\subsection{Prediction and Uncertainty Estimation}
\label{sec:pred_uncertainty}
For prediction, Monte Carlo dropout is equivalent to performing $M$ forward passes through the network with stochastic dropouts at each layer but considering the specific nature of the network (recurrent or feedforward). The dropouts produce randomly sampled network weights (network architecture) which can be interpreted as Monte Carlo samples from the posterior distribution. Final prediction is done by taking an average prediction from these networks.
For each network, we use bisection method~\cite{omi2019fully} to predict the time of next event. Bisection method provides the median $t_*$ of the predictive distribution over next event time using the relation $\Phi(t_*-t_N|\boldsymbol{h}_N, t_*; \hat{W})=\log(2)$. We obtain $S$ median event times, with each median event time $t_*_s$ obtained using a network with sampled weight $\hat{W}_s$. The mean event time is then found by averaging these $S$ times obtained from different sampled weights, $t_* = \frac{1}{S} \sum_{s=1}^S t_*_s$
The variance of predicted time is obtained as $Var(t_*) = {\sigma_*}^2 = \frac{1}{S} \sum_{s=1}^S (t_*_s - t_*)^2$
We also define lower and upper bound of predicted time as
\begin{equation}\label{eq:bound}
{t}_{*}^L = {t}_* - k\sigma_* ; \quad
{t}_{*}^U = {t}_* + k\sigma_*
\end{equation}
We have explained the proposed approach in the Algorithm \ref{alg:algorithm2} in Appendix.
\subsection{Bayesian Neural Hawkes Process for Spatio-Temporal Modeling }
We extend the Bayesian Neural Hawkes Process developed for modeling uncertainty over time to modeling uncertainty over space. There are many applications involving spatio-temporal data such as traffic flow prediction, human mobility prediction etc. In many of these applications, its useful to obtain uncertainty over spatial points apart from the temporal uncertainty.
Following Daley and Vere-Jones \cite{valkeila2008introduction}, we model conditional intensity function for modelling the spatio-temporal data as $\lambda(t,x) = \lambda(t) p(\mathbf{x} | t)$.
Here $\mathbf{x} \in \mathcal{R}^D$ represents a point in the $D$ dimensional space, $\lambda(t)$ is the intensity of temporal process and $p( \mathbf{x}| t)$ is the conditional spatial density of location $\mathbf{x}$ at t given $H_t$.
Since many mobility patterns involve movement in close-by regions, we model the conditional spatial density $p(\mathbf{x}_i|t_i)$ as a Gaussian conditioned on the history, i.e. all the past events times and locations ($(t_{i-}, \mathbf{x}_{i-})$). Thus,
\begin{equation}
\begin{split}
p(\mathbf{x}_i | t_{i-}, \mathbf{x}_{i-}) &= \mathcal{N}(\mathbf{x}_i ; \mu(t_{i-}, \mathbf{x}_{i-}),
\sigma(t_{i-}, \mathbf{x}_{i-}))
\end{split}
\end{equation}
In the proposed model, we consider parameters of the Gaussian $\mu(\cdot)$ and $\sigma(\cdot)$ as functions of past event times and locations and are modeled using a feed-forward neural network.
\[
[\mu(t_{i-}, \mathbf{x}_{i-}), \sigma(t_{i-}, \mathbf{x}_{i-}) ]= FNN(\boldsymbol{h}_i, \mathbf{x}_{i-};W_l)
\]
where $\boldsymbol{h}_i$ is the hidden representation obtained from the RNN model with the sequence of the past event times as input.
The log likelihood for the spatio-temporal neural Hawkes model can be written as
\begin{equation}
\label{eq:log-likelihood-spatial}
\begin{split}
& \sum_{i=1}^N \big( \log \left\{ \frac{ \partial}{\partial \tau} \Phi(\tau_i |\boldsymbol{h}_{i-1}, t_{i}; W ) \right\} -
\Phi(\tau_i|\boldsymbol{h}_{i-1}, t_{i}; W) \\ & + \log p(x_i| t_{i-}, x_{i-}; W_l) \big) \end{split}
\end{equation}
To obtain spatio-temporal Bayesian neural Hawkes model, we consider a distribution over $W_l$ and follow a similar approach as in Section \ref{sect:bnhp}, where a variational distribution $q(W_l)$ over $W_l$ is defined as in \eqref{eq:vardistr}. The resulting variational lower bound considers the spatial likelihood and can be written as
\begin{equation}
\label{eq:log-likelihood-spatial-montecarlo}
\begin{split}
& - \sum_{i=1}^N \big( \log \left\{ \frac{ \partial}{\partial \tau} \Phi(\tau_i |\boldsymbol{h}_{i-1}, t_{i}; \hat{W}_i ) \right\} -
\Phi(\tau_i|\boldsymbol{h}_{i-1}, t_{i}; \hat{W}_i) \\
& + \log p(x_i| t_{i-}, x_{i-}; \hat{W}_{li}) \big) + \lambda (\parallel \bar{W} \parallel^{2} + \parallel \bar{W}_l \parallel^{2} ) \end{split}
\end{equation}
where $\hat{W}_{li} \sim q(W_l)$. The variational parameters (weight matrices) are learnt by minimizing the lower bound \eqref{eq:log-likelihood-spatial-montecarlo} and is equivalent to learning with dropout regularization. Prediction is done as discussed in Section \ref{sect:bnhp}, where one considers multiple dropout architectures (corresponding to different samples of weight matrices), and taking an average over them. For each dropout architecture, we predict the time of occurrence of the next event using the Bisection method and the location of of the next event by sampling from the conditional Gaussian $\mathcal{N}(\mathbf{x}_* ; \mu(t_{N-}, \mathbf{x}_{N-}),
\sigma(t_{N-}, \mathbf{x}_{N-}))$.
We have explained the proposed approach in the Algorithm \ref{alg:algorithm2} in Appendix.
\section{Experiments and Results}
\paragraph{Dataset Details}
We extensively perform experiments on six datasets including two synthetic and four real-world datasets.
\textbf{1)} \textbf{Simulated Poisson (Sim-Poisson):} We simulate a homogenous poisson process with conditional intensity $\lambda$ = 1.
\textbf{2)} \textbf{Simulated Hawkes (Sim-Hawkes):} We use Hawkes process, in which kernel function is given by sum of multiple exponential functions. The conditional intensity function is given by $\lambda(t) = \mu + \sum_{t_i < t} \sum_{j=1}^2 \alpha_j \beta_j \exp{(- \beta_j(t - t_i))}$. We have used $\mu = 0.05 $, $\alpha_1 = 0.4$, $\alpha_2 = 0.4$, $\beta_1 = 1.0$, $\beta_1 = 20.0$.
\textbf{3)} \textbf{Crime:} This dataset contains the records of the police department calls for service in San Francisco~\footnote{\url{https://catalog.data.gov/dataset/police-calls-for-service}}. Each record contains the crime and timestamp associated with the call along with other information.
\textbf{4)} \textbf{Music:} This dataset contains the history of music listening of users at \textit{lastfm}~\footnote{\url{https://www.dtic.upf.edu/~ocelma/MusicRecommendationDataset/lastfm-1K.html}}.
\textbf{5)} \textbf{New York Taxi:} The dataset contains trip records for taxis in New York City. Each pick-up record is considered as an event.
\textbf{6)} \textbf{Foursquare:} This is a location-based social network which contains information about check-ins of user.
\paragraph{Implementation Details}
Herein, we present training details for all our experiments. We split our dataset into training, validation and test set as 70-10-20. The split is made across all sequences. Therefore, the first 70\%, next 10\% and last 20\% of the events in each sequence are used for training, validation and testing respectively. The best hyperparameters are selected using the validation set. We have used 50 different architectures using Monte Carlo Dropout. The results are reported after averaging the results after running the model three times. More architecture details for hyperparameter settings is mentioned in the the supplementary. We perform 1-step lookahead prediction where we use actual time of occurrence of events as past events for the historical information to predict future event. We have perfomed all the experiments on Intel(R) Xeon(R) Silver 4208 CPU @ 2.10GHz, GeForce RTX 2080 Ti GPU and 128 GB RAM. We have implemented our code in Tensorflow 1.5.0 \cite{tensorflow2015-whitepaper}.
\paragraph{Evaluation metrics}
We consider these metrics for evaluation of our results \textbf{1)} \textbf{Mean Negative Log Likelihood (MNLL): } Log-likehood consider the probability of predicting the actual observations, and we expect a good model to have a lower MNLL score.
\textbf{2)} \textbf{Mean Absolute Error for prediction (MAE):} The measure computes purely the error in predicting the time with out considering the probability. A model with low MAE will reflect a better model.
\textbf{3)} \textbf{Prediction Interval Coverage (PIC):} It represents the number of times actual event occurs within the estimated interval. Hence, higher PIC will represent a better model.
\textbf{4)} \textbf{Prediction Interval Length (PIL):} It represents the length of difference between upper bound and lower bound of the predicted interval (Refer \eqref{eq:bound}). We report the mean and variance of interval length ($2*k*\sigma$). We will use this metric for qualitative evaluation of the results. Higher PIL signifies more uncertainty associated with the event.
These evaluation metrics are tweaked for spatio-temporal modeling as well. For example, spatial MNLL represents conditional spatial density. MAE and PIL is calculated separately for latitude and longitude. Moreover, we modulate PIC in spatial manner by considering an actual event to occur within the estimated latitude and longitude bounds.
\paragraph{Baselines}
\textbf{1)} \textbf{FNHP:} We consider~\cite{omi2019fully} as baseline for evaluating the performance of predicted time of occurrence of event.
\textbf{2)} \textbf{SHP:} We consider standard Hawkes Process with exponential kernel as baseline. Standard Hawkes Process models probability distribution over event times $p(\tau | h_i) $, though does not model epistemic uncertainty like FNHP.
\textbf{3)} \textbf{Ensemble Hawkes (EH):} We propose a baseline where we create an ensemble of parametric Hawkes process with exponential kernels using tick~\cite{bacry2017tick} library with different hyperparameters. However, it is very complex to use survival likelihood as loss function for this setup since there is no convergence guarantee as the loss function is not gradient Lipschitz \cite{bompaire2018dual}. Convergence is even difficult to achieve for real-world complex datasets. Therefore, we use least-square loss \cite{xu2018benefits} for training ensemble Hawkes on all the datasets. Due to this MNLL of EH won't be comparable with other methods using survival likelihood, and therefore we use MAE and PIC for the purpose of comparison.
\begin{table*}
\centering
\caption{Comparison of the proposed approach (BNHP) against the baselines (Please note that FNHP is incapable of finding uncertainty, and therefore we have marked PIC with '-' and EH uses least square loss and hence MNLL for EH is not comparable to our results, and therefore MNLL for EH is marked with '*'. ) }
\label{Tab:experiments}
\tabcolsep=0.05cm
\begin{tabular}{c|cccc|cccc|cccc|cccc}
\hline
\begin{tabular}[c]{@{}c@{}}\\\end{tabular} & & \multicolumn{4}{c}{Sim-Poisson} & \multicolumn{4}{c}{Sim-Hawkes} & \multicolumn{4}{c}{Crime} & \multicolumn{3}{c}{Music} \\
\hline
\textbf{Metric} & SHP & FNHP~ & EH & BNHP & SHP & FNHP & EH & BNHP & SHP & FNHP & EH & BNHP & SHP & FNHP & EH & BNHP \\
\hline
\textbf{MNLL} & 1.21 & 1.36 & * & \textbf{0.196} & 1.08 & 1.26 & * & \textbf{0.166} & 1.809 & 1.42 & * & \textbf{0.279} & 1.239 & 0.97 & * & \textbf{-0.322} \\
\textbf{MAE}~ & 0.81 & 0.76 & 0.172 & \textbf{0.078} & 0.382 & 0.83 & 0.234 & \textbf{0.156} & 0.903 & 0.82 & 0.242 & \textbf{0.158} & 0.997 & 0.58 & 0.104 & \textbf{0.060} \\
\textbf{PIC@1} & 0.0 & - & 0.019 & \textbf{0.946} & 0.0 & - & 0.012 & \textbf{0.725} & 0.0 & - & 0.002 & \textbf{0.586} & 0.0 & - & 0.265 & 0.\textbf{836} \\
\textbf{PIC@2} & 0.0 & - & 0.031 & \textbf{0.996} & 0.0 & - & 0.029 & \textbf{0.976} & 0.0 & - & 0.005 & \textbf{0.856} & 0.0 & - & 0.312 & \textbf{0.963} \\
\textbf{PIC@5} & 0.0 & - & 0.061 & \textbf{1.0} & 0.0 & - & 0.058 & \textbf{0.999} & 0.0 & - & 0.015 & \textbf{0.997} & 0.0 & - & 0.458 & \textbf{0.996} \\
\hline
\end{tabular}
\end{table*}
\begin{table*}
\centering
\caption{Comparison of the proposed approach (ST-BNHP) against the baseline for spatio-temporal modeling }
\label{Tab:experiments}
\begin{tabular}{cccccccccc}
\hline
Method & Dataset & MNLL & \begin{tabular}[c]{@{}c@{}}MNLL\\Temporal\end{tabular} & \begin{tabular}[c]{@{}c@{}}MNLL\\Spatial\end{tabular} & \begin{tabular}[c]{@{}c@{}}MAE\\time\end{tabular} & \begin{tabular}[c]{@{}c@{}}MAE\\lat\end{tabular} & \begin{tabular}[c]{@{}c@{}}MAE\\long\end{tabular} & \begin{tabular}[c]{@{}c@{}}PIC\\time\end{tabular} & \begin{tabular}[c]{@{}c@{}}PIC\\spatial\end{tabular} \\
\hline
\multirow{}{}{ST-HomogPoisson} & Foursquare & 8.204 & - & - & 4.229 & 1.23 & 1.824 & 0.026 & 0.025 \\
& Taxi & 13.711 & - & - & 2.472 & 4.386 & 1.527 & 0.041 & 0.056 \\
\hline
\multirow{}{}{ST-BNHP} & Foursquare & 2.817 & 0.477 & 2.340 & 1.122 & 0.754 & 0.760 & 0.877 & 0.649 \\
& Taxi & 2.392 & 0.054 & 2.338 & 0.133 & 0.589 & 0.536 & 0.386 & 0.721 \\
\hline
\end{tabular}
\end{table*}
\subsection{Results and Analysis}
We perform evaluation of the proposed methodology across quantitative and qualitative dimensions. We compare our results with the baselines which are reported in Table~\ref{Tab:experiments}. We can observe that the proposed methodology is performing well in terms of time of prediction of event as well as uncertainty estimation for the event. The proposed method BNHP achieves significantly better MNLL and MAE as compared to FNHP and ensemble of Hawkes Process for all the datasets. A better generalization performance can be attributed to the ensemble of FNHP architectures obtained through dropout at test time. In addition to better predictive performance, our approach also provides better uncertainty estimates. We quantify the uncertainty interval on the basis of how well the predicted intervals capture the actual occurrence of event. We report \textit{PIC@1}, \textit{PIC@2} and \textit{PIC@5} values in Table~\ref{Tab:experiments} where \textit{PIC@k} is calculated using the different values of k in computing the upper bound and lower bound of the prediction interval(Refer \eqref{eq:bound}). SHP and FNHP provides very small interval length and the actual points will not lie in this small interval, hence their PIC values are close to $0$. So, we compare PIC of the proposed approach with an ensemble of Hawkes Process. We can observe that we predict better PIC values compared to EH. One could argue that too wide intervals may yield higher \textit{PIC}, but such intervals may be of no use. However, if the predicted intervals are too high, the algorithm will output higher MNLL score (or smaller log-likelihood). On the contrary, if the interval length is too small, then the number of events captured within the predicted interval will also be less, hence yielding a low PIC. Ideally, the length of uncertainty interval should be large enough to capture points well and small enough to yield low MNLL. We observe that the proposed BNHP model gives lowest MNLL and highest PIC. Also, MAE scores are also better for the two real-world datasets. Our method achieves significantly better results in terms of MNLL, MAE and PIC both on synthetic and real world data sets, establishing as an effective technique for event time prediction and uncertainty quantification.
\section{Analysis}
In this section, we will attempt to analyse various aspects of uncertainty of time of occurrence of events and answer the following questions with our experimental analysis -
\begin{itemize}
\item How to understand relevance of predictive uncertainty?
\item How does intensity and uncertainty over intensity behaves at different instants of event occurrence?
\item How does evaluation metric changes with different dropouts?
\item How can we analyze spatial uncertainty?
\end{itemize}
\begin{figure}[h]
\centering
\caption{Averaged Absolute Deviation against quantiles of predictive variance}
\label{fig:quantile_plots}
\subfloat[Sim-Poisson Dataset] {\includegraphics[scale=0.28]{quantile_synthetic_homog.png} \label{fig:quantile_sim}} \quad
\subfloat[Crime Dataset]{\includegraphics[scale=0.28]{quantile_crime.png} \label{fig:quantile_crime}}
\end{figure}
\begin{table}[b]
\centering
\caption{Spearman Coefficient between MAE and PIL (positive value indicates positive correlation) }
\label{Tab:correlation}
\begin{tabular}{|c|c|}
\hline
\textbf{Dataset} & \begin{tabular}[c]{@{}c@{}}\textbf{Spearman }\\\textbf{Correlation}\end{tabular} \\
\hline
\textbf{Sim-Poisson} & 0.537 \\
\hline
\textbf{Sim-Hawkes} & 0.324 \\
\hline
\textbf{Music} & 0.336 \\
\hline
\textbf{Crime} & 0.107 \\
\hline
\end{tabular}
\end{table}
\subsection{Relevance of Predictive Uncertainty}
Evaluating uncertainty for an event data is a difficult task. In such a set-up, intuitively, a model should be more confident for correct predictions. And hence, it should assign higher PIL for incorrect predictions. To acknowledge this behavior, we plot Quantile Plots of absolute deviation against the average variance predicted by the model. For this, we consider quantile $q$ of the absolute deviation (AD) of predicted time and actual time of occurrence of event $| t_i - \hat{t}_i |$. Then we average prediction interval length (Avg-PIL), of all the events with absolute deviation less than the quantiled deviation.
\[
\text{Avg-PIL} = \{ \text{Average}(2*\sigma_i) | \quad \forall |t_i - \hat{t}_i| <= \text{q-th quantile}\}
\]
We can observe the quantile plots of averaged predictive variance against the absolute deviation of the predicted time for simulated Poisson and Crime dataset in the Figure \ref{fig:quantile_plots}. An increasing line suggests that as absolute deviation increases, predictive uncertainty also increases, hence supporting our hypotheses.
We also validate our hypotheses using correlation between predictive variance and Absolute Deviation (AD). We calculate Spearman coefficient between absolute deviation (AD) and prediction interval length (PIL) for all the datasets and report in Table~\ref{Tab:correlation}. Here, we can observe that the Spearman coefficient is positive for all datasets, supporting our hypothesis.
Also, Figure \ref{fig:mae_corr2} displays averaged AD and PIC for a batch of three for a sequence of events corresponding to a user of \textit{Music} dataset. Here also, it is evident that the correlation between AD and prediction interval length. More such qualitative results are presented in the appendix.
\begin{figure}[h]
\centering
\caption{Correlation between MAE and PIL}
\label{fig:mae_corr2}
\subfloat[PIL] {\includegraphics[scale=0.24]{exp_predict2bb_mu_hpmc_timestamp_timediff_ogatta_1stddev_var11_TEST_18_batchsize3SMALL_seq_uncertainty.png} \label{fig:corr2_uncertainty}} \quad
\subfloat[MAE]{\includegraphics[scale=0.24]{exp_predict2bb_mu_hpmc_timestamp_timediff_ogatta_1stddev_var11_TEST_18_batchsize3SMALL_seq_mae.png} \label{fig:corr2_mae}}
\end{figure}
\begin{table}[h]
\centering
\caption{Sensitivity Analysis for different dropouts for Crime dataset}
\label{Tab:sensitivitydropout}
\begin{tabular}{|c|c|c|}
\hline
\textbf{Dropout} & \textbf{MAE} & \textbf{PIC} \\ \hline
0.01 & 0.201 & 0.294 \\ \hline
0.1 & 0.193 & 0.227 \\ \hline
0.6 & 0.203 & 0.737 \\ \hline
0.8 & 5.57 & 0.999 \\ \hline
\end{tabular}
\end{table}
\begin{minipage}[c]{0.5\textwidth}
\centering
\begin{tabular}{|c|c|c|}
\hline
\textbf{Dropout} & \textbf{MAE} & \textbf{PIC} \\ \hline
0.01 & 0.201 & 0.294 \\ \hline
0.1 & 0.193 & 0.227 \\ \hline
0.6 & 0.203 & 0.737 \\ \hline
0.8 & 5.57 & 0.999 \\ \hline
\end{tabular}
\captionof{table}{table no. 1}
\end{minipage}
\begin{minipage}[c]{0.5\textwidth}
\centering
\captionof{table}{table no. 2}
\end{minipage}
\subsection{Sensitivity Analysis}
We also perform sensitivity analysis on crime dataset for different dropouts. The results are reported in Table~\ref{Tab:sensitivitydropout}. We can observe that although it produces PIC of 0.999, however, this may not be the best setting. This is so because the MAE is also high. So, the algorithm is producing wider intervals to cover many events, however the MAE is increasing. On the contrary, dropout 0.1 is producing low MAE, however PIC is also low. So, actual event coverage will be low for such a model. Therefore, we employ multiple evaluation metrics with the aim of reducing the MAE and MNLL along with PIC.
\subsection{Spatial Analysis}
The proposed approach outputs spatial uncertainty in terms of lower and upper bound on latitude and longitude. However, we view space in terms of distance. Therefore, in Figure \ref{fig:spatial_taxi_density}, we calculate the distance using the predicted latitude-longitude bounds in kilometers and plot it in the map. It shows predicted spatial variance for two different users in Foursquare dataset. Table \ref{Tab:corr_spatial} lists the correlation between predictive varaince and absolute deviation (AD) for predicted time, latitude and longitude. The positive correlation coefficient thereby indicates that when absolute deviation increases, predictive uncertainty also increases.
\begin{figure}[h]
\centering
\label{fig:intensity_plots}
\caption{Spatial Plots for Foursquare Dataset representing distance between predicted lower and upper bound (in km)}
\subfloat[] {\includegraphics[scale=0.20]{spatialplot_4sq_user2.png} \label{fig:spatial_user_comparison}} \\
\subfloat[]{\includegraphics[scale=0.20]{spatialplot_4sq_dist_16.png} \label{fig:spatial_taxi_density}}
\end{figure}
\begin{table}
\centering
\caption{Spearman Correlation Coefficient between MAE and PIL for spatial predictions (positive value indicates positive correlation) }
\label{Tab:corr_spatial}
\begin{tabular}{|c|c|c|}
\hline
Dataset & Foursquare & Taxi \\
\hline
Time & 0.907 & 0.749 \\
\hline
Latitude & 0.169 & 0.007 \\
\hline
Longitude & 0.179 & 0.006 \\
\hline
\end{tabular}
\end{table}
\section{Conclusion}
We propose \textit{Bayesian Neural Hawkes Process}, a framework for event time prediction which predicts the time of occurrence of next event as well as can model uncertainty over predictions. Our framework combines the advantages of Neural Hawkes process and Monte Carlo Dropout. Neural Hawkes process is well known for high modeling capabilities of neural hawkes process for unknown distributions of sequence of events. We predict the uncertainty estimate over the predicted time by using Monte Carlo Dropout, which is a widely adopted technique for approximation of Bayesian Neural Networks. Our experiments show the efficacy of the proposed approach on simulated and real datasets.
\nocite{tick}
\bibliographystyle{named}
| {'timestamp': '2022-01-20T02:13:13', 'yymm': '2112', 'arxiv_id': '2112.14474', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14474'} | arxiv |
\section{Introduction}\label{sec:introduction}
Language is not an isolated system. Language is grounded in the physical world and serves to coordinate and achieve common objectives \cite{Lewis1969, clark_1992}. Under this functional perspective, it becomes obvious that language interfaces with many areas of cognition, among others, perception, action and embodiment, and social cognition \cite{bisk_2020}. To understand the origins and evolution of language it is important to take these connections into account. In this paper, we demonstrate how deep learning models of interactive language emergence can be used to study the relationship between language and other areas of cognition, focusing on the interface between language and visual perception.
Deep neural networks (DNNs), even though originally developed for engineering purposes, have been used to study human cognition in various fields.
In terms of language emergence and language evolution, simulations with neural network agents have been used to model, for example, the emergence of color naming systems \cite{chaabouni_2021, kagebaeck}, contact linguistic phenomena \cite{harding_graesser_2019}, the emergence of word learning biases \cite{xenia_2020, portelance2021}, or the emergence of compositional structure \cite{lazaridou_2018b, li_2019, ren_2020}.
In terms of visual perception and representation learning, DNNs have been used to model brain activations in the visual cortex \cite{khaligh-razavi_2014, kriegeskorte_2015, cichy_2016}
and judgments of image similarity \cite{jozwik_2017, peterson_2018}. Our work extends existing research by studying \textit{interactions} between language emergence and visual representation learning in neural network agents.
In human cognition, the influence between language and perception is bidirectional.
Expressions for concrete concepts like colors depend on perception \cite{Regier_2007}. But also abstract concepts can be understood and represented via metaphoric mappings to concrete concepts grounded in sensorimotor experience, for example in reasoning about time as a moving object (``The time will come when ...'', ``Time flies'') \cite{lakoff_1980}. Similarly, the effects of language on perception can be observed for high-level cognitive processes such as recognition as well as low-level processes such as discrimination and detection \cite{lupyan_2020}.
In particular, language affects perceptual processing by imposing categorical structure \cite{winawer_2007, forder_2019}. We aim to analyze such bidirectional influences systematically, by studying the effects of variations in visual representations on emergent communication and vice versa.
More precisely, this paper looks at three questions: (i) how does perceptual bias affect language emergence, (ii) how does exposure to a particular linguistic input influence perceptual representations, and relatedly (iii) could perceptual representations be shaped by an optimization process towards successful communication of environmentally relevant distinctions. We use a conventional language emergence setup with two agents, a sender and a receiver, playing a reference game, based on the signaling game originally developed by Lewis \cite{Lewis1969}. The sender sees a target object and sends a message to the receiver. Using that message, the receiver tries to identify the target among a set of distractor objects.
By choosing this kind of game, we study the emergence and effects of \textit{referential labels}, with denotations as sets of real-world objects. Reference is arguably a core function of language around which more complex functions are organized \cite{jackendoff_1999}.
The agents have a vision module to process input images, and a language module to generate (sender) or interpret (receiver) messages. In line with many existing models \cite{havrylov_2017, rodriguez_2020, lazaridou-etal-2020-multi}, the vision modules are implemented as pretrained convolutional neural networks (CNNs) and the language modules as recurrent neural networks (RNNs). The following three paragraphs enlarge on how this setup is adjusted to address each question.
(i) To study the influence of perception on language, we design agents with different visual biases, such that object representations vary between agents. We fix these biases and combine different agents to quantify differences in the emergent communication protocols.
Given that concept formation in humans depends on perceptual similarity \cite{sloutsky_2003}, our manipulations target the similarity relationships between object representations.
By applying a new method called \textit{relational label smoothing} to the CNN pre-training we modify the class labels, such that the resulting representational similarities between objects vary for different conditions.
Thereby, we can test how language groundedness is influenced by these differences, and how certain perceptual predispositions can benefit communication.
(ii) To study the influence of language on perception, we allow agents to adapt their visual representations (CNN weights) while playing the communication game. We measure how perception adapts to fixed languages in language learning, or to different communication partners in language emergence.
To analyze changes in perception we again rely on similarity relationships between visual representations.
Several studies concerning categorical perception have shown that language affects perceptual similarity \cite{lupyan_2020}.
Moreover, developing a system of similarity relationships along \textit{relevant} perceptual dimensions (e.g., color, shape, magnitude, texture) is a major achievement in child development \cite{smith_1989}. In our case, relevance is determined by the communication game.
Thus, our setup not only allows us to study how language influences perceptual similarity but also how a system of similarity relationships with respect to task-relevant dimensions can evolve via communication.
(iii) Finally, an evolutionary analysis explores whether an agent's perceptual system might be optimized over time to facilitate communication about relevant aspects of the environment.
As in (i), we consider agents with different, fixed perceptual biases. We train an extensive variety of agent combinations on the reference game and derive a payoff matrix for a symmetric population game.
We subject this payoff matrix to a simple analysis in terms of evolutionary stable states (ESSs) \cite{maynard-smith_1974}. Thereby, we can determine whether certain perceptual representations (biases) are more likely to prevail in an adaptation process to the demands of linguistic interaction, which in our case defines the agents' environment. Importantly, ESS-analysis does not entail a commitment to an underlying process of biological evolution. ESSs can also be considered the rest points of other (agent-internal) optimization processes.
The remainder of the paper is structured as follows. Sections \ref{sec:related_work} gives a short overview of related work on language emergence. Section \ref{sec:methods} provides details about the game and agent design, and Section \ref{sec:experiments} about the training and evaluation procedures. Section \ref{sec:results} presents our results for each of the three analyses discussed above. Section \ref{sec:discussion} critically assesses these results and Section \ref{sec:outlook} discusses our approach in the larger context of studying interactions between language and general cognition with deep multi-agent communication games.
\section{Related work}\label{sec:related_work}
Communication games have been used to study the emergence and evolution of language theoretically \cite{crawford_1982}, experimentally \cite{crawford_1998, blume_1998}, and computationally \cite{kirby_2002_overview}.
Artificial intelligence research has also emphasized the importance of learning to communicate through interaction for developing agents that can coordinate with other, possibly human agents in a goal-directed and intelligent way
\cite{mikolov_2016}.
It has been shown that by playing communication games, artificial (robotic) agents can self-organize symbolic systems that are grounded in sensorimotor interactions with the world and other agents \cite{steels-1998, steels_2001, steels_belpaeme_2005, bleys_2009}.
For example, in a case study with color stimuli, simulated agents established color categories and labels by playing a (perceptual) discrimination game, paired with a color reference game \cite{steels_belpaeme_2005}. Bleys et al. extended these findings to robotic agents, demonstrating that successful color naming systems emerge in spite of differences in the agents' perspective \cite{bleys_2009}.
These studies are mainly interested in how a categorical repertoire can become sufficiently shared among the members of a population to allow for successful communication.
Our analyses, in contrast, assume that successful communication will emerge, and focus on how visual representations and language shape each other.
Over the past years, research using communication games to study language emergence in DNN agents has been gaining popularity \cite{lazaridou_2020}.
Some of these models skip any form of perceptual processing by using symbolic input data \cite{bouchacourt_2019, kharitonov_2020, chaabouni_2020}. Even though other models implement a visual processing system and work with image data \cite{lazaridou_2017, havrylov_2017}, they have rarely been used to explore the relation between language and visual perception.
Notably, Rodriguez et al. examined the effects of natural differences in object appearance (such as frequency, position, and luminosity) on emergent communication \cite{rodriguez_2020}.
Apart from that, Bouchacourt and Baroni measured the alignment between agents' internal representations and conceptual input properties to determine whether emergent language captures such properties or relies on low-level pixel information \cite{bouchacourt_2018}.
Still, these models usually extract object representations from fixed, pre-trained CNNs.
As a result, they make claims about how the emergent language relates to the input, not the visual perception of that input.
In our work, we exploit the flexibility of modern setups and introduce systematic variations in the agents' visual processing, such that we can establish a relationship between differences in visual processing and differences in emergent protocols.
\section{Methods} \label{sec:methods}
\subsection{Data set
We use the \textit{3dshapes} data set \cite{3dshapes18}. The data set contains images of 3D shapes in an abstract room, generated from six latent factors, which can vary independently: floor color ($10$ values), wall color ($10$ values), object color ($10$ values), object scale ($8$ values), object shape ($4$ values), and object orientation ($15$ values). We use a subset of four different object colors (red, yellow, turquoise, purple), and four different object scales (equally spaced from smallest to largest); amounting to $96000$ different images. For our purpose, we define objects by color, scale, and shape of the geometric shape, such that there are $4^3 = 64$ different objects. The term ``object'' refers to an object class, such as ``tiny red cube'', with each image representing an instance of such an object. Consequently, if we say that two agents see the same object, e.g., a tiny red cube, they both see an object that agrees on the relevant attributes (object color, object scale, and object shape), but not necessarily on the irrelevant ones (floor color, wall color, object orientation), e.g., they might both see a tiny red cube, one against a yellow wall and another against a green wall. Similarly, when we say that two objects are different, they differ in at least one of the relevant attributes but may agree on all irrelevant ones.
\subsection{Communication game
Two agents, sender $S$ and receiver $R$, play a reference game where one round of the game proceeds as follows:
\begin{enumerate}
\item A random object is selected as the target.
\item $S$ sees an image of the target and produces a message. Messages have length $L$ and consist of a sequence of symbols $(s_1, ..., s_L)$ from vocabulary $V=\lbrace0,\dots,|V|-1\rbrace$.
\item $R$ sees a possibly different image of the target and additionally $k$ random distractor images, showing other objects. Based on the message from $S$, $R$ tries to select the image showing the target.
\item If $R$ succeeds, both agents receive a positive reward, $r=1$, otherwise they receive zero reward, $r=0$.
\end{enumerate}
Three attributes---color, size, and shape---define what we call ``object''. Sender and receiver see potentially different images of the same target object, while the distractor images show different objects. Consequently, it lies in the nature of this game, that \textit{conceptually relevant} (i.e. class-defining) attributes and \textit{task-relevant} attributes coincide.
\subsection{Model
The model components and their interactions in the communication game are shown in Fig~\ref{fig:architecture}. Sender and receiver each have a vision module to process images, $i$, and a language module to generate (sender) or process (receiver) discrete messages, $m$. The sender maps the input image to a probability distribution over messages, $\pi_S(m\mid i)$, by sequentially generating a probability distribution across symbols conditioned on the symbols produced so far. The receiver maps the input message onto a probability distribution over (target and distractor) images, $\pi_R(i\mid m)$. These distributions define the agents' policies. During training, actions are sampled from the policies, whereas for testing the arguments of the maxima are used.
\begin{figure}[htb]
\centering
\includegraphics[width=\textwidth]{archs_final_with_f.png}
\caption{{Schematic visualization of sender and receiver architecture and their interaction in one round of the reference game.} The sender takes an image of the target object as input. The image is processed by the sender's vision module and the resulting activations are used to initialize the hidden state, $h_0$, of the sender's language module. The initial input to the sender's language module, $\langle \textrm{start} \rangle$, is a zero vector of the same dimensionality as the symbol embeddings, and at each time step a symbol is sampled from its output distribution. The generated message is processed by the receiver's language module. In addition, the target and the distractor images are processed by the receiver's vision module. The final selection probability is proportional to the dot product between the receiver's final hidden state and the image embeddings.}
\label{fig:architecture}
\end{figure}
The vision module, $v(\cdot)$, is a CNN pretrained to classify the $64$ different objects. The agents use the activations of the fully connected layer before the final softmax layer as object representation. The language module, $l(\cdot)$, consists of an embedding layer and a gated recurrent unit (GRU) layer \cite{cho_2014}. Each agent has an additional fully connected layer, $f^1(\cdot)$, mapping the visual representations onto the same dimensionality as the GRU hidden state. For the sender, the output of $f^1_S$ is used to initialize the hidden state of the language module. The sender has an additional fully connected layer, $f^2_S(\cdot)$, mapping the GRU hidden state onto a probability distribution across symbols at each time step, $t$, such that $\pi_S(m=(s_1, ..., s_{L}) \mid i) = \prod_{t=1}^L \pi_S(s_t \mid s_{k<t}, i)$, with $\pi_S(s_t \mid s_{k<t}, i) \propto f^2_S(h_t)$. For the receiver, the dot product between the output of layer $f^1_R$ and the final GRU hidden state defines the selection policy: $\pi_R(i\mid m) \propto \exp \big( f^1_R(v_R(i)) \cdot l_R(m) \big)$.
\subsection{Introducing perceptual biases via relational label smoothing}\label{sec:methods_label_smoothing}
In order to investigate the influence of differences in perception on emergent language, we develop a method called \textit{relational label smoothing}, which allows us to systematically manipulate the CNN pretraining and thereby to create agents with different perceptual biases.
We aim to have four conditions, next to the unmanipulated \textsc{default}. Specific biases for either of the object-defining attributes---color, scale, and shape---make up three of these conditions. E.g., in the \textsc{color} condition, color similarities are amplified. In addition, we experiment with an \textsc{all} condition, where we amplify similarities for all three attributes simultaneously.
Relational label smoothing calculates the target at training time as a weighted sum of the usual one-hot target, $\mathbf{y}_0$, and a relational component, $\mathbf{y}_r$, according to
\begin{equation*} \label{eq:rel_targs}
\mathbf{y} = \sigma \mathbf{y}_r + (1-\sigma)\mathbf{y}_0\,,
\end{equation*}
where $\sigma\in\mathbb{R}$ is the smoothing factor, controlling the strength with which the relationship(s) should be enforced.
To enforce object similarities along one specific attribute (or dimension), $a$, we use a single-level hierarchical version of relational label smoothing. If $i$ is the true object class, we define superclass $C_i$ as the set of object classes having the same value as $i$ for $a$. Then $\mathbf{y}_r$ is given by
\begin{equation*} \label{eq:smoothed_targs}
y_{r_{ij}} = \left\{
\begin{array}{cc}
(n-1)^{-1} & \quad j \in C_i \text{ and } i \neq j \\
0 & \quad \text{else}
\end{array}\,,
\right.
\end{equation*}
where $n$ is the number of object classes in $C_i$. E.g., in the \textsc{color} condition, if the training sample is a red object, the relational component, $\mathbf{y}_r$, is a uniform distribution of $\nicefrac{1}{(16-1)}$ across the class indices of the other $15$ red objects, see Fig~\ref{fig:rls_examples}A, which increases the representational similarity between red objects, and analogously that of objects sharing other color values, see Fig~\ref{fig:rls_examples}B.
\begin{figure}[htb]
\centering
\includegraphics[scale=0.4]{rls_examples.png}
\caption{{Creating perceptual bias with relational label smoothing}. (A) Example of how the training targets (labels) are adapted to induce a \textsc{color} bias. To generate a CNN with a \textsc{color} bias, some of the target weight is spread across all other classes that \textit{have the same color as the target object}. In our data set, there are $64$ different object classes. The first sixteen classes comprise red objects (classes $1$--$16$), followed by yellow objects (classes $17$--$32$), turquoise objects (class $33$--$48$), and purple objects (classes $49$--$64$). For example, if the input image belongs to class $2$ (``tiny red cylinder''), the usual target label, $\mathbf{y}_0$, is a one-hot vector where the entire weight lies on the true class index. The relational component, $\mathbf{y}_r$, spreads some of the target weight onto all other red objects. The target vector used for training is a weighted average of the original target and the relational component. Analogously, to introduce a scale/shape bias, some of the target weight is spread onto all other objects of the same scale/shape as the input object. (B) Representational similarity matrix for the \textsc{color} CNN after training ($\sigma=0.6$). Entries at position ($i$,$j$) correspond to the average cosine similarity between the CNN activations for images of class $i$ and the CNN activations for images of class $j$ (based on the penultimate fully-connected layer). The white $16\times16$ blocks on the diagonal indicate that objects of the same color are perceived as very similar to each other.}
\label{fig:rls_examples}
\end{figure}
In order to enforce relationships for multiple attributes in a single model, we generalize the previous definition to include $\mathbf{y}_r$ to be a sum over relational components,
\begin{equation*} \label{eq:all_targs}
\mathbf{y}_r = \frac{1}{N} \sum_{a=1}^{N} \mathbf{y}_{r_a}\,,
\end{equation*}
where $N$ is the number of attribute relationships, and $\mathbf{y}_{r_a}$ represents the relational component from attribute $a$. To calculate the relational component for the \textsc{all} condition, we average the relational components from the \textsc{color}, \textsc{scale}, and \textsc{shape} conditions.
\section{Experiments}\label{sec:experiments}
\subsection{Training and hyperparameters}
We use a train/test split of 0.75/0.25.
\paragraph{General setup.}
The general training setup varies depending on which direction of influence between perception and language is being investigated. A schematic overview of these variations is shown in Fig~\ref{fig:setup}.
The agents' vision modules are always pretrained on a classification task, and different perceptual biases can be achieved via the different pretraining conditions explained above.
Categories do not have to originate from language. Categories can also be formed through interactions with the world, and nonhuman animals as well as preverbal human infants can learn categories \cite{sloutsky_2019}. Of course, these categories can still be lexicalized later on. The classification task is motivated by this ability to form categories through interactions with the world. While we do not explicitly model such interactions we assume they take place nonetheless.
To study the influence of differences in perception on communication (Fig~\ref{fig:setup}, top row), we train a sender and a receiver with fixed vision module weights on the communication game.
The evolutionary analysis uses the same setup. Here, multiple games between sender-receiver pairs are used to approximate the communicative success of agent populations with different perceptual dispositions.
To study the influence of language on perception, we consider language learning and language emergence (Fig~\ref{fig:setup}, center and bottom row). In the language learning scenario, the language is fixed---using a trained sender---and only the receiver is trained, while in the language emergence scenario, both agents are trained. Importantly, in both scenarios, not only the language module but also the vision module is trained, such that changes in perception can occur.
When learning to communicate, visual representations may adapt but they are still constrained by the functions of the visual system. In our case, this function is limited to object recognition (classification).
To ensure that the agents' perceptual ability does not deteriorate to processing only aspects relevant to the communication game, training on the classification task used for pretraining continues.
The loss function is generated by adding the classification loss and the communication game loss together.
\begin{figure}[htb]
\centering
\includegraphics[scale=0.23]{setup_with_evolution.png}
\vspace{0.3cm}
\caption{{Illustration of the training setups.} The vision module is represented by an eye, the language module by a mouth (sender) or an ear (receiver). The speech bubble represents the message, and the question mark the receiver's selection. Modules that are not trained, i.e. have fixed weights, are light gray. Modules that are trained are dark gray. Note that the vision modules in the two language emergence scenarios (center and bottom row) are trained on the communication game and simultaneously also on the original object classification task.}
\label{fig:setup}
\end{figure}
\paragraph{CNN pretraining.}
The CNN architecture consists of two convolutional layers with 32 channels, followed by two fully connected layers with 16 nodes, and a final softmax layer. The first convolutional layer is followed by a $2 \times 2$ max-pooling layer. For pretraining, we use stochastic gradient descent (SGD) with learning rate $0.001$ and batch size $128$, and train for $200$ epochs. We set smoothing factors as high as possible while keeping the classification accuracy close to maximal. For the \textsc{color}, \textsc{scale}, and \textsc{shape} conditions, we use a smoothing factor of $\sigma=0.6$. For \textsc{all}, the weight is distributed across more classes, which allows for a higher smoothing factor of $0.8$. All networks achieve test accuracies $>97\%$.
\paragraph{Communication game.}
For most simulations, we use vocabulary size $|V|=4$, message length $L=3$, and $k=2$ distractors. In principle, this allows agents to use a distinct symbol for each object and thereby to achieve maximal reward. As there are only a few distractors, agents may achieve relatively high rewards with suboptimal strategies. It is in the variation of such local solutions that we hope to identify linguistic differences that reflect perceptual biases and vice versa. We also run control experiments with a larger vocabulary size and more distractors, as well as control experiments changing the task-relevance of individual attributes. The agents minimize the negative expected reward, $-\mathbb{E}[r]$, and their trainable weights are updated using REINFORCE \cite{Williams}, which is a basic policy gradient algorithm.
We train all agents using Adam with learning rate $0.0005$ and batch size $128$. Embedding and GRU layer each have a dimensionality of $128$. We add an entropy regularization term \cite{mnih_2016} of $0.02$ to sender and receiver loss to encourage exploration. The vision modules are initialized with the weights of the pretrained CNNs. When both agents are trained, training proceeds for $150$ epochs, if only the receiver is trained (language learning) for $25$ epochs.
\subsection{Evaluation}
We are interested in the mutual influence between perception and language. Accordingly, we devise metrics to quantify perceptual biases as well as linguistic biases.
\subsubsection{Perception
Let $A = \lbrace color, \: scale, \: shape\rbrace$ be the set of object attributes, and $V_a$ all values that attribute $a\in A$ can take on, e.g., $V_{scale} = \lbrace tiny, \: small, \: big, \: huge\rbrace$.
Given a set of inputs, \textit{representational similarity analysis} (RSA) \cite{kriegeskorte_2008} measures the similarity between two representational spaces, by calculating the pairwise distances (in our case similarities) of input representations in either space and then correlating the two distance matrices. We use the analysis in two different ways. In the first case, RSA quantifies how well an agent's visual representations capture conceptually relevant attributes. Here, the two spaces under comparison are the space of the agent's visual representations generated by $v(\cdot)$, and a symbolic space of $k$-hot encoded attribute vectors ($k=|A|=3$). In the second case, RSA quantifies the degree of perceptual alignment between an agent and its communication partner, and the two spaces under comparison are the two different visual representation spaces. In a first step, we extract $N=50$ random example images for each object (class) and generate a representational similarity matrix (RSM) for each space under comparison, by calculating the pairwise cosine similarities between the corresponding representations, $sim_{cos}(r_i,r_j) = \frac{r_i^T r_j}{\lVert r_i\rVert \lVert r_j \rVert}$. Fig~\ref{fig:rls_examples}B shows an example of an RSM for a \textsc{color} agent. In a second step, the actual RSA score is calculated as the Spearman correlation between the RSMs of the two spaces under comparison.
The RSA score with respect to the attribute template tells us how well differences in the underlying compositional object structure correlate with differences in the agent's visual representations. Fig~\ref{fig:rsa_examples}A shows the RSM calculated from $k$-hot encoded attribute vectors, which serves as a ground-truth template. We can also use RSA to quantify whether agents can represent similarity relationships for some attributes better than for others. In order to do so, we replace the $k$-hot attribute vectors above by one-hot vectors encoding the values $V_a$ of a specific attribute $a$, and repeat the procedure for each attribute $a \in A$, resulting in separate RSA scores for color, scale, and shape. Fig~\ref{fig:rsa_examples}B shows the color RSM template. Notice, that the RSA scores for individual attributes attenuate each other, as the agent's representations cannot simultaneously match all three templates. If one score is higher than the others, the agent represents one attribute at the cost of the others and is said to have a perceptual bias for that attribute. We denote the general RSA score (including all attribute values) by $RSA$, and the scores for a specific attribute by $RSA_{a}$.
\begin{figure}[htb]
\centering
\includegraphics[scale=0.4]{rsa_examples.png}
\caption{{Quantifying perceptual bias.} (A) Object similarities calculated from $3$-hot encodings based on all three attributes. This template is used in the RSA calculation to measure how well conceptually relevant attributes are encoded. (B) Object similarities calculated from $1$-hot encodings based on color value. This template is used to calculate $RSA_{color}$.}
\label{fig:rsa_examples}
\end{figure}
\subsubsection{Language}
We use an information-theoretic evaluation to quantify the linguistic bias. Communicative success is based on what information about the target objects, $O$, the sender encodes in the messages, $M$, but also what information the receiver decodes from the messages to determine its object selections, $S$. Communicative success depends on both these factors, suggesting a three-way analysis, see Fig~\ref{fig:entropy_analysis} (left), which would allow us to quantify the shared and distinct information between all combinations of objects, messages, and selections. However, in our experiments, the shared information between objects and selections is entirely predicted by the messages, since the receiver can only make selections based on message content (for details see Appendix \ref{S1_Appendix}). Therefore, we can skip the object-selection interface, leading to separate analyses of the relation between objects and messages, and messages and selections Fig~\ref{fig:entropy_analysis} (right).
\begin{figure}[htb]
\centering
\includegraphics[scale=0.4]{entropy_3.png}
\caption{{Schema of the information in the target objects, $O$, the corresponding messages, $M$, and objects selected by the receiver, $S$.} $H$ denotes entropy and $I$ mutual information. The object-selection interface is entirely predicted by the messages as the mutual information between objects and selections given messages (shaded region on the left side) is zero. Therefore we can separate the analysis of sender (objects-messages) and receiver (messages-selections) as shown on the right. Note, the schema is not an actual set-theoretic representation and serves illustrative purposes only.}
\label{fig:entropy_analysis}
\end{figure}
The mutual information between two random variables, $I(X, Y)$, measures how predictive these variables are of each other
\begin{equation*}
I(X,Y) = H(Y) - H(Y\mid X) = H(X) - H(X\mid Y)\,,
\end{equation*}
where $H(X)$ is the marginal entropy and $H(X\mid Y)$ the conditional entropy defined as
\begin{equation*}
H(X\mid Y) = - \sum_{y\in Y,\; x\in X} p(y,x) \log \frac{p(y,x)}{p(y)}\,.
\end{equation*}
The conditional entropy indicates how much uncertainty about $X$ remains (on average) after learning $Y$. It turns out that, in all our experiments, the analysis of sender and receiver are symmetric in that $H(O\mid M)\approx H(S\mid M)$, $H(M\mid O) \approx H(M\mid S)$, and accordingly also $I(O, M)\approx I(M, S)$. Therefore we limit our analysis to the sender.
The conditional entropy, $H(O\mid M)$, quantifies the degree of uncertainty about the objects when knowing the messages that were sent. In reverse, to measure how much information about the objects is encoded in the messages, we can define an effectiveness score by
\begin{equation*}
E(O,M) = 1 - \frac{H(O\mid M)}{H(O)}\,,
\end{equation*}
with $E(O,M) \in [0,1]$. To measure linguistic bias, we can define an effectiveness score for individual attributes. Let $O_a$ be the values of attribute $a$ for all objects, and $M$ the generated messages as above, then we can measure how much information about $a$ is encoded in the messages as $E(O_a, M)$. It follows, that
\begin{equation*}
\overline{E(O_a,M)} = \frac{1}{|A|} \sum_{a\in A} E(O_a, M)\
\end{equation*}
measures how well all conceptually relevant attributes are communicated. Unlike the RSA scores for individual attributes, $E(O_a, M)$, can be maximal for all attributes at the same time.
\section{Results}\label{sec:results}
This section presents analyses and results. At first, a validity check of label smoothing as a method to induce selective visual biases is performed. Then, each of the three questions under investigation is treated separately.
\subsection{Perceptual biases generated via label smoothing} \label{sec:label-smoothing}
\paragraph{Relational label smoothing can systematically manipulate perception.} In order to test the validity of our manipulations, we check whether relational label smoothing induces the intended biases.
As the agents' vision modules use object representations from the penultimate CNN layer, we quantify the biases for that layer using RSA.
t-SNE plots \cite{tsne} and pairwise class similarities of object representations can be found in Appendix \ref{S1_Fig} and Appendix \ref{S2_Fig}.
Table \ref{tab:CNN_bias} shows the RSA scores for each of the five pretraining conditions.
Surprisingly, the \textsc{default} CNN represents differences in color values much more accurately than differences in other attributes.
This inherent color bias may be due to the networks' direct access to color information via the RGB channel input \cite{hill_2020}.
\textsc{color}, \textsc{scale}, and \textsc{shape} networks mostly capture differences in the respective attribute.
The \textsc{all} network represents differences in all three attributes, which can be seen from relatively high RSA scores per attribute, as well as a higher overall RSA score.
Note, maximum values per attribute are smaller than in the other conditions due to mutual attenuation.
In conclusion, by default, object representations extracted from CNNs are biased towards representing color information but relational label smoothing can shift this bias to other attributes as well as improve coverage of the entire input topology.
\begin{table}[htb]
\centering
\begin{tabular}{l||c|c|c|c|c}
& default & color & scale & shape & all
\\
\hline
\hline
\hline
$RSA_{color}$ & 0.633 & 0.750 & 0.019 & 0.021 & 0.440\\
\hline
$RSA_{scale}$ & 0.101 & 0.019 & 0.750 & 0.025 & 0.319\\
\hline
$RSA_{shape}$ & 0.056 & 0.017 & 0.015 & 0.748 & 0.424\\
\hline
\hline
$RSA$ & 0.439 & 0.437 & 0.437 & 0.442 & 0.675\\
\end{tabular}
\caption{RSA between visual object representations and object attributes for each pretraining condition. Scores are calculated between object representations and $k$-hot attribute encodings, $RSA$ (bottom row), as well as for each individual attribute $a$, $RSA_a$.}
\label{tab:CNN_bias}
\end{table}
\subsection{Influence of perception on language}\label{sec:perception_influences_language}
To quantify the influence of different visual biases on emergent communication, we trained agents with different visual biases (and fixed vision module weights) on the communication game.
For all CNNs (\textsc{default, color, scale, shape, all}) we trained a sender-receiver pair where both agents used the same vision module and thus had the same bias.
In addition, to evaluate the impact of sender versus receiver bias we ran experiments combining a \textsc{default} receiver with each type of sender, and combining a \textsc{default} sender with each type of receiver. We conducted twenty runs per agent combination. All agents learned to play the game, with mean test rewards ranging between 0.914–0.968 (details about the agents' performance follow later in this section).
\paragraph{Perceptual biases systematically shape emergent language.}
We begin by analyzing the effect of perceptual biases on emergent language when both agents have the same bias.
We use the effectiveness score to measure how much information about specific attributes is contained in the messages.
The results for each type of bias and each attribute are shown in Fig~\ref{fig:effectiveness}A.
The five blocks on the $x$-axis show the perceptual bias conditions, with each bar representing one of the three attributes. In the \textsc{default} condition (left) the messages are strongly grounded in object color, which can be attributed to the inherent color bias of the \textsc{default} CNN.
Agents with a color, scale, or shape bias (central three blocks), ground their messages to a large extent in the attributes they have a perceptual bias for.
Overall, the effectiveness across conditions is significantly higher for biased attributes ($M=0.868$) than unbiased attributes ($M=0.468$), as indicated by a bootstrapped 95\% confidence interval (CI) for the difference in means of $[0.355, 0.444]$.
Qualitatively, the observed patterns prevail also if the vocabulary size and the number of distractors are increased, both of which encourage the agents to communicate more information about each attribute (see Appendix \ref{S2_Appendix}).
It seems that if agents are good at perceiving object similarities along specific dimensions, they prefer to communicate these dimensions over others.
\begin{figure}[htb]
\centering
\includegraphics[scale=0.4]{effectiveness_gray_abc_20runs.png}
\caption{{Effectiveness per attribute for different pairings of senders and receivers.} Pairings are (A) biased sender and biased receiver, (B) biased sender and \textsc{default} receiver, and (C) \textsc{default} sender and biased receiver. The $x$-axis shows the agents' perceptual biases. The bars are labeled with the attribute $a$ used for calculating $E(O_a|M)$, with attributes enforced via label smoothing in dark gray. We report means and bootstrapped $95$\% CIs of twenty runs each.}
\label{fig:effectiveness}
\end{figure}
\paragraph{Sender bias is more influential than receiver bias.}
Effectiveness scores for varying the sender bias in combination with a \textsc{default} receiver are shown in Fig~\ref{fig:effectiveness}B, and for varying the receiver bias in combination with a \textsc{default} sender in Fig~\ref{fig:effectiveness}C. The results for \textsc{default} from part (A) are repeated as a reference. Comparing part (B) to part (A) of the figure, and singling out the effects of color, scale, and shape biases, biasing only the sender has similar effects as biasing both agents. For each of these biases, the language is grounded largely in the corresponding attribute. Still, the color bias of the \textsc{default} receiver leads to an increase in color effectiveness when the sender itself does not have a color bias. Comparing (C) to (B), also a receiver bias is carried over into the emergent language, even though its influence is weaker and the color bias of the \textsc{default} sender dominates. We calculate the mean absolute difference (MAD) between the average effectiveness scores in (B) and (A), as well as (C) and (A), for \textsc{color}, \textsc{scale}, and \textsc{shape} condition, to quantify the relative influence of biasing one versus both agents. The imbalance between sender and receiver bias is reflected in a higher MAD for biased receivers ($0.194$) than biased senders ($0.103$). Looking at the \textsc{all} condition, an interesting pattern emerges. If both agents have an \textsc{all} CNN as in (A), the message information is more evenly distributed across all attributes than in the \textsc{default} condition. However, if either of the agents uses a \textsc{default} CNN, as in (B) or (C), this effect is reversed and the messages are mostly grounded in color, which is likely because the ``flexible'' \textsc{all} agent adapts to the inherent color bias of the \textsc{default} agent. In line with this interpretation, the MAD between average effectiveness scores in \textsc{all} condition and \textsc{default} condition is very small, both when the sender is biased ($0.012$) and when the receiver is biased ($0.013$). In sum, perceptual biases of both sender and receiver are reflected in the emergent language, but due to the asymmetry of communication, the sender bias is more influential. Further, agents that rely strongly on all conceptually relevant object dimensions for perceptual categorization can flexibly adapt their language to suit communication partners with more narrow perceptual discrimination abilities.
\paragraph{Perception of relevant similarity relationships improves communication.}
Table \ref{tab:perception-language} displays the training rewards, test rewards, and average effectiveness across attributes for all five conditions (sender and receiver biased). Results for pairing biased with \textsc{default} agents can be found in Appendix \ref{S1_Table}. The mean test rewards range between $0.914$--$0.968$ across all conditions, at a chance level of $0.33$. We are particularly interested in the \textsc{all} versus \textsc{default} comparison, so whether sharpening the agents' perception with respect to conceptually relevant dimensions improves emergent communication in comparison to default processing. According to all three metrics, \textsc{all} agents achieve the best values, and \textsc{default} agents the second-best values. The strong perceptual bias for individual attributes seems to bias the communication to a degree that is harmful to performance. Still, the differences between \textsc{all} and \textsc{default} are significant based on the bootstrapped 95\% CIs for the difference in means with respect to training rewards ($[0.007, 0.017]$), test rewards ($[0.005, 0.014]$), and average effectiveness ($[0.040, 0.083]$).
The higher average effectiveness in the \textsc{all} condition suggests that enforcing conceptually relevant similarities helps the agents to overcome categorization biases, such that they can better communicate all relevant attributes---instead of forming semantic categories based on individual attributes---and as a consequence achieve higher performance.
\begin{table}[htb]
\centering
\begin{tabular}{l||c|c|c|c|c}
& default & color & scale & shape & all \\
\hline
\hline
train reward
& 0.956 $\pm$ 0.003 & 0.928 $\pm$ 0.008 & 0.910 $\pm$ 0.006 & 0.937 $\pm$ 0.008 &\textbf{0.968} $\pm$ 0.004\\
\hline
test reward
& 0.959 $\pm$ 0.003 & 0.929 $\pm$ 0.009 & 0.914 $\pm$ 0.007 & 0.939 $\pm$ 0.008 &\textbf{0.968} $\pm$ 0.004\\
\hline
\rule{0pt}{10pt} {\small $\overline{E(O_a,M)}$}
& 0.676 $\pm$ 0.013 & 0.596 $\pm$ 0.015 & 0.532 $\pm$ 0.016 & 0.600 $\pm$ 0.020 &\textbf{0.738} $\pm$ 0.017\\
\end{tabular
\caption{{Training rewards, test rewards, and average effectiveness across attributes for sender-receiver pairs with the same bias.} Reported are means and bootstrapped 95\% CIs calculated from twenty runs per condition. The best values across conditions are highlighted.}
\label{tab:perception-language}
\end{table}
\subsection{Influence of language on perception}\label{sec:language_influences_perception}
To study the influence of different linguistic biases on visual perception, we considered a language learning and a language emergence scenario. For the language learning scenario, we used the trained senders from the agent pairs above (where both agents have the same bias) and trained \textsc{default} receivers to learn their language. For the language emergence scenario, we ran experiments combining a \textsc{default} receiver with each type of sender, and combining a \textsc{default} sender with each type of receiver. We conducted ten runs per scenario and agent combination, with mean test rewards ranging between $0.919$--$0.973$ (for details about training and test rewards see Appendix \ref{S3_Fig}).
\paragraph{Linguistic biases influence perception.}
In the language learning scenario, the language was fixed and learned by the receiver. Fig~\ref{fig:language-perception-influence}, top left, shows that the linguistic biases clearly influence the agent's perception: if message content is biased towards a specific attribute---as in the \textsc{default} (color attribute), \textsc{color}, \textsc{scale}, and \textsc{shape} condition---the agent learns to better represent visual differences for this attribute. As the \textsc{default} receiver starts out with a perceptual color bias (see Table \ref{tab:CNN_bias}), changes in visual perception are most clearly visible in the \textsc{scale} and \textsc{shape} conditions, where the color bias is reduced, and scale or shape bias increases. Looking at the RSA scores between the sender's and the receiver's visual object representations (Fig~\ref{fig:language-perception-influence}, bottom left) we find that unless both agents start out with a color bias (\textsc{default} and \textsc{color} condition) the scores increase, so the receiver's representations adapt to those of the sender. The center and right columns of Fig~\ref{fig:language-perception-influence} visualize the same analysis results for the language emergence scenario, once for a \textsc{default} receiver paired with senders from different conditions (center), as well as for a \textsc{default} sender paired with receivers from different conditions (right). The exact same qualitative patterns as in the language learning scenario emerge, with differences in amplitude suggesting that the receiver is more affected by the sender's bias than vice versa. The agents' biases are passed on through language, even if there is no fixed linguistic protocol to begin with.
\begin{figure}[htb]
\centering
\includegraphics[width=\textwidth]{language-perception-influence_gray_bci.png}
\caption{{Influence of linguistic biases on perception.} Shown are the effects of language learning and language emergence on a \textsc{default} agent, when paired with agents of different visual bias conditions. The left column covers the language learning scenario with a \textsc{default} receiver, the central column the language emergence scenario with a \textsc{default} receiver, and the right column the language emergence scenario with a \textsc{default} sender. In the language learning scenario, the sender's weights (and therefore also the language) are entirely fixed. In the language emergence scenario, both agents are trained and the language emerges. The visual bias of the communication partner is shown on the $x$-axis. The top row shows the RSA scores between the \textsc{default} agent's visual representations and each object attribute---indicated by the bar label---after training. Attributes that were enforced to create the visual bias of the communication partner are dark gray. The bottom row shows the RSA scores between the visual representations of the \textsc{default} agent and those of its communication partner before (light gray) and after (dark gray) training. Reported are means and bootstrapped $95$\% CIs of ten runs each.}
\label{fig:language-perception-influence}
\end{figure}
\paragraph{Communication can improve perception of relevant similarity relationships.}
Color, scale, and shape information is relevant for the communication game. Therefore, it seems plausible that playing the game could improve visual object representations with respect to these attributes. Fig~\ref{fig:language-perception-improvement} shows the RSA scores of a \textsc{default} agent after training in the language learning scenario (left), and the language emergence scenario as receiver (center) or sender (right). The CNN type of the communication partner is color-coded. Indeed, compared to the original RSA score, regardless of the scenario and the bias of the communication partner, the CNN of the \textsc{default} agent better accounts for differences in the conceptually relevant attributes. The representational grouping of objects based on the inherent CNN color bias is reduced by playing the communication game.
\begin{figure}[htb]
\centering
\includegraphics[scale=0.5]{language-perception-improvement-boxplot.png}
\caption{{RSA scores between symbolic object representations ($k$-hot attribute vectors) and neural object representations in the agent's vision module.} Shown are the scores for the \textsc{default} agent after training, for different communication partners, and across ten runs each. For the language learning scenario, the \textsc{default} receiver is shown (left). For the language emergence scenario, the \textsc{default} receiver (left) and the \textsc{default} sender (right) are shown. The dashed line indicates the RSA score of the \textsc{default} CNN---so the agent's vision module---before training.}
\label{fig:language-perception-improvement}
\end{figure}
We further analyzed the influence of scenario (learning, emergence - \textsc{default} receiver, emergence - \textsc{default} sender) and communication partner bias (\textsc{default, color, scale, shape, all}) by looking at the bootstrapped 95\% CIs for the differences in means.
Mean RSA scores are lowest in the learning scenario ($M=0.518$).
They are higher in the emergence scenario with a \textsc{default} receiver ($M=0.543$), with a CI of $[0.017, 0.033]$, and even higher for the emergence scenario with a \textsc{default} sender, with a CI for the two emergence scenarios of $[0.014, 0.033]$.
Agents in the language emergence scenarios learn object representations that better reflect the underlying object structure compared to agents in the language learning scenario, with a stronger effect for the sender than the receiver. Thus, it is beneficial, if both agents can adapt their perceptual processes to the game. As the sender dominates the emerging protocol (see above), its visual representations might adapt more strongly to the task. With respect to differences in communication partner bias, we were particularly interested in which communication partners can increase the RSA score compared to a \textsc{default} partner ($M=0.525$ across scenarios). In pairwise comparisons with the \textsc{default} partner, a partner with a \textsc{shape} bias leads to the strongest improvement ($M=0.558$, $CI=\lbrack0.017, 0.047\rbrack$), followed by \textsc{all} ($M=0.552$, $CI=[0.014, 0.040]$), then \textsc{scale} ($M=0.543$, $CI=[0.005, 0.030]$), and finally \textsc{color} does not seem to yield a significant improvement ($M=0.535$, $CI=[-0.003,0.022]$). The \textsc{default} agent is good at representing differences in object colors, and bad at representing differences in both scale and shape information, with the largest deficit for shape (see Table \ref{tab:CNN_bias}).
It seems that talking to \textsc{shape} or \textsc{all} agents, which are good at representing shape information, can help overcome the shape deficit, therefore leading to the strongest improvements. Similarly, communication with a \textsc{color} agent does not stimulate the agent to adapt its representations, as the preferred structure based on color values is mutual.
Overall, adapting visual perception for a downstream communication task (while staying true to the original classification objective) improves the visual representation of task-relevant aspects of the environment---in our case the three object-defining attributes. The improvement is stronger if the communication partner is good at representing aspects for which the agent has a deficit.
\paragraph{The role of classification.} The agents' vision modules are trained for classification and communication at the same time. The classification task is used to simulate that the visual representations have other purposes apart from informing communication. We ran additional control simulations without the classification task, to understand its influence on the results above. A detailed description of methods and results can be found in Appendix \ref{S3_Appendix}. The main finding can be confirmed also without classification: If message content is biased towards a specific attribute---because it is predetermined (language learning) or arises through a visual bias of the communication partner (language emergence)---the \textsc{default} agent learns to better represent visual differences for this attribute.
Still, the classification loss has a moderating effect on the RSA scores as it constrains the visual representations to capture differences between the values of all attributes regardless of linguistic bias. In other words, it keeps the vision module from only representing information that is relevant to the communication game. As the agents discriminate between fewer objects in communication than in classification (communication is less optimal than classification), playing the reference game does not improve the visual representations, i.e. the general RSA score, without the classification loss.
\subsection{Evolutionary analysis}\label{sec:evolutionary-analysis}
In the preceding analyses
we studied how perceptual biases, or more generally representations, are affected by language use. Here, we take this idea to an extreme by analyzing whether specific perceptual representations (biases) are more likely to result from within- or cross-generational adaptation processes based on their aptitude for communication.
For this purpose, we use the static solution concept of evolutionary stability from evolutionary game theory \cite{maynard-smith_1974}.
This solution concept assumes a large, homogeneous population where agents are randomly paired to play a game of interest. Based on the reward (or payoff) structure between different types of agents, it can be decided whether a population of a certain type can be invaded by an alternative type. In a two-player symmetric game, type $t$ is evolutionary stable, if agents of any mutant type $t'$ achieve less reward playing with an agent of type $t$ than two agents of type $t$ playing with each other, $r(t,t)>r(t',t)$. If there is a competing type $t'$, such that $r(t',t)=r(t,t)$, $t$ is still evolutionary stable if $r(t,t')>r(t',t')$.
While the concept of an ESS has first been introduced in the context of biological evolution, it is useful also for analyzing the stable rest points of non-biological evolutionary optimization processes
The latter is made possible by the fact that ESSs are the (locally) asymptotically stable rest points of the replicator dynamic \cite{taylor_1978, HofbauerSigmund1998:Evolutionary-Ga}. The replicator dynamic, in turn, is a rather encompassing high-level formalization of a wide variety of agent-internal optimization processes, be they cross-generational as in cultural evolution or (asexual) reproduction \cite{Sandholm2010:Population-Game}, or within-generational as in imitation-based dynamics \cite{FrankeCorreia2018:Vagueness-and-I, Sandholm2010:Population-Game} or simple forms of reinforcement learning \cite{BorgersSarin997:Learning-Throug}.
\paragraph{Enhanced perception of relevant features is evolutionary stable.}
In our case, the game of interest is the reference game, and the different types are given by different perceptual biases.
We assume that agents in the population can act as both sender and receiver. Accordingly, the rewards for two communicating agents with biases $t$ and $t'$ are calculated by averaging the rewards of a $t$-sender paired with a $t'$-receiver and a $t'$-sender paired with a $t$-receiver.
This is also known as \textit{symmetrizing} the game \cite[Section 3.4]{cressman_2003}.
Because the training process and the agents' policies are stochastic, the reward for an interaction between two bias types is approximated by averaging across multiple runs.
Fig~\ref{fig:evolution}A shows the reward matrix for all bias combinations averaged across twenty simulations for each sender-receiver pair.
Judging from the average rewards, the \textsc{default} and \textsc{all} conditions form the only evolutionary stable biases. Pairwise comparisons between the CIs in each matrix column reveal that only the evolutionary stability of the \textsc{all} bias is significant. Thus, only the \textsc{all} bias prevails in an optimization process for communicative success.
\begin{figure}[htb]
\centering
\includegraphics[width=\textwidth]{evolution.png}
\caption{{Mean reward on the test set for two agents of different bias types communicating with each other.} For each sender-receiver combination, we ran twenty simulations. To obtain the average reward for an agent of bias type $t'$ communicating with an agent of bias type $t$, we average the rewards of the combinations $t'$-sender/$t$-receiver and $t$-sender/$t'$-receiver, hence the matrices are symmetric. We highlight the results for the combinations where both agents are biased towards all relevant attributes.
(A) shows the mean test rewards for agents with $t', t \in \lbrace$\textsc{default, color, scale, shape, all}$\rbrace$ in the basic reference game where all attributes (color, scale, shape) are relevant.
(B) shows the mean test rewards for agents with mixed biases $t', t \in \lbrace$\textsc{color-scale, color-shape, scale-shape}$\rbrace$ for reference games where out of the three attributes either color (left), scale (center), or shape (right) is not relevant.
}
\label{fig:evolution}
\end{figure}
\paragraph{Eliminating potential confounds of task-relevance as evolutionary drive.}
\textsc{all} agents achieve higher rewards than other agents. Intuitively, this is the case because the \textsc{all} condition enforces task-relevant attributes. If object color was not relevant to the game, enforcing color similarities should not increase performance, and a color bias should not evolve. However, the advantage of \textsc{all} agents could be due to other factors. We noted above that, based on the nature of the reference game, the conceptually relevant (i.e. class-defining) attributes correspond to the attributes that are relevant for successful communication. To achieve perfect performance, all conceptually relevant attributes must be communicated, such that the receiver can identify the target unambiguously against different distractors. \textsc{all} agents could therefore achieve higher performance because they are biased towards class-defining attributes rather than task-relevant attributes; or, simply because more attributes are enforced than in the other conditions, which might improve representational structure.
To exclude these alternative explanations, we ran a set of control simulations. We created different mixed-bias conditions, where similarities for two out of three attributes were enforced during perception-pretraining (\textsc{color-scale}, \textsc{color-shape}, \textsc{scale-shape}). To ensure that the bias strength for enforced attributes is high and approximately equal within and across types, as well as that the bias strength for unenforced attributes is approximately zero, we conducted a grid search across different smoothing factors and weightings between the two enforced biases (for details see Appendix \ref{S4_Appendix}).
In addition, we designed reference game variants, where always one of the three object attributes is not relevant (color irrelevant, scale irrelevant, shape irrelevant). E.g., if object color is irrelevant, sender and receiver target may have different colors and still yield maximal reward, while scale and shape must be the same, see Fig~\ref{fig:color_irrelevant_example}.
By training combinations of mixed-bias agents on these games, the set of attributes relevant to pretraining is disentangled from the set of attributes relevant to communication, while the number of enforced biases is constant across agent types.
\begin{figure}[htb]
\centering
\includegraphics[scale=0.5]{color_irrelevant_inputs.png}
\caption{{Example inputs if object color is irrelevant in the communication game.} The receiver target is marked by a black box. Appendix \ref{S4_Fig} shows examples of sender and receiver inputs for each game variant (color irrelevant, scale irrelevant, shape irrelevant).}
\label{fig:color_irrelevant_example}
\end{figure}
Fig~\ref{fig:evolution}B shows the resulting reward matrices (for an analysis of the linguistic biases see Appendix \ref{S5_Fig}). In each game variant, agent types with a bias for task-relevant attributes form the only evolutionary stable population. Particularly low performances arise when both agents have the same mismatching bias (low values on the diagonal) because, in that case, the agents' bias does not encourage communication about the respective ``missing'' attribute. E.g., if both agents have a \textsc{color-scale} bias, introducing shape information into the conversation is more difficult than if one agent has a \textsc{color-shape} bias. The matrices further show that representations which are biased towards task-relevant attributes will win against any alternative homogeneous bias. In conclusion, there might be optimization pressure towards representations that accurately capture the relationships between objects, in terms of features that are environmentally relevant.
\section{Discussion}\label{sec:discussion}
We proposed that communication games with deep neural network agents can be used to study interactions between perception and emergent communication. Based on systematic manipulations of visual representations and communication protocols, we made the following main observations: 1) biases in either modality are reflected in the other, 2) communication improves the perception of task-relevant attributes, and 3) enforcing accurate representation of task-relevant attributes improves communication---to a degree that specialization of the perceptual system to the linguistic environment could accrue.
Multi-agent communication games account for the interactive and grounded nature of communication. Reinforcement learning (RL) presents a natural framework for modeling learning in these games. Utterances are treated like actions: they are grounded in the environment and driven by objectives.
Machine learning models trained on language in isolation---typically under (self-)supervision---have achieved impressive results on various natural language processing tasks by capturing statistical patterns from large corpora \cite{devlin-2019, Radford2019, brown_2020}. However, lacking a grounded shared experience, these models cannot address deeper questions about communication and meaning \cite{bisk_2020}.
\subsection{Influence of perception on language}
The first set of analyses investigated the influence of visual perception on emergent communication.
We found that semantic category formation was largely shaped by perceptual similarity relationships.
In human cognition, the idea that many concepts are characterized by perceptual properties is uncontroversial.
For example, objects that are grouped under the same psychological concept often have similar shapes \cite{rosch_1976}.
The conceptual structure of the world in our reference game is predetermined: objects are defined by color, scale, and shape, each being equally important. Still, the agents group together several concepts under a single label based on perceptual similarity, which means the emerging protocol is suboptimal.
They even do so when the message space and the number of distractors are increased (see Appendix \ref{S2_Appendix}).
Recently, it was shown that neural network agents playing a color discrimination game develop \textit{efficient} communication, in the sense that they reach maximum accuracy for a given language complexity, and that---as in human color-naming systems---low complexity is preferred \cite{chaabouni_2021}.
We assume a similar effect in our simulations. The agents develop accurate but simple protocols, and reductions in complexity are achieved by grouping different objects under the same label based on perceptual similarity.
We further showed that increasing the perceptual sensitivity for features that are relevant to the communication game debiases communication and improves performance. In line with the above interpretation, it could be that agents with better adapted representational spaces find solutions with higher complexity and accuracy, while still optimizing the trade-off between the two.
These results are also relevant from an engineering perspective.
A lot of the existing research in language emergence is focused on developing setups that foster the emergence of communication protocols sharing desirable properties with natural language.
The role of how agents perceive and represent the world is mostly ignored \cite{bouchacourt_2018}.
However, we not only show that perceptual biases directly influence the emerging protocol but also that they are present in default setups.
We find that the organization of pixel inputs into dedicated color channels makes color information more easily accessible than other object information, which leads to a color bias in communication.
Neural networks process visual information differently from humans in many ways.
For example, they are susceptible to adversarial attacks \cite{szegedy_2014} and lack useful learning mechanisms observed in children \cite{Lake_ME_challenge}.
We think that language emergence research can profit from taking into account the effects of differences between human and machine perception.
Moreover, we show that agents' performance can be improved by developing representational similarity relationships that are based on task-relevant dimensions, rather than using out-of-the-box pretrained networks.
\subsection{Influence of language on perception}
The second set of analyses studied the influence of (emergent) communication on visual perception. We found that categories established by the communication protocol modulate representational similarities to better reflect this categorical structure, by increasing the similarity between objects that are grouped together under the same expression. It has been shown that learning new color categories (through a perceptual task) induces categorical effects on color discrimination similar to those of natural color categories \cite{ozgen_2002}. These results suggest that cross-language differences in perceptual representations may arise as a result of learning linguistic categories, as simulated in our experiments. Besides, we observed that perceptual sensitivity increases for features that are relevant in the communication game and therefore affect the agents' objective. The need to discriminate between features, for communication to be successful, can disentangle their visual representations. This increase in sensitivity occurs even though the exact same features are also relevant in the pretraining classification task. A related effect has been observed in a visual search task. Although there is a baseline effect of conceptual categories on visual processing, this effect increases if the target category is labeled \cite{lupyan_2008}.
Both these observations have been made in earlier simulations. Harnad, Hanson, and Lubin, showed that neural networks trained on a supervised classification task show effects of categorical perception, in that a continuous input dimension is warped in the network representations to increase within-category similarity and decrease between-category similarity \cite{harnad_1991}. Later, Cangelosi and Harnad compared agents that learned categories from sensorimotor interaction with the world (``sensorimotor toil'') to agents that could additionally learn from communication signals (``symbolic theft'') \cite{cangelosi_2002}. Sensorimotor interaction, comparable to our pretraining classification task, warped the agents' representational similarity space but supervised learning of symbolic object descriptions warped these similarity spaces even further, leading to increasingly categorical perception. Our work extends these computational approaches. We model how a representation space can restructure itself to reflect a categorical partition of a comparatively complex input space, based on communicative interaction rather than supervised learning.
Modeling a communication scenario has the advantage that we can study interactions between communication partners who conceptualize the world differently. Because the emerging language is shaped by the perceptual biases of both agents, and in turn shapes their perceptual biases, the agents’ representations become aligned through communication. Comparable effects have been found in empirical studies. Category structure aligns between people who play a reference game \cite{markman_1998}, and more generally between people who assign novel labels to stimuli with the goal to coordinate \cite{suffill_2019}.
These analyses, too, have implications for engineering-driven research.
Backpropagating the learning signal from the communication game through the vision module of the agents improves their ability to represent and discriminate between relevant features, which might be useful for downstream tasks other than communication.
It also provides a way to align perceptual representations of different agents, which can be particularly useful if one agent can thereby correct specific perceptual deficits of the other agent.
\subsection{Evolutionary analysis}
Finally, the evolutionary analysis showed that accurate perception of environmentally relevant aspects constitutes a functional advantage. Related results have been found in experiments with robots playing a color naming game \cite{bleys_2009}. Robots that could adapt their categories to the task performed better than robots starting out with the same, but fixed category structure.
Most likely, representational structure in humans is optimized to accommodate environmentally relevant conceptualizations as well \cite{gardenfors2004conceptual, marstaller_2013}.
In our simulations, communication was the only task performed by the agents. Representational structure in humans, however, is shaped by various environmental pressures.
Our results do not indicate that perception only adapts to optimize communication, but rather that communication (as a means to exchange information about relevant aspects of the environment) may constitute one of these pressures.
Whether language could have influenced the brain, and therefore also visual perception, through biological evolution is highly debated. A major problem lies in the fact that it is difficult to estimate the relative change of perception during the evolution of language. The (macaque) monkey visual system is often and successfully taken as a model system for the human visual system. A mainstream view is that the two visual systems share many characteristics but are not identical \cite{orban_2004, rapan_2022}. Furthermore, it is uncertain when language emerged \cite{hauser_2014}. However, it has been argued that---evolutionarily young and variable---language is rather shaped by the---evolutionarily old and stable---brain than vice versa \cite{christiansen_2008}. While we abstain from claims about the time scales of the analyzed optimization process, it seems more likely that language-guided adaptations of visual representations happen within the lifetime of an individual.
Stable state analysis is a static solution approach to evolutionary games. It can identify whether a given population will remain at a certain state but does not explain how a population arrives at that state. The latter question can be answered by dynamic approaches, which apply an explicit model of the optimization process. A prominent example is the \textit{replicator dynamic}, originally defined for a single species by Taylor and Jonker \cite{taylor_1978} and named by Schuster and Sigmund \cite{schuster_1983}. Thus, evaluating the probability that a randomly initialized population develops perceptual representations that match communicative needs would require the use of dynamic models.
\subsection{Flexible-role agents and populations}
In the original Lewis game, there are two agents with fixed roles (sender and receiver), two world states, and two actions. In the theoretical analysis of signaling games, it has been of general interest how the agents' behavior changes under variations of this simple case \cite{skyrms_2010}. Like the original Lewis game, our reference game involves two agents with fixed roles. To make sure that our results do not only pertain to this special case, we ran additional simulations with more agents and flexible-role agents. In particular, we separately tested an extension to flexible-role agents and an extension to a 4-agent game (two senders, two receivers). We repeated the analyses above for the \textsc{default}, \textsc{scale}, and \textsc{all} conditions, as these conditions cover the main manipulations of enforcing no bias, a bias for a single attribute, or a bias for all attributes. Details about methods and results can be found in Appendix \ref{S5_Appendix} (4 agents) and Appendix \ref{S6_Appendix} (flexible-role agents). At least for these two extensions, we can establish the same main results as for the fixed-role, 2-agent game. While many more variations are conceivable, our findings seem to reflect general aspects of language-perception interactions in multi-agent communication.
\subsection{Limitations}
Combining communication games with deep learning to study interactions between language and perception (and possibly other areas of cognition) is a novel approach. As a first implementation, the proposed setup tries to strike a balance between the flexibility of modern DNNs and experimental control. Our images and categories fall clearly short of the visual complexity of the world. However, using objects that are composed of a fixed set of attributes and attribute values has several advantages. We can introduce selective visual biases via relational label smoothing, and we can quantify and compare visual and linguistic biases with respect to these attributes.
Our model also greatly simplifies the functionality of visual perception. Our agents use their vision modules to generate representations that can be used for classification and communication. The visual brain, in contrast, performs a multitude of functions each of which imposes organizational and representational constraints. In particular, visual perception requires an (implicit) understanding of sensorimotor contingencies as it informs and is informed by motor action \cite{noe_2005}. Hence, unlike our model, the visual system continues to represent information that is irrelevant to categorization or communication.
As a consequence, our results likely overestimate the effects of language on perception.
In addition, without a significant increase in architectural and functional complexity, an analysis of the penetration depth of language into visual representations (high-level attentional selection mechanisms vs. dynamic re-tuning of receptive fields of primary sensory neurons) does not warrant conclusions about the human visual system.
Empirical studies show that the effects of language on vision are dynamic and task-dependent. For example, in color discrimination tasks, categorical effects are observed for naive but not trained observers \cite{witzel_2015}, and sometimes only in the presence but not in the absence of verbal cues \cite{forder_2019}. Future work could study these more nuanced effects by using more complex vision modules.
\section{Outlook}\label{sec:outlook}
Our vision modules are CNNs trained on classification. Thereby, they rely on the same principles---albeit being much simpler---as state of the art models of vision \cite{lindsay_2021, storrs_2021}. Still, there are many ideas on how correspondence between artificial and biological neural networks can be further improved by changing architectures, learning algorithms, input statistics, or training objectives \cite{kietzmann_2019, richards_2019}.
As a relatively minor change, training on superordinate or both superordinate and basic labels, rather than on subordinate labels as is typically the case, makes visual representations more robust and more human-like \cite{ahn_2021}. Note that information about taxonomic relationships can also be encoded in the training labels directly using the (hierarchical) relational label smoothing method presented here.
An example of an architectural change are recurrent CNNs, which include not only bottom-up but also lateral and top-down connections. Including recurrence improves object recognition, especially under challenging conditions \cite{spoerer_2017}, and is required to model the representational dynamics of the visual system \cite{kietzmann_2019_recurrence}. As an example of a change in objective, an \textit{embodied} DNN agent has been shown to learn sparse and interpretable representations through interactions with its simulated environment \cite{clay_2021}. In addition to scaling our experiments to more complex input data and deeper networks, future work could draw on these exciting developments to better capture the functional and architectural constraints on the visual system. The resulting models could be used to investigate how the effect of communication on perceptual representations changes under these additional constraints.
This paper set out to explore mutual influences between language and (visual) perception in multi-agent communication. But language interfaces with other areas of human cognition as well.
The embedding of language in general cognition is evident in everyday language use. For instance, in understanding a written text, we are able to recruit from memory the right background assumptions to make the text coherent \cite{graesser_2001}.
This can, among others, be observed in bridging inferences.
Upon reading ``They had a barbecue. The beer was warm.'', we can conclude that the beer was part of the barbecue.
Another salient example is attention.
While we may share a basic attention mechanism for dealing with the non-linguistic world, having a language to ``bridge minds'' will likely lead to fine-tuning and, in fact, align our attentional mechanisms. Think about saying ``Wow!'' or adding ``surprisingly''.
These so-called mirative markers convey surprise \cite{delancey_1997}, thereby telling the audience what we expected, but also what we pay attention to.
Essentially, every statement about the world conveys meta-information about what the speaker finds newsworthy in the first place.
On a basic level, also the role of attention or memory could be studied with our setup, for example by using neural network agents with attention mechanisms \cite{chaudhari_2021} or external memory \cite{graves_2016}.
In general, due to the versatility of both deep learning architectures and communication games, their combination forms an excellent testbed for various language-related interface problems.
Our experiments go beyond analyzing effects \textit{on} emergent communication.
They also account for the reverse direction, i.e. how language shapes other domains.
Such Whorfian effects are widespread; apart from visual perception they have, for example, been observed in motion, spatial relations, number, and false belief understanding \cite{wolff_2011}.
In fact, it seems likely that all interfaces between cognition and language are mutually adapted towards optimal interaction in the environments we face \cite{jablonka_2018}, such that language can guide the acquisition of cognitive representations from experience, and in turn, can be used to structure and exchange these experiences \cite{perlovsky_2009}.
In a neural network agent, linguistic feedback can be backpropagated into any module that may be considered adaptive to language use.
As illustrated by our analyses, language emergence games can address adaptions within and across generations. Future research could use the presented framework to improve our understanding of language in relation to general cognition, from its origins to its cultural and potentially genetic evolution.
\section*{Data availability}
Materials and code are publicly available at the Open Science Framework (OSF): \url{https://osf.io/qu4xp/}.
\section*{Acknowledgments}
This work was funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) - GRK 2340. Preliminary results (parts of Section \ref{sec:label-smoothing} and Section \ref{sec:perception_influences_language}) were presented at the 43rd Annual Conference of the Cognitive Science Society \cite{ohmer_2021}.
| {'timestamp': '2022-10-18T02:25:36', 'yymm': '2112', 'arxiv_id': '2112.14518', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14518'} | arxiv |
\section{Introduction}
In this paper, we consider a stochastic recursion of the following form~\cite{lakshminarayanan2018linear}:
\begin{align}
x_{k + 1} = A x_k + b + C w_k,\label{eq:LTI-system}
\end{align}
where $x_k\in {\mathbb R}^n$ is the state, $k\in \{1,2,\ldots \}$ is the time, $A \in {\mathbb R}^{n\times n}$ is a constant system matrix such that $\left\| A \right\|_\infty < 1$, $b \in {\mathbb R}^n$ and $C \in {\mathbb R}^{n,\times m}$ are some constants, $w_k \in {\mathbb R}^m$ is an i.i.d. noise with ${\mathbb E}[w_k] = 0$ and ${\mathbb E}[w_k^T w_k] \leq W$ for some constant $W >0$. Such a class of iterative algorithms have been widely studied for a variety of disciplines and applications such as reinforcement learning~\cite{lakshminarayanan2018linear}, control engineering, communication engineering, signal processing~\cite{kushner2003stochastic}, and stochastic optimization~\cite{bhatnagar2012stochastic} to name just a few. The goal of this paper is to study convergence of~\eqref{eq:LTI-system}, and as an example, apply the results to a reinforcement learning algorithm~\cite{sutton1998reinforcement}. In particular, the property of~\eqref{eq:LTI-system} follows mainly that of the linear dynamic system without the random noise
\begin{align}
x_{k + 1} = A x_k + b,\label{eq:LTI-system2}
\end{align}
A point $x=x_\infty$ in the state-space of~\eqref{eq:LTI-system2} is said to be an equilibrium point of~\eqref{eq:LTI-system2} if $\lim_{k \to \infty } A x_k + b = x_\infty$, which satisfies $x_\infty = A x_\infty + b$. The equilibrium point $x_\infty$ is said to be globally asymptotically stable~\cite{khalil2002nonlinear} if for any initial state $x_0 \in {\mathbb R}^n$, $x_k \to x_\infty$ as $k \to \infty$. In this case,~\eqref{eq:LTI-system2} can be written by the linear time-invariant (LTI) system~\cite{chen1995linear}
\begin{align}
x_{k + 1} - x_\infty = A (x_k - x_\infty).\label{eq:LTI-system3}
\end{align}
Using similar approaches, the recursion in~\eqref{eq:LTI-system} can be written as
\begin{align}
x_{k + 1} - x_\infty = A(x_k - x_\infty) + B w_k,\label{eq:LTI-system4}
\end{align}
which is an LTI system with a stochastic noise. Our main result is the following finite-time error bound.
\begin{theorem}[Convergence of average iteration]\label{thm:convergence2}
Suppose that $\left\| A \right\|_\infty \le \beta \in (0,1)$. For any $k\geq 0$, we have
\begin{align*}
{\mathbb E}\left[ {{{\left\| {\frac{1}{N}\sum\limits_{k = 0}^{N - 1} {{x_k}} - {x_\infty }} \right\|}_\infty}} \right] \le& \sqrt {\frac{1}{N}\frac{1}{{1 - \beta }}} n{\left\| {{x_0} - {x_\infty }} \right\|_\infty }\\
& + \sqrt {{\frac{2n}{1 - \beta}}{\lambda _{\max }}({B^T}B)W}
\end{align*}
\end{theorem}
The result follows from standard tools in control communities such as Lyapunov theory~\cite{khalil2002nonlinear}. The result is then applied to analysis of temporal difference (TD) learning~\cite{sutton1988learning}.
TD-learning is a linear stochastic iterative algorithm to estimate the value function of a given policy for a Markov decision process~\cite{puterman2014markov}, which is one of the most popular and fundamental reinforcement learning algorithms~\cite{sutton1998reinforcement}. While there has been a series of successful works~\cite{sutton1988learning,tsitsiklis1994asynchronous,jaakkola1994convergence,borkar2000ode,bertsekas1996neuro,sutton2009fast,hu2019characterizing,lee2019target} in theoretical analysis of TD-learning, it was not until recently that researchers found some guarantees on its statistical efficiency~\cite{lakshminarayanan2018linear,dalal2018finite,srikant2019,bhandari2018finite}, e.g., finite-time analysis. Based on~\cref{thm:convergence2}, we establish an additional finite-time error bound for TD-learning, which provides new insights on TD-learning and stochastic recursive algorithms with simple concepts and analysis tools in control theory.
\subsection{Related Works}
Recently, significant progresses have been made in finite-time analysis of TD-learning algorithms~\cite{bhandari2018finite,dalal2018finite,srikant2019}.
In particular,~\cite{dalal2018finite} proposed the first finite-time analysis of TD-learning in the pure form, and~\cite{srikant2019} improved convergence of TD-learning in~\cite{dalal2018finite} by considering Markovian sampling and higher-order moments. In addition,~\cite{bhandari2018finite} studied finite-time analysis of TD-learning based on standard techniques used in stochastic gradient descent literatures
Besides the finite-time analysis of TD-learning, some recent advances~\cite{lee2020unified,hu2019characterizing,lee2021discrete} in control system analysis of reinforcement learning algorithms are worth mentioning. Dynamical system perspectives of reinforcement learning and general stochastic iterative algorithms have a long tradition, which dates back to O.D.E analysis~\cite{borkar2009stochastic,kushner2003stochastic,bhatnagar2012stochastic,borkar2000ode}. More recently,~\cite{lee2020unified} studied asymptotic convergence of Q-learning~\cite{watkins1992q} through a continuous-time switched linear system model~\cite{liberzon2003switching}, and~\cite{hu2019characterizing} investigated asymptotic convergence TD-learning based on a Markvian jump linear systems (MJLSs). A finite-time analysis of Q-learning has been studied using discrete-time switched linear system model in~\cite{lee2021discrete}.
\paragraph{Contributions}
We present features of the proposed method that differentiate it from the previous ones in the literature. \cite{srikant2019} considers a continuous-time O.D.E. model of linear stochastic approximation and TD-learning, and hence, relies on the stability of continuous-time LTI models, i.e, Herwitz stability. On the other hand, the proposed work considers discrete-time LTI models with its property associated with Schur stability. As a result, the proposed analysis can cover analysis of off-policy TD-learning without linear function approximation, while the results in~\cite{srikant2019} are more suitable for analysis of on-policy TD-learning with (or without) linear function approximation. Similar arguments can be applied to~\cite{dalal2018finite}. Compared to~\cite{bhandari2018finite}, the analysis given in~\cite{bhandari2018finite} can be suitably applied to on-policy TD-learning with (or without) linear function approximation, while the proposed method can be applied to both on-policy and off-policy TD-learning without linear function approximation. Details on the convergence rates and conditions on the step-size are slightly different as well. Besides, the proposed approach provides unique discrete-time LTI system perspective of TD-learning, which provides additional insights on TD-learning. The proposed work also has unique features compared to the discrete-time MJLS model in~\cite{hu2019characterizing}. In particular,~\cite{hu2019characterizing} considers an equivalent discrete-time MJLS model of TD-learning, while the proposed method considers an equivalent discrete-time LTI system with random noises, which encode all randomness into a single vector. As a result,~\cite{hu2019characterizing} offers asymptotic convergence, while we provides finite-time analysis.
The traditional O.D.E. approaches~\cite{borkar2009stochastic,kushner2003stochastic,bhatnagar2012stochastic,borkar2000ode} can be seen as a control system framework, which are based on continuous-time system models. On the other hand, the proposed work exploits directly discrete-time system models.
Although the recent works~\cite{bhandari2018finite,dalal2018finite,srikant2019} offer fruitful results on finite-time analysis under various conditions, the proposed approach still gives additional finite-time bounds under different conditions, and additional insights, which can deepen our understanding on linear stochastic approximation and TD-learning based on concepts and tools in linear system theory. In this respect, we see the proposed methods as complements rather than replacement of existing methods.
\paragraph{Limitations}
In this work, we only consider TD-learning with i.i.d. sampling. Moreover, linear function approximation is not taken into account. Instead, off-policy learning is applied to TD-learning. Note that off-policy TD-learning converges without linear function approximation, while can diverge with linear function approximation~\cite{bertsekas1996neuro}. On the other hand, recent finite-time analysis~\cite{bhandari2018finite,srikant2019} covers TD-learning with Markovian sampling and linear function approximation. In addition, the proposed approach only considers a constant step-size in order to fit into the LTI system model framework, while~\cite{dalal2018finite} and~\cite{bhandari2018finite} covers diminishing step-sizes as well.
These improvements are potential future topics.
{\bf Notation}: The adopted notation is as follows: ${\mathbb R}$: set of real numbers; ${\mathbb R}^n $: $n$-dimensional Euclidean
space; ${\mathbb R}^{n \times m}$: set of all $n \times m$ real
matrices; $A^T$: transpose of matrix $A$; $A \succ 0$ ($A \prec
0$, $A\succeq 0$, and $A\preceq 0$, respectively): symmetric
positive definite (negative definite, positive semi-definite, and
negative semi-definite, respectively) matrix $A$; $I$: identity matrix with appropriate dimensions; for any matrix $A$, $[A]_{ij}$ is the element of $A$ in $i$-th row and $j$-th column; $\lambda_{\min}(A)$ and $\lambda_{\max}(A)$ for any symmetric matrix $A$: the minimum and maximum eigenvalues of $A$; $|{\cal S}|$: cardinality of a finite set $\cal S$.
\section{Application of~\cref{thm:convergence2}}
In this section, we will consider TD-learning~\cite{sutton1988learning} as an application of~\cref{thm:convergence2}. To this end, we briefly introduce Markov decision problem and related preliminaries~\cite{puterman2014markov,bertsekas1996neuro} first.
\subsection{Markov decision problem}
We consider the infinite-horizon discounted Markov decision problem (MDP)~\cite{puterman2014markov,bertsekas1996neuro}, where the agent sequentially takes actions to maximize cumulative discounted rewards. In a Markov decision process with the state-space ${\cal S}:=\{ 1,2,\ldots ,|{\cal S}|\}$ and action-space ${\cal A}:= \{1,2,\ldots,|{\cal A}|\}$, the decision maker selects an action $a \in {\cal A}$ with the current state $s$, then the state
transits to a state $s'$ with probability $P(s'|s,a)$, and the transition incurs a
reward $r(s,a,s')$. For convenience, we consider a deterministic reward function and simply write $r(s_k,a_k ,s_{k + 1}) =:r_k, k \in \{ 0,1,\ldots \}$. A (stochastic) policy is a map $\pi:{\mathcal S} \times {\mathcal A}\to [0,1]$ representing the probability, $\pi(a|s)$, of selecting action $a$ at the current state $s$. The objective of the Markov decision problem (MDP) is to find a deterministic optimal policy, $\pi^*$, such that the cumulative discounted rewards over infinite time horizons is
maximized, i.e., $\pi^*:= \argmax_{\pi\in \Theta} {\mathbb E}\left[\left.\sum_{k=0}^\infty {\gamma^k r_k}\right|\pi\right]$, where $\gamma \in [0,1)$ is the discount factor, $\Theta$ is the set of all admissible deterministic policies, $(s_0,a_0,s_1,a_1,\ldots)$ is a state-action trajectory generated by the Markov chain under policy $\pi$, and ${\mathbb E}[\cdot|\pi]$ is an expectation conditioned on the policy $\pi$. The value function under policy $\pi$ is defined as $V^{\pi}(s)={\mathbb E}\left[ \left. \sum_{k=0}^\infty {\gamma^k r_k} \right|s_0=s,\pi \right], s\in {\cal S}$. Based on these notions, the policy evaluation problem is defined as follows.
\begin{definition}[Policy evaluation problem]
Given a policy $\pi$, find the corresponding value function $V^\pi$.
\end{definition}
The policy evaluation problem is an important component of policy design problems for the Markov decision problem. The (model-free) policy evaluation problem is defined as follows: given a policy $\pi$, find the corresponding value function $V^\pi$ without the model knowledge, i.e., $P$, only using experiences or transitions $(s,a,r,s')$. In the policy evaluation problem, the policy $\pi$ we want to evaluate is called a target policy. On the other hand, the behavior policy, denoted by $b$, is the policy that is used to generate experiences. For a learning algorithm, if $b = \pi$, it is called on-policy learning. Otherwise, it is called off-policy learning. The stationary state distribution, if exists, is defined as
\[
\lim_{k \to \infty } {\mathbb P}[s_k= s|b] =: d(s), \quad s\in {\cal S},
\]
where $b$ is any behavior policy. Throughout, we assume that the stationary state distribution exists, which is a standard assumption.
\subsection{TD-Learning}
We consider a version of TD-learning given in~\cref{algo:TD1}.
\begin{algorithm}[h!]
\caption{Off-policy TD-learning}
\begin{algorithmic}[1]
\State Set the step-size sequence $(\alpha_k)_{k=0}^\infty$.
\State Initialize $V_0 \in {\mathbb R}^{|{\cal S}|}$ arbitrarily such that $\|V_0\|_\infty \le 1$.
\For{iteration $k=0,1,\ldots$}
\State Observe $s_k\sim d$, $a_k\sim b(\cdot|s_k)$, $s_k'\sim P(s_k,a_k,\cdot)$ and $r_k= r(s_k,a_k,s_k')$
\State Update $V_{k+1}(s_k)=V_k(s_k)+\alpha_k \{\sigma(s_k,a_k) r_k+\gamma \sigma(s_k,a_k) V_k(s_k')-V_k (s_k)\}$
where $\sigma(s,a) : = \frac{{\pi (a|s )}}{{b (a|s)}}$
\EndFor
\end{algorithmic}\label{algo:TD1}
\end{algorithm}
Compared to the original TD-learning, the step-size $\alpha$ is constant in this paper.
Note that an importance sampling ratio, $\sigma(s_k,a_k) : = \pi (a_k |s_k ) /b(a_k |s_k )$, is introduced for off-policy learning~\cite{precup2001off}. In other words,~\cref{algo:TD1} is an off-policy TD-learning. Note also that if $\pi = b$, then $\sigma \equiv 1$.
\subsection{Finite-time Analysis of TD-learning}\label{sec:convergence}
In this subsection, we study a discrete-time linear system model of~\cite{precup2001off} and establish its finite-time convergence based on the stability analysis of linear systems. For simplicity, let us assume that the initial state distribution is already the stationary distribution, i.e.,
\[
{\mathbb P}[s_0 = s] = d(s),\quad s \in {\cal S}.
\]
This assumption is also frequently adopted in the literature~\cite{sutton1988learning,borkar2000ode,sutton2009fast,lee2019target,dalal2018finite} to simplify the overall problem. In addition, we make the following assumptions throughout the paper.
\begin{assumption}\label{assumption:summary}$\,$
\begin{enumerate}
\item The step-size $\alpha$ satisfies $\alpha \in (0,1)$.
\item (Positive stationary state distribution) $d(s)> 0$ holds for all $s\in {\cal S}$.
\item (Bounded rewards) The reward is bounded as follows:
\begin{align*}
\max _{(s,a,s') \in {\cal S} \times {\cal A} \times {\cal S}} |r (s,a,s')| =:R_{\max}\leq 1.
\end{align*}
\item (Bounded initial parameter) The initial iterate $V_0$ satisfies $\|V_0\|_\infty \le 1$.
\item (Bounded importance sampling ratio)
\[
\max _{(s,a) \in S \times A} \left\{ {\sigma (s,a): = \frac{{\pi (a|s)}}{{b(a|s)}}} \right\} = :\sigma _{\max } \in [1,\infty )
\]
\end{enumerate}
\end{assumption}
The first statement in~\cref{assumption:summary} is required to guarantee the convergence of the proposed results.
The second statement is standard, and guarantees that every state may be visited infinitely often for sufficient exploration. The third statement is standard, and is required to ensure the boundedness of the iterates of TD-learning. The bound imposed on $V_0$ in the fourth item is just for simplicity of analysis. The following quantities will be frequently used in this paper; hence, we define them for convenience.
\begin{definition}$\,$
\begin{enumerate}
\item Maximum state-action visit probability:
\[
d_{\max} := \max_{s\in {\cal S}} d(s) \in (0,1).
\]
\item Minimum state-action visit probability:
\[
d_{\min}:= \min_{s \in {\cal S}} d(s) \in (0,1).
\]
\end{enumerate}
\end{definition}
Using~\cref{thm:convergence2}, the following convergence result for~\cref{algo:TD1} can be established.
\begin{theorem}\label{thm:convergence4}
For any $k\geq0$, it holds that
\begin{align*}
&{\mathbb E}\left[ {\left\| {\frac{1}{N}\sum_{k = 0}^{N - 1} {V_k } - V^\pi } \right\|_2 } \right]\\
\le& |{\cal S}|\sqrt {\frac{1}{N}\frac{1}{{\alpha d_{\min } (1 - \gamma )}}} \left\| {V_0 - V^\pi } \right\|_\infty \\& + 6\xi |{\cal S}|\sqrt {\frac{{2\alpha }}{{d_{\min } (1 - \gamma )^3 }}}
\end{align*}
\end{theorem}
\subsection{LTI System Interpretation}
In this subsection, we will introduce an LTI system model in~\eqref{eq:LTI-system4} of~\cref{algo:TD1}.
Throughout the paper, we will use the following compact notations:
\[
D: = \left[ {\begin{array}{*{20}c}
{d(1)} & {} & {} \\
{} & \ddots & {} \\
{} & {} & {d(|S|)} \\
\end{array}} \right],
\]
$P^\pi\in {\mathbb R}^{|{\cal S}| \times |{\cal S}|}$ is a matrix such that $[P^\pi ]_{ij} = {\mathbb P}[s' = j|s = i|\pi ]$, $R^\pi \in {\mathbb R}^{|{\cal S}|}$ is a vector such that $[R^\pi ]_i = {\mathbb E}[r(s_k ,a_k ,s_{k + 1} )|a_k \sim \pi (s_k ),s_k = i]$. Moreover, note that $P^{\pi}$ and $R^{\pi}$ can be expressed in terms of the importance sampling ratio $\rho(s,a)$
\begin{align}
P^\pi(s'|s) =& \sum\limits_{a \in {\cal A}} {P(s'|s,a)\pi (a|s)}\nonumber\\
=& \sum\limits_{a \in {\cal A}} {P(s'|s,a)b (a|s)\frac{{\pi (a|s)}}{{b(a|s)}}}\label{eq:importance-ratio1}
\end{align}
where $P^\pi(s'|s)$ implies the probability that the current state $s$ transits to $s'$ under the policy $\pi$, and $P(s'|s,a)$ means the probability that the current state $s$ transits to $s'$ under the action $a$. Similarly,
\begin{align}
R^\pi (s): =& \sum\limits_{a \in A} {\sum\limits_{s' \in {\cal S}} {\pi (a|s)P(s'|s,a)r(s,a,s')} }\nonumber\\
=& \sum\limits_{a \in A} {\sum\limits_{s' \in {\cal S}} {b(a|s)P(s'|s,a)\frac{{\pi (a|s)}}{{b(a|s)}}r(s,a,s')} }.\label{eq:importance-ratio2}
\end{align}
Using the notation introduced, the update in~\cref{algo:TD1} can be equivalently rewritten as
\begin{align}
V_{k+1}=V_k+\alpha \{D R^\pi+\gamma D P^\pi V_k-D V_k + w_{k}\},\label{eq:1}
\end{align}
where
\begin{align}
w_k =& (e_{s_k } e_{s_k }^T )\sigma(s_k,a_k) r_k + \gamma \sigma(s_k,a_k) (e_{s_k } e_{s_{k'} }^T )V_k \nonumber\\
& - (e_{s_k } e_{s_k }^T )V_k - (DR^\pi + \gamma DP^\pi V_k - DV_k ),\label{eq:w}
\end{align}
Here, $(s_k,a_k,r_k,s_k')$ is the sample in the $k$-th time-step. The expressions can be equivalently reformulated as~\eqref{eq:LTI-system} with
\[
\underbrace {V_{k + 1} }_{x_{k + 1} } = \underbrace {(I + \gamma \alpha D P^\pi - \alpha D )}_{ = A}\underbrace {V_k }_{x_k } + \underbrace {\alpha D R^\pi }_{ = b} + \underbrace {\alpha I}_{ = C}w_k
\]
Invoking the optimal Bellman equation $(\gamma D P^\pi-D )V^\pi+D R^\pi=0$ leads to the equivalent equation
\begin{align}
\underbrace {V_{k + 1} - V^\pi }_{ = x_{k + 1} - x_\infty } = \underbrace {\{ I + \alpha (\gamma D P^\pi - D)\} }_{ = A}\underbrace {(V_k - V^\pi )}_{ = x_k - x_\infty } + \underbrace {\alpha I}_{ = B}w_k \label{eq:TD-learning-stochastic-recursion-form}
\end{align}
Hence, the TD-learning iteration in~\cref{algo:TD1} can be concisely represented as the \emph{stochastic linear system}
\begin{align}
V_{k + 1}- V^\pi = A (V_k - V^\pi) + \alpha w_k,\label{eq:linear-system-form}
\end{align}
which is in the form of~\eqref{eq:LTI-system4}. Before closing this subsection, the boundedness of TD-learning iterates~\cite{gosavi2006boundedness} is introduced, which will play an important role in our analysis.
\begin{lemma}[Boundedness of TD-learning iterates~\cite{gosavi2006boundedness}]\label{lemma:bounded-Q}
If the step-size is less than one in~\cref{algo:TD1}, then for all $k \ge 0$,
\begin{align*}
\|V_k\|_\infty \le V_{\max}:= \frac{\max \{R_{\max},\max_{s\in {\cal S}} V_0 (s)\}}{1-\gamma}.
\end{align*}
\end{lemma}
From~\cref{assumption:summary}, $R_{\max}\leq 1$ and $\|V_0\|_\infty \le 1$, one can easily see that $V_{\max}\leq\frac{1}{1-\gamma}$.
In the remaining subsections, we will prove~\cref{thm:convergence4}.
\subsection{Proof of~\cref{thm:convergence4}}
To prove~\cref{thm:convergence4},~\cref{thm:convergence2} is applied. We only need to prove the following facts:
\begin{enumerate}
\item $\left\| A \right\|_\infty \le \beta$ for some constant $\beta \in (0,1)$
\item ${\mathbb E}[w_k] = 0$ and ${\mathbb E}[w_k^T w_k] \leq W$ for some constant $W < \infty$
\end{enumerate}
For the first statement, the following lemma is established first.
\begin{lemma}\label{lemma:max-norm-system-matrix}
$\|A \|_\infty \le 1 - \alpha d_{\min} (1 - \gamma ) \in (0,1)$ holds, where the matrix norm $\| A \|_\infty :=\max_{1\le i \le m} \sum_{j=1}^n {|[A]_{ij} |}$ and $[A]_{ij}$ is the element of $A$ in $i$-th row and $j$-th column.
\end{lemma}
\begin{proof}
Noting that $A = I + \alpha (\gamma DP^\pi - D)$, we have
\begin{align*}
\sum_j|[A]_{ij}|=&\sum_j {| [I - \alpha D + \alpha \gamma D P^\pi ]_{ij}|}\\
=& [I-\alpha D ]_{ii} + \sum_j {[\alpha\gamma D P^\pi ]_{ij}}\\
=& 1 - \alpha [D]_{ii} + \alpha \gamma [D]_{ii} \sum_j {[P^\pi]_{ij}}\\
=& 1 - \alpha [D]_{ii} + \alpha \gamma [D]_{ii}\\
=& 1 + \alpha [D]_{ii}(\gamma - 1),
\end{align*}
where the first line is due to the fact that $A$ is a positive matrix. Taking the maximum over $i$, we have
\begin{align*}
\| A \|_\infty =& \max_{i\in \{ 1,2,\ldots ,|{\cal S}|\} } \{ 1 + \alpha [D]_{ii} (\gamma-1)\}\\
=& 1 - \alpha \min_{s \in {\cal S}} d(s)(1 - \gamma ) ,
\end{align*}
which completes the proof.
\end{proof}
Next we prove the second statement.
\begin{lemma}
We have ${\mathbb E}[w_k] = 0$ and ${\mathbb E}[w_k^T w_k ] \le \frac{{36\sigma_{\max}^2 |{\cal S}|}}{{(1 - \gamma )^2 }} = :W$.
\end{lemma}
\begin{proof}
The first statement can be proved by taking the expectation on~\eqref{eq:w} and using the relations in~\eqref{eq:importance-ratio1} and~\eqref{eq:importance-ratio2}. Moreover, taking the norm on~\eqref{eq:w} leads to
\begin{align*}
&\left\| {w_k } \right\|_\infty \\
\le & \left\| {(\sigma (s_k ,a_k )e_s - D)r_k } \right\|_\infty \\
& + \left\| {\gamma \sigma (s_k ,a_k )e_s (e_{s'} )^T - \gamma DP^\pi } \right\|_\infty \left\| {V_k } \right\|_\infty \\
& + \left\| {(e_s (e_s )^T - D)} \right\|_\infty \left\| {V_k } \right\|_\infty\\
\le & 2 R_{\max } + \gamma \left\| {\sigma (s_k ,a_k )e_s (e_{s'} )^T - DP^\pi } \right\|_\infty V_{\max } + 2V_{\max }\\
\le & 2 R_{\max } + \gamma (1 + \sigma_{\max} )V_{\max } + 2V_{\max }\\
\le & \frac{{6\sigma_{\max} }}{{1 - \gamma }}
\end{align*}
where the last two inequalities come from~\cref{assumption:summary}, and~\cref{lemma:bounded-Q}.
Using this bound, we can conclude the proof by using ${\mathbb E}[w_k^T w_k ] = {\mathbb E}\left[ {\left\| {w_k } \right\|_2^2 } \right] \le {\mathbb E}\left[ {|{\cal S}|\left\| {w_k } \right\|_\infty ^2 } \right] \le \frac{{36\sigma_{\max} ^2 |{\cal S}|}}{{(1 - \gamma )^2 }} = :W$.
\end{proof}
By invoking~\cref{thm:convergence2} and with $n = |{\cal S}|,W = \frac{{36\sigma_{\max} ^2 |{\cal S}|}}{{(1 - \gamma )^2 }},\beta = 1 - \alpha d_{\min } (1 - \gamma ),\lambda _{\max } (B^T B) = \alpha ^2$, one gets the desired result.
\section{Proofs of~\cref{thm:convergence2}}
In this section, we provide proofs of~\cref{thm:convergence2}. The results are mainly based on Lyapunov theory~\cite{chen1995linear,khalil2002nonlinear} for LTI systems in~\eqref{eq:LTI-system3}. We will use a Lyapunov theorem summarized below to prove the convergence in~\cref{thm:convergence2}.
\begin{lemma}\label{lmm:Lyapunov-theorem2}
There exists a positive definite $M\succ 0 $ such that
\[
A^T M A = M - I,
\]
and
\begin{align*}
\lambda_{\min}(M) \ge 1,\quad \lambda_{\max}(M) \le \frac{n}{1-\beta}.
\end{align*}
\end{lemma}
\begin{proof}
Consider matrix $M$ such that
\begin{align}
M = \sum_{k=0}^\infty {(A^k)^T A^k}. \label{eq:4}
\end{align}
Noting that $A^T M A + I= A^T \left(\sum_{k=0}^\infty {(A^k)^T A^k }\right)A + I = M$, we have $A^T M A + I = M$, resulting in the desired conclusion. Next, it remains to prove the existence of $P$ by proving its boundedness. In particular, taking the norm on $M$ leads to
\begin{align*}
\left\| M \right\|_2 =& \left\| {I + A^T A + (A^2 )^T A^2 + \cdots } \right\|_2\\
\le& \left\| I \right\|_2 + \left\| {A^T A} \right\|_2 + \left\| {(A^2 )^T A^2 } \right\|_2 + \cdots\\
=& \left\| I \right\|_2 + \left\| A \right\|_2^2 + \left\| {A^2 } \right\|_2^2 + \cdots\\
=& 1 + n \left\| A \right\|_\infty ^2 + n\left\| {A^2 } \right\|_\infty ^2 + \cdots\\
=& 1 - n + \frac{n}{1 - \beta^2},
\end{align*}
which implies the boundedness. Next, we prove the bounds on the maximum and minimum eigenvalues.
From the definition~\eqref{eq:4}, $M \succeq I$, and hence $\lambda_{\min}(M)\ge 1$. On the other hand, one gets
\begin{align*}
\lambda_{\max}(M)=& \lambda_{\max}(I + A^T A+ (A^2)^T A^2+\cdots)\\
\le& \lambda_{\max}(I) + \lambda_{\max}(A^T A)+ \lambda_{\max}((A^2)^T A^2 )+\cdots\\
=& \lambda_{\max}(I) + \|A\|_2^2 + \|A^2\|_2^2 + \cdots\\
\le& 1 + n \|A\|_\infty^2 + n \|A^2\|_\infty ^2 + \cdots\\
\le& \frac{n}{1 - \beta^2}\\
\le& \frac{n}{1 - \beta}.
\end{align*}
The proof is completed.
\end{proof}
Now, we are ready to prove~\cref{thm:convergence2}.
\subsection{Proof of~\cref{thm:convergence2}}
Using~\cref{lmm:Lyapunov-theorem2}, we have
\begin{align*}
&{\mathbb E}[v(x_{k + 1} - x_\infty )]\\
=& {\mathbb E}[(A(x_k - x_\infty ) + Bw_k )^T M(A(x_k - x_\infty ) + Bw_k )]\\
=& {\mathbb E}[v(A(x_k - x_\infty ))] + 2\lambda _{\max } (B^T B)\lambda _{\max } (M)W\\
\le& {\mathbb E}[v(x_k - x_\infty )] - (x_k - x_\infty )^T (x_k - x_\infty )\\
& + 2\lambda _{\max } (B^T B)\lambda _{\max } (M)W
\end{align*}
Summing the last inequality over $k=0$ to $\infty$ and dividing both sides by $N$ leads to
\begin{align*}
&\frac{1}{N}\sum\limits_{k = 0}^{N - 1} {{\mathbb E}[(x_k - x_\infty )^T (x_k - x_\infty )]} \\
\le &\frac{1}{N}{\mathbb E}[v(x_0 - x_\infty )] + 2\lambda _{\max } (B^T B) \lambda _{\max } (M) W
\end{align*}
Using Jensen's inequality, $\lambda _{\min } (M)\left\| x \right\|_2^2 \le v(x) \le \lambda _{\max } (M)\left\| x \right\|_2^2$, and $\left\| {x_0 - x_\infty } \right\|_2 \le \sqrt n \left\| {x_0 - x_\infty } \right\|_\infty$, we have the desired conclusion.
\section*{Conclusion}
In this paper, we have proposed a control theoretic finite-time analysis TD-learning. Although the recent advances have offered fruitful results on finite-time analysis under various conditions, the proposed approach still gives additional finite-time bounds under different conditions, and additional insights, which can deepen our understanding on linear stochastic approximation and TD-learning based on concepts and tools in linear system theory. On the other hand, we have only considered i.i.d. sampling. Moreover, linear function approximation and diminishing step-size have not been taken into account. Instead, off-policy learning is applied to TD-learning. These improvements are potential future topics.
\bibliographystyle{IEEEtran}
| {'timestamp': '2022-04-08T02:25:39', 'yymm': '2112', 'arxiv_id': '2112.14417', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14417'} | arxiv |
\section{Introduction}
Ubiquitous intelligent devices equipped with advanced sensors (\textit{e.g.}, smartwatches, environmental monitoring devices) have brought us into the Internet of Things (IoTs) era, which connects the dispersive world into an interconnected system of intelligent networks. To make use of the data generated by these distributed devices, machine learning as a service (MLaaS)~\cite{mlaas} is becoming popular to assist users in refining their businesses. However, MLaaS usually needs to collect data from those devices and perform data analysis jobs in a centralized manner, which inevitably incurs two severe problems: high communication cost and privacy leakage~\cite{mlaasSecurity}. In IoTs, data is explosively generated every day, uploading all the raw data to a central server will bring a high burden to the bandwidth, especially in the wireless communication network. Besides, end-user devices usually contain a large amount of private information, such as location, identity, personal profiles, \textit{etc. } Directly uploading local data to the server will raise great concerns on user privacy.
To address these issues, recently emerged federated learning (FL)~\cite{FL1,FL2,FL3} is a new computing paradigm that allows users to collaboratively compute a global machine learning model without revealing their local data. By distributing the model learning process to the end users (\textit{e.g.}, intelligent devices), FL constructs a global model from user-specific local models, ensuring that the users’ private data never leaves the devices. In this way, the bandwidth cost is significantly reduced and user privacy is well protected.
Despite the promising prospect, recent studies show that FL is highly susceptible to Byzantine attacks, where malicious users can falsify real models or gradients to damage the learning process, or directly poison the training data to make the global model learn the wrong information. Blanchard \textit{et al.}~\cite{b1} have shown that just one baleful user can compromise the convergence of the training and damage the performance of the ultimate global model. To address this issue, a mounting number of defense strategies against Byzantine attacks have been proposed to further safeguard FL~\cite{b2,b3,b4,b5,b6}. {\color{black}Although these research efforts have demonstrated their preliminary success in defeating Byzantine attacks, we emphasize that it is still far from practice to provide a full protection for FL. Protecting FL from Byzantine attacks that simultaneously considers the issues including efficiency, privacy, data distribution is an extremely challenging problem in the literature, especially when there still exist unknown attack surface in its standard process. Recently Mothukuri \textit{et al.}~\cite{mothukuri2020survey} presented a comprehensive survey on the security and privacy of federated learning. However, it neither conducted experiments to evaluate existing schemes simultaneously, which is important to give a fair comparison, nor proposed any novel ideas to support its findings on the further work.}
In order to clearly demonstrate the vulnerability of existing Byzantine-robust FL schemes, this article first conducts a concise overview where an in-depth taxonomy is provided for the state-of-the-art defense strategies. We divide the existing defense solutions into four categories according to the principals they relied on for anomaly detection, \textit{i.e.}, the distance based solution, the performance based solution, the statistics based solution, and the target optimization based solution. Then a comprehensive comparison is provided in terms of their advantages and disadvantages. After reviewing the literature, we
propose a new kind of Byzantine attack called weight attack to defeat those defense schemes. By making use of the flaw in the existing weight assignment strategy, our attack is much easier to put into practice while enjoying a high attack success rate. We further conduct experiments to validate the threat of our weight attack. Finally, we discuss the possible countermeasures, and highlight several stubborn challenges and future research directions for hardening the security of FL.
{\color{black}
In summary, we make the following contributions:
\begin{itemize}
\item We provide a systematic review and comparison for state-of-the-art Byzantine-resilient federated learning schemes.
\item We propose a new kind of Byzantine attack to show the feasibility of disabling existing defense methods, followed by experimental validations.
\item We give an in-depth discussion for future work on enhancing the security of federated learning when facing Byzantine attacks.
\end{itemize}
}
\begin{figure*}
\begin{center}
\includegraphics[width= 1.8\columnwidth]{FL_server}\\
\caption{Architecture of federated learning}\label{fig:FL}
\end{center}
\end{figure*}
\section{Preliminaries}
\subsection{Federated Learning}
{\color{black}In the conventional collaborative deep learning training framework, a powerful central server is usually required to gather users' training data. After receiving the data from users, the central server iteratively trains a deep neural network (DNN) model until it converges. In the end, users can download the DNN model and enjoy intelligent services. However, such training framework can easily lead to the leakage of user privacy, as users' private data is handed over to a third party.}
To address this issue, recently proposed federated learning (FL) is a distributed and privacy-protected architecture in which users collaboratively train and maintain a shared model under the architecture of a central server. Fig.~\ref{fig:FL} depicts an overview of the standard FL architecture. In each iteration, the server first broadcasts a global model to a set of randomly chosen distributed users, each of which will then re-train a local model using their own data. After completing the local training, the users send the update (\textit{i.e.}, the local model) to the server for aggregation and generating a new global model. The iteration repeats until the global model converges.
However, FL still faces many technical challenges, such as vulnerability to Byzantine attack, high communication overhead, dependence on the assumption of IID (\textit{i.e.}, independently and identically distributed data). In this paper, we mainly focus on defense schemes against Byzantine attacks.
\subsection{Byzantine Attack}
Recent works show that standard federated learning is vulnerable to Byzantine attacks carried out by faulty or malicious clients. Even if there is only one attacker, the model accuracy can drop from 100$\%$ to 0$\%$. For example, in an extreme case where an attacker knows the local updates of all benign clients, it only needs to set its update to the opposite of the linear combination of other normal updates to offset the effect of benign clients, then the accuracy of the aggregated global model can be reduced to 0$\%$ with a high possibility. We classify malicious attacks into two types based on which step in FL the malicious clients aim to breach:
\begin{enumerate}[1)]
\item Training data based attack: This kind of attack is also known as the data poisoning attack, which aims to mislead the global model by manipulating the local training data. In general, there are three main approaches for this attack:
\begin{itemize}
\item \textbf{Label flipping.} The attacker ``flips'' the labels of its training data to arbitrary ones (\textit{e.g.}, via a permutation function).
\item \textbf{Adding noise.} An attacker contaminates the dataset by adding noises to degrade the quality of models.
\item \textbf{Backdoor trigger.} An attacker injects a trigger into a small area of the original dataset to cause the classifier misclassifying into the target category.
\end{itemize}
\item Parameter based attack: This attack method involves altering local parameters (\textit{i.e.}, gradient or model) so that the central server aggregates a corrupted global model. There are two ways to modify the parameters:
\begin{itemize}
\item \textbf{Nonrandom modification.} Modifying the direction or the size of the parameters based on the model faithfully learned from the local dataset, \textit{e.g.}, flipping the signs of local iterates and gradients, or enlarging the magnitudes.
\item\textbf{Random modification.} Modifying the parameters directly, \textit{e.g.}, randomly sampling a number from the Gaussian distribution and treating it as one of the parameters of the local model.
\end{itemize}
\end{enumerate}
\section{Existing defense schemes}
Depending on the principles that the server relies on for detecting or evading anomalous updates, the existing defense schemes can be divided into four categories: the distance based defense schemes, the performance based defense schemes, the statistics based defense schemes and the target optimization based defense schemes.
\subsection{The Distance based Defense Schemes}
This kind of defense schemes aims to detect and discard bad or malicious updates by comparing the distances between the updates. The update which is apparently far away from the others is regarded as malicious. These schemes are usually easy to implement .
Blanchard \textit{et al.}~\cite{b1} proposed Krum and its variant, called Multi-Krum. In Krum, the central server chooses only one update that is closest to its neighbors to update the global model, and discards all the other updates, whereas Multi-Krum chooses multiple updates and computes the mean to update the global model. Similar to Multi-Krum, FABA \cite{b2} aims to remove the outliers in the uploaded gradients by discarding the gradients that are far away from the mean gradient. However, both Multi-Krum and FABA need to know the number of malicious clients in advance, which makes them difficult to be applied to practical applications. To get rid of this limitation, FoolsGold \cite{b9} uses cosine similarity to identify malicious updates and assigns them a low weight to reduce their impact on the global model. In their viewpoint, the updates from attackers have nearly the same direction, thus the cosine similarities between abnormal updates should be extraordinarily large. Based on this observation, the central server can find an abnormal update and assigns them low weights. Cao \textit{et al.}~\cite{b13} proposed Sniper, which utilizes Euclidean distances between local models to construct a graph, based on which a set of updates will be selected for aggregation. The above defenses apply to the scenario where malicious updates are far from each other (\textit{i.e.}, non-sybil case), however, attackers may collude to upload extremely similar or even identical updates to make the attack more covert (\textit{i.e.}, sybil case). In light of this, Wan \textit{et al.}~\cite{WeightAttack} proposed a density-based anomaly algorithm to detect similar updates. Nevertheless, the defense only focuses on the sybil case and ignores the non-sybil case. To deal with both sybil and non-sybil cases simultaneously, Wan \textit{et al.}~\cite{MAB-RFL} proposed a two-pronged defense called MAB-RFL, which first discards the updates that are excessively similar in direction through graph theory, aiming to cope with the collusion attack. Then it utilizes principal components analysis (PCA) to extract the key parameters lie in the updates, because benign and malicious updates are easier to distinguish (\textit{e.g.}, through agglomerative clustering) in the new low-dimensional parameter space. In this way, the non-sybil challenge can be settled.
\subsection{The Performance based Defense Schemes}
In this category, each update will be evaluated over a clean dataset provided by the server, such that any update that performs poorly will be assigned low weights or removed directly.
Li \textit{et al.}~\cite{b3} leveraged a pre-trained autoencoder to evaluate the performance. For a benign model update, the autoencoder will output a vector that is similar to the input, but an abnormal update will generate a large gap. However, training an autoencoder is time-consuming, and it is difficult to get the training set that includes sufficient benign model updates. In contrast, Zeno \cite{b4} only requires a small validation set on the server-side. Specifically, Zeno computes a score for each candidate gradient with the validation set. The score is composed of two parts: the estimated descendant of the loss function, and the magnitude of the update. A higher score of the update implies better performance, indicating a higher probability of being reliable. Nevertheless, Zeno requires the knowledge about the number of attackers. To address this problem, Cao \textit{et al.}~\cite{b14} proposed a Byzantine-robust distributed gradient algorithm, which can filter out information received from the compromised clients by computing noisy gradient with a small clean dataset. The update whose distance with the noisy gradient satisfies a pre-defined condition will be accepted. However, the defense proposed by Cao \textit{et al.}~\cite{b14} heavily relies on the setting of hyper-parameters, which may difficult to find when putting it into practice. In light of this, Cao \textit{et al.}~\cite{FLTrust} proposed FLTrust, which utilize ReLU-clipped cosine similarity between each local update and the server update (calculated based on the clean dataset collected by the central server) to allocate trust score for the local update. A reliable update will obtain a high trust score due to its consistency with the golden standard (\textit{i.e.}, the server update), while a malicious update will obtain a 0 trust score. The higher the trust score, the greater the weight of the corresponding local update
when aggregation.
\subsection{The Statistics based Defense Schemes}
Schemes in this category exploit the statistical characteristics of uploaded updates, such as the median or mean, to circumvent abnormal updates to get a robust one.
Yin \textit{et al.}~\cite{b7} proposed two robust distributed gradient descent algorithms by computing coordinate-wise median and the coordinate-wise trimmed mean of all local updates in each dimension, respectively. Meanwhile, Xie \textit{et al.}~\cite{b8} proposed three aggregation rules: geometric median, marginal median, and ``mean around median''. The geometric median intends to find a new update that minimizes the summation of the distances between the update and each local update. The marginal median is similar to the coordinate-wise median proposed in \cite{b7}. The ``mean around median'' takes the average of the values near to the median for each dimension of local update to obtain a new global update. However, the scheme in \cite{b8} needs to call a secure average oracle many times, which incurs expensive computational overhead. In light of this, Pillutla \textit{et al.}~\cite{b10} proposed RFA (Robust Aggregation for Federated Learning) by computing the geometric median with a alternating minimization approach, which calls the secure average oracle for only three times. Bulyan \cite{b11}, which is modified based on \cite{b7}, executes a robust detection algorithm, such as Multi-Krum, before the aggregation with trimmed mean. The experimental results show that Bulyan performs better than using Krum alone. Mu{\~{n}}oz{-}Gonz{\'{a}}lez \textit{et al.}~\cite{b6} proposed AFA (Adaptive Federated Averaging), which separately computes the cosine similarity between each local model and the global model, and discards bad models based on the statistical distribution of the median and the average of these cosine similarities. Xie \textit{et al.}~\cite{b12} also used trimmed mean as the aggregation rule, and they further proposed a moving-average method, which considers global models in two successive rounds.
\subsection{The Target Optimization based Defense Schemes}
The target optimization based defense schemes refer to optimizing a different objective function to improve the robustness of the global model.
Li \textit{et al.}~\cite{b5} proposed RSA (Byzantine-Robust Stochastic Aggregation), which adds a regularization term to the objective loss function, such that each regular local model is forced to be close to the global model. As far as we know, this is the only work in this category so far.
\begin{table*}[!t]
\centering
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}
\renewcommand{\arraystretch}{1.2}
\addtolength{\tabcolsep}{-4pt}
\begin{tabular}{ |M{8em}||M{7em}|M{7em}|M{10em}|M{10em}|M{6em}|M{10em}| }
\hline
\textbf{Solution} & \textbf{Category} & \textbf{Target attack} & \textbf{The number of attackers} & \textbf{Model accuracy} & \textbf{Data distribution} & \textbf{Time complexity} \\
\hline
Multi-Krum \cite{b1} & Distance based & Data/parameter based & Less than 50$\%$ & Medium & IID & ${\mathcal O}(K^{2}d)$ \\
\hline
FABA \cite{b2} & Distance based & Data/parameter based & Less than 50$\%$ & Medium & IID & ${\mathcal O}(K^{2}d)$ \\
\hline
Sniper \cite{b13} & Distance based & Data based & Less than 50$\%$ & Medium & IID & ${\mathcal O}(K^{2}d)$ \\
\hline
FoolsGold \cite{b9} & Distance based & Data/parameter based & No limitation & Medium (FoolsGold) High (FoolsGold+Multi-Krum) & IID/non-IID & ${\mathcal O}(K^{2}d)$ \\
\hline
Wan \textit{et al.} \cite{WeightAttack} & Distance based & Parameter based & Less than $50\%$ & High & IID & ${\mathcal O}(K^{2}d)$ \\
\hline
MAB-RFL \cite{MAB-RFL} & Distance based & Data/parameter based & Less than $50\%$ & High & IID/non-IID & ${\mathcal O}(K^{2}d)$ \\
\hline
Li \textit{et al.} \cite{b3} & Performance based & Data/parameter based & Less than 50$\%$ & High & IID/non-IID & ${\mathcal O}(Kd)$ \\
\hline
Zeno \cite{b4} & Performance based & Data/parameter based & No limitation & High & IID/non-IID & ${\mathcal O}(Kd)$ \\
\hline
Cao \textit{et al.} \cite{b14} & Performance based & Data/parameter based & No limitation & High & IID & ${\mathcal O}(Kd)$ \\
\hline
FLTrust \cite{FLTrust} & Performance based & Data/parameter based & No limitation & High & IID/non-IID & ${\mathcal O}(Kd)$ \\
\hline
AFA \cite{b6} & Statistic based & Data/parameter based & Less than 50$\%$ & High & IID & ${\mathcal O}(K^{2}d)$ \\
\hline
GeoMed \cite{b8} \newline MarMed \cite{b7,b8} \newline Trimmed mean \cite{b7,b8} & Statistic based & Data/parameter based & Less than 50$\%$ & High & IID/non-IID & ${\mathcal O}(KdlogK)$ \\
\hline
Bulyan \cite{b11} & Statistic based & Data/parameter based & Less than 50$\%$ & Medium & IID & ${\mathcal O}(K^{2}d)$ \\
\hline
SLSGD \cite{b12} & Statistic based & Data/parameter based & Less than 50$\%$ & Medium & IID/non-IID & ${\mathcal O}(KdlogK)$ \\
\hline
RFA \cite{b10} & Statistic based & Data/parameter based & Less than 50$\%$ & Medium & IID & ${\mathcal O}(Kd)$ \\
\hline
RSA \cite{b5} & Target optimization based & Data based & No limitation & High & IID/non-IID & ${\mathcal O}(Kd)$ \\
\hline
\end{tabular}
\caption{A comprehensive comparison of Byzantine-robust FL method. The model accuracy represents the prediction accuracy of the defense scheme, and ``Medium'' and ``High'' indicate that the accuracy is below and close to that of non-attacker case, respectively. ``IID'' means that the users’ local data sets are independently and identically distributed, while ``non-IID'' indicates otherwise. $K$ denotes the number of users and $d$ denotes the model size.}
\label{tab:compALL}
\end{table*}
\section{A comprehensive comparison}
Based on the above discussion, we know that the distance based defense schemes usually rely on the assumption that the parameter distribution of a malicious attacker is scattered and deviates from the benign ones, so it is only suitable to resist the attacks that generate evident abnormal parameters. For example, the label flipping attack can easily cause significant changes in parameters. However, it is obvious that such defense schemes perform poorly when the attack causes faint changes.
The performance based defense schemes detect anomalous updates by directly verifying their performance, which is much more reliable than other solutions. For example, Zeno \cite{b4} is superior to Krum under both the data based attack (\textit{e.g.}, sign flipping) and the parameter based attack (\textit{e.g.}, random gradient). However, it relies on a clean auxiliary data set for examination, which hampers its practicability. Besides, scheme \cite{b3} has a high time complexity since the time-consuming pre-training is required when using the auto-encoder.
The statistics based defense schemes rely on computing median or mean to evade abnormal parameters, making it only suitable to the situation where the number of malicious users is less than half of the total users, otherwise legitimate updates will be left out when malicious updates dominate. In comparison, the target optimization based defense scheme enjoys a high efficiency. For instance, according to the experimental results in \cite{b5} conducted on the MNIST dataset, the time cost of RSA is around 45s, while Median, Krum, and GeoMed cost about 50s, 62s, and 127s, respectively.
TABLE~\ref{tab:compALL} presents a comprehensive comparison among existing solutions.
We can see that various defense strategies have already been proposed, each of which has its own merits and demerits, and many tough issues have been discussed in detail, such as non-IID condition, more than 50\% attackers, \textit{etc. } Nevertheless, we emphasize that it is still far from practice to deploy a secure framework for FL in the presence of Byzantine attacks.
{\color{black}Fully protecting FL that integrally considers the issues including efficiency, data privacy, and data distribution is an extremely challenging problem, especially when there still exist many attack surfaces in its standard process. In the next section, we will present a newly found attack approach to support our observation. }
\section{Weight attack}
In this section, we propose a new attack approach called weight attack to circumvent those defense schemes. The key idea lies in manipulating the drawbacks of the weight assignment strategy that have not received enough attention yet. {\color{black}Our attack is simple and easy to carry out in practice, and performs well even when those defense schemes were deployed.}
\subsection{System Overview}\label{Sec:SysOverview}
In the standard federated learning setting, when aggregating updates in each iteration, the weight assigned to each update totally depends on the size of the local training data set~\cite{b1,b2,b4,b12,b13,b14}. The central server has no authority or effective means to check the sizes and quality of clients' training data, due to the privacy reasons. Therefore, the local data set size is declared by the clients themselves without any verification.
Based on this observation, any malicious client can arbitrarily lie about its data set size for gaining a high weight.
According to the way the attackers declare their training data set sizes, we consider the following two simple misreport cases:
\begin{enumerate}[1)]
\item The attackers' training data set sizes are much smaller than that of the regular clients, but they declare that they have similar sizes with the regular clients.
\item The attackers and the regular clients have similar training data set sizes, but the attackers declare that their training set sizes are much larger than that of the regular clients.
\end{enumerate}
Obviously, it is very easy for attackers to initiate such attack since the server cannot examine the clients' declarations. Next, we briefly introduce the specific process of the weight attack.
\subsection{Algorithm Design}
\textbf{Step 1.} The central server broadcasts the global model to each selected client.
\textbf{Step 2.} Each client, including the attackers, re-trains the global model based on its local training data set.
\textbf{Step 3.} The clients send the updates to the server. And the attackers misreport their data set sizes, while the regular clients faithfully report their training set sizes.
\textbf{Step 4.} The central server aggregates the received updated models to obtain a new global model and repeats steps 1 to 4 until the global model converges.
\begin{figure*}[t]
\centering
\subfigure[]{
\includegraphics[width=0.45\columnwidth]{20attackers}}
\subfigure[]{
\includegraphics[width=0.45\columnwidth]{30attackers}}
\subfigure[]{
\includegraphics[width=0.45\columnwidth]{40attackers}}
\subfigure[]{
\includegraphics[width=0.45\columnwidth]{50attackers}}
\caption{The accuracy of existing defense schemes under weight attack with: (a) 20$\%$ attackers, (b) 30$\%$ attackers, (c) 40$\%$ attackers, (d) 50$\%$ attackers}
\label{fig:accuracy}
\end{figure*}
\section{Experiments and evaluation}
In this section, we conduct experiments to show the effectiveness of the weight attack. The experiments are implemented with Tensorflow on CIFAR-10 image classification dataset, which is composed of 50K images for training and 10K images for testing. We use CNN with 2 convolutional layers followed by 2 fully connected layers. Since our purpose is to examine the effectiveness of the weight attack, we omit the client selection process and assume that there are 20 clients in total and all of them are selected in each round.
We only consider the first misreport case defined in Section~\ref{Sec:SysOverview} since it is more practical than the second case. This is because if a bad node claims to have a larger dataset size than that of regular clients, the central server is easier to find abnormality and thus require the node re-upload the local update or prove that the update is indeed derived from the claimed dataset size.
In the first misreport case, however, all the dataset sizes are similar, the central server cannot tell which nodes might be malicious just from the dataset sizes.
{\color{black}We test four typical defense schemes (\textit{i.e.}, Multi-Krum, FABA, Zeno, and Median), and evaluate the weight attack with 4, 6, 8, and 10 attackers among 20 clients, \textit{i.e.}, there are 20$\%$, 30$\%$, $40$\% and 50$\%$ attackers, respectively. We set the training data set size (\textit{i.e.}, number of images) to be 2500 and 100 for regular clients and attackers, respectively. But they gain equal weight for each update on the server side. And it should be noted that the clients' data is allocated in an IID way. Specifically, we randomly scramble all the data and allocate the appropriate amount of data based on the dataset size of each client. As a comparison, we also consider the case without attackers.}
In Fig.~\ref{fig:accuracy}, we observe that with 20$\%$ attackers, Multi-Krum, FABA, and Median have similar performance, and their accuracy is lower than the case without attacker, while Zeno performs slightly worse than the other three schemes. In the case of 30$\%$ attackers, the accuracy of Multi-Krum and FABA is significantly affected. In comparison, Median and Zeno performs better than Multi-Krum and FABA, and their accuracy is about 52$\%$. When there are 40$\%$ attackers, Zeno performs similar to the case of 30$\%$ attackers, while the accuracy of the other three schemes is further reduced. In the case of 50$\%$ attackers, Multi-Krum and FABA cannot converge, and both of them have low accuracy (\textit{i.e.}, 20$\%$). Although Zeno and Median perform better, their accuracy is still 10$\%$ lower than the case without attacker.
We also give a comparison between our weight attack with two typical Byzantine attacks: label flipping attack and sign flipping attack.
In the sign flipping attack, after obtaining the local model, the attacker multiplies it with a negative number. We set the negative number to be $-4$ in our experiments, which is also adopted in existing works. The experiments are conducted on CIFAR-10 data set, and 40$\%$ participants are malicious among 20 clients. Note that Multi-Krum and FABA are used as the defense.
As shown in Fig.~\ref{fig:attackscompare}, label flipping attack and sign flipping attack have little effect on the accuracy when Multi-Krum or FABA is deployed, and both of the attacks reduce the accuracy by 2$\%$-5$\%$. On the contrary, the weight attack has a high attack success rate, which can reduce the accuracy by 20$\%$.
From the above experiments, we can conclude that the weight attack can indeed decay the existing defense schemes, especially in reducing the prediction accuracy of the global model or even preventing it from converging.
\section{Possible solutions to weight attack}
Existing defense solutions are not able to mitigate the weight attack. The main difficult lies in the fact that the server cannot directly examine the quality of the clients' local data sets. Next, we discuss some possible countermeasures.
Although the distance based schemes such as Multi-Krum and FABA fail to resist the weight attack, we think it is still a promising solution. The reason why both Multi-Krum and FABA fail is that they are inclined to exclude updates that are far from the overall distribution. We hold the viewpoint that by analyzing the distribution of local updates, designing a new distance based strategy is able to directly evade the ``bad'' updates.
Besides, as shown in our experiments, the performance based defense scheme, such as Zeno, performs much better than other schemes. We think this kind of defense scheme can do better in the future, because the most straightforward way to determine whether an update is benign or malicious is to examine its performance. The ``bad'' updates generated from the weight attack are sure to act differently when the clean test data set is well designed for some experiments.
As for the statistics based and the target optimization based defense schemes, we firmly believe that by fully exploiting the statistical characteristics of local updates or selecting a good loss to optimize the objective function, they can mitigate the weight attack effectively as well.
\begin{figure}[t]
\centering
\subfigure[]{
\includegraphics[width=0.45\columnwidth]{attacks_compare_multikrum}}
\subfigure[]{
\includegraphics[width=0.45\columnwidth]{attacks_compare_faba}}
\caption{The comparison between weight attack and existing Byzantine attacks under (a) Multi-Krum, (b) FABA}
\label{fig:attackscompare}
\end{figure}
\section{Challenges and research directions}
Although the Byzantine attacks in FL have attracted much research interest and great efforts have been devoted to designing a secure FL scheme, there are many open problems that need to be further investigated. In this section, we outline some challenges and research directions which we believe are of great significance for defending against Byzantine attacks.
\subsection{Fair Reward Distribution in FL}
The success of the weight attack relies on the assumption that the server assigns the weight to updates according to the local training data set size of each client. It enables attackers to arbitrarily claim their workload in the local training by falsely reporting their data set size. Moreover, even if the server has deployed effective detection methods, if any, to discard bad updates generated from the weight attack, the clients may also tend to misbehave (\textit{e.g.}, being lazy) since they will finally share the same global model, no matter how many data sets are used for local training or how much computing power are devoted.
In light of this, we emphasize that it is of significant importance to design a fair incentive mechanism before putting FL into practice. Apart from the training data set size, more metrics (\textit{e.g.}, model quality, computing resources, past behavior) should be included to evaluate the contribution of each client such that they will be fairly rewarded. As a result, each client is incentivized to do correct computations. This can not only discourage the weight attack, but also motivate clients to contribute more resources to speed-up the local training.
\subsection{Defending Attacks with Privacy Protection}
The primary goal of federated learning is to protect users' privacy by requiring them to upload local updates instead of their training data. However, recent research~\cite{ModelInversion} has shown that deep models will also reveal private information about the training data. Existing defense schemes mainly focus on mitigating Byzantine attacks, but ignore the possible privacy leakage through the updates.
Hence, it is necessary to consider privacy protection while defending against Byzantine attackers simultaneously. The most straightforward solution is letting the client encrypt local updates before uploading them to the central server, who can carry out a defense scheme to detect anomaly over encrypted data. Then the central server broadcasts the encrypted global model to clients for decryption and proceeds to the next iteration. The main challenge for this method lies in designing a secure computation protocol that can effectively detect anomaly while protecting the privacy of update, without affecting the performance of the final global model at the same time. Cryptographic tools such as homomorphic encryption or garbled circuit can provide accurate computations over encrypted data, but they will bring a high computation overhead. Other privacy-enhancing techniques like differential privacy, or hardware-based trusted execution environment enjoy a high efficiency, but they may cause loss on the model accuracy or cannot fully protect the private information. A trade-off between efficiency, security, and privacy needs to be carefully considered for specific application scenarios.
\subsection{Shielding FL in Label Deficiency Scenario}
Nearly all the existing Byzantine-robust defenses focus on the label sufficiency scenario, where each client is equipped with fully labeled data. In other words, they concentrate on supervised learning tasks. However, in real-world scenarios, clients' data may be slightly labeled or even totally unlabeled due to the lack of expertise and motivation of the clients to label their own data. Although a few works~\cite{FSSL1,FSSL2,FSSL3} begin to research how to train a high-quality global model in the label deficiency scenario, the security problem is overlooked.
One may expect to directly apply existing defenses to the label deficiency FL scenario, however, this may not work. As we know, one key reason why detecting malicious updates in non-IID scenario is difficult lies in the tremendous differences between benign updates, which makes it intractable to distinguish between benign updates and malicious ones. Worse still, the differences will be amplified in the label deficiency scenario. Because the pseudo-labels generated by the local model may be incorrect, especially in the early iterations, which may be caused by the low-quality of the received global model. On the other hand, one usually sets a confidence threshold to make the pseudo-labels more reliable, so only those highly confident data will be used for training, making the local updates biased.
Therefore, shielding FL in label deficiency scenario is challenging and significant. We argue that variance reduction techniques (\textit{e.g.}, resampling~\cite{resampling}, grouping~\cite{groupingFSSL} and momentum~\cite{momentum}) will be promising to solve the problem, as they have shown splendid performance in coping with the data heterogeneity challenge. By reducing the differences between benign updates, an IID-like distribution can be built, which is more conducive to detecting malicious updates for the server.
\section{Conclusion}
The advance of federated learning has given researchers a new direction in addressing the security and privacy issues of distributed training. Mitigating Byzantine attacks is important for securing federated learning. In this article, we review existing solutions for defending against Byzantine attacks. After a comprehensive comparison and discussion, we propose a new attack method that can pose threats to existing defense schemes, supported by our experimental results. Finally, we indicate several challenges and the future research direction of FL.
\section*{Acknowledgments}
Shengshan’s work is supported in part by the National Natural Science Foundation of China (Grant Nos. 62002126, U20A20177), and Fundamental Research Funds for the Central Universities (Grant No. 2020kfyXJJS075). Leo’s work is supported in part by the National Natural Science Foundation of China (Grant No. 61702221). Wei's work is supported in part by Ant Group. Shengshan is the corresponding author.
\bibliographystyle{IEEEtran}
| {'timestamp': '2022-10-10T02:04:56', 'yymm': '2112', 'arxiv_id': '2112.14468', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14468'} | arxiv |
\section{Introduction}
The panoramic camera is a new type of camera to capture images with $180^\circ\times360^\circ$ field of view (FoV), which is convenient to obtain omnidirectional spatial information in a single shot without the post-calibration and stitching.
With its wide usage in the fields such as virtual reality (VR) and security monitoring in recent years,
panorama depth estimation is a crucial step in a variety of downstream applications, such as semantic segmentation, layout recovery, and 3D reconstruction, to name a few.
Generally, panorama images are represented as images on the sphere grid for warp and weft by the equirectangular projection (ERP). However, the geometric structure in the higher latitude areas is distorted since the spatial sampling rate changes with latitude.
Therefore, accurate depth estimation is difficult with conventional convolution networks in these areas.
Early works \cite{DBLP:journals/corr/abs-1709-04893,DBLP:conf/iclr/CohenGKW18} define the spherical CNNs to process the spherical signals but cause the high resource expenditure.
And some others \cite{DBLP:conf/nips/SuG17,DBLP:conf/eccv/TatenoNT18,DBLP:conf/eccv/CoorsCG18,DBLP:journals/ral/Fernandez-Labrador20} propose the different custom convolutions to deform the convolution kernels according to the geometric structures in the 3D space of the ERP coordinates.
These adaptive convolution kernels expand the receptive fields near the poles according to the corresponding latitude coordinates.
However, these methods still have a great potential to be further improved.
\begin{figure}[tb]
\centering
\includegraphics[width=0.45\textwidth]{teaser.pdf}
\caption{Reconstructed results of different models. Left: the panorama color image and the predicted depth maps. Right: point clouds generated from the ground-truth and predicted depth maps with inverse equirectangular projection. Note that our predicted depth map has more clear edges and also generates a more accurate point cloud in both overall shape and object details.}
\label{fig:teaser}
\end{figure}
On the other hand, BiFuse \cite{DBLP:conf/cvpr/WangYSCT20} and UniFuse \cite{DBLP:journals/ral/JiangSZDH21} project the ERP image to the cubemap images to solve the distortion with the perspective projection. However, due to the limitation of the FoV in the cubemap branch, the overall layout in the reconstructed scenes can not be well restored.
Besides, HoHoNet \cite{Sun_2021_CVPR} and SliceNet \cite{Pintore_2021_CVPR} extract the horizontal 1D feature maps from gravity-aligned equirectangular projection and recover the dense 2D predictions. However, it is hard to recover the details in the columns from 1D features (see Fig.\ref{fig:teaser}). Thus, the balance between quantitative results and visual effects still needs to be considered.
In this paper, we propose the ACDNet based on the adaptively combined dilated convolution for the panoramic monocular depth estimation.
We combine the convolution kernels with different dilations to extend the receptive field in the equirectangular projection.
Meanwhile, we use an adaptive channel-wise fusion module to summarize the feature maps and get diverse attention areas in the receptive field along different channels.
Different from methods \cite{DBLP:conf/nips/SuG17,DBLP:conf/eccv/TatenoNT18,DBLP:conf/eccv/CoorsCG18,DBLP:journals/ral/Fernandez-Labrador20} that calculate the shapes of convolution kernels according to the latitude coordinates, we learn the focused areas in different feature channels that help the network to capture the cross-channel contextual information.
Finally, we evaluate our method on both virtual and real-world panoramic RGB-D datasets. The experimental results show that our ACDNet and the adaptively combined dilated convolution outperform the current state-of-the-art methods.
In summary, the main contributions of this work can be summarized as follows:
\begin{itemize}
\item[1.] We propose the adaptively combined dilated convolution to process the panorama images for monocular depth estimation, and it can be easily embedded into convolution networks by replacing the regular convolution.
\item[2.] The interest areas can be obtained by learning different attention scores in different channels, which is more suitable for panoramic images than explicitly deforming convolution kernels in different latitudes.
\item[3.] We perform the monocular panorama depth estimation experiments on both virtual and real-world RGB-D panorama datasets, which outperforms the SOTA methods in both quantitative metrics and visual effects.
\end{itemize}
\section{Related Work}
In this section, we describe the overview of researches on panorama depth estimation and simply introduce the applications of dilated convolution in CNNs.
\begin{figure*}[tb]
\centering
\includegraphics[width=0.9\textwidth]{network.pdf}
\caption{The architecture of our ACDNet.}
\label{fig:network}
\end{figure*}
\subsection{Panorama Depth Estimation}
Depth estimation is an important step for 3D reconstruction, and panorama images can capture the omnidirectional spatial information for the global structure, which conduces to recover the depth in areas with weak textures.
OmniDepth \cite{DBLP:conf/eccv/ZioulisKZD18} first proposes the RectNet to estimate the depth map with a single panorama image and shows better performance than individually processing the different views of cubemap projection (CMP).
However, this method is limited by the distortion of the geometric structures and the decrease of the FoV near the poles for panoramic images in the equirectangular projection. There are some main types of existing methods to solve this problem.
Firstly, some methods ~\cite{DBLP:conf/eccv/CoorsCG18,DBLP:conf/eccv/TatenoNT18,DBLP:journals/ral/Fernandez-Labrador20,DBLP:journals/corr/abs-1906-11096} deform the convolution kernels to adaptively extend the receptive fields of custom convolutions. Specifically, SphereNet \cite{DBLP:conf/eccv/CoorsCG18} and DistConv \cite{DBLP:conf/eccv/TatenoNT18} calculate the sampling positions for the convolution kernels with inverse gnomonic projection, and CFL \cite{DBLP:journals/ral/Fernandez-Labrador20} defines the convolution over the field of view on the spherical surface with longitudinal and latitudinal angles.
Besides, mapped convolution ~\cite{DBLP:journals/corr/abs-1906-11096} proposes a more general method to process images of any structured representation by accepting the corresponding mapping function.
These methods all produce the different convolution kernels with the change of latitude coordinates in the ERP.
Secondly, some other methods introduce the additional CMP branch with perspective projection into the network. BiFuse uses their proposed bi-projection fusion module to fuse the feature maps in two complete encoder-decoder branches. Furthermore, UniFuse removes the CMP decoder branch and proposes a more effective unidirectional fusion module. However, due to the limitation of the FoV, the CMP branch can not extract good features from areas with weak textures, e.g., the ceilings and the floors, which cripples the ability for fused features to express the spatial structures.
Last, recent works HoHoNet and SliceNet compress the 2D features to 1D features from gravity-aligned panoramic images, then they apply the RNNs to capture the global context information.
There are also still other methods to estimate panoramic depth with different strategies, including deformable convolution kernels \cite{DBLP:conf/icra/ChengWZGY20,DBLP:journals/spl/ChenLFLCG21}, geometric guidance \cite{DBLP:conf/3dim/EderMG19,DBLP:conf/cvpr/JinXZZTXYG20,DBLP:conf/eccv/ZengKG20}, self-supervised/unsupervised learning \cite{DBLP:conf/3dim/ZioulisKZAD19,DBLP:conf/itsc/ZhouWY20}, and stereo matching \cite{DBLP:conf/icra/WangSTCS20}.
These existing methods have achieved good results on depth estimation with panoramic cameras. But there is still much room for improvement in terms of quantitative results or visual effects.
\subsection{Dilated Convolution}
It is proved that dilated convolution is an effective tool for the increment of the receptive field without additional parameters and down-sampling. Apart from semantic segmentation \cite{DBLP:journals/pami/ChenPKMY18} and object detection \cite{DBLP:conf/eccv/LiuAESRFB16}, dilated convolution is also widely utilized on some other tasks such as depth estimation.
Earlier works \cite{DBLP:conf/cvpr/YuKF17,DBLP:conf/pcm/MaDWZL18} simply embed the dilated convolutions in the network. And many works use the atrous spatial pyramid pooling (ASPP) \cite{DBLP:journals/pami/ChenPKMY18} or a similar module to model contextual information. Some works \cite{DBLP:conf/cvpr/FuGWBT18,DBLP:conf/wacv/FangCCG20,DBLP:conf/eccv/ZhangYWCW20,DBLP:journals/corr/abs-2106-08615} introduce ASPP to aggregate multi-scale contextual information for better monocular depth estimation. Besides, MSDC-Net \cite{DBLP:journals/access/TianZRWHH19} combines the res-block module with different dilated rates to build the irregular shape ResNet \cite{DBLP:conf/cvpr/HeZRS16} module. CrossGuidance \cite{DBLP:journals/access/LeeLKK20} proposes a residual atrous spatial pyramid (RASP) block to analyze the large input images. And MAPUnet \cite{DBLP:journals/access/YangWZZSY21} develops the multi-layers DenseASPP with more scales to cover more pixels.
Different from modules similar to ASPP, we combine the dilated convolutions as an equivalent large kernel convolution and apply it to replace the regular convolution layers in ResNet blocks. This operator enlarges the receptive field and produces a variety of interest areas in the receptive field.
\section{Approach}
For the reconstruction of the indoor scene with a single panoramic image, we propose the ACDNet with adaptively combined dilated convolution (ACDConv) layers to estimate the depth map.
In the following text, we first present the architecture of the ACDNet, then we show the implementation of the ACDConv to extract feature maps from panorama images. Finally, we introduce the loss function in our approach.
\subsection{Architecture}
We propose the ACDNet to estimate the depth map with a single panorama image as illustrated in Fig.\ref{fig:network}. In general, the ACDNet is a conventional network with ResNet blocks based on the ACDConv and the iterative depth prediction process. Specifically, given an input panoramic color image, the encoder extracts feature maps in five downsampling scales with the ResNet blocks. Here, the $3\times3$ convolution layers are replaced by our proposed ACDConv, the detail is introduced in the following sub-section. Second, the decoder upsamples the feature maps with up-convolution modules \cite{DBLP:conf/3dim/LainaRBTN16} and produces the depth maps in 4 different scales. The first coarse depth map $D_0$ is generated at the 1/8 downsampling level (level $0$), then the subsequent residual maps $\{R_i\}_{i=1}^3$ are produced in the following decoder blocks. The depth map $D_i$ at level $i$ is formulated as $D_i = \tilde{D}_{i-1}+R_i$, where $\tilde{D}_{i-1}$ is up-sampled from $D_{i-1}$ with bilinear interpolation.
\begin{figure}[tb]
\centering
\includegraphics[width=0.45\textwidth]{pad.pdf}
\caption{The circular padding for panoramic feature maps. The elements with the same color are selected to pad each other.}
\label{fig:pad}
\end{figure}
Besides, the circular padding ~\cite{DBLP:conf/icra/WangHLHZS18} is utilized to maintain a complete and continuous spatial field of view for panoramic images. As shown in Fig.\ref{fig:pad}, we select feature items along the longitudinal direction near the poles and the latitudinal direction near the other boundaries. The circular padding maintains the continuity of spatial information on the sphere surface and avoids the invalid padding elements for dilated convolutions.
\subsection{Adaptively Combined Dilated Convolution}
The panorama image expands the spherical imaging result to a rectangular image, which causes the narrow FoV near the poles for regular convolutions. Previous works have developed different custom convolutions to extend FoV near the poles. In this paper, we combine the regular convolutions with different dilations to increase the FoV. Moreover, we introduce an adaptive channel-wise fusion (ACF) module to aggregate the feature maps and get diverse attention areas in the receptive field along the channels.
\begin{figure}[tb]
\centering
\includegraphics[width=0.45\textwidth]{convolution.pdf}
\caption{Our adaptively combined dilated convolution layer. The label $R^n$ in the figure means the n-th choice of the four dilation rate settings.}
\label{fig:convolution}
\end{figure}
The details of our proposed ACDConv are illustrated in Fig.\ref{fig:convolution}. First, given the input features \newchange{$F_{input}\in \mathbb{R}^{C\times H\times W}$}, we use the different convolutions with a group of dilation settings to extract feature maps \newchange{$\{F^i\}_{i=1}^4\in \mathbb{R}^{C'\times H\times W}$} from the input features in parallel. Then, a learnable ACF module is applied to integrate the feature maps. Specifically, we first get the intermediate mean feature and utilize the global average pooling to obtain a vector \newchange{$V\in \mathbb{R}^{C'}$}. \newchange{After that, the fully connected layers predict the probability vectors $\{V^i\}_{i=1}^4\in \mathbb{R}^{C'}$ for different feature maps, and the softmax function is applied to produce the channel-wise fusion weights as follows:
\begin{align}
W^i_c=\frac{\exp{V^i_c}}{\sum^4_{j=1}{\exp{V^j_c}}}
\end{align}
Finally, the feature maps $F^i$ from different convolutions are summarized with the channel-wise weights $W^i$ to generate the final feature maps $F_{output}=\sum_i{F^iW^i}$ and get a large receptive field.}
On the other hand, we draw the receptive fields of different convolutions in Fig.\ref{fig:rf}, including the regular $3\times3$ convolution, the custom convolution with inverse gnomonic projection in SphereNet, and our adaptively combined dilated convolution. As shown in Fig.\ref{fig:rf} (a), the vanilla convolution always keeps the $3\times3$ receptive field in the different latitudes of the ERP, and SphereNet deforms the convolution kernel according to the latitudes to extend the receptive field, especially in the poles areas (see Fig.\ref{fig:rf} (b)). Our combined convolution keeps the shape of a large receptive field in the different latitudes of the ERP as shown in Fig.\ref{fig:rf} (c). More importantly, different attention weights in diverse areas of the combined receptive field along the channels can be acquired after the weighted summarization. Besides, we set the dilation settings as $1\times1$, $1\times2$, $1\times4$, and $2\times1$ in our experiments.
\begin{figure*}[tb]
\centering
\includegraphics[width=0.9\textwidth]{rf.pdf}
\caption{Receptive fields (RF) of different convolutions. In sub-figure (c), the items with the same color in a sub-area of a receptive field have the same interest scores.}
\label{fig:rf}
\end{figure*}
\subsection{Loss Function}
In our approach, we use the BerHu \cite{DBLP:conf/3dim/LainaRBTN16} loss function to supervise the training process for the network, which is formulated as:
\begin{align}
L(d_i,\widetilde{d}_i) = \left\{
\begin{matrix}
|\Delta| & |\Delta|\le c \\
\frac{|\Delta|^2+c^2}{2c} & |\Delta|> c
\end{matrix}
\right.
\end{align}
where $\Delta=d_i-\widetilde{d}_i$, and $d_i,\widetilde{d}_i$ are the estimated depth and the ground truth on pixel $i$ of input image respectively.
For each input image, the parameter $c$ is set as
\begin{align}
c=\frac{1}{5}\max_i |d_i-\widetilde{d}_i|
\end{align}
Finally, we apply the BerHu loss on $D_3$, the shape of which is the same as the input image, and $\{D_i\}_{i=0}^2$ are part of the components of $D_3$.
\section{Experiments}
In this section, we first introduce our experiments, including datasets, implementation details, and evaluation metrics. Then, we provide the qualitative and quantitative comparisons of our network with state-of-the-art approaches.
Finally, we perform the ablation experiments to validate the effectiveness of our network structure.
All experiments were conducted on a server computer equipped with an Intel(R) Xeon(R) Gold 6130 CPU processor, 256GB of RAM, and an NVIDIA TITAN RTX 24GB graphics card.
\begin{table*}[!htb]
\centering
\begin{tabular}{ccccccccc}
\toprule
Dataset & Method & MAE$\downarrow$ & RMSE$\downarrow$ & RMSElog$\downarrow$ & AbsRel$\downarrow$ & $\delta^1\uparrow$ & $\delta^2\uparrow$ & $\delta^3\uparrow$\\
\midrule
\multirow{6}{*}{Stanford2D3D} & BiFuse & 0.2343 & 0.4142 & 0.0787 & 0.1209 & 86.60 & 95.80 & 98.60 \\
~ & UniFuse & 0.2082 & 0.3691 & 0.0721 & 0.1114 & 87.11 & 96.64 & 98.82\\
~ & HoHoNet & 0.2027 & 0.3834 & 0.0668 & 0.1014 & \textbf{90.54} & 96.93 & 98.86\\
~ & SliceNet& \textbf{0.1757} & 0.3509 & 0.0801 & 0.0995 & 90.29 & 96.26 & 98.44\\
~ & SphereNet & 0.2253 & 0.3833 & 0.0786 & 0.1234 & 85.39 & 95.67 & 98.33\\
~ & Ours & 0.1870 & \textbf{0.3410} & \textbf{0.0664} & \textbf{0.0984} & 88.72 & \textbf{97.04} & \textbf{98.95} \\
\midrule
\multirow{6}{*}{Matterport3D} & BiFuse & 0.3470 & 0.6259 & 0.1134 & 0.2048 & 84.52 & 93.19 & 96.32 \\
~ & UniFuse & 0.2814 & 0.4941 & 0.0701 & 0.1063 & 88.97 & 96.23 & 98.31\\
~ & HoHoNet & 0.2862 & 0.5138 & 0.0871 & 0.1488 & 87.86 & 95.19 & 97.71\\
~ & SliceNet& 0.3296 & 0.6133 & 0.1045 & 0.1764 & 87.16 & 94.83 & 97.16\\
~ & SphereNet & 0.3167 & 0.5212 & 0.0778 & 0.1258 & 84.34 & 95.49 & 98.17 \\
~ & Ours & \textbf{0.2670} & \textbf{0.4629} & \textbf{0.0646} & \textbf{0.1010} & \textbf{90.00} & \textbf{96.78} & \textbf{98.76}\\
\midrule
\multirow{6}{*}{Structured3D} & BiFuse & 0.0562 & 0.1100 & 0.0295 & 0.0401 & 98.19 & 99.41 & 99.72 \\
~ & UniFuse & 0.0617 & 0.1167 & 0.0324 & 0.0458 & 97.65 & 99.28 & 99.69 \\
~ & HoHoNet & 0.0549 & 0.1088 & 0.0316 & 0.0408 & 97.97 & 99.35 & 99.70 \\
~ & SliceNet& 0.0660 & 0.1290 & 0.0444 & 0.0496 & 97.25 & 99.09 & 99.54\\
~ & SphereNet & 0.0664 & 0.1161 & 0.0368 & 0.0491 & 97.58 & 99.36 & 99.71 \\
~ & Ours & \textbf{0.0454} & \textbf{0.0924} & \textbf{0.0291} & \textbf{0.0327} & \textbf{98.74} & \textbf{99.59} & \textbf{99.82}\\
\bottomrule
\end{tabular}
\caption{Quantitative comparison on different datasets. The best result of each measurement is marked in \textbf{bold} font. Here we re-train the previous works on Structured3D with their source codes at the resolution of $512\times1024$, and the training strategies are the same as ours.}
\label{tab:comparison-1}
\end{table*}
\subsection{Implementation}
\subsubsection{Datasets}
We carry out experiments on both virtual and real-world datasets, including Stanford2D3D \cite{DBLP:journals/corr/ArmeniSZS17}, Matterport3D \cite{DBLP:conf/3dim/ChangDFHNSSZZ17}, and Structured3D \cite{DBLP:conf/eccv/ZhengZLTGZ20}. Both Stanford2D3D and Matterport3D are scanned with RGB-D cameras in the real-world scenes, and they include $1,413$ and $10,800$ RGB-D panoramic views respectively. While Structured3D is rendered with synthetic scenes, and it contains over $196k$ RGB-D panorama images.
For Stanford2D3D and Matterport3D, we follow their official splits with entire panoramic RGB-D pairs to train and test the network. For Structured3D, we just utilize the subset with \textit{rawlight} illumination and \textit{full} furniture settings. The subset includes $21,835$ panoramic RGB-D image pairs, and we follow the official scene split for training and testing.
Moreover, we follow the process strategy for Matterport3D as previous works to merge the 18-views perspective depth images and the rendered skybox color images to panoramic RGB-D image pairs.
\subsubsection{Implementation Details}
We implement our network on the PyTorch \cite{DBLP:conf/nips/PaszkeGMLBCKLGA19} platform. We train our network for 100 epochs on Stanford2D3D, 60 epochs on Matterport3D, and 60 epochs on Structured3D with Adam \cite{DBLP:journals/corr/KingmaB14} optimizer respectively, the learning rate is set as 1e-4 in all the experiments.
Meanwhile, we set the image size as $512\times1024$ with the batch size of 6 on an NVIDIA TITAN RTX graphics card.
\subsubsection{Evaluation Metrics}
We adopt five widely-used evaluation metrics used in previous works to evaluate our method quantitatively, including mean absolute error (MAE), root mean square error (RMSE), logarithmic root mean square error (RMSElog), absolute relative error (Abs Rel), and threshold percentage ($\delta^n$), which can be formulated as:
\begin{itemize}
\item[\textbf{$\cdot$}] $ MAE=\frac{1}{N}\sum_{i=1}^N |d_i-\widetilde{d}_i| $;
\item[\textbf{$\cdot$}] $ RMSE=\sqrt{\frac{1}{N}\sum_{i=1}^N |d_i-\widetilde{d}_i|^2} $;
\item[\textbf{$\cdot$}] $ RMSElog=\sqrt{\frac{1}{N}\sum_{i=1}^N |\log d_i - \log \widetilde{d}_i|^2}$;
\item[\textbf{$\cdot$}] $ Abs Rel=\frac{1}{N}\sum_{i=1}^N |d_i-\widetilde{d}_i|/\widetilde{d}_i$;
\item[\textbf{$\cdot$}] Threshold percentage $\delta^n$ is the percentage of pixels satisfying $\max(\frac{d_i}{\widetilde{d}_i},\frac{\widetilde{d}_i}{d_i})<1.25^n$.
\end{itemize}
Following the previous methods, we clip the estimated depth maps to $10m$ without scale calibration when calculating the evaluation metrics.
\subsection{Comparison Experiments}
In this sub-section, we provide the quantitative comparison and visual comparison to prove the effectiveness of our method.
\subsubsection{Quantitative Comparison}
\newchange{
We compare our ACDNet with previous works on the three above-mentioned datasets, and the quantitative results are shown in Tab.\ref{tab:comparison-1}. Our ACDNet outperforms previous works for most metrics on Stanford2D3D and all metrics on Matterport3D and Structured3D. Note that the results of SliceNet on Stanford2D3D are produced by the fixed parameters in SliceNet's Github repository \footnote{https://github.com/crs4/SliceNet} and differ from the original values in its paper. Specifically, our results exceed the previous state-of-the-art method by $5.1\%$ in MAE metric on Matterport3D and $17.3\%$ on Structured3D as well as reduce the AbsRel metric by $1.1\%$, $5.0\%$, and $18.5\%$ on the three datasets. Besides, we also compare our method with the SphereNet that uses a custom convolution, where we implement by using the same framework and replace the convolution layers in ResNet50 with that in SphereNet. According to the results in Tab.\ref{tab:comparison-1}, our ACDNet with ACDConv also outperforms the distortion-aware convolution with inverse gnomonic projection in SphereNet. On the one hand, the ACDConv expands the receptive field to get a large spatial FoV. On the other hand, it focuses on the various areas in the receptive field along different channels, which makes the convolution kernels learn a variety of latent kernel shapes in different channels, and our network can accommodate the diverse geometric relationships in ERP.
}
\begin{figure*}[tb]
\centering
\includegraphics[width=1.0\textwidth]{visual.pdf}
\caption{Depth maps comparison with other methods. The area with zero values in ground truth means the missing area of depth maps.}
\label{fig:visual}
\end{figure*}
\subsubsection{Visual Comparison}
Furthermore, Fig.\ref{fig:visual} shows our visual comparison results with SOTA methods on three datasets.
As shown in Fig.\ref{fig:visual}, our ACDNet predicts more accurate and detailed depth maps with better visual effects. Firstly, we recover more clear and accurate walls in the invisible areas, as shown in the first row of Fig.\ref{fig:visual}. It can be easily noticed that our ACF module plays a key role in capturing the spatial global context and the circular padding helps to keep the spatial continuity of the panorama images on the sphere.
Compared to our single-branch, the cubemap branch proposed in the UniFuse extracts features with weak texture in the ceiling areas of a narrow FoV, which leads to bad performance in the obscured areas. Secondly, our ACDNet estimates more object details in the depth maps, such as the bookcase in the second row and the bathtub in the third row in Fig.\ref{fig:visual}. Our network also performs well in distinguishing between the background and the foreground objects with similar depth values as shown in the last three rows in Fig.\ref{fig:visual}. Moreover, our ACDNet generates more accurate edges in the depth maps, such as the wall in the third row and the ceiling lamps in the last row in Fig.\ref{fig:visual}. These results demonstrate the better performance of our ACDNet in the depth maps estimation with monocular panorama images.
\subsection{Ablation Studies}
To further verify the effectiveness of our ACDNet, we introduce some groups of ablation studies on the Stanford2D3D dataset in this section. First, we conduct some ablation studies on our ACDConv, including the different parts, the different dilation directions, and the number of dilated convolutions.
\newchange{
Then, we compare the results of different padding methods and study the advantage of iterative depth prediction.
Finally, we test the network with different ResNet backbones. In addition, we also compare the model complexity and inference time with existing methods. In all of these experiments, we use the same hyper-parameters and training strategy on Stanford2D3D.
}
\subsubsection{Adaptively Combined Dilated Convolution}
Here, four experiments are executed to study the roles of the dilated convolution and the ACF module in our ACDConv as shown in Tab.\ref{tab:abs-1}.
First, we remove the ACDConv and use the original ResNet backbone with the regular convolution in our network as the baseline. Then we introduce the ACDConv but replace our ACF module with a simple average operator, denoted as \textit{Simple}.
\newchange{
Moreover, we test two other fusion strategies in ACDConv instead of our channel-wise fusion strategy. Specifically, given the intermediate feature maps $\{F^i\}_{i=1}^4\in \mathbb{R}^{C'\times H\times W}$, the \textit{Row-wise} strategy adds $F^i$ and squeezes the results to row-wise feature vector $V\in \mathbb{R}^{H}$ with averaging operators, then the following MLPs generate the row-wise normalized probability $\{W^i\}_{i=1}^4 \in \mathbb{R}^{H}$ for fusion process. By contrast, the \textit{Pixel-wise} strategy does not squeeze the feature maps and produces pixel-wise normalized probability $\{W^i\}_{i=1}^4 \in \mathbb{R}^{C'\times H\times W}$ with $1\times1$ convolutions.
}
Finally, we also test the popular ASPP module in our baseline which combines the different dilated convolutions to capture multi-scale context.
\begin{table}[tb]
\centering
\begin{tabular}{ccccc}
\toprule
Method & MAE$\downarrow$ & RMSE$\downarrow$ & RMSElog$\downarrow$ & AbsRel$\downarrow$ \\
\midrule
Baseline & 0.2104 & 0.3620 & 0.0746 & 0.1148 \\
Simple & 0.2037 & 0.3582 & 0.0689 & 0.1075 \\
Row-wise & 0.2096 & 0.3694 & 0.0759 & 0.1124 \\
Pixel-wise & 0.2096 & 0.3659 & 0.0720 & 0.1090 \\
Ours & \textbf{0.1870} & \textbf{0.3410} & \textbf{0.0664} & \textbf{0.0984} \\
ASPP & 0.1990 & 0.3633 & 0.0700 & 0.1032 \\
\bottomrule
\end{tabular}
\caption{Ablation studies about ACDConv. In the table, we use the different convolutions in the ResNet50 blocks to build the network.}
\label{tab:abs-1}
\end{table}
As shown in Tab.\ref{tab:abs-1}, simply averaging the features from different dilated convolutions or utilizing the ASPP module can improve the performance on panoramic images, which shows that the large receptive field of convolution contributes to this task.
Our adaptive aggregation operator produces various attention areas on the receptive field and can adapt to the different geometric properties in the different latitudes of panoramic images, thus our full ACDConv outperforms these two methods.
\newchange{
Besides, the adaptively combined dilated convolution with row-wise or pixel-wise fusion strategy hardly improves the results or even makes it worse.
Thus, explicitly combining different dilation at different latitudes or different pixel locations is not suitable for panoramic images and our adaptively learning the receptive field in different feature channels is a more applicable solution, which also explains the reason that the custom distortion-aware convolution does not perform well in this task.
}
\begin{table}[tb]
\centering
\begin{tabular}{ccccc}
\toprule
Method & MAE$\downarrow$ & RMSE$\downarrow$ & RMSElog$\downarrow$ & AbsRel$\downarrow$ \\
\midrule
Baseline & 0.2104 & 0.3620 & 0.0746 & 0.1148 \\
X-axis & 0.1953 & 0.3559 & 0.0679 & 0.1028 \\
Y-axis & 0.1965 & 0.3540 & 0.0684 & 0.1028 \\
Ours & \textbf{0.1870} & \textbf{0.3410} & \textbf{0.0664} & \textbf{0.0984} \\
\bottomrule
\end{tabular}
\caption{Ablation studies about different dilation directions.}
\label{tab:abs-2}
\end{table}
Due to the deployment of the dilation convolutions along both the x-axis and the y-axis, we study the effects of different dilation directions.
Specifically, we separately test the dilation only along the x-axis or the y-axis with the combined dilation settings of 1, 2, 3, and 4.
As shown in Tab.\ref{tab:abs-2}, dilation settings along only the x-axis or y-axis can improve the MAE metric to 0.1953 and 0.1965 respectively.
As the areas near the poles have narrow FoV along the latitude direction in the ERP coordinates, the dilated convolution along the latitude contributes to addressing this problem.
Moreover, despite that the ERP expression keeps uniform FoV along the longitude direction, the areas near the poles mainly include the weak textures and geometric structures, e.g., the ceiling and the floor. Thus, the dilation along the y-axis introduces more spatial information in these areas in estimating accurate depth.
Therefore, our dilation settings along both directions have the best performance (see in Tab.\ref{tab:abs-2}).
We also discuss the impact of the dilation number in the ACDConv shown in Tab.\ref{tab:abs-4}. More dilations could bring larger receptive fields and better depth estimation performance but increase the network complexity and aggravate training difficulty at the same time.
When the dilation number is 5 with an additional $1\times8$ dilation setting, the network is overfitted, which will make performance worse.
Thus, the dilation number is set to 4 in our experiments.
\begin{table}[tb]
\centering
\begin{tabular}{ccccc}
\toprule
Dilations & MAE$\downarrow$ & RMSE$\downarrow$ & RMSElog$\downarrow$ & AbsRel$\downarrow$ \\
\midrule
Baseline & 0.2104 & 0.3620 & 0.0746 & 0.1148 \\
Two & 0.2038 & 0.3632 & 0.0703 & 0.1088 \\
Three & 0.1971 & 0.3573 & 0.0687 & 0.1023 \\
Four (Ours) & \textbf{0.1870} & \textbf{0.3410} & \textbf{0.0664} & \textbf{0.0984} \\
Five & 0.1963 & 0.3561 & 0.0689 & 0.1047 \\
\bottomrule
\end{tabular}
\caption{Ablation studies about different dilation numbers.}
\label{tab:abs-4}
\end{table}
\subsubsection{Padding Method}
In the proposed ACDNet, we apply circular padding to get continuous features on the sphere. In this sub-section, we also test the effects of zero padding and left-right padding as shown in Tab.\ref{tab:abs-3}. We observe that the results have gradual improvements by zero padding, left-right padding, and circular padding.
\newchange{
The root cause is that proper padding avoids introducing abundant invalid elements into the dilated convolutions in the boundary regions.
}
Meanwhile, this also demonstrates the effectiveness of the complete and continuous spatial information for depth estimation in the panoramic images.
\begin{table}[tb]
\centering
\begin{tabular}{ccccc}
\toprule
Padding & MAE$\downarrow$ & RMSE$\downarrow$ & RMSElog$\downarrow$ & AbsRel$\downarrow$ \\
\midrule
ZeroPad & 0.1948 & 0.3526 & 0.0684 & 0.1045 \\
LRPad & 0.1935 & 0.3503 & 0.0670 & 0.1025 \\
CirPad & \textbf{0.1870} & \textbf{0.3410} & \textbf{0.0664} & \textbf{0.0984} \\
\bottomrule
\end{tabular}
\caption{Ablation studies about different padding methods.}
\label{tab:abs-3}
\end{table}
\begin{table}[tb]
\centering
\begin{tabular}{ccccc}
\toprule
Methods & MAE$\downarrow$ & RMSE$\downarrow$ & RMSElog$\downarrow$ & AbsRel$\downarrow$ \\
\midrule
\small{Baseline} & \multirow{2}{*}{0.2104} & \multirow{2}{*}{0.3620} & \multirow{2}{*}{0.0746} & \multirow{2}{*}{0.1148} \\
\small{w/ iter} & ~ & ~ & ~ & ~\\
\small{Baseline} & \multirow{2}{*}{0.2287} & \multirow{2}{*}{0.3923} & \multirow{2}{*}{0.0796} & \multirow{2}{*}{0.1200}\\
\small{w/o iter} & ~ & ~ & ~ & ~\\
\small{Ours} & \multirow{2}{*}{\textbf{0.1870}} & \multirow{2}{*}{\textbf{0.3410}} & \multirow{2}{*}{\textbf{0.0664}} & \multirow{2}{*}{\textbf{0.0984}} \\
\small{w/ iter} & ~ & ~ & ~ & ~\\
\small{Ours} & \multirow{2}{*}{0.2017} & \multirow{2}{*}{0.3650} & \multirow{2}{*}{0.0694} & \multirow{2}{*}{0.1022} \\
\small{w/o iter} & ~ & ~ & ~ & ~\\
\bottomrule
\end{tabular}
\caption{Ablation studies about iterative depth prediction.}
\label{tab:abs-5}
\end{table}
\newchange{
\subsubsection{Iterative Depth Prediction}
In this sub-section, we separately test the role of iterative depth prediction and our ACDConv.
According to Tab.\ref{tab:abs-5}, iterative depth prediction improves the performance in both baseline and our network as it decomposes different scales of depth regression and improves the process of gradient backpropagation.
Meanwhile, our ACDConv efficiently extracts features for more precise depth estimation and works independently with iterative depth prediction.
}
\subsubsection{ResNet Backbone}
Finally, we test different ResNet backbones in our ACDNet. As shown in Tab.\ref{tab:abs-6}, the network performance gradually improves with the increasing of the backbone complexity. However, using the ResNet101 backbone to build the network is time-consuming and produces overfitting. Considering network performance and overhead, we select ResNet50 as our backbone in the experiments.
\begin{table}[tb]
\centering
\begin{tabular}{ccccc}
\toprule
Backbone & MAE$\downarrow$ & RMSE$\downarrow$ & RMSElog$\downarrow$ & AbsRel$\downarrow$ \\
\midrule
ResNet18 & 0.2309 & 0.3957 & 0.0771 & 0.1195 \\
ResNet34 & 0.2044 & 0.3661 & 0.0687 & 0.1041 \\
ResNet50 & \textbf{0.1870} & \textbf{0.3410} & 0.0664 & \textbf{0.0984} \\
ResNet101 & 0.1911 & 0.3481 & \textbf{0.0654} & 0.0992 \\
\bottomrule
\end{tabular}
\caption{Ablation studies about different ResNet backbones.}
\label{tab:abs-6}
\end{table}
\newchange{
\subsubsection{Model Complexity}
We compare the model complexity and computational efficiency with previous methods, and all the results are derived from inferring a $512\times 1024$ image.
Compared with \textit{Baseline}, the dilated convolution groups introduced in \textit{Simple} increase $33.9M$ parameters and $240M$ memories and reduce the FPS from 19 to 12 as shown in Tab.\ref{tab:abs-7}.
Against the data in Tab.\ref{tab:abs-1}, simply increasing model parameters does not play a fundamental role in improving the performance. While the channel-wise fusion modules in \textit{Ours} scarcely influence the model complexity and computational efficiency but improve results substantially.
\begin{table}[tb]
\centering
\small
\begin{tabular}{ccccc}
\toprule
Method & Parameters & GPU Mem & FPS\\
\midrule
BiFuse & 253.1M & 4003M & 0.9 \\
UniFuse & 30.26M & 1221M & 31 \\
SliceNet & 75.3M & 1911M & 13 \\
HoHoNet & 49.5M & 1487M & 52 \\
Ours (Baseline) & 52.5M & 2136M & 19 \\
Ours (Simple) & 86.4M & 2376M & 12 \\
Ours & 87.0M & 2378M & 11 \\
\bottomrule
\end{tabular}
\caption{Model complexity and computation efficiency}
\label{tab:abs-7}
\end{table}
}
\section{Conclusion}
In this work, we first propose the adaptively combined dilated convolution to replace the regular convolution to well extract the features from panorama images in ERP. Then we construct the ACDNet to estimate depth maps with monocular panorama images, which outperforms the SOTA approaches in quantitative metrics and visual effects.
Our experiments show that the convolutions with extended receptive fields contribute to panoramic depth estimation. Moreover, the experiments with adaptive channel-wise fusion strategy also express that obtaining different latent shapes of convolution kernels in different feature channels is better than explicitly deforming convolution kernels at different latitudes. That is worth further researching for panorama images in the future.
\newchange{
In addition, we will study our ACDConv in other existing depth prediction models and its effects on other various panoramic image tasks such as image classification and semantic segmentation.
}
\section{Acknowledgments}
This work is supported by the Strategic Priority Research Program of the Chinese Academy of Sciences (No. XDA23090304), the National Natural Science Foundation of China (U2003109, U21A20515, 62102393), the Youth Innovation Promotion Association of the Chinese Academy of Sciences (Y201935), the State Key Laboratory of Robotics and Systems (HIT) (SKLRS-2022-KF-11), and the Fundamental Research Funds for the Central Universities.
| {'timestamp': '2022-04-04T02:11:31', 'yymm': '2112', 'arxiv_id': '2112.14440', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14440'} | arxiv |
\section{Introduction}
\IEEEPARstart{W}{ireless} communications systems have evolved for several generations and the recently commercialized 5G systems have partially met the needs for high data rate, reliable, and low latency communication services. However, with the development of innovative applications such as autonomous driving and industrial IoT \cite{cui2021integrating,10.1145/3447744,9143269}, future wireless systems are expected to provide new services, e.g., target tracking and environmental monitoring \cite{6504845,9296833}. To this end, the recently proposed integrated sensing and communication (ISAC) framework provides a promising platform to integrate sensing capability in communication systems \cite{liu2021integrated}. The use of millimeter-wave (mmWave) in 5G and beyond further facilitates the integration between radar and communication systems with possible hardware and software sharing between two functionalities. In this case, there have been some interesting developments in three different areas, i.e., dual-functional radar-communication (DFRC) \cite{8288677,8386661,8999605,9124713}, sensing-aided communication \cite{5776640}, and communication-aided sensing \cite{1211013,4268440,7814210,7347464,7485066,9093221,9205659}.
The most fundamental issue for integrating sensing and communication lies in the interference management and resource allocation between the two sub-systems. The interference exists and can be handled in both the device and network levels. In the device level, full-duplex operation is a critical challenge because BSs need to serve as the transmitter and receiver simultaneously \cite{9540344}. To this end, existing works considered self-interference cancellation (SIC) \cite{bharadia2013full,sabharwal2014band,korpi2013advanced}, where analog filters based on the recursive least squares (RLS) or least mean squares (LMS) estimation are proposed.
In the system level, there exists the interference between communication and sensing signals. To this end, some research efforts have been made for the transmit beamformer and waveform design in ISAC systems. \cite{8288677} optimized the transmit beamformers for the dual DFRC systems to achieve a target radar beam pattern while satisfying a given communication performance requirement. \cite{8386661} investigated the transmit waveform design by minimizing the multi-user interference in communication while allowing a tolerable mismatch between the designed and the desired radar beam patterns. The hybrid beamforming technique was considered in \cite{8999605} to save the energy consumption. To improve the parameter estimation performance, \cite{liu2021cramerrao} proposed to design the ISAC system by minimizing the Cram\'{e}r-Rao bound (CRB) for sensing. In \cite{8827589,9349171}, the perceptive mobile network (PMN) was studied to enable different types of sensing capabilities for wireless communications. However, the joint transmitter and receiver design for PMN systems is not available in the literature. More importantly, the interplay between sensing and communication, especially in terms of interference management and resource allocation, has not been well understood.
In this paper, we will try to tackle the interference in the system levels by taking advantage of the network structure of mobile networks. Specifically, we first propose the PMN with distributed target monitoring terminals (PMN-TMT), where TMTs are deployed to add sensing capability to mobile networks. In the proposed PMN-TMT, the base stations (BSs) will not only serve communication but also work as the radar transmitters. In particular, BSs will transmit/receive communication signals and also send sounding signals to the sensing target (ST). However, to avoid the full-duplex operation and reduce interference between sensing and communication, the radar signal estimation task will be taken over by the TMTs, which are passive sensing terminals deployed as IoT devices for sensing and monitoring tasks \cite{9143269,7845396}. They can be deployed on the BSs, but normally will be spread around the BSs to provide additional angles for sensing and monitoring purposes. TMTs are connected to the BSs through high capacity links and form the sensing network.
With the proposed PMN-TMT, we will then consider the joint design of transmit and receive beamformers. Due to the different nature of sensing and communication systems, the PMN-TMT has some unique characteristics: 1) Sensing signal, if not handled properly, will cause interference to the communication receivers; 2) Communication signals can be utilized for sensing purpose, given they are known by the BSs; and 3) Communication signals will be reflected by the environment, creating the clutter (interference) for sensing, which may lead to false alarm/estimation. As a result, how to manage the interference and allocate resources between sensing and communication are two of the most important questions to be addressed. In this paper, we will jointly design the transmitter and receiver to optimize the sensing and communication performance. This problem is first solved by an alternating optimization (AO) framework, whose convergence proof is also given. However, the complexity of the AO-based design is high. To reduce the complexity and obtain physical insights regarding the interference management and resource allocation between the two sub-systems, we further derive linear transceiver structures and compare their performance with that of the AO-based solution.
The contributions of this paper can be summarized as follows:
\begin{enumerate}
\item We propose a novel ISAC framework, i.e., PMN-TMT, where passive TMTs are deployed over traditional mobile networks to locate the ST. The distributed multi-antenna TMTs save the need for full-duplex operation, bring macro-diversity for target detection, and provide spatial freedom for interference management and environment sensing.
\item We jointly design the transmitter and receiver by maximizing the weighted average of sensing and communication performance. To address the non-convex optimization problem, we transfer the fractional programming to a parametric square-root subtractive-form problem by exploiting the quadratic transform technique \cite{8314727}. Then, we propose an AO-based framework to iteratively optimize the transmit and receive beamformers and prove the convergence of the proposed algorithm.
\item We derive linear transceiver structures, including the zero-forcing (ZF) and beam synthesis (B-syn) transmitter, and the minimum variance distortionless response (MVDR) receiver. These linear transceivers not only reduce the computation complexity but also provide interesting physical insights: (1) ``Leaking'' energy from communication signals to the ST is more efficient than forming a dedicated sensing signal; and (2) the amount of energy leaked from one UE to the ST depends on their channel correlation, which is determined by their locations.
\end{enumerate}
The remainder of this paper is organized as follows. Section II introduces the system model of the proposed PMN-TMT. Section III formulates the problem and provides the AO-based joint transceiver design algorithm, together with its convergence proof. The sub-optimal linear transceiver structures are derived in Section IV, where several interesting physical insights regarding the interference management and resource allocation between sensing and communication are also revealed. Section V provides simulation results to illustrate the performance of the proposed methods and Section VI concludes the paper.
\section{System Model}
\subsection{Perceptive Mobile Network with Distributed Target Monitoring Terminals}
PMN represents a promising framework to integrate radar sensing in wireless communications networks. However, due to the different nature of communication and sensing functionalities, a fully integrated system with dual-functionality will face many challenging issues such as the full-duplex operation. In this paper, to release such demanding requirements, we propose the PMN-TMT, as illustrated in Fig. \ref{sys1}. The PMN-TMT can be implemented by adding another layer of passive TMTs over the traditional cellular networks. In particular, TMTs are passive nodes with only perception functionalities, including radar, vision, and other sensing capabilities \cite{9143269,7845396}. They are distributed in a target area and connected with the base stations (BSs) through low latency links.
In the proposed PMN-TMT, the communication between the BSs and the UEs is achieved in the same way as traditional cellular networks. To perform radar sensing, the sounding signal is generated by the BSs during the downlink communication period.
To avoid transmitting and receiving at the same time (full-duplex), the target sensing/detection is performed by the TMTs. The distributed TMTs not only reduce the implementation difficulty but also provide multiple angles to monitor the environment. Such design also facilitates the integration of other IoT applications in the PMN-TMT.
\begin{figure}[!t]
\centering
\includegraphics[width=3.2in]{mmWave_system7_2.pdf}
\caption{Illustration of PMN-TMT.}
\label{sys1}
\end{figure}
In this paper, we consider a simplified network with one base station (BS) and one TMT equipped with $N_{t}$ and $N_{r}$ antennas\footnote{Collaborative sensing by several TMTs will provide better sensing performance, which is left for the future work.}, respectively. The multiple antennas at the TMTs provide the spatial freedom that for environment sensing and interference rejection. This network serves $K$ single-antenna UEs and detects a ST simultaneously. Denote $\mathbf{h}_{c,k}\in \mathbb{C}^{N_{r} \times 1}$ and $\mathbf{h}_{R}\in \mathbb{C}^{N_{r} \times 1}$ as the channels from the BS to the $k$th UE and the ST, respectively. To serve both communication and sensing, the BS transmits $N_s$ data streams by $N_{t}$ transmit antennas. The transmit signal $\mathbf{s}\in\mathbb{C}^{N_s \times 1}$ consists of $K$ data streams for the UEs and $N_s-K$ \footnote{Here we assume that the number of UEs $K$ is no more than $N_s$.} data streams for sensing. Without loss of generality, the transmitted symbol vector is given by
\begin{equation}
\begin{split}
\mathbf{s}=\left[\begin{matrix}
\mathbf{s}_c\\
\mathbf{s}_R\\
\end{matrix}\right] \in \mathbb{C}^{N_s\times 1},
\end{split}
\end{equation}
which is assumed to be Gaussian distributed with zero means and covariance matrix $\mathbf{I}$. Each entry of $\mathbf{s}$ corresponds to a single-carrier waveform, where $\mathbf{s}_c$ and $\mathbf{s}_R$ denote the symbols for communication and sensing, respectively. Specially, $s_k$, i.e., the $k$th entry of $\mathbf{s}_c$, denotes the symbol transmitted to the $k$-th UE.
In this paper, we consider the widely used Saleh-Valenzuela (SV) model to characterize the sparse nature of mmWave channels \cite{7445130,6834753,9234098}.
Suppose uniform linear arrays (ULAs) are employed at the BS. The BS-UE channel $\mathbf{h}_{c,k}$ can then be given by \cite{9234098}
\begin{equation}
\begin{split}
\mathbf{h}_{c,k}=\sqrt{\frac{N_{t}}{N_{p}}} \sum_{i=1}^{N_{p}} \beta_{k,i}^{(t)} \mathbf{a}_{T} (\phi_{k,i}^{(t)}),
\end{split}
\label{channelmodel}
\end{equation}
where $N_{p}$ denotes the number of paths between the BS and the UE. $\mathbf{a}_{T}(\phi)$ represents the steering vector of the BS with $||\mathbf{a}_{T}(\phi)||^2=1$ and $\phi_{k,i}^{(t)}$ is the angle-of-departure (AOD) from the BS to the $k$th UE in the $i$th path. $\beta_{k,i}^{(t)}$ denotes the path gain in the $i$th path of the corresponding channel. The BS-ST and ST-TMT channels can be modeled similarly.
\subsection{Communication Signal Model}
The signal received at the $k$th UE is expressed as \cite{7397861
\begin{equation}
\begin{split}
y_{c,k}&=\mathbf{h}_{c,k}^\HH \mathbf{F} \mathbf{s}+n_c,\\
\end{split}
\end{equation}
where
\begin{equation}
\begin{split}
\mathbf{F}=\left[ \underbrace{\mathbf{f}_{c,1}, \cdots,\mathbf{f}_{c,K}}_{\mathbf{F}_c:\;\text{Communications}},\underbrace{\mathbf{f}_{R,1},\cdots,\mathbf{f}_{R,N_s-K}}_{\mathbf{F}_R:\;\text{Sensing}} \right] \in \mathbb{C}^{N_t\times N_{s}}
\end{split}
\end{equation}
denotes the precoder matrix and $n_c$ represents the additive white Gaussian noise (AWGN) with zero mean and variance $\sigma_c^2$.
In general, it may not be optimal to use only $K$ data streams for $K$ multiple-antenna communication users. More streams will provide additional freedom in achieving a good tradeoff between communication and sensing. In this paper, we consider single-antenna UEs, and thus we assume that $K$ streams of communication signals are transmitted.
Note that both communication and sensing signals may impose interference to the UEs. Thus, the received signal-to-interference-plus-noise-ratio (SINR) at the $k$th UE is expressed as
\begin{equation}
\begin{split}
\gamma_k \left(\mathbf{F} \right)=\dfrac{\left\vert \mathbf{h}_{c,k}^\HH \mathbf{f}_{c,k} \right\vert^2}{
\underbrace{ \sum_{i\neq k}\left|\mathbf{h}_{c,k}^\HH\mathbf{f}_{c,i} \right|^2}_{\text{Multi-user Interference}}
+\underbrace{ \left\Vert\mathbf{h}_{c,k}^\HH\mathbf{F}_R \right\Vert^2}_{\text{Sensing}}
+\sigma_c^2} .
\end{split}
\label{gammak}
\end{equation}
\subsection{Radar Signal Model}
The sensing signal is regarded as interference by communication systems, but communication signals can be used for sensing because the transmitted communication waveform is known by the TMT. Assuming that the transmit waveform is narrow-band and the propagation path is a line of sight (LoS) path, the base-band signal at a point-like target can be given by \cite{9124713}
\begin{equation}
\begin{split}
y_t=\mathbf{a}_{T}^\HH(\phi_t)\mathbf{F} \mathbf{s},
\end{split}
\end{equation}
where $\phi_t$ denotes the AOD from the BS to the ST. Note that the back-scattered echos from the environment will impose interference to the TMT.
Target detection is a binary hypothesis testing problem, where hypotheses $\mathcal{H}_0$ and $\mathcal{H}_1$ correspond to the absence and presence of the ST, respectively. Besides the echo back-scattered from the ST, the TMT will also receive the echoes from the environment, which is known as the clutter \cite{6081358,303737,9052470}. The echo signal received by the TMT in the range-Doppler cell under test (CUT) \cite{6081358,303737,9052470} is expressed as
\begin{equation} \label{assuptionmodel}
\left\{
\begin{array}{ll}
\mathcal{H}_0: &\mathbf{y}_{R,0}=\sum\limits_{l=1}^{L}\epsilon_{c,l} \mathbf{A}_{c,l} \mathbf{F} \mathbf{s}+\mathbf{n}_{R},\\
\mathcal{H}_1: &\mathbf{y}_{R}=\epsilon_s\mathbf{A}_{R} \mathbf{F} \mathbf{s} + \sum\limits_{l=1}^{L}\epsilon_{c,l} \mathbf{A}_{c,l} \mathbf{F} \mathbf{s}+\mathbf{n}_{R},\\
\end{array}
\right.
\end{equation}
where $L$ denotes the number of clutter patches. The response matrices of the clutter patches and the target \cite{liu2021cramerrao} are respectively given as
\[\mathbf{A}_{c,l}=\mathbf{a}_R(\phi_{c,l}^{(r)}) \mathbf{a}_{T}^\HH(\phi_{c,l}),\mathbf{A}_{R}=\mathbf{a}_{R}(\phi_t^{(r)}) \mathbf{a}_{T}^\HH(\phi_t),\]
where $\mathbf{a}_{R}(\phi)$ denotes the steering vector of the TMT with $||\mathbf{a}_{R}(\phi)||^2=1$. $\phi_t^{(r)}$ and $\phi_{c,l}^{(r)}$ represent the angle-of-arrival (AOA) from the ST and $l$th clutter patch to the TMT, respectively. $\phi_{c,l}$ denotes the AOD of the $l$th clutter patch with respect to (w.r.t.) the BS. $\epsilon_s$ and $\epsilon_{c,l}$ represent the complex gains of the ST-TMT channel and the channel between the $l$th clutter patch and the TMT, respectively, which depend on the gain of the matched filtering, the gain of emission patterns, the propagation loss, and the target radar cross section (RCS) \cite{303737,9052470}. They are assumed to be zero mean Gaussian random variables with variance $\sigma_t^2$ and $\sigma_{c,l}^2$, respectively \cite{303737,9052470}. $\mathbf{n}_{R} $ is modeled as AWGN with zero means and covariance matrix $\sigma_n^2 \mathbf{I}$.
In practical applications, the TMT is deployed on a smart manufacturing or industrial IOT device whose power is limited \cite{9143269,7845396}. To reduce hardware cost and improve the overall energy efficiency (EE) of the TMT, we consider the hybrid beamforming structure. The baseband signal is processed by an analog baseband combiner $\mathbf{W}_{RF}\in \mathbb{C}^{N_r \times N_{RF}^r}$, a digital baseband combiner $\mathbf{W}_{BB}\in \mathbb{C}^{N_{RF}^r \times N_s}$, and a detection filter $\mathbf{w}_d\in \mathbb{C}^{N_{s} \times 1}$ with the output
\begin{equation}\label{xo}
\begin{split}
&x_{o}=\mathbf{w}_d^\HH \mathbf{W}_{BB}^\HH \mathbf{W}_{RF}^\HH \mathbf{y}_R.
\end{split}
\end{equation}
Denote $\mathbf{w}=\mathbf{W}_{BB} \mathbf{w}_d \in \mathbb{C}^{N_{RF}^r \times 1}$ as the effective digital baseband processor.
Different performance metrics can be selected for different radar applications, e.g., the Cram\'{e}r-Rao bound for angle estimation \cite{9652071}. In this paper, we focus on target detection in the clutter-presence scenario, where the signal-dependent clutter is generally much stronger than the signal component. In this case, the detection probability is directly related to the signal-to-clutter-and-noise-ratio (SCNR) \cite{9052470}, which is widely used to measure the ability of a radar system in rejecting the clutter \cite{303737,9052470}. Therefore, we choose SCNR as the performance metric \footnote{The objective of this paper is to probe whether a target exists at a given direction. In order to scan a large area, one option is to design the transceiver for monitoring over a continuous range of directions.}, i.e.,
\begin{equation}\label{SCNR}\nonumber
\begin{split}
&\text{SCNR}(\mathbf{w},\mathbf{W}_{RF},\mathbf{F})=\frac{\mathcal{P}_S(\mathbf{w},\mathbf{W}_{RF},\mathbf{F})}{\mathcal{P}_{Q}(\mathbf{w},\mathbf{W}_{RF},\mathbf{F})}=\frac{\mathbb{E}\left( \left\Vert
\epsilon_s \mathbf{w}^\HH \mathbf{W}_{RF}^\HH\mathbf{A}_{R} \mathbf{F}\mathbf{s}
\right\Vert^2 \right)
}{
\mathbb{E}\left( \left\Vert
\sum\limits_{l=1}^{L}\epsilon_{c,l}\mathbf{w}^\HH \mathbf{W}_{RF}^\HH\mathbf{A}_{c,l} \mathbf{F}\mathbf{s}+ \mathbf{w}^\HH \mathbf{W}_{RF}^\HH\mathbf{n}_{R}
\right\Vert^2 \right)},\\
\end{split}
\end{equation}
where \begin{equation}
\begin{split}
\mathcal{P}_S(\mathbf{w},\mathbf{W}_{RF},\mathbf{F})
&\triangleq \sigma_t^2 \mathbf{w}^\HH\mathbf{W}_{RF}^\HH\mathbf{A}_{R}\mathbf{F}\mathbf{F}^\HH \mathbf{A}_{R}^\HH \mathbf{W}_{RF}\mathbf{w},\\
\mathcal{P}_{Q}(\mathbf{w},\mathbf{W}_{RF},\mathbf{F})
&\triangleq \underbrace{ \sum\limits_{l=1}^{L}\sigma_{c,l}^2 \mathbf{w}^\HH \mathbf{W}_{RF}^\HH\mathbf{A}_{c,l}\mathbf{F}\mathbf{F}^\HH\mathbf{A}_{c,l}^\HH \mathbf{W}_{RF}\mathbf{w}}_{\text{Clutter}}+\underbrace{\sigma_n^2 \mathbf{w}^\HH\mathbf{W}_{RF}^\HH\mathbf{W}_{RF}\mathbf{w} }_{\text{Noise}}.
\end{split}
\end{equation}
denote the power of received signal and that of the clutter plus noise, respectively.
\section{Joint Communication and Sensing Design}
The communication performance can be measured by the SINR at the UEs, whereas the sensing performance depends on SCNR. In this paper, we attempt to jointly optimize the receive filter $\mathbf{w}$, the analog combiner $\mathbf{W}_{RF}$, and the precoder $\mathbf{F}$ to maximize the weighted sum of the SCNR and the worst case SINR simultaneously. Concretely, the optimization problem is formulated as
\begin{subequations}
\begin{align}
\max_{\mathbf{w},\mathbf{W}_{RF},\mathbf{F}}\quad &\mathcal{L}(\mathbf{w},\mathbf{W}_{RF},\mathbf{F}) \notag\\
s.t. \quad \quad &\left\Vert \mathbf{w} \right\Vert^2 \leq 1 \label{cont04}\\
&\left\Vert \mathbf{F} \right\Vert_F^2 \leq P \label{cont05}\\
&\mathbf{W}_{RF}\in \mathcal{M}^{N_{r}\times N_{RF}^r}, \label{cont06}
\end{align}
\label{Problem0}
\end{subequations}
where
\begin{equation}
\begin{split}\nonumber
&\mathcal{L}(\mathbf{w},\mathbf{W}_{RF},\mathbf{F})=\kappa_r\text{SCNR}(\mathbf{w},\mathbf{W}_{RF},\mathbf{F})+\kappa_c \min_{k\in [1,K]}
\gamma_k(\mathbf{F}),
\end{split}
\end{equation}
with $\kappa_r \in [0,1]$ and $\kappa_c = 1-\kappa_r$ denoting the weighting coefficients for the sensing and communication, respectively. The feasible set of the analog combiner is given by $\mathcal{M}^{M\times N}=\{\mathbf{X}\in \mathcal{C}^{M\times N} \big| \ |\mathbf{X}(i,j)|=1, i=1,\cdots,M, j=1,\cdots,N \}.$
Note that (\ref{cont04}) forces the receiver to have a unit norm and (\ref{cont05}) limits the power of the transmitter. (\ref{cont06}) represents the unit modulus constraint as the analog precoders are implemented by phase shifters. The knowledge of $\sigma_t^2$, $\sigma_n^2$ and $\sigma_{c,l}^2, l=1,\cdots,L$ can be obtained by a cognitive paradigm \cite{https://doi.org/10.1049/iet-rsn.2014.0527,melvin2006knowledge,guerci2010cognitive} and is assumed to be known. Moreover, we assume that the channel state information (CSI), i.e., $\mathbf{h}_{c,k}$ and $\mathbf{h}_{c,k}^{(r)}$, are known. It can be observed that both the fractional objective function and constraints are non-convex, which causes the optimization problem hard to solve.
Note that the problem in (\ref{Problem0}) is a multi-ratio fractional programming (FP) problem which is NP-hard. Fortunately, the objective function is continuous and has positive denominator. Thus, the FP problem can be transformed into a parametric subtractive-form problem by exploiting the Dinkelbach method \cite{barros1996new}. However, although the Dinkelbach method can be an efficient solution to those single-ratio problems with a concave numerator and convex denominator, it cannot be easily generalized to the multi-ratio problem, like (\ref{Problem0}). Also, the numerator of the objective function in (\ref{Problem0}) has a quadratic form w.r.t. $\mathbf{w}$, $\mathbf{W}_{RF}$, and $\mathbf{F}$, and thus is non-concave. As a result, extra relaxations are needed to further relax the resulting subtractive-form objective function which may degrade the convergence and optimization performance.
To address this issue, we reformulate (\ref{Problem0}) as a parametric subtractive-form problem by exploiting the quadratic transform technique proposed in \cite{8314727}, i.e.,
\begin{equation}
\begin{split}
\max_{\substack{\mathbf{w},\mathbf{W}_{RF},\mathbf{F}, \mathbf{u}_r,u_{k}} } & \mathcal{F}\left(\mathbf{w}^{(t)},\mathbf{W}_{RF}^{(t)},\mathbf{F}^{(t)},\mathbf{u}_r^{(t)},u_{k}^{(t)} \right)\\
s.t. \quad\quad & (\ref{cont04}) \text{-} (\ref{cont06}),\\
\end{split}
\label{probfracF}
\end{equation}
where
\begin{equation}
\begin{split}
&\mathcal{F}\left(\mathbf{w}^{(t)},\mathbf{W}_{RF}^{(t)},\mathbf{F}^{(t)},\mathbf{u}_r^{(t)},u_{k}^{(t)} \right)=\mathcal{F}_R\left(\mathbf{w}^{(t)},\mathbf{W}_{RF}^{(t)},\mathbf{F}^{(t)},\mathbf{u}_r^{(t)} \right)+\min_{k\in[1,K]}\mathcal{F}_k\left(\mathbf{F}^{(t)},u_{k}^{(t)} \right),
\end{split}
\end{equation}
with
\begin{equation}
\begin{split}
&\mathcal{F}_R \left(\mathbf{w},\mathbf{W}_{RF},\mathbf{F},\mathbf{u}_r \right) = 2 \kappa_r \Re\left( \sigma_t \mathbf{w}^\HH\mathbf{W}_{RF}^\HH\mathbf{A}_{R}\mathbf{F}\mathbf{u}_r \right) -\kappa_r \Vert \mathbf{u}_r \Vert^2 \mathcal{P}_{Q}\left(\mathbf{w},\mathbf{W}_{RF},\mathbf{F} \right),
\end{split}
\label{lossfunc}
\end{equation}
\begin{equation}
\begin{split}
&\mathcal{F}_k \left(\mathbf{F} ,u_{k} \right)=2\kappa_c\Re\left(u_{k} \mathbf{h}_{c,k}^\HH \mathbf{f}_{c,k} \right)-\kappa_c|u_{k} |^2 \left(\left\Vert \mathbf{h}_{c,k}^\HH \mathbf{F}_R \right\Vert^2+\sum_{i\neq k}\left|\mathbf{h}_{c,k}^\HH\mathbf{f}_{c,i} \right|^2
+\sigma_c^2\right).
\end{split}
\label{lossfuncCk}
\end{equation}
Here, $\mathbf{u}_r$ and $u_{k}$ are two auxiliary complex variables.
To solve this problem, an iteration process based on AO is given as follows
\begin{subequations}\label{IterationCore}
\begin{align}
&\mathbf{w}^{(t+1)}= \mathop{\arg \max}_{\mathbf{w}} \mathcal{F}_R\left(\mathbf{w}|\mathbf{W}_{RF}^{(t)},\mathbf{F}^{(t)},\mathbf{u}_r^{(t)} \right), \quad s.t. \quad (\ref{cont04}), \label{probwt1}\\
&\mathbf{W}_{RF}^{(t+1)}= \mathop{\arg \max}_{\mathbf{W}_{RF}} \mathcal{F}_R\left(\mathbf{W}_{RF}|\mathbf{w}^{(t+1)},\mathbf{F}^{(t)},\mathbf{u}_r^{(t)} \right), \quad s.t. \quad (\ref{cont06}),\label{probWRFt1}\\
&\mathbf{F}^{(t+1)} = \mathop{\arg \max}_{\mathbf{F}} \mathcal{F}_R\left(\mathbf{F}|\mathbf{w}^{(t+1)},\mathbf{W}_{RF}^{(t+1)},\mathbf{u}_r^{(t)} \right), s.t. \mathcal{F}_k\left(\mathbf{F}|u_k^{(t)} \right)\geq \zeta^{(t)}, k\in [1,K],
(\ref{cont05}),\label{probFt1}\\
&\mathbf{u}_r^{(t+1)}
=\frac{ \sigma_t\mathbf{F}^{(t+1),\HH}\mathbf{A}_{R}^{\HH}\mathbf{W}_{RF}^{(t+1)} \mathbf{w}^{(t+1)} }{\mathcal{P}_{Q}\left(\mathbf{w}^{(t+1)},\mathbf{W}_{RF}^{(t+1)},\mathbf{F}^{(t+1)} \right)},\label{urt1}\\
&u_{k}^{(t+1)}
=\frac{\mathbf{f}_c^{(t+1),\HH}\mathbf{h}_{c,k}}{\left\Vert \mathbf{h}_{c,k}^\HH \mathbf{F}_R^{(t+1)} \right\Vert^2+\sum_{i\neq k}\left|\mathbf{h}_{c,k}^\HH\mathbf{f}_{c,i}^{(t+1)} \right|^2
+\sigma_c^2},\\
&\zeta^{(t+1)}=\min_{k \in [1,K]} \kappa_c\gamma_k (\mathbf{F}^{(t+1)}).\label{zetat1}
\end{align}
\end{subequations}
\textbf{Remark 1} (\emph{Convergence Analysis}): We have the following proposition regarding the convergence of the proposed algorithm.
\begin{proposition}
\label{PROconverge}
The iteration in (\ref{IterationCore}) creates a non-decreasing sequence
\begin{equation}
\begin{split}
\mathcal{L}^{(t)}
&=\mathcal{L}\left(\mathbf{w}^{(t)},\mathbf{W}_{RF}^{(t)},\mathbf{F}^{(t)} \right)=\mathcal{F}\left(\mathbf{w}^{(t)},\mathbf{W}_{RF}^{(t)},\mathbf{F}^{(t)},\mathbf{u}_r^{(t)},u_{k}^{(t)} \right),\\
\end{split}
\end{equation}
which converges to the stationary point of (\ref{Problem0}), i.e., $\mathcal{L} ^{\star}=\mathcal{L}\left(\mathbf{w}^{\star},\mathbf{W}_{RF}^{\star},\mathbf{F}^{\star} \right)$.
\end{proposition}
\textit{Proof}: See Appendix \ref{IterConv}. \hfill $\blacksquare$
The convergence and optimality of the proposed algorithm are guaranteed by Proposition 1 and \cite[Theorem 4]{8314727}, respectively.
The next issue is to solve (\ref{probwt1})-(\ref{probFt1}).
\subsection{Update $\mathbf{w}^{(t+1)}$}
First, we reformulate (\ref{lossfunc}) w.r.t. $\mathbf{w}$ as
\begin{equation}
\label{16}
\begin{split}
&\mathcal{F}_R\left(\mathbf{w}|\mathbf{W}_{RF},\mathbf{F},\mathbf{u}_r \right)=2 \kappa_r \Re\left( \mathbf{w}^\HH \mathbf{a}_{w} \right)- \kappa_r\Vert\mathbf{u}_r\Vert^2
\mathbf{w}^\HH \mathbf{B}_{w} \mathbf{w}+const,\\
\end{split}
\end{equation}
where
\begin{equation}
\begin{split}
&\mathbf{a}_w= \sigma_t \mathbf{W}_{RF}^\HH\mathbf{A}_{R}\mathbf{F} \mathbf{u}_r, \quad\mathbf{B}_{w}=\sum\limits_{l=1}^{L}\sigma_{c,l}^2 \mathbf{W}_{RF}^\HH\mathbf{A}_{c,l}\mathbf{F}\mathbf{F}^\HH\mathbf{A}_{c,l}^\HH \mathbf{W}_{RF}+\sigma_n^2 \mathbf{W}_{RF}^\HH \mathbf{W}_{RF} .
\end{split}
\end{equation}
Then the problem in (\ref{probfracF}) is reformulated as the maximization of (\ref{16}).
This problem can be efficiently solved by the Lagrange multiplier method.
Specifically, we introduce a penalty function to reformulate the problem in (\ref{16}) as an unconstrained optimization problem that minimizes
\begin{equation}
\begin{split}
L_{w}^{(t)}(\mathbf{w})=&-\mathcal{F}_R\left(\mathbf{w}|\mathbf{W}_{RF}^{(t)},\mathbf{F}^{(t)},\mathbf{u}_r^{(t)} \right)+ \gamma_{w} \left(\mathbf{w}^\HH\mathbf{w} -1 \right),\\
\end{split}
\label{objsubiF3}
\end{equation}
where $\gamma_{w} \geq 0$ is the Lagrange penalty coefficient. Note that (\ref{objsubiF3}) is convex w.r.t. $\mathbf{w}$. The minimizer of (\ref{objsubiF3}) can be obtained by solving $\nabla_{\mathbf{w}} L_{w}^{(t)}(\mathbf{w})=0$, i.e.,
\begin{equation}
\begin{split}
\mathbf{w}^{(t,\star)}=\frac{1}{\Vert\mathbf{u}_r^{(t)}\Vert^2 }\left(\mathbf{B}_{w}^{(t)}+\gamma_w\mathbf{I}\right)^{-1}\mathbf{a}_w^{(t)}.
\end{split}
\label{wstar}
\end{equation}
Note that $\mathbf{w}^{(t,\star)}$ depends on $\gamma_{w}$. Therefore, in the rest of this subsection, we focus on determining $\gamma_{w}$. By performing the eigen-decomposition $ \mathbf{B}_w^{(t)}=\mathbf{V}_w\mathbf{\Lambda}_w\mathbf{V}_w^\HH$ and based on the complementary Karush–Kuhn–Tucker (KKT) condition, we have
\begin{equation}
\begin{split}
\mathbf{w}^{(t,\star),\HH}\mathbf{w}^{(t,\star)}&= \mathbf{a}_w^{(t),\HH} \mathbf{V}_w\left(\mathbf{\Lambda}_w+\lambda_{w,1}\mathbf{I} \right)^{-2}\mathbf{V}_w^\HH \mathbf{a}_w^{(t)}=\sum_{i=1}^{N_{RF}^r} \frac{\left|\mathbf{v}_{w,i}^\HH \mathbf{a}_w^{(t)}\right|^2}{\left(\lambda_{w,i}+\gamma_{w}\right)^2} = 1,
\end{split}
\label{lambdaF1}
\end{equation}
where $\mathbf{v}_{w,i}$ denotes the $i$th column of $\mathbf{V}_{w}$ and $\lambda_{w,i}$ is the $(i,i)$th entry of $\mathbf{\Lambda}_w$. It is easy to check that $\mathrm{tr}\left( \mathbf{w}^{(t+1)}\mathbf{w}^{(t+1),\HH} \right)$ is monotonic w.r.t. $\gamma_{w}$.
We thus utilize the bisection method to find a suitable $\gamma_{w}$ to make $||\mathbf{w}^{{(t,\star)}}||=1$. We then update $\mathbf{w}^{(t+1)}=\mathbf{w}^{{(t,\star)}}$.
\subsection{Update $\mathbf{W}_{RF}^{(t+1)}$}
\label{updatewRF}
Note that $\mathcal{P}_Q$ is dependent on $\mathbf{W}_{RF}$. Therefore, we first simplify the formulation in (\ref{lossfunc}). Defining the vectorization of $\mathbf{W}_{RF}$ as $\mathbf{w}_{RF}=\mathrm{vec}(\mathbf{W}_{RF})$, the objective function in (\ref{lossfunc}) w.r.t. $\mathbf{w}_{RF}$ is then reformulated as
\begin{equation}
\begin{split}
&\mathcal{F}\left(\mathbf{w}_{RF}|\mathbf{F},\mathbf{u}_r,u_{k} \right)
=2 \kappa_r \Re\left( \mathbf{w}_{RF}^\HH \mathbf{a}_{w_{RF}} \right) -\kappa_r\Vert\mathbf{u}_r\Vert^2
\mathbf{w}_{RF}^\HH \mathbf{B}_{w_{RF}} \mathbf{w}_{RF}+const,\\
\end{split}
\label{fwRF}
\end{equation}
where
\begin{equation}
\begin{split}
&\mathbf{a}_{w_{RF}}=\sigma_t \mathrm{vec} \left(\mathbf{A}_{R}\mathbf{F} \mathbf{u}_r\mathbf{w}^\HH\right),\quad\mathbf{B}_{w_{RF}}= \mathbf{w}^* \mathbf{w}^\mathrm{T} \otimes \left(\sum\limits_{l=1}^{L} \sigma_{c,l}^2 \mathbf{A}_{c,l}\mathbf{F} \mathbf{F}^\HH\mathbf{A}_{c,l}^\HH+\sigma_n^2 \mathbf{I}\right).
\end{split}
\end{equation}
From (\ref{probWRFt1}), we can observe that the objective function is convex w.r.t. $\mathbf{w}_{RF}$, whereas the feasible set $\mathcal{M}^{N_{r}N_{RF}^r\times 1}$ is still non-convex. Fortunately, $\mathcal{M}^{N_{r}N_{RF}^r\times 1}$ is known as the complex circle manifold (CCM) so that (\ref{probWRFt1}) can be addressed by the manifold-based method.
The manifold-based method updates the variable within the tangent space $\mathcal{T} \mathcal{M}$. By updating along the tangent space with a small enough step, the new point is almost within $\mathcal{M}$.
For the manifold in (\ref{cont06}), its corresponding tangent space is given as
\begin{equation}
\begin{split}
&\mathcal{T}_{\mathbf{w}_{RF}} \mathcal{M}^{N_{r}N_{RF}^r\times 1}=\{\mathbf{x} \in \mathbb{C}^{N_{r}N_{RF}^r\times 1}| \Re (\mathbf{x} \circ \mathbf{w}_{RF})=\mathbf{0} \}.
\end{split}
\end{equation}
Resembling the gradient-based method, the manifold-based method will find a direction from the tangent space where the objective function decreases most steeply (for minimization problems), i.e., the negative Riemannian gradient direction. For the manifold $\mathcal{M}^{N_{r}N_{RF}^r\times 1}$, the Riemannian gradient at $\mathbf{w}_{RF}$ is a tangent vector given as the orthogonal projection of the Euclidean gradient $\nabla \mathcal{G}_{w}^{(t)}(\mathbf{w}_{RF})$ onto the tangent space \cite{absil2009optimization}, i.e.,
\begin{equation}
\begin{split}
&\mathbf{\eta}(\mathbf{w}_{RF})=\mathrm{grad} \mathcal{G}_{w}^{(t)}(\mathbf{w}_{RF})=\nabla \mathcal{G}_{w}^{(t)}(\mathbf{w}_{RF})- \Re(\nabla \mathcal{G}_{w}^{(t)}(\mathbf{w}_{RF}) \circ \mathbf{w}_{RF} ) \circ
\mathbf{w}_{RF},
\end{split}
\label{RiemGrad}
\end{equation}
where $\nabla \mathcal{G}_{w}^{(t)}(\mathbf{w}_{RF})=-2\kappa_r\mathbf{a}_{w_{RF}}^{(t)}+ 2\kappa_r \Vert\mathbf{u}_r^{(t)}\Vert^2 \mathbf{B}_{w_{RF}}^{(t)} \mathbf{w}_{RF}$
denotes the Euclidean gradient.
The Riemannian gradient in the tangent space is the optimization direction that shifts the manifold the least.
In practice, a retraction is needed to remap the updated points from the tangent space onto the manifold.
The retraction of a tangent vector $\beta \mathbf{d} \in \mathcal{T}_{\mathbf{w}_{RF}}\mathcal{M}^{N_{r}N_{RF}^r\times 1}$ at $\mathbf{w}_{RF}$ is
\begin{equation}
\begin{split}
\mathcal{P}: &\mathcal{T}_{\mathbf{w}_{RF}}\mathcal{M}^{N_{r}N_{RF}^r\times 1}\to \mathcal{M}^{N_{r}N_{RF}^r\times 1}\\
& \beta \mathbf{d} \to \left(\mathbf{w}_{RF}+\beta \mathbf{d} \right) \circ \frac{\mathbf{1}}{|\mathbf{w}_{RF}+\beta \mathbf{d}|_e},
\end{split}
\label{funcP}
\end{equation}
where $\frac{\mathbf{1}}{|\mathbf{x}|_e}\in \mathcal{R}^{N_{r}N_{RF}^r\times 1}$ denotes a vector whose $i$th entry is ${1}/{|x_{i}|}$, and $\beta$ represents the Armijo step \cite[Definition 4.2.2]{absil2009optimization}.
To solve (\ref{probWRFt1}), we propose the manifold-based method summarized in Algorithm \ref{ALG1}, whose convergence is guaranteed by \cite[Theorem 4.3.1]{absil2009optimization}. Algorithm \ref{ALG1} provides the update $\mathbf{w}_{RF}^{(t+1)}=\mathbf{w}_{RF}^{{(t,\star)}}$.
\begin{algorithm}[t]
\caption{Proposed Manifold-based Method to obtain $\mathbf{w}_{RF}^{{(t,\star)}}$}
\textbf{Input:} An initial point $\mathbf{w}_{RF}^{(t,0)}=\mathbf{w}_{RF}^{(t)}$ and $\mathbf{d}^{(0)}=-\mathbf{\eta} \left(\mathbf{w}_{RF}^{(t,0)} \right)$.
\textbf{Repeat}
\begin{enumerate}
\item Compute $\beta^{(m)}$ via the Armijo line search step \cite[Definition 4.2.2]{absil2009optimization}.
\item Update $\mathbf{w}_{RF}^{(t,m+1)}=\mathcal{P}(\beta^{(m)} \mathbf{d}^{(m)})$ via (\ref{funcP}).
\item Compute the Riemannian gradient $\mathbf{\eta} \left(\mathbf{w}_{RF}^{(t,m+1)} \right)$ via (\ref{RiemGrad}).
\item Update the optimization direction $\mathbf{d}^{(m+1)}=-\mathbf{\eta} \left(\mathbf{w}_{RF}^{(t,m+1)} \right)$.
\item $m \gets m+1$.
\end{enumerate}
\textbf{Until} Convergence criterion is met.\\
\textbf{Output:} The optimal solution $\mathbf{w}_{RF}^{{(t,\star)}}$.
\label{ALG1}
\end{algorithm}
\subsection{Update $\mathbf{F}^{(t+1)}$}
We first reformulate the problem w.r.t. $\mathbf{F}$ as a quadratically constrained quadratic programming (QCQP) which is a subclass of semi-definite programming (SDP) \cite{vandenberghe1996semidefinite}.
Define the vectorization of $\mathbf{F}$ as $\mathbf{f}=\mathrm{vec}\left(\mathbf{F}\right)$.
Omitting some constants, (\ref{lossfunc}) w.r.t. $\mathbf{f}$ is rewritten as
\begin{equation}
\begin{split}
&\mathcal{F}_R\left(\mathbf{f}|\mathbf{w},\mathbf{W}_{RF}, \mathbf{u}_r \right)=2\kappa_r\Re(\mathbf{a}_F^\HH \mathbf{f})-\kappa_r\Vert\mathbf{u}_r\Vert^2 \mathbf{f}^\HH \mathbf{B}_F \mathbf{f}+const,
\end{split}
\label{fRrefo}
\end{equation}
where
\begin{equation}
\begin{split}
&\mathbf{a}_F= \sigma_t \mathrm{vec}\left(\mathbf{A}_{R}^\HH \mathbf{W}_{RF} \mathbf{w}\mathbf{u}_r^\HH \right),\quad \mathbf{B}_F=\mathbf{I} \otimes \left(\sum\limits_{l=1}^{L} \sigma_{c,l}^2\mathbf{A}_{c,l}^\HH\mathbf{W}_{RF}\mathbf{w}\mathbf{w}^\HH \mathbf{W}_{RF}^\HH\mathbf{A}_{c,l}\right).
\end{split}
\end{equation}
Then (\ref{lossfuncCk}) can be rewritten as
\begin{equation}
\begin{split}
&\mathcal{F}_k \left(\mathbf{f} |u_{k} \right)=2\kappa_c\Re\left( \mathbf{a}_{F_k}^\HH \mathbf{f} \right)-\kappa_c \mathbf{f}^\HH \mathbf{B}_{F_k} \mathbf{f} -\kappa_c|u_k|^2 \sigma_c^2,
\end{split}
\label{fkrefo}
\end{equation}
where
\begin{equation}
\begin{split}
&\mathbf{a}_{F_k}=u_{k}^*\mathbf{e}_k\otimes \mathbf{h}_{c,k},\quad\mathbf{B}_{F_k}=||u_{k}||^2 (\mathbf{1}-\mathbf{e}_k )(\mathbf{1}-\mathbf{e}_k )^\mathrm{T} \otimes \mathbf{h}_{c,k}\mathbf{h}_{c,k}^\HH,
\end{split}
\end{equation}
with $\mathbf{e}_k=[\underbrace{0,\cdots,0}_{k-1},1,\underbrace{0,\cdots,0}_{N_s-k}]^\mathrm{T}.$
By substituting (\ref{fRrefo}) and (\ref{fkrefo}) into (\ref{probFt1}), the resultant problem is a typical QCQP because the objective function and all constraints are reformulated as a linear or quadratic form.
This problem can be easily solved by the well-known CVX toolbox \cite{cvx}. We then update $\mathbf{F}^{(t+1)}$ by rearranging $\mathbf{f}^{{(t,\star)}}$.
\textbf{Remark 2}:
The proposed AO-based method consists of six sub-optimization problems, i.e., (\ref{probwt1})-(\ref{zetat1}), where the computational cost is dominated by (\ref{probwt1}), (\ref{probWRFt1}) and (\ref{probFt1}). The first step aims to obtain the digital baseband processor $\mathbf{w}$, whose main computational cost comes from the inverse operation of the $N_{RF}^r \times N_{RF}^r$ matrix. Therefore, the computational cost of the first step is about $\mathcal{O}((N_{RF}^r)^3 I_1)$ where $I_1$ denotes the number of iterations to update $\mathbf{w}$. The second step is a manifold-based optimization to obtain $\mathbf{W}_{RF}$, whose computational cost is about $\mathcal{O}(N_r N_{RF}^r I_{2})$ where $I_2$ denotes the number of iterations required by the bisection method to update $\mathbf{W}_{RF}$ \cite{9234098}. The third step is a QCQP solved by the CVX toolbox, whose computational cost is about $\mathcal{O}((N_t N_s)^3 I_{3})$, where $I_3$ denotes the required number of iterations to update $\mathbf{F}$. In this case, the total computational cost of the proposed AO-based method is about $\mathcal{O}(((N_{RF}^r)^3 I_1+N_r N_{RF}^r I_{2}+(N_t N_s)^3 I_{3})T)$, where $T$ denotes the number of iterations required by the proposed optimization problem in (\ref{probfracF}). It is observed from experiments that $T$ is usually no more than 10.
Meanwhile, the performance of the AO-based method depends on the weighting coefficients $\kappa_c$ and $\kappa_R$, but it is hard to adjust them to meet a desired communication or sensing performance. These issues motivate us to find other methods. One option is to use other optimization methods, such as the alternating direction method of multipliers (ADMM). However, such methods also involve an internal iteration process whose computational cost is still high since the dimension of $\mathbf{f}$ is large. Moreover, their performance also depends on some intermediate parameters. In the next section, we derive some linear transceiver structures to reduce the complexity and reveal more physical sights.
\section{Linear Transceiver Design}
In this section, we derive two sub-optimal transceiver structures to reduce the computational cost. These methods aim to maximize the sensing performance with given communication requirements.
\subsection{Linear Transmitter Design}
\subsubsection{ZF Transmitter}
ZF is a well-established beamforming method. In the concerned PMN-TMT, the channel matrix for the UEs is given as $\mathbf{H}_c
=\left[ \mathbf{h}_{c,1},\cdots,\mathbf{h}_{c,K} \right] \in \mathbb{C}^{N_t\times K}.$
Then, the zero forcing precoder can be written as
\begin{equation}
\label{Fzfdef}
\begin{split}
\mathbf{F}_{\text{ZF}}=\mu \mathbf{H}_c(\mathbf{H}_c^\HH \mathbf{H}_c)^{-1}\in \mathbb{C}^{N_t\times K},
\end{split}
\end{equation}
where
\begin{equation}
\begin{split}
\mu=\sqrt{\frac{P}{\mathrm{tr}\left[(\mathbf{H}_c^\HH \mathbf{H}_c)^{-1}\right]}}
\end{split}
\end{equation}
denotes the normalized coefficient that guarantees $||\mathbf{F}_{\text{ZF}}||^2=P$.
It can be validated that
\begin{equation}
\begin{split}
\mathbf{h}_{c,i}^\HH \mathbf{f}_{\text{ZF},j}=\left\{\begin{matrix}
\mu,i= j\\
0,i\neq j\\
\end{matrix}
\right. ,
\end{split}
\end{equation}
where $\mathbf{f}_{\text{ZF},j}$ denotes the $j$th column of $\mathbf{F}_{\text{ZF}}$, indicating that the beam for one UE will not generate interference to others.
For an ISAC system, the channel between the BS and the ST is unknown. Thus, we leverage the steering vector towards the ST. Construct the ISAC `channel' matrix as
\begin{equation}
\label{Heisac}
\begin{split}
\mathbf{H}_e(\lambda_{a})
=\left[ \mathbf{H}_{c},\lambda_{a}\mathbf{a}_T(\phi_t) \right] \in \mathbb{C}^{N_t\times (K+1)},
\end{split}
\end{equation}
where $\lambda_{a}$ denotes a normalized coefficient to balance the amplitude of $\mathbf{a}_T(\phi_t)$.
Then the ZF-ISAC precoder is given as
\begin{equation}
\begin{split}
\mathbf{F}_{\text{ZF-ISAC}}=\mu_{a}(\lambda_{a}) \mathbf{H}_e(\lambda_{a})\left(\mathbf{H}_e^\HH(\lambda_{a}) \mathbf{H}_e(\lambda_{a})\right)^{-1},
\end{split}
\label{Fzfisac}
\end{equation}
where
\begin{equation}
\label{mudef}
\begin{split}
\mu_{a}(\lambda_{a})=\sqrt{\frac{P}{\mathrm{tr}\left[(\mathbf{H}_e^\HH(\lambda_{a}) \mathbf{H}_e(\lambda_{a}))^{-1}\right]}}.
\end{split}
\end{equation}
\begin{lemma}
\label{mualemma}
The normalized coefficient $\mu_a(\lambda_{a})$ can be simplified as
\begin{equation}
\label{mualammadef}
\begin{split}
\mu_{a}(\lambda_{a})=\sqrt{\frac{P}{C_a + \frac{1}{\lambda_a^2 C_b}}},
\end{split}
\end{equation}
where
\begin{equation}\nonumber
\begin{split}
C_a&=\mathrm{tr}(\mathbf{H}_c^\HH \mathbf{H}_c)^{-1}+\frac{\mathbf{a}_T^\HH(\phi_t) \mathbf{H}_c(\mathbf{H}_c^\HH \mathbf{H}_c)^{-2}\mathbf{H}_c^\HH\mathbf{a}_T(\phi_t)}{1-\mathbf{a}_T^\HH(\phi_t) \mathbf{H}_c(\mathbf{H}_c^\HH \mathbf{H}_c)^{-1}\mathbf{H}_c^\HH\mathbf{a}_T(\phi_t)},\\
C_b&=1-\mathbf{a}_T^\HH(\phi_t) \mathbf{H}_c(\mathbf{H}_c^\HH \mathbf{H}_c)^{-1}\mathbf{H}_c^\HH\mathbf{a}_T(\phi_t).
\end{split}
\end{equation}
\end{lemma}
\emph{Proof}: See Appendix \ref{muaproof}. \hfill $\blacksquare$
It can be checked that
\begin{equation}
\begin{split}
&\mathbf{h}_{c,i}^\HH \mathbf{f}_{\text{ZF-ISAC},j}=\left\{\begin{matrix}
\mu_a,i= j\\
0,i\neq j\\
\end{matrix}
\right.
,\quad\mathbf{a}_T^\HH(\phi_t)\mathbf{f}_{\text{ZF-ISAC},j}=\left\{\begin{matrix}
\frac{\mu_a}{\lambda_{a}},j= K+1\\
0,j \neq K+1\\
\end{matrix}
\right. ,
\end{split}
\end{equation}
which indicates that there is no interference between sensing and communication.
By substituting (\ref{Fzfisac}) into (\ref{gammak}), we have the SINR for $K$ UEs as
\begin{equation}
\begin{split}
\gamma_1=\cdots=\gamma_K=\frac{\mu_{a}^2(\lambda_{a})}{\sigma_c^2}.
\end{split}
\end{equation}
To guarantee the minimum SINR among all UEs is greater than a given threshold, i.e.,
\begin{equation}
\begin{split}
\min_{k \in [1,K]}\gamma_k = \frac{\mu_{a}^2(\lambda_{a})}{\sigma_c^2} \geq \Gamma,
\end{split}
\end{equation}
we can obtain $\lambda_{a}=\sqrt{\frac{1}{C_b(\frac{P}{\Gamma \sigma_c^2}-C_a)}}$
where $\Gamma$ denotes the given threshold.
The transmit power on the direction of the ST is thus given by
\begin{equation}
\label{ptgtzf0}
\begin{split}
P_{ZF,tgt}
&\triangleq \mathbb{E}\left(||a_T^\HH(\phi_t) \mathbf{F}_{\text{ZF-ISAC}}\mathbf{s}||^2\right)= \frac{\mu_{a}^2(\lambda_{a})}{\lambda_{a}^2}=(P-\Gamma\sigma_c^2 C_a)C_b.
\end{split}
\end{equation}
\subsubsection{Beam Synthesis Transmitter}
Note that the communication signal can also be leveraged for sensing since the transmitted communication waveform is known by the TMT. Thus, although the sensing signals are not supposed to create interference to the UEs, the communication signals can be leaked to the direction of the ST.
In the following, we will investigate how the above observation can be exploited by the B-syn method \cite{9648341}.
In particular, by the array response control, the beam pattern is synthesized to force the orientation and nulls of beams at the directions of the target
and interference, respectively.
For the given ISAC system, the B-syn precoder can be constructed as
\begin{equation}
\begin{split}
&\mathbf{F}_{\text{B-syn}}\triangleq\left[\underbrace{\mathbf{f}_{\text{B-syn},c,1},\cdots,\mathbf{f}_{\text{B-syn},c,K}}_{\text{Communication}},\underbrace{\mathbf{f}_{\text{B-syn},R,1},\cdots,\mathbf{f}_{\text{B-syn},R,N_s-K}}_{\text{Sensing}}\right],
\end{split}
\label{Fbs}
\end{equation}
where
\begin{equation}
\begin{split}
&\mathbf{f}_{\text{B-syn},c,i}=\alpha_i\mathbf{f}_{\text{ZF},i}+\beta_{i}\mathbf{f}_\perp, i=1,\cdots,K,\\
&\mathbf{f}_{\text{B-syn},R,j}=\nu_j \mathbf{f}_\perp, j=1,\cdots,N_s-K,\\
\end{split}
\label{Fbt}
\end{equation}
denote the beamformers for the $K$ UEs and the radar target, respectively. Here $\mathbf{f}_{\text{ZF},i}$ denotes the $i$th column of $\mathbf{F}_{\text{ZF}}$ defined in (\ref{Fzfdef}). Note that the beamformer to the UE includes two parts, i.e., the ZF precoder to the $i$th UE ($\mathbf{f}_{\text{ZF},i}$) and the leaked communication signal towards the ST ($\mathbf{f}_\perp$). Here, $\alpha_i$, $\beta_i$ and $\nu_j$ denote the weighting coefficients for the communication terms, the leaked communication terms, and the dedicated sensing terms, respectively. To avoid interference from sensing to communication, the term $\mathbf{f}_\perp$ is expected to have the following property:
\begin{equation}
\begin{split}
&\mathbf{H}_c^\HH\mathbf{f}_\perp=\mathbf{0},\quad\mathbf{a}_T^\HH(\phi_t)\mathbf{f}_\perp=1,
\end{split}
\label{ZFr}
\end{equation}
indicating that $\mathbf{f}_\perp$ should not impose interference to communication and should have a constant gain on the direction of the ST.
We then choose $\mathbf{f}_\perp$ as the projection of $\mathbf{a}_T(\phi_t)$ in the null-space of $\mathbf{H}_c$, i.e.,
\begin{equation}\label{Fperp}
\begin{split}
\mathbf{f}_\perp=\frac{\mathbf{a}_T(\phi_t)-\mathbf{H}_c(\mathbf{H}_c^\HH \mathbf{H}_c)^{-1}\mathbf{H}_c^\HH \mathbf{a}_T(\phi_t)}{1-\mathbf{a}_T^\HH(\phi_t)\mathbf{H}_c(\mathbf{H}_c^\HH \mathbf{H}_c)^{-1}\mathbf{H}_c^\HH \mathbf{a}_T(\phi_t)}.
\end{split}
\end{equation}
It can be validated that $\mathbf{F}_{\text{ZF}}^\HH \mathbf{f}_{\perp} =\mathbf{0}$ and $||\mathbf{f}_\perp||^2=\frac{1}{C_b}$. From (\ref{Fbt}) and (\ref{ZFr}), we can observe the communication precoder $\mathbf{f}_{\text{B-syn},c,i}$ will transmit signals on the
direction of the $i$th UE and the ST without interfering the other UEs. The sensing beamformer $\mathbf{f}_{\text{B-syn},R,j}$ will transmit signals on the direction of the ST without imposing interference to UEs.
The remaining issue is how to allocate power to these component beams. By substituting (\ref{Fbt}) into (\ref{gammak}), we have
\begin{equation}
\begin{split}
\gamma_k=\frac{|\alpha_k|^2 \mu^2 }{\sigma_c^2}, k=1,\cdots,K.
\end{split}
\end{equation}
It is desired to maximize the sensing performance with a minimal SINR for all UEs, i.e., $\min_{k \in [1,K]}\gamma_k \geq \Gamma$.
Thus, we consider the equal-rate transmission, i.e.,
\begin{equation}
\begin{split}
\alpha_1=\cdots=\alpha_K=\alpha_\star = \sqrt{\frac{\Gamma \sigma_c^2}{\mu^2}}.
\end{split}
\end{equation}
The remaining task is to determine $\beta_{i}$ and $\nu_j$. We give the following proposition for allocating power to maximize the transmitted power on the direction of ST.
\begin{proposition} \label{Ptgt}
The optimal allocation is given as $\nu_{j}=0,j=1,\cdots,N_s-K$ and
\begin{equation}
\begin{split}
\beta_i=\sqrt{(P-\Gamma \sigma_c^2 \mathrm{tr}(\mathbf{H}_c^\HH \mathbf{H}_c)^{-1})C_b}\cdot\frac{\mathbf{f}_{\text{ZF},i}^\HH\mathbf{a}_T(\phi_t)}{||\mathbf{F}_{\text{ZF}}\mathbf{a}_T(\phi_t)||}, i=1,\cdots,K.
\end{split}
\end{equation}
\end{proposition}
The resultant transmit power on the direction of ST is given as
\begin{equation}
\begin{split}
&P_{\text{B-syn},tgt}
=2\alpha_\star\sqrt{P_q}||\mathbf{a}_{tgt}|| + C_{tgt},\\
\end{split}
\label{ptgt1}
\end{equation}
where
\begin{equation}\label{ctgt}
\begin{split}
C_{tgt}&=\Gamma \sigma_c^2 \mathbf{a}_T^\HH(\phi_t) \mathbf{H}_{c} \left(\mathbf{H}_{c}^\HH\mathbf{H}_{c}\right)^{-2}\mathbf{H}_{c}^\HH \mathbf{a}_T(\phi_t) +(P-\Gamma \sigma_c^2 \mathrm{tr}(\mathbf{H}_c^\HH \mathbf{H}_c)^{-1})C_b.
\end{split}
\end{equation}
\emph{Proof}: See Appendix \ref{ptgtproof}.
Proposition 2 indicates that instead of designing dedicated sensing streams, we should add the sensing streams to the communication streams. As a result, the transmit signal can be given by $\sum_{i=1}^{K}\alpha_\star \mathbf{a}_T^\HH(\phi_t)\mathbf{f}_{\text{ZF},i}s_{c,i}+\sum_{i=1}^{K}\beta_{i} s_{c,i}=\sum_{i=1}^{K}\left(\alpha_\star \mathbf{a}_T^\HH(\phi_t)\mathbf{f}_{\text{ZF},i}+\beta_{i}\right)s_{c,i}$.
It can be observed from (\ref{ptgt1}) that there are three energy terms in $P_{\text{B-syn},tgt}$, including the two terms in $C_{tgt}$. On the other hand, if we use a dedicated sensing stream, the transmit signal is given by $\sum_{i=1}^{K}\alpha_\star \mathbf{a}_T^\HH(\phi_t)\mathbf{f}_{\text{ZF},i}s_{c,i} +\sum_{j=1}^{N_s-K}\nu_{j} s_{R,j}$ where the received power is equal to $C_{tgt}$. Thus, the advantage of the B-syn scheme comes from the cross-term $2\alpha_\star\sqrt{P_q}||\mathbf{a}_{tgt}||$. We may regard this cross-term as the reuse or leaking of communication energy for the sensing purpose.
Comparing the transmit power towards the ST by ZF and B-syn, we have the following proposition regarding the improvement of B-syn over ZF.
\begin{proposition}
The improvement of the transmit power towards the ST by B-syn over ZF can be obtained
from (\ref{ptgtzf0}) and (\ref{ptgt1}) as
\begin{equation}
\label{ineq}
\begin{split}
P_{\text{B-syn},tgt}-P_{ZF,tgt}
&=\frac{2\Gamma \sigma_c^2 }{\mu^2} ||\mathbf{F}_{\text{ZF}}^\HH \mathbf{a}_T(\phi_t)||^2+2\sqrt{\frac{\Gamma \sigma_c^2 P_q}{\mu^2}}||\mathbf{F}_{\text{ZF}}^\HH \mathbf{a}_T(\phi_t)||\geq 0.
\end{split}
\end{equation}
\end{proposition}
\textbf{Remark 3}: The improvement by B-syn over ZF will be zero only when
\begin{enumerate}
\item $\Gamma = 0$, indicating that the required communications performance is zero. Then all power will be allocated to sensing.
\item $\mathbf{F}_{\text{ZF}}^\HH \mathbf{a}_T(\phi_t)=\mathbf{0}$. Recalling (\ref{Fzfdef}), it is equivalent to $\mathbf{H}_{c}^\HH \mathbf{a}_T(\phi_t)=\mathbf{0}$, implying that the ST already falls into the null space of $\mathbf{H}_{c}$.
\end{enumerate}
In the above cases, B-syn is equivalent to ZF. On the other hand, the performance gap between B-syn and ZF will become larger if $||\mathbf{F}_{\text{ZF}}^\HH \mathbf{a}_T(\phi_t)||^2$ is larger. Note that $\mathbf{F}_{\text{ZF}}^\HH \mathbf{a}_T(\phi_t)$ denotes the power of $\mathbf{F}_{\text{ZF}}$ on the ST direction. In general, if the ST is closer to one UE, the correlation between them gets larger and it is more efficient to leak power from that UE to the ST.
\textbf{Remark 4}: B-syn and ZF are the linear precoders, whose computational cost mainly comes from matrix operations. Specially, the computational cost of (\ref{Fzfdef}) and (\ref{Fperp}) are dominated by the inverse operation of $\mathbf{H}_c^\mathrm{H} \mathbf{H}_c$ with complexity $\mathcal{O}(K^3+K^2N_t) $. Thus, the computational cost of (\ref{Fzfdef}) and (\ref{Fperp}) are about $\mathcal{O}(K^3+2K^2N_t) $ and $\mathcal{O}(K^3+2 K^2 N_t+2 K N_t)$, respectively, whereas that of the AO for updating $\mathbf{F}$ is about $\mathcal{O}((N_t N_s)^{3}I_3)$. Note that we choose $N_s=K$ for B-syn and ZF.
This indicates that the proposed B-syn and ZF methods can significantly reduce the computational cost. Meanwhile, B-syn and ZF can update the precoder with a given communication requirement. ZF transmits a dedicated sensing data stream to the ST and there is no interference between the dedicated sensing signal and the communication signals.
In contrast, B-syn leaks energy from the communication signal to ST. From (\ref{ineq}), we can observe that, it is better to leak communication energy to the ST direction than designing a dedicated sensing signal. In particular, B-syn uses less data stream to achieve a better sensing performance than ZF.
\subsection{Receiver Design}
In the above, we give two methods to design the transmitter. With a given transmitter structure, to maximize the SCNR, the design of the receiver $\mathbf{w}_{\text{eff}}$ is given by
\begin{equation}
\begin{split}
\max_{\mathbf{w}_{\text{eff}}} \;\text{SCNR}(\mathbf{w}_{\text{eff}})=\frac{\sigma_t^2 P_{tgt} \left| \mathbf{w}_{\text{eff}}^\HH \mathbf{a}_R(\phi_t) \right|^2}{\mathbf{w}_{\text{eff}}^\HH \mathbf{R}_{CN} \mathbf{w}_{\text{eff}}},
\end{split}
\end{equation}
where $P_{tgt}$ denotes the power transmitted to the ST and $\mathbf{R}_{CN}= \sum\limits_{l=1}^{L}\sigma_{c,l}^2 \mathbf{A}_{c,l}\mathbf{F}\mathbf{F}^\HH\mathbf{A}_{c,l}^\HH +\sigma_n^2\mathbf{I}.$
This problem is the classic MVDR beamforming problem, whose solution is given by \cite{1449208}
\begin{equation}\label{weff}
\begin{split}
\mathbf{w}_{\text{eff}}=\frac{\mathbf{R}_{CN}^{-1} \mathbf{a}_R(\phi_t)}{\mathbf{a}_R^\HH(\phi_t)\mathbf{R}_{CN}^{-1} \mathbf{a}_R(\phi_t)}.
\end{split}
\end{equation}
Then we can adopt the fast optimization method in \cite{8646553} to obtain $\mathbf{W}_{RF}$ and $\mathbf{w}$ from $\mathbf{w}_{\text{eff}}$. Assembling the MVDR receiver with B-syn and ZF yields two linear transceiver structures, i.e., `B-syn $+$ MVDR' and `ZF $+$ MVDR'.
\textbf{Remark 5}: The computational cost of (\ref{weff}) and the method in \cite{8646553} are about $\mathcal{O}((N_{RF}^{r})^3)$ and $\mathcal{O}(N_{RF}^{r} N_s I_4)$, respectively, where $I_4$ denotes the number of required iterations. Thus, the total computational cost of `B-syn $+$ MVDR' and `ZF $+$ MVDR' are about $\mathcal{O}((N_{RF}^{r})^3+N_{RF}^{r} N_s I_4+K^3+ K^2 N_t)$ and $\mathcal{O}((N_{RF}^{r})^3+N_{RF}^{r} N_s I_4+K^3+2 K^2 N_t+2 K N_t)$, respectively.
Compared with the computational cost of AO, i.e., $\mathcal{O}(((N_{RF}^r)^3 I_1+N_r N_{RF}^r I_{2}+(N_t N_s)^3 I_{3})T)$, the linear transceiver structures are more computationally efficient.
\section{Simulation}
In this section, we show the performance of the proposed PMN-TMT with different transceiver structures. In the simulation, we consider a mmWave system operating at a carrier frequency of 28GHz. We assume that the ISAC system serves 3 single antenna UEs and 1 ST. The BS employs a ULA with $N_t = 128$ antennas. Unless specified otherwise, we also set $N_r = 128$ and $N_{RF}=4$. In this paper, we fix the distance between the BS and TMT as 50m. The distances between the BS and UEs are set as a random variable uniformly distributed in the range $[19,21]$m. The AOD and AOA of the ST, UEs and clutter patches are set as random variable uniformly distributed in the range $[-\frac{\pi}{2},\frac{\pi}{2}]$.
The noise power at the UEs and TMT are $\sigma_c^2$ and $\sigma_n^2$, respectively.
We set $\sigma_c^2=\sigma_n^2=-90$dBm, $\sigma_t^2/\sigma_n^2=20$dB and $\frac{1}{L}\sum_{l=1}^{L}\sigma_{c,l}^2/\sigma_n^2=30$dB.
Recalling (\ref{channelmodel}), the channel between the BS and $k$th UE is modeled as \cite{9234098}
\begin{equation}
\begin{split}
\mathbf{h}_{c,k}=\sqrt{\frac{N_{t}}{N_{p}}} \sum_{i=1}^{N_{p}} \beta_{k,i}^{(t)} \mathbf{a}_{T} (\phi_{k,i}^{(t)}),
\end{split}
\end{equation}
where $\beta_{k,i}^{(t)}\sim \mathcal{CN}(0,10^{-0.1\kappa})$ denotes the complex gain of the LOS path and $\kappa$ is the path loss given as $\kappa=a+10b\log_{10}(d)+\epsilon$
with $d$ denoting the distance between the BS and the $k$th UE and $\epsilon \sim \mathcal{CN}(0,\sigma_{\epsilon}^2)$ \cite{6834753}. Following \cite{6834753}, we set $a=61.4$, $b=2$, $\sigma_{\epsilon}=5.8$dB. $\beta_{k,i}^{(t)}\sim \mathcal{CN}(0,10^{-0.1(\kappa+\mu)})$ denotes the complex gain of the NLOS path and $\mu$ is the Rician factor \cite{7503970}. We model the small-scale fading as Rician, where the Rician factors is set as 7dB for LOS and 0dB for NLOS. Here, we set $N_p=4$.
For the manifold optimization, we set the maximum number of iterations as $200$. The tolerance for the norm of the gradient between two iterations is $10^{-4}$. To terminate the iteration, the tolerance for the objective function between two iterations is $10^{-2}$ and the maximum number of iterations is $20$.
\subsection{System Performance}
\begin{figure}[t]
\centering
\includegraphics[width=3.2in]{ObjFunc_test1.pdf}
\caption{The objective function $\mathcal{L}(\mathbf{w},\mathbf{W}_{RF},\mathbf{F})$ over iterations.}
\label{fig_Conv}
\end{figure}
In Sec. III, we prove the convergence of the proposed AO method. Here, we first show its convergence through the simulation.
Fig. \ref{fig_Conv} illustrates the convergence behavior of the average objective function with AO. Here we set $N_r=32$, $\kappa_c=0.5$ and 500 Monte-Carlo experiments are performed.
It can be observed that the iteration will converge in about 4 rounds.
\begin{figure}[t]
\centering
\includegraphics[width=3.2in]{BT_sensing_test6.pdf}
\caption{Comparison of different methods for updating $\mathbf{F}$.}
\label{fig_BT}
\end{figure}
Fig. \ref{fig_BT} shows the average sensing performance of different transceiver structures with different levels of communication performance requirement with $N_r=32$. For each curve, 800 Monte-Carlo experiments are performed.
The legend `AO ($\kappa_c = C$)' denotes the AO method proposed in Sec. III with $\kappa_c = C$. The legend `Beam synthesis' and `ZF' represent the proposed `B-syn + MVDR' and ‘ZF + MVDR’ transceivers with a given $\Gamma$, respectively.
In particular, $\Gamma=\Gamma_{\text{AO},\kappa_c=C}$ means that we fix $\Gamma$ to be the same as that of the `AO' with $\kappa_c=C$. Note that $\Gamma_{\text{AO},\kappa_c=0.5}<\Gamma_{\text{AO},\kappa_c=0.9995}<50$. We have several observations regarding the performance comparison.
\textbf{AO vs. B-syn vs. ZF:} By comparing `AO ($\kappa_c=0.5$)', `Beam synthesis ($\Gamma=\Gamma_{\text{AO},\kappa_c=0.5}$)' and `ZF ($\Gamma=\Gamma_{\text{AO},\kappa_c=0.5}$)', we can observe that the performance of AO outperforms both B-syn and ZF, while B-syn is better than ZF. The same conclusion can be obtained by comparing `AO ($\kappa_c=0.9995$)', `Beam synthesis ($\Gamma=\Gamma_{\text{AO},\kappa_c=0.9995}$)' and `ZF ($\Gamma=\Gamma_{\text{AO},\kappa_c=0.9995}$)'. This is mainly due to different transceivers' tolerance for the interference between UEs and the ST. In particular, AO does not force the beams towards different UEs and the ST to be completely orthogonal. B-syn requires the orthogonality between UEs to completely eliminate the multi-UE interference but allows leakage from the communication signal to the ST. On the other hand, ZF strictly constrains the UEs and ST not to affect each other. In particular, the sensing performance will degrade when the orthogonality constraint is stronger.
\textbf{AO vs. B-syn with Different Communication Requirements:} Comparing `AO ($\kappa_c=0.5$)' and `Beam synthesis ($\Gamma=\Gamma_{\text{AO},\kappa_c=0.5}$)' with `AO ($\kappa_c=0.9995$)' and `Beam synthesis ($\Gamma=\Gamma_{\text{AO},\kappa_c=0.9995}$)', we can observe the gap between AO and B-syn will become smaller when $\kappa_c$ and the corresponding $\Gamma$ increase. This indicates that when the communication requirement is high, B-syn will behave similarly as AO. This is because when the communication requirement is low, the UEs can tolerate higher interference and thus it is not necessary to completely eliminate the multiuser interference. As the communication requirement increases, the multi-UE interference is more critical and forces AO to avoid it like B-syn. Thus, the gap is getting smaller. Under such circumstances, B-syn is preferable since it has much lower computational complexity than AO.
\textbf{B-syn vs. ZF with Different Communication Requirements:} Comparing `Beam synthesis ($\Gamma=\Gamma_{\text{AO},\kappa_c=0.5}$)' and `ZF ($\Gamma=\Gamma_{\text{AO},\kappa_c=0.5}$)' with `Beam synthesis ($\Gamma=50$)' and `ZF ($\Gamma=50$)', we can observe that, as $\Gamma$ increases, the gap between B-syn and ZF will become larger. Note here $\Gamma=50$ corresponds to a higher communication requirement than $\Gamma=\Gamma_{\text{AO},\kappa_c=0.5}$. This indicates that, compared with ZF, B-syn can achieve better sensing performance with the same communication requirement, and as the communication requirement $\Gamma$ increases, the power improvement in (\ref{ineq}) becomes larger.
\begin{figure}[h]
\centering
\includegraphics[width=3.2in]{Ns_effect_test2.pdf}
\caption{Effect of $N_s$ for AO.}
\label{fig_Ns}
\end{figure}
\textbf{Energy Leaking:} In Sec. IV, we proved that it is more efficient to leak communication energy to the ST than sending a dedicated sensing signal, i.e., B-syn outperforms ZF. However, it is hard to prove this property for AO. In Fig. \ref{fig_Ns}, we show the sensing performance of AO with different number of data streams $N_s$ when $\kappa_c=0.5$. Note that the case $N_s=K$ indicates there are $K$ communication data streams and no dedicated sensing signal, while the case $N_s=K+C$ indicates that there are $C$ data streams for sensing. It can be observed that, as $N_s$ increases, the performance of AO becomes slightly worse, implying that the dedicated sensing signal is also less efficient for AO.
\subsection{Physical Insights}
In this section, we reveal some physical insights by looking into the beam patterns with different transceiver structures.
\begin{figure*}[h]
\centering
\subfloat[]{\includegraphics[width=3.2in]{BP_UE1_test9.pdf}}\
\subfloat[]{\includegraphics[width=3.2in]{BP_UE2_test9.pdf}}\
\subfloat[]{\includegraphics[width=3.2in]{BP_UE3_test9.pdf}}\\
\caption{Transmitted beam pattern for different data streams. (a) Data stream 1 for UE 1 ($10^\circ$); (b) Data stream 2 for UE 2 ($15^\circ$); (c) Data stream 3 for UE 3 ($40^\circ$).
}
\label{fig_beampattran0}
\end{figure*}
\textbf{Interference Management:} In Fig. \ref{fig_beampattran0}, we show how interference management and power allocation between sensing and communication are achieved by different transmitter structures, which further explains the performance difference shown in Fig. \ref{fig_BT}. For ease of display, we fix the direction of the ST, the UEs and the clutter patches at $45^\circ$, $\{ 10^\circ,15^\circ,40^\circ \}$ and $\{ 50^\circ,60^\circ \}$, respectively. Parts (a), (b) and (c) in Fig. \ref{fig_beampattran0} illustrate the beam pattern for each UE, together with their corresponding energy leakage to the ST. The beam pattern for the $i$th communication data stream is defined as $P_{i}(\phi)=||\mathbf{a}_T^\HH(\phi)\mathbf{f}_{c,i}||^2$. Here we set $\kappa_c=0.5$.
It can be observed that both ZF and B-syn eliminate the multi-user interference, but AO allows a low level of interference. In terms of the power leakage from communication to sensing, both B-syn and AO leak a certain amount of energy from the UEs to the ST, but ZF does not. Furthermore, with AO, the transmit gain on the ST direction from data streams 1, 2, and 3 are about $16.2145$dB, $16.2416$dB and $16.4111$dB, respectively, where the total gain is about $21.0612$dB.
The corresponding numbers for B-syn are $4.7362$dB, $11.0243$dB and $20.4923$dB, respectively, and the total gain is about $21.0598$dB.
Meanwhile, the resultant SCNR of AO and B-syn are $475.947$ and $472.001$, respectively.
These observations agree with (\ref{qsolu0}), which indicates that $\beta_i$ is proportional to the $i$th entry of $\mathbf{a}_{tgt}$, i.e., $\mathbf{a}_T^\HH(\phi_t)\mathbf{f}_{ZF,i}$ and it is more efficient to leak energy to the ST from UEs closer to the ST (higher channel correlation).
\begin{figure}[t]
\centering
\includegraphics[width=3.2in]{BP_all_test8.pdf}
\caption{Overall Beam Pattern.}
\label{fig_beampatternall}
\end{figure}
\textbf{Overall Beam Pattern:} Fig. \ref{fig_beampatternall} shows the overall beam pattern, i.e., $P(\phi) =||\mathbf{a}_T^\HH (\phi) \mathbf{F}||^2$.
Comparing AO with B-syn, we can observe that they achieved the same communication performance by different strategies, i.e., AO delivers a higher power to the UEs while allowing interference between UEs, but B-syn forces the interference to zero while sending a lower power to different UEs. On the other hand, the transmit power towards the ST by two schemes is similar, which agrees with Fig. \ref{fig_BT}. When comparing B-syn with ZF, we notice that they achieved the same gain for the UEs but B-syn obtained a higher transmit power towards the ST, because leaking energy from communication to sensing is more efficient than forming a dedicated sensing signal, which agrees with (\ref{ineq}). Furthermore, we can observe that AO transmits extremely low (but non-zero) power on the direction of the clutter patches, i.e., $\{ 50^\circ,60^\circ \}$. As will be shown later, this will give more freedom to the receiver design.
\begin{figure*}[t]
\centering
\subfloat[]{\includegraphics[width=3.2in]{BP_UE1_test9_3.pdf}}\
\subfloat[]{\includegraphics[width=3.2in]{BP_UE2_test9_3.pdf}}\
\subfloat[]{\includegraphics[width=3.2in]{BP_UE3_test9_3.pdf}}\\
\caption{Transmitted beam pattern for different location of ST and UEs. (a) $\phi_t=65^\circ$, Data stream 1 for UE 1 ($70^\circ$); (b) $\phi_t=65^\circ$, Data stream 2 for UE 2 ($75^\circ$); (c) $\phi_t=65^\circ$, Data stream 3 for UE 3 ($80^\circ$).
}
\label{fig_beampattran1}
\end{figure*}
\textbf{Which UE Leaks More Energy?} Fig. \ref{fig_beampattran1} shows the beam pattern where the relative locations of the UEs with respect to the ST are different and we set $\Gamma=600$. In general, the ST can obtain more gain from the closer UEs. The B-syn and ZF methods can always avoid multi-UE interference.
\begin{figure*}[t]
\centering
\subfloat[]{\includegraphics[width=3.2in]{BP_all_test8_1.pdf}}\
\subfloat[]{\includegraphics[width=3.2in]{BP_all_test8_2.pdf}}\\
\caption{Transmitted beam pattern under different $\Gamma$. (a) $\Gamma=80$; (b) $\Gamma=800$;.
}
\label{fig_beampattdiffGam}
\end{figure*}
\textbf{Impact of Communication Requirement:} Fig. \ref{fig_beampattdiffGam} shows the beam pattern with different $\Gamma$s. The directions of the ST and UEs are set as $45^\circ$ and $(48^\circ,54^\circ,60^\circ)$, respectively. The transmit power to the ST by B-syn is larger than that of ZF owing to the power improvement in (\ref{ineq}).
When $\Gamma$ is reasonably large, the gap becomes larger. This is because, with a large $\Gamma$, the power improvement will be more significant as more energy has been used for communication.
\begin{figure*}[h]
\centering
\subfloat[]{\includegraphics[width=3.2in]{BP_receiver_test8_1.pdf}}\
\subfloat[]{\includegraphics[width=3.2in]{BP_receiver_test8_2.pdf}}\\
\caption{Received beam pattern under different $N_r$. (a) $N_r=128$; (b) $N_r=16$;.
}
\label{fig_beampattreceive}
\end{figure*}
\textbf{Receive Beam Pattern:} Next, we show the beamforming performance of the TMT, i.e., $P(\phi)=||\mathbf{w}^\HH\mathbf{W}_{RF}^\HH\mathbf{a}_R(\phi)||^2$. For ease of illustration, we fix the direction of the ST and the clutter patches at $54^\circ$ and $(30^\circ,35^\circ,40^\circ)$, respectively. Fig. \ref{fig_beampattreceive} shows the received beam pattern with different number of the receive antennas $N_r$. Overall, the mainlobe of all scenarios can focus on the ST while the responses on the clutter direction are all less than $-20$dB. Comparing `B-syn $+$ MVDR' and AO, we can observe that the MVDR receiver suppresses the energy from the direction of clutter patches while AO does not need to. This is because AO can suppress the transmit power towards the clutter patches, which leaves more freedom for the receiver.
\section{Conclusion}
In this paper, we proposed a novel perceptive mobile network structure with distributed target monitoring terminals, which saves the full-duplex operation required by conventional ISAC systems. We investigate the interference management between sensing and communication by jointly design the transmit and receive beamformers to maximize the weighted average between sensing and communication performance. The problem was first solved by an AO method and linear transceiver structures were also derived to reduce the computation complexity and reveal interesting physical insights. It was shown that leaking communication energy towards to the sensing target is more efficient than forming a dedicated sensing signal. Furthermore, the amount of energy leakage depends on the channel correlation between the communication user and sensing target, which is determined by their locations. Simulation results validated the effectiveness of the proposed methods and illustrated the physical insights regarding interference management and resource allocation between sensing and communication.
%
%
%
%
%
%
\appendices
\section{Proof of Proposition \ref{PROconverge}}
\label{IterConv}
To simply the notation, we first denote
\begin{equation}
\begin{split}\label{aurbur}
\mathbf{a}_{\mathbf{u}_r}^{(t+1)}=\mathbf{F}^{(t+1),\HH}\mathbf{H}^{(t+1),\HH}\mathbf{W}_{RF}^{(t+1)} \mathbf{w}^{(t+1)} ,\quad
B_{\mathbf{u}_r}^{(t+1)}=\mathcal{P}_{Q}\left(\mathbf{w}^{(t+1)},\mathbf{W}_{RF}^{(t+1)},\mathbf{F}^{(t+1)} \right).
\end{split}
\end{equation}
Hence, (\ref{urt1}) can be rewritten as $\mathbf{u}_r^{(t+1)}=\frac{\mathbf{a}_{\mathbf{u}_r}^{(t+1)}}{B_{\mathbf{u}_r}^{(t+1)}}$.
By substituting (\ref{aurbur}) into (\ref{lossfunc}), we have
\begin{equation}
\begin{split} \nonumber
&\mathcal{F}_R\left(\mathbf{u}_r^{(t)}|\mathbf{w}^{(t+1)},\mathbf{W}_{RF}^{(t+1)},\mathbf{F}^{(t+1)} \right)=2\kappa_r\Re(\mathbf{a}_{\mathbf{u}_r}^{(t+1),\HH} \mathbf{u}_r^{(t)})-\kappa_r \Vert \mathbf{u}_r \Vert^2 B_{\mathbf{u}_r}^{(t+1)}.\\
\end{split}
\end{equation}
Thus, we can obtain
\begin{equation}
\begin{split}\nonumber
&\mathcal{F}_R\left(\mathbf{u}_r^{(t+1)}|\mathbf{w}^{(t+1)},\mathbf{W}_{RF}^{(t+1)},\mathbf{F}^{(t+1)} \right)-\mathcal{F}_R\left(\mathbf{u}_r^{(t)}|\mathbf{w}^{(t+1)},\mathbf{W}_{RF}^{(t+1)},\mathbf{F}^{(t+1)} \right)\\
&=\frac{\kappa_r}{B_{\mathbf{u}_r}^{(t+1)}}\left\Vert\mathbf{a}_{\mathbf{u}_r}^{(t+1)}-B_{\mathbf{u}_r}^{(t+1)} \mathbf{u}_r^{(t)} \right\Vert^2 \geq 0.
\end{split}
\end{equation}
It indicates that the objective function $\mathcal{F}_R$ increases after the update of $\mathbf{u}_r$.
Then we have
\begin{equation}
\begin{split}
\label{SCNRinc}
&\text{SCNR}^{(t+1)}=\text{SCNR}\left(\mathbf{w}^{(t+1)},\mathbf{W}_{RF}^{(t+1)},\mathbf{F}^{(t+1)} \right)=\frac{\mathcal{F}_R\left(\mathbf{w}^{(t+1)},\mathbf{W}_{RF}^{(t+1)},\mathbf{F}^{(t+1)},\mathbf{u}_r^{(t+1)} \right)}{\kappa_r}\\
&\geq \frac{\mathcal{F}_R\left(\mathbf{w}^{(t+1)},\mathbf{W}_{RF}^{(t+1)},\mathbf{F}^{(t+1)},\mathbf{u}_r^{(t)} \right)}{\kappa_r}\geq \cdots \geq \frac{\mathcal{F}_R\left(\mathbf{w}^{(t)},\mathbf{W}_{RF}^{(t)},\mathbf{F}^{(t)},\mathbf{u}_r^{(t)} \right)}{\kappa_r}= \text{SCNR}^{(t)}.\\
\end{split}
\end{equation}
Similarly, we have
\begin{equation}
\begin{split}\nonumber
&\mathcal{F}_k (u_k^{(t+1)}|\mathbf{F}^{(t+1)})- \mathcal{F}_k (u_k^{(t)}|\mathbf{F}^{(t+1)})= \frac{\kappa_c}{B_{u_k}^{(t+1)}}\left\Vert a_{u_{k}}^{(t+1)}-B_{u_{k}}^{(t+1)} u_k^{(t)} \right\Vert^2 \geq 0.
\end{split}
\end{equation}
where $a_{u_{k}}^{(t+1)}=\mathbf{f}_c^{(t+1),\HH}\mathbf{h}_{c,k}^{(t+1)}$, $ B_{u_{k}}^{(t+1)}= \sum_{i\neq k}\left|\mathbf{h}_{c,k}^\HH\mathbf{f}_{c,i} \right|^2
+ \left\Vert\mathbf{h}_{c,k}^\HH\mathbf{F}_R \right\Vert^2
+\sigma_c^2$.
Denote $k^\dagger=\arg\min_{k \in [1,K]} \gamma_k (\mathbf{F}^{(t+1)})$. We have
\begin{equation}
\begin{split}
\label{gammakinc}
\min_{k}\gamma_k (\mathbf{F}^{(t+1)})
=\frac{\mathcal{F}_{k^\dagger} (u_{k^\dagger}^{(t+1)}|\mathbf{F}^{(t+1)})}{\kappa_c}
\geq \frac{\mathcal{F}_{k^\dagger} (u_{k^\dagger}^{(t)}|\mathbf{F}^{(t+1)})}{\kappa_c} \overset{(a)}{\geq}
\frac{\zeta^{(t)}}{\kappa_c}=\min_{k }\gamma_k (\mathbf{F}^{(t)}),
\end{split}
\end{equation}
where (a) comes from the constraint in (\ref{probFt1}).
From (\ref{SCNRinc}) and (\ref{gammakinc}), the sequence $\mathcal{L}^{(t)}=\kappa_R\text{SCNR}^{(t)}+\kappa_c \min_{k \in [1,K]}\gamma_k(\mathbf{F}^{(t)})$ is monotonically increasing with more iterations.
According to the monotone convergence theorem \cite{bibby_1974}, the increasing sequence $\mathcal{L}^{(t)}$ will converge to a stationary point $\mathcal{L}^{\star}$ as $t$ increases. \hfill $\blacksquare$
\section{Proof of Lemma \ref{mualemma}}
\label{muaproof}
For ease of illustration, we denote $\mathbf{H}_e(\lambda_{a})$ as $\mathbf{H}_e$ hereafter in this proof.
Recalling (\ref{Heisac}) and applying the block matrix inversion lemma \cite{9052470}, we can show that
\begin{equation}
\begin{split}
(\mathbf{H}_e^\HH \mathbf{H}_e)^{-1}=\left[\begin{matrix}
\mathbf{H}_c^\HH \mathbf{H}_c & \lambda_{a} \mathbf{H}_c^\HH \mathbf{a}_T(\phi_t)\\
\lambda_{a} \mathbf{a}_T^\HH(\phi_t) \mathbf{H}_c & \lambda_{a}^2 \\
\end{matrix}\right]^{-1}=\left[\begin{matrix}
(\mathbf{H}_c^\HH \mathbf{H}_c)^{-1} & \mathbf{0}\\
\mathbf{0}^\HH & 0 \\
\end{matrix}\right]+\left[\begin{matrix}
\mathbf{A}_1 & \mathbf{A}_2\\
\mathbf{A}_2^\HH & A_3^\HH \\
\end{matrix}\right],
\end{split}
\end{equation}
where
\begin{equation}
\begin{split}
&\mathbf{A}_1=\frac{\lambda_{a}^2(\mathbf{H}_e^\HH \mathbf{H}_e)^{-1}\mathbf{H}_e^\HH\mathbf{a}_T(\phi_t)\mathbf{a}_T^\HH(\phi_t) \mathbf{H}_e(\mathbf{H}_e^\HH \mathbf{H}_e)^{-1}}{\lambda_{a}^2-\lambda_{a}^2\mathbf{a}_T^\HH(\phi_t) \mathbf{H}_e(\mathbf{H}_e^\HH \mathbf{H}_e)^{-1}\mathbf{H}_e^\HH\mathbf{a}_T(\phi_t)},\\
&\mathbf{A}_2=\frac{\lambda_{a}(\mathbf{H}_e^\HH \mathbf{H}_e)^{-1}\mathbf{H}_e^\HH\mathbf{a}_T(\phi_t)}{\lambda_{a}^2-\lambda_{a}^2\mathbf{a}_T^\HH(\phi_t) \mathbf{H}_e(\mathbf{H}_e^\HH \mathbf{H}_e)^{-1}\mathbf{H}_e^\HH\mathbf{a}_T^(\phi_t)},\\
&A_3=\frac{1}{\lambda_{a}^2-\lambda_{a}^2\mathbf{a}_T^\HH(\phi_t) \mathbf{H}_e(\mathbf{H}_e^\HH \mathbf{H}_e)^{-1}\mathbf{H}_e^\HH\mathbf{a}_T(\phi_t)}.\\
\end{split}
\end{equation}
Thus, we have
\begin{equation}
\label{traceHehe}
\begin{split}
\mathrm{tr}(\mathbf{H}_e^\HH \mathbf{H}_e)^{-1}=\mathrm{tr}(\mathbf{H}_c^\HH \mathbf{H}_c)^{-1}+\mathrm{tr}(\mathbf{A}_1) + A_3.
\end{split}
\end{equation}
By substituting (\ref{traceHehe}) into (\ref{mudef}), we have (\ref{mualammadef}). \hfill $\blacksquare$
\section{Proof of Proposition \ref{Ptgt}}
\label{ptgtproof}
The transmit power to the ST is given by
\begin{equation}
\begin{split}\nonumber
&P_{\text{B-syn},tgt}\triangleq \mathbb{E}\left( ||\mathbf{a}_T^\HH(\phi_t) \mathbf{F}_{\text{B-syn}} \mathbf{s}||^2 \right)=\mathbb{E}\left(\left\Vert \sum_{i=1}^{K}\alpha_\star \mathbf{a}_T^\HH(\phi_t)\mathbf{f}_{\text{ZF},i}s_{c,i}+\sum_{i=1}^{K}\beta_{i} s_{c,i} +\sum_{j=1}^{N_s-K}\nu_{j} s_{R,j}\right\Vert^2 \right)\\
&= \sum_{i=1}^{K}\sum_{m=1}^{K}\alpha_\star^2 \mathbf{a}_T^\HH(\phi_t)\mathbf{f}_{\text{ZF},i} (\mathbf{a}_T^\HH(\phi_t)\mathbf{f}_{\text{ZF},m})^* \mathbb{E}\left(s_{c,i}s_{c,m}^*\right) + \sum_{i=1}^{K}\sum_{m=1}^{K}\beta_{i}\beta_{m}^* \mathbb{E}\left(s_{c,i}s_{c,m}^*\right)\\
& +\sum_{j=1}^{N_s-K}\sum_{n=1}^{N_s-K}\nu_{j}\nu_{n}^* \mathbb{E}\left(s_{R,j}s_{R,n}^*\right) +\sum_{i=1}^{K} \sum_{m=1}^{K} 2 \alpha_\star \Re\left( \beta_m^* \mathbf{a}_T^\HH(\phi_t)\mathbf{f}_{\text{ZF},i} \mathbb{E}\left(s_{c,i}s_{c,m}^*\right) \right) \\
&+\sum_{i=1}^{K} \sum_{j=1}^{N_s-K} 2 \alpha_\star \Re\left( \nu_j^* \mathbf{a}_T^\HH(\phi_t)\mathbf{f}_{\text{ZF},i} \mathbb{E}\left(s_{c,i}s_{R,j}^*\right)\right) + \sum_{i=1}^{K} \sum_{j=1}^{N_s-K} 2\Re\left(\beta_{i}\nu_j^* \mathbb{E}\left(s_{c,i}s_{R,j}^*\right) \right),\\
\end{split}
\end{equation}
where we utilized the property $\mathbf{a}_T^\HH \mathbf{f}_\perp=1$. Here, $s_{c,i}$ and $s_{R,j}$ denote the $i$th and $j$th entry of $\mathbf{s}_c$ and $\mathbf{s}_R$, respectively.
Recalling that $\mathbb{E}(\mathbf{s}\mathbf{s}^\HH)=\mathbf{I}$, we have
\begin{equation}
\label{ptgt}
\begin{split}
&P_{\text{B-syn},tgt}=\sum_{i=1}^{K} |\alpha_\star \mathbf{a}_T^\HH(\phi_t)\mathbf{f}_{\text{ZF},i} |^2+\sum_{i=1}^{K} 2\alpha_\star \Re( \beta_i^*\mathbf{a}_T^\HH(\phi_t)\mathbf{f}_{\text{ZF},i}) +\sum_{i=1}^{K} |\beta_i |^2+\sum_{j=1}^{N_s-K} |\nu_j|^2.\\
\end{split}
\end{equation}
Next, we further simplify (\ref{ptgt}). First, by the definition of $\mathbf{F}_{\text{ZF}}$ and $\alpha_\star$, we have
\begin{equation}
\begin{split}
\sum_{i=1}^{K} |\alpha_\star \mathbf{a}_T^\HH(\phi_t)\mathbf{f}_{\text{ZF},i} |^2
&=\alpha_\star^2\mathbf{a}_T^\HH(\phi_t) \mathbf{F}_{\text{ZF}}\mathbf{F}_{\text{ZF}}^\HH \mathbf{a}_T(\phi_t)=\Gamma \sigma_c^2 \mathbf{a}_T^\HH(\phi_t) \mathbf{H}_{c} \left(\mathbf{H}_{c}^\HH\mathbf{H}_{c}\right)^{-2}\mathbf{H}_{c}^\HH \mathbf{a}_T(\phi_t).
\end{split}
\label{aatfzf}
\end{equation}
Then, to meet the transmit power constraint, we have
\begin{equation}\nonumber
\begin{split}
P&=\sum_{i=1}^{K}||\mathbf{f}_{\text{B-syn},c,i}||^2 + \sum_{j=1}^{N_s-K}||\mathbf{f}_{\text{B-syn},R,j}||^2=\sum_{i=1}^{K} \left(\alpha_\star^2 ||\mathbf{f}_{\text{ZF},i}||^2+|\beta_i|^2||\mathbf{f}_\perp||^2 \right)+\sum_{j=1}^{N_s-K} |\nu_j|^2 ||\mathbf{f}_\perp||^2,
\end{split}
\end{equation}
which is equivalent to
\begin{equation}
\begin{split}
\sum_{i=1}^{K} |\beta_i|^2+\sum_{j=1}^{N_s-K} |\nu_j|^2&=\frac{P- \alpha_\star^2 ||\mathbf{F}_{\text{ZF}}||^2}{||\mathbf{f}_\perp||^2}=(P-\Gamma \sigma_c^2 \mathrm{tr}(\mathbf{H}_c^\HH \mathbf{H}_c)^{-1})C_b,
\end{split}
\label{PowerCons}
\end{equation}
where we used the property $||\mathbf{F}_{\text{ZF}}||^2=P$ and $||\mathbf{f}_\perp||^2=\frac{1}{C_b}$. It requires that $P-\Gamma \sigma_c^2 \mathrm{tr}(\mathbf{H}_c^\HH \mathbf{H}_c)^{-1}\geq 0$, i.e., $\Gamma \leq \frac{P}{\sigma_c^2 \mathrm{tr}(\mathbf{H}_c^\HH \mathbf{H}_c)^{-1}}.$
Substituting (\ref{PowerCons}) into (\ref{ptgt}) yields
\begin{equation}\label{ptgt0}
\begin{split}
P_{\text{B-syn},tgt}
&\triangleq \mathbb{E}\left(||a_T^\HH(\phi_t) \mathbf{F}_{\text{B-syn}}\mathbf{s}||^2 \right)
=2\alpha_\star\Re(\mathbf{a}_{tgt}^\HH \mathbf{q}) + C_{tgt},
\end{split}
\end{equation}
where
\begin{equation}
\begin{split}
\label{atgt}
\mathbf{a}_{tgt}&=\left[\mathbf{f}_{\text{ZF},1}^\HH\mathbf{a}_T(\phi_t),\cdots,\mathbf{f}_{\text{ZF},K}^\HH\mathbf{a}_T(\phi_t),\underbrace{0,\cdots,0}_{N_s-K}\right]^\mathrm{T},\\
\end{split}
\end{equation}
\begin{equation}\label{qdef}
\begin{split}
\mathbf{q}=[\beta_{1},\cdots,\beta_{K},\nu_1,\cdots,\nu_{N_s-K}]^\mathrm{T},
\end{split}
\end{equation}
Omitting $\alpha_\star$ and $C_{tgt}$ which are constant irrelevant to the allocation of $\{\beta_{i}\}$ and $\{\nu_j\}$, the resource allocation problem to maximize $P_{\text{B-syn},tgt}$ is formulated as
\begin{equation}
\begin{split}
\max_{ \mathbf{q}}\quad & \Re(\mathbf{a}_{tgt}^\HH \mathbf{q})\\
s.t. \quad & ||\mathbf{q}||^2=P_q,
\end{split}
\label{preal0}
\end{equation}
where $P_q=(P-\Gamma \sigma_c^2 \mathrm{tr}(\mathbf{H}_c^\HH \mathbf{H}_c)^{-1})C_b$.
The constraint is obtained from (\ref{PowerCons}) which indicates that the total power of $\mathbf{q}$, composed of $\{\beta_{i}\}_{i=1}^K$ and $\{\nu_j\}_j^{N_s-K}$, is fixed once $\Gamma$ is given. This problem is to find a vector $\mathbf{q}$ on a sphere which has the highest correlation with $\mathbf{a}_{tgt}$. The solution can be obtained by the Lagrange multiplier method as
\begin{equation}
\label{qsolu0}
\begin{split}
\mathbf{q}=\sqrt{P_q}\cdot\frac{\mathbf{a}_{tgt}}{||\mathbf{a}_{tgt}||}.
\end{split}
\end{equation}
It follows from (\ref{atgt}) and (\ref{qdef}) that $\nu_j=0$ for $j=1,\cdots,N_s-K$, which indicates that the optimal solution is to allocate all power to $\{\beta_i\}_{i=1}^{K}$. Substituting (\ref{qsolu0}) into (\ref{ptgt0}) yields (\ref{ptgt1}). \hfill $\blacksquare$
| {'timestamp': '2022-04-20T02:13:13', 'yymm': '2112', 'arxiv_id': '2112.14391', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14391'} | arxiv |
\section{Introduction}
Recently artificial intelligence (AI) systems become popular and are
playing an increasingly important and pervasive role in the life of
individuals and society. The fact that AI systems can significatively
affect human lives, and can play an active role in society, is fostering
discussions on how these new systems should behave in their relationship
with humans. Human Centered AI (HCAI) concerns the study of how present
and future AI systems will interact with human lives in a mixed society
composed of artificial and human agents, and how to keep the human into
the focus in this mixed society.
Due the interdisciplinarity of the topic, the discussion involves both
technical and non technical people which see AI agents from different
perspectives. It is often difficult to integrate these perspectives in
a coherent vision in which all points of view can contribute and
complement each other. Of particular interests are the recent attempts
to provide requirements and ethical guidelines that regulate HCAI
systems, like the ones published by the European Commission in
2019~\cite{eu-ethical-guidelines}. While such guidelines will certainly
have an important impact on the future of AI, they typically describe
HCAI systems at a very abstract, qualitative level. Understanding the
concrete impact of such abstract requirements on the technical
development of HCAI systems is neither trivial nor unique. A case in
point is the recent European legislative proposal for an ``AI
Act''~\cite{AIAct.ec2021}. The necessity to define a precise grounding
of high level qualitative statements into technical requirements for
HCAI systems was explicitly noted in the above EC guidelines:
\begin{quote}
Requirements for Trustworthy AI should be ''translated'' into
procedures and/or constraints on procedures, which should be anchored
in the AI system’s architecture. \cite[page 21]{eu-ethical-guidelines}.
\end{quote}
The main objective of this document is to provide a reference
description of an HCAI agent, together with its main components and
functions, that helps to bridge the gap between the abstract
specifications of HCAI systems provided by non-technical entities and
the real implementation of these systems. Such a description is
intended to contribute to the above grounding.
In other words, the main objective of this paper is an attempt to fill
the gap between ``non technical description of HCAI agent'' and more
``technical structure'' that is understandable without a deep knowledge
of the main technics of AI, such as Machine Learning, Automated
Reasoning, Reinforcement Learning, Probabilistic inference and
optimisation. Despite this, we will try to be precise enough to allow
the mapping of high level concepts that one can find for instance in the
EC ethical guidelines into a more technical and technically operative
description. Although the account of HCAI agents that we offer in this
paper is certainly preliminary, we believe that it constitutes an
important first step towards filling a crucial cultural gap.
The rest of this paper is organized as follows. In the next section, we
provide a definition of HCAI agents in terms of their neessary features.
In Section~\ref{schema.sec} we offer a schematic represesentation of a
HCAI agent, and in Section~\ref{keys.sec} we discuss the key components
of this representation. In Section~\ref{models.sec} we look in more
detail at one of these components, AI models.
Finally, we discuss related work in Section~\ref{related.sec}, and draw
some concluding remarks in Section~\ref{conclusions.sec}.
\section{Definition of HCAI agent}
\label{hcai.sec}
In the following, we provide a connotative definition of an HCAI agent by
listing a set of features that an AI agent should meet in order to be
considered Human Centered.
\paragraph{Agent-environment pair.}
\def\mathbf{Ag}{\mathbf{Ag}}
\defState(\agent){State(\mathbf{Ag})}
\def\mathbf{Env}{\mathbf{Env}}
\defState(\environment){State(\mathbf{Env})}
We consider a reference framework composed of an autonomus agent that
operates in an environment that includes the presence of humans. We
call this an \emph{agent-environment pair}. HCAI concentrates on
agent-environment pairs in which humans directly interact with the
artificial agent in a \emph{collaborative attitude}. We therefore
exclude from our analysis situations in which the agent competes with
humans, such as the ones recently studied in \cite{fraune2019human}. In
an agent-environment pair, there is a clear separation between what is
internal to the agent and what is external to the agent, i.e., the
environment. At every time point in time, both the agent and the
enviroment are in a state, that we refer as the state of the agent and
the state of the environment, respectively. We don't consider the level
of quantum physics here, so we assume that both agents and environments
are in one single state at every time. While the internal state of the
agent is directly accessible to the agent, the state of the environment,
including the humans that populate it, is not directly accessible by the
agent. The agent can only partially perceive the state of the
environment through observations.
The agent-environment pair can be represented as a pair
$(\mathbf{Ag},\mathbf{Env})$ with $\mathbf{Ag}=\{State(\agent)_t\}_{t\geq t_o}$ and
$\mathbf{Env} = \{State(\environment)_t\}_{t\geq t_0}$ where $t_0$ is some
starting time-point. $State(\agent)_t$ denotes the state of the agent at
time $t$, while $State(\environment)_t$ denotes the state of the
environment at time $t$. We emphasize once again that the environment
$\mathbf{Env}$ also includes the humans, and that these interact with
the agent.
\paragraph{Observations and actions.}
The agent observes the environment via sensors, and acts upon the
environment via effectors. Every interaction between the agent and the
environment happens through these means. Observations and actions are
considered here in a very broad sense. Sensors provide the agent with
observations or percepts that range from low level data to natural
language input, images, movies, and so on. Actions may range from
physical actions such as moving ahead or grasping an object, to
communicative actions (speech acts) such as displaying some data on the
screen, uttering a sentence, smiling, or playing a song or a movie. We
do not assume that there is a synchronisation between actions and
observations, and both actions and observations can happen independently
without following a precise protocol.
To be human-centered, an HCAI agent may have to comply to restrictions
and requirements on the data that can be observed by an agent, and on
the actions that can be executed. For instance, according to the EC
Ethics Guidelines,
observations in HCAI systems
\begin{quote}
[\ldots] must guarantee privacy and data protection throughout a system’s
entire lifecycle.~\cite[page 17]{eu-ethical-guidelines}
\end{quote}
and should be unbiased. Concerning actions, the same guidelines
postulate that they should be
\begin{quote}
[\ldots] consistent with the input, and that the decisions [to execute
an action] are made in a way allowing validation of the underlying
process.~\cite[page 22]{eu-ethical-guidelines}
\end{quote}
Furthermore, in the presence of an applicable legislation, an HCAI agent
should execute only legal actions, i.e., actions complying with all
applicable laws and regulations.
\paragraph{Goal directed agents.}
AI agents always have one or more goals to achieve.%
\footnote{So-called \emph{reflex} agents \cite{aima4},
that directly map observations to actions, do not maintain an explicit
internal representation of their goals. Most machine learning systems
belong to this category. Even in this case, the mapping
that implements the reflexes is programmed, or learned, with reference
to some implicit objective that these agents are meant to achieve.}
An agent's goals can be codified in many different ways, depending on
the architecture of the agent. For instance, the goal could be to
optimize a certain function, to find the best path to achieve a
position, to improve the agent's capability of recognising objects in a
scene, or to correctly answer users queries.
To be human-centered, the achievement of such a goal by an HCAI agent
should not harm the humans present in the environment. According to the
principles of prevention of harm and fairness mentioned in the EU Ethics
Guidelines:
\begin{quote}
AI systems should neither cause nor exacerbate harm or otherwise
adversely affect human beings, [\dots] ensuring that individuals and
groups are free from unfair bias, discrimination and
stigmatisation. If unfair biases can be avoided, AI systems could even
increase societal fairness.
\cite[page 12]{eu-ethical-guidelines}
\end{quote}
Making explicit the goals of an HCAI agent in a necessary condition to
support these principles.
Furthermore an HCAI agent should not have goals that contrasts the goal
of the human present in the environment.
\paragraph{No full autonomy.}
HCAI agent should not be completely autonomous, and their behaviour
should always be sensitive to the external environmental or human
context. Humans should always be allowed to intervene, e.g., to avoid
that the agent performs a harmful actions, or a specific set of them.
This is necessary to guarantee the \emph{principle of respect for human
autonomy} from the EU Ethics Guidelines~\cite[page
12]{eu-ethical-guidelines}, that allows a human to autonomously decide
to prevent the execution of one or more actions to the HCAI agent. From
an architectural poin of view, this means that among the set of
observations that an HCAI agent has to employ, there should be some that
detect the willingness of the humans to interrupt some planned or
executed actions.
\section{Schema for an HCAI agent}
\label{schema.sec}
Figure~\ref{fig:hcai-onion} shows a pictorial representation of our
vision of an HCAI agent. This picture interprets literally the
adjective ``human centered'' by drawing the human, and their
environment, at the center of the representation surrounded by the
agent. This is the opposite of the usual representation that shows an
AI agent in the center, connected to the environment and the humans
around it. A first observation concerns the fact that humans cannot be
separated from the environment where they operate. Indeed they are
\emph{part} of the environment, and \emph{embedded} in it. Humans and
environment are complementary, interconnected, and interdependent in the
natural world, and they interrelate to one another. Therefore HCAI
Agents should take into account both humans and the environment where
humans operate. In the picture this is represented by the blue and
green Yin-Yang symbol in the inner ring.
\begin{figure}[h]
\begin{center}
\input{onion}
\end{center}
\caption{A simple schematization of a Human-Centered Artificial
Intelligence Agent (external ring). The agent interacts with of the
humans (H) and environment (E) (inner ring) via the elements in the
middle ring, relying on one or several internal models.}
\label{fig:hcai-onion}
\end{figure}
The outer ring in Figure~\ref{fig:hcai-onion} represents the artificial
intelligent agent. For our discussion, the agent behaves as a unit. In
many cases, however, the HCAI agent may be internally comprise several
interrelated intelligent agents, which interact following, e.g., a
multi-agent paradigm. The whole HCAI agent, or any of its component
agents, accomplishes some task directly relevant for the humans it
interacts with using one or several specific approaches, or models. For
instance, an ``artificial reasoner'' could represent its knowledge in
some logical formalism and support query answering and inference through
automatic reasoning (e.g., SAT, ASP); an ``artificial classifier'' could
be implemented in a deep neural network that is capable to classify
images into different classes; and an ``artificial planner'' can produce
plans and take decision exploiting classical planning techniques or
reinforcement learning. To solve complex tasks, different systems and
methodologies typically need to be integrated. A black box integration
of each ``intelligent agent'' is not sufficient; it is necessary to
integrate and make all these different approaches to collaborate one
another in a glass-box method. We shall come back to this point when
discussing hybrid models in Section~\ref{models.classes.sec}.
The middle ring represents the interaction between the human-environment
system and the (integrated) artificial intelligent system. The type of
interactions that one can see between human-environment system and the
artificial agent happens across a set of artifacts that are ``shared''
by the human-environment and the artificial systems. We briefly
introduce them here, and we shall describe them more extensively in the
rest of this document. \emph{Dependability Requirements} are artifacts,
produced by humans, that specify the expected behaviour or other
non-functional properties of the artificial intelligent system.
\emph{Actions} are considered in a broad sense. They represent the
actions that the artificial agent can perform on the human-environment
system, as well as the action that the human can perform on the
artificial agent. These can be physical actions, that affect the state
of the environment, or informative actions, that affect the knowledge of
the human or of the artificial agent. \emph{Observations} are all the
data that the artificial intelligent system can collect through its
sensors. Finally, \emph{Explanations} are artifacts produced by an
artificial agent that ``explain'' to the human the reasons of its
behaviour, e.g., the reason why it took a decision or executed an
action. Explanations should be human understandable and acceptable in a
rational system shared by the machine and the human.
\section{Key components of an HCAI agent}
\label{keys.sec}
Figure~\ref{fig:hcai-onion} identifies five key components that
constitute a Human Centered AI agent: four types of artifacts that are
shared by the human-environment system and the agent and that mediate
the interactions between them; and a set of internal models. We now
discuss these components in greater detail.
\subsection{Observations}
An agent can observe the humans and the environment through its sensors.
Here we use sensor in a broad sense, i.e., everything that can be used
by the agent to autonomously acquire data about the environment
(including humans) and everything the humans and the environment can use
to syncronously or asyncronouysy input data to the artificial agent.
Among the observations we also include the ``commands/requests'' that
humans pose to the artificial agent.
There is a great variety of types of sensors, and they all serve their
purpose depending on the information which they are meant to collect,
and on the application domain.
For example, sensors in Internet of Things applications may include
cameras, ultrasonic, infrared, acoustic, mechanical, and so on. In
Robotics applications, sensors may include potentiometers,
accelerometers, Gimbles, lidar, an so on. In Media applications,
sensors may include digital cameras, audio recording, textual documents,
and so on. Essentially, sensor systems inject input data. These can
come in streams, mostly for online systems, or in batch, mostly for
offline systems. The way input data is represented varies widely, from
continuous to discrete, structured, lists, trees, and so on. Input data
are typically coupled with some meta information that describes their
representation and structure.
In general, every item of data is associated with one or several time
stamps, that can be relative or absolute.
\def\mathbf{Obs}{\mathbf{Obs}}
\defObs{Obs}
\begin{definition}
The \emph{observations} of an HCAI agent are all the data that an
agent can aquire through its sensors. We denote by
$\mathbf{Obs}_{\leq t}=\{Obs_{t'}\}_{t_0\leq t'\leq t}$ the
observations about the human-environment system that are available to
the agent at a given time $t$. $Obs_t$ may or may not be a
function of the state of the environment and the agent at time $t$.
In general, we state that
%
\[Obs_t\sim Pr(\cdot\midState(\environment)_t,State(\agent)_t),
\]
%
i.e., observations at time $t$ follow some (possibly unknown)
probability distribution conditioned by the state of the environment
and of the agent at time $t$.
\end{definition}
\subsection{Actions}
\def\mathcal{A}{\mathcal{A}}
The set of actions of an agent are all the possible ways that the agent
has to affect the state of the environemnt and of the humans which it
iteracts with. Actions can be \emph{physical actions}, e.g., robot
moves forward 10\,cm, an autonomous car brakes, an autonomous personal
assistant books a room in hotel Bellavista or buys 100 stocks of the
company SuperGulp. Another type of action are \emph{informative
actions} that provide information to the human as a conseguence of a
decision that the agent has reached. Examples of informative actions
are the communication of the result of a classifications of an iten
provided in input, or the communication that the price of SuperGulp
stocks is falling.
Actions should produce a tangible effect on the environment and/or the
humans in it. This means that if execution does not fail, the state of
the humans or environment once an action is terminated should be
different from their state before the execution of that action. Note
that an internal agent activity, like an agent taking a decision about
doing something, should not be considered as an action, because it
changes only the internal state of the agent but it does not affect the
environment. The real action consists on the effective execution of the
decision. Also note that in general the outcome of an action is not
deterministic.
Concrete examples of actions include the following. If an agent's task
is to classify documents in $n$ classes, its actions are those that
\emph{communicate} the result of the classification of an item into one
or more class. Such action will change the knowledge state of the human
that has requested the classification. Classification without
communication should not be considered as action. Clearly all the
actions of a robot involving physical movement are conisdered as actions
since they change the position of the robot in the environment. The set
of actions associated to an artificial agent can be discrete or
continuous. Notice that the set of agent's actions does not include the
actions that are executed by the humans, or other events that can
happen asynchronously in the environment.
\def\mathbf{Eff}{\mathbf{Eff}}
\begin{definition}
The \emph{actions} of an HCAI agent is a set $\mathcal{A}$ such that any
$a\in\mathcal{A}$ is associated to a set of effects $\mathbf{Eff}(a)$ which
describes a transformation of the state of the environment that is
directly relevant for the humans in the environment. The mapping
$\mathbf{Eff}(a)$ can be deterministic, non deterministic or
probabilistic.
\end{definition}
An important aspect of the above defition is that actions in an HCAI
should be \emph{directly relevant} for the humans that populates the
environment. This aspect relies on the pre-theoretical notion of
relevance that cannot be easily captured in a formal definition, since
relevance may emerge through complex causal chains. In some cases,
relevance is clear: the decision of an agent to grant a mortgage to a
human is definitively relevant for the human; while the decision taken
by a system that controls the trajectory of a satellite cannot be
considered human centered, although it might have an impact on TV
viewers.
Most cases, however, are not so clear cut. For instance, a domestic
robot's plugging to the charging station may not directly affect the
state of a human; but if this action consumes the solar-powered battery
cells of the home, this may affect the ability of the human inhabitant
to cook dinner later on.
\subsection{Explanations}
An explanation is an explanation of some decision. In HCAI, explanations
are meant to explain to a human, or a set of humans, the decision of
executing an action $a$ made by an agent at time $t$ when it was in the
state $State(\agent)_t$. As argued in~\cite{miller2019explanation}, the
definition of explanations for a decision taken by an HCAI agent cannot
be provided without making explicit reference to the human to whom the
explanation is addressed, i.e, the \emph{explanee}. In general, an
explanation of a decision taken by the agent can be independent from how
the agent reaches such a decision. This is especially true when the
decision is taken by a black-box method such as a neural network.
\begin{definition}[Explanation]
An \emph{explanation} of an HCAI is a representation of the reason why
the agent took a decision to execute a given action $a$ in state
$State(\agent)_t$. Such an explanation should be intelligible,
understandable and acceptable by the explanee.
\end{definition}
This definition sees explanation as an artifact. Another notion of
explanation is to see it as the process of building or communicating an
explanation. There is a rich literature in which explanation refers to
a dialogue, and therefore a collaborative process, between the human and
the agent, where the human collaborates with the agent in the creation
of a explanation of the agent's decision that is satisfactory for the
human.
The result of this process is an explanation artifact that can be stored
and reused.
\subsection{Requirements}
A requirement, including the concept of dependability requirement, is
the formulation of a functional need that an AI system must satisfy.
This is central to the problem of verifiable AI, which has the objective
of checking that a system meets its requirements, including functional
specifications and dependability attributes. Dependability requirements
should be expressed in a human understandable way: in fact, they are
usually formulated by humans. The problem of verifiable AI is how to
translate these requirements in algorithms that check that the system is
compliant with them. Being a human produced artifact, providing a sharp
definition of a requirement is rather complex if not impossible.
Some requirements may be specified in a formal language, that has an
intuitive semantics for the human, so that it is possible to verify
automatically that the artificial intelligent system behaves according
to the requirement, at least to some measurable degree of certainty.
Some requirements may not be expressed in a formal language, as
representing them in a mathematical structure is still an open issue.
Below, we concentrate on formal requirements.
\begin{definition}
A formal \emph{requirement} is an expression in a formal language
(e.g., in mathematics or logics) that unambiguously describes a
criterion to determine if an agent-environment pair fulfils it.
\end{definition}
There are aspects of the verification of requirements for HCAI agents
that go beyond standard requirement engineering, and that stem from
these being AI agents as opposed to more traditional software systems.
In particular, AI agents have the ability to \emph{learn new knowledge}
by generalising observations done on a set of data, and to \emph{make
inferences from the learned knowledge} in order to take decision in
previously unseen or unmodeled situations.
In addition, in Human-Centered AI agents one may need to impose
requirements on \emph{how} the agent reaches the decision that leads to
a certain behaviour. For instance, in the case of an agent that
contains machine learning models trained on data, typical requirements
concerns the fact that these data are not biased, or that they respect
the GDPR. This type of requirements goes beyond the above definition,
that focuses on the behaviour of the agent relative to the environment
in which it operates.
\subsection{Models}
An HCAI agent takes decisions on how to act in the environment, or how
to react to some input coming from the humans and/or the environment, on
the basis of one or more \emph{models} of the human-environment system
which it is interacting with. Models are abstract (computational)
structures that allow to answer queries about what holds in the current
or past situations, and to predict what will be true in the future.
Models can also be used to simulate possible alternative evolutions of
the human-environment system in order to take the ``right'' decision
now.
HCAI agents are equipped with a set of models that represent the
knowledge of the agent about the human-environment system. This
knowledge is used to support the agent in making decisions about which
actions to perform. In general, we cannot assume that such models are
\emph{correct}, i.e., that their reflect the true state
human-environment system and that their predictions are effectively
true. For this reason it is more appropriate to speak about
\emph{belief} instead of knowledge. Neither we can assume that models
are \emph{complete}, i.e., that they describe the environment in all its
details. Indeed they are \emph{simplified, abstract} representations of
some aspect of the environment obtained by abstracting away irrelevant
(or believed to be irrelevant) details. Even at the given level of
abstraction, models may still miss information if this is not known or
observed.
\section{Models for an HCAI agent}
\label{models.sec}
The core knowledge of an HCAI agent is encapsulated in the set of models
that it adopts in order to interpret the input data, take decisions, and
provide explanations for the decisions taken. If we ignore the physical
aspects of an agent, it is acceptable to say that the behaviour of an
HCAI agent is fully determined by its models. Most of the requirements
and guidelines provided for HCAI agents thus concern how models are
built, how they evolve, and how they are used to take decisions.
Given this central role of models, it is useful to discuss in more
detail what are the different classes of models that we can use in an
HCAI agent, and how these models are built and how they evolve --- in
other words, the life-cycle of models. The rest of this section is
devoted to these topics.
\subsection{Classes of AI Models}
\label{models.classes.sec}
Providing a complete and coherent classification, or even an ontology,
of AI models is beyond the scope of this paper. For our purposes, it is
enough to list the most important, general classes of AI models. In our
classification we take a ``technological'' perspective, i.e., we define
classes on the basis of the set of methodologies which are used to
specify the model, to represent information, and to perform decisions.
We identify four main classes plus their combination.
\paragraph{Logical Models.} The key aspects of the environment and
the human are represented with a logical theory (set of formulas of a
logical/formal language) and decision on the basis of this model are
taken via logical reasoning. Examples of this type of model are
Logical Knowledge Bases and Ontologies, Logic programs, and planning
domains specified via PDDL or other action languages. Logical models
are specified declaratively using a set of terms and formulas from a
logic based language. A good summary of many different logical models
is provided in the Handbook of Knowledge
Representation~\cite{lifschitz2008handbook}. Logical models provide
information of what is true, what is false and what logically follows
from some premises. Minker~\cite{minker2012logic} offers an overview
of how logical models can be built and how they can be used for
inference, decision making and planning.
\paragraph{Probabilistic Models.} The key aspects of the environment
and the human are represented by some probabilistic distribution.
Decision are taken on the basis of probabilistic inference. In an AI
model, probability distributions are not simply defined over a set of
hypotheses but rather over some more complex structure suitable to
represent knowledge, as noted by Chater \textit{et
al}~\cite{chater2006probabilistic}:
%
\begin{quote}
\it The knowledge and beliefs of cognitive agents are modeled using
probability distributions defined over structured systems of
representation, such as graphs, generative grammars, or predicate
logic. This development is crucial for making probabilistic models
relevant to cognitive science, where structured representations are
frequently viewed as theoretically central.
\end{quote}
%
Examples of this type of models are statistical graphical models, like
Bayesian Networks and Hidden Markov Models.
Usually probabilistic models distinguish between observable variables,
which correspond to the evidence that an agent is able to observe
directly, and hidden variables, whose distribution should be
discovered from the data.
The key concept in this type of model is the \emph{variable
assignment}, i.e., an assignment to all the random variables, on which
it is possible to apply the model in order to predict the likelihood
of such an assignment.
Beside probability, other mathematical theories have been used to
build models for uncertain knowledge and plausible reasoning,
including possibility theory~\cite{DuboisPrade.hbook2015} and belief
function~\cite{YagerLiu.book2008}. We extend the term ``probabilistic
models'' to cover models based on those theories as well.
\paragraph{Real-Valued Functional Models.} The key aspects of the worlds and
the user are represented through (a set of) real-valued functions.
These models can be used take in input observable quantities and
produce an estimation of some non-observable quantity, or predictions
of future values. Examples of this type of models are linear models,
support vector machines, decision trees, random forest and (deep)
neural networks.
A large class of real-valued functional models is constituted by
neural network models. A neural model is a directed graph of nodes.
Each node is associated with a non linear activation function, the
input of a node $n$ is a linear combination of the outputs of the
functions associated to nodes that precede $n$ in the graph. Both the
linear combination and the activation function are associated with a
set of parameters, that need to be instantiated in order to fully
define the function. A neural network model is also associated to a
Loss (or Cost) function, that determines the approximation error
(i.e., difference between known and predicted outputs) to be
minimized.
For every instantiation of its parameters, a neural network computes a
function $f:R^k\rightarrow R^h$ where $k$ is the number of input nodes
(i.e., nodes that don't have any predecessor) and $h$ is the number of
output nodes (i.e., nodes which are not predecessor of any other
node). Like in all machine learning models, the main objective in a
neural network is to find an instantiation of the parameters that
minimizes the Loss/Cost function.
\paragraph{Dynamic Decision Models} The main purpose of these models
is to represent the dynamics of the environment in terms of states and
relations (transitions) between states, as well as the payoff obtained
by the agent's being at a state. A state represents what holds at a
given time point in the environment; two states are connected by a
transition if the agent can pass from one state to the other by
executing an action. Furthermore every state is associated with some
``evaluation'' function that expresses how much that state satisfies
the objectives of the agent. These models are used by the agent to
decide which actions to take at every future state in order to
maximize the likelihood of its payoff. These models are associated
with a set of algorithms that allow the agent to produce a ``policy''
or a ``plan'', i.e., a sequence of actions, or some more complex
control structure, that will reach a state with optimal (or
sub-optimal) payoff. This class includes a vast variety of models,
such as (Partially Observable) Markov Decision Models, Planning
Models, and Finite Automata.
\paragraph{Hybrid models.} In many cases a model presents
characteristics that are common to more than one of the classes
described above. We call them \emph{hybrid models}. Hybrid models are
models that integrate some of the previous types of models. Examples
of such models are approaches that integrates logical and numerical
models (e.g., Logic Tensor Networks, Lyrics) approaches that integrate
logical and statistical models (e.g., Markov Logic Networks,
Probabilistic Logic Programming), and approaches that integrate
numeric, statistical and logical models (e.g., DeepProbLog, deep
probabilistic logic programming, and Probabilistic Soft Logic).
\subsection{The lifecycle of HCAI models}
We represent the lifecycle of each model in an HCAI agent as illustrated
in Figure~\ref{fig:peterlifecycle}. Below, we describe each main step
in this cycle.
\begin{figure}
\centering
\input{lifecycle}
\caption{AI model lifecycle}
\label{fig:peterlifecycle}
\end{figure}
\subsubsection{Model schema specification}
A model schema describes a class of models that share the same
structure. The models within the same class can be obtained by
instantiating a (possibly infinite) set of parameters of the model
schema. Notice that here we use the term parameter in a broad sense,
referring both to the parameters of a probabilistic model, or a neural
network, but also to the signature of a logical language. The model
schema specification is usually done manually, but there is a growing
interest in the community in developing methods that
(semi-)automatically learn the model structure from data: examples
include structural machine learning, programm sinthesis, non-parametric
statistical models, auto-generated neural networks, predicate invention,
and learning planning domains.
Associated to a model schema there is also an ``intuitive explanation''
of parts of the model. For instance, in choosing a logical language to
specify the knowledge of an agent one has to say for some of the
predicates what is the intuitive meaning (with respect to states of the
environment, i.e., the proposition) that those predicates. Similarly,
in a neural network for classifying images in N classes C1, \ldots, CN,
one has to say which of the output neuron corresponds to each class Ci.
\subsubsection{Model instance specification/learning/update}
The instantiation of a model schema amounts in setting the parameters of
the model. This amounts in encoding a certain amount of knowledge about
the environment utilizing the ``tool-set'' provided by the model schema.
The encoding can be done manually, as it often happens in logical rule
based models via some knowledge engineering activity, or via supervised
learning from data manually labelled by humans, or in a fully
unsupervised and automatic manner (e.g., clustering). Statistical
models can be obtained by Bayesian inference from a set of observations
or by Maximum likelihood, or maximum a posteriori inference. Other
methods to model specifications can also be obtained by model adaptation
or transfer learning. Similarly, updating the model can be performed
automatically via retraining, or manually by modifying the parameters.
Automatic learning of facts and rules from natural language is also
possible. Methods for automatic learning of constraints from data are
also available.
\subsubsection{Inference with the model}
The second important aspect is how the model is used to infer a
decision, i.e., an action that the artificial agent decides to
undertake. Given a set of observations $O$ as input, the model provides
as output a set of actions or a policy for actions. This is obtained by
applying an \emph{inference engine} which is defined on the model.
In this phase the model instance is queried about what holds in the
environment. Inference can be very simple, like in neural network
(simple forward propagation) or rather complex, like in constraint
satisfaction where it may be necessary to apply search or optimization
algorithms. In logical models inference is done via some form of
logical reasoning (e.g., satisfiability) or model checking, while in
statistical models inference can be a generative process (generate a
data that has certain properties) or to compute some marginal
distribution of a certain (set of) stochastic variables. What all the
above inference activities have in common is that they don't change the
model, but only query it.
\subsubsection{Quality Control and Maintenance}
Once an AI artifact is ready to be used in practice, additional tasks
that are often not part of research activities become important to reach
higher Technology Readiness Levels.
For certification purposes and for the permission to use the artifact in
practice on/with non-expert users, \emph{testing and verification} procedures
for safety/security-related properties of the behavior of the model can
be necessary.
For products that are already in usage and needs to be updated,
\emph{maintenance and updating} methods need to exist so that problems
that are identified after shipping the model can be counteracted.
For supporting users and for legal reasons, it can be necessary to have
powerful methods for \emph{debugging} model properties and (re-)actions,
and for \emph{explaining} why certain outputs were (or were not)
generated. Moreover, in connection with updates of the model, these
methods can be useful to prove to authorities that certain behavior is
excluded in the future.
This part of the AI artifact lifecycle is very relevant to human-centric
artificial intelligence, because it is the longest-lasting process in
the existence of the model where the model has contact with a large
number of untrained human individuals and unseen input data.
\section{Related work}
\label{related.sec}
With the increasing prominence of AI, there is an increasing reflection
on what it means for AI to be ``human-centered'' and several papers have
been published on this topic, some of which are discussed below. To the
best of our knowledge, however, the work reported here is the first one
that tries to take a foundational approach to the problem of
human-centered AI, framing the discussion in technical terms by defining
the notion of a human-centered AI agent.
Wei Xu~\cite{wei2019toward} emphasizes that human centered AI systems
should exhibit behaviour which is intuitive for humans, and that this
can be achieved by adopting human centered design. The paper proposes
an architecture that supports the collaboration between humans and
machines by considering three main factors: \emph{ethically aligned
design}, necessary to create AI agents that behave fairly, and
collaborate with humans rather than competing with them;
\emph{resemblance of human intelligence}, necessary to develop AI agents
with human-like intelligent behaviours; and \emph{comprehensibility,
usefulness and usability}, necessary to develop AI agents that are
capable of helping humans.
Ben Shneiderman~\cite{human-centered-ardito-2021} suggests that making
human-centered AI system requires the combination of AI-based
intelligent algorithms with human-centered design. The author
highlights that, in developing HCAI, one should not limit the evaluation
to performance to the technological parts, but higher attention to human
users and other stakeholders. This requires an increased the prominence
of user experience design and of human performance measures. The
perspective taken in the paper is to support the 17 United Nations
Sustainable Development Goals.%
\footnote{\url{https://sdgs.un.org/goals}}
This work resonates with the AI model lifecycle proposed here (see
Section~\ref{models.sec}), especially in the parts of providing input
for requirement specification and of collecting the agent feedback.
In another work~\cite{shneiderman2021human}, Shneiderman stresses that
HCAI systems should give humans a greater control on the ever-increasing
automation, instead of replacing them in the decision processes.
According to the author,%
\begin{quote}
[\ldots] humans must have \emph{meaningful control of technology} and
are responsible for the outcomes of their actions. When humans depend
on automation to get their work done, they must be able to anticipate
what happens, because they, not the machines, are responsible.
\end{quote}
Shneiderman's stance is important, as it poses a limit on the decision
power of the machines and it relieves them from any responsibility.
Such a vision clashes with an opposite request of AI systems to be
increasingly autonomous.
The tension between machine autonomy and human control gave rise
recently to a field called \emph{Human Centered Machine Learning}, which
focuses on the development of HCAI systesm that adopt models that can be
trained via machine learning techniques. See Kaluarachchi \textit{et
al}~\cite{kaluarachchi2021review} for a review of the recent
literature. The main objective here is to develop AI models that take
into account the input provided by humans when they get to a decision.
An example is provided by Abir De\textit{et
al}~\cite{de2020classification}, who propose a model that classifies
images while allowing user input during inference. An empirical
evaluation shows that this model can surpass the performance of models
trained for full automation, as well as the one of humans operating
alone.
\citeauthor{Dignum2020HowTC}~\cite{Dignum2020HowTC} argue that
human-centered AI involves a shift from an AI which is able to solve
human tasks that require some form of intelligence, to an AI which is
aware on the social environment in which it is embedded, and operates
taking into account all the limitations, the opportunities, and the
needs of the social environment. This positions suggests that an AI
system should be considered as part of a broader \emph{socio-technical}
system. As they put it:
\begin{quote}
AI systems are fundamentally socio-technical, including the social
context where it is developed, used, and acted upon, with its variety
of stakeholders, institutions, cultures, norms and spaces.
\end{quote}
This perspective is in accordance with the schema of a human centered AI
agent proposed here (see Figure~\ref{fig:hcai-onion}), where the AI
agent is built \emph{around} the environment, and, in some sense, also
includes the social context in which it operates.
\section{Conclusions}
\label{conclusions.sec}
Human-centered AI agents are considered as part of a larger system
that also includes the humans, their society and the environment at
large. Consequently, the developments of HCAI agents is not only a
matter of developing efficient and effective altorithms to solve
complex probleems that require some form of intelligence. HCAI looks
at the developments of AI focussing also on human values such ethical
principles, fareness, transparency of decision and objectives, \dots.
As such, human-centered AI is an intrinsically
multi-disciplinary effort that requires the establishment of a common
ground between technical and non-technical disciplines such as,
sociology, low, ethics, and philosophy.
This paper is an attempt to offers a first step in fulfilling this requirement, by
introducing the general concept of a Human-Centered AI agent, together
with its main components and functions, as a way to bridge technical and
non-technical discussions on human-centered AI.
\section*{Acknowledgements}
This paper has been influenced by the many discussions on the
foundations of human-centered AI held in the framework of AI4EU, the EU
landmark project to develop the European AI platform and ecosystem. We
are indebted to the partners of work-package WP7 in AI4EU, who all
contributed to these discussions. This work has been supported by the
European Union's Horizon 2020 research and innovation programme under
grant agreement No. 825619 (AI4EU).
\subsubsection{#1}}
\def\mathcal{R}{\mathcal{R}}
\def\mathcal{A}{\mathcal{A}}
\def\mathcal{O}{\mathcal{O}}
\def\Observations2\mathcal{L}{\Observations2\mathcal{L}}
\def\mathbb{R}{\mathbb{R}}
\def\mathcal{L}{\mathcal{L}}
\def\mathcal{T}{\mathcal{T}}
\def\mathcal{I}{\mathcal{I}}
\def\textsc{AI4EU-Ontology}{\textsc{AI4EU-Ontology}}
\def\rb#1{{\color{blue} RAUL: #1}}
\def\cn#1{{\color{red} CHRISTIAN: #1}}
\def\lo#1{{\color{magenta} LUCA: #1}}
\def\jr#1{{\color{purple} JACQUES: #1}}
\def\as#1{{\color{teal} ALESSANDRO: #1}}
\def\jv#1{{\color{violet} JAVIER: #1}}
\def\ps#1{{\color{olive} PETER: #1}}
\def\ls#1{{\color{brown} LUCIANO: #1}}
\def\new#1{{\color{green!70!black} CHANGED #1}}
\title{On some foundational aspects of\\ human centered Artificial Intelligence}
\author{Luciano Serafini\inst{1} \and
Raul Barbosa \inst{2} \and
Jasmin Grosinger\inst{3} \and
Luca Iocchi \inst{4} \and
Christian Napoli\inst{4} \and
Salvatore Rinzivillo\inst{5} \and
Jacques Robin\inst{6} \and
Alessandro Saffiotti\inst{3} \and
Teresa Scantamburlo \inst{7} \and
Peter Sch\"uller\inst{8} \and
Paolo Traverso\inst{1} \and
Javier V\'azquez-Salceda\inst{9}}
\institute{Fondazione Bruno Kessler, Trento, Italy \and
University of Coimbra, Portugal \and
\"Orebro University, Sweden \and
Universit\'a di Roma ``La Sapienza'', Italy \and
Istituto di Scienza e Tecnologie dell’Informazione, National Research
Council, Italy \and
Universit\'e Paris 1 Panthon-Sorbonne, France \and
Ca' Foscari University, Italy \and
Technische Universit\"at Wien, Austria \and
Universitat Politecnica de Catalunya, Spain
}
\begin{document}
\maketitle
\begin{abstract}
The burgeoning of AI has prompted recommendations that AI techniques
should be ``human-centered''. However, there is no clear definition
of what is meant by Human Centered Artificial Intelligence, or for
short, \emph{HCAI}. This paper aims to improve this situation by
addressing some foundational aspects of
HCAI. To do so, we introduce the term \emph{HCAI agent} to refer to
any physical or software computational agent equipped with AI
components and that interacts and/or collaborates with humans. This
article identifies five main conceptual components that participate in
an HCAI agent: \emph{Observations}, \emph{Requirements},
\emph{Actions}, \emph{Explanations} and \emph{Models}.
We see the notion of HCAI agent, together with its components and
functions, as a way to bridge the technical and non-technical
discussions on human-centered AI.
%
In this paper, we focus our analysis on scenarios consisting of a
single agent operating in dynamic environments in presence of humans.
\end{abstract}
\input{01_introduction}
\input{02_key_concepts}
\input{03_ai_models}
\input{04_lifecycle}
\input{07_relatedwork}
\input{08_conclusions}
\bibliographystyle{plainnat}
| {'timestamp': '2021-12-30T02:24:16', 'yymm': '2112', 'arxiv_id': '2112.14480', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14480'} | arxiv |
\section{\changed{Generalization to non-Linear/Gaussian Models\label{sec:appendix-general-models}}}
When considering general models (which are not linear and Gaussian), the problems of state inference and belief space planning can no longer be described using the matrix-based formulation provided in Sections~\ref{sec:prelim-square-root-sam}-\ref{sec:prelim-planning}. Nonetheless, they can still be described using graphical models, as we began to explain in Section~\ref{sec:prelim-infer}; thus, let us now extend that graph-based problem formulation, explain its equivalence to the matrix-based formulation, and show that $\mathtt{PIVOT}$ is still relevant and applicable in this case.
\subsection{\changedRemoved{Inference with General Beliefs}}
To perform state inference with general models, we can re-factorize the belief $b_k(\mathcal{X}_k)$ (from (\ref{eq:belief-factor-product})) to a product of $\@ifstar{\oldabs}{\oldabs*}{\mathcal{X}_k}$ conditional factors, representing the conditional probabilities of each state variable, given (a subset of) the other variables. This process is known as \emph{variable elimination}. While the order of state variables used in (\ref{eq:belief-factor-product}) (and the factor graph) is arbitrary, the variable order now plays an important role, as it conveys the elimination order chosen for the variables. Let us consider a certain variable order, represented with the state vector $\bm X_k$. Then, in short, this elimination process is done as follows: we choose the first variable for elimination $\bm X_k(1)$, and select all the factors in $\mathcal{F}_k$, in which it is involved. Then, we utilize the chain rule to replace the selected factors with two "new" factors: (a) the conditional probability of $\bm X_k(1)$, given all the other variables involved in the selected factors $\mathbb{P}(\bm X_k(1) \mid d(\bm X_k(1)))$; and (b) a "marginal factor" $f^\text{marginal}_{k,1} \doteq \mathbb{P}(d(\bm X_k(i)))$, which connects all these variables (not including $\bm X_k(1)$). We then repeat this process according to the elimination order, examining at each step the remaining factors from $\mathcal{F}_k$, and the accumulated marginal factors. Finally, we shall be left with a product of $n_k$ conditional factors:
\begin{equation}
\label{eq:belief-conditionals-product}
b_k(\bm X_k) \propto \prod_{i=1}^{n_k-1} \mathbb{P}(\bm X_k(i) \mid d(\bm X_k(i)))\cdot\mathbb{P}(\bm X_k(n_k)),
\end{equation}
where $d(x)$ denotes the set of variables $x$ depends on (for the chosen variable order). Surly, a variable may only depend on those which follow it according to the chosen order. Then, from this hierarchical representation, we can derive the MAP estimate (or other marginal distributions), by examining the variables in the reverse order.
Graphically, this factorization of the belief to conditional probabilities can be represented with yet another PGM -- a Bayesian network ("Bayes net") $BN_k \doteq (\mathcal{X}_k,\mathcal{D}_k)$. In the Bayes net, the directed edges $\mathcal{D}_k$, represent the conditional dependencies between the connected variables, such that the edge's destination depends on its origin. Elimination can be seen as building the belief's Bayes net from its factor graph. A Bayes net, resulting from eliminating the variables of the factor graph from Fig.~\ref{fig:example-factor-graph}, is provided in Fig.~\ref{fig:example-bayes-net}.
We note that there is a duality between the factorization of $b_k(\bm X_k)$ from a product of $\@ifstar{\oldabs}{\oldabs*}{\mathcal{F}_k}$ factors, to a product of $n_k$ conditional probabilities, and the QR factorization of $\bm J_k$ ($\@ifstar{\oldabs}{\oldabs*}{\mathcal{F}_k}$ rows) to $\bm R_k$ ($n_k$ rows), as described before for linear(ized) Gaussian models. Each conditional probability corresponds (in order) to the respective row of $\bm R_k$, and the sparsity pattern of this matrix matches the structure of the Bayes net $BN_k$: the variable at index~$i$ is dependent on the variable at index~$j$, if and only if ${{\bm R}_k}_{ij}$ is non-zero. Appropriately, edges between variables in the Bayes net, which did not have a connecting factor in the Factor graph, are also known as "fill-in". The amount of fill-in reflects the computational cost of elimination, and depends on the elimination order. For more details, see, e.g., \cite{Elimelech21ral}.
\begin{figure}[t]
\begin{subfigure}[t]{\textwidth}\center
\includegraphics[width=0.75\columnwidth]{bn-eps-converted-to}
\caption{The original Bayes net created from elimination of the variables in the factor graph given in Fig.~\ref{fig:example-factor-graph}; this process depends on the elimination order, which here is chosen to be $[x_1,l_2,x_2,l_1,x_3,l_3]$. Arrows between the variable nodes represent conditional dependencies.\\$ $}
\label{fig:example-bayes-net}
\end{subfigure}
\begin{subfigure}[t]{\textwidth}\center
\includegraphics[width=0.75\columnwidth]{bn-update-eps-converted-to}
\caption{Updated Bayes net, after addition of new factors and/or variables to the factor graph, as shown in Fig.~\ref{fig:inc-update}. The only variables affected by the update (in orange) are the first involved variable, and those which follow it, according to the elimination order.}
\label{fig:example-bayes-net-update-full}
\end{subfigure}
\caption{Incrementally updating the Bayes net (i.e., belief factorization), used for inference in non-linear/Gaussian beliefs.}
\label{fig:example-bayes-net-update}
\end{figure}
\subsection{\changedRemoved{Incremental Belief Update}}
We recall that we consider a sequential problem, in which the system (i.e., sets of variables and factors) may grow as time progresses. Hence, at the arrival of new factors, we wish to update the belief accordingly, and refine our estimate.
Formally, we may consider the initial belief $b_k(\mathcal{X}_k)$, represented with $FG_k$ and $BN_k$, and assume that at time-step $k+1$ we wish to update the system with new factors, and possibly new state variables (e.g., transition to a new pose). Such an update can be represented as a factor \mbox{(sub-)graph}, which we wish to merge into the initial graph; i.e.,
$FG^\delta_{k+1} \doteq (\mathcal{X}_k\cup\mathcal{X}^\delta_{k+1}\cup\mathcal{F}^\delta_{k+1},\mathcal{E}^\delta_{k+1})$, such that $ FG_{k+1} \doteq FG_k \cup FG^\delta_{k+1} $, as demonstrated in Fig.~\ref{fig:inc-update}.
Adding new factors to the belief (i.e., updating (\ref{eq:belief-factor-product}) or the matching factor graph) is trivial; yet, inferring the updated factorized belief representation at time $k+1$ (i.e., updating (\ref{eq:belief-conditionals-product}) or the matching Bayes net) is not, and requires re-elimination. Conveniently though, and similarly to the square root matrix, this can be performed incrementally, given access to the elimination process of the belief at the previous time-step $k$. Assume that the first variable in $\mathcal{X}_k$, according to the elimination order $\bm X_k$, that is involved in any of the new factors, is $\bm X_k(j)$. Thus, according to the elimination algorithm explained before, instead of full elimination of $b_{k+1}/FG_{k+1}$, we can reuse the conditionals (and marginal factors) calculated at time-step $k$, and only (re)start the elimination from the $j$-th variable. We refer to the variables which are left for re-elimination, i.e., $\bm X_{k+1}(j)$ to $\bm X_{k+1}(n_{k+1})$, as the "affected variables". Of course, to take advantage of such incremental updates, the elimination order of the first $j-1$ variables in $\bm X_{k+1}$ (the "unaffected variables") must match the one set in $\bm X_{k}$ -- otherwise, they would become affected too. A demonstration of this concept is provided in Fig.~\ref{fig:example-bayes-net-update-full}.
We should also mention that by using more advanced graphical structures, such as the Bayes or Junction tree \citep{Kaess10tr}, it is sometimes possible to avoid re-elimination of some of the variables we defined as "affected" (i.e., all the variables following the first involved). Since this aspect is not essential to the discussion, we choose not to over-complicate this formulation, and assume all affected variables are due to re-elimination.
\subsection{\changed{Applying PIVOT}}
As we may easily conclude from the previous discussion, changing the order of state variables, as suggested by $\mathtt{PIVOT}$, is relevant also when planning with non-linear/Gaussian beliefs. In this case, the order of variables corresponds to the elimination order used to create the Bayes net, instead of the order of columns used to create the square root matrix. The influence on the affected variables and fill-in remains similar in both the graphical and matrix representations.
\section{\changed{Generalization to Multiple Hypotheses\label{sec:appendix-general-obs}}}
\subsection{Predicting Observations in High-Dimensional States\label{sec:predicting-obs}}
As explained, for each candidate policy, we seek to calculate the expected return (i.e., value function $V$), considering the possible predictable hypotheses for the observation set. In practice, when the observation space is infinite or too large to handle, we must rely on an empirical estimation of $V$ for decision making, by predicting (sampling) a finite subset of hypotheses for $\mathcal{Z}_{k+1:k+T}$ (for each candidate).
To appropriately predict observation realizations according to the generative model (i.e., sample them according to their likelihood), we can examine an "hypothesis tree", for every candidate policy, as shown in Fig.~\ref{fig:hyp-tree}. When following a certain path from the root down to a leaf, the policy is incrementally executed, and control actions and observations are selected (given the latest belief) and incorporated (into that belief) in alternation. Thus, every path in this tree represents a hypothesis -- an appropriate assignment to the Markov chain $H_{k+1:k+T} \doteq [u_{k+1},z_{k+1},\dots,u_{k+T},z_{k+T}]$. After "completing" each step, we can calculate its reward.
Beyond affecting the high cost of belief propagation in high-dimensional states, the "curse of dimensionality" also plays an important role in cost of predicting observations. Generally, if the state is small (e.g., a single pose), or the entire state is observed each time, then we only need to contemplate about the observation value, considering the observation stochastic noise. However, when the observations may involve only a subset of the state variables, as we considered before, we should ask two questions before predicting each observation: "which variables (if any) are observed?", and (only then) "what is the observed value?".
We thus need to "pass" two layers in the hypothesis tree, in order to sample an observation in each time-step. The branching in the first layer represents variation in the topology of the observation, where all observations derived from each of these branches involve the same subset of state variables; the branching in the second layer represents variation in the observed value. This double branching means that the breadth of the hypothesis tree can quickly "explode" beyond our computation ability. This is especially problematic in our case, since: (1)~we want to solve the planning online; (2)~for each hypothesis, we need to perform high-dimensional belief update (and not, e.g., simple particle propagation), which is computationally demanding; (3)~the process of (realistic) observation generation is typically not trivial; e.g., in vision-based navigation, we would have to calculate landmark observability from our current pose (i.e., which landmarks are in our field of view), considering multiple realizations for the state value.
As mentioned, it was shown that using only a single hypothesis per candidate is often enough to achieve sufficient accuracy, by assuming "Maximum Likelihood (ML)" observations (see \cite{Platt10rss}). According to this assumption, we should only consider the "most likely" observation $z_{k+t}$ in each time-step~$k+t$. Such observation relies on the MAP estimate of the belief, which is, in the Gaussian case, its mean $\bm X^*_k$. Given this realization for the state variables, we can determine which variables would be observed (involved) $\mathcal{X}^o_{k+t}$, and infer the ML observation from the observation model. When the model noise is a zero-mean Gaussian, as we considered before, this observation would simply be $z^{ML}_{k+t} = h_{k+t}(\mathcal{X}^o_{k+t})$. So, the "ML observations assumption" translates every candidate policy into a specific "action and observation sequence" (i.e., a single hypothesis $H_{k+1:k+T}$ from the hypothesis tree), according to which the initial belief should be propagated.
Further, it is clear that updating the belief $b^-_{k+t}$ (derived from the belief $b_{k+t-1}$ after performing the action $u_{k+t}$, but before incorporating the observation $z_{k+t}$) using the ML observation $z^{ML}_{k+t}$, would not change its MAP estimate -- since we used this exact value to generate the observation. Thus, assuming the policy function depends only on the belief's MAP estimate, the next action to be taken $u_{k+t+1} = \pi(b_{k+t})$ can be determined without calculating the updated belief $b_{k+t}$, but just using the MAP estimate of $b^-_{k+t}$. Also, updating $b_{k+t}$'s mean, after applying the action $u_{k+t+1}$ (which has a zero-mean noise model), is done by simply calculating the noiseless transition function: $\overline{x_{k+t+1}} = g_k(\overline{x_{k+t}}, u_{k+t+1})$; thus, we can conveniently generate the next ML observation $z^{ML}_{k+t+1}$, without actually calculating the updated belief $b_{k+t+1}$. Overall, this means that the entire "ML hypothesis" (and the posterior MAP estimate) is known \emph{in advance}, before performing any belief updates, and by only iteratively applying the deterministic transition and observation functions.
\begin{figure}[t]
\includegraphics[width=0.9\textwidth]{hyp-tree-eps-converted-to}
\caption{The tree of predictable hypotheses of a policy $\pi$, starting from belief $b_k$. Though belief transition is deterministic, uncertainty in the future observations leads to hypothesis branching. The "maximum likelihood" hypothesis (in black) is a specific path in tree, inferable without explicit belief updates.}
\label{fig:hyp-tree}
\end{figure}
\subsection{Utilizing PIVOT with General Observations}
As explained, to determine the $\mathtt{PIVOT}$ order, we need access to the predicted updates, in order to determine the variable involvement levels and classification. We recall that assuming ML observations contributes to planning in two manners: (1) each candidate policy is represented with only a single hypothesis, and can be evaluated with a single update; (2) this hypothesis (along the entire planning horizon) can be inferred ahead of planning, without propagating the belief. Both of these properties are beneficial for $\mathtt{PIVOT}$, as they allow us to infer the variable involvement levels in the long-horizon future updates, ahead of planning time; in other words, they allow us to "prepare" in advance for all the updates due in the planning process.
When not relying on ML observations, each candidate is matched with multiple hypotheses. Further, for each candidate, and at each time-step, we have access only to the (multiple) immediately upcoming updates, taking the belief to the next time-step. Meaning, we do not have access to the "complete" hypotheses (over the entire horizon) in advance, but must "build" them gradually, by actually performing the belief updates. Hence, we also cannot infer the involvement levels of the variables in these hypotheses ahead of time, but only infer the involvement levels in the upcoming myopic updates. Thus, in this case, we shall use $\mathtt{PIVOT}$ myopically and incrementally, by calculating and applying a $\mathtt{PIVOT}$ order \emph{on the intermediate beliefs} at each time-step. In other words, we shall apply $\mathtt{PIVOT}$ before each "observation branching" of the hypothesis tree, as demonstrated in Fig.~\ref{fig:planning-tree-general}.
\begin{figure}[b]\center
\includegraphics[width=0.8\textwidth]{general-plan-tree-eps-converted-to}
\caption{Planning trees, built by connecting the full hypothesis trees (as presented in Fig.~\ref{fig:hyp-tree}) of three candidate policies at their root. $\mathtt{PIVOT}$ is applied on the beliefs at each time-step (in purple), given only the myopic updates. It is also possible to apply $\mathtt{PIVOT}$ on the initial belief, considering \emph{heuristic} knowledge on the variable involvement levels.}
\label{fig:planning-tree-general}
\end{figure}
\subsubsection{PIVOT with Heuristic Classification}
Previously, we relied on the "true" variable involvement levels, derive from the (accessible) future updates, to determine $\mathtt{PIVOT}$. Yet, it is also possible to try and heuristically \emph{estimate} the variable involvement levels, even if we do not have full access to the future updates in advance. For example, we can use the "ML hypotheses" just to estimate the variable involvement, even if we consider planning with multiple hypotheses per candidate. We can also try to perform a precursory visibility or reachability analysis, to identify variables that are (almost) certainly involved or uninvolved in the future updates. In some cases, we may even know in advance that a certain subset of the state variables can never be involved by definition; e.g., past poses are never involved in landmark-based SLAM -- where only landmarks can be re-observed.
In this case, we shall infer and apply a $\mathtt{PIVOT}$ order on the initial belief, in preparation for the long-horizon future updates, based on this estimated classification. We note that even if this variable classification does not match the "true" classification, inferred from the "real" updates (when they become available), this does cannot lead to any sacrifice in accuracy; at worst, such misclassification can lead to an increase in the computational cost of the updates.
\section{PIVOT: Predictive Incremental Variable Ordering Tactic \label{sec:pivot}}
\subsection{\changed{Overview}}
Say we are interested in performing a planning session, as described before. At this point in time, to calculate the candidate policies' values, we should perform multiple updates to the current belief "in parallel", propagating it according to the predicted hypotheses of the candidates, as demonstrated in Fig.~\ref{fig:planning-tree-ml}. We thus suggest the following concept: optimize the initial belief representation predictively -- i.e., before and in preparation for these updates -- in order to increase their efficiency. In practice, we wish to perform a single, precursory, and standalone modification to the initial belief's square root matrix, to convey \emph{reordering of the state variables}. We call this idea $\mathtt{PIVOT}$: {Predictive Incremental Variable Ordering Tactic.} Although applying $\mathtt{PIVOT}$, which may require partial matrix re-factorization, comes at a certain cost, this small investment in the current time should be overall beneficial in the long run, by reducing the cost of all future belief updates. It is important to mention that this modification simply conveys a change of representation; it is, hence, does not affect the accuracy of the belief, and does not compromise the quality of solution.
In the following sub-sections, we introduce the basic variation of $\mathtt{PIVOT}$ (in Section~\ref{sec:pivot-push}), and several extensions to it, which can lead to even greater improvement in performance: multi-class (Section~\ref{sec:pivot-multi}), fill-aware (Section~\ref{sec:pivot-fill}), and forced-incremental (Section~\ref{sec:pivot-inc}).
\begin{figure}[ht]
\includegraphics[width=\textwidth]{reordering-eps-converted-to}
\caption{The state variable order matches the column order in the square root matrix $\bm R$ (on the left). Variable reordering hence implies reordering of the columns (white overlay), but this would break the matrix' upper triangular structure. Thus, to apply a new variable order, the rows indexed between the first and last permuted indices (boxed in blue), should be recalculated.}
\label{fig:reordering}
\end{figure}
\begin{figure}[t]
\includegraphics[width=0.68\textwidth]{ml-plan-tree-eps-converted-to}
\caption{A planning tree, connecting predicted (ML) hypotheses for three candidate policies at their root, which is the initial belief (in purple). To benefit all future updates, we shall apply $\mathtt{PIVOT}$ once on the initial belief.}
\label{fig:planning-tree-ml}
\end{figure}
\subsection{Determining vs. Applying a New Order \label{sec:applying-order}}
To avoid confusion, before describing $\mathtt{PIVOT}$, we wish to clarify that discussion to follow only comes to answer the question "what should be the new variable order?". The question of "how to modify the existing square root matrix $\bm R$, after the new order is determined?" was extensively discussed in our previous work \citep{Elimelech21ral}, and one should refer to it for full details.
For good measure, we shall briefly mention some of the key points identified. First, we recall that the variable order matches the order of columns in $\bm R$. However, trying to reorder the variables by simply reordering the columns of the matrix, would break its upper triangular shape. Thus, when reordering the variables, we must re-calculate (a subset of) the rows indexed between $j_\text{first}$, and $j_\text{last}$, where those mark the index of the first and last permuted variables; a visualization of this idea is brought in Fig.~\ref{fig:reordering}. These affected rows can be recalculated through direct modification of $\bm R$, with no access to $\bm J$ nor the original factors; yet, if we also wish to recalculate the cache of marginal factors (which is needed for future updates), we must calculate these rows through partial re-factorization. Again, the full details of this process are covered in the aforementioned work.
\subsection{\changed{Pushing Forwards Involved Variables \label{sec:pivot-push}}}
Let $b(\bm X)$ mark the initial belief, and $FG \doteq (\mathcal{X}\cup\mathcal{F},\mathcal{E})$ its corresponding factor graph; in the linear/Gaussian~case, this belief is represented with the mean vector $\overline{\bm X}$, and information matrix $\bm \Lambda \doteq \bm J^T \bm J$, such that $b \approx \mathcal{N}(\overline{\bm X}, \bm \Lambda)$.
Also, let $\mathcal{H} \doteq \left\{ H_1,\dots,H_m \right\}$ represent the set of candidates' hypotheses, which, in our case, are of the form $H\doteq[u_1,z_1,\dots,u_t,z_t]$.
\pagebreak
Each hypothesis~$H$ can be matched with its own factor graph $FG^\delta_H \doteq (\mathcal{X}\cup\mathcal{X}^\delta_H\cup\mathcal{F}^\delta_H,\mathcal{E}^\delta_H)$ ("update"), containing the variables and constraints we wish to integrate into the initial belief, and with which we wish to extend the initial factor graph, such that $ FG_H \doteq FG \cup FG^\delta_H $. By looking at $FG^\delta_H$, for each hypothesis $H\in\mathcal{H}$, we can identify the set of involved prior-state variables marked as $\mathcal{I}nv_\mathcal{X}(H)$: these are the variables which are directly involved in any of the "new" factors $\mathcal{F}^\delta_H$. The remaining variables are uninvolved in this update, and marked $\neg\mathcal{I}nv_\mathcal{X}(H)$. This is visualized in Fig.~\ref{fig:supergraph}. Accordingly, the variables which are involved in at least one update $H\in\mathcal{H}$ are marked $\mathcal{I}nv_\mathcal{X}(\mathcal{H})$, and the variables which are uninvolved in any of the updates are marked $\neg\mathcal{I}nv_\mathcal{X}(\mathcal{H})$. We use the subscript $\bm X$, instead of~$\mathcal{X}$, to refer to the respective subset of variables, \emph{ordered} according to the variables' index in $\bm X$. In the linear/Gaussian case, each update~$H$ is matched with a matrix $\bm J^\delta_H$ containing the new rows with which we want to extend the matrix $\bm J$; then, the involved variables can also be identified simply by the non-zero columns in the matrix $\bm J^\delta_H$.
\begin{figure}[t]
\includegraphics[width=0.72\textwidth]{supergraph-eps-converted-to}
\caption{Identifying involved variables. The factor graph from Fig.~\ref{fig:example-factor-graph} represents the initial belief, which is extended according to two candidate policies: following the right and left paths. We hypothesize that each path would lead to the addition of two new poses, and three new factors (in gray). For each hypothesis we can identify the involved variables (from the initial state), as those connected to the new factors: $\mathcal{I}nv_\mathcal{X}(\text{right}) = \{ x_3, l_3 \}$ and $\mathcal{I}nv_\mathcal{X}(\text{left}) = \{ x_3, l_1 \}$; $\neg\mathcal{I}nv_\mathcal{X}(\{ \text{right, left} \}) = \{ x_1, l_2, x_2 \}$ are uninvolved in any of the hypotheses. For planning, we are interested in updating the initial belief's square root matrix (which appears in Fig.~\ref{fig:example-qr-fact}), according to each hypothesis.}
\label{fig:supergraph}
\end{figure}
We now wish to update $b$ according to each of these hypotheses. We recall that to do so, we are actually interested in updating the belief factorization, which is represented with the square root information matrix~$\bm R$. We previously explained that (1) $\bm R$ depends on the initial variable order expressed in $\bm X$; and (2) updates can be performed via incremental re-factorization -- only considering the block of "affected variables" (i.e., all the variables starting from the first variable involved in the update).
Notably, the initial variable order determines the index of the first involved variable in each of the future updates, and, by such, which variables would be affected by each of them. We should consider that updating the square root factorization has, at worst, cubical complexity in relation to the number of affected variables \citep{Hammerlin12book}; hence, for computational efficiency concerns, we wish this number, in each update, to be minimal.
\pagebreak
\begin{figure}[ht]
\begin{subfigure}[t]{\textwidth}\center
\includegraphics[width=\textwidth]{pivot1-eps-converted-to}
\caption{Planning with and without applying $\mathtt{PIVOT}_1$. On the left are the sparsity patterns of the square root matrix $\bm R$ of the initial belief $b$, and the Jacobian matrices of three candidate updates.
The order of columns in the matrices corresponds to the state variable order.
Colored cells in each update's Jacobian matrix signify non-zero columns, which in turn represent the involved variables in the update. According to $\mathtt{PIVOT}_1$, we should reorder the state variables, and push forwards the involved variables, towards the end of the state. The modified matrices, after variable reordering, appears on the right. Note that to keep its triangular shape, $\bm R$ requires specialized modification, as explained in Section~\ref{sec:applying-order}.
\\ $ $}
\end{subfigure}
\begin{subfigure}[t]{\textwidth}\center
\includegraphics[width=\textwidth]{pivot2-eps-converted-to}
\caption{Updating the original matrix according to each of the candidates. The orange blocks in each posterior matrix represent the affected (i.e., recalculated) entries; this block is determined according to the index of the first involved variable (column).\\ $ $}
\end{subfigure}
\begin{subfigure}[t]{\textwidth}\center
\includegraphics[width=\textwidth]{pivot3-eps-converted-to}
\caption{By adding a $\mathtt{PIVOT}_1$ reordering step before planning, we are able to reduce the size of the affected block in each candidate update.}
\end{subfigure}
\caption{A conceptual demonstration of $\mathtt{PIVOT}_1$. Please note that we do not assume dense matrices; gray or orange-colored cells only indicate entries which \emph{may} be non-zero.}
\label{fig:pivot-concept}
\end{figure}
We note that for each update, the set of affected variables may include also uninvolved variables, which appear after the first involved variable (according to the initial variable order); such variables are only affected due to their index in the state. We will develop our variable ordering tactic to avoid such scenarios.
Beforehand, let us clarify our terminology, as used throughout this paper: pushing a variable forwards means increasing its index in the state vector, bringing it closer to the vector's end; accordingly, pushing a variable backwards means decreasing its index, bringing it closer to the start.
Thus, according to our ordering tactic, we suggest to push backwards all the uninvolved variables $\neg\mathcal{I}nv_\mathcal{X}(\mathcal{H})$, to appear before $\mathcal{I}nv_\mathcal{X}(\mathcal{H})$, or equally, \textbf{push the involved variables forwards}; this verifies that variables that are uninvolved in all the actions, are never affected while planning. This approach, which we refer to as \emph{$\mathtt{PIVOT}$: Predictive Incremental Variable Ordering Tactic}, can be represented with the permutation operator
\begin{equation}
\mathtt{PIVOT}_1(\bm X) \doteq \begin{bmatrix}
\neg\mathcal{I}nv_{\bm X}(\mathcal{H}) \\ \mathcal{I}nv_{\bm X}(\mathcal{H})
\end{bmatrix},
\end{equation}
which separates the variables according to their \emph{class}: involved or uninvolved. Optimally, for each hypothesis, we would like to update only the involved variables, and make all the uninvolved variables unaffected. However, since we perform the reordering only \emph{once per planning session}, some of the affected variables might still not actually be involved, for each candidate action. Nonetheless, such reordering maximizes the number of unaffected variables, and, by such, the overlapping sub-matrix of the prior square root matrix, which can best be reused when calculating all posteriors. This concept is demonstrated in Fig.~\ref{fig:pivot-concept}.
\subsection{Multi-Class PIVOT \label{sec:pivot-multi}}
We note that the previous separation of variables maintains the \emph{relative} order of variables in each class; i.e., if a variable $x$ initially came before variable $y$, and they both are in the same class, then even after the reordering, their relative order is kept. This means that involved variables may only be pushed forwards (compared to their original index), and the number of the affected variables by each planning hypothesis may only decrease.
Nonetheless, while maintaining the relative variable order in the "involved" class presumably makes sure that the cost of each update it reduced, this property is not always desirable when considering the overall planning performance point of view. For example, if a variable is only involved in one hypothesis, it might not be sensible to keep it ahead of another variable which is involved in all actions, as it would cause the first variable to unnecessarily be affected in all updates. Instead, we might want \textbf{the order among the involved variables to convey their "involvement level"}, i.e., the number of hypotheses in which each variable is involved. In this case, pushing "more forwards" variables which are "more involved", may increase the number of affected variables in some of the updates, but the total number of affected variables, considering all the updates, would be minimized.
\pagebreak
We thus suggest a generalization of $\mathtt{PIVOT}_1$, in which we subdivide the involved variables into $c\in \mathbb{N}$ (sub-)classes, according to their involvement level:
\begin{equation}
\mathtt{PIVOT}_c(\bm X) \doteq \begin{bmatrix}
\text{class}^0_{\bm X} \\ \vdots \\ \text{class}^c_{\bm X}
\end{bmatrix},
\end{equation}
where
\begin{align}
\text{class}^i_\mathcal{X} &\doteq \left\{ x\in\mathcal{X} \mid (i-1)\cdot\frac{M}{c} < \mathtt{level}(x) \leq i\cdot\frac{M}{c} \right\} \\
M &\doteq \max_{x\in \mathcal{X}} \mathtt{level}(x) \\
\mathtt{level}(x) &\doteq \sum_{H\in\mathcal{H}} 1\left(x\in\mathcal{I}nv_\mathcal{X}(H)\right)
\end{align}
For example, when $c=1$, the class separation is based on a binary indicator of involvement -- this matches the definition of $\mathtt{PIVOT}_1$ from before, where all the involved variables are in the same class. When $c=2$, we subdivide the involved variables into two classes -- those which are involved in at most $\frac{M}{2}$ updates, and those who are involved in more than that amount (where $M$ is the maximum number of updates in which any variable is involved).
We can similarly continue to increase $c$ for a finer division. We may also explicitly require $c=\max$, to treat every involvement level as a distinct class.
For any choice of $c$, $\text{class}^0_\mathcal{X} \equiv \neg\mathcal{I}nv_\mathcal{X}(\mathcal{H})$ always contains the uninvolved variables. Algorithm~\ref{alg:pivot} summarizes the steps for calculating $\mathtt{PIVOT}_c$.
Further, each chosen $c$ imposes a block-diagonal structure on the modified square root matrix, separating the variables according to their class division, as demonstrated in Fig.~\ref{fig:root-blocks}.
\begin{figure}[t]
\includegraphics[width=0.9\textwidth]{R-block-structure-eps-converted-to}
\caption{The block structure of the modified square root matrix $\bm R$ of the prior belief from Fig.~\ref{fig:supergraph}, after applying $\mathtt{PIVOT}_1$ (a) and $\mathtt{PIVOT}_2$ (b). $\mathtt{PIVOT}_1$ puts all involved variables ($l_1,x_3,l_3$) in the same class; $\mathtt{PIVOT}_2$ separates the involved variables into two classes, as $x_3$ is involved in both hypotheses, while $l_1$ and $l_3$ are involved in one hypothesis, each.}
\label{fig:root-blocks}
\end{figure}
\subsection{\changed{Fill-Aware PIVOT \label{sec:pivot-fill}}}
As reviewed, pushing the involved variables forwards is an ordering tactic \emph{intended} to keep the cost of future belief updates during planning low; however, this tactic is not always optimal.
Indeed, when handling dense matrices (beliefs), then the cost of re-factorization (updates) is determined solely by the number of variables in the affected blocks. Yet, in sparse systems, the cost of such updates also tightly depends on the density of these blocks.
It is theoretically possible that applying the previous tactic, and reducing the size of an affected block, would actually make the cost of re-factorization higher, if this operation introduced more fill-in in this block (i.e., made it denser). Of course, we refer here to the density of the affected block in the \emph{prior} square root matrix; yet, this acts as the baseline for the fill-in in the re-calculated block in the posterior matrix, which can only increase after adding new constraints. In other words, a dense (block in the) prior would lead to a dense (block in the) posterior, which conveys high re-factorization cost. This fill-in would also affect the cost of performing back-substitution, which is needed in order to update the MAP estimate. Further, the fill-in in the prior also conveys the cost of the reordering process itself, which also typically requires re-factorization. Thus, we would like to optimize the variable order such that we find \textbf{\mbox{balance between reducing} the size of the affected blocks, and keeping the system density low}.
To achieve that, we introduce next two fill-aware improvements to the basic $\mathtt{PIVOT}_c$ order.
\begin{figure}[b]
\includegraphics[width=\textwidth]{fill-reducing-order-eps-converted-to}
\caption{(a) A factor graph representing a small belief; the graph contains a "highly connected" variable (in blue). We can examine the sparsity pattern of the belief's square root matrix: (b) shows the sparsity pattern, if the "highly connected" variable is placed last in the variable order; (c) shows the pattern if the variable is placed first. As a rule of thumb, to reduce fill-in, "highly connected" variables should be placed forwards.
}
\label{fig:density}
\end{figure}
First, taking this aspect into account, we shall reconsider the rules for class separation. As a rule of thumb, to reduce fill-in, a "highly connected" variable should be placed forwards, after the variables it is connected to; placing it behind these variables (i.e., eliminating it first, which is equivalent to its marginalization from the belief) would lead to a dense block, involving all the connected variables. This property, which is demonstrated in Fig.~\ref{fig:density}, is the key to "minimum degree" fill-reducing ordering strategies.
Thus, considering a certain update, having a "highly connected" uninvolved variable pushed back, outside of the affected block, can make that affected block denser, and actually decrease the re-factorization efficiency. \linebreak To avoid such scenarios, we want to identify these "highly connected" variables, and push them further forwards in the variable order, by "bumping" them to higher classes. We thus consider the following adjustment to the original involvement-level-based class separation rule: if a variable has more factors connecting it to (variables in) higher classes, than factors connecting it to (variables in) its own class or lower ones, then forcefully bump it to a higher class. We then mark this fill-optimized variable reclassification as $*\text{class}$.
\newcommand{\AlgEssential}[1]{{\color{teal} #1}}
\newcommand{\AlgOptional}[1]{{\color{teal} #1}}
\newcommand{\AlgFlag}[1]{{\color{RedViolet} #1}}
\begin{algorithm}
\caption{$\mathtt{PIVOT}$}
\label{alg:pivot}
\SetKw{return}{return}
\SetKwBlock{inputs}{Inputs:}{}
\SetKwBlock{outputs}{Output:}{}
\small{
\nonl\inputs{
An initial belief $b$ (with state vector $\bm X$), and a set $\mathcal{H}$ of future hypotheses, as described in Section~\ref{sec:pivot-push} \\
$c$ (chosen number of classes), \\
\AlgFlag{FILL\_AWARE} (boolean flag),\\
\AlgFlag{FORCE\_INCREMENTAL} (boolean flag)\\
}
\nonl\outputs{
A permuted state vector $\tilde{\bm X}$ \\
}
\AlgEssential{\tcp{calc variable involvement levels}}
class,$\mathtt{level} \leftarrow zeros(1,n)$ \tcp{init zero vectors}
\ForAll{$x\in\mathcal{X}$}{
\ForAll{$H\in\mathcal{H}$}{
\If{$x\in\mathcal{I}nv_\mathcal{X}(H)$}{
$\mathtt{level}(x) ++$\\
}}}
\AlgEssential{\tcp{divide involved vars into $c$ classes}}
\If{$c = 1$}{
\ForAll{$x\in\mathcal{X}$}{
class$(x) \leftarrow \max\{1, \mathtt{level}(x)\}$\\
}
}
\ElseIf{$c = \max$}{
class$(x) = \mathtt{level}(x)$\\
}
\Else{
$M \leftarrow \max_{x\in\mathcal{X}}\{\mathtt{level}(x)\}$ \\
\ForAll{$x\in\mathcal{X}$}{
class$(x) \leftarrow \min \left\{i\in[0,\dots,c] \mid \mathtt{level}(x) \leq i\cdot\frac{M}{c} \right\}$ \\
}
}
\If{\AlgFlag{FILL\_AWARE = false}}{
\AlgEssential{\tcp{calc $\mathtt{PIVOT}$, sort vars by class}}
$ \tilde{\bm X} \leftarrow \mathtt{sort}(\bm X,\text{class})$ \\
}
\Else{
\AlgOptional{\tcp{calc fill-aware $\mathtt{PIVOT}^*$}}
$*$class $\leftarrow$ class\\
\If{\AlgFlag{FORCE\_INCREMENTAL = true}}{
\AlgOptional{\tcp{from first involved var}}
$j_\text{first} \leftarrow \min \left\{j\in[1,\dots,n] \mid \mathtt{level}(x_j) > 0 \right\}$ \\
$*$class$(x_1,\dots,x_{j_\text{first}-1}) \leftarrow$ -1}
\Else{
\AlgOptional{\tcp{from first state var}}
$j_\text{first} \leftarrow 1$
}
\AlgOptional{\tcp{fill-aware var re-classification}}
$\bm \Lambda \leftarrow \bm J^T \bm J$ \\
\ForAll{$j \in [j_\text{first},\dots,n]$}{
\tcp{count how many factors connect $x_j$ to each class}
connections $\leftarrow zeros(1,c)$ \\
\ForAll{$i \in [1,\dots,j-1,j+1,\dots,n]$}{
\If{$\bm \Lambda(i,j) \neq 0$}{
\tcp{count connection between $x_j$ to the class of $x_i$}
connections$(*$class$(x_i)) ++$
}
}
current\_class $\leftarrow$ class$(x_j)$ \\
\While{$\sum \text{connections}(1:\text{current\_class}) <
\sum \text{connections}(\text{current\_class}+1:c)$}{
\tcp{bump $x_j$ to a higher class}
current\_class $++$ \\
}
$*$class$(x_j) \leftarrow$ current\_class\\
}
\AlgOptional{\tcp{optimize order in each class}}
new\_order $\leftarrow \mathtt{CCOLAMD}(\bm J, *\text{class})$\\
\If{\AlgFlag{FORCE\_INCREMENTAL = true}}{
new\_order$(1:j_\text{first}-1) \leftarrow [1:j_\text{first}-1$] \\
}
$ \tilde{\bm X} \leftarrow \bm X(\text{new\_order})$
}
}\end{algorithm}
\pagebreak
As another treatment for the fill-in concern, we may combine $\mathtt{PIVOT}_c$ with a fill-reducing order, such as $\mathtt{CCOLAMD}$. This order is the constrained version of the famous $\mathtt{COLAMD}$ order, which also allows to enforce the relative order among groups of variables, by specifying a certain value $\in\mathbb{N}$ ("constraint") for every variable. Then, for example, all variables with value~$1$ will appear before variables with value~$2$, which will appear before variables with value~$3$, and so on. The internal ordering of variables with the same constraint will match the fill-reducing $\mathtt{COLAMD}$. In our case, intuitively, the variable constraints should match the connectivity-aware variable involvement classes, which we marked $*\text{class}$.
Overall, combining these two ideas yields the fill-aware $\mathtt{PIVOT}_c$ order, which we mark $\mathtt{PIVOT}^*_c$:
\begin{multline}
\mathtt{PIVOT}^*_c(\bm X) \doteq \mathtt{CCOLAMD}(\bm J, \mathtt{constraint}), \\ \text{where }\,
\mathtt{constraint}(x) \doteq i, \,\text{such that }\, x\in*\text{class}^i_{\mathcal{X}}.
\end{multline}
The explicit steps for calculating $\mathtt{PIVOT}^*_c$ are provided in Algorithm~\ref{alg:pivot}, when the "fill-aware" flag is set to "true".
\subsection{Forced-Incremental PIVOT \label{sec:pivot-inc}}
Maintaining the relative order in the "uninvolved" class, as occurs in $\mathtt{PIVOT}_c$, means that if the current variable order (i.e., $\bm X$) begins with uninvolved variables, they would keep their position, and not be reordered, i.e.,
\begin{equation}
\big[\mathtt{PIVOT}_c(\bm X) \big](1,\dots,j-1) \equiv \bm X(1,\dots,j-1),
\end{equation}
where
\begin{equation}
j \doteq \min_{x\in\mathcal{X}}\{\mathtt{index}(x,\bm X) \mid x\in\mathcal{I}nv_{\mathcal{X}}(\mathcal{H}) \}
\end{equation}
marks the index of the first involved variable, in any of the updates. In accordance to Section~\ref{sec:applying-order}, this property means that the $\mathtt{PIVOT}_c$ order can often be \emph{applied} incrementally, with only partial modification of the belief.
This property (which is demonstrated in Fig.~\ref{fig:incremental-reordering}) is especially important for large systems, where performing "full" reordering may not be feasible in real time. However, it is not necessarily kept in the fill-aware variation of $\mathtt{PIVOT}$, where variables in each class might be "shuffled" to a fill-reducing order. If we want to \textbf{make sure the returned order can still be applied incrementally}, we should consider a slight adjustment to it. To this end, we shall first divide $\text{class}^0_{\mathcal{X}}$ (the uninvolved variables) into two sub-classes:
\begin{equation}
\text{class}^0_{\mathcal{X}} =
\text{class}^0_{\mathcal{X}<j} \cup \text{class}^0_{\mathcal{X}>j}
\end{equation}
where
\begin{equation}
\text{class}^0_{\mathcal{X}<j} \doteq \{ x\in \text{class}^0_{\mathcal{X}} \mid \mathtt{index}(x,X) < j \}
\end{equation}
contains all the uninvolved variables that already appear at the beginning of the state, before the first involved; and
\begin{equation}
\text{class}^0_{\mathcal{X}>j} \doteq \{ x\in \text{class}^0_{\mathcal{X}} \mid \mathtt{index}(x,X) > j \}
\end{equation}
contains all the uninvolved variables that appear after the first involved, and should be pushed back. This division is also demonstrated in Fig.~\ref{fig:incremental-reordering}.
Then, to avoid affecting the order of the first $j$ variables, our fill-aware optimizations should be adjusted as follows: first, the reclassification of "highly connected variables" should ignore the variables in $\text{class}^0_{\mathcal{X}<j}$; second, when applying $\mathtt{CCOLAMD}$, the constraint value used for the variables in $\text{class}^0_{\mathcal{X}<j}$ should be set to $-1$, to force them backwards; third, after the application of $\mathtt{CCOLAMD}$, we should "cancel" the internal ordering of those variables, by forcing:
\begin{equation}
\big[\mathtt{PIVOT}^*_c(\bm X) \big](1,\dots,j-1) = \bm X(1,\dots,j-1)
\end{equation}
These steps are explicitly formulated as part of Algorithm~\ref{alg:pivot}, when the "force-incremental" flag is set to "true".
Note that, although such incremental application of $\mathtt{PIVOT}^*_c$ is more efficient, it can lead to slightly inferior fill reduction in comparison to the standard counterpart. Still, the sub-optimal fill-in in the "uninvolved" rows does not affect the efficiency of the updates, by definition.
\begin{figure}[t]
\includegraphics[width=\textwidth]{incremental-ordering-eps-converted-to}
\caption{Incremental aspects of $\mathtt{PIVOT}$ vs. $\mathtt{PIVOT}^*$. On the left -- the initial state vector, where white cells represent uninvolved variables, and blue cells represent involved variables. On the right -- two modified orders, returned from $\mathtt{PIVOT}_1$, and its fill-aware counterpart $\mathtt{PIVOT}^*_1$. $\mathtt{PIVOT}_1$ does not change the order of uninvolved variables that appear at the beginning of the state (before the first involved variable at index~$4$); it can thus be applied incrementally. On the other hand, $\mathtt{PIVOT}^*_1$ may cause reordering of all variables (black overlay), and must be adjusted to allow incremental application.}
\label{fig:incremental-reordering}
\end{figure}
\section{\changedRemoved{Conclusion \label{sec:conclusion}}}
In this work, we presented a novel idea to improve the efficiency of planning in the belief space, with no sacrifice in accuracy. First, we recognized that the order of state variables of a belief, as expressed in its "square root matrix", determines which subset of them would be affected by future belief updates. We also recognized that, during planning, to evaluate the different candidates, we should perform multiple updates on the same belief, "in parallel". Thus, when facing such a scenario, we suggested to perform a precursory optimization to the variable order, in order to reduce number of affected variables, and the overall planning cost. We referred to this reordering paradigm as PIVOT: Predictive Incremental Variable Ordering Tactic, and presented fill-aware and incremental variations of it. Essentially, PIVOT helps reducing the update cost by bringing forwards "loop closing variables", and sparing the update of "uninvolved variables", as identified by the candidate updates.
We also saw that as a "by-product" of applying the tactic, we are able to improve the efficiency of the state inference sessions, which are due when executing the selected policy: if we maintain the PIVOT order after the planning session, and our prediction is in-line with the ground truth during execution, then we would similarly reduce the cost of loop closures, when they actually occur.
To demonstrate the effectiveness and benefits of the approach, we applied PIVOT in a realistic active SLAM simulation. There, we solved a sequence of planning and state inference sessions, using various variable ordering tactics. We proved that, using PIVOT, we were able to significantly reduce the computation time of both the planning and inference, with only a slight increase in fill-in (the memory footprint), and with no sacrifice in accuracy.
Since PIVOT does not make any assumptions on the belief structure, as future work, it would be interesting to also verify its benefits when applied to other belief topologies, such as in full-SLAM (vs. pose-SLAM), or when considering non-binary factors. We may also be able to further optimize the order, by utilizing more advanced fill-reducing concepts, such as graph dissection \citep{Krauthausen06rss}, or the Bayes tree \citep{Kaess10tr}. Finally, we would also like to examine the applicability of PIVOT to other contexts, such as multi-hypothesis or multi-modal beliefs \citep{Pathak18ijrr}, where we might also face branching belief updates.
\section{Introduction}
\subsection{\changedRemoved{Background}}
Autonomous agents and robots deployed in the real world must be able to handle uncertainty, in order to achieve reliable and robust performance. For example, when solving tasks such as localization, mapping, or manipulation, mobile robots should often estimate their own state in the world, while accounting for their inherently noisy actuation, and only relying on noisy sensing or partial observability. They should also be able to propagate this estimate efficiently and sequentially, to allow long term autonomous operation. An important instance of this problem is Simultaneous Localization And Mapping (SLAM) \citep{Cadena16tro}, in which we wish to infer an agent's trajectory, while mapping its surroundings, \emph{in real time}. Such problems are especially challenging, as the estimated state is high-dimensional.
Further, to allow real autonomous operation, once a robust state estimate is achieved, the agent should address the task of planning under uncertainty. This fundamental problem has long been a major interest of the robotics and Artificial Intelligence (AI) research communities. The goal in this task is, given the uncertainty-aware state estimate, to "actively" determine the \emph{future} course of action for the agent, in order to achieve a certain objective. To make a reliable decision, we should predict the development of uncertainty into the future, considering the different candidate actions or policies, and their possible outcomes. \linebreak Thus, while state inference is challenging for real-time solution, planning is exponentially more demanding.
The focus of this work is to allow computationally efficient planning under uncertainty, with a practical focus on "active SLAM"; yet, before formulating this problem and its solutions, it is important to first introduce the state inference problem, on which it relies.
\subsection{\changedRemoved{Sequential Probabilistic State Inference}}
In this problem, given a set of probabilistic constraints or noisy measurements, we would like to find the best, i.e., the maximum-a-posteriori (MAP), state estimate. To be able to express our confidence in the current estimate, and to allow fusion of information arriving from different sources, we typically maintain a \emph{belief} -- a posterior distribution over the state, given the available information. By utilizing Bayes'~rule, we are able to update ("propagate") the belief through time-steps, at the arrival of new information, in what is known as "Bayesian Inference". Broadly, we can divide the belief-based inference methods into two categories: filtering, in which we maintain the belief over the present agent pose (and possibly other variables of interest); and smoothing, in which we maintain a belief over a high-dimensional state, containing also past poses.
Generally, smoothing approaches enjoy a better accuracy and robustness, as maintaining the belief over the entire trajectory allows us to: (1) perform "loop closures", and update the estimate of past poses, when re-observing scenes; (2) perform re-linearization of past constraints, given the updated estimate, and, by such, further improve accuracy; (3)~understand topological properties of the constraint graph. For these reasons, this estimation paradigm is an appropriate choice for solving (e.g.) the SLAM problem. The application of this smoothing paradigm to SLAM was established by \cite{Dellaert06ijrr}, as "Smoothing and Mapping (SAM)". There, the authors suggested to represent the belief using a Probabilistic Graphical Model (PGM), the factor graph, which describes the topology of constraints (factors) \citep{Koller09book,Dellaert17foundations}.\linebreak
If the constraint models are linearized, and their noise is Gaussian, it was shown that the state inference can be performed using the upper triangular "square root matrix"~$\bm R$ of the system's information, given via the QR or Cholesky factorizations \citep{Golub96}.
In sequential problems, as time progresses, new constraints, and possibly new variables, are added to the system; then, the belief and its square root matrix shall be updated. However, propagation of beliefs, has, at worst, cubical complexity in terms of the state size, and it thus suffers from the "curse of dimensionality" \citep{Bellman57book}. State-of-the-art SAM approaches, such as iSAM2 \citep{Kaess12ijrr}, and SLAM++ \citep{Ila17ijrr}, partially alleviate this concern, by recognizing that the belief's square root matrix can be incrementally updated, starting from the first variable to receive a new constraint, according to the variable order.
\subsection{Belief Space Planning}
Following the previous discussion, we can now confidently examine the problem of online planning and decision making under uncertainty \citep{Kochenderfer15book}, which is the actual interest of this work. When solving this problem, we wish to select (online) an action sequence or a policy, out of a set of possible candidates, which we predict to maximize some expected objective. This problem is often modeled as (a variation of) the Markov Decision Process (MDP), or Partially Observable MDP (POMDP) \citep{Kaelbling98ai,Thrun05book}. While it might be theoretically possible to approximate the expected objectives by sampling and propagating \emph{state} particles along each predicted trajectory \citep{Thrun00nips,Stachniss05rss}, achieving a sufficient representation of a belief over the high-dimensional state would require an outstanding amount of such particles, making this approach unfeasible. We hence focus here only on parametric belief propagation, as previously discussed. Also, examining the belief space, instead of the state space, as considered in standard PO/MDPs, allows us to examine belief-based policies, and belief-based information-theoretic reward functions. This paradigm is thus useful for solving tasks such as information gathering, and active SLAM \citep{Stachniss04iros,Kim14ijrr}, where we wish to reduce the uncertainty over the entire maintained trajectory and/or feature map.
Thus, to evaluate the candidates, and select the optimal one, we shall predictively propagate the belief (usually) multiple time-steps into the future, according to (possibly) different hypotheses for each candidate; in other words, we shall solve multiple "parallel" state inference sessions, while predicting the future belief development, as if we were to follow each candidate. Essentially, this process means performing a forward search in the belief space, and we thus refer to this problem as Belief Space Planning (BSP) \citep{Bonet00aips}. Unfortunately, BSP is computationally challenging for online solution, and reducing its cost is of great importance.
\subsection{\changed{Contribution}}
The previous discussion leads us to the goal of this work -- reducing the computational complexity of this planning problem, by optimizing the process of belief update required for candidate evaluation. As explained, during sequential inference, the order of variables in the belief determines which variables will be affected by an upcoming update. Potentially, we wish the amount of these affected variables to be minimal; yet, when facing such an update, it is not possible to manipulate the belief or the order of variables to make variables "unaffected", as doing so would inherently make the manipulated variables affected.
However, during planning, we face a unique situation, in which the same initial belief faces \emph{multiple} different updates "in parallel", representing predicted hypotheses for different candidates actions. In this case, we suggest a simple yet effective idea: before performing these updates, perform a precursory standalone variable reordering procedure, and "push forwards" all loop closing variables, in order to minimize the total number of affected variables by these updates. We call this approach PIVOT: Predictive Incremental Variable Ordering Tactic. This approach is inherently complementary to various planning methods, as we only optimize the belief \emph{representation}. This also means that the approach does not comprise the accuracy of the belief nor the quality of solution.
Also, while PIVOT is intended to benefit the efficiency of planning, the tactic often benefits also the efficiency of state inference. If the optimized order is maintained \emph{after} planning, then the predicted loop closing variables would remain "forward" in the variable order. Thus, if our prediction coincides with the ground truth during execution, we should similarly reduce the cost of loop closures during inference, when they actually occurs. Further, this tactic is highly relevant when considering sequential re-planning, as the PIVOT order can be incrementally updated before each planning session.
PIVOT was first introduced in our previous publication \citep{Elimelech19isrr}. In this article, we vastly extend and improve our analysis, by presenting new scalable ("multi-class") and fill-aware variants. We also show that it is applicable for more general scenarios, including non-Gaussian and non-linear systems; planning with multiple hypotheses per candidate (i.e., without relying on "maximum likelihood observations"); and general objective functions.
\subsection{\changed{Article Structure}}
The article is structured as follows:
we begin with an extensive overview and formulation of the state inference and belief space planning problems, in the context of active SLAM (Section~\ref{sec:prelim}). Afterwards, we present the novel concept of PIVOT and its algorithmic variations (Section~\ref{sec:pivot}). Although PIVOT aims to contribute primarily to planning, we follow by explaining its evident effects on state inference and re-planning (Section~\ref{sec:influence-on-inf}). We then present an experimental demonstration of the approach in a realistic active SLAM simulation (Section~\ref{sec:results}), where we managed to substantially improve the solution efficiency, with no sacrifice in accuracy. We finish with a discussion on the experimental results (Section~\ref{sec:discussion}), and some concluding remarks (Section~\ref{sec:conclusion}).
To keep the explanation clear, in our approach description, we assume that each candidate policy is matched with a single predicted hypothesis during planning; however, this is not an inherent assumption of PIVOT. An extended analysis describing the more general case is brought in Appendix~\ref{sec:appendix-general-obs}. Further, for conciseness, the ideas in the article are presented in the practical context of linear(ized) and Gaussian systems, in which the inference can be described through manipulation of matrices; however, the ideas presented in this article are applicable to general distributions, where inference can be described through manipulation of probabilistic graphical models (PGMs). In Appendix~\ref{sec:appendix-general-models} we extend the discussion, and explain how and why PIVOT is still applicable in such scenarios.
\subsection{\changedRemoved{Comparison to Additional Related Work}}
Most works which consider planning in the belief space, typically focus on methods for sampling the space, in order to alleviate the search for the optimal candidate \citep{Prentice09ijrr,Patil14wafr,AghaMohammadi18tro}; such methods only rely on belief filtering (i.e., considering a belief over a single pose), and not on the more accurate and general belief smoothing, as we do. This is not surprising, since, as explained, the computational cost of this problem can be exceptionally high (due to the "curse of dimensionality"); this provides further motivation to our approach, which tries to tackle this exact issue.
In fact, our previous work \citep{Elimelech18arxiv} presented another attempt in achieving this goal, through belief sparsification, rather than belief reordering. Since such sparsification intrinsically requires a variable reordering step, the two methods are essentially related. Still, they are logically different as sparsification conveys \emph{approximation}, while reordering conveys a change of \emph{representation}. Further, both methods are "scalable", though in different regards: sparsification -- by selecting more variable for spasification; and PIVOT -- by dividing the variables into more classes. Thus, although the most basic form of each approach ("action consistent sparsification" and $\mathtt{PIVOT}_1$) can have a similar effect on the updates, each approach enjoys it own unique strengths. For example, we can sparsify also "involved" (as to be explained) variables, and, by such, sacrifice accuracy for additional performance; on the other hand, with PIVOT, we do not have to discard the modified belief, and, by such, improve the inference process, and efficiently update the order during re-planning. Also, with PIVOT, unlike sparsification, we are not limited to information theoretic objectives.
The work by \cite{Kopitkov17ijrr,Kopitkov19ijrr} also focused on reducing the computational complexity of planning with high-dimensional beliefs. It showed that when relying on the information gain as an information-theoretic objective for planning, we do not need to explicitly propagate the belief, in order to derive the objective values; instead, we can utilize the matrix determinant lemma, to efficiently update the determinant of the initial belief's covariance matrix. Of course, our method does not limit the objective function used in planning, nor the type of belief distribution (which was, in their case, strictly Gaussian).
Similarly to us, another related work \citep{Farhi17icra} also considers a system-wide view, which jointly examines both the (belief space) planning and the inference processes. There, the authors suggested to re-use calculation from planning, during the following state inference sessions, when applying the selected action. We note that while our approach is meant to mainly benefit the planning (and as a "by-product" also the state inference), the intention of that approach is to solely benefit the inference process (as a "by-product" of the planning). Further, while both approaches lead to a reduction in the computational effort required in inference time, their approach requires maintenance of an external cache; in contrast, our method reaches this goal implicitly, with simply modifying the belief representation, and with no explicit intervention in the inference process.
One work, by \cite{Chaves16iros}, similarly examined variable ordering in the context of planning, to allow reuse of calculations when examining similar candidate actions or between similar planning sessions. This scheme is conceptually different from the one presented here, as that reordering occurs during the evaluation of the candidates (instead of it being a precursory step), and also requires external Bayes tree caching. Also, while their results are indeed impressive, that work is significantly more restricted than the one we propose here: they consider a problem-specific scenario (active SLAM), while we do not; they assume a certain belief structure ("pose graph"), a certain belief distribution (Gaussian), and certain topological properties of the candidate paths, while we make no assumptions of this nature; they also do not account for the possibility of multiple predicted hypotheses per candidate, while we do; and, finally, they only consider planning with predefined control sequences, while we also allow incrementally-evaluated policies. Besides this attempt, we are not aware of other variable ordering approaches designed specifically for planning, as we presented here.
Nevertheless, we recognize that variable ordering tactics (or heuristics) are used extensively in the solution of the state inference problem. Due to the equivalence between graphs and matrices, this concern lies in the intersection of sparse matrix algebra and graph theory, as recognized in SAM and our formulation \citep{Kepner11book}. As explained, to solve the inference problem, we need to find the factorized representation of the belief, given either as the "square root matrix" $\bm R$ (derived from the QR of Cholseky factorizations), or, more generally, an "eliminated" Bayesian network. The amount of non-zero entries in $\bm R$, which is known as its "fill-in", reflects the computational cost of this factorization, and relies heavily on the order of state variables. Thus, to reduce this cost, we often rely on fill-reducing variable reordering. Although finding the optimal fill-reducing order is NP-complete \citep{Yannakakis81}, various heuristics -- variations of the minimum degree algorithm, such as COLAMD \citep{Davis04toms}, or graph partitioning techniques, such as nested dissection \citep{Gilbert86nm} -- provide empirically good results. Problem-specific heuristics, e.g., for SLAM \citep{Agarwal12iros,Krauthausen06rss}, which exploit the known state topology, are also applicable.
We recall that in sequential estimation, at each time-step, we shall appropriately update the belief factorization, in order to refine our estimate. To efficiently keep up with such updates, the aforementioned incremental inference techniques \citep{Kaess12ijrr,Ila17ijrr} apply such fill-reducing orders incrementally, only on the subset of affected variables, during the partial re-factorization. Thus, in sequential estimation, variable reordering is usually not applied globally (considering all the variables), and not as a standalone procedure. It should be mentioned that in an earlier version of the incremental smoothing and mapping algorithm (iSAM, by \cite{Kaess08tro}), application of a fill-reducing order was indeed suggested in periodic standalone steps; yet, this approach was later neglected, as it was not cost-efficient, in comparison to the incremental (though possibly sub-optimal) application of such orders during updates. Nonetheless, we should clarify that although the suggested PIVOT order is fill-aware, it is not intended to be fill-reducing, but only to benefit the planning process. Also, unlike such ordering tactics, which arrange the variables according to the current belief topology, we uniquely suggest to order the variables based on its predicted future development.
\section{Declaration of Conflicting Interest}
The authors declare that there is no conflict of interest.
\section{Funding}
This research was partially supported by the Israel Science Foundation (ISF), by the Israel Ministry of Science and Technology (MOST), and by a donation from the Zuckerman Fund to the Technion Center for Machine Learning and Intelligent Systems (MLIS).
\subsection{\changedRemoved{The Influence of PIVOT on State Inference and Re-Planning \label{sec:influence-on-inf}}}
Consider that in the planning session at time-step $k$, we applied $\mathtt{PIVOT}$ on the initial belief. After policy selection, we have the option to continue to the following inference and planning sessions with the belief in the original order (assuming it was cached), or continue with the belief in the $\mathtt{PIVOT}$ order. Let us examine the benefits (and possible shortcomings) of continuing with the modified order.
First, consider another planning session is due in the future.
Since $\mathtt{PIVOT}$ can be applied incrementally, if the $\mathtt{PIVOT}$ order is kept after the current planning session, then in the next planning session, a "new" $\mathtt{PIVOT}$ order can simply be incrementally updated, according to the change in variable classification (and addition of new variables). Assuming the classification of uninvolved variables usually does not change much between consecutive planning sessions, maintaining the $\mathtt{PIVOT}$ order would gradually increase the size of the "fixed" variable class $\text{class}^0_{\mathcal{X}<j}$, and reduce the cost of re-applying $\mathtt{PIVOT}$ in the future.
Second, we can examine the influence on future state inference updates, due when executing the selected policy. As explained, incorporating updates to variables from the past (i.e., loop closures) is expensive, when these affect numerous variables. When applying $\mathtt{PIVOT}$ during a planning session, we push forwards predicted loop closing variables, which we believe to be re-observed when executing the policy. We explained how doing so can reduce the computational cost of performing the predicted updates during planning. Now, if we are to execute the selected policy, it is likely that we indeed face the same loop closures we predicted, and need to perform similar belief updates. Hence, in this case, keeping the predicted loop closing variables forwards (i.e., maintaining the $\mathtt{PIVOT}$ order after planning) can reduce the computational cost of the following state inference updates, just like it did during the (predicted) planning updates. As mentioned, when considering "pure" state inference, and ignoring the planning problem, there is no point in actively pushing forwards loop closing variables, as the cost of such reordering is equivalent to actually performing the loop closure. However, since we conduct the reordering procedure anyway, as part of the planning, we gain this indirect benefit to the state inference process. This conclusion is derived from a wider view of the system, which considers both the state inference and planning processes.
Finally, we should also consider that $\mathtt{PIVOT}$ is intended to increase planning efficiency, in the ways indicated, and is not inherently fill-reducing. Typically, maintaining the $\mathtt{PIVOT}$ variable order after planning, would result in a sub-optimal fill-in in the belief during state inference, and increase the memory footprint. Also, although the cost of inference updates should actually improve, as we explained, the added fill-in in the square root matrix might increase the cost of back-substitution, which is performed when updating the state MAP estimate. The frequency of back-substitution in the system is a matter of design. For example, one may compute it after every state inference session, or only before planning. We also do not always need to calculate the entire back-substitution solution; updating the estimate of the last pose, which is usually at the end of the state, can be achieved almost immediately. Thus, overall, even if we expect some sacrifice in fill-in and back-substitution cost, we expect the gains in performance to prevail.
\section{\changedRemoved{Preliminaries and Problem Definition} \label{sec:prelim}}
\subsection{\changedRemoved{Probabilistic State Inference \label{sec:prelim-infer}}}
Let us consider a sequential stochastic optimization process. In such a process, we wish to maintain an estimate of a state vector of random variables, given a stream of probabilistic constraints over these variables.
For example, in the context of mobile robots, we may consider a Simultaneous Localization and Mapping (SLAM) process, which we describe as follows: at time-step $k$, an agent at pose $x_{k-1}$ transitions to pose $x_k$, using a control $u_k$, and then collects an observation $z_k$. The agent's state $\mathcal{X}_k \doteq \{x_0,\dots,x_k\} \cup \mathcal{L}_k$ is comprised of its entire trajectory up to that point, alongside (optionally) a collection of additional external variables $\mathcal{L}_k$, such as the positions of observed landmarks. We assume that the pose transition and the observations comply to the following models, respectively:
\begin{eqnarray}
\label{eq:model-trans}
x_k &=& g_k(x_{k-1}, u_k) + w_{k},\\
\label{eq:model-obs}
z_{k} &=& h_k(\mathcal{X}^o_k) + v_{k},
\end{eqnarray}
where $\mathcal{X}^o_k$ represents the subset of the state variables which are observed ("involved in the observation"); $g_k$ and $h_k$ are deterministic functions; and $w_k$ and $v_k$ are independent random variables, representing stochastic noise. We may also assume access to prior probabilistic knowledge on the initial~pose, given as the constraint
\begin{eqnarray}
\label{eq:model-prior}
x_0 &=& \overline{x_0} + \bm v_{0},
\end{eqnarray}
where $\overline{x_0}$ is an initial estimate, and the random variable $v_0$ represents stochastic noise.
At each time-step, we wish to derive the posterior distribution over the state, given the controls and observations taken until that time, known as the agent's \emph{belief}:
\begin{equation}
b_k(\mathcal{X}_k) \doteq \mathbb{P}(\mathcal{X}_k \mid \mathcal{U}_k, \mathcal{Z}_k)
\end{equation}
where $\mathcal{U}_k \doteq \left\{u_1,\dots,u_k\right\}$ and $\mathcal{Z}_k \doteq \left\{z_1,\dots,z_k\right\}$.
Inferring the belief over the state, or over a subset of its variables, is known as "probabilistic state inference". Maintaining the belief over the agent's entire trajectory is known as "smoothing", in comparison to "filtering", where we maintain the belief only over the most recent pose. Most often, from this belief, we are interested in finding the maximum-a-posteriori (MAP) state estimate \mbox{$ \mathcal{X}^*_k \doteq \argmax_{\mathcal{X}_k} b_k(\mathcal{X}_k)$} ("MAP inference").
To do so, we begin by applying Bayes' rule and the Markov assumption on the belief, which allows us to conveniently factorize it into the following product:
\begin{equation}
\label{eq:belief-factor-product}
b_k(\mathcal{X}_k) \propto f^\text{prior}_{\overline{x_0}}(x_0) \cdot \prod_{i=1}^k f^\text{motion}_{u_i}(x_{i-1},x_{i}) \prod_{i=1}^k f^\text{obs}_{z_i}(\mathcal{X}^o_k),
\end{equation}
where
\begin{eqnarray}
f^\text{motion}_{u_k}(x_{k-1},x_{k}) &\doteq & \mathbb{P}(x_{k+1} \mid x_k, u_{k+1}),\\
f^\text{obs}_{z_k}(\mathcal{X}^o_k) &\doteq & \mathbb{P}(z_k \mid \mathcal{X}^o_k), \\
f^\text{prior}_{\overline{x_0}}(x_0) &\doteq & \mathbb{P}(x_0).
\end{eqnarray}
Each of these \emph{factors} represents a probabilistic constraint on the state variables, matching the aforementioned prior, transition, and observation models.
\begin{figure}[t]
\includegraphics[width=0.75\columnwidth]{fg-eps-converted-to}
\caption{An exemplary factor graph representing the belief of a SLAM agent. The state contains two types of variables: poses (blue nodes) and landmarks (yellow nodes). Motion and observation factors (small black nodes) connect the variables. }
\label{fig:example-factor-graph}
\end{figure}
This factorization also allows us to represent our system at each time-step with a common Probabilistic Graphical Model (PGM) -- the factor graph $FG_k \doteq (\mathcal{X}_k\cup\mathcal{F}_k,\mathcal{E}_k)$, where the set of nodes is comprised of the \emph{set} of state variables $\mathcal{X}_k$, and set of factors $\mathcal{F}_k$; and the undirected edges in $\mathcal{E}_k$ are used to connect state variables to the factors in which they are involved. An example is given in Fig.~\ref{fig:example-factor-graph}.
\subsection{\changedRemoved{Square-Root SAM: Inference with Linear/Gaussian Models \label{sec:prelim-square-root-sam}}}
A particularly interesting case, which we will focus on in this paper, is when the prior and model noise are Gaussian, i.e.,
\begin{eqnarray}
w_k &\sim& \mathcal{N}(0, \bm W_k),\\
v_k &\sim& \mathcal{N}(0, \bm V_k), \\
v_0 &\sim& \mathcal{N}(0, \bm V_0),
\end{eqnarray}
where $\forall k\in\mathbb{N},\, \bm W_k, \bm V_k$ are the covariance matrices of the respective zero-mean Gaussian noise variables $\bm w_k, \bm v_k$, and $\bm V_0$ is the covariance matrix of the prior over the pose $x_0$.
Assigning the corresponding Gaussian probability density functions in (\ref{eq:belief-factor-product}) yields
\begin{multline}
\label{eq:belief-prod-exp}
b_k(\mathcal{X}_k) \propto \exp \left[ -\frac12 \@ifstar{\oldnorm}{\oldnorm*}{ x_0 - \overline{x_0} }^2_{\bm V_0}\right] \\\cdot \prod_{i=1}^{k} \exp \left[ -\frac12 \@ifstar{\oldnorm}{\oldnorm*}{x_i - g_k(x_{i-1}, u_i)}^2_{\bm W_i}\right] \\\cdot \prod_{i=1}^k \exp \left[ -\frac12 \@ifstar{\oldnorm}{\oldnorm*}{z_{k} - h_k(\mathcal{X}^o_k)}^2_{\bm V_i}\right],
\end{multline}
where the notation $\@ifstar{\oldnorm}{\oldnorm*}{\square}_{\bm\Sigma} \doteq \sqrt{\square^T{\bm\Sigma}^{-1} \square}$ marks the \mbox{Mahalanobis distance.}
Further, we may also consider the factor models are linear; otherwise, if the models are not linear, we can consider a local linearization of the non-linear functions, by calculating their Jacobian matrices, around an initial state estimate $\overline{\bm X_k}$ (typically, the MAP from time-step $k-1$, with proper initialization for new variables). Note that to calculate these Jacobians, the order of variables, which matches the order of columns in the matrices, must be fixed; we use \mbox{$\bm X_k \doteq [\bm X_k(1),\dots,\bm X_k(n_k)]^T$}, where $n_k$ is the state size, to mark the state \emph{vector}, which represents the order of state variables. Given these linearized models, we can easily derive that the belief at time-step $k$ (from (\ref{eq:belief-prod-exp})), is also (approximately) Gaussian:
\begin{equation}
b_k(\bm X_k) \approx \mathcal{N}({\bm X}^*_k, \bm \Lambda_k^{-1}),
\end{equation}
where $\bm \Lambda_k$ is the information/precision matrix, achieved by calculating $\bm\Lambda_k \doteq \bm J_k^T \bm J_k$, where
\begin{equation}
\bm J_{k\geq1} \doteq \begin{bmatrix}
\bm J_0 \\ \bm J^\delta_1 \\ \vdots \\ \bm J^\delta_k
\end{bmatrix}
,\, \bm J_0 \doteq \begin{bmatrix}
\bm V_0^{-\frac12} \bm P_0
\end{bmatrix}
,\, \bm J^\delta_{k\geq1} \doteq \begin{bmatrix}
\bm W_k^{-\frac12} \bm G_k \\ \bm V_k^{-\frac12} \bm H_k
\end{bmatrix},
\end{equation}
$g'_k(x_{k-1}, u_k, x_k) \doteq - x_k + g_k(x_{k-1}, u_k)$,
$\bm G_k \doteq \nabla \vert_{\overline {\bm X}_k} g'_k$, \linebreak
$\bm H_k \doteq \nabla \vert_{\overline {\bm X}_k} h_k$, $\bm P_0 \doteq \nabla \vert_{\overline {\bm X}_k} x_0$, and $\square^{\frac12}$ marks the Cholesky factor of the matrix. We note that since every row in the "collective" Jacobian matrix $\bm J_k$ represents a factor from $\mathcal{F}_k$, and the order of columns in the matrix matches the variable order in $\bm X_k$, the sparsity pattern of $\bm J_k$ matches the structure of the factor graph $FG_k$: looking at each row of the matrix, entries in it are non-zero, if and only if the variables matching the column-index of these entries are involved in the corresponding factor. This is demonstrated in Fig.~\ref{fig:example-qr-fact}.
In this case, the belief mean $\bm X_k^*$ matches the MAP estimate. It can be inferred as $\bm X_k^* = \overline{\bm X_k} + \bm\Delta^*_k$, where $\bm\Delta^*_k$ -- the "correction" to the initial estimate -- is achieved by solving the following linear "least squares" problem:
\begin{equation}
\bm J_k \cdot \bm\Delta_k = \bm \zeta_k,
\end{equation}
with the Right Hand Side (RHS) vector $\bm\zeta_k$, given as
\begin{equation}
\bm\zeta_{k\geq1} \doteq \begin{bmatrix}
\bm\zeta_0 \\ \bm\zeta^\delta_1 \\ \vdots \\ \bm\zeta^\delta_k
\end{bmatrix}
,\, \bm\zeta_0 \doteq
\begin{bmatrix}
\overline{x_0}
\end{bmatrix}
,\, \bm\zeta^\delta_{k\geq1} \doteq
\begin{bmatrix}
\overline{x_k} - g(\overline{x_{k-1}},u_k) \\
z_k - h(\overline{\mathcal{X}^o_k})
\end{bmatrix}.
\end{equation}
The solution of this system is achieved by calculating the upper triangular \emph{square root information matrix} $\bm R_k$ (in Fig.~\ref{fig:example-qr-fact}), given by the QR factorization of $\bm J_k$, or the Cholesky factorization of $\bm \Lambda_k$, and then performing "back substitution". From this square root matrix we can also conveniently infer other common properties of interest, such as marginal distributions, and the differential entropy. For more details, refer to \cite{Dellaert06ijrr}, or \cite{Elimelech21thesis}.
Non-zero entries in the square root matrix $\bm R_k$, which were zero entries in the information matrix $\bm \Lambda_k$, are known as "fill-in". The amount of fill-in is directly related to the computational cost of the factorization, and hence we care to minimize it. The amount of fill-in is determined by the variable (i.e., column elimination) order. While finding the optimal order is NP-complete (as mentioned), various heuristics -- variations of the minimum degree algorithm -- exist, and most prominently, $\mathtt{COLAMD}$ \citep{Davis04toms}. The amount of fill-in also determines the computational cost of performing back-substitution, though this cost is normally less significant than that of the factorization itself.
\begin{figure}[t]
\includegraphics[width=\textwidth]{fg-J-R-eps-converted-to}
\caption{When the models are linear(ized), the factor graph from Fig.~\ref{fig:example-factor-graph} (left) can be represented with the "Jacobian matrix" $\bm J$ (center). To perform inference, we shall perform QR factorization on $\bm J$, to derive the "square root" matrix $\bm R$ (right).}
\label{fig:example-qr-fact}
\end{figure}
\subsection{\changedRemoved{Incremental Belief Update}}
According to the former explanation, incorporation of new factors to the belief can be seen as adding new linear constraints to the system. Hence, to update the Jacobian matrix from time-step~$k$, to time-step~$k+1$, after performing a control $u_{k+1}$, and receiving an observation $z_{k+1}$, we need to simply add new rows to it, such that
\begin{equation}
\bm J_{k+1} \doteq \begin{bmatrix}
\begin{matrix} \bm J_k & \bm 0 \end{matrix} \\ -\, \bm J^\delta_{k+1} \,-
\end{bmatrix}.
\end{equation}
Note that in order for the columns in the "old" and "new" rows to match, this also requires proper augmentation of $\bm J_k$ with zero-columns, accounting for newly introduced variables $\mathcal{X}^\delta_{k+1}$. The placement of the augmented columns should be according to their index in the state vector $\bm X_{k+1}$; here we added the new variables at the end of the state. As mentioned, re-observing variables from the (non-immediate) past is commonly known as "loop closing".
To update our belief and estimate, we shall calculate the "new" square root matrix $\bm R_{k+1}$. Fortunately, $\bm R_{k+1}$ can be derived by incrementally updating $\bm R_k$, instead of calculating the factorization of $\bm J_{k+1}$ (or $\bm \Lambda_{k+1}$) "from~scratch". First, we should identify the index of the first non-zero column in $\bm J^\delta_{k+1}$, and we mark it as $j$; this represents the index in the state vector of the first variable involved in the added factors. According to the QR algorithm, calculation of the top $j-1$ rows of $\bm R_k$ and $\bm R_{k+1}$ is equivalent, and thus we only need to calculate the bottom right block of $\bm R_{k+1}$, starting from the $j$-th row/column (the \emph{"affected block"}). This idea, which is visualized in Fig.~\ref{fig:inc-update}, is utilized by state-of-the-art "Smoothing and Mapping" (SAM) algorithms, such as iSAM1 \citep{Kaess08tro}, iSAM2 \citep{Kaess12ijrr}, and SLAM++ \citep{Ila17ijrr}. Of course, after the incremental re-factorization of the system, we shall again perform back sub substitution, if we wish to update the MAP estimate.
To take advantage of such incremental updates, the order of the "unaffected" first $j-1$ variables in $\bm X_{k+1}$ must match the one set in $\bm X_{k}$; i.e., the order of the first $j-1$ columns of $\bm J_{k+1}$ must match those of $\bm J_k$. It is possible, and sensible, to reorder columns $j$ to $n_{k+1}$ during the re-factorization; e.g., to apply a fill-reducing order. Such incremental application of fill-reducing ordering tactics is likely to be inferior, in terms of the resulting fill-in, than if we were to consider reordering of all the variables, but proves to still be effective. To clarify, it is not possible to reorder the variables in order to make the affected block (which is due to re-factorization) smaller.
\subsection{\changedRemoved{Belief Space Planning \label{sec:prelim-planning}}}
Up until now, we examined a "passive" problem, in which we cared to estimate an agent's state, given known actions and observations. Understanding this problem was essential for describing the planning problem, to its solution we wish to contribute with this work.
When planning, we wish to actively seek the next course of action for the agent; if we consider a SLAM agent, as we have done so far, this problem is known as "active~SLAM". Thus, assume the agent currently holds the belief $b_k$ over its state~$\mathcal{X}_k$. The goal is to select (online) the optimal policy \mbox{$\pi\in\Pi$} -- a mapping from beliefs to actions -- which, when applied $T$ times ("the planning horizon"), starting from~$b_k$, would maximize the expected accumulated discounted reward ("the expected return"), as measured with the value or objective function:
\begin{multline}
\label{eq:value-function}
V\left(b_k, \pi\right) \doteq \\ \expect_{\mathcal{Z}_{k+1:k+T-1}} \left[ \sum_{t=1}^T \gamma_t\cdot\left[\rho\left(b_{k+t-1}, u_{k+t}\right) \mid \pi,\mathcal{Z}_{k+1:k+t-1}\right]\right],
\end{multline}
where, for $t\geq1$, $\mathcal{Z}_{k+1:k+t-1} \doteq \left\{z_{k+1},\dots,z_{k+t-1}\right\}$; $u_{k+t} = \pi(b_{k+t-1})$; and the belief $b_{k+t-1}$ is recursively defined as in (\ref{eq:belief-factor-product}). Note that for generality, we mark the discount factor $\gamma_t\in[0,1]$ as a function of the index, to not force reward diminishment.
\begin{figure}[t]
\includegraphics[width=\textwidth]{fg-J-R-update-eps-converted-to}
\caption{New factors added to the system (left, in green), are represented with new Jacobian rows, with which we should update the square root matrix (center). The updated square root matrix (right) can be derived incrementally, by only recalculating the square bottom-right "affected" block, starting from the index of the first non-zero column in the update (in orange).}
\label{fig:inc-update}
\end{figure}
Since our objective and policies are belief-dependent, this problem is known as planning in the "belief space". Specifically, in information-theoretic belief space planning (BSP), such as in active SLAM, we often wish to minimize the uncertainty in the posterior belief. We can use the differential entropy as an uncertainty measure, which, for a Gaussian belief $b$, over a state of size $n$, with an information matrix $\bm \Lambda = \bm R^T \bm R$, is
\begin{equation}
\mathrm H\left(b\right) = \frac12\cdot\ln\left[\frac{\left(2\pi e\right)^{n}}{\@ifstar{\oldabs}{\oldabs*}{\bm \Lambda}}\right] = -\left( \ln \@ifstar{\oldabs}{\oldabs*}{\bm R} - \frac n 2 \cdot\ln \left(2\pi e\right) \right).
\end{equation}
Then, we can define the following objective function:
\begin{equation}
\label{eq:objective}
\tilde{V}\left(b_k, \pi\right) \doteq \expect_{\mathcal{Z}_{k+1:k+T}} \left[ \mathrm H(b_{k})-\mathrm H(b_{k+T}\mid \pi,\mathcal{Z}_{k+1:k+T}) \right],
\end{equation}
which measures the expected information gain between the current and final beliefs. As we can see, this value depends on the square root matrix of the agent's belief at the end of the candidate trajectory.
\subsection{\changed{Problem Definition} \label{sec:prelim-def}}
Overall, we can formulate the following decision problem: given an initial belief $b_k$ over the state $\mathcal{X}_k$, with known transition and observation models, a set $\Pi$ of candidate policies, and a value function $V$, such as the one defined in~(\ref{eq:objective}), return the optimal candidate $\pi^*$, such that
\begin{equation}
\label{eq:decision-problem}
\pi^* = \operatorname*{argmax}_{\pi \in \Pi} V\left(b_k,\pi\right).
\end{equation}
Since solving this problem requires to perform belief updates considering multiple candidate policies, and over long horizons, the computational cost of the solution can turn exceptionally high. The goal of this work is to help \emph{alleviate the computational cost} of this problem's solution. Note that we may also consider other value functions, as this choice is mostly orthogonal to the contribution to follow.
\subsubsection{Assumptions and Generalizations}
Evidently, to calculate the candidates' expected returns, the prior belief should be predictively propagated (updated) according to each of the candidate policies. Yet, since our models are stochastic, utilization of each policy may lead to different outcomes, or \emph{hypotheses}; in our active SLAM formulation, each hypothesis can be described as an assignment to the Markov chain $H_{k+1:k+T} \doteq [u_{k+1},z_{k+1},\dots,u_{k+T},z_{k+T}]$, according to the candidate policy, and the observation model. Luckily, it was shown that using only \emph{a single hypothesis per candidate} is often enough to achieve sufficient accuracy, by assuming "Maximum Likelihood (ML)" observations (see \cite{Platt10rss}); it is hence a common assumption taken to practically solve this online planning problem. For conciseness of the discussion, we will utilize this assumption when describing our approach in the following sections; however, this is not an inherent limitation of the approach. An extended discussion on observation prediction and generalization of the approach, to allow multiple hypotheses per candidate, is provided in Appendix~\ref{sec:appendix-general-obs}.
For the same reason, we will also assume linear(ized) and Gaussian models, which means our belief can be described and updated using the aforementioned matrix-based formulation; yet again, this is not an inherent limitation of the approach, which is applicable to more general models as well. An extended discussion generalizing the approach to other models, using PGMs, is provided in Appendix~\ref{sec:appendix-general-models}.
\section{\changed{Experimental Evaluation \label{sec:results}}}
\graphicspath{ {./images/scenario/} }
\changed{Next, we wish demonstrate the advantages of $\mathtt{PIVOT}$, and present an in-depth analysis of the approach, in a realistic active SLAM simulation. In this simulation, a ground robot is tasked to autonomously navigate through a sequence of eight pre-defined goal points in an unknown indoor environment. The robot knows the location of the goals, but must perform SLAM, in order to accurately maintain its own location in the environment (i.e., localize). To maintain safety, and make sure the goal points are indeed reached, the robot should actively reason about its future belief, in order to choose the most informative path to each goal, which minimize the uncertainty over its trajectory. For example, when choosing a path which passes through a previously explored area, certain loop closures are expected to be added to the belief, reducing its uncertainty; hence, different paths might lead to different loop closures, and convey different uncertainty levels.}
\subsection{Simulation Overview}
We used the Gazebo simulation engine \citep{Koenig04iros} to simulate the environment and the robot (Pioneer 3-AT), which is equipped with a lidar sensor (Hokuyo UST-10LX), providing point-cloud observations; these components can be seen in Fig.~\ref{fig:scenario-robot}. A grid-based map of the environment is incrementally approximated by the robot from the scans during the navigation. Robot Operating System (ROS) is used to run and coordinate the system components -- state inference, decision making, sensing, etc. The robot's state $\bm X_k \doteq [x^T_0,\dots,x^T_k]^T$ consists of discretized poses kept along its entire executed trajectory. Its belief over this trajectory is represented as a factor graph, and maintained using the GTSAM C++ library \citep{Dellaert12tr}. Each pose $x_k$ consists of three variables, representing a 2D position and orientation (in a global coordinate frame). The robot's initial pose is provided to it as a prior factor over $x_0$ (with white Gaussian noise). After passing a set distance, a new pose is added to the end of the state, and a lidar scan (in a range of approximately 30 meters) is taken. A motion constraint (pose transition factor), with white Gaussian noise, matching the real hardware's specs, is added between the new pose and the previous one. The observed point-cloud is then matched to scans taken from key past poses using ICP matching \citep{Besl92pami}. If a match is found, a Gaussian loop closing constraint (factor) is added between these poses. After adding the new motion and observation constraints, the agent incrementally updates its belief and state estimate; we refer to this belief update process as a "state inference session". To follow a path, the robot uses a "pure pursuit" controller \cite{Coulter92report}, which yields an appropriate sequence of control actions, based on the robot's estimated position. To initiate the simulation, and build a rudimentary map, the robot is set to follow a short predefined path, given as a sequence of way-points.
\begin{figure}[t]
\includegraphics[width=0.49\textwidth]{gazebo-1}
\includegraphics[width=0.49\textwidth]{gazebo-2}
\caption{A Pioneer 3-AT robot in the simulated indoor environment. The robot is equipped with a lidar sensor, Hokuyo UST-10LX, as visible on top of it.}
\label{fig:scenario-robot}
\end{figure}
\subsection{Planning}
After completing the initial predefined path, the robot performs a "planning session", based on its latest belief $b$, towards the first goal. It begins by generating a set $\Pi$ of twenty collision-free candidate paths (sequences of way-points) from its estimated pose to the goal: it first execute the Probabilistic RoadMap (PRM) algorithm \citep{Kavraki96tra} to sample the map, and then executes the K-diverse-paths algorithm \citep{Voss15icra} on the sampled PRM graph, to return a set of topologically diverse paths.
To evaluate and compare the "safety" of taking each path, we use the previously-defined belief-based information-theoretic value function $\tilde{V}$ (from (\ref{eq:objective})), which measures the expected information gain. For tractability, we evaluate each candidate by predicting only the ML future hypothesis, as explained in Section~\ref{sec:prelim-def}. Hence, each candidate path $\pi\in\Pi$ is pre-matched with a single factor graph $FG^\delta_\pi$, containing the factors and poses to be added to the prior belief graph $FG$, after following the path. For each candidate, loop closure factors are predicted between future and past poses, if their estimated location is within a close range (i.e., where we expect to add them when following this path); thus, we do not need predict the raw laser scans, but only which poses would be connected with a factor.
After updating the initial belief according to each of the candidate hypotheses, the value of each candidate is computed, and the optimal path is selected (marking the end of this planning session), and then followed. After reaching the goal at the end of the selected path, the robot conducts a new planning session, towards its next goal, until all goals are reached. In total, the robot conducts eight planning sessions, separated by sequences of state inference sessions. A visualization of (some of) the planning sessions is provided in Fig.~\ref{fig:planning-sessions}.
\begin{figure}[t]
\begin{subfigure}[t]{0.9\textwidth}
\includegraphics[width=\textwidth]{screenshot1}
\caption{Planning session \#1.}
\end{subfigure}
\begin{subfigure}[t]{0.9\textwidth}
\includegraphics[width=\textwidth]{screenshot2}
\caption{Planning session \#2.}
\end{subfigure}
\begin{subfigure}[t]{0.9\textwidth}
\includegraphics[width=\textwidth]{screenshot7}
\caption{Planning session \#7.}
\end{subfigure}
\caption{Visualization of the planning sessions, including: the estimated map (blue occupancy grid); the current estimated pose (yellow arrow-head) and goal (yellow circle); the trajectory taken up to that point (thin green line); the candidate trajectories from the current position to the goal (thick lines in various colors); and the selected trajectory (highlighted in bright green). The size of the mapped area "in reality" is (roughly) 20m$\times$30m.}
\label{fig:planning-sessions}
\end{figure}
\subsection{\changedRemoved{Comparing the Performance of PIVOT} }
In the considered scenario, the state size grows quickly as the navigation progresses, making planning more computationally challenging. Hence, we wish to examine how utilizing $\mathtt{PIVOT}$ can help reducing the planning cost. To do so, throughout the simulation, we maintained in parallel multiple versions of the (factorized) belief, using different ordering tactics, and performed the appropriate belief updates on all versions of the belief, during each planning and state inference session. We recall that the different ordering tactics only convey a change of representation, and do not affect the accuracy of the solution.
The baseline ordering tactic we considered matches the one suggested by the state-of-the-art SAM algorithm iSAM2 \citep{Kaess12ijrr}.
According to this tactic, at each incremental update of the factorization, we shall calculate and apply a constrained fill-reducing order ($\mathtt{CCOLAMD}$) on the affected variables; the constraint forces the involved variables forward, to the end of the state. While the reasons for applying a fill-reducing order as part of this tactic are obvious (reducing fill-in and the update cost), the added constraint actually leads to a sacrifice in fill-in, and does not contribute to the current inference session. However, the constraint is added to contribute to the following inference session: if the variables are to be updated again, then the affected block in the next session would be smaller. This tactic is often worthwhile for incremental inference.
We also utilized several variations of $\mathtt{PIVOT}$ during planning, which meant performing additional standalone reordering of the belief before calculating the objective values in each planning session. This comes in contrast to the baseline tactic, where (incremental) reordering is only performed during updates, and never as a standalone step. For comparison, we considered $\mathtt{PIVOT}_1$, $\mathtt{PIVOT}_5$, and $\mathtt{PIVOT}_{\max}$, which are the basic $\mathtt{PIVOT}$ orders, with varying numbers of classes, and their fill-aware counterparts $\mathtt{PIVOT}^*_1$, $\mathtt{PIVOT}^*_5$, and $\mathtt{PIVOT}^*_{\max}$. Although it is not obligatory, for this comparison, we chose to always continue to the following state inference sessions (after the planning is completed) with the modified orders; nonetheless, all updates during the state inference sessions were always conducted according to the baseline tactic.
Overall, we maintained seven versions of the belief, according to seven ordering tactics: the baseline -- in which we performed reordering only during updates, and six other tactics, in which we additionally applied a $\mathtt{PIVOT}$ variation in standalone reordering steps during planning sessions. For each version, we measured and compared the total state inference and planning times. For each inference session, we measured the time of performing the belief factorization update and the back-substitution (to refine the MAP estimate); for each planning session, we measured the belief update time according to the predicted hypothesis of each candidate, along with the time of applying the $\mathtt{PIVOT}$ order, when it was used. As explained in Section~\ref{sec:applying-order}, applying the order requires partial re-factorization; to this end, we used the modification algorithm developed in our previous work \citep{Elimelech21ral}.
For a fair comparison, we chose to the detach the timing of the belief update and reordering processes from any framework-specific implementation overhead. As explained in Section~\ref{sec:prelim-square-root-sam}, since the system is Gaussian, the belief update process can be performed by updating the square root information matrix. Thus, at each state inference session, we extracted the new Jacobian rows from our GTSAM factor graph, representing the newly added (linearized) factors. We then performed the incremental update of the belief's square root matrix, in "iSAM2 fashion", using a standard MATLAB implementation \citep[see][]{Elimelech21thesis}. At each planning session, we extracted the Jacobian rows representing the predicted hypotheses, and performed a similar square root matrix update for each one. Of course, the columns of the extracted Jacobian rows were reordered appropriately before each update, to match the variable order of that version of the belief. The sparsity pattern of the square root matrix under different variable orders is presented in Fig.~\ref{fig:scenario-fill-in}.
\begin{figure}[t]
\begin{subfigure}[t]{\textwidth}
\includegraphics[width=\textwidth]{graph-planning-eps-converted-to}
\caption{}
\label{fig:scenario-timing-planning}
\end{subfigure}
\begin{subfigure}[t]{\textwidth}
\includegraphics[width=\textwidth]{graph-inference-eps-converted-to}
\caption{}
\label{fig:scenario-timing-inf}
\end{subfigure}
\begin{subfigure}[t]{\textwidth}
\includegraphics[width=\textwidth]{graph-fill-in-eps-converted-to}
\caption{}
\label{fig:scenario-fill-in-per-session}
\end{subfigure}
\caption{Comparison of the experiment solution, using different variable ordering tactics: baseline ("iSAM2"), three variants of $\mathtt{PIVOT}_c$, and three variants of $\mathtt{PIVOT}^*_c$.\\
(a) Accumulated planning time throughout the eight planning sessions; lower is better. The dashed line represents the accumulated reordering time out of the measured time.\\
(b) Accumulated state inference time throughout the ($\sim$)1,000 inference sessions; lower is better. The dashed line represents the accumulated back-substitution time out of the measured time.
(c) Fill-in accumulation (number of non-zeros in $\bm R$).}
\label{fig:scenario-timing}
\end{figure}
\begin{table*}[ht]
\footnotesize
\begin{tabularx}{\textwidth}{|l|l?X?X|X|X?X|X|X|}
\hline
\multicolumn{2}{|l?}{Tactic}
& Baseline
& \multicolumn{3}{c?}{$\mathtt{PIVOT}_c$}
& \multicolumn{3}{c|}{$\mathtt{PIVOT}^*_c$} \\
\hline
\multicolumn{2}{|l?}{\# of classes}
& N/A
& $1$
& $5$
& $\max$
& $1$
& $5$
& $\max$
\\\Xhline{5\arrayrulewidth}
\multirow{2}{*}{Planning Session \#1}
& Reordering time & / & 00.05 & 00.06 & 00.06 & 00.07 & 00.08 & 00.07
\\\cline{2-9}
& Update time & 0.56 & 00.39 & 00.30 & 00.30 & 00.26 & 00.29 & \textbf{00.28}
\\\Xhline{3\arrayrulewidth}
\multirow{2}{*}{Planning Session \#2}
& Reordering time & / & 00.11 & 00.06 & 00.06 & 00.26 & 00.20 & 00.16
\\\cline{2-9}
& Update time & 01.02 & 00.64 & 00.64 & 00.56 & 00.57 & 00.52 & \textbf{00.52}
\\\Xhline{3\arrayrulewidth}
\multirow{2}{*}{Planning Session \#3}
& Reordering time & / & 00.05 & 00.21 & 00.22 & 00.23 & 00.18 & 00.18
\\\cline{2-9}
& Update time & 03.40 & 03.36 & \textbf{02.52} & 02.53 & 03.72 & 02.78 & 02.64
\\\Xhline{3\arrayrulewidth}
\multirow{2}{*}{Planning Session \#4}
& Reordering time & / & 00.63 & 00.45 & 00.45 & 00.48 & 00.42 & 00.45
\\\cline{2-9}
& Update time & 19.12 & 03.20 & 02.77 & 02.56 & 02.78 & 02.54 & \textbf{02.33}
\\\Xhline{3\arrayrulewidth}
\multirow{2}{*}{Planning Session \#5}
& Reordering time & / & 00.90 & 00.66 & 00.59 & 00.76 & 00.79 & 00.75
\\\cline{2-9}
& Update time & 18.12 & 01.88 & 01.71 & 01.71 & 02.22 & 01.37 & \textbf{01.35}
\\\Xhline{3\arrayrulewidth}
\multirow{2}{*}{Planning Session \#6}
& Reordering time & / & 00.84 & 00.85 & 00.88 & 01.02 & 01.02 & 01.03
\\\cline{2-9}
& Update time & 07.90 & 02.00 & \textbf{01.61} & 01.54 & 02.27 & 01.69 & 01.70
\\\Xhline{3\arrayrulewidth}
\multirow{2}{*}{Planning Session \#7}
& Reordering time & / & 01.01 & 00.92 & 00.86 & 00.89 & 00.79 & 00.78
\\\cline{2-9}
& Update time & 31.20 & 08.89 & 05.92 & 06.67 & 08.58 & 05.26 & \textbf{04.95}
\\\Xhline{3\arrayrulewidth}
\multirow{2}{*}{Planning Session \#8}
& Reordering time & / & 01.15 & 01.40 & 01.42 & 01.09 & 00.75 & 01.20
\\\cline{2-9}
& Update time & 35.70 & 33.49 & 39.52 & 35.98 & 34.91 & 22.30 & \textbf{21.23}
\\\Xhline{5\arrayrulewidth}
\multirow{2}{*}{Total planning time}
& Sec. & 117.05 & 58.69 & 59.68 & 56.45 & 60.21 & 41.07 & \textbf{39.70}
\\\cline{2-9}
& Relative & 100\% & 50.14\% & 50.98\% & 48.22\% & 51.43\% & 35.08\% & \textbf{33.91\%}
\\\Xhline{5\arrayrulewidth}
\multirow{2}{*}{Total state inference time}
& Update time & 73.19 & 72.60 & 65.27 & 65.08 & 72.69 & 60.71 & \textbf{57.62}
\\\cline{2-9}
& Back-sub. time & \textbf{00.24} & 00.25 & 00.28 & 00.31 & 00.24 & 00.25 & 00.26
\\\Xhline{5\arrayrulewidth}
\multirow{2}{*}{Total solution time}
& Sec. & 190.49 & 131.55 & 125.24 & 121.82 & 133.16 & 102.05 & \textbf{97.57}
\\\cline{2-9}
& Relative & 100\% & 69.00\% & 65.74\% & 63.95\% & 69.90\% & 53.57\% & \textbf{51.22\%}
\\\Xhline{5\arrayrulewidth}
\multirow{2}{*}{Fill-in (nnz in the $\bm R$ matrix)}
& before final reordering & \textbf{28842} & \textbf{28842} & 48372 & 50472 & \textbf{28842} & 35029 & 38749
\\\cline{2-9}
& after final reordering & / & 31571 & 62091 & 69376 & \textbf{27662} & 32737 & 40882
\\\hline
\end{tabularx}
\caption{Summary of the accumulated inference and planning times, and final fill-in, as presented in Fig.~\ref{fig:scenario-timing}. Best values in \textbf{bold}.}
\label{tbl:scenario-timing}
\end{table*}
\subsection{Results and Discussion \label{sec:discussion}}
Next, we present and analyze the results of using each ordering tactic to solve the described scenario. Fig.~\ref{fig:scenario-timing-planning} presents the accumulated planning time (update and reordering), using each ordering tactic, throughout the eight planning sessions. Fig.~\ref{fig:scenario-timing-inf} similarly presents the accumulated state inference time (update and back-substitution), using each ordering tactic. Fig.~\ref{fig:scenario-fill-in-per-session} presents the number of non-zero entries in the square root matrix of the current belief, which represents the fill-in of the factorization, in each state-inference session, using each ordering tactic. All the numeric values from these figures are summarized in Table~\ref{tbl:scenario-timing}.
Several conclusions can be made:
first, it is clear to see that using any variation of $\mathtt{PIVOT}$ managed to substantially reduce the planning time in comparison to baseline tactic ($50-66\%$ reduction), as intended. We can also see that the reordering (applying the $\mathtt{PIVOT}$ order) time in each planning session becomes minor, in comparison to the update time, as the state grows. Further, all variations of $\mathtt{PIVOT}$ managed to reduce the state inference time -- verifying our claims in Section~\ref{sec:influence-on-inf} -- and, by such, the total solution time of the scenario ($30-50\%$ reduction). To explain the contribution of $\mathtt{PIVOT}$ to the inference process, in comparison to the baseline tactic, we may recall that with that tactic we pushed forwards the loop closing variables only \emph{after} they were met; \linebreak when applying $\mathtt{PIVOT}$, we pushed forwards (predicted) loop closing variables \emph{before} meeting them, in the preceding planning sessions. This resulted in a more efficient loop closing during state inference compared to the baseline.
More specifically, we can see that each variation of $\mathtt{PIVOT}$ led to different results. Whether examining the per-session or accumulated results, the fill-aware variations of $\mathtt{PIVOT}$ resulted in lower planning time, inference time, and \mbox{fill-in} (number of non-zeros in $\bm R$), in comparison to their "standard" counterparts; the belief reordering time is also lower in the fill-aware variations. Also, while, generally, using $\mathtt{PIVOT}/\mathtt{PIVOT}^*$ led to increase in fill-in, in comparison to the baseline, the fill-aware variants resulted in much lower fill-in, in comparison to their standard counterparts, as expected. These results encourages us to always utilize the $\mathtt{PIVOT}^*$ over $\mathtt{PIVOT}$. In most cases, increasing the number of classes (as determined by the parameter $c$), led to lower planning and inference times; yet, with both $\mathtt{PIVOT}$ and $\mathtt{PIVOT}^*$, this also resulted in increased fill-in. When using only a single $\mathtt{PIVOT}$ class (i.e., $c=1$), we can see that the fill-in was hardly impacted. In fact, by applying $\mathtt{PIVOT}^*_1$ in the final planning session, we even managed to reduce the fill-in below the baseline level. Interestingly, we can see that in the last planning session, the added fill-in induced by $\mathtt{PIVOT}_5$ and $\mathtt{PIVOT}_{\max}$ was so significant, that it actually made the planning cost higher, in comparison to the baseline; this might occur when the number of non-zeros in the affected block (of a candidate update) grows more significantly than the decrease in block size. Fortunately, this is not an issue when considering the fill-aware $\mathtt{PIVOT}^*$ tactics. In fact, it is evident that $\mathtt{PIVOT}^*_{\max}$ achieved the best performance in both planning and inference.
\begin{figure*}[t]
\begin{subfigure}[t]{0.33\textwidth}\hfill
\includegraphics[width=0.75\textwidth]{R_-eps-converted-to}\hspace{20pt}
\caption{Baseline $\bm R$.}
\end{subfigure}
\begin{subfigure}[t]{0.33\textwidth}\center
\includegraphics[width=0.75\textwidth]{R_m_-eps-converted-to}
\caption{$\bm R$ after the applying $\mathtt{PIVOT}_{\max}$.}
\end{subfigure}
\begin{subfigure}[t]{0.33\textwidth}
\hspace{20pt}\includegraphics[width=0.75\textwidth]{R_m_f_-eps-converted-to}
\caption{$\bm R$ after the applying $\mathtt{PIVOT}^*_{\max}$.}
\end{subfigure}
\caption{A comparison of the sparsity pattern of three variants of the agent's square root matrix $\bm R$, at the final planning session.}
\label{fig:scenario-fill-in}
\end{figure*}
We may also notice that the added fill-in led to a slight increase in the back-substitution time during the inference sessions; yet, the cost of this step is insignificant in relation to the update cost. As mentioned, Fig.~\ref{fig:scenario-fill-in} shows the difference in fill-in in three variations of the square root matrix, at the final planning session: the baseline, after the applying $\mathtt{PIVOT}_{\max}$, and $\mathtt{PIVOT}^*_{\max}$.
We can see that between planning sessions $3$ and $4$, which were seprated by numerous state inference sessions, the fill-in induced by the $\mathtt{PIVOT}$ variants decreased back to the baseline level. It appears that the incremental reordering that takes place in those inference sessions has gradually "canceled out" the $\mathtt{PIVOT}$ constraints, and realigned the order back to the baseline. In contrast, in the latter planning sessions, which occurred more frequently in between the inference sessions, we can see that the fill-in accumulated. Overall, we may conclude that frequent re-planning, and/or a higher number of classes, can amplify both $\mathtt{PIVOT}$'s disadvantages (relative added fill-in), and benefits (relative reduction in computation time).
As mentioned, we chose to maintain the $\mathtt{PIVOT}$ order(s) after every planning session. Although we saw this can indeed help reducing the state inference cost, if we wanted, we could also revert back to the original variable order after each planning session. That way, the state inference process (and the fill-in in $\bm R$) would not influenced by $\mathtt{PIVOT}$. Potentially, we can also analyze the fill-in in the affected block of the selected action, to verify that the state inference is indeed expected to improve by keeping the $\mathtt{PIVOT}$ order, before making such decision.
Surely, the improvement in planning time tightly depends on the number of candidates, the belief's topology, and the size of the state; the improvement in total solution time is also a parameter of the planning to inference session ratio. Nonetheless, these results encourages us to utilize $\mathtt{PIVOT}$ in the solution of high-dimensional planning problems.
| {'timestamp': '2021-12-30T02:22:11', 'yymm': '2112', 'arxiv_id': '2112.14428', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14428'} | arxiv |
\section{Introduction}\label{sec:intro}
A questionnaire is called \emph{adaptive} when its question sequence is dynamically driven by the answers of the taker. The typical goal is to optimally estimate an aspect of interest of the test taker described by a set of target variables (e.g., his/her skills) while also reducing as much as possible the number of questions.
Algorithm~\ref{alg:ta} depicts a standard workflow for adaptive questionnaires. The best question ($Q^*$) to ask in a particular stage of the questionnaire is picked from an item pool ($\bm{Q}$) by a function (${\tt Pick}$) of the previous answers ($\bm{e}$). The answer of the test taker ($\sigma$) is consequently collected (${\tt Answer}$) and the process iterated unless some (${\tt Stopping}$) condition, still based on the previous answers, is achieved. Finally a function (${\tt Evaluate}$) returns a grade based on all the answers collected before the end of the questionnaire.
\begin{algorithm}[htp!]
\begin{algorithmic}[1]
\STATE $\bm{e}\gets\emptyset$
\WHILE{ {\bf not} $\tt{Stopping}(\bm{e})$}
\STATE $Q^* \gets {\tt{Pick}}(\bm{Q},\bm{e})$
\STATE $q^* \gets {\tt{Answer}}(Q^*,\sigma)$
\STATE $\bm{e} \gets \bm{e} \cup \{ Q^*=q^* \}$
\STATE $\bm{Q} \gets \bm{Q} \setminus \{ Q^*\}$
\ENDWHILE
\STATE {\bf return} $\tt{Evaluate}(\bm{e})$
\end{algorithmic}
\caption{Adaptive questionnaire workflow: given student $\sigma$ and item pool $\bm{Q}$, a grade based on answers $\bm{e}$ is returned.\label{alg:ta}}
\end{algorithm}
Trading off accuracy and the number of questions is the typical challenge with real adaptive systems. Algorithms to drive the selection mechanism are extremely important to improve the quality and the reliability of the evaluation process in modern interactions with users. This has to be supported by flexible interfaces able to provide such adaptiveness and interact with portable implementations of the above algorithms.
An important field of application of adaptive questionnaires is education, where they can be used both for training and assessment. In classical assessment tests, tools to achieve some form of adaptiveness by simple deterministic rules have been considered \cite{devellis2006classical}. More successful results can be achieved by the latent modelling of the skill level of the taker \cite{courville2004empirical}.
\emph{Item response theory} (IRT) is the most popular approach of this kind \cite{embretson2013item}. The probability of a correct answer is described by a logistic model with a small number of parameters. Under standard independence assumptions, this allows for a simple updating process, thus making also very easy the implementation of adaptive strategies. As a matter of fact, implementing IRT, but also more sophisticated techniques, such as the Rasch model \cite{brinkhuis2020dynamic}, in a computer system is relatively straightforward and a huge number of tools for e-learning tools currently embed these algorithms.\footnote{E.g., {\tt\href{http://www.concertoplatform.com}{concertoplatform.com}}.}
Despite its popularity and advantages at the implementation level, IRT might be unable to properly cope with questionnaires aiming to evaluate multiple target variables in the same moment \cite{millan2000using}. The IRT independence assumptions in those cases might be unrealistic, and the model consequently performs poorly. In order to overcome these weaknesses, other formalisms have been considered. Among them, Bayesian networks (BNs, \cite{koller2009}) emerged as a sensible choice able to guarantee an accurate selection of the items \cite{vomlel2004bayesian}, but also a good explainability of the actions \cite{almond2015bayesian}.
However, in spite of a huge amount of adaptive tools based on IRT, BNs are much less used in this area. To the best of our knowledge, the software we are presenting, called ADAPQUEST\footnote{See {\tt\href{http://www.github.com/IDSIA/adapquest}{github.com/IDSIA/adapquest}}.} is the first mature contribution of this kind.
We see two possible explanations for such situation. First, although BN inference is nowadays a standard technique, the number of freely available libraries for this task is limited and their embedding in other software projects might be not smooth, while an implementation from scratch would require dedicated efforts not always compatible with an application project. Second, the number of parameters to be tuned for a BN approach might be large and typically higher than those needed for IRT. As the target variables are often regarded as latent variables, learning them from data might not be possible (see \cite{plajner2020monotonicity} for dedicated data approaches) and elicitation techniques should be considered instead. This might be time consuming and also complicated for practitioners not confident with probabilistic graphical models, thus preventing a widespread diffusion of those flexible approaches.
Such situation motivated us to present ADAPQUEST, as a new freely available Java software tool embedding BN inference and modelling features implemented for the design of adaptive tests and their practical implementation through web interfaces. ADAPQUEST supports state-of-the-art techniques for both the elicitation process, intended to make as simple and as smooth as possible such elicitation process, and the adaptive selection of the items intended to guarantee the necessary explainability of the process \cite{antonucci2021}. The tool is directly built on the top of a recently developed library for probabilistic graphical models, that takes care of the necessary inference tasks \cite{huber2020a}.
The paper is organised as follows. In Section \ref{sec:bn} we discuss the basic ideas of adaptive testing based on BNs and the tools used for explainability and elicitation. In Section \ref{sec:sw} we give some technical information related to the development of ADAPQUEST. In Section \ref{sec:app} we consider a case study, already implemented in ADAPQUEST, and freely available to the community as a demonstrative project. A discussion about possible outlooks concludes the paper in Section \ref{sec:conc}.
\section{Adaptive Questionnaires by Bayesian Nets}\label{sec:bn}
Bayesian networks (BNs) \cite{koller2009} are a popular class of probabilistic graphical models designed for a compact specification of joint, generative, probability distributions. To implement adaptive questionnaires with BNs we regard the set of \emph{skills} to be evaluated during the questionnaire as a joint variable $\bm{S}$, and we similarly regard the item pool $\bm{Q}$ as a set of variables. Here we only consider discrete variables. The BN uses a directed acyclic graph over these variables as a model of the conditional independence relations among them. This allows for a compact specification of the distribution $P(\bm{S},\bm{Q})$. Given such a generative model, standard algorithms for BNs can be used to answer queries about the model variables. E.g., $P(\bm{S}|\bm{e})$ is the posterior probability for the skills given the answers $\bm{e}$ to the questions in $\bm{Q}$ properly asked to the taker. This distribution can be used to grade the taker at the end of the questionnaire, but also to decide whether or not to keep asking questions. For the latter task information-theoretic measures, such as the entropy $H(\bm{S}|\bm{e})$ of the posterior distribution over the skills given the answers received so far, are used and we typically stop the questionnaire when this entropy level goes below a threshold $H^*$. The selection of the optimal question to ask to the taker is slightly more involved: as the actual answer to a candidate question $Q$ is not known, expectation obtained by a weighted average over the probability for the possible answers (i.e., the conditional entropy $H(\bm{S}|Q,\bm{e})$) should be considered instead. To detect the optimal question we maximize the \emph{information gain}, i.e., the difference between the current entropy and the conditional one for the candidate question. Algorithm \ref{alg:bnta} depicts a typical workflow for BNs. The final grade is also an expectation, based on the posterior distribution of a function $f$ able to precisely grade the taker when no uncertainty about the skills is present.
\begin{algorithm}[htp!]
\begin{algorithmic}[1]
\STATE $\bm{e}=\emptyset$
\WHILE{$H(\bm{S}|\bm{e}) > H^*$}
\STATE $Q^* \gets \arg\max_{Q \in \bm{Q}} \left[ H(\bm{S}|\bm{e})-H(\bm{S}|Q,\bm{e}) \right]$
\STATE $q^* \gets {\tt{Answer}}(Q^*,\bm{s}_\sigma)$
\STATE $\bm{e} \gets \bm{e} \cup \{ Q^*=q^* \}$
\STATE $\bm{Q} \gets \bm{Q} \setminus \{ Q^*\}$
\ENDWHILE
\STATE {\bf return} $\mathbb{E}_{P(\bm{S}|\bm{e})}[f(\bm{S})]$
\end{algorithmic}
\caption{Adaptive questionnaire workflow based on a BN over the questions $\bm{Q}$ and the skills $\bm{S}$: given the taker profile $\bm{s}_\sigma$, the algorithm returns an evaluation corresponding to the expectation of an evaluation function $f$ with respect to the posterior for the skills given the answers $\bm{e}$.\label{alg:bnta}}
\end{algorithm}
The procedure is extremely easy to achieve, provided that a reliable BN inference engine to compute $P(\bm{S}|\bm{e})$ and $P(Q|\bm{e})$ is available. In terms of explainability the model offers high transparency: the numerical values leading to a particular question selection, to the stopping condition and to a grade might be reported online during the test execution. Moreover, the techniques recently proposed in \cite{antonucci2021} allow to associate with such quantitative information the modal state of the variables, this providing a qualitative summary of the different actions.
\begin{figure}[htp!]
\centering
\begin{tikzpicture}[scale=1]
\node[nodo] (s1) at (0,1) {$S_1$};
\node[nodo] (s2) at (2,1) {$S_2$};
\node[nodo] (s3) at (4,1) {$S_3$};
\node[Qnodo] (q1) at (-1,0) {$Q_1$};
\node[Qnodo] (q2) at (1,0) {$Q_2$};
\node[Qnodo] (q3) at (3,0) {$Q_3$};
\node[Qnodo] (q4) at (5,0) {$Q_4$};
\draw[arco] (s1) -- (s2);
\draw[arco] (s1) -- (q1);
\draw[arco] (s1) -- (q2);
\draw[arco] (s2) -- (q2);
\draw[arco] (s2) -- (q3);
\draw[arco] (s3) -- (q4);
\end{tikzpicture}
\caption{BN for questionnaires with three skills and four questions.}
\label{fig:minicat}
\end{figure}
The only critical part of such workflow is the learning of the BN structure and its parameters. In principle, given a data set of observations for $\bm{S}$ and $\bm{Q}$, standard statistical learning techniques could be used. This typically requires complete data, but algorithms to cope with partially incomplete data are also available. Yet, the skills $\bm{S}$ are typically represented by latent variables and their observations unavailable. This particular situation when modelling adaptive questionnaires have been investigated, and specialised learning techniques have been developed (e.g., see \cite{plajner2020monotonicity}).
In ADAPQUEST, we assume the design of the questions and the quantification of the BN to take place in the same time. Thus, when no complete data are available, we assume the quantification process to be based on an elicitation process from a domain expert (e.g., the instructor). Regarding the structure, the natural interpretability of the directed graph underlying a BN makes this task simple: first a graph over $\bm{S}$ is elicited in order to reflect the dependencies between the skills (e.g., in Figure \ref{fig:minicat}, the first two skills are connected and hence dependent, while the third is independent from the first two). Regarding the questions, as we assume them to correspond to the children of the skills, the only effort is to identify the skills relevant to properly answer a particular question.
Once this qualitative part has been achieved, the quantification of the parameters in a BN corresponds to assessing probabilities for single nodes/variables given all the values of the parents. Typical questions are about the probability of a correct answer if the taker has the necessary skills. Or the probability of having skill $S_2$ while not having $S_1$, and so on.
Alternative parametrisations has been proposed to make such elicitation easier \cite{antonucci2021}. Consider for instance a Boolean skill $S$ and a Boolean question $Q$. Two probabilities such as $p:=P(q|s)$ and $p':=P(q|\neg s)$ corresponding to the probability of a correct answer given that the taker has or has not the skill are sufficient to quantify the relation. A possibly simpler parametrisation is provided by $\delta:=p-p'$ and $\gamma:=1-\frac{p+p'}{2}$, the two numbers being still normalised between zero and one and giving the discriminative power of the question and its difficulty. These parameters can be extended to the general case, and make faster and easier the elicitation efforts when adding new items to the pool.
\section{The ADAPQUEST Software}\label{sec:sw}
ADAPQUEST is a REST micro-service written in Java using the Spring Boot framework.\footnote{\href{https://spring.io/projects/spring-boot}{See \tt spring.io/projects/spring-boot}.}
The structure is extremely flexible and the configuration of a new survey/test can be done via API, via code, or by using simple JSON files. If needed, the tool can also connect to an already configured and compatible database where the item pool and the model are stored. The simple hierarchy of classes and a state-of-the-art architecture allows the system to be easily expanded with new features and adaptive criteria to cover further explorations on the field.
From a developer point of view, each questionnaire/survey is composed by three parts: (i) a BN model used to perform inference in order to find the next best question based on the history of given answers as in Algorithm \ref{alg:bnta}; (ii) a pool of questions, associated with their BN nodes; (iii) and an highly configurable part that act on the adaptive engine. The BN inferences are based on the CreMA library \cite{huber2020a}.
The tool is intended to be a back-end service that needs a custom front-end web-application to show the questions. Yet, a demonstrative web interface is already available. This can be used to test the functioning of the tool itself, of new models, and the questions flow. An exchange library can be used to query and manage a remote tool from a client, allowing standard CRUD operations on the surveys and the stored answers. This also allows to integrate the tool as a library inside other projects and easily interact with it. This is especially important when running extensive simulations.
\section{A Case Study on Mental Disorder Diagnosis}\label{sec:app}
Finally, let us present a case study involving the practical use of ADAPQUEST in the development of a survey. The code for the specification of the model used for that is freely available in the ADAPQUEST repository and can be used as a guidance for the development of new applications within this framework. Although here the focus is on a survey, the implementation of a test would be identical. We refer the reader to \cite{mangili2017b} for an educational application whose items cannot be disclosed for the sake of confidentiality.
Following the empirical evidence corroborating the relation between job quality and mental health \cite{bracci2020perceived}, ADAPQUEST was applied to the development of a questionnaire for the early detection of employees at risk of mental health problems. Data for the development of the model were taken from the Swiss Household Panel (SHP) \cite{tillmann2016swiss}. The association between job quality and health being the focus of the questionnaire, mostly job related questions were selected from the panel. General demographic information (e.g., age, region, education, etc.) and questions about the current perceived mental states (e.g., self assessed degree of anger, happiness, etc. on a scale from 0 to 10) were also included. Overall, the questions database contains 48 questions based on which the risk of developing a stated of distress, experiencing lack of happiness or running into psychological disorders within one year are estimated. Those three events of interest are described by the binary variables \textit{distress}, \textit{lack}, \textit{disorder}.
The BN model used in the adaptive questionnaire is based on a naive Bayes classifier \cite{koller2009}, the classes being represented by the joint state of the three variables \textit{distress}, \textit{lack} and \textit{disorder}, which is described by a single node called \textit{target}. After collecting a sufficient number of answers, the system computes from the posterior probabilities of the \textit{target} node the marginal probabilities of the three health-related variables being true. Such probabilities are taken as a measure of risk for the mental well-being of the test taker. The naive Bayes model adopts the questionable assumption of independence of the question nodes given the target node, however, the predictive performance of that model exceeded that of more complex networks. Namely, with a 10-fold cross validation over the SHP data set (including 57422 instances) we estimated an AUC of 0.78 (standard deviation = 0.01) 0.88 (s.d. = 0.01) and 0.78 (s.d. = 0.03), for the \textit{distress}, \textit{lack} and \textit{disorder} variables, respectively.
\section{Conclusions and Outlooks}\label{sec:conc}
We presented a new software tool for the design and implementation of adaptive questionnaires and surveys based on Bayesian networks. The tool is freely available to the community. As a necessary future work we intend to support \emph{credal} networks \cite{piatti2010a} for the design of adaptive questionnaires. This can be based on the ideas outlined in \cite{mangili2017b} and later extended by \cite{antonucci2021}. This would allow to support interval-valued elicitation, thus providing higher realism in the modelling step.
\newpage
\section*{Acknowledgments} {The case study has been realised using the data collected by the SHP, which is based at the Swiss Centre of Expertise in the Social Sciences FORS. The project is financed by the Swiss National Science Foundation}
\bibliographystyle{named}
| {'timestamp': '2021-12-30T02:24:05', 'yymm': '2112', 'arxiv_id': '2112.14476', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14476'} | arxiv |
\section{Introduction}
Fault seeding techniques, such as mutation testing, are extensively used in controlled studies to evaluate and compare testing techniques \cite{PapadakisK00TH19, PapadakisHHJT16}. These techniques allow researchers to seed faults under experimentally controlled conditions and thus perform reproducible test assessments. In a sense by comparing the number of seeded faults revealed by test methods, researchers can form a proxy metric that approximates the fault revealing potential of the performed testing \cite{PapadakisSYB18, JustJIEHF14, AndrewsBL05}.
Although popular, such techniques have been criticised for producing unrealistic faults \cite{SemSeed, tufano2019learning, Wild_Caught, mutations_how_close_are_they_to_bugs}, i.e., faults that are significantly different from real ones in terms of syntax \cite{mutations_how_close_are_they_to_bugs}, and as a result numerous propositions have been made claiming to produce seeded faults that are syntactically similar to real ones. The most recent research in particular, motivated by the code naturalness hypothesis \cite{HindleBSGD12}\footnote{Naturalness hypothesis states that programs exhibit properties similar to text and thus, natural language process techniques can be used to support code analysis techniques.}, aims at forming realistic faults that are, in fact, artificial faults that have some form of syntactic similarity to real ones, i.e., usually following particular syntactic fault patterns. We call this line of work as \textit{fault mimicking} approaches.
Table \ref{tbl:Related} lists a set of recent fault mimicking techniques that aim at generating (syntactically) realistic faults. By inspecting the table it becomes evident that the key objective of these techniques is to improve the realism of fault-seeding, which is defined and evaluated by some form of syntactic distance (number of tokens changed, Bleu score, etc.) from real faults. While such approaches may indeed succeed to generate some exact matches of real faults, they have never been evaluated with respect to their semantics and particularly their utility as fault-based testing techniques \cite{PapadakisK00TH19}, in a sense the typical use case of mutation testing \cite{demillo1978, PapadakisK00TH19}.
Mutation testing has long been based on the basis that fault seeding should be based on untargeted program syntactic changes \cite{offut1992, Offutt:Mutation:2001}. These changes are defined using the programming language grammar and are completely unaware of any fault semantics. The key assumption here is that simple syntactic changes result in semantic deviations that subsume the faulty ones \cite{offut1992}, meaning that test cases revealing these faults are also capable of revealing real faults \cite{ChekamPTH17}. Therefore, the aim of mutation testing is different from the one followed by fault mimicking techniques.
The key strategy followed by fault mimicking is to identify program locations where fault opportunities emerge and perform relevant changes, following a pattern observed in some fault instances, that alter the program behaviors similarly to real faults. This implies an underlying assumption that \textit{seeding faults with frequent syntactic fault patterns that have similarities with a real fault will result in faults that are subtle or semantically similar to real ones}. Similarly, another assumption is that \textit{seeding faults that are syntactically dissimilar to real ones results in unrealistic faulty semantics}, i.e., the seeded fault semantics are quite different from those of real faults.
These assumptions may appear intuitive but have absence of evidence, except of course from the case where seeded faults match exactly real ones. Early research on the coupling effect \cite{offut1992} stated that ``simple faults can cascade or couple to form other emergent faults'', implying that fault instances couple independent of their pattern. Additionally, recent studies report large semantic overlaps between simple and complex faults \cite{PapadakisHHJT16, KurtzAODKG16, jia2009}, questioning on the role of the syntactic-based metrics.
This raises the question of whether syntactically similar, or dissimilar, faults are also semantically similar, or dissimilar. More generally, a question of whether the use of such techniques results in faults that: \textit{a) are semantically similar to real faults, b) resemble (semantically) more faults than the dissimilar ones, and c) are subsumed by simple untargeted syntactic deviations as done by mutation testing, i.e., bring any useful addition to mutation testing}.
We answer the above questions by employing four fundamentally different fault-seeding techniques. These include PiTest \cite{ColesLHPV16}, a popular mutation testing tool \cite{KintisPPVMT18}, that uses simple syntactic patterns, IBIR \cite{khanfir2020ibir}, a mutation testing tool with manually crafted fault patterns, DeepMutation \cite{DeepMutation}, a deep learning-based tool that derives patterns from real bug-fixes \cite{tufano2019learning}, and CodeBERT \cite{DBLP:conf/emnlp/FengGTDFGS0LJZ20}, a newly designed mutation testing tool that uses a pre-trained language model capable of making token replacement based on big code learning, i.e., code embeddings. Hence, we investigate the ability of all faults produced by these techniques to form similar semantic deviations as the Defects4J V2 faults \cite{defects4j} and check their potential utility within mutation testing.
Perhaps surprising, our results show that syntactic similarity does not reflect semantic similarity indicating that syntactic distance should not be used as an evaluation metric in the context of mutation testing. Additionally, our results show that 60\%, 47\%, 43\% and 7\% of the real faults of Defects4J V2 can be semantically resembled by CodeBERT, PiTest, IBIR and DeepMutation faults, respectively, indicating that fault mimicking, i.e., IBIR and DeepMutation, approaches are significantly outperformed by syntactic-based fault seeding ones, i.e., CodeBERT and PiTest. To further demonstrate this difference, we also perform an objective comparison between the techniques and show that CodeBERT and PiTest have similar fault detection capabilities that subsume IBIR and DeepMutation. We also compare the techniques in an cost-effective way (by controlling test size) and show that when selecting few test cases, IBIR is the best cost-effective solution, followed by CodeBERT and PiTest. DeepMutation is outperformed by the other techniques. In contrast, when selecting sufficient tests to kill more mutants, the fault detection of PiTest and CodeBERT is increasing and reaches 54\% and 53\% (while IBIR and DeepMutaiton reaches 37\% and 7\%).
Overall, our work aims at raising the awareness over the use of non-semantic metrics in fault seeding studies and in providing evidence related to the utility of recent fault seeding advances in software testing. We also
provide evidence that fault coupling makes syntactically dissimilar faults to be useful in software testing.
In summary, our key contributions are the following:
\begin{itemize}
\item We perform the first study on comparing syntactic and semantic similarity of artificial and real faults and found no link between these two metrics.
\item We propose a new fault seeding technique based on a state-of-the-art pre-trained language model, CodeBERT, and show its ability to semantically resemble real faults.
\item We show that IBIR is the most cost-effective technique but subsumed by PiTest in almost all cases when not considering cost. We also find that CodeBERT faults can complement the fault set of PiTest, motivating research that exploits the link between mutation testing and code embeddings, and that DeepMutation is almost subsumed by the other techniques.
\end{itemize}
\begin{table}[]
\vspace{-0.8em}
\centering
\caption{Fault Mimicking Techniques}
\vspace{-1.1em}
\begin{tabular}{p{.107\textwidth}p{.2\textwidth}p{.11\textwidth}}
\toprule
\textbf{\scriptsize{Approach}} & \textbf{\scriptsize{Aim}} & \textbf{\scriptsize{Evaluation metric}}\\
\midrule
\scriptsize{SemSeed: Token Embeddings\cite{SemSeed}} & \scriptsize{Derive syntactic patterns that are syntactically similar to real faults} & \scriptsize{Exact syntactic match}\\
\scriptsize{DeepMutation: Learning-based Mutations\cite{DeepMutation}} & \scriptsize{Produce mutants syntactically similar to real faults} & \scriptsize{Syntactic distance from real faults} \\
\scriptsize{Learning-based Mutations\cite{tufano2019learning}} & \scriptsize{Derive syntactic patterns from bug-fixes} & \scriptsize{Syntactic distance from real faults} \\
\scriptsize{Wild-Caught Mutations\cite{Wild_Caught}} & \scriptsize{Deriving simple syntactic patterns from bug-fixes} & \scriptsize{Token similarity, Compilability} \\
\scriptsize{Mutation Monkey\cite{Mutation_Monkey}} & \scriptsize{Deriving common fault syntactic patterns} & \scriptsize{Detection Ratio} \\
\scriptsize{Analysis of real faults and mutants \cite{mutations_how_close_are_they_to_bugs}} & \scriptsize{Syntactic similarities of bug-fixes and mutants} & \scriptsize{Number of tokens changed} \\
\bottomrule
\end{tabular}
\vspace{-1.1em}
\label{tbl:Related}
\end{table}
\input{sections/background.tex}
\input{sections/motivating_example.tex}
\input{sections/research_questions.tex}
\input{sections/tools.tex}
\input{sections/experimental_setup.tex}
\input{sections/empirical_evaluation.tex}
\input{sections/discussion.tex}
\section{Related Work}
Fault seeding and particularly mutation testing, is widely used in experimental studies as a way to compare and assess testing techniques \cite{PapadakisK00TH19}. Assuming that seeded faults include properties that are in some sense similar to real ones \cite{AndrewsBL05}. Interestingly, mutation testing, one of the most widely used techniques \cite{PapadakisK00TH19}, introduces faults that are syntactically simple and are quite different from real faults that are in their majority more complex \cite{mutations_how_close_are_they_to_bugs}. In particular, the study of Gopinath et al. \cite{mutations_how_close_are_they_to_bugs} provided empirical evidence showing the misalignment between seeded and real faults that are produced by traditional mutation operators and concluded that real faults are rarely equivalent to mutant-faults.
To deal with this issue, Brown et al. \cite{Wild_Caught} proposed inferring fault seeding patterns, mutation operators, by using historical fault-fixing commits. The idea was to form (syntactic) fault patterns that resemble (in terms of syntax) real historical faults. Their results show that syntactic fault patterns can be mined from code versioning systems, and these differ (syntactically) from those used by modern mutation testing tools.
DeepMutation \cite{DeepMutation}, a neural machine translation technique \cite{tufano2019learning} that automatically infers fault patterns from historical fault-fixing commits, was proposed. It was shown that DeepMutation resembles exact matches of 45\% of real faulty cases while achieving relatively good syntactic similarity scores in most of the cases. SemSeed \cite{SemSeed} aims at inferring faulty patterns from bug-fixes and attempts to generalize them by appropriately adapting them to the particular local code, i.e., context. Although powerful, SemSeed operators on JavaScript programs making its application in our experiment hard.
More recently, mutation monkey \cite{Mutation_Monkey} was built by mining frequently occurring faults from complex changes that caused operational issues at Facebook \cite{Mutation_Monkey}. The analysis of these faults indicated that they were good at finding holes and missing tests in the systems under test.
Interestingly, the above studies aim at mimicking (syntactically) real faults, and as a result, they have been evaluated with ``static'' syntactic-nature metrics such as the syntactic similarity. Hence, raising the question of whether they are suitable for dynamic analysis, such as mutation testing, i.e., incorporating realistic semantic fault properties, and how they compare with traditional mutation testing, which we investigate here.
Traditionally mutation testing aims at seeding faults using simple syntactic changes. Showing empirical evidence of the coupling effect, \cite{demillo1978} states that simple faults subsume almost all the complex ones \cite{offut1992}. This implies a more general assumption about the ''size'' of faults \cite{OffuttH96}, suggesting that seeded faults with small syntactic distance from the original program introduce small semantic deviations (subtle faults), which form valuable test requirements \cite{ChekamPCT21} and lead to high fault reveling potential \cite{PapadakisCT18}.
The coupling between seeded faults has also been considered as a source of bias in mutation testing studies as it introduces large overlaps between the seeded fault instances \cite{jia2009, KurtzAODKG16, PapadakisHHJT16}. Nevertheless, the question of how to select optimal mutant-fault sets falls outside the scope of this work.
\section{Conclusion}
We investigated the link between syntactic and semantic similarity of seed and real faults in the context of mutation testing. Our results showed that many seeded faults behave similarly to real ones (they have high semantic similarity), while at the same time having low syntactic similarity (to real faults). This means that we found no evidence suggesting any link between syntactic and semantic similarity, except of course from the case of exact matches.
We also found that CodeBERT can complement PiTest, i.e., the joint use of PiTest and CodeBERT resulted in 25\% more subsuming mutants than PiTest alone, and that IBIR forms the most cost-effective technique. Interestingly, the ability of CodeBERT indicates a potentially new direction for mutation testing research, one that exploits the link between mutation testing and code embedding.
\bibliographystyle{ACM-Reference-Format}
\section{Fault Seeding}
\label{mutation_testing_tools}
We employ the following fault seeding techniques:
\begin{itemize}[leftmargin=5.5mm]
\item PiTest~\cite{ColesLHPV16} a mutation testing technique that uses simple grammar-based transformations for seeding faults.
\item IBIR~\cite{khanfir2020ibir} a fault mimicking technique that attempts to seed faults using manually crafted fault patterns (based on fault analysis of common fault instances).
\item DeepMutation~\cite{DeepMutation} a fault mimicking technique that learns to seed faults based on bug-fixes, i.e., it learns inverted bug-fixes.
\item CodeBERT, a mutation testing technique that we develop. CodeBERT seeds ``natural'' faults by replacing tokens based on code embeddings~\cite{DBLP:conf/emnlp/FengGTDFGS0LJZ20}
CodeBERT seeds faults that follow the implicit programming norms of programs captured by big code.
\end{itemize}
\subsection{PiTest}
PiTest~\cite{ColesLHPV16} is a state-of-the-art mutation testing tool for Java. It seeds faults by manipulating the bytecode of programs in order to
avoid mutant compilation and reduce mutant generation overheads.
PiTest works by analyzing entire bytecode sequences and by looking for a possible location, i.e., instruction, to seed faults.
Mutants Operators are designed to be stable and categorized into 29 task-specific distinct groups. Hence, an example of groups is Conditionals Boundary and Return Values mutators, which seed variations concerning relational operators and method call return values. PiTest provides over 120 Mutant Operators, among which are many experimental mutants used for scientific purposes. For this study, we take into consideration ALL mutants that PiTest offers.
Every mutant is uniquely identified, providing sufficient information to replicate the bytecode transformation to compute syntactic and semantic similarity scores. We employ ASM Java bytecode instrumentation API for this purpose.
\subsection{IBIR}
IBIR~\cite{khanfir2020ibir} is a Java fault seeding tool that leverages an information-retrieval-based fault localization model (IRFL) combined with automatic program repair (APR) inverted fix-patterns. It aims to favour the generation of few but realistic mutants (similar to real ones). It takes as input the git repository of the program to mutate and a bug report of this latter, written in natural language. It then seeds multiple faults (inducing multiple faulty versions of the program) that emulates the fault described in the inputted bug report.
IBIR starts by analysing the given bug report using IRFL ~\cite{ZhouZL12} to identify locations that are likely to be related to the features impacted by the corresponding fault.
Second, IBIR applies fault-patterns on the identified locations, which are inverted fix-patterns used in pattern-based automated program repair approaches~\cite{khanfir2020ibir}. As the fix-patterns are crafted from real bug-fixes, their inverse would induce faults similar to real faults.
IBIR repeats this process until all location-pattern pairs have been treated, or a predefined number of faults is reached, which is set to 100 by default. In this study we passed to its provided filtering parameter, the classes changed by the bug-fix on defects4j to exclude the mutants from other classes, and we run it with the rest of its setup, as default.
\subsection{DeepMutation}
\emph{DeepMutation}~\cite{DeepMutation} generates mutants using a Neural Machine Translation (NMT) \cite{tufano2019learning} trained on a large corpus ($\sim$787k) of existing bug-fixing commits mined from GitHub repositories.
It takes as input a Java class file and starts by extracting the methods to mutate.
Then, it applies an abstraction process to each method (i.e., user-defined names are replaced by learnable identifiers) to obtain an abstracted representation for each method (like the one shown in Section~\ref{sec:motivating-example}). These are then fed into the pre-trained NMT model to produce abstract mutations translated back to source code.
We followed the guidelines provided by the DeepMutation tool~\cite{deepmutationweb}, but unfortunately we could not install and run the provided implementation of DeepMutation. We thus, reproduced it by using the publicly available pre-trained model and \texttt{src2abs}~\cite{src2abs} tool to abstract and translate back to source code the mutants. We generate one mutant per method as done by DeepMutation~\cite{DeepMutation}.
\subsection{CodeBERT based Mutation}
\emph{CodeBERT}~\cite{codebertweb,DBLP:conf/emnlp/FengGTDFGS0LJZ20} is a pre-trained language model for programming languages, recently released by Microsoft Research.
It was pre-trained on around 6.4 million programs from 6 different programming languages, including Java. It supports a variety of tasks, such as natural language code search and code documentation generation, but we are only using the Masked Language Modeling (MLM) task. MLM takes as input a text sequence from which there is 1 masked token, which it attempts to predict (replace). For instance, given the masked sequence \texttt{int a = <mask>;}, CodeBERT predicts that \texttt{0}, \texttt{1}, \texttt{b}, \texttt{2}, and \texttt{10} are the (five) most likely tokens to replace the masked one (ordered in descending order according to their score -- likelihood).
We use CodeBERT to generate mutants by selecting tokens to mask and replacing them with the predicted tokens. Specifically, we develop a mutant generation tool, based on CodeBERT's predictions, that iterates on each statement and repeats the following process: (1) it selects and masks one token at a time, depending on the type of expression being analysed; (2) it feeds CodeBERT with the masked sequence and obtains the predictions; (3) it creates mutants by replacing the masked token with the predicted ones; and (4) it discards non-compilable and duplicate mutants (mutants syntactically the equal to original code).
CodeBERT uses multi-layer bidirectional Transformer~\cite{VaswaniSPULALP2017}, meaning that the predictions are context-dependent, which result in different mutants when masking the same variable in different program locations.
Our implementation applies to a wide variety of Java expressions, being able to mutate operands and operators of unary/binary expressions, assignment statements, literals, variable names, method calls, object field accesses, among others. This indicates that for the same program location, several mutants can be generated. For instance, for a binary expression like \texttt{a == b}, our tool will create (potentially 15) mutants from the following 3 masked sequences: \texttt{<mask> == b}, \texttt{a <mask> b}, and \texttt{a == <mask>}.
We feed a sequence of 512 tokens to CodeBERT (maximum sequence length supported) that includes the masked token and its context.
\section{Motivating example}
\label{sec:motivating-example}
We demonstrate the potential differences between syntactic and semantic deviations in fault seeding by using an example from the work of Tufano et al.~\cite{tufano2019learning}. Consider the following example\footnote{this example was taken from \cite[Figure~2]{tufano2019learning} and demonstrates a successful case where the fault seeded by Tufano et al. matches exactly a real fault.}:
\begin{lstlisting}
//Original (abstracted) code in abstract representation (representation used by Tufano et al.)
public TYPE_1 remove ( int index ) {
TYPE_2 < TYPE_1 > VAR_1 = this . VAR_2 . remove ( index ) ;
return null != VAR_1 ? VAR_1 . get ( ) : null ; }
\end{lstlisting}
In this example, the \texttt{remove} method first accesses one of the attributes of the invoking object (\texttt{this.VAR\_2}) and invokes recursively the method \texttt{remove}, saving the result in variable \texttt{VAR\_1}. Then, it returns \texttt{null} in the case that \texttt{VAR\_1} was \texttt{null}, otherwise it returns the result of invoking \texttt{VAR\_1.get()}. Tufano et al. seeds a fault that resembles exactly the real faulty instance, which is the following:
\begin{lstlisting}
//Successful fault seeding with Tufano et al. (the fault resembles exactly the real fault)
public TYPE_1 remove ( int index ) {
return this . VAR_2 . remove ( index ) . get ( ) ; }
\end{lstlisting}
The fault is caused because of the conditional check that is skipped and is indeed resembling a real fault made by developers~\cite{tufano2019learning}. In particular the fault regards the checking of whether the result of the recursive call returns \texttt{null} or not that is ignored.
Consider now a particular fault seeded by ``traditional'' mutation testing, using simple syntactic changes (e.g., generated by the REMOVE\_CONDITIONALS \footnote{https://pitest.org/quickstart/mutators/\#REMOVE\_CONDITIONALS} operator from PiTest~\cite{ColesLHPV16}):
\begin{lstlisting}
//Fault seeded using mutation testing, simple syntax-based mutation
public TYPE_1 remove ( int index ) {
TYPE_2 < TYPE_1 > VAR_1 = this . VAR_2 . remove ( index ) ;
return true ? VAR_1 . get ( ) : null ; }
\end{lstlisting}
This mutant replaces the condition \texttt{null != VAR\_1} by \texttt{true}, making the guarded statements (i.e. \texttt{VAR\_1.get()}) to be executed irrespective of the condition (actually it is always executed).
Interestingly, by comparing the two faulty instances one can easily observe that they are syntactically different despite being semantically equivalent. One can also observe that a simple syntactic transformation, such as the one used by mutation testing perfectly matches the complex transformation learned by Tufano et al. To make the differences concrete we can compute the BLEU scores (syntactic similarity between seeded and real fault), i.e., the evaluation metric used by Tufano et al.~\cite{tufano2019learning}, and see that the returned scores are \emph{1} and \emph{0.48}, respectivelly. However, as the mutants are equivalent and resemble a real fault, their semantic similarity is 1 despite the large difference in the BLEU scores.
The above example, clearly evidence that seeded faults do not necessarily need to be similar to real faults in order to resemble them. At the same time, the above example demonstrates the \textit{fault coupling}~\cite{offut1992}, i.e., simple syntactic transformations, such as those used by mutation testing, couple to more complex faults. In this particular case, the transformation performed by mutation is significantly smaller than Tufano et al. as it has a BLEU score (syntactic similarity from the original code) 0.85 while, Tufano et al. has 0.39.
\section{Syntactic and Semantic similarity of Artificial and Real Faults}
\label{mutation_testing}
Mutation is a test criterion in which test requirements are characterized by mean of seeded faults that are called \emph{mutants}. Thus, mutants are artificial faults generated by performing simple syntactic modifications to the program under analysis \cite{PapadakisK00TH19}. For instance, in expressions like $\texttt{a < b}$ faults are seeded by changing (mutating) the expression to the following one $\texttt{a > b}$.
Mutant faults are then used to assess the effectiveness and thoroughness of a test suite in detecting these artificial faults. A test case that detects a mutant fault, i.e., it is capable of producing distinguishable observable outputs between the mutant and the original program is said to be able to \emph{kill} the mutant. A mutant is said \emph{killed} if it is detected by a test case or a test suite, otherwise it is called \emph{live} or \emph{survived}. Test adequacy is called \emph{mutation score}, and is computed as the ratio of killed mutants over the total number of generated mutants.
To evaluate fault seeding two types of metrics are used, the syntactic and semantic similarity. Table \ref{tbl:Related} lists studies using syntactic similarity, while some form of semantic similarity has been used by several studies \cite{jia2009, JustJIEHF14, PapadakisSYB18, khanfir2020ibir}. Intuitively, \emph{syntactic similarity} refers to the distance between the text representations of the mutant and the real faulty code, while \emph{semantic similarity} to the program \emph{behavior} similarities, between the seeded and the real fault.
To compute syntactic similarity between two sequence of tokens we consider
Bilingual Evaluation Understudy (BLEU) score~\cite{metrics_bleu} which is widely used for quantifying machine translated text in NLP~\cite{bleu_word_string_similarity, bleu_seq2seq, bleu_phrase_translation, bleu_exploring_tl}.
BLEU score takes a reference and a candidate text, brakes it into n-grams and computes how many n-grams of the candidate text appear in the reference text. We report the geometric mean of all n-grams up to 4, similarly to previous work~\cite{tufano2019learning}.
To compute the semantic similarity we resort on dynamic test executions since capturing all program behaviours is an undecidable problem. We thus, use a similarity coefficient, such as Ochiai coefficient, to compute the similarity of the passing and failing test cases. This is a common practice in many different lines of work such as mutation testing \cite{jia2009, JustJIEHF14, PapadakisSYB18, khanfir2020ibir} program repair \cite{GouesNFW12} and code analysis \cite{GoldBHIKY17} studies. Since semantic similarity compares the behavior between two program versions using a reference test suite, Ochiai coefficient~\cite{Ochiai} approximates program semantics using passing and failing test cases.
Precisely, let $P_1$, $P_2$, $fTS_1$ and $fTS_2$ be two programs and their respectively set of failing tests, then the Ochiai coefficient between programs $P_1$ and $P_2$ is computed as $Ochiai(P_1,P_2) = \frac{|fTS_1 \cap fTS_2|}{\sqrt{|fTS_1| . |fTS_2|}}$, where $|\cdot|$ denotes the set size.
\section{Discussion}
\label{sec:discussion}
\subsection{Sensitivity to program locations}
\label{subsec:limitations}
One may wonder how sensitive the syntactic and semantic similarity metrics are with respect to the seeded faults' locations. In other words, these metrics may reflect the utility of the locations and not of the faults. Thus, we study the variance of the syntactic and semantic similarity of mutant pairs generated from the same location (we do not consider DeepMutation since it creates only one mutant per method). Figure~\ref{fig:RQ1-sensitivity} records the distances between the syntactic and semantic similarity of mutant pairs, taken from a) the same randomly picked locations and b) from the bug-fixing locations. We observe that while there is almost no syntactic difference between mutants from the same location, the semantic similarity varies significantly. There are a few outliers in which syntactic similarity varies up to 16\% between mutants from the same location. Some PiTest mutations remove a complete line or replace entire boolean conditions by true (as shown in the motivating example), affecting the byte-code generated.
Figure~\ref{fig:RQ1-sensitivity} includes only plots for PiTest, but a similar trend was observed for all the tools. Please refer to the accompanying website to visualize plots for the other tools.
Overall, these results support the conclusion that there is no link between syntactic and semantic similarity. Interestingly, even small syntactic changes in the same instruction can have a large and diverse impact on the program semantics.
\subsection{Threats to Validity}
\label{subsec:threats-to-validity}
To reduce threats related to external validity, we selected a new and large benchmark of Java language faults that have not been used by previous studies. We though, excluded some faults due to technical reason, making our study with 509 faults from 15 mature open-source real-world projects that are well maintained and tested. Nevertheless, we do not exclude the threat of having different results when conducting the same study on other projects from other domains. As we already discussed, while conducting our experiments, we could not compile or run the tests of all the versions available in Defects4J.
Other internal threats emerge from the tools' specificity and running configurations, such as the number of mutants to generate, the mutation operators to apply, or source-code locations to mutate.
For instance, DeepMutation generates one mutant per method, up to 5 mutants per masked token, IBIR generates mutants only on locations predicted from the bug report by its fault localization step. In contrast, PiTest generates all available mutants in terms of location and mutation operation. To reduce these threats we performed our analysis in a tool basis (without mixing the results from the tools). We also performed a cost-effective analysis by controlling for test suite size to account for the different number of mutants when comparing the tools.
Unfortunately, we did not manage to compile and run the master-branch~\cite{master-branch-deepmutation} version currently available of DeepMutation.
We thus, had to recreate the tool from the resources and pre-trained artifacts provided in the repository.
Additional threat mitigation actions involved the analysis of mutants at different granularity levels (class, method, and location of patch). We also restricted the scope of analysis on the artifacts where the bug-fixes were available, allowing us to consider an original fault from Defects4J as ground truth, isolating it from others. We made sure that all mutants change the same class, or method, or statement, as each of the target faults at a time. Thus, we compare fairly different mutated versions w.r.t. their similarities and distances from the corresponding fixed and faulty version.
To mitigate any threats from the use of BLEU score when measuring syntactic similarity, we also measured Cosine~\cite{cosine} and Jaccard~\cite{jaccard} similarity coefficients. The results did not showed any significant differences wrt the ones of BLEU scores. Nevertheless, please refer to the accompanying website for additional details on using Cosine and Jaccard similarity.
Other threats may arise from the test suites used. Since the employed projects are mature and well-tested they should approximate well vital project semantics.
\begin{figure}[t]
\vspace{-0.5em}
\centering
\begin{subfigure}[b]{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/PiTest/RQ1/Scatter-Plot-PIT_bleu_ochiai_RQ1_Random_Lines_Mutants___Box_plot_updated_final.png}
\vspace{-1.2em}
\caption[PiTest - Random lines]%
{{\small PiTest - Random lines}}
\label{fig:PiTest_rq2_mutants_from_random_lines}
\end{subfigure}
\begin{subfigure}[b]{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/PiTest/RQ1/Scatter-Plot-PIT_bleu_ochiai_RQ1_Changed_Lines_Mutants___Box_plot_updated_final.png}
\vspace{-1.2em}
\caption[PiTest - Changed lines]%
{{\small PiTest - Changed lines}}
\label{fig:PiTest_rq2_mutants_from_changed_lines}
\end{subfigure}
\vspace{-1.2em}
\caption{\small Sensitivity of mutants from the same location. Small syntactic changes lead to diverse semantic changes. }
\label{fig:RQ1-sensitivity}
\vspace{-0.7em}
\end{figure}
\section{Research questions}
\label{sec:research-questions}
We start our analysis by recording the syntactic and semantic similarity between injected and real faults. We perform this analysis
to understand the general relation between seeded and real faults and check if there is any associations between these two variables. The existence of such a relation will provide evidence that fault seeding techniques, instead of using grammar-based (simple) transformations as it is traditionally done in mutation testing, should attempt to form frequent fault patterns and design fault seeding techniques guided by real fault instances, in a sense follow similar path to static code analysis \cite{PradelS18, HovemeyerP04}. Therefore, we ask:
\begin{description}
\item[RQ1] \emph{How semantically and syntactically similar are seeded and real faults?}
\end{description}
The answer to this question will also provide evidence on the use of syntactic distance metrics in evaluating fault seeding methods, i.e., whether seeded faults with small syntactic distance from the real ones are indeed semantically close to them (at least closer than those that are not syntactically similar, i.e., dissimilar). As we discussed before, such evaluation metrics are followed by recent research (Table \ref{tbl:Related}) without any empirical evidence of their validity. This means that we want to check whether the choice of syntactic distance as an evaluation metric, as performed by previous studies in Table \ref{tbl:Related}, is a valid choice.
To further investigate the fault-revealing potential of the techniques, we also check whether real faults can be resembled solely by syntactically similar (but not exact matches) or dissimilar seeded faults. The difference of this analysis with the above is that instead of interest in a general relationship, here we are interested in the existence of some, perhaps few, cases that resemble the sought faults. In practical terms, the existence of such instances indicates the minimum level of fault detection that can be achieved by fault-based testing when one attempts to design test cases that reveal all seeded faults \cite{JustJIEHF14}.
Thus, we ask:
\begin{description}
\item[RQ2] \emph{How many real faults we can resemble by using syntactically similar and dissimilar seeded faults?}
\end{description}
Having investigated the relationships between syntactic changes and semantic changes, we turn our attention to comparing the fault seeding techniques. Precisely, we seek to examine whether there is any utility benefit in combining the techniques. Therefore, we ask:
\begin{description}
\item[RQ3] \emph{How do the employed techniques compare to each other? Are they producing faults subsumed by mutation testing?}
\end{description}
This question aims to study the ``overlaps'' of the fault seeding techniques to strengthen fault seeding tools. We investigate the practical use of the approaches when testers aim at revealing the seeded faults and compare the techniques in a cost-benefit fashion.
\section{Empirical Evaluation}
\subsection{Syntactic and Semantic Similarity between Seeded and Real Faults (RQ1)}
Figure~\ref{fig:RQ1-all-mutants} summarises the syntactic and semantic similarity values between the mutants created with different tools and the real faults. Interestingly, we notice that while many of the mutants have high syntactic similarity, their semantic similarity is scattered from 0 to 1. This seems to imply that the relationship between the two metrics is weak.
To check this further, in Figure~\ref{fig:RQ1-syntactic-80} we depict syntactic and semantic similarity values for all mutants with a syntactic similarity greater than 0.8 (i.e., mutants syntactically very similar to real faults). We notice that the four tools generated mutants that behave as faults (obtaining Ochiai 1). These are both syntactically similar and dissimilar to the faults (see the plots' top values, y-axis). We can also observe that most of the mutants that are syntactically almost the same as real faults (BLEU near 1) behave very differently (Ochiai near 0), indicating that the relationship is weak even when seeded faults are close to real ones.
The above results are based on the class granularity level, and therefore their syntactic and semantic changes may be impacted by the ``size'' of the seeded faults. We thus, analyse the results at method level granularity as well. Figure~\ref{fig:RQ1-modified-methods} shows the syntactic and semantic similarities only for the mutants that change the same methods as the real faults.
In this case, we focus on mutants with syntactic similarity greater than 80\% and see a similar trend with the class level results, i.e., every tool managed to generate syntactically similar and dissimilar mutants that behave exactly like a real fault. Additionally, the syntactic similarity is almost 1, but the semantic similarity is scattered from 0 to 1, as in the class level granularity case.
Therefore, it indicates a potential threat to validity to the studies that approximate semantic similarity through the use of a syntactic one.
To further analyze this relationship and look more into its practical use case and investigate whether seeding faults with small syntactic distance from the real ones result in semantically close faults to real ones (at least closer than those that are not syntactically similar, i.e., dissimilar). The key objective is to check whether there is some effect when we have high syntactic similarity.
Figure~\ref{fig:RQ2-syntactic-proxy-for-semantic} shows the distribution of semantic similarities when we group mutants according to their syntactic similarity. We observe that semantic similarity is uniformly distributed between mutants that are syntactically similar and dissimilar to the real faults. This evidence that more minor syntactic transformations do not imply smaller semantic changes, and at the same time, more significant syntactic changes also do not imply more extensive semantic changes. \\
\begin{tcolorbox}[
standard jigsaw,
opacityback=0,
left=0pt,right=0pt,top=0pt,bottom=0pt, arc=0pt,
boxrule=0.4pt,leftrule=1.5pt
]
Many seeded faults behave quite similarly to real faults (high semantic similarity) while at the same time having low syntactical similarity to real faults. Perhaps surprisingly, we find no evidence suggesting any link between syntactic and semantic similarity, except from the cases of exact matches.
\end{tcolorbox}
\begin{figure*}[!htb]
\centering
\vspace{-0.5em}
\begin{subfigure}[b]{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/PiTest/RQ1/Scatter-Plot-PIT_bleu_ochiai_RQ1_All_Mutants_No_Filter__Box_plot_updated_final.png}
\vspace{-1.2em}
\caption[PiTest]%
{{\small PiTest}}
\label{fig:PitTest_class_level_rq1}
\end{subfigure}
\begin{subfigure}[b]{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/CodeBert/RQ1/Scatter-Plot-codebert_bleu_ochiai_RQ1_all___Box_plot.png}
\vspace{-1.2em}
\caption[CodeBERT]%
{{\small CodeBERT}}
\label{fig:Codebert_class_level_rq1}
\end{subfigure}
\begin{subfigure}[b]{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/DeepMutation/RQ1/Scatter-Plot-nmt_bleu_ochiai_RQ1_all___Box_plot.png}
\vspace{-1.2em}
\caption[DeepMutation]%
{{\small DeepMutation}}
\label{fig:DeepMutation_class_level_rq1}
\end{subfigure}
\begin{subfigure}[b]{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/IBIR/RQ1/Scatter-Plot-ibir_bleu_ochiai_RQ1_all___Box_plot.png}
\vspace{-1.2em}
\caption[IBIR]%
{{\small IBIR}}
\label{fig:IBIR_class_level_rq1}
\end{subfigure}
\vspace{-1.0em}
\caption{\small RQ1: Syntactic vs semantic similarity at class granularity level. There's a weak link between syntactic and semantic similarity.}
\label{fig:RQ1-all-mutants}
\end{figure*}
\begin{figure*}[!htb]
\vspace{-1.0em}
\centering
\begin{subfigure}[b]{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/PiTest/RQ1/Scatter-Plot-PIT_bleu_ochiai_RQ1_All_Mutants_SynctacticGT_8_Class_Level_Box_plot_updated_final.png}
\vspace{-1.2em}
\caption[PiTest]%
{{\small PiTest}}
\label{fig:PitTest_function_level_rq1}
\end{subfigure}
\begin{subfigure}[b]{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/CodeBert/RQ1/Scatter-Plot-codebert_bleu_ochiai_RQ1_syn_gt80p___Box_plot.png}
\vspace{-1.2em}
\caption[CodeBERT]%
{{\small CodeBERT}}
\label{fig:Codebert_function_level_rq1}
\end{subfigure}
\begin{subfigure}[b]{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/DeepMutation/RQ1/Scatter-Plot-nmt_bleu_ochiai_RQ1_syn_gt80p___Box_plot.png}
\vspace{-1.2em}
\caption[DeepMutation]%
{{\small DeepMutation}}
\label{fig:DeepMutation_function_level_rq1}
\end{subfigure}
\begin{subfigure}[b]{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/IBIR/RQ1/Scatter-Plot-ibir_bleu_ochiai_RQ1_syn_gt80p___Box_plot.png}
\vspace{-1.2em}
\caption[IBIR]%
{{\small IBIR}}
\label{fig:IBIR_function_level_rq1}
\end{subfigure}
\vspace{-1.0em}
\caption{\small RQ1: Semantic vs syntactic similarity when syntactic similarity is greater than 80\%. Again no link between them.}
\label{fig:RQ1-syntactic-80}
\end{figure*}
\begin{figure*}[!htb]
\centering
\vspace{-1.0em}
\begin{subfigure}[b]{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/PiTest/RQ1/Scatter-Plot-PIT_bleu_ochiai_RQ1_All_Mutants_SynctacticGT_8_Function_Level_Box_plot_updated_final.png}
\vspace{-1.2em}
\caption[PiTest]%
{{\small PiTest}}
\label{fig:PitTest_function_level_rq1}
\end{subfigure}
\begin{subfigure}[b]{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/CodeBert/RQ1/Scatter-Plot-codebert_bleu_ochiai_RQ2_patch_based___Box_plot.png}
\vspace{-1.2em}
\caption[CodeBERT]%
{{\small CodeBERT}}
\label{fig:Codebert_function_level_rq1}
\end{subfigure}
\begin{subfigure}[b]{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/DeepMutation/RQ1/Scatter-Plot-nmt_bleu_ochiai_RQ2_patch_based___Box_plot.png}
\vspace{-1.2em}
\caption[DeepMutation]%
{{\small DeepMutation}}
\label{fig:DeepMutation_function_level_rq1}
\end{subfigure}
\begin{subfigure}[b]{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/IBIR/RQ1/Scatter-Plot-ibir_bleu_ochiai_RQ2_patch_based___Box_plot.png}
\vspace{-1.2em}
\caption[IBIR]%
{{\small IBIR}}
\label{fig:IBIR_function_level_rq1}
\end{subfigure}
\vspace{-1.0em}
\caption[Correlation between semantic and syntactic similarity of seeded and real faults]{\small RQ1: Semantic vs syntactic similarity at method granularity. Faults from the same method have divers semantic similarity.}
\label{fig:RQ1-modified-methods}
\end{figure*}
\begin{figure*}[!htb]
\vspace{-1.2em}
\centering
\begin{subfigure}[b]{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/PiTest/RQ2/Box_plot_RQ2b_semantic_syntactic_proxy_final.png}
\vspace{-1.2em}
\caption[PiTest]%
{{\small PiTest}}
\label{fig:PiTest_rq2}
\end{subfigure}
\begin{subfigure}[b]{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/CodeBert/RQ2/Scatter-Plot-codebert_bleu_ochiai_RQ2_Quartiles___Box_plot}
\vspace{-1.2em}
\caption[CodeBERT]%
{{\small CodeBERT}}
\label{fig:Codebert_rq2}
\end{subfigure}
\begin{subfigure}[b]{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/DeepMutation/RQ2/Scatter-Plot-nmt_bleu_ochiai_RQ2_Quartiles___Box_plot}
\vspace{-1.2em}
\caption[DeepMutation]%
{{\small DeepMutation}}
\label{fig:DeepMutation_rq2}
\end{subfigure}
\begin{subfigure}[b]{0.23\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/IBIR/RQ2/Scatter-Plot-ibir_bleu_ochiai_RQ2_Quartiles___Box_plot}
\vspace{-1.2em}
\caption[IBIR]%
{{\small IBIR}}
\label{fig:PiTest_rq2_mutants_from_random_lines}
\end{subfigure}
\vspace{-1.0em}
\caption{\small RQ1: Distribution of Semantic similarities across different levels of syntactic similarities.}
\label{fig:RQ2-syntactic-proxy-for-semantic}
\vspace{-1.0em}
\end{figure*}
\subsection{Mutants Resembling Real Faults (RQ2)}
Table~\ref{tbl:rq3a} summarizes the percentage of real faults that were resembled by at least one mutant produced by each tool. Column \emph{Total} indicates the percentage of real faults for which the tool generated at least one mutant with semantic similarity 1, meaning that it semantically resembles the real fault. Column \emph{Exact Matches} indicates the percentage of real faults for which the tools produced one mutant syntactically the same as the fault. Columns \emph{Q1, Q2, Q3} and \emph{Q4} express the percentage of faults semantically resembled by mutants of each quartile. Notice that quartile \emph{Q4} includes mutants syntactically the same as real faults, which have syntactic similarity 1 (this explains why Q4 results are more inflated than for the other quartiles).
We observe that PiTest resembles 46.85\% of the real faults, while CodeBERT successfully resembles 60.42\%, DeepMutation 6.9\% and IBIR 43.01\%. Interestingly, CodeBERT reproduces most of the real faults, significantly more than the other tools: 13.57\% more than PiTest, 17.41\% more than IBIR and 53.52\% more than DeepMutation. A reason why PiTest performance is lower is that its mutants are designed to be hard to be detected by test suites, i.e., they aim at producing small semantic changes to programs, so the number of failing tests for them can be very small wrt the number of failing tests for the real faults (leading to lower Ochiai). In the case of IBIR, the reason is the opposite; it tends to produce several transformations to resemble real faults, that may lead to big semantic differences. In the case of DeepMutation, it manages to reproduce real faults even when we are creating only one mutant per method but these are very few cases.
Regarding exact matching, IBIR successfully reproduces 5.6\% of the faults, outperforming the rest of the tools which only managed to reproduce less than 1\%.
\begin{table}[tp]
\centering
\vspace{-0.7em}
\caption{RQ2 Percentage of real faults with at least one semantically similar mutant - Quartiles represent mutants sorted by syntactic similarity}
\vspace{-0.95em}
\resizebox{\columnwidth}{!}{
{\small
\begin{tabular}{l|r|r|r|r|r|r}
\toprule
\textbf{\scriptsize{Fault Seeding Tool}} & \textbf{\scriptsize{Total}} & \textbf{\scriptsize{Exact Matches
}} & \textbf{\scriptsize{Q1}} & \textbf{\scriptsize{Q2}} & \textbf{\scriptsize{Q3}} & \textbf{\scriptsize{Q4}} \\
\midrule
PiTest & 46.85 & 0.58 & 29.20 & 29.61 & 32.45 & 39.09 \\
CodeBERT & 60.42 & 0.42 & 23.73 & 25.68 & 27.91 & 28.42 \\
DeepMutation & 6.90 & 0.57 & 1.84 & 1.34 & 1.95 & 4.31\\
IBIR & 43.01 & 5.60 & 26.21 & 27.48 & 28.24 & 33.84 \\
\bottomrule
\end{tabular}
}
}
\label{tbl:rq3a}
\vspace{-0.8em}
\end{table}
Table~\ref{tbl:rq3b} records the mean ratios of mutants that behave as the real faults.
We observe that in average between 3.55\%-4.9\% of mutants resemble the real faults, independently of their syntactic similarity. \\
\begin{table}[tp]
\centering
\vspace{-0.5em}
\caption{RQ2: Mean ratios of mutants resemble real faults.}
\vspace{-0.95em}
\resizebox{\columnwidth}{!}{
{\scriptsize
\begin{tabular}{l|r|r|r|r|r}
\toprule
\textbf{\scriptsize{Fault Seeding Tool}} & \textbf{\scriptsize{Overall}} & \textbf{\scriptsize{Q1}} & \textbf{\scriptsize{Q2}} & \textbf{\scriptsize{Q3}} & \textbf{\scriptsize{Q4}} \\
\midrule
PiTest & 4.10 & 0.85 & 1.00 & 1.07 & 1.19 \\
CodeBERT & 4.30 & 4.33 & 4.18 & 4.17 & 4.50 \\
DeepMutation & 3.55 & 1.46 & 1.12 & 1.45 & 3.85 \\
IBIR & 4.90 & 4.72 & 4.31 & 5.03 & 5.54 \\
\bottomrule
\end{tabular}
}
}
\label{tbl:rq3b}
\vspace{-1.3em}
\end{table}
\begin{tcolorbox}[
standard jigsaw,
opacityback=0,
left=0pt,right=0pt,top=0pt,bottom=0pt, arc=0pt,
boxrule=0.4pt,leftrule=1.5pt
]
CodeBERT resembles 60.42\% of the real faults, significantly outperforming PiTest (46.85\%), IBIR (43.01\%) and DeepMutation (6.9\%).
In terms of exact (syntactic) matching, IBIR reproduces 5.6\% of the faults, outperforming the other tools. Interestingly, 3.55\%-4.9\% of the mutants behave as real faults.
\end{tcolorbox}
\subsection{Comparing fault seeding techniques (RQ3)}
Figure~\ref{fig:RQ5-tools-simulation} depicts the results of the objective comparison of the 4 techniques.
Based on these results, we can conclude that the mutants created by PiTest are the strongest ones since a test suite that kills them also kills almost every mutant created by other tools. We can observe similar phenomena in the case of mutants created with CodeBERT. The majority of the mutants seeded by other tools will be killed but remain ~5\% of mutants from IBIR and PiTest that require further analysis.
We can also observe that test suite designed by mutants from IBIR and DeepMutation will not be very effective in killing PiTest and CodeBERT mutants, leaving us with around ~50\% of the unidentified mutants.
Furthermore, Figure~\ref{fig:RQ5-revailing_bugs} summarises the percentage of faults detected by a test cases selected to kill all the mutants for each tool.
We depict in gray and green boxes descriptive statistics in terms of median and mean, respectively, for each box plot.
Thus, we can confirm the earlier findings, where we observed that the test suite designed by PiTest mutants are the strongest ones, being able to detect most real faults (100\% according to median value).
In the case of test suites designed by mutants from CodeBERT, we can see a trend most similar to PiTest. On average, they can reveal 52.6\% of real faults, which is 1.36\% less than PiTest's average value—at the same time, reporting a median value of 80\% of the real faults.
On the contrary, we can observe that a test suite designed to identify all mutants from IBIR and DeepMutations shows a significant difference in revealing a fault. In the case of IBIR, we observe that the median value is 0 but the test suitse designed to kill all IBIR mutants can identify on average ~36\% of faults.
\begin{tcolorbox}[
standard jigsaw,
opacityback=0,
left=0pt,right=0pt,top=0pt,bottom=0pt, arc=0pt,
boxrule=0.4pt,leftrule=1.5pt
]
PiTest and CodeBERT are the strongest techniques capable of almost subsuming IBIR and DeepMutation.
\end{tcolorbox}
Figure~\ref{fig:RQ5-subsumption_relation} depicts the subsuming relation between an observed tool (axis x) and each corresponding tool (pairs).
By observing the relation for each tool separately, we can notice that mutants from PiTest subsume almost every mutant from DeepMutation, and around $\sim$10\% and $\sim$20\% of mutants from IBIR and CodeBERT, respectively, cannot be subsumed by PiTest mutants. This observation follows the same trend for all mutants. Meaning that if we analyze mutants from CodeBERT, we will subsume the majority of mutants from DeepMutation, but will lose nearly 20\% of mutants from IBIR and around 80\% of PiTest generated mutants.
Mutants from IBIR subsume the majority of the mutants from DeepMutation as well, advocating their subsumption weakness. While on the other side more than 80\% of the subsuming mutants from CodeBERT and PiTest cannot be subsumed.
In the case of mutants from DeepMutation we can see the same trend as before, not subsuming almost any mutant from the other tools.
To summarise, the robust set of mutants from PiTest can be further complemented with some mutants from CodeBERT, to improve mutation testing capabilities.\\
\begin{tcolorbox}[
standard jigsaw,
opacityback=0,
left=0pt,right=0pt,top=0pt,bottom=0pt, arc=0pt,
boxrule=0.4pt,leftrule=1.5pt
]
CodeBERT can complement PiTest by offering more than 20\% subsuming mutants to the PiTest subsuming mutant set.
\end{tcolorbox}
Finally, in Figure~\ref{fig:RQ3-Cost-effectiveness}, we plot the results of our cost effort-analysis, in particular real fault detection in terms of a number of analyzed tests.
Precisely, Figure~\ref{fig:RQ3-Cost-effectiveness-DeepMutation} shows that fault detection of DeepMutation is very low ($\sim$5\%) compared to the fault detection reached by the other tools, when same number of tests are taken (determined my the number of tests required to kill DeepMutation mutants). Clearly, we can observe that under same effort, IBIR is the best cost-effective technique, with $\sim$25\% of fault detection.
In fact, Figure~\ref{fig:RQ3-Cost-effectiveness-Ibir} evidences that while the number of tests increase (until all IBIR mutants are killed), the fault detection of IBIR ($\sim$50\%) significantly outperforms fault detection capabilities of PiTest ($\sim$25\%) and CodeBERT ($\sim$30\%).
Figure~\ref{fig:RQ3-Cost-effectiveness-CodeBert} shows that when same number of tests are designed (to cover all CodeBERT mutants), CodeBERT ($\sim$90\%) detects more faults than PiTest ($\sim$80\%).
Notice that we do not consider PiTest as baseline, since killing all mutants from PiTest leads to large test suites, all mutants of other tools are killed as well with test suites of same size, then no fault detection differences is observed.
Tables~\ref{fig:A12-DeepMutation}, \ref{fig:A12-IBIR} and \ref{fig:A12-Codebert} report Vargha-Delaney A measure~\cite{VarghaDelaney2000} between the fault detection reached by the different tools, indicating that results are statistically significant. \\
\begin{tcolorbox}[
standard jigsaw,
opacityback=0,
left=0pt,right=0pt,top=0pt,bottom=0pt, arc=0pt,
boxrule=0.4pt,leftrule=1.5pt
]
IBIR is the most cost-effective tool. When controlling for test size, IBIR detects $\sim$50\% of the real faults, while PiTest and CodeBERT detect $\sim$25\% and $\sim$30\%.
\end{tcolorbox}
\begin{figure*}[!htb]
\vspace{-0.8em}
\centering
\begin{subfigure}[b]{0.325\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/RQ5/BoxPlot-PIT_developer_simulation_update_final.png}
\vspace{-1.4em}
\caption{{\small Mutation scores achieved on the mutants of the 4 techniques when selecting test cases that kill the mutants of each one. Higher scores indicate higher collateral kills among the techniques (semantic overlaps between the seeded faults).}}
\label{fig:RQ5-tools-simulation}
\end{subfigure}
\hspace{0.8mm}
\begin{subfigure}[b]{0.32\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/RQ5/BoxPlot-PIT_fault_detection_extended_info_NO_dpi_final.png}
\vspace{-1.4em}
\caption{{\small Fault detection of test cases that kill the mutants of the techniques. PiTest and CodeBERT perform best with median-average values of 100\%-53.96\% and 80\%-52.6\%. IBIR and DeepMutation achieve median-average values of 0\%-7.36\% and 0\%-36.68\%.}}
\label{fig:RQ5-revailing_bugs}
\end{subfigure}
\hspace{0.8mm}
\begin{subfigure}[b]{0.325\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/RQ5/BoxPlot-PIT_Subsumption_analysis_update_final.png}
\vspace{-1.4em}
\caption{{\small Technique's subsumption. Ratios of subsuming mutants contributed by the joint use of one technique with the others. For example, using IBIR, DeepMutation and CodeBERT contributes with 6.8\%, 0.74\%, and 24.06\%, on the subsuming mutants of PiTest.}}
\label{fig:RQ5-subsumption_relation}
\end{subfigure}
\vspace{-0.8em}
\caption{\small RQ3: Objective comparison between the techniques.}
\label{fig:RQ5-tools-comparison}
\vspace{-0.8em}
\end{figure*}
\begin{figure*}[!htb]
\vspace{-0.65em}
\begin{subfigure}[b]{0.33\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/RQ5/LinePlot-PIT_fault_detection_effort_simulation_deep-mutation_tests_limit_update_cut_last_outlier_update_final.png}
\vspace{-1.4em}
\caption{{\small DeepMutation.}}
\label{fig:RQ3-Cost-effectiveness-DeepMutation}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.33\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/RQ5/LinePlot-PIT_fault_detection_effort_simulation_ibir_tests_limit_update_cut_last_outlier_update_final.png}
\vspace{-1.4em}
\caption{{\small IBIR.}}
\label{fig:RQ3-Cost-effectiveness-Ibir}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.33\textwidth}
\centering
\includegraphics[width=\textwidth]{figures/RQ5/LinePlot-PIT_fault_detection_effort_simulation_codebert_tests_limit_update_cut_last_outlier_update_final.png}
\vspace{-1.4em}
\caption{{\small CodeBERT.}}
\label{fig:RQ3-Cost-effectiveness-CodeBert}
\end{subfigure}
\begin{subfigure}[b]{0.33\textwidth}
\centering
\resizebox{\columnwidth}{!}{
{\small
\begin{tabular}{l|r|r|r|r|r}
\toprule
\textbf{\% mutants analysed} & 10\% & 20\% & 50\% & 75\% & 100\% \\
\midrule
PiTest - DeepMutation & 0.74 & 0.78 & 0.76 & 0.76 & 0.78 \\
CodeBERT - DeepMutation & 0.79 & 0.80 & 0.85 & 0.85 & 0.85 \\
IBIR - DeepMutation & 0.82 & 0.88 & 0.91 & 0.92 & 0.92 \\
\bottomrule
\end{tabular}
}}
\vspace{-0.1em}
\caption{\small{$\hat{A}_{12}$. Fault detection when number of tests is determined by DeepMutation mutants. IBIR ($\sim$25\%) detects significantly more faults than related tools ($\sim$5\%-$\sim$15\%) under same effort.}}
\label{fig:A12-DeepMutation}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.33\textwidth}
\centering
\resizebox{\columnwidth}{!}{
{\small
\begin{tabular}{l|r|r|r|r|r}
\toprule
\textbf{\% mutants analysed} & \textbf{10\%} & \textbf{20\%} & \textbf{50\%} & \textbf{75\%} & \textbf{100\%} \\
\midrule
PiTest - IBIR & 0.65 & 0.54 & 0.42 & 0.37 & 0.33\\
CodeBERT - IBIR & 0.50 & 0.48 & 0.39 & 0.36 & 0.32\\
\bottomrule
\end{tabular}
}}
\vspace{-0.1em}
\caption{\small{$\hat{A}_{12}$. Fault detection when number of tests is determined by IBIR mutants. IBIR ($\sim$50\%) detects significantly more faults than related tools ($\sim$25\%-$\sim$30\%) under same effort.}}
\label{fig:A12-IBIR}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.33\textwidth}
\centering
\resizebox{\columnwidth}{!}{
{\small
\begin{tabular}{l|r|r|r|r|r}
\toprule
\textbf{\% mutants analysed} & \textbf{10\%} & \textbf{20\%} & \textbf{50\%} & \textbf{75\%} & \textbf{100\%} \\
\midrule
PiTest - CodeBERT & 0.44 & 0.49 & 0.44 & 0.43 & 0.42\\
\bottomrule
\end{tabular}
}}
\vspace{-0.1em}
\caption{\small{$\hat{A}_{12}$. Fault detection when number of tests is determined by CodeBERT mutants. CodeBERT ($\sim$90\%) detects more faults than related PiTest ($\sim$80\%) under same effort.}}
\label{fig:A12-Codebert}
\end{subfigure}
\vspace{-2em}
\caption{\small RQ3: Cost-Effectiveness Comparison.}
\vspace{-1.2em}
\label{fig:RQ3-Cost-effectiveness}
\end{figure*}
\section{Experimental setup}
\label{sec:experimetal-setup}
\subsection{Real Faults}
We used Defects4J
\cite{defects4j} v2.0,0, which contains over 800 faults with supporting build infrastructure and forms one of the largest collections of reproducible real faults for Java programs.
Every fault in the dataset consists of the faulty and fixed versions of the code, a developer's test suite accompanying the project, and information regarding the commit modified classes and the patches produced to fix the fault. The faults have manually been minimized, so every irrelevant change to the fix has been removed. The dataset also includes at least one fault triggering test that fails in the faulty version and passes in the fixed one.
The set of faults spans more than a decade of development history, making it challenging for us to synchronize the execution of faults over different mutant generation techniques.
Thus, intending to be as fair as possible with the selected tools, we had to discard those faults that do not satisfy the building requirements for each tool. Precisely, we discarded the faults from the project Jfreechart (number of faults 26) and Closure-compiler (174). Additionally, at the time of conducting this study, we found that 82 faults from Jsoup project were not compilable due to technical reasons~\cite{defects4j_issue}
We consider the following projects and number of faults from Apache Commons~\cite{apache_commons}
family, which is a collection of projects of Java utility classes: commons-cli (38), commons-codec (18), commons-compress (33), commons-csv (16), commons-math (100), commons-lang (63), commons-collections (4), commons-jxpath (21). We also include projects from the Jackson~\cite{jackson}
family, which is a suite of data-processing tools for Java and includes jackson-core (26), jackson-databind (102), and jackson-dataformat-xml (6).
Additionaly, we include faults from Mockito (27), one of the most popular mocking frameworks in Java, Jsoup (11), a Java library for HTML parsing,
Gson (18) a Java library for JSON parsing and generation from and into java objects,
and joda-time (26) for the Java date and time classes. In total, we analyzed 509 faults from 15 different projects.
\subsection{Seeded Faults}
For each selected faulty project version from Defects4J, we start by identifying the modified classes between the faulty and fixed versions. Then we generate mutants for the fixed version of each modified class by employing the selected mutation testing tools.
Table \ref{tbl:tools_mutants_statistics} records the number of faults analysed and the number of mutants generated by each mutation testing tool.
Since we use all available mutation operators provided by PiTest, it generated 1,120,719 mutants for the 509 faulty classes.
Our CodeBERT-based mutation testing technique applied on 499 faults and produced a total of 192,905 mutants. DeepMutation, which produces only 1 mutant per method, produced 3,057 mutants for the 348 analysed faults.
IBIR produces at most 100 number of mutants per bug report, resulting in a total of 38,327 mutants for the 393 analysed faults.
\begin{table}[tp]
\vspace{-1.0em}
\centering
\caption{Mutants used}
\vspace{-1.2em}
\resizebox{\columnwidth}{!}{
\scriptsize{
\begin{tabular}{l|r|r}
\toprule
\textbf{\scriptsize{Fault Seeding Tool}} & \textbf{\scriptsize{\# of Analysed Faults}} & \textbf{\scriptsize{\# of Mutants}} \\
\midrule
\scriptsize{PiTest} & \scriptsize{509} & \scriptsize{1,120,719} \\
\scriptsize{CodeBERT} & \scriptsize{499} & 192,905 \\
\scriptsize{DeepMutation} & 348 & 3,057\\
\scriptsize{IBIR} & \scriptsize{393} & \scriptsize{38,327} \\
\bottomrule
\end{tabular}
}
}
\label{tbl:tools_mutants_statistics}
\vspace{-1.6em}
\end{table}
\subsection{Experimental Procedure}
We start by executing every mutant generated using the Defects4J framework, recording the set of failing tests (if any) killing each mutant.
Then we proceed to compute syntactic and semantic similarities between the mutants and the corresponding faults, relying on the metrics defined in Section~\ref{mutation_testing}. Thus, syntactic similarity between the mutant and the fault will be measured in terms of the BLEU score, while the semantic similarity will be characterised by the Ochiai coefficient between the mutant and the fault.
It is worth to mention that, since PiTest produces the mutations at bytecode level, we perform the syntactic similarity computation between the bytecode sequences corresponding to mutants and faults.
To answer RQ1, we study the existence or not of any correlation between the syntactic and semantic similarity between seeded and real faults.
We do this analysis per tool bases, and firstly by considering all the mutants created with each particular tool (all mutants), and secondly by considering only the mutants that change the same method that was modified in the patch from fault to fix according to the information gathered from Defects4J (modified-methods mutants).
In the first case, by analysing all the mutants, we are trying to see if some general trend is observed, even when seeded faults are changing locations that are not part of patches (leading to lower syntactic similarities).
In the second case we aim at controlling this, by analysing only the mutants from the same methods modified in the patches (leading to higher syntactic similarities).
We then study whether high scores for syntactic similarity (i.e., seeded and real faults are syntactically similar) implies high scores for semantic similarity (i.e., seeded and real faults behave the same). And dually, we also explore whether low scores for syntactic metrics implies low scores for semantic metrics.
To do so, for each fault and tool, we start by sorting mutants in ascending order according to their syntactic similarity, and we organise them into four quartiles $Q_1$, $Q_2$, $Q_3$ and $Q_4$, where $Q_1$ represents the most syntactically dissimilar mutants wrt the fault (lowest syntactic scores) and $Q_4$ represents the most syntactically similar mutants wrt the fault (highest syntactic scores).
Finally, for the mutants in each quartile we analyse their semantic similarity wrt the fault, with the aim at observing if there is any evidence that more syntactically dissimilar mutants behave very differently than the faults, and whether syntactically similar mutants behave the same as the faults.
To answer RQ2, we study if there is at least one mutant that behaves the same as the fault. Since checking if two programs are equivalent is undecidable, we will consider that a mutant resemble a real fault whether they behave the same wrt the test suite, i.e., when the semantic similarity (Ochiai) value is equals to 1.
Firstly, we start by analysing the percentage of real faults that each tool can resemble (i.e., percentage of real faults for which the tool generated at least one mutant with Ochiai 1).
Secondly, we focus the analysis on the same quartiles used for RQ1 to study the percentage of real faults resembled by syntactically similar and dissimilar mutants.
Up to this point our analysis checks single mutant instances. However, mutation testing tools are generating sets of mutants, which may have different properties than the single instances \cite{PapadakisCT18}.
Thus, to answer RQ3, we compare the mutants generated with every technique with respect to following aspects:
\begin{itemize}[leftmargin=8.0mm]
\item We make an objective comparison between the techniques \cite{LaurentPKHTV17} in terms of mutant kills and faults detected. In a sense we select minimal test cases, from the developer test suites, that kill the maximum number of mutants of each technique and check how well they kill mutants from the other techniques and whether they detect the associated real faults or not. This analysis checks how well the test requirements (mutants) of one technique work against the test requirements of the other.
\item We study the subsumptions~\cite{KurtzADOD2014} between mutants produced by the different tools (mutant $m_1$ subsumes mutant $m_2$, if every test that kills $m_1$, also kills $m_2$~\cite{KurtzADOD2014}) with respect to their joint use. Subsuming mutants have been proposed as a way to evaluate mutant selection methods \cite{ammann_establishing_2014, PapadakisHHJT16}. In essence they quantify the contributions of mutant sets by discarding subsumed mutants \cite{PapadakisK00TH19}. We thus compute the subsumption relations among all mutants produced by all techniques and count the number of mutants that are in the top of the hierarchy and are not subsumed by each tool. This cross-technique evaluation indicates the overlaps between the techniques and highlights opportunities for complementary use of the techniques.
\item We simulate a testing scenario where a tester selects a subset of mutants, to use for mutation analysis, and designs tests to kill them. We start by taking each mutant created by one tool, selecting a test that kills it, until we reach a maximum of mutants killed. The selected test suite is then used to measure mutation score from the pool of mutants created by the other tools. We repeat this process 100 times to reduce the impact of the random selection of killing tests on our results. This analysis form a cost-effective evaluation and aims at emphasising the effects of the different approaches \cite{KurtzAODKG16, AndrewsBLN06}. Here it must be noted that in order to make the comparison fair, in RQ3 we investigate only the classes-faults analysed by all the tools.
\end{itemize}
\subsection{Statistical Analysis}
To study the correlation between semantic and syntactic properties, we use two correlation metrics: Kendall rank coefficient ($\tau$)) (Tau-a) and Pearson product-moment correlation coefficient (r). In every case, we take into consideration the 0.05 significance level. Each correlation coefficients measure similarity, taking values from -1 to 1. Values close to both ends represent negative and positive correlation, respectively. While values in a range of absolute 0.2 around zero, donate absence and insignificant correlation.
| {'timestamp': '2021-12-30T02:25:41', 'yymm': '2112', 'arxiv_id': '2112.14508', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14508'} | arxiv |
\section{Introduction}
Graph neural networks (GNN) are now the \textit{de facto} standard when it comes to learning the low-dimension embedding on the graph-structured data. It is shown effective in prior works to use the low-dimensional vector embeddings as the input node/graph features for a variety of prediction, recommendation, or any other graph-related analysis~\cite{wu2020comprehensive}. The idea behind it is through aggregating and distilling the high-dimensional information of a node as well as its graph neighborhood into a dense vector form, the principle of which is derived from the natural languages processing (NLP) field~\cite{zhou2020graph}.
The rise of GNNs comes from the fact that most dominant neural network architectures in the deep learning field focus on dealing with tasks involving grid-like data structures (e.g., images, text corpus). However, it is unpractical not to consider the sheer amount of non-euclidean space data in the case of social networks, molecular protein networks, or financial risk networks~\cite{zhou2020graph}. These types of data can be formed into the graph structure and convey a better interpretation from a human's perspective.
Much interesting research has thus emerged over the last several years to embed the graph-structured data using GNNs, and these GNNs can be generalized in two forms, namely conventional and sampling-based ones~\cite{wu2020comprehensive}. Specifically, a conventional GNN refers to optimizing node's embedding using matrix factorization-based objective in a single, fixed graph, while aggregating knowledge from all connected node pairs. One widely used work is graph convolutional networks (GCN), which could easily lead to the ``neighbor explosion'' problem in the large-scale and dense graph. The recursive expansion across layers in a top-down way also requires expensive convolution computations for all nodes at each time step. One flagship sampling-based model is GraphSAGE, which randomly samples a fixed size of neighbors for each node instead of taking in the whole neighborhood to avoid ``neighbor explosion'' problem. Similarly, other sampling works either resort to the layer-wise sampling~\cite{huang2018adaptive} or graph-level sampling~\cite{graphsaint}.
It is considered challenging for representation learning due to the need of generalizing the ones on which the algorithm has already been optimized to the unseen nodes/graphs. To this end, we propose an adaptive graph policy-driven sampling model, namely GPS, to generate both node and graph level embedding inductively. The policy-driven sampling is realized through several key steps. It first quantifies the importance of all nodes at each layer recursively, from which a better sense of locality of a given node can be comprehended while sampling the nodes based on the rank of importance. It then integrates the sampling loss into the final graph level classification task, and the importance of the nodes is thus adjusted adaptively along with the change of gradients towards the minimum of loss. The contributions of the paper can be summarized as the following:
\begin{itemize}
\item We propose an innovative policy-driven sampling approach to enhance the generation of the embedding on the graph-structured data, in which the node embedding is updated with the guidance of the policy function, and the graph embedding derives from a shallow multi-layer perceptions network (MLP).
\item We realize the graph representation learning in an end-to-end fashion, including the initial graph construction/vectorization, the adaptive policy-driven sampling/embedding update and graph embedding generation. We quantify the correlations of nodes in the local neighborhood and only sample ones deemed important iteratively. In addition, the sampling process is considered an integral part of the training process and thus adapted dynamically.
\item We conduct extensive experiments on five molecular graph datasets for graph level classification tasks. Compared with the other four state-of-the-art methods, the proposed GPS achieves superior performance among all. We also demonstrate the influence of sampling parameter $K$ on the overall performance of the GPS and implement variants of GPS for ablation study.
\end{itemize}
\begin{figure*}[h!]
\vspace{-6mm}
\centering
\includegraphics[width =\textwidth]{img/arch.png}
\vspace{-6mm}
\caption{The overview of node feature vectorization, and embedding update via GPS, and graph-level embedding generation (from left to right).}
\label{fig:demo}
\vspace{-6mm}
\end{figure*}
\section{Related Work}
While the sheer number of graph-structured data have been found particularly useful in many learning tasks in recent years (e.g., financial risks analysis for costumers social connection graphs), designing effective and efficient graph neural networks has become a popular topic in the graph representation learning field.
\cite{bruna2013spectral} first introduces the convolution operation into the graph domain and propose both spatial construction and spectral construction during the convolution process. To speed up the graph convolution computation, both \cite{gcn} and \cite{defferrard2016convolutional} design localized filters based on Chebyshev expansion and verify their approach on relatively small datasets, where the training is able to happen in full batch. Apart from that, \cite{duvenaud2015convolutional} adopts the convolution by using the spatial connections on the graph directly, where a wight matrix is learned for each node degree. Additionally, \cite{cao2019multi} develops the channel-wise convolution to learn a series of graph channels at each
layer, which is able to shrink the graph hierarchically to encode the pooled structures. These GCN-based models have achieved state-of-the-art performance at that time and outperformed the traditional node embedding approaches such as node2vec~\cite{grover2016node2vec} and DeepWalk~\cite{perozzi2014deepwalk}.
However, despite the success of GCN-based models, one major limitation is that these models are all based on knowledge of the entire graph Laplacian matrix amid training, making it unpractical to large-scale graph data with millions of nodes and edges. Following that, various sampling approaches are proposed to avoid operating on the entire Laplacian matrix~\cite{graphsage,ying2018graph,huang2018adaptive,graphsaint}. Specifically, \cite{graphsage} first introduces the uniform layer-wise sampling algorithm, which applies a fixed size sampling window to each layer from inside out iteratively. \cite{ying2018graph} takes advantage of random walk and considers sampling from different perspective. It considers nodes with highest visited count as important nodes and constructs the neighborhood based on this. Both~\cite{huang2018adaptive} and~\cite{graphsaint} focus on the variance reduction-based sampling. While the former proposes a condition-based sampling where the lower layer is sampled conditionally on the top one, the latter samples at the graph level, suggesting to construct different subgraphs as the minibatches while decoupling the sampling from the forward and backpropogation processes.
Another line of work aims to improve the model capacity. For instance, \cite{gat} first integrates the attention mechanism into the graph representation learning. They introduce an attention-based architecture and the use self-attention to assign edge weights to the neighborhood. Following that, \cite{zhang2018gaan} adopts gated attention network to further enhance the control over attention heads. While our proposed method shares the same concept of quantifying the correlations to the neighbor nodes, it differentiates in coefficients calculations, the adaptive policy-driven sampling for neighbor nodes, and the forward message passing process.
\section{The Proposed GPS Model}
The target of graph classification task is to map a structural graph data into a set of labels. In this work, we consider a full undirected graph
$\mathcal{G} = \left(\mathcal{V}, \mathcal{E}\right)$, where
$\mathcal{V} = \left\{\emph{v}_{1},...,\emph{v}_N\right\}$ is the set of nodes, and $\mathcal{E} = \left\{\left(\emph{v}_{i},\emph{v}_{j}\right)|\emph{v}_{i},\emph{v}_{j}\in\mathcal{V}\right\}$ denotes the set of edges in the graph. We use an adjacency matrix $\emph{A}\in\left\{0,1\right\}^{N\times N}$ to encompass the edge sets with all connectivity information in which $\emph{A}_{i,j} = 1$ if $\left(\emph{v}_{i},\emph{v}_{j}\right)\in\mathcal{E}$ and $\emph{A}_{i,j} = 0$ otherwise. Since GNN takes both adjacency matrix and vectorized node feature as input to learn the node embedding, we herein have initial node features denoted by $\emph{X}^{0} \in \mathcal{R}^{N\times d}$ with $\emph{x}_{i} \in X^0$ corresponding to the $d$-dimensional feature vector for node $\emph{v}_i$. Simply, the neighbor nodes of $\emph{v}_{i}$ are represented as $\mathcal{N}\left(\emph{v}_{i}\right)$. For the graph classification task, we use $\left\{\mathcal{G}_{1},...,\mathcal{G}_{n}\right\}$ as the whole graph datasets and $\left\{\emph{y}_{1},...,\emph{y}_{n}\right\}$ as corresponding labels, before splitting into train/val/test set.
\paragraph{Solution to Initial Node Embedding}GNN requires both vectorized feature input and adjacency matrix~\cite{yuan2020explainability,rong2019dropedge}, yet original node features in the real-world structural graphs are not vectorized in the first place (e.g., citation network, molecular graph, and social network)~\cite{lou2021stfl}. To this end, we demonstrate the process of turning raw node feature input to initial node embeddings in Figure~\ref{fig:demo}(a), including the steps of graph construction as well as vectorization. At the graph construction step, the graph is assembled with both raw node feature (e.g., paper/author name in citation graph, or carbon atom name in molecular graph) and structural connectivity (i.e., a list of pair-wise connections using node ids), transforming the graph into sequential representation known as SMILES format~\cite{weininger1989smiles}. It is not uncommon to use SMILES format to encode the contextual information of the graph on which the NLP-based models can be easily applied to generate the node embeddings~\cite{wang2019smiles,liu2019n}. To better encode the structural information of the graphs that other NLP-based models fail to do, we use a pre-trained GNN Transformer called GTransformer to leverage both the node features and structural information in SMILES sequence when it comes to generating the initial feature embeddings, which is then used as the input to GPS. Briefly, the key component of the GTransformer is the graph multi-head attention component, which is the attention blocks tailored to latent structural data and reports the state-of-the-art initial feature embedding results. The detailed model architecture can be found in~\cite{rong2020self}.
\paragraph{Embedding Update and Learning}Instead of drawing the full expansion of the graph like GCN~\cite{gcn} in the feedforward computation, our method updates the embedding of each node iteratively (Figure~\ref{fig:demo}(b)). Specifically, we define the sampled node set as $\emph{V}_{sa}^{l}$ ($\emph{V}_{sa}^{l} \subseteq \mathcal{V}$) whose embedding only need to be updated at aggregation layer $l$. Note $\emph{V}_{sa}^{0}$ essentially contains all nodes at the root layer, while sampled nodes at other layers are adaptively chosen through the designed policy-driven sampling process (details unveiled in eq.(4) and Algorithm 1). The unduplicated neighbor set of $\emph{V}_{sa}^{l}$ is denoted as $\emph{V}_{ne}^{l}$ = $\left\{\mathcal{N}\left(\emph{v}_{i}^{l}\right) : \forall\emph{v}_{i}^{l}\in\emph{V}_{sa}^{l} \right\}$ in which $\mathcal{N}\left(\cdot\right)$ returns the neighbor nodes of ${v}_{i}^{l}$. To show a concrete example, Figure~\ref{fig:demo}(b) demonstrates one of the sampled nodes $v_1^0$ at the root layer ($l=0$) with neighbor node set \{$v_2^1$, $v_3^1$, $v_5^1$\}. We use words aggregation layer and message passing layer interchangeably in this paper, the notation of which is $l \in \left\{1,...,L\right\}$, and $L$ indicates the largest aggregation/message passing layer.
Since the node index are in fixed order in full adjacency matrix $\emph{A}$, we can define both row filter matrix $\emph{R}^{l}_{sa} \in \mathcal{R}^{\left\|\emph{V}_{sa}^{l}\right\|\times N}$ and column filter matrix $\emph{C}^{l}_{ne} \in \mathcal{R}^{N \times \left\|\emph{V}_{ne}^{l}\right\|}$ to select rows or columns from the adjacent matrix at any message passing layer $l$. Simply put, the left multiplication with $\emph{R}^{l}_{sa}$ can be regarded as selecting sampled nodes from full adjacency $\emph{A}$, and the right multiplication with $\emph{C}^{l}_{ne}$ indicates selecting corresponding neighbor nodes. Taking the row filter matrix as an example, $\emph{R}^{l}_{sa}$ is expanded as $\left[\emph{e}_{1}^l,\emph{e}_{2}^l,...,\emph{e}_{i}^l \right]^{T}$, where $\emph{e}_{i} \in \{0, 1\}^{N \times 1}$ and $i=\left\|\emph{V}_{sa}^{l}\right\|$. Specifically, $\emph{e}_{i}^l$ serves as the position indicator and tells the $i$th sampled node position at layer $l$ in the full adjacency matrix $A$, e.g., $\emph{e}_{1}^l = \left[0,1,0,...,0\right]^T \in \mathcal{R}^{N \times 1}$ means the first sampled node is at the second row in $\emph{A}$ (node 2). Herein, the column filter matrix $\emph{C}^{l}_{ne}$ follows the same logic to filter out the unique neighbor nodes of the sampled nodes. Consequently, the layer-wise adjacency matrix $\emph{A}^{l} \in \mathcal{R}^{\left\|\emph{V}_{sa}^{l}\right\|\times \left\|\emph{V}_{ne}^{l}\right\|}$ can be formulated as:
\begin{equation}
\emph{A}^{l} = \left(\emph{R}^{l}_{sa}\cdot\emph{A}\right)\cdot\emph{C}^{l}_{ne}
\end{equation}
Similarly, we can retrieve the embedding representation for both sampled nodes and neighbor nodes at layer $l$. Say the hidden embedding matrix of all nodes at hop layer $l$ is represented as $\emph{H}^{l} \in \mathcal{R}^{N\times D}$, and $\emph{H}^{0} = \emph{X}^0$ simply means the node embedding is assigned with the initial node feature matrix at the root layer.
\begin{equation}
\hat{\emph{H}}^{l}_{sa} = \emph{R}^{l}_{sa}\cdot\emph{H}^{l}
\end{equation}
\begin{equation}
\tilde{\emph{H}}^{l}_{ne} = \left(\emph{C}^{l}_{ne}\right)^{T}\cdot\emph{H}^{l}
\end{equation}
where $\hat{\emph{H}}^{l}_{sa}\in\mathcal{R}^{\|\emph{V}_{sa}^{l}\|\times D}$ and $\tilde{\emph{H}}^{l}_{ne}\in\mathcal{R}^{\|\emph{V}_{ne}^{l}\|\times D}$ represent sampled nodes embedding and unique neighbor nodes, respectively.
We then calculate the correlation coefficients for each connected node pair and proceed with the sampling process, which is an integral part of the policy strategy in the proposed model. The adaptive policy-driven sampling process can be written as:
\begin{equation}
\emph{A}^{l}_{\alpha}= \Phi\left[\delta\left(\hat{\emph{H}}^{l}_{sa}\cdot\emph{W}^{l}_{sa}, \left(\tilde{\emph{H}}^{l}_{ne}\cdot\emph{W}^{l}_{ne}\right)^{T}\right)\odot\emph{A}^{l}\right]
\end{equation}
$\delta\left(\cdot\right)$ denotes the coefficient function, which is used to quantify the correlations of each sampled node with different neighbor nodes. Instead of applying coefficient function directly on sampled node embedding $\hat{\emph{H}}^{l}_{sa}$ and neighbor node embedding $\tilde{\emph{H}}^{l}_{ne}$, we utilize two learnable weight matrices $\emph{W}^{l}_{sa}$ and $\emph{W}^{l}_{ne}$ to conduct further linear transformations in which embedding space for both sampled and neighbor nodes can be approximated separately at that layer throughout the training. Towards optimizing two transformation matrices for both sampled and neighbor node embeddings, our model can adaptively uncover better correlations through designated operations (e.g., multiplicative, normalized cosine or distance based operations, etc.) in the transformed embedding space. The Hadamard product operator $\odot\left(\cdot\right)$ is employed to only retain the connected node pairs. $\Phi\left(\cdot\right)$ is the policy function that confines a pre-defined budget on the
sample size, from which the computation complexity can be bound easily. In this paper, we implement $\emph{top}\left(K,\cdot\right)$ in row-wise fashion as the policy to only selects neighbors deemed important in this case, and $K$ is the sample budget. $\emph{A}^{l}_{\alpha}$ is the calculated correlation matrix at that layer, and $\alpha_{i, j}^l \in \emph{A}^{l}_{\alpha}$ has also been visually shown in Figure~\ref{fig:demo}(b).
Following that, we have $\hat{\emph{h}}^{l}_{i}\in\hat{\emph{H}}^{l}_{sa}$ to represent embedding of each sampled node, where $i\in\{1,...,\|\emph{V}_{sa}^{l}\|\}$. The message aggregation from layer $l$ to $l+1$ can be formalized as:
\begin{equation}
\hat{\emph{h}}_{i}^{l+1} = \sigma\left(\emph{W}^{l+1}_{agg}\cdot\left(\hat{\emph{h}}_{i}^{l}\oplus\frac{1}{\|\emph{V}_{ne}^{l}\|}\sum_{j=1,..,\|\emph{V}_{ne}^{l}\|}\alpha_{i,j}^{l}\tilde{\emph{h}}_{j}^{l}\right)\right)
\end{equation}
where $\tilde{\emph{h}}^{l}_{j}\in\tilde{\emph{H}}^{l}_{ne}$, $\oplus$ denotes the concatenation operator, and $\sigma$ is the nonlinear activation function (e.g., ReLu). Note we use $\|\emph{V}_{ne}^{l}\|$ as the regularizer after aggregating messages from neighbor nodes. $\emph{W}^{l+1}_{agg}$ is a shared weight matrix at that layer and applied on every sampled node before updating its embedding.
\paragraph{Graph-level Representation}To derive the final graph representation from the node embeddings, we design the \textit{READOUT} operation as follows:
\begin{equation}
\emph{z}^{\mathcal{G}} = MEAN\left(MLP\left(\emph{X}^{0}\oplus\emph{H}^{L}\right)\right)
\end{equation}
Instead of simply taking the mean of all node embeddings, we first input the embedding matrix to a shallow multi-layer perception (MLP), the design of this MLP could be found in the experimental setup in Section 4. The row-wise $MEAN$ operation is then applied on the output of the MLP, as shown in Figure~\ref{fig:demo}(c). For notational convenience, we use $\hat{\emph{h}}_{i}^{L} \in H^L$ to denote the final node representations.
In order to learn graph representation in the fully supervised setting, we apply a graph-based cross entropy loss onto the graph-level output $\emph{z}^{\mathcal{G}}$. The gradient-based adjustments for all trainable parameters mentioned above achieve two goals: 1) to select the neighbor nodes with the best interests adaptively; 2) to approach the suitable latent embedding space gradually.
\begin{equation}
\mathcal{L}\left(\emph{z}^{\mathcal{G}},\emph{y}^{\mathcal{G}}\right) = -\sum_{i}\left[\emph{y}^{\mathcal{G}}_{i}\cdot\log\emph{z}^{\mathcal{G}}_{i} + \left(1-\emph{y}_{i}^{\mathcal{G}}\right)\cdot\log\left(1-\emph{z}^{\mathcal{G}}_{i}\right)\right]
\end{equation}
where the loss $\mathcal{L}$ of graph output $\emph{z}^{\mathcal{G}}$ is calculated against corresponding label $\emph{y}^{\mathcal{G}}$, and $i$ means $i$th logits at that index.
\begin{algorithm}[t!]
\caption{GPS training algorithm}
\label{alg:algorith}
\begin{algorithmic}[1]
\REQUIRE Graph $\mathcal{G} = \left(\mathcal{V},\mathcal{E}\right)$; label $\emph{y}^{\mathcal{G}}$; sampling hyperparameter $K$; total message passing layers $L$
\ENSURE Embedding representation of graph $z^\mathcal{G}$
\STATE $\emph{V}_{sa}^{0}$ $\leftarrow$ root nodes $\emph{V}_{rt} \subseteq \mathcal{V}$
\FOR{l = 1,..$L$}
\STATE $\emph{V}_{sa}^{l}$ $\leftarrow$ Sampled nodes from previous layer $\emph{V}_{sa}^{l-1}$
\STATE $\emph{V}_{ne}^{l}$ $\leftarrow$ All neighbor nodes of $\emph{V}_{sa}^{l}$
\STATE $\emph{A}^{l}$ $\leftarrow$ Generate layer-wise adjacency (eq.(1))
\STATE $ \emph{A}^{l}_{\alpha}$ $\leftarrow$ Policy-driven adaptive sampling according to eq.(4) with adjustable parameter $K$
\STATE $\hat{\emph{H}}^{l}_{sa}$ $\leftarrow$ Embedding update through eq.(5)
\STATE $\emph{V}_{sa}^{l}$ $\leftarrow$ Update sampled nodes from $\emph{A}^{l}_{\alpha}$ for next layer
\ENDFOR
\STATE $\emph{z}^{\mathcal{G}}$ $\leftarrow$ Graph-level representation from eq.(6)
\STATE Calculate loss from eq.(7), and update all trainable weights.
\end{algorithmic}
\vspace{-1.6mm}
\end{algorithm}
Algorithm~\ref{alg:algorith} illustrates the training process of one graph using GPS. There are a few pre-processing to nodes before the training starts, including the generation of sampled nodes and neighbor nodes (lines 1, 3 and 4, respectively). We want to point out that the initial sampled nodes at layer 0 comprise either a subset nodes or all nodes in the graph, depending on the size of the input graph. Line 5 constructs the layer-wise adjacency, and the sampled version of which is then generated at line 6. It can be interpreted that the algorithm only allows the neighbors deemed important to contribute to the update of embeddings of parental nodes (line 7), and the influence of the sampling parameter $K$ is studied in the next section. Note that the algorithm only passes the sampled nodes to the next-hop layer (line 8). Afterwards, the graph-level representation is composed at line 10, and all trainable weights are updated by minimizing the loss at line 11. The use of optimizer is shown in Table~\ref{tab:hyperpara}.
\paragraph{Discussion} The advantage of GPS is twofold. First, the sampling is guided by the designated adaptive sampling policy, enabling a more effective message propagation than GraphSAGE, whose node representations are generated through random sampling of neighborhoods of each node. Other importance-based sampling works adopt a different strategy, where inter-node probabilities need to be calculated and optimized to reduce the variance caused by sampled nodes~\cite{huang2018adaptive,graphsaint}. However, this line of work incurs a significant computation overhead in AS-GCN~\cite{huang2018adaptive}. The latest work GraphSAINT splits sampled nodes and edges from a bigger graph into subgraphs on which the GCN is applied, causing unstable performance on small molecular graphs (details unveiled in the experiment part). GPS, on the other hand, enjoys a more stable performance and high accuracy at the same time.
\section{Experiment}
The performance of the proposed GPS is evaluated on the real-world molecular datasets for graph classification tasks (e.g., prediction of toxicity of molecular compounds). Also, we present a detailed analysis of the obtained results, aiming to answer the following key questions: \textbf{Q1} (Performance Comparison): Does our proposed method outperform the state-of-the-art baseline methods using the real-world molecular graph dataset? \textbf{Q2} (Sensitivity Analysis): How does the change of sampling parameter $K$ affect the final results? \textbf{Q3} (Ablation Study): To what extent the key component (e.g., correlation coefficient function $\delta$) contribute to the performance of our model?
\subsection{Dataset}
As the majority of the GNN-based embedding works tend to verify their methods on node classification tasks, where one large graph is given and smaller graphs are then generated from it through mini-batch splitting~\cite{gat,graphsage,graphsaint} (e.g., Cora, Citeseer, Pubmed etc.). We study the graph-level classification task instead, and five different molecular datasets are selected as the benchmark datasets~\cite{wu2018moleculenet}: 1) BBBP records a collections of compounds that whether carry the permeability property to the blood-brain barrier; 2) ClinTox compares FDA approved drugs against terminated drugs due to the toxicity during clinical trials; 3) SIDER involves a list of marketed drugs along with their side effects; 4) BACE collects compounds that acts as the inhibitors of human $\beta$-secretase 1; 5) Tox21 is a widely used public compounds dataset, recording the toxicity of each compound.
As explained in Section 3, we first conduct the pre-processing of the data, which generates the standard input for both our model and other benchmark GNN models (Figure~\ref{fig:demo}(a)), including the initial node feature and adjacency matrix of each graph. Note that GTransformer produces a 8 dimension feature vector for each node in the graph~\cite{rong2020self}. We follow the inductive data setup and randomly split molecular graphs into 80/10/10 partitions for training, validation and test, where the graphs in test partitions remain unobserved throughout the training process. The overview of the characteristics of different datasets\footnote{http://moleculenet.ai/datasets-1} can be seen in Table~\ref{tab:dataset}.
\begin{table}[t!]
\vspace{-1mm}
\centering
\resizebox{0.7\linewidth}{!}{
\begin{tabular}{c||c}
\hline
Name & \ Setup\\
\hline
\hline
Readout func & 2 linear layers, 1 output layer \\
Loss func & cross entropy loss \\
Optimizer & Adam~\cite{kingma2014adam}\\
Learning rate & 15e-4 \\
Epochs & 10 \\
Layer depth & 2 \\
Weigh initializer & Xavier~\cite{glorot2010understanding}\\
\hline
\end{tabular}
}
\caption{Shared model setup}
\label{tab:hyperpara}
\vspace{-4mm}
\end{table}
\begin{table}[t!]
\centering
\resizebox{0.9\linewidth}{!}{
\begin{tabular}{c||c|c|c|c}
\hline
Dataset & \# of Graphs & \# of Nodes (Avg.) & \# of Edges (Avg.) & \# of Classes\\
\hline
Tox21 & 7831 & 18.51 & 25.94 & 12 \\
SIDER & 1427 & 33.64 & 35.36 & 27 \\
ClinTox & 1478 & 26.13 & 27.86 & 2 \\
BBBP & 2039 & 24.03 & 25.94 & 1 \\
BACE & 1513 & 34.09 & 36.89 & 1 \\
\hline
\end{tabular}
}
\caption{Summary of molecular datasets}
\label{tab:dataset}
\vspace{-6mm}
\end{table}
\subsection{Experimental Setup}
\paragraph{Baseline Models}To ensure a fair comparison for predictive tasks on graphs, we re-implement other four baseline models (GCN~\cite{gcn} and GAT~\cite{gat} as conventional GNN models, GraphSAGE~\cite{graphsage} and GraphSAINT~\cite{graphsaint} as sampling-based ones) with the shared model setup using Pytorch\footnote{https://pytorch.org}, including the same layer depth, readout function for graph-level embedding, loss function, Adam optimizer, epochs, and weight initializer. The shared model setup is summarized in Table~\ref{tab:hyperpara}. Note GraphSAINT achieves state-of-the-art results prior our work. In addition, we implement the normalized cosine coefficient (GPS-C), L2 norm distance coefficient (GPS-S) to compare with the default Hadamard product coefficient (GPS) for the ablation study.
\paragraph{Parameter Settings}It is worth mentioning that all baseline models are adapted directly from their officially released code, with the minimum changes possible from their original hyperparameter/architecture setup. As listed in Table~\ref{tab:hyperpara}, we apply the same readout function for all models, with the architecture of shallow MLP as [32, 64, 64]. Note the node embedding size is 32 and final graph embedding size is 64. We select Adam~\cite{kingma2014adam} as the optimizer with the learning rate 15e-4. Also, the layer depth is set to be 2 for all models in the experiment, making it consistent with the best reporting performance for the baseline methods~\cite{graphsage,gcn,gat}. The sample window of GraphSAGE is set to be 3 by default from the released code, and the number of attention heads is 3 in GAT. While the original GraphSAINT samples sub-GCN graphs from one large graph, we adopt the node sampling from the released source code and choose a smaller node budget and node repeat to meet our experimental scenario (15 and 10, respectively)~\cite{graphsaint}. All trainable parameters of the neural network are initialized through Xavier~\cite{glorot2010understanding}.
\paragraph{Evaluation Metrics}We evaluate the performance of all the models on graph classification task through AUC (i.e. Area Under the ROC Curve~\cite{fawcett2006introduction}), which is widely adopted to multi-label classification scenarios. The multi-label AUC score can be formalized as:
\begin{equation}
\emph{AUC}_{mul} = \frac{1}{\left\|\emph{y}\right\|}\sum_{\emph{y}_{i}\in\emph{y}}\emph{AUC}\left(\emph{y}_{i}\right)
\end{equation}
where $\emph{AUC}\left(\emph{y}_{i}\right)$ is the area under the curve of ROC for label $\emph{y}_{i}$, and $\left\|\emph{y}\right\|$ represents the total number of label $\emph{y}$. $\emph{AUC}_{mul}$ is the arithmetic average of all labels.
\subsection{Evaluation Results}
As shown in Table~\ref{tab:hyperpara}, we use a shallow MLP (2 linear layers and 1 output layer) as the readout function to generate final graph-level output, and report the AUC (i.e., Area Under the ROC Curve) scores of all models on graph prediction tasks across five different datasets.
\begin{figure}[t!]
\centering
\includegraphics[width=0.5\textwidth]{img/result1.png}
\vspace{-5mm}
\caption{{Test AUC score at different steps in 10 epochs period. One training epoch is a pass for all graphs in the training set}}
\label{fig:exp_overview}
\vspace{-4mm}
\end{figure}
\paragraph{Performance Comparison (for Q1)} We first look at the performance of our proposed method comparing with other baseline models. Figure~\ref{fig:exp_overview} demonstrates the change of AUC scores from the test set along with the increase of training steps. Note that we record test scores of all unseen graphs for every 200 training graphs as one training step, and the training epoch is set to be 10 for all datasets. We select $K=3$ for our proposed method owing to the reported results, which will be analyzed in detail in the sensitivity analysis part. Compared with four baseline methods, the proposed GPS generally shows higher scores throughout the training.
The best AUC results among all datasets are also recorded and demonstrated in Table~\ref{tbl:bestauc}, in which the highest are marked in bold. Our method outperforms other four baseline models in all datasets in the inductive setting by an average improvement of 4.74\%. In particular, GPS improves the latest reporting sampling model GraphSAINT~\cite{graphsaint} by an average of 6.17\% while demonstrating a much more stable performance throughout the training (as indicated in both Fig.~\ref{fig:exp_overview} and Table~\ref{tbl:bestauc}). Additionally, our method achieves a significant improvement comparing to other conventional (GCN, GAT) and sampling (GraphSAGE) models \textit{w.r.t} the recorded best results, gaining an average increase by 3.7\% on Tox21, 2.8\% on SIDER, 1.07\% on ClinTox, 3.08\% on BBBP, and 8.31\% on BACE respectively. The comparison results with GraphSAGE once again suggest the importance of employing a policy-driven sampling strategy when selecting neighbor nodes rather than using the random sampling seeds.
We also compare our proposed methods with other benchmarks in terms of training speed. As shown in Table~\ref{tbl:time}, GraphSAGE presents the fastest speed owing to less trainable parameters and random sampling strategy. GPS ranks second, showing a small gap with GraphSAGE while significantly improving the AUC score. We also observe splitting a graph into subgraphs in GraphSAINT slows down the training speed, especially for molecular graphs. In general, GPS makes a good balance between training speed and accuracy.
\begin{table}[t!]
\centering
\resizebox{0.5\textwidth}{!}{
\begin{tabular}{|cc|lllll|}
\hline
\multicolumn{2}{|c|}{\multirow{2}{*}{Models}} & \multicolumn{5}{c|}{Best AUC Scores} \\ \cline{3-7}
\multicolumn{2}{|c|}{} & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}Tox21\\ (7831)\end{tabular}} & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}SIDER\\ (1427)\end{tabular}} & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}ClinTox\\ (1478)\end{tabular}} & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}BBBP\\ (2039)\end{tabular}} & \begin{tabular}[c]{@{}l@{}}BACE\\ (1513)\end{tabular} \\ \hline
\multicolumn{1}{|c|}{\multirow{2}{*}{Conventional}} & GCN & \multicolumn{1}{l|}{0.7714} & \multicolumn{1}{l|}{0.6715} & \multicolumn{1}{l|}{0.9021} & \multicolumn{1}{l|}{0.7974} & 0.8958 \\ \cline{2-7}
\multicolumn{1}{|c|}{} & GAT & \multicolumn{1}{l|}{0.7745} & \multicolumn{1}{l|}{0.6577} & \multicolumn{1}{l|}{0.9149} & \multicolumn{1}{l|}{0.7743} & 0.8534 \\ \hline
\multicolumn{1}{|c|}{\multirow{2}{*}{Sampling}} & GraphSAGE & \multicolumn{1}{l|}{0.7742} & \multicolumn{1}{l|}{0.6625} & \multicolumn{1}{l|}{0.9011} & \multicolumn{1}{l|}{0.7506} & 0.7915 \\ \cline{2-7}
\multicolumn{1}{|c|}{} & GraphSAINT & \multicolumn{1}{l|}{0.7337} & \multicolumn{1}{l|}{0.6579} & \multicolumn{1}{l|}{0.9198} & \multicolumn{1}{l|}{0.7856} & 0.7736 \\ \hline
\multicolumn{1}{|c|}{\multirow{3}{*}{Our Methods}} & GPS-D & \multicolumn{1}{l|}{0.7876} & \multicolumn{1}{l|}{0.6572} & \multicolumn{1}{l|}{0.9200} & \multicolumn{1}{l|}{0.7936} & 0.7840 \\ \cline{2-7}
\multicolumn{1}{|c|}{} & GPS-C & \multicolumn{1}{l|}{0.7927} & \multicolumn{1}{l|}{0.6869} & \multicolumn{1}{l|}{0.9130} & \multicolumn{1}{l|}{0.8285} & 0.8290 \\ \cline{2-7}
\multicolumn{1}{|c|}{} & \begin{tabular}[c]{@{}c@{}}\textbf{GPS} (default)\end{tabular} & \multicolumn{1}{l|}{\textbf{0.8005}} & \multicolumn{1}{l|}{\textbf{0.6905}} & \multicolumn{1}{l|}{\textbf{0.9202}} & \multicolumn{1}{l|}{\textbf{0.8566}} & \textbf{0.9117} \\ \hline
\end{tabular}
}
\caption{Best AUC results (higher is better)}
\label{tbl:bestauc}
\vspace{-6mm}
\end{table}
\paragraph{Sensitivity Analysis of Sampling Parameter (for Q2)}We study the impact of sampling parameter $K$ on the overall performance of GPS and explain why we select $K=3$ in the preceding part. As clearly seen in Figure~\ref{fig:topk}, we test different $K$ on all datasets and observe an increasing performance of the model at the beginning. Interestingly, it reaches the best score when $K = 3$ with fluctuation or slight decline afterwards(circled in dashed line). Intuitively, it proves the concept that important neighbor nodes carry most of the topological properties of the graph especially in small molecular graphs, and the traversal to the whole neighborhood may not be needed. This also indicates that the increase of $K$ adds extra noise when updating the node embeddings through message aggregation and thus deteriorate on the unseen graphs in the test set.
\paragraph{Ablation Study (for Q3)}To answer \textbf{Q3}, we implement the variants of GPS, i.e., GPS-D and GPS-C, by replacing the element-wise dot product to L2 norm distance-based and the normalized cosine-based coefficient, all of which are considered as the common strategy when it comes to measuring the correlation scores between vectors~\cite{luo2018cosine}. As indicated in Table~\ref{tbl:bestauc}, the default GPS, which uses the element-wise dot product as the coefficient function in eq.(4), achieves a better performance on all dataset compared with varients GPS-D and GPS-C. Specifically, it improves by an average of 1.03\% on Tox21, 1.84\% on SIDER, 0.37\% on ClinTox, 4.55\% on BBBP, and 10.52\% on BACE. We also observe that the use of simple dot product-based coefficient function requires less computation times when conducting the matrix operations compared to the other two variants.
\begin{table}[t!]
\centering
\resizebox{0.8\linewidth}{!}{
\begin{tabular}{l||lllll}
\hline
Method & Tox21 & SIDER & ClinTox & BBBP & BACE \\ \hline\hline
GCN & 75.44 & 21.72 & 18.86 & 21.01 & 17.27 \\ \hline
GAT & 433.03 & 96.72 & 87.82 & 87.12 & 67.76 \\ \hline
GraphSAGE & 48.12 & 13.41 & 16.13 & 18.55 & 15.09 \\ \hline
GraphSAINT & 337.82 & 75.21 & 65.65 & 68.27 & 54.66 \\ \hline
\textbf{GPS} & \textbf{69.74} & \textbf{18.10} & \textbf{16.92} & \textbf{20.21} & \textbf{17.09} \\ \hline
\end{tabular}
}
\caption{CPU execution time per epoch (second)}
\label{tbl:time}
\vspace{-6mm}
\end{table}
\begin{figure}[t!]
\centering
\includegraphics[width=0.85\linewidth]{img/sensitivity2.png}
\vspace{-5mm}
\caption{The best AUC score on among different datasets with the change of $K$}
\label{fig:topk}
\vspace{-6mm}
\end{figure}
\section{Conclusion}
We present the GPS work in this paper, in which a novel adaptive sampling strategy is designed to generate embeddings effectively for both unseen nodes and graphs. By incorporating the importance-based policy into the sampling process, GPS is able to achieve state-of-the-art performance on graph classification in the inductive setting. The experimental results implicitly prove that our proposed method is able to generalize topological properties of the given graph without knowing the entire graph structure upfront, thus making it easily expandable to larger graphs such as social network or citation network. As future work, an interesting direction is to explore the impact of edge properties in the sampling process, especially for heterogeneous graphs with different edge properties.
\bibliographystyle{named}
| {'timestamp': '2022-01-20T02:11:25', 'yymm': '2112', 'arxiv_id': '2112.14482', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14482'} | arxiv |
\section{Introduction}
Machine Learning is used in a wide range of systems, such as health care \cite{de2018clinically,kourou2015machine}, education \cite{oneto2017dropout,oneto2019learning,papamitsiou2014learning}, financial lending \cite{byanjankar2015predicting,malekipirbazari2015risk}, and social services \cite{now2018litigating,eubanks2018automating}, to facilitate decision making and automate services which has a critical implications to individuals and communities. This extensive use of machine learning creates a growing concern, as algorithms might introduce far-reaching bias that treats individuals or groups unfairly, based on certain characteristics such as age, race, gender, or political affiliation. Thus, it is becoming very important to develop fairness aware algorithms.
In recent years many methods have been developed addressing both individual-based and group-based fairness. Most of the works tackles issues of discovering discrimination, and adding solutions to eliminate such discrimination to have fair and accurate decisions \cite{zhang2019fairness,zliobaite2015survey}. The bias mitigation approaches on either the training data or the learned model can be categorized into three main groups \cite{d2017conscientious}: $(1)$ Pre-processing approaches such as reweighting \cite{calders2009building}, massaging \cite{kamiran2009classifying}, aiming to eliminate discrimination at the data level; $(2)$ In-processing algorithms such as \cite{bhaskaruni2019improving,kamiran2010discrimination} addressing discrimination by modifying algorithms; $(3)$ post-processing methods such as \cite{hajian2015discrimination,kamiran2010discrimination} take the learned model and change the predicted labels appropriately to meet fairness requirements.
Algorithms proposed recently in bias mitigation has focused on neural networks. However, the efficiency and explainability of tree ensembles for many applications makes them preferable to be implemented in many areas. Even though there are few works focused on studying fairness for trees and tree ensembles, notably \cite{kamiran2010discrimination,raff2018fair,zhangfaht,grari2020achieving}, most of them are focused on single decision tree classifiers and in-processing approaches. Our interest mainly lies in developing fair random forest classifiers with post-processing approaches designed to relabel leaves with accuracy and discrimination constraints. We take advantage of implementing a post-process approach, in which we do not require to know the training process.
{\bf Contributions.}
We focus on decision tree ensembles for binary classification tasks susceptible to group discrimination
with respect to attributes sensitive classes such as age, gender, race, etc.
We propose a post-processing approach named EiFFFeL --Enforcing Fairness in Forests by Flipping Leaves-- that given a forest,
however trained, selects a subset of its leaves and changes their predictions so as to reduce the discrimination degree of the forest.
We summarize the main contributions of our work as follows.
\begin{enumerate}[noitemsep,topsep=4pt]
\item We propose an iterative leaf flipping post-processing algorithm to ensure group fairness .
\item We devise tree-based and leaf-based flipping methodologies on top of random forest classifier to enforce fairness.
\item We report experimental evaluations of group fairness on three different datasets, aiming to empirically show the effectiveness of our method.
\end{enumerate}
\section{Fairness in Machine Learning}
Without loss of generality, we consider a binary classifier $g:\mathcal{X \to Y}$ that maps an input feature vector $\bm{x} \in \mathcal{X}$ to a binary class label $y \in \mathcal{Y} = \{0,1\}$.
Among the attributes in the feature space $\mathcal{X}$,
a binary attribute called \textit{sensitive feature} ${S} \in \{0,1\}$ identifies the aspects of data which are socio-culturally precarious for the application of machine learning. Specifically, given $x \in \mathcal{X}$ and $x.S$ the value of the sensitive attribute $S$ for the given instance, if $x.S=0$ then we say that $x$ belongs to the \textit{unprivileged group} that could possibly be discriminated.
\subsection{Fairness and Discrimination Definitions}
To achieve non-discriminatory and fair machine learning model, it is essential to first define \textit{fairness}. In a broad context, fairness can be seen from an individual or a group point of view. \textit{Individual fairness} requires that similar individuals being treated similarly.
\textit{Group fairness} requires fairness of the classification model to apply on the two groups, defined through the binary sensitive feature $S$ \cite{dwork2012fairness}. Our work focuses on group fairness, in which a group of individuals identified by $S$ risks for experiencing discrimination.
We define the discrimination of a classifier measured by \textit{group fairness} as follows.
Recall that attribute $S=0$ identifies the unprivileged group, while $S=1$ corresponds to the privileged one, whose members are not discriminated but rather favoured by a learnt ML model.
Moreover, we assume that the values $1$ and $0$ of class label $Y$ represent \textit{favorable} and \textit{unfavorable} outcomes, respectively. For example, $Y=1$ might correspond to the decision of granting a loan, thus favouring a bank customer.
A classifier $g$ applied over $x \in \mathcal{X}$ is non-discriminatory if its prediction $g(\bm{x})$ is statistically independent of the sensitive attribute $S$. Hence, a classifier is fair if both groups have equal probability of being classified as belonging to the favorable class, which is the desirable outcome.
Using the problem formalization by \cite{kamiran2010discrimination}, the discrimination of a model $g$ with respect to a sensitive attribute $S$ and a dataset $\mathcal{D}=\{(\bm{x}_i, y_i)\}_{i=1}^N$ can be computed as follows:
\begin{multline*}
disc_{\mathcal{D},S,g} := \frac{|\{ (\bm{x},y) \in \mathcal{D} ~|~ \bm{x}.S=1 \wedge g(\bm{x})=1\}|}{|\{(\bm{x},y) \in \mathcal{D}~|~ \bm{x}.S=1\}|}\\ - \frac{|\{(\bm{x},y) \in \mathcal{D}~|~ \bm{x}.S=0 \wedge g(\bm{x})=1\}|}{|\{ (\bm{x},y) \in \mathcal{D} ~|~ \bm{x}.S=0 \}|} ,
\end{multline*}
\noindent where $\bm{x}.S$ refers to the sensitive attribute of the instance $\bm{x}$. When $S$ and $\mathcal{D}$ are clear from the context we simply use the notation $disc_g$.
To clarify the above definition, let's consider the case of a classifier $g$ used by the HR staff of a company. The classifier $g$ suggests hiring when $g(\bm{x})=1$ vs.\ not hiring when $g(\bm{x})=0$. We may wonder whether the classifier favours \textit{men} ($S=1$) over \textit{women} ($S=0$). The value of $disc_g$ is large if the ratio of men with a favorable hiring prediction is larger than the ratio of women with a favorable hiring prediction.
By minimizing $disc_g$ we can provide a fairer classifier w.r.t.\ the gender attribute.
\subsection{Related Works}
Notably, in recent years works identifying and solving bias in machine learning algorithms have progressed. \textit{Pre-processing}, \textit{in-processing}, and \textit{post-processing} approaches have been used to mitigate and quantify bias coming from training data, learning algorithms, or the interaction between the twos.
Algorithms which are identified in the \textit{Pre-processing} category deal with discrimination at the dataset level by altering its distribution to ensure there is no bias against a specific group or individual. This can be achieved by removing the sensitive attribute, re-sampling the data, or changing class labels. One of the well known pre-processing method is massaging \cite{kamiran2009classifying}, which changes the class labels of a subset of carefully selected instances. Another work in this category is re-weighting \cite{calders2009building}, which assigns different weights to different groups of the dataset to reduce bias. A re-sampling approach in \cite{calmon2017optimized} limits the sample size to control discrimination.
In the \textit{In-processing} bias mitigation algorithms, discrimination is accounted during the training phase of the learning algorithm. Strategies in this group take different approaches to discount discrimination by including fairness penalty into the loss function such as in \cite{zafar2017fairness}, which integrates decision boundary covariance constraint for logistic regression. In \cite{aghaei2019learning} regularization terms are added to penalize discrimination in mixed-integer optimization framework of decision tree. Another interesting work is \cite{calders2010three}, which proposes three approaches for fairness-aware Na\"ive Bayes classifiers. The approaches are: altering the decision distribution until there is no more discrimination, building a separate model for each sensitive group to remove the correlation between sensitive attribute and class label, and adding latent variable representing unbiased label.
Kamiran \textit{et al.} \cite{kamiran2010discrimination} included a discrimination factor into the information gain splitting criterion of a single decision tree classifier by considering the split of a node under the influence of a sensitive feature, i.e., before a node split happens not only the usual purity w.r.t.\ to the target label is calculated, but also the purity of the split w.r.t.\ the sensitive feature. Three alternative splitting criteria are given based on the way discrimination is accounted. The first option is subtracting discrimination gain from accuracy gain, which allows for a split if it is non-discriminatory, second option is an accuracy-discrimination trade-off split where the accuracy gain is divided by discrimination gain to have the final gain value. The third option is adding the accuracy and discrimination gain to decide the best feature to split a node. The authors claim the additive information gain criterion produces a lower discrimination. We also implement this method for the base trees of our forest and evaluate the impact of it to the overall forest discrimination value.
Finally, authors propose an additional relabeling of some leaves of the tree so as to further reduce its discrimination degree.
A recent work, called Distributed Fair Random Forest (DFRF) \cite{fantin2020distributed} exploits randomly generated decision trees and filters them by their fairness before adding them to the forest.
This is achieved through a hyper-parameter fairness constraint, which forces to accept only decision trees with statistical parity below the given threshold. The generation and fairness thresholding of each individual tree can be done in distributed framework that optimizes the trade-of between discrimination and accuracy of the tree before being added to the forest. Furthermore, this algorithm uses randomness constraint to train base trees in which one feature is randomly selected to split a node for building a randomized decision tree.
\textit{Post-processing} mitigation approaches focus on adjusting the final output of the trained model rather than the underline loss function or training data.
The algorithms discussed in \cite{hardt2016equality,pleiss2017fairness} aim at achieving same error rates between privileged and unprivileged groups,
\cite{hardt2016equality} uses equalized odd and equalized opportunity to promote features which are more dependent on the target label than the sensitive attribute. While
in \cite{pleiss2017fairness} the proposed algorithm aims to achieve both privileged and unprivileged groups to have the same false negative rate and false positive rate
by taking into account a calibrated probability estimates.
Another post-processing algorithm called Reject Option based Classification (ROC) \cite{kamiran2012decision} takes in to consideration the decision boundary of classifiers; in a region where uncertainty is high, it gives favorable outcomes to the unprivileged group and unfavorable outcomes to the privileged group to reduce discrimination.
Among the various works, the closest to our proposal is \cite{kamiran2010discrimination}, which relabels leaves of a single tree classifier with a small effect on the model accuracy.
We borrow from this approach and propose a novel algorithm for enforcing fairness in forests of decision trees.
\begin{table}[H]
\centering
\footnotesize
\caption{\label{tab:notation} Notation Summary}
\begin{tabular}{@{}c|p{.6\columnwidth}@{}}
\toprule
Symbol & Meaning \\
\midrule
$\mathcal{D}$ & Dataset \\
$S$ & Sensitive feature\\
$\lambda$ & leaf \\
$\Lambda$ & Set of Leaves to be flipped\\
$disc_{ \mathcal{F}}$ & Forest discrimination\\
$disc_{ \mathcal{T}}$ & Tree discrimination\\
$accu_{ \mathcal{F}}$ & Forest accuracy \\
$\Delta disc_{ \mathcal{\lambda}}$ & change in discrimination after flipping\\
$\Delta accu_{ \mathcal{\lambda}}$ & change on accuracy after flipping \\
$\delta$ & Ratio of change in accuracy and discrimination \\
\bottomrule
\end{tabular}
\end{table}
\section{The EiFFFel Algorithm}
We propose a novel post-processing algorithm named EiFFFeL that, given a forest of decision trees for a binary classification task, modifies the prediction of a carefully chosen set of leaves so as to reduce the forest's discrimination degree.
This process is named leaf relabeling, or, since we are focusing on a binary prediction task, \emph{leaf flipping}.
The rationale is to flip the prediction of the leaves that contribute the most to the model discrimination degree so as to make them fair.
Recall that the score $disc_{\mathcal{D},S,g}$ adopted to evaluate the model's discrimination depends on the number of privileged/unprivileged instances with a favorable prediction.
Therefore, by flipping a leaf label we can increase or decrease the number of instances that contribute to the discrimination score.
Note that, while leaf relabeling can be done judiciously so as to reduce discrimination, modifying the leaf predictions determined at training time may reduce the accuracy of the whole forest.
Therefore the goal of EiFFFeL is to find a sweet-spot in the accuracy vs.\ discrimination trade-off.
While leaf relabeling was introduced by \cite{kamiran2010discrimination} for a single tree, we improve such strategy and extend it to a forest of decision trees.
In this work we focus on Random Forests ensembles, which, for their high accuracy and limited bias, are an optimal candidate for building a fair classifier. The approach is however general and we leave to future work the application to other tree ensembles, such as those obtained by bagging and boosting approaches.
The proposed EiFFFel algorithm accepts a user-defined maximum discrimination constraint $\epsilon$ and a minimum relative accuracy drop constraint $\alpha$.
Given a forest $\mathcal{F}$, it iteratively modifies the prediction associated with a subset of the leaves of $\mathcal{F}$, until either the desired discrimination $\epsilon$ is achieved, or the maximum required accuracy drop $\alpha$ is hit.
Below we first illustrate the \emph{Leaf Scoring} strategy used to find the most discriminative leaves of a tree, and then we illustrate two variants of the EiFFFeL algorithm.
\begin{algorithm}[t]
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\caption{\sc Score\_Leaves}
\label{alg:getL}
\begin{algorithmic}[1]
\small
\REQUIRE Decision Tree $\mathcal{T}$ \\ Dataset $\mathcal{D}$ \\ Sensitive feature $S$
\ENSURE Candidate flipping leaves $\Lambda$
\STATE $\Lambda \gets \emptyset$
\FORALL{$\lambda \in \mathcal{T} ~|~ \neg \lambda.flipped$}
\STATE $\Delta accu_{ \lambda}\gets -abs\left( \frac{ | \mathcal{D}^\lambda_{y= 1} | - |\mathcal{D}^\lambda_{y= 0 }| }{|\mathcal{D}|} \right)$ \label{lst:line:line4}
\STATE $\Delta disc_{\lambda} \gets sign\left(| \mathcal{D}^\lambda_{y=1} | - |\mathcal{D}^\lambda_{y=0} |\right)\cdot\left( \frac{ |\mathcal{D}^\lambda_{S=1} |}{|\mathcal{D}_{S=1} |}
- \frac{|\mathcal{D}^\lambda_{S=0}|}{|\mathcal{D}_{S=0}|} \right) $ \label{lst:line:line3}
\STATE $\delta \gets \frac{\Delta disc_{\lambda}}{\Delta accu_{ \lambda}}$ \label{lst:line:line5}
\IF{$\delta \geq 0$}
\STATE $\lambda.score \gets \delta$
\STATE $\Lambda \gets \Lambda \cup \{\lambda\}$
\ENDIF
\ENDFOR
\RETURN $\Lambda $
\end{algorithmic}
\end{algorithm}
\subsection{Leaf Scoring}
EiFFFeL borrows from \cite{kamiran2010discrimination} a simple strategy for scoring leaves according to their impact $\Delta accu_{ \lambda}$ and $\Delta disc_{ \lambda}$ on accuracy and discrimination respectively. Then, the ratio $\delta$ between the two is used as a score to greedily select the best leaves to be \emph{flipped}.
We proceed as described in Alg.~\ref{alg:getL}.
We consider only leaves of the tree that were not flipped during previous iteration of the EiFFFeL algorithm (see subsection below). For those leaves we compute the accuracy and discrimination variation in the case of flipping the leaf prediction. We illustrate shortly the computations below, please refer to \cite{kamiran2010discrimination} for a more detailed description.
The change in accuracy $\Delta accu_{ \lambda}$ clearly depends on the number of instances of $\mathcal{D}$ that fall into the leaf $\lambda$ denoted with $\mathcal{D}^\lambda$. The training process sets the leaf prediction to the majority class among such instances. Therefore, when flipping the leaf prediction the accuracy may only decrease depending on the instances with label $1$ and $0$, denoted by $\mathcal{D}^\lambda_{y=1}$ and $\mathcal{D}^\lambda_{y=0}$ respectively. The difference between the size of these two sets results in the accuracy loss as computed in line~\ref{lst:line:line4}.
The change in discrimination $\Delta disc_{ \lambda}$ depends on the number of privileged and unpriviledged instances that fall in the leaf $\lambda$ respectively denoted by $\mathcal{D}^\lambda_{S=1}$ and $\mathcal{D}^\lambda_{S=0}$, and on their analogous on the whole dataset $\mathcal{D}_{S=1}$ and $\mathcal{D}_{S=0}$. If the leaf prediction equals $1$ (favourable class), then increasing $\mathcal{D}^\lambda_{S=1}$ would increase the discrimination, while increasing $\mathcal{D}^\lambda_{S=0}$ would decrease it. The opposite holds if the prediction of the leaf equals $0$ (unfavourable class). As the original leaf prediction depends on the majority of the instances between $\mathcal{D}^\lambda_{y=1}$ and $\mathcal{D}^\lambda_{y=0}$, the sign of their difference is used to correct the above contributions as computed in line~\ref{lst:line:line3}.
The ratio $\delta=\Delta disc_{ \lambda}/\Delta accu_{ \lambda}$ is positive if the flipping generates a discrimination drop, and it is large if the benefit to discrimination is larger than the harm to accuracy. If the value of $\delta$ is positive, then this is stored with the leaf $\lambda$, and $\lambda$ is recorded into the set of candidate leaves $\Lambda$. The set $\Lambda$ is eventually returned and exploited during the iterations of EiFFFeL.
\subsection{EiFFFeL Leaf Flipping Strategies}
By exploiting the scoring technique discussed before, we propose two strategies to choose which trees and which leaves in those trees to flip.
The first strategy, named \textit{Tree-based Flipping}, is illustrated in Alg.~\ref{alg:mlr}.
During each iteration of EiFFFeL, the tree $\mathcal{T}^\dagger$ with the largest discrimination degree is greedily selected: this is the best tree to be attacked in order to significantly reduce the discrimination of the full forest. Then, we use the previous scoring technique to find the set of leaves $\Lambda$ in $\mathcal{T}^\dagger$ that should be relabeled. If $\Lambda$ is not empty, the predictions $\lambda.pred$ of such leaves will be flipped. Then, the whole tree is marked as already flipped. The selection is repeated by considering only the remaining non-flipped trees. The algorithm ends when all trees have been flipped, or when the desired discrimination $\epsilon$ is achieved, or when tolerated accuracy drop $\alpha$ is met. Note that the accuracy drop is computed by comparing the accuracy of the original forest with the accuracy of the current forest after the flipping step.
\begin{algorithm}[t]
\small
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\caption{EiFFFeL-TF (Tree-based Flipping)}
\label{alg:mlr}
\begin{algorithmic}[1]
\REQUIRE Random Forest classifier $\mathcal{F}$ \\ Discrimination Constraint $\epsilon \in [0,1]$ \\ Accuracy Constraint $\alpha \in [0,1]$ \\ Training Dataset $\mathcal{D}$ \\ Sensitive feature $S$
\ENSURE Fair Random Forest $\mathcal{F}$
\FORALL{$\mathcal{T} \in \mathcal{F}$}
\STATE{$\mathcal{T}.flipped \gets false$}
\FORALL{$\lambda \in \mathcal{T}$}
\STATE{$\lambda.flipped \gets false$}
\ENDFOR
\ENDFOR
\STATE $accu_{ \mathcal{F}}^*\gets \frac{ | \mathcal{D}_{y= 1} \wedge \mathcal{F}(\bm{x})=1 |~+~ |\mathcal{D}_{y= 0 }\wedge \mathcal{F}(\bm{x})=0| }{|\mathcal{D}|} $
\STATE{$\Delta accu_{\mathcal{F}} \gets 0$}
\WHILE{$|\{\mathcal{T} \in \mathcal{F} ~|~ \neg\mathcal{T}.flipped\}|>0 \wedge\hfill \hspace*{\fill}\linebreak
\hspace*{3em}\ disc_{\mathcal{D},S,\mathcal{F}} > \epsilon\ \wedge\ \Delta accu_{\mathcal{F}} < \alpha$}
\STATE $\mathcal{T}^\dagger \gets \argmax_{\mathcal{T} \in \mathcal{F}}\ disc_{\mathcal{D},S,\mathcal{T}}$
\STATE $\Lambda \gets$ {\sc Score\_Leaves($\mathcal{T}^\dagger,\mathcal{D},S$)}
\IF{$\Lambda\neq\emptyset$}
\FORALL{$\lambda \in \Lambda$}
\STATE{$\lambda.pred = 1 - \lambda.pred$}
\ENDFOR
\ENDIF
\STATE{$\mathcal{T}^\dagger.flipped = true$}
\STATE{$accu_{ \mathcal{F}}\gets \frac{ | \mathcal{D}_{y= 1} \wedge \mathcal{F}(\bm{x})=1 |~+~ |\mathcal{D}_{y= 0 }\wedge \mathcal{F}(\bm{x})=0| }{|\mathcal{D}|} $}
\STATE{$\Delta accu_{\mathcal{F}} \gets accu_{ \mathcal{F}}^* - accu_{ \mathcal{F}}$}
\ENDWHILE
\RETURN $\mathcal{F}$
\end{algorithmic}
\end{algorithm}
Such tree-based strategy might be too aggressive, as it immediately flips all the candidate leaves of the selected tree. Indeed, only a few leaves may be sufficient to meet our discrimination and accuracy requirements.
Therefore we propose a second strategy, named \textit{Leaf-Based Flipping}, illustrated in Alg~\ref{alg:slr}. As in the former strategy, we first select the tree $\mathcal{T}^\dagger$ with the largest discrimination. Then we use the leaf scoring technique to find a set of candidate leaves from $\mathcal{T}^\dagger$. If such set is empty, e.g., because they were already flipped or they cannot improve the discrimination, the full tree is marked as flipped and the procedure is repeated on the remaining non-flipped trees. Otherwise, the leaf with the largest score $\lambda^\dagger$ is selected, marked as flipped, while its prediction is inverted. The process is repeated until all trees have been flipped, or the desired discrimination $\epsilon$ is achieved, or the tolerated accuracy drop $\alpha$ is met.
We argued that the Leaf-based approach exploits a more fine-grained tuning of the given forest, and therefore it can achieve the desired accuracy with a smaller set of alterations. Indeed, reducing the flips applied to the forest provides a larger accuracy.
\begin{algorithm}[t]
\small
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\caption{EiFFFeL-LF (Leaf-based Flipping)}
\algsetup{linenosize=\small}
\label{alg:slr}
\begin{algorithmic}[1]
\REQUIRE Random Forest classifier $\mathcal{F}$ \\ Discrimination Constraint $\epsilon \in [0,1]$ \\ Accuracy Constraint $\alpha \in [0,1]$ \\ Training Dataset $\mathcal{D}$ \\ Sensitive feature $S$
\ENSURE Fair Random Forest $\mathcal{F}$
\FORALL{$\mathcal{T} \in \mathcal{F}$}
\STATE{$\mathcal{T}.flipped \gets false$}
\FORALL{$\lambda \in \mathcal{T}$}
\STATE{$\lambda.flipped \gets false$}
\ENDFOR
\ENDFOR
\STATE $accu_{ \mathcal{F}}^*\gets \frac{ | \mathcal{D}_{y= 1} \wedge \mathcal{F}(\bm{x})=1 |~+~ |\mathcal{D}_{y= 0 }\wedge \mathcal{F}(\bm{x})=0| }{|\mathcal{D}|} $
\STATE{$\Delta accu_{\mathcal{F}} \gets 0$}
\WHILE{$|\{\mathcal{T} \in \mathcal{F} ~|~ \neg\mathcal{T}.flipped\}|>0 \wedge\hfill \hspace*{\fill}\linebreak
\hspace*{3em}\ disc_{\mathcal{D},S,\mathcal{F}} > \epsilon\ \wedge\ \Delta accu_{\mathcal{F}} < \alpha$}
\STATE $\mathcal{T}^\dagger \gets \argmax_{\mathcal{T} \in \mathcal{F}}\ disc_{\mathcal{D},S,\mathcal{T}}$
\STATE $\Lambda \gets$ {\sc Score\_Leaves($\mathcal{T}^\dagger,\mathcal{D},S$)}
\IF{$\Lambda=\emptyset$}
\STATE{$\mathcal{T}.flipped \gets true$}
\ELSE
\STATE $\lambda^\dagger \gets \argmax_{\lambda \in \Lambda}\ \lambda.score$
\STATE{$\lambda^\dagger.flipped = true$}
\STATE{$\lambda^\dagger.pred = 1 - \lambda.pred$}
\STATE{$accu_{ \mathcal{F}}\gets \frac{ | \mathcal{D}_{y= 1} \wedge \mathcal{F}(\bm{x})=1 |~+~ |\mathcal{D}_{y= 0 }\wedge \mathcal{F}(\bm{x})=0| }{|\mathcal{D}|} $}
\STATE{$\Delta accu_{\mathcal{F}} \gets accu_{ \mathcal{F}}^* - accu_{ \mathcal{F}}$}
\ENDIF
\ENDWHILE
\RETURN $\mathcal{F}$
\end{algorithmic}
\end{algorithm}
\begin{table*}[ht]
\caption{Comparison of accuracy reduction and discrimination decrease on Adult dataset with respect to baseline accuracy of 0.85 and discrimination 0.2.
Along with $\Delta$Accu and $\Delta$Disc, we also report (within parentheses) the final accuracy and discrimination values obtained.
\label{tab:adult}}
\center
\begin{tabular}{ccc|ccc|ccc|ccc|ccc|ccc|ccc|}
\cline{4-15}
& & & \multicolumn{2}{ c|| }{DFRF} & \multicolumn{2}{ c|| }{EOP} & \multicolumn{2}{ c|| }{EiFFFeL-TF} & \multicolumn{2}{ c|| }{EiFFFeL-LF}& \multicolumn{2}{ c||}{EiFFFeL-TF$^{\star}$} & \multicolumn{2}{ c|| }{EiFFFeL-LF$^{\star}$} \\
\cline{4-15}
& & & \multicolumn{1}{ c| }{$\Delta$Accu$\downarrow$} & \multicolumn{1}{ c|| }{$\Delta$Disc $\uparrow$} & \multicolumn{1}{ c| }{$\Delta$Accu$\downarrow$} & \multicolumn{1}{ c|| }{$\Delta$Disc$\uparrow$} &
\multicolumn{1}{ c|}{$\Delta$Accu$\downarrow$} & \multicolumn{1}{ c||}{$\Delta$Disc$\uparrow$} & \multicolumn{1}{ c| }{$\Delta$Accu$\downarrow$} & \multicolumn{1}{ c|| }{$\Delta$Disc$\uparrow$} & \multicolumn{1}{ c| }{$\Delta$Accu$\downarrow$} & \multicolumn{1}{ c|| }{$\Delta$Disc$\uparrow$} &
\multicolumn{1}{ c||}{$\Delta$Accu$\downarrow$} & \multicolumn{1}{ c|| }{$\Delta$Disc$\uparrow$} \\
\toprule
\multicolumn{1}{ |c}{\multirow{4}{*}{Adult} } &
\multicolumn{1}{ |c }{\multirow{4}{*}{\rotatebox[origin=c]{0}{$\epsilon$}}} &
\multicolumn{1}{|c|}{0.01} &
\multicolumn{1}{c|}{{7(0.78)}} & \multicolumn{1}{c||}{{18(0.02)}} &
\multicolumn{1}{ c| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{2(0.83)}}} &
\multicolumn{1}{ c|| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{7(0.13)}}} &
\multicolumn{1}{c|}{4(0.81)} & \multicolumn{1}{c||}{19(0.01)} &
\multicolumn{1}{c|}{{4(0.81)}} & \multicolumn{1}{c||}{\color{blue}{\textbf{20(0)}}}
& \multicolumn{1}{c|}{{6(0.79)}} & \multicolumn{1}{c||}{15(0.05)}
& \multicolumn{1}{c|}{{3(0.82)}} & \multicolumn{1}{c||}{17(0.03)}
\\
\cline{3-5}
\cline{8-15}
\multicolumn{1}{|c}{} & \multicolumn{1}{|c}{} &
\multicolumn{1}{|c|}{0.05} &
\multicolumn{1}{c|}{3(0.82)} & \multicolumn{1}{c||}{13(0.07)} &
\multicolumn{1}{ c| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{}}} &
\multicolumn{1}{ c || }{\multirow{4}{*}{\rotatebox[origin=c]{0}{}}} &
\multicolumn{1}{c|}{3(0.82)} &
\multicolumn{1}{c||}{\color{blue}{\textbf{16(0.04)}}} & \multicolumn{1}{c|}{{2(0.83)}} &
\multicolumn{1}{c||}{{15(0.05)}}
& \multicolumn{1}{c|}{{6(0.79)}} & \multicolumn{1}{c||}{16(0.04)}
& \multicolumn{1}{c|}{{3(0.82)}} & \multicolumn{1}{c||}{\color{blue}{\textbf{16(0.04)}}}
\\
\cline{3-5}
\cline{8-15}
\multicolumn{1}{|c}{} & \multicolumn{1}{|c}{} &
\multicolumn{1}{|c|}{0.10} &
\multicolumn{1}{c|}{4(0.81)} & \multicolumn{1}{c||}{15(0.05)} &
\multicolumn{1}{ c| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{}}} &
\multicolumn{1}{ c|| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{}}} &
\multicolumn{1}{c|}{2(0.83)} & \multicolumn{1}{c||}{12(0.08)} &
\multicolumn{1}{c|}{{1(0.84)}} & \multicolumn{1}{c||}{{\color{blue}{\textbf{12(0.08)}}}}
& \multicolumn{1}{c|}{{1(0.84)}} & \multicolumn{1}{c||}{\color{blue}{\textbf{12(0.08)}}}
& \multicolumn{1}{c|}{{2(0.83)}} & \multicolumn{1}{c||}{10(0.1)}
\\
\cline{3-5}
\cline{8-15}
\multicolumn{1}{|c}{} & \multicolumn{1}{|c}{} &
\multicolumn{1}{|c|}{0.15} &
\multicolumn{1}{c|}{2(0.83)} & \multicolumn{1}{c||}{10(0.1)} &
\multicolumn{1}{ c| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{}}} &
\multicolumn{1}{ c|| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{}}} &
\multicolumn{1}{c|}{0(0.85)} & \multicolumn{1}{c||}{8(0.12)} & \multicolumn{1}{c|}{{0(0.85)}} & \multicolumn{1}{c||}{{ \color{blue}{\textbf{9(0.11)}}}}
& \multicolumn{1}{c|}{{0(0.85)}} & \multicolumn{1}{c||}{7(0.13)}
& \multicolumn{1}{c|}{{0(0.85)}} & \multicolumn{1}{c||}{7(0.13)}
\\
\bottomrule
\end{tabular}
\end{table*}
\begin{table*}[ht]
\caption{Comparison of accuracy reduction and discrimination decrease on Bank dataset with respect to baseline accuracy of 0.82 and discrimination 0.18. Along with $\Delta$Accu and $\Delta$Disc, we also report (within parentheses) the final accuracy and discrimination values obtained.
\label{tab:bank}}
\center
\footnotesize
\begin{tabular}{ccc|ccc|ccc|ccc|ccc|ccc|ccc|}
\cline{4-15}
& & & \multicolumn{2}{ c|| }{DFRF} & \multicolumn{2}{ c|| }{EOP} & \multicolumn{2}{ c|| }{EiFFFeL-TF} & \multicolumn{2}{ c|| }{EiFFFeL-LF}& \multicolumn{2}{ c||}{EiFFFeL-TF$^{\star}$} & \multicolumn{2}{ c|| }{EiFFFeL-LF$^{\star}$} \\
\cline{4-15}
& & & \multicolumn{1}{ c| }{$\Delta$Accu$\downarrow$} & \multicolumn{1}{ c|| }{$\Delta$Disc $\uparrow$} & \multicolumn{1}{ c| }{$\Delta$Accu$\downarrow$} & \multicolumn{1}{ c|| }{$\Delta$Disc$\uparrow$} &
\multicolumn{1}{ c| }{$\Delta$Accu$\downarrow$} & \multicolumn{1}{ c|| }{$\Delta$Disc$\uparrow$} & \multicolumn{1}{ c| }{$\Delta$Accu$\downarrow$} & \multicolumn{1}{ c|| }{$\Delta$Disc$\uparrow$} & \multicolumn{1}{ c| }{$\Delta$Accu$\downarrow$} & \multicolumn{1}{ c|| }{$\Delta$Disc$\uparrow$} &
\multicolumn{1}{ c||}{$\Delta$Accu$\downarrow$} & \multicolumn{1}{ c|| }{$\Delta$Disc$\uparrow$} \\
\toprule
\multicolumn{1}{ |c}{\multirow{4}{*}{Bank} } &
\multicolumn{1}{ |c }{\multirow{4}{*}{\rotatebox[origin=c]{0}{$\epsilon$}}} &
\multicolumn{1}{|c|}{0.01} &
\multicolumn{1}{c|}{{9(0.73)}} & \multicolumn{1}{c||}{{13(0.05)}} &
\multicolumn{1}{ c| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{0(0.82)}}} &
\multicolumn{1}{ c|| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{14(0.04)}}} &
\multicolumn{1}{c|}{7(0.75)} & \multicolumn{1}{c||}{17(0.01)} & \multicolumn{1}{c|}{{10(0.72)}} & \multicolumn{1}{c||}{15(0.03)}
& \multicolumn{1}{c|}{{8(0.74)}} & \multicolumn{1}{c||}{14(0.04)}
& \multicolumn{1}{c|}{{5(0.77)}} & \multicolumn{1}{c||}{10(0.08)}
\\
\cline{3-5}
\cline{8-15}
\multicolumn{1}{|c}{} & \multicolumn{1}{|c}{} &
\multicolumn{1}{|c|}{0.05} &
\multicolumn{1}{c|}{4(0.78)} & \multicolumn{1}{c||}{11(0.07)} &
\multicolumn{1}{ c| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{}}} &
\multicolumn{1}{ c|| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{}}} &
\multicolumn{1}{c|}{3(0.79)} & \multicolumn{1}{c||}{13(0.05)} & \multicolumn{1}{c|}{{8(0.74)}} & \multicolumn{1}{c||}{{14(0.04)}}
& \multicolumn{1}{c|}{{8(0.74)}} & \multicolumn{1}{c||}{13(0.05)}
& \multicolumn{1}{c|}{{5(0.77)}} & \multicolumn{1}{c||}{13(0.05)}
\\
\cline{3-5}
\cline{8-15}
\multicolumn{1}{|c}{} & \multicolumn{1}{|c}{} &
\multicolumn{1}{|c|}{0.10} &
\multicolumn{1}{c|}{4(0.78)} & \multicolumn{1}{c||}{6(0.12)} &
\multicolumn{1}{ c| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{}}} &
\multicolumn{1}{ c|| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{}}} &
\multicolumn{1}{c|}{2(0.80)} & \multicolumn{1}{c||}{10(0.08)} & \multicolumn{1}{c|}{{1(0.81)}} & \multicolumn{1}{c||}{{7(0.11)}}
& \multicolumn{1}{c|}{{7(0.75)}} & \multicolumn{1}{c||}{9(0.09)}
& \multicolumn{1}{c|}{{4(0.78)}} & \multicolumn{1}{c||}{8(0.10)}
\\
\cline{3-5}
\cline{8-15}
\multicolumn{1}{|c}{} & \multicolumn{1}{|c}{} &
\multicolumn{1}{|c|}{0.15} &
\multicolumn{1}{c|}{4(0.78)} & \multicolumn{1}{c||}{9(0.09)} &
\multicolumn{1}{ c| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{}}} &
\multicolumn{1}{ c|| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{}}} &
\multicolumn{1}{c|}{0(0.82)} & \multicolumn{1}{c||}{4(0.14)} & \multicolumn{1}{c|}{{0(0.82)}} & \multicolumn{1}{c||}{{ 4(0.14)}}
& \multicolumn{1}{c|}{{6(0.76)}} & \multicolumn{1}{c||}{5(0.13)}
& \multicolumn{1}{c|}{{2(0.80)}} & \multicolumn{1}{c||}{5(0.13)}
\\
\bottomrule
\end{tabular}
\end{table*}
\begin{table*}[ht]
\caption{Comparison of accuracy reduction and discrimination decrease on Compas dataset with respect to baseline accuracy of 0.69 and discrimination 0.3.
Along with $\Delta$Accu and $\Delta$Disc, we also report (within parentheses) the final accuracy and discrimination values obtained.
\label{tab:compas}}
\center
\footnotesize
\begin{tabular}{ccc|ccc|ccc|ccc|ccc|ccc|ccc|}
\cline{4-15}
& & & \multicolumn{2}{ c|| }{DFRF} & \multicolumn{2}{ c|| }{EOP} & \multicolumn{2}{ c|| }{EiFFFeL-TF} & \multicolumn{2}{ c|| }{EiFFFeL-LF}& \multicolumn{2}{ c||}{EiFFFeL-TF$^{\star}$} & \multicolumn{2}{ c|| }{EiFFFeL-LF$^{\star}$} \\
\cline{4-15}
& & & \multicolumn{1}{ c| }{$\Delta$Accu$\downarrow$} & \multicolumn{1}{ c|| }{$\Delta$Disc $\uparrow$} & \multicolumn{1}{ c| }{$\Delta$Accu$\downarrow$} & \multicolumn{1}{ c|| }{$\Delta$Disc$\uparrow$} &
\multicolumn{1}{ c| }{$\Delta$Accu$\downarrow$} & \multicolumn{1}{ c|| }{$\Delta$Disc$\uparrow$} & \multicolumn{1}{ c| }{$\Delta$Accu$\downarrow$} & \multicolumn{1}{ c|| }{$\Delta$Disc$\uparrow$} & \multicolumn{1}{ c| }{$\Delta$Accu$\downarrow$} & \multicolumn{1}{ c|| }{$\Delta$Disc$\uparrow$} &
\multicolumn{1}{ c||}{$\Delta$Accu$\downarrow$} & \multicolumn{1}{ c|| }{$\Delta$Disc$\uparrow$} \\
\toprule
\multicolumn{1}{ |c}{\multirow{4}{*}{COMPAS} } &
\multicolumn{1}{ |c }{\multirow{4}{*}{\rotatebox[origin=c]{0}{$\epsilon$}}} &
\multicolumn{1}{|c|}{0.01} &
\multicolumn{1}{c|}{{11(0.58)}} & \multicolumn{1}{c||}{{28(0.02)}} &
\multicolumn{1}{ c| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{4(0.65)}}} &
\multicolumn{1}{ c|| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{5(0.25)}}} &
\multicolumn{1}{c|}{25(0.44)} & \multicolumn{1}{c||}{29(0.01)} & \multicolumn{1}{c|}{{5(0.64)}} & \multicolumn{1}{c||}{26(0.04)}
& \multicolumn{1}{c|}{{9(0.60)}} & \multicolumn{1}{c||}{29(0.01)}
& \multicolumn{1}{c|}{{1(0.68)}} & \multicolumn{1}{c||}{7(0.23)}
\\
\cline{3-5}
\cline{8-15}
\multicolumn{1}{|c}{} & \multicolumn{1}{|c}{} &
\multicolumn{1}{|c|}{0.05} &
\multicolumn{1}{c|}{5(0.64)} & \multicolumn{1}{c||}{13(0.17)} &
\multicolumn{1}{ c| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{}}} &
\multicolumn{1}{ c|| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{}}} &
\multicolumn{1}{c|}{12(0.57)} & \multicolumn{1}{c||}{28(0.02)} & \multicolumn{1}{c|}{{5(0.64)}} & \multicolumn{1}{c||}{{22(0.08)}}
& \multicolumn{1}{c|}{{9(0.60)}} & \multicolumn{1}{c||}{28(0.02)}
& \multicolumn{1}{c|}{{1(0.68)}} & \multicolumn{1}{c||}{7(0.23)}
\\
\cline{3-5}
\cline{8-15}
\multicolumn{1}{|c}{} & \multicolumn{1}{|c}{} &
\multicolumn{1}{|c|}{0.10} &
\multicolumn{1}{c|}{4(0.65)} & \multicolumn{1}{c||}{7(0.23)} &
\multicolumn{1}{ c| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{}}} &
\multicolumn{1}{ c|| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{}}} &
\multicolumn{1}{c|}{7(0.62)} & \multicolumn{1}{c||}{21(0.09)} & \multicolumn{1}{c|}{{5(0.64)}} & \multicolumn{1}{c||}{{21(0.09)}}
& \multicolumn{1}{c|}{{1(0.68)}} & \multicolumn{1}{c||}{21(0.09)}
& \multicolumn{1}{c|}{{1(0.68)}} & \multicolumn{1}{c||}{7(0.23)}
\\
\cline{3-5}
\cline{8-15}
\multicolumn{1}{|c}{} & \multicolumn{1}{|c}{} &
\multicolumn{1}{|c|}{0.15} &
\multicolumn{1}{c|}{2(0.67)} & \multicolumn{1}{c||}{6(0.24)} &
\multicolumn{1}{ c| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{}}} &
\multicolumn{1}{ c|| }{\multirow{4}{*}{\rotatebox[origin=c]{0}{}}} &
\multicolumn{1}{c|}{1(0.68)} & \multicolumn{1}{c||}{19(0.11)} & \multicolumn{1}{c|}{{2(0.67)}} & \multicolumn{1}{c||}{{ 15(0.15)}}
& \multicolumn{1}{c|}{{0(0.69)}} & \multicolumn{1}{c||}{16(0.14)}
& \multicolumn{1}{c|}{{1(0.68)}} & \multicolumn{1}{c||}{7(0.23)}
\\
\bottomrule
\end{tabular}
\end{table*}
\section{Experimental Evaluation}
\subsection{Datasets.}
We use datasets publicly available, widely used in fairness literature, concerning binary classification. We pre-process them using one-hot encoding for categorical features, binary encoding of sensitive feature, and removing of instances containing missing values. Moreover, we use an 80/20 training/test split.
\begin{itemize}
\item \textit{Adult}: The Adult UCI income dataset \cite{Dua:2019} contains 14 demographic attributes of more than 45,000 individuals, together with class labels which states whether their income is higher than \$50K or not. As sensitive attribute, we use the \textit{gender} encoded as a binary attribute 1/0 for male/female respectively.
\item \textit{COMPAS}: The COMPAS dataset \cite{angwin2016machine} contains data collected on the use of the COMPAS (Correctional Offender Management Profiling for Alternative Sanctions) risk assessment tool. It contains 13 attributes of more than 7,000 convicted criminals, with class labels that state whether or not the individual reoffend within 2 years of her/his most recent crime. We use \textit{race} as sensitive attribute encoded as a binary attribute 1/0 for Others/African-American, respectively.
\item \textit{Bank}: Bank marketing dataset \cite{moro2014data} contains 16 features about 45,211 clients of direct marketing campaigns of a Portuguese banking institution. The goal is to predict whether the client will subscribe or not to a term deposit. We consider the \textit{age} as sensitive attribute, encoded as a binary attribute 1/0, indicating whether the client’s age is $\geq$25 or $<$25, respectively.
\end{itemize}
\begin{figure*} [ht]
\centering
\includegraphics[width=0.7\textwidth]{Ac_Vs_dis.png}
\caption{ Accuracy vs. discrimination scores after relabeling for constraints $\epsilon=0.01,0.05,0.1,0.15$. }
\label{fig:plot1}
\end{figure*}
\begin{figure*}[ht]
\centering
\includegraphics[width=0.7\textwidth]{Ac_Vs_ep.png}
\caption{Accuracy of the model as a function the $\epsilon$ constraint.}
\label{fig:plot2}
\end{figure*}
\begin{figure*}[ht]
\centering
\includegraphics[width=0.7\textwidth]{Dis_Vs_ep.png}
\caption{Discrimination scores as a function of the $\epsilon$ constraint.}
\label{fig:plot3}
\end{figure*}
\subsection{Experimental Setup.}
We apply our proposed EiFFFeL algorithm over a Random Forest classifier with/without the fair splitting of nodes for individual base trees, and evaluate the performance of the algorithms in terms of model accuracy and discrimination over the three datasets mentioned above.
We compare our results against a DFRF classifier (\textit{Distributed fair random forest}) \cite{fantin2020distributed}, which only includes fair decision trees within the forest. The setting of hyper-parameters of DFRF are the same as the one described in the original work. We use fair split and sensitive feature as hyper-parameters, along with
tree number and maximum tree depth.
Additionally,
we also compare our results against EOP (\textit{Equalized Odds Post-processing}) \cite{hardt2016equality,pleiss2017fairness}, a random forest classifier with the same number of base estimators and maximum depth as ours. After training and achieving the desired equalized odd we score the discrimination in the same approach we used for our experiments.
In conclusion, the comparisons of accuracy and discrimination values are among the following methods:
\begin{itemize}
\item DFRF \cite{fantin2020distributed},\footnote{\url{https://github.com/pjlake98/Distributed-Fair-Random-Forest}} which adds base trees to the forest only if they are fair;
\item EOP \cite{hardt2016equality,pleiss2017fairness},\footnote{\url{https://github.com/Trusted-AI/AIF360/blob/master/aif360/algorithms/postprocessing/calibrated_eq_odds_postprocessing.py}} which adopts a post-processing method based on achieving equalized odds requiring the privileged and unprivileged groups to have the same false negative rate and same false positive rate;
\item our implementations of EiFFFeL-TF and EiFFFeL-LF algorithms, whose post-processing is applied to a plain Random Forest of trees;
\item the same post-processing techniques of EiFFFeL-TF and EiFFFeL-LF applied on top of a random forest with discrimination aware base trees \cite{kamiran2010discrimination}. These versions are denoted by EiFFFeL-TF$^{\star}$ and EiFFFeL-LF$^{\star}$.
\end{itemize}
Finally, the \textit{baseline accuracy} and \textit{discrimination} used to compare the various methods are the ones obtained by a plain Random Forest of trees, trained on the three datasets through the scikit-learn algorithm Random Forest Classifier\footnote{\url{https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html}}. The various EiFFFeL methods are applied to the same baseline Random Forest.
\subsection{Results.}
Tables \ref{tab:adult}), \ref{tab:bank}), and \ref{tab:compas}) compare the decreases in accuracy and discrimination, obtained by the different algorithms, on the three datasets with respect to the baseline results obtained by plain Random Forest models.
Recall that increasing $\epsilon$, we reduce the space for improving discrimination, and as a side effect, we preserves the baseline accuracy. Indeed, in these experiments the accuracy constraint $\alpha$ was set to 1, so that there are no limits in the possible accuracy reduction $\Delta$Accu. This allows us to compare our methods against DFRF and EOP, which do not have this $\alpha$ constraint. Indeed, EOP is completely parameter free, and does not support neither $\alpha$ nor $\epsilon$.
In more details, Tables \ref{tab:adult}), \ref{tab:bank}), and \ref{tab:compas}) report, for different values of $\epsilon$ in the set $\{0.01, 0.05, 0.10, 0.15\}$, the $\Delta$Accu and $\Delta$Disc values obtained by the different algorithms, where $\Delta$Accu and $\Delta$Disc indicate the \textit{absolute difference} in accuracy and discrimination w.r.t. the baselines.
Indeed, we express these $\Delta$ absolute differences in points/hundredths (each point corresponds to $1/100$).
Note that while greater values of $\Delta$Disc are better, greater values of $\Delta$Accu are worse, so a trade-off is needed. In addition, besides the absolute $\Delta$ values, we also report (within parentheses) the final values for accuracy and discrimination score obtained by the various techniques.
For example, for the \textit{Adult} dataset (Table \ref{tab:adult}) and $\epsilon=0.01$, EiFFFeL-TF can reach a very low discrimination score of $0.01$, by only losing $4$ points in accuracy (from $0.85$ of the baseline to $0.81$). In comparison, the best results we can obtain with DFRF in terms of discrimination is a score of $0.02$, by losing 7 points in accuracy (from $0.85$ of the baseline to $0.78$). Overall, our algorithms are capable of reducing discrimination better than DFRF while maintaining the same accuracy. Also EOP does not work well, as the best discrimination score is only $0.13$, by losing 2 points in accuracy. In addition, using $\epsilon=0.15$ for EiFFFeL-TF and EiFFFeL-LF (also EiFFFeL-TF$^{\star}$ and EiFFFeL-LF$^{\star}$), we can decrease the baseline discrimination of about $7-9$ points, by keeping the same accuracy of the baseline.
Results for the Bank dataset (Table \ref{tab:bank}) shows that EiFFFeL-TF can reach for $\epsilon=0.01$ the desired discrimination score, but losing 7 points in accuracy (from 0.82 to 0.75), whereas DFRF has worse discrimination score of 0.05 and a worse accuracy of 0.73. EOP does not lose any accuracy for lowering the discrimination score by 14 points to 0.04.
Finally, considering the results obtained for the COMPAS dataset (Table \ref{tab:compas}), we observe in some cases DFRF works pretty well, but always one of our algorithms gets better results. For example, for $\epsilon=0.01$, the best discrimination score of $0.01$ is obtained by EiFFFeL-TF$^\star$, by only losing 9 points in accuracy, against the 11 points lost by DFRF with a discrimination score of $0.02$.
\medskip
Figures~\ref{fig:plot1}, \ref{fig:plot2}, and \ref{fig:plot3} report the same data of the above tables, where we varied the discrimination constraint $\epsilon=\{0.01, 0.05, 0.1, 0.5\}$, with no constraints on accuracy. The results obtained by EOP are not plotted, as its results are always worse than the competitors and do not vary with $\epsilon$.
Specifically, Figure \ref{fig:plot1} reports results for the three datasets, and aims at showing the tradeoff
of accuracy vs. discrimination when we vary $\epsilon$. Recall that we are interested in achieving low discrimination and high accuracy, and thus the best tradeoff corresponds to points of curves falling in the top-left quadrant.
First, we highlight that DRFR performs poorly on most settings compared to the proposed EIFFFeL variants.
On the Adult dataset, EIFFFeL-LF dominates the other algorithms for all values of $\epsilon$ and achieves the desired or better discrimination with the largest accuracy. To appreciate the strict relationships between of the setting of $\epsilon$ and the discrimination/accuracy obtained, the reader can refer to the other two Figures \ref{fig:plot1} and \ref{fig:plot2}.
Returning to Figure \ref{fig:plot1}, the COMPAS EIFFFeL-LF provides the best performance together with EIFFFeL-TF$^{\star}$. This is the only dataset where EIFFFeL-TF$^{\star}$ provides interesting performance, and thus the discrimination aware splitting at training time provides some benefits. We also highlight that when using $\epsilon=0.15$ (see Figure \ref{fig:plot3}) the algorithm DFRF only gets a discrimination score of 0.25. Note that EIFFFeL-LF$^{\star}$ is not able to provide better performance when varying $\epsilon$, thus resulting in a constant curve.
Finally, on the Bank Dataset, EIFFFeL-TF and EIFFFeL-LF achieve the best results, with an advantage for EIFFFeL-TF for smaller values of $\epsilon$. Finally, the results show how we can obtain the desired discrimination degree with a limited drop in accuracy. Overall, the proposed EIFFFEL algorithm outperforms the competitor DFRF, and, on average, it is advisable to avoid the discrimination aware node splitting. We believe that working only at post-processing allows us to exploit a richer set of trees grown, by exploring a larger and unconstrained search space.
\begin{table*}
\caption{Accuracy and discrimination scores on the Adult dataset for $\epsilon=0.01$ and $\alpha=0.01,0.02,0.03,0.05$. The baseline accuracy and discrimination score are $0.85$ and $0.2$, respectively.
\label{tab:alpha}}
\center
\footnotesize
\begin{tabular}{cccc|ccc|ccc|ccc|}
\cline{5-12}
& & & & \multicolumn{2}{ c|| }{EiFFFeL-TF} & \multicolumn{2}{ c|| }{EiFFFeL-LF}& \multicolumn{2}{ c||}{EiFFFeL-TF$^{\star}$} & \multicolumn{2}{ c|| }{EiFFFeL-LF$^{\star}$} \\
\cline{5-12}
& & & & \multicolumn{1}{ c| }{Accu} & \multicolumn{1}{ c|| }{Disc} & \multicolumn{1}{ c| }{Accu} & \multicolumn{1}{ c|| }{Disc} & \multicolumn{1}{ c| }{Accu} & \multicolumn{1}{ c|| }{Disc} & \multicolumn{1}{ c||}{Accu} & \multicolumn{1}{ c|| }{Disc} \\
\toprule
\multicolumn{1}{ |c}{\multirow{4}{*}{Adult} } &
\multicolumn{1}{ |c }{\multirow{4}{*}{\rotatebox[origin=c]{0}{$\epsilon$=0.01}}} &
\multicolumn{1}{ |c }{\multirow{4}{*}{\rotatebox[origin=c]{0}{$\alpha$}}} &
\multicolumn{1}{|c|}{0.01} &
\multicolumn{1}{c|}{0.83} & \multicolumn{1}{c||}{0.09} &
\multicolumn{1}{c|}{{0.84}} & \multicolumn{1}{c||}{\bf0.08}
& \multicolumn{1}{c|}{{0.84}} & \multicolumn{1}{c||}{0.10}
& \multicolumn{1}{c|}{{0.84}} & \multicolumn{1}{c||}{0.11}
\\
\cline{4-12}
\multicolumn{1}{|c}{} &
\multicolumn{1}{|c}{} &
\multicolumn{1}{|c}{} &
\multicolumn{1}{|c|}{0.02} &
\multicolumn{1}{c|}{0.83} & \multicolumn{1}{c||}{0.09} &
\multicolumn{1}{c|}{{0.83}} & \multicolumn{1}{c||}{{\bf0.06}}
& \multicolumn{1}{c|}{{0.83}} & \multicolumn{1}{c||}{0.10}
& \multicolumn{1}{c|}{{0.83}} & \multicolumn{1}{c||}{0.07}
\\
\cline{4-12}
\multicolumn{1}{|c}{} &
\multicolumn{1}{|c}{} &
\multicolumn{1}{|c}{} &
\multicolumn{1}{|c|}{0.03} &
\multicolumn{1}{c|}{0.82} & \multicolumn{1}{c||}{\bf0.04} &
\multicolumn{1}{c|}{{0.82}} & \multicolumn{1}{c||}{{0.05}}
& \multicolumn{1}{c|}{{0.82}} & \multicolumn{1}{c||}{0.07}
& \multicolumn{1}{c|}{{0.82}} & \multicolumn{1}{c||}{\bf0.04}
\\
\cline{4-12}
\multicolumn{1}{|c}{} &
\multicolumn{1}{|c}{} &
\multicolumn{1}{|c}{} &
\multicolumn{1}{|c|}{0.05} &
\multicolumn{1}{c|}{0.81} & \multicolumn{1}{c||}{0.01} &
\multicolumn{1}{c|}{{0.81}} & \multicolumn{1}{c||}{{\bf 0.00}}
& \multicolumn{1}{c|}{{0.80}} & \multicolumn{1}{c||}{0.08}
& \multicolumn{1}{c|}{{0.82}} & \multicolumn{1}{c||}{0.03}
\\
\bottomrule
\end{tabular}
\end{table*}
The effect of varying the discrimination constraint $\epsilon$ without constraining accuracy can be observed in Figure \ref{fig:plot2}, where we discover that lower discrimination is achieved with large accuracy reduction. This is due to the fact that a small discrimination threshold allows our flipping strategies to force the change of many leaves, thus changing more the classification decision regions, with a final lower accuracy.
However our approach of selecting potential leaves to relabel seems better than training random forest with only fair trees.
In addition, training and then rejecting trees (because they are not fair) makes longer the training of the forest,
particularly when we fail often in finding fair trees.
Finally, Figure~\ref{fig:plot3} contrasts the discrimination measured on the test set against the desired discrimination constraint $\epsilon$. Clearly, the twos do not always match. In particular, DFRF has an unstable behaviour, meaning that filtering the tree to be added to the forest is not the best option. Conversely, EiFFFeL-TF and EiFFFeL-LF provide a much more stable behaviour.
\medskip
We also discuss the results of other experiments, aiming to evaluate the effects of different values for the $\alpha$ constraints. Note that only the EiFFFeL algorithms support the $\alpha$ parameter, so we cannot reports any results for the competitors DFRF and EOP.
Specifically, Table \ref{tab:alpha} reports results relative to the Adult dataset, where,
for a fixed $\epsilon=0.01$, we vary the $\alpha$ constraint over the expected accuracy, with values ranging in the set \{0.01,0.02,0.03,0.05\}. For each $\alpha$ value, we show in bold the best results in terms of discrimination score.
We observe that the accuracy constraint $\alpha$ has an indirect impact on the final discrimination score obtained. Using EiFFFeL-LF with $\alpha=0.01$, the loss in accuracy is 1 point as expected, while the baseline discrimination score decreases by more than half (from $0.2$ to $0.08$). Furthermore, as the $\alpha$ value increases, discrimination score decreases further. With $\alpha=0.05$, EiFFFeL-LF is able to reduce by 4 points the final accuracy, by also achieving a discrimination score of 0, thus showing the power of our method in achieving a very good trade-off between accuracy and discrimination.
\section{Conclusion}
In this work we deal with fairness in machine learning, and specifically in binary classifiers trained by a Random Forest algorithm. We are interested in group fairness, so as to mitigate the effect of bias against specific groups, which may comes from biased training datasets or algorithm design.
We develop EiFFFeL, a novel post-process approach, which maintains good predictive performance of the trained model with a low discrimination score. Our approaches flips the label of selected leaf (or leaves) of base trees in a random forest by using two algorithms: $(i)$ an aggressive tree-based approach, which flips all candidate leaves of a tree, and $(ii)$ a leaf-based strategy which only flips the label of the most discriminative leaf of a tree. Both strategies are implemented by considering accuracy and discrimination constraints. Indeed, the constraints are used to control the minimum accuracy decrease we can tolerate in order to achieve the desired discrimination value.
In addition, we have tested the impact of incorporating discrimination aware node split strategies for base trees of the forest, by adding discrimination gain value in their node splitting criterion \cite{kamiran2010discrimination}.
By using three publicly available datasets, our experimental results show that effective non-discriminative models can be obtained, while keeping a strict control over both accuracy and discrimination level. Compared to state-of-the-art methods, which adopt both in-process and post-process bias mitigation approaches, EiFFFeL resulted to produce the most accurate models that also exhibit the best levels of fairness.
As part of the future work, we plan to extend our methods by studying the effect of multiple sensitive features in relation to discrimination and accuracy, by also extending our work to other tree ensemble learning methods.
| {'timestamp': '2022-05-17T02:43:34', 'yymm': '2112', 'arxiv_id': '2112.14435', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14435'} | arxiv |
\section{Introduction}
\label{sec:intro}
\input{intro}
\begin{figure}[t]
\centering
\subfigure[Transformer Layer]{
\includegraphics[width=0.13\textwidth]{Figures/preliminary/transformer_layer.pdf}
\label{fig:transformer}
}
\subfigure[Transformer Layer with Mixture-of-Expert]{
\includegraphics[width=0.32\textwidth]{Figures/preliminary/moe_transformer_layer.pdf}
\label{fig:moe_transformer}
}
\caption{A brief architecture of Transformer Encoder Layer and Transformer with Mixture-of-Expert Layer. The Transformer encoder layer contains two main components: a Multi-Head Self-Attention Layer and a Position-wise Feed-Forward Layer. Based on Transformer layer, the transformer with MoE replaces the FFN with a series of FFNs and introduce a gate network.}
\label{fig:preliminary}
\end{figure}
\section{Preliminary}
\label{sec:preliminary}
\subsection{Transformer}
The model architecture of Transformer~\cite{vaswani2017attention} has demonstrated its superior performance in many sequence-to-sequence natural language processing (NLP) tasks, which contains several encoder layers and decoder layers. Each encoder layer is stacked by a multi-head self-attention network and a position-wise feed-forward network (FFN), which is illustrated in Figure~\ref{fig:transformer}.
It employs a residual connection on each of these two sub-layers, followed by a normalization layer~\cite{DBLP:journals/corr/layernorm}. Formally, each sub-layer, e.g., attention and FFN, produces its output as $\text{LayerNorm}(x + \text{Sublayer}(x))$.
The decoder is similarly constructed, except for an additional cross-attention mechanism between attention and FFN to introduce the output of the encoder. For a sequence of input tokens $(x_{1},...,x_{s})$ $\in$ $\mathbb{R}^{D}$, we formulate the function of each sub-layer in following:
\begin{table}[t]
\centering
\renewcommand{\multirowsetup}{\centering}
\caption{Notations}
\label{tab:notation}
\vspace{-2mm}
\begin{tabular}{cc}
\toprule
Symbols & Definitions \\
\midrule
$Q$ & Queries in self-attention module \\
\midrule
$K$ & Keys in self-attention module \\
\midrule
$V$ & Values in self-attention module\\
\midrule
$d_k$ & Feature dimension of each Query/Key \\
\midrule
$S$ & A set of input tokens \\
\midrule
$E$ & An series of experts\\
\midrule
$D$ & Feature dimension of each token \\
\midrule
$N$ & Number of experts in each MoE layer \\
\midrule
$e_{i}(x_s)$ & The output of $i$-$th$ Expert by taking input $x_s$ \\
\midrule
$g(x_s)_i$ & The routing score for $x_s$ on $i$-$th$ Expert\\
\midrule
$c$ & Threshold for expert selection \\
\midrule
$G_{S, E}$ & The routing score for $S$ on $E$ \\
\midrule
$Id_{S}$ & The set of selected expert id on $S$\\
\bottomrule
\end{tabular}
\end{table}
\textbf{Attention:} The attention module~\cite{DBLP:conf/nips/VaswaniSPUJGKP17} could capture the dependencies between tokens in the sequence, and is effective in sequence modeling. It performs as a ternary function, which maps the input queries (Q), keys (K) and values (V) to the output (O). Equation~\ref{equ:attention} represents the Scaled Dot-Product Attention~\cite{DBLP:conf/nips/VaswaniSPUJGKP17}, which performs dot products of each query with all keys, divides each by $\sqrt{d_k}$ and then adopts the softmax function to get the weight of each value. In addition, $d_k$ is the dimension of queries and keys.
\begin{equation}
\texttt{Attention}(Q, K, V) = \texttt{softmax}(\frac{QK^T}{\sqrt{d_k}})V
\label{equ:attention}
\end{equation}
\textbf{Multi-Head Attention:} ~\citet{DBLP:conf/nips/VaswaniSPUJGKP17} proposed the multi-head attention mechanism to jointly learn from different representation subspaces at different positions and thus improved the model performance. The multi-head attention linearly projected the queries, keys and values $h$ times with learned linear projections to $d_k$, $d_k$ and $d_v$, dimensions, respectively.
\begin{align}
\texttt{MultiHead}&(Q, K, V) = \texttt{Concat}(head_1, ..., head_h){W^O} \\
\text{where}&\ head_i = \texttt{Attention}(QW_{i}^Q, KW_{i}^K, VW_{i}^V) \nonumber
\label{equ:multi_head}
\end{align}
\noindent The projections are the trainable parameter matrices, where $W_{i}^Q \in \mathbb{R}^{d_{model} \times d_k}$, $W_{i}^K \in \mathbb{R}^{d_{model} \times d_k}$, $W_{i}^V \in \mathbb{R}^{d_{model} \times d_v}$. Meanwhile, $h$ is the number of heads, and $d_k = d_v = d_{model}/h$. Because the dimension of each head is reduced from $d_{model}$ to $d_{model}/h$, the time cost of multi-head attention is similar to that of the original attention. In addition, the decoder employs a masked self-attention, which only sees the tokens on the left of the sequence.
\textbf{Position-wise Feed-Forward Networks:} Each transformer layer also includes a fully connected feed-forward network (Equation~\ref{equ:ffn}), which consists of two fully connected networks and a ReLU activation function.
\begin{equation}
\texttt{FFN}(x_{s}) = W_{2} \cdot \texttt{ReLU}(W_{1} \cdot x_{s} + b_{1}) + b_{2}
\label{equ:ffn}
\end{equation}
\begin{figure}[t]
\centering
\includegraphics[width=0.415\textwidth]{Figures/preliminary/moe_layer.pdf}
\caption{Illustration on the workflow of Mixture-of-Expert (MoE). The input token $x_s$ is first processed by the gate network to calculate similarities between $x_s$ and each expert. Then, it performs Top-K operation on these similarities to determine the target activated experts. Finally, $y_s$ is produced by the linearly weighted combination of each expert's output on the token by the gate's output. }
\label{fig:moe_layer}
\end{figure}
\begin{figure*}[t]
\centering
\subfigure[Expert Loads Distribution .]{
\includegraphics[width=0.22\textwidth]{Figures/expert_loads_conformity.pdf}
\label{fig:duration_distribution}
}
\subfigure[Unstable Routing Pattern for Token ``the'']{
\includegraphics[width=0.68\textwidth]{Figures/expert_selection.pdf}
\label{fig:weights_distribution}
}
\caption{The observations of GPT-MoE with 16 experts and the Top-1 gate among 12 MoE-layers (totally 24 layer).
Figure~\ref{fig:duration_distribution} shows the expert load distribution (deeper color represents heavier workload, i.e., more tokens to be processed) and Figure~\ref{fig:weights_distribution} shows the expert selection for a specific token ``the''.}
\label{fig:dense_moe}
\end{figure*}
\subsection{Mixture of Experts}
Because larger pretrained models always achieve better model quality~\cite{DBLP:scaling_laws}, the size of state-of-the-art NLP models has been increasing $10\times$ per year, e.g., BERT~\cite{DBLP:conf/naacl/BERT}, GPT~\cite{gpt}, T5~\cite{DBLP:googleT5}, GPT-2~\cite{gpt2}, GPT-3~\cite{DBLP:conf/nips/gpt3}, which require increasing compute budgets. To improve the model capacity without increasing computation budgets, researchers sparsely scale transformers recently as Figure~\ref{fig:moe_transformer} by replacing the feed-forward network with the mixture of experts (MoE) architecture and activating only a subset of these experts for each input sample~\cite{DBLP:lstm_moe, DBLP:switch, DBLP:gshard}.
The main components of the MoE architecture include an expert network $E$ for scaling model capacity and a sparse gate network $G$ for introducing model sparsity.
\textbf{Expert Network:}
The expert network $E$ includes a series of experts $\{e_{1},...,e_{N}\}$ to increase the model capacity, where each expert $e_{i}$ represents a single neural network, e.g., \text{FFN}, and contains its own parameters. In Figure~\ref{fig:moe_layer}, the MoE layer consists of three FFN networks.
For each expert $e_{i}$ ($e_{i}: \mathbb{R}^{D} \rightarrow \mathbb{R}^{D}$), it takes the token $x_{s}$ as an input to produce its own output $e_{i}(x_{s})$. The final output of the expert network $y_{s}$ is the linearly weighted combination of each expert’s output on the token by the gate's output, formulated as Equation \ref{equ:moe_weighted_sum}.
\begin{equation}
y_{s} = \sum_{i=1}^{N}g(x_{s})_{i} \cdot e_{i}(x_{s})
\label{equ:moe_weighted_sum}
\end{equation}
\noindent In Figure~\ref{fig:moe_layer}, the expert network takes the input token $x_{s}: [-0.2, 0.4, 1.5]$ and produces the output of each individual expert on $x_s$, e.g., $e_{0}(x_s)$, $e_{1}(x_s)$ and $e_{2}(x_s)$. By combining the gate's output, i.e., $[0.35, 0.65, 0]$, the output of this MoE layer is $y_s = 0.35*e_{0}(x_s) + 0.65*e_{1}(x_s)$.
\textbf{Sparse Gate Network:}
The sparse gate network $G$ is the key component to introduce model sparsity, which takes a batch of tokens $\{x_{1},...,x_{s}\}$ as input and produces the probability of them with respective to all experts $\{e_{1},...,e_{N}\}$.
\citet{DBLP:lstm_moe} proposes the Top-K gating as Equation~\ref{equ:topk_gate}, which keeps only the top k values before the softmax function. In addition, $W_{g}$ is a trainable variable ($W_{g} \in \mathbb{R}^{D \times N}$) and determine the targeted experts for each token.
\begin{equation}
g(x_s) = softmax(TopK(x_{s} \cdot W_{g}) )
\label{equ:topk_gate}
\end{equation}
\noindent We illustrate the workflow of a MoE layer in Figure~\ref{fig:moe_layer}, where $k=2$ and $W_g$ is a 3 $\times$ 3 (i.e., feature dimension $\times$ number of experts) matrix to represents the parameter of gate network. We first perform a dot-product on $x_s$ and $W_g$ to calculate similarity between the input token and the experts. The result, $[2.01, 2.64, 1.8]$, indicates that the input prefers $e_1 > e_0 > e_2$ and we only activate $e_0$ and $e_1$ as $k = 2$. Finally, we conduct a softmax function to get the weight score of each expert and perform a weighted sum to get the final output $y_s$.
Previous work mainly focuses on how to improve the quality and efficiency of training such sparse gate network. ~\citet{DBLP:lstm_moe} proposed the noisy Top-K gating on Long Short-TerM memory (LSTM) kayers~\cite{DBLP:journals/neco/lstm} and ~\citet{DBLP:gshard} introduced MoE with Top-2 gate into Transformer.
~\citet{lewis2021base} adopted the numerous solution for balanced token-to-expert routing and \citet{roller2021hash} utilized the hash-based routing strategy.
\textbf{Distributed Training of MoE Models:}
Expert parallel training is a specific method of parallelism for MoE models, which is first proposed by GShard~\cite{DBLP:gshard}. Experts are placed on different workers and each worker takes a different batch of training samples. For non-MoE layers, expert parallelism behaves the same as data parallelism. In MoE layers, tokens in the sequence are sent to workers where their desired experts reside. Similar to model parallelism, the outputs of each MoE layer are exchanged again to be organized back into original sequences for the computation of the next layer. As MoE models often have numerous experts, expert parallelism can scale up with model size better than model parallelism.
\subsection{Observation and Motivation}
\label{sec:motivation}
In this section, we revisit the learning process of MoE models and introduce our two key findings in the following, which motivates us to design our {EvoMoE}\xspace framework.
\textbf{Conformity in Mixture of Experts:} One interesting finding is conformity. During the early training stage, existing join-training methods of sparse MoE make the routing decision to comply with most tokens.
Here we train a GPT model including 24 transformer layers, with every FFN layer replaced by 16-expert MoE layer using the Top-1 gate.
Figure~\ref{fig:duration_distribution} shows that most tokens keep concentrating on the 8-th expert at first, since it has been greedily reinforced.
After around hundreds of training steps (i.e., 1 duration equals 40 training steps), the other experts gradually catch up and the workload becomes balanced. Such phenomenon motivates us to focus on training a common expert and utilize the computational resources to accelerate the early stage.
\textbf{Instability in Mixture of Experts:} Another important finding is the instability. We take a single token ``the'' as an example and Figure~\ref{fig:weights_distribution} shows its expert selection results for a longer training process. As we can see, the selection is highly unstable later since both the gate network and the experts are not knowledgeable enough to obtain a stable routing pattern, especially at the early stage of the training process. This indicates that a pre-defined gates (e.g., Top-K) in existing works, which assumes a fixed number of activated experts, could limit the exploration of potential valuable experts. Aggressively increasing the number of activated experts could improve the model capacity but inherently violates the original design intention of sparse MoE. Such a dilemma motivates us to design an adaptive solution to balance the trade-off between the convergence performance and computation costs.
\begin{figure}[t]
\centering
\includegraphics[width=0.25\textwidth]{Figures/shared_to_diverse.pdf}
\caption{
To spawn multiple diverse experts from the shared-expert, \ourmethods{} adopt the random masking technique. Specifically,
part of the shared expert's weight are masked as 0.}
\label{fig:shared_to_diverse}
\end{figure}
\section{Methods}
\label{sec:methods}
The observations in Section~\ref{sec:motivation} motivates EvoMoE, a two-phase framework that gradually and adaptively training MoE-based models, which is different from existing methods that jointly train the gate network and the expert network over a pre-defined sparse (e.g., Top-1 or Top-2) gate and a series of randomly initialized experts.
As shown in Figure~\ref{fig:overview}, EvoMoE contains two phases: an expert-diversify phase and a gate-sparsify phase.
In the expert-diversify phase, \ourmethods{} shares the weights among experts in one MoE layer for several training steps and then makes experts diverse by randomly masking.
In the gate-sparsify phase, \ourmethods{} introduces the dense-to-sparse (i.e., DTS) gate, which begins routing as a dense gate that routes tokens to all experts and then adaptively learns the weights of routing to each expert and gradually anneals to standard Top-1 gating.
\subsection{Problem Formulation}
Given an input token $x_s$, a series of experts $\{e_1,..., e_N\}$ and a learn-able gate with parameter $W_g$, \texttt{Func} is adopted by the gate network to determine the targeted experts for it, i.e., the token-to-expert assignment, formulated in Equation~\ref{equ:gate_problem}. $g(x_s)$ is a 1$\times$N vector, which represents the scores of $x_s$ with respect to experts.
Meanwhile, each expert will process the input token separately as $e_i(x_s)$ and combine their output as Equation~\ref{equ:moe_weighted_sum_problem}.
\begin{equation}
g(x_s) = \texttt{Func}(x_{s} \cdot W_{g})
\label{equ:gate_problem}
\end{equation}
\begin{equation}
y_{s} = \sum_{i=1}^{N}g(x_{s})_{i} \cdot e_{i}(x_{s})
\label{equ:moe_weighted_sum_problem}
\end{equation}
Existing work adopts a pre-defined Top-K as $Func$, such as Top-2 for GShard ~\cite{DBLP:gshard} and Top-1 for Switch-Transformer~\cite{DBLP:switch}. However, due to the non-derivability of Top-K, only the selected experts would back-propagate their gradients to the gate network and update their corresponding columns in $W_g$.
For example, only 1 expert is selected and 1 column of the gate would be updated in Switch-Transformer. So it is hard for Top-K gate to optimize this \textbf{expert-selection} problem.
Moreover, as observed in Figure~\ref{fig:duration_distribution}, the loads of experts are extremely imbalanced at the early stage of training and thus most GPUs suffer from low utilization due to stragglers in expert parallelism.
\setlength{\textfloatsep}{0.1cm}
\begin{algorithm}[t]
\SetAlgoLined
\SetKwProg{Fn}{Function}{}{end}
\KwData{$x_{S}$: a group of tokens of size $S$, \\
\quad \quad $E$: expert network \\
\quad \quad $T_{S}$: number of iterations for shared-expert, \\
\quad \quad $T_{D}$: number of iterations for dense-gate, \\
\quad \quad $T$: number of training iterations.}
\SetInd{0.61em}{0.61em}
\For{$i \leftarrow 1\ to\ T_{S}$}{
$y_{S} \leftarrow e(x_{S})$ \;
}
// Diversify experts from the shared \;
\For{$e_{i} \in E$}{
$e_{i} \leftarrow diversify(e, i)$ \;
}
\For{$i \leftarrow T_{S}\ to\ T$}{
$\tau \leftarrow \text{\textit{temperature scheduler}}(i)$ \;
// Get selected expert ids and weights for each token \;
$G_{S,\ E}, Id_{S} \leftarrow DTS\_Gate(x_{S},\ \tau, T_{D})$\;
\For{$s \leftarrow 1\ to\ S$}{
$y_{s} \leftarrow 0$
\For{$id \in id_{s}$}{
$y_{s} \leftarrow y_{s} + G_{s, \ id} * e_{id}(x_{s})$ \;
}
}
}
\caption{Training MoE in the {EvoMoE}\xspace{} Framework}
\label{alg:std_algo}
\end{algorithm}
\subsection{Stage 1: Expert-Diversify}
As the gate network and expert network are both randomly initialized, it requires a vast amount of computation budget for trial and errors, which is inefficient for models' training. Based on the observation in Section~\ref{sec:motivation} that most tokens are processed by the same expert and other experts waste their computation budget, we train one shared-expert instead of $N$ individual experts in the early stage (illustrated as the left of Figure~\ref{fig:overview}). Because all experts within the same MoE layer share weights, the model is equal to its corresponding non-MoE model as a small dense model.
Algorithm~\ref{alg:std_algo} illustrates the MoE training process in our \ourmethods{} framework. First, input tokens are processed by the shared expert $e_{0}$ (line 1-2). Then \ourmethods{} switches the training into standard MoE models' training, by adding a gate network at each MoE layer and diversifying all experts from the shared expert (line 4-5). After this expert-diversify phase, \ourmethods{} steps into the gate-sparsify phase, where it schedules the gate temperature coefficients and then obtains the token-to-expert routing relation from DTS-gate (line 7-9). Tokens will be dispatched to corresponding experts and aggregated together by weighted sum operating (line 10-12).
Multiple $diversify$ techniques can be adopted to spawn multiple diverse experts from one expert, such as noise, NAS, random mask.
\ourmethods{} adopts the random mask, which masks part of the shared expert's weights as 0 (shown as Figure~\ref{fig:shared_to_diverse}). For example, expert-1 is initialized by masking the central value. The proposed expert-diversify stage avoids joint training from scratch and the well-trained diverse experts could be treated as a better initialization to benefit the following model convergence.
\subsection{Stage 2: Gate-Sparsify}
Although sparse gating has demonstrated its superior model efficiency in both training and inference, prior work tends to convergence to a sub-optimal model under the fixed computation budget or the dataset size due to the jointly training of the randomly initialized gate network and expert network.
In this paper, we propose a new mechanism for training the gate network, named \texttt{Dense-to-Sparse} gate (DTS-Gate, as illustrated in Algorithm~\ref{alg:dts_algo} ), which starts as a dense gate that routes tokens to most experts and then gradually becomes sparser.
DTS-Gate benefits from the sufficient training of experts in the early stage and then make the experts selection becomes sparser on the basis of specialized experts.
This dense-to-sparse process only occupies a small fraction compared with the total training time, which usually takes days to weeks.
\textbf{Gate with Temperature:}
In order to control the sparsity during training, we adopt the softmax temperature to adjust the weights distribution among experts. Formulated as Equation~\ref{equ:gumbel_softmax}, $W_{g}$ is the parameter of gate, $\zeta$ is the extra noise and sampled from \texttt{Gumbel}$(0, 1)$ distribution~\citep{DBLP:gumbel_softmax}, and $\tau$ is the softmax temperature which controls the distribution.
When the $\tau$ increases, the distribution of $g'(x_{s})$ becomes more uniform, which evolves more experts into the computation of each token.
As the $\tau$ approaching 0, the distribution becomes one-hot, which is more confident for the gate network.
\begin{equation}
g'(x_{s}) = \frac {e^{(x_{s} \cdot W_{g}+\zeta)/\tau }}{\sum _ {s'=1}^ {N}e^{(x_{s'} \cdot W_{g}+\zeta)/\tau }}
\label{equ:gumbel_softmax}
\end{equation}
\textbf{Content-based Sparsity:}
Different from existing static Top-K based gate~\cite{DBLP:switch}~\cite{DBLP:gshard}, \ourmethods{} adopts the \textit{content-based sparsity} method to determine the number of activated experts, which keeps the value beyond an threshold $c$. As formulated by Equation~\ref{equ:adaptive_sparsity}, we drop the experts whose weights fall below the threshold $c$ and no extra communication or computation will be wasted.
It's worth noting that the sum of selected experts' score can not be equal to 1 because we don't normalize them after dropping. It is useful to remain the original score, especially only one expert is selected, which was verified in Switch. To meet the demand of above two designs, we enable each expert with this content-based gate to make them well specialized. transformer~\cite{DBLP:switch}.
\begin{equation}
g(x_{s})_i = \begin{cases}
g'(x_{s})_i, &\text{if}\quad {g(x_{s})_i} > c \\
0, &\text{else}
\end{cases}
\label{equ:adaptive_sparsity}
\end{equation}
\textbf{Sparsity Scheduler:}
With temperature $\tau$ increasing, the distribution tends to be uniform and more experts will be selected. So the sparsity decreases and the training cost of the neural network would increases.
On the opposite, less experts are involved into computation and thus the sparsity increases.
By scheduling the temperature of Equation~\ref{equ:gumbel_softmax}, we can control the sparsity of the MoE layer over different training stages. There is a trade-off between model quality and training cost for the selection of temperature.
For example, when the distribution of experts is nearly one-hot, it would lead to large variance of gradients between experts and thus make the learning of MoE learning difficult. To optimize this problem, our DTS-Gate starts at a large temperature that routes tokens to most experts and then anneals to a small temperature that gradually sparsifies the MoE layer.
\textbf{Balance Loss:} Similar to Switch transformer~\cite{DBLP:switch}, we utilize the balance loss $\mathcal{L}_{balance}$ to avoid imbalanced assignments for different experts which would cause the straggler problem and thus lead to low training efficiency.
\begin{equation}
\mathcal{L}_{balance} = \alpha N \sum_{i=1}^N(\frac{\sum_{x_s \in \mathcal{B}}{\mathbb{I}\{g(x_s)_i} > 0\}}{|\mathcal{B}|^2} \sum_{x_s \in \mathcal{B}}{g'(x_s)_i})
\label{equ:balance_loss}
\end{equation}
\noindent As formulated in Equation~\ref{equ:balance_loss}, $\alpha$ is a hyper-parameter and $\mathcal{B}$ represents current batch of tokens. $\sum_{x_s \in \mathcal{B}}{\mathbb{I}\{g(x_s)_i} > 0\}$ represents the number of tokens dispatch to expert $i$ and $\sum_{x_s \in \mathcal{B}}{g'(x_s)_i}$ represents the gate probability allocated for expert $i$. Intuitively, the balance loss will reduce the amount of data for overloaded-experts and move towards to balanced loads at the batch data level.
\textbf{Training Objective:}
In the first stage, the experts of each MoE layer share same weights and thus the loads can be divided to them equally. The training objective is to optimize the model quality (i.e., $\mathcal{L}_{task}$). In the second stage, both the model quality and training efficiency (i.e., balanced workloads between experts) need to be considered.
\begin{equation}
\mathcal{L} = \begin{cases}
\mathcal{L}_{task}, &\text{if}\quad $stage = 1$ \\
\mathcal{L}_{task} + \mathcal{L}_{balance}, &\text{else}
\end{cases}
\label{equ:train_obj}
\end{equation}
\setlength{\textfloatsep}{0.1cm}
\begin{algorithm}[t]
\SetAlgoLined
\SetKwProg{Fn}{Function}{}{end}
\KwData{$x_{S}$: a group of tokens of size $S$, $\tau$: temperature,\\ \quad\quad $T_{D}$: number of iterations of dense-gate.}
\KwResult{$G_{S,\ E}$: group combine weights, $Id_{S}$: Index of selected experts}
\SetInd{0.61em}{0.61em}
\Fn{DTS\_Gate($x_{S},\ \tau$, $T_{D}$):}{
$g_{S,\ E} \leftarrow gumbel\_softmax(x_{S} \cdot W_{g},\ \tau)$ \;
\If{current\_iteration $<$ $T_{D}$}{
//select experts for token, N $\geq$ len($id_{s}$) $\geq$1 \;
$Id_{S} \leftarrow select\ g_{S,\ E} \textgreater threshold$ \;
}
\Else{
//select Top-1 expert for token, len($id_{s}$) = 1 \;
$Id_{S} \leftarrow select\ Top1(g_{S,\ E})$\;
}
\For{$s \leftarrow 1\ to\ S$}{
\For{$id \in ids$}{
$G_{s,\ id} \leftarrow g_{s,\ id}$ \;
}
}
Return $Id_{S}, \ G_{S,\ E}$ \;
}
\caption{Dense-to-Sparse Gate Mechanism}
\label{alg:dts_algo}
\end{algorithm}
\section{Implementation}
\label{sec:impl}
\input{implementation}
\section{Experiments}
\label{sec:experiment}
\input{experiment}
\section{Related Work}
\label{sec:related_work}
\input{related_work}
\section{Conclusion and Future Work}
\label{sec:conclusion}
MoE models suffer from the training efficiency challenge due to the difficulty of training many experts and the gate network jointly.
In this work, we presented an MoE training framework {EvoMoE}\xspace that decouples the training of experts and the gate network by first spawning multiple diverse experts from one single well-trained base expert and then learning a increasingly sparse gate from a dense gate.
Our evaluations show that {EvoMoE}\xspace can not only achieve better model quality in Transformers with given computation budget but also achieve better FLOPs-efficiency when comparing with previous works in MoE training.
On the other hand, {EvoMoE}\xspace opens challenges for system execution due to the computation in the early stage and the adaptive capacity of experts.
In the future, we would like to design and implement system-level optimizations to achieve efficient training in both model quality and system execution.
\balance
\subsection{Experimental Setup}
\subsubsection{Machine Environment}
We conduct experiments on DGX-A100, where each server is equipped 2 AMD CPUs and 8 NVIDIA Ampere A100 (40GB) GPUs, with Ubuntu 20.04, CUDA 11.3, CuDNN 8.2.0 and NCCL 2.12.7. GPUs inside a server are connected via NVLink 3.0
with and servers are connected with 8 InfiniBand NICs via 8*200 Gbps bandwidth totally. The RDMA is used by default and the PyTorch version is 1.11. \\ \\
\subsubsection{Baselines}
To verify the effectiveness of our method, we compare it with the several representative baselines, including Switch-Transformer~\cite{DBLP:switch}, BASELayer~\cite{DBLP:conf/icml/baselayer}, HashLayer~\cite{roller2021hash}, DSelectK~\cite{DBLP:conf/nips/dselectk}
and StableMoE~\cite{DBLP:conf/acl/stablemoe}.
Switch-Transformer~\cite{DBLP:switch} proposed to adopt Top-1 gate for the training of large-scale models.
BASELayer~\cite{lewis2021base} formulates the token-expert routing as a linear assignment problem and guarantees balanced compute loads by employing numerous algorithms.
HashLayer~\cite{roller2021hash} replaces the gating network with a hash-based routing strategy (e.g., random hash, clustered hash). DSelectK~\cite{DBLP:conf/nips/dselectk} involves sparse gates (Top-K) in the multi-gate MoE (i.e., MMoE) architecture for better parameter sharing among different tasks and trains gates from dense to sparse for smoothness. StableMoE~\cite{DBLP:conf/acl/stablemoe} also proposed two training stages, which learn the gate as well as distill it into a lightweight one in the first stage, and freezes the parameter of gate for stable routing in the second stage.
Our {EvoMoE}\xspace mainly contains two phases: an \texttt{expert-diversify}
phase to spawn multiple diverse experts from one single well-trained base expert,
and a \texttt{gate-sparsify} phase that gradually and adaptively learns a increasingly sparse gate from a dense gate.
\subsubsection{Benchmark and Datasets}
We evaluate {EvoMoE}\xspace{} on three popular tasks, including the machine translation (MT) task for domain-specific models, the Masked Language Modeling (MLM) task and the language modeling (LM) task for pre-trained models.
We adopt standard Transformer architecture~\cite{vaswani2017attention} (Encoder-Decoder)
for the MT task and train models on four popular translation datasets, WMT17 (English to German/German to English)\footnote{https://www.statmt.org/wmt17/}, and WMT14 (English to French/French to English)\footnote{https://www.statmt.org/wmt14/}. BLEU scores of the test sets are reported for comparison.
We adopt RoBERTa architecture architecture~\cite{liu2019roberta} (Encoder-only)
for the MLM task and train models on the combination of datasets, including Wikipedia\footnote{https://dumps.wikimedia.org/enwiki/latest/enwiki-latest-abstract.xml.gz}, BooksCorpus\footnote{https://battle.shawwn.com/sdb/books1/books1.tar.gz}, OpenWebText\footnote{https://zenodo.org/record/3834942/files/openwebtext.tar.xz} and CC-100\footnote{https://data.statmt.org/cc-100/}. Moreover, these datasets are tokenized by byte-pair encoding with a vocabulary size of 50257. Models are validated on the famous General Language Understanding Evaluation(GLUE) benchmark~\cite{DBLP:conf/emnlp/glue} for comparison.
We adopt GPT architecture architecture~\cite{gpt2} (Decoder-only)
for the LM task and train models on OpenWebText as ~\citet{gpt2}. We report train/valid/test perplexity (PPL) for comparison.
We also report the inference FLOPs of each model, which represents the speed of deploying this model at industry. All the training data are downloaded and pre-processed by following the example scripts from Fairseq\footnote{https://github.com/facebookresearch/fairseq/tree/main/examples}.
\subsubsection{Hyper-Parameter Detail}
We sparsely scale these models by replacing every other the \textit{feed-forward} layer (FFN) with MoE-FFN Layer, which contains a series of FFN experts.
All models use the GeLU activation functions~\cite{gelu_activation}, polynomial learning rate scheduler and Adam optimizer~\cite{DBLP:journals/corr/adam_optim}, where $\beta_1 = 0.9$ and $\beta_2 = 0.98$ .
We set clip norm as 0.0, weight decay as 0.1 and dropout rate as 0.1.
We use CrossEntropy as the criterion and utilize the label smoothed technique with coefficient of 0.1 for the MT task.
The coefficient of balance loss is set as 0.1 in Switch-Transformer~\cite{DBLP:switch}, StableMoE~\cite{DBLP:conf/acl/stablemoe} and our EvoMoE.
We set the threshold $c$ of our dense-to-sparse gate as 0.001 over training steps, which determines how large the expert's weight is important and is a trade-off between training cost and model quality from our point of view.
\begin{table*}[t]
\caption{Perplexity results of language modeling task.}
\begin{center}
\begin{tabular}{l|cccc|c}
\toprule
\textbf{Models} & \textbf{\#Shared Params.} & \textbf{\#Expert}& \textbf{\#Expert Params.} & \textbf{FLOPs} &
\textbf{Perplexity($\downarrow$)} \\
\midrule
Standard TRM& 345M& - & - & 207B& 15.14\\
Larger TRM (wider)& 360M & - & - & 220B& 14.92\\
\midrule
Switch TRM & 249M& 192& 1536M& 220B& 13.12\\
BASE Layer & 249M& 192& 1536M& 220B& 12.45\\
Hash Layer& 249M& 192& 1536M& 220B& 12.87\\
StableMoE & 249M& 192& 1536M&220B & 12.91\\
EvoMoE & 249M& 192& 1536M& 220B& \textbf{12.24}\\
\bottomrule
\end{tabular}
\end{center}
\label{tab:gpt_lm}
\end{table*}
\begin{table}[t]
\caption{BLEU score on each machine translation datasets}
\begin{center}
\begin{tabular}{c|cccc}
\toprule
\textbf{Models}
& \textbf{En-De} & \textbf{De-En} & \textbf{En-Fr} & \textbf{Fr-En}\\
\midrule
{TRM-Base}
& {28.1} &{34.8}
& {39.2} &{38.1}\\
{Switch-TRM}
& {28.4} &{34.6}
& {39.1} &{38.2} \\
\midrule
{{EvoMoE}\xspace{}}
& {\textbf{29.6}} &{\textbf{36.7}}
& {\textbf{40.3}} &{39.2} \\
{\quad\quad\quad\quad w/o \ stage\ 1}
& {\textbf{29.6}} &{36.5}
& {40.2} &{\textbf{39.3}} \\
{\quad\quad\quad\quad w/o \ stage\ 2}
& {28.7} &{35.2}
& {39.4} &{38.3} \\
\bottomrule
\end{tabular}
\end{center}
\label{tab:trans_tasks}
\end{table}
\subsection{GLUE Results}
\textbf{Model Architecture:} We pretrain the representative RoBERTa model for the masked language modeling task, where we set standard Transformer(TRM) with 24 encoder layers, hidden dimension as 1024 and number of attention heads as 16. We replace every other FFN layer in standard Transformer with the MoE layer (16 experts per layers) to construct the MoE models. The standard Transformer is a dense model and contains 355M parameters totally, whose inference FLOPs is 207B. Meanwhile, the sparse MoE model contains 1759M parameters totally, including 259M parameters for shared backbone and 1536M parameters for the expert network. In our setting that only 1 expert is active at a time, each input token will activate 335M parameters of the sparse MoE models, which is the same as standard Transformer model except for the gate network. To exactly match the inference speed (FLOPs) of MoE models, we slightly increase the FFN hidden size of standard TRM to construct the larger TRM.
\textbf{Model Performance:}
We pretrained each model for 100k steps totally, 5k of which was the warm-up phase. For our \ourmethods{}, we scheduled the first 5k steps as the expert-diversify stage and the following 5k steps for annealing temperature from 2.0 to 0.3. After the pre-training stage, we finetune the pre-trained models on each GLUE task and summarized the results in Table~\ref{tab:roberta_glue}. As for RTE, we finetune it starting from the MNLI model rather than the pretrained model as ~\citet{liu2019roberta}.
Compared with other baselines, \ourmethods{} achieves state-of-the-art results on 7 out of 8 tasks and the best averaged score. The MoE model is constructed by adding the gate network and replacing the original FFN layer of standard Transformer, which increases its model size and thus enlarges its capacity. Thus all MoE models outperform their backbone model (standard TRM), e.g., 89.750 for standard TRM and 90.313 (+ 0.563) for Switch TRM with respect to the avg score. Larger TRM slightly outperforms standard TRM because of its large model size. As verified by ~\citet{DBLP:scaling_laws}, larger models tend to be more sample-efficient, which represents better model quality with fixed training data/steps.
Compared with other MoE methods, \ourmethods{} benefits from the sufficient training of experts in the early stage and then make the experts selection becomes sparser on the basis of specialized experts.
Specifically, \ourmethods{} outperforms other MoE methods on GLUE benchmark up to 0.562 and 0.403 on average.
Switch TRM~\cite{DBLP:switch} jointly trains the randomly initialized experts and gates, which aims to learn better parameter as well as balanced routing. It is hard to optimize them simultaneously and thus performs bad among MoE models. To alleviate this problem, StableMoE~\cite{DBLP:conf/acl/stablemoe} freezes the parameter of gate network after the early training stage and improves over Switch-TRM. Hash Layer~\cite{roller2021hash} utilizes the fixed hash strategy to route tokens, which is based on the input embedding. Because both the hash strategy and input embedding is fixed, Hash Layers only need to learn the parameter of experts. However, it may lead to sub-optimal because the hash strategy is selected based on human knowledge and may be inappropriate. BASE Layer~\cite{DBLP:conf/icml/baselayer} enforces a balanced token-to-expert assignment through a linear assignment problem, which simplify the training in another way. All these work find the problem of jointly training and targeting at alleviate it.
\subsection{Language Modeling Results}
\textbf{Model Architecture:} We pretrain the representative GPT model for the language modeling task, where we set standard Transformer(TRM) with 24 decoder layers, hidden dimension as 1024 and number of attention heads as 16.
Every other FFN layer is replaced by in standard Transformer with the MoE layer (16 experts per layers) to construct the MoE models. There totally exists 12 MoE layers and thus 192 experts (i.e., $12 \times 16$).
Meanwhile, larger TRM is scaled by increasing its FFN hidden size.
\textbf{Model Performance:}
We pretrained each model on the OpenWebText dataset for 200k steps totally, 10k of which was the warm-up phase. For our \ourmethods{}, we scheduled the first 10k steps as the expert-diversify stage and the following 5k steps for annealing temperature from 2.0 to 0.3. We report the perplexity on the test set. Results are summarized in Table~\ref{tab:gpt_lm}.
Compared with other baselines, our \ourmethods{} achieves the best result among all baselines. Specifically, the perplexity of \ourmethods{} is 12.24, which achieves a 2.90 improvement compared with 15.14 of standard TRM. Meanwhile, all MoE models outperform their backbone model (standard TRM) because of their large model capacity. Larger TRM slightly outperforms standard TRM because of its large model size, which demonstrates the sample-efficient of large models.
Compared with other MoE methods, \ourmethods{} benefits from the sufficient training of experts in the early stage and then make the experts selection becomes sparser on the basis of specialized experts. Specifically, \ourmethods{} outperforms other MoE methods up to 0.88 ppl and 0.545 ppl on average. The analysis between different methods is same as that in GLUE results.
\begin{table}[t]
\caption{BLEU performance of MoE models with different expert number. }
\begin{center}
\begin{tabular}{c|ccc}
\toprule
{} & \multicolumn{3}{c}{\textbf{Number\ of\ Experts }} \\
&{\textbf{4}} & {\textbf{8}} &{\textbf{16}}\\
\midrule
{Switch}
&{28.4}
&{28.6} &{28.7}\\
{\ourmethods{}}
&\textbf{29.6} &\textbf{29.9}
&{30.0} \\
{\quad\quad\quad\quad w/o \ stage\ 1}
&\textbf{29.6} &\textbf{29.9}
&\textbf{30.1} \\
{\quad\quad\quad\quad w/o \ stage\ 2}
&{28.7} &{28.9}
&{28.9} \\
\bottomrule
\end{tabular}
\end{center}
\label{tab:expert_number}
\end{table}
\begin{table}[t]
\caption{Efficiency of MoE models with different expert number, and the results are normalized over Switch.}
\begin{center}
\begin{tabular}{c|ccc}
\toprule
{} & \multicolumn{3}{c}{\textbf{Number\ of\ Experts }} \\
&{\textbf{4}} & {\textbf{8}} &{\textbf{16}}\\
\midrule
{Switch}
&{1}
&{1} &{1}\\
{\ourmethods{}}
&\textbf{0.82}
&\textbf{0.78} &\textbf{0.75} \\
{\quad\quad\quad\quad w/o \ stage\ 1}
&{0.86}
&{0.82} &{0.81} \\
{\quad\quad\quad\quad w/o \ stage\ 2}
&{0.95}
&{0.93} &{0.92} \\
\bottomrule
\end{tabular}
\end{center}
\label{tab:efficiency}
\end{table}
\begin{figure*}[t]
\begin{center}
\subfigure[Validation PPL over steps]{
\includegraphics[width=0.35\textwidth]{Figures/e2e_iteration.pdf}
\label{fig:iters_ppl} }
\subfigure[Validation PPL over FLOPs]{
\includegraphics[width=0.35\textwidth]{Figures/e2e_flops.pdf}
\label{fig:flops_ppl}
}
\caption{End-to-end performance comparison between GPT-ori, GPT-Switch and GPT-DTS. Figure~\ref{fig:iters_ppl} and Figure~\ref{fig:flops_ppl} represent the curve of PPL over iterations and FLOPs, where GPT-DTS can obtain $2.0$x speed-up to reach the same validation perplexity, as well as higher FLOPs-efficiency of a $1.42$x speed-up.
}
\label{fig:end2end}
\end{center}
\end{figure*}
\subsection{Machine Translation Results}
\textbf{Model Architecture:} We pretrain the representative T5 model for the machine translation task, where we set standard Transformer(TRM) with 12 encoder-decoder layers, hidden dimension as 768 and number of attention heads as 12.
Every other FFN layer is replaced by in standard Transformer with the MoE layer (4 experts per layers) to construct the MoE models.
\textbf{Model Performance:}
We compare {EvoMoE}\xspace{} with Transformer and Switch-Transformer on four language-pair datasets, including English to German, German to English, English to French and French to English. Results are shown in Table~\ref{tab:trans_tasks},~\ref{tab:expert_number},~\ref{tab:efficiency}.
We remark that these models all have the same inference speed even if MoE models enlarge the parameter size.
We show the BLEU score on the test set of each dataset in Table~\ref{tab:trans_tasks}.
\ourmethods{} outperforms other methods by 1 BLEU score on average.
Although Switch-Transformer scale the model size, it still achieves a similar performance with Transformer-Base, which is parameter-efficient.
Table~\ref{tab:expert_number} shows the BLEU performance of different expert number on the English-German datasets. \ourmethods{} can still outperform the Switch-Transformer about 1.3 BLEU with the increasing number of experts. Because of the datasets' quality, the effect of increasing expert number is limited.
\textbf{Model-Efficency:} Table~\ref{tab:efficiency} show the model efficiency of \ourmethods{} and Switch Gate on the English-German datasets. \ourmethods{} is efficient at the speed of converge. For example, \ourmethods{} need only $75\%$ compute budget of Switch-Transformer to reach the same PPL. It is worth noting that the speedup over Switch-Transformer improves as the expert number increases.
\textbf{Ablation Study:}
We present a ablation study on \ourmethods{} to show the influence of two stages by removing the expert-diversify phase and the gate-sparsify phase respectively. Results are summarized in Table~\ref{tab:trans_tasks}~\ref{tab:expert_number}~\ref{tab:efficiency}.
As for the model performance metric, it will lead to performance degradation when \ourmethods{} removes the gate-sparsify stage, such as 38.3/39.2 in Fr-En of Table~\ref{tab:trans_tasks}.
Meanwhile, it is worth noting that influence is little as for w/ and w/o the expert-diversify stage, which encourages us to involve this stage for saving computation budget.
As for the FLOPs-efficiency metric, the gate-sparsify phase can improve the FLOPs-efficiency by $17\%$. By introducing the expert-diversify stage, \ourmethods{} can obtain an extra $4\%$ improvement.
In summary, the gate-sparsify phase can both improve the model performance and FLOPs-efficiency significantly and the expert-diversify phase can introduce extra FLOPs-efficiency without performance degradation. In the following sections, we will detail analyze the gate-sparsify phase and evaluate it at large scale.
\subsection{Breakdown on the Gate-Sparsify Phase}
\textbf{Model Architecture:} We pretrain the representative GPT model for the language modeling task, where we set GPT-ori with 24 decoder layers, hidden dimension as 1024 and number of attention heads as 16.
Every other FFN layer is replaced by in standard Transformer with the MoE layer (16 experts per layers) to construct the GPT-MoE model.
GPT-Switch represents training MoE models with Switch gate, which keeps Top-1 selection.
GPT-DTS represents training MoE models with the \texttt{dense-to-sparse} gate, which starts as a dense gate that routes tokens to most experts and then gradually becomes sparser.
We compare the required FLOPs to train models to show the FLOPs-efficiency of different methods.
The FLOPs-efficiency is defined as the best model performance (PPL) can be achieved given the fixed number of floating-point operations (computation budget).
Because the actual training time could be affected by the system engineering efforts on the implementation details, which are not our focus in this approach. Instead, in our experiments, we prefer to choose the computation complexity for fair comparisons.
\begin{figure*}[t]
\centering
\subfigure[More Experts]{
\includegraphics[width=0.33\textwidth]{Figures/expert_scalability_flops.pdf}
\label{fig:expert_scalability}
}
\subfigure[More MoE Layers]{
\includegraphics[width=0.33\textwidth]{Figures/moe_layer_scalability_flops.pdf}
\label{fig:moe_layer_scalability}
}
\caption{Scalability for DTS gate. It shows that more experts or more MoE-layers (larger models with constant FLOPs), will lead to better FLOPs-efficiency.
}
\label{fig:scalability}
\end{figure*}
\textbf{Model Performance:}
We pretrained each model on the OpenWebText dataset for 300k steps totally, 10k of which was the warm-up phase. For our \ourmethods{}, we scheduled the first 10k steps for annealing temperature from 2.0 to 0.3. We report the perplexity on the validation set. Results are shown in Figure~\ref{fig:end2end}.
To improve the computation efficiency, only part parameters are used for each token in sparse models with the cost of model performance.
DTS-Gate aims to shift the model training from dense to sparse, and keep the inference cost same as sparse models.
Experiments show that compared with the state-of-the-art Switch-Transformer in GPT-MoE model with OpenWebText dataset, GPT-DTS can obtain
2.0x speed-up to reach the same validation perplexity (Figure~\ref{fig:iters_ppl}), as well as higher FLOPs-efficiency of a 1.42x speed-up (Figure~\ref{fig:flops_ppl}).
Experiments also verify the ability of \texttt{dense-to-sparse} gate for scaling models with more experts or more MoE layers.
Comparison with Sparse Models.
MoE-Switch pre-defines its static Top-1 gating network and jointly training the gate and experts networks. Different from GPT-Switch, GPT-DTS utilizes temperature to adjust the distribution of the token-to-experts (one-hot or uniform) and threshold to remove computation of experts with low weights. \ourmethods{} performs better than GPT-Switch in sample-efficiency because of more experts involved in training and updates at the beginning, shown as Figure~\ref{fig:iters_ppl}. As for FLOPs-efficiency, DTS-Gate first involves more experts into warm-up training, which is poor FLOPs-efficency. But with the training going on, GPT-DTS can obtain greater than $25\%$ improvements in FLOPs-efficiency compared with the state-of-the-art Switch-Transformer in GPT-MoE model with OpenWebText dataset.
\subsection{Scalability}
In this subsection, we investigate different experiment settings to validate the scalability of our DTS-Gate.
\textbf{Model Architecture:} We choose the GPT-small as the backbone model for the language modeling task, where we set the model with 12 decoder layers, hidden dimension as 768 and number of attention heads as 12.
\textbf{Increase the Expert Number:} Based on GPT-Small model with 117M parameters, we replace the 7-th FFN layer by one MoE layer and vary its experts number within $\{1, 4, 8, 16\}$.
As shown by Figure~\ref{fig:expert_scalability}, with increasing expert numbers, \ourmethods{} keeps consistent improvements (i.e., lower PPL) during training.
\textbf{Increase the MoE layer number:} Similarly, we also vary the number of MoE layers to validate the performance of DTS gate.
We insert $k$ MoE layers in GPT-Small, where $k \in \{0, 1, 4, 6\}$ and each MoE layer contains 8 experts.
Figure~\ref{fig:moe_layer_scalability} shows that by increasing MoE layers, \ourmethods{} can achieve better model performance with same FLOPs.
\subsection{Effect of Sparsity Scheduler}
It is worth noting that several hyper-parameters are introduced in Dense-To-Sparse gate, such as max/min temperature and decay iterations.
In this section, we analyze the effect of different hyper-parameter setting by conducting experiments of various settings. The training model is GPT-MoE, 24-layer decoder with 12 MoE-layer (16 experts per layer) and the dataset is OpenWebText.
We decay temperature $\tau$ from $max\_value$ to $min\_value$ in the first 15000 iterations and switch to Top1 then. Experiments with different $max\_value$ to $min\_value$ are evaluated, and the results are shown in Figure~\ref{fig:scheduler}.
\begin{figure}[t]
\centering
\includegraphics[width=0.35\textwidth]{Figures/temperature_scheduler_flops.pdf}
\caption{Effect of different temperature scheduler.}
\label{fig:scheduler}
\end{figure}
\textbf{Max/Min Temperature} Under small temperatures, the weight distribution of experts is close to one-hot, which leads to the one-token-one-expert distribution and low training cost,
but the variance of gradients is large.
In contrast, large temperatures result in nearly uniform distribution gate weights,
which evolves more experts into training but the variance of gradients is small. As shown in Figure~\ref{fig:scheduler}, we find the these two hyper-parameters have low influence on the model quality under the same training budget, except for the extrame value, e.g., 1.0 for $max\_value$ and 0.1 for $min\_value$.
\begin{table}[t]
\caption{The most frequent tokens assigned to each expert in the validation set, which shows that some experts assignment decisions are made based on local contexts. For many other experts, the assignment decision depends on longer context, and is harder to visualize.}
\begin{center}
\begin{tabular}{c|ccccc|c}
\toprule
\textbf{Expert} & \multicolumn{5}{c|}{\textbf{Top5 Proceeding Tokens}} & \textbf{Descriptions} \\
\midrule
1 & is & was & be & are & have & auxiliary verbs \\
3 & .& \textbackslash n & /& (&; & punctuations \\
4 & in& , & of& and& from & prepositions \\
6 & and& I & it& that& they & possessive cases\\
12 & out& up & go& back& down & directional prepositions \\
\bottomrule
\end{tabular}
\end{center}
\label{tab:visual}
\end{table}
\subsection{Visualization of Expert Specialization}
We visualize the routing strategy of the pre-trained GPT model by \ourmethods{} in Table~\ref{tab:visual} through its corresponding input embedding, where each MoE layer contains 16 experts. For each expert, we present the Top5 proceeding tokens assigned and give descriptions for explanations from our points of view. For example, Expert 1 captures the auxiliary verbs and Expert 6 captures possessive cases. These experts can capture local contexts of each embedding well. For other experts, it is diff cult to visualize because of the long contexts' influence.
| {'timestamp': '2022-10-11T02:16:53', 'yymm': '2112', 'arxiv_id': '2112.14397', 'language': 'en', 'url': 'https://arxiv.org/abs/2112.14397'} | arxiv |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.